Datasets:
Add files using upload-large-folder tool
Browse files- md/train/1Jv6b0Zq3qi/1Jv6b0Zq3qi.md +338 -0
- md/train/2zCRcTafea/2zCRcTafea.md +267 -0
- md/train/30EvkP2aQLD/30EvkP2aQLD.md +611 -0
- md/train/3EwcMzmUbNd/3EwcMzmUbNd.md +356 -0
- md/train/5vShUEyjmm/5vShUEyjmm.md +389 -0
- md/train/7_eLEvFjCi3/7_eLEvFjCi3.md +318 -0
- md/train/8q_ca26L1fz/8q_ca26L1fz.md +346 -0
- md/train/B7v4QMR6Z9w/B7v4QMR6Z9w.md +0 -0
- md/train/BJInEZsTb/BJInEZsTb.md +396 -0
- md/train/BJLmN8xRW/BJLmN8xRW.md +169 -0
- md/train/BJlkgaNKvr/BJlkgaNKvr.md +0 -0
- md/train/BkV4VS9ll/BkV4VS9ll.md +599 -0
- md/train/BkeaEyBYDB/BkeaEyBYDB.md +234 -0
- md/train/D7bPRxNt_AP/D7bPRxNt_AP.md +292 -0
- md/train/Fo6S5-3Dx_/Fo6S5-3Dx_.md +329 -0
- md/train/GrB-y0SNkQ/GrB-y0SNkQ.md +636 -0
- md/train/H1eCw3EKvH/H1eCw3EKvH.md +354 -0
- md/train/H1gBsgBYwH/H1gBsgBYwH.md +0 -0
- md/train/H1xwNhCcYm/H1xwNhCcYm.md +382 -0
- md/train/HJ1kmv9xx/HJ1kmv9xx.md +333 -0
- md/train/HJxeWnCcF7/HJxeWnCcF7.md +526 -0
- md/train/HyGhN2A5tm/HyGhN2A5tm.md +383 -0
- md/train/Hyx6Bi0qYm/Hyx6Bi0qYm.md +188 -0
- md/train/Ig53hpHxS4/Ig53hpHxS4.md +374 -0
- md/train/QpU7n-6l0n/QpU7n-6l0n.md +317 -0
- md/train/RQfcckT1M_4/RQfcckT1M_4.md +289 -0
- md/train/RtNpzLdHUAW/RtNpzLdHUAW.md +324 -0
- md/train/S1eK3i09YQ/S1eK3i09YQ.md +680 -0
- md/train/S1lF8xHYwS/S1lF8xHYwS.md +360 -0
- md/train/SJlKrkSFPH/SJlKrkSFPH.md +0 -0
- md/train/SJx7Jrtgl/SJx7Jrtgl.md +255 -0
- md/train/SkgHtkrYPH/SkgHtkrYPH.md +261 -0
- md/train/SkxKPDv5xl/SkxKPDv5xl.md +265 -0
- md/train/Sy1f0e-R-/Sy1f0e-R-.md +310 -0
- md/train/UZgGf92u5N0/UZgGf92u5N0.md +457 -0
- md/train/VKVShLsAuZ/VKVShLsAuZ.md +222 -0
- md/train/VRgITLy0l2/VRgITLy0l2.md +349 -0
- md/train/WGWzwdjm8mS/WGWzwdjm8mS.md +0 -0
- md/train/XZDeL25T12l/XZDeL25T12l.md +374 -0
- md/train/YicbFdNTTy/YicbFdNTTy.md +422 -0
- md/train/dBE8OI8_ZOa/dBE8OI8_ZOa.md +269 -0
- md/train/m1CD7tPubNy/m1CD7tPubNy.md +692 -0
- md/train/r1eBeyHFDH/r1eBeyHFDH.md +0 -0
- md/train/r1efr3C9Ym/r1efr3C9Ym.md +305 -0
- md/train/rJfHoM-C-/rJfHoM-C-.md +283 -0
- md/train/rJiNwv9gg/rJiNwv9gg.md +308 -0
- md/train/rklB76EKPr/rklB76EKPr.md +741 -0
- md/train/rkxY-sl0W/rkxY-sl0W.md +361 -0
- md/train/uDeDDoFOEpj/uDeDDoFOEpj.md +0 -0
- md/train/zI38PZQHWKj/zI38PZQHWKj.md +691 -0
md/train/1Jv6b0Zq3qi/1Jv6b0Zq3qi.md
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNCERTAINTY IN GRADIENT BOOSTING VIA ENSEMBLES
|
| 2 |
+
|
| 3 |
+
Andrey Malinin∗
|
| 4 |
+
Yandex; HSE University
|
| 5 |
+
Moscow, Russia
|
| 6 |
+
am969@yandex-team.ru Liudmila Prokhorenkova∗
|
| 7 |
+
Yandex; HSE University;
|
| 8 |
+
Moscow Institute of Physics and Technology Moscow, Russia
|
| 9 |
+
ostroumova-la@yandex-team.ru
|
| 10 |
+
|
| 11 |
+
# Aleksei Ustimenko∗
|
| 12 |
+
|
| 13 |
+
Yandex
|
| 14 |
+
Moscow, Russia
|
| 15 |
+
austimenko@yandex-team.ru
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
For many practical, high-risk applications, it is essential to quantify uncertainty in a model’s predictions to avoid costly mistakes. While predictive uncertainty is widely studied for neural networks, the topic seems to be under-explored for models based on gradient boosting. However, gradient boosting often achieves stateof-the-art results on tabular data. This work examines a probabilistic ensemblebased framework for deriving uncertainty estimates in the predictions of gradient boosting classification and regression models. We conducted experiments on a range of synthetic and real datasets and investigated the applicability of ensemble approaches to gradient boosting models that are themselves ensembles of decision trees. Our analysis shows that ensembles of gradient boosting models successfully detect anomalous inputs while having limited ability to improve the predicted total uncertainty. Importantly, we also propose a concept of a virtual ensemble to get the benefits of an ensemble via only one gradient boosting model, which significantly reduces complexity.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
Gradient boosting (Friedman, 2001) is a widely used machine learning algorithm that achieves stateof-the-art results on tasks containing heterogeneous features, complex dependencies, and noisy data: web search, recommendation systems, weather forecasting, and many others (Burges, 2010; Caruana & Niculescu-Mizil, 2006; Richardson et al., 2007; Roe et al., 2005; Wu et al., 2010; Zhang & Haghani, 2015). Gradient boosting based on decision trees (GBDT) underlies such well-known libraries like XGBoost, LightGBM, and CatBoost. In this paper, we investigate the estimation of predictive uncertainty in GBDT models. Uncertainty estimation is crucial for avoiding costly mistakes in high-risk applications, such as autonomous driving, medical diagnostics, and financial forecasting. For example, in self-driving cars, it is necessary to know when the AI-pilot is confident in its ability to drive and when it is not to avoid a fatal collision. In financial forecasting and medical diagnostics, mistakes on the part of an AI forecasting or diagnostic system could either lead to large financial or reputational loss or to the loss of life. Crucially, both financial and medical data are often represented in heterogeneous tabular form — data on which GBDTs are typically applied, highlighting the relevance of our work on obtaining uncertainty estimates for GBDT models.
|
| 24 |
+
|
| 25 |
+
Approximate Bayesian approaches for uncertainty estimation have been extensively studied for neural network models (Gal, 2016; Malinin, 2019). Bayesian methods for tree-based models (Chipman et al., 2010; Linero, 2017) have also been widely studied in the literature. However, this research did not explicitly focus on studying uncertainty estimation and its applications. Some related work was done by Coulston et al. (2016); Shaker & Hüllermeier (2020), who examined quantifying predictive uncertainty for random forests. However, the area has been otherwise relatively under-explored, especially for GBDT models that are widely used in practice and known to outperform other approaches based on tree ensembles.
|
| 26 |
+
|
| 27 |
+
While for classification problems GDBT models already return a distribution over class labels, for regression tasks they typically yield only point predictions. Recently, this problem was addressed in the NGBoost algorithm (Duan et al., 2020), where a GBDT model is trained to return the mean and variance of a normal distribution over the target variable $y$ for a given feature vector. However, such models only capture data uncertainty (Gal, 2016; Malinin, 2019), also known as aleatoric uncertainty, which arises due to inherent class overlap or noise in the data. However, this does not quantify uncertainty due to the model’s inherent lack of knowledge about inputs from regions either far from the training data or sparsely covered by it, known as knowledge uncertainty, or epistemic uncertainty (Gal, 2016; Malinin, 2019). One class of approaches for capturing knowledge uncertainty are Bayesian ensemble methods, which have recently become popular for estimating predictive uncertainty in neural networks (Depeweg et al., 2017; Gal & Ghahramani, 2016; Kendall et al., 2018; Lakshminarayanan et al., 2017; Maddox et al., 2019; Smith & Gal, 2018). A key feature of ensemble approaches is that they allow overall uncertainty to be decomposed into data uncertainty and knowledge uncertainty within an interpretable probabilistic framework (Depeweg et al., 2017; Gal, 2016; Malinin, 2019). Ensembles are also known to yield improvements in predictive performance.
|
| 28 |
+
|
| 29 |
+
This work examines ensemble-based uncertainty-estimation for GBDT models. The contributions are as follows. First, we consider generating ensembles using both classical Stochastic Gradient Boosting (SGB) as well as the recently proposed Stochastic Gradient Langevin Boosting (SGLB) (Ustimenko & Prokhorenkova, 2020). Importantly, SGLB allows us to guarantee that the models are asymptotically sampled from a true Bayesian posterior. Second, we show that using SGLB we can construct a virtual ensemble using only one gradient boosting model, significantly reducing the computational complexity. Third, to understand the attributes of using ensembles-based uncertainty estimation in GBDT models, we conduct extensive analysis on several synthetic datasets. Finally, we evaluate the proposed approach on a range of real regression and classification datasets. Our results show that this approach successfully enables the detection of anomalous out-of-domain inputs. Importantly, our solution is easy to combine with any implementation of GBDT. Our methods have been implemented within the open-source CatBoost library. The code of our experiments is publicly available at https://github.com/yandex-research/GBDT-uncertainty.
|
| 30 |
+
|
| 31 |
+
# 2 PRELIMINARIES
|
| 32 |
+
|
| 33 |
+
Uncertainty Estimation via Bayesian Ensembles In this work we consider uncertainty estimation within the standard Bayesian ensemble-based framework (Gal, 2016; Malinin, 2019). Here, model parameters $\pmb { \theta }$ are considered random variables and a prior $\mathtt { p } ( \pmb \theta )$ is placed over them to compute a posterior $\mathtt { p } ( \pmb { \theta } | \mathcal { D } )$ via Bayes’ rule:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathtt { p } ( \pmb { \theta } | \mathcal { D } ) = \frac { \mathtt { p } ( \mathcal { D } | \pmb { \theta } ) \mathtt { p } ( \pmb { \theta } ) } { \mathtt { p } ( \mathcal { D } ) } .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\mathcal { D } = \{ \pmb { x } ^ { ( i ) } , y ^ { ( i ) } \} _ { i = 1 } ^ { N }$ is the training dataset. Each set of parameters can be considered a hypothesis or explanation about how the world works. Samples from the posterior should yield explanations consistent with the observations of the world contained within the training data $\mathcal { D }$ . However, on data far from $\mathcal { D }$ each set of parameters can yield different predictions. Therefore, estimates of knowledge uncertainty can be obtained by examining the diversity of predictions.
|
| 40 |
+
|
| 41 |
+
Consider an ensemble of probabilistic models $\{ \mathsf { P } ( y | \pmb { x } ; \pmb { \theta } ^ { ( m ) } ) \} _ { m = 1 } ^ { M }$ sampled from the posterior $\mathtt { p } ( \pmb { \theta } | \mathcal { D } )$ . Each model $\mathsf { P } ( y | \pmb { x } , \pmb { \theta } ^ { ( m ) } )$ yields a different estimate of data uncertainty, represented by the entropy of its predictive distribution (Malinin, 2019). Uncertainty in predictions due to knowledge uncertainty is expressed as the level of spread, or “disagreement”, of models in the ensemble (Malinin, 2019). Note that exact Bayesian inference is often intractable, and it is common to consider either an explicit or implicit approximation ${ \mathfrak { q } } ( \theta )$ to the true posterior ${ \tt p } ( \pmb \theta | \mathcal { D } )$ . While a range of approximations has been explored for neural network models (Gal & Ghahramani, 2016; Lakshminarayanan et al., 2017; Maddox et al., 2019)1, to the best of our knowledge, limited work has explored Bayesian inference for gradient-boosted trees. Given ${ \tt p } ( \pmb \theta | \mathcal { D } )$ , the predictive posterior of the ensemble is obtained by taking the expectation with respect to the models in the ensemble:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathbb { P } \big ( \boldsymbol { y } | \boldsymbol { x } , \mathcal { D } \big ) = \mathbb { E } _ { \mathbb { P } ^ { ( \theta | \mathcal { D } ) } } \big [ \mathbb { P } \big ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } \big ) \big ] \approx \ \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \mathbb { P } \big ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ^ { ( m ) } \big ) , \ \boldsymbol { \theta } ^ { ( m ) } \sim \mathbb { p } ( \boldsymbol { \theta } | \mathcal { D } ) .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
The entropy of the predictive posterior estimates total uncertainty in predictions:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r } { \mathcal { H } \big [ \mathrm { P } ( y | x , \mathcal { D } ) \big ] = \mathbb { E } _ { \mathrm { P } ( y | x , \mathcal { D } ) } \big [ - \ln \mathrm { P } ( y | x , \mathcal { D } ) \big ] . } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Total uncertainty is due to both data uncertainty and knowledge uncertainty. However, in applications like active learning (Kirsch et al., 2019) and out-of-domain detection it is desirable to estimate knowledge uncertainty separately. The sources of uncertainty can be decomposed by considering the mutual information between the parameters $\pmb \theta$ and the prediction $y$ (Depeweg et al., 2017):
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l r } { { \underbrace { \underline { { \mathcal { L } \big [ \boldsymbol { y } , \boldsymbol { \theta } | \boldsymbol { x } , \mathcal { D } \big ] } } } _ { \mathrm { K n o w l e d g e ~ U n c e r t a i n t y } } = \underbrace { \mathcal { H } \big [ \mathtt { P } ( \boldsymbol { y } | \boldsymbol { x } , \mathcal { D } ) \big ] } _ { \mathrm { T o t a l ~ U n c e r t a i n t y } } - \underbrace { \mathbb { E } _ { \mathtt { P } ( \boldsymbol { \theta } | \mathcal { D } ) } \big [ \mathcal { H } \big [ \mathtt { P } ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ) \big ] \big ] } _ { \mathrm { E x p e c t e d ~ D a t a ~ U n c e r t a i n t y } } } } \\ & { } & { \approx \mathcal { H } \big [ \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \mathtt { P } ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ^ { ( m ) } ) \big ] - \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \mathcal { H } \big [ \mathtt { P } ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ^ { ( m ) } ) \big ] . } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
This is expressed as the difference between the entropy of the predictive posterior, a measure of total uncertainty, and the expected entropy of each model in the ensemble, a measure of expected data uncertainty. Their difference is a measure of ensemble diversity and estimates knowledge uncertainty.
|
| 60 |
+
|
| 61 |
+
Unfortunately, when considering ensembles of probabilistic regression models $\{ \mathsf { p } ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ^ { ( m ) } ) \} _ { m = 1 } ^ { M }$ over continuous-valued target $y \in \mathbb { R }$ , it is no longer possible to obtain tractable estimates of the (differential) entropy of the predictive posterior, and, by extension, mutual information. In this cases uncertainty estimates can instead derived via the law of total variation:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\underbrace { \mathbb { V } _ { \mathtt { p } ( y | x , \mathcal { D } ) } [ y ] } _ { \mathrm { T o t a l ~ U n c e r t a i n t y } } = \underbrace { \mathbb { V } _ { \mathtt { p } ( \theta | \mathcal { D } ) } \left[ \mathbb { E } _ { \mathtt { p } ( y | x , \theta ) } [ y ] \right] } _ { \mathrm { K n o w l e d g e ~ U n c e r t a i n t y } } + \underbrace { \mathbb { E } _ { \mathtt { p } ( \theta | \mathcal { D } ) } \left[ \mathbb { V } _ { \mathtt { p } ( y | x , \theta ) } [ y ] \right] } _ { \mathrm { E x p e c t e d ~ D a t a ~ U n c e r t a i n t y } } .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
This is conceptually similar to the decomposition (4) obtained via mutual information. For an ensemble of probabilistic regression models which parameterize the normal distribution, and where each models yields a mean and standard-deviation, the total variance can be computed as follows:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\underbrace { \mathbb { V } _ { \mathrm { p } ( y | \mathbf { x } , \mathcal { D } ) } [ y ] } _ { \mathrm { T r a t a l } \Pi _ { \mathrm { m e a r i a n t y } } } \approx \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \Big [ \Big ( \sum _ { m = 1 } ^ { M } \frac { \mu _ { m } } { M } \Big ) - \mu _ { m } \Big ] ^ { 2 } + \quad \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \sigma _ { m } ^ { 2 } \quad , \ \{ \mu _ { m } , \sigma _ { m } \} = f ( \mathbf { x } ; \theta ^ { ( m ) } ) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
However, while these measures are tractable, they are based on only first and second moments, and may therefore miss high-order details in the uncertainty. They are also not scale-invariant, which can cause issues is the scale of prediction on in-domain and out-of-domain data is very different.
|
| 74 |
+
|
| 75 |
+
Gradient boosting is a powerful machine learning technique especially useful on tasks containing heterogeneous features. It iteratively combines weak models, such as decision trees, to obtain more accurate predictions. Formally, given a dataset $\mathcal { D }$ and a loss function $L : \mathbb { R } ^ { 2 } \to \mathbb { R }$ , the gradient boosting algorithm (Friedman, 2001) iteratively constructs a model $F : X \mathbb { R }$ to minimize the empirical risk $\mathcal { L } ( F | \mathcal { D } ) = \mathbb { E } _ { \mathcal { D } } [ L ( F ( \pmb { x } ) , y ) ]$ . At each iteration $t$ the model is updated as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
{ \cal F } ^ { ( t ) } ( { \pmb x } ) = { \cal F } ^ { ( t - 1 ) } ( { \pmb x } ) + \epsilon h ^ { ( t ) } ( { \pmb x } ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $F ^ { ( t - 1 ) }$ is a model constructed at the previous iteration, $h ^ { ( t ) } ( { \pmb x } ) \in \mathcal { H }$ is a weak learner chosen from some family of functionds $\mathcal { H }$ , and $\epsilon$ is learning rate. The weak learner $h ^ { ( t ) }$ is usually chosen to approximate the negative gradient $\begin{array} { r } { - g ^ { ( t ) } ( \pmb { x } , y ) : = - \frac { \partial L ( y , s ) } { \partial s } \big | _ { s = F ^ { ( t - 1 ) } ( \pmb { x } ) } } \end{array}$ :
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\boldsymbol { h } ^ { ( t ) } = \underset { \boldsymbol { h } \in \mathcal { H } } { \arg \operatorname* { m i n } } \mathbb { E } _ { \mathcal { D } } \big [ \big ( - \boldsymbol { g } ^ { ( t ) } ( \boldsymbol { x } , \boldsymbol { y } ) - \boldsymbol { h } ( \boldsymbol { x } ) \big ) ^ { 2 } \big ] .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
A weak learner $h ^ { ( t ) }$ is associated with parameters $\phi ^ { ( t ) } \in \mathbb { R } ^ { d }$ . We write $h ^ { ( t ) } ( { \pmb x } , \phi ^ { ( t ) } )$ to reflect this
|
| 88 |
+
dependence. The set of weak learners $\mathcal { H }$ often consists of shallow decision trees, which are models
|
| 89 |
+
that recursively partition the feature space into disjoint regions called leaves. Each leaf $R _ { j }$ of the
|
| 90 |
+
tree iwrite estimated response , so the decision tre $y$ in the correspondings a linear function of n. We c. The fin $\begin{array} { r } { h ( \pmb { x } , \phi ^ { ( t ) } ) = \sum _ { j = 1 } ^ { d } \phi _ { j } ^ { ( t ) } \mathbf { 1 } _ { \{ \pmb { x } \in R _ { j } \} } } \end{array}$ $\phi ^ { ( t ) }$ $F$ $\pmb \theta$
|
| 91 |
+
|
| 92 |
+
For classification tasks, a model yields estimates data uncertainty if it is trained via negative loglikelihood and provides a distribution over class labels. However, classic GBDT regression models yield point predictions, and there has been little research devoted to estimating predictive uncertainty. Recently, this issue was addressed by Duan et al. (2020) via an algorithm called NGBoost (Natural Gradient Boosting), which allows estimating data uncertainty. NGBoost simultaneously estimates the parameters of a conditional distribution $\mathtt { p } ( y | \pmb { x } , \pmb { \theta } )$ over the target $y$ given the features $_ { \textbf { \em x } }$ , by optimizing a proper scoring rule. Typically, a normal distribution over $y$ is assumed and negative log-likelihood is taken as a scoring rule. Formally, given an input $_ { \textbf { \em x } }$ , the model $F$ predicts two parameters of normal distribution - the mean $\mu$ and the logarithm of the standard deviation $\log \sigma$ The loss function is the expected negative log-likelihood:2
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathrm { p } ( \boldsymbol { y } | \mathbf { \boldsymbol { x } } , \pmb { \theta } ^ { ( t ) } ) = \mathcal { N } ( \boldsymbol { y } | \mu ^ { ( t ) } , \boldsymbol { \sigma } ^ { ( t ) } ) , \quad \{ \mu ^ { ( t ) } , \log \sigma ^ { ( t ) } \} = F ^ { ( t ) } ( \pmb { x } ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathcal { L } ( \pmb { \theta } | \mathcal { D } ) = \mathbb { E } _ { \mathcal { D } } [ - \log \mathbb { p } ( \pmb { y } | \pmb { x } , \pmb { \theta } ) ] = - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \mathbb { p } ( \pmb { y } ^ { ( i ) } | \pmb { x } ^ { ( i ) } , \pmb { \theta } ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Note that $\pmb \theta$ denotes the concatenation of two parameter vectors used to predict $\mu$ and $\log \sigma$ .
|
| 103 |
+
|
| 104 |
+
# 3 GENERATING ENSEMBLES OF GDBT MODELS
|
| 105 |
+
|
| 106 |
+
As discussed in Section 2, knowledge uncertainty can be estimated by considering an ensemble of models $\{ \mathsf { p } ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ^ { ( m ) } ) \} _ { m = 1 } ^ { M }$ sampled from the posterior ${ \tt p } ( \pmb \theta | \mathcal { D } )$ . The level of diversity or “disagreement” between the models is an estimate of knowledge uncertainty. In this section, we consider three approaches to generating an ensemble of GBDT models. We emphasize that this section discusses ensembles of GBDT models, where a each GBDT model is itself an ensemble of trees.
|
| 107 |
+
|
| 108 |
+
SGB ensembles One way to generate an ensemble is to consider several independent models generated via Stochastic Gradient Boosting (SGB). Stochasticity is added to GBDT models via random subsampling of the data at every iteration (Friedman, 2002). Specifically, at each iteration of (8) we select a subset of training objects $\mathcal { D } ^ { \prime }$ (via bootstrap or uniformly without replacement), which is smaller than the original training dataset $\mathcal { D }$ , and use $\mathcal { D } ^ { \prime }$ to fit the next tree instead of $\mathcal { D }$ . The fraction of chosen objects is called sample rate. This implicitly injects noise into the learning process, effectively inducing a distribution ${ \mathfrak { q } } ( \theta )$ over such models. Thus, an SGB ensemble is an ensemble of independent models $\{ \pmb { \theta } ^ { ( m ) } \} _ { m = 1 } ^ { M }$ built according to SGB with different random seeds for subsampling data. Unfortunately, there are no guarantees on how well the distribution ${ \mathfrak { q } } ( \theta )$ estimates the true posterior $\mathtt { p } ( \pmb { \theta } | \mathcal { D } )$ .
|
| 109 |
+
|
| 110 |
+
SGLB ensembles Remarkably, there is a way to sample GBDT models from the true posterior $\mathtt { p } ( \pmb { \theta } | \mathcal { D } )$ via a recently proposed Stochastic Gradient Langevin Boosting (SGLB) algorithm (Ustimenko $\&$ Prokhorenkova, 2020). SGLB combines gradient boosting with stochastic gradient Langevin dynamics (Raginsky et al., 2017) in order to achieve convergence to the global optimum even for non-convex loss functions. The algorithm has two differences compared with SGB. First, Gaussian noise is explicitly injected into the gradients, so (8) is replaced by:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
h ^ { ( t ) } = \underset { h \in \mathcal { H } } { \mathrm { a r g } \mathrm { m i n } } \mathbb { E } _ { \mathcal { D } } \left[ \left( - g ^ { ( t ) } ( \pmb { x } , y ) - h ( \pmb { x } , \phi ) + \nu \right) ^ { 2 } \right] , \nu \sim \mathcal { N } \left( 0 , \frac { 2 } { \beta \epsilon } I _ { | \mathcal { D } | } \right) ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\beta$ is the inverse diffusion temperature and $I _ { | \mathcal { D } | }$ is an identity matrix. This random noise $\nu$ helps to explore the solution space in order to find the global optimum and the diffusion temperature controls the level of exploration. Second, the update (7) is modified as:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
F ^ { ( t ) } ( { \pmb x } ) = ( 1 - \gamma \epsilon ) F ^ { ( t - 1 ) } ( { \pmb x } ) + \epsilon h ^ { ( t ) } ( { \pmb x } , { \phi } ^ { ( t ) } ) ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 1: Virtual ensemble
|
| 124 |
+
|
| 125 |
+
where $\gamma$ is regularization parameter. If the number of all possible trees is finite (a natural assumption given that the training dataset is finite), then the SGLB parameters ${ \pmb \theta } ^ { ( t ) }$ at each iteration form a Markov chain that weakly converges to the stationary distribution, also called the invariant measure:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
p _ { \beta } ^ { * } ( \pmb { \theta } ) \propto \exp ( - \beta \mathcal { L } ( \pmb { \theta } | \mathcal { D } ) - \beta \gamma \| \Gamma \pmb { \theta } \| _ { 2 } ^ { 2 } ) ,
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
where $\Gamma = \Gamma ^ { T } > 0$ is an implicitly defined regularization matrix which depends on a particular tree construction algorithm (Ustimenko & Prokhorenkova, 2020).
|
| 132 |
+
|
| 133 |
+
While Ustimenko & Prokhorenkova (2020) used the weak convergence to (13) to prove the global convergence, we apply this to enable sampling from the true posterior. For this purpose, we set $\beta = | \mathcal { D } |$ and $\begin{array} { r } { \gamma = \frac { \hat { \mathrm { ~ T ~ } } } { 2 \left| \mathcal { D } \right| } } \end{array}$ . For the negative log-likelihood loss function (10) the invariant measure (13) can be expressed as:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
p _ { \beta } ^ { * } ( \pmb { \theta } ) \propto \exp \left( \log \mathbb { p } ( \mathcal { D } | \pmb { \theta } ) - \frac { 1 } { 2 } \| \Gamma \pmb { \theta } \| _ { 2 } ^ { 2 } \right) \propto \mathrm { p } ( \mathcal { D } | \pmb { \theta } ) \mathrm { p } ( \pmb { \theta } ) ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
which is proportional to the true posterior distribution ${ \tt p } ( \pmb \theta | \mathcal { D } )$ under Gaussian prior $\mathsf { p } ( \theta ) = \mathcal { N } ( 0 , \Gamma )$ . Thus, an SGLB ensemble is an ensemble of independent models $\{ \pmb { \theta } ^ { ( m ) } \} _ { m = 1 } ^ { M }$ generated according to the SGLB algorithm using different random seeds. In this case, asymptotically, models are sampled from the true posterior ${ \tt p } ( \pmb \theta | \mathcal { D } )$ .
|
| 140 |
+
|
| 141 |
+
Virtual SGLB ensembles While SGB and SGLB yield ensembles of independent models, their time and space complexity is $M$ times larger than that of a single model, which is a significant overhead. Consequently, generating an ensemble requires either significantly increasing complexity or sacrificing the quality by reducing the number of training iterations. To address this, we introduce the concept of a virtual ensemble that enables generating an ensemble using only one model. This is possible since a GBDT model is itself an ensemble of trees. However, in contrast to random forests formed by independent trees (Shaker & Hüllermeier, 2020), the sequential nature of GBDT models implies that all trees are dependent and individual trees cannot be considered as separate models. Hence, we use “truncated” sub-models of a single GBDT model as elements of an ensemble, as illustrated in Figure 1. Notably, a virtual ensemble can be obtained using any already constructed GBDT model. Below we formally describe this procedure applied to SGLB models since in this case we can guarantee asymptotically sampling from the true posterior ${ \tt p } ( \pmb \theta | \mathcal { D } )$ .
|
| 142 |
+
|
| 143 |
+
Each “truncated” model is described by the vector of parameters $\pmb \theta ^ { ( t ) }$ . As the parameters ${ \pmb \theta } ^ { ( t ) }$ at each iteration of the SGLB algorithm form a Markov chain that weakly convergences to the stationary distribution (14), we can consider using them as an ensemble of models. However, unlike parameters taken from different SGLB trajectories, these will have a high degree of correlation, which adversely affects the ensemble’s quality. This problem can be overcome by retaining only every $K$ -th set of parameters. Formally, fix $K \geq 1$ and consider a set of models $\begin{array} { r } { \Theta _ { T , K } = \{ \pmb { \theta } ^ { ( K t ) } , \left[ \frac { T } { 2 K } \right] \leq t \leq \left[ \frac { T } { K } \right] \} } \end{array}$ i.e., we add to $\Theta _ { T , K }$ every $K$ -th model obtained while constructing one SGLB model using $T$ iterations of gradient boosting. Choosing larger values of $K$ allows us to reduce the correlation between samples from the SGLB Markov chain. Furthermore, we do not include to the ensemble the models $\bar { \pmb { \theta } ( t ) }$ with $t < T / 2$ as (14) holds only asymptotically. The set of $\begin{array} { r } { M \ : = \ : \left[ \frac { T } { 2 K } \right] } \end{array}$ models $\Theta _ { T , K }$ is called a virtual ensemble. Note that virtual ensembles behave similarly to true ensembles in the limit (for large $K$ and $T$ ).
|
| 144 |
+
|
| 145 |
+
Importantly, we can compute the prediction of $\Theta _ { T , K }$ with the same computation time as one ${ \pmb \theta } ^ { ( T ) }$ Indeed, when computing the prediction of one model, we have to sum up the predictions made by individual trees. To get the virtual ensemble, we only have to store the partial sums. For SGLB, we also have to account for regularization (12). Formally, according to (12), for SGLB we have $\begin{array} { r } { \pmb { \theta } ^ { ( T ) } = \sum _ { i = 1 } ^ { T } \epsilon ( 1 - \gamma \epsilon ) ^ { T - i } \pmb { \phi } ^ { ( i ) } } \end{array}$ , where $( 1 - \gamma \epsilon ) ^ { T - i }$ appears due to shrinkage. While computing ${ \pmb \theta } ^ { ( T ) }$ i=1 we store the partial sums $\begin{array} { r } { \pmb { \theta } _ { \leq t } ^ { ( T ) } = \sum _ { i = 1 } ^ { t } \epsilon ( 1 - \gamma \epsilon ) ^ { T - i } \pmb { \phi } ^ { ( i ) } } \end{array}$ . Then, any model $\pmb \theta ^ { ( t ) }$ from $\Theta _ { T , K }$ can easily be obtained from the stored values:
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 2: Uncertainty for synthetic regression dataset with two categorical features. Inside the heart (white region on the first figure) there are no training examples.
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\pmb \theta ^ { ( t ) } = \sum _ { i = 1 } ^ { t } \epsilon ( 1 - \gamma \epsilon ) ^ { t - i } \pmb \phi ^ { ( i ) } = ( 1 - \gamma \epsilon ) ^ { t - T } \pmb \theta _ { \leq t } ^ { ( T ) } .
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
# 4 ANALYSIS ON SYNTHETIC DATA
|
| 155 |
+
|
| 156 |
+
In this section, we analyze how ensemble algorithms discussed in Section 3 perform on synthetic data. The aim is to understand the attributes of ensembles of GBDT models for estimating data and knowledge uncertainty in a controllable setting.
|
| 157 |
+
|
| 158 |
+
GBDT models are usually applied to tabular data, where features are often categorical. Hence, we first generate a dataset with each example described by two categorical features $x _ { 1 } , x _ { 2 }$ with 9 values each, resulting in 81 possible combinations. The target depends on the features as $y = a ( x _ { 1 } , x _ { 2 } ) + \varepsilon ( x _ { 1 } , \stackrel { \_ } { x } _ { 2 } )$ , where $\varepsilon ( x _ { 1 } , x _ { 2 } ) \sim \mathcal { N } ( 0 , b ( x _ { 1 } , x _ { 2 } ) )$ and $a ( \overset { \cdot } { x _ { 1 } } , x _ { 2 } ) , b ( \overset { \cdot } { x } _ { 1 } , \overset { \cdot } { x } _ { 2 } )$ are some deterministic functions. The values for $a ( x _ { 1 } , x _ { 2 } )$ are randomly generated according to the uniform distribution over $[ 0 , 1 ]$ . The values for $b ( x _ { 1 } , x _ { 2 } )$ are shown on Figure 2(a). We generate a heartshaped dataset with this distribution: inside the heart (white region on Figure 2(a)) there are no training points, for the other cells we have 1000 examples per cell.
|
| 159 |
+
|
| 160 |
+
We train an ensemble of 10 SGLB models (each model consists of 1000 trees) and observe the following effects. First, Figure 2(b) shows the total uncertainty estimated with SGLB ensemble and we see that the models correctly capture this uncertainty in all cells containing training examples. At the same time, arbitrary values can be predicted inside the heart, as no training data constrain the models’ behavior there. Second, Figure 2(c) shows that estimates of knowledge uncertainty allow us to detect regions that are out-of-domain and are not covered by the training data. Notably, the separation is perfect, as there is no trace of the original heart border.
|
| 161 |
+
|
| 162 |
+
To further analyze ensembles of GBDT models, we apply them to a two-dimensional classification task with continuous-valued features. We consider a 3-class spiral dataset shown on Figure 3(a); and this setting is much harder for gradient boosted trees.3 Figure 3(b) shows the total uncertainty estimated with SGLB ensemble, while Figure 3(c) demonstrates knowledge uncertainty. We observe several effects. First, total uncertainty correctly detects class boundaries and ‘sectors’ of input space outside the training dataset. Second, looking at these ‘sectors’ of high uncertainty, we can better understand how GBDT ensembles work: as decision trees are discriminative functions (Bishop, 2006), if features have values outside the training domain, then the prediction is the same as for the “closest” elements in the dataset. In other words, the models’ behavior on the boundary of the dataset is further extended to the outer regions. Third, estimates of knowledge uncertainty allow discrimination between out-of-domain regions and class boundaries. However, we still can see traces of the class boundaries in Figure 3(c). A possible reason is the fact that for real-valued features, near the class borders, the splitting values may vary across all models in the ensemble, resulting in nonzero estimates of knowledge uncertainty due to decision-boundary ‘jitter’.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 3: Uncertainty for synthetic classification dataset
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 4: Comparison of SGLB and vSGLB knowledge uncertainty estimates
|
| 169 |
+
|
| 170 |
+
On both “heart” and “spiral” datasets, we observed that the absolute values of knowledge uncertainty are much smaller than of data uncertainty and therefore contribute very little to total uncertainty. Thus, we expect that while knowledge uncertainty is especially useful for detecting anomalous inputs, the proposed approaches will contribute little to error detection on top of estimates of data uncertainty provided by single models.
|
| 171 |
+
|
| 172 |
+
Finally, on Figure 4, we compare the performance of ‘true’ SGLB ensembles with the virtual SGLB ensembles (vSGBL) on both the “heart” and “spiral” datasets. The virtual ensemble is ten times cheaper to train and infer, but the ensemble members are strongly correlated. We observe that on the “heart” dataset, vSGLB perfectly detects regions not covered by training data. However, the absolute values of knowledge uncertainty are much smaller than for SGLB, which can be explained by the correlations. The “spiral” dataset is more challenging for both SGLB and vSGLB. While having qualitatively similar behavior, virtual ensembles struggle to detect out-of-domain regions and separate them from class boundaries. In all cases, the absolute values of knowledge uncertainty are far lower than for ‘true’ SGLB ensembles. This shows that while vSGLB yields very cheap estimates of knowledge uncertainty by exploiting the ‘ensemble of trees’ structure of GBDT models, the quality of these estimates is inferior to ensembles of independent models.
|
| 173 |
+
|
| 174 |
+
# 5 EXPERIMENTS ON CLASSIFICATION AND REGRESSION DATASETS
|
| 175 |
+
|
| 176 |
+
In this section, we evaluate the performance of ensembles of GBDT models on a range of classification and regression tasks, focusing on their ability to detect errors and out-of-domain inputs.
|
| 177 |
+
|
| 178 |
+
Experimental setup Our implementation of all GBDT models is based on the CatBoost library that is known to achieve state-of-the-art results in a variety of tasks (Prokhorenkova et al., 2018). Classification models yield a probability distribution over binary class labels, while regression models yield the mean and variance of the normal distribution, as discussed in Section 2. All models are trained by optimizing the negative log-likelihood.4 We consider SGB and SGBL single models as the baselines and examine all ensemble methods defined in Section 3. Ensembles of SGB and SGLB models consist of 10 independent (with different seeds) models with 1000 trees each. The virtual ensemble vSGLB is obtained from one model with 1000 trees, where each 50th model from the interval [501, 1000] is added to the ensemble. Thus, vSGLB has the same computational and space complexity as just one SGB or SGLB model. Hyper-parameters are tuned by grid search, for details see Appendix A.2.
|
| 179 |
+
|
| 180 |
+
We compare the algorithms on several classification and regression tasks (Gal & Ghahramani, 2016;
|
| 181 |
+
Prokhorenkova et al., 2018), the description of which is available in Appendix A.3.
|
| 182 |
+
|
| 183 |
+
While not being the focus of the current research, Random Forest (RF) models are naturally suitable for ensemble approaches. Hence, we conduct additional experiments and analyze the performance of ensemble approaches applied to RF models in Appendix C.
|
| 184 |
+
|
| 185 |
+
Detection of errors and anomalous inputs We analyze whether measures of total and knowledge uncertainty can be used to detect errors and out-of-domain inputs. Error detection can be evaluated via the Prediction-Rejection Ratio (PRR) (Malinin, 2019; Malinin et al., 2020), which measures how well uncertainty estimates correlate with errors and rank-order them. The best value is 100, random is 0. Out-of-domain (OOD) detection is assessed via area under the ROC curve (AUCROC) (Hendrycks & Gimpel, 2016). For OOD detection, we need an OOD test-set. However, obtaining ‘real’ OOD examples for the datasets considered in this work is challenging, so we instead create synthetic OOD data as follows. For each dataset, we take its test set as the in-domain examples and sample an OOD dataset of the same size from the Year MSD dataset to get out-of-domain (OOD) data. The only exceptions are KDD datasets (Appetency, Churn, Upselling) and Year MSD, for which we sample OOD data from the Relative location of CT slices on axial axis Data Set (Graf et al., 2011). All numerical features in OOD data are normalized by the per-column mean and variance obtained on the in-domain training data. For categorical features, we sample a random category uniformly at random from the set of all feature’s categories. Total and knowledge uncertainty are estimated via entropy of the predictive posterior (3) and mutual information (4) for classification models and via total variance and variance of the mean (5) for regression ones.
|
| 186 |
+
|
| 187 |
+
Test errors can occur due to both noise and lack of knowledge, so we expect that ranking elements by total uncertainty would give better values of PRR. Table 1 shows that measures of total uncertainty consistently yield better PPR results across all datasets. This is consistent with results obtained for ensembles of neural network models (Lakshminarayanan et al., 2017; Malinin, 2019; Malinin & Gales, 2019; Malinin et al., 2020). However, ensembles do not outperform single models. We believe this occurs for two reasons. First, due to the additive nature of boosting, GDBT models are already ensembles. Second, as we have discussed in Section 4, for GBDT models, estimates of knowledge uncertainty obtained via the approaches considered here contribute little to estimates of total uncertainty.
|
| 188 |
+
|
| 189 |
+
In contrast, Table 1 shows that measures of knowledge uncertainty yield superior OOD detection performance compared to total uncertainty in terms of AUC-ROC, which is consistent with results for non-GBDT models (Malinin, 2019; Malinin & Gales, 2019; Malinin et al., 2020).5 The results also show that SGB and SGLB ensembles performed almost equally well. At the same time, virtual ensembling (vSGLB) performed consistently worse (with one exception) than SGB/SGLB ensembles, which is explained by the presence of strong correlations between the models in a virtual ensemble. However, in classification tasks, estimates of knowledge uncertainty provided by vSGLB nevertheless outperform uncertainty estimates derived from single SGB and SGLB models. This shows that useful measures of knowledge uncertainty can be derived from a single SGLB model by interpreting it as a virtual ensemble at no additional computational or memory cost. For vSGLB, the difference between classification and regression tasks can be explained by the presence or absence of categorical features. In our preliminary experiments on synthetic data, we noticed that categorical features may have a noticeable effect on the diversity of vSGLB models, and our classification datasets contain categorical features.
|
| 190 |
+
|
| 191 |
+
# 6 CONCLUSION
|
| 192 |
+
|
| 193 |
+
This work examined principled, ensemble-based uncertainty-estimation for GBDT models. Two main approaches to generating ensembles of GDBT models, where each model is itself an ensemble of trees, were considered — Stochastic Gradient Boosting (SGB) and Stochastic Gradient Langevin Boosting (SGLB). Based on SGLB, we propose constructing a virtual ensemble (vSGLB) by exploiting the ‘ensemble-of-trees’ nature of GBDT models. Properties of the estimates of total, data, and knowledge uncertainty derived from these ensembles were first analyzed on synthetic data. It was shown that the proposed approach can successfully detect anomalous inputs and is especially successful on tabular data. On continuous data, detecting knowledge uncertainty is still possible, but it becomes harder to differentiate it with data uncertainty due to decision-boundary ‘jitter’. Further experiments on a wide range of classification and regression datasets showed that while ensembles of GDBT models do not offer much advantage in terms of error detection, as each model is already an ensemble of trees, they do yield useful measures of knowledge uncertainty, which enables outof-domain detection in both regression and classification tasks. Notably, measures of knowledge uncertainty, which can only be obtained via ensembles, achieve far better OOD detection performance than measures of total uncertainty. It is also shown that while there is little practical difference between SGB and SGLB ensembles, vSGLB performs noticeably worse. However, for classification tasks containing categorical features, vSGLB still yields useful measures of knowledge uncertainty at the computational time and space complexity of a single SGLB model. Thus, vSGLB allows us to derive the benefits of an ensemble at no additional computational and memory cost.
|
| 194 |
+
|
| 195 |
+
Table 1: Detection of errors and OOD examples for regression and classification tasks
|
| 196 |
+
|
| 197 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2"></td><td colspan="2">Single SGB</td><td colspan="3">Ensemble</td><td colspan="2">Single</td><td colspan="3">Ensemble</td></tr><tr><td></td><td>SGLB</td><td>SGB Classification % PRR (↑)</td><td>SGLB</td><td>vSGLB</td><td>SGB</td><td>SGLB Clasification % AUC-ROC (↑)</td><td>SGB</td><td>SGLB</td><td>vSGLB</td></tr><tr><td>Adult</td><td>TU KU</td><td>72</td><td colspan="3">72 72</td><td>72</td><td colspan="3">53 50</td><td>51</td><td>51</td></tr><tr><td></td><td>TU</td><td>一 71</td><td>一 69</td><td>49 70</td><td>49 68</td><td>38 68</td><td>丨 86</td><td>一 87</td><td>89 86</td><td>89 86</td><td>85 86</td></tr><tr><td>Amazon Click</td><td>KU TU</td><td>丨 43</td><td>一 44</td><td>64 43</td><td>61 44</td><td>40 44</td><td>丨 61</td><td>一 67</td><td>88 64</td><td>74 64</td><td>67 68</td></tr><tr><td>Internet</td><td>KU TU</td><td>丨 76</td><td>一 79</td><td>22 77</td><td>22 79</td><td>11 79</td><td>1 67</td><td>1 68</td><td>91 70</td><td>92 69</td><td>90 68</td></tr><tr><td></td><td>KU TU</td><td>一 68</td><td>1 69</td><td>69 69</td><td>72 69</td><td>61 69</td><td>1 29</td><td>1 48</td><td>87 47</td><td>89 50</td><td>81 52</td></tr><tr><td>KDD-Appetency KDD-Churn</td><td>KU TU</td><td>1 47</td><td>1 45</td><td>64 48</td><td>54 46</td><td>14 46</td><td>1 81</td><td>1 57</td><td>90 82</td><td>91 75</td><td>93 60</td></tr><tr><td>KDD-Upselling</td><td>KU TU</td><td>1 56</td><td>1 56</td><td>33 57</td><td>35 57</td><td>28 56</td><td>1 53</td><td>1 51</td><td>99 62</td><td>98 60</td><td>92 47</td></tr><tr><td>Kick</td><td>KU TU KU</td><td>丨 44</td><td>1 45</td><td>45 44 34</td><td>49 44 34</td><td>33 45 20</td><td>1 45</td><td>1 37</td><td>97 52</td><td>97 58 98</td><td>78 38 89</td></tr><tr><td>Dataset</td><td></td><td colspan="5">Regression % PRR (↑)</td><td colspan="5">98 Regression % AUC-ROC (↑)</td></tr><tr><td>BostonH</td><td>TU KU</td><td>45 一</td><td>45 1</td><td>44 36</td><td>45 37</td><td>46 38</td><td>70 1</td><td>68 1</td><td>71 80</td><td>69 80</td><td>64 49</td></tr><tr><td>Concrete</td><td>TU KU</td><td>45 一</td><td>41 一</td><td>44 27</td><td>42 27</td><td>41 25</td><td>78</td><td>80 1</td><td>79 92</td><td>81 92</td><td>78 56</td></tr><tr><td>Energy</td><td>TU KU</td><td>58 1</td><td>56 1</td><td>58 36</td><td>56 31</td><td>62 54</td><td>67 1</td><td>69 1</td><td>89 100</td><td>89 100</td><td>69 32</td></tr><tr><td>Kin8nm</td><td>TU KU</td><td>59</td><td>59 一</td><td>59 18</td><td>59 19</td><td>58 35</td><td>43 一</td><td>43 1</td><td>43 45</td><td>43 45</td><td>42 45</td></tr><tr><td>Naval-p</td><td>TU KU</td><td>75 一</td><td>76 丨</td><td>82 52</td><td>82 56</td><td>81 69</td><td>99 1</td><td>99 1</td><td>100 100</td><td>100 100</td><td>99 87</td></tr><tr><td>Power-p</td><td>TU KU</td><td>30 丨</td><td>32 1</td><td>31 8</td><td>33 9</td><td>32 13</td><td>48 1</td><td>47 1</td><td>51 72</td><td>49 73</td><td>47 57</td></tr><tr><td>Protein</td><td>TU KU</td><td>49 丨</td><td>48 1</td><td>52 30</td><td>50 29</td><td>48 12</td><td>82 1</td><td>84 1</td><td>92 99</td><td>91 99</td><td>86 94</td></tr><tr><td>Wine-qu</td><td>TU KU</td><td>33 丨</td><td>32 1</td><td>33 25</td><td>32 19</td><td>32 9</td><td>60 1</td><td>56 1</td><td>60 74</td><td>56 72</td><td>56 49</td></tr><tr><td>Yacht</td><td>TU KU</td><td>89 一</td><td>88 1</td><td>88 74</td><td>88 78</td><td>88 66</td><td>57 1</td><td>57 1</td><td>58 62</td><td>58 60</td><td>55 40</td></tr><tr><td>Year</td><td>TU KU</td><td>61 一</td><td>62 1</td><td>62 30</td><td>63 30</td><td>62 25</td><td>59 1</td><td>58 1</td><td>60 67</td><td>60 57</td><td>57 52</td></tr></table>
|
| 198 |
+
|
| 199 |
+
# ACKNOWLEDGMENTS
|
| 200 |
+
|
| 201 |
+
We would like to thank Ekaterina Ermishkina and Stanislav Kirillov for implementing the proposed methods within the CatBoost library.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
UCI datasets. https://github.com/yaringal/DropoutUncertaintyExps/tree/ master/UCI_Datasets.
|
| 206 |
+
|
| 207 |
+
Arsenii Ashukha, Alexander Lyzhov, Dmitry Molchanov, and Dmitry Vetrov. Pitfalls of in-domain uncertainty estimation and ensembling in deep learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BJxI5gHKDr.
|
| 208 |
+
|
| 209 |
+
Thierry Bertin-Mahieux, Daniel PW Ellis, Brian Whitman, and Paul Lamere. The million song dataset. In Proceedings of the 12th International Society for Music Information Retrieval Conference (ISMIR 2011), 2011.
|
| 210 |
+
|
| 211 |
+
Christopher M Bishop. Pattern recognition and machine learning. springer, 2006.
|
| 212 |
+
|
| 213 |
+
Christopher JC Burges. From RankNet to LambdaRank to LambdaMART: An overview. Learning, 11(23-581):81, 2010.
|
| 214 |
+
|
| 215 |
+
Rich Caruana and Alexandru Niculescu-Mizil. An empirical comparison of supervised learning algorithms. In Proceedings of the 23rd international conference on Machine learning, pp. 161– 168. ACM, 2006.
|
| 216 |
+
|
| 217 |
+
Hugh A Chipman, Edward I George, Robert E McCulloch, et al. Bart: Bayesian additive regression trees. The Annals of Applied Statistics, 4(1):266–298, 2010.
|
| 218 |
+
|
| 219 |
+
John W Coulston, Christine E Blinn, Valerie A Thomas, and Randolph H Wynne. Approximating prediction uncertainty for random forest regression models. Photogrammetric Engineering & Remote Sensing, 82(3):189–197, 2016.
|
| 220 |
+
|
| 221 |
+
Stefan Depeweg, José Miguel Hernández-Lobato, Finale Doshi-Velez, and Steffen Udluft. Decomposition of uncertainty for active learning and reliable reinforcement learning in stochastic systems. stat, 1050:11, 2017.
|
| 222 |
+
|
| 223 |
+
Tony Duan, Anand Avati, Daisy Yi Ding, Sanjay Basu, Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ , and Alejandro Schuler. Ngboost: Natural gradient boosting for probabilistic prediction. Proc. 37th International Conference on Machine Learning (ICML), 2020.
|
| 224 |
+
|
| 225 |
+
Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pp. 1189–1232, 2001.
|
| 226 |
+
|
| 227 |
+
Jerome H Friedman. Stochastic gradient boosting. Computational Statistics & Data Analysis, 38(4): 367–378, 2002.
|
| 228 |
+
|
| 229 |
+
Yarin Gal. Uncertainty in Deep Learning. PhD thesis, University of Cambridge, 2016.
|
| 230 |
+
|
| 231 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. In Proc. 33rd International Conference on Machine Learning (ICML-16), 2016.
|
| 232 |
+
|
| 233 |
+
Franz Graf, Hans-Peter Kriegel, Matthias Schubert, Sebastian Pölsterl, and Alexander Cavallaro. 2d image registration in ct images using radial image descriptors. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 607���614. Springer, 2011.
|
| 234 |
+
|
| 235 |
+
Dan Hendrycks and Kevin Gimpel. A Baseline for Detecting Misclassified and Out-ofDistribution Examples in Neural Networks. http://arxiv.org/abs/1610.02136, 2016. arXiv:1610.02136.
|
| 236 |
+
|
| 237 |
+
Kaggle. "Don’t Get Kicked!". https://www.kaggle.com/c/DontGetKicked, 2011.
|
| 238 |
+
|
| 239 |
+
Kaggle. Amazon dataset. https://www.kaggle.com/bittlingmayer/ amazonreviews, 2017.
|
| 240 |
+
KDD. Kdd cup 2009: Customer relationship prediction. https://www.kdd.org/kdd-cup/ view/kdd-cup-2009/Data, 2009.
|
| 241 |
+
KDD. Kdd cup 2012 (track 2): Predict the click-through rate of ads given the query and user information. https://www.kdd.org/kdd-cup/view/kdd-cup-2012-track-2, 2012.
|
| 242 |
+
Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7482–7491, 2018.
|
| 243 |
+
Andreas Kirsch, Joost van Amersfoort, and Yarin Gal. BatchBALD: Efficient and diverse batch acquisition for deep bayesian active learning. In Advances in Neural Information Processing Systems 32 (NeurIPS 2019), 2019.
|
| 244 |
+
Ron Kohavi. Scaling up the accuracy of naive-bayes classifiers: A decision-tree hybrid. In Proceedings of the Second International Conference on Knowledge Discovery and Data Mining, 1996.
|
| 245 |
+
B. Lakshminarayanan, A. Pritzel, and C. Blundell. Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles. In Proc. Conference on Neural Information Processing Systems (NIPS), 2017.
|
| 246 |
+
Antonio R Linero. A review of tree-based bayesian methods. Communications for Statistical Applications and Methods, 24(6), 2017.
|
| 247 |
+
Wesley Maddox, Timur Garipov, Pavel Izmailov, Dmitry Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning. arXiv preprint arXiv:1902.02476, 2019.
|
| 248 |
+
Andrey Malinin. Uncertainty Estimation in Deep Learning with application to Spoken Language Assessment. PhD thesis, University of Cambridge, 2019.
|
| 249 |
+
Andrey Malinin and Mark JF Gales. Reverse kl-divergence training of prior networks: Improved uncertainty and adversarial robustness. 2019.
|
| 250 |
+
Andrey Malinin, Bruno Mlodozeniec, and Mark JF Gales. Ensemble distribution distillation. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id $=$ BygSP6Vtvr.
|
| 251 |
+
Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, D Sculley, Sebastian Nowozin, Joshua V Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model’s uncertainty? Evaluating predictive uncertainty under dataset shift. Advances in Neural Information Processing Systems, 2019.
|
| 252 |
+
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, 12:2825–2830, 2011.
|
| 253 |
+
Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, and Andrey Gulin. Catboost: unbiased boosting with categorical features. In Proceedings of the 32nd International Conference on Neural Information Processing Systems (NeurIPS), pp. 6638–6648, 2018.
|
| 254 |
+
Maxim Raginsky, Alexander Rakhlin, and Matus Telgarsky. Non-convex learning via stochastic gradient langevin dynamics: a nonasymptotic analysis. CoRR, abs/1702.03849, 2017.
|
| 255 |
+
Matthew Richardson, Ewa Dominowska, and Robert Ragno. Predicting clicks: estimating the clickthrough rate for new ads. In Proceedings of the 16th international conference on World Wide Web, pp. 521–530. ACM, 2007.
|
| 256 |
+
Byron P Roe, Hai-Jun Yang, Ji Zhu, Yong Liu, Ion Stancu, and Gordon McGregor. Boosted decision trees as an alternative to artificial neural networks for particle identification. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 543(2):577–584, 2005.
|
| 257 |
+
|
| 258 |
+
Mohammad Hossein Shaker and Eyke Hüllermeier. Aleatoric and epistemic uncertainty with random forests. In International Symposium on Intelligent Data Analysis, pp. 444–456. Springer, 2020.
|
| 259 |
+
|
| 260 |
+
Lewis Smith and Yarin Gal. Understanding Measures of Uncertainty for Adversarial Example Detection. In UAI, 2018.
|
| 261 |
+
|
| 262 |
+
UCI. KDD internet usage data. https://archive.ics.uci.edu/ml/datasets/ Internet $^ +$ Usage+Data, 1997.
|
| 263 |
+
|
| 264 |
+
Aleksei Ustimenko and Liudmila Prokhorenkova. SGLB: Stochastic Gradient Langevin Boosting. arXiv e-prints, art. arXiv:2001.07248, 2020.
|
| 265 |
+
|
| 266 |
+
Qiang Wu, Christopher JC Burges, Krysta M Svore, and Jianfeng Gao. Adapting boosting for information retrieval measures. Information Retrieval, 13(3):254–270, 2010.
|
| 267 |
+
|
| 268 |
+
Yanru Zhang and Ali Haghani. A gradient boosting method to improve travel time prediction. Transportation Research Part C: Emerging Technologies, 58:308–324, 2015.
|
| 269 |
+
|
| 270 |
+
A EXPERIMENTAL SETUP
|
| 271 |
+
|
| 272 |
+
# A.1 OUR IMPLEMENTATION OF DATA UNCERTAINTY
|
| 273 |
+
|
| 274 |
+
As discussed in Section 2.2 of the main text, for regression we simultaneously predict the parameters $\mu$ and $\log \sigma$ of the Normal distribution. Similarly to NGBoost, we use the natural gradients. For our loss and parameterization, the natural gradient is:
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
g ^ { ( t ) } ( \pmb { x } , y ) = \left( \mu ^ { ( t - 1 ) } - y , \frac { 1 } { 2 } - \frac { 1 } { 2 } \left( \frac { y - \mu ^ { ( t - 1 ) } } { \sigma ^ { ( t - 1 ) } } \right) ^ { 2 } \right) .
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
At each step of the gradient boosting procedure, we construct one tree predicting both components of $g ^ { ( t ) }$ , similarly to the MultiRMSE regime of CatBoost.6
|
| 281 |
+
|
| 282 |
+
Recall that for classification we optimize the logistic loss.
|
| 283 |
+
|
| 284 |
+
In Table 2, we compare our implementation with NGBoots (Duan et al., 2020) and Deep Ensembles (Lakshminarayanan et al., 2017) on regression datasets. For our implementation, we consider SGB with fixed sample rate (0.5) and perform parameter tuning as described below. The best results are highlighted.
|
| 285 |
+
|
| 286 |
+
Table 2: Comparison of our implementation with existing methods
|
| 287 |
+
|
| 288 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">RMSE</td><td colspan="3">NLL</td></tr><tr><td>Deep. Ens.</td><td>NGBoost</td><td>CatBoost</td><td>Deep. Ens.</td><td>NGBoost</td><td>CatBoost</td></tr><tr><td>Boston</td><td>3.28 ±1.00</td><td>2.94 ± 0.53</td><td>3.06 ± 0.68</td><td>2.41 ± 0.25</td><td>2.43 ± 0.15</td><td>2.47 ± 0.20</td></tr><tr><td>Concrete</td><td>6.03 ± 0.58</td><td>5.06 ± 0.61</td><td>5.21 ± 0.53</td><td>3.06 ± 0.18</td><td>3.04 ± 0.17</td><td>3.06 ± 0.13</td></tr><tr><td>Energy</td><td>2.09 ±0.29</td><td>0.46 ± 0.06</td><td>0.57 ± 0.06</td><td>1.38 ± 0.22</td><td>0.60 ± 0.45</td><td>1.24 ± 1.28</td></tr><tr><td>Kin8nm</td><td>0.09 ± 0.00</td><td>0.16 ± 0.00</td><td>0.14 ± 0.00</td><td>-1.20 ± 0.02</td><td>-0.49 ± 0.02</td><td>- 0.63 ± 0.02</td></tr><tr><td>Naval</td><td>0.00 ± 0.00</td><td>0.00 ± 0.00</td><td>0.00 ±0.00</td><td>-5.63 ± 0.05</td><td>-5.34 ± 0.04</td><td>-5.39 ± 0.04</td></tr><tr><td>Power</td><td>4.11 ± 0.17</td><td>3.79 ± 0.18</td><td>3.55 ± 0.27</td><td>2.79 ± 0.04</td><td>2.79 ± 0.11</td><td>2.72 ± 0.12</td></tr><tr><td>Protein</td><td>4.71 ± 0.06</td><td>4.33 ±0.03</td><td>3.92 ± 0.08</td><td>2.83 ± 0.02</td><td>2.81 ± 0.03</td><td>2.73 ± 0.07</td></tr><tr><td>Wine</td><td>0.64 ± 0.04</td><td>0.63 ± 0.04</td><td>0.63 ± 0.04</td><td>0.94 ± 0.12</td><td>0.91 ± 0.06</td><td>0.93 ± 0.08</td></tr><tr><td>Yacht</td><td>1.58 ± 0.48</td><td>0.50 ± 0.20</td><td>0.82 ± 0.40</td><td>1.18 ± 0.21</td><td>0.20 ± 0.26</td><td>0.41 ± 0.39</td></tr><tr><td>Year MSD</td><td>8.89 ± NA</td><td>8.94±NA</td><td>8.99±NA</td><td>3.35± NA</td><td>3.43±NA</td><td>3.43±NA</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# A.2 PARAMETER TUNING
|
| 291 |
+
|
| 292 |
+
For all approaches, we use grid search to tune learning-rate in $\{ 0 . 0 0 1 , 0 . 0 1 , 0 . 1 \}$ , tree depth in $\{ 3 , 4 , 5 , \bar { 6 } \bar \}$ . We fix subsample to 0.5 for SGB and to 1 for SGLB. This is done to avoid joint randomization effects of SGB sampling and SGLB noise in gradients. We also set diffusion-temperature $= N$ and model-shrink-rate $\scriptstyle { \dot { \mathbf { \theta } } } = { \frac { \mathbf { \bar { 1 } } } { 2 N } }$ for SGLB.
|
| 293 |
+
|
| 294 |
+
# A.3 DATASETS
|
| 295 |
+
|
| 296 |
+
The datasets are described in Table 3. For regression, we use standard train/validation/test splits (UCI). For classification, we split the datasets into proportion 65/15/20 in train, validation, and test sets. For more details, see our GitHub repository.7
|
| 297 |
+
|
| 298 |
+
# A.4 STATISTICAL SIGNIFICANCE
|
| 299 |
+
|
| 300 |
+
For regression, we perform cross-validation to estimate statistical significance with paired $t$ -test. In the corresponding tables, we highlight the approaches that are insignificantly different from the best one (p-value $> 0 . 0 5$ ).
|
| 301 |
+
|
| 302 |
+
Table 3: Datasets description
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Dataset</td><td># Examples</td><td>#Features</td></tr><tr><td colspan="3">Classification</td></tr><tr><td>Adult (Kohavi, 1996)</td><td>48842</td><td>14</td></tr><tr><td>Amazon (Kaggle,2017)</td><td>32769</td><td>9</td></tr><tr><td>Click (KDD,2012)</td><td>399482</td><td>11</td></tr><tr><td>Internet (UCI, 1997)</td><td>10108</td><td>68</td></tr><tr><td>KDD-Appetency (KDD,2009)</td><td>50000</td><td>419</td></tr><tr><td>KDD-Churn (KDD, 2009)</td><td>50000</td><td>419</td></tr><tr><td>KDD-Upselling (KDD, 2009)</td><td>50000</td><td>419</td></tr><tr><td>Kick (Kaggle,2011)</td><td>72983</td><td>43</td></tr><tr><td colspan="3">Regression</td></tr><tr><td>Boston (UCI)</td><td>506</td><td>13</td></tr><tr><td>Concrete (UCI)</td><td>1030</td><td>8</td></tr><tr><td>Energy (UCI)</td><td>768</td><td>8</td></tr><tr><td>Kin8nm (UCI)</td><td>8192</td><td>8</td></tr><tr><td>Naval (UCI)</td><td>11934</td><td>16</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Power (UCI)</td><td>9568</td><td>4</td></tr><tr><td>Protein (UCI)</td><td>45730</td><td>9</td></tr><tr><td>Wine (UCI)</td><td>1599</td><td>11</td></tr><tr><td>Yacht (UCI)</td><td>308</td><td>6</td></tr><tr><td>Year MSD (Bertin-Mahieux et al.,2011)</td><td>515345</td><td>90</td></tr></table>
|
| 305 |
+
|
| 306 |
+
Table 4: NLL and RMSE/Error rate for regression and classification
|
| 307 |
+
|
| 308 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="2">Single SGB SGLB</td><td colspan="3">Ensemble SGB SGLB</td><td colspan="2">Single SGB SGLB</td><td colspan="3">Ensemble SGLB vSGLB</td></tr><tr><td></td><td>Classification NLL (↓)</td><td></td><td></td><td>vSGLB</td><td></td><td>SGB Classification % Error (↓)</td><td></td><td></td><td></td></tr><tr><td>Adult</td><td colspan="5">0.273 0.276</td><td colspan="5">12.8 12.7 12.8</td></tr><tr><td>Amazon</td><td>0.276 0.141</td><td>0.142</td><td>0.140</td><td>0.271 0.142</td><td>0.274 0.143</td><td>4.7</td><td>4.6</td><td>4.6</td><td>12.6 4.5</td><td>12.7 4.5</td></tr><tr><td>Click</td><td>0.393</td><td>0.392</td><td>0.392</td><td>0.391</td><td>0.392</td><td>15.6</td><td>15.7</td><td>15.6</td><td>15.6</td><td>15.6</td></tr><tr><td>Internet</td><td>0.224</td><td>0.218</td><td>0.221</td><td>0.217</td><td>0.218</td><td>9.9</td><td>10.0</td><td>9.7</td><td>10.0</td><td>10.0</td></tr><tr><td>Appetency</td><td>0.073</td><td>0.073</td><td>0.073</td><td>0.073</td><td>0.073</td><td>1.8</td><td>1.8</td><td>1.8</td><td>1.8</td><td>1.8</td></tr><tr><td>Churn</td><td>0.235</td><td>0.236</td><td>0.233</td><td>0.234</td><td>0.235</td><td>7.3</td><td>7.2</td><td>7.3</td><td>7.2</td><td>7.2</td></tr><tr><td>Upselling</td><td>0.168</td><td>0.168</td><td>0.168</td><td>0.168</td><td>0.168</td><td>5.0</td><td>4.9</td><td>5.0</td><td>5.0</td><td>4.9</td></tr><tr><td>Kick</td><td>0.287</td><td>0.286</td><td>0.286</td><td>0.285</td><td>0.286</td><td>9.5</td><td>9.6</td><td>9.5</td><td>9.4</td><td>9.6</td></tr><tr><td>Dataset</td><td></td><td colspan="3">Regression NLL (↓)</td><td></td><td colspan="5"></td></tr><tr><td>BostonH</td><td>2.47</td><td>2.52</td><td>2.46</td><td>2.50</td><td>2.50</td><td>3.06</td><td>Regression RMSE (↓) 3.12</td><td>3.04</td><td>3.10</td><td>3.27</td></tr><tr><td>Concrete</td><td>3.06</td><td>3.06</td><td>3.05</td><td>3.05</td><td>3.06</td><td>5.21</td><td>5.11</td><td>5.21</td><td>5.10</td><td>5.37</td></tr><tr><td>Energy</td><td>1.24</td><td>1.70</td><td>1.13</td><td>1.52</td><td>0.70</td><td>0.57</td><td>0.54</td><td>0.57</td><td>0.54</td><td>0.64</td></tr><tr><td>Kin8nm</td><td>-0.63</td><td>-0.65</td><td>-0.63</td><td>-0.65</td><td>-0.60</td><td>0.14</td><td>0.14</td><td>0.14</td><td>0.14</td><td>0.15</td></tr><tr><td>Naval-p</td><td>-5.39</td><td>-5.42</td><td>-5.61</td><td>-5.65</td><td>-5.39</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td>Power-p</td><td>2.72</td><td>2.71</td><td>2.66</td><td>2.66</td><td>2.69</td><td>3.55</td><td>3.56</td><td>3.52</td><td>3.54</td><td>3.64</td></tr><tr><td>Protein</td><td>2.73</td><td>2.73</td><td>2.61</td><td>2.64</td><td>2.70</td><td>3.92</td><td>3.96</td><td>3.90</td><td>3.93</td><td>4.02</td></tr><tr><td>Wine-qu</td><td>0.93</td><td>0.99</td><td>0.92</td><td>0.98</td><td>0.96</td><td>0.63</td><td>0.65</td><td>0.63</td><td>0.65</td><td>0.66</td></tr><tr><td>Yacht</td><td>0.41</td><td>0.38</td><td>0.27</td><td>0.32</td><td>0.51</td><td>0.82</td><td>0.84</td><td>0.83</td><td>0.84</td><td>0.97</td></tr><tr><td>Year</td><td>3.43</td><td>3.43</td><td>3.41</td><td>3.40</td><td>3.42</td><td>8.99</td><td>8.96</td><td>8.97</td><td>8.94</td><td>8.98</td></tr></table>
|
| 309 |
+
|
| 310 |
+
For classification (and Year MSD), we measure statistical significance for NLL and error/RMSE on the test set. In the corresponding tables, the approaches that are insignificantly different from the best one are highlighted. For PRR and AUC-ROC (for classification and Year MSD), we highlight the best value.
|
| 311 |
+
|
| 312 |
+
# B ADDITIONAL EXPERIMENTAL RESULTS
|
| 313 |
+
|
| 314 |
+
In Table 4, we compare ensemble approaches with single models in terms of NLL and error rate for classification and in terms of NLL and RMSE for regression tasks. Results for NLL demonstrate an advantage of ensembling approaches compared to single models. However, in some cases the difference is not significant, which can be explained by the additive nature of boosting: averaging several tree ensembles gives another (larger) tree ensemble. Thus, improved NLL can result from the increased complexity of ensemble models. We can make a similar conclusion from the results for RMSE and error rate.
|
| 315 |
+
|
| 316 |
+
# C COMPARISON WITH RANDOM FOREST
|
| 317 |
+
|
| 318 |
+
Our paper specifically focuses on uncertainty estimation in Gradient Boosted Decision Trees (GBDT) models. However, some related work was done for quantifying uncertainty in random forests (Coulston et al., 2016; Shaker & Hüllermeier, 2020), which are also ensembles of decision trees. Thus, for completeness, we also analyze how ensemble approaches perform in combination with random forests.
|
| 319 |
+
|
| 320 |
+
In these experiments, we use the scikit-learn implementation of random forests (Pedregosa et al., 2011). We limit the maximum depth to 10 and keep all other parameters default. For categorical features, we use leave-one-out encoding.
|
| 321 |
+
|
| 322 |
+
Unlike GBDT, where trees are added to correct the previous model’s mistakes, random forests (RF) consist of decision trees that are independently trained on bootstrapped sub-samples of the dataset. Hence, for knowledge uncertainty we can divide RF into several independent parts, each consisting of several trees. Drawing a parallel to virtual SGLB, we call this approach vRF (virtual RF) since it allows estimating knowledge uncertainty using only one trained random forest model. In our experiments with vRF, we divide one RF model into 10 independent parts, each consisting of 100 trees. Similarly, one can also construct an ensemble of several independently trained random forest models, which is expected to be a stronger baseline. However, we expect a small difference between vRF and an ensemble of random forests, as there are, a priori, no correlations between trees both in a single model and across multiple RF models.
|
| 323 |
+
|
| 324 |
+
In Tables 5 and 6, we compare the predictive performance of random forests (both individual models and explicit ensembles of multiple models) to SGLB individual and ensemble models on classification and regression tasks. The results show that generally GBDT models outperform random forest models in terms of classification error rate and NLL. Note that we cannot calculate NLL for RF regression models as they are not naturally probabilistic (do not yield a predicted variance). As a result, they are unable to estimate data uncertainty, and therefore we can only obtain estimates of knowledge uncertainty.
|
| 325 |
+
|
| 326 |
+
Table 7 compares SGLB and RF ensembles in terms of error detection (PRR) and out-of-domain input detection (ROC-AUC). One can see that SGLB usually outperforms RF, especially for OOD detection. Notably, as we expected, for OOD detection vRF and RF give similar results. Thus, we conclude that for random forests, a virtual ensemble is a good and cheap alternative to the true one.
|
| 327 |
+
|
| 328 |
+
Table 5: Comparison with random forest: NLL and error rate for classification
|
| 329 |
+
|
| 330 |
+
<table><tr><td rowspan="3">Dataset</td><td colspan="2">Single</td><td colspan="2">Ensemble</td><td colspan="2">Single</td><td colspan="2">Ensemble</td></tr><tr><td>SGLB</td><td>RF</td><td>SGLB</td><td>RF</td><td>SGLB</td><td>RF</td><td>SGLB</td><td>RF</td></tr><tr><td colspan="4">Classification NLL (↓)</td><td colspan="4">Classification %Error ()</td></tr><tr><td>Adult</td><td>0.273</td><td>0.300</td><td>0.271</td><td>0.300</td><td>12.7</td><td>13.9</td><td>12.6</td><td>13.9</td></tr><tr><td>Amazon</td><td>0.142</td><td>0.183</td><td>0.142</td><td>0.183</td><td>4.6</td><td>5.6</td><td>4.5</td><td>5.6</td></tr><tr><td>Click</td><td>0.392</td><td>0.411</td><td>0.391</td><td>0.411</td><td>15.7</td><td>16.0</td><td>15.6</td><td>16.0</td></tr><tr><td>Internet</td><td>0.218</td><td>0.275</td><td>0.217</td><td>0.274</td><td>10.0</td><td>11.2</td><td>10.0</td><td>11.0</td></tr><tr><td>KDD-Appetency</td><td>0.073</td><td>0.083</td><td>0.073</td><td>0.083</td><td>1.8</td><td>1.8</td><td>1.8</td><td>1.8</td></tr><tr><td>KDD-Churn</td><td>0.236</td><td>0.249</td><td>0.234</td><td>0.249</td><td>7.2</td><td>7.3</td><td>7.2</td><td>7.3</td></tr><tr><td>KDD-Upselling</td><td>0.168</td><td>0.202</td><td>0.168</td><td>0.202</td><td>4.9</td><td>7.4</td><td>5.0</td><td>7.4</td></tr><tr><td>Kick</td><td>0.286</td><td>0.311</td><td>0.285</td><td>0.311</td><td>9.6</td><td>10.4</td><td>9.4</td><td>10.4</td></tr></table>
|
| 331 |
+
|
| 332 |
+
Table 6: Comparison with random forest: RMSE for regression
|
| 333 |
+
|
| 334 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="2">Single</td><td colspan="2">Ensemble</td></tr><tr><td>SGLB</td><td>RF</td><td>SGLB</td><td>RF</td></tr><tr><td>BostonH</td><td>3.12</td><td>2.98</td><td>3.10</td><td>2.98</td></tr><tr><td>Concrete</td><td>5.11</td><td>4.96</td><td>5.10</td><td>4.95</td></tr><tr><td>Energy</td><td>0.54</td><td>0.50</td><td>0.54</td><td>0.50</td></tr><tr><td>Kin8nm</td><td>0.14</td><td>0.15</td><td>0.14</td><td>0.15</td></tr><tr><td>Naval-p</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td>Power-p</td><td>3.56</td><td>3.53</td><td>3.54</td><td>3.53</td></tr><tr><td>Protein</td><td>3.96</td><td>4.19</td><td>3.93</td><td>4.19</td></tr><tr><td>Wine-qu</td><td>0.65</td><td>0.58</td><td>0.65</td><td>0.58</td></tr><tr><td>Yacht</td><td>0.84</td><td>0.84</td><td>0.84</td><td>0.84</td></tr><tr><td>Year</td><td>8.96</td><td>9.43</td><td>8.94</td><td>9.43</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 7: Comparison with random forest: detection of errors and OOD examples for regression and classification (virtual and true ensembles)
|
| 337 |
+
|
| 338 |
+
<table><tr><td colspan="2">Dataset</td><td>vSGLB</td><td>vRF</td><td>SGLB</td><td>RF</td><td>vSGLB</td><td>vRF</td><td>SGLB</td><td>RF</td></tr><tr><td colspan="2"></td><td></td><td colspan="3">Classification % PRR (↑)</td><td></td><td>Classfcation % AUC-ROC (1)</td><td></td><td></td></tr><tr><td rowspan="2">Adult</td><td>TU KU</td><td>72</td><td>70</td><td>72</td><td>70</td><td>51</td><td>58</td><td>51</td><td>58</td></tr><tr><td></td><td>38</td><td>20</td><td>49</td><td>22</td><td>85</td><td>86</td><td>89</td><td>87</td></tr><tr><td rowspan="2">Amazon</td><td>TU</td><td>68</td><td>63</td><td>68</td><td>64</td><td>86</td><td>48</td><td>86</td><td>49</td></tr><tr><td>KU</td><td>40</td><td>45</td><td>61</td><td>52</td><td>67</td><td>55</td><td>74</td><td>53</td></tr><tr><td rowspan="2">Click</td><td>TU</td><td>44</td><td>36</td><td>44</td><td>37</td><td>68</td><td>71</td><td>64</td><td>71</td></tr><tr><td>KU</td><td>11</td><td>20</td><td>22</td><td>21</td><td>90</td><td>81</td><td>92</td><td>80</td></tr><tr><td rowspan="2">Internet</td><td>TU</td><td>79</td><td>69</td><td>79</td><td>68</td><td>68</td><td>72</td><td>69</td><td>72</td></tr><tr><td>KU</td><td>61</td><td>38</td><td>72</td><td>36</td><td>81</td><td>79</td><td>89</td><td>79</td></tr><tr><td rowspan="2"> KDD-Appetency</td><td>TU</td><td>69</td><td>56</td><td>69</td><td>56</td><td>52</td><td>82</td><td>50</td><td>81</td></tr><tr><td>KU</td><td>14</td><td>34</td><td>54</td><td>34</td><td>93</td><td>97</td><td>91</td><td>98</td></tr><tr><td rowspan="2">KDD-Churn</td><td>TU</td><td>46</td><td>39</td><td>46</td><td>39</td><td>60</td><td>75</td><td>75</td><td>78</td></tr><tr><td>KU</td><td>28</td><td>13</td><td>35</td><td>9</td><td>92</td><td>93</td><td>98</td><td>94</td></tr><tr><td>KDD-Upselling</td><td>TU KU</td><td>56 33</td><td>66</td><td>57</td><td>66</td><td>47</td><td>73</td><td>60</td><td>72</td></tr><tr><td rowspan="2">Kick</td><td>TU</td><td></td><td>45</td><td>49</td><td>44</td><td>78</td><td>90</td><td>97</td><td>92</td></tr><tr><td>KU</td><td>45 20</td><td>38 27</td><td>44</td><td>38</td><td>38</td><td>64</td><td>58</td><td>63</td></tr><tr><td>Dataset</td><td></td><td>Regression % PRR (1)</td><td></td><td>34</td><td>29</td><td>89</td><td>89</td><td>98</td><td>89</td></tr><tr><td></td><td>TU</td><td></td><td></td><td></td><td></td><td>Regression % AUC-ROC (1)</td><td></td><td></td><td></td></tr><tr><td rowspan="2">BostonH</td><td>KU</td><td>46 38</td><td>1 53</td><td>45</td><td>一</td><td>64</td><td>一</td><td>69</td><td>1</td></tr><tr><td></td><td></td><td></td><td>37</td><td>55</td><td>49</td><td>75</td><td>80</td><td>76</td></tr><tr><td rowspan="2">Concrete</td><td>TU KU</td><td>41</td><td>1</td><td>42</td><td>1</td><td>78</td><td>1</td><td>81</td><td>1</td></tr><tr><td></td><td>25</td><td>43</td><td>27</td><td>42</td><td>56</td><td>80</td><td>92</td><td>80</td></tr><tr><td rowspan="2">Energy</td><td>TU KU</td><td>62</td><td>1</td><td>56</td><td>一</td><td>69</td><td>丨</td><td>89</td><td>丨</td></tr><tr><td></td><td>54</td><td>40</td><td>31</td><td>41</td><td>32</td><td>100</td><td>100</td><td>100</td></tr><tr><td rowspan="2">Kin8nm</td><td>TU KU</td><td>58</td><td>1</td><td>59</td><td>1</td><td>42</td><td>1</td><td>43</td><td>1</td></tr><tr><td></td><td>35</td><td>33</td><td>19</td><td>33</td><td>45</td><td>48</td><td>45</td><td>48</td></tr><tr><td rowspan="2">Power-p</td><td>TU KU</td><td>32</td><td>一</td><td>33</td><td></td><td>47</td><td>一</td><td>49</td><td>一</td></tr><tr><td></td><td>13</td><td>21</td><td>9</td><td>22</td><td>57</td><td>66</td><td>73</td><td>65</td></tr><tr><td rowspan="2">Protein</td><td>TU</td><td>48</td><td>一</td><td>50</td><td></td><td>86</td><td>一</td><td>91</td><td></td></tr><tr><td>KU</td><td>12</td><td>40</td><td>29</td><td>40</td><td>94</td><td>91</td><td>99</td><td>92</td></tr><tr><td rowspan="2">Wine-qu</td><td>TU</td><td>32</td><td></td><td>32</td><td></td><td>56</td><td></td><td>56</td><td></td></tr><tr><td>KU</td><td>9</td><td>35</td><td>19</td><td>32</td><td>49</td><td>74</td><td>72</td><td>74</td></tr><tr><td rowspan="2">Yacht</td><td>TU</td><td>88</td><td>一</td><td>88</td><td>丨</td><td>55</td><td>1</td><td>58</td><td>1</td></tr><tr><td>KU</td><td>66</td><td>79</td><td>78</td><td>81</td><td>40</td><td>52</td><td>60</td><td>52</td></tr><tr><td rowspan="2">Year</td><td>TU</td><td>62</td><td>1</td><td>63</td><td>1</td><td>57</td><td>丨</td><td>60</td><td>1</td></tr><tr><td>KU</td><td>25</td><td>28</td><td>30</td><td>27</td><td>52</td><td>74</td><td>57</td><td>74</td></tr></table>
|
md/train/2zCRcTafea/2zCRcTafea.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Focal Attention for Long-Range Interactions in Vision Transformers
|
| 2 |
+
|
| 3 |
+
Jianwei Yang1 Chunyuan $\mathbf { L i } ^ { 1 }$ Pengchuan Zhang1 Xiyang Dai2 Bin Xiao2 Lu Yuan2 Jianfeng Gao1 1Microsoft Research at Redmond, 2Microsoft Cloud $^ +$ AI
|
| 4 |
+
{jianwyan,chunyl,penzhan,xidai,bixi,luyuan,jfgao}@microsoft.com
|
| 5 |
+
|
| 6 |
+
# Abstract
|
| 7 |
+
|
| 8 |
+
Recently, Vision Transformer and its variants have shown great promise on various computer vision tasks. The ability of capturing local and global visual dependencies through self-attention is the key to its success. However, this also brings challenges due to quadratic computational overhead, especially for the high-resolution vision tasks (e.g., object detection). Many recent works have attempted to reduce the cost and improve model performance by applying either coarse-grained global attention or fine-grained local attention. However, both approaches cripple the modeling power of the original self-attention mechanism of multi-layer Transformers, leading to sub-optimal solutions. In this paper, we present focal attention, a new attention mechanism that incorporates both fine-grained local and coarse-grained global interactions. In this new mechanism, each token attends its closest surrounding tokens at fine granularity and the tokens far away at coarse granularity, and thus can capture both short- and long-range visual dependencies efficiently and effectively. With focal attention, we build a new variant of Vision Transformer models, called Focal Transformers, which achieve superior performance over the state-of-theart (SoTA) Vision Transformers on a range of public image classification and object detection benchmarks. In particular, our Focal Transformer models with a moderate size of 51.1M and a large size of $8 9 . 8 \mathbf { M }$ achieve $\mathbf { 8 3 . 6 \% }$ and $\mathbf { 8 4 . 0 \% }$ Top-1 accuracy, respectively, on ImageNet classification at $2 2 4 \times 2 2 4$ . When employed as the backbones, Focal Transformers achieve consistent and substantial improvements over the current SoTA Swin Transformers [43] across 6 different object detection methods. Our largest Focal Transformer yields 58.7/59.0 box mAPs and 50.9/51.3 mask mAPs on COCO mini-val/test-dev, and 55.4 mIoU on ADE20K for semantic segmentation, creating new SoTA on three of the most challenging computer vision tasks. Our code is available at: https://github. com/microsoft/Focal-Transformer.
|
| 9 |
+
|
| 10 |
+
# 1 Introduction
|
| 11 |
+
|
| 12 |
+
Nowadays, Transformer [57] has become a prevalent model architecture in natural language processing (NLP) [20, 6]. In the light of its success in NLP, there is an increasing effort on adapting it to computer vision (CV) [47, 50]. Since its promise firstly demonstrated in Vision Transformer (ViT) [21], we have witnessed a flourish of full-Transformer models for image classification [55, 60, 64, 43, 76, 56], object detection [8, 85, 79, 18] and semantic segmentation [58, 62]. Beyond these static image tasks, it has also been applied on various temporal understanding tasks, such as action recognition [40, 78, 10], object tracking [13, 59], scene flow estimation [38].
|
| 13 |
+
|
| 14 |
+
The self-attention mechanism is arguably the key component that differentiates Transformers from the widely used convolutional neural networks (CNNs) [37] in computer vision. At each Transformer layer, self-attention enables global content-dependent interactions among different image regions for modeling short- and long-range dependencies, respectively. Through the visualization of full selfattention results1, we indeed observe that self-attention learns to attend local surroundings (like CNNs) and the global contexts at the same time, as illustrated in Fig. 1 (Left). Nevertheless, when dealing with high-resolution vision tasks such as object detection or segmentation, an efficient implementation of a global and fine-grained self-attention becomes non-trivial due to the quadratic computational cost with respect to the number of tokens in feature maps. Recent works have alternatively exploited either a coarse-grained global self-attention [60, 64] or a fine-grained local self-attention [43, 76, 56], for the sake of reducing the computational cost. However, both approaches cripple the power of the original full self-attention i.e., the ability to simultaneously capture local and global visual dependencies.
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
Figure 1: Left: Visualization of the attention maps of the three heads at the given query patch (blue) in the first layer of the DeiT-Tiny model [55]. Right: An illustrative depiction of focal attention mechanism. Three granularity levels are used to compose the attention region for the blue query.
|
| 18 |
+
|
| 19 |
+
In this paper, we present a new attention mechanism to capture both short- and long-range interactions in Transformer layers for high-resolution input images. Considering that the visual dependencies between the nearby (local) regions are usually much stronger than the dependencies between the regions that are far away, we perform the fine-grained attention only in local regions while the coarse-grained attention globally. As depicted in Fig. 1 (Right), a query token in the feature map attends its closest local surroundings at the finest granularity as itself. However, when it goes to the regions far away, it attends to summarized tokens to capture coarse-grained visual dependencies. We call this new mechanism focal attention, as each token attends the others in a focal manner. We will show in this study that focal attention allows to effectively model visual dependencies among all regions covering the whole high-resolution feature maps while introducing much less number of tokens in the computation than that in the standard self-attention mechanism.
|
| 20 |
+
|
| 21 |
+
Equipped with focal attention, a series of Focal Transformers are developed and validated via a comprehensive empirical study across three core vision tasks, including image classification, object detection and segmentation. Results show that Focal Transformers consistently outperform the SoTA Vision Transformers across various settings (i.e., in model sizes and complexities). Notably, the small Focal Transformer with 51.1M parameters achieves $8 3 . 6 \%$ top-1 accuracy on ImageNet-1K, and the base model with 89.8M parameters obtains $8 4 . 0 \%$ top-1 accuracy. In the fine-tuning experiments for object detection, Focal Transformers consistently outperform the SoTA Swin Transformers [43] across six popular object detection methods. Our largest Focal Transformer model achieves 59.0 box mAP and 51.3 mask mAP on COCO test-dev for object detection and instance segmentation, respectively, and 55.4 mIoU on ADE20K for semantic segmentation. These results demonstrate that focal attention is highly effective in modeling the global interactions in Vision Transformers.
|
| 22 |
+
|
| 23 |
+
# 2 Related work
|
| 24 |
+
|
| 25 |
+
Vision Transformers. Vision Transformer (ViT) is first introduced in [21]. It applies a standard Transformer, originally developed for NLP [57], to encode an image by analogously splitting the image into a sequence of visual tokens. It has demonstrated superior performance to CNNs such as ResNet [33] on multiple image classification benchmarks, when trained with sufficient data [21] and carefully designed data augmentation and regularization methods [55]. The results thus inspire researchers to explore the applications of ViT on various vision tasks beyond image classification, such as self-supervised learning [14, 9, 39], object detection [8, 85, 79, 18] and semantic segmentation [58, 62, 81]. There are also increasing number of studies for improving ViT via data-efficient training [55], improved patch embedding/encoding [16, 71, 31], integrating convolutional projections into transformers [64, 70], and using multi-scale architectures and efficient self-attention mechanisms for high-resolution vision tasks [60, 64, 43, 76, 15]. Recent surveys include [36, 30, 36]. This paper focuses on improving the self-attention mechanism of ViT for encoding high-resolution images.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 2: Model architecture for our Focal Transformers. As highlighted in light blue boxes, our main innovation is the proposed focal attention in each Transformer layer.
|
| 29 |
+
|
| 30 |
+
Efficient global and local self-attention. In many real-world tasks, Transformers need to cope with a large number of input tokens, such as long documents in NLP and high-resolution images in computer vision (CV). Recently, many efficient self-attention mechanisms have been proposed to deal with the quadratic computational and memory cost incurred by the standard self-attention mechanism. On one hand, a number of works in both NLP and CV resort to coarse-grained global self-attention (i.e., attending the down-sampled or summarized tokens) to capture the long-range interactions [49, 46, 60, 64, 31, 23]. Although this approach improves the model efficiency, it loses the detailed context information surrounding the query tokens. On the other hand, to make the computational cost manageable, various local fine-grained attention mechanism (i.e., attending neighboring tokens within a pre-set window size) are used for both NLP [3, 74, 1] and CV [56, 43, 76]. In this paper, we argue that both global and local attentions are important for model performance. This is also validated by some recent studies that aim to improve CNNs by incorporating ways of modeling global attentions [35, 63, 61, 68, 2, 7, 51]. The standard self-attention mechanism used by ViT can indeed learned both types of attentions, as shown in Fig. 1 (Left). But it often incurs a prohibitively high cost for high-resolution images. To the best of our knowledge, the proposed focal attention provides the first mechanism to incorporate local and global attention in a single Transformer layer 2. It can capture both short- and long-range interactions as standard self-attention but in a much more efficient and effective way, especially for high-resolution images.
|
| 31 |
+
|
| 32 |
+
# 3 Method
|
| 33 |
+
|
| 34 |
+
# 3.1 Model architecture
|
| 35 |
+
|
| 36 |
+
To accommodate high-resolution dense prediction tasks, we employ a multi-scale model architecture as in [60, 76, 43]. As shown in Fig. 2, an image $I \in \mathcal { R } ^ { H \times W \times 3 }$ is first partitioned into patches of size $4 \times 4$ , resulting in ${ \frac { H } { 4 } } \times { \frac { W } { 4 } }$ visual tokens with dimension $4 \times 4 \times 3$ . Then, we use a patch embedding layer, consisting of a convolutional layer with filter size and stride both equal to 4, to project these patches into hidden features with dimension $d$ . We then pass this spatial feature map to the four stages of Focal Transformer blocks. In each stage $i \in \{ 1 , 2 , 3 , 4 \}$ , the Focal Transformer block consists of $N _ { i }$ Focal Transformer layers. After each stage, we use a patch embedding layer to reduce the spatial size of feature map by factor 2 and increase the feature dimension by 2. For image classification tasks, we take the average of the output from the last stage and send it to a classification layer. For object detection, the feature maps from the last 3 or all 4 stages are fed to a particular object detector head, depending on the specific detection method we choose to use. The model capacity can be customized by varying the input feature dimension $d$ and the number of Focal Transformer layers.
|
| 37 |
+
|
| 38 |
+
Standard self-attention can capture both short- and long-range interactions at fine-grain, but suffers from high computational cost when it performs attention on high-resolution feature maps as noted in [76]. Take stage 1 in Fig. 2 as an example. For a feature map of size ${ \frac { H } { 4 } } \times { \frac { W } { 4 } } \times d$ , the complexity of self-attention is $\begin{array} { r } { \mathcal { O } ( ( \frac { H } { 4 } \times \frac { W } { 4 } ) ^ { 2 } d ) } \end{array}$ , resulting in an explosion of time and memory cost, considering that $\operatorname* { m i n } ( H , W )$ could be 800 or even larger for object detection. In the next section, we describe how we address this issue with the proposed focal attention mechanism.
|
| 39 |
+
|
| 40 |
+
# 3.2 Token-wise focal attention
|
| 41 |
+
|
| 42 |
+
Focal attention is proposed to make the Transformer layers suitable for encoding high-resolution input images. Instead of attending all tokens at fine-grain, we attend the fine-grain tokens only locally, but the summarized ones (i.e., the coarse-grained tokens generated by sub-window pooling, which is illustrated in Fig. 4 and will be described later) globally. As such, focal attention can cover the same amount of image regions as standard self-attention but with much less cost. In Fig. 3, we show the size of the receptive field for standard self-attention and our focal attention as a function of the number of attended tokens. For a given query position, by reducing the granularity of its surroundings based on their distance to the query, focal attention can have significantly larger receptive fields at the same cost measured by the number of visual tokens, compared to the standard self-attention mechanism.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 3: The size of receptive field (yaxis) as a function of the number of used visual tokens $\mathbf { \bar { x } }$ -axis) in regular (standard) self-attention and focal attention. When plotting the curve for focal attention, we increase the focal window size by 2 for each focal level up to the maximal window size of 8.
|
| 46 |
+
|
| 47 |
+
Theoretically, the focal attention mechanism enables global interaction with much less time and memory cost, because it attends a much smaller number of surrounding (summarized) tokens. In practice, however, extracting the surrounding tokens for each query position could incur high time cost since we need to duplicate the extraction of each token for all queries that the token surrounds. This issue had been extensively discussed in [56, 76, 43] and a common solution is to partition the input feature map into windows. Thus, in our Focal Transformers, we resort to performing focal attention at the window level. We elaborate the window-wise focal attention in the following.
|
| 48 |
+
|
| 49 |
+
# 3.2.1 Window-wise focal attention
|
| 50 |
+
|
| 51 |
+
Given a feature map of $\boldsymbol { x } \in \mathcal { R } ^ { M \times N \times d }$ with spatial size $M \times N$ , we first partition it into a grid of windows of size $s _ { p } \times s _ { p }$ . Then, we extract the surroundings for each window rather than each individual token. The proposed window-wise focal attention is illustrated in Fig. 4. To clarify, we first define three terms:
|
| 52 |
+
|
| 53 |
+
• Focal level $L$ refers to the granularity level at which we extract the tokens for focal attention.
|
| 54 |
+
• Focal window size $s _ { w } ^ { l }$ is the size of sub-window on which the summarized tokens are formed via
|
| 55 |
+
sub-window pooling at granularity level of $l \in \{ 1 , . . . , L \}$ .
|
| 56 |
+
• Focal region size $s _ { r } ^ { l }$ denotes the number of sub-windows that are filled up horizontally (or vertically) in an attended region at level $l$ .
|
| 57 |
+
|
| 58 |
+
Now, we detail how window-wise focal attention works in the following two steps, sub-window pooling and attention computing.
|
| 59 |
+
|
| 60 |
+
Sub-window pooling. Consider input feature map $\boldsymbol { x } \in \mathcal { R } ^ { M \times N \times d }$ , where $M \times N$ is the spatial dimension and $d$ the feature dimension. We perform sub-window pooling for all $L$ levels. At focal level $l$ , we first split the input feature map $x$ into a grid of sub-windows with size $s _ { w } ^ { l } \times s _ { w } ^ { l }$ . Then we use a linear projection layer $f _ { p } ^ { l }$ to pool the sub-windows spatially by
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { x ^ { l } = f _ { p } ^ { l } ( \hat { x } ) \in \mathcal { R } ^ { \frac { M } { s _ { w } ^ { l } } \times \frac { N } { s _ { w } ^ { l } } \times d } , \quad \hat { x } = \mathrm { R e s h a p e } ( x ) \in \mathcal { R } ^ { ( \frac { M } { s _ { w } ^ { l } } \times \frac { N } { s _ { w } ^ { l } } \times d ) \times ( s _ { w } ^ { l } \times s _ { w } ^ { l } ) } . } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The pooled feature maps $\{ x ^ { l } \} _ { 1 } ^ { L }$ at different levels $l$ provide rich information at both fine-grain and coarse-grain. Since we set $s _ { w } ^ { l } = 1$ for the first focal level which has the same granularity as the input
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 4: An illustration of focal attention at window level. Each of the square cells represents a visual token that is either from the original feature map or a summarized token formed by sub-window pooling. Suppose we have an input feature map of size $2 0 \times 2 0$ . We first partition it into $5 \times 5$ windows of size $4 \times 4$ . Take the $4 \times 4$ blue window in the middle as the query set, we extract its surrounding tokens at three granularity levels as its keys and values. For the first level, we extract the $8 \times 8$ tokens which are closest to the blue window at the finest grain. At the second level, we expand the attention region and pool the surrounding $2 \times 2$ sub-windows to form summarized tokens, which results in $6 \times 6$ summarized tokens. At the third level, we attend a larger region covering the whole feature map and pool $4 \times 4$ sub-windows, which leads to $5 \times 5$ summarized tokens. Finally, these three levels of tokens are concatenated to compute the keys and values for the $4 \times 4 = 1 6$ tokens (queries) in the blue window.
|
| 70 |
+
|
| 71 |
+
feature map, there is no need to perform any sub-window pooling. Considering that the focal window size is usually very small (7 maximally in our settings), the number of extra parameters introduced by sub-window pooling is negligible.
|
| 72 |
+
|
| 73 |
+
Attention computing. Once we obtain the pooled feature maps $\{ x ^ { l } \} _ { 1 } ^ { L }$ at all $L$ levels, we compute the query at the first level, and key and value for all levels using three linear projection layers $f _ { q } , f _ { k }$ and $f _ { v }$ , respectively, as
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
Q = f _ { q } ( x ^ { 1 } ) , \quad K = \{ K ^ { l } \} _ { 1 } ^ { L } = f _ { k } ( \{ x ^ { 1 } , . . . , x ^ { L } \} ) , \quad V = \{ V ^ { l } \} _ { 1 } ^ { L } = f _ { v } ( \{ x ^ { 1 } , . . . , x ^ { L } \} ) .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
To perform focal attention, we need to first extract the surrounding tokens for each query token in the feature map. As mentioned earlier, tokens inside a window partition $s _ { p } \times s _ { p }$ share the same set of surroundings. For the queries inside the $i$ -th window $Q _ { i } \in \mathcal { R } ^ { s _ { p } \times s _ { p } \times d }$ , we extract the $s _ { r } ^ { l } \times s _ { r } ^ { l }$ keys and values from $K ^ { l }$ and $V ^ { l }$ surrounding the window which the query lies in, and then gather the keys and values from all $L$ levels to obtain $\breve { K } _ { i } = \{ K _ { i } ^ { 1 } , . . . , K _ { i } ^ { L } \} \in \mathscr { R } ^ { \bar { s } \times d }$ and $V _ { i } = \{ V _ { i } ^ { 1 } , . . . , \mathbf { \bar { V } } _ { i } ^ { L } \} \in \mathcal { R } ^ { s \times d }$ , where imple $s$ is the sum of focal regions from all levels, i.e., ntation of focal attention following Fig. 1 requires $\begin{array} { r } { s = \sum _ { l = 1 } ^ { L } ( s _ { r } ^ { l } ) ^ { 2 } } \end{array}$ . Note that a canonicalverlapped regions across different levels. In our implementation, we intentionally keep them in order to capture the pyramid information for the overlapped regions. Finally, we follow [43] to include a relative position bias and compute the focal attention for $Q _ { i }$ by
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathrm { A t t e n t i o n } ( Q _ { i } , K _ { i } , V _ { i } ) = \mathrm { S o f t m a x } ( \frac { Q _ { i } K _ { i } ^ { T } } { \sqrt { d } } + B ) V _ { i } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $B = \{ B ^ { l } \} _ { 1 } ^ { L }$ is the learnable relative position bias. It consists of $L$ subsets for $L$ focal levels. Similar to [43], for the first level, we parameterize it as $B ^ { 1 } \in \mathcal { R } ^ { ( 2 s _ { p } - 1 ) \times ( 2 s _ { p } - 1 ) }$ , considering that the horizontal and vertical position ranges are both in $[ - s _ { p } + 1 , s _ { p } - 1 ]$ . For the other focal levels, considering that they have different granularity with respect to the queries, we treat all the queries inside a window equally and use $B ^ { l } \in \mathcal { R } ^ { s _ { r } ^ { l } \times s _ { r } ^ { l } }$ to represent the relative position bias between the query window and each of $s _ { r } ^ { l } \times s _ { r } ^ { l }$ summarized tokens. Since the focal attention for each window can be performed independent of the others, we can compute Eq. (3) in parallel. Once we obtain attention scores for the whole input feature map, we send them to LayerNorm and the MLP block.
|
| 86 |
+
|
| 87 |
+
<table><tr><td></td><td>Output Size</td><td>Layer Name</td><td>Focal-Tiny</td><td></td><td>Focal-Small</td><td></td><td>Focal-Base</td><td></td></tr><tr><td rowspan="2">stage 1</td><td>56×56</td><td>Patch Embedding</td><td>p1= 4;c1 = 96</td><td></td><td>p1=4;c1= 96</td><td></td><td>p1 = 4;c1 = 128</td><td></td></tr><tr><td>56×56</td><td>Transformer Block</td><td>{1,13} 三 s={7,7</td><td>×2</td><td>二 {1,13} ={7,7}</td><td>×2</td><td>{1,13} ={7,7}</td><td>×2</td></tr><tr><td rowspan="2">stage 2</td><td>28×28</td><td>Patch Embedding</td><td>P2=2;c=192</td><td></td><td>P2=2;C=192</td><td></td><td>P2=2;C= 256</td><td></td></tr><tr><td>28×28</td><td>Transformer Block</td><td>{1,13} 三 swr={7,5} 1</td><td>×2</td><td>={1,13} sw,r={7,5} 1</td><td>×2</td><td>{1,13} 二 su,r={7,5}</td><td>×2</td></tr><tr><td rowspan="2">stage 3</td><td>14 × 14</td><td>Patch Embedding</td><td>p3=2;c3=384</td><td></td><td>p3=2; c3= 384</td><td></td><td>p3=2; c3= 512</td><td></td></tr><tr><td>14 × 14</td><td>Transformer Block</td><td>={1,13} s={7,3}</td><td>×6</td><td>={1,13} ={7,3}</td><td>×18</td><td>={1,13} ={7,3}</td><td>×18</td></tr><tr><td rowspan="2">stage 4</td><td>7×7</td><td>Patch Embedding</td><td>P4=2;C4=768</td><td></td><td>P4=2;C4=768</td><td></td><td>P4= 2;C4=1024</td><td></td></tr><tr><td>7×7</td><td>Transformer Block</td><td>二 {1,7}</td><td>×2</td><td>{1,7} s 三 ={7,1}</td><td>×2</td><td>二 {1,7} su,r {7,1} 二</td><td>×2</td></tr></table>
|
| 88 |
+
|
| 89 |
+
Table 1: Model configurations for Focal Transformers. We use three configurations with different model capacities: Focal-Tiny, Focal-Small and Focal-Base.
|
| 90 |
+
|
| 91 |
+
# 3.2.2 Complexity analysis
|
| 92 |
+
|
| 93 |
+
We analyze the computational complexity for the two steps of focal attention described above. For the input feature map $\dot { \boldsymbol { x } } \in \mathcal { R } ^ { M \times N \times d }$ , we have $\begin{array} { r } { \frac { M } { s _ { w } ^ { l } } \times \frac { N } { s _ { w } ^ { l } } } \end{array}$ sub-windows at focal level l. For each sub-window, the pooling operation in Eq.1 has the complexity of $\mathcal { O } ( ( s _ { w } ^ { l } ) ^ { 2 } d )$ . Aggregating all sub-windows brings us $O ( ( M N ) d )$ . Then for all focal levels, we have the complexity of $\mathcal { O } ( L ( M N ) d )$ in total, which is independent of the sub-window size at each focal level. Regarding the attention computation in Eq. 3, the computational cost for a query window $s _ { p } \times s _ { p }$ is $\mathcal { O } ( ( s _ { p } ) ^ { 2 } \textstyle \sum _ { l } ( s _ { r } ^ { l } ) ^ { 2 } d )$ , and $\mathcal { O } ( \dot { \sum } _ { l } ( s _ { r } ^ { l } ) ^ { 2 } ( M \dot { N } ) d )$ for the whole input feature map. To sum up, the overall computational cost for focal attention is $\begin{array} { r } { \mathcal { O } ( ( L + \sum _ { l } ( s _ { r } ^ { l } ) ^ { \bar { 2 } } ) ( M N ) d ) } \end{array}$ . In an extreme case, one can set $s _ { r } ^ { \hat { L } } = 2 \times \operatorname* { m a x } ( M , N ) / s _ { w } ^ { L }$ to ensure a global receptive field for all queries (including both corner and middle queries) in this layer.
|
| 94 |
+
|
| 95 |
+
# 3.3 Model configurations
|
| 96 |
+
|
| 97 |
+
For fair comparison, we consider three network configurations for Focal Transformers, following [60, 64, 43]. Specifically, we follow the design of the Tiny, Small and Base models in Swin Transformer [43], as shown in Table 1. Our models take $2 2 4 \times 2 2 4$ images as inputs and the window partition size is set to 7 to make our models comparable to Swin Transformers. For the focal attention layer, we introduce two levels, one for fine-grained local attention and the other for coarse-grained global attention. Except for the last stage, the focal region size is set to 13 for the window partition size of 7, which means that we expand 3 tokens for each window partition. For the last stage, since the whole feature map is $7 \times 7$ , the focal region size at level 0 is set to 7, which is sufficient to cover the entire feature map. For the coarse-grained global attention, we set its focal window size the same as the window partition size 7, but gradually decrease the focal region size to get $\{ 7 , 5 , 3 , 1 \}$ for the four stages, respectively. For the patch embedding layer, the spatial reduction ratio $p _ { i }$ for the four stages are all $\{ 4 , 2 , 2 , 2 \}$ . Note that Focal-Base has a higher hidden dimension $c _ { i }$ , compared to Focal-Tiny and Focal-Small.
|
| 98 |
+
|
| 99 |
+
# 4 Experiments
|
| 100 |
+
|
| 101 |
+
# 4.1 Image classification on ImageNet-1K
|
| 102 |
+
|
| 103 |
+
We compare different methods on ImageNet-1K [19]. For fair comparison, we follow the training recipes in [55, 60]. All models are trained for 300 epochs with batch size 1024. The initial learning rate is set to $1 0 ^ { - 3 }$ with 20 epochs of linear warm-up starting from $1 0 ^ { - 5 }$ . For optimization, we use AdamW [44] as the optimizer with a cosine learning rate scheduler. The weight decay is set to 0.05 and the maximal gradient norm is clipped to 5.0. We use the same set of data augmentation and regularization strategies used in [55] after excluding random erasing [82], repeated augmentation [4, 34] and exponential moving average (EMA) [48]. The stochastic depth drop rates are set to 0.2, 0.2 and 0.3 for our tiny, small and base models, respectively. During training, we crop images randomly to $2 2 4 \times 2 2 4$ , while a center crop is used during evaluation on the validation set.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Model</td><td>#Params. FLOPs</td><td>Top-1 (%)</td></tr><tr><td>ResNet-50 [33]</td><td>25.0 4.1</td><td>76.2</td></tr><tr><td>DeiT-Small/16 [55]</td><td>22.1 4.6</td><td>79.9</td></tr><tr><td>PVT-Small [60]</td><td>24.5 3.8</td><td>79.8</td></tr><tr><td>ViL-Small [76]</td><td>24.6 5.1</td><td>82.0</td></tr><tr><td>CvT-13 [64]</td><td>20.0 4.5</td><td>81.6</td></tr><tr><td>Swin-Tiny [43]</td><td>28.3 4.5</td><td>81.2</td></tr><tr><td>Focal-Tiny (Ours)</td><td>28.9 4.9</td><td>82.2</td></tr><tr><td>ResNet-101[33]</td><td>45.0 7.9</td><td>77.4</td></tr><tr><td>PVT-Medium [60]</td><td>44.2 6.7</td><td>81.2</td></tr><tr><td>CvT-21 [64]</td><td>32.0 7.1</td><td>82.5</td></tr><tr><td>ViL-Medium [76]</td><td>39.7 9.1</td><td>83.3</td></tr><tr><td>Swin-Small [43]</td><td>49.6 8.7</td><td>83.1</td></tr><tr><td>Focal-Small (Ours)</td><td>51.1 9.4</td><td>83.6</td></tr><tr><td>ResNet-152[33]</td><td>60.0 11.0</td><td>78.3</td></tr><tr><td>ViT-Base/16 [21]</td><td>86.6 17.6</td><td>77.9</td></tr><tr><td>DeiT-Base/16 [55]</td><td>17.5</td><td>81.8</td></tr><tr><td></td><td>86.6</td><td></td></tr><tr><td>PVT-Large [60]</td><td>61.4 9.8</td><td>81.7</td></tr><tr><td>ViL-Base[76]</td><td>55.7 13.4</td><td>83.2</td></tr><tr><td>Swin-Base [43]</td><td>87.8 15.4</td><td>83.4</td></tr><tr><td>Focal-Base (Ours)</td><td>89.8</td><td>16.4 84.0</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 2: Comparison of image classification on ImageNet-1K for different models. Except for ViT-Base/16, all other models are trained and evaluated on $2 2 4 \times 2 2 4$ resolution.
|
| 108 |
+
|
| 109 |
+
Table 3: Comparisons with CNN and Transformer baselines and SoTA methods on COCO object detection. The box mAP $( A P ^ { b } )$ and mask mAP $( A P ^ { m } )$ are reported for RetinaNet and Mask R-CNN trained with $1 \times$ schedule. More detailed comparisons with $3 \times$ schedule are in Table 4.
|
| 110 |
+
|
| 111 |
+
<table><tr><td rowspan="2">Backbone</td><td>RetinaNet</td><td>Mask R-CNN</td><td></td></tr><tr><td>APb</td><td>Apb</td><td>APm</td></tr><tr><td>ResNet-50 [33]</td><td>36.3</td><td>38.0</td><td>34.4</td></tr><tr><td>PVT-Small</td><td>40.4</td><td>40.4</td><td>37.8</td></tr><tr><td>ViL-Small [76]</td><td>41.6</td><td>41.8</td><td>38.5</td></tr><tr><td>Swin-Tiny [43]</td><td>42.0</td><td>43.7</td><td>39.8</td></tr><tr><td>Focal-Tiny (Ours)</td><td>43.7 (+1.7)</td><td>44.8 (+1.1)</td><td> 41.0 (+1.3)</td></tr><tr><td>ResNet-101[33]</td><td>38.5</td><td>40.4</td><td>36.4</td></tr><tr><td>ResNeXt101-32x4d [67]</td><td>39.9</td><td>41.9</td><td>37.5</td></tr><tr><td>PVT-Medium [60]</td><td>41.9</td><td>42.0</td><td>39.0</td></tr><tr><td>ViL-Medium [76]</td><td>42.9</td><td>43.4</td><td>39.7</td></tr><tr><td>Swin-Small [43]</td><td>45.0</td><td>46.5</td><td>42.1</td></tr><tr><td>Focal-Small (Ours)</td><td>45.6 (+0.6)</td><td>47.4 (+0.9)</td><td> 42.8 (+0.7)</td></tr><tr><td>ResNeXt101-64x4d[67] 41.0</td><td></td><td>42.8</td><td>38.4</td></tr><tr><td>PVT-Large [60]</td><td>42.6</td><td>42.9</td><td>39.5</td></tr><tr><td>ViL-Base[76]</td><td>44.3</td><td>45.1</td><td>41.0</td></tr><tr><td>Swin-Base [43]</td><td>45.0</td><td>46.9</td><td>42.3</td></tr><tr><td>Focal-Base (Ours)</td><td>46.3 (+1.3)</td><td>47.8 (+0.9)</td><td>43.2 (+0.9)</td></tr></table>
|
| 112 |
+
|
| 113 |
+
In Table 2, we summarize the results for baseline models and the state-of-the-art models on image classification task. We can see that Focal Transformers consistently outperform other methods with similar model sizes (#Params.) and computational complexities (GFLOPs). Specifically, Focal-Tiny improves over the Transformer baseline DeiT-Small/16 by $2 . 3 \%$ . Meanwhile, using the same model configuration (2-2-6-2) and a few extra parameters and computations, Focal-Tiny improves over Swin-Tiny by 1.0 point. For small and base models, Focal-Small with 51.1M parameters can reach $8 3 . 6 \%$ which is better than all the counterpart small and base models using much less parameters. By increasing the model size, Focal-Base model achieves $8 4 . 0 \%$ , surpassing all the other models with comparable parameters and FLOPs.
|
| 114 |
+
|
| 115 |
+
To compare with the large-scale models, we further build Focal-Large Transformer by increasing the hidden dimension in Focal-Base from 128 to 196 while keeping all the other hyperparameters the same. We follow the common practice to pretrain our Focal-Large Transformer on ImageNet-22K and transfer it to detection and segmentation tasks [64, 43].
|
| 116 |
+
|
| 117 |
+
# 4.2 Object detection and instance segmentation
|
| 118 |
+
|
| 119 |
+
We benchmark our models on object detection with COCO 2017 [42]. The pretrained models are used as visual backbones and then plugged into two representative pipelines, RetinaNet [41] and Mask R-CNN [32]. All models are trained on the $1 1 8 \mathrm { k }$ training images and the results are reported on 5K validation set. We use the two standard training schedules, $1 \times$ with 12 epochs and $3 \times$ with 36 epochs. For the $1 \times$ schedule, we resize image’s shorter side to 800 while keeping its longer side no more than 1,333. For the $3 \times$ schedule, we use the multi-scale training strategy by randomly resizing its shorter side to the range of [480, 800]. Considering this higher input resolution, we adaptively increase the focal sizes at four stages to (15, 13, 9, 7), to ensures that the focal attention covers more than half of the image region at the first two stages, and the whole image at the last two stages. With the focal size increased, the relative position biases are accordingly up-sampled to the corresponding sizes using bilinear interpolation. During training, we use AdamW [44] for optimization with initial learning rate $1 0 ^ { - 4 }$ and weight decay 0.05. Similarly, we use 0.2, 0.3 and 0.5 stochastic depth drop rates to regularize the training for our Tiny, Small and Base models, respectively. Since Swin Transformer does not report the results on RetinaNet, we obtain the results by ourselves using their official code with the same hyper-parameters as that of Focal Transformers.
|
| 120 |
+
|
| 121 |
+
In Table 3, we show the performance for both CNN-based models and the current Transformerbased state-of-the-art models. The bbox mAP $( A P ^ { b } )$ and mask mAP $( A P ^ { m } )$ are reported. We see that Focal Transformers outperform the CNN-based models consistently with the gap of 4.8-7.1 points. Compared with the other methods which also use multi-scale Transformer architectures,
|
| 122 |
+
|
| 123 |
+
Table 4: COCO object detection and segmentation results with RetinaNet [41] and Mask R-CNN [33]. All models are trained with $3 \times$ schedule and multi-scale inputs (MS). The numbers before and after “/” at column 2 and 3 are the model size and complexity for RetinaNet and Mask R-CNN, respectively.
|
| 124 |
+
|
| 125 |
+
<table><tr><td rowspan="2">Backbone</td><td rowspan="2">#Params (M)</td><td rowspan="2">FLOPs (G)</td><td colspan="6">RetinaNet 3x schedule + MS</td><td colspan="6">Mask R-CNN 3x schedule + MS</td></tr><tr><td>AP</td><td>AP5</td><td>AP</td><td>APs</td><td>APM</td><td>APL</td><td>AP6</td><td>AP</td><td>AP</td><td>Apm</td><td>AP</td><td>AP</td></tr><tr><td>ResNet50 [33]</td><td>37.7/44.2</td><td>239/260</td><td>39.0</td><td>58.4</td><td>41.8</td><td>22.4</td><td>42.8</td><td>51.6</td><td>41.0</td><td>61.7</td><td>44.9</td><td>37.1</td><td>58.4</td><td>40.1</td></tr><tr><td>PVT-Small[60]</td><td>34.2/44.1</td><td>226/245</td><td>42.2</td><td>62.7</td><td>45.0</td><td>26.2</td><td>45.2</td><td>57.2</td><td>43.0</td><td>65.3</td><td>46.9</td><td>39.9</td><td>62.5</td><td>42.8</td></tr><tr><td>ViL-Small [76]</td><td>35.7/45.0</td><td>252/174 42.9</td><td></td><td>63.8</td><td>45.6</td><td>27.8</td><td>46.4</td><td>56.3</td><td>43.4</td><td>64.9</td><td>47.0</td><td>39.6</td><td>62.1</td><td>42.4</td></tr><tr><td>Swin-Tiny [43]</td><td>38.5/47.8</td><td>245/264 45.0</td><td></td><td>65.9</td><td>48.4</td><td>29.7</td><td>48.9</td><td>58.1</td><td>46.0</td><td>68.1</td><td>50.3</td><td>41.6</td><td>65.1</td><td>44.9</td></tr><tr><td>Focal-Tiny (Ours)</td><td>39.4/48.8</td><td>265/291</td><td> 45.5</td><td>66.3</td><td>48.8</td><td>31.2</td><td>49.2</td><td>58.7</td><td>47.2</td><td>69.4</td><td>51.9</td><td>42.7</td><td>66.5</td><td> 45.9</td></tr><tr><td>ResNet101 [33]</td><td>56.7/63.2</td><td>315/33640.9</td><td></td><td>60.1</td><td>44.0</td><td>23.7</td><td>45.0</td><td>53.8</td><td>42.8</td><td>63.2</td><td>47.1</td><td>38.5</td><td>60.1</td><td>41.3</td></tr><tr><td>ResNeXt101-32x4d [67]</td><td>56.4/62.8</td><td>319/340</td><td>41.4</td><td>61.0</td><td>44.3</td><td>23.9</td><td>45.5</td><td>53.7</td><td>44.0</td><td>64.4</td><td>48.0</td><td>39.2</td><td>61.4</td><td>41.9</td></tr><tr><td>PVT-Medium [60]</td><td>53.9/63.9</td><td>283/302</td><td>43.2</td><td>63.8</td><td>46.1</td><td>27.3</td><td>46.3</td><td>58.9</td><td>44.2</td><td>66.0</td><td>48.2</td><td>40.5</td><td>63.1</td><td>43.5</td></tr><tr><td>ViL-Medium [76]</td><td>50.8/60.1</td><td>339/261</td><td>43.7</td><td>64.6</td><td>46.4</td><td>27.9</td><td>47.1</td><td>56.9</td><td>44.6</td><td>66.3</td><td>48.5</td><td>40.7</td><td>63.8</td><td>43.7</td></tr><tr><td>Swin-Small [43]</td><td>59.8/69.1</td><td>335/354 46.4</td><td></td><td>67.0</td><td>50.1</td><td>31.0</td><td>50.1</td><td>60.3</td><td>48.5</td><td>70.2</td><td>53.5</td><td>43.3</td><td>67.3</td><td>46.6</td></tr><tr><td>Focal-Small (Ours)</td><td>61.7/71.2</td><td>367/401</td><td>47.3</td><td>67.8</td><td>51.0</td><td>31.6</td><td>50.9</td><td>61.1</td><td>48.8</td><td>70.5</td><td>53.6</td><td>43.8</td><td>67.7</td><td>47.2</td></tr><tr><td>ResNeXt101-64x4d [67]</td><td>95.5/102</td><td>473/493</td><td>41.8</td><td>61.5</td><td>44.4</td><td>25.2</td><td>45.4</td><td>54.6</td><td>44.4</td><td>64.9</td><td>48.8</td><td>39.7</td><td>61.9</td><td>42.6</td></tr><tr><td>PVT-Large[60]</td><td>71.1/81.0</td><td>345/364 43.4</td><td></td><td>63.6</td><td>46.1</td><td>26.1</td><td>46.0</td><td>59.5</td><td>44.5</td><td>66.0</td><td>48.3</td><td>40.7</td><td>63.4</td><td>43.7</td></tr><tr><td>ViL-Base [76]</td><td>66.7/76.1</td><td>443/365 44.7</td><td></td><td>65.5</td><td>47.6</td><td>29.9</td><td>48.0</td><td>58.1</td><td>45.7</td><td>67.2</td><td>49.9</td><td>41.3</td><td>64.4</td><td>44.5</td></tr><tr><td>Swin-Base 43]</td><td>98.4/107</td><td>477/496 45.8</td><td></td><td>66.4</td><td>49.1</td><td>29.9</td><td>49.4</td><td>60.3</td><td>48.5</td><td>69.8</td><td>53.2</td><td>43.4</td><td>66.8</td><td>46.9</td></tr><tr><td>Focal-Base (Ours)</td><td>100.8/110.0 514/533 46.9</td><td></td><td></td><td>67.8</td><td>50.3</td><td>31.9</td><td>50.3</td><td>61.5</td><td>49.0</td><td>70.1</td><td>53.6</td><td>43.7</td><td>67.6</td><td>47.0</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Focal Transformers show substantial gains across all settings and metrics. Particularly, Focal Transformers brings 0.7-1.7 points of mAP against the current best approach Swin Transformer [43] at comparable settings. Different from the other multi-scale Transformer models, Focal Transformers can simultaneously enable short-range fine-grain and long-range coarse-grain interactions for each visual token, and thus capture richer visual contexts at each layer for better dense predictions. To have more comprehensive comparisons, we train all models using the $3 \times$ schedule and show the detailed numbers for RetinaNet and Mask R-CNN in Table 4. As we can see, even with the $3 \times$ schedule, Focal Transformers can still achieve 0.3-1.1 gain over Swin Transformer models in comparable settings.
|
| 128 |
+
|
| 129 |
+
Comparison with large SoTA detection models. We follow Swin Transformers to use HTC [11] as the detection method in that it reported SoTA performance on COCO detection when using Swin Transformer as the backbone. For fair comparison, we also use soft-NMS [5], instaboost [24] and a multi-scale training strategy with the shorter side in range [400, 1400] and the longer side no more than 1600. We train the model using AdamW [44] with base learning rate 1e-4 and weight decay 0.1. The model is trained using the standard $3 \times$ schedule. The box and mask mAPs on COCO validation set and test-dev are reported in Table 5, where both single-scale evaluation and multi-scale evaluation results are presented. Our Focal-Large model with multi-scale test achieves 58.1 box mAP and 50.9 mask mAP on mini-val set, which is better than the reported numbers for Swin-Large in [43]. When evaluating our model on the test-dev set, it achieves 58.4 box mAP and 51.3 mask mAP, which is slightly better than Swin Transformer. Note that because our model does not include the global self-attention layer used in Swin Transformer at the last stage, it has a smaller model size and fewer FLOPs. More recently, DyHead [17] achieves new SoTA on COCO, when combined with Swin-Large. We replace the Swin-Large model with the Focal-Large model, and use the same $2 \times$ training schedule as in [17]. We report the box mAPs for both mini-val and test-dev. Focal-Large achieves 58.7 and 59.0 on mini-val and test-dev, respectively.
|
| 130 |
+
|
| 131 |
+
# 4.3 Semantic Segmentation
|
| 132 |
+
|
| 133 |
+
In addition to the instance segmentation results, we also evaluate our models on the semantic segmentation task which usually takes high-resolution input images and requires capturing long-range interactions. We benchmark our methods on ADE20K [83]. We use UperNet [65] as the segmentation method and Focal Transformers as the backbones. We train three models as Focal-Tiny, Focal-Small, Focal-Base, respectively. For all the models, we use a standard recipe that sets the input size to $5 1 2 \times 5 1 2$ and trains the model for 160k iterations with batch size 16. Table 6 shows the comparison results. We see that Focal-Tiny, Focal-Small and Focal-Base models consistently outperform Swin Transformers of the similar size in single-scale and multi-scale mIoUs.
|
| 134 |
+
|
| 135 |
+
Comparison with large SoTA semantic segmentation models. We use the pretrained Focal-Large model as the backbone for semantic segmentation. Follow the setting in [43], we use input image size $6 4 0 \times 6 4 0$ and train the model for 160k iterations with a batch size of 16. We set the initial learning to 6e-5 and use a polynomial learning rate decay. The weight decay is set to 0.01. For
|
| 136 |
+
|
| 137 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">#Param FLOPs</td><td rowspan="2"></td><td colspan="2">mini-val</td><td colspan="2">test-dev</td></tr><tr><td>Apb</td><td>APm</td><td>Apb</td><td>Apm</td></tr><tr><td>X101-64x4d [67]</td><td>155M</td><td>1033G 52.3</td><td></td><td>46.0</td><td></td><td></td></tr><tr><td>EfficientNet-D7 [54]</td><td>77M</td><td>410G</td><td>54.4</td><td>-</td><td>55.1</td><td>=</td></tr><tr><td>GCNet*[7]</td><td>-</td><td>1041G</td><td>51.8</td><td>44.7</td><td>52.3</td><td>45.4</td></tr><tr><td>ResNeSt-200 [75]</td><td>=</td><td></td><td>52.5</td><td>=</td><td>53.3</td><td>47.1</td></tr><tr><td>Copy-paste [28]</td><td>185M</td><td>1440G 55.9</td><td></td><td>47.2</td><td>56.0</td><td>47.4</td></tr><tr><td>BoTNet-200 [51]</td><td>-</td><td></td><td>49.7</td><td></td><td>-</td><td></td></tr><tr><td>SpineNet-190 [22]</td><td>164M</td><td>1885G 52.6</td><td></td><td></td><td>52.8</td><td></td></tr><tr><td>CenterNet2 [84]</td><td>-</td><td>=</td><td>-</td><td>-</td><td>56.4</td><td>=</td></tr><tr><td>Swin-L (HTC++) [43]</td><td>284M</td><td>1470G 57.1</td><td></td><td>49.5</td><td>57.7</td><td>50.2</td></tr><tr><td>Swin-L (DyHead)[17]</td><td>213M</td><td>965G</td><td>56.2</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Swin-L† (HTC++) [43]</td><td>284M</td><td></td><td>58.0</td><td>50.4</td><td>58.7</td><td>51.1</td></tr><tr><td>Swin-L† (DyHead) [17]</td><td>213M</td><td></td><td>58.4</td><td>-</td><td>58.7</td><td></td></tr><tr><td>Swin-L† (QueryInst) [25]</td><td>-</td><td></td><td>56.1</td><td>1</td><td>56.1</td><td></td></tr><tr><td>Focal-L (HTC++) (Ours)</td><td>265M</td><td>1165G</td><td>57.0</td><td>49.9</td><td>-</td><td>=</td></tr><tr><td>Focal-L (DyHead) (Ours)</td><td>229M</td><td>1081G</td><td>56.4</td><td>-</td><td>-</td><td>=</td></tr><tr><td>Focal-L† (HTC++) (Ours)</td><td>265M</td><td>-</td><td>58.1</td><td>50.9</td><td>58.4</td><td>51.3</td></tr><tr><td>Focal-L† (DyHead) (Ours)</td><td>229M</td><td>-</td><td>58.7</td><td>-</td><td>59.0</td><td>-</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 5: Comparison with state-of-the-art methods on COCO object detection and instance segmentation. The numbers are reported on 5K val set and test-dev. Augmented HTC [11] (denoted by $\mathrm { H T C + + }$ ) and DyHead [17] are used as the detection methods. † means multi-scale evaluation.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Backbone</td><td>Method</td><td>#Param FLOPs mIoU +MS</td><td></td><td></td><td></td></tr><tr><td>ResNet-101</td><td>DANet [45]</td><td>69M</td><td>1119G</td><td>45.3</td><td></td></tr><tr><td>ResNet-101</td><td>ACNet [26]</td><td>=</td><td>=</td><td>45.9</td><td></td></tr><tr><td>ResNet-101</td><td>DNL [69]</td><td>69M</td><td>1249G</td><td>46.0</td><td></td></tr><tr><td>ResNet-101</td><td>UperNet [65]</td><td>86M</td><td>1029G</td><td>44.9</td><td></td></tr><tr><td>HRNet-w48 [53]</td><td>OCRNet [73]</td><td>71M</td><td>664G</td><td>45.7</td><td>=</td></tr><tr><td>ResNeSt-200 [75]</td><td>DLab.v3+ [12]</td><td>88M</td><td>1381G</td><td>48.4</td><td>=</td></tr><tr><td>Swin-T[43]</td><td>UperNet [65]</td><td>60M</td><td>945G</td><td>44.5</td><td>45.8</td></tr><tr><td>Swin-S [43]</td><td>UperNet [65]</td><td>81M</td><td>1038G</td><td>47.6</td><td>49.5</td></tr><tr><td>Swin-B [43]</td><td>UperNet [65]</td><td>121M</td><td>1188G</td><td>48.1</td><td>49.7</td></tr><tr><td>Twins-SVT-L[15]</td><td>UperNet [65]</td><td>133M</td><td></td><td>48.8</td><td>50.2</td></tr><tr><td>MiT-B5 [66]</td><td>SegFormer [66]</td><td>85M</td><td></td><td>51.0</td><td>51.8</td></tr><tr><td>ViT-L/16+ [21]</td><td>SETR[80]</td><td>308M</td><td></td><td>50.3</td><td>=</td></tr><tr><td>Swin-L* [43]</td><td>UperNet [65]</td><td>234M</td><td>3230G</td><td>52.1</td><td>53.5</td></tr><tr><td>ViT-L/16 [21]</td><td>Segmenter [52]</td><td>334M</td><td>=</td><td>51.8</td><td>53.6</td></tr><tr><td>Swin-L‡ [43]</td><td>K-Net [77]</td><td>=</td><td></td><td>=</td><td>54.3</td></tr><tr><td>Swin-L‡ [43]</td><td>PatchDiverse [29]</td><td>234M</td><td></td><td>53.1</td><td>54.4</td></tr><tr><td>VOLO-D5 [72]</td><td>UperNet [65]</td><td>=</td><td></td><td>-</td><td>54.3</td></tr><tr><td>Focal-T (Ours)</td><td>UperNet [65]</td><td>62M</td><td>998G</td><td>45.8</td><td>47.0</td></tr><tr><td>Focal-S (Ours)</td><td>UperNet [65]</td><td>85M</td><td>1130G</td><td>48.0</td><td>50.0</td></tr><tr><td>Focal-B (Ours)</td><td>UperNet [65]</td><td>126M</td><td>1354G</td><td>49.0</td><td>50.5</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Focal-L‡ (Ours)</td><td>UperNet [65]</td><td>240M</td><td>3376G</td><td>54.0</td><td>55.4</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 6: Comparison with SoTA methods for semantic segmentation on ADE20K [83] val set. Single- and multi-scale evaluations are reported in the last two columns. $^ \ddag$ means ImageNet-22K is used as the pretraining dataset.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td> W-Size FLOPs Top-1(%) APb APm</td><td></td><td></td></tr><tr><td rowspan="2">Swin-Tiny</td><td>7</td><td>4.5</td><td>81.2 43.739.8</td></tr><tr><td>14</td><td>4.9</td><td>82.1 44.0 40.5</td></tr><tr><td rowspan="2">Focal-Tiny</td><td>7</td><td>4.9</td><td>82.2 44.941.1</td></tr><tr><td>14</td><td>5.2</td><td>82.3 45.5 41.5</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 7: Impact of different window sizes (WSize). We alter the default size 7 to 14 and observe consistent improvements for both methods.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td colspan="3"> W-Shift Top-1(%) APb APm</td></tr><tr><td>Swin-Tiny</td><td>√</td><td>80.2 81.2</td><td>38.8 43.7</td><td>36.4 39.8</td></tr><tr><td rowspan="2">Focal-Tiny</td><td></td><td>82.2</td><td>44.8</td><td>41.0</td></tr><tr><td>√</td><td>81.9</td><td>44.9</td><td>41.1</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 8: Impact of window shift (W-Shift) on Swin Transformer and Focal Transformer. Tiny models are used.
|
| 152 |
+
|
| 153 |
+
multi-scale evaluation, we use the same scaling ratios [0.5, 0.75, 1.0, 1.25, 1.5, 1.75] as in previous works. The results in Table 6 show that Focal-Large achieves significantly better performance than Swin-Large. In both single-scale and multi-scale evaluations, Focal-Large leads to more than 1 point mIoU improvement, creating new SoTA for semantic segmentation on ADE20K.
|
| 154 |
+
|
| 155 |
+
# 4.4 Ablation studies
|
| 156 |
+
|
| 157 |
+
We conduct a series of ablation studies to inspect the model’s capacity from different aspects. We use Focal-Tiny and the image classification and object detection tasks.
|
| 158 |
+
|
| 159 |
+
Effect of varying the window size. We have demonstrated that it is crucial to model both short- and long-range interactions. Thus, a related question is whether increasing the window size helps as it leads to a larger receptive field. Table 7 shows the performance of Swin-Tiny and Focal-Tiny with window sizes 7 and 14. Clearly, a larger window size is beneficial for both methods measured in all three metrics, and Focal-Tiny consistently outperforms Swin-Tiny in both window sizes. Comparing the second and third row, we find that Focal-Tiny outperforms Swin-Tiny even with a smaller window size $( 7 \nu . s . \ 1 4 )$ . We suspect that the gain is attributed to our focal attention’s superior capability of capturing long-range dependencies among visual tokens.
|
| 160 |
+
|
| 161 |
+
The necessity of window shift. In Swin Transformer [43], window shift is proposed to capture crosswindow interactions between two successive layers. In contrast, visual tokens in Focal Transformers can always communicate with each other across windows at both fine- and coarse-grain. Thus, it is interesting to investigate whether adding window shift to Focal Transformers can lead to any improvement. To answer the question, we remove window shift from Swin Transformer while adding it to Focal Transformers. As shown in Table 8, Swin Transformer shows a severe degradation after removing the window shift. However, adding window shift to Focal Transformer hurts classification performance. The result indicates that window shift is unnecessary for Focal Transformers. While in
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 5: Ablating Focal-Tiny model by adding local, global and both interactions, respectively. Blue bars are image classification results and orange bars object detection results. This figure is better viewed in color.
|
| 165 |
+
|
| 166 |
+
<table><tr><td colspan="6">Depths Model #Params. FLOPs Top-1(%) APb Apm</td></tr><tr><td rowspan="2">2-2-2-2</td><td>Swin</td><td>21.2</td><td>3.1</td><td>78.7</td><td>38.2 35.7</td></tr><tr><td>Focal</td><td>21.7</td><td>3.4</td><td>79.9</td><td>40.5 37.6</td></tr><tr><td rowspan="2">2-2-4-2</td><td>Swin</td><td>24.7</td><td>3.8</td><td>80.2</td><td>41.2 38.1</td></tr><tr><td>Focal</td><td>25.4</td><td>4.1</td><td>81.4</td><td>43.3 39.8</td></tr><tr><td rowspan="2">2-2-6-2</td><td>Swin</td><td>28.3</td><td>4.5</td><td>81.2</td><td>43.7 39.8</td></tr><tr><td>Focal</td><td>29.1</td><td>4.9</td><td>82.2</td><td>44.8 41.0</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 9: Impact of the change of model depth. We gradually reduce the number of transformer layers at the third stage from original 6 to 4 and further 2. Our Focal Transformers has much slower drop rate than Swin Transformer.
|
| 169 |
+
|
| 170 |
+
Swin Transformers, there should always be an even number of layers in each stage for the alternative window shift operation, Focal Transformers do not have such a constraint.
|
| 171 |
+
|
| 172 |
+
Contributions of local and global interactions. To investigate the relative contributions of capturing local fine-grain and global coarse-grain interactions in Focal Transformers, we have developed several variants of Focal-Tiny: a) Focal-Tiny-Window merely performs attention inside each window; b) Focal-Tiny-Local attends the additional fine-grain surrounding tokens and c) Focal-Tiny-Global attends the extra coarse-grain summarized tokens. We train these models using the same setting as Focal-Tiny and report their performance on image classification and object detection using Mask R-CNN $1 \times$ schedule. As shown in Fig. 5, Focal-Tiny-Window suffers from a significant performance drop on both image classification $8 2 . 2 \substack { 8 0 . 1 }$ ) and object detection $\cdot 4 4 . 8 \mathrm { \ - } \to 3 8 . 3$ ). This is expected since the communication across windows is completely cut off at each Transformer layer. After we enable either the local fine-grain or global coarse-grain interactions (middle two columns), we observe significant performance boost. When we combine short- and long-range interactions, we observe additional improvements on both tasks. This implies that these two type of interactions are complementary and both are beneficial to model performance.
|
| 173 |
+
|
| 174 |
+
Model capacity against model depth. Focal attention allows a Transformer model to capture shortand long-range interactions at each Transformer layer. An interesting question is whether Focal Transformers need fewer layers to obtain a similar modeling capacity as the Transformer models that does not use focal attention, such as Swin Transformer. To answer this question, we conduct an experiment by training a series of Swin-Tiny and Focal-Tiny models by varying the number of Transformer layers at stage 3. As shown in Table 9, Focal-Tiny outperforms Swin-Tiny consistently with the same depth. More importantly, using fewer layers, Focal-Tiny can sometimes achieve comparable or even better performance than Swin Transformer. For example, Focal-Tiny with (2-2-4-2) achieves 81.4 on image classification which is better than Swin-Tiny with (2-2-6-2).
|
| 175 |
+
|
| 176 |
+
# 5 Conclusion
|
| 177 |
+
|
| 178 |
+
In this paper, we have presented a new focal attention mechanism that enables efficient long-range interactions in Vision Transformers. Different from previous works, it performs the local attention at fine-grain and global attention at coarse-grain, providing an effective way of capturing both shortand long-range context with a manageable computational cost. By applying focal attention into a multi-scale Transformer architecture, we propose Focal Transformers as general-purpose backbones for a wide range of dense vision tasks. A comprehensive empirical study shows that our Focal Transformers outperform the SoTA Vision Transformers on a range of vision tasks including image classification, object detection and segmentation.
|
| 179 |
+
|
| 180 |
+
Limitations and future work. Although our experiments show that focal attention can significantly boost the performance on image classification and dense prediction tasks, focal attention does introduce extra computational and memory cost, since each query token needs to attend more (summarized) tokens in addition to tokens inside a window. A cost-effective implementation of Focal Transformer is necessary to make it more applicable to many real-world scenarios. This study focuses on incorporating focal attention into multi-scale Vision Transformers for CV tasks. However, we notice that focal attention is an effective sparse attention mechanism that is widely applicable to all attention-based neural network models that are developed for processing natural language, images, videos etc. This is an exciting future direction.
|
| 181 |
+
|
| 182 |
+
References
|
| 183 |
+
[1] Joshua Ainslie, Santiago Ontanon, Chris Alberti, Philip Pham, Anirudh Ravula, and Sumit Sanghai. Etc: Encoding long and structured data in transformers. arXiv preprint arXiv:2004.08483, 2020.
|
| 184 |
+
[2] Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3286–3295, 2019.
|
| 185 |
+
[3] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
|
| 186 |
+
[4] Maxim Berman, Hervé Jégou, Andrea Vedaldi, Iasonas Kokkinos, and Matthijs Douze. Multigrain: a unified image embedding for classes and instances. arXiv preprint arXiv:1902.05509, 2019.
|
| 187 |
+
[5] Navaneeth Bodla, Bharat Singh, Rama Chellappa, and Larry S Davis. Soft-nms–improving object detection with one line of code. In Proceedings of the IEEE international conference on computer vision, pages 5561–5569, 2017.
|
| 188 |
+
[6] 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.
|
| 189 |
+
[7] Yue Cao, Jiarui Xu, Stephen Lin, Fangyun Wei, and Han Hu. Gcnet: Non-local networks meet squeezeexcitation networks and beyond. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019.
|
| 190 |
+
[8] 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.
|
| 191 |
+
[9] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021.
|
| 192 |
+
[10] Shuning Chang, Pichao Wang, Fan Wang, Hao Li, and Jiashi Feng. Augmented transformer with adaptive graph for temporal action proposal generation. arXiv preprint arXiv:2103.16024, 2021.
|
| 193 |
+
[11] Kai Chen, Jiangmiao Pang, Jiaqi Wang, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jianping Shi, Wanli Ouyang, et al. Hybrid task cascade for instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4974–4983, 2019.
|
| 194 |
+
[12] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In Proceedings of the European conference on computer vision (ECCV), pages 801–818, 2018.
|
| 195 |
+
[13] Xin Chen, Bin Yan, Jiawen Zhu, Dong Wang, Xiaoyun Yang, and Huchuan Lu. Transformer tracking. arXiv preprint arXiv:2103.15436, 2021.
|
| 196 |
+
[14] Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised visual transformers. arXiv preprint arXiv:2104.02057, 2021.
|
| 197 |
+
[15] Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Twins: Revisiting spatial attention design in vision transformers. arXiv preprint arXiv:2104.13840, 2021.
|
| 198 |
+
[16] Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Conditional positional encodings for vision transformers. Arxiv preprint 2102.10882, 2021.
|
| 199 |
+
[17] Xiyang Dai, Yinpeng Chen, Bin Xiao, Dongdong Chen, Mengchen Liu, Lu Yuan, and Lei Zhang. Dynamic head: Unifying object detection heads with attentions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7373–7382, 2021.
|
| 200 |
+
[18] 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.
|
| 201 |
+
[19] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 202 |
+
[20] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. NAACL, 2019.
|
| 203 |
+
[21] 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.
|
| 204 |
+
[22] Xianzhi Du, Tsung-Yi Lin, Pengchong Jin, Golnaz Ghiasi, Mingxing Tan, Yin Cui, Quoc V Le, and Xiaodan Song. Spinenet: Learning scale-permuted backbone for recognition and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11592–11601, 2020.
|
| 205 |
+
[23] Haoqi Fan, Bo Xiong, Karttikeya Mangalam, Yanghao Li, Zhicheng Yan, Jitendra Malik, and Christoph Feichtenhofer. Multiscale vision transformers. arXiv preprint arXiv:2104.11227, 2021.
|
| 206 |
+
[24] Hao-Shu Fang, Jianhua Sun, Runzhong Wang, Minghao Gou, Yong-Lu Li, and Cewu Lu. Instaboost: Boosting instance segmentation via probability map guided copy-pasting. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 682–691, 2019.
|
| 207 |
+
[25] Yuxin Fang, Shusheng Yang, Xinggang Wang, Yu Li, Chen Fang, Ying Shan, Bin Feng, and Wenyu Liu. Instances as queries, 2021.
|
| 208 |
+
[26] Jun Fu, Jing Liu, Yuhang Wang, Yong Li, Yongjun Bao, Jinhui Tang, and Hanqing Lu. Adaptive context network for scene parsing. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6748–6757, 2019.
|
| 209 |
+
[27] Jianfeng Gao, Patrick Pantel, Michael Gamon, Xiaodong He, and Li Deng. Modeling interestingness with deep neural networks. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2–13, Doha, Qatar, October 2014. Association for Computational Linguistics.
|
| 210 |
+
[28] Golnaz Ghiasi, Yin Cui, Aravind Srinivas, Rui Qian, Tsung-Yi Lin, Ekin D Cubuk, Quoc V Le, and Barret Zoph. Simple copy-paste is a strong data augmentation method for instance segmentation. arXiv preprint arXiv:2012.07177, 2020.
|
| 211 |
+
[29] Chengyue Gong, Dilin Wang, Meng Li, Vikas Chandra, and Qiang Liu. Vision transformers with patch diversification, 2021.
|
| 212 |
+
[30] 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.
|
| 213 |
+
[31] Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer, 2021.
|
| 214 |
+
[32] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961–2969, 2017.
|
| 215 |
+
[33] 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.
|
| 216 |
+
[34] Elad Hoffer, Tal Ben-Nun, Itay Hubara, Niv Giladi, Torsten Hoefler, and Daniel Soudry. Augment your batch: Improving generalization through instance repetition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8129–8138, 2020.
|
| 217 |
+
[35] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132–7141, 2018.
|
| 218 |
+
[36] Salman Khan, Muzammal Naseer, Munawar Hayat, Syed Waqas Zamir, Fahad Shahbaz Khan, and Mubarak Shah. Transformers in vision: A survey. arXiv preprint arXiv:2101.01169, 2021.
|
| 219 |
+
[37] Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 220 |
+
[38] Bing Li, Cheng Zheng, Silvio Giancola, and Bernard Ghanem. Sctn: Sparse convolution-transformer network for scene flow estimation. arXiv preprint arXiv:2105.04447, 2021.
|
| 221 |
+
[39] Chunyuan Li, Jianwei Yang, Pengchuan Zhang, Mei Gao, Bin Xiao, Xiyang Dai, Lu Yuan, and Jianfeng Gao. Efficient self-supervised vision transformers for representation learning. arXiv preprint arXiv:2106.09785, 2021.
|
| 222 |
+
[40] Xiangyu Li, Yonghong Hou, Pichao Wang, Zhimin Gao, Mingliang Xu, and Wanqing Li. Trear: Transformer-based rgb-d egocentric action recognition. arXiv preprint arXiv:2101.03904, 2021.
|
| 223 |
+
[41] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980–2988, 2017.
|
| 224 |
+
[42] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014.
|
| 225 |
+
[43] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
|
| 226 |
+
[44] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 227 |
+
[45] Hyeonseob Nam, Jung-Woo Ha, and Jeonghee Kim. Dual attention networks for multimodal reasoning and matching. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 299–307, 2017.
|
| 228 |
+
[46] R. Pappagari, P. Zelasko, J. Villalba, Y. Carmiel, and N. Dehak. Hierarchical transformers for long document classification. In 2019 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 838–844, 2019.
|
| 229 |
+
[47] 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.
|
| 230 |
+
[48] Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM journal on control and optimization, 30(4):838–855, 1992.
|
| 231 |
+
[49] 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.
|
| 232 |
+
[50] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019.
|
| 233 |
+
[51] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition, 2021.
|
| 234 |
+
[52] Robin Strudel, Ricardo Garcia, Ivan Laptev, and Cordelia Schmid. Segmenter: Transformer for semantic segmentation. arXiv preprint arXiv:2105.05633, 2021.
|
| 235 |
+
[53] Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In CVPR, 2019.
|
| 236 |
+
[54] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019.
|
| 237 |
+
[55] 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.
|
| 238 |
+
[56] Ashish Vaswani, Prajit Ramachandran, Aravind Srinivas, Niki Parmar, Blake Hechtman, and Jonathon Shlens. Scaling local self-attention for parameter efficient visual backbones. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12894–12904, 2021.
|
| 239 |
+
[57] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 240 |
+
[58] 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.
|
| 241 |
+
[59] Ning Wang, Wengang Zhou, Jie Wang, and Houqaing Li. Transformer meets tracker: Exploiting temporal context for robust visual tracking. arXiv preprint arXiv:2103.11681, 2021.
|
| 242 |
+
[60] 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.
|
| 243 |
+
[61] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
|
| 244 |
+
[62] 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.
|
| 245 |
+
[63] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV), pages 3–19, 2018.
|
| 246 |
+
[64] Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, and Lei Zhang. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021.
|
| 247 |
+
[65] Tete Xiao, Yingcheng Liu, Bolei Zhou, Yuning Jiang, and Jian Sun. Unified perceptual parsing for scene understanding. In Proceedings of the European Conference on Computer Vision (ECCV), pages 418–434, 2018.
|
| 248 |
+
[66] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers, 2021.
|
| 249 |
+
[67] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
|
| 250 |
+
[68] Jianwei Yang, Zhile Ren, Chuang Gan, Hongyuan Zhu, and Devi Parikh. Cross-channel communication networks. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pages 1297–1306, 2019.
|
| 251 |
+
[69] Minghao Yin, Zhuliang Yao, Yue Cao, Xiu Li, Zheng Zhang, Stephen Lin, and Han Hu. Disentangled non-local neural networks. In European Conference on Computer Vision, pages 191–207. Springer, 2020.
|
| 252 |
+
[70] Kun Yuan, Shaopeng Guo, Ziwei Liu, Aojun Zhou, Fengwei Yu, and Wei Wu. Incorporating convolution designs into visual transformers. arXiv preprint arXiv:2103.11816, 2021.
|
| 253 |
+
[71] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, 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.
|
| 254 |
+
[72] Li Yuan, Qibin Hou, Zihang Jiang, Jiashi Feng, and Shuicheng Yan. Volo: Vision outlooker for visual recognition. arXiv preprint arXiv:2106.13112, 2021.
|
| 255 |
+
[73] Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-contextual representations for semantic segmentation. arXiv preprint arXiv:1909.11065, 2019.
|
| 256 |
+
[74] Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020.
|
| 257 |
+
[75] Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Haibin Lin, Zhi Zhang, Yue Sun, Tong He, Jonas Mueller, R Manmatha, et al. Resnest: Split-attention networks. arXiv preprint arXiv:2004.08955, 2020.
|
| 258 |
+
[76] Pengchuan Zhang, Xiyang Dai, Jianwei Yang, Bin Xiao, Lu Yuan, Lei Zhang, and Jianfeng Gao. Multiscale vision longformer: A new vision transformer for high-resolution image encoding. arXiv preprint arXiv:2103.15358, 2021.
|
| 259 |
+
[77] Wenwei Zhang, Jiangmiao Pang, Kai Chen, and Chen Change Loy. K-net: Towards unified image segmentation, 2021.
|
| 260 |
+
[78] Jiaojiao Zhao, Xinyu Li, Chunhui Liu, Shuai Bing, Hao Chen, Cees GM Snoek, and Joseph Tighe. Tuber: Tube-transformer for action detection. arXiv preprint arXiv:2104.00969, 2021.
|
| 261 |
+
[79] 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.
|
| 262 |
+
[80] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. arXiv preprint arXiv:2012.15840, 2020.
|
| 263 |
+
[81] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6881–6890, 2021.
|
| 264 |
+
[82] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001–13008, 2020.
|
| 265 |
+
[83] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 633–641, 2017.
|
| 266 |
+
[84] Xingyi Zhou, Vladlen Koltun, and Philipp Krähenbühl. Probabilistic two-stage detection. arXiv preprint arXiv:2103.07461, 2021.
|
| 267 |
+
[85] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
|
md/train/30EvkP2aQLD/30EvkP2aQLD.md
ADDED
|
@@ -0,0 +1,611 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WHAT ARE THE STATISTICAL LIMITS OF OFFLINE RL WITH LINEAR FUNCTION APPROXIMATION?
|
| 2 |
+
|
| 3 |
+
Ruosong Wang Carnegie Mellon University ruosongw@andrew.cmu.edu
|
| 4 |
+
|
| 5 |
+
Dean P. Foster
|
| 6 |
+
University of Pennsylvania and Amazon
|
| 7 |
+
dean@foster.net
|
| 8 |
+
Sham M. Kakade
|
| 9 |
+
University of Washington, Seattle and Microsoft Research
|
| 10 |
+
sham@cs.washington.edu
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Offline reinforcement learning seeks to utilize offline (observational) data to guide the learning of (causal) sequential decision making strategies. The hope is that offline reinforcement learning coupled with function approximation methods (to deal with the curse of dimensionality) can provide a means to help alleviate the excessive sample complexity burden in modern sequential decision making problems. However, the extent to which this broader approach can be effective is not well understood, where the literature largely consists of sufficient conditions.
|
| 15 |
+
|
| 16 |
+
This work focuses on the basic question of what are necessary representational and distributional conditions that permit provable sample-efficient offline reinforcement learning. Perhaps surprisingly, our main result shows that even if: i) we have realizability in that the true value function of every policy is linear in a given set of features and 2) our off-policy data has good coverage over all features (under a strong spectral condition), any algorithm still (information-theoretically) requires a number of offline samples that is exponential in the problem horizon to nontrivially estimate the value of any given policy. Our results highlight that sampleefficient offline policy evaluation is not possible unless significantly stronger conditions hold; such conditions include either having low distribution shift (where the offline data distribution is close to the distribution of the policy to be evaluated) or significantly stronger representational conditions (beyond realizability).
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
Offline methods (also known as off-policy methods or batch methods) are a promising methodology to alleviate the sample complexity burden in challenging reinforcement learning (RL) settings, particularly those where sample efficiency is paramount (Mandel et al., 2014; Gottesman et al., 2018; Wang et al., 2018; Yu et al., 2019). Off-policy methods are often applied together with function approximation schemes; such methods take sample transition data and reward values as inputs, and approximate the value of a target policy or the value function of the optimal policy. Indeed, many practical deep RL algorithms find their prototypes in the literature of offline RL. For example, when running on off-policy data (sometimes termed as “experience replay”), deep $Q$ -networks (DQN) (Mnih et al., 2015) can be viewed as an analog of Fitted $Q$ -Iteration (Gordon, 1999) with neural networks being the function approximators. More recently, there are an increasing number of both model-free (Laroche et al., 2019; Fujimoto et al., 2019; Jaques et al., 2020; Kumar et al., 2019; Agarwal et al., 2020) and model-based (Ross & Bagnell, 2012; Kidambi et al., 2020) offline RL methods, with steady improvements in performance (Fujimoto et al., 2019; Kumar et al., 2019; Wu et al., 2020; Kidambi et al., 2020).
|
| 21 |
+
|
| 22 |
+
However, despite the importance of these methods, the extent to which data reuse is possible, especially when off-policy methods are combined with function approximation, is not well understood. For example, deep $Q$ -network requires millions of samples to solve certain Atari games (Mnih et al., 2015). Also important is that in some safety-critical settings, we seek guarantees when offlinetrained policies can be effective (Thomas, 2014; Thomas et al., 2019). A basic question here is that if there are fundamental statistical limits on such methods, where sample-efficient offline RL is simply not possible without further restrictions on the problem.
|
| 23 |
+
|
| 24 |
+
In the context of supervised learning, it is well-known that empirical risk minimization is sampleefficient if the hypothesis class has bounded complexity. For example, suppose the agent is given a $d$ -dimensional feature extractor, and the ground truth labeling function is a (realizable) linear function with respect to the feature mapping. Here, it is well-known that a polynomial number of samples in $d$ suffice for a given target accuracy. Furthermore, in this realizable case, provided the training data has a good feature coverage, then we will have good accuracy against any test distribution.1
|
| 25 |
+
|
| 26 |
+
In the more challenging offline RL setting, it is unclear if sample-efficient methods are possible, even under analogous assumptions. This is our motivation to consider the following question:
|
| 27 |
+
|
| 28 |
+
# What are the statistical limits for offline RL with linear function approximation?
|
| 29 |
+
|
| 30 |
+
Here, one may hope that value estimation for a given policy is possible in the offline RL setting under the analogous set of assumptions that enable sample-efficient supervised learning, i.e., 1) (realizability) the features can perfectly represent the value functions and 2) (good coverage) the feature covariance matrix of our off-policy data has lower bounded eigenvalues.
|
| 31 |
+
|
| 32 |
+
The extant body of provable methods on offline RL either make representational assumptions that are far stronger than realizability or assume distribution shift conditions that are far stronger than having coverage with regards to the spectrum of the feature covariance matrix of the data distribution. For example, Szepesvari & Munos (2005) analyze offline RL methods by assuming a representational ´ condition where the features satisfy (approximate) closedness under Bellman updates, which is a far stronger representation condition than realizability. Recently, Xie & Jiang (2020a) propose a offline RL algorithm that only requires realizability as the representation condition. However, the algorithm in (Xie & Jiang, 2020a) requires a more stringent data distribution condition. Whether it is possible to design a sample-efficient offline RL method under the realizability assumption and a reasonable data coverage assumption — an open problem in (Chen & Jiang, 2019) — is the focus of this work.
|
| 33 |
+
|
| 34 |
+
Our Contributions. Perhaps surprisingly, our main result shows that, under only the above two assumptions, it is information-theoretically not possible to design a sample-efficient algorithm to non-trivially estimate the value of a given policy. The following theorem is an informal version of the result in Section 4.
|
| 35 |
+
|
| 36 |
+
Theorem 1.1 (Informal). In the offline RL setting, suppose the data distributions have (polynomially) lower bounded eigenvalues, and the $Q$ -functions of every policy are linear with respect to a given feature mapping. Any algorithm requires an exponential number of samples in the horizon $H$ to output a non-trivially accurate estimate of the value of any given policy $\pi$ , with constant probability.
|
| 37 |
+
|
| 38 |
+
This hardness result states that even if the $Q$ -functions of all polices are linear with respect to the given feature mapping, we still require an exponential number of samples to evaluate any given policy. Note that this representation condition is significantly stronger than assuming realizability with regards to only a single target policy; it assumes realizability for all policies. Regardless, even under this stronger representation condition, it is hard to evaluate any policy, as specified in our hardness result.
|
| 39 |
+
|
| 40 |
+
This result also formalizes a key issue in offline reinforcement learning with function approximation: geometric error amplification. To better illustrate the issue, in Section 5, we analyze the classical Least-Squares Policy Evaluation (LSPE) algorithm under the realizability assumption, which demonstrates how the error propagates as the algorithm proceeds. Here, our analysis shows that, if we only rely on the realizability assumption, then a far more stringent condition is required for sample-efficient offline policy evaluation: the off-policy data distribution must be quite close to the distribution induced by the policy to be evaluated.
|
| 41 |
+
|
| 42 |
+
Our results highlight that sample-efficient offline RL is simply not possible unless either the distribution shift condition is sufficiently mild or we have stronger representation conditions that go well beyond realizability. See Section 5 for more details.
|
| 43 |
+
|
| 44 |
+
Furthermore, our hardness result implies an exponential separation on the sample complexity between offline RL and supervised learning, since supervised learning (which is equivalent to offline RL with $H = 1$ ) is possible with polynomial number of samples under the same set of assumptions.
|
| 45 |
+
|
| 46 |
+
A few additional points are worth emphasizing with regards to our lower bound construction:
|
| 47 |
+
|
| 48 |
+
• Our results imply that Least-Squares Policy Evaluation (LSPE, i.e., using Bellman backups with linear regression) will fail. Interestingly, while LSPE will provide an unbiased estimator, our results imply that it will have exponential variance in the problem horizon.
|
| 49 |
+
Our construction is simple and does not rely on having a large state or action space: the size of the state space is only $O ( d \cdot H )$ where $d$ is the feature dimension and $H$ is the planning horizon, and the size of the action space is only is 2. This stands in contrast to other RL lower bounds, which typically require state spaces that are exponential in the problem horizon (e.g. see (Du et al., 2020)).
|
| 50 |
+
• We provide two hard instances, one with a sparse reward (and stochastic transitions) and another with deterministic dynamics (and stochastic rewards). These two hard instances jointly imply that both the estimation error on reward values and the estimation error on the transition probabilities could be geometrically amplified in offline RL. Of possibly broader interest is that our hard instances are, to our knowledge, the first concrete examples showing that geometric error amplification is real in RL problems (even with realizability). While this is a known concern in the analysis of RL algorithms, there have been no concrete examples exhibiting such behavior under only a realizability assumption.
|
| 51 |
+
|
| 52 |
+
# 2 RELATED WORK
|
| 53 |
+
|
| 54 |
+
We now survey prior work on offline RL, largely focusing on theoretical results. We also discuss results on the error amplification issue in RL. Concurrent to this work, Xie & Jiang (2020a) propose a offline RL algorithm under the realizability assumption, which requires stronger distribution shift conditions. We will discuss this work shortly.
|
| 55 |
+
|
| 56 |
+
Existing Algorithms and Analysis. Offline RL with value function approximation is closely related to Approximate Dynamic Programming (Bertsekas & Tsitsiklis, 1995). Existing work (Munos, 2003; Szepesvari & Munos, 2005; Antos et al., 2008; Munos & Szepesv ´ ari, 2008; Tosatto et al., ´ 2017; Xie & Jiang, 2020b; Duan & Wang, 2020) that analyze the sample complexity of approximate dynamic programming-based approaches usually make the following two categories of assumptions: (i) representation conditions that assume the function class approximates the value functions well and (ii) distribution shift conditions that assume the given data distribution has sufficient coverage over the state-action space. As mentioned in the introduction, the desired representation condition would be realizability, which only assumes the value function of the policy to be evaluated lies in the function class (for the case of offline policy evaluation) or the optimal value function lies in the function class (for the case of finding near-optimal policies), and existing works usually make stronger assumptions. For example, Szepesvari & Munos (2005); Duan & Wang (2020) assume (ap- ´ proximate) closedness under Bellman updates, which is much stronger than realizability. Whether it is possible to design a sample-efficient offline RL method under the realizability assumption and reasonable data coverage assumption, is left as an open problem in (Chen & Jiang, 2019).
|
| 57 |
+
|
| 58 |
+
To measure the coverage over the state-action space of the given data distribution, existing works assume the concentrability coefficient (introduced by Munos (2003)) to be bounded. The concentrability coefficient, informally speaking, is the largest possible ratio between the probability for a state-action pair $( s , a )$ to be visited by a policy, and the probability that $( s , a )$ appears on the data distribution. Since we work with linear function approximation in this work, we measure the distribution shift in terms of the spectrum of the feature covariance matrices (see Assumption 2), which is a well-known sufficient condition in the context of supervised learning and is much more natural for the case of linear function approximation.
|
| 59 |
+
|
| 60 |
+
Concurrent to this work, Xie & Jiang (2020a) propose an algorithm that works under the realizability assumption instead of other stronger representation conditions used in prior work. However, the algorithm in (Xie & Jiang, 2020a) requires a much stronger data distribution condition which assumes a stringent version of concentrability coefficient introduced by (Munos, 2003) to be bounded. In contrast, in this work we measure the distribution shift in terms of the spectrum of the feature covariance matrix of the data distribution, which is more natural than the concentrability coefficient for the case of linear function approximation.
|
| 61 |
+
|
| 62 |
+
Recently, there has been great interest in approaching offline policy evaluation (Precup, 2000) via importance sampling. For recent work on this topic, see (Dud´ık et al., 2011; Mandel et al., 2014; Thomas et al., 2015; Li et al., 2015; Jiang & Li, 2016; Thomas & Brunskill, 2016; Guo et al., 2017; Wang et al., 2017; Liu et al., 2018; Farajtabar et al., 2018; Xie et al., 2019; Kallus & Uehara, 2019; Liu et al., 2019; Uehara & Jiang, 2019; Kallus & Uehara, 2020; Jiang & Huang, 2020; Feng et al., 2020). Offline policy evaluation with importance sampling incurs exponential variance in the planning horizon when the behavior policy is significantly different from the policy to be evaluated. Bypassing such exponential dependency requires non-trivial function approximation assumptions (Jiang & Huang, 2020; Feng et al., 2020; Liu et al., 2018). Finally, Kidambi et al. (2020) provide a model-based offline RL algorithm, with a theoretical analysis based on hitting times.
|
| 63 |
+
|
| 64 |
+
Hardness Results. Algorithm-specific hardness results have been known for a long time in the literature of Approximate Dynamic Programming. See Chapter 4 in (Van Roy, 1994) and also (Gordon, 1995; Tsitsiklis & Van Roy, 1996). These works demonstrate that certain approximate dynamic programming-based methods will diverge on hard cases. However, such hardness results only hold for a restricted class of algorithms, and to demonstrate the fundamental difficulty of offline RL, it is more desirable to obtain information-theoretic lower bounds as initiated by Chen & Jiang (2019).
|
| 65 |
+
|
| 66 |
+
Existing (information-theoretic) exponential lower bounds (Krishnamurthy et al., 2016; Sun et al., 2017; Chen & Jiang, 2019) usually construct unstructured MDPs with an exponentially large state space. Du et al. (2020) prove an exponential lower bound under the assumption that the optimal $Q$ - function is approximately linear. The condition that the optimal $Q$ -function is only approximately linear is crucial for the hardness result in Du et al. (2020). The techniques in (Du et al., 2020) are later generalized to other settings (Kumar et al., 2020; Wang et al., 2020; Mou et al., 2020).
|
| 67 |
+
|
| 68 |
+
Error Amplification In RL. Error amplification induced by distribution shift and long planning horizon is a known issue in the theoretical analysis of RL algorithms. See (Gordon, 1995; 1996; Munos & Moore, 1999; Ormoneit & Sen, 2002; Kakade, 2003; Zanette et al., 2019) for papers on this topic and additional assumptions that mitigate this issue. Error amplification in offline RL is also observed in empirical works (see e.g. (Fujimoto et al., 2019)). In this work, we provide the first information-theoretic lower bound showing that geometric error amplification is real in offline RL.
|
| 69 |
+
|
| 70 |
+
# 3 THE OFFLINE POLICY EVALUATION PROBLEM
|
| 71 |
+
|
| 72 |
+
Throughout this paper, for a given integer $H$ , we use $[ H ]$ to denote the set $\{ 1 , 2 , \ldots , H \}$
|
| 73 |
+
|
| 74 |
+
Episodic Reinforcement Learning. Let $M = ( \mathcal { S } , \mathcal { A } , P , R , H )$ be a Markov Decision Process (MDP) where $s$ is the state space, $\mathcal { A }$ is the action space, $P : \mathcal { S } \times \mathcal { A } \Delta ( \mathcal { S } )$ is the transition operator which takes a state-action pair and returns a distribution over states, $\Dot { R : } \Dot { S } \times \mathcal { A } \Delta ( \mathbb { R } )$ is the reward distribution, $H \in \mathbb { Z } _ { + }$ is the planning horizon. For simplicity, we assume a fixed initial state $s _ { 1 } \in { \mathcal { S } }$ . A (stochastic) policy $\pi : S \Delta ( { \mathcal { A } } )$ chooses an action $a$ randomly based on the current state $s$ . The policy $\pi$ induces a (random) trajectory $s _ { 1 } , a _ { 1 } , r _ { 1 } , s _ { 2 } , a _ { 2 } , r _ { 2 } , \ldots , s _ { H } , a _ { H } , r _ { H }$ , where $a _ { 1 } \sim \pi _ { 1 } ( s _ { 1 } )$ , $r _ { 1 } \sim R ( s _ { 1 } , a _ { 1 } )$ , $s _ { 2 } \sim P ( s _ { 1 } , a _ { 1 } )$ , $a _ { 2 } \sim \pi _ { 2 } ( s _ { 2 } )$ , etc. To streamline our analysis, for each $h \in [ H ]$ , we use $S _ { h } \subseteq S$ to denote the set of states at level $h$ , and we assume $S _ { h }$ do not intersect with each other. We assume, almost surely, that $r _ { h } \in [ - 1 , 1 ]$ for all $h \in [ H ]$ .
|
| 75 |
+
|
| 76 |
+
Value Functions. Given a policy $\begin{array} { r } { \mathbb { E } \left[ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } \mid s _ { h } = s , a _ { h } = a , \pi \right] } \end{array}$ an d , $\textit { h } \in \ [ H ]$ $\begin{array} { r } { V _ { h } ^ { \pi } ( s ) = \mathbb { E } \left[ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } \mid s _ { h } = s , \pi \right] } \end{array}$ and $( s , a ) \in S _ { h } \times \mathcal { A }$ , define h. For a policy $Q _ { h } ^ { \pi } ( s , a ) \ =$ $\pi$ , we define $V ^ { \pi } = V _ { 1 } ^ { \pi } ( s _ { 1 } )$ to be the value of $\pi$ from the fixed initial state $s _ { 1 }$ .
|
| 77 |
+
|
| 78 |
+
Linear Function Approximation. When applying linear function approximation schemes, it is commonly assumed that the agent is given a feature extractor $\phi : \mathcal { S } \times \bar { \mathcal { A } } \mathbb { R } ^ { d }$ which can either be hand-crafted or a pre-trained neural network that transforms a state-action pair to a $d$ -dimensional embedding, and the $Q$ -functions can be predicted by linear functions of the features. In this paper, we are interested in the following realizability assumption.
|
| 79 |
+
|
| 80 |
+
Assumption 1 (Realizable Linear Function Approximation). For every policy $\pi : S \Delta ( { \mathcal { A } } )$ , there exists $\theta _ { 1 } ^ { \pi } , \ldots \theta _ { H } ^ { \pi } \in \mathbb { R } ^ { d }$ such that for all $( s , a ) \in S \times A$ and $h \in [ H ] , Q _ { h } ^ { \pi } ( s , a ) = \left( \theta _ { h } ^ { \pi } \right) ^ { \top } \phi ( s , a ) .$ .
|
| 81 |
+
|
| 82 |
+
Note that our assumption is much stronger than assuming realizability with regards to a single policy $\pi$ (say the policy that we wish to evaluate); our assumption imposes realizability for all policies.
|
| 83 |
+
|
| 84 |
+
Offline Reinforcement Learning. This paper is concerned with the offline RL setting. In this setting, thtributions $\{ \mu _ { h } \} _ { h = 1 } ^ { H }$ oes not have dirwhere for each $h \in [ H ]$ , $\mu _ { h } \in \Delta ( S _ { h } \times \mathcal { A } )$ stead is given access to data d. The inputs of the agent are $H$ datasets $\{ D _ { h } \} _ { h = 1 } ^ { H }$ 1 , and for each $h \in [ H ]$ , $D _ { h }$ consists i.i.d. samples of the form $( s , a , r , s ^ { \prime } ) \in$ $S _ { h } \times \mathcal { A } \times \mathbb { R } \times \mathcal { S } _ { h + 1 }$ tuples, where $( s , \dot { a } ) \stackrel { . } { \sim } \mu _ { h } , r \sim r ( s , a ) , s ^ { \prime } \sim \bar { P ( } s , a ) $ .
|
| 85 |
+
|
| 86 |
+
In this paper, we focus on the offline policy evaluation problem with linear function approximation: given a policy accurate estim $\pi : S \Delta ( { \mathcal { A } } )$ f $\pi$ d a fe(i.e., $V ^ { \pi }$ re extractor ) approxima $\phi : \mathcal { S } \times \mathcal { A } \mathbb { R } ^ { d }$ , the goal is toected datasets $\{ D _ { h } \} _ { h = 1 } ^ { H }$ with as few samples as possible.
|
| 87 |
+
|
| 88 |
+
Notation. For a vector $x \in \mathbb { R } ^ { d }$ , we use $\lVert x \rVert _ { 2 }$ to denote its $\ell _ { 2 }$ norm. For a positive semidefinite matrix $A$ , we use $\| A \| _ { 2 }$ to denote its operator norm, and $\sigma _ { \mathrm { m i n } } ( A )$ to denote its smallest eigenvalue. For two positive semidefinite matrices $A$ and $B$ , we write $A \succeq B$ to denote the Lowner partial ¨ ordering of matrices, i.e, $A \succeq B$ if and only if $A - B$ is positive semidefinite. For a policy $\pi : { \cal { S } } $ $\Delta \left( \mathcal { A } \right)$ , we use $\mu _ { h } ^ { \pi }$ to denote the marginal distribution of $s _ { h }$ under $\pi$ , i.e., $\mu _ { h } ^ { \pi } ( s ) = \operatorname* { P r } [ s _ { h } = s \mid \pi ]$ . For a vector $x \in \mathbb { R } ^ { d }$ and a positive semidefinite matrix $A \in \mathbb { R } ^ { d \times d }$ , we use $\| x \| _ { A }$ to denote $\sqrt { x ^ { \top } A x }$ .
|
| 89 |
+
|
| 90 |
+
# 4 THE LOWER BOUND: REALIZABILITY AND COVERAGE ARE INSUFFICIENT
|
| 91 |
+
|
| 92 |
+
We now present our main hardness result for offline policy evaluation with linear function approximation. It should be evident that without feature coverage in our dataset, realizability alone is clearly not sufficient for sample-efficient estimation. Here, we will make the strongest possible assumption, with regards to the conditioning of the feature covariance matrix.
|
| 93 |
+
|
| 94 |
+
Assumption 2 (Feature Coverage). For all $( s , a ) \in S \times A ,$ , assume our feature map is bounded such that $\| \phi ( s , a ) \| _ { 2 } \leq 1$ . Furthermore, suppose for each $h \in [ H ]$ , the data distributions $\mu _ { h }$ satisfy the following minimum eigenvalue condition: $\sigma _ { \mathrm { m i n } } \left( \mathbb { E } _ { ( s , a ) \sim \mu _ { h } } [ \dot { \phi } ( \dot { s } , a ) \phi ( s , a ) ^ { \top } ] \right) = 1 / d .$ . 2
|
| 95 |
+
|
| 96 |
+
Clearly, for the case where $H = 1$ , the realizability assumption (Assumption 1), and feature coverage assumption (Assumption 2) imply that the ordinary least squares estimator will accurately estimate $\theta _ { 1 }$ .3 Our main result now shows that these assumptions are not sufficient for offline policy evaluation for long horizon problems.
|
| 97 |
+
|
| 98 |
+
Theorem 4.1. Suppose Assumption 2 holds. Fix an algorithm that takes as input both a policy and $a$ feature mapping. There exists a (deterministic) MDP satisfying Assumption $^ { l }$ , such that for any policy $\pi : S \Delta ( { \mathcal { A } } )$ , the algorithm requires $\Omega ( ( d / 2 ) ^ { H } )$ samples to output the value of $\pi$ up to constant additive approximation error with probability at least 0.9.
|
| 99 |
+
|
| 100 |
+
Although we focus on offline policy evaluation in this work, our hardness result also holds for finding near-optimal policies under Assumption 1 in the offline RL setting. Below we give a simple reduction. At the initial state, if the agent chooses action $a _ { 1 }$ , then the agent receives a fixed reward value (say 0.5) and terminates. If the agent chooses action $a _ { 2 }$ , then the agent transits to our hard instance. In order to find a policy with suboptimality at most 0.5, the agent must evaluate the value of the optimal policy in our hard instance up to an error of 0.5, and hence the hardness result holds.
|
| 101 |
+
|
| 102 |
+
Remark 1 (The sparse reward case). As stated, the theorem uses a deterministic MDP (with stochastic rewards). See Appendix C for another hard case where the transition is stochastic and the reward is deterministic and sparse (only occurring at two states at $h = H$ ).
|
| 103 |
+
|
| 104 |
+
Remark 2 (Least-Squares Policy Evaluation (LSPE) has exponential variance). For offline policy evaluation with linear function approximation, the most na¨ıve algorithm here would be LSPE, i.e., using ordinary least squares (OLS) to estimate $\theta ^ { \pi }$ , starting at level $h = H$ and then proceeding backwards to level $h = 1$ , using the plug-in estimator from the previous level. Here, LSPE will provide an unbiased estimate (provided the feature covariance matrices are full rank, which will occur with high probability). As a direct corollary, the above theorem implies that LSPE has exponential variance in $H$ . See Section 5 for a more detailed discussion on LSPE. More generally, our theorem implies that there is no estimator that can avoid such exponential dependence in the offline setting.
|
| 105 |
+
|
| 106 |
+
Remark 3 (Least-Squares Value Iteration (LSVI) versus Least-Squares Policy Iteration (LSPI)). In the offline setting, under Assumptions 1 and 2, in order to find a near-optimal policy, the most na¨ıve algorithm would be LSVI, i.e., using ordinary least squares (OLS) to estimate $\theta ^ { * }$ , starting at level $h = H$ and then proceeding backwards to level $h = 1$ , using the plug-in estimator from the previous level and the bellman operator. The above theorem implies that LSVI will require an exponential number of samples to find a near-optimal policy. On the other hand, if the regression targets are collected by using rollouts (i.e. on-policy sampling) as in LSPI (Lagoudakis & Parr, 2003), then a polynomial number of samples suffice. See Section D in (Du et al., 2020) for an analysis. Thus, Theorem 4.1 implies an exponential separation on the sample complexity between LSVI and LSPI. Of course, LSPI requires adaptive data samples and thus does not work in the offline setting.
|
| 107 |
+
|
| 108 |
+
One may wonder if Theorem 4.1 still holds when the data distributions $\{ \mu _ { h } \} _ { h = 1 } ^ { H }$ are induced by a policy. In Appendix C, we prove another exponential sample complexity lower bound under the additional assumption that the data distributions are induced by a fixed policy $\pi$ . However, under such an assumption, it is impossible to prove a hardness result as strong as Theorem 4.1 (which shows that evaluating any policy is hard), since one can at least evaluate the policy $\pi$ that induces the data distributions. Nevertheless, we are able to prove the hardness of offline policy evaluation, under a weaker version of Assumption 1. See Appendix $\textrm { C }$ for more details.
|
| 109 |
+
|
| 110 |
+
In the remaining part of this section, we give the hard instance construction and the proof of Theorem 4.1. We use $d$ the denote the feature dimension, and we assume $d$ is even for simplicity. We use $\hat { d }$ to denote $d / 2$ for convenience. We also provide an illustration of the construction in Figure 1.
|
| 111 |
+
|
| 112 |
+
ac, Action Spcontains d Transtates or. and action space . For each $\mathcal { A } = \{ a _ { 1 } , a _ { 2 } \}$ . For each, for each $h \in [ H ]$ $S _ { h }$ $\hat { d } + 1$ $s _ { h } ^ { 1 } , s _ { h } ^ { 2 } , \ldots , s _ { h } ^ { \hat { d } }$ $s _ { h } ^ { \hat { d } + 1 }$ $h \in [ H - 1 ]$ $c \in \{ 1 , 2 , \ldots , \hat { d } + 1 \}$ , we have $P ( s _ { h } ^ { c } , a _ { 1 } ) = s _ { h + 1 } ^ { \hat { d } + 1 }$ and $P ( s _ { h } ^ { c } , a _ { 1 } ) = s _ { h + 1 } ^ { c }$ .
|
| 113 |
+
|
| 114 |
+
Reward Distributions. Let $0 \leq r _ { 0 } \leq \hat { d } ^ { - H / 2 }$ be a parameter to be determined. For each $( h , c ) \in$ $[ H - 1 ] \times [ \hat { d } ]$ and $a \in { \mathcal { A } }$ , we set $R ( s _ { h } ^ { c } , a ) = 0$ and $R ( s _ { h } ^ { \hat { d } + 1 } , a ) = r _ { 0 } \cdot ( \hat { d } ^ { 1 / 2 } - 1 ) \cdot \hat { d } ^ { ( H - h ) / 2 }$ . For the last level, for each $c \in [ \hat { d } ]$ and $a \in { \mathcal { A } }$ , we set $R ( s _ { H } ^ { c } , a ) = \left\{ \begin{array} { l l } { { 1 } } \\ { { - 1 } } \end{array} \right.$ with probability with probability $( 1 + r _ { 0 } ) / 2$ $( 1 - r _ { 0 } ) / 2$ so that $\mathbb { E } [ R ( s _ { H } ^ { c } , a ) ] = r _ { 0 }$ . Moreover, for all actions $a \in \mathcal { A } , R ( s _ { H } ^ { \hat { d } + 1 } , a ) = r _ { 0 } \cdot \hat { d } ^ { 1 / 2 }$ .
|
| 115 |
+
|
| 116 |
+
Feature Mapping. Let $e _ { 1 } , e _ { 2 } , \ldots , e _ { d }$ be a set of orthonormal vectors in $\mathbb { R } ^ { d }$ . Here, one possible choice is to set $e _ { 1 } , e _ { 2 } , \ldots , e _ { d }$ to be the standard basis vectors. For each $( h , c ) \in [ H ] \times [ \hat { d } ]$ , we set $\phi ( s _ { h } ^ { c } , a _ { 1 } ) = e _ { c } , \phi ( s _ { h } ^ { c } , a _ { 2 } ) = e _ { c + { \hat { d } } } $ , and $\begin{array} { r } { \phi ( s _ { h } ^ { \hat { d } + 1 } , a ) = \sum _ { c \in \hat { d } } e _ { c } / \hat { d } ^ { 1 / 2 } } \end{array}$ for all $a \in { \mathcal { A } }$ .
|
| 117 |
+
|
| 118 |
+
Verifying Assumption 1. The following lemma shows that Assumption 1 holds for our construction. The formal proof can be found in Appendix A.
|
| 119 |
+
|
| 120 |
+
Lemma 4.2. For every policy $\pi : S \Delta ( { \mathcal { A } } )$ , for each $h \in [ H ]$ , for all $( s , a ) \in S _ { h } \times \mathcal { A } ,$ , we have $Q _ { h } ^ { \pi } ( s , a ) = \left( \theta _ { h } ^ { \pi } \right) ^ { \top } \phi ( s , a )$ for some $\theta _ { h } ^ { \pi } \in \mathbb { R } ^ { d }$ .
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
|
| 124 |
+
Figure 1: An illustration of the hard instance. Recall that $\hat { d } = d / 2$ . States on the top are those in the first level $( h = 1 )$ ), while states at the bottom are those in the last level $h = H$ ). Solid line (with arrow) corresponds to transitions associated with action $a _ { 1 }$ , while dotted line (with arrow) corresponds to transitions associated with action $a _ { 2 }$ . For each level $h \in [ H ]$ , reward values and $Q$ -values associated with $s _ { h } ^ { 1 } , s _ { h } ^ { 2 } , \ldots , s _ { h } ^ { \hat { d } }$ are marked on the left, while reward values and $Q$ -values associated with $s _ { h } ^ { \hat { d } + 1 }$ are mark on the right. Rewards and transitions are all deterministic, except for the reward distributions associated with $s _ { H } ^ { 1 } , s _ { H } ^ { 2 } , \ldots , s _ { H } ^ { \hat { d } }$ . We mark the ex tation of the reward uniformly at random from those states in the dashed rectangle, i.e., $h \in [ H ]$ $\{ s _ { h } ^ { 1 } , s _ { h } ^ { 2 } , \ldots , s _ { h } ^ { \hat { d } } \}$ $\mu _ { h }$ , while the action is chosen uniformly at random from $\{ a _ { 1 } , a _ { 2 } \}$ . Suppose the initial state is $s _ { 1 } ^ { \hat { d } + 1 }$ . When $r _ { 0 } = 0$ , the value of the policy is 0. When $r _ { 0 } = \hat { d } ^ { - H / 2 }$ , the value of the policy is $r _ { 0 } \cdot \hat { d } ^ { H / 2 } = 1$ .
|
| 125 |
+
|
| 126 |
+
The Data Distributions. For each level $h \in [ H ]$ , the data distribution $\mu _ { h }$ is a uniform distribution over $\{ ( s _ { h } ^ { 1 } , a _ { 1 } ) , ( s _ { h } ^ { 1 } , a _ { 2 } ) , ( s _ { h } ^ { 2 } , a _ { 1 } ) , ( s _ { h } ^ { 2 } , a _ { 2 } ) , \ldots , ( s _ { h } ^ { \hat { d } } , a _ { 1 } ) , ( s _ { h } ^ { \hat { d } } , a _ { 2 } ) \}$ . Notice that $( s _ { h } ^ { \hat { d } + 1 } , a )$ is not in the hsupport of $\mu _ { h }$ hfor all $a \in { \mathcal { A } }$ h h. It can be seen that, $\begin{array} { r } { \mathbb { E } _ { ( s , a ) \sim \mu _ { h } } \left[ \phi ( s , a ) \phi ( s , a ) ^ { \top } \right] = \frac { 1 } { d } \sum _ { c = 1 } ^ { d } e _ { c } e _ { c } ^ { \top } = \frac { 1 } { d } I . } \end{array}$
|
| 127 |
+
|
| 128 |
+
The Lower Bound. We show that it is information-theoretically hard for any algorithm to distinguish the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - H / 2 }$ . We fix the initial state to be $s _ { 1 } ^ { \hat { d } + 1 }$ , and consider any policy $\pi$ . When $r _ { 0 } = 0$ , all reward values will be zero, and thus the value of $\pi$ is zero. On the other hand, when $r _ { 0 } = \hat { d } ^ { - H / 2 }$ , the value of $\pi$ would be $r _ { 0 } \cdot \hat { d } ^ { H / 2 } = 1$ . Thus, if the algorithm approximates the value of the policy up to an error of $1 / 2$ , then it must distinguish the case that $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - H / 2 }$ .
|
| 129 |
+
|
| 130 |
+
We first notice that for the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - H / 2 }$ , the data distributions $\{ \mu _ { h } \} _ { h = 1 } ^ { H }$ , the feature mapping $\phi : \mathcal { S } \times \mathcal { A } \mathbb { R } ^ { d }$ , the policy $\pi$ to be evaluated and the transition operator $P$ are the same. Thus, in order to distinguish the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - H / 2 }$ , the only way is to query the reward distribution by using sampling taken from the data distributions. For all state-action pairs $( s , a )$ in the support of the data distributions of the first $H - 1$ levels, the reward distributions will be identical. This is because for all $s \in \mathcal { S } _ { h } \setminus \{ s _ { h } ^ { \hat { d } + 1 } \}$ and $a \in { \mathcal { A } }$ , we have $R ( s , a ) = 0$ . For the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - H / 2 }$ , for all state-action pairs $( s , a )$ in the support of the data distribution of the last level, $R ( s , a ) = \left\{ { 1 \atop - 1 } \right.$ with probability with probability $( 1 + r _ { 0 } ) / 2$ $\dot { ( 1 - r _ { 0 } ) / 2 }$ Therefore, to distinguish the case that $r _ { 0 } ~ = ~ 0$ and $r _ { 0 } ~ = ~ \hat { d } ^ { - H / 2 }$ , the agent needs to distinguish two reward distributions $r _ { 1 } = \left\{ { \begin{array} { l l } { 1 } & { { \mathrm { w i t h ~ p r o b a b i l i t y ~ } } 1 / 2 } \\ { - 1 } & { { \mathrm { w i t h ~ p r o b a b i l i t y ~ } } 1 / 2 } \end{array} } \right.$ and $r _ { 2 } = \left\{ \begin{array} { l l } { { \stackrel { - } { 1 } } } \\ { { - 1 } } \end{array} \right.$ with probability with probability $\begin{array} { c } { { ( 1 + \hat { d } ^ { - H / 2 } ) / 2 } } \\ { { ( 1 - \hat { d } ^ { - H / 2 } ) / 2 } } \end{array}$ . Now we invoke Lemma B.1 in Section B by setting $\varepsilon = \hat { d } ^ { - H / 2 } / 2$ and $\delta = 0 . 9$ . By Lemma B.1, in order to distinguish $r _ { 1 }$ and $r _ { 2 }$ with probability at least 0.9, any algorithm requires $\Omega ( \hat { d } ^ { H } )$ samples.
|
| 131 |
+
|
| 132 |
+
Algorithm 1 Least-Squares Policy Evaluation
|
| 133 |
+
|
| 134 |
+
<table><tr><td></td><td>1: Input: policy π to be evaluated, number of samples N, regularization parameter 入 > 0</td></tr><tr><td></td><td>2:Let QH+1(·,·)=O andVH+1(-)= 0</td></tr><tr><td></td><td>forh=H,H-1,...,1do</td></tr><tr><td>4:</td><td>Take samples (s,a)~ μh,rh ~ r(s,a) and sh ~P(s,a) for eachi∈ [N]</td></tr><tr><td>5:</td><td>LetAh=∑i∈[N](sn,an)(s,a)T+λI</td></tr><tr><td>6: 7:</td><td>LetOn=An1(∑N(s,)·(nh+V+1(3))</td></tr><tr><td></td><td>Let Qn(-,) = (.,·)TOn and Vh(.)=Q(·,π())</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Remark 4. The key in our construction is the state sdˆ+h in each level, whose feature vector is defined to be $\textstyle \sum _ { c \in { \hat { d } } } e _ { c } / { \hat { d } } ^ { 1 / 2 }$ . In each level, $s _ { h } ^ { \hat { d } + 1 }$ amplifies the $Q$ -value by a $\hat { d } ^ { 1 / 2 }$ factor, due to the linearity of the $Q$ -function. After all the $H$ levels, the value will be amplified by a $\hat { d } ^ { H / 2 }$ factor. Since $s _ { h } ^ { \hat { d } + 1 }$ is not in the support of the data distribution, the only way to estimate the value of the policy istimate the expected reward value in the last level. Our construction forces the estimation error of the last level to be amplified exponentially and thus implies an exponential lower bound.
|
| 137 |
+
|
| 138 |
+
# 5 UPPER BOUNDS: LOW DISTRIBUTION SHIFT OR POLICY COMPLETENESS ARE SUFFICIENT
|
| 139 |
+
|
| 140 |
+
In order to illustrate the error amplification issue and discuss conditions that permit sample-efficient offline RL, in this section, we analyze Least-Squares Policy Evaluation when applied to the offline policy evaluation problem under the realizability assumption. The algorithm is presented in Algorithm 1. For simplicity here we assume the policy $\pi$ to be evaluated is deterministic.
|
| 141 |
+
|
| 142 |
+
Notation. For each $h \in [ H ]$ , define $\Lambda _ { h } = \mathbb { E } _ { ( s , a ) \sim \mu _ { h } } \left[ \phi ( s , a ) \phi ( s , a ) ^ { \top } \right]$ to be the feature covariance matrix at level $h$ . For each $h \in [ H - 1 ]$ , define $\overline { { \Lambda } } _ { h + 1 } = \mathbb { E } _ { ( s , a ) \sim \mu _ { h } , \overline { { s } } \sim P ( \cdot \vert s , a ) } \left[ \phi ( \overline { { s } } , \pi ( \overline { { s } } ) ) \phi ( \overline { { s } } , \pi ( \overline { { s } } ) ) ^ { \top } \right]$ to be the feature covariance matrix of the one-step lookahead distribution at level $h$ . Moreover, define $\overline { { \Lambda } } _ { 1 } = \phi ( s _ { 1 } , \pi ( s _ { 1 } ) ) \phi ( s _ { 1 } , \pi ( s _ { 1 } ) ) ^ { \top }$ . We define $\Phi _ { h }$ to be a $N \times d$ matrix, whose $i$ -th row is $\phi ( s _ { h } ^ { i } , a _ { h } ^ { i } )$ , and define $\overline { { \Phi } } _ { h + 1 }$ to be another $N \times d$ matrix whose $i$ -th row is $\phi ( \overline { { s } } _ { h } ^ { i } , \pi ( \overline { { s } } _ { h } ^ { i } ) )$ . For each $h \in [ H ]$ and $i \in [ N ]$ , define $\xi _ { h } ^ { i } = r _ { h } ^ { i } + V ( \overline { { s } } _ { h } ^ { i } ) - Q ( s _ { h } ^ { i } , a _ { h } ^ { i } )$ . We use $\xi _ { h }$ to denote a vector whose $i$ -th entry is $\xi _ { h } ^ { i }$ .
|
| 143 |
+
|
| 144 |
+
Now we present a general lemma that characterizes the estimation error of Algorithm 1 by an equality. The proof can be found in Appendix D. Later, we apply this general lemma to special cases.
|
| 145 |
+
|
| 146 |
+
Lemma 5.1. Suppose $\lambda > 0$ in Algorithm $^ { l }$ , and for the given policy $\pi$ , there exists $\theta _ { 1 } , \theta _ { 2 } , \ldots , \theta _ { d } \in$ $\mathbb { R } ^ { d }$ such that for each $h \in [ H ]$ , $Q _ { h } ^ { \bar { \pi } } ( s , a ) = \phi ( s , \bar { a } ) ^ { \top } \theta _ { h }$ for all $( s , a ) \in S _ { h } \times \mathcal { A }$ . Then we have
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
( Q ^ { \pi } ( s _ { 1 } , \pi ( s _ { 1 } ) ) - \hat { Q } ( s _ { 1 } , \pi ( s _ { 1 } ) ) ) ^ { 2 } = \displaystyle \left\| \sum _ { h = 1 } ^ { H } \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \cdot \cdot \cdot ( \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } - \lambda \hat { \Lambda } _ { h } ^ { - 1 } \theta _ { h } ) \right\| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } .
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
Now we consider two special cases where the estimation error in Equation (1) can be upper bounded.
|
| 153 |
+
|
| 154 |
+
Low Distribution Shift. The first special we focus on is the case where the distribution shift between the data distributions and the distribution induced by the policy to be evaluated is low. To measure the distribution shift formally, our main assumption is as follows.
|
| 155 |
+
|
| 156 |
+
Assumption 3. We assume that for each $h \in [ H ]$ , there exists $C _ { h } \geq 1$ such that $\overline { { \Lambda _ { h } } } \preceq C _ { h } \Lambda _ { h }$ .
|
| 157 |
+
|
| 158 |
+
Remark 5. For each Therefore, Assumptio $h \in [ H ]$ , if be r $\sigma _ { \mathrm { m i n } } ( \Lambda _ { h } ) \succeq \frac { 1 } { C _ { h } } I$ for some ssumption $C _ { h } \geq 1$ e . $\overline { { { \Lambda } } } _ { h } \preceq I \preceq C _ { h } \Lambda _ { h }$ $C _ { h } \Lambda _ { h } \succeq I$ to the original version of Assumption 3 as it gives a tighter characterization of the distribution shift.
|
| 159 |
+
|
| 160 |
+
Now we state the theoretical guarantee of Algorithm 1. The proof can be found in Appendix D.
|
| 161 |
+
|
| 162 |
+
Theorem 5.2. Suppose for the given policy $\pi$ , there exists $\theta _ { 1 } , \theta _ { 2 } , \ldots , \theta _ { d } \ \in \ \mathbb { R } ^ { d }$ such that for√ each $h \in [ H ] , Q _ { h } ^ { \pi } ( s , a ) \ : = \ : \phi ( s , a ) ^ { \top } \theta _ { h }$ for all $( s , a ) \ \in \ S _ { h } \times { \mathcal A }$ and $\| \theta _ { h } \| _ { 2 } ~ \le ~ H \sqrt { d } .$ 4 Let $\lambda = C H \sqrt { d \log ( d H / \delta ) N }$ for some $C > 0$ . With probability at least $1 - \delta$ , for some $c > 0$ , $\begin{array} { r } { ( Q _ { 1 } ^ { \pi } ( s _ { 1 } , \pi ( s _ { 1 } ) ) - \hat { Q } _ { 1 } ( s _ { 1 } , \pi ( s _ { 1 } ) ) ) ^ { 2 } \leq c \cdot \prod _ { h = 1 } ^ { H } C _ { h } \cdot d H ^ { 5 } \cdot \sqrt { d \log ( d H / \delta ) / N } } \end{array}$ .
|
| 163 |
+
|
| 164 |
+
Remark 6. The factor $\textstyle \prod _ { h = 1 } ^ { H } C _ { h }$ in Theorem 5.2 implies that the estimation error will be amplified geometrically. Now we discuss how the error is amplified when running Algorithm 1 on the instance in Section 4 to better illustrate the issue. If we run Algorithm 1 on the hard instance in Section 4, when $h = H$ , the estimation error on $V ( s _ { H } ^ { c } )$ would be roughly $N ^ { - 1 / 2 }$ for each $c \in [ \hat { d } ]$ . When using the linear predictor at level $H$ to predict the value of $s _ { H } ^ { * }$ , the error will be amplified by $\hat { d } ^ { 1 / 2 }$ . When $h = H - 1$ , the dataset contains only $s _ { H - 1 } ^ { c }$ for $c \in [ \hat { d } ]$ , and the estimation error on the value of $s _ { H - 1 } ^ { c }$ will be the same as that of $s _ { H } ^ { * }$ , which is roughly $( \hat { d } / N ) ^ { 1 / 2 }$ . Again, the estimation error on the value of $s _ { H - 1 } ^ { * }$ will be $( \hat { d } ^ { 2 } / N ) ^ { 1 / 2 }$ when using the linear predictor at level $H - 1$ . The error will eventually be amplified by a factor of $\hat { d } ^ { H / 2 }$ , which corresponds to the factor $\textstyle \prod _ { h = 1 } ^ { H } C _ { h }$ in Theorem 5.2.
|
| 165 |
+
|
| 166 |
+
Policy Completeness. In offline RL, another representation condition is closedness under Bellman update (Szepesvari & Munos, 2005; Duan & Wang, 2020), which is stronger than realizability. In ´ the context of offline policy evaluation, we have the following policy completeness assumption.
|
| 167 |
+
|
| 168 |
+
Assumption 4. For the given policy $\pi$ , for any $h > 1$ and $\theta _ { h } \in \mathbb { R } ^ { d }$ , there exists $\theta ^ { \prime } \in \mathbb { R } ^ { d }$ such that for any $\begin{array} { r } { ( s , a ) \in \mathcal S _ { h - 1 } \times \mathcal A , \mathbb E [ R ( s , a ) ] + \sum _ { s ^ { \prime } \in { \cal S } _ { h } } P ( s ^ { \prime } \mid s , a ) \phi ( s ^ { \prime } , \pi ( s ^ { \prime } ) ) ^ { \top } \theta _ { h } = \phi ( s , a ) ^ { \top } \theta ^ { \prime } . } \end{array}$ .
|
| 169 |
+
|
| 170 |
+
Under Assumption 4 and the assumption that $\sigma _ { \operatorname* { m i n } } ( \Lambda _ { h } ) \geq \lambda _ { 0 }$ for all $h \in [ H ]$ for some $\lambda _ { 0 } > 0$ , Duan & Wang (2020) have shown that for Algorithm 1, by taking $N = \mathrm { p o l } \bar { \mathrm { y } } ( \bar { H } , d , 1 / \varepsilon , 1 / \lambda _ { 0 } )$ , we have $( Q _ { 1 } ^ { \pi } ( s _ { 1 } , \pi ( s _ { 1 } ) ) - \hat { Q } _ { 1 } ( s _ { 1 } , \pi ( s _ { 1 } ) ) ) ^ { 2 } \leq \varepsilon$ . We refer interested readers to (Duan & Wang, 2020).
|
| 171 |
+
|
| 172 |
+
We remark that the above analysis again implies that geometric error amplification is a real issue in offline RL, and sample-efficient offline RL is impossible unless the distribution shift is sufficiently low, i.e., $\textstyle \prod _ { h = 1 } ^ { H } C _ { h }$ is bounded, or strong representation condition (e.g. policy completeness) holds.
|
| 173 |
+
|
| 174 |
+
# 6 CONCLUSION
|
| 175 |
+
|
| 176 |
+
While the extant body of provable results in the literature largely focus on sufficient conditions for sample-efficient offline RL, this work focuses on obtaining a better understanding of the necessary conditions, where we seek to understand to what extent mild assumptions can imply sample-efficient offline RL. This work shows that for off-policy evaluation, even if we are given a representation that can perfectly represent the value function of the given policy and the data distribution has good coverage over the features, any provable algorithm still requires an exponential number of samples to non-trivially approximate the value of the given policy. These results highlight that provable sample-efficient offline RL is simply not possible unless either the distribution shift condition is sufficiently mild or we have stronger representation conditions that go well beyond realizability.
|
| 177 |
+
|
| 178 |
+
# ACKNOWLEDGMENTS
|
| 179 |
+
|
| 180 |
+
The authors would like to thank Akshay Krishnamurthy, Alekh Agarwal, Wen Sun, and Nan Jiang for numerous helpful discussion. Sham M. Kakade gratefully acknowledges funding from the ONR award N00014-18-1-2247, and NSF Awards CCF-1703574 and CCF-1740551. Ruosong Wang was supported in part by the NSF IIS1763562, US Army W911NF1920104, and ONR Grant N000141812861. Research performed while Ruosong Wang was an intern at Microsoft Research.
|
| 181 |
+
|
| 182 |
+
# REFERENCES
|
| 183 |
+
|
| 184 |
+
Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. An optimistic perspective on offline reinforcement learning. In International Conference on Machine Learning, 2020.
|
| 185 |
+
|
| 186 |
+
Martin Anthony and Peter L Bartlett. Neural network learning: Theoretical foundations. cambridge university press, 2009.
|
| 187 |
+
|
| 188 |
+
Andras Antos, Csaba Szepesv ´ ari, and R ´ emi Munos. Learning near-optimal policies with bellman- ´ residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71(1):89–129, 2008.
|
| 189 |
+
|
| 190 |
+
Keith Ball. An elementary introduction to modern convex geometry. Flavors of geometry, 31:1–58, 1997.
|
| 191 |
+
|
| 192 |
+
Dimitri P Bertsekas and John N Tsitsiklis. Neuro-dynamic programming: an overview. In Proceedings of 1995 34th IEEE Conference on Decision and Control, volume 1, pp. 560–564. IEEE, 1995.
|
| 193 |
+
|
| 194 |
+
Sebastien Bubeck, Nicol ´ o Cesa-Bianchi, and Sham M. Kakade. Towards minimax policies for \` online linear optimization with bandit feedback. In COLT 2012 - The 25th Annual Conference on Learning Theory, June 25-27, 2012, Edinburgh, Scotland, volume 23 of JMLR Proceedings, pp. 41.1–41.14, 2012.
|
| 195 |
+
|
| 196 |
+
Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. In International Conference on Machine Learning, pp. 1042–1051, 2019.
|
| 197 |
+
|
| 198 |
+
Herman Chernoff. Sequential analysis and optimal design. SIAM, 1972.
|
| 199 |
+
|
| 200 |
+
Simon S. Du, Sham M. Kakade, Ruosong Wang, and Lin F. Yang. Is a good representation sufficient for sample efficient reinforcement learning? In International Conference on Learning Representations, 2020.
|
| 201 |
+
|
| 202 |
+
Yaqi Duan and Mengdi Wang. Minimax-optimal off-policy evaluation with linear function approximation. arXiv preprint arXiv:2002.09516, 2020.
|
| 203 |
+
|
| 204 |
+
Miroslav Dud´ık, John Langford, and Lihong Li. Doubly robust policy evaluation and learning. In Proceedings of the 28th International Conference on International Conference on Machine Learning, pp. 1097–1104, 2011.
|
| 205 |
+
|
| 206 |
+
Mehrdad Farajtabar, Yinlam Chow, and Mohammad Ghavamzadeh. More robust doubly robust off-policy evaluation. In International Conference on Machine Learning, pp. 1447–1456, 2018.
|
| 207 |
+
|
| 208 |
+
Yihao Feng, Tongzheng Ren, Ziyang Tang, and Qiang Liu. Accountable off-policy evaluation with kernel bellman statistics. arXiv preprint arXiv:2008.06668, 2020.
|
| 209 |
+
|
| 210 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052–2062, 2019.
|
| 211 |
+
|
| 212 |
+
Geoffrey J Gordon. Stable function approximation in dynamic programming. In Machine Learning Proceedings 1995, pp. 261–268. Elsevier, 1995.
|
| 213 |
+
|
| 214 |
+
Geoffrey J Gordon. Stable fitted reinforcement learning. In Advances in neural information processing systems, pp. 1052–1058, 1996.
|
| 215 |
+
|
| 216 |
+
Geoffrey J Gordon. Approximate solutions to markov decision processes. Technical report, CARNEGIE-MELLON UNIV PITTSBURGH PA SCHOOL OF COMPUTER SCIENCE, 1999.
|
| 217 |
+
|
| 218 |
+
Omer Gottesman, Fredrik Johansson, Joshua Meier, Jack Dent, Donghun Lee, Srivatsan Srinivasan, Linying Zhang, Yi Ding, David Wihl, Xuefeng Peng, Jiayu Yao, Isaac Lage, Christopher Mosch, Li wei H. Lehman, Matthieu Komorowski, Matthieu Komorowski, Aldo Faisal, Leo Anthony Celi, David Sontag, and Finale Doshi-Velez. Evaluating reinforcement learning algorithms in observational health settings, 2018.
|
| 219 |
+
|
| 220 |
+
Zhaohan Guo, Philip S Thomas, and Emma Brunskill. Using options and covariance testing for long horizon off-policy policy evaluation. In Advances in Neural Information Processing Systems, pp. 2492–2501, 2017.
|
| 221 |
+
|
| 222 |
+
Daniel Hsu, Sham Kakade, Tong Zhang, et al. A tail inequality for quadratic forms of subgaussian random vectors. Electronic Communications in Probability, 17, 2012a.
|
| 223 |
+
|
| 224 |
+
Daniel Hsu, Sham M Kakade, and Tong Zhang. Random design analysis of ridge regression. In Conference on learning theory, pp. 9–1, 2012b.
|
| 225 |
+
|
| 226 |
+
Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of human preferences in dialog, 2020. URL https://openreview.net/forum?id $=$ rJl5rRVFvH.
|
| 227 |
+
|
| 228 |
+
Nan Jiang and Jiawei Huang. Minimax confidence interval for off-policy evaluation and policy optimization. arXiv preprint arXiv:2002.02081, 2020.
|
| 229 |
+
|
| 230 |
+
Nan Jiang and Lihong Li. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 652–661. PMLR, 2016.
|
| 231 |
+
|
| 232 |
+
Sham Machandranath Kakade. On the sample complexity of reinforcement learning. PhD thesis, University of London London, England, 2003.
|
| 233 |
+
|
| 234 |
+
Nathan Kallus and Masatoshi Uehara. Efficiently breaking the curse of horizon in off-policy evaluation with double reinforcement learning. arXiv preprint arXiv:1909.05850, 2019.
|
| 235 |
+
|
| 236 |
+
Nathan Kallus and Masatoshi Uehara. Double reinforcement learning for efficient off-policy evaluation in markov decision processes. Journal of Machine Learning Research, 21(167):1–63, 2020.
|
| 237 |
+
|
| 238 |
+
Emilie Kaufmann, Olivier Cappe, and Aur ´ elien Garivier. On the complexity of best-arm identifi- ´ cation in multi-armed bandit models. The Journal of Machine Learning Research, 17(1):1–42, 2016.
|
| 239 |
+
|
| 240 |
+
Rahul Kidambi, Aravind Rajeswaran, Praneeth Netrapalli, and Thorsten Joachims. Morel $:$ Modelbased offline reinforcement learning, 2020.
|
| 241 |
+
|
| 242 |
+
Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Pac reinforcement learning with rich observations. In Advances in Neural Information Processing Systems, pp. 1840–1848, 2016.
|
| 243 |
+
|
| 244 |
+
Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. neural information processing systems, pp. 11761– 11771, 2019.
|
| 245 |
+
|
| 246 |
+
Aviral Kumar, Abhishek Gupta, and Sergey Levine. Discor: Corrective feedback in reinforcement learning via distribution correction. arXiv preprint arXiv:2003.07305, 2020.
|
| 247 |
+
|
| 248 |
+
Michail G Lagoudakis and Ronald Parr. Least-squares policy iteration. Journal of machine learning research, 4(Dec):1107–1149, 2003.
|
| 249 |
+
|
| 250 |
+
Romain Laroche, Paul Trichelair, and Remi Tachet des Combes. Safe policy improvement with ´ baseline bootstrapping. In Proceedings of the 36th International Conference on Machine Learning (ICML), 2019.
|
| 251 |
+
|
| 252 |
+
Lihong Li, Remi Munos, and Csaba Szepesvari. Toward minimax off-policy value estimation. In Artificial Intelligence and Statistics, pp. 608–616, 2015.
|
| 253 |
+
|
| 254 |
+
Qiang Liu, Lihong Li, Ziyang Tang, and Dengyong Zhou. Breaking the curse of horizon: Infinitehorizon off-policy estimation. In Advances in Neural Information Processing Systems, pp. 5356– 5366, 2018.
|
| 255 |
+
|
| 256 |
+
Yao Liu, Pierre-Luc Bacon, and Emma Brunskill. Understanding the curse of horizon in off-policy evaluation via conditional importance sampling. arXiv preprint arXiv:1910.06508, 2019.
|
| 257 |
+
|
| 258 |
+
Travis Mandel, Yun-En Liu, Sergey Levine, Emma Brunskill, and Zoran Popovic. Offline policy evaluation across representations with applications to educational games. In AAMAS, pp. 1077– 1084, 2014.
|
| 259 |
+
|
| 260 |
+
Shie Mannor and John N Tsitsiklis. The sample complexity of exploration in the multi-armed bandit problem. Journal of Machine Learning Research, 5(Jun):623–648, 2004.
|
| 261 |
+
|
| 262 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 263 |
+
|
| 264 |
+
Wenlong Mou, Zheng Wen, and Xi Chen. On the sample complexity of reinforcement learning with policy space generalization. arXiv preprint arXiv:2008.07353, 2020.
|
| 265 |
+
|
| 266 |
+
Remi Munos. Error bounds for approximate policy iteration. In ´ ICML, volume 3, pp. 560–567, 2003.
|
| 267 |
+
|
| 268 |
+
Remi Munos and Andrew W Moore. Barycentric interpolators for continuous space and time reinforcement learning. In Advances in neural information processing systems, pp. 1024–1030, 1999.
|
| 269 |
+
|
| 270 |
+
Remi Munos and Csaba Szepesv ´ ari. Finite-time bounds for fitted value iteration. ´ Journal of Machine Learning Research, 9(May):815–857, 2008.
|
| 271 |
+
|
| 272 |
+
Dirk Ormoneit and Saunak Sen. Kernel-based reinforcement learning. ´ Machine learning, 49(2-3): 161–178, 2002.
|
| 273 |
+
|
| 274 |
+
Doina Precup. Eligibility traces for off-policy policy evaluation. Computer Science Department Faculty Publication Series, pp. 80, 2000.
|
| 275 |
+
|
| 276 |
+
Stephane Ross and Drew Bagnell. Agnostic system identification for model-based reinforcement ´ learning. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, June 26 - July 1, 2012. icml.cc / Omnipress, 2012.
|
| 277 |
+
|
| 278 |
+
Wen Sun, Arun Venkatraman, Geoffrey J Gordon, Byron Boots, and J Andrew Bagnell. Deeply aggrevated: Differentiable imitation learning for sequential prediction. In International Conference on Machine Learning, pp. 3309–3318, 2017.
|
| 279 |
+
|
| 280 |
+
Csaba Szepesvari and R ´ emi Munos. Finite time bounds for sampling based fitted value iteration. In ´ Proceedings of the 22nd international conference on Machine learning, pp. 880–887, 2005.
|
| 281 |
+
|
| 282 |
+
Philip Thomas and Emma Brunskill. Data-efficient off-policy policy evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 2139–2148, 2016.
|
| 283 |
+
|
| 284 |
+
Philip S. Thomas. Safe reinforcement learning. PhD thesis, University of Massachusetts, Amherst, 2014.
|
| 285 |
+
|
| 286 |
+
Philip S Thomas, Georgios Theocharous, and Mohammad Ghavamzadeh. High-confidence offpolicy evaluation. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015.
|
| 287 |
+
|
| 288 |
+
Philip S. Thomas, Bruno Castro da Silva, Andrew G. Barto, Stephen Giguere, Yuriy Brun, and Emma Brunskill. Preventing undesirable behavior of intelligent machines. Science, 366(6468): 999–1004, 2019. ISSN 0036-8075. doi: 10.1126/science.aag3311.
|
| 289 |
+
|
| 290 |
+
Samuele Tosatto, Matteo Pirotta, Carlo d’Eramo, and Marcello Restelli. Boosted fitted q-iteration. In International Conference on Machine Learning, pp. 3434–3443. PMLR, 2017.
|
| 291 |
+
|
| 292 |
+
Joel A Tropp. An introduction to matrix concentration inequalities. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 8(1-2):1–230, 2015.
|
| 293 |
+
|
| 294 |
+
J Tsitsiklis and B Van Roy. An analysis of temporal-difference learning with function approximation (technical report lids-p-2322). Laboratory for Information and Decision Systems, 1996.
|
| 295 |
+
|
| 296 |
+
Masatoshi Uehara and Nan Jiang. Minimax weight and q-function learning for off-policy evaluation. arXiv preprint arXiv:1910.12809, 2019.
|
| 297 |
+
|
| 298 |
+
Benjamin Van Roy. Feature-based methods for large scale dynamic programming. PhD thesis, Massachusetts Institute of Technology, 1994.
|
| 299 |
+
|
| 300 |
+
L. Wang, Wei Zhang, Xiaofeng He, and H. Zha. Supervised reinforcement learning with recurrent neural network for dynamic treatment recommendation. Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2018.
|
| 301 |
+
|
| 302 |
+
Ruosong Wang, Simon S Du, Lin F Yang, and Ruslan Salakhutdinov. On reward-free reinforcement learning with linear function approximation. arXiv preprint arXiv:2006.11274, 2020.
|
| 303 |
+
|
| 304 |
+
Yu-Xiang Wang, Alekh Agarwal, and Miroslav Dudık. Optimal and adaptive off-policy evaluation in contextual bandits. In International Conference on Machine Learning, pp. 3589–3597. PMLR, 2017.
|
| 305 |
+
|
| 306 |
+
Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning, 2020. URL https://openreview.net/forum?id ${ . } = { }$ BJg9hTNKPH.
|
| 307 |
+
|
| 308 |
+
Tengyang Xie and Nan Jiang. Batch value-function approximation with only realizability. arXiv preprint arXiv:2008.04990, 2020a.
|
| 309 |
+
|
| 310 |
+
Tengyang Xie and Nan Jiang. $Q ^ { \star }$ approximation schemes for batch reinforcement learning: A theoretical comparison. arXiv preprint arXiv:2003.03924, 2020b.
|
| 311 |
+
|
| 312 |
+
Tengyang Xie, Yifei Ma, and $\mathrm { Y u }$ -Xiang Wang. Towards optimal off-policy evaluation for reinforcement learning with marginalized importance sampling. In Advances in Neural Information Processing Systems, pp. 9668–9678, 2019.
|
| 313 |
+
|
| 314 |
+
C. Yu, G. Ren, and J. Liu. Deep inverse reinforcement learning for sepsis treatment. In 2019 IEEE International Conference on Healthcare Informatics (ICHI), pp. 1–3, 2019.
|
| 315 |
+
|
| 316 |
+
Andrea Zanette, Alessandro Lazaric, Mykel J Kochenderfer, and Emma Brunskill. Limiting extrapolation in linear approximate value iteration. In Advances in Neural Information Processing Systems, pp. 5616–5625, 2019.
|
| 317 |
+
|
| 318 |
+
# A PROOF OF LEMMA 4.2
|
| 319 |
+
|
| 320 |
+
Proof. We first verify $Q ^ { \pi }$ is linear for the first $H - 1$ levels. For each $( h , c ) \in [ H - 1 ] \times [ \hat { d } ]$ , we have
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
Q _ { h } ^ { \pi } ( s _ { h } ^ { c } , a _ { 1 } ) = R ( s _ { h } ^ { c } , a _ { 1 } ) + R ( s _ { h + 1 } ^ { \hat { d } + 1 } , a _ { 1 } ) + R ( s _ { h + 2 } ^ { \hat { d } + 1 } , a _ { 1 } ) + \ldots + R ( s _ { H } ^ { \hat { d } + 1 } , a _ { 1 } ) = r _ { 0 } \cdot \hat { d } ^ { ( H - h ) / 2 } .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
Moreover, for all $a \in { \mathcal { A } }$ ,
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { r } { \mathcal { Q } _ { h } ^ { \pi } ( s _ { h } ^ { \hat { d } + 1 } , a ) = R ( s _ { h } ^ { \hat { d } + 1 } , a ) + R ( s _ { h + 1 } ^ { \hat { d } + 1 } , a _ { 1 } ) + R ( s _ { h + 2 } ^ { \hat { d } + 1 } , a _ { 1 } ) + . . . + R ( s _ { H } ^ { \hat { d } + 1 } , a _ { 1 } ) = r _ { 0 } \cdot \hat { d } ^ { ( H - h + 1 ) / 2 } . } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
Therefore, if we define
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\boldsymbol { \theta } _ { h } ^ { \pi } = \sum _ { c = 1 } ^ { \hat { d } } \boldsymbol { r } _ { 0 } \cdot \hat { d } ^ { ( H - h ) / 2 } \cdot \boldsymbol { e } _ { c } + \sum _ { c = 1 } ^ { \hat { d } } Q _ { h } ^ { \pi } ( s _ { h } ^ { c } , a _ { 2 } ) \cdot \boldsymbol { e } _ { c + \hat { d } } ,
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
then $Q _ { h } ^ { \pi } ( s , a ) = \left( \theta _ { h } ^ { \pi } \right) ^ { \top } \phi ( s , a )$ for all $( s , a ) \in S _ { h } \times \mathcal { A }$
|
| 339 |
+
|
| 340 |
+
Now we verify that the $Q$ -function is linear for the last level. Clearly, for all $c \in [ \hat { d } ]$ and $a \in { \mathcal { A } }$ , $Q _ { H } ^ { \pi } ( s _ { H } ^ { c } , a ) = r _ { 0 }$ and $Q _ { H } ^ { \pi } ( s _ { H } ^ { \hat { d } + 1 } , a ) = r _ { 0 } \cdot \sqrt { \hat { d } }$ . Thus by defining $\begin{array} { r } { \theta _ { H } ^ { \pi } = \sum _ { c = 1 } ^ { d } r _ { 0 } \cdot e _ { c } } \end{array}$ , we have $Q _ { H } ^ { \pi } ( s , a ) = \left( \theta _ { H } ^ { \pi } \right) ^ { \top } \phi ( s , a )$ for all $( s , a ) \in { \cal S } _ { H } \times \mathcal { A }$ .
|
| 341 |
+
|
| 342 |
+
# B A TECHNICAL LEMMA
|
| 343 |
+
|
| 344 |
+
We need the following lemma in the proof of our hardness results.
|
| 345 |
+
|
| 346 |
+
Lemma B.1. Let α be a random variable uniformly distributed on $\{ \alpha _ { + } , \alpha _ { - } \}$ , where $\alpha _ { - } = 1 / 2$ and $\alpha _ { + } = 1 / 2 + \varepsilon$ with $0 < \varepsilon < 1$ . Suppose that $\xi _ { 1 } , \xi _ { 2 } , \ldots , \xi _ { m }$ are i.i.d. $\{ + 1 , - 1 \}$ -valued random variables with $\operatorname* { P r } [ \xi _ { i } = + 1 ] = \alpha$ for all $i \in [ m ]$ . Let $f$ be a function from $\bar { \{ + 1 , - 1 \} } ^ { m }$ to $\{ \alpha _ { + } , \alpha _ { - } \}$ . Suppose $m \le C / \varepsilon ^ { 2 } \log ( 1 / \delta )$ for some fixed constant $C$ . Then
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\operatorname* { P r } [ f ( \xi _ { 1 } , \xi _ { 2 } , \ldots , \xi _ { m } ) \neq \alpha ] > \delta .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
To our best knowledge, Lemma B.1 was first proved in (Chernoff, 1972) and has enormous applications in statistical learning theory (see, e.g., Chapter 5 in (Anthony & Bartlett, 2009)) and bandits (Mannor & Tsitsiklis, 2004).
|
| 353 |
+
|
| 354 |
+
To prove Lemma B.1, one can first prove that the maximum likelihood estimator (MLE) is optimal and then show that MLE requires $\dot { \Omega ( 1 / \varepsilon ^ { 2 } \log ( 1 / \delta ) ) }$ samples to correctly output $\alpha$ with probability $1 - \delta$ by anti-concentration. Lemma B.1 can also be proved by using information theory. See, e.g., (Kaufmann et al., 2016) for such a proof.
|
| 355 |
+
|
| 356 |
+
# C ANOTHER HARD INSTANCE
|
| 357 |
+
|
| 358 |
+
In this section, we present another hard case under a weaker version of Assumption 1. Here the transition operator is stochastic and the reward is deterministic and sparse, meaning that the reward value is non-zero only for the last level. Moreover, the data distributions $\{ \mu _ { h } \} _ { h = 1 } ^ { H }$ are induced by a fixed policy $\pi _ { \mathrm { d a t a } }$ . We also illustrate the construction in Figure 2. Throughout this section, we use $d$ the denote the feature dimension, and we assume $d$ is an even integer for simplicity. We use $\hat { d }$ to denote $d / 2 - 1$ .
|
| 359 |
+
|
| 360 |
+
In this section, we adopt the following realizability assumption, which is a weaker version of Assumption 1.
|
| 361 |
+
|
| 362 |
+
Assumption 5 (Realizability). For the policy $\pi : { \mathcal { S } } \to \Delta ( { \mathcal { A } } )$ to be evaluated, there exists $\theta _ { 1 } , \ldots \theta _ { H } \in \mathbb { R } ^ { d }$ such that for all $( s , a ) \in S \times A$ and $h \in [ H ]$ ,
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
Q _ { h } ^ { \pi } ( s , a ) = \theta _ { h } ^ { \top } \phi ( s , a ) .
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 2: An illustration of the hard instance. Recall that $\hat { d } = d / 2 - 1$ . States on the top are those in the first level $( h = 1 )$ ), while states at the bottom are those in the last level ( $h = H$ ). Dotted line (with arrow) corresponds to transitions associated with actions $a _ { 1 } , a _ { 2 } , \ldots , a _ { \hat { d } }$ , while solid line (with arrow) corresponds to transitions associated with actions $a _ { \hat { d } + 1 } , a _ { \hat { d } + 2 } , \dotsc , a _ { d }$ . We omit the transition associated with $a _ { 1 } , a _ { 2 } , \ldots , a _ { \hat { d } }$ in the figure if all actions give the same transition. For each level $h \in [ H ]$ , $Q$ -values associated with $s _ { h } ^ { 1 } , s _ { h } ^ { 2 } , \ldots , s _ { h } ^ { \hat { d } } , s _ { h } ^ { + } , s _ { h } ^ { - }$ , sdˆh, s+h , s−h are marked on the left, while transition distributions and $Q$ -values associated with + − $s _ { h } ^ { \hat { d } + 1 }$ are marked on the right. Rewards are all deterministic, and the only two states ) with non-zero reward values are marked in black and grey. Consider the fixed policy that returns $\mathit { a } _ { d }$ for all input states. When $r _ { 0 } = 0$ , the value of the policy is 0. When $r _ { 0 } = \hat { d } ^ { - ( \bar { H } - 2 ) / 2 }$ , the value of the policy $s = r _ { 0 } \hat { d } ^ { ( H - 2 ) / 2 } = 1$ .
|
| 370 |
+
|
| 371 |
+
State Space, Action Space and Transition Operator. In this hard case, the action space ${ \mathcal { A } } =$ $\{ a _ { 1 } , a _ { 2 } , \ldots , a _ { d } \}$ contains $d$ elements. $S _ { 1 }$ contains a single state $s _ { 1 }$ . For each $h \geq 2$ , $S _ { h }$ contains ${ \hat { d } } + 3$ states $s _ { h } ^ { 1 } , s _ { h } ^ { 2 } , \ldots , s _ { h } ^ { \hat { d } } , s _ { h } ^ { \hat { d } + 1 } , s _ { h } ^ { + }$ and $s _ { h } ^ { - }$ .
|
| 372 |
+
|
| 373 |
+
Let $0 \leq r _ { 0 } \leq \hat { d } ^ { - ( H - 2 ) / 2 }$ be a parameter to be determined. We first define the transition operator for the first level. We have
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
P ( s _ { 1 } , a ) = \left\{ \begin{array} { l l } { s _ { 2 } ^ { c } } & { a = a _ { c } , c \in [ \hat { d } ] } \\ { s _ { 2 } ^ { + } } & { a = a _ { \hat { d } + 1 } } \\ { s _ { 2 } ^ { - } } & { a = a _ { \hat { d } + 2 } } \\ { s _ { 2 } ^ { \hat { d } + 1 } } & { a \in \{ a _ { \hat { d } + 3 } , a _ { \hat { d } + 4 } , \dots , a _ { d } \} } \end{array} \right. .
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
Now we define the transition operator when $h \in \{ 2 , 3 , \ldots , H - 2 \}$ . For each $h \in \{ 2 , 3 , \ldots , H - 2 \}$ , $a \in { \mathcal { A } }$ and $c \in [ \hat { d } ]$ , we have $P ( s _ { h } ^ { c } , a ) = s _ { h + 1 } ^ { \hat { d } + 1 }$ , $P ( s _ { h } ^ { + } , a ) = s _ { h + 1 } ^ { + }$ and $P ( s _ { h } ^ { - } , a ) = s _ { h + 1 } ^ { - }$ . For each $h \in \{ 2 , 3 , \ldots , H - 2 \}$ and $c \in [ \hat { d } ]$ , we have $P ( s _ { h } ^ { \hat { d } + 1 } , a _ { c } ) = s _ { h + 1 } ^ { c }$ . For all $a \in \left\{ a _ { \hat { d } + 1 } , a _ { \hat { d } + 2 } , \dotsc , a _ { d } \right\}$ ,
|
| 380 |
+
|
| 381 |
+
we have
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
P \left( s _ { h } ^ { \hat { d } + 1 } , a \right) = \left\{ \begin{array} { l l } { s _ { h + 1 } ^ { + } } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } ( 1 + r _ { 0 } \cdot \hat { d } ^ { ( H - h ) / 2 } ) / 2 } \\ { s _ { h + 1 } ^ { - } } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } ( 1 - r _ { 0 } \cdot \hat { d } ^ { ( H - h ) / 2 } ) / 2 } \end{array} \right. .
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Now we define the transition operator for the second last level. For all $c \in [ \hat { d } ]$ and $a \in { \mathcal { A } }$ , we have
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
P ( s _ { H - 1 } ^ { c } , a ) = \left\{ \begin{array} { l l } { s _ { H } ^ { + } } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } ( 1 + r _ { 0 } ) / 2 } \\ { s _ { H } ^ { - } } & { \mathrm { w i t h ~ p r o b a b i l i t y ~ } ( 1 - r _ { 0 } ) / 2 } \end{array} \right. .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
For all $a \in { \mathcal { A } }$ , we have $P ( s _ { H - 1 } ^ { + } , a ) = s _ { H } ^ { + }$ and $P ( s _ { H - 1 } ^ { - } , a ) \ = \ s _ { H } ^ { - }$ . For each $c \in [ \hat { d } ]$ , we have $P ( s _ { H - 1 } ^ { \hat { d } + 1 } , a _ { c } ) = s _ { H } ^ { c }$ . For all $a \in \left\{ a _ { \hat { d } + 1 } , a _ { \hat { d } + 2 } , \dotsc , a _ { d } \right\}$ , we have
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
P ( s _ { H - 1 } ^ { \hat { d } + 1 } , a ) = \left\{ \begin{array} { l l } { s _ { H } ^ { + } } & { \mathrm { w i t h } \mathrm { p r o b a b i l i t y } \left( 1 + r _ { 0 } \cdot \sqrt { \hat { d } } \right) / 2 } \\ { s _ { H } ^ { - } } & { \mathrm { w i t h } \mathrm { p r o b a b i l i t y } \left( 1 - r _ { 0 } \cdot \sqrt { \hat { d } } \right) / 2 } \end{array} \right. .
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Reward Values. In this hard case, all reward values are deterministic, and reward values can be non-zero only for the last level. Formally, we have
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
R ( s , a ) = \left\{ { \begin{array} { l l } { 1 } & { s = s _ { H } ^ { + } } \\ { - 1 } & { s = s _ { H } ^ { - } } \\ { 0 } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right. .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Feature Mapping. As in the in hard instance in Section 4, let $e _ { 1 } , e _ { 2 } , \ldots , e _ { d }$ be a set of of orthonormal vectors in $\mathbb { R } ^ { d }$ . For the initial state, for each $c \in [ d ]$ , we have $\phi ( s _ { 1 } , a _ { c } ) = e _ { c }$ .
|
| 406 |
+
|
| 407 |
+
Now we define the feature mapping when $h \in \{ 2 , 3 , \ldots , H \}$ . For each $h \in \{ 2 , 3 , \ldots , H \}$ , $a \in { \mathcal { A } }$ and $c \in [ \hat { d } ] , \phi ( s _ { h } ^ { c } , a ) = e _ { c } , \phi ( s _ { h } ^ { + } , a ) = e _ { \hat { d } + 1 }$ and $\phi ( s _ { h } ^ { - } , a ) = e _ { \hat { d } + 2 }$ . Moreover, for all actions $a \in { \mathcal { A } }$ ,
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\phi ( s _ { h } ^ { \hat { d } + 1 } , a ) = \left\{ { \begin{array} { l l } { e _ { \hat { d } + 2 + c } } & { a = a _ { c } , c \in [ { \hat { d } } ] } \\ { { \frac { 1 } { d ^ { 1 / 2 } } } \left( e _ { 1 } + e _ { 2 } + \ldots + e _ { \hat { d } } \right) } & { a \in \left\{ a _ { \hat { d } + 1 } , a _ { \hat { d } + 2 } , \ldots , a _ { d } \right\} } \end{array} } \right. .
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
Clearly, for all (s, a) ∈ S × A, $\| \phi ( s , a ) \| _ { 2 } \leq 1$ .
|
| 414 |
+
|
| 415 |
+
Verifying Assumption 5. Now we consider the deterministic policy $\pi : { \mathcal { S } } A$ , which is defined to be $\pi ( s ) = a _ { d }$ for all $s \in S$ . We show that Assumption 5 holds.
|
| 416 |
+
|
| 417 |
+
When $h = 1$ , define
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\theta _ { 1 } = \sum _ { c = 1 } ^ { \hat { d } } r _ { 0 } \cdot \hat { d } ^ { ( H - 3 ) / 2 } \cdot e _ { c } + e _ { \hat { d } + 1 } - e _ { \hat { d } + 2 } + \sum _ { c = 1 } ^ { \hat { d } } r _ { 0 } \cdot \hat { d } ^ { ( H - 2 ) / 2 } \cdot e _ { \hat { d } + 2 + c } .
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
For each $h \in \{ 2 , 3 , \ldots , H - 2 \}$ , define
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\theta _ { h } = \sum _ { c = 1 } ^ { \hat { d } } r _ { 0 } \cdot \hat { d } ^ { ( H - h - 1 ) / 2 } \cdot e _ { c } + e _ { \hat { d } + 1 } - e _ { \hat { d } + 2 } + \sum _ { c = 1 } ^ { \hat { d } } r _ { 0 } \cdot \hat { d } ^ { ( H - h - 2 ) / 2 } \cdot e _ { \hat { d } + 2 + c } .
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
For the second last level $h = H - 1$ , define
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\theta _ { H - 1 } = \sum _ { c = 1 } ^ { \hat { d } } r _ { 0 } \cdot e _ { c } + e _ { \hat { d } + 1 } - e _ { \hat { d } + 2 } .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
Finally, for the last level $h = H$ , define
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\theta _ { H } = e _ { \hat { d } + 1 } - e _ { \hat { d } + 2 } .
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
It can be verified that for each $h \in [ H ]$ , $Q _ { h } ^ { \pi } ( s , a ) = \theta _ { h } ^ { \top } \phi ( s , a )$ for all $( s , a ) \in S _ { h } \times \mathcal { A }$ .
|
| 442 |
+
|
| 443 |
+
The Data Distributions. For the first level, the data distribution $\mu _ { 1 }$ is defined to be the uniform distribution over $\{ ( s _ { 1 } , a _ { c } ) ~ | ~ c ~ \in ~ [ d ] \}$ . For each $h \geq 2$ , the data distribution $\mu _ { h }$ is a uniform distribution over
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\{ ( s _ { h } ^ { 1 } , a _ { 1 } ) , ( s _ { h } ^ { 2 } , a _ { 1 } ) , \ldots , ( s _ { h } ^ { \hat { d } } , a _ { 1 } ) , ( s _ { h } ^ { + } , a _ { 1 } ) , ( s _ { h } ^ { - } , a _ { 1 } ) , ( s _ { h } ^ { \hat { d } + 1 } , a _ { 1 } ) , ( s _ { h } ^ { \hat { d } + 1 } , a _ { 2 } ) , \ldots , ( s _ { h } ^ { \hat { d } + 1 } , a _ { \hat { d } } ) \} .
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
Notice that again $( s _ { h } ^ { \hat { d } + 1 } , a )$ is not in the support of $\mu _ { h }$ for all actions $a \in \left\{ a _ { \hat { d } + 1 } , a _ { \hat { d } + 2 } , \dotsc , a _ { d } \right\}$ . It can be seen that for all $h \in [ H ]$ ,
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\mathbb { E } _ { ( s , a ) \sim \mu _ { h } } [ \phi ( s , a ) \phi ( s , a ) ^ { \top } ] = \frac { 1 } { d } \sum _ { c = 1 } ^ { d } e _ { c } e _ { c } ^ { \top } = \frac { 1 } { d } I .
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Moreover, by defining
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\pi _ { \operatorname* { d a t a } } ( s ) = \left\{ \begin{array} { l l } { \operatorname { U n i f o r m } ( A ) } & { s = s _ { 1 } } \\ { a _ { 1 } } & { s \in \{ s _ { h } ^ { c } \mid h \in \{ 2 , 3 , \ldots , H \} , c \in [ \hat { d } ] \} } \\ { a _ { 1 } } & { s \in \{ s _ { h } ^ { + } \mid h \in \{ 2 , 3 , \ldots , H \} \} } \\ { a _ { 1 } } & { s \in \{ s _ { h } ^ { - } \mid h \in \{ 2 , 3 , \ldots , H \} \} } \\ { \operatorname { U n i f o r m } ( \{ a _ { 1 } , a _ { 2 } , \ldots , a _ { \hat { d } } \} ) } & { s \in \{ s _ { h } ^ { \hat { d } + 1 } \mid h \in \{ 2 , 3 , \ldots , H \} \} } \end{array} \right. ,
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
we have $\mu _ { h } = \mu _ { h } ^ { \pi _ { \mathrm { d a t a } } }$ for all $h \in [ H ]$
|
| 462 |
+
|
| 463 |
+
The Lower Bound. Now we show that it is information-theoretically hard for any algorithm to distinguish the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ in the offline setting by taking samples from the data distributions $\{ \mu _ { h } \} _ { h = 1 } ^ { H }$ . Here we consider the above policy $\pi$ defined above which returns action $a _ { d }$ for all input states. Notice that when $r _ { 0 } = 0$ , the value of the policy would be zero. On the other hand, when $\stackrel { \cdot } { r } _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ , the value of the policy would be $r _ { 0 } \cdot \hat { d } ^ { ( \overleftarrow { H } - 2 ) / 2 } = 1 .$ . Therefore, if the algorithm approximates the value of the policy up to an approximation error of $1 / 2$ , then it must distinguish the case that $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ .
|
| 464 |
+
|
| 465 |
+
We first notice that for the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ , the data distributions $\{ \mu _ { h } \} _ { h = 1 } ^ { H }$ , the feature mapping $\phi : \mathcal { S } \times \mathcal { A } \mathbb { R } ^ { d }$ , the policy $\pi$ to be evaluated and the reward distributions $R$ are the same. Thus, in order to distinguish the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ , the only way is to query the transition operator $P$ by using sampling taken from the data distributions.
|
| 466 |
+
|
| 467 |
+
Now, for all state-action pairs $( s , a )$ in the support of the data distributions of the first $H - 2$ lev
|
| 468 |
+
elsing amely only $\mu _ { 1 } , \mu _ { 2 } , \ldots , \mu _ { H - 2 } )$ , the transition opeion distributions of ang-, and $r _ { 0 }$ $( s _ { h } ^ { \hat { d } + 1 } , a _ { \hat { d } + 1 } ) , ( s _ { h } ^ { \hat { d } + 1 } , a _ { \hat { d } + 2 } ) , \dots , ( s _ { h } ^ { \hat { d } + 1 } , a _ { d } )$ support of in the supp f of $h ~ \in ~ [ H \mathrm { ~ - ~ } 2 ]$ . Moreover, for anyso be identical no mat
|
| 469 |
+
$( s , a ) \in \{ s _ { H - 1 } ^ { + } , s _ { H - 1 } ^ { - } , s _ { H - 1 } ^ { \hat { d } + 1 } \} \times \mathcal { A }$ $\mu _ { H - 1 }$ $P ( s , a )$
|
| 470 |
+
ter $r _ { 0 } = 0$ or $r _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ . For those state-action pairs $( s , a )$ in the support of $\mu _ { H - 1 }$ with
|
| 471 |
+
$s \not \in \{ s _ { H - 1 } ^ { + } , s _ { H - 1 } ^ { - } , s _ { H - 1 } ^ { \hat { d } + 1 } \}$ , we have
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
P ( s , a ) = \left\{ \begin{array} { l l } { s _ { H } ^ { + } } & { \mathrm { w i t h } \ p r o b a b i l i t y \ ( 1 + r _ { 0 } ) / 2 } \\ { s _ { H } ^ { - } } & { \mathrm { w i t h } \ p r o b a b i l i t y \ ( 1 - r _ { 0 } ) / 2 } \end{array} \right. .
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
Again, this is because $( s _ { H - 1 } ^ { \hat { d } + 1 } , a )$ is not in the support of $\mu _ { H - 1 }$ for all $a \in \left\{ a _ { \hat { d } + 1 } , a _ { \hat { d } + 2 } , \dotsc , a _ { d } \right\}$
|
| 478 |
+
|
| 479 |
+
Therefore, in order to distinguish the case $r _ { 0 } = 0$ and $r _ { 0 } = \hat { d } ^ { - ( H - 2 ) / 2 }$ , the agent needs distinguish two transition distributions
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
p _ { 1 } = { \left\{ \begin{array} { l l } { s _ { H } ^ { + } } & { { \mathrm { w i t h ~ p r o b a b i l i t y ~ } } 1 / 2 } \\ { s _ { H } ^ { - } } & { { \mathrm { w i t h ~ p r o b a b i l i t y ~ } } 1 / 2 } \end{array} \right. }
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
and
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
p _ { 2 } = \left\{ s _ { H } ^ { + } \quad \mathrm { w i t h } \mathrm { p r o b a b i l i t y } ( 1 + \hat { d } ^ { - ( H - 2 ) / 2 } ) / 2 \right.
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
Again, by Lemma B.1, in order to distinguish $p _ { 1 }$ and $p _ { 2 }$ with probability at least 0.9, one needs $\Omega ( \hat { d } ^ { H - 2 } )$ samples. Formally, we have the following theorem.
|
| 492 |
+
|
| 493 |
+
Theorem C.1. Suppose Assumption 2 holds, and rewards are deterministic and could be nonezero only for state-action pairs in the last level. Fix an algorithm that takes as input both a policy and a feature mapping. There exists an MDP satisfying Assumption 5, such that for a fixed policy $\pi : { \mathcal { S } } A$ , the algorithm requires $\Omega ( ( d / 2 - 1 ) ^ { H / 2 } )$ samples to output the value of π up to constant additive approximation error with probability at least 0.9.
|
| 494 |
+
|
| 495 |
+
# D ANALYSIS OF ALGORITHM 1
|
| 496 |
+
|
| 497 |
+
D.1 PROOF OF LEMMA 5.1
|
| 498 |
+
|
| 499 |
+
Clearly,
|
| 500 |
+
|
| 501 |
+
For the first te
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\begin{array} { r l } & { \frac { 1 } { \sqrt { 3 } } \sum _ { k \geq 0 , k \leq 1 } \bar { \zeta } _ { k } \bigg ( \frac { 1 } { 2 } \eta _ { k } ^ { 2 } \bigg ( \mathbb { E } _ { k } \| \hat { \zeta } _ { k } \| ^ { 2 } \eta _ { k } ^ { 2 } \bigg ( \mathbb { E } _ { k } \| \hat { \zeta } _ { k } \| ^ { 2 } \eta _ { k } ^ { 2 } \bigg ) \bigg ) } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
Therefore,
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\begin{array} { l } { \displaystyle \hat { \theta } _ { 1 } - \theta _ { 1 } = ( \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } \xi _ { 1 } - \lambda \hat { \Lambda } _ { 1 } ^ { - 1 } \theta _ { 1 } ) + \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } ( \theta _ { 2 } - \hat { \theta } _ { 2 } ) } \\ { \displaystyle = ( \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } \xi _ { 1 } - \lambda \hat { \Lambda } _ { 1 } ^ { - 1 } \theta _ { 1 } ) + \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } ( \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \xi _ { 2 } - \lambda \hat { \Lambda } _ { 2 } ^ { - 1 } \theta _ { 2 } ) } \\ { \displaystyle \quad \quad + \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } ( \theta _ { 3 } - \hat { \theta } _ { 3 } ) } \\ { \displaystyle \quad = \ldots } \\ { \displaystyle \quad = \sum _ { h = 1 } ^ { H } \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \ldots ( \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } - \lambda \hat { \Lambda } _ { h } ^ { - 1 } \theta _ { h } ) . } \end{array}
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
Also note that
|
| 514 |
+
|
| 515 |
+
$$
|
| 516 |
+
\begin{array} { r } { ( Q ^ { \pi } ( s _ { 1 } , \pi ( s _ { 1 } ) ) - \hat { Q } ( s _ { 1 } , \pi ( s _ { 1 } ) ) ) ^ { 2 } = \| \theta _ { 1 } - \hat { \theta } _ { 1 } \| _ { \bar { \Lambda } _ { 1 } } ^ { 2 } . } \end{array}
|
| 517 |
+
$$
|
| 518 |
+
|
| 519 |
+
# D.2 PROOF OF THEOREM 5.2
|
| 520 |
+
|
| 521 |
+
By matrix concentration inequality (Tropp, 2015), we have the following lemma.
|
| 522 |
+
|
| 523 |
+
Lemma D.1. For each $h \in [ H ]$ , with probability $1 - \delta / ( 4 H )$ , for some universal constant $C$ , we have
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\left\| \frac { 1 } { N } \Phi _ { h } ^ { \top } \Phi _ { h } - \Lambda _ { h } \right\| _ { 2 } \leq C \sqrt { d \log ( d H / \delta ) / N } .
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
and
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
\left\| \frac { 1 } { N } \overline { { \Phi } } _ { h + 1 } \overline { { \Phi } } _ { h + 1 } - \overline { { \Lambda } } _ { h + 1 } \right\| _ { 2 } \leq C \sqrt { d \log ( d H / \delta ) / N } .
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
Therefore, since $\lambda = C H \sqrt { d \log ( d H / \delta ) N }$ , with probability $1 - \delta / ( 4 H )$ , we have
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\hat { \Lambda } _ { h } = \Phi _ { h } ^ { \top } \Phi _ { h } + \lambda I \succeq N \Lambda _ { h } .
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
Note that
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
\begin{array} { l } { \displaystyle ( { \mathcal Q } ^ { \pi } ( s _ { 1 } , \pi ( s _ { 1 } ) ) - \hat { Q } ( s _ { 1 } , \pi ( s _ { 1 } ) ) ) ^ { 2 } } \\ { \displaystyle \leq H \cdot \left( \sum _ { h = 1 } ^ { H } \left\| \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdot \cdot \cdot ( \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } - \lambda \hat { \Lambda } _ { h } ^ { - 1 } \theta _ { h } ) \right\| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } \right) } \\ { \displaystyle \leq 2 H \cdot \left( \sum _ { h = 1 } ^ { H } \left\| \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdot \cdot \cdot \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } \right\| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } + \sum _ { h = 1 } ^ { H } \left\| \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdot \cdot \cdot \cdot \lambda \hat { \Lambda } _ { h } ^ { - 1 } \theta _ { h } \right\| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } \right) } \end{array}
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
For each $h \in [ H ]$ ,
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
\begin{array} { r l } & { \quad \| \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdots \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } \| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } } \\ & { \leq \| \Phi _ { 1 } \hat { \Lambda } _ { 1 } ^ { - 1 } \overline { { \Lambda } } _ { 1 } \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \| _ { 2 } \cdot \| \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdots \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } \| _ { 2 } ^ { 2 } } \\ & { \leq \| \hat { \Lambda } _ { 1 } ^ { - 1 / 2 } \overline { { \Lambda } } _ { 1 } \hat { \Lambda } _ { 1 } ^ { - 1 / 2 } \| _ { 2 } \cdot \| \Phi _ { 1 } \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \| _ { 2 } \cdot \| \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 2 } \cdot \cdot \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } \| _ { 2 } ^ { 2 } } \\ & \leq \| \hat { \Lambda } _ { 1 } ^ { - 1 / 2 } \overline { { \Lambda } } _ { 1 } \hat { \Lambda } _ { 1 } ^ { - 1 / 2 } \| _ { 2 } \cdot \displaystyle \prod _ { h ^ { \prime } = 1 } ^ { h - 1 } \Big ( \| \Phi _ { h ^ { \prime } } \hat { \Lambda } _ { h ^ { \prime } } ^ { - 1 } \Phi _ { h ^ { \prime } } ^ { \top } \| _ { 2 } \cdot \| \hat { \Phi } _ { h ^ { \prime } + 1 } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h ^ { \prime } + 1 } ^ { \top } \overline { { \Phi } } _ { h ^ { \prime } + 1 } ) \hat { \Lambda } _ h ^ { \prime } \end{array}
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
Similarly,
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\begin{array} { r l } & { \quad \| \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \boldsymbol { \Lambda } } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdot \cdot \lambda \hat { \boldsymbol { \Lambda } } _ { h } ^ { - 1 } \theta _ { h } \| _ { \overline { { \boldsymbol { \Lambda } } } _ { 1 } } ^ { 2 } } \\ & { \leq \| \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 / 2 } \overline { { \boldsymbol { \Lambda } } } _ { 1 } \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 / 2 } \| _ { 2 } \cdot \displaystyle \prod _ { h ^ { \prime } = 1 } ^ { h - 1 } \Big ( \| \Phi _ { h ^ { \prime } } \hat { \boldsymbol { \Lambda } } _ { h ^ { \prime } } ^ { - 1 } \Phi _ { h ^ { \prime } } ^ { \top } \| _ { 2 } \cdot \| \hat { \boldsymbol { \Lambda } } _ { h ^ { \prime } + 1 } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h ^ { \prime } + 1 } ^ { \top } \overline { { \Phi } } _ { h ^ { \prime } + 1 } ) \hat { \boldsymbol { \Lambda } } _ { h + 1 } ^ { - 1 / 2 } \| _ { 2 } \Big ) \cdot \lambda ^ { 2 } \cdot \| \theta _ { h } \| _ { \hat { \boldsymbol { \Lambda } } _ { h } ^ { - 1 } } ^ { 2 } } \\ & { \leq \| \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 / 2 } \overline { { \boldsymbol { \Lambda } } } _ { 1 } \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 / 2 } \| _ { 2 } \cdot \displaystyle \prod _ { h ^ { \prime } = 1 } ^ { h - 1 } \Big ( \| \Phi _ { h ^ { \prime } } \hat { \boldsymbol { \Lambda } } _ { h ^ { \prime } } ^ { - 1 } \Phi _ { h ^ { \prime } } ^ { \top } \| _ { 2 } \cdot \| \hat { \boldsymbol { \Lambda } } _ { h ^ { \prime } + 1 } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h ^ { \prime } + 1 } ^ { \top } \overline { { \Phi } } _ { h ^ { \prime } + 1 } ) \hat { \boldsymbol { \Lambda } } _ { h ^ { \prime } + 1 } ^ { - 1 / 2 } \| _ { 2 } \cdot \lambda \cdot H ^ { 2 } d . } \end{array}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
For all $h \in [ H ]$ , we have
|
| 560 |
+
|
| 561 |
+
$$
|
| 562 |
+
\| \Phi _ { h } \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \| _ { 2 } \leq 1
|
| 563 |
+
$$
|
| 564 |
+
|
| 565 |
+
and
|
| 566 |
+
|
| 567 |
+
$$
|
| 568 |
+
\begin{array} { r } { \lVert \hat { \Lambda } _ { h } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h } ^ { \top } \overline { { \Phi } } _ { h } ) \hat { \Lambda } _ { h } ^ { - 1 / 2 } \rVert _ { 2 } \leq \lVert N \hat { \Lambda } _ { h } ^ { - 1 / 2 } \overline { { \Lambda } } _ { h } \hat { \Lambda } _ { h } ^ { - 1 / 2 } \rVert _ { 2 } + \lVert \hat { \Lambda } _ { h } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h } ^ { \top } \overline { { \Phi } } _ { h } - N \overline { { \Lambda } } _ { h } ) \hat { \Lambda } _ { h } ^ { - 1 / 2 } \rVert _ { 2 } . } \end{array}
|
| 569 |
+
$$
|
| 570 |
+
|
| 571 |
+
Conditioned on the event in Lemma D.1,
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
\hat { \Lambda } _ { h } \succeq N \Lambda _ { h } \succeq \frac { N } { C _ { h } } \overline { { \Lambda } } _ { h } ,
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
which implies $\| N \hat { \Lambda } _ { h } ^ { - 1 / 2 } \overline { { \Lambda } } _ { h } \hat { \Lambda } _ { h } ^ { - 1 / 2 } \| \le C _ { h }$ . Moreover, conditioned on the event in Lemma D.1,
|
| 578 |
+
|
| 579 |
+
$$
|
| 580 |
+
\begin{array} { r } { \| \hat { \boldsymbol { \Lambda } } _ { h } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h } ^ { \top } \overline { { \Phi } } _ { h } - N \overline { { \boldsymbol { \Lambda } } } _ { h } ) \hat { \boldsymbol { \Lambda } } _ { h } ^ { - 1 / 2 } \| _ { 2 } \leq C \sqrt { d \log ( d H / \delta ) N } / \lambda . } \end{array}
|
| 581 |
+
$$
|
| 582 |
+
|
| 583 |
+
Thus,
|
| 584 |
+
|
| 585 |
+
$$
|
| 586 |
+
\| \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 / 2 } \overline { { \boldsymbol { \Lambda } } } _ { 1 } \hat { \boldsymbol { \Lambda } } _ { 1 } ^ { - 1 / 2 } \| _ { 2 } \leq C _ { 1 } / N .
|
| 587 |
+
$$
|
| 588 |
+
|
| 589 |
+
and
|
| 590 |
+
|
| 591 |
+
$$
|
| 592 |
+
\begin{array} { r } { \| \hat { \boldsymbol \Lambda } _ { h } ^ { - 1 / 2 } ( \overline { { \Phi } } _ { h } ^ { \top } \overline { { \Phi } } _ { h } ) \hat { \boldsymbol \Lambda } _ { h } ^ { - 1 / 2 } \| _ { 2 } \leq C _ { h } + C \sqrt { d \log ( d H / \delta ) N } / \lambda . } \end{array}
|
| 593 |
+
$$
|
| 594 |
+
|
| 595 |
+
Finally, by Theorem 1.2 in (Hsu et al., 2012a), with probability $1 - \delta / ( 4 H )$ , for some constant $C ^ { \prime }$ , we have
|
| 596 |
+
|
| 597 |
+
$$
|
| 598 |
+
\begin{array} { r } { \| \xi _ { h } \| _ { \Phi _ { h } \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } } ^ { 2 } \le C ^ { \prime } H ^ { 2 } d \log ( H / \delta ) . } \end{array}
|
| 599 |
+
$$
|
| 600 |
+
|
| 601 |
+
Therefore,
|
| 602 |
+
|
| 603 |
+
$$
|
| 604 |
+
\begin{array} { r l } & { \quad \quad \left\| \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdots \hat { \Lambda } _ { h } ^ { - 1 } \Phi _ { h } ^ { \top } \xi _ { h } \right\| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } + \left\| \hat { \Lambda } _ { 1 } ^ { - 1 } \Phi _ { 1 } ^ { \top } \overline { { \Phi } } _ { 2 } \hat { \Lambda } _ { 2 } ^ { - 1 } \Phi _ { 2 } ^ { \top } \overline { { \Phi } } _ { 3 } \cdots \lambda \hat { \Lambda } _ { h } ^ { - 1 } \theta _ { h } \right\| _ { \overline { { \Lambda } } _ { 1 } } ^ { 2 } } \\ & { \leq \frac { C _ { 1 } } { N } ( C _ { 2 } + C \sqrt { d \log ( d / \delta ) N } / \lambda ) \times \cdots \times ( C _ { h } + C \sqrt { d \log ( d / \delta ) N } / \lambda ) \times ( C ^ { \prime } H ^ { 2 } d \log ( H / \delta ) + \lambda H } \\ & { \leq \frac { C _ { 1 } } { N } ( C _ { 2 } + 1 / H ) \times \cdots \times ( C _ { h } + 1 / H ) \times ( C ^ { \prime } H ^ { 2 } d \log ( H / \delta ) + \lambda H ^ { 2 } d ) } \\ & { \leq \frac { e } { N } C _ { 1 } \times C _ { 2 } \times \cdots \times C _ { h } \times ( C ^ { \prime } H ^ { 2 } d \log ( H / \delta ) + C d H ^ { 3 } \sqrt { d \log ( d H / \delta ) N } ) . } \end{array}
|
| 605 |
+
$$
|
| 606 |
+
|
| 607 |
+
Let $c > 0$ be a large enough constant. We now have
|
| 608 |
+
|
| 609 |
+
$$
|
| 610 |
+
\mathbb { E } _ { s _ { 1 } } [ ( Q _ { 1 } ^ { \pi } ( s _ { 1 } , \pi ( s _ { 1 } ) ) - \hat { Q } _ { 1 } ( s _ { 1 } , \pi ( s _ { 1 } ) ) ) ^ { 2 } ] \leq c \cdot \left( \prod _ { h = 1 } ^ { H } C _ { h } \right) \cdot d H ^ { 5 } \cdot \sqrt { \frac { d \log ( d H / \delta ) } { N } } .
|
| 611 |
+
$$
|
md/train/3EwcMzmUbNd/3EwcMzmUbNd.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On Training Implicit Models
|
| 2 |
+
|
| 3 |
+
Zhengyang Geng1,2∗ Xin-Yu Zhang2∗ Shaojie Bai4 Yisen Wang2,3 Zhouchen Lin2,3,5†
|
| 4 |
+
|
| 5 |
+
1Zhejiang Lab, China 2Key Lab. of Machine Perception, School of AI, Peking University 3Institute for Artificial Intelligence, Peking University 4Carnegie Mellon University 5Pazhou Lab, China
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
This paper focuses on training implicit models of infinite layers. Specifically, previous works employ implicit differentiation and solve the exact gradient for the backward propagation. However, is it necessary to compute such an exact but expensive gradient for training? In this work, we propose a novel gradient estimate for implicit models, named phantom gradient, that 1) forgoes the costly computation of the exact gradient; and 2) provides an update direction empirically preferable to the implicit model training. We theoretically analyze the condition under which an ascent direction of the loss landscape could be found, and provide two specific instantiations of the phantom gradient based on the damped unrolling and Neumann series. Experiments on large-scale tasks demonstrate that these lightweight phantom gradients significantly accelerate the backward passes in training implicit models by roughly $1 . 7 \times$ , and even boost the performance over approaches based on the exact gradient on ImageNet.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Conventional neural networks are typically constructed by explicitly stacking multiple linear and non-linear operators in a feed-forward manner. Recently, the implicitly-defined models [1, 2, 3, 4, 5] have attracted increasing attentions and are able to match the state-of-the-art results by explicit models on several vision [3, 6], language [2] and graph [4] tasks. These works treat the evolution of the intermediate hidden states as a certain form of dynamics, such as fixed-point equations [2, 3] or ordinary differential equations (ODEs) [1, 7], which represents infinite latent states. The forward passes of implicit models are therefore formulated as solving the underlying dynamics, by either black-box ODE solvers [1, 7] or root-finding algorithms [2, 3]. As for the backward passes, however, directly differentiating through the forward pass trajectories could induce a heavy memory overhead [8, 9]. To this end, researchers have developed memory-efficient backpropagation via implicit differentiation, such as solving a Jacobian-based linear fixed-point equation for the backward pass of deep equilibrium models (DEQs) [2], which eventually makes the backpropagation trajectories independent of the forward passes. This technique allows one to train implicit models with essentially constant memory consumption, as we only need to store the final output and the layer itself without saving any intermediate states. However, in order to estimate the exact gradient by implicit differentiation, implicit models have to rely on expensive black-box solvers for backward passes, e.g., ODE solvers or root-solving algorithms. These black-box solver usually makes the gradient computation very costly in practice, even taking weeks to train state-of-the-art implicit models on ImageNet [10] with 8 GPUs.
|
| 14 |
+
|
| 15 |
+
This work investigates fast approximate gradients for training implicit models. We found that a firstorder oracle that produces good gradient estimates is enough to efficiently and effectively train implicit models, circumventing laboriously computing the exact gradient as in prior arts [2, 3, 4, 11, 12]. We develop a framework in which a balanced trade-off is made between the precision and conditioning of the gradient estimate. Specifically, we provide the general condition under which the phantom gradient can provide an ascent direction of the loss landscape. We further propose two instantiations of phantom gradients in the context of DEQ models, which are based on the the damped fixed-point unrolling and the Neumann series, respectively. Importantly, we show that our proposed instantiations satisfy the theoretical condition, and that the stochastic gradient descent (SGD) algorithm based on the phantom gradient enjoys a sound convergence property as long as the relevant hyperparameters, e.g., the damping factor, are wisely selected. Note that our method only affects, and thus accelerates, the backward formulation of the implicit models, leaving the forward pass formulation (i.e., the root-solving process) and the inference behavior unchanged so that our method is applicable to a wide range of implicit models, forward solvers, and inference strategies. We conduct an extensive set of synthetic, ablation, and large-scale experiments to both analyze the theoretical properties of the phantom gradient and validate its speedup and performances on various tasks, such as ImageNet [10] classification and Wikitext-103 [13] language modeling.
|
| 16 |
+
|
| 17 |
+
Overall, our results suggest that: 1) the phantom gradient estimates an ascent direction; 2) it is applicable to large-scale tasks and is capable of achieving a strong performance which is comparable with or even better than that of the exact gradient; and 3) it significantly shortens the total training time needed for implicit models roughly by a factor of $1 . 4 \sim 1 . 7 \times$ , and even accelerates the backward passes by astonishingly $1 2 \times$ on ImageNet. We believe that our results provide strong evidence for effectively training implicit models with the lightweight phantom gradient.
|
| 18 |
+
|
| 19 |
+
# 2 Method
|
| 20 |
+
|
| 21 |
+
# 2.1 Inspection of Implicit Differentiation
|
| 22 |
+
|
| 23 |
+
In this work, we primarily focus on the formulation of implicit models based on root-solving, represented by the DEQ models [2]. The table of notations is arranged in Appendix A. Specifically, given an equilibrium module $\mathcal { F }$ , the output of the implicit model is characterized by the solution $h ^ { * }$ to the following fixed-point equation:
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\begin{array} { r } { \begin{array} { r } { h ^ { * } = \mathcal { F } ( h ^ { * } , z ) , } \end{array} } \end{array}
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
where $\boldsymbol { z } \in \mathbb { R } ^ { d _ { \boldsymbol { u } } + d _ { \boldsymbol { \theta } } }$ is the union of the module’s input $\pmb { u } \in \mathbb { R } ^ { d _ { u } }$ and parameters $\pmb { \theta } \in \mathbb { R } ^ { d _ { \pmb { \theta } } }$ , i.e., $z ^ { \top } =$ $[ \boldsymbol { u } ^ { \top } , \boldsymbol { \theta } ^ { \top } ]$ . Here, $\textbf { \em u }$ is usually a projection of the original data point $\boldsymbol { x } \in \mathbb { R } ^ { d _ { x } }$ , e.g., $\pmb { u } = \mathcal { M } ( \pmb { x } )$ . In this section, we assume $\mathcal { F }$ is a contraction mapping w.r.t. $^ { h }$ so that its Lipschitz constant $L _ { h } \ w . r . t . \ h$ is less than one, i.e., $L _ { h } < 1$ , a setting that has been analyzed in recent works $[ 1 4 , 1 5 ] ^ { 1 }$ .
|
| 30 |
+
|
| 31 |
+
To differentiate through the fixed point by Eq. (1), we need to calculate the gradient of $h ^ { \ast } w . r . t .$ the input $_ z$ . By Implicit Function Theorem (IFT), we have
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\frac { \partial { \pmb h } ^ { * } } { \partial z } = \left. \frac { \partial \mathcal { F } } { \partial z } \right| _ { { \pmb h } ^ { * } } \left( { \pmb I } - \left. \frac { \partial \mathcal { F } } { \partial { \pmb h } } \right| _ { { \pmb h } ^ { * } } \right) ^ { - 1 } .
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
Here, $( \partial \pmb { a } / \partial b ) _ { i j } = \partial \pmb { a } _ { j } / \partial b _ { i }$ . The equilibrium point $h ^ { * }$ of Eq. (1) is then passed to a post-processing function $\mathcal { G }$ to obtain a prediction $\hat { y } = \mathcal G ( h ^ { * } )$ . In the generic learning scenario, the training objective is the following expected loss:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \mathcal { R } ( \pmb { \theta } ) = \mathbb { E } _ { ( \pmb { x } , \pmb { y } ) \sim \mathcal { P } } \left[ \mathcal { L } ( \hat { \pmb { y } } ( \pmb { x } ; \pmb { \theta } ) , \pmb { y } ) \right] , } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\textbf { { y } }$ is the groundtruth corresponding to the training example $_ { \textbf { \em x } }$ , and $\mathcal { P }$ is the data distribution. Here, we omit the parameters of $\mathcal { G }$ , because given the output $h ^ { * }$ of the implicit module $\mathcal { F }$ , training the post-processing part $\mathcal { G }$ is the same as training explicit neural networks. The most crucial component is the gradient of the loss function $\mathcal { L } w . r . t .$ the input vector $z ^ { \top } = [ \pmb { u } ^ { \top } , \pmb { \theta } ^ { \top } ]$ , which is used to train both the implicit module $\mathcal { F }$ and the input projection module $\mathcal { M }$ . Using Eq. (2) with the condition $h = h ^ { * }$ , we have
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\frac { \partial \mathcal { L } } { \partial u } = \frac { \partial \mathcal { F } } { \partial u } \left( I - \frac { \partial \mathcal { F } } { \partial h } \right) ^ { - 1 } \frac { \partial \mathcal { L } } { \partial h } , \quad \frac { \partial \mathcal { L } } { \partial \theta } = \frac { \partial \mathcal { F } } { \partial \theta } \left( I - \frac { \partial \mathcal { F } } { \partial h } \right) ^ { - 1 } \frac { \partial \mathcal { L } } { \partial h } .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
The gradients in Eq. (4) are in the same form w.r.t. $\textbf { \em u }$ and $\pmb \theta$ . Without loss of generality, we only discuss the gradient w.r.t. $\pmb { \theta }$ in the following sections.
|
| 50 |
+
|
| 51 |
+
# 2.2 Motivation
|
| 52 |
+
|
| 53 |
+
The most intriguing part lies in the Jacobian-inverse term, i.e., $\left( I - \partial \mathcal { F } / \partial h \right) ^ { - 1 }$ . Computing the inverse term by brute force is intractable due to the $\mathcal { O } ( n ^ { 3 } )$ complexity. Previous implicit models [2] approach this by solving a linear system involving a Jacobian-vector product iteratively via a gradient solver, introducing over 30 Broyden [16] iterations in the backward pass. However, the scale of the Jacobian matrix can exceed $\mathrm { 1 0 ^ { 6 } \times 1 0 ^ { 6 } }$ in the real scenarios, leading to a prohibitive cost in computing the exact gradient. For example, training a small-scale state-of-the-art implicit model on ImageNet can consume weeks using 8 GPUs while training explicit models usually takes days, demonstrating that pursuing the exact gradient severely slows down the training process of implicit models compared with explicit models.
|
| 54 |
+
|
| 55 |
+
Secondly, because of the inversion operation, we cast doubt on the conditioning of the gradient and the stability of training process from the numerical aspect. The Jacobian-inverse can be numerically unstable when encountering the ill-conditioning issue. The conditioning problem might further undermine the training stability, as studied in the recent work [17].
|
| 56 |
+
|
| 57 |
+
Plus, the inexact gradient [9, 18, 19, 20, 21, 22] is widely applied in the previous learning protocol, like linear propagation [23] and synthetic gradient [24]. Here, the Jacobian-inverse is used to calculate the exact gradient which is not always optimal for model training. Moreover, previous research has used a moderate gradient noise as a regularization approach [25], which has been shown to play a central role in escaping poor local minima and improving generalization ability [26, 27, 28].
|
| 58 |
+
|
| 59 |
+
The concerns and observations motivate us to rethink the possibility of replacing the Jacobian-inverse term in the standard implicit differentiation with a cheaper and more stable counterpart. We believe that an exact gradient estimate is not always required, especially for a black-box layer like those in the implicit models. Hence this work designs an inexact, theoretically sound, and practically efficient gradient for training implicit models under various settings. We name the proposed gradient estimate as the phantom gradient.
|
| 60 |
+
|
| 61 |
+
Suppose the Jacobian ${ { \partial } { h } ^ { * } } / { { \partial } { \theta } }$ is replaced with a matrix $\pmb { A }$ , and the corresponding phantom gradient is defined as
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
{ \widehat { \frac { \partial { \mathcal { L } } } { \partial \theta } } } : = A \ { \frac { \partial { \mathcal { L } } } { \partial h } } .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Next, we give the general condition on $\pmb { A }$ so that the phantom gradient can be guaranteed valid for optimization (Sec. 2.3), and provide two concrete instantiations of $\pmb { A }$ based on either damped fixed-point unrolling or the Neumann series (Sec. 2.4). The proofs of all our theoretical results are presented in Appendix C.
|
| 68 |
+
|
| 69 |
+
# 2.3 General Condition on the Phantom Gradient
|
| 70 |
+
|
| 71 |
+
Previous research on theoretical properties for the inexact gradient include several aspects, such as the gradient direction [22], the unbiasedness of the estimator [29], and the convergence theory of the stochastic algorithm [19, 30]. The following theorem formulates a sufficient condition that the phantom gradient gives an ascent direction of the loss landscape.
|
| 72 |
+
|
| 73 |
+
Theorem 1. Suppose the exact gradient and the phantom gradient are given by Eq. (4) and (5), respectively. Let $\sigma _ { m a x }$ and $\sigma _ { m i n }$ be the maximal and minimal singular value of $\partial \mathcal { F } / \partial \theta$ . If
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\left\| A \left( I - \frac { \partial \mathcal { F } } { \partial h } \right) - \frac { \partial \mathcal { F } } { \partial \theta } \right\| < \frac { \sigma _ { m i n } ^ { 2 } } { \sigma _ { m a x } } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
then the phantom gradient provides an ascent direction of the function $\mathcal { L }$ , i.e.,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\left. { \widehat { \frac { \partial { \mathcal { L } } } { \partial \theta } } } , { \frac { \partial { \mathcal { L } } } { \partial \theta } } \right. > 0 .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Remark 1. Suppose only the $\left( I - \partial \mathcal { F } / \partial h \right) ^ { - 1 }$ term is replaced with a matrix $_ { D }$ , namely, $A =$ $( \partial \mathcal { F } / \partial \pmb { \theta } ) \pmb { D }$ . Then, the condition in (6) can be reduced into
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\left\| D \left( I - \frac { \partial \mathcal { F } } { \partial h } \right) - I \right\| < \frac { 1 } { \kappa ^ { 2 } } ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\kappa$ is the condition number of $\partial \mathcal { F } / \partial \theta$ . (See Appendix C.1 for the derivation.)
|
| 92 |
+
|
| 93 |
+
# 2.4 Instantiations of the Phantom Gradient
|
| 94 |
+
|
| 95 |
+
In this section, we present two practical instantiations of the phantom gradient. We also verify that the general condition in Theorem 1 can be satisfied if the hyperparameters in our instantiations are wisely selected.
|
| 96 |
+
|
| 97 |
+
Suppose we hope to differentiate through implicit dynamics, e.g., either a root-solving process or an optimization problem. In the context of hyperparameter optimization (HO), previous solutions include differentiating through the unrolled steps of the dynamics [19] or employing the Neumann series of the Jacobian-inverse term [9]. In our case, if we solve the root of Eq. (1) via the fixed-point iteration:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\pmb { h } _ { t + 1 } = \mathcal { F } ( \pmb { h } _ { t } , z ) , \quad t = 0 , 1 , \cdots , T - 1 ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
then by differentiating through the unrolled steps of Eq. (9), we have
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\frac { \partial { \pmb h } _ { T } } { \partial { \pmb \theta } } = \sum _ { t = 0 } ^ { T - 1 } \left. \frac { \partial \mathcal { F } } { \partial { \pmb \theta } } \right| _ { { \pmb h } _ { t } ~ s = t + 1 } \left. \frac { \partial \mathcal { F } } { \partial { \pmb h } } \right| _ { { \pmb h } _ { s } } .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Besides, the Neumann series of the Jacobian-inverse $\left( I - \partial \mathcal { F } / \partial h \right) ^ { - 1 }$ is
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\pmb { I } + \frac { \partial \mathcal { F } } { \partial \pmb { h } } + \left( \frac { \partial \mathcal { F } } { \partial \pmb { h } } \right) ^ { 2 } + \left( \frac { \partial \mathcal { F } } { \partial \pmb { h } } \right) ^ { 3 } + \cdots .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Notably, computing the Jacobian $\partial \pmb { h } ^ { * } / \partial \pmb { \theta }$ using the Neumann series in (11) is equivalent to differentiating through the unrolled steps of Eq. (9) at the exact equilibrium point $h ^ { * }$ and taking the limit of infinite steps [9].
|
| 116 |
+
|
| 117 |
+
Without altering the root of Eq. (1), we consider a damped variant of the fixed-point iteration:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r } { h _ { t + 1 } = \mathscr { F } _ { \lambda } ( h _ { t } , z ) = \lambda \mathscr { F } ( h _ { t } , z ) + ( 1 - \lambda ) h _ { t } , \quad t = 0 , 1 , \cdots , T - 1 . } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Differentiating through the unrolled steps of Eq. (12), Eq. (10) is adapted as
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\frac { \partial h _ { T } } { \partial \pmb { \theta } } = \lambda \sum _ { t = 0 } ^ { T - 1 } \frac { \partial \mathcal { F } } { \partial \pmb { \theta } } | _ { h _ { t } } \prod _ { s = t + 1 } ^ { T - 1 } ( \lambda \frac { \partial \mathcal { F } } { \partial h } | _ { h _ { s } } + ( 1 - \lambda ) \pmb { I } ) .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
The Neumann series of $\left( I - \partial \mathcal { F } / \partial h \right) ^ { - 1 }$ is correspondingly adapted as
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\lambda \left( I + B + B ^ { 2 } + B ^ { 3 } + \cdots \right) , \quad \mathrm { w h e r e ~ } B = \lambda \frac { \partial \mathcal { F } } { \partial h } + ( 1 - \lambda ) I .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
The next theorem shows that under mild conditions, the Jacobian from the damped unrolling in Eq. (13) converges to the exact Jacobian and the Neumann series in (14) converges to the Jacobianinverse $( I - \partial \mathcal { F } / \partial h ) ^ { - 1 }$ as well.
|
| 136 |
+
|
| 137 |
+
Theorem 2. Suppose the Jacobian $\partial \mathcal { F } / \partial h$ is a contraction mapping. Then,
|
| 138 |
+
|
| 139 |
+
(i) the Neumann series in (14) converges to the Jacobian-inverse $\left( I - \partial \mathcal { F } / \partial h \right) ^ { - 1 }$ ; and
|
| 140 |
+
|
| 141 |
+
(ii) if the function $\mathcal { F }$ is continuously differentiable w.r.t. both $^ { h }$ and $\pmb \theta$ , the sequence in Eq. (13) converges to the exact Jacobian $\partial \pmb { h } ^ { * } / \partial \pmb { \theta }$ as $T \to \infty$ , i.e.,
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\operatorname* { l i m } _ { T \infty } \frac { \partial h _ { T } } { \partial \pmb { \theta } } = \frac { \partial \mathcal { F } } { \partial \pmb { \theta } } | _ { h ^ { \ast } } ( \pmb { I } - \frac { \partial \mathcal { F } } { \partial h } | _ { h ^ { \ast } } ) ^ { - 1 } .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
However, as discussed in Sec. 2.2, it is unnecessary to compute the exact gradient with infinite terms. In the following context, we introduce two instantiations of the phantom gradient based on the finite-term truncation of Eq. (13) or (14).
|
| 148 |
+
|
| 149 |
+
Unrolling-based Phantom Gradient (UPG). In the unrolling form, the matrix $\pmb { A }$ is defined as
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
A _ { k , \lambda } ^ { \mathrm { u n r } } = \lambda \sum _ { t = 0 } ^ { k - 1 } \frac { \partial \mathcal { F } } { \partial \pmb { \theta } } | _ { h _ { t } } \prod _ { s = t + 1 } ^ { k - 1 } ( \lambda \frac { \partial \mathcal { F } } { \partial h } | _ { h _ { s } } + ( 1 - \lambda ) \pmb { I } ) .
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
Neumann-series-based Phantom Gradient (NPG). In the Neumann form, the matrix $\pmb { A }$ is defined as
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\pmb { A } _ { k , \lambda } ^ { \mathrm { n e u } } = \lambda \left. \frac { \partial \mathcal { F } } { \partial \pmb { \theta } } \right| _ { h ^ { * } } \left( I + \pmb { B } + \pmb { B } ^ { 2 } + \cdots + \pmb { B } ^ { k - 1 } \right) , \quad \mathrm { w h e r e } \ \pmb { B } = \lambda \left. \frac { \partial \mathcal { F } } { \partial h } \right| _ { h ^ { * } } + ( 1 - \lambda ) I .
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
Note that both the initial point of the fixed-point iteration (i.e., $h _ { 0 }$ in Eq. (16)) and the point at which the Neumann series is evaluated (i.e., $h ^ { * }$ in (17)) are the solution of the root-finding solver. (See Appendix B for implementation of the phantom gradient.)
|
| 162 |
+
|
| 163 |
+
According to Theorem 2, the matrix $\pmb { A }$ defined by either Eq. (16) or (17) converges to the exact Jacobian ${ \bar { \partial } } h ^ { * } / \partial \theta$ as $k \to \infty$ for any $\lambda \in ( 0 , 1 ]$ . Therefore, by Theorem 2, the condition in (6) can be satisfied if a sufficiently large step $k$ is selected, since
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\left\| A \left( I - { \frac { \partial { \mathcal { F } } } { \partial h } } \right) - { \frac { \partial { \mathcal { F } } } { \partial \theta } } \right\| \leq \left( 1 + L _ { h } \right) \left\| A - { \frac { \partial { \mathcal { F } } } { \partial \theta } } \left( I - { \frac { \partial { \mathcal { F } } } { \partial h } } \right) ^ { - 1 } \right\| .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Next, we characterize the impact of the two hyperparameters, i.e., $k$ and $\lambda$ , on the precision and conditioning of $\pmb { A }$ . Take the NPG (Eq. (17)) as an example.
|
| 170 |
+
|
| 171 |
+
(i) On the precision of the phantom gradient,
|
| 172 |
+
|
| 173 |
+
• a large $k$ makes the gradient estimate more accurate, as higher-order terms of the Neumann series are included, while
|
| 174 |
+
• a small $\lambda$ slows down the convergence of the Neumann series because the norm $\| B \|$ increases as $\lambda$ decreases.
|
| 175 |
+
|
| 176 |
+
(ii) On the conditioning of the phantom gradient,
|
| 177 |
+
|
| 178 |
+
• a large $k$ impairs the conditioning of $\pmb { A }$ since the condition number of $B ^ { k }$ grows exponentially as $k$ increases, while
|
| 179 |
+
• a small $\lambda$ helps maintain a small condition number of $\pmb { A }$ because the singular values of $\partial \mathcal { F } / \partial h$ are “smoothed” by the identity matrix.
|
| 180 |
+
|
| 181 |
+
In a word, a large $k$ is preferable for a more accurate $\pmb { A }$ , while a small $\lambda$ contributes to the wellconditioning of $\pmb { A }$ . Practically, these hyperparameters should be selected in consideration of a balanced trade-off between the precision and conditioning of $\pmb { A }$ . See Sec. 3 for experimental results.
|
| 182 |
+
|
| 183 |
+
# 2.5 Convergence Theory
|
| 184 |
+
|
| 185 |
+
In this section, we provide the convergence guarantee of the SGD algorithm using the phantom gradient. We prove that under mild conditions, if the approximation error of the phantom gradient is sufficiently small, the SGD algorithm converges to an $\epsilon$ -approximate stationary point in the expectation sense. We will discuss the feasibility of our assumptions in Appendix C.3.
|
| 186 |
+
|
| 187 |
+
Theorem 3. Suppose the loss function $\mathcal { R }$ in Eq. (3) is $\ell$ -smooth, lower-bounded, and has bounded gradient almost surely in the training process. Besides, assume the gradient in Eq. (4) is an unbiased estimator of $\nabla \mathcal { R } ( \theta )$ with a bounded covariance. If the phantom gradient in Eq. (5) is an $\epsilon$ -approximation to the gradient in Eq. (4), i.e.,
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\left\| { \widehat { \frac { \partial { \mathcal { L } } } { \partial \theta } } } - { \frac { \partial { \mathcal { L } } } { \partial \theta } } \right\| \leq \epsilon , \quad a l m o s t s u r e l y ,
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
then using Eq. (5) as a stochastic first-order oracle with a step size of $\eta _ { n } = \mathcal { O } ( 1 / \sqrt { n } )$ to update $\pmb \theta$ with gradient descent, it follows after $N$ iterations that
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\begin{array} { r } { \mathbb { E } \left[ \frac { \sum _ { n = 1 } ^ { N } \eta _ { n } \left\| \nabla \mathcal { R } \left( \pmb { \theta } _ { n } \right) \right\| ^ { 2 } } { \sum _ { n = 1 } ^ { N } \eta _ { n } } \right] \le \mathcal { O } \left( \epsilon + \frac { \log N } { \sqrt { N } } \right) . } \end{array}
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
Remark 2. Consider the condition in (19):
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
\left\| \widehat { \frac { \partial \mathcal { L } } { \partial \theta } } - \frac { \partial \mathcal { L } } { \partial \theta } \right\| \leq \left\| A - \frac { \partial \mathcal { F } } { \partial \theta } \left( I - \frac { \partial \mathcal { F } } { \partial h } \right) ^ { - 1 } \right\| \left\| \frac { \partial \mathcal { L } } { \partial h } \right\| .
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
Suppose the gradient $\partial \mathcal { L } / \partial h$ is almost surely bounded. By Theorem 2, the condition in (19) can be guaranteed as long as a sufficiently large $k$ is selected.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 1: Cosine similarity between the phantom gradient and the exact gradient in the synthetic setting.
|
| 209 |
+
|
| 210 |
+
# 3 Experiments
|
| 211 |
+
|
| 212 |
+
In this section, we aim to answer the following questions via empirical results: (1) How precise is the phantom gradient? (2) What is the difference between the unrolling-based and the Neumannseries-based phantom gradients? (3) How is the phantom gradient influenced by the hyperparameters $k$ and $\lambda ?$ (4) How about the computational cost of the phantom gradient compared with implicit differentiation? (5) Can the phantom gradient work at large-scale settings for various tasks?
|
| 213 |
+
|
| 214 |
+
We have provided some theoretical analysis and intuitions to (1), (2), and (3) in Sec. 2.4. Now we answer (1) and (2) and demonstrate the performance curves under different hyperparameters $k$ and $\lambda$ on CIFAR-10 [31]. Besides, we also study other factors that have potential influences on the training process of the state-of-the-art implicit models [2, 3] like pretraining. For (4) and (5), we conduct experiments on large-scale datasets to highlight the ultra-fast speed and competitive performances, including image classification on ImageNet [10] and language modeling on Wikitext-103 [13].
|
| 215 |
+
|
| 216 |
+
We start by introducing two experiment settings. We adopt a single-layer neural network with spectral normalization [32] as the function $\mathcal { F }$ and fixed-point iterations as the equilibrium solver, which is the synthetic setting. Moreover, on the CIFAR-10 dataset, we use the MDEQ-Tiny model [3] (170K parameters) as the backbone model, denoted as the ablation setting. Additional implementation details and experimental results are presented in Appendix $\mathsf { D } ^ { 2 }$ .
|
| 217 |
+
|
| 218 |
+
Precision of the Phantom Gradient. The precision of the phantom gradient is measured by its angle against the exact gradient, indicated by the cosine similarity between the two. We discuss its precision in both the synthetic setting and the ablation setting. The former is under the static and randomly generated weights, while the latter provides characterization of the training dynamics.
|
| 219 |
+
|
| 220 |
+
In the synthetic setting, the function $\mathcal { F }$ is restricted to be a contraction mapping. Specifically, we directly set the Lipschitz constant of $\mathcal { F }$ as $L _ { h } = 0 . 9$ , and use 100 fixed-point iterations to solve the root $h ^ { * }$ of Eq. (1) until the relative error satisfies $\| h - \mathcal { F } ( h , z ) \| / \| h \| ^ { - } 1 0 ^ { - 5 }$ . Here, the exact gradient is estimated by backpropagation through the fixed-point iterations, and cross-validated by implicit differentiation solved with 20 iterations of the Broyden’s method [16]. In our experiment, the cosine similarity between these two gradient estimates consistently succeeds 0.9999, indicating the gradient estimate is quite accurate when the relative error of forward solver is minor. The cosine similarity between phantom gradients and exact gradients is shown in Fig. 1. It shows that the cosine similarity tends to increase as $k$ grows and that a small $\lambda$ tends to slow down the convergence of the phantom gradient, allowing it to explore in a wider range regarding the angle against the exact gradient.
|
| 221 |
+
|
| 222 |
+
In the ablation setting, the precision of the phantom gradient during the training process is shown in Fig. 2. The model is trained by implicit differentiation under the official schedule3. It shows that the phantom gradient still provides an ascent direction in the real training process, as indicated by the considerable cosine similarity against the exact gradient. Interestingly, the cosine similarity slightly decays as the training progresses, which implies a possibility to construct an adaptive gradient solver for implicit models.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 2: Cosine similarity between the phantom gradient and the exact gradient in the real scenario. The horizontal axis corresponds to the cosine similarity, and the vertical axis to the training step.
|
| 226 |
+
|
| 227 |
+
To Pretrain, or not to Pretrain? To better understand the components of the implicit models’ training schedule, we first illustrate a detailed ablation study of the baseline model in the ablation setting. The average accuracy with standard deviation is reported in Tab. 1.
|
| 228 |
+
|
| 229 |
+
The MDEQ model employs a pretraining stage in which the model $\mathcal { F }$ is unrolled as a recurrent network. We study the impact of the pretraining stage, the Dropout [33] operation, and the optimizer separately. It can be seen that the unrolled pretraining stabilizes the training of the MDEQ model. Removing the pretraining stage leads to a severe performance drop and apparent training instability among different trials because the solver cannot obtain an accurate fixed point $h ^ { * }$ when the model is not adequately trained. This ablation study also suggests that the MDEQ model is a strong baseline for our method to compare with.
|
| 230 |
+
|
| 231 |
+
Table 1: Ablation settings on CIFAR-10.
|
| 232 |
+
|
| 233 |
+
<table><tr><td>Method</td><td>Acc. (%)</td></tr><tr><td>Implicit Differentiation</td><td>85.0± 0.2</td></tr><tr><td>w/o Pretraining</td><td>82.3± 1.3</td></tr><tr><td>w/o Dropout Adam →SGD</td><td>83.7± 0.1</td></tr><tr><td> SGD w/o Pretraining</td><td>84.5 ± 0.3</td></tr><tr><td>UPG (A5,0.5, W/o Dropout)</td><td>82.9 ± 1.5</td></tr><tr><td>NPG (A5,0.5, w/o Dropout)</td><td>85.8±0.5</td></tr><tr><td>UPG (A9.0.5, w/ Dropout)</td><td>85.6± 0.5 86.1±0.5</td></tr></table>
|
| 234 |
+
|
| 235 |
+
However, pretraining is not always indispensable for training implicit models. It introduces an extra hyperparameter, i.e., how many steps should be involved in the pretraining stage. Next, we discuss how the UPG could circumvent this issue.
|
| 236 |
+
|
| 237 |
+
Trade-offs between Unrolling and Neumann. For an exact fixed point $h ^ { * }$ , i.e., $\begin{array} { r } { \begin{array} { r } { h ^ { * } = \mathcal { F } ( h ^ { * } , z ) } \end{array} } \end{array}$ , there is no difference between UPG and NPG. However, when the numerical error exists in solving $h ^ { * }$ , i.e., $\| h ^ { * } - \mathcal { F } ( h ^ { * } , z ) \| > 0$ , these two instatiations of the phantom gradient can behave differently.
|
| 238 |
+
|
| 239 |
+
We note that a particular benefit of the UPG is its ability to automatically switch between the pretraining and training stages for implicit models. When the model is not sufficiently trained and the solver converges poorly (see [3]), the UPG defines a forward computation graph that is essentially equivalent to a shallow weight-tied network to refine the coarse equilibrium states. In this stage, the phantom gradient serves as a backpropagation through time (BPTT) algorithm and hence behaves as in the pretraining stage. Then, as training progresses, the solver becomes more stable and converges to the fixed point $h ^ { * }$ better. This makes the UPG behave more like the NPG. Therefore, the unrolled pretraining is gradually transited into the regular training phase based on implicit differentiation, and the hyperparameter tuning of pretraining steps can be waived. We argue that such an ability to adaptively switch training stages is benign to the implicit models’ training protocol, which is also supported by the performance gain in Tab. 1.
|
| 240 |
+
|
| 241 |
+
Table 2: Complexity comparison. Mem means the memory cost, and $K$ and $k$ denote the solver’s steps and the unrolling/Neumann steps, respectively. Here, $K \gg k \approx 1$ .
|
| 242 |
+
|
| 243 |
+
<table><tr><td>Method</td><td>Time</td><td>Mem</td><td>Peak Mem</td></tr><tr><td>Implicit</td><td>O(K)</td><td>0(1)</td><td>O(k)</td></tr><tr><td>UPG</td><td>O(k)</td><td>O(k)</td><td>O(k)</td></tr><tr><td>NPG</td><td>(k)</td><td>0(1)</td><td>0(1)</td></tr></table>
|
| 244 |
+
|
| 245 |
+
Although the UPG requires higher memory overhead than implicit differentiation or the NPG, it does not surpass the peak memory usage in the entire training protocol by implicit differentiation due to the pretraining stage. In the ablation setting, the MDEQ model employs a 10-layer unrolling for pretraining, which actually consumes double memory compared with a 5-step unrolling scheme, e.g., $A _ { 5 , 0 . 5 }$ in Tab. 1. In Tab. 2, we also demonstrate the time and memory complexity for implicit differentiation and the two forms of phantom gradient.
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 3: Ablation studies on (a) the hyperparameters $\lambda$ and $k$ , and (b) two forms of phantom gradient.
|
| 249 |
+
|
| 250 |
+
In addition, leaving the context of approximate and exact gradient aside, we also develop insights into understanding the subtle differences between UPG and NPG in terms of the state-dependent and state-free gradient. Actually, the UPG is state-dependent, which means it corresponds to the “exact” gradient of a computational sub-graph. Both the NPG and the gradient solved by implicit differentiation, however, do not exactly match the gradient of any forward computation graph unless the numerical error is entirely eliminated in both the forward and the backward passes for implicit differentiation or the one-step gradient [34, 21, 30, 22] is used for the NPG, i.e., $k =$ 1. Interestingly, we observe that models trained on the state-dependent gradient demonstrate an additional training stability regarding the Jacobian spectral radius, compared with those trained on the state-free counterpart. We empirically note that it can be seen as certain form of implicit Jacobian regularization for implicit models as a supplement to the explicit counterpart [17], indicated by the stable estimated Jacobian spectral radius during training, i.e., $\rho ( \partial \mathcal { F } _ { \lambda } / \partial h ) \approx 1$ .
|
| 251 |
+
|
| 252 |
+
The experimental results also cohere with our insight. The performance curves in Fig. 3 demonstrate the influence of $\lambda$ and $k$ and further validate that the UPG is more robust to a wide range of steps $k$ than the NPG. In fact, when the Jacobian spectral radius $\rho ( \partial \mathcal { F } / \partial h )$ increases freely without proper regularization, the exploding high-order terms in the NPG could exert a negative impact on the overall direction of the phantom gradient, leading to performance degradation when a large $k$ is selected (see Fig. 3(b)). We also observe a surging of the estimated Jacobian spectral radius as well as the gradient explosion issue in the NPG experiments. On the contrary, the UPG can circumvent these problems thanks to its implicit Jacobian regularization.
|
| 253 |
+
|
| 254 |
+
Table 3: Experiments using DEQ [2] and MDEQ [3] on vision and language tasks. Metrics stand for accuracy $( \% ) \uparrow$ for image classification on CIFAR-10 and ImageNet, and perplexity↓ for language modeling on Wikitext-103. JR stands for Jacobian Regularization [17]. $\dagger$ indicates additional steps in the forward equilibrium solver.
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Datasets</td><td>Model</td><td>Method</td><td>Params</td><td>Metrics</td><td>Speed</td></tr><tr><td>CIFAR-10</td><td>MDEQ</td><td>Implicit</td><td>10M</td><td>93.8 ± 0.17</td><td>1.0×</td></tr><tr><td>CIFAR-10</td><td>MDEQ</td><td>UPG A5,0.5</td><td>10M</td><td>95.0 ± 0.16</td><td>1.4×</td></tr><tr><td>ImageNet</td><td>MDEQ</td><td>Implicit</td><td>18M</td><td>75.3</td><td>1.0×</td></tr><tr><td>ImageNet</td><td>MDEQ</td><td>UPG A5.0.6</td><td>18M</td><td>75.7</td><td>1.7×</td></tr><tr><td>Wikitext-103</td><td>DEQ (PostLN)</td><td>Implicit</td><td>98M</td><td>24.0</td><td>1.0×</td></tr><tr><td>Wikitext-103</td><td>DEQ( (PostLN)</td><td>UPG A5,0.8</td><td>98M</td><td>25.7</td><td>1.7×</td></tr><tr><td>Wikitext-103</td><td>DEQ (PreLN)</td><td>JR + Implicit</td><td>98M</td><td>24.5</td><td>1.7×</td></tr><tr><td>Wikitext-103</td><td>DEQ (PreLN)</td><td>JR + UPG A5,0.8</td><td>98M</td><td>24.4</td><td>2.2×</td></tr><tr><td>Wikitext-103</td><td>DEQ (PreLN)</td><td>JR + UPG A5,0.8</td><td>98M</td><td>24.0t</td><td>1.7×</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Phantom Gradient at Scale. We conduct large-scale experiments to verify the advantages of the phantom gradient on vision, graph, and language benchmarks. We adopt the UPG in the large-scale experiments. The results are illustrated in Tab. 3 and Tab. 4. Our method matches or surpasses the implicit differentiation training protocol on the state-of-the-art implicit models with a visible reduction on the training time. When only considering the backward pass, the acceleration for MDEQ can be remarkably $1 2 \times$ on ImageNet classification.
|
| 259 |
+
|
| 260 |
+
Table 4: Experiments using IGNN [4] on graph tasks. Metrics stand for accuracy $( \% ) \uparrow$ for graph classification on COX2 and PROTEINS, Micro- $\mathrm { F l } ( \% ) \uparrow$ for node classification on PPI.
|
| 261 |
+
|
| 262 |
+
<table><tr><td>Datasets</td><td>Model</td><td>Method</td><td>Params</td><td>Metrics (%)</td></tr><tr><td>COX2</td><td>IGNN</td><td>Implicit</td><td>38K</td><td>84.1 ± 2.9</td></tr><tr><td>COX2</td><td>IGNN</td><td>UPG A5,0.5</td><td>38K</td><td>83.9 ± 3.0</td></tr><tr><td>COX2</td><td>IGNN</td><td>UPG A5,0.8</td><td>38K</td><td>83.9 ± 2.7</td></tr><tr><td>COX2</td><td>IGNN</td><td>UPG A5,1.0</td><td>38K</td><td>83.0 ± 2.9</td></tr><tr><td>PROTEINS</td><td>IGNN</td><td>Implicit</td><td>34K</td><td>78.6 ± 4.1</td></tr><tr><td>PROTEINS</td><td>IGNN</td><td>UPG A5,0.5</td><td>34K</td><td>78.4 ± 4.2</td></tr><tr><td>PROTEINS</td><td>IGNN</td><td>UPG A5,0.8</td><td>34K</td><td>78.6 ± 4.2</td></tr><tr><td>PROTEINS</td><td>IGNN</td><td>UPG A5,1.0</td><td>34K</td><td>78.8± 4.2</td></tr><tr><td>PPI</td><td>IGNN</td><td>Implicit</td><td>4.7M</td><td>97.6</td></tr><tr><td>PPI</td><td>IGNN</td><td>UPG A5,0.5</td><td>4.7M</td><td>98.2</td></tr><tr><td>PPI</td><td>IGNN</td><td>UPG A5,0.8</td><td>4.7M</td><td>97.4</td></tr><tr><td>PPI</td><td>IGNN</td><td>UPG A5,1.0</td><td>4.7M</td><td>96.2</td></tr></table>
|
| 263 |
+
|
| 264 |
+
# 4 Related Work
|
| 265 |
+
|
| 266 |
+
Implicit Models. Implicit models generalize the recursive forward/backward rules of neural networks and characterize their internal mechanism by some pre-specified dynamics. Based on the dynamics, the implicit mechanisms can be broadly categorized into three classes: ODE-based [1, 7], root-solving-based [2, 3, 4, 5, 11], and optimization-based [35, 36, 37] implicit models.
|
| 267 |
+
|
| 268 |
+
The ODE-based implicit models [1, 7] treat the iterative update rules of residual networks as the Euler discretization of an ODE, which could be solved by any black-box ODE solver. The gradient of the differential equation is calculated using the adjoint method [38], in which the adjoint state is obtained by solving another ODE. The root-solving-based implicit models [2, 5, 3, 4, 6, 11, 22] characterize layers of neural networks by solving fixed-point equations. The equations are solved by either the black-box root-finding solver [2, 3] or the fixed-point iteration [4, 22]. The optimization-based implicit models [35, 36, 37, 39, 34, 21, 40, 41] leverage the optimization programs as layers of neural networks. Previous works have studied differentiable layers of quadratic programming [35], submodular optimization [36], maximum satisfiability (MAXSAT) problems [37], and structured decomposition [21]. As for the backward passes, implicit differentiation is applied to the problemdefining equations of the root-solving-based models [2, 3] or the KKT conditions of the optimizationbased models [35]. As such, the gradient can be obtained from solving the backward linear system.
|
| 269 |
+
|
| 270 |
+
In this work, we focus on the root-solving-based implicit models. Theoretical works towards root-solving-based implicit models include the well-posedness [5, 4], monotone operators [11], global convergence [42, 41], and Lipschitz analysis [15]. We look into the theoretical aspect of the gradient-based algorithm in training implicit models and the efficient practice guidance. With these considerations, we show that implicit models of the same architecture could enjoy faster training speed and strong generalization in practical applications by using the phantom gradient.
|
| 271 |
+
|
| 272 |
+
Non-End-to-End Optimization in Deep Learning. Non-end-to-end optimization aims to replace the standard gradient-based training of deep architectures with modular or weakly modular training without the entire forward and backward passes. Currently, there are mainly three research directions in this field, namely, the auxiliary variable methods [43, 44, 45, 46, 47, 48, 49], target propagation [50, 51, 52], and synthetic gradient [24, 53, 54]. The auxiliary variable methods [43, 44, 45, 46, 47, 48, 49] formulate the optimization of neural networks as constrained optimization problems, in which the layer-wise activations are considered as trainable auxiliary variables. Then, the equality constraints are relaxed as penalty terms added to the objectives so that the parameters and auxiliary variables can be divided into blocks and thus optimized in parallel. The target propagation method [50, 51, 52] trains each module by having its activations regress to the pre-assigned targets, which are propagated backwards from the downstream modules. Specifically, the auto-encoder architecture is used to reconstruct targets at each layer. Finally, the synthetic gradient method [24, 53, 54] estimates the local gradient of neural networks using auxiliary models, and employ the synthetic gradient in place of the exact gradient to perform parameter update. In this way, the forward and backward passes are decoupled and can be executed in an asynchronous manner.
|
| 273 |
+
|
| 274 |
+
Our work is in line with the non-end-to-end optimization research since we also aims to decouple the forward and backward passes of neural networks. However, we show that finding a reasonable “target” or a precise gradient estimate is not always necessary in training deep architectures. Our paper paves a path that an inexact but well-conditioned gradient estimate can contribute to both fast training and competitive generalization of implicit models.
|
| 275 |
+
|
| 276 |
+
Differentiation through Implicit Dynamics. Differentiation through certain implicit dynamics is an important aspect in a wide range of research fields, including bilevel optimization [19, 9], metalearning [18, 55, 30], and sensitivity analysis [56]. Since the gradient usually cannot be computed analytically, researchers have to implicitly differentiate the dynamics at the converged point. The formula of the gradient typically contains a term of Jacobian-inverse (or Hessian-inverse), which is computationally prohibitive for large-scale models. (See Eq. (2) in our case.) Herein, several techniques have been developed to approximate the matrix inverse in the previous literature.
|
| 277 |
+
|
| 278 |
+
An intuitive solution is to differentiate through the unrolled steps of a numerical solver of the dynamics [57, 58, 8]. In particular, if a single step is unrolled, it reduces to the well-known one-step gradient [59, 18, 60, 34, 30, 21, 22], in which the inverse of Jacobian/Hessian is simply approximated by an identity matrix. On the contrary, unrolling a small number of steps may induce a bias [9], while the memory and computational cost grows linearly as the number of unrolled steps increases. Towards this issue, Shaban et al. [19] propose to truncate the long-term dependencies and differentiate through only the last $L$ steps. In fact, if the dynamics have converged to a stationary point, the finite-term truncation in Shaban et al. [19] is exactly the Neumann approximation of the Jacobian-inverse with the first $L$ terms. Based on this, Lorraine et al. [9] directly use the truncated Neumann series as an approximation of the Jacobian-inverse. Besides the unrolling-based methods, optimization-based approaches [61, 55] have been studied in this field as well. Since the Jacobian-inverse-vector product can be viewed as solution of a linear system, algorithms like the conjugate gradient method can be used to solve it.
|
| 279 |
+
|
| 280 |
+
# 5 Limitation and Future Work
|
| 281 |
+
|
| 282 |
+
The main limitation of this work lies in the hyperparameter tuning of the phantom gradient, especially for the damping factor $\lambda$ , which directly controls the gradient’s precision and conditioning, the implicit Jacobian regularization for UPG, the stability for NPG, and the final generalization behaviors. However, it has not been a hindrance to the application of phantom gradients in training implicit models as one can tune the hyperparameter according to the validation loss in the early training stage.
|
| 283 |
+
|
| 284 |
+
Regarding future works, we would like to highlight the following aspects: (1) eliminating the bias of the current phantom gradient, (2) constructing an adaptive gradient solver for implicit models, (3) analyzing the damping factor to provide practical guidance, (4) investigating the implicit Jacobian regularization, and (5) understanding how different noises in the gradients can impact the training of implicit models under different loss landscapes.
|
| 285 |
+
|
| 286 |
+
# 6 Conclusion
|
| 287 |
+
|
| 288 |
+
In this work, we explore the possibility of training implicit models via the efficient approximate phantom gradient. We systematically analyze the general condition of a gradient estimate so that the implicit model can be guaranteed to converge to an approximate stationary point of the loss function. Specifically, we give a sufficient condition under which a first-order oracle could always find an ascent direction of the loss landscape in the training process. Moreover, we introduce two instantiations of the proposed phantom gradient, based on either the damped fixed-point unrolling or the Neumann series. The proposed method shows a $1 . 4 \sim 1 . 7 \times$ acceleration with comparable or better performances on large-scale benchmarks. Overall, this paper provides a practical perspective on training implicit models with theoretical guarantees.
|
| 289 |
+
|
| 290 |
+
# Acknowledgments
|
| 291 |
+
|
| 292 |
+
Zhouchen Lin was supported by the NSF China (No.s 61625301 and 61731018), NSFC Tianyuan Fund for Mathematics (No. 12026606) and Project 2020BD006 supported by PKU-Baidu Fund. Yisen Wang was partially supported by the National Natural Science Foundation of China under Grant 62006153, and Project 2020BD006 supported by PKU-Baidu Fund. Shaojie Bai was sponsored by a grant from the Bosch Center for Artificial Intelligence.
|
| 293 |
+
|
| 294 |
+
# References
|
| 295 |
+
|
| 296 |
+
[1] Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural Ordinary Differential Equations. In Neural Information Processing Systems (NeurIPS), 2018. 1, 9
|
| 297 |
+
[2] Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. Deep Equilibrium Models. In Neural Information Processing Systems (NeurIPS), 2019. 1, 2, 3, 6, 8, 9
|
| 298 |
+
[3] Shaojie Bai, Vladlen Koltun, and J. Zico Kolter. Multiscale Deep Equilibrium Models. In Neural Information Processing Systems (NeurIPS), pages 5238–5250, 2020. 1, 2, 6, 7, 8, 9
|
| 299 |
+
[4] Fangda Gu, Heng Chang, Wenwu Zhu, Somayeh Sojoudi, and Laurent El Ghaoui. Implicit Graph Neural Networks. In Neural Information Processing Systems (NeurIPS), pages 11984– 11995, 2020. 1, 2, 9
|
| 300 |
+
[5] Laurent El Ghaoui, Fangda Gu, Bertrand Travacca, Armin Askari, and Alicia Tsai. Implicit Deep Learning. SIAM Journal on Mathematics of Data Science, 3(3):930–958, 2021. 1, 2, 9
|
| 301 |
+
[6] Tiancai Wang, Xiangyu Zhang, and Jian Sun. Implicit Feature Pyramid Network for Object Detection. arXiv preprint arXiv:2012.13563, 2020. 1, 9
|
| 302 |
+
[7] Emilien Dupont, Arnaud Doucet, and Yee Whye Teh. Augmented Neural ODEs. In Neural Information Processing Systems (NeurIPS), 2019. 1, 9
|
| 303 |
+
[8] Luca Franceschi, Michele Donini, Paolo Frasconi, and Massimiliano Pontil. Forward and Reverse Gradient-Based Hyperparameter Optimization. In International Conference on Machine Learning (ICML), pages 1165–1173, 2017. 1, 10
|
| 304 |
+
[9] Jonathan Lorraine, Paul Vicol, and David Duvenaud. Optimizing Millions of Hyperparameters by Implicit Differentiation. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 1540–1552, 2020. 1, 3, 4, 10
|
| 305 |
+
[10] 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. International Journal on Computer Vision (IJCV), 115(3):211–252, 2015. 1, 2, 6
|
| 306 |
+
[11] Ezra Winston and J. Zico Kolter. Monotone operator equilibrium networks. In Neural Information Processing Systems (NeurIPS), pages 10718–10728, 2020. 2, 9
|
| 307 |
+
[12] Cheng Lu, Jianfei Chen, Chongxuan Li, Qiuhao Wang, and Jun Zhu. Implicit Normalizing Flows. In International Conference on Learning Representations (ICLR), 2021. 2
|
| 308 |
+
[13] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer Sentinel Mixture Models. In International Conference on Learning Representations (ICLR), 2017. 2, 6
|
| 309 |
+
[14] Chirag Pabbaraju, Ezra Winston, and J. Zico Kolter. Estimating Lipschitz constants of monotone deep equilibrium models. In International Conference on Learning Representations (ICLR), 2021. 2
|
| 310 |
+
[15] Max Revay, Ruigang Wang, and Ian R Manchester. Lipschitz Bounded Equilibrium Networks. arXiv:2010.01732, 2020. 2, 9
|
| 311 |
+
[16] Charles G Broyden. A Class of Methods for Solving Nonlinear Simultaneous Equations. Mathematics of computation, 19(92):577–593, 1965. 3, 6
|
| 312 |
+
[17] Shaojie Bai, Vladlen Koltun, and J. Zico Kolter. Stabilizing Equilibrium Models by Jacobian Regularization. In International Conference on Machine Learning (ICML), 2021. 3, 8
|
| 313 |
+
[18] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. In International Conference on Machine Learning (ICML), pages 1126–1135, 2017. 3, 10
|
| 314 |
+
[19] Amirreza Shaban, Ching-An Cheng, Nathan Hatch, and Byron Boots. Truncated Backpropagation for Bilevel Optimization. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 1723–1732, 2019. 3, 4, 10
|
| 315 |
+
[20] Jens Behrmann, David Kristjanson Duvenaud, and Jörn-Henrik Jacobsen. Invertible Residual Networks. In International Conference on Machine Learning (ICML), 2019. 3
|
| 316 |
+
[21] Zhengyang Geng, Meng-Hao Guo, Hongxu Chen, Xia Li, Ke Wei, and Zhouchen Lin. Is Attention Better Than Matrix Decomposition? In International Conference on Learning Representations (ICLR), 2021. 3, 8, 9, 10
|
| 317 |
+
[22] Samy Wu Fung, Howard Heaton, Qiuwei Li, Daniel McKenzie, Stanley J. Osher, and Wotao Yin. Fixed Point Networks: Implicit Depth Models with Jacobian-Free Backprop. arXiv preprint arXiv:2103.12803, 2021. 3, 8, 9, 10
|
| 318 |
+
[23] Mehrdad Yazdani. Linear Backprop in non-linear networks. In Neural Information Processing Systems Workshops, 2018. 3
|
| 319 |
+
[24] Max Jaderberg, Wojciech Marian Czarnecki, Simon Osindero, Oriol Vinyals, Alex Graves, David Silver, and Koray Kavukcuoglu. Decoupled Neural Interfaces using Synthetic Gradients. In International Conference on Machine Learning (ICML), pages 1627–1635, 2017. 3, 9, 10
|
| 320 |
+
[25] Xavier Gastaldi. Shake-Shake Regularization. arXiv preprint arXiv:1705.07485, 2017. 3
|
| 321 |
+
[26] Guozhong An. The Effects of Adding Noise During Backpropagation Training on a Generalization Performance. Neural Computation, 8(3):643–674, 1996. 3
|
| 322 |
+
[27] Zhanxing Zhu, Jingfeng Wu, Bing Yu, Lei Wu, and Jinwen Ma. The Anisotropic Noise in Stochastic Gradient Descent: Its Behavior of Escaping from Sharp Minima and Regularization Effects. In International Conference on Machine Learning (ICML), pages 7654–7663, 2019. 3
|
| 323 |
+
[28] Jingfeng Wu, Wenqing Hu, Haoyi Xiong, Jun Huan, Vladimir Braverman, and Zhanxing Zhu. On the Noisy Gradient Descent that Generalizes as SGD. In International Conference on Machine Learning (ICML), pages 10367–10376, 2020. 3
|
| 324 |
+
[29] Ricky TQ Chen, Jens Behrmann, David K Duvenaud, and Joern-Henrik Jacobsen. Residual Flows for Invertible Generative Modeling. Neural Information Processing Systems (NeurIPS), pages 9916–9926, 2019. 3
|
| 325 |
+
[30] Xin-Yu Zhang, Taihong Xiao, Haolin Jia, Ming-Ming Cheng, and Ming-Hsuan Yang. SemiSupervised Learning with Meta-Gradient. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 73–81, 2021. 3, 8, 10
|
| 326 |
+
[31] Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images. Technical report, Citeseer, 2009. 6
|
| 327 |
+
[32] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral Normalization for Generative Adversarial Networks. In International Conference on Learning Representations (ICLR), 2018. 6
|
| 328 |
+
[33] 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. 7
|
| 329 |
+
[34] Bryan Wilder, Eric Ewing, Bistra Dilkina, and Milind Tambe. End to end learning and optimization on graphs. In Neural Information Processing Systems (NeurIPS), pages 4672– 4683, 2019. 8, 9, 10
|
| 330 |
+
[35] Brandon Amos and J. Zico Kolter. OptNet: Differentiable Optimization as a Layer in Neural Networks. In International Conference on Machine Learning (ICML), pages 136–145, 2017. 9
|
| 331 |
+
[36] Josip Djolonga and Andreas Krause. Differentiable Learning of Submodular Models. Neural Information Processing Systems (NeurIPS), pages 1013–1023, 2017. 9
|
| 332 |
+
[37] Po-Wei Wang, Priya Donti, Bryan Wilder, and Zico Kolter. SATNet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver. In International Conference on Machine Learning (ICML), pages 6545–6554, 2019. 9
|
| 333 |
+
[38] VG Boltyanskiy, Revaz V Gamkrelidze, YEF Mishchenko, and LS Pontryagin. Mathematical theory of optimal processes. 1962. 9
|
| 334 |
+
[39] Marin Vlastelica, Anselm Paulus, Vít Musil, Georg Martius, and Michal Rolínek. Differentiation of Blackbox Combinatorial Solvers. In International Conference on Learning Representations (ICLR), 2020. 9
|
| 335 |
+
[40] Stephen Gould, Richard Hartley, and Dylan Campbell. Deep Declarative Networks. IEEE Transactions on Pattern Recognition and Machine Intelligence (PAMI), 2021. 9
|
| 336 |
+
[41] Xingyu Xie, Qiuhao Wang, Zenan Ling, Xia Li, Yisen Wang, Guangcan Liu, and Zhouchen Lin. Optimization Induced Equilibrium Networks. arXiv preprint arXiv:2105.13228, 2021. 9
|
| 337 |
+
[42] Kenji Kawaguchi. On the Theory of Implicit Deep Learning: Global Convergence with Implicit Layers. In International Conference on Learning Representations (ICLR), 2020. 9
|
| 338 |
+
[43] Miguel Carreira-Perpinan and Weiran Wang. Distributed Optimization of Deeply Nested Systems. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 10–19, 2014. 9
|
| 339 |
+
[44] Gavin Taylor, Ryan Burmeister, Zheng Xu, Bharat Singh, Ankit Patel, and Tom Goldstein. Training Neural Networks Without Gradients: A Scalable ADMM Approach. In International Conference on Machine Learning (ICML), pages 2722–2731, 2016. 9
|
| 340 |
+
[45] Ziming Zhang, Yuting Chen, and Venkatesh Saligrama. Efficient Training of Very Deep Neural Networks for Supervised Hashing. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1487–1495, 2016. 9
|
| 341 |
+
[46] Ziming Zhang and Matthew Brand. Convergent Block Coordinate Descent for Training Tikhonov Regularized Deep Neural Networks. In Neural Information Processing Systems (NeurIPS), 2017. 9
|
| 342 |
+
[47] Jinshan Zeng, Shikang Ouyang, Tim Tsz-Kit Lau, Shaobo Lin, and Yuan Yao. Global Convergence in Deep Learning with Variable Splitting via the Kurdyka-Łojasiewicz Property. arXiv preprint arXiv:1803.00225, 2018. 9
|
| 343 |
+
[48] Jia Li, Cong Fang, and Zhouchen Lin. Lifted Proximal Operator Machines. In Association for the Advancement of Artificial Intelligence (AAAI), pages 4181–4188, 2019. 9
|
| 344 |
+
[49] Fangda Gu, Armin Askari, and Laurent El Ghaoui. Fenchel Lifted Networks: A Lagrange Relaxation of Neural Network Training. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 3362–3371, 2020. 9
|
| 345 |
+
[50] Yoshua Bengio. How Auto-Encoders Could Provide Credit Assignment in Deep Networks via Target Propagation. arXiv preprint arXiv:1407.7906, 2014. 9
|
| 346 |
+
[51] Dong-Hyun Lee, Saizheng Zhang, Asja Fischer, and Yoshua Bengio. Difference Target Propagation. In International Conference on Learning Representations (ICLR), pages 498–515, 2015. 9
|
| 347 |
+
[52] Alexander Meulemans, Francesco Carzaniga, Johan Suykens, João Sacramento, and Benjamin F. Grewe. A Theoretical Framework for Target Propagation. In Neural Information Processing Systems (NeurIPS), pages 20024–20036, 2020. 9
|
| 348 |
+
[53] Wojciech Marian Czarnecki, Grzegorz Swirszcz, Max Jaderberg, Simon Osindero, Oriol Vinyals, ´ and Koray Kavukcuoglu. Understanding Synthetic Gradients and Decoupled Neural Interfaces. In International Conference on Machine Learning (ICML), pages 904–912, 2017. 9, 10
|
| 349 |
+
[54] Benjamin James Lansdell, Prashanth Ravi Prakash, and Konrad Paul Kording. Learning to solve the credit assignment problem. In International Conference on Learning Representations (ICLR), 2020. 9, 10
|
| 350 |
+
[55] Aravind Rajeswaran, Chelsea Finn, Sham M Kakade, and Sergey Levine. Meta-Learning with Implicit Gradients. In Neural Information Processing Systems (NeurIPS), 2019. 10
|
| 351 |
+
[56] J Frédéric Bonnans and Alexander Shapiro. Perturbation analysis of optimization problems. Springer Science & Business Media, 2013. 10
|
| 352 |
+
[57] Justin Domke. Generic Methods for Optimization-Based Modeling. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 318–326, 2012. 10
|
| 353 |
+
[58] Dougal Maclaurin, David Duvenaud, and Ryan Adams. Gradient-based Hyperparameter Optimization through Reversible Learning. In International Conference on Machine Learning (ICML), pages 2113–2122, 2015. 10
|
| 354 |
+
[59] Jelena Luketina, Mathias Berglund, Klaus Greff, and Tapani Raiko. Scalable Gradient-Based Tuning of Continuous Regularization Hyperparameters. In International Conference on Machine Learning (ICML), pages 2952–2960, 2016. 10
|
| 355 |
+
[60] Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable Architecture Search. International Conference on Learning Representations (ICLR), 2018. 10
|
| 356 |
+
[61] Fabian Pedregosa. Hyperparameter Optimization with Approximate Gradient. In International Conference on Machine Learning (ICML), pages 737–746, 2016. 10
|
md/train/5vShUEyjmm/5vShUEyjmm.md
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DUAL CONTRADISTINCTIVE GENERATIVE AUTOENCODER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a new generative autoencoder model with dual contradistinctive losses to improve generative autoencoder that performs simultaneous inference (reconstruction) and synthesis (generation). We name our model dual contradistinctive generative autoencoder (DC-VAE) that integrates an instance-level discriminative loss (maintaining the instance-level fidelity for the reconstruction/synthesis) with a set-level adversarial loss (encouraging the set-level fidelity for the reconstruction/synthesis), both being contradistinctive. There also exists a mathematical connection between the instance-based classification and instance-level conditional distribution. DC-VAE achieves competitive results in three tasks, including image synthesis, image reconstruction, and representation learning. DC-VAE is applicable to various tasks in computer vision and machine learning.
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
(a) DC-VAE (ours) Reconstruction results. Left: $1 2 8 \times 1 2 8$ . Right: $5 1 2 \times 5 1 2$ .
|
| 11 |
+
|
| 12 |
+

|
| 13 |
+
(b) DC-VAE (ours) Sampling results. Left: $1 2 8 \times 1 2 8$ . Right: $5 1 2 \times 5 1 2$
|
| 14 |
+
Figure 1: DC-VAE Reconstruction (top) and Sampling (bottom) on LSUN Bedroom $\mathrm { Y u }$ et al. (2015) at resolution $1 2 8 \times 1 2 8$ (left) and CelebA-HQ (Karras et al., 2018) at resolution $5 1 2 \times 5 1 2$ (right).
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Tremendous progress has been made in deep learning for the development of various learning frameworks (Krizhevsky et al., 2012; He et al., 2016; Goodfellow et al., 2014; Vaswani et al., 2017). Autoencoder (AE) (LeCun, 1987; Hinton & Zemel, 1994) aims to compactly represent and faithfully reproduce the original input signal by concatenating an encoder and a decoder in an end-to-end learning framework. The goal of AE is to make the encoded representation semantically efficient and sufficient to reproduce the input signal by its decoder. Autoencoder’s generative companion, variational autoencoder (VAE) (Kingma & Welling, 2014), additionally learns a variational model for the latent variables to capture the underlying sample distribution. For the encoder and decoder models separately, tremendous progress has been made in image classification with deep convolutional neural network (CNN) (Krizhevsky et al., 2012; He et al., 2016) (an encoder) and in image generation with generative adversarial network (GAN) (Goodfellow et al., 2014) (a decoder).
|
| 19 |
+
|
| 20 |
+
The key objective for a generative autoencoder is to maintain two types of fidelities: (1) an instancelevel fidelity to make the reconstruction/synthesis faithful to the individual input data sample, and (2) a set-level fidelity to make the reconstruction/synthesis of the decoder faithful to the entire input data set. The VAE/GAN algorithm (Larsen et al., 2016) combines a reconstruction loss with an adversarial loss. However, the result of VAE/GAN is sub-optimal, as shown in Table 1.
|
| 21 |
+
|
| 22 |
+
The pixel-wise reconstruction loss in the standard VAE (Kingma & Welling, 2014) typically results in blurry images with degenerated semantics. A possible solution to resolving the above conflict lies in two aspects: (1) turning the measure in the pixel space into induced feature space that is more semantically meaningful; (2) changing the L2 distance (per-pixel) into a learned instance-level distance function for the entire image (akin to generative adversarial networks which learn set-level distance functions). Taking these two steps allows us to design an instance-level classification loss that is aligned with the adversarial loss in the GAN model enforcing set-level fidelity. Motivated by the above observations, we develop a new generative autoencoder model with dual contradistinctive losses by adopting a discriminative loss performing instance-level classification (enforcing the instance-level fidelity), which is rooted in metric learning (Kulis et al., 2012) and contrastive learning (Hadsell et al., 2006; Wu et al., 2018; van den Oord et al., 2018). Combined with the adversarial losses for the set-level fidelity, both terms are formulated in the induced feature space performing contradistinction: (1) the instance-level contrastive loss considers each input instance (image) itself as a class, and (2) the set-level adversarial loss treats the entire input set as a positive class. We name our method dual contradistinctive generative autoencoder (DC-VAE) and make the following contributions.
|
| 23 |
+
|
| 24 |
+
• We develop a new algorithm, dual contradistinctive generative autoencoder (DC-VAE), by combining instance-level and set-level classification losses in the VAE framework, and systematically show the significance of these two loss terms in DC-VAE.
|
| 25 |
+
• The effectiveness of DC-VAE is illustrated in three tasks altogether, including image synthesis, image reconstruction, and representation learning.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Related work can be roughly divided into three categories: (1) generative autoencoder, (2) deep generative model, and (3) contrastive learning.
|
| 30 |
+
|
| 31 |
+
Variational autoencoder (VAE) (Kingma & Welling, 2014) points to an exciting direction of generative models by developing an Evidence Lower BOund (ELBO) objective (Higgins et al., 2017; Ding et al., 2020). However, the VAE reconstruction/synthesis is known to be blurry. To improve the image quality, a sequence of VAE based models have been developed (Larsen et al., 2016; Dumoulin et al., 2017; Huang et al., 2018; Brock et al., 2018; Zhang et al., 2019). VAE/GAN (Larsen et al., 2016) adopts an adversarial loss to improve the quality of the image, but its output for both reconstruction and synthesis (new samples) is still unsatisfactory. IntroVAE Huang et al. (2018) adds a loop from the output back to the input and is able to attain image quality that is on par with some modern GANs in some aspects. However, its full illustration for both reconstruction and synthesis is unclear. PGA (Zhang et al., 2019) adds a constraint to the latent variables.
|
| 32 |
+
|
| 33 |
+
Pioneering works of (Tu, 2007; Gutmann & Hyvärinen, 2012) alleviate the difficulty of learning densities by approximating likelihoods via classification (real (positive) samples vs. fake (pseudonegative or adversarial) samples). Generative adversarial network (GAN) (Goodfellow et al., 2014) builds on neural networks and amortized sampling (a decoder network that maps a noise into an image). The subsequent development after GAN (Radford et al., 2016; Arjovsky et al., 2017; Gulrajani et al., 2017; Karras et al., 2018; Gong et al., 2019; Dumoulin et al., 2017; Donahue et al., 2017) has led to a great leap forward in building decoder-based generative models. It has been widely observed that the adversarial loss in GANs contributes significantly to the improved quality of image synthesis. Energy-based generative models (Salakhutdinov & Hinton, 2009; Xie et al., 2016; Jin et al., 2017; Lee et al., 2018) — which aim to directly model data density — are making a steady improvement for a simultaneously generative and discriminative single model.
|
| 34 |
+
|
| 35 |
+
From another angle, contrastive learning (Hadsell et al., 2006; Wu et al., 2018; He et al., 2020; Chen et al., 2020) has lately shown its particular advantage in unsupervised training of CNN features. It overcomes the limitation in unsupervised learning where class label is missing by turning each image instance into one class. Thus, the softmax function in the standard discriminative classification training can be applied. Contrastive learning can be connected to metric learning (Bromley et al., 1993; Chopra et al., 2005; Chechik et al., 2010).
|
| 36 |
+
|
| 37 |
+
In this paper, we aim to improve VAE (Kingma & Welling, 2014) by introducing a contrastive loss (van den Oord et al., 2018) to address instance-level fidelity between the input and the reconstruction in the induced feature space. Unlike in self-supervised representation learning methods (van den Oord et al., 2018; He et al., 2020; Chen et al., 2020), where self-supervision requires generating a transformed input (via data augmentation operations), the reconstruction naturally fits into the contrastive term that encourages the matching between the reconstruction and the input image instance, while pushing the reconstruction away from the rest of the images in the entire training set. Thus, the instance-level and set-level contradistinctive terms collaborate with each to encourage the high fidelity of the reconstruction and synthesis. In Figure 3, we systematically show the significance of with and without the instance-level and the set-level contradistinctive terms. In addition, we explore multi-scale contrastive learning via two schemes in Section 4.1: 1) deep supervision for contrastive learning in different convolution layers, and 2) patch-based contrastive learning for fine-grained data fidelity. In the experiments, we show competitive results for the proposed dual contradistinctive generative autoencoder (DC-VAE) in a number of benchmarks for three tasks, including image synthesis, image reconstruction, and representation learning.
|
| 38 |
+
|
| 39 |
+
# 3 PRELIMINARIES: VAE AND VAE/GAN
|
| 40 |
+
|
| 41 |
+
Variational autoencoder (VAE) Assume a given training set $S = \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { n }$ where each $\mathbf { x } _ { i } \in \mathbb { R } ^ { m }$ We suppose that each $\mathbf { x } _ { i }$ is sampled from a generative process $p ( \mathbf { x } | \mathbf { z } )$ . In the literature, vector $\mathbf { z }$ refers to latent variables. In practice, latent variables $\mathbf { z }$ and the generative process $p ( \mathbf { x } | \mathbf { z } )$ are unknown. The objectives of a variational autoencoder (VAE) (Kingma & Welling, 2014) is to simultaneously train an inference network $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ and a generator network $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } )$ . In VAE (Kingma $\&$ Welling, 2014), the inference network is a neural network that outputs parameters for Gaussian distribution $q _ { \phi } ( \mathbf { z } | \mathbf { x } ) = \mathcal { N } ( \mu _ { \phi } ( \mathbf { x } ) , \Sigma _ { \phi } ( \mathbf { x } ) )$ . The generator is a deterministic neural network $f _ { \pmb \theta } ( \mathbf z )$ parameterized by $\pmb { \theta }$ . Generative density $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } )$ is assumed to be subject to a Gaussian distribution: $p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } ) = \dot { \mathcal { N } } ( f _ { \pmb { \theta } } ( \mathbf { z } ) , \sigma ^ { 2 } I )$ . These models can be trained by minimizing the negative of evidence lower bound (ELBO) in Eq. (1) below.
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { E L B O } } ( \pmb { \theta } , \phi ; \mathbf { x } ) = - \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \mathrm { l o g } ( p _ { \theta } ( \mathbf { x } | \mathbf { z } ) ) ] + K L [ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p ( \mathbf { z } ) ] } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $p ( \mathbf { z } )$ is the prior, which is assumed to be $\mathcal { N } ( 0 , I )$ . The first term $- \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \log ( p _ { \pmb { \theta } } ( \mathbf { x } | \mathbf { z } ) ) ]$ reduces to standard pixel-wise reconstruction loss $\mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ | | \mathbf { x } - f _ { \theta } ( \mathbf { z } ) | | _ { 2 } ^ { 2 } ]$ (up to a constant) due to the Gaussian assumption. The second term is the regularization term, which prevents the conditional $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ from deviating from the Gaussian prior $\mathcal { N } ( 0 , I )$ . The inference network and generator network are jointly optimized over training samples by:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\operatorname* { m i n } _ { \theta , \phi } \operatorname* { \mathbb { E } } _ { \mathbf { x } \sim p _ { \mathrm { d a t a } } ( \mathbf { x } ) } \mathcal { L } _ { \mathrm { E L B O } } ( \theta , \phi ; \mathbf { x } ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $p _ { \mathrm { d a t a } }$ is the distribution induced by the training set $S$ .
|
| 54 |
+
|
| 55 |
+
VAE has an elegant formulation. However, it relies on a pixel-wise reconstruction loss, which is known not ideal to be reflective of perceptual realism (Johnson et al., 2016; Isola et al., 2017), often resulting in blurry images. From another viewpoint, it can be thought of as using a kernel density estimator (with an isotropic Gaussian kernel) in the pixel space. Although allowing efficient training and inference, such a non-parametric approach is overly simplistic for modeling the semantics and perception of natural images.
|
| 56 |
+
|
| 57 |
+
VAE/GAN Generative adversarial networks (GANs) (Goodfellow et al., 2014) and its variants (Radford et al., 2016), on the other hand, are shown to be producing highly realistic images. The success was largely attributed to learning a fidelity function (often referred to as a discriminator) that measures how realistic the generated images are. This can be achieved by learning to contrast (classify) the set of training images with the set of generated images (Tu, 2007; Gutmann & Hyvärinen, 2012; Goodfellow et al., 2014).
|
| 58 |
+
|
| 59 |
+
VAE/GAN (Larsen et al., 2016) augments the ELBO objective (Eq. (2)) with the GAN objective. Specifically, the objective of VAE/GAN consists of two terms, namely the modified ELBO (Eq. (3))
|
| 60 |
+
|
| 61 |
+
and the GAN objective. To make the notations later consistent, we now define the set of given training images as ${ \cal { S } } = \{ { \bf { x } } _ { i } \} _ { i = 1 } ^ { n }$ in which a total number of $n$ unlabeled training images are present. For each input image $\mathbf { x } _ { i }$ , the modified ELBO computes the reconstruction loss in the feature space of the discriminator instead of the pixel space:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathcal { L } _ { \mathrm { E L B O } } ( \theta , \phi , D ; \mathbf { x } _ { i } ) = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) } [ | | F _ { D } ( \mathbf { x } _ { i } ) - F _ { D } ( f _ { \theta } ( \mathbf { z } ) ) | | _ { 2 } ^ { 2 } ] + K L [ q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) | | p ( \mathbf { z } ) ]
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $F _ { D } ( \cdot )$ denotes the feature embedding from the discriminator $D$ . Feature reconstruction loss (also referred to as perceptual loss), similar to that in style transfer (Johnson et al., 2016). The modified GAN objective considers both reconstructed images (latent code from $q _ { \phi } ( \mathbf { z } | \mathbf { x } ) )$ and sampled images (latent code from the prior $p ( \mathbf { z } ) .$ ) as its fake samples:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { G A N } } ( \pmb { \theta } , \phi , D ; \mathbf { x } _ { i } ) = \log D ( \mathbf { x } _ { i } ) + \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) } \log ( 1 - D ( f _ { \theta } ( \mathbf { z } ) ) + \mathbb { E } _ { \mathbf { z } \sim p ( \mathbf { z } ) } \log ( 1 - D ( f _ { \theta } ( \mathbf { z } ) ) . } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The VAE/GAN objective becomes:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\operatorname* { m i n } _ { \theta , \phi } \operatorname* { m a x } _ { D } \sum _ { i = 1 } ^ { n } \left[ \mathcal { L } _ { \mathrm { E L B O } } ( \theta , \phi , D ; \mathbf { x } _ { i } ) + \mathcal { L } _ { \mathrm { G A N } } ( \theta , \phi , D ; \mathbf { x } _ { i } ) \right] .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
# 4 DUAL CONTRADISTINCTIVE GENERATIVE AUTOENCODER (DC-VAE)
|
| 80 |
+
|
| 81 |
+
Here we want to address a question: Is the degeneration of the synthesized images by VAE always the case once the decoder is joined with an encoder? Can the problem be remedied by using a more informative loss?
|
| 82 |
+
|
| 83 |
+
Although improving the image qualities of VAE by integrating a set-level contrastive loss (GAN objective of Eq. (4)), VAE/GAN still does not accurately model instance-level fidelity. Inspired by the literature on instance-level classification (Malisiewicz et al., 2011), approximating likelihood by classification (Tu, 2007), and contrastive learning (Hadsell et al., 2006; Wu et al., 2018; He et al., 2020), we propose to model instance-level fidelity by contrastive loss (commonly referred to as InfoNCE loss) (van den Oord et al., 2018). In DC-VAE, we perform the following minimization and loosely call each term a loss.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { L } _ { \mathrm { i n s t a n c e } } ( \pmb { \theta } , \phi , D ; i , \{ \mathbf { x } _ { j } \} _ { j = 1 } ^ { n } ) \triangleq - \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) } \left[ \log \frac { e ^ { h ( \mathbf { x } _ { i } , f _ { \pmb { \theta } } ( \mathbf { z } ) ) } } { \sum _ { j = 1 } ^ { n } e ^ { h ( \mathbf { x } _ { j } , f _ { \pmb { \theta } } ( \mathbf { z } ) ) } } \right] ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $i$ is an index for a training sample (instance), $\{ { \bf x } _ { j } \} _ { j = 1 } ^ { n }$ is the union of positive samples and negative samples, $h ( \mathbf x , \mathbf y )$ is the critic function that measures compatibility between $\mathbf { x }$ and $\mathbf { y }$ . Following the popular choice from (He et al., 2020), $h ( \mathbf x , \mathbf y )$ is the cosine similarity between the embeddings of $\mathbf { x }$ and y: $\begin{array} { r } { h ( \mathbf { x } , \mathbf { y } ) = \frac { F _ { D } ( \mathbf { x } ) ^ { \top } F _ { D } ( \mathbf { y } ) } { | | F _ { D } ( \mathbf { x } ) | | _ { 2 } | | F _ { D } ( \mathbf { y } ) | | _ { 2 } } } \end{array}$ . Note that unlike in contrastive self-supervised learning methods (van den Oord et al., 2018; He et al., 2020; Chen et al., 2020) where two views (independent augmentations) of an instance constitutes a positive pair, an input instance $\mathbf { x } _ { i }$ and its reconstruction $f _ { \pmb \theta } ( \mathbf z )$ comprises a positive pair in DC-VAE. Likewise, the reconstruction $f _ { \pmb \theta } ( \mathbf z )$ and any instance that is not $\mathbf { x } _ { i }$ can be a negative pair.
|
| 90 |
+
|
| 91 |
+
To bridge the gap between the instance-level contrastive loss (Eq. (6)) and log-likelihood in ELBO term (Eq. (1)), we show the following observation.
|
| 92 |
+
|
| 93 |
+
Theorem 1 (From (Ma & Collins, 2018; Poole et al., 2019)) The following objective is minimized, i.e., the optimal critic $h$ is achieved, when $h ( f _ { \pmb \theta } ( \mathbf { z } ) , \mathbf { x } ) = \log { p ( \mathbf { x } | \mathbf { z } ) } + \overset { \cdot } { c } ( \mathbf { x } )$ where $c ( \mathbf { x } )$ is any function that does not depend on $\mathbf { z }$ .
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
I _ { N C E } \triangleq \mathbb { E } _ { { \mathbf { x } } _ { 1 } , \cdots { \mathbf { x } } _ { K } } \mathbb { E } _ { i } \big [ \mathcal { L } _ { i n s t a n c e } ( \pmb { \theta } , \phi , D ; i , \{ { \mathbf { x } } _ { j } \} _ { j = 1 } ^ { n } ) \big ] .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
From Theorem 1, we see that the contrastive loss of Eq. (6) implicitly estimates the log-likelihood $\log p _ { \theta } ( \mathbf { x } | \mathbf { z } )$ required for the evidence lower bound (ELBO). Hence, we modify the ELBO objective of Eq. (1) as follows and name it as implicit ELBO (IELBO):
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathcal { L } _ { \mathrm { I E L B O } } ( \pmb { \theta } , \phi , D ; \mathbf { x } _ { i } ) = \mathcal { L } _ { \mathrm { i n s t a n c e } } ( \pmb { \theta } , \phi , D ; i , \{ \mathbf { x } _ { j } \} _ { j = 1 } ^ { n } ) + K L [ q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) | | p ( \mathbf { z } ) ] .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 2: Model architecture for the proposed DC-VAE algorithm.
|
| 107 |
+
|
| 108 |
+
Finally, the combined objective for the proposed DC-VAE algorithm becomes:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\operatorname* { m i n } _ { \theta , \phi } \operatorname* { m a x } _ { D } \sum _ { i = 1 } ^ { n } \left[ \mathcal { L } _ { \mathrm { I E L B O } } ( \theta , \phi , D ; \mathbf { x } _ { i } ) + \mathcal { L } _ { \mathrm { G A N } } ( \theta , \phi , D ; \mathbf { x } _ { i } ) \right] .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
The definition of $\mathcal { L } _ { \mathrm { G A N } }$ follows Eq. (4). Note here we also consider the term in Eq. (4) as contrasdistinctive since it tries to minimize the difference/discriminative classification between the input (“real”) image set and the reconstructed/generated (“fake”) image set. Below we highlight the significance of the two contradistinctive terms. Figure 2 shows the model architecture.
|
| 115 |
+
|
| 116 |
+
• Instance-level fidelity. The first item in Eq. (8) is an instance-level fidelity term encouraging the reconstruction to be as close as possible to the input image while being different from all the rest of the images. A key advantage of the contrastive loss in Eq. (8) over the standard reconstruction loss in Eq. (3) is its relaxed and background instances aware formulation. In general, the reconstruction in Eq. (3) wants a perfect match between the reconstruction and the input, whereas the contrastive loss in Eq. (8) requests for being the most similar one among the training samples. This way, the contrastive loss becomes more cooperative with less conflict to the GAN loss, compared with the reconstruction loss. The introduction of the contrastive loss results in a significant improvement over VAE and VAE/GAN in which only matching the reconstruction, and the input instance is enforced.
|
| 117 |
+
|
| 118 |
+
• Set-level fidelity. The second item in Eq. (9) is a set-level fidelity term encouraging the entire set of synthesized images to be non distinguishable from the input image set. Having this term (Eq. (4)) is still important since the instance contrastive loss alone (Eq. (9)) will also lead to a degenerated situation: the input image and its reconstruction can be projected to the same point in the new feature space, but without a guarantee that the reconstruction itself lies on the valid “real” image manifold.
|
| 119 |
+
|
| 120 |
+
As shown in Figure 3 and Table 1 for the comparison with and without the individual terms in Eq. (9). We observe evident effectiveness of the proposed DC-VAE combining both the instance-level fidelity term (Eq. (6)) and the set-level fidelity term (Eq. (4)), compared with VAE (using pixel-wise reconstruction loss without the GAN objective), VAE-GAN (using feature reconstruction loss and the GAN objective), and VAE contrastive (using contrastive loss but without the GAN objective).
|
| 121 |
+
|
| 122 |
+
In the experiments, we show that both terms required to achieve faithful reconstruction (captured by InfoNCE loss) with perceptual realism (captured by the GAN loss).
|
| 123 |
+
|
| 124 |
+
# 4.1 MULTI SCALE CONTRASTIVE LEARNING
|
| 125 |
+
|
| 126 |
+
Inspired by (Lee et al., 2015), we utilize information from feature maps at different scales. In addition to contrasting on the last layer of $D$ in Equation 9, we add contrastive objective on $f _ { l } ( \mathbf { z } )$ where $f _ { l }$ is some function on top of an intermediate layer $l$ of D. We do it in two different ways.
|
| 127 |
+
|
| 128 |
+
1. Deep supervision: We use $1 \times 1$ convolution to reduce the dimension channel-wise, and use a linear layer to obtain $f _ { l }$ .
|
| 129 |
+
2. Local patch: We use a random location across channel at layer $l$ (size: $1 \times 1 \times \mathrm { d }$ , where d is the channel depth).
|
| 130 |
+
|
| 131 |
+
The intuition for the second is that in a convolutional neural network, one location at a feature map corresponds to a receptive area (patch) in the original image. Thus, by contrasting locations across channels in the same feature maps, we are encouraging the original image and the reconstruction to image have locally similar content, while encouraging them to have locally dissimilar content in other images. We use deep supervision for initial training, and add local patch after certain iterations.
|
| 132 |
+
|
| 133 |
+
# 5 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 3: Qualitative results of CIFAR-10 (Krizhevsky et al., 2009) images (resolution $3 2 \times 3 2$ ) for experiments in Table 1 (Krizhevsky et al., 2009).
|
| 137 |
+
|
| 138 |
+
# 5.1 IMPLEMENTATION
|
| 139 |
+
|
| 140 |
+
Datasets To validate our method, we train our method on several different datasets — CIFAR-10 (Krizhevsky et al., 2009), STL-10 (Coates et al., 2011), CelebA (Liu et al., 2015), CelebA-HQ (Karras et al., 2018), and LSUN bedroom (Yu et al., 2015). See the appendix for more detailed descriptions.
|
| 141 |
+
|
| 142 |
+
Network architecture For $3 2 \times 3 2$ resolution, we design the encoder and decoder subnetworks of our model in a similar way to the discriminator and generator found through neural architecture search in AutoGAN (Gong et al., 2019). For the higher resolution experiments $1 2 8 \times 1 2 8$ and $5 1 2 \times 5 1 2$ resolution), we use Progressive GAN (Karras et al., 2018) as the backbone. Network architecture diagram is available in the appendix.
|
| 143 |
+
|
| 144 |
+
Training details The number of negative samples for contrastive learning is 8096 for all datasets. The latent dimension for the VAE decoder is 128 for CIFAR-10, STL-10, and 512 for CelebA, CelebA-HQ and LSUN Bedroom. Learning rate is 0.0002 with Adam parameters of $( \beta _ { 1 } , \beta _ { 2 } ) = ( 0 . 0 , 0 . 9 )$ and a batch size of 128 for CIFAR-10 and STL-10. For CelebA, CelebA-HQ, LSUN Bedroom datasets, we use the optimizer parameters given in (Karras et al., 2018). The contrastive embedding dimension used is 16 for each of the experiments.
|
| 145 |
+
|
| 146 |
+
# 5.2 ABLATION STUDY
|
| 147 |
+
|
| 148 |
+
Table 1: Ablation studies on CIFAR-10 for the proposed DC-VAE algorithm. We follow (Johnson et al., 2016) and measure perceptual distance in an relu4_3 layer of a pretrained VGG network. $\downarrow$ means lower is better. ↑ means higher is better.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Method</td><td>FID↓/IS↑ Sampling</td><td>FID↓/IS↑ Reconstruction</td><td>Pixel↓ Distance</td><td>Perceptual↓ Distance</td></tr><tr><td>VAE</td><td>115.8 /3.8</td><td>108.4/4.3</td><td>21.8</td><td>65.8</td></tr><tr><td>VAE/GAN</td><td>39.8 /7.4</td><td>29.0 /7.6</td><td>62.7</td><td>57.2</td></tr><tr><td>VAE-Contrastive</td><td>240.4 /1.8</td><td>242 /1.9</td><td>53.6</td><td>104.2</td></tr><tr><td>DC-VAE</td><td>17.9 /8.2</td><td>21.4 / 7.9</td><td>45.9</td><td>52.9</td></tr></table>
|
| 151 |
+
|
| 152 |
+
To demonstrate the necessity of the GAN loss (Eq. 4) and contrastive loss (Eq. 8), we conduct four experiments with the same backbone. These experiments are: VAE (No GAN, no Contrastive),
|
| 153 |
+
|
| 154 |
+
VAE/GAN (with GAN, no Contrastive), VAE-Contrastive (No GAN, with Contrastive, and ours (With GAN, with Contrastive). Here, GAN denotes Eq. 4, and Contrastive denotes Eq. 8.
|
| 155 |
+
|
| 156 |
+
Qualitative analysis From Figure 3, we see that without GAN and contrastive, images are blurry; Without GAN, the contrastive head can classify images, but not on the image manifold; Without Contrastive, reconstruction images are on the image manifold because of the discriminator, but they are different from input images. These experiments show that it is necessary to combine both instance-level and set-level fidelity, and in a contradistinctive manner.
|
| 157 |
+
|
| 158 |
+
Quantitative analysis In Table 1 we observe the same trend. VAE generates blurry images; thus the FID/IS (Inception Score) is not ideal. VAE-Contrastive does not generate images on the natural manifold; thus FID/IS is poor. VAE/GAN combines set-level and instance-level information. However the L2 objective is not ideal; thus the FID/IS is sub-optimal. For both reconstruction and sampling tasks, DC-VAE generates high fidelity images and has a favorable FID and Inception score. This illustrates the advantange of having a contradistinctive objective on both set level and instance level. To measure the faithfulness of the reconstructed image we compute the pixelwise L2 distance and the perceptual distance (Johnson et al. (2016)). For the pixel distance, VAE has the lowest value because it directly optimizes this distance during training; our pixel-wise distance is better than VAE/GAN and VAE-Contrastive. For perceptual distance, our method outperforms other three, which confirms that using contrastive learning helps reconstruct images semantically.
|
| 159 |
+
|
| 160 |
+
Table 2: Comparison on CIFAR-10 and STL-10. Average Inception scores (Salimans et al., 2016) and FID scores (Heusel et al., 2017). Results derived from (Gong et al., 2019). Table style derived from (Lee et al., 2019). †Result from Aneja et al. (2020). ∗Result from (Dieng et al., 2019).
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">CIFAR-10</td><td colspan="2">STL-10</td></tr><tr><td>Inception Score↑</td><td>FID↓</td><td>Inception Score↑</td><td>FID↓</td></tr><tr><td>Methods based on GAN:</td><td></td><td></td><td></td><td></td></tr><tr><td>DCGAN (Radford et al.,2016)</td><td>6.6</td><td></td><td></td><td>-</td></tr><tr><td>ProbGAN (He et al.,2019)</td><td>7.8</td><td>24.6</td><td>8.9</td><td>46.7</td></tr><tr><td>WGAN-GP ResNet (Gulrajani et al.,2017)</td><td>7.9</td><td>-</td><td>-</td><td>-</td></tr><tr><td>RaGAN (Jolicoeur-Martineau,2018)</td><td>=</td><td>23.5</td><td>=</td><td>■</td></tr><tr><td>SN-GAN (Miyato et al., 2018)</td><td>8.2</td><td>21.7</td><td>9.1</td><td>40.1</td></tr><tr><td>MGAN (Hoang et al., 2018)</td><td>8.3</td><td>26.7</td><td>-</td><td>-</td></tr><tr><td>Progressive GAN (Karras et al.,2018)</td><td>8.8</td><td>-</td><td>■</td><td>=</td></tr><tr><td>Improving MMD GAN(Wang et al.,2019)</td><td>8.3</td><td>16.2</td><td>9.3</td><td>37.6</td></tr><tr><td>PULSGAN (Guo et al., 2020)</td><td>■</td><td>22.3</td><td>=</td><td>-</td></tr><tr><td>AutoGAN (Gong et al., 2019)</td><td>8.6</td><td>12.4</td><td>9.2</td><td>31.0</td></tr><tr><td>MethodsbasedonVAE:</td><td></td><td></td><td></td><td></td></tr><tr><td>VAE</td><td>3.8</td><td>115.8</td><td></td><td></td></tr><tr><td>VAE/GAN</td><td>7.4</td><td>39.8</td><td></td><td></td></tr><tr><td>VEEGAN* (Srivastava et al.,2017)</td><td>-</td><td>95.2</td><td></td><td></td></tr><tr><td>WAE-GAN (Tolstikhin et al., 2017)</td><td></td><td>93.1</td><td></td><td></td></tr><tr><td>NVAE†(Vahdat & Kautz,202O) Sampling</td><td></td><td>50.8</td><td></td><td></td></tr><tr><td>NVAE† (Vahdat & Kautz,2020) Reconstruction</td><td>=</td><td>2.67</td><td>=</td><td></td></tr><tr><td>DC-VAE Sampling (ours)</td><td>8.2</td><td>17.9</td><td>8.1</td><td>41.9</td></tr><tr><td>DC-VAE Reconstruction (ours)</td><td>7.9</td><td>21.4</td><td>8.4</td><td>43.6</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 5.3 COMPARISON TO EXISTING GENERATIVE MODELS
|
| 165 |
+
|
| 166 |
+
Table 2 gives a comparison of quantitative measurement for CIFAR-10 and STL-10 dataset. In general, there is a large difference in terms of FID and IS between GAN family and VAE family of models. Our model has state-of-the-art results in VAE family, and is comparable to state-of-the-art GAN models on CIFAR-10. Similarly Table 4 shows that DC-VAE is able to generate images that are comparable to GAN based methods even on higher resolution datasets.
|
| 167 |
+
|
| 168 |
+
# 5.4 LATENT SPACE REPRESENTATION: IMAGE AND STYLE INTERPOLATION
|
| 169 |
+
|
| 170 |
+
We further validate the effectiveness of DC-VAE for representation learning. One benefit of having an AE/VAE framework compared with just a decoder as in GAN Goodfellow et al. (2014) is to be able to directly obtain the latent representation from the input images. The encoder and decoder modules in VAE allows us to readily perform image/style interpolation by mixing the latent variables of different images and reconstruct/synthesize new ones. We demonstrate qualitative results on image interpolation (Fig. 5, Appendix Fig. 9), style interpolation (Appendix Fig. 10) and image editing (Fig. 6). We directly use the trained DC-VAE model without disentanglement learning Karras et al. (2019). Additional latent space analysis and the method used for interpolation and editing is provided in the Appendix. We also quantitatively compare the latent space disentanglement through the perceptual path length (PPL) (Karras et al., 2019) (Table 6). We observe that DC-VAE learns a more disentangled latent space representation than the backbone Progressive GAN (Karras et al., 2018) and StyleALAE (Pidhorskyi et al., 2020) that uses a much more capable StyleGAN (Karras et al., 2019) backbone.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
(c) DC-VAE Reconstruction (ours, $5 1 2 \times 5 1 2$ ) Figure 4: Comparison of DC-VAE (resolution $5 1 2 \times 5 1 2$ ) with IntroVAE (Huang et al., 2018) (resolution $1 0 2 4 \times 1 0 2 4 )$ ).
|
| 174 |
+
|
| 175 |
+
Table 3: Quality of image generation (FID) comparison on LSUN Bedrooms. $^ \dag 1 2 8 \times 1 2 8$ resolution. $^ \dag 2 5 6 \times 2 5 6$ resolution. $\downarrow$ means lower is better.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Method</td><td>FID↓</td></tr><tr><td>Progressive GAN‡ (Karras et al.,2018)</td><td>8.3</td></tr><tr><td>SNGANt (Miyato et al.,2018)(from (Chen et al.,2019))</td><td>16.0</td></tr><tr><td>SSGANt(Chen et al., 2019)</td><td>13.3</td></tr><tr><td>StyleALAE(Pidhorskyi et al.,202O) Reconstruction</td><td>15.92</td></tr><tr><td>StyleALAE(Pidhorskyi et al.,2020) Sampling</td><td>17.13</td></tr><tr><td>DC-VAEt (ours) Reconstruction</td><td>10.57</td></tr><tr><td>DC-VAEt (ours) Sampling</td><td>14.3</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 4: FID on CelebA. $^ { * } 6 4 \times 6 4$ resolution.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Method</td><td>FID↓</td></tr><tr><td>Methods based on GAN:</td><td></td></tr><tr><td>PresGAN*(Dieng et al., 2019)</td><td>29.1</td></tr><tr><td>LSGAN(Mao et al.,2017) (from (Hoshen et al.,2019))</td><td>53.9</td></tr><tr><td>COCO-GAN† (Lin et al., 2019)</td><td>5.7</td></tr><tr><td>PGANt (Karras et al.,2018)(from (Lin et al.,2019))</td><td>7.30</td></tr><tr><td>MethodsbasedonVAE:</td><td></td></tr><tr><td>VEE-GAN† (Srivastava et al.,2017) (from (Dieng et al.,2019))</td><td>46.2</td></tr><tr><td>WAE-GAN*(Tolstikhin et al.,2017)</td><td>42</td></tr><tr><td>DC-VAEt (ours) Reconstruction</td><td>14.3</td></tr><tr><td>DC-VAEt (ours) Sampling</td><td>19.9</td></tr></table>
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 5: Interpolation results generated by DC-VAE (ours) on CelebA-HQ (Karras et al., 2018) images $( 5 \bar { 1 } 2 \times 5 1 2$ , left) and LSUN Bedroom Yu et al. (2015) images $1 2 8 \times 1 2 8$ , right). More images can be seen in Appendix Figure 9. (Zoom in for a better visualization.)
|
| 185 |
+
|
| 186 |
+
# 5.5 LATENT SPACE REPRESENTATION: CLSSIFICATION
|
| 187 |
+
|
| 188 |
+
To show that our model learns a good representation, we measure the performance on the downstream MNIST classification task (Ding et al., 2020). The VAE models were trained on MNIST dataset (LeCun, 1998). We feed input images into our VAE encoder and get the latent representation. Then we train a linear classifier on the latent representation to classify the classes of the input images. Results in Table 5 show that our model gives the lowest classification error in most cases. This experiment demonstrates that our model not only gains the ability to do faithful synthesis and reconstruction, but also gains better representation ability on the VAE side.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 6: Image editing on CelebA-HQ (Karras et al., 2018) validation set images (resolution $5 1 2 \times 5 1 2$ ). The method used to generate these is outlined in Appendix A.2.
|
| 192 |
+
|
| 193 |
+
Table 5: Comparison to prior VAE-based representation learning methods. Classification error on MNIST dataset. ↓: lower is better. $9 5 \ \%$ confidence intervals are from 5 trials. Results derived from (Ding et al., 2020).
|
| 194 |
+
Table 6: PPL Comparison of on CelebA-HQ Karras et al. (2018)
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Method</td><td>dz=16↓</td><td>dz=32↓</td><td>dz=64↓</td></tr><tr><td>VAE (Kingma&Welling,2014)</td><td>2.92%±0.12</td><td>3.05%±0.42</td><td>2.98%±0.14</td></tr><tr><td>β-VAE(β=2) (Higgins et al.,2017)</td><td>4.69%±0.18</td><td>5.26%±0.22</td><td>5.40%±0.33</td></tr><tr><td>FactorVAE(y=5) (Kim& Mnih,2018)</td><td>6.07%±0.05</td><td>6.18%±0.20</td><td>6.35%±0.48</td></tr><tr><td>β-TCVAE (α=1,β=5,γ=1) (Chen et al.,2018)</td><td>1.62%±0.07</td><td>1.24%±0.05</td><td>1.32%±0.09</td></tr><tr><td>Guided-VAE (Ding et al.,2020)</td><td>1.85%±0.08</td><td>1.60%±0.08</td><td>1.49%±0.06</td></tr><tr><td>Guided-β-TCVAE (Ding et al.,2020)</td><td>1.47%±0.12</td><td>1.10%±0.03</td><td>1.31%±0.06</td></tr><tr><td>DC-VAE (Ours)</td><td>1.30% ±0.035</td><td>1.27%±0.037</td><td>1.29%±0.034</td></tr><tr><td colspan="4"></td></tr><tr><td>Method</td><td colspan="2">Backbone</td></tr><tr><td>StyleALAE (Pidhorskyi et al., 2020)</td><td colspan="2">StyleGAN</td></tr><tr><td>Progressive GAN (Karras et al., 2018)</td><td colspan="2">Progressive GAN</td></tr><tr><td>DC-VAE (ours)</td><td colspan="2">Progressive GAN</td></tr></table>
|
| 197 |
+
|
| 198 |
+
# 6 CONCLUSION
|
| 199 |
+
|
| 200 |
+
In this paper, we have proposed dual contradistinctive generative autoencoder (DC-VAE), a new framework that integrates an instance-level discriminative loss (InfoNCE) with a set-level adversarial loss (GAN) into a single variational autoencoder framework. Our experiments show competitive results for a single model in several tasks, including image synthesis, image reconstruction, representation learning for image interpolation, and representation learning for classification. DC-VAE points to a encouraging direction that attains high-quality synthesis (decoding) and inference (encoding).
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Jyoti Aneja, Alexander Schwing, Jan Kautz, and Arash Vahdat. Ncp-vae: Variational autoencoders with noise contrastive priors, 2020.
|
| 205 |
+
|
| 206 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In ICML, 2017.
|
| 207 |
+
|
| 208 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 209 |
+
|
| 210 |
+
Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a “siamese” time delay neural network. In Neural Information Processing Systems, 1993.
|
| 211 |
+
|
| 212 |
+
Gal Chechik, Varun Sharma, Uri Shalit, and Samy Bengio. Large scale online learning of image similarity through ranking. J. Mach. Learn. Res., 11:1109–1135, March 2010. ISSN 1532-4435.
|
| 213 |
+
|
| 214 |
+
Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, 2018.
|
| 215 |
+
|
| 216 |
+
Ting Chen, Xiaohua Zhai, Marvin Ritter, Mario Lucic, and Neil Houlsby. Self-supervised gans via auxiliary rotation loss. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 12154–12163, 2019.
|
| 217 |
+
|
| 218 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv:2002.05709, 2020.
|
| 219 |
+
|
| 220 |
+
Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In CVPR, pp. 539–546, 2005. ISBN 0769523722.
|
| 221 |
+
|
| 222 |
+
Adam Coates, Andrew $\mathrm { N g }$ , and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In AISTATS, pp. 215–223, 2011.
|
| 223 |
+
|
| 224 |
+
Adji B Dieng, Francisco JR Ruiz, David M Blei, and Michalis K Titsias. Prescribed generative adversarial networks. arXiv:1910.04302, 2019.
|
| 225 |
+
|
| 226 |
+
Zheng Ding, Yifan Xu, Weijian Xu, Gaurav Parmar, Yang Yang, Max Welling, and Zhuowen Tu. Guided variational autoencoder for disentanglement learning. In CVPR, 2020.
|
| 227 |
+
|
| 228 |
+
Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. In ICLR, 2017.
|
| 229 |
+
|
| 230 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. In ICLR, 2017.
|
| 231 |
+
|
| 232 |
+
Xinyu Gong, Shiyu Chang, Yifan Jiang, and Zhangyang Wang. Autogan: Neural architecture search for generative adversarial networks. In ICCV, 2019.
|
| 233 |
+
|
| 234 |
+
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, 2014.
|
| 235 |
+
|
| 236 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, 2017.
|
| 237 |
+
|
| 238 |
+
T. Guo, C. Xu, J. Huang, Y. Wang, B. Shi, C. Xu, and D. Tao. On positive-unlabeled classification in gan. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8382–8390, Los Alamitos, CA, USA, jun 2020. IEEE Computer Society. doi: 10.1109/CVPR42600.2020.00841. URL https://doi.ieeecomputersociety.org/ 10.1109/CVPR42600.2020.00841.
|
| 239 |
+
|
| 240 |
+
Michael U. Gutmann and Aapo Hyvärinen. Noise-contrastive estimation of unnormalized statistical models, with applications to natural image statistics. J. Mach. Learn. Res., 13(null):307–361, February 2012. ISSN 1532-4435.
|
| 241 |
+
|
| 242 |
+
Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, 2006.
|
| 243 |
+
|
| 244 |
+
Hao He, Hao Wang, Guang-He Lee, and Yonglong Tian. Probgan: Towards probabilistic gan with theoretical guarantees. In ICLR, 2019.
|
| 245 |
+
|
| 246 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 247 |
+
|
| 248 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
|
| 249 |
+
|
| 250 |
+
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, 2017.
|
| 251 |
+
|
| 252 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017.
|
| 253 |
+
|
| 254 |
+
Geoffrey E Hinton and Richard S Zemel. Autoencoders, minimum description length and helmholtz free energy. In Advances in neural information processing systems, 1994.
|
| 255 |
+
|
| 256 |
+
Quan Hoang, Tu Dinh Nguyen, Trung Le, and Dinh Phung. Mgan: training generative adversarial nets with multiple generators. In ICLR, 2018.
|
| 257 |
+
|
| 258 |
+
Yedid Hoshen, Ke Li, and Jitendra Malik. Non-adversarial image synthesis with generative latent nearest neighbors. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5811–5819, 2019.
|
| 259 |
+
|
| 260 |
+
Huaibo Huang, Ran He, Zhenan Sun, Tieniu Tan, et al. Introvae: Introspective variational autoencoders for photographic image synthesis. In Advances in Neural Information Processing Systems, pp. 52–63, 2018.
|
| 261 |
+
|
| 262 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. CVPR, 2017.
|
| 263 |
+
|
| 264 |
+
Long Jin, Justin Lazarow, and Zhuowen Tu. Introspective classification with convolutional nets. In Advances in Neural Information Processing Systems, 2017.
|
| 265 |
+
|
| 266 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016.
|
| 267 |
+
|
| 268 |
+
Alexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. arXiv preprint arXiv:1807.00734, 2018.
|
| 269 |
+
|
| 270 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In ICLR, 2018.
|
| 271 |
+
|
| 272 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4401–4410, 2019.
|
| 273 |
+
|
| 274 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In ICML, 2018.
|
| 275 |
+
|
| 276 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
|
| 277 |
+
|
| 278 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 279 |
+
|
| 280 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, 2012.
|
| 281 |
+
|
| 282 |
+
Brian Kulis et al. Metric learning: A survey. Foundations and trends in machine learning, 5(4): 287–364, 2012.
|
| 283 |
+
|
| 284 |
+
Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. In ICML, 2016.
|
| 285 |
+
|
| 286 |
+
Yann LeCun. Modeles connexionnistes de lapprentissage. PhD thesis, PhD thesis, These de Doctorat, Universite Paris 6, 1987.
|
| 287 |
+
|
| 288 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 289 |
+
|
| 290 |
+
Chen-Yu Lee, Saining Xie, Patrick Gallagher, Zhengyou Zhang, and Zhuowen Tu. Deeply-supervised nets. In Artificial intelligence and statistics, pp. 562–570, 2015.
|
| 291 |
+
|
| 292 |
+
Kwonjoon Lee, Weijian Xu, Fan Fan, and Zhuowen Tu. Wasserstein introspective neural networks. In CVPR, 2018.
|
| 293 |
+
|
| 294 |
+
Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In CVPR, 2019.
|
| 295 |
+
|
| 296 |
+
Chieh Hubert Lin, Chia-Che Chang, Yu-Sheng Chen, Da-Cheng Juan, Wei Wei, and Hwann-Tzong Chen. Coco-gan: generation by parts via conditional coordinating. In Proceedings of the IEEE International Conference on Computer Vision, pp. 4512–4521, 2019.
|
| 297 |
+
|
| 298 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In ICCV, 2015.
|
| 299 |
+
|
| 300 |
+
Zhuang Ma and Michael Collins. Noise contrastive estimation and negative sampling for conditional models: Consistency and statistical efficiency. In EMNLP, 2018.
|
| 301 |
+
|
| 302 |
+
Tomasz Malisiewicz, Abhinav Gupta, and Alexei A. Efros. Ensemble of exemplar-svms for object detection and beyond. In ICCV, 2011.
|
| 303 |
+
|
| 304 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pp. 2794–2802, 2017.
|
| 305 |
+
|
| 306 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018.
|
| 307 |
+
|
| 308 |
+
Stanislav Pidhorskyi, Donald Adjeroh, and Gianfranco Doretto. Adversarial latent autoencoders, 2020.
|
| 309 |
+
|
| 310 |
+
Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In ICML, 2019.
|
| 311 |
+
|
| 312 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016.
|
| 313 |
+
|
| 314 |
+
Ruslan Salakhutdinov and Geoffrey Hinton. Deep boltzmann machines. In David van Dyk and Max Welling (eds.), AISTATS, volume 5, pp. 448–455, 16–18 Apr 2009.
|
| 315 |
+
|
| 316 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, 2016.
|
| 317 |
+
|
| 318 |
+
Akash Srivastava, Lazar Valkov, Chris Russell, Michael U Gutmann, and Charles Sutton. Veegan: Reducing mode collapse in gans using implicit variational learning. In Advances in Neural Information Processing Systems, pp. 3308–3318, 2017.
|
| 319 |
+
|
| 320 |
+
Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. arXiv preprint arXiv:1711.01558, 2017.
|
| 321 |
+
|
| 322 |
+
Zhuowen Tu. Learning generative models via discriminative approaches. In CVPR, 2007.
|
| 323 |
+
Arash Vahdat and Jan Kautz. NVAE: A deep hierarchical variational autoencoder. In Neural Information Processing Systems (NeurIPS), 2020.
|
| 324 |
+
Aäron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. CoRR, abs/1807.03748, 2018. URL http://arxiv.org/abs/1807.03748.
|
| 325 |
+
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, 2017.
|
| 326 |
+
Wei Wang, Yuan Sun, and Saman Halgamuge. Improving mmd-gan training with repulsive loss function. In ICLR, 2019.
|
| 327 |
+
Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, pp. 3733–3742, 2018.
|
| 328 |
+
Jianwen Xie, Yang Lu, Song-Chun Zhu, and Yingnian Wu. A theory of generative convnet. In ICML, 2016.
|
| 329 |
+
Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a largescale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
|
| 330 |
+
Zijun Zhang, Ruixiang Zhang, Zongpeng Li, Yoshua Bengio, and Liam Paull. Perceptual generative autoencoders. In ICLR, 2019.
|
| 331 |
+
|
| 332 |
+
A APPENDIX
|
| 333 |
+
|
| 334 |
+
# A.1 Additional reconstruction results
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 7: Additional CelebA-HQ (Karras et al., 2018) reconstruction images (resolution $5 1 2 \times 5 1 2$ ) generated by DC-VAE (ours)
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 8: Additional LSUN Bedroom (Yu et al., 2015) reconstruction images (resolution $1 2 8 \times 1 2 8$
|
| 341 |
+
|
| 342 |
+
# A.2 Analysing the latent space
|
| 343 |
+
|
| 344 |
+
In this section we analyse the smoothness of the latent space learnt by DC-VAE. In Figure 9 we qualitatively show the high resolution $( 5 1 2 \times 5 1 2 )$ CelebA-HQ Karras et al. (2018) images generated by an evenly spaced linear blending between two latent vectors. In Fig. 6 we show that DC-VAE is able to perform meaningful attribute editing on images while retaining the original identity. To perform image editing, we first need to compute the direction vector in the latent space that correspond to a desired attribute (e.g. has glasses, has blonde hair, is a woman, has facial hair). We compute these attribute direction vectors by selecting 20 images that have the attribute and 20 images that do not have the attribute, obtaining the corresponding pairs of 20 latent vectors, and calculating the difference of the mean. The results in Fig. 6 show that these direction vectors can be added to a latent vector to add a diverse combination of desired image attributes while retaining the original identity of the individual.
|
| 345 |
+
|
| 346 |
+
Additionally we corroborate the above qualitative results quantitatively by inspecting the Perceptual Path Length (PPL) Karras et al. (2019) of our learn DC-VAE Decoder (Tab. 6) to measures the disentanglement of the latent space. We note that although ProgressiveGAN (ours base model) has a better FID score, DC-VAE has a lower PPL score which indicated that the latent space learnt is more disentangled.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 9: Additional latent space interpolations on CelebA-HQ (Karras et al., 2018) (resolution $5 1 \bar { 2 } \times 5 1 2 $ )
|
| 350 |
+
|
| 351 |
+
# Source A
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 10: Latent Mixing results on CelebA-HQ Karras et al. (2018). Each combined image in the grid is generated by replacing an arbitrary subset of Source A latent with the corresponding Source B latent.
|
| 355 |
+
|
| 356 |
+
# A.3 Effect of negative samples
|
| 357 |
+
|
| 358 |
+
In this section we analyse the effect of varying the number of negative samples used for contrastive learning. The figure 11 shows the reconstruction error on the CIFAR-10 Krizhevsky et al. (2009) test set as the negative samples is varied. We observe that a higher number of negative samples results in better reconstruction. We choose 8096 for all of our experiments because of memory constraints.
|
| 359 |
+
|
| 360 |
+
# A.4 Datasets used
|
| 361 |
+
|
| 362 |
+
CIFAR-10 comprises 50,000 training images and 10,000 test images with a spatial resolution of $3 2 \times 3 2$ . STL-10 is a similar dataset that contains 5,000 training images and 100,000 unlabeled images at $9 6 \times 9 6$ resolution. We follow the procedure in AutoGAN(Gong et al., 2019) and resize the STL-10 images to $3 2 \times 3 2$ . The CelebA dataset has 162,770 training images and 19,962 testing images, CelebA-HQ contains 29,000 training images with 1,000 test images of size $1 0 2 4 \times 1 0 2 4$ and LSUN Bedroom has approximately 3M images. We resize all images progressively in these three datasets from $\left( 4 \times 4 \right)$ to $( 5 1 2 \times 5 1 2 )$ for the progressive training.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 11: Pixel reconstruction error on CIFAR-10 Krizhevsky et al. (2009) test set for varying number of negative samples
|
| 366 |
+
|
| 367 |
+
# A.5 Network architecture diagrams
|
| 368 |
+
|
| 369 |
+
In Figures 15 we show the detailed network architecture of DC-VAE for input resolutions of $3 2 \times 3 2$ Note that the comparison results shown in Figure 3 and Table 1 in the main paper, for VAE, VAE/GAN, VAE w/o GAN, and our proposed DC-VAE are all based on the same network architecture (shown in Figure 15 here), for a fair comparison.
|
| 370 |
+
|
| 371 |
+
The network architectures shown in Figure 15 are adapted closely from the networks discovered by (Gong et al., 2019) through Neural Architecture Search. The DC-VAE developed in our paper is not tied to any particular CNN architecture. We choose the AutoGAN architecture (Gong et al., 2019) to start with a strong baseline. The decoder in Figure 15 matches the generator in (Gong et al., 2019). The encoder is built by modifying the output shape of the final linear layer in the discriminator of AutoGAN (Gong et al., 2019) to match the latent dimension and adding spectral normalization. The discriminator is used both for classifying real/fake images, and contrastive learning. For each layer we choose, we first apply 1x1 convolution and a linear layer, and then use this feature as an input to the contrastive module. For experiments at $3 2 \times 3 2$ , we pick two different positions: the output of second residual conv block (lower level) and the output of the first linear layer (higher level). For experiments on higher resolution datasets we use a Progressive GAN (Karras et al., 2018) Generator and Discriminator as our backbone and apply similar modifications as described above.
|
| 372 |
+
|
| 373 |
+
# A.6 Training infrastructure
|
| 374 |
+
|
| 375 |
+
# .7 Further details about the representation learning experiments
|
| 376 |
+
|
| 377 |
+
As seen in Table 4 in the main paper, we show the representation capability of DC-VAE following the procedure outlined in (Ding et al., 2020). We train our model on the MNIST dataset (LeCun, 1998) and measure the transferability though a classification task on the latent embedding vector. Specifically, we first pretrain the DC-VAE model on the training split of the MNIST dataset. Following that we freeze the DC-VAE model and train a linear classifier that takes latent embedding vector as the input and predicts the class label of the original image.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 12: Visualization of the effect of adding each instance level and set level objectives. Table 1 and Figure 3 contain FID (Heusel et al., 2017) results and qualitative comparisons on the CIFAR-10 (Krizhevsky et al., 2009) that correspond to these settings.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 13: DC-VAE synthesis images on LSUN images (Yu et al., 2015) (resolution $1 2 8 \times 1 2 8$ )
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 14: DC-VAE reconstruction (a) and synthesis results (b) on STL10 (Coates et al., 2011) images (resolution $3 2 \times 3 2 ,$ ). In (a) the top two rows are input images and the bottom two rows are the corresponding reconstruction images.
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 15: Network architecture of DC-VAE for resolution $3 2 \times 3 2$ for CIFAR-10 (Krizhevsky et al., 2009) and STL-10 (Coates et al., 2011). (a) is the Encoder. (b) is the Decoder. (c) is the Discriminator.
|
md/train/7_eLEvFjCi3/7_eLEvFjCi3.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Nested Graph Neural Networks
|
| 2 |
+
|
| 3 |
+
Muhan Zhang1,2,∗ Pan Li3,† 1Institute for Artificial Intelligence, Peking University 2Beijing Institute for General Artificial Intelligence 3Department of Computer Science, Purdue University
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Graph neural network (GNN)’s success in graph classification is closely related to the Weisfeiler-Lehman (1-WL) algorithm. By iteratively aggregating neighboring node features to a center node, both 1-WL and GNN obtain a node representation that encodes a rooted subtree around the center node. These rooted subtree representations are then pooled into a single representation to represent the whole graph. However, rooted subtrees are of limited expressiveness to represent a nontree graph. To address it, we propose Nested Graph Neural Networks (NGNNs). NGNN represents a graph with rooted subgraphs instead of rooted subtrees, so that two graphs sharing many identical subgraphs (rather than subtrees) tend to have similar representations. The key is to make each node representation encode a subgraph around it more than a subtree. To achieve this, NGNN extracts a local subgraph around each node and applies a base GNN to each subgraph to learn a subgraph representation. The whole-graph representation is then obtained by pooling these subgraph representations. We provide a rigorous theoretical analysis showing that NGNN is strictly more powerful than 1-WL. In particular, we proved that NGNN can discriminate almost all $r$ -regular graphs, where 1-WL always fails. Moreover, unlike other more powerful GNNs, NGNN only introduces a constantfactor higher time complexity than standard GNNs. NGNN is a plug-and-play framework that can be combined with various base GNNs. We test NGNN with different base GNNs on several benchmark datasets. NGNN uniformly improves their performance and shows highly competitive performance on all datasets.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Graph is an important tool to model relational data in the real world. Representation learning over graphs has become a popular topic of machine learning in recent years. While network embedding methods, such as DeepWalk [1], can learn node representations well, they fail to generalize to whole-graph representations, which are crucial for applications such as graph classification, molecule modeling, and drug discovery. On the contrary, although traditional graph kernels [2–7] can be used for graph classification, they define graph similarity often in a heuristic way, which is not parameterized and lacks some flexibility to deal with features.
|
| 12 |
+
|
| 13 |
+
In this context, graph neural networks (GNNs) have regained people’s attention and become the state-of-the-art graph representation learning tool [8–17]. GNNs use message passing to propagate features between connected nodes. By iteratively aggregating neighboring node features to the center node, GNNs learn node representations encoding their local structure and feature information. These node representations can be further pooled into a graph representation, enabling graph-level tasks such as graph classification. In this paper, we will use message passing GNNs to denote this class of GNNs based on repeated neighbor aggregation [18], in order to distinguish them from some high-order GNN variants [19–21] where the effective message passing happens between high-order node tuples instead of nodes.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: The two original graphs $G _ { 1 }$ and $G _ { 2 }$ are non-isomorphic. $G _ { 1 }$ is composed of two triangles, while $G _ { 2 }$ is a hexagon. However, both 1-WL and message passing GNNs cannot differentiate them, since all nodes in the two graphs share identical rooted subtrees at any height (see the rooted subtrees around $v _ { 1 }$ and $v _ { 2 }$ in the middle block for example). In comparison, we can discriminate the two graphs by comparing their height-1 rooted subgraphs around any nodes. For example, the height-1 rooted subgraph around $v _ { 1 }$ is a closed triangle, but the height-1 rooted subgraph around $v _ { 2 }$ is an open triangle (see the red boxes in the right block).
|
| 17 |
+
|
| 18 |
+
GNNs’ message passing scheme mimics the 1-dimensional Weisfeiler-Lehman (1-WL) algorithm [22], which iteratively refines a node’s color according to its current color and the multiset of its neighbors’ colors. This procedure essentially encodes a rooted subtree around each node into its final color, where the rooted subtree is constructed by recursively expanding the neighbors of the root node. One critical reason for GNN’s success in graph classification is because two graphs sharing many identical or similar rooted subtrees are more likely classified into the same class, which actually aligns with the inductive bias that two graphs are similar if they have many common substructures [23].
|
| 19 |
+
|
| 20 |
+
Despite this, rooted subtrees are still limited in terms of expressing all possible substructures that can appear in a graph. It is likely that two graphs, despite sharing a lot of identical rooted subtrees, are not similar at all because their other substructure patterns are not similar. Take the two graphs $G _ { 1 }$ and $G _ { 2 }$ in Figure 1 as an example. If we apply 1-WL or a message passing GNN to them, the two graphs will always have the same representation no matter how many iterations/layers we use. This is because all nodes in the two graphs have identical rooted subtrees across all tree heights. However, the two graphs are quite different from a holistic perspective. $G _ { 1 }$ is composed of two triangles, while $G _ { 2 }$ is a hexagon. The intrinsic reason for such a failure is that rooted subtrees have limited expressiveness for representing general graphs, especially those with cycles.
|
| 21 |
+
|
| 22 |
+
To address this issue, we propose Nested Graph Neural Networks (NGNNs). The core idea is, instead of encoding a rooted subtree, we want the final representation of a node to encode a rooted subgraph (local $h$ -hop subgraph) around it. The subgraph is not restricted to be of any particular graph type such as tree, but serves as a general description of the local neighborhood around a node. Rooted subgraphs offer much better representation power than rooted subtrees, e.g., we can easily discriminate the two graphs in Figure 1 by only comparing their height-1 rooted subgraphs.
|
| 23 |
+
|
| 24 |
+
To represent a graph with rooted subgraphs, NGNN uses two levels of GNNs: base (inner) GNNs and an outer GNN. By extracting a local rooted subgraph around each node, NGNN first applies a base GNN to each node’s subgraph independently. Then, a subgraph pooling layer is applied to each subgraph to aggregate the intermediate node representations into a subgraph representation. This subgraph representation is used as the final representation of the root node. Rather than encoding a rooted subtree, this final node representation encodes the local subgraph around it, which contains more information than a subtree. Finally, all the final node representations are further fed into an outer GNN to learn a representation for the entire graph. Figure 2 shows one NGNN implementation using message passing GNNs as the base GNNs and a simple graph pooling layer as the outer GNN.
|
| 25 |
+
|
| 26 |
+
One may wonder that the base GNN seems to still learn only rooted subtrees if it is message-passingbased. Then why is NGNN more powerful than GNN? One key reason lies in the subgraph pooling layer. Take the height-1 rooted subgraphs (marked with red boxes) around $v _ { 1 }$ and $v _ { 2 }$ in Figure 1 as an example. Although $v _ { 1 }$ and $v _ { 2 }$ ’s height-1 rooted subtrees are still the same, their neighbors (labeled by 1 and 2) have different height-1 rooted subtrees. Thus, applying a one-layer message passing GNN plus a subgraph pooling as the base GNN is sufficient to discriminate $G _ { 1 }$ and $G _ { 2 }$ .
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 2: A particular implementation of the NGNN framework. It first extracts (copies) a rooted subgraph (height=1) around each node from the original graph, and then applies a base GNN with a subgraph pooling layer to each rooted subgraph independently to learn a subgraph representation. The subgraph representation is used as the root node’s final representation in the original graph. Then, a graph pooling layer is used to summarize the final node representations into a graph representation.
|
| 30 |
+
|
| 31 |
+
The NGNN framework has multiple exclusive advantages. Firstly, it allows freely choosing the base GNN, and can enhance the base GNN’s representation power in a plug-and-play fashion. Theoretically, we proved that NGNN is more powerful than message passing GNNs and 1-WL by being able to discriminate almost all $r$ -regular graphs (where 1-WL always fails). Secondly, by extracting rooted subgraphs, NGNN allows augmenting the initial features of a node with subgraphspecific structural features such as distance encoding [24] to improve the quality of the learned node representations. Thirdly, unlike other more powerful graph neural networks, especially those based on higher-order WL tests [19–21, 25], NGNN still has linear time and space complexity w.r.t. graph size like standard message passing GNNs, thus maintaining good scalability. We demonstrate the effectiveness of the NGNN framework in various synthetic/real-world graph classification/regression datasets. On synthetic datasets, NGNN demonstrates higher-than-1-WL expressive power, matching very well with our theorem. On real-world datasets, NGNN consistently enhances a wide range of base GNNs’ performance, achieving highly competitive results on all datasets.
|
| 32 |
+
|
| 33 |
+
# 2 Preliminaries
|
| 34 |
+
|
| 35 |
+
# 2.1 Notation and problem definition
|
| 36 |
+
|
| 37 |
+
We consider the graph classification/regression problem. Given a graph $G = ( V , E )$ where $V =$ $\{ 1 , 2 , \ldots n \}$ is the node set and $E \subseteq V \times V$ is the edge set, we aim to learn a function mapping $G$ to its class or target value $y$ . The nodes and edges in $G$ can have feature vectors associated with them, denoted by $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ (for node $i$ ) and $e _ { i j }$ (for edge $( i , j ) )$ , respectively.
|
| 38 |
+
|
| 39 |
+
# 2.2 Weisfeiler-Lehman test
|
| 40 |
+
|
| 41 |
+
The Wesfeiler-Lehman (1-WL) test [22] is a popular algorithm for graph isomorphism checking. The classical 1-WL works as follows. At first, all nodes receive a color 1. Each node collects its neighbors’ colors into a multiset. Then, 1-WL will update each node’s color so that two nodes get the same new color if and only if their current colors are the same and they have identical multisets of neighbor colors. Repeat this process until the number of colors does not increase between two iterations. Then, 1-WL will return that two graphs are non-isomorphic if their node colors are different at some iteration, or fail to determine whether they are non-isomorphic. See [7, 26] for more details.
|
| 42 |
+
|
| 43 |
+
1-WL essentially encodes the rooted subtrees around each node at different heights into its color representations. Figure 1 middle shows the rooted subtrees around $v _ { 1 }$ and $v _ { 2 }$ . Two nodes will have the same color at iteration $h$ if and only if their height- $h$ rooted subtrees are the same.
|
| 44 |
+
|
| 45 |
+
# 3 Nested Graph Neural Network
|
| 46 |
+
|
| 47 |
+
In this section, we introduce our Nested Graph Neural Network (NGNN) framework and theoretically demonstrate its higher representation power than message passing GNNs.
|
| 48 |
+
|
| 49 |
+
# 3.1 Limitations of the message passing GNNs
|
| 50 |
+
|
| 51 |
+
Most existing GNNs follow the message passing framework [18]: given a graph $G$ , each node’s hidden state $\bar { h } _ { v } ^ { t + 1 }$ is updated based on its previous state $\boldsymbol { h } _ { v } ^ { t }$ and the messages $m _ { v } ^ { \overline { { t } } + \tilde { 1 } }$ from its neighbors
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\pmb { h } _ { v } ^ { t + 1 } = U _ { t } ( \pmb { h } _ { v } ^ { t } , \pmb { m } _ { v } ^ { t + 1 } ) , \mathrm { ~ w h e r e ~ } \pmb { m } _ { v } ^ { t + 1 } = \sum _ { u \in N ( v | G ) } M _ { t } ( \pmb { h } _ { v } ^ { t } , \pmb { h } _ { u } ^ { t } , \pmb { e } _ { v u } ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Here $M _ { t } , U _ { t }$ are the message and update functions at time stamp $t$ , $e _ { v u }$ is the feature of edge $( v , u )$ , and $N ( v | G )$ is the set of $v$ ’s neighbors in graph $G$ . The initial hidden states $h _ { v } ^ { 0 }$ are given by the raw node features $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathit { v } }$ . After $T$ time stamps (iterations), the final node representations $h _ { v } ^ { T }$ are summarized into a whole-graph representation with a readout (pooling) function $R$ (e.g., mean or sum):
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r } { h _ { G } = R ( \{ h _ { v } ^ { T } | v \in G \} ) . } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Such a message passing (or neighbor aggregation) scheme iteratively aggregates neighbor information into a center node’s hidden state, making it encode a local rooted subtree around the node. The final node representations will contain both the local structure and feature information around nodes, enabling node-level tasks such as node classification. After a pooling layer, these node representations can be further summarized into a graph representation, enabling graph-level tasks. When there is no edge feature and the node features are from a countable space, it is shown that message passing GNNs are at most as powerful as the 1-WL test for discriminating non-isomorphic graphs [27, 19].
|
| 64 |
+
|
| 65 |
+
For an $h$ -layer message passing GNN, it will give two nodes the same final representation if they have identical height- $h$ rooted subtrees (i.e., both the structures and the features on the corresponding nodes/edges are the same). If two graphs have a lot of identical (or similar) rooted subtrees, they will also have similar graph representations after pooling. This insight is crucial for the success of modern GNNs in graph classification, because it aligns with the inductive bias that two graphs are similar if they have many common substructures. Such insight has also been used in designing the WL subtree kernel [7], a state-of-the-art graph classification method before GNNs.
|
| 66 |
+
|
| 67 |
+
However, message passing GNNs have several limitations. Firstly, rooted subtree is only one specific substructure. It is not general enough to represent arbitrary subgraphs, especially those with cycles due to the natural restriction of tree structure. Secondly, using rooted subtree as the elementary substructure results in a discriminating power bounded by the 1-WL test. For example, all $n$ -node $r$ -regular graphs cannot be discriminated by message passing GNNs. Thirdly, standard message passing GNNs do not allow using root-node-specific structural features (such as the distance between a node and the root node) to improve the quality of the learned root node’s representation. We might need to break through such limitations in order to design more powerful GNNs.
|
| 68 |
+
|
| 69 |
+
# 3.2 The NGNN framework
|
| 70 |
+
|
| 71 |
+
To address the above limitations, we propose the Nested Graph Neural Network (NGNN) framework. NGNN no longer aims to encode a rooted subtree around each node. Instead, in NGNN, each node’s final representation encodes the general local subgraph information around it more than a subtree, so that two graphs sharing a lot of identical or similar rooted subgraphs will have similar representations.
|
| 72 |
+
|
| 73 |
+
Definition 1. (Rooted subgraph) Given a graph $G$ and a node v, the height-h rooted subgraph $G _ { v } ^ { h }$ of v is the subgraph induced from $G$ by the nodes within h hops of v (including $h$ -hop nodes).
|
| 74 |
+
|
| 75 |
+
To make a node’s final representation encode a rooted subgraph, we need to compute a subgraph representation. To achieve this, we resort to an arbitrary GNN, which we call the base GNN of NGNN. For example, the base GNN can be simply a message passing GNN, which performs message passing within each rooted subgraph to learn an intermediate representation for every node of the subgraph, and then uses a pooling layer to summarize a subgraph representation from the intermediate node representations. This subgraph representation is used as the final representation of the root node in the original graph. Take root node $w$ as an example. We first perform $T$ rounds of message passing within node $w$ ’s rooted subgraph $G _ { w } ^ { h }$ . Let $v$ be any node appearing in $G _ { w } ^ { h }$ . We have
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
h _ { v , G _ { w } ^ { h } } ^ { t + 1 } = U _ { t } ( h _ { v , G _ { w } ^ { h } } ^ { t } , m _ { v , G _ { w } ^ { h } } ^ { t + 1 } ) , ~ \mathrm { w h e r e } ~ m _ { v , G _ { w } ^ { h } } ^ { t + 1 } = \sum _ { u \in N ( v | G _ { w } ^ { h } ) } M _ { t } ( h _ { v , G _ { w } ^ { h } } ^ { t } , h _ { u , G _ { w } ^ { h } } ^ { t } , e _ { v u } ) .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Here $M _ { t } , U _ { t }$ are the message and update functions of the base GNN at time stamp $t$ , $N ( v | G _ { w } ^ { h } )$
|
| 82 |
+
denonode s th’s hi set of den st $v$ ’s neighbors within e and message spec $w$ ’s rooted subgraph to rooted subgrap $G _ { w } ^ { h }$ and at ti $h _ { v , G _ { w } ^ { h } } ^ { t + 1 }$ anmp $m _ { v , G _ { w } ^ { h } } ^ { t + 1 }$ denoteote that $v$ $G _ { w } ^ { h }$ $t + 1$ $v$
|
| 83 |
+
different. This is in contrast to standard GNNs where a node’s hidden state and message at time $t$ is
|
| 84 |
+
the same regardless of which root node it contributes to. For example, $\boldsymbol { h } _ { v } ^ { t + 1 }$ and $m _ { v } ^ { t + 1 }$ in Eq. 1 do
|
| 85 |
+
not depend on any particular rooted subgraph.
|
| 86 |
+
|
| 87 |
+
After $T$ rounds of message passing, we apply a subgraph pooling layer to summarize a subgraph representation $h _ { G _ { w } ^ { h } }$ from the intermediate node representations $\{ h _ { v , G _ { w } ^ { h } } ^ { T } | v \in G _ { w } ^ { h } \}$ .
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\pmb { h _ { w } } : = \pmb { h } _ { G _ { w } ^ { h } } = R _ { 0 } \big ( \{ \pmb { h } _ { v , G _ { w } ^ { h } } ^ { T } | v \in G _ { w } ^ { h } \} \big ) ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $R _ { 0 }$ is the subgraph pooling layer. This subgraph representation $h _ { G _ { w } ^ { h } }$ will be used as root node $w$ ’s final representation $h _ { w }$ in the original graph. Note that the base GNNs are simultaneously applied to all nodes’ rooted subgraphs to return a final node representation for every node in the original graph, and all the base GNNs share the same parameters. With such node representations, NGNN uses an outer GNN to further process and aggregate them into a graph representation of the whole graph. For simplicity, we let the outer GNN be simply a graph pooling layer denoted by $R _ { 1 }$ :
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r } { h _ { G } : = R _ { 1 } ( \{ h _ { w } | w \in G \} ) . } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
The Nested GNN framework can be understood as a two-level GNN, or a GNN of GNNs—the inner subgraph-level GNNs (base GNNs) are used to learn node representations from their rooted subgraphs, while the outer graph-level GNN is used to return a whole-graph representation from the inner GNNs’ outputs. The inner GNNs all share the same parameters which are trained end-to-end with the outer GNN. Figure 2 depicts the implementation of the NGNN framework described above.
|
| 100 |
+
|
| 101 |
+
Compared to message passing GNNs, NGNN changes the “receptive field” of each node from a rooted subtree to a rooted subgraph, in order to capture better local substructure information. The rooted subgraph is read by a base GNN to learn a subgraph representation. Finally, the outer GNN reads the subgraph representations output by the base GNNs to return a graph representation.
|
| 102 |
+
|
| 103 |
+
Note that, when we apply the base GNN to a rooted subgraph, this rooted subgraph is extracted (copied) out of the original graph and treated as a completely independent graph from the other rooted subgraphs and the original graph. This allows the same node to have different representations within different rooted subgraphs. For example, in Figure 2, the same node $B$ appears in four different rooted subgraphs. Sometimes it is the root node, while other times it is a 1-hop neighbor of the root node. NGNN enables learning different representations for the same node when it appears in different rooted subgraphs, in contrast to standard GNNs where a node only has one single representation at one time stamp (Eq. 1). Similarly, NGNN also enables using different initial features for the same node when it appears in different rooted subgraphs. This allows us to customize a node’s initial features based on its structural role within a rooted subgraph, as opposed to using the same initial features for a node across all rooted subgraphs. For example, we can optionally augment node $B$ ’s initial features with the distance between node $B$ and the root—when node $B$ is the root node, we give it an additional feature 0; and when $B$ is a $k$ -hop neighbor of the root, we give it an additional feature $k$ . Such feature augmentation may help better capture a node’s structural role within a rooted subgraph. It is an exclusive advantage of NGNN and is not possible in standard GNNs.
|
| 104 |
+
|
| 105 |
+
# 3.3 The representation power of NGNN
|
| 106 |
+
|
| 107 |
+
We theoretically characterize the additional expressive power of NGNN (using message passing GNNs as base GNNs) as opposed to standard message passing GNNs. We focus on the ability to discriminate regular graphs because they form an important category of graphs which standard GNNs cannot represent well. Using 1-WL or message passing GNNs, any two $n$ -sized $r$ -regular graphs will have the same representation, unless discriminative node features are available. In contrast, we prove that NGNN can distinguish almost all pairs of $n$ -sized $r$ -regular graphs regardless of node features.
|
| 108 |
+
|
| 109 |
+
Definition 2. If the message passing (Eq. 3) and the two-level graph pooling (Eqs. 4,5) are all injective given input from a countable space, then the NGNN is called proper.
|
| 110 |
+
|
| 111 |
+
A proper NGNN always exists due to the representation power of fully-connected neural networks used for message passing and Deep Set for graph pooling [28]. For all pairs of graphs that 1-WL can discriminate, there always exists a proper NGNN that can also discriminate them, because two graphs discriminated by 1-WL means they must have different multisets of rooted subtrees at some height $h$ , while a rooted subtree is always included in a rooted subgraph with the same height.
|
| 112 |
+
|
| 113 |
+
Now we present our main theorem.
|
| 114 |
+
|
| 115 |
+
Theorem 1. Consider all pairs of $n$ -sized $r$ -regular graphs, where $3 \leq r < ( 2 \log n ) ^ { 1 / 2 }$ . For any small constant $\epsilon > 0$ , there exists a proper NGNN using at most $\begin{array} { r } { \lceil ( \frac { 1 } { 2 } + \epsilon ) \frac { \log n } { \log ( r - 1 - \epsilon ) } \rceil } \end{array}$ -height rooted subgraphs and $\left\lceil \epsilon \frac { \log n } { \log ( r - 1 - \epsilon ) } \right\rceil$ -layer message passing, which distinguishes almost all $( 1 - o ( 1 ) ,$ ) such pairs of graphs.
|
| 116 |
+
|
| 117 |
+
We include the proof in Appendix A. Theorem 1 has three implications. Firstly, since NGNN can discriminate almost all $r$ -regular graphs where 1-WL always fails, it is strictly more powerful than 1-WL and message passing GNNs. Secondly, it implies that NGNN does not need to extract subgraphs with a too large height (abou t 12 log nlog (r−1) ) to be more powerful. Moreover, NGNN is already powerful with very few layers, i.e., an arbitrarily small constant $\epsilon$ times $\frac { \log n } { \log ( r - 1 ) }$ (as few as 1 layer). This benefit comes from the subgraph pooling (Eq. 4), freeing us from using deep base GNNs. We further conduct a simulation experiment in Appendix D to verify Theorem 1 by testing how well NGNN discriminates $r$ -regular graphs in practice. The results match almost perfectly with our theory.
|
| 118 |
+
|
| 119 |
+
Although NGNN is strictly more powerful than 1-WL and 2-WL (1-WL and 2-WL have the same discriminating power [20]), it is unclear whether NGNN is more powerful than 3-WL. Our early-stage analysis shows both NGNN and 3-WL cannot discriminate strongly regular graphs with the same parameters [29]. We leave the exact comparison between NGNN and 3-WL to future work.
|
| 120 |
+
|
| 121 |
+
# 3.4 Discussion
|
| 122 |
+
|
| 123 |
+
Base GNN. NGNN is a general plug-and-play framework to increase the power of a base GNN. For the base GNN, we are not restricted to message passing GNNs as described in Section 3.2. For example, we can also use GNNs approximating the power of higher-dimensional WL tests, such as 1-2-3-GNN [19] and PPGN/Ring-GNN [20, 21], as the base GNN. In fact, one limitation of these high-order GNNs is their $\mathcal { O } ( n ^ { 3 } )$ complexity. Using the NGNN framework we can greatly alleviate this by applying the higher-order GNN to multiple small rooted subgraphs instead of the whole graph. Suppose a rooted subgraph has at most $c$ nodes, then by applying a high-order GNN to all $n$ rooted subgraphs, we can reduce the time complexity from $\dot { \mathcal { O } ( n ^ { 3 } ) }$ to $\bar { \mathcal { O } } \bar { ( n c ^ { 3 } ) }$ .
|
| 124 |
+
|
| 125 |
+
Complexity. We compare the time complexity of NGNN (using message passing GNNs as base GNNs) with a standard message passing GNN. Suppose the graph has $n$ nodes with a maximum degree $d$ , and the maximum number of nodes in a rooted subgraph is $c$ . Each message passing iteration in a standard message passing GNN takes $\mathcal { O } ( n d )$ operations. In NGNN, we need to perform message passing over all $n$ nodes’ rooted subgraphs, which takes $O ( n \cdot c d )$ . We will keep $c$ small (which can be achieved by using a small $h$ ) to improve NGNN’s scalability. Additionally, a small $c$ enables the base GNN to focus on learning local subgraph patterns.
|
| 126 |
+
|
| 127 |
+
In Appendix B, we discuss some other design choices of NGNN.
|
| 128 |
+
|
| 129 |
+
# 4 Related work
|
| 130 |
+
|
| 131 |
+
Understanding GNN’s representation power is a fundamental problem in GNN research. Xu et al. [27] and Morris et al. [19] first proved that the discriminating power of message passing GNNs is bounded by the 1-WL test, namely they cannot discriminate two non-isomorphic graphs that 1-WL fails to discriminate (such as $r$ -regular graphs). Since then, there is increasing effort in enhancing GNN’s discriminating power beyond 1-WL [19, 21, 20, 30, 24, 31–33, 25]. Many GNNs have been proposed to mimic higher-dimensional WL tests, such as 1-2-3-GNN [19], Ring-GNN [21] and PPGN [20]. However, these models generally require learning the representations of all node tuples of certain cardinality (e.g., node pairs, node triples and so on), thus cannot leverage the sparsity of graph structure and are difficult to scale to large graphs. Some works study the universality of GNNs for approximating any invariant or equivariant functions over graphs [34, 21, 35–37]. However, reaching universality would require polynomial $( n )$ -order tensors, which hold more theoretical value than practical applicability. Dasoulas et al. [38] propose to augment nodes of identical attributes with different colors, which requires exhausting all the coloring choices to reach universality. Similarly, Relational Pooling (RP) [30] uses the ensemble of permutation-aware functions over graphs to reach universality, which requires exhausting all $n !$ permutations to achieve its theoretical power. Its local version Local Relational Pooling (LRP) [39] applies RP over subgraphs around nodes, which is similar to our work yet still requires exhausting node permutations in local subgraphs and even more loses RP’s theoretical power. In contrast, NGNN maintains a controllable cost by only applying a message passing GNN to local subgraphs, and is guaranteed to be more powerful than 1-WL.
|
| 132 |
+
|
| 133 |
+
Because of the high cost of mimicking high-dimensional WL tests, several works have been proposed to increase GNN’s representation power within the message passing framework. Observing that different neighbors are indistinguishable during neighbor aggregation, some works propose to add one-hot node index features or random features to GNNs [40, 41]. These methods work well when nodes naturally have distinct identities irrespective of the graph structure. However, although making GNNs more discriminative, they also lose some of GNNs’ generalization ability by not being able to guarantee nodes with identical neighborhoods to have the same embedding; the resulting models are also no longer permutation invariant. Repeating random initialization helps with avoiding such an issue but gets much slower convergence [42]. An exception is structural message-passing (SMP) [43], which propagates one-hot node index features to learn a global $n \times d$ feature matrix for each node. The feature matrix is further pooled to learn a permutation-invariant node representation.
|
| 134 |
+
|
| 135 |
+
On the contrary, some works propose to use structural features to augment GNNs without hurting the generalization ability of GNNs. SEAL [44, 45], IGMC [46] and DE [24] use distance-based features, where a distance vector w.r.t. the target node set to predict is calculated for each node as its additional features. Our NGNN framework is naturally compatible with such distance-based features due to its independent rooted subgraph processing. GSN [31] uses the count of certain substructures to augment node/edge features, which also surpasses 1-WL theoretically. However, GSN needs a properly defined substructure set to incorporate domain-specific inductive biases, while NGNN aims to learn arbitrary substructures around nodes without the need to predefine a substructure set.
|
| 136 |
+
|
| 137 |
+
Concurrent to our work, You et al. [32] propose Identity-aware GNN (ID-GNN). ID-GNN uses different weight parameters between each root node and its context nodes during message passing. It also extracts a rooted subgraph around each node, and thus can be viewed as a special case of NGNN with: 1) the number of message passing layers equivalent to the subgraph height, 2) directly using the root node’s intermediate representation as its final representation without subgraph pooling, and 3) augmenting initial node features with 0/1 “identity”. However, the extra power of ID-GNN only comes from the “identity” feature, while the power of NGNN comes from the subgraph pooling— without using any node features, NGNN is still provably more discriminative than 1-WL. Another similar work to ours is natural graph network (NGN) [47]. NGN argues that graph convolution weights need not be shared among all nodes but only (locally) isomorphic nodes. If we view our distance-based node features as refining the graph convolution weights so that nodes within a center node’s neighborhood are no longer treated symmetrically, then our NGNN reduces to an NGN.
|
| 138 |
+
|
| 139 |
+
The idea of independently performing message passing within $k$ -hop neighborhood is also explored in $k$ -hop GNN [48] and MixHop [49]. However, MixHop directly concatenates the aggregation results of neighbors at different hops as the root representation, which ignores the connections between other nodes in the rooted subgraph. $k$ -hop GNN sequentially performs message passing for $k$ -hop, $k - 1$ -hop, ..., and 0-hop node (the update of $( i - 1 )$ -hop nodes depend on the updated states of $i$ -hop nodes), while NGNN simultaneously performs message passing for all nodes in the subgraph thus is more parallelizable. Both MixHop and $k$ -hop GNN directly use the root node’s representation as its final node representation. In contrast, NGNN uses a subgraph pooling to summarize all node representations within the subgraph as the final root representation, which distinguishes NGNN from other $k$ -hop models. As Theorem 1 shows, the subgraph pooling enables using a much smaller number of message passing layers $l$ (as small as 1) than the depth $k$ of the subgraph, while MixHop and $k$ -hop GNN always require $l \geq k$ . MixHop and $k$ -hop GNN also do not have the strong theoretical power of NGNN to discriminate $r$ -regular graphs. Like SEAL and $k$ -hop GNN, G-Meta [50] is another work extracting subgraphs around nodes/links. It focuses specifically on a meta-learning setting.
|
| 140 |
+
|
| 141 |
+
Table 1: Statistics and evaluation metrics of the QM9 and OGB datasets.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Dataset</td><td>#Graphs</td><td>Avg. #nodes</td><td>Avg.#edges</td><td>Split ratio</td><td>#Tasks</td><td>Task type</td><td>Metric</td></tr><tr><td>QM9</td><td>129,433</td><td>18.0</td><td>18.6</td><td>80/10/10</td><td>12</td><td>Regression</td><td>MAE</td></tr><tr><td>ogbl-molhiv</td><td>41,127</td><td>25.5</td><td>27.5</td><td>80/10/10</td><td>1</td><td>Classification</td><td>ROC-AUC</td></tr><tr><td>ogbl-molpcba</td><td>437,929</td><td>26.0</td><td>28.1</td><td>80/10/10</td><td>128</td><td>Classification</td><td>AP</td></tr></table>
|
| 144 |
+
|
| 145 |
+
# 5 Experiments
|
| 146 |
+
|
| 147 |
+
In this section, we study the effectiveness of the NGNN framework for graph classification and regression tasks. In particular, we want to answer the following questions:
|
| 148 |
+
|
| 149 |
+
Q1 Can NGNN reach its theoretical power to discriminate 1-WL-indistinguishable graphs? Q2 How often and how much does NGNN improve the performance of a base GNN? Q3 How does NGNN perform in comparison to state-of-the-art GNN methods in open benchmarks? Q4 How much extra computation time does NGNN incur?
|
| 150 |
+
|
| 151 |
+
We implement the NGNN framework based on the PyTorch Geometric library [51]. Our code is available at https://github.com/muhanzhang/NestedGNN.
|
| 152 |
+
|
| 153 |
+
# 5.1 Datasets
|
| 154 |
+
|
| 155 |
+
To answer Q1, we use a simulation dataset of $r$ -regular graphs and the EXP dataset [42] containing 600 pairs of 1-WL-indistinguishable but non-isomorphic graphs. To answer Q2, we use the QM9 dataset [52, 53] and the TU datasets [54]. QM9 contains $1 3 0 \mathrm { K }$ small molecules. The task here is to perform regression on twelve targets representing energetic, electronic, geometric, and thermodynamic properties, based on the graph structure and node/edge features. TU contains five graph classification datasets including D&D [55], MUTAG [56], PROTEINS [55], PTC_MR [57], and ENZYMES [58]. We used the datasets provided by PyTorch Geometric [51], where for QM9 we performed unit conversions to match the units used by [19]. The evaluation metric is Mean Absolute Error (MAE) for QM9 and Accuracy $( \% )$ for TU. To answer Q3, we use two Open Graph Benchmark (OGB) datasets [59], ogbg-molhiv and ogbg-molpcba. The ogbg-molhiv dataset contains 41K small molecules, the task of which is to classify whether a molecule inhibits HIV virus or not. ROC-AUC is used for evaluation. The ogbg-molpcba dataset contains 438K molecules with 128 classification tasks. The evaluation metric is Average Precision (AP) averaged over all the tasks. We include the statistics for QM9 and OGB datasets in Table 1.
|
| 156 |
+
|
| 157 |
+
# 5.2 Models
|
| 158 |
+
|
| 159 |
+
QM9. We use 1-GNN, 1-2-GNN, 1-3-GNN, and 1-2-3-GNN from [19] as both the baselines and the base GNNs of NGNN. Among them, 1-GNN is a standard message passing GNN with 1-WL power. 1-2-GNN is a GNN mimicking 2-WL, where message passing happens among 2-tuples of nodes. 1-3-GNN and 1-2-3-GNN mimic 3-WL, where message passing happens among 3-tuples of nodes. 1-2-GNN and 1-3-GNN use features computed by 1-GNN as initial node features, and 1-2-3-GNN uses the concatenated features from 1-2-GNN and 1-3-GNN. We additionally include numbers provided by [53] and Deep LRP [39] as baselines. Note that we omit more recent methods [60–62] using advanced physical representations calculated from angles, atom coordinates, and quantum mechanics, which may obscure the comparison of models’ pure graph representation power. For NGNN, we uniformly use height-3 rooted subgraphs. For a fair comparison, the base GNNs in NGNN use exactly the same hyperparameters as when they are used alone, except for 1-GNN where we increase the number of message passing layers from 3 to 5 to make the number of layers larger than the subgraph height, similar to [63]. For subgraph pooling and graph pooling layers, we uniformly use mean pooling. All other settings follow [19].
|
| 160 |
+
|
| 161 |
+
TU. We use four widely adopted GNNs as the baselines and the base GNNs of NGNN: GCN [12], GraphSAGE [64], GIN [27], and GAT [15]. Since TU datasets suffer from inconsistent evaluation standards [65], we uniformly use the 10-fold cross validation framework provided by PyTorch Geomtric [66] for all the models to ensure a fair comparison. For GNNs, we search the number of message passing layers in $\{ 2 , 3 , 4 , 5 \}$ . For NGNNs, we similarly search the subgraph height $h$ in $\{ 2 , 3 , 4 , 5 \}$ , so that both NGNNs and GNNs can have equal-depth local receptive fields. For NGNNs, we always use $h + 1$ message passing layers instead of searching it together with $h$ , because that will make NGNNs have more hyperparameters to tune. All models have 32 hidden dimensions, and are trained for 100 epochs with a batch size of 128. For each fold, we record the test accuracy with the hyperparameters chosen based on the best validation performance of this fold. Finally, we report the average test accuracy across all the 10 folds.
|
| 162 |
+
|
| 163 |
+
OGB. We use GNNs achieving top places on the OGB graph classification leaderboard3 (at the time of submission) as the baselines, including GCN [12], GIN [27], DeeperGCN [67], Deep LRP [39], PNA [68], DGN [33], GINE [69], and PHC-GNN [70]. Note that those high-order GNNs [19–21, 25] are not included here, because despite being theoretically more discriminative, these GNNs are not among the GNNs with the best empirical performance on modern large-scale graph benchmarks, and their $\bar { \mathcal { O } } ( n ^ { 3 } )$ complexity also raises a scalability issue. For NGNN, we use GIN as the base GNN (although GIN is not among the strongest baselines here). Some baselines additionally use the virtual node technique [18, 11, 71], which are marked by $\therefore$ . For NGNN, we search the subgraph height $h$ in $\{ 3 , 4 , 5 \}$ , and the number of layers in $\{ 4 , 5 , 6 \}$ . We train the NGNN models for 100 and 150 epochs for ogbg-molhiv and ogbg-molpcba, respectively, and report the validation and test scores at the best validation epoch. We also find that our models are subject to high performance variance across epochs, likely due to the increased expressiveness. Thus, we save a model checkpoint every 10 epochs, and additionally report the ensemble performance by averaging the predictions from all checkpoints. The final hyperparameter choices and more details about the experimental settings are included in Appendix C. All results are averaged over 10 independent runs.
|
| 164 |
+
|
| 165 |
+
In the following, we uniformly use “Nested GNN” to denote an NGNN model using “GNN” as the base GNN. For example, Nested GIN denotes an NGNN model using GIN [27] as the base GNN. For the NGNN models in QM9, TU and OGB datasets, we augment the initial features of a node with Distance Encoding (DE) [24], which uses the (generalized) distance between a node and the root as its additional feature, due to DE’s successful applications in link-level tasks [44, 46]. Note that such feature augmentation is not applicable to the baseline models as discussed in Section 3.2. An ablation study on the effects of the DE features is included in Appendix E.
|
| 166 |
+
|
| 167 |
+
# 5.3 Results and discussion
|
| 168 |
+
|
| 169 |
+
To answer Q1, we first run a simulation to test NGNN’s power for discriminating $r$ -regular graphs. The results are presented in Appendix D. They match almost perfectly with Theorem 1, demonstrating that a practical NGNN can fulfil its theoretical power for discriminating $r$ -regular graphs.
|
| 170 |
+
|
| 171 |
+
Table 2: Results $( \% )$ on EXP.
|
| 172 |
+
|
| 173 |
+
<table><tr><td>Method</td><td>Test Accuracy</td></tr><tr><td>GCN-RNI [42]</td><td>98.0±1.85</td></tr><tr><td>PPGN [20]</td><td>50.0±0.00</td></tr><tr><td>1-2-3-GNN [19]</td><td>50.0±0.00</td></tr><tr><td>3-GCN[42]</td><td>99.7±0.004</td></tr><tr><td>Nested GIN</td><td>99.9±0.26</td></tr></table>
|
| 174 |
+
|
| 175 |
+
We also test NGNN’s expressive power using the EXP dataset provided by [42], which contains 600 carefully constructed 1-WL indistinguishable but non-isomorphic graph pairs. Each pair of graphs have different labels, thus a standard message passing GNN cannot predict them both correctly, resulting in an expected classification accuracy of only $50 \%$ . We exactly follow the experimental settings and copy the baseline results in [42]. In Table 2, our Nested GIN model achieves a $9 9 . 9 \%$ classification accuracy, which outperforms all the baselines and distinguishes almost all the 1-WL indistinguishable graph pairs. These results verified that NGNN’s expressive power is indeed beyond 1-WL and message passing GNNs.
|
| 176 |
+
|
| 177 |
+
To answer Q2, we adopt the QM9 and TU datasets. We show the QM9 results in Table 3. If the Nested version of a base GNN achieves a better result than the base GNN itself, we color that cell with light green. As we can see, NGNN brings performance gains to all base GNNs on most targets, sometimes by large margins. We also show the results on TU in Table 4. NGNNs also show improvement over their base GNNs in most cases. These results indicate that NGNN is a general framework for improving a GNN’s power. We further compute the maximum reduction of MAE for QM9 and maximum improvement of accuracy for TU before and after applying NGNN. NGNN reduces the MAE by up to 7.9 times for QM9, and increases the accuracy by up to $1 4 . 3 \%$ for TU. These results answer Q2, indicating that NGNN can bring steady and significant improvement to base GNNs.
|
| 178 |
+
|
| 179 |
+
To answer Q3, we compare Nested GIN with leading methods on the OGB leaderboard. The results are shown in Table 5. Nested GIN achieves highly competitive performance with these leading GNN models, albeit using a relatively weak base GNN (GIN). Compared to GIN alone, Nested GIN shows clear performance gains. It achieves test scores up to 79.86 and 30.07 on ogbg-molhiv and ogbg-molpcba, respectively, which outperform all the baselines. In particular, for the challenging ogbg-molpcba, our Nested GIN can achieve 30.07 and 28.32 test AP with and without ensemble, respectively, outperforming the plain GIN model (with 27.03 test AP) significantly. These results demonstrate the great empirical performance and potential of NGNN even compared to heavily tuned open leaderboard models, despite using only GIN as the base GNN.
|
| 180 |
+
|
| 181 |
+
Table 3: MAE results on QM9 (smaller the better). A colored cell means NGNN is better than the base GNN.
|
| 182 |
+
|
| 183 |
+
<table><tr><td rowspan="2">Target</td><td colspan="10">Method (Ne. forNested)</td></tr><tr><td>DTNN</td><td>MPNN</td><td>Deep LRP</td><td>1-GNN1-2-GNN</td><td></td><td>1-3-GNN</td><td></td><td></td><td></td><td></td><td></td><td>1-2-3-GNN|Ne.1-GNN Ne.1-2-GNN Ne.1-3-GNN Ne.1-2-3-GNN|Max.reduction</td></tr><tr><td>μ</td><td>0.244</td><td>0.358</td><td>0.364</td><td>0.493</td><td>0.493</td><td>0.473</td><td>0.476</td><td>0.428</td><td>0.437</td><td>0.436</td><td>0.433</td><td>1.2×</td></tr><tr><td>α</td><td>0.95</td><td>0.89</td><td>0.298</td><td>0.78</td><td>0.27</td><td>0.46</td><td>0.27</td><td>0.29</td><td>0.278</td><td>0.261</td><td>0.265</td><td>2.7×</td></tr><tr><td>εHOMO</td><td>0.00388</td><td>0.00541</td><td>0.00254</td><td>0.00321</td><td>0.00331</td><td>0.00328</td><td>0.00337</td><td>0.00265</td><td>0.00275</td><td>0.00265</td><td>0.00279</td><td>1.2×</td></tr><tr><td>εLUMO</td><td>0.00512</td><td>0.00623</td><td>0.00277</td><td>0.00355</td><td>0.00350</td><td>0.00354</td><td>0.00351</td><td>0.00297</td><td>0.00271</td><td>0.00269</td><td>0.00276</td><td>1.3×</td></tr><tr><td>△</td><td>0.0112</td><td>0.0066</td><td>0.00353</td><td>0.0049</td><td>0.0047</td><td>0.0046</td><td>0.0048</td><td>0.0038</td><td>0.0039</td><td>0.0039</td><td>0.0039</td><td>1.8×</td></tr><tr><td>(R²)</td><td>17.0</td><td>28.5</td><td>19.3</td><td>34.1</td><td>21.5</td><td>25.8</td><td>22.9</td><td>20.5</td><td>20.4</td><td>20.2</td><td>20.1</td><td>1.7×</td></tr><tr><td>ZPVE</td><td>0.00172</td><td>0.00216</td><td>0.00055</td><td>0.00124</td><td>0.00018</td><td>0.00064</td><td>0.00019</td><td>0.00020</td><td>0.00017</td><td>0.00017</td><td>0.00015</td><td>6.2×</td></tr><tr><td>Uo</td><td>2.43</td><td>2.05</td><td>0.413</td><td>2.32</td><td>0.0357</td><td>0.6855</td><td>0.0427</td><td>0.295</td><td>0.252</td><td>0.291</td><td>0.205</td><td>7.9×</td></tr><tr><td>U</td><td>2.43</td><td>2.00</td><td>0.413</td><td>2.08</td><td>0.107</td><td>0.686</td><td>0.111</td><td>0.361</td><td>0.265</td><td>0.278</td><td>0.200</td><td>5.8×</td></tr><tr><td>H</td><td>2.43</td><td>2.02</td><td>0.413</td><td>2.23</td><td>0.070</td><td>0.794</td><td>0.0419</td><td>0.305</td><td>0.241</td><td>0.267</td><td>0.249</td><td>7.3×</td></tr><tr><td>G</td><td>2.43</td><td>2.02</td><td>0.413</td><td>1.94</td><td>0.140</td><td>0.587</td><td>0.0469</td><td>0.489</td><td>0.272</td><td>0.287</td><td>0.253</td><td>4.0×</td></tr><tr><td>C</td><td>0.27</td><td>0.42</td><td>0.129</td><td>0.27</td><td>0.0989</td><td>0.158</td><td>0.0944</td><td>0.174</td><td>0.0891</td><td>0.0879</td><td>0.0811</td><td>1.8×</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 4: Accuracy results $( \% )$ on TU datasets.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>#Graphs</td><td>D&D 1178</td><td>MUTAG 188</td><td>PROTEINS 1113</td><td>PTC_MR 344</td><td>ENZYMES 600</td></tr><tr><td>Avg. #nodes</td><td>284.32</td><td>17.93</td><td>39.06</td><td>14.29</td><td>32.63</td></tr><tr><td>GCN GraphSAGE</td><td>71.6±2.8 71.6±3.0</td><td>73.4±10.8</td><td>71.7±4.7</td><td>56.4±7.1 57.0±5.5</td><td>27.3±5.5 30.7±6.3</td></tr><tr><td></td><td>70.5±3.9</td><td>74.0±8.8</td><td>71.2±5.2</td><td></td><td></td></tr><tr><td>GIN GAT</td><td>71.0±4.4</td><td>84.5±8.9 73.9±10.7</td><td>70.6±4.3 72.0±3.3</td><td>51.2±9.2 57.0±7.3</td><td>38.3±6.4 30.2±4.2</td></tr><tr><td>Nested GCN</td><td>76.3±3.8</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>77.4±4.2</td><td>82.9±11.1</td><td>73.3±4.0</td><td>57.3±7.7</td><td>31.2±6.7</td></tr><tr><td>Nested GraphSAGE Nested GIN</td><td>77.8±3.9</td><td>83.9±10.7 87.9±8.2</td><td>74.2±3.7 73.9±5.1</td><td>57.0±5.9 54.1±7.7</td><td>30.7±6.3 29.0±8.0</td></tr><tr><td>Nested GAT</td><td>76.0±4.4</td><td>81.9±10.2</td><td>73.7±4.8</td><td>56.7±8.1</td><td>29.5±5.7</td></tr><tr><td>Max. improvement</td><td>10.4%</td><td>13.4%</td><td>4.7%</td><td>5.7%</td><td>14.3%</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 5: Results $( \% )$ on OGB datasets (\* virtual node).
|
| 190 |
+
|
| 191 |
+
<table><tr><td></td><td colspan="2">ogbg-molhiv (AUC)</td><td colspan="2">ogbg-molpcba (AP)</td></tr><tr><td>Method</td><td>Validation</td><td>Test</td><td>Validation</td><td>Test</td></tr><tr><td>CCN*</td><td>83.84±0.91</td><td>75.99±1.19</td><td>24.95±0.42</td><td>24.24±0.34</td></tr><tr><td>GIN*</td><td>84.79±0.68</td><td>77.07±1.49</td><td>27.98±0.25</td><td>27.03±0.23</td></tr><tr><td>Deep LRP</td><td>82.09±1.16</td><td>77.19±1.40</td><td></td><td></td></tr><tr><td>DeeperGCN*</td><td></td><td></td><td>29.20±0.25</td><td>27.81±0.38</td></tr><tr><td>HIMP</td><td></td><td>78.80±0.82</td><td></td><td></td></tr><tr><td>PNA</td><td>85.19±0.99</td><td>79.05±1.32</td><td></td><td></td></tr><tr><td>DGN</td><td>84.70±0.47</td><td>79.70±0.97-</td><td></td><td></td></tr><tr><td>GINE*</td><td></td><td></td><td>30.65±0.30</td><td>29.17±0.15</td></tr><tr><td>PHC-GNN</td><td>82.17±0.89</td><td>79.34±1.16</td><td>30.68±0.25</td><td>29.47±0.26</td></tr><tr><td>Nested GIN*</td><td>83.17±1.99</td><td>78.34±1.86</td><td>29.15±0.35</td><td>28.32±0.41</td></tr><tr><td>NestedGIN* (ens)</td><td>80.80±2.78</td><td>79.86±1.05</td><td>30.59±0.56</td><td>30.07±0.37</td></tr></table>
|
| 192 |
+
|
| 193 |
+
To answer Q4, we report the training time per epoch for GIN and Nested GIN on OGB datasets. On ogbg-molhiv, GIN takes 54s per epoch, while Nested GIN takes 183s. On ogbg-molpcba, GIN takes 10min per epoch, while Nested GIN takes $2 0 \mathrm { { m i n } }$ . This verifies that NGNN has comparable time complexity with message passing GNNs. The extra complexity comes from independently learning better node representations from rooted subgraphs, which is a trade-off for the higher expressivity.
|
| 194 |
+
|
| 195 |
+
In summary, our experiments have firmly shown that NGNN is a theoretically sound method which brings consistent gains to its base GNNs in a plug-and-play way. Furthermore, NGNN still maintains a controllable time complexity compared to other more powerful GNNs.
|
| 196 |
+
|
| 197 |
+
Finally, we point out one memory limitation of the current NGNN implementation. Currently, NGNN does not scale to graph datasets with a large average node number (such as REDDIT-BINARY) or datasets with a large average node degree (such as ogbg-ppa) due to copying a rooted subgraph for each node to the GPU memory. Reducing batch size or subgraph height helps, but at the same time leads to performance degradation. One may wonder why materializing all the subgraphs into GPU memory is necessary. The reason is that we want to batch-process all the subgraphs simultaneously. Otherwise, we have to sequentially extract subgraphs on the fly, which results in a much higher latency. We leave the exploration of memory efficient NGNN to the future work.
|
| 198 |
+
|
| 199 |
+
# 6 Conclusions
|
| 200 |
+
|
| 201 |
+
We have proposed Nested Graph Neural Network (NGNN), a general framework for improving GNN’s representation power. NGNN learns node representations encoding rooted subgraphs instead of rooted subtrees. Theoretically, we prove NGNN can discriminate almost all $r$ -regular graphs where 1-WL always fails. Empirically, NGNN consistently improves the performance of various base GNNs across different datasets without incurring the $\mathcal { O } ( \bar { n } ^ { 3 } )$ complexity like other more powerful GNNs.
|
| 202 |
+
|
| 203 |
+
# Acknowledge
|
| 204 |
+
|
| 205 |
+
The authors greatly thank the actionable suggestions from the reviewers to improve the manuscript. Li is partly supported by the 2021 JP Morgan Faculty Award and the National Science Foundation (NSF) award HDR-2117997.
|
| 206 |
+
|
| 207 |
+
References
|
| 208 |
+
[1] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 701–710. ACM, 2014.
|
| 209 |
+
[2] David Haussler. Convolution kernels on discrete structures. Technical report, Citeseer, 1999.
|
| 210 |
+
[3] Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten M Borgwardt. Efficient graphlet kernels for large graph comparison. In AISTATS, volume 5, pages 488–495, 2009.
|
| 211 |
+
[4] Risi Kondor, Nino Shervashidze, and Karsten M Borgwardt. The graphlet spectrum. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 529–536. ACM, 2009.
|
| 212 |
+
[5] Karsten M Borgwardt and Hans-Peter Kriegel. Shortest-path kernels on graphs. In 5th IEEE International Conference on Data Mining, pages 8–pp. IEEE, 2005.
|
| 213 |
+
[6] Marion Neumann, Roman Garnett, Christian Bauckhage, and Kristian Kersting. Propagation kernels: efficient graph kernels from propagated information. Machine Learning, 102(2): 209–245, 2016.
|
| 214 |
+
[7] Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep): 2539–2561, 2011.
|
| 215 |
+
[8] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009.
|
| 216 |
+
[9] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 217 |
+
[10] David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pages 2224– 2232, 2015.
|
| 218 |
+
[11] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 219 |
+
[12] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 220 |
+
[13] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pages 3837–3845, 2016.
|
| 221 |
+
[14] Hanjun Dai, Bo Dai, and Le Song. Discriminative embeddings of latent variable models for structured data. In Proceedings of The 33rd International Conference on Machine Learning, pages 2702–2711, 2016.
|
| 222 |
+
[15] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 223 |
+
[16] Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In AAAI, pages 4438–4445, 2018.
|
| 224 |
+
[17] Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in Neural Information Processing Systems, pages 4800–4810, 2018.
|
| 225 |
+
[18] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1263–1272. JMLR. org, 2017.
|
| 226 |
+
|
| 227 |
+
[19] Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4602–4609, 2019.
|
| 228 |
+
|
| 229 |
+
[20] Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. In Advances in Neural Information Processing Systems, pages 2156–2167, 2019.
|
| 230 |
+
|
| 231 |
+
[21] Zhengdao Chen, Soledad Villar, Lei Chen, and Joan Bruna. On the equivalence between graph isomorphism testing and function approximation with gnns. In Advances in Neural Information Processing Systems, pages 15894–15902, 2019.
|
| 232 |
+
|
| 233 |
+
[22] Boris Weisfeiler and AA Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12–16, 1968.
|
| 234 |
+
|
| 235 |
+
[23] S Vichy N Vishwanathan, Nicol N Schraudolph, Risi Kondor, and Karsten M Borgwardt. Graph kernels. Journal of Machine Learning Research, 11(Apr):1201–1242, 2010.
|
| 236 |
+
|
| 237 |
+
[24] Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding–design provably more powerful gnns for structural representation learning. arXiv preprint arXiv:2009.00142, 2020.
|
| 238 |
+
|
| 239 |
+
[25] Christopher Morris, Gaurav Rattan, and Petra Mutzel. Weisfeiler and leman go sparse: Towards scalable higher-order graph embeddings. 2020.
|
| 240 |
+
|
| 241 |
+
[26] Muhan Zhang and Yixin Chen. Weisfeiler-lehman neural machine for link prediction. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 575–583. ACM, 2017.
|
| 242 |
+
|
| 243 |
+
[27] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 244 |
+
|
| 245 |
+
[28] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pages 3391–3401, 2017.
|
| 246 |
+
|
| 247 |
+
[29] Andries E Brouwer and Willem H Haemers. Strongly regular graphs. In Spectra of Graphs, pages 115–149. Springer, 2012.
|
| 248 |
+
|
| 249 |
+
[30] Ryan Murphy, Balasubramaniam Srinivasan, Vinayak Rao, and Bruno Ribeiro. Relational pooling for graph representations. In International Conference on Machine Learning, pages 4663–4673. PMLR, 2019.
|
| 250 |
+
|
| 251 |
+
[31] Giorgos Bouritsas, Fabrizio Frasca, Stefanos Zafeiriou, and Michael M Bronstein. Improving graph neural network expressivity via subgraph isomorphism counting. arXiv preprint arXiv:2006.09252, 2020.
|
| 252 |
+
|
| 253 |
+
[32] Jiaxuan You, Jonathan Gomes-Selman, Rex Ying, and Jure Leskovec. Identity-aware graph neural networks. arXiv preprint arXiv:2101.10320, 2021.
|
| 254 |
+
|
| 255 |
+
[33] Dominique Beaini, Saro Passaro, Vincent Létourneau, William L Hamilton, Gabriele Corso, and Pietro Liò. Directional graph networks. arXiv preprint arXiv:2010.02863, 2020.
|
| 256 |
+
|
| 257 |
+
[34] Haggai Maron, Heli Ben-Hamu, Nadav Shamir, and Yaron Lipman. Invariant and equivariant graph networks. arXiv preprint arXiv:1812.09902, 2018.
|
| 258 |
+
|
| 259 |
+
[35] Haggai Maron, Ethan Fetaya, Nimrod Segol, and Yaron Lipman. On the universality of invariant networks. In International conference on machine learning, pages 4363–4371. PMLR, 2019.
|
| 260 |
+
|
| 261 |
+
[36] Nicolas Keriven and Gabriel Peyré. Universal invariant and equivariant graph neural networks. arXiv preprint arXiv:1905.04943, 2019.
|
| 262 |
+
|
| 263 |
+
[37] Waïss Azizian and Marc Lelarge. Characterizing the expressive power of invariant and equivariant graph neural networks. arXiv preprint arXiv:2006.15646, 2020.
|
| 264 |
+
|
| 265 |
+
[38] George Dasoulas, Ludovic Dos Santos, Kevin Scaman, and Aladin Virmaux. Coloring graph neural networks for node disambiguation. arXiv preprint arXiv:1912.06058, 2019.
|
| 266 |
+
|
| 267 |
+
[39] Zhengdao Chen, Lei Chen, Soledad Villar, and Joan Bruna. Can graph neural networks count substructures? Advances in neural information processing systems, 2020.
|
| 268 |
+
|
| 269 |
+
[40] Andreas Loukas. What graph neural networks cannot learn: depth vs width. arXiv preprint arXiv:1907.03199, 2019.
|
| 270 |
+
|
| 271 |
+
[41] Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Random features strengthen graph neural networks. arXiv preprint arXiv:2002.03155, 2020.
|
| 272 |
+
|
| 273 |
+
[42] Ralph Abboud, ˙Ismail ˙Ilkan Ceylan, Martin Grohe, and Thomas Lukasiewicz. The surprising power of graph neural networks with random node initialization. arXiv preprint arXiv:2010.01179, 2020.
|
| 274 |
+
|
| 275 |
+
[43] Clément Vignac, Andreas Loukas, and Pascal Frossard. Building powerful and equivariant graph neural networks with structural message-passing. arXiv e-prints, pages arXiv–2006, 2020.
|
| 276 |
+
|
| 277 |
+
[44] Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pages 5165–5175, 2018.
|
| 278 |
+
|
| 279 |
+
[45] Muhan Zhang, Pan Li, Yinglong Xia, Kai Wang, and Long Jin. Revisiting graph neural networks for link prediction. arXiv preprint arXiv:2010.16103, 2020.
|
| 280 |
+
|
| 281 |
+
[46] Muhan Zhang and Yixin Chen. Inductive matrix completion based on graph neural networks. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id $\equiv$ ByxxgCEYDS.
|
| 282 |
+
|
| 283 |
+
[47] Pim de Haan, Taco Cohen, and Max Welling. Natural graph networks. arXiv preprint arXiv:2007.08349, 2020.
|
| 284 |
+
|
| 285 |
+
[48] Giannis Nikolentzos, George Dasoulas, and Michalis Vazirgiannis. k-hop graph neural networks. Neural Networks, 130:195–205, 2020.
|
| 286 |
+
|
| 287 |
+
[49] Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In international conference on machine learning, pages 21–29. PMLR, 2019.
|
| 288 |
+
|
| 289 |
+
[50] Kexin Huang and Marinka Zitnik. Graph meta learning via local subgraphs. Advances in Neural Information Processing Systems, 33, 2020.
|
| 290 |
+
|
| 291 |
+
[51] Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 292 |
+
|
| 293 |
+
[52] Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1(1):1–7, 2014.
|
| 294 |
+
|
| 295 |
+
[53] Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S Pappu, Karl Leswing, and Vijay Pande. Moleculenet: a benchmark for molecular machine learning. Chemical science, 9(2):513–530, 2018.
|
| 296 |
+
|
| 297 |
+
[54] Kristian Kersting, Nils M. Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark data sets for graph kernels, 2016. URL http://graphkernels.cs. tu-dortmund.de.
|
| 298 |
+
|
| 299 |
+
[55] Paul D Dobson and Andrew J Doig. Distinguishing enzyme structures from non-enzymes without alignments. Journal of molecular biology, 330(4):771–783, 2003.
|
| 300 |
+
|
| 301 |
+
[56] Asim Kumar Debnath, de Compadre RL Lopez, Gargi Debnath, Alan J Shusterman, and Corwin Hansch. Structure-activity relationship of mutagenic aromatic and heteroaromatic nitro compounds. correlation with molecular orbital energies and hydrophobicity. Journal of medicinal chemistry, 34(2):786–797, 1991.
|
| 302 |
+
[57] Hannu Toivonen, Ashwin Srinivasan, Ross D King, Stefan Kramer, and Christoph Helma. Statistical evaluation of the predictive toxicology challenge 2000–2001. Bioinformatics, 19(10): 1183–1193, 2003.
|
| 303 |
+
[58] Ida Schomburg, Antje Chang, Christian Ebeling, Marion Gremse, Christian Heldt, Gregor Huhn, and Dietmar Schomburg. Brenda, the enzyme database: updates and major new developments. Nucleic acids research, 32(suppl_1):D431–D433, 2004.
|
| 304 |
+
[59] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 305 |
+
[60] Brandon Anderson, Truong-Son Hy, and Risi Kondor. Cormorant: Covariant molecular neural networks. arXiv preprint arXiv:1906.04015, 2019.
|
| 306 |
+
[61] Johannes Klicpera, Janek Groß, and Stephan Günnemann. Directional message passing for molecular graphs. arXiv preprint arXiv:2003.03123, 2020.
|
| 307 |
+
[62] Zhuoran Qiao, Matthew Welborn, Animashree Anandkumar, Frederick R Manby, and Thomas F Miller III. Orbnet: Deep learning for quantum chemistry using symmetry-adapted atomic-orbital features. The Journal of Chemical Physics, 153(12):124111, 2020.
|
| 308 |
+
[63] Hanqing Zeng, Muhan Zhang, Yinglong Xia, Ajitesh Srivastava, Andrey Malevich, Rajgopal Kannan, Viktor Prasanna, Long Jin, and Ren Chen. Deep graph neural networks with shallow subgraph samplers. arXiv preprint arXiv:2012.01380, 2020.
|
| 309 |
+
[64] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pages 1025–1035, 2017.
|
| 310 |
+
[65] Federico Errica, Marco Podda, Davide Bacciu, and Alessio Micheli. A fair comparison of graph neural networks for graph classification. arXiv preprint arXiv:1912.09893, 2019.
|
| 311 |
+
[66] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
|
| 312 |
+
[67] Guohao Li, Chenxin Xiong, Ali Thabet, and Bernard Ghanem. Deepergcn: All you need to train deeper gcns. arXiv preprint arXiv:2006.07739, 2020.
|
| 313 |
+
[68] Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Velickovi ˇ c. Principal ´ neighbourhood aggregation for graph nets. arXiv preprint arXiv:2004.05718, 2020.
|
| 314 |
+
[69] Rémy Brossard, Oriel Frigo, and David Dehaene. Graph convolutions that can finally model local structure. arXiv preprint arXiv:2011.15069, 2020.
|
| 315 |
+
[70] Tuan Le, Marco Bertolini, Frank Noé, and Djork-Arné Clevert. Parameterized hypercomplex graph neural networks for graph classification. arXiv preprint arXiv:2103.16584, 2021.
|
| 316 |
+
[71] Katsuhiko Ishiguro, Shin-ichi Maeda, and Masanori Koyama. Graph warp module: an auxiliary module for boosting the power of graph neural networks. arXiv preprint arXiv:1902.01020, 2019.
|
| 317 |
+
[72] Hongyang Gao and Shuiwang Ji. Graph u-nets. arXiv preprint arXiv:1905.05178, 2019.
|
| 318 |
+
[73] Douglas J Klein and Milan Randic. Resistance distance. ´ Journal of Mathematical Chemistry, 12(1):81–95, 1993.
|
md/train/8q_ca26L1fz/8q_ca26L1fz.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REVISITING GRAPH NEURAL NETWORKS FOR LINK PREDICTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Graph neural networks (GNNs) have achieved great success in recent years. Three most common applications include node classification, link prediction, and graph classification. While there is rich literature on node classification and graph classification, GNNs for link prediction is relatively less studied and less understood. Two representative classes of methods exist: GAE and SEAL. GAE (Graph Autoencoder) first uses a GNN to learn node embeddings for all nodes, and then aggregates the embeddings of the source and target nodes as their link representation. SEAL extracts a subgraph around the source and target nodes, labels the nodes in the subgraph, and then uses a GNN to learn a link representation from the labeled subgraph. In this paper, we thoroughly discuss the differences between these two classes of methods, and conclude that simply aggregating node embeddings does not lead to effective link representations, while learning from properly labeled subgraphs around links provides highly expressive and generalizable link representations. Experiments on the recent large-scale OGB link prediction datasets show that SEAL has up to $19 5 \%$ performance gains over GAE methods, achieving new state-of-the-art results on 3 out of 4 datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Link prediction is to predict potential or missing links connecting pairwise nodes in a network. It has wide applications in various fields, such as friend recommendation in social networks (Adamic & Adar, 2003), movie recommendation in Netflix (Bennett et al., 2007), protein-protein interaction prediction (Qi et al., 2006), and knowledge graph completion (Nickel et al., 2015), etc.
|
| 12 |
+
|
| 13 |
+
Traditional link prediction approaches include heuristic methods, embedding methods, and featurebased methods. Heuristic methods compute some heuristic node similarity scores as the likelihood of links (Liben-Nowell & Kleinberg, 2007), such as common neighbors, preferential attachment (Barabasi & Albert, 1999), and Katz index (Katz, 1953), which can be regarded as some ´ predefined graph structure features. Embedding methods, including matrix factorization (MF) and Node2vec (Grover & Leskovec, 2016), learn free-parameter node embeddings from the observed network transductively, thus do not generalize to unseen nodes and networks. Feature-based methods only use explicit node features yet do not consider the graph structure. Recently, graph neural networks (GNNs) emerged to be powerful tools for learning over graph-structured data (Scarselli et al., 2009; Bruna et al., 2013; Duvenaud et al., 2015; Li et al., 2015; Kipf & Welling, 2016a; Niepert et al., 2016; Dai et al., 2016), and have been successfully used in link prediction as well (Kipf & Welling, 2016b; Zhang & Chen, 2018; You et al., 2019; Chami et al., 2019; Li et al., 2020).
|
| 14 |
+
|
| 15 |
+
There are two main types of GNN-based link prediction methods. One is Graph Autoencoder (Kipf & Welling, 2016b), where a GNN is first applied to the entire network to learn an embedding vector for each node. Then the embeddings of the source and target nodes are aggregated to predict the target link. The second type is SEAL (Zhang & Chen, 2018; Li et al., 2020), where an enclosing subgraph is extracted around each target link. Then the nodes in each enclosing subgraph are labeled differently according to their distances to the source and target nodes. Finally a GNN is applied to each enclosing subgraph to learn a link representation for link prediction. At first glance, both methods seem to learn graph structure features associated with the target link, and leverage these structure features for link prediction. However, as we will see, the two methods have fundamentally different power in terms of learning the structural representations of links.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: The structural roles of link $( v _ { 1 } , v _ { 2 } )$ and link $( v _ { 1 } , v _ { 3 } )$ are different, but GAE will assign equal probabilities to them.
|
| 19 |
+
|
| 20 |
+
We first show that by individually learning source and target node embeddings, GAE methods cannot differentiate links with different structural roles. To intuitively understand this, we give an example in Figure 1. In this graph, nodes $v _ { 2 }$ and $v _ { 3 }$ have the same structural roles (symmetric/isomorphic to each other). A GAE will learn the same node embeddings for $v _ { 2 }$ and $v _ { 3 }$ , thus giving the same predicted probabilities for link $( v _ { 1 } , v _ { 2 } )$ and link $( v _ { 1 } , v _ { 3 } )$ . However, the structural roles of link $( v _ { 1 } , v _ { 2 } )$ and link $( v _ { 1 } , v _ { 3 } )$ are apparently different – $v _ { 1 }$ intuitively should have unequal probabilities connecting to $v _ { 2 }$ and $v _ { 3 }$ . Next, we propose a labeling trick, which gives a label to each node as its additional feature, where the source and target nodes are labeled differently from the rest. We show that combined with the labeling trick, a sufficiently expressive GNN can learn the same representations for two links if and only if their structural roles are the same within the graph. This way, $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ will be predicted differently in Figure 1. We further show that SEAL is such an example. Finally, we give a more practical definition of isomorphism, called local isomorphism, which defines two nodes/links as isomorphic if their local neighborhood subgraphs are isomorphic. We argue that GNNs for link prediction should target on local-isomorphism-discriminating.
|
| 21 |
+
|
| 22 |
+
We conduct a thorough comparison among different link prediction methods, including SEAL and various GAE and embedding methods, on the recent large-scale Open Graph Benchmark (OGB) datasets (Hu et al., 2020). We show that SEAL with the labeling trick has up to $19 5 \%$ higher Hits $@ 1 0 0$ than GAE methods, achieving new state-of-the-art results on 3 out of 4 datasets.
|
| 23 |
+
|
| 24 |
+
# 2 PRELIMINARIES
|
| 25 |
+
|
| 26 |
+
In this section, we formally define the notions of graph, permutation, isomorphism, and GNN.
|
| 27 |
+
|
| 28 |
+
Definition 1. (Graph). We consider an undirected graph $\mathcal { G } = ( V , E , \pmb { \Delta } )$ , where $V = \{ 1 , 2 , \dots , n \}$ is the set of n vertices, $E \subseteq V \times V$ is the set of edges, and $\pmb { \mathsf { A } } \in \mathbb { R } ^ { n \times n \times k }$ contains the node and edge features with its diagonal components $\mathsf { \pmb { A } } _ { i , i } ,$ : denoting node attributes and off-diagonal components $\mathsf { \pmb { A } } _ { i , j } ,$ : denoting edge attributes. We further use $\pmb { A } \in \mathsf { \bar { \{ 0 , 1 \} } } ^ { n \times n }$ to denote the adjacency matrix of $\mathcal { G }$ with $A _ { i , j } = 1$ iff $( i , j ) \in E$ . If there are no node/edge features, we let $\pmb { \mathsf { A } } = \pmb { A }$ . Otherwise, $\pmb { A }$ can be regarded as the first slice of $\pmb { \mathsf { A } }$ , i.e., $A = \pmb { \mathsf { A } } _ { : , : , 1 }$ .
|
| 29 |
+
|
| 30 |
+
Definition 2. (Permutation) $A$ node permutation $\pi$ is a bijective mapping from $\{ 1 , 2 , \ldots , n \}$ to $\{ 1 , 2 , \ldots , n \}$ . All $n$ ! possible $\pi$ ’s constitute the permutation group $\Pi _ { n }$ . We define $\pi ( S ) = \{ \pi ( i ) | i \in$ $S \}$ when $S$ is a subset of $\{ 1 , 2 , \ldots , n \}$ . We further define the permutation of $\pmb { \mathsf { A } }$ as $\pi ( \pmb { \mathsf { A } } )$ , where $\pi ( \pmb { \ A } ) _ { \pi ( i ) , \pi ( j ) , : } = \pmb { \ A } _ { i , j , : }$ . In other words, $\pi ( \mathbf { A } ) _ { i , j , : } = \pmb { \Delta } _ { \pi ^ { - 1 } ( i ) , \pi ^ { - 1 } ( j ) , }$ : .
|
| 31 |
+
|
| 32 |
+
Definition 3. (Set isomorphism) Given two $n$ -node graphs $\mathcal { G } = ( V , E , \pmb { \Delta } )$ , $\mathcal { G } ^ { \prime } = ( V ^ { \prime } , E ^ { \prime } , \pmb { \Delta } ^ { \prime } )$ , and two node sets $S \subseteq V$ , $S ^ { \prime } \subseteq V ^ { \prime }$ , we say $( S , \pmb { \mathsf { A } } )$ and $( S ^ { \prime } , { \pmb { \mathsf { A } } } ^ { \prime } )$ are isomorphic (denoted by $( S , \pmb { \mathsf { A } } ) \simeq ( S ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime } ) )$ ) $i f \exists \pi \in \Pi _ { n }$ such that $S = \pi ( S ^ { \prime } )$ and $\pmb { \mathsf { A } } = \pi ( \pmb { \mathsf { A } } ^ { \prime } )$ .
|
| 33 |
+
|
| 34 |
+
When $( V , \pmb { \mathsf { A } } ) \simeq ( V ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime } )$ , we say two graphs $\mathcal { G }$ and $\mathcal { G } ^ { \prime }$ are isomorphic (abbreviated as $\mathsf { \pmb { A } } \simeq \mathsf { \pmb { A } } ^ { \prime }$ because $V = \pi ( V ^ { \prime } )$ for any $\pi$ ). Note that set isomorphism is more strict than graph isomorphism, because it not only requires graph isomorphism, but also requires the permutation maps a specific subset $S$ to another subset $S ^ { \bar { \prime } }$ . When $S \subset V$ and $S ^ { \prime } \subset V ^ { \prime }$ , we are often more concerned with the case of $\pmb { \mathsf { A } } = \pmb { \mathsf { A } } ^ { \prime }$ , where we are to find isomorphic node sets in the same graph (automorphism). For example, when $S = \{ i \} , S ^ { \prime } = \{ j \}$ (single node case) and $( i , \pmb { \mathsf { A } } ) , ( j , \pmb { \mathsf { A } } )$ are isomorphic, it means $i$ and $j$ are on the same orbit of graph $\pmb { \mathsf { A } }$ (i.e., they have symmetric positions/same structural roles within the graph). An example is $v _ { 2 }$ and $v _ { 3 }$ in Figure 1.
|
| 35 |
+
|
| 36 |
+
Definition 4. (Invariant function) A function $f$ defined over the space of $( S , \pmb { \mathsf { A } } )$ is invariant if $\forall \pi \in \Pi _ { n }$ , $f ( S , \mathbf { A } ) = f ( \pi ( S ) , \pi ( \mathbf { A } ) )$ .
|
| 37 |
+
|
| 38 |
+
Definition 5. (GNN) $A$ GNN is an invariant function mapping from the space of $( S , \pmb { \mathsf { A } } )$ to $\mathbb { R } ^ { d }$ . More specifically, a GNN first performs multiple invariant message passing operations to compute a node embedding $z _ { i } = \mathbf { G N N } ( i , \mathbf { A } )$ for all $i \in S$ , and then performs a set aggregation (pooling) over $\{ z _ { i } | i \in S \}$ , written as $\mathrm { A G G } ( \{ z _ { i } | i \in S \} )$ , as the set $S$ ’s representation $\mathrm { G N N } ( S , \pmb { \mathsf { A } } )$ .
|
| 39 |
+
|
| 40 |
+
Note that, when $| S | = 1$ , the set aggregation is often an identity mapping. In graph classification $S = V )$ , we use a graph pooling layer over node embeddings to compute the graph representation.
|
| 41 |
+
|
| 42 |
+
# 3 GAE AND STRUCTURAL LINK REPRESENTATION
|
| 43 |
+
|
| 44 |
+
In this section, we review how GAE methods predict links, and show that simply aggregating node embeddings learned by a GNN cannot lead to effective link representations. We use $\pmb { \mathsf { A } }$ to denote the incomplete network to perform link prediction.
|
| 45 |
+
|
| 46 |
+
# 3.1 GAE FOR LINK PREDICTION
|
| 47 |
+
|
| 48 |
+
Graph Autoencoder (GAE) methods (Kipf & Welling, 2016b) first use a GNN to compute a node embedding $z _ { i }$ for each node $i$ , and then use $f ( z _ { i } , z _ { j } )$ to predict the link $( i , j )$ :
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\hat { A } _ { i , j } = f ( z _ { i } , z _ { j } ) , \mathrm { w h e r e } z _ { i } = \mathrm { G N N } ( i , \mathsf { A } ) , z _ { j } = \mathrm { G N N } ( j , \mathsf { A } )
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\hat { A } _ { i , j }$ is the predicted score for link $( i , j )$ . The model is trained to maximize the likelihood of reconstructing the true adjacency matrix. The original GAE uses a two-layer GCN (Kipf & Welling, 2016a) as the GNN, and let $f ( z _ { i } , z _ { j } ) : = \sigma ( z _ { i } ^ { \top } z _ { j } )$ . In principle, we can replace GCN with any message passing neural network (Gilmer et al., 2017), and use an MLP over the aggregation of $z _ { i }$ and $z _ { j }$ as the $f ( z _ { i } , z _ { j } )$ . Popular aggregation functions include concatenation, mean and Hadamard product, etc. In the following, we will use GAE to denote a general class of GNN-based link prediction methods, without differentiating the specific choices of GNN and $f$ .
|
| 55 |
+
|
| 56 |
+
# 3.2 GAE CAN LEARN STRUCTURAL NODE REPRESENTATIONS
|
| 57 |
+
|
| 58 |
+
Following (Srinivasan & Ribeiro, 2020; Li et al., 2020), we first define most expressive structural representations for nodes and links. Then we relate them to GAE-learned node embeddings and show that GAE is not capable of learning structural link representations.
|
| 59 |
+
|
| 60 |
+
Definition 6. Given an invariant function $\Gamma ( \cdot )$ , $\Gamma ( S , \pmb { \mathsf { A } } )$ is a most expressive structural representation for $( S , \pmb { \mathsf { A } } )$ if $\forall ( S , \pmb { \mathsf { A } } , S ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime } )$ , $\Gamma ( S , \pmb { \mathsf { A } } ) = \Gamma ( S ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime } ) \Leftrightarrow ( S , \pmb { \mathsf { A } } ) \simeq ( S ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime } ) .$ .
|
| 61 |
+
|
| 62 |
+
For simplicity, we will briefly use “structural representation” to denote most expressive structural representation in the rest of the paper. We will omit $\pmb { \mathsf { A } }$ if it is clear from context. We call $\Gamma ( i , \pmb { \mathsf { A } } )$ a structural node representation for $i$ , and call $\Gamma ( \{ i , j \} , \mathbf { A } )$ a structural link representation for $( i , j )$ .
|
| 63 |
+
|
| 64 |
+
The above definition indicates that two node sets have the same structural representations if and only if they are isomorphic to each other. In the same graph $\pmb { \mathsf { A } }$ , structural representations uniquely mark the structural roles of nodes or node sets. This is in contrast to positional node embeddings such as DeepWalk (Perozzi et al., 2014) and matrix factorization (Mnih & Salakhutdinov, 2008), where two isomorphic nodes can have different node embeddings (Ribeiro et al., 2017).
|
| 65 |
+
|
| 66 |
+
So why do we need to define structural representations? From a node classification point of view, it is because two isomorphic nodes in a network are perfectly symmetric to each other, and should be indistinguishable using any labeling functions on graphs (i.e., they should have the same ground truth $y$ ). Learning a structural node representation can guarantee that isomorphic nodes are always classified into the same class.
|
| 67 |
+
|
| 68 |
+
Then, a natural question to ask is, do GNNs learn structural node representations? The answer is no. Recall that $( { \dot { i } } , \mathbf { A } ) \simeq ( j , \mathbf { A } ^ { \prime } ) \Rightarrow \mathbf { A } \simeq \mathbf { A } ^ { \prime }$ . If a GNN can learn structural node representations, we can always use it for graph isomorphism test by checking whether there exist two nodes in two graphs sharing the same structural node representation. In fact, existing GNNs’ graph discriminating power is bounded by the Weisfeiler-Lehman (WL) test (Morris et al., 2019; Maron et al., 2019), which provably fails to distinguish certain non-isomorphic graphs (Cai et al., 1992). Despite this, GNNs/WL are still powerful enough to learn representations that can distinguish almost all nonisomorphic nodes and graphs (Babai & Kucera, 1979).
|
| 69 |
+
|
| 70 |
+
For easy analysis, we assume there exists a node-most-expressive GNN that can output structural node representations thus able to distinguish all non-isomorphic nodes. Despite this, the techniques we will present are not limited to node-most-expressive GNNs, but also benefit practical GNNs.
|
| 71 |
+
|
| 72 |
+
Definition 7. A GNN is node-most-expressive if $\forall ( i , \mathsf { \pmb A } , j , \mathsf { \pmb A } ^ { \prime } )$ , $\mathrm { G N N } ( i , \pmb { \mathsf { A } } ) = \mathrm { G N N } ( j , \pmb { \mathsf { A } } ^ { \prime } ) \Leftrightarrow$ $( i , \mathsf { \pmb A } ) \simeq ( j , \mathsf { \pmb A } ^ { \prime } )$ .
|
| 73 |
+
|
| 74 |
+
Recall that GAE first uses a GNN to compute node embeddings. Therefore, GAE with a node-mostexpressive GNN is able to leverage structural node representations for link prediction.
|
| 75 |
+
|
| 76 |
+
# 3.3 GAE CANNOT LEARN STRUCTURAL LINK REPRESENTATIONS
|
| 77 |
+
|
| 78 |
+
The next question to ask is whether GAE learns structural link representations. That is, does the aggregation of structural node representations of $i$ and $j$ result in a structural link representation of $( i , j ) ^ { \prime }$ ? The answer is no, as shown in previous works (Srinivasan & Ribeiro, 2020; Zhang & Chen, 2020). We have also illustrated it in the introduction. In Figure 1, we have two isomorphic nodes $v _ { 2 }$ and $v _ { 3 }$ , thus $v _ { 2 }$ and $v _ { 3 }$ will have the same structural node representation. By aggregating structural node representations as link representations, GAE will assign $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ the same link representation and predict them to have equal probabilities of forming a link. However, $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ apparently have different structural link representations, which indicates that
|
| 79 |
+
|
| 80 |
+
Proposition 1. Even with a node-most-expressive GNN, GAE cannot learn structural link representations.
|
| 81 |
+
|
| 82 |
+
The root cause of this problem is that GAE learns representations for the source and target nodes individually, without considering their relative positions and associations. For example, although $v _ { 2 }$ and $v _ { 3 }$ are perfectly symmetric in the graph, when considering the source node $v _ { 1 }$ to predict link from, $v _ { 2 }$ and $v _ { 3 }$ ’s positions w.r.t. $v _ { 1 }$ are no longer symmetric.
|
| 83 |
+
|
| 84 |
+
# 4 HOW TO LEARN STRUCTURAL LINK REPRESENTATIONS?
|
| 85 |
+
|
| 86 |
+
In this section, we discuss how to enable GNNs to learn structural link representations with a simple labeling trick, and show that SEAL is a valid example to learn structural link representations.
|
| 87 |
+
|
| 88 |
+
# 4.1 LABELING TRICK
|
| 89 |
+
|
| 90 |
+
We first introduce the labeling trick.
|
| 91 |
+
|
| 92 |
+
Definition 8. (Labeling trick) Given $( S , \pmb { \mathsf { A } } )$ , we stack a diagonal labeling matrix $\pmb { I } ^ { ( S ) } \in \mathbb { R } ^ { n \times n }$ in the third dimension of $\pmb { \mathsf { A } }$ to get a new $\tilde { \textbf { A } } \in \mathbb { R } ^ { n \times n \times ( k + 1 ) }$ , where $\pmb { I }$ satisfies: $\forall \pi \ \in \ \Pi _ { n }$ , (1) $\pmb { I } ^ { ( S ) } = \pi ( \pmb { I } ^ { ( S ^ { \prime } ) } ) \Rightarrow S = \pi ( S ^ { \prime } )$ , and (2) $S = \pi ( S ^ { \prime } ) , \pmb { \mathrm { A } } = \pi ( \pmb { \mathrm { A } } ^ { \prime } ) \Rightarrow \pmb { I } ^ { ( S ) } = \pi ( \pmb { I } ^ { ( S ^ { \prime } ) } )$ . A simplest labeling trick is to let $I _ { i i } ^ { ( S ) } = 1$ if $i \in S$ otherwise $O$ .
|
| 93 |
+
|
| 94 |
+
Note that the notation $\tilde { \pmb { A } }$ should actually depend on $S$ . For convenience, we omit such dependence on $S$ and infer it from the context. The first condition in Definition 8 requires the labeling matrix to identify the target node set $S$ ; and the second condition requires the labeling trick to be permutation equivariant, i.e., when $( S , A )$ and $( S ^ { \prime } , A ^ { \prime } )$ are isomorphic under $\pi$ , the corresponding nodes $i = \pi ( j )$ always have the same label. Essentially, the labeling trick distinguishes nodes in $S$ from the rest nodes. It can be as simple as only giving label 1 to nodes in $S$ and otherwise 0. Next, we show that with the labeling trick, a node-most-expressive GNN can learn structural link representations.
|
| 95 |
+
|
| 96 |
+
Theorem 1. If a GNN is node-most-expressive, then with an injective set aggregation function AGG in Definition 5, $\mathrm { G N N } ( S , { \tilde { \mathbf { A } } } ) = \mathrm { G N N } ( S ^ { \prime } , { \tilde { \mathbf { A } } } ^ { \prime } ) \Leftrightarrow ( S , \mathbf { A } ) \simeq ( S ^ { \prime } , \mathbf { A } ^ { \prime } )$ for any $S , \pmb { \mathsf { A } } , S ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime }$ .
|
| 97 |
+
|
| 98 |
+
We include all the proofs in the appendix. Theorem 1 implies that $\mathbf { G N N } ( S , \tilde { \mathbf { A } } )$ is a structural representation for $( S , \pmb { \mathsf { A } } )$ . Recall Definition 5 defines $\mathrm { G N N } ( S , \tilde { \mathbf { A } } ) = \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ) | i \in S \} )$ ). The above theorem indicates that although directly aggregating structural node representations learned from the original graph $\pmb { \mathsf { A } }$ does not lead to structural link representations, an injective aggregation over the structural node representations learned from the labeled graph $\tilde { \pmb { A } }$ does lead to structural link representations. How intuitively is it possible? Let’s return to the example in Figure 1. When we want to predict link $( v _ { 1 } , v _ { 2 } )$ , we can mark $v _ { 1 } , v _ { 2 }$ with a different label from the rest nodes, as shown by the different color in Figure 2 left. With the source and target nodes labeled, when the GNN is computing $v _ { 2 }$ ’s embedding, it is also “aware” of the source node $v _ { 1 }$ , instead of the previous agnostic way that treats $v _ { 1 }$ the same as other nodes. And when we want to predict link $( v _ { 1 } , v _ { 3 } )$ , we can again mark $v _ { 1 } , v _ { 3 }$ with a different label, as shown in Figure 2 right. This way, $v _ { 2 }$ and $v _ { 3 }$ ’s structural node representations are no longer the same in the two differently labeled graphs because of their different relative positions w.r.t. $v _ { 1 }$ , and we are able to give different predictions to $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ .
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 2: When we predict $( v _ { 1 } , v _ { 2 } )$ , we will label these two nodes differently from the rest, so that a GNN is aware of the target link when computing $v _ { 1 }$ and $v _ { 2 }$ ’s embeddings. Similarly, when predicting $( v _ { 1 } , v _ { 3 } )$ , nodes $v _ { 1 } , v _ { 3 }$ will be labeled differently. The aggregated embedding of $v _ { 1 } , v _ { 2 }$ in the left graph will be different from the aggregated embedding of $v _ { 1 } , v _ { 3 }$ in the right graph, enabling GNNs to predict $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ differently.
|
| 102 |
+
|
| 103 |
+
# 4.2 SEAL CAN LEARN STRUCTURAL LINK REPRESENTATIONS
|
| 104 |
+
|
| 105 |
+
In this section, we will review SEAL (Zhang & Chen, 2018; Li et al., 2020), and show that SEAL exactly uses a valid labeling trick that is able to learn structural link representations.
|
| 106 |
+
|
| 107 |
+
SEAL first extracts an enclosing subgraph ( $h$ -hop ego-network) around the link to predict.
|
| 108 |
+
|
| 109 |
+
Definition 9. (Enclosing subgraph) Given $( S , \pmb { \mathsf { A } } )$ , the $h$ -hop enclosing subgraph ${ \pmb { \mathsf { A } } } _ { S } ^ { ( h ) }$ of $S$ is the subgraph induced from A by $\cup _ { i \in S } \{ j | d ( j , i ) \leq h \}$ , where $d ( j , i )$ is the shortest path distance between nodes $j$ and $i$ .
|
| 110 |
+
|
| 111 |
+
Then, SEAL applies a Double Radius Node Labeling (DRNL) to give an integer label to each node within the enclosing subgraph. DRNL assigns different labels to nodes with different distances w.r.t. both the source and target nodes, where the source and target nodes are always labeled 1, and nodes farther away from the source and target nodes get larger labels (starting from 2). For example, nodes with distances 1 and 1 to the source and target nodes will get label 2, and nodes with distances 1 and 2 to the source and target nodes will get label 3. So on and so forth. Finally the labeled enclosing subgraph is fed to a GNN to learn the link representation and output the probability of link existence.
|
| 112 |
+
|
| 113 |
+
It can be easily proved that DRNL satisfies the definition of the labeling trick, because node distances are invariant under permutation. DRNL not only differentiates the source and target nodes from the rest, but also differentiates nodes of different distances to the source and target nodes. The DRNL-labeled graphs also satisfy Theorem 1 and thus can enable a node-most-expressive GNN to learn structural link representations. Moreover, SEAL’s distance-based node labeling scheme is formalized into distance encoding, or $D E$ , in (Li et al., 2020), which theoretically shows that encoding distances between nodes can increase the representation power of normal GNNs.
|
| 114 |
+
|
| 115 |
+
SEAL only uses a subgraph ${ \pmb { \mathsf { A } } } _ { S } ^ { ( h ) }$ within $h$ hops from the source and target nodes instead of using the whole graph. This is for practical concerns (just like GAE typically uses less than 3 message passing layers in practice), and will be discussed in detail in Section 5. When $h \infty$ , SEAL can also leverage the entire graph and learn structural representations for $( S , \pmb { \mathsf { A } } )$ :
|
| 116 |
+
|
| 117 |
+
Proposition 2. When $h \infty$ , SEAL can learn structural link representations with a node-mostexpressive GNN.
|
| 118 |
+
|
| 119 |
+
Note that although we show a node-most-expressive GNN combining with the labeling trick is able to learn structural link representations, even without a node-most-expressive GNN, the labeling trick can still benefit most link representation learning tasks. For example, in Figure 2, as long as a normal GNN can give different embeddings to $v _ { 2 }$ and $v _ { 3 }$ in the left and right graphs (which is easy for most GNNs), we can still differentiate link $( v _ { 1 } , v _ { 2 } )$ from link $( v _ { 1 } , v _ { 3 } )$ . And this is not possible for GAE.
|
| 120 |
+
|
| 121 |
+
Despite the power, the labeling trick introduces extra computational complexity. The reason is that for every link $( i , j )$ to predict, we need to relabel the graph according to $( i , j )$ . The same node $i$ will be labeled differently depending on the target link, and will be given a different node embedding by the GNN when it appears in different links’ labeled graphs. This is different from GAE, where we do not relabel the graph and each node only has a single embedding vector. For a graph with $n$ nodes and $m$ links to predict, GAE needs to apply the GNN ${ \mathcal { O } } ( n )$ times to compute an embedding for each node, while SEAL needs to apply the GNN $\mathcal { O } ( m )$ times for all links. When $m \gg n$ , SEAL has worse time complexity than GAE, which is a trade-off for learning structural link representations.
|
| 122 |
+
|
| 123 |
+
In the previous analysis, we have assumed there exists a node-most-expressive GNN that can discriminate non-isomorphic nodes. Although a practical GNN can also discriminate almost all nonisomorphic nodes, there is little research discussing how to reach this discriminating power. In this section, we analyze GNNs for link prediction from a more practical point of view.
|
| 124 |
+
|
| 125 |
+
Practical GNNs usually simulate the 1-dimensional Weisfeiler-Lehman (1-WL) test (Weisfeiler & Lehman, 1968) to iteratively update each node’s hidden state by aggregating its neighbors’ states (we call them 1-WL-GNN). One most powerful 1-WL-GNN is the Graph Isomorphism Network (GIN) (Xu et al., 2018), which achieves theoretically the same discriminating power as 1-WL.
|
| 126 |
+
|
| 127 |
+
Although showing 1-WL-GNN’s maximum discriminating power, previous GNN research has not discussed how many message passing layers are required to reach this theoretical power. We therefore introduce the following lemma.
|
| 128 |
+
|
| 129 |
+
Lemma 1. Given a graph with n nodes, a most powerful 1-WL-GNN takes up to ${ \mathcal { O } } ( n )$ message passing layers to discriminate all non-isomorphic nodes that 1-WL can discriminate.
|
| 130 |
+
|
| 131 |
+
Lemma 1 suggests that 1-WL-GNN needs a number of message passing layers of the same order as the number of nodes in the graph to reach its maximum discriminating power. However, practical GNNs usually only use a small number of message passing layers (such as 1 or 2) while still achieving good performance. This perhaps suggests that in practice, we do not necessarily need to find nodes/links that are exactly isomorphic to each other. Instead, nodes/links which are locally isomorphic could even more strongly suggest they should be classified into the same class.
|
| 132 |
+
|
| 133 |
+
Definition 10. (Local $h$ -isomorphism) $\forall ( S , \pmb { \mathsf { A } } , S ^ { \prime } , \pmb { \mathsf { A } } ^ { \prime } )$ , $( S , \pmb { \mathsf { A } } )$ and $( S ^ { \prime } , { \pmb { \mathsf { A } } } ^ { \prime } )$ are locally $h$ -isomorphic to each other if $\mathbf { \Sigma } ( S , \mathbf { A } _ { S } ^ { ( h ) } ) \simeq ( S ^ { \prime } , \mathbf { A ^ { \prime } } _ { S ^ { \prime } } ^ { ( h ) } )$ .
|
| 134 |
+
|
| 135 |
+
For two sets $S , S ^ { \prime }$ , if their tuples with their $h$ -hop enclosing subgraphs $( S , \pmb { \mathsf { A } } _ { S } ^ { ( h ) } )$ and $( S ^ { \prime } , \pmb { A } _ { S ^ { \prime } } ^ { \prime ( h ) } )$ are isomorphic, then we say they are locally -isomorphic. We argue that this is a more useful definition than isomorphism, because isomorphism requires the entire graph looks identical from two sets’ separate views, which is often too strict in practice. If we use the strict definition of isomorphism, we may fail to identify a lot of nodes/links that actually have very similar neighborhood structures. In fact, Babai & Kucera (1979) prove that at least $\left( n - \log n \right)$ nodes in almost all $n$ -node graphs are non-isomorphic to each other. Therefore, it is less meaningful to only assign the same representations to nodes/links when they are strictly isomorphic, and GNNs targeting on isomorphismdiscriminating tend to overfit. In comparison, local $h$ -isomorphism only cares about whether the $h$ -hop neighborhoods are isomorphic, which is more realistic and allows better generalizability.
|
| 136 |
+
|
| 137 |
+
With local $h$ -isomorphism, all our previous conclusions using the standard isomorphism definition still apply. For example, GAE with a node-most-expressive GNN can be used to identify locally $h$ -isomorphic nodes, but cannot discriminate locally $h$ -non-isomorphic links. And a node-mostexpressive GNN with the labeling trick (SEAL) can identify locally $h$ -isomorphic node sets, etc. To enable a GNN to focus on local $h$ -isomorphism-discriminating, all we need to do is to set a boundary between the $h$ -hop enclosing subgraph and the rest of the graph, and apply the GNN only to the extracted subgraph within the boundary (possibly use more than $h$ message passing layers).
|
| 138 |
+
|
| 139 |
+
Finally, we want to answer a question: in what chance node local $h$ -isomorphism also indicates link local $h$ -isomorphism? If in a graph, two nodes being locally $h$ -isomorphic almost always indicates their links with a third node are locally $h$ -isomorphic, then learning structural link representations with SEAL may no longer be necessary, and using GAE to learn structural node representations may already be enough. In other words, we are interested in how often examples like Figure 1 appear in graphs. Fortunately, we have the following theorem, which shows that there are enough links where only identifying locally $h$ -isomorphic nodes is not enough.
|
| 140 |
+
|
| 141 |
+
Theorem 2. In any graphs with n nodes and without node/edge features, if the degree of each node in the graph is between 1 and $\mathcal { O } ( \log ^ { \frac { 1 - \epsilon } { 2 h } } n )$ for any constant $\epsilon > 0$ , then there exists $\omega ( n ^ { 2 \epsilon } )$ many pairs of nodes $u , v$ such that u and $v$ are locally $h$ -isomorphic while there exists another node $w$ such that $( u , w )$ and $( v , w )$ are not locally $h$ -isomorphic.
|
| 142 |
+
|
| 143 |
+
Table 1: Statistics and evaluation metrics of OGB link prediction datasets.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Dataset</td><td>#Nodes</td><td>#Edges</td><td>Avg. node deg.</td><td>Density</td><td>Split ratio</td><td>Metric</td></tr><tr><td>ogbl-ppa</td><td>576,289</td><td>30,326,273</td><td>73.7</td><td>0.018%</td><td>70/20/10</td><td>Hits @100</td></tr><tr><td>ogbl-collab</td><td>235,868</td><td>1,285,465</td><td>8.2</td><td>0.0046%</td><td>92/4/4</td><td>Hits@50</td></tr><tr><td>ogbl-ddi</td><td>4,267</td><td>1,334,889</td><td>500.5</td><td>14.67%</td><td>80/10/10</td><td>Hits @20</td></tr><tr><td>ogbl-citation</td><td>2,927,963</td><td>30,561,187</td><td>20.7</td><td>0.00036%</td><td>98/1/1</td><td>MRR</td></tr></table>
|
| 146 |
+
|
| 147 |
+
# 6 RELATED WORK
|
| 148 |
+
|
| 149 |
+
There are emerging interests in studying the expressive power of graph neural networks recently. Xu et al. (2018) and Morris et al. (2019) first show that the discriminating power of GNNs performing neighbor aggregation is bounded by the 1-WL test. Many works have since been proposed to increase the power of GNNs by simulating higher-order WL tests (Morris et al., 2019; Maron et al., 2019; Chen et al., 2019). However, most previous works focus on improving GNN’s graph representation power. Little work has been done to analyze GNN’s node/link representation power. Srinivasan & Ribeiro (2020) first formally studied the difference between structural representations of nodes and links. Although showing that structural node representations alone cannot perform link prediction, their way of learning structural link representations is to give up GNNs and instead use Monte Carlo samples of node embeddings learned by network embedding methods. In this paper, we show that GNNs combined with a simple labeling trick can as well learn structural link representations, which reassures using GNNs for link prediction.
|
| 150 |
+
|
| 151 |
+
Many works have implicitly assumed that if a model can learn node embeddings well, then combining the pairwise node embeddings can also lead to good link representations (Grover & Leskovec, 2016; Kipf & Welling, 2016b; Hamilton et al., 2017). However, we argue in this paper that by considering the source and target nodes explicitly with the labeling trick, we can aggregate better link representations from node embeddings. Li et al. (2020) studied one particular form of the labeling trick based on distance, and proved that distance encoding can improve 1-WL-GNNs’ expressive power, enabling them to distinguish almost all $( S , \pmb { \mathsf { A } } )$ tuples sampled from r-regular graphs. In this paper, we do not focus on improving 1-WL-GNNs’ expressive power, but focus on how to enable a sufficiently expressive GNN to learn structural link representations in any graphs. We also provide a general definition of the labeling trick, and argue that a labeling trick as simple as only giving the source and target nodes 1 and other nodes 0 suffices to enable structural link representation learning.
|
| 152 |
+
|
| 153 |
+
# 7 EXPERIMENTS
|
| 154 |
+
|
| 155 |
+
In this section, we compare SEAL, GAE methods, and network embedding methods on the Open Graph Benchmark (OGB) (Hu et al., 2020) datasets. We use all the four link prediction datasets in OGB: ogbl-ppa, ogbl-collab, ogbl-ddi, and ogbl-citation. These datasets adopt realistic train/validation/test splitting methods, such as by resource cost in laboratory (ogbl-ppa), by time (ogbl-collab and ogbl-citation), and by drug target in the body (ogbl-ddi). They are also large-scale (up to 2.9M nodes and $3 0 . 6 \mathbf { M }$ edges), open-sourced, and have standard evaluation metrics, thus providing an ideal place to benchmark an algorithm’s realistic link prediction power. The evaluation metrics include Hits $@ K$ and MRR. Hits $@ K$ counts the ratio of positive edges ranked at the K-th place or above against all the negative edges. MRR (Mean Reciprocal Rank) computes the reciprocal rank of the true target node against 1,000 negative candidates, averaged over all the true source nodes. Both metrics are higher the better. The statistics are in Table 1.
|
| 156 |
+
|
| 157 |
+
Baselines. We consider the following representative models. Except SEAL, all models first compute node embeddings from the original graph and use the Hadamard product between pairwise node embeddings as link representations. The link representations are fed to an MLP for final prediction.
|
| 158 |
+
|
| 159 |
+
• MLP: Input node features are directly used as the node embeddings.
|
| 160 |
+
• Node2vec (Perozzi et al., 2014; Grover & Leskovec, 2016): The node embeddings are the concatenation of node features and Node2vec embeddings.
|
| 161 |
+
• MF: Use free-parameter node embeddings trained end-to-end as the node embeddings.
|
| 162 |
+
• GraphSAGE (Hamilton et al., 2017): A GAE method with GraphSAGE as the GNN. • GCN (Kipf & Welling, 2016b): A GAE method with GCN as the GNN.
|
| 163 |
+
• GCN+LRGA (Puny et al., 2020): A GAE method with LRGA-module-enhanced GCN.
|
| 164 |
+
• SEAL (Zhang & Chen, 2018): Learn link representations from labeled subgraphs via a GNN.
|
| 165 |
+
|
| 166 |
+
Table 2: Results for ogbl-ppa, ogbl-collab, ogbl-ddi and ogbl-citation.
|
| 167 |
+
|
| 168 |
+
<table><tr><td></td><td colspan="2">ogbl-ppa Hits @100 (%)</td><td colspan="2">ogbl-collab Hits @50 (%)</td><td colspan="2">ogbl-ddi Hits @20 (%)</td><td colspan="2">ogbl-citation MRR (%)</td></tr><tr><td>Method</td><td>Validation</td><td>Test</td><td>Validation</td><td>Test</td><td>Validation</td><td>Test</td><td>Validation</td><td>Test</td></tr><tr><td>MLP</td><td>0.46±0.00</td><td>0.46±0.00</td><td>24.02±1.45</td><td>19.27±1.29</td><td></td><td></td><td>28.98±0.14</td><td>29.04±0.13</td></tr><tr><td>Node2vec</td><td>22.53±0.88</td><td>22.26±0.88</td><td>57.03±0.52</td><td>48.88±0.54</td><td>32.92±1.21</td><td>23.26±2.09</td><td>59.44±0.11</td><td>59.64±0.11</td></tr><tr><td>MF</td><td>32.28±4.28</td><td>32.29±0.94</td><td>48.96±0.29</td><td>38.86±0.29</td><td>33.70±2.64</td><td>13.68±4.75</td><td>53.11±5.65</td><td>53.16±5.65</td></tr><tr><td>GraphSAGE</td><td>17.24±2.64</td><td>16.55±2.40</td><td>56.88±0.77</td><td>48.10±0.81</td><td>62.62±0.37</td><td>53.90±4.74</td><td>82.17±0.86</td><td>82.28±0.84</td></tr><tr><td>GCN</td><td>18.45±1.40</td><td>18.67±1.32</td><td>52.63±1.15</td><td>44.75±1.07</td><td>55.50±2.08</td><td>37.07±5.07</td><td>84.49±1.08</td><td>84.56±1.10</td></tr><tr><td>GCN+LRGA</td><td>25.75±2.82</td><td>26.12±2.35</td><td>60.88±0.59</td><td>52.21±0.72</td><td>66.75±0.58</td><td>62.30±9.12</td><td>65.05±0.22</td><td>65.05±0.22</td></tr><tr><td>SEAL</td><td>51.25±2.52</td><td>48.80±3.16</td><td>63.89±0.49</td><td>53.71±0.47</td><td>28.49±2.69</td><td>30.56±3.86</td><td>85.09±0.88</td><td>85.27±0.91</td></tr></table>
|
| 169 |
+
|
| 170 |
+
All the GAE methods’ GNNs have 3 message passing layers with 256 hidden dimensions, with a tuned dropout ratio in $\{ 0 , 0 . 5 \}$ . The GNN in SEAL follows the original paper, which has 3 GCN layers with 32 hidden dimensions each, with a tuned subgraph hop $h$ in $\{ 1 , 2 \}$ . The ogbl-ddi graph contains no node features, so MLP is omitted, and the GAE methods here use free-parameter node embeddings as the GNN input node features and trained them together with the GNN parameters. For SEAL, the DRNL node labels are input to an embedding layer and then concatenated with the node features (if any) as the GNN input. More details are in Appendix D.
|
| 171 |
+
|
| 172 |
+
Results and discussion. We compare the baselines’ link prediction performance on ogbl-ppa, ogbl-collab, ogbl-ddi, and ogbl-citation. Among them, ogbl-ppa is a proteinprotein association graph where the task is to predict biologically meaningful associations between proteins. ogbl-collab is an author collaboration graph, where the task is to predict future collaborations. ogbl-ddi is a drug-drug interaction network, where each edge represents an interaction between drugs which indicates the join effect of taking the two drugs together is considerably different from their independent effects. ogbl-citation is a paper citation network, where the task is to predict missing citations. We present the ten-time average results in Table 2. The results show that SEAL achieves the best performance on 3 out of 4 datasets. It outperforms GAE and network embedding methods, sometimes by surprisingly large margins. For example, in the challenging ogbl-ppa graph, SEAL achieves an $\operatorname { H i t s } @ 1 0 0$ of 48.80, which is over $50 \%$ higher than the second-best baseline MF which only has an Hits $@ 1 0 0$ of 32.29. In comparison, all GAE methods achieve Hits $@ 1 0 0$ lower than 30. SEAL has $8 7 \% . 1 9 5 \%$ improvement over GAE methods in this dataset, which demonstrates the superiority of learning structural link representations over structural node representations for link prediction. SEAL also improves the state-of-the-art results for ogbl-collab and ogbl-citation in both validation and test performance.
|
| 173 |
+
|
| 174 |
+
Nevertheless, we observe that SEAL does not perform well on ogbl-ddi. ogbl-ddi is considerably denser than the other graphs. It only has 4,267 nodes, but has 1,334,889 edges, which results in an average node degree of 500.5 and density of $1 4 . 6 7 \%$ . Interestingly, although SEAL is able to beat MF and Node2vec, it falls behind GAE methods with free-parameter node embeddings. One possible reason is that the nodes in ogbl-ddi are so densely connected that a practical GNN with limited expressive power is hard to inductively learn any meaningful structural patterns. In comparison, the free-parameter node embeddings make GAE methods transductive and no longer focus on learning structural patterns, but focus on optimizing node embeddings. An interesting topic is thus how to improve structural representation learning on dense graphs, which we leave for future work.
|
| 175 |
+
|
| 176 |
+
# 8 CONCLUSIONS
|
| 177 |
+
|
| 178 |
+
In this paper, we have revisited the topic of using graph neural networks for link prediction. We reviewed two popular classes of methods, GAE and SEAL. We first showed that GAE methods cannot learn structural link representations by aggregating individually learned node embeddings. We further showed that combining with a simple labeling trick, a node-most-expressive GNN can learn structural link representations, and SEAL is such an example. Experiments on 4 large-scale OGB datasets demonstrate the superiority of learning structural link representations with SEAL.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Lada A Adamic and Eytan Adar. Friends and neighbors on the web. Social networks, 25(3):211–230, 2003.
|
| 183 |
+
|
| 184 |
+
Laszl ´ o Babai and Ludik Kucera. Canonical labelling of graphs in linear average time. In ´ 20th Annual Symposium on Foundations of Computer Science (sfcs 1979), pp. 39–46. IEEE, 1979.
|
| 185 |
+
|
| 186 |
+
Albert-Laszl ´ o Barab ´ asi and R ´ eka Albert. Emergence of scaling in random networks. ´ science, 286 (5439):509–512, 1999.
|
| 187 |
+
|
| 188 |
+
James Bennett, Stan Lanning, et al. The netflix prize. In Proceedings of KDD cup and workshop, volume 2007, pp. 35. New York, 2007.
|
| 189 |
+
|
| 190 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 191 |
+
|
| 192 |
+
Jin-Yi Cai, Martin Furer, and Neil Immerman. An optimal lower bound on the number of variables ¨ for graph identification. Combinatorica, 12(4):389–410, 1992.
|
| 193 |
+
|
| 194 |
+
Ines Chami, Zhitao Ying, Christopher Re, and Jure Leskovec. Hyperbolic graph convolutional neural ´ networks. In Advances in neural information processing systems, pp. 4868–4879, 2019.
|
| 195 |
+
|
| 196 |
+
Zhengdao Chen, Soledad Villar, Lei Chen, and Joan Bruna. On the equivalence between graph isomorphism testing and function approximation with gnns. In Advances in Neural Information Processing Systems, pp. 15894–15902, 2019.
|
| 197 |
+
|
| 198 |
+
Hanjun Dai, Bo Dai, and Le Song. Discriminative embeddings of latent variable models for structured data. In Proceedings of The 33rd International Conference on Machine Learning, pp. 2702– 2711, 2016.
|
| 199 |
+
|
| 200 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015.
|
| 201 |
+
|
| 202 |
+
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 203 |
+
|
| 204 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263–1272. JMLR. org, 2017.
|
| 205 |
+
|
| 206 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864. ACM, 2016.
|
| 207 |
+
|
| 208 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1025–1035, 2017.
|
| 209 |
+
|
| 210 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 211 |
+
|
| 212 |
+
Leo Katz. A new status index derived from sociometric analysis. Psychometrika, 18(1):39–43, 1953.
|
| 213 |
+
|
| 214 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016a.
|
| 215 |
+
|
| 216 |
+
Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016b.
|
| 217 |
+
|
| 218 |
+
Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding–design provably more powerful gnns for structural representation learning. arXiv preprint arXiv:2009.00142, 2020.
|
| 219 |
+
|
| 220 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 221 |
+
|
| 222 |
+
David Liben-Nowell and Jon Kleinberg. The link-prediction problem for social networks. Journal of the American society for information science and technology, 58(7):1019–1031, 2007.
|
| 223 |
+
|
| 224 |
+
Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. In Advances in Neural Information Processing Systems, pp. 2156–2167, 2019.
|
| 225 |
+
|
| 226 |
+
Andriy Mnih and Ruslan R Salakhutdinov. Probabilistic matrix factorization. In Advances in neural information processing systems, pp. 1257–1264, 2008.
|
| 227 |
+
|
| 228 |
+
Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 4602–4609, 2019.
|
| 229 |
+
|
| 230 |
+
Maximilian Nickel, Kevin Murphy, Volker Tresp, and Evgeniy Gabrilovich. A review of relational machine learning for knowledge graphs. arXiv preprint arXiv:1503.00759, 2015.
|
| 231 |
+
|
| 232 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In Proceedings of the 33rd annual international conference on machine learning. ACM, 2016.
|
| 233 |
+
|
| 234 |
+
Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 701–710. ACM, 2014.
|
| 235 |
+
|
| 236 |
+
Omri Puny, Heli Ben-Hamu, and Yaron Lipman. From graph low-rank global attention to 2-fwl approximation. arXiv preprint arXiv:2006.07846, 2020.
|
| 237 |
+
|
| 238 |
+
Yanjun Qi, Ziv Bar-Joseph, and Judith Klein-Seetharaman. Evaluation of different biological data and computational classification methods for use in protein interaction prediction. Proteins: Structure, Function, and Bioinformatics, 63(3):490–500, 2006.
|
| 239 |
+
|
| 240 |
+
Leonardo FR Ribeiro, Pedro HP Saverese, and Daniel R Figueiredo. struc2vec: Learning node representations from structural identity. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 385–394. ACM, 2017.
|
| 241 |
+
|
| 242 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009.
|
| 243 |
+
|
| 244 |
+
Balasubramaniam Srinivasan and Bruno Ribeiro. On the equivalence between positional node embeddings and structural graph representations. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ SJxzFySKwH.
|
| 245 |
+
|
| 246 |
+
Boris Weisfeiler and AA Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12–16, 1968.
|
| 247 |
+
|
| 248 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 249 |
+
|
| 250 |
+
Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. arXiv preprint arXiv:1906.04817, 2019.
|
| 251 |
+
|
| 252 |
+
Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pp. 5165–5175, 2018.
|
| 253 |
+
|
| 254 |
+
Muhan Zhang and Yixin Chen. Inductive matrix completion based on graph neural networks. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id $=$ ByxxgCEYDS.
|
| 255 |
+
|
| 256 |
+
Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In AAAI, pp. 4438–4445, 2018.
|
| 257 |
+
|
| 258 |
+
# A PROOF OF THEOREM 1
|
| 259 |
+
|
| 260 |
+
Recall Definition 5 defines:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\mathrm { G N N } ( S , \tilde { \mathbf { A } } ) = \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ) | i \in S \} ) .
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
Thus, we only need to show $\mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ) | i \in S \} ) = \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ^ { \prime } ) | i \in S ^ { \prime } \} )$ iff $( S , \pmb { \mathsf { A } } ) \simeq$ $( S ^ { \prime } , { \pmb { \mathsf { A } } } ^ { \prime } )$ .
|
| 267 |
+
|
| 268 |
+
To prove the first direction, we notice that with an injective AGG,
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\begin{array} { r l } & { ~ \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ) | i \in S \} ) = \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ^ { \prime } ) | i \in S ^ { \prime } \} ) } \\ & { \implies \exists v _ { 1 } \in S , v _ { 2 } \in S ^ { \prime } , \mathrm { ~ s u c h ~ t h a t ~ G N N } ( v _ { 1 } , \tilde { \mathbf { A } } ) = \mathrm { G N N } ( v _ { 2 } , \tilde { \mathbf { A } } ^ { \prime } ) } \\ & { \implies ( v _ { 1 } , \tilde { \mathbf { A } } ) \simeq \left( v _ { 2 } , \tilde { \mathbf { A } } ^ { \prime } \right) \quad ( \mathrm { b e c a u s e ~ G N N ~ i s ~ n o d e - m o s t - e x p r e s s i v e } , } \\ & { \implies \exists \pi \in \Pi _ { n } , \mathrm { ~ s u c h ~ t h a t ~ } v _ { 1 } = \pi ( v _ { 2 } ) , \tilde { \mathbf { A } } = \pi ( \tilde { \mathbf { A } } ^ { \prime } ) . } \end{array}
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
Remember $\tilde { \pmb { A } }$ is constructed by stacking $\pmb { \mathsf { A } }$ and $\pmb { I } ^ { ( S ) }$ in the third dimension, where $\pmb { I } ^ { ( S ) }$ is a diagonal matrix satisfying: $\forall \pi \in \Pi _ { n }$ , (1) $\pmb { I } ^ { ( S ) } = \pi ( \pmb { I } ^ { ( S ^ { \prime } ) } ) \Rightarrow S = \pi ( S ^ { \prime } )$ , and (2) $S = \pi ( S ^ { \prime } ) , \pmb { \mathbb { A } } = \pi ( \pmb { \mathbb { A } } ^ { \prime } ) \Rightarrow$ $\pmb { I } ^ { ( S ) } = \pi ( \pmb { I } ^ { ( S ^ { \prime } ) } )$ . With $\tilde { \pmb { \mathsf { A } } } = \pi ( \tilde { \pmb { \mathsf { A } } } ^ { \prime } )$ , we have both
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\mathbf { A } = \pi ( \mathbf { A } ^ { \prime } ) , I ^ { ( S ) } = \pi ( I ^ { ( S ^ { \prime } ) } ) .
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
Because $\pmb { I } ^ { ( S ) } = \pi ( \pmb { I } ^ { ( S ^ { \prime } ) } ) \Rightarrow S = \pi ( S ^ { \prime } )$ , we have
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\begin{array} { r l } & { \quad \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ) | i \in S \} ) = \mathrm { A G G } ( \{ \mathrm { G N N } ( i , \tilde { \mathbf { A } } ^ { \prime } ) | i \in S ^ { \prime } \} ) } \\ & { \implies \exists \pi \in \Pi _ { n } , \mathrm { ~ s u c h ~ t h a t ~ } S = \pi ( S ^ { \prime } ) , \mathbf { A } = \pi ( \mathbf { A } ^ { \prime } ) } \\ & { \implies ( S , \mathbf { A } ) \simeq ( S ^ { \prime } , \mathbf { A } ^ { \prime } ) . } \end{array}
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
Now we prove the second direction. We have:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\begin{array} { r l } & { \qquad ( S , \boldsymbol { \mathsf { A } } ) \simeq ( S ^ { \prime } , \boldsymbol { \mathsf { A } } ^ { \prime } ) } \\ & { \Longrightarrow \exists \pi \in \Pi _ { n } , \mathrm { ~ s u c h ~ t h a t } S = \pi ( S ^ { \prime } ) , \boldsymbol { \mathsf { A } } = \pi ( \boldsymbol { \mathsf { A } } ^ { \prime } ) } \\ & { \Longrightarrow \exists \pi \in \Pi _ { n } , \mathrm { ~ s u c h ~ t h a t } S = \pi ( S ^ { \prime } ) , I ^ { ( S ) } = \pi ( I ^ { ( S ^ { \prime } ) } ) , \boldsymbol { \mathsf { A } } = \pi ( \boldsymbol { \mathsf { A } } ^ { \prime } ) } \\ & { \Longrightarrow \exists \pi \in \Pi _ { n } , \mathrm { ~ s u c h ~ t h a t } S = \pi ( S ^ { \prime } ) , \tilde { \boldsymbol { \mathsf { A } } } = \pi ( \boldsymbol { \mathsf { A } } ^ { \prime } ) } \\ & { \Longrightarrow \forall v _ { 1 } \in S , v _ { 2 } \in S ^ { \prime } , v _ { 1 } = \pi ( v _ { 2 } ) , \mathrm { ~ w e ~ h a v e ~ G N N } ( v _ { 1 } , \tilde { \boldsymbol { \mathsf { A } } } ) = \mathrm { G N N } ( v _ { 2 } , \tilde { \boldsymbol { \mathsf { A } } } ^ { \prime } ) } \\ & { \Longrightarrow \boldsymbol { \mathsf { A } } \mathrm { G G } ( \{ \mathrm { G N N } ( v _ { 1 } , \tilde { \boldsymbol { \mathsf { A } } } ) | v _ { 1 } \in S \} ) = \boldsymbol { \mathsf { A } } \mathrm { G G } ( \{ \mathrm { G N N } ( v _ { 2 } , \tilde { \boldsymbol { \mathsf { A } } } ^ { \prime } ) | v _ { 2 } \in S ^ { \prime } \} ) , } \end{array}
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
which concludes the proof.
|
| 293 |
+
|
| 294 |
+
# B PROOF OF LEMMA 1
|
| 295 |
+
|
| 296 |
+
We first note that for a most powerful 1-WL-GNN, after a message passing layer, gives different embeddings to any two nodes that 1-WL gives different colors to after one iteration. So we only need to show how many iterations 1-WL takes to converge in any graph.
|
| 297 |
+
|
| 298 |
+
Note that if two nodes are given different colors by 1-WL at some iteration (they are discriminated by 1-WL), their colors are always different in any future iteration. And if at some iteration, all nodes’ colors are the same as their colors in the last iteration, then 1-WL will stop (1-WL fails to discriminate any more nodes and has converged). Therefore, before termination, 1-WL will increase its total number of colors by at least 1 after every iteration. Because there are at most $n$ different final colors given an $n$ -node graph, 1-WL takes at most $n - 1 = { \mathcal { O } } ( n )$ iterations before assigning all nodes different colors.
|
| 299 |
+
|
| 300 |
+
Now it suffices to show that there exists a $n$ -node graph that 1-WL takes ${ \mathcal { O } } ( n )$ iterations to converge. Suppose there is a linked list of $n$ nodes (a path). Then by simple calculation, it takes $\lceil n / 2 \rceil$ iterations for 1-WL to converge, which concludes the proof.
|
| 301 |
+
|
| 302 |
+
# C PROOF OF THEOREM 2
|
| 303 |
+
|
| 304 |
+
Our proof has two steps. First, we would like to show that there are $\omega ( n ^ { \epsilon } )$ nodes that are locally $h$ -isomorphic to each other. Then, we prove that among these nodes, there are at least $\omega ( n ^ { 2 \epsilon } )$ pairs of nodes such that there exists another node constructing locally $h$ non-isomorphic links with either of the two nodes in each node pair.
|
| 305 |
+
|
| 306 |
+
Step 1. Consider an arbitrary node $v$ and denote the subgraph induced by the nodes that are at most $h$ -hop away from $v$ as $G _ { v } ^ { ( h ) }$ (the $h$ -hop enclosing subgraph of $v$ ). As each node is with degree $d = \mathcal { O } ( \log ^ { \frac { 1 - \epsilon } { 2 h } } n )$ , then the number of nodes in $G _ { v } ^ { ( h ) }$ , denoted by $| V ( G _ { v } ^ { ( h ) } ) |$ , satisfies
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
| V ( G _ { v } ^ { ( h ) } ) | \leq \sum _ { i = 0 } ^ { h } d ^ { i } = \mathcal { O } ( d ^ { h } ) = \mathcal { O } ( \log ^ { \frac { 1 - \epsilon } { 2 } } n ) .
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
We set the max $K = \operatorname* { m a x } _ { v \in V } | V ( G _ { v } ^ { ( h ) } ) |$ and thus $K = \mathcal { O } ( \log ^ { \frac { 1 - \epsilon } { 2 } } n )$
|
| 313 |
+
|
| 314 |
+
Now we expand subgraphs $G _ { v } ^ { ( h ) }$ to $\bar { G } _ { v } ^ { ( h ) }$ by adding $K - | V ( G _ { v } ^ { ( h ) } ) |$ independent nodes for each node $v \in V$ . Then, all $\bar { G } _ { v } ^ { ( h ) }$ have the same number of nodes, which is $K$ , though they may not be connected graphs.
|
| 315 |
+
|
| 316 |
+
Next, we consider the number of non-isomorphic graphs over $K$ nodes. Actually, the number of nonisomorphic graph structures over $K$ nodes is bounded by $2 ^ { \binom { K } { 2 } } = \exp ( \mathcal { O } ( \log ^ { 1 - \epsilon } n ) ) = o ( n ^ { 1 - \epsilon } )$ .
|
| 317 |
+
|
| 318 |
+
Therefore, due to the pigeonhole principle, there exist $n / o ( n ^ { 1 - \epsilon } ) = \omega ( n ^ { \epsilon } )$ many nodes $v$ whose $\bar { G } _ { v } ^ { ( h ) }$ are isomorphic to each other. Denote the set of these nodes as $V _ { i s o }$ , which consist of nodes that are all locally $h$ -isomorphic to each other. Next, we focus on looking for other nodes to form locally $h$ -non-isomorphic links with nodes $V _ { i s o }$ .
|
| 319 |
+
|
| 320 |
+
Step 2. Let us partition $V _ { i s o } = \cup _ { i = 1 } ^ { q } V _ { i }$ so that for all nodes in $V _ { i }$ , they share the same first-hop neighbor sets. Then, consider any pair of nodes $u , v$ such that $u , v$ are from different $V _ { i }$ ’s. Then, we may pick one $u$ ’s first-hop neighbor $w$ that is not $v$ ’s first-hop neighbor. We know such $w$ exists because of the definition of $V _ { i }$ . As $w$ is $u$ ’s first-hop neighbor and is not $v$ ’s first-hop neighbor, $( u , w )$ and $( v , w )$ are not locally 1-isomorphic and thus not locally $h$ -isomorphic. Therefore, based on this partition, we know the number of node pairs $u , v$ such that there exists another node $w$ making $( u , w )$ and $( v , w )$ not locally $h$ -isomorphic is at least
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
Y \geq \prod _ { \substack { i , j = 1 , i \neq j } } ^ { q } | V _ { i } | | V _ { j } | = \frac { 1 } { 2 } \left[ ( \sum _ { i = 1 } ^ { q } | V _ { i } | ) ^ { 2 } - \sum _ { i = 1 } ^ { q } | V _ { i } | ^ { 2 } \right] .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
Because of the definitions of the partition, $\begin{array} { r } { \sum _ { i = 1 } ^ { q } | V _ { i } | = | V _ { i s o } | = \omega ( n ^ { \epsilon } ) } \end{array}$ and the size of each $V _ { i }$ satisfies
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
1 \leq | V _ { i } | \leq d _ { w } = \mathcal { O } ( \log ^ { \frac { 1 - \epsilon } { 2 h } } n ) ,
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where $w$ is one of the common first-hop neighbors shared by all nodes in $V _ { i }$ and $d _ { w }$ is its degree.
|
| 333 |
+
|
| 334 |
+
By plugging in the range of $| V _ { i } |$ , Eq.12 leads to
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
Y \ge \frac { 1 } { 2 } ( \omega ( n ^ { 2 \epsilon } ) - \omega ( n ^ { \epsilon } ) \mathcal { O } ( \log ^ { \frac { 1 - \epsilon } { 2 h } } n ) ) = \omega ( n ^ { 2 \epsilon } ) ,
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
which concludes the proof.
|
| 341 |
+
|
| 342 |
+
# D MORE DETAILS ABOUT BASELINES
|
| 343 |
+
|
| 344 |
+
We include baselines achieving top performances on the OGB Link Prediction Leaderboard1. All the methods have their open-sourced code and paper available from the leaderboard. We adopt the numbers published on the leaderboard if available, otherwise we run the method ourselves using the open-sourced code. For the baseline GCN+LRGA, its default hyperparameters result in out of GPU memory on ogbl-citation, even we use an NVIDIA V100 GPU with 32GB memory. Thus, we have to reduce its hidden dimension to 16 and matrix rank to 10. It is possible that it can achieve better performance with a larger hidden dimension and larger matrix rank using a GPU with a larger memory. Despite this, GCN+LRGA generally performs second to best among all methods.
|
| 345 |
+
|
| 346 |
+
We implemented SEAL using the PyTorch Geometric (Fey & Lenssen, 2019) package. Following the original paper (Zhang & Chen, 2018), we adopt a SortPooling layer (Zhang et al., 2018) after the GCN layers to readout the subgraph. For all datasets, SEAL only used a fixed $1 \%$ to $10 \%$ of all the available training edges as the positive training links, and sampled an equal number of negative training links randomly. SEAL showed excellent performance even without using the full training data, which indicates its strong inductive learning ability. Due to using different labeled subgraphs for different links, SEAL generally has longer running time than GAE methods. On the largest ogbl-citation graph, SEAL takes about 7 hours to finishing its training of 10 epochs, and takes another 28 hours to evaluate the validation and test MRR each. For ogbl-ppa, SEAL takes about 20 hours to train for 20 epochs and takes about 4 hours for evaluation. The other two datasets are finished within hours. We will release all our code for reproducing the experimental results.
|
md/train/B7v4QMR6Z9w/B7v4QMR6Z9w.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BJInEZsTb/BJInEZsTb.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING REPRESENTATIONS AND GENERATIVE MODELS FOR 3D POINT CLOUDS
|
| 2 |
+
|
| 3 |
+
Panos Achlioptas ,\* Department of Computer Science Stanford University, USA
|
| 4 |
+
|
| 5 |
+
Olga Diamanti Department of Computer Science Stanford University, USA
|
| 6 |
+
|
| 7 |
+
Ioannis Mitliagkas
|
| 8 |
+
Department of Computer Science and Operations Research
|
| 9 |
+
University of Montréal, Canada
|
| 10 |
+
|
| 11 |
+
Leonidas Guibas Department of Computer Science Stanford University, USA
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Three-dimensional geometric data offer an excellent domain for studying representation learning and generative modeling. In this paper, we look at geometric data represented as point clouds. We introduce a deep autoencoder (AE) network with state-of-the-art reconstruction quality and generalization ability. The learned representations outperform existing methods on 3D recognition tasks and enable basic shape editing via simple algebraic manipulations, such as semantic part editing, shape analogies and shape interpolation. We perform a thorough study of different generative models including: GANs operating on the raw point clouds, significantly improved GANs trained in the fixed latent space of our AEs and, Gaussian mixture models (GMM). For our quantitative evaluation we propose measures of sample fidelity and diversity based on matchings between sets of point clouds. Interestingly, our careful evaluation of generalization, fidelity and diversity reveals that GMMs trained in the latent space of our AEs produce the best results.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Three-dimensional (3D) representations of real-life objects are a core tool for vision, robotics, medicine, augmented and virtual reality applications. Recent encodings like view-based projections, volumetric grids and graphs, complement more traditional shape representations such as 3D meshes, level set functions, curve-based CAD models and constructive solid geometry (Botsch et al., 2010). These encodings, while effective in their respective domains (e.g. acquisition or rendering), are often poor in semantics. For example, naïvely interpolating between two different cars in a view-based representation does not yield a representation of an “intermediate” car. Furthermore, these raw, high-dimensional representations are typically not well suited for the design of generative models via classic statistical methods. As such, editing and designing new objects with such representations frequently involves the construction and manipulation of complex, object-specific parametric models that link the semantics to the representation. This may require significant expertise and effort.
|
| 20 |
+
|
| 21 |
+
Recent advances in deep learning bring the promise of a data-driven approach. In domains where data is plentiful, deep learning tools have eliminated the need for hand-crafting features and models. Deep learning architectures like autoencoders (AEs) (Rumelhart et al., 1988; Kingma & Welling, 2013) and Generative Adversarial Networks (GANs) (Goodfellow et al., 2014; Radford et al., 2015; Denton et al., 2015; Che et al., 2016) are successful at learning complex data representations and generating realistic samples from complex underlying distributions. Recently, deep learning architectures for view-based projections (Su et al., 2015; Wei et al., 2016; Kalogerakis et al., 2016), volumetric grids (Qi et al., 2016b; Wu et al., 2015; Hegde & Zadeh, 2016) and graphs (Bruna et al., 2013; Henaff et al., 2015; Defferrard et al., 2016; Yi et al., 2016b) have appeared in the 3D machine learning literature.
|
| 22 |
+
|
| 23 |
+
In this paper we focus on point clouds, a relatively unexplored 3D modality. Point clouds provide a homogeneous, expressive and compact representation of surface geometry, easily amenable to geometric operations. These properties make them attractive from a learning point of view. In addition, they come up as the output of common range-scanning acquisition pipelines used in devices like the Kinect and iPhone’s recent face identification feature. Only a handful of deep architectures for 3D point clouds exist in the literature: PointNet (Qi et al., 2016a; 2017) successfully tackled classification and segmentation tasks; Kalogerakis et al. (2016) used point-clouds as an intermediate step in their pipeline; Fan et al. (2016) used pointclouds as the underlying representation to extract 3D information from 2D images. We provide the first results that use deep architectures with the focus of learning representations and generative models for point clouds.
|
| 24 |
+
|
| 25 |
+
Generative models have garnered increased attention recently in the deep learning community with the introduction of GANs (Goodfellow et al., 2014). An issue with GAN-based generative pipelines is that training them is notoriously hard and unstable (Salimans et al., 2016). More importantly, there is no universally accepted way to evaluate generative models. In evaluating generative models one is interested in both fidelity, i.e. how much the generated points resemble the actual data, and coverage, i.e. what fraction of the data distribution a generated sample represents. The latter is especially important given the tendency of certain GANs to exhibit mode collapse. We provide simple methods to deal with both issues (training and evaluation) in our target domain. Our specific contributions are:
|
| 26 |
+
|
| 27 |
+
• We design a new AE architecture—inspired by recent architectures used for classification (Qi et al., 2016a)—that is capable of learning compact representations of point clouds with excellent reconstruction quality even on unseen samples. The learned representations are (i) good for classification via simple methods (SVM), improving on the state of the art (Wu et al., 2016); (ii) suitable for meaningful interpolations and semantic operations.
|
| 28 |
+
We create the first set of generative models which (i) can generate point clouds measurably similar to the training data and held-out test data; (ii) provide good coverage of the training and test dataset. We argue that jointly learning the representation and training the GAN is unnecessary for our modality. We propose a workflow that first learns a representation by training an AE with a compact bottleneck layer, then trains a plain GAN in that fixed latent representation. Intuitively, training a GAN inside a compact, low-dimensional representation is easier. We point to theory (Arjovsky & Bottou, 2017) that supports this idea, and verify it empirically. Latent GANs are much easier to train than monolithic (raw) GANs and achieve superior reconstruction with much better coverage. Somewhat surprisingly, GMMs trained in the latent space of fixed AEs achieve the best performance across the board.
|
| 29 |
+
We show that multi-class GANs work almost on par with dedicated GANs trained per-objectcategory, as long as they are trained in the latent space.
|
| 30 |
+
To support our qualitative evaluation, we perform a careful study of various old and new metrics, in terms of their applicability (i) as objectives for learning good representations; (ii) for the evaluation of generated samples. We find that a commonly used point cloud metric, Chamfer distance, fails to discriminate certain pathological cases from good examples. We also propose fidelity and coverage metrics for our generative models, based on an optimal matching between two different samples, e.g. a set of point clouds generated by the model and a held-out test set.
|
| 31 |
+
|
| 32 |
+
The rest of this paper is organized as follows: Section 2 outlines the necessary background and building blocks for our work and introduces our evaluation metrics. Section 3 introduces our models for latent representations and generation of point clouds. In Section 4, we evaluate all of our models both quantitatively and qualitatively, and analyze their behaviour. Further results and evaluation can be found in the appendix. The code for all our models is publicly available 1.
|
| 33 |
+
|
| 34 |
+
# 2 BACKGROUND
|
| 35 |
+
|
| 36 |
+
Autoencoders. Autoencoders (AE - inset) are deep architectures that aim to reproduce their input. They are especially useful, when they contain a narrow bottleneck layer between input and output. Upon successful training, the bottleneck layer corresponds to a lowdimensional representation, a code for the dataset. The Encoder (E) learns to compress a data point $_ { \textbf { \em x } }$ into its latent representation, $_ z$ . The Decoder (D) can then reproduce $_ { \textbf { \em x } }$ from its encoded version $_ { z }$ .
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
|
| 40 |
+
Generative Adversarial Networks. GANs are state-of-the-art generative models. The basic architecture (inset) is based on a adversarial game between a generator (G) and a discriminator (D). The generator aims to synthesize samples that look indistinguishable from real data (drawn from $\begin{array} { r } { \mathbf { \boldsymbol { x } } \sim p _ { \mathrm { d a t a } } , } \end{array}$ ) by passing a randomly drawn sample $z \sim p _ { z }$ through the generator function $G$ . The discriminator tries to tell synthesized from real samples. The most commonly used losses for the discriminator and generator networks are:
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r c l } { { J ^ { ( D ) } ( { \pmb \theta } ^ { ( D ) } , { \pmb \theta } ^ { ( G ) } ) } } & { { = } } & { { - \mathbb { E } _ { { \pmb x } \sim p _ { \mathrm { d a t a } } } \log D ( { \pmb x } ) - \mathbb { E } _ { { \pmb z } \sim p _ { z } } \log \left( 1 - D \left( G ( { \pmb z } ) \right) \right) , } } \\ { { J ^ { ( G ) } ( { \pmb \theta } ^ { ( D ) } , { \pmb \theta } ^ { ( G ) } ) } } & { { = } } & { { - \mathbb { E } _ { { \pmb z } \sim p _ { z } } \log D ( G ( { \pmb z } ) ) , } } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\pmb \theta ^ { ( D ) } , \pmb \theta ^ { ( G ) }$ are the parameters for the discriminator and the generator network respectively. In addition to the classical GAN formulation, we also use the improved Wasserstein GAN (Gulrajani et al., 2017), which has shown improved stability during training.
|
| 49 |
+
|
| 50 |
+
Challenges specific to point cloud geometry. Point clouds as an input modality present a unique set of challenges when building a network architecture. As an example, the convolution operator – now ubiquitous in image-processing pipelines – requires the signal (in our case, geometry) to be defined on top of an underlying grid-like structure. Such a structure is not available in raw point clouds, which renders them significantly more difficult to encode than e.g. images or voxel grids. Recent classification work on point clouds (PointNet – Qi et al. (2016a)) bypasses this issue by circumventing 2D convolutions. Another issue with point clouds as a representation is that they are unordered - any permutation of a point set still describes the same shape. This complicates comparisons between two point sets, typically needed to define a loss function. This unorderedness of point clouds also creates the need for making the encoded feature permutation invariant.
|
| 51 |
+
|
| 52 |
+
Point-set distances. Two permutation-invariant metrics for comparing unordered point sets have been proposed in the literature (Fan et al., 2016). On the one hand, the Earth Mover’s distance (EMD) (Rubner et al., 2000) is the solution of a transportation problem which attempts to transform one set to the other. For two equally sized subsets $S _ { 1 } \subseteq \bar { R ^ { 3 } } , S _ { 2 } \subseteq R ^ { 3 }$ , their EMD is defined by $d _ { E M D } ( S _ { 1 } , S _ { 2 } ) \ = \ \operatorname* { m i n } _ { \phi : S _ { 1 } \to S _ { 2 } } \sum _ { x \in S _ { 1 } } \| x - \phi ( x ) \| _ { 2 }$ where $\phi$ is a bijection. Interpreted as a loss, EMD is differentiable almost everywhere. On the other hand, the Chamfer (pseudo)-distance (CD) measures the squared distance between each point in one set to its nearest neighbor in the other set: $d _ { C H } ( S _ { 1 } , S _ { 2 } ) = \sum _ { x \in S _ { 1 } } \operatorname* { m i n } _ { y \in S _ { 2 } } \| x - y \| _ { 2 } ^ { 2 } + \sum _ { y \in S _ { 2 } } \operatorname* { m i n } _ { x \in S _ { 1 } } \| x - y \| _ { 2 } ^ { 2 } .$ . It is still differentiable but more computationally efficient.
|
| 53 |
+
|
| 54 |
+
Evaluation Metrics for representations and generative models. In the remainder of the paper, we will frequently need to compare a given set (distribution) of points clouds, whether reconstructed or synthesized, to its ground truth counterpart. For example, one might want to assess the quality of a representation model, in terms of how well it matches the training set or a held-out test set. Such a comparison might be done to evaluate the faithfulness and/or diversity of a generative model, and measure potential mode-collapse. To measure how well a point-cloud distribution $A$ matches a ground truth distribution $G$ , we use the following metrics:
|
| 55 |
+
|
| 56 |
+
Coverage. For each point-cloud in $A$ we find its closest neighbor in $G$ ; closeness can be computed using either CD or EMD, thus yielding two different metrics, COV-CD and COV-EMD. Coverage is measured as the fraction of the point-clouds in $G$ that were matched to point-clouds in $A$ . A high coverage score typically indicates that most of $G$ is roughly represented within $A$ .
|
| 57 |
+
|
| 58 |
+
Minimum Matching Distance (MMD). Coverage is not representative of the fidelity of $A$ with respect to $G$ as matched elements need not be close. To capture fidelity, we match every point cloud of $G$ to the one in $A$ with the minimum distance (MMD) and report the average of distances in the matching. Either of the structural distances can be used, yielding MMD-CD and MMD-EMD. MMD measures the distances in the pairwise matchings, so it correlates with how realistic the elements of $A$ are.
|
| 59 |
+
|
| 60 |
+
Jensen-Shannon Divergence (JSD). The Jensen-Shannon divergence between marginal distributions defined over the euclidean 3D space. Assuming point cloud data that are axis-aligned and a canonical voxel grid in the ambient space; one can measure the degree to which point clouds of $A$ tend to occupy similar locations as those of $B$ . To that end, we count the number of points lying within each voxel across all point clouds of $A$ , and correspondingly for $B$ and report the JSD between the obtained empirical distributions.
|
| 61 |
+
|
| 62 |
+
# 3 REPRESENTATION AND GENERATIVE MODELS
|
| 63 |
+
|
| 64 |
+
In this section we describe the architectures of our representation and generative models for point clouds, starting from our autoencoder design. Later, we introduce a GAN architecture tailored to point-cloud data, followed by a more efficient pipeline that first learns an AE and the trains a much smaller GAN in the learned latent space, and a simpler generative model based on Gaussian Mixtures.
|
| 65 |
+
|
| 66 |
+
# 3.1 LEARNING REPRESENTATIONS OF 3D POINT CLOUDS
|
| 67 |
+
|
| 68 |
+
The input to our AE network is a point cloud with 2048 points $( 2 0 4 8 \times 3$ matrix), representing a 3D shape. The encoder architecture follows the principle of Qi et al. (2016a): 1-D convolutional layers with kernel size 1 and increasing number of features, ending with a "symmetric" function. This approach encodes every point independently and uses a permutation-invariant (symmetric) function to make a joint representation. In our implementation we use 5 1-D conv layers, each followed by a ReLU and a batch-norm layer. The output of the last 1-D conv layer is passed to a feature-wise maximum to produce a $k$ -dimensional vector which is the basis for our latent space. The decoder transforms the latent vector with 3 fully connected layers, the first two having ReLUs, to produce a $2 0 4 8 \times 3$ output. For a permutation invariant objective, we explore both the efficient EMD-distance approximation (Fan et al., 2016) and the Chamfer-Distance as our structural losses; this yields two distinct AE models, referred to as AE-EMD and AE-CD (detailed architecture parameters can be found in Appendix A). To determine an appropriate size for the latent-space, we constructed 8 (otherwise architecturally identical) AEs with bottleneck sizes $k \in \{ 4 , 8 \ldots , 5 1 2 \}$ and trained them with point-clouds of a single object class, under the two losses. We repeated this procedure with pseudo-random weight initializations three times (see appendix, Fig. 15) and found that $k = 1 2 8$ had the best generalization error on the test data, while achieving minimal reconstruction error on the train split.
|
| 69 |
+
|
| 70 |
+
# 3.2 GENERATIVE MODELS FOR POINT CLOUDS
|
| 71 |
+
|
| 72 |
+
Raw point cloud GAN (r-GAN). The first version of our generative model operates directly on the raw $2 0 4 8 \times 3$ point set input – to the best of our knowledge this work is the first to present a GAN for point clouds. The architecture of the discriminator is identical to the AE (modulo the filter-sizes and the number of neurons), without any batch-norm and with leaky ReLUs (Maas et al., 2013) instead or ReLUs. The output of the last fully connected layer is fed into a sigmoid neuron. The generator takes as input a 128-dimensional noise vector and maps it to a $2 0 4 8 \times 3$ output by 5 FC-ReLU layers.
|
| 73 |
+
|
| 74 |
+
Latent-space GAN (l-GAN). In our l-GAN, instead of operating on the raw point cloud input, we pass the data through our pre-trained autoencoder, trained separately for each object class with the EMD (or Chamfer) loss function. Both the generator and the discriminator of the GAN then operate on the 128- dimensional bottleneck variable of the AE. Finally, once the GAN training is over, the output of the generator is decoded to a point cloud via the AE decoder. The architecture for the l-GAN is significantly simpler than the one of the r-GAN. We found that very shallow designs for both the generator and discriminator (in our case, one hidden FC layer for the generator and two FC for the discriminator) are sufficient to produce realistic results.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
|
| 78 |
+
Gaussian Mixture Model. In addition to the l-GANs, we also train a family of Gaussian Mixture Models (GMMs) on the latent spaces learned by our AEs. We fitted GMMs with varying numbers of Gaussian components, and experimented with both diagonal and full covariance matrices for the Gaussians. The GMMs can be turned into point-cloud generators by first sampling the latent-space from the GMM distribution and accordingly using the AE’s decoder, similarly to the l-GANs.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 1: Reconstructions of unseen shapes from the test split of the input data. The leftmost image of each pair shows the ground truth shape, the rightmost the shape produced after encoding and decoding using our class-specific AEs.
|
| 82 |
+
|
| 83 |
+
# 4 EVALUATION AND RESULTS
|
| 84 |
+
|
| 85 |
+
Our source for shapes is the ShapeNet repository (Chang et al., 2015); we pre-center all shapes into a sphere of diameter 1. Unless otherwise stated, we train specific per-class models, and split the models in each class into training/testing/validation set using a $8 5 \% - 5 \% - 1 0 \%$ split.
|
| 86 |
+
|
| 87 |
+
# 4.1 EVALUATING THE LATENT REPRESENTATION
|
| 88 |
+
|
| 89 |
+
Classification. A common technique for evaluating the quality of unsupervised representation learning algorithms is to apply them as feature extractors on supervised datasets and evaluate the performance of linear models fitted on top of these features. We use this technique to evaluate the performance of the latent “features” computed by our AE. For this experiment to be meaningful, the AE was trained across all different shape categories: we used 57,000 models from ShapeNet from 55 categories of man-made objects. Exclusively for this experiment, we used a bigger bottleneck of 512, increased the number of neurons and applied batch-norm to the decoder as well. To obtain features for an input 3D shape, we feed forward to the network its point-cloud and extract the 512-dimensional bottleneck layer vector. This feature is then processed by a linear classification SVM trained on the de-facto 3D classification benchmark of ModelNet (Wu et al., 2015). Table 1 shows comparative results. Note that previous state of the art (Wu et al., 2016) uses several layers of a GAN to derive a 7168-long feature; our 512-dimensional feature is more intuitive and parsimonious.
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Dataset</td><td>SPH[1]</td><td>LFD[2]</td><td>T-L-Net[3]</td><td>VConv-DAE[4]</td><td>3D-GAN[5]</td><td>ours - EMD</td><td>ours - CD</td></tr><tr><td>MN10</td><td>79.8%</td><td>79.9%</td><td>-</td><td>80.5%</td><td>91.0%</td><td>95.4%</td><td>95.4%</td></tr><tr><td>MN40</td><td>68.2%</td><td>75.5%</td><td>74.4%</td><td>75.5%</td><td>83.3%</td><td>84.0%</td><td>84.5%</td></tr></table>
|
| 92 |
+
|
| 93 |
+
Table 1: Classification performance on ModelNet40 and ModelNet10. All methods train a linear SVM with features derived in an unsupervised manner. Comparing to [1] Kazhdan et al. (2003), [2] Chen et al. (2003), [3] Girdhar et al. (2016a), [4] Sharma et al. (2016), [5] Wu et al. (2016).
|
| 94 |
+
|
| 95 |
+
The decoupling of latent representation from generation allows flexibly choosing the AE loss, which can effect the learned feature. On ModelNet10, which includes primarily larger objects and fewer categories than ModelNet40, the EMD and CD losses perform equivalently. On the other hand, when the variation within the collection increases, CD produces better results. This is perhaps due to its more local and less smooth nature, which allows it to understand rough edges and some high frequency geometric details. Finally, note that since our AEs were not trained on ModelNet, this experiment also demonstrates the domain-robustness of our learned features.
|
| 96 |
+
|
| 97 |
+
Qualitative Evaluation. To visually assess the quality of the learned representation, we show some reconstruction results in Fig. 1. Here, we use our AEs to encode samples from the test split of the ground truth dataset (the leftmost of each pair of images) and then decode them and compare them visually to the input (the rightmost image). These results show the ability of our learned representation to generalize to unseen shapes. In addition to reconstruction, our learned latent representation enables a number of interesting shape editing applications, including shape interpolations (Fig. 2), part editing and shape analogies. More results are showcased in Appendix F.
|
| 98 |
+
|
| 99 |
+
Generalization Ability. Our AEs are able to reconstruct unseen shapes; this is highlighted not only in the results of Figure 1, but also in quantitative measurements of the fidelity and coverage of the reconstructed ground truth datasets (see appendix, Table 6) and by the comparable reconstruction quality on the training vs. test splits (see appendix, Figure 15).
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 2: Interpolating between different point clouds, using our latent space representation.
|
| 103 |
+
|
| 104 |
+
# 4.2 EVALUATING THE GENERATIVE MODELS
|
| 105 |
+
|
| 106 |
+
We train and compare a total of five generative models on the data distribution of point-clouds of the chair category. We begin by establishing the two AEs with the 128-dimensional bottleneck, trained with the CD or EMD loss respectively – referred to as AE-CD and AE-EMD. Both AEs were stopped at the epoch at which the average reconstruction error with respect to our validation dataset was minimized. We train an l-GAN in each of the AE-CD and AE-EMD latent spaces. In the space associated only with the AE-EMD we train a further two models: an identical (architecture-wise) l-GAN that utilizes the Wasserstein objective with gradient-penalty (Gulrajani et al., 2017), and a family of GMMs. Lastly, we also train an r-GAN directly on the point cloud data.
|
| 107 |
+
|
| 108 |
+
Model Selection. All GANs are trained for maximally 2000 epochs; for each GAN, we select one of its training epochs to obtain the “final” model, based on how well the synthetic results match the ground-truth distribution. Specifically, at a given epoch, we use the GAN to generate a set of synthetic point clouds, and measure the distance between this set and the validation set (Section 2). We avoid measuring this distance using MMD-EMD, given the high computational cost of EMD. Instead, we use either the JSD or MMD-CD metrics to compare the synthetic dataset to the validation dataset. To further reduce the computational cost of model selection, we only check every 100 epochs (50 for r-GAN). The epochs at which the various models were selected using the JSD criterion are shown in Table 3. Using the same criterion, we also select the number and covariance type of Gaussian components for the GMM, and obtain the optimal value of 32 components. GMMs performed much better with full (as opposed to diagonal) covariance matrices, suggesting strong correlations between the latent dimensions (see appendix Fig. 17). When using MMD-CD as the selection criterion, we obtain models of similar quality and at similar stopping epochs (see appendix, Table 13); the optimal number of Gaussians in this case was 40.
|
| 109 |
+
|
| 110 |
+
Table 2: Evaluating 5 generators on train-split of chair dataset on epochs/models selected via minimal JSD on the validation-split. We also compare against the volumetric approach of Wu et al. (2016). Note that the average classification score attained by the ground-truth point clouds was $8 4 . 7 \%$ .
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Metric</td><td>r-GAN</td><td>Wu et al. (2016)</td><td>1-GAN (AE-CD)</td><td>1-GAN (AE-EMD)</td><td>1-WGAN (AE-EMD)</td><td>GMM (AE-EMD)</td></tr><tr><td>JSD</td><td>0.1660</td><td>0.1705</td><td>0.0372</td><td>0.0188</td><td>0.0077</td><td>0.0048</td></tr><tr><td>Classification</td><td>84.10</td><td>87.00</td><td>96.10</td><td>94.53</td><td>89.35</td><td>87.40</td></tr><tr><td>MMD-CD</td><td>0.0017</td><td>0.0042</td><td>0.0015</td><td>0.0018</td><td>0.0015</td><td>0.0014</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Quantitative Evaluation. Upon selection of the models, we compare them with respect to their capacity to generate synthetic samples. In two different sets of experiments, we measure how well the distribution of the generated samples resembles both the train and test splits of the ground truth distribution, by using our models to generate a set of synthetic point clouds and employing the metrics from Section 2 to compare against the train or test set distributions respectively. The train split results are reported in Table 2. We also show the average classification probability for those samples being recognized as a chair using the PointNet classifier (Qi et al., 2016a), which is state of the art for classifying point clouds. A similar experiment is ran to measure how well the synthetic samples match the test split dataset; here, we repeat the experiment with three pseudo-random seeds and report the average measurements in Table 3, for various comparison metrics. Perhaps surprisingly, training a simple Gaussian mixture model in the latent space of the EMD-based AE yields the best results in terms of both fidelity and coverage. Furthermore, GMMs are particularly easy to train. Additionally, the achieved fidelity and coverage are very close to the reconstruction baseline, namely, the lower bounds for the JSD and MMD achieved by the AE on which the generative models operate (see appendix, Table 6). For example, the AE-EMD achieved an MMD-EMD of 0.05 with respect to the ground truth training data , which is comparable with the MMD-EMD value of 0.06 achieved by the GMMs with respect to the test data. Finally, by comparing Table 2 and Table 3 we can again establish the generalization ability of our models, since their performance for the training vs. testing splits is comparable. This is highlighted in more detail in Fig. 16 in the appendix.
|
| 115 |
+
|
| 116 |
+
Table 3: Evaluating 5 generators on test-split of chair dataset on epochs/models selected via minimal JSD on the validation-split. The reported scores are averages of 3 pseudo-random repetitions. GMM32-F stands for a GMM with 32 Gaussian components with full covariances.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Method</td><td>Epoch</td><td>JSD</td><td>MMD-CD</td><td>MMD-EMD</td><td>COV-EMD</td><td>COV-CD</td></tr><tr><td>r-GAN</td><td>1700</td><td>0.1764</td><td>0.0020</td><td>0.1230</td><td>19.0</td><td>52.3</td></tr><tr><td>1-GAN (AE-CD)</td><td>300</td><td>0.0486</td><td>0.0020</td><td>0.0796</td><td>32.2</td><td>59.4</td></tr><tr><td>1-GAN (AE-EMD)</td><td>100</td><td>0.0308</td><td>0.0023</td><td>0.0697</td><td>57.1</td><td>59.3</td></tr><tr><td>1-WGAN (AE-EMD)</td><td>1800</td><td>0.0227</td><td>0.0019</td><td>0.0660</td><td>66.9</td><td>67.6</td></tr><tr><td>GMM-32-F (AE-EMD)</td><td>-</td><td>0.0202</td><td>0.0018</td><td>0.0651</td><td>67.4</td><td>68.9</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Note: The number of synthetic point clouds we generate for the train split experiment is equal to the size of the train dataset. For the test split experiment, as well as for the validation split comparisons done for model selection, we generate synthetic datasets that are three times bigger than the ground truth dataset (the test resp. validation set); this is possible due to the relatively small size of the test resp. validation sets, and helps reduce sampling bias. This is only necessary when measuring MMD or Coverage statistics.
|
| 121 |
+
|
| 122 |
+
Fidelity of metrics. In Table 3 we note that the MMD-CD distance to the test set appears to be relatively small for the r-GANs. This seeming advantage of the r-GANs is counter to what a qualitative inspection of the results yields. We attribute this effect to the inadequacy of the chamfer distance to distinguish pathological cases. Some examples of such behaviour are showcased in Fig. 3. We show two triplets of images: in each triplet, an r-GAN and an l-GAN is used to generate a synthetic set of point clouds; the left triplet shows an l-GAN on the AE-CD and the right an l-GAN on the AE-EMD. For a given ground truth point cloud from the test set (leftmost image of each triplet), we find its nearest neighbor in each synthetic set under the chamfer distance - the middle image in each triplet shows the nearest neighbor in the synthetic results of the r-GAN and the right most image the nearest neighbor in the l-GAN set. We report the distances between these nearest neighbors and the ground truth using both CD and EMD (in-image numbers). Note that the CD values miss the fact that the r-GAN results are visibly of lesser quality. The underlying reason appears to be that r-GANs tend to generate clouds with many points concentrated in the areas that are most likely to be occupied in the underlying shape class (e.g. the seat of chairs in the figure). This implies that one of the two terms in the CD –namely, the one going from the synthetic point cloud to the ground truth– is likely to be very small for r-GAN results. The “blindness” of the CD metric to only partial matches between shapes has the additional interesting side-effect that the CD-based coverage metric is consistently bigger than that reported by EMD, as noted in Table 3. Instead, the EMD distance promotes a one-to-one mapping and thus correlates more strongly to visual quality; this means that it heavily penalizes the r-GAN result both in terms of MMD and coverage.
|
| 123 |
+
|
| 124 |
+
Training trends. We performed extensive measurements during training of our models, to understand their behavior during training, as shown in Fig. 4. On the left, we plot the JSD distance between the ground truth test set and synthetic datasets generated by the various models at various epochs of training. On the right, we also plot the EMD-based MMD and Coverage between the same two sets, where larger marker symbols denote a higher epoch. In general, r-GAN struggles to provide good coverage of the test set no matter the metric used; which alludes to the well-established fact that end-to-end GANs are generally difficult to train. The l-GAN (AE-CD) performs better in terms of fidelity with much fewer epochs as measured by JSD/MMD-EMD, but its coverage remains low. We attribute this to the CD promoting unnatural topologies – cf. Fig. 3 that visually shows this phenomenon. Switching to an EMD-based AE for the representation and otherwise using the same latent GAN architecture (l-GAN, AE-EMD), yields a dramatic improvement in coverage and fidelity. Both l-GANs though suffer from the known issue of mode collapse: Half-way through training, first coverage starts dropping with fidelity still at good levels, which implies that they are overfitting a small subset of the data. Later on, this is followed by a more catastrophic collapse, with coverage dropping as low as $0 . 5 \%$ . Switching to a latent WGAN largely eliminates this collapse, as expected.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 3: The CD distance is less faithful than EMD to visual quality of synthetic results; in this case it favors r-GAN results, due to the presence of high-density areas in the synthesized point sets.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 4: Training trends for the various generative models, in terms of coverage / fidelity to the ground truth test dataset. On the right, the curve markers indicate epochs 1, 10, 100, 200, 400, 1000, 1500, 2000, with larger symbols denoting higher epochs. See text for more details.
|
| 131 |
+
|
| 132 |
+
Comparisons to voxel-based methods. To the best of our knowledge we are the first to propose GANs on point-cloud data. To find out how our models fare against other 3D generative methods, in Table 2 and Fig. 4 we compare to a recent voxel-grid based approach (Wu et al., 2016) in terms of the JSD on the training set of the chair category - other shape categories can be found in the appendix (Table 10). We convert their voxel grid output into a point-set with 2048 points by performing farthest-point-sampling on the isosurface of the grid values. Per the authors’ suggestion, we used an isovalue parameter of 0.1 and isolated the largest connected component from the isosurface. Since Wu et al. (2016) do not use any train/test split, we perform 5 rounds of sampling 1k synthetic results from their models and report the best values of the respective evaluation metrics. The r-GAN mildly outperforms Wu et al. (2016) in terms of its diversity (as measured by JSD/MMD), while also creating realistic-looking results, as shown by the classification score. The l-GANs perform even better, both in terms of classification and diversity, with less training epochs. Note also that the training time for one epoch of the l-GAN is more than an order of magnitude smaller than for the r-GAN, due to its much smaller architecture and dimensionality. For fairness, we acknowledge that since Wu et al. (2016) operates on voxel grids, it is not necessarily on equal standing when it comes to generating point clouds.
|
| 133 |
+
|
| 134 |
+
Qualitative evaluation. In Fig. 5, we show some synthetic results produced by our l-GANs (top row) and the 32-component GMM, both trained on the AE-EMD latent space. We notice high quality results from either model - this highlights the strength of our learned representation, which makes it possible for the simple GMM model to perform well. The shapes (after decoding) corresponding to the 32 means of the Gaussian components can be found in the appendix (Fig. 18), as well as results using the r-GAN (see appendix, Fig. 14). The l-GAN produces crisper and less noisy results than the r-GAN, demonstrating an advantage of using a good structural loss on the decoupled, pre-trained AE.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 5: Synthetic point clouds generated by samples produced with l-GAN (top) and 32-component GMM (bottom), both trained on the latent space of an AE using the EMD loss.
|
| 138 |
+
|
| 139 |
+
Extensions to multiple classes We have performed experiments with an AE-EMD trained on a mixed set containing point clouds from 5 categories (chair, airplane, car, table, sofa). The training and testing datasets for this AE were constructed by randomly picking and adding models from each class; 2K models per class for the training set, 200 models for testing and 100 for validation. The multi-class AE has the same bottleneck size of 128 and was trained for 1000 epochs. We compare against the class-specific AEs with the 85-5-10 train-val-test-split, which we trained for 500 epochs. The precise AE model in all cases was selected based on the minimal reconstruction loss on the the respective validation set. On top of all six AEs, we train six l-WGANs for 2K epochs, and evaluate their fidelity/coverage using the MMD-CD between the respective testing sets and a synthesized dataset of $3 \mathbf { x }$ the size, as above. It turns out that the l-WGANs based on the multi-class AE perform similarly to the dedicated class-specifically trained ones (Table 4). A qualitative comparison (Fig. 6) also reveals that by using a multi-class AE-EMD we do not sacrifice much in terms of visual quality compared to the dedicated AEs.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 6: Synthetic point clouds generated by samples produced with l-WGANs trained in the latent space of an AE-EMD trained on a multi-class dataset.
|
| 143 |
+
|
| 144 |
+
<table><tr><td></td><td>airplane</td><td>car</td><td>chair</td><td>sofa</td><td>table</td><td>average</td><td>multi-class</td></tr><tr><td>train</td><td>0.0004</td><td>0.0006</td><td>0.0015</td><td>0.0011</td><td>0.0013</td><td>0.0010</td><td>0.0011</td></tr><tr><td>test</td><td>0.0006</td><td>0.0007</td><td>0.0019</td><td>0.0014</td><td>0.0017</td><td>0.0013</td><td>0.0014</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 4: MMD-CD measurements for l-WGANs stopped at the two-thousand epoch and trained on the latent spaces of dedicated (left 5 columns) and multi-class EMD-AEs (right column). The “average” measurement is computed as the weighted average of the per-class values, using the number of train resp. test examples for each class as weights.
|
| 147 |
+
|
| 148 |
+
Limitations. Fig. 7 shows some failure cases of our models. Chairs with rare geometries (left two images) are sometimes not faithfully decoded. Additionally, the AEs may miss high-frequency geometric details, e.g. a hole in the back of a chair (middle), thus altering the style of the input shape. Finally, the r-GAN often struggles to create realistic-looking shapes (right) for some shape classes – while the r-GAN chairs that are easily visually recognizable, it has a harder time on cars. Designing more robust raw-GANs for point clouds remain an interesting avenue for future work.
|
| 149 |
+
|
| 150 |
+
# 5 RELATED WORK
|
| 151 |
+
|
| 152 |
+
A number of recent works (Wu et al. (2016), Wang et al. (2016), Girdhar et al. (2016b), Brock et al. (2016), Maimaitimin et al. (2017), Zhu et al. (2016)) have explored generative and discriminative representations for geometry. They operate on different modalities, typically voxel grids or view-based image projections. To the best of our knowledge, our work is the first to study such representations for point clouds.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 7: Limitations: The AEs might fail to reconstruct shapes of uncommon/overly detailed geometry (left four images). The r-GAN may synthesize noisy/unrealistic results, cf. a car (right).
|
| 156 |
+
|
| 157 |
+
Training Gaussian mixture models (GMM) in the latent space of an autoencoder is closely related to VAEs (Kingma & Welling, 2013). One documented issue with VAEs is over-regularization: the regularization term associated with the prior, is often so strong that reconstruction quality suffers (Bowman et al., 2015; Sønderby et al., 2016; Kingma et al., 2016; Dilokthanakul et al., 2016). The literature contains methods that start only with a reconstruction penalty and slowly increase the weight of the regularizer. In our case, we find that fixing the AE before we train our generative models yields good results.
|
| 158 |
+
|
| 159 |
+
# 6 CONCLUSION
|
| 160 |
+
|
| 161 |
+
We presented a novel set of architectures for 3D point-cloud representation learning and generation. Our results show good generalization to unseen data and our representations encode meaningful semantics. In particular our generative models are able to produce faithful samples and cover most of the ground truth distribution without memorizing a few examples. Interestingly, we see that the best-performing generative model in our experiments is a GMM trained in the fixed latent space of an AE. While, this might not be a universal result, it suggests that simple classic tools should not be dismissed. A thorough investigation on the conditions under which simple latent GMMs are as powerful as adversarially trained models would be of significant interest.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. In NIPS 2016 Workshop on Adversarial Training. In review for ICLR, volume 2016, 2017.
|
| 166 |
+
|
| 167 |
+
Mario Botsch, Leif Kobbelt, Mark Pauly, Pierre Alliez, and Br uno Levy. Polygon Mesh Processing. AK Peters, 2010. ISBN 978-1-56881-426-1.
|
| 168 |
+
|
| 169 |
+
Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.
|
| 170 |
+
|
| 171 |
+
André Brock, Theodore Lim, James M. Ritchie, and Nick Weston. Generative and discriminative voxel modeling with convolutional neural networks. CoRR, 2016.
|
| 172 |
+
|
| 173 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. CoRR, abs/1312.6203, 2013.
|
| 174 |
+
|
| 175 |
+
Angel X. Chang, Thomas A. Funkhouser, Leonidas J. Guibas, Pat Hanrahan, Qi-Xing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. Shapenet: An information-rich 3d model repository. CoRR, abs/1512.03012, 2015.
|
| 176 |
+
|
| 177 |
+
Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016.
|
| 178 |
+
|
| 179 |
+
Ding-Yun Chen, Xiao-Pei Tian, Yu-Te Shen, and Ming Ouhyoung. On Visual Similarity Based 3D Model Retrieval. Computer Graphics Forum, 2003. ISSN 1467-8659. doi: 10.1111/1467-8659. 00669.
|
| 180 |
+
|
| 181 |
+
Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 3837–3845, 2016.
|
| 182 |
+
|
| 183 |
+
Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in neural information processing systems, pp. 1486–1494, 2015.
|
| 184 |
+
|
| 185 |
+
Nat Dilokthanakul, Pedro AM Mediano, Marta Garnelo, Matthew CH Lee, Hugh Salimbeni, Kai Arulkumaran, and Murray Shanahan. Deep unsupervised clustering with gaussian mixture variational autoencoders. arXiv preprint arXiv:1611.02648, 2016.
|
| 186 |
+
|
| 187 |
+
Haoqiang Fan, Hao Su, and Leonidas J. Guibas. A point set generation network for 3d object reconstruction from a single image. CoRR, abs/1612.00603, 2016.
|
| 188 |
+
|
| 189 |
+
Rohit Girdhar, David F. Fouhey, Mikel Rodriguez, and Abhinav Gupta. Learning a Predictable and Generative Vector Representation for Objects, pp. 484–499. Springer International Publishing, Cham, 2016a. ISBN 978-3-319-46466-4. doi: 10.1007/978-3-319-46466-4_29.
|
| 190 |
+
|
| 191 |
+
Rohit Girdhar, David F Fouhey, Mikel Rodriguez, and Abhinav Gupta. Learning a predictable and generative vector representation for objects. In European Conference on Computer Vision, pp. 484–499. Springer, 2016b.
|
| 192 |
+
|
| 193 |
+
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.
|
| 194 |
+
|
| 195 |
+
Ishaan Gulrajani, Faruk Ahmed, Martín Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of wasserstein gans. CoRR, abs/1704.00028, 2017.
|
| 196 |
+
|
| 197 |
+
Vishakh Hegde and Reza Zadeh. Fusionnet: 3d object classification using multiple data representations. arXiv preprint arXiv:1607.05695, 2016.
|
| 198 |
+
|
| 199 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. CoRR, 2015.
|
| 200 |
+
|
| 201 |
+
Evangelos Kalogerakis, Melinos Averkiou, Subhransu Maji, and Siddhartha Chaudhuri. 3d shape segmentation with projective convolutional networks. CoRR, abs/1612.02808, 2016.
|
| 202 |
+
|
| 203 |
+
Michael Kazhdan, Thomas Funkhouser, and Szymon Rusinkiewicz. Rotation invariant spherical harmonic representation of 3d shape descriptors. In Proceedings of the 2003 Eurographics/ACM SIGGRAPH Symposium on Geometry Processing, SGP ’03, pp. 156–164, Aire-la-Ville, Switzerland, Switzerland, 2003. Eurographics Association. ISBN 1-58113-687-0.
|
| 204 |
+
|
| 205 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
|
| 206 |
+
|
| 207 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 208 |
+
|
| 209 |
+
Diederik P Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. arXiv preprint arXiv:1606.04934, 2016.
|
| 210 |
+
|
| 211 |
+
Thomas Lewiner, Helio Lopes, Antonio Wilson Vieira, and Geovan Tavares. Efficient implementation of marching cubes’ cases with topological guarantees, 2003.
|
| 212 |
+
|
| 213 |
+
Andrew L. Maas, Awni Y. Hannun, and Andrew Y. Ng. Rectifier nonlinearities improve neural network acoustic models. In Proceedings of the 30 th International Conference on Ma- chine Learning (ICML-13), 2013.
|
| 214 |
+
|
| 215 |
+
Maierdan Maimaitimin, Keigo Watanabe, and Shoichi Maeyama. Stacked convolutional autoencoders for surface recognition based on 3d point cloud data. Artificial Life and Robotics, pp. 1–6, 2017. ISSN 1614-7456. doi: 10.1007/s10015-017-0350-9.
|
| 216 |
+
|
| 217 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. arXiv preprint arXiv:1612.00593, 2016a.
|
| 218 |
+
|
| 219 |
+
Charles Ruizhongtai Qi, Hao Su, Matthias Nießner, Angela Dai, Mengyuan Yan, and Leonidas J. Guibas. Volumetric and multi-view cnns for object classification on 3d data. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 5648–5656, 2016b. doi: 10.1109/CVPR.2016.609.
|
| 220 |
+
|
| 221 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J. Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. CoRR, abs/1706.02413, 2017.
|
| 222 |
+
|
| 223 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 224 |
+
|
| 225 |
+
Yossi Rubner, Carlo Tomasi, and Leonidas J. Guibas. The earth mover’s distance as a metric for image retrieval. International Journal of Computer Vision, (2):99–121, 2000. ISSN 1573-1405. doi: 10.1023/A:1026543900054.
|
| 226 |
+
|
| 227 |
+
David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by back-propagating errors. Cognitive modeling, 5(3):1, 1988.
|
| 228 |
+
|
| 229 |
+
Raif M. Rustamov, Maks Ovsjanikov, Omri Azencot, Mirela Ben-Chen, Frédéric Chazal, and Leonidas Guibas. Map-based exploration of intrinsic shape differences and variability. ACM Trans. Graph., 32(4):72:1–72:12, July 2013. ISSN 0730-0301. doi: 10.1145/2461912.2461959.
|
| 230 |
+
|
| 231 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2226–2234, 2016.
|
| 232 |
+
|
| 233 |
+
Abhishek Sharma, Oliver Grau, and Mario Fritz. Vconv-dae: Deep volumetric shape learning without object labels. In Geometry Meets Deep Learning Workshop at European Conference on Computer Vision (ECCV-W), 2016.
|
| 234 |
+
|
| 235 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. How to train deep variational autoencoders and probabilistic ladder networks. arXiv preprint arXiv:1602.02282, 2016.
|
| 236 |
+
|
| 237 |
+
Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik G. Learned-Miller. Multi-view convolutional neural networks for 3d shape recognition. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pp. 945–953, 2015. doi: 10.1109/ICCV.2015.114.
|
| 238 |
+
|
| 239 |
+
Maxim Tatarchenko, Alexey Dosovitskiy, and Thomas Brox. Octree generating networks: Efficient convolutional architectures for high-resolution 3d outputs. arXiv preprint arXiv:1703.09438, 2017.
|
| 240 |
+
|
| 241 |
+
Yueqing Wang, Zhige Xie, Kai Xu, Yong Dou, and Yuanwu Lei. An efficient and effective convolutional auto-encoder extreme learning machine network for 3d feature learning. Neurocomputing, 174:988–998, 2016.
|
| 242 |
+
|
| 243 |
+
Lingyu Wei, Qixing Huang, Duygu Ceylan, Etienne Vouga, and Hao Li. Dense human body correspondences using convolutional networks. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 1544–1553, 2016. doi: 10.1109/CVPR.2016.171.
|
| 244 |
+
|
| 245 |
+
Jiajun Wu, Chengkai Zhang, Tianfan Xue, Bill Freeman, and Josh Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 82–90. Curran Associates, Inc., 2016.
|
| 246 |
+
|
| 247 |
+
Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7-12, 2015, pp. 1912–1920, 2015. doi: 10.1109/CVPR.2015.7298801.
|
| 248 |
+
|
| 249 |
+
Li Yi, Vladimir G. Kim, Duygu Ceylan, I-Chao Shen, Mengyan Yan, Hao Su, Cewu Lu, Qixing Huang, Alla Sheffer, and Leonidas J. Guibas. A scalable active framework for region annotation in 3d shape collections. ACM Trans. Graph., (6):210:1–210:12, 2016a.
|
| 250 |
+
|
| 251 |
+
Li Yi, Hao Su, Xingwen Guo, and Leonidas J. Guibas. Syncspeccnn: Synchronized spectral CNN for 3d shape segmentation. CoRR, 2016b.
|
| 252 |
+
|
| 253 |
+
Zhuotun Zhu, Xinggang Wang, Song Bai, Cong Yao, and Xiang Bai. Deep learning representation using autoencoder for 3d shape retrieval. 2016.
|
| 254 |
+
|
| 255 |
+
# A AE DETAILS
|
| 256 |
+
|
| 257 |
+
The encoding layers of our AEs were implemented as 1D-convolutions with ReLUs, with kernel size of 1 and stride of 1, i.e. treating each 3D point independently. Their decoding layers, were MLPs built with FC-ReLUs. We used Adam (Kingma & Ba, 2014) with initial learning rate of 0.0005, $\beta _ { 1 }$ of 0.9 and a batch size of 50 to train all AEs.
|
| 258 |
+
|
| 259 |
+
# A.1 AE USED FOR SVM-BASED EXPERIMENTS
|
| 260 |
+
|
| 261 |
+
For the AE mentioned in the beginning of Section 4.1 and which was used for the SVM-related experiments, we used an encoder with 128, 128, 256 and 512 filters in each of its layers and a decoder with 1024, 2048, $2 0 4 8 \times 3$ neurons, respectively. Batch normalization was used between every layer. We also used online data augmentation by applying random rotations along the gravity- $\mathbf { \tau } ( \mathbf { Z } )$ -axis to the input point-clouds of each batch. We trained this AE for 1000 epochs with the CD loss and for 1100 with the EMD.
|
| 262 |
+
|
| 263 |
+
# A.2 ALL OTHER AES
|
| 264 |
+
|
| 265 |
+
For all other AEs, the encoder had 64, 128, 128, 256 and $k$ filters at each layer, with $k$ being the bottle-neck size. The decoder was comprised by 3 FC-ReLU layers with 256, 256, $2 0 4 8 \times 3$ neurons each. We trained these AEs for a maximum of 500 epochs when using single class data and 1000 epochs for the sole experiment involving 5 shape classes (end of Section 4.2)
|
| 266 |
+
|
| 267 |
+
Remark. Different AE setups (denoising/regularised) brought no noticeable advantage over our “vanilla” architecture. Adding drop-out layers resulted in worse reconstructions and using batch-norm on the encoder only, sped up training and gave us slightly better generalization error when the AE was trained with single-class data.
|
| 268 |
+
|
| 269 |
+
# B R-GAN DETAILS
|
| 270 |
+
|
| 271 |
+
The discriminator’s first 5 layers are 1D-convolutions with stride/kernel of size 1 and $\{ 6 4 , 1 2 8 , 2 5 6 , 2 5 6 , 5 1 2 \}$ filters each; interleaved with leaky-ReLU. They are followed by a featurewise max-pool. The last 2 FC-leaky-ReLU layers have $\{ 1 2 8 , 6 4 \}$ , neurons each and they lead to single sigmoid neuron. We used 0.2 units of leak.
|
| 272 |
+
|
| 273 |
+
The generator consists of 5 FC-ReLU layers with $\{ 6 4 , 1 2 8 , 5 1 2 , 1 0 2 4 , 2 0 4 8 \times 3 \}$ neurons each. We trained r-GAN with Adam with an initial learning rate of 0.0001, and $b e t a _ { 1 }$ of 0.5 in batches of size 50. The noise vector was drawn by a spherical Gaussian of 128 dimensions with zero mean and 0.2 units of standard deviation.
|
| 274 |
+
|
| 275 |
+
# C L-GAN DETAILS
|
| 276 |
+
|
| 277 |
+
The discriminator consists of 2 FC-ReLU layers with $\{ 2 5 6 , 5 1 2 \}$ neurons each and a final FC layer with a single sigmoid neuron. The generator consists of 2 FC-ReLUs with $\{ 1 2 8 , k = 1 2 8 \}$ neurons each. When used the l-Wasserstein-GAN, we used a gradient penalty regularizer $\lambda = 1 0$ and trained the critic for 5 iterations per one iteration of the generator. The training parameters (learning rate, batch size) and the generator’s noise distribution were the same as those used for the r-GAN.
|
| 278 |
+
|
| 279 |
+
# D SVM PARAMETERS FOR AUTOENCODER EVALUATION
|
| 280 |
+
|
| 281 |
+
For the classification experiments of Section 4.1 we used a one-versus-rest linear SVM classifier with an $l _ { 2 }$ norm penalty and balanced class weights. The exact optimization parameters can be found in Table 5.
|
| 282 |
+
|
| 283 |
+
<table><tr><td rowspan=2 colspan=1>Structural Loss</td><td rowspan=1 colspan=3>ModelNet40</td><td rowspan=1 colspan=3>ModelNet10</td></tr><tr><td rowspan=1 colspan=1>C-penalty</td><td rowspan=1 colspan=1>intercept</td><td rowspan=1 colspan=1>loss</td><td rowspan=1 colspan=1>C-penalty</td><td rowspan=1 colspan=1>intercept</td><td rowspan=1 colspan=1>loss</td></tr><tr><td rowspan=1 colspan=1>EMD</td><td rowspan=1 colspan=1>0.09</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>hinge</td><td rowspan=1 colspan=1>0.02</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>squared-hinge</td></tr><tr><td rowspan=1 colspan=1>CD</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>0.4</td><td rowspan=1 colspan=1>squared-hinge</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>squared-hinge</td></tr></table>
|
| 284 |
+
|
| 285 |
+
Table 5: Training parameters of SVMs used in each dataset with each structural loss of the AE. $C$ -penalty: term controlling the trade-off between the size of the learned margin and the misclassification’s rate; intercept: extra dimension appended on the input features to center them; loss: svm’s optimization loss function.
|
| 286 |
+
|
| 287 |
+
# E AE RECONSTRUCTION QUALITY
|
| 288 |
+
|
| 289 |
+
Table 6 shows the reconstruction quality of the two AEs (CD- and EMD-based), in terms of the JSD of the reconstructed datasets with respect to their ground truth counterparts. Note that, in general, the quality of reconstruction is comparable between the training and test datasets, indicating that the AEs are indeed able to generalize.
|
| 290 |
+
|
| 291 |
+
<table><tr><td>Method</td><td>JSD (Tr)</td><td>JSD (Te)</td><td>MMD-CD (Tr)</td><td>MMD-EMD(Tr)</td></tr><tr><td>AE-CD</td><td>0.0216</td><td>0.0243</td><td>0.0004</td><td>0.0753</td></tr><tr><td>AE-EMD</td><td>0.0028</td><td>0.0067</td><td>0.0005</td><td>0.0527</td></tr></table>
|
| 292 |
+
|
| 293 |
+
Table 6: Effect of loss-type for AE reconstructions. The EMD loss gives rise to reconstructions with significantly better JSD compared to Chamfer. MMD-measurements favor the AE that was trained with the same loss under which the MMD measurement is computed. (Tr: Train split, Te: Test split)
|
| 294 |
+
|
| 295 |
+
# F APPLICATIONS OF THE LATENT SPACE REPRESENTATION
|
| 296 |
+
|
| 297 |
+
For shape editing applications, we use the embedding we learned with the AE-EMD trained across all 55 object classes, not separately per-category. This showcases its ability to encode features for different shapes, and enables interesting applications involving different kinds of shapes.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 8: Editing parts in point clouds using vector arithmetic on the AE latent space. Left to right: tuning the appearance of cars towards the shape of convertibles, adding armrests to chairs, removing handle from mug.
|
| 301 |
+
|
| 302 |
+
Editing shape parts. We use the shape annotations of $\mathrm { Y i }$ et al.Yi et al. (2016a) as guidance to modify shapes. As an example, assume that a given object category (e.g. chairs) can be further subdivided into two sub-categories $\mathcal { A }$ and $\boldsymbol { B }$ : every object $A \in { \mathcal { A } }$ possesses a certain structural property (e.g. has armrests, is four-legged, etc.) and objects $B \in B$ do not. Using our latent representation we can model this structural difference between the two sub-categories by the difference between their average latent representations $\mathbf { x } _ { B } - \mathbf { x } _ { A }$ , where $\mathbf { x } _ { \mathcal { A } } = \sum _ { A \in \mathcal { A } } \mathbf { x } _ { A } , \mathbf { x } _ { \mathcal { B } } = \sum _ { B \in \mathcal { B } } \mathbf { x } _ { B }$ . Then, given an object $A \ \in \ A$ , we can change its property by transforming its latent representation: $x _ { A ^ { \prime } } = x _ { A } + \mathbf { x } _ { B } - \mathbf { x } _ { A }$ , and decode $\mathbf { x } _ { \ r { A ^ { \prime } } }$ to obtain $A ^ { \prime } \in B$ . This process is shown in Figure 8. Note that the height of chairs with armrests is on average $13 \%$ smaller than the chairs without, which is reflected in the output of this process.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 9: Interpolating between different point clouds, using our latent space representation. Note the interpolation between structurally and topologically different shapes.
|
| 306 |
+
|
| 307 |
+
Interpolating shapes. By linearly interpolating between the latent representations of two shapes and decoding the result we obtain intermediate variants between the two shapes. This produces a “morph-like” sequence with the two shapes at its end points (Fig. 2, 9). Our latent representation is powerful enough to support removing and merging shape parts, which enables morphing between shapes of significantly different appearance. Our cross-category latent representation enables morphing between shapes of different classes, cfg. the second row for an interpolation between a bench and a sofa.
|
| 308 |
+
|
| 309 |
+
Shape analogies. Another demonstration of the euclidean nature of the latent space is demonstrated by finding “analogous” shapes by a combination of linear manipulations and euclidean nearestneighbor searching. Concretely, we find the difference vector between $A$ and $A ^ { \prime }$ , we add it to shape $B$ and search in the latent space for the nearest-neighbor of that result, which yields shape $B ^ { \prime }$ . We demonstrate the finding in Fig. 10 with images taken from the meshes used to derive the underlying point-clouds to help the visualization. Finding shape analogies has been of interest recently in the geometry processing community Rustamov et al. (2013).
|
| 310 |
+
|
| 311 |
+
# G MORE COMPARISONS WITH VOXEL-BASED METHODS
|
| 312 |
+
|
| 313 |
+
In this section we include preliminary results of point-cloud generators that work in conjunction with voxel-based AEs. We followed the same strategy as we did with the l-GAN but instead of using a point-cloud autoencoder we learned the latent space by an AE that works with occupancy grids of 3D shapes. For generation we used a full-GMM model with 32 centers, which was established as our best model in our previous experiments. We tried two different grid resolutions: $3 2 ^ { 3 }$ and $6 4 ^ { 3 }$ on ShapeNet’s chair class. To compare with our established “pure” point-cloud generators we converted the generated voxel-grids into 2048 points by first extracting a mesh from the grids using isosurfacing and then sampling points on the mesh using uniform area-wise sampling. We also compare against Wu et al.’s Wu et al. (2016) voxel-based GANs, which represent the “raw” GAN architecture for the case of voxel grids. For quantitative results and more details see Table 7.
|
| 314 |
+
|
| 315 |
+
Discussion. First, we see that the latent AE-based GMM models outperform Wu et al.’s “raw” GAN architecture by a big margin. In terms of coverage, using the latent representation (voxel GMM)
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 10: Shape Analogies using our learned representation. Shape $B ^ { \prime }$ relates to $B$ in the same way that shape $A ^ { \prime }$ relates to $A$ .
|
| 319 |
+
|
| 320 |
+
provides a vast improvement over the “raw” voxel GAN architecture (Wu et al.). This indicates an advantage of using latent representations for generation in the voxel modality as well. Second, we note that the performance of the $6 4 ^ { 3 }$ voxel-based GMM is comparable to the one operating at $3 2 ^ { 3 }$ resolution. This suggests that the main factor affecting fidelity of the results is not the lack of high-frequency details in the ground-truth data. Third, our point-cloud-based models outperform voxel-based models in terms of the fidelity between their output and the ground truth, as measured by the MMD.
|
| 321 |
+
|
| 322 |
+
The bigger coverage boost of the voxel-based latent-space models compared to the MMD, is likely due to the way the coverage metric is computed: one matches all generated shapes against the ground truth, regardless of the quality of the generated shape. Voxel-based models frequently produce shapes with missing components (see Fig. 11); even extremely partial instances (“outliers”) will be matched (however poorly) to an arbitrary ground truth model. This effect likely artificially increases the coverage. The histogram in Figure 12 shows distances between the GMM-generated samples and their closest matches in the ground truth. The heavier “tail” for the voxel-based method indicates the presence of such poor quality matchings. Qualitative inspection of the ground truth models that were covered by the voxel-based output but not by the point-cloud output confirmed that the covering came mostly from very poor quality partial shapes.
|
| 323 |
+
|
| 324 |
+
<table><tr><td>Metric</td><td>“raw” 64³-voxel GAN Wu et al. (2016)</td><td>latent 323-voxel GMM-32</td><td>latent 643-voxel GMM-32</td><td>latent 1283-octtree GMM-32</td><td>latent point-cloud GMM-32</td></tr><tr><td>MMD-CD</td><td>0.0046</td><td>0.0025</td><td>0.0025</td><td>0.0024</td><td>0.0018</td></tr><tr><td>MMD-EMD</td><td>0.0915</td><td>0.0742</td><td>0.0729</td><td>0.0750</td><td>0.0651</td></tr><tr><td>COV-CD</td><td>19.6</td><td>63.5</td><td>60.3</td><td>60.9</td><td>68.9</td></tr><tr><td>COV-EMD</td><td>22.4</td><td>66.6</td><td>64.8</td><td>64.7</td><td>67.4</td></tr></table>
|
| 325 |
+
|
| 326 |
+
Table 7: MMD and Coverage metrics evaluated on the output of voxel-based methods at resolutions $3 2 ^ { 3 }$ and $6 4 ^ { 3 }$ and (oct-tree based) $1 2 8 ^ { 3 }$ , matched against the chair test set, using the same protocol as in Table 3 of the main paper. Our volumetric models use GMMs with full covariances and 32 centers and 64 or 256-dimensional latent codes (for the $3 2 ^ { 3 }$ , $6 4 ^ { 3 }$ and $1 2 8 ^ { 3 }$ respectively). For the mesh conversion we used the marching cubes algorithm ((Lewiner et al., 2003)) with an iso-surface value of 0.5. The rightmost column shows the results with our point-cloud based GMM.
|
| 327 |
+
|
| 328 |
+
# G.1 VOXEL AE DETAILS
|
| 329 |
+
|
| 330 |
+
Our voxel-based AEs are fully-convolutional with the encoders consisting of 3D-Conv-ReLU layers and the decoders of 3D-Conv-Relu-transpose layers. Below, we list the parameters of consecutive layers, listed left-to-right. The layer parameters are denoted in the following manner: (number of filters, filter size). Each conv/conv-tranpose has a stride of 2 except the last layer of the $3 2 ^ { 3 }$ decoder which has 4. In the last layer of the decoders we do not use a non-linearity. The abbreviation "bn" stands for batch-normalization.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 11: Point clouds extracted from synthetic voxel-based results, after isosurfacing and point sampling. Note the missing components and appearance of noise.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 12: Histograms of MMD-distances: EMD (left) and Chamfer (right), for a purely point-cloudbased generative model (GMM with 32 full-covariance components, in orange) and a voxel-based model (a latent-GAN trained on a voxel-based AE of resolution $6 4 ^ { 3 }$ , in blue). Note the larger MMD values for the voxel based approach, indicating results of lower fidelity.
|
| 337 |
+
|
| 338 |
+
• $3 2 ^ { 3 }$ - model Encoder: Input $ ( 3 2 , 6 ) ( 3 2 , 6 ) \mathrm { b n } ( 6 4 , 4 ) ( 6 4 , 2 ) \mathrm { b n } ( 6 4 , 2 )$ Decoder: (6 $4 , 2 ) ( 3 2 , 4 ) \mathrm { b n } ( 3 2 , 6 ) ( 1 , 8 ) \mathrm { C }$ utput
|
| 339 |
+
• $6 4 ^ { 3 }$ - model Encoder: $\mathrm { I n p u t } \to ( 3 2 , 6 ) \to ( 3 2 , 6 ) \to \mathrm { b n } \to ( 6 4 , 4 ) \to ( 6 4 , 4 ) \to \mathrm { b n } \to ( 6 4 , 2 )$ $ ( 6 4 , 2 )$ Decoder: $( 6 4 , 2 ) ( 3 2 , 4 ) \mathrm { b n } ( 3 2 , 6 ) ( 3 2 , 6 ) \mathrm { b n } ( 3 2 , 8 ) ( 1 , 8 )$ Output
|
| 340 |
+
|
| 341 |
+
We train each AE for 100 epochs with Adam under the binary cross-entropy loss. The learning rate was 0.001, the $\beta _ { 1 } 0 . 9$ and the batch size 64. To validate our voxel AE architectures, we compared them in terms of reconstruction quality to the state-of-the-art method of Tatarchenko et al. (2017) and obtained comparable results, as demonstrated in Table 8.
|
| 342 |
+
|
| 343 |
+
<table><tr><td>Voxel Resolution</td><td>32</td><td>64</td></tr><tr><td>Ours</td><td>92.7</td><td>88.4</td></tr><tr><td>(Tatarchenko et al., 2017)</td><td>93.9</td><td>90.4</td></tr></table>
|
| 344 |
+
|
| 345 |
+
Table 8: Reconstruction quality statistics for our dense voxel-based AE and the one of Tatarchenko et al. (2017) for the ShapeNetCars dataset. Both approaches use a 0.5 occupancy threshold and the train-test split of Tatarchenko et al. (2017). Reconstruction quality is measured by measuring the intersection-over-union between the input and synthesized voxel grids, namely the ratio between the volume in the voxel grid that is 1 in both grids divided by the volume that is 1 in at least one grid.
|
| 346 |
+
|
| 347 |
+
# H MEMORIZATION BASELINE
|
| 348 |
+
|
| 349 |
+
Here we compare our GMM-generator against a model that memorizes the training data of the chair class. To do this, we either consider the entire training set or randomly sub-sample it, to create sets of different sizes. We then evaluate our metrics between these ”memorized” sets and the point-clouds of test split (see Table 9). The coverage/fidelity obtained by our generative models (last row) is slightly lower than the equivalent in size case (third row) as expected: memorizing the training set produces good coverage/fidelity with respect to the test set when they are both drawn from the same population. This speaks for the validity of our metrics. Naturally, the advantage of using a learned representation lies in learning the structure of the underlying space instead of individual samples, which enables compactly representing the data and generating novel shapes as demonstrated by our interpolations. In particular, note that while some mode collapse is present in our generative results, as indicated by the $\sim 1 0 \%$ drop in coverage, the achieved MMD of our generative models is almost identical to that of the memorization case, indicating excellent fidelity.
|
| 350 |
+
|
| 351 |
+
<table><tr><td>Sample Set Size</td><td>COV-CD</td><td>MMD-CD</td><td>COV-EMD</td><td>MMD-EMD</td></tr><tr><td>Entire |Trainl</td><td>97.3</td><td>0.0013</td><td>98.2</td><td>0.0545</td></tr><tr><td>1 × ITestl</td><td>54.0</td><td>0.0023</td><td>51.9</td><td>0.0699</td></tr><tr><td>3 × ITestl</td><td>79.4</td><td>0.0018</td><td>78.6</td><td>0.0633</td></tr><tr><td>Full-GMM/32 (3 × ITestl)</td><td>68.9</td><td>0.0018</td><td>67.4</td><td>0.0651</td></tr></table>
|
| 352 |
+
|
| 353 |
+
Table 9: Quantitative results of a baseline sampling/memorizing model, for different sizes of sets sampled from the training set and evaluated against the test split. The first three rows show results of a memorizing model, while the third row corresponds to our generative model. The first row shows the results of memorizing the entire training chair dataset. The second and third rows show the averages of three repetitions of the sub-sampling procedure with different random seeds.
|
| 354 |
+
|
| 355 |
+
# I MORE COMPARISONS WITH WU ET AL.
|
| 356 |
+
|
| 357 |
+
In Tables 10, 11, 12 we provide more comparisons with Wu et al. (2015) for the major ShapeNet classes for which the authors have made publicly available their models. In Table 10 we provide JSD-based comparisons for two of our models (see details in main paper 4.2.) In Tables 11, 12 we provide MMD/Coverage comparisons on the test split following the same protocol as in Table 3.
|
| 358 |
+
|
| 359 |
+
<table><tr><td rowspan="2">Class</td><td rowspan="2">Wu et al. (2016) train+test</td><td colspan="2">L-GAN (AE-EMD)</td><td colspan="2">Full GMM/32 (AE-EMD)</td></tr><tr><td>train</td><td>test</td><td>train</td><td>test</td></tr><tr><td>airplane</td><td>1</td><td>0.0149</td><td>0.0268</td><td>0.0065</td><td>0.0191</td></tr><tr><td>car</td><td>0.1890</td><td>0.0081</td><td>0.0109</td><td>0.0063</td><td>0.0108</td></tr><tr><td>rifle</td><td>0.2012</td><td>0.0212</td><td>0.0364</td><td>0.0092</td><td>0.0214</td></tr><tr><td>sofa</td><td>0.1812</td><td>0.0102</td><td>0.0102</td><td>0.0102</td><td>0.0101</td></tr><tr><td>table</td><td>0.2472</td><td>0.0058</td><td>0.0177</td><td>0.0035</td><td>0.0143</td></tr></table>
|
| 360 |
+
|
| 361 |
+
Table 10: JSD-based comparison between Wu et al. (2016) and our generative models. Full GMM/32 stands for a GM model trained on the latent space of our AE with the EMD structural loss. Note that the l-GAN here uses the same “vanilla” adversarial objective as Wu et al. (2016).
|
| 362 |
+
|
| 363 |
+
Table 11: EMD based MMD and Coverage comparison between Wu et al. (2016) and our generative model on the test split of each class. Full GMM/32 stands for a GM model trained on the latent space of our AE with the EMD structural loss. Note that Wu et al. used all models of each class for training.
|
| 364 |
+
|
| 365 |
+
<table><tr><td rowspan="2">Class</td><td colspan="2">MMD-EMD</td><td colspan="2">COV-EMD</td></tr><tr><td>Wu et al. (2016)</td><td>Full GMM/32</td><td>Wu et al. (2016)</td><td>Full GMM/32</td></tr><tr><td>airplane</td><td>■</td><td>0.0387</td><td>=</td><td>69.6</td></tr><tr><td>car</td><td>0.0591</td><td>0.0418</td><td>28.6</td><td>65.3</td></tr><tr><td>rifle</td><td>0.0512</td><td>0.0459</td><td>69.0</td><td>74.8</td></tr><tr><td>sofa</td><td>0.0773</td><td>0.0554</td><td>52.53</td><td>66.6</td></tr><tr><td>table</td><td>0.1038</td><td>0.0615</td><td>18.35</td><td>71.1</td></tr></table>
|
| 366 |
+
|
| 367 |
+
Table 12: CD based MMD and Coverage comparison between Wu et al. (2016) and our generative model on the test split of each class. Full GMM/32 stands for a GM model trained on the latent space of our AE with the EMD structural loss. Note that Wu et al. used all models of each class for training.
|
| 368 |
+
|
| 369 |
+
<table><tr><td rowspan="2">Class</td><td colspan="2">MMD-CD</td><td colspan="2">COV-CD</td></tr><tr><td>Wu et al. (2016)</td><td>Full GMM/32</td><td>Wu et al. (2016)</td><td>Full GMM/32</td></tr><tr><td>airplane</td><td>1</td><td>0.0005</td><td>1</td><td>71.1</td></tr><tr><td>car</td><td>0.0015</td><td>0.0007</td><td>22.9</td><td>63.0</td></tr><tr><td>rifle</td><td>0.0008</td><td>0.0005</td><td>56.7</td><td>71.7</td></tr><tr><td>sofa</td><td>0.0027</td><td>0.0013</td><td>42.40</td><td>75.5</td></tr><tr><td>table</td><td>0.0058</td><td>0.0016</td><td>16.7</td><td>71.7</td></tr></table>
|
| 370 |
+
|
| 371 |
+
# J FURTHER EVALUATION AND RESULTS
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
Figure 13: Confusion matrix for the SVM-based classification of Section 4.1, for the Chamfer loss on ModelNet40. The class pairs most confused by the classifier are dresser/nightstand, flower pot/plant. Better viewed in the electronic version.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 14: Synthetic results produced by the r-GAN. From left to right: airplanes, car, chairs, sofas.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 15: The optimal bottleneck size was fixed at 128 by observing the reconstruction loss of the AEs, shown here for various bottleneck sizes.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 16: Generalization error of the various GAN models, at various training epochs. Generalization is estimated using the JSD (left) and MMD-CD (right) metrics, which measure closeness of the synthetic results to the training resp. test ground truth distributions. The plots show the measurements of various GANs.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 17: GMM model selection. GMMs with a varying number of Gaussians and covariance type are trained on the latent space learned by and AE trained with EMD and a bottleneck of 128. Models with a full covariance matrix achieve significantly smaller JSD than models trained with diagonal covariance. For those with full covariance, 30 or more clusters seem sufficient to achieve minimal JSD. On the right, the values in a typical covariance matrix of a Gaussian component are shown in pseudocolor - note the strong off-diagonal components.
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 18: The 32 centers of the GMM fitted to the latent codes, and decoded using the decoder of the AE-EMD.
|
| 390 |
+
|
| 391 |
+
Table 13: Evaluation of five generators on test-split of chair data on epochs/models that were selected via minimal MMD-CD on the validation-split. The reported scores are averages of three pseudo-random repetitions. Compare this with Table 3. Note that the overall quality of the selected models remains the same, irrespective of the metric used for the selection. GMM-40-F stands for a GMM with 40 Gaussian components with full covariances.
|
| 392 |
+
|
| 393 |
+
<table><tr><td>Method</td><td>Epoch</td><td>JSD</td><td>MMD-CD</td><td>MMD-EMD</td><td>COV-EMD</td><td>COV-CD</td></tr><tr><td>r-GAN</td><td>1350</td><td>0.1893</td><td>0.0020</td><td>0.1265</td><td>19.4</td><td>54.7</td></tr><tr><td>1-GAN (AE-CD)</td><td>300</td><td>0.0463</td><td>0.0020</td><td>0.0800</td><td>32.6</td><td>58.2</td></tr><tr><td>1-GAN (AE-EMD)</td><td>200</td><td>0.0319</td><td>0.0022</td><td>0.0684</td><td>57.6</td><td>58.7</td></tr><tr><td>1-WGAN (AE-EMD)</td><td>1700</td><td>0.0240</td><td>0.0020</td><td>0.0664</td><td>64.2</td><td>64.7</td></tr><tr><td>GMM-40-F (AE-EMD)</td><td>-</td><td>0.0182</td><td>0.0018</td><td>0.0646</td><td>68.6</td><td>69.3</td></tr></table>
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 19: Training trends in terms of the MMD-CD metric for the various GANs. Here, we sample a set of synthetic point-clouds for each model, of size 3x the size of the ground truth test dataset, and measure how well this synthetic dataset matches the ground truth in terms of MMD-CD. This plot complements Fig. 4 (left), where a different evaluation measure was used - note the similar behavior.
|
md/train/BJLmN8xRW/BJLmN8xRW.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CHARACTER LEVEL BASED DETECTION OF DGA DOMAIN NAMES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recently several different deep learning architectures have been proposed that take a string of characters as the raw input signal and automatically derive features for text classification. Few studies are available that compare the effectiveness of these approaches for character based text classification with each other. In this paper we perform such an empirical comparison for the important cybersecurity problem of DGA detection: classifying domain names as either benign vs. produced by malware (i.e., by a Domain Generation Algorithm). Training and evaluating on a dataset with 2M domain names shows that there is surprisingly little difference between various convolutional neural network (CNN) and recurrent neural network (RNN) based architectures in terms of accuracy, prompting a preference for the simpler architectures, since they are faster to train and less prone to overfitting.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Malware is software that infects computers in order to perform unauthorized malicious activities. In order to successfully achieve its goals, the malware needs to be able to connect to a command and control (C&C) center. To this end, both the controller behind the C&C center (hereafter called botmaster) and the malware on the infected machines can run a Domain Generation Algorithm (DGA) that generates hundreds or even thousands of domains automatically. The malware then attempts at resolving each one of these domains with its local DNS server. The botmaster will have registered one or a few of these automatically generated domains. For these domains that have been actually registered, the malware will obtain a valid IP address and will be able to communicate with the C&C center.
|
| 12 |
+
|
| 13 |
+
The binary text classification task that we address in this paper is: given a domain name string as input, classify it as either malicious, i.e. generated by a DGA, or as benign. Deep neural networks have recently appeared in the literature on DGA detection Woodbridge et al. (2016); Saxe & Berlin (2017); Yu et al. (2017). They significantly outperform traditional machine learning methods in accuracy, at the price of increasing the complexity of training the model and requiring larger datasets. Independent of the work on deep networks for DGA detection, other deep learning approaches for character based text classification have recently been proposed, including deep neural network architectures designed for processing and classification of tweets (Dhingra et al. (2016); Vosoughi et al. (2016)) as well as general natural language text (Zhang et al. (2015)). No systematic study is available that compares the predictive accuracy of all these different character based deep learning architectures, leaving one to wonder which one works best for DGA detection.
|
| 14 |
+
|
| 15 |
+
To answer this open question, in this paper we compare the performance of five different deep learning architectures for character based text classification (see Table 1) for the problem of detecting DGAs. They all rely on character-level embeddings, and they all use a deep learning architecture based on convolutional neural network (CNN) layers, recurrent neural network (RNN) layers, or a combination of both. Our most important finding is that for DGA detection, which can be thought of as classification of short character strings, despite of vast differences in the deep network architectures, there is remarkably little difference among the methods in terms of accuracy and false positive rates, while they all comfortably outperform a random forest trained on human engineered features. This finding is of practical value for the design of deep neural network based classifiers for short text classification in industry and academia: it provides evidence that one can select an architecture that is faster to train, without loss of accuracy. In the context of DGA detection, optimizing the training time is of particular importance, as the models need to be retrained on a regular basis to stay current with respect to new, emerging malware.
|
| 16 |
+
|
| 17 |
+
Table 1: High level overview of recent deep learning approaches for character based text classification
|
| 18 |
+
|
| 19 |
+
<table><tr><td rowspan=1 colspan=1>Name</td><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1>Reference</td></tr><tr><td rowspan=1 colspan=1>Endgame</td><td rowspan=1 colspan=1>single LSTMlayer</td><td rowspan=1 colspan=1>Woodbridge et al. (2016)</td></tr><tr><td rowspan=1 colspan=1>Invincea</td><td rowspan=1 colspan=1>parallel CNN layers</td><td rowspan=1 colspan=1>Saxe&Berlin (2017)</td></tr><tr><td rowspan=1 colspan=1>CMU</td><td rowspan=1 colspan=1>forward LSTM layer+ backward LSTMlayer</td><td rowspan=1 colspan=1>Dhingra et al. (2016)</td></tr><tr><td rowspan=1 colspan=1>MIT</td><td rowspan=1 colspan=1> stacked CNN layers + single LSTM layer</td><td rowspan=1 colspan=1>Vosoughi et al. (2016)</td></tr><tr><td rowspan=1 colspan=1>NYU</td><td rowspan=1 colspan=1>stacked CNNlayers</td><td rowspan=1 colspan=1>Zhang et al. (2015)</td></tr></table>
|
| 20 |
+
|
| 21 |
+
# 2 BACKGROUND
|
| 22 |
+
|
| 23 |
+
Malware controllers, or botmasters, use malware for all kinds of unauthorized malicious activities. These activities range from stealing information, to exploiting the victims’ computing resources to mine bitcoin. They can also include launching a distributed denial of service attack from the victims’s computers or encrypting the victims hard drive (ransomware). In order to successfully achieve its goals, it is vital that the malware be able to connect to a command and control (C&C) center. This communication can serve many purposes. The malware can use it to send stolen information (such as passwords or access credentials) to the malware designer behind the C&C center, it can use this communication channel to receive instructions or even to update itself to a newer version.
|
| 24 |
+
|
| 25 |
+
Initially, botmasters established such a communication channel to the C&C center by hard-coding an IP address inside the malware. This approach has obvious shortcomings from the botmasters’ perspective: once the malware is reversed engineered, the IP address is discovered and shut down. Over time, malware designers came up with a much more effective strategy: Domain Generation Algorithms (DGAs). Domain Generation Algorithms work by having the malware accessing some available source of randomness and inputting it into an algorithm that generates hundreds or even thousands of domains automatically. The malware then attempts at resolving each one of these domains with its local DNS server (a DNS server runs a protocol that translates domain names into IP addresses; it is a vital piece of the Internet). The botmaster will have registered one or a few of these automatically generated domains. For these domains that have been actually registered, the malware will obtain a valid IP address and will be able to communicate with the C&C center. For all the other domains that were automatically generated but not registered, the malware obtains a message stating that these domains could not have been resolved and ignores them.
|
| 26 |
+
|
| 27 |
+
DGAs make blacklisting of domains extremely difficult, since by changing the initial randomness (while keeping the same algorithm) the malware can potentially generate completely different domains. This technique has been used by high-profile malware such as Conficker, Stuxnet (the malware designed to attack Iran nuclear facilities) and Flame. Catching domain names generated by malware has become a central topic in information security, leading to a recent interest in detecting DGA domains using machine learning techniques. Models that classify domain names as benign or malicious based solely on the domain name string are of particular interest for their generality, as context information beyond the domain name string might be unavailable or expensive to acquire. Traditional machine learning methods for DGA detection based on the domain name string rely on extraction of predefined, human engineered lexical features, see e.g. Antonakakis et al. (2012); Schiavoni et al. (2014). Whenever human engineered features are used, it is obvious that this opens the door for an adversary to carefully craft its DGA to avoid detection by using the aforementioned features. This makes maintaining such machine learning systems labor intensive. Recently proposed deep learning techniques for detecting DGAs learn features automatically, thereby offering the potential to bypass the human effort of feature engineering (Woodbridge et al. (2016); Saxe & Berlin (2017); Yu et al. (2017)). In addition these deep learning approaches outperform the traditional machine learning techniques with human engineered features in terms of accuracy and false positive rates. The choice of deep network architecture in these recent works appears fairly arbitrary, and it is unclear whether they would perform better or worse than other deep neural networks approaches for text classification that have been introduced recently, in particular character-level methods for processing and classification of tweets (Dhingra et al. (2016); Vosoughi et al. (2016)) and for general natural language text (Zhang et al. (2015)). In this paper, we provide the first comparative study of all these different methods, showing that, despite of vast differences in the architectures, they can be easily tuned to result in the same predictive accuracy.
|
| 28 |
+
|
| 29 |
+
The problem of adversarial examples, i.e. instances that have intentionally been designed to cause the model to make a mistake, are a well known problem in machine learning. The scenario sketched above — in which a malware designer exploits knowledge about the lexical features used by a random forest to craft his DGA to avoid detection — is a prime example of this. Deep neural networks are famously not immune to adversarial examples either, and generative adversarial networks (GANs) can be trained to generate them automatically (see e.g. Goodfellow et al. (2014a;b)). Specifically in the context of DGA detection, Anderson et al. (2016) have used a character-based generative adversarial network (GAN) to augment training sets in order to harden other machine learning models (like a random forest) against yet-to-be-observed DGAs. It is highly unlikely for attackers to use GANs themselves, because DGA algorithms must be light enough to be embedded inside malware code. Furthermore, generating domain names that look like a benign domain is not enough for an effective DGA. Ideally, every domain produced by a DGA must not have been registered yet or must have a low likelihood of being registered already – if a domain produced by a DGA has already been taken, it is useless for the botmaster. Combining all these requirements is essential for a serious study of adversarial generated domains and outside the scope of this paper.
|
| 30 |
+
|
| 31 |
+
# 3 METHODS
|
| 32 |
+
|
| 33 |
+
We compare five different deep learning methods for short string classification, when applied to the problem of DGA detection specifically. For each of the methods, we start from the original proposals as can be found in the references in Table 1 and only make modifications when they improve the predictive accuracy for the classification of domain names. Below we give an overview of the methods and the adaptations made. A Keras1 code snippet for each method is included in Appendix A.
|
| 34 |
+
|
| 35 |
+
The strings that we give as input to all classifiers consist of a second level domain (SLD) and a top level domain (TLD), separated by a dot, as in e.g. wikipedia.org. Following Woodbridge et al. (2016), we set the maximum length at 75 characters, padded with zeros on the left for domains whose length is less than 75.2 We convert each domain name string to lower case, since domain names are case insensitive, and encode it as an ASCII code sequence of length 128, effectively representing each domain name string as a 75 by 128 matrix in which each character corresponds to a column.
|
| 36 |
+
|
| 37 |
+
# 3.1 RNN BASED ARCHITECTURES
|
| 38 |
+
|
| 39 |
+
Endgame Model Long short-term memory networks (LSTMs), a special kind of recurrent neural networks (RNNs) have recently attracted a lot of attention because of their successful application to problems that involve processing of sequences (Hochreiter & Schmidhuber (1997)). Since domain names can be thought of as sequences of characters, LSTMs are a natural kind of classifiers to apply. The LSTM network proposed by Woodbridge et al. (2016) was designed specifically for DGA detection, so we stay very close to the original model. The network is comprised of an embedding layer, an LSTM layer (128 LSTM cells with default Tanh activation), and a single node output layer with sigmoid activation. Instead of using RMSProp as the optimization algorithm, as was done in Woodbridge et al. (2016), we switched to Adam (Kingma & Ba (2014)) because it resulted in better loss convergence results (see Section 4). The Endgame model includes dropout, a technique to improve model performance and overcome over-fitting by randomly excluding nodes during training, which serves to break up complex co-adaptations in the network Srivastava et al. (2014). This is confined to the training phase; all nodes are active during testing and deployment.
|
| 40 |
+
|
| 41 |
+
The role of the embedding layer is to learn to represent each character that can occur in a domain name by a 128-dimensional numerical vector. This vector is different from the original 128- dimensional ASCII encoding. The embedding maps semantically similar characters to similar vectors, where the notion of similarity is implicitly derived (learned) based on the classification task at hand. As will become clear in the remainder of this section, all five deep neural network architectures under study start with such an embedding layer. To allow for a fair comparison, we have made the parameter choices for the embedding layer, such as the dimensionality of the embedding space, identical for all five models. In addition, for comparison purposes, in Section 4 we also present the results of a “baseline neural network model” consisting only of an embedding layer as its hidden layer.
|
| 42 |
+
|
| 43 |
+
CMU Model Bidirectional RNNs extend regular RNNs by processing the input string in two ways. In a forward layer, the input sequence is processed from the left to the right, as in a traditional RNN, while in a backward layer, the processing happens from the right to the left. The output from the forward and the backward layer is then combined and passed on to further layers. Bidirectional LSTMs for character level text processing have been proposed in Ling et al. (2015), and, following up on that, very similar bidirectional GRUs (gated recurrent units) have been applied in a “Tweet2Vec” model for tweet classification (predicting hashtags of tweets) by Dhingra et al. (2016). We use an adaptation of the latter; see Listing 2 in Appendix A. Including dropout or replacing LSTM by GRU did not cause a significant change in predictive accuracy, although the latter did result in a decrease of training runtime.
|
| 44 |
+
|
| 45 |
+
# 3.2 CNN BASED ARCHITECTURES
|
| 46 |
+
|
| 47 |
+
NYU Model Convolutional neural networks (CNNs) are known for their ability to process input data with a grid like topology, such as images consisting of a grid of pixels. To the best of our knowledge, Zhang et al. (2015) were the first to apply 1-dimensional or “temporal” CNNs successfully to text classification at character level. Their proposed deep network architecture, which is intended to process full-blown natural language text such as news articles or reviews, includes 6 stacked CNN layers, with each subsequent layer consuming the output from the previous layer. In contrast to natural language text, domain names are very short and they do not have an internal grammatical structure, naturally resulting the original architectures from Zhang et al. (2015) to overfit on our data. We therefore reduced the number of stacked CNN layers to two, and decreased the size and the number of filters on the CNN layers (see Listing 3).
|
| 48 |
+
|
| 49 |
+
Invincea Model Saxe & Berlin (2017) proposed a CNN based classifier that takes generic short character strings as its input and learns to detect whether they are indicators of malicious behavior. The short character strings can be e.g. URLs, file paths, or registry keys. The fundamental difference between the Invincea model versus the NYU model described above, is that in the Invincea model the CNN layers are parallel instead of stacked, and that pooling always happens over the entire domain name instead of within a small pooling window. That means that the Invincea model is only detecting the presence or absence of patterns in the domain names, and does not retain any information on where exactly in the domain name string these patterns occur. In the Invincea model, the embedding layer is followed by a convolutional layer with 1024 filters, namely 256 filters for each of the sizes 2, 3, 4, and 5. Each of these filters learns to detect the soft presence of an interesting soft $n$ -gram (with $n = 2 , 3 , 4 , 5$ ). The output of the convolutional layer is consumed by two dense hidden layers, each with 1024 nodes, before reaching a single node output layer with sigmoid activation. Out of all the models that we compared, this one has the most extensive architecture.
|
| 50 |
+
|
| 51 |
+
# 3.3 HYBRID CNN/RNN BASED ARCHITECTURE
|
| 52 |
+
|
| 53 |
+
MIT Model The MIT model proposed by Vosoughi et al. (2016) is an extension of the NYU model, where the stacked CNN layers are followed by an LSTM layer. Similarly as with the NYU model, the use of multiple stacked CNN layers (which worked well for tweets in Vosoughi et al. (2016)) resulted in the models to overfit on our data. For this reason, we reduced the MIT model architecture to the minimum that preserves its spirit: one CNN layer followed by one LSTM layer.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: Training and validation loss curves. The vertical axis in Figure (f) has a different scale than the other figures, related to the fact that the “Embedding only” baseline model has a much higher loss than the other models.
|
| 57 |
+
|
| 58 |
+
# 4 RESULTS AND LEARNED REPRESENTATIONS
|
| 59 |
+
|
| 60 |
+
We trained and evaluated the models on a dataset with 1 million DGA domain names from Bambenek3 (positive examples) and the top 1 million domain names from Alexa4 (negative examples). Alexa ranks websites based on their popularity in terms of number of page views and number of unique visitors. It only retains the websites’ SLD and TLD, aggregating across any subdomains. For example, according to Alexa, the five highest ranked domain names in terms of popularity on 2017-10-26 are google.com, youtube.com, facebook.com baidu.com, and wikipedia.org. For our experiments, we assume that the top 1 million domain names in this ranking are benign domain names, although it is possible that the bottom of the ranking may contain some noise.
|
| 61 |
+
|
| 62 |
+
In addition to these benign domain names, we collected 1 million DGA domain names from the Bambenek Consulting feeds for 3 different days, namely Jun 24, Jul 22, Jul 23, 2017. These feeds contain DGA domain names from specific malware families that were observed in real traffic on those days. Such domain names can be collected by reverse engineering a known malware family, generating lists of domain names with the reverse engineered malware, and checking which of these domain names also occur in real traffic. Note that our goal in this paper is the development of a neural network classifier that can detect DGAs without the need to reverse engineer malware families. An important advantage of such a classifier is that it can also be used against new and previously unknown malware families.
|
| 63 |
+
|
| 64 |
+
Table 2: Results on test data from July 2017. Accuracy, TPR, FPR are w.r.t. a threshold that gives a FPR of 0.001 on the validation data.
|
| 65 |
+
|
| 66 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=2>Architecture</td><td rowspan=1 colspan=1>Acc</td><td rowspan=1 colspan=1>TPR</td><td rowspan=1 colspan=1>FPR</td><td rowspan=1 colspan=1>AUC@1%</td></tr><tr><td rowspan=1 colspan=1>RF</td><td rowspan=1 colspan=2>Lexical features</td><td rowspan=1 colspan=1>91.51%</td><td rowspan=1 colspan=1>83.15%</td><td rowspan=1 colspan=1>0.00128</td><td rowspan=1 colspan=1>84.77%</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=2>Lexical features</td><td rowspan=1 colspan=1>73.74%</td><td rowspan=1 colspan=1>47.61%</td><td rowspan=1 colspan=1>0.00091</td><td rowspan=1 colspan=1>58.81%</td></tr><tr><td rowspan=1 colspan=1>Embedding</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>84.29%</td><td rowspan=1 colspan=1>68.69%</td><td rowspan=1 colspan=1>0.00108</td><td rowspan=1 colspan=1>80.88%</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Endgame</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>98.72%</td><td rowspan=1 colspan=1>97.55%</td><td rowspan=1 colspan=1>0.00102</td><td rowspan=1 colspan=1>98.03%</td></tr><tr><td rowspan=1 colspan=1>Invincea</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>98.95%</td><td rowspan=1 colspan=1>98.01%</td><td rowspan=1 colspan=1>0.00109</td><td rowspan=1 colspan=1>97.47%</td></tr><tr><td rowspan=1 colspan=1>CMU</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>98.54%</td><td rowspan=1 colspan=1>97.18%</td><td rowspan=1 colspan=1>0.00108</td><td rowspan=1 colspan=1>98.25%</td></tr><tr><td rowspan=1 colspan=1>MIT</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>98.70%</td><td rowspan=1 colspan=1>97.49%</td><td rowspan=1 colspan=1>0.00099</td><td rowspan=1 colspan=1>97.55%</td></tr><tr><td rowspan=1 colspan=1>NYU</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>98.58%</td><td rowspan=1 colspan=1>97.27%</td><td rowspan=1 colspan=1>0.00116</td><td rowspan=1 colspan=1>97.93%</td></tr></table>
|
| 67 |
+
|
| 68 |
+
We randomly split the data into $80 \%$ for training, $10 \%$ for validation, and $10 \%$ for testing. Figure 1 shows the training and validation loss curves for each of the models described in Section 3. The displayed epochs indicate where we stopped the training to obtain the models used to produce the final results in Table 2 and 5. The training loss is higher than the validation loss in the pictures in Figure 1 because the loss against the training data is computed in an average way across batches (the batch size is 100) while dropout is being applied, whereas performance on the validation set is determined at the end of each epoch with dropout disabled. Figure 1(f) displays the loss curves for training a simple neural network consisting of only an embedding layer. We include the performance of this network in our results as a baseline.
|
| 69 |
+
|
| 70 |
+
The accuracy of each of the trained models when applied to the test data is recorded in Table 2. In addition to accuracy, this table includes the true positive rate (TPR) and false positive rate (FPR) for each of the models. Recall that $\mathrm { T P R } = \mathrm { T P } / ( \mathrm { T P } { + } \mathrm { F N } )$ and $\mathrm { F P R } = \mathrm { F P } / ( \mathrm { F P + T N } )$ where TP, FP, TN, and FN are the number of true positives, false positives, true negatives, and false negatives respectively. A low false positive rate is very important in deployed DGA detection systems, because blocking legitimate traffic is highly undesirable. All classifiers in Table 2 output a probability that a given instance belongs to the positive class, so we can tune a threshold probability at which to consider a prediction positive. For each model, we choose this threshold such that the model trained over the training data has a 0.001 FPR over the validation data. Then we report the accuracy, TPR and FPR obtained with this classification threshold over the test data. Finally, we also report AUC $@1 \%$ FPR, which is the integral of the ROC curve from $\mathrm { { F P R } = 0 }$ to $\mathrm { { F P R } = 0 . 0 1 }$ on the test data.
|
| 71 |
+
|
| 72 |
+
For comparison purposes, Table 2 also contains results for a Random Forest (RF) and a Multilayer Perceptron (MLP) trained on the following 11 features, extracted from each domain name string (see Yu et al. (2014; 2016)): ent (normalized entropy of characters); nl2 (median of 2-gram); nl3 (median of 3-gram); naz (symbol character ratio); hex (hex character ratio); vwl (vowel character ratio); len (domain label length); gni (gini index of characters); cer (classification error of characters); tld (top level domain hash); dgt (first character digit). The Random Forest consists of 100 trees. The MLP has a single hidden layer with 128 nodes; see Listing 7 in Appendix A. Like the deep networks in this paper, this MLP was trained with batch size 100. The values of the 11 features are normalized so that they are all on the same scale before presenting them to the MLP.
|
| 73 |
+
|
| 74 |
+
As expected, the FPR of all classifiers is around 0.001. There is a clear variation in the TPR that the classifiers achieve against that small FPR. While the Random Forest is only able to “catch” $83 \%$ of the malicious domain names, all the deep neural network architectures achieve a recall of 97- $98 \%$ . The baseline neural network consisting of only an embedding layer as its hidden layer clearly performs the worst with a TPR of less than $69 \%$ , highlighting that it is advantageous to extend the network architecture with one or more LSTM or CNN layers. Interestingly, there is little to no variation among the five deep neural network architectures in terms of TPR.
|
| 75 |
+
|
| 76 |
+
Table 3 contains examples of domain names that were randomly selected among those misclassified by either the Random Forest or by all five deep neural networks. Inspecting the column of the benign domain names, i.e. the Alexa domain names, it is interesting to note that most of those misclassified by the deep neural networks (bottom left in the table) come across as gibberish that a human annotator would likely also classify as malicious. As also evident from the top right of Table 3, the deep neural networks have become very good at considering such gibberish-looking domain names to be malicious, even though they were never explicitly told to do so (unlike the Random Forest, which explicitly includes a normalized entropy of characters feature). The fact that the malicious domain names at the bottom right of Table 3 were missed by the deep neural networks might be due to our deliberate choice to tune the classification threshold to achieve a very low FPR. This makes all the classifiers hold back from labeling a domain name as malicious if they are not almost completely certain. As explained above, a low FPR is very important in deployed DGA detection systems, as blocking legitimate traffic is highly undesirable. Note that if a deployed DGA detection system would rely on the Random Forest classifier, it would block all domain names from the first row in Table 3, whereas, if it would rely on any of the deep neural network classifiers, it would block all domain names from the second row in Table 3. The domain names from the first column would have been unjustly blocked. For those negatively affected by this, it would be easier to “understand” (and perhaps forgive) the decisions made by the deep neural network classifiers, as they are more in line with decisions that a human would make when confronted with these domain name strings.
|
| 77 |
+
|
| 78 |
+
Table 3: Examples of domain names that were either misclassified by the Random Forest or by the deep neural networks. For the malicious domain names, the name of the malware family is shown between parentheses.
|
| 79 |
+
|
| 80 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>benign</td><td rowspan=1 colspan=1>malicious</td></tr><tr><td rowspan=1 colspan=1>misclassifiedby RF&correctlyclassifiedby all fivedeep networks</td><td rowspan=1 colspan=1>kosmetikosdnr.ltjobrankingcommittee.comnaturalandhealthytips.compokemonrubysapphire.comturkcehdpornoizle.combollywoodparksdubai.com</td><td rowspan=1 colspan=1>mowvcssclilpomqi.com (murofet)ntearasildeafeninguvuc.com (banjori)raklloblmuppono.info (cryptolocker)5alolch3wvn5olcc.org (chinad)ldjucxqhivnaperisusb.ga (necurs)daeontibyxgask.cc (ranbyus)</td></tr><tr><td rowspan=1 colspan=1>misclassifiedby all fivedeep networks &correctlyclassified by RF</td><td rowspan=1 colspan=1>rfembassy.kz 4553t5pugtt1qslvsnmpc0tpfz5fo.xyz9odyefocculgririlemjijbab.topa5rtngpo9840oyd.commydwnldsghtfv.com</td><td rowspan=1 colspan=1>doycsnramt.com (qakbot)gypjuytopleh.com (ramnit)zamdazhocs.com (nymaim)mxdsbbnxmogo.online (tinba)pelkbazgro.info (pykspa)</td></tr></table>
|
| 81 |
+
|
| 82 |
+
The results in Table 2 are for DGA domain names that appeared at the same time in real traffic as the training data used to construct the classifiers, namely July 2017. To evaluate how well the trained models hold up against DGA domain names that appear at a later point, we collected an additional 100K DGA domain names from the Bambenek Consulting feeds for Dec 6, Dec 9, and Dec 10, 2017. Table 4 contains results for this “prospective” dataset. The only difference between the experimental setup for Table 2 and Table 4 are the 100K DGA domain names used in the test set. The training dataset, the validation dataset, and the 100K Alexa domain names used in the test set are kept the same. As can be seen when comparing the results in Table 2 and Table 4, the to be expected drop in TPR is minor.
|
| 83 |
+
|
| 84 |
+
As Table 5 shows there is a substantial distinction among the different models in terms of complexity (number of parameters that have to be learned during the training process) and required training time per epoch. The platform used for training is an AWS virtual machine with access to multiple GPUs. Both the number of epochs needed to train a network, and the number of seconds required per epoch, are contributing factors to the overall training runtime. The NYU model took less than 8 minutes to train, while the CMU model took as much as 10 hours. The last column in Table 5 shows the time needed to classify 200K domain names with an already trained model. The ranking of the deep networks in terms of this “scoring time” coincides with the ranking in terms of training time. Given that all deep networks achieve a similar accuracy (TPR), the NYU model with it short training and scoring time comes out as the winner.
|
| 85 |
+
|
| 86 |
+
Table 4: Results on test data from December 2017. Accuracy, TPR, FPR are w.r.t. a threshold that gives a FPR of 0.001 on the validation data.
|
| 87 |
+
|
| 88 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=2>Architecture</td><td rowspan=1 colspan=1>Acc</td><td rowspan=1 colspan=1>TPR</td><td rowspan=1 colspan=1>FPR</td><td rowspan=1 colspan=1>AUC@1%</td></tr><tr><td rowspan=1 colspan=1>RF</td><td rowspan=1 colspan=2>Lexical features</td><td rowspan=1 colspan=1>91.57%</td><td rowspan=1 colspan=1>83.26%</td><td rowspan=1 colspan=1>0.00128</td><td rowspan=1 colspan=1>84.47%</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=2>Lexical features</td><td rowspan=1 colspan=1>78.87%</td><td rowspan=1 colspan=1>57.86%</td><td rowspan=1 colspan=1>0.00091</td><td rowspan=1 colspan=1>67.23%</td></tr><tr><td rowspan=1 colspan=1>Embedding</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>86.75%</td><td rowspan=1 colspan=1>73.61%</td><td rowspan=1 colspan=1>0.00108</td><td rowspan=1 colspan=1>82.93%</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Endgame</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>98.22%</td><td rowspan=1 colspan=1>96.54%</td><td rowspan=1 colspan=1>0.00102</td><td rowspan=1 colspan=1>97.53%</td></tr><tr><td rowspan=1 colspan=1>Invincea</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>98.44%</td><td rowspan=1 colspan=1>97.00%</td><td rowspan=1 colspan=1>0.00109</td><td rowspan=1 colspan=1>97.07%</td></tr><tr><td rowspan=1 colspan=1>CMU</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>98.06%</td><td rowspan=1 colspan=1>96.23%</td><td rowspan=1 colspan=1>0.00108</td><td rowspan=1 colspan=1>97.46%</td></tr><tr><td rowspan=1 colspan=1>MIT</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>98.21%</td><td rowspan=1 colspan=1>96.52%</td><td rowspan=1 colspan=1>0.00099</td><td rowspan=1 colspan=1>97.52%</td></tr><tr><td rowspan=1 colspan=1>NYU</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>98.12%</td><td rowspan=1 colspan=1>96.35%</td><td rowspan=1 colspan=1>0.00116</td><td rowspan=1 colspan=1>97.10%</td></tr></table>
|
| 89 |
+
|
| 90 |
+
Table 5: Comparison of complexity and efficiency of classifiers for DGA detection. The complexity refers to the number of parameters that have to be learned in the deep learning architectures. The training time is reported in terms of seconds needed for an epoch times the number of epochs. The scoring time is the time in seconds needed to label 200K domain names by an already trained model.
|
| 91 |
+
|
| 92 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=2>Architecture</td><td rowspan=1 colspan=1>Complexity</td><td rowspan=1 colspan=1>Training'Time</td><td rowspan=1 colspan=1>Scoring time</td></tr><tr><td rowspan=1 colspan=1>RF</td><td rowspan=1 colspan=2>Lexical features</td><td rowspan=1 colspan=1>100 trees</td><td rowspan=1 colspan=1>1,800s</td><td rowspan=1 colspan=1>5s</td></tr><tr><td rowspan=1 colspan=1>MLP</td><td rowspan=1 colspan=2>Lexical features</td><td rowspan=1 colspan=1>1,665 par</td><td rowspan=1 colspan=1>10s× 40= 400s</td><td rowspan=1 colspan=1>1s</td></tr><tr><td rowspan=1 colspan=1>Embedding</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>25,985 par</td><td rowspan=1 colspan=1>15s × 40= 600s</td><td rowspan=1 colspan=1>3s</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Endgame</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>148,097 par</td><td rowspan=1 colspan=1>430s × 10= 4,300s</td><td rowspan=1 colspan=1>13s</td></tr><tr><td rowspan=1 colspan=1>Invincea</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>2,576,385 par</td><td rowspan=1 colspan=1>105s × 40= 4,200s</td><td rowspan=1 colspan=1>7s</td></tr><tr><td rowspan=1 colspan=1>CMU</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>115,329 par</td><td rowspan=1 colspan=1>1200s ×30= 36,000s</td><td rowspan=1 colspan=1>26s</td></tr><tr><td rowspan=1 colspan=1>MIT</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>115,137 par</td><td rowspan=1 colspan=1>800s ×15= 12,000s</td><td rowspan=1 colspan=1>10s</td></tr><tr><td rowspan=1 colspan=1>NYU</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>254,337 par</td><td rowspan=1 colspan=1>45s ×10= 450s</td><td rowspan=1 colspan=1>5s</td></tr></table>
|
| 93 |
+
|
| 94 |
+
# 5 CONCLUSION
|
| 95 |
+
|
| 96 |
+
DGA detection, i.e. the classification task of distinguishing between benign domain names and those generated by malware (Domain Generation Algorithms), has become a central topic in information security. In this paper we have compared five different deep neural network architectures that perform this classification task based purely on the domain name string, given as a raw input signal at character level. All five models, i.e. two RNN based architectures, two CNN based architectures, and one hybrid RNN/CNN architecture perform equally well, catching around $9 7 . 9 8 \%$ of malicious domain names against a false positive rate of 0.001. This roughly means that for every 970 malicious domain names that the deep networks catch, they flag only one benign domain name erroneously as malicious. A Random Forest based on human defined linguistic features achieves a recall of only $83 \%$ against the same 0.001 false positive rate when trained and tested on the same data that was used for the deep networks. The use of a deep neural network that automatically learns features is attractive in a cybersecurity setting because it is a lot harder to craft malware to avoid detection by a system that relies on automatically learned features instead of on human engineered features. An interesting direction for future work is to test the trained deep networks more extensively on domain names generated by new and previously unseen malware families.
|
| 97 |
+
|
| 98 |
+
# REFERENCES
|
| 99 |
+
|
| 100 |
+
Hyrum S Anderson, Jonathan Woodbridge, and Bobby Filar. Deepdga: Adversarially-tuned domain generation and detection. In Proceedings of the 2016 ACM Workshop on Artificial Intelligence and Security, pp. 13–21, 2016.
|
| 101 |
+
|
| 102 |
+
Manos Antonakakis, Roberto Perdisci, Yacin Nadji, Nikolaos Vasiloglou II, Saeed Abu-Nimeh, Wenke Lee, and David Dagon. From throw-away traffic to bots: Detecting the rise of DGA-based malware. In USENIX Security Symposium, volume 12, 2012.
|
| 103 |
+
|
| 104 |
+
Bhuwan Dhingra, Zhong Zhou, Dylan Fitzpatrick, Michael Muehl, and William Cohen. Tweet2vec: Character-based distributed representations for social media. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, volume 2, pp. 269–274, 2016.
|
| 105 |
+
|
| 106 |
+
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, 2014a.
|
| 107 |
+
|
| 108 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014b.
|
| 109 |
+
|
| 110 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
|
| 111 |
+
|
| 112 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. preprint arXiv:1412.6980, 2014.
|
| 113 |
+
|
| 114 |
+
Wang Ling, Tiago Lu´ıs, Lu´ıs Marujo, Ramon Fernandez Astudillo, Silvio Amir, Chris Dyer, Alan W ´ Black, and Isabel Trancoso. Finding function in form: Compositional character models for open vocabulary word representation. arXiv preprint arXiv:1508.02096, 2015.
|
| 115 |
+
|
| 116 |
+
Joshua Saxe and Konstantin Berlin. eXpose: A character-level convolutional neural network with embeddings for detecting malicious urls, file paths and registry keys. arXiv preprint arXiv:1702.08568, 2017.
|
| 117 |
+
|
| 118 |
+
Stefano Schiavoni, Federico Maggi, Lorenzo Cavallaro, and Stefano Zanero. Phoenix: DGA-based botnet tracking and intelligence. In International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment, pp. 192–211, 2014.
|
| 119 |
+
|
| 120 |
+
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.
|
| 121 |
+
|
| 122 |
+
Soroush Vosoughi, Prashanth Vijayaraghavan, and Deb Roy. Tweet2vec: Learning tweet embeddings using character-level cnn-lstm encoder-decoder. In Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, pp. 1041–1044, 2016.
|
| 123 |
+
|
| 124 |
+
Jonathan Woodbridge, Hyrum S Anderson, Anjum Ahuja, and Daniel Grant. Predicting domain generation algorithms with long short-term memory networks. preprint arXiv:1611.00791, 2016.
|
| 125 |
+
|
| 126 |
+
Bin Yu, Les Smith, and Mark Threefoot. Semi-supervised time series modeling for real-time flux domain detection on passive DNS traffic. In Proc. of the 10th International Conference on Machine Learning and Data Mining, pp. 258–271, 2014.
|
| 127 |
+
|
| 128 |
+
Bin Yu, Les Smith, Mark Threefoot, and Femi Olumofin. Behavior analysis based DNS tunneling detection with big data technologies. In Proc. of the International Conference on Internet of Things and Big Data, pp. 284–290, 2016.
|
| 129 |
+
|
| 130 |
+
Bin Yu, Daniel Gray, Jie Pan, Martine De Cock, and Anderson Nascimento. Inline dga detection with deep networks. In Proceedings of Data Mining for Cyber Security (DMCS2017), workshop at ICDM2017 (IEEE International Conference on Data Mining), 2017.
|
| 131 |
+
|
| 132 |
+
Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, volume 28, pp. 649–657, 2015.
|
| 133 |
+
|
| 134 |
+
# A KERAS CODE FOR DEEP NETWORKS
|
| 135 |
+
|
| 136 |
+
main input $=$ Input (shape $: =$ (75, ) , dtype $z '$ int32 ’, name $\mathbf { \equiv }$ ’main input’)
|
| 137 |
+
embedding $=$ Embedding(input dim ${ \tt 1 2 8 }$ , output dim ${ \tt 1 2 8 }$ , input length $= 7 5$ )(main input )
|
| 138 |
+
lstm $=$ LSTM(128, return sequence $\vDash$ False) (embedding)
|
| 139 |
+
drop $=$ Dropout(0.5) ( lstm )
|
| 140 |
+
output $=$ Dense(1, activation $= ^ { \mathrm { i } }$ ’sigmoid’) (drop)
|
| 141 |
+
model $=$ Model(inputs $\mathbf { \sigma } =$ main input, outputs $=$ output)
|
| 142 |
+
model.compile( ${ \mathrm { l o s s } } = { \ ' }$ binary crossentropy ’, optimizer $= ^ { \ ' }$ adam’)
|
| 143 |
+
main input $=$ Input (shape=(75, ) , dtype=’int32 ’, name $u = { \mathrm { i } }$ ’main input’)
|
| 144 |
+
embedding $=$ Embedding(input dim ${ \tt 1 2 8 }$ , output dim ${ \tt 1 2 8 }$ , input length $= 7 5$ )(main input )
|
| 145 |
+
bi lstm $=$ Bidirectional ( layer =LSTM(64, return sequence $\mathrm { ~ \sigma ~ } \mathrm { ~ \sigma ~ } \mathrm { ~ \sigma ~ } \mathrm { ~ \sigma ~ }$ False) , merge mode=’concat’)(embedding)
|
| 146 |
+
output $=$ Dense(1, activation $= ^ { \overrightarrow { { \mathbf { \Gamma } } } }$ ’sigmoid’) ( bi lstm )
|
| 147 |
+
model $=$ Model(inputs main input, outputs $=$ output)
|
| 148 |
+
model.compile( ${ \mathrm { l o s s } } = { \ ' }$ binary crossentropy ’, optimizer $= ^ { \ ' }$ adam’)
|
| 149 |
+
main input $=$ Input (shape $: = 1$ (75, ) , dtype $= ^ { \ ' }$ int32 ’, name $z '$ ’main input’)
|
| 150 |
+
embedding $=$ Embedding(input dim ${ \tt 1 2 8 }$ , output dim ${ \tt 1 2 8 }$ , input length $= 7 5$ )(main input )
|
| 151 |
+
conv1 $=$ Conv1D( filters ${ } = 1 2 8$ , kernel size $^ { = 3 }$ , padding $= ^ { \ast }$ ’same’, strides $^ { = 1 }$ )(embedding)
|
| 152 |
+
thresh1 $=$ ThresholdedReLU(1e−6)(conv1)
|
| 153 |
+
max pool1 $=$ MaxPooling1D(pool size $^ { = 2 }$ , padding=’same’)(thresh1 )
|
| 154 |
+
conv $\ ? =$ Conv1D( filters ${ } = 1 2 8$ , kernel size $^ { = 2 }$ , padding $= ^ { \overrightarrow { } }$ ’same’, strides $^ { = 1 }$ )(max pool1)
|
| 155 |
+
thresh2 $=$ ThresholdedReLU(1e−6)(conv2)
|
| 156 |
+
max pool2 $=$ MaxPooling1D(pool size $^ { = 2 }$ , padding=’same’)(thresh2 )
|
| 157 |
+
flatten $=$ Flatten () (max pool2)
|
| 158 |
+
fc $=$ Dense(64)( flatten )
|
| 159 |
+
thresh fc $=$ ThresholdedReLU(1e−6)(fc)
|
| 160 |
+
drop $=$ Dropout(0.5) ( thresh fc )
|
| 161 |
+
output $=$ Dense(1, activation $= ^ { \overrightarrow { { \mathbf { \Gamma } } } }$ ’sigmoid’) (drop)
|
| 162 |
+
model $=$ Model(inputs=main input, outputs $=$ output)
|
| 163 |
+
model.compile( ${ \mathrm { l o s s } } = { \ ' }$ binary crossentropy ’, optimizer $= ^ { \ ' }$ adam’)
|
| 164 |
+
|
| 165 |
+
def getconvmodel( self , kernel size , filters ) : model $=$ Sequential () model.add( Conv1D( filters $=$ filters , input shape $=$ (128, 128), kernel size $=$ kernel size , padding=’same’, activation $= ^ { \ ' }$ relu ’, strides $\mathbf { \tau } = 1 \dot { }$ )) model.add(Lambda(lambda x: K.sum(x, axi $^ { - 1 }$ ), output shape $=$ ( filters , ) ) ) model.add(Dropout(0.5) ) return model
|
| 166 |
+
|
| 167 |
+
middle $=$ Dropout(0.5) (middle)
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan=1 colspan=1>output = Dense(1,activation ='sigmoid')(middle)model = Model(inputs=main_input, outputs =output)model.compile(loss='binary_crossentropy’,optimizer='adam')</td></tr><tr><td rowspan=1 colspan=1>Listing 4: Invincea CNN model with parallel CNN layers,adapted from Saxe & Berlin (2017)</td></tr><tr><td rowspan=1 colspan=1>main_input = Input(shape=(75,),dtype=' int32’,name='main_input')embedding =Embedding(input_dim=128,output_dim=128,input_length=75)(main_input)conv = Conv1D(filters =128,kernel_size =3,padding='same',activation ='relu’,strides=1)(embedding)max_pool = MaxPooling1D(pool_size=2, padding='same')(conv)encode = LSTM(64, return_sequences=False)(max-pool)output = Dense(1, activation ='sigmoid')(encode)model= Model(inputs=main_input, outputs =output)model.compile(loss=’ binary_crossentropy’, optimizer='adam')</td></tr><tr><td rowspan=1 colspan=1>Listing 5: MIT model with a stacked CNN and LSTM layer,adapted from Vosoughi et al. (2016)</td></tr><tr><td rowspan=1 colspan=1>main_input = Input(shape=(75,),dtype=' int32’,name='main_input')embedding =Embedding(input_dim=128,output_dim=128,input_length=75)(main_input)flatten = Flatten ((embedding)output = Dense(1, activation ='sigmoid')( flatten )model = Model(inputs=main_input, outputs =output)print (model.summaryO)model.compile(loss=' binary_crossentropy’,optimizer='adam')</td></tr><tr><td rowspan=1 colspan=1>Listing 6: Baseline Model with only Embedding Layer</td></tr><tr><td rowspan=1 colspan=1>main_input = Input(shape=(11,),name='main_input')dense = Dense(128,activation ='relu ')(main_input)output = Dense(1, activation ='sigmoid')(dense)model = Model(inputs=main_input, outputs =output)print (model.summaryO)model.compile(loss='binary_crossentropy’,optimizer='adam')</td></tr></table>
|
md/train/BJlkgaNKvr/BJlkgaNKvr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BkV4VS9ll/BkV4VS9ll.md
ADDED
|
@@ -0,0 +1,599 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE INCREDIBLE SHRINKING NEURAL NETWORK: NEW PERSPECTIVES ON LEARNING REPRESENTATIONS THROUGH THE LENS OF PRUNING
|
| 2 |
+
|
| 3 |
+
Nikolas Wolfe, Aditya Sharma & Bhiksha Raj
|
| 4 |
+
School of Computer Science
|
| 5 |
+
Carnegie Mellon University
|
| 6 |
+
Pittsburgh, PA 15213, USA
|
| 7 |
+
{nwolfe, bhiksha}@cs.cmu.edu, adityasharma@cmu.edu
|
| 8 |
+
|
| 9 |
+
Lukas Drude Universitat Paderborn drude@nt.upb.de
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
How much can pruning algorithms teach us about the fundamentals of learning representations in neural networks? A lot, it turns out. Neural network model compression has become a topic of great interest in recent years, and many different techniques have been proposed to address this problem. In general, this is motivated by the idea that smaller models typically lead to better generalization. At the same time, the decision of what to prune and when to prune necessarily forces us to confront our assumptions about how neural networks actually learn to represent patterns in data. In this work we set out to test several long-held hypotheses about neural network learning representations and numerical approaches to pruning. To accomplish this we first reviewed the historical literature and derived a novel algorithm to prune whole neurons (as opposed to the traditional method of pruning weights) from optimally trained networks using a second-order Taylor method. We then set about testing the performance of our algorithm and analyzing the quality of the decisions it made. As a baseline for comparison we used a first-order Taylor method based on the Skeletonization algorithm and an exhaustive brute-force serial pruning algorithm. Our proposed algorithm worked well compared to a first-order method, but not nearly as well as the brute-force method. Our error analysis led us to question the validity of many widely-held assumptions behind pruning algorithms in general and the trade-offs we often make in the interest of reducing computational complexity. We discovered that there is a straightforward way, however expensive, to serially prune $40 \%$ of the neurons in a trained network with minimal effect on the learning representation and without any re-training.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
In this work we propose and evaluate a novel algorithm for pruning whole neurons from a trained neural network without any re-training and examine its performance compared to two simpler methods. We then analyze the kinds of errors made by our algorithm and use this as a stepping off point to launch an investigation into the fundamental nature of learning representations in neural networks. Our results corroborate an insightful though largely forgotten observation by Mozer & Smolensky (1989a) concerning the nature of neural network learning. This observation is best summarized in a quotation from Segee & Carter (1991) on the notion of fault-tolerance in multilayer perceptron networks:
|
| 18 |
+
|
| 19 |
+
Contrary to the belief widely held, multilayer networks are not inherently fault tolerant. In fact, the loss of a single weight is frequently sufficient to completely disrupt a learned function approximation. Furthermore, having a large number of weights does not seem to improve fault tolerance. [Emphasis added]
|
| 20 |
+
|
| 21 |
+
Essentially, Mozer & Smolensky (1989b) observed that during training neural networks do not distribute the learning representation evenly or equitably across hidden units. What actually happens is that a few, elite neurons learn an approximation of the input-output function, and the remaining units must learn a complex interdependence function which cancels out their respective influence on the network output. Furthermore, assuming enough units exist to learn the function in question, increasing the number of parameters does not increase the richness or robustness of the learned approximation, but rather simply increases the likelihood of overfitting and the number of noisy parameters to be canceled during training. This is evinced by the fact that in many cases, multiple neurons can be removed from a network with no re-training and with negligible impact on the quality of the output approximation. In other words, there are few bipartisan units in a trained network. A unit is typically either part of the (possibly overfit) input-output function approximation, or it is part of an elaborate noise cancellation task force. Assuming this is the case, most of the compute-time spent training a neural network is likely occupied by this arguably wasteful procedure of silencing superfluous parameters, and pruning can be viewed as a necessary procedure to “trim the fat.”
|
| 22 |
+
|
| 23 |
+
We observed copious evidence of this phenomenon in our experiments, and this is the motivation behind our decision to evaluate the pruning algorithms in this study on the simple criteria of their ability to trim neurons without any re-training. If we were to employ re-training as part of our evaluation criteria, we would arguably not be evaluating the quality of our algorithm’s pruning decisions per se but rather the ability of back-propagation trained networks to recover from faults caused by non-ideal pruning decisions, as suggested by the conclusions of Segee & Carter (1991) and Mozer & Smolensky (1989a). Moreover, as Fahlman & Lebiere (1989) discuss, due to the “herd effect” and “moving target” phenomena in back-propagation learning, the remaining units in a network will simply shift course to account for whatever error signal is re-introduced as a result of a bad pruning decision or network fault. So long as there are enough critical parameters to learn the function in question, a network can typically recover faults with additional training. This limits the conclusions we can draw about the quality of our pruning criteria when we employ re-training.
|
| 24 |
+
|
| 25 |
+
In terms of removing units without re-training, what we discovered is that predicting the behavior of a network when a unit is to be pruned is very difficult, and most of the approximation techniques put forth in existing pruning algorithms do not fare well at all when compared to a brute-force search. To begin our discussion of how we arrived at our algorithm and set up our experiments, we review of the existing literature.
|
| 26 |
+
|
| 27 |
+
# 2 LITERATURE REVIEW
|
| 28 |
+
|
| 29 |
+
Pruning algorithms, as comprehensively surveyed by Reed (1993), are a useful set of heuristics designed to identify and remove elements from a neural network which are either redundant or do not significantly contribute to the output of the network. This is motivated by the observed tendency of neural networks to overfit to the idiosyncrasies of their training data given too many trainable parameters or too few input patterns from which to generalize, as stated by Chauvin (1990).
|
| 30 |
+
|
| 31 |
+
Network architecture design and hyperparameter selection are inherently difficult tasks typically approached using a few well-known rules of thumb, e.g. various weight initialization procedures, choosing the width and number of layers, different activation functions, learning rates, momentum, etc. Some of this “black art” appears unavoidable. For problems which cannot be solved using linear threshold units alone, Baum & Haussler (1989) demonstrate that there is no way to precisely determine the appropriate size of a neural network a priori given any random set of training instances. Using too few neurons seems to inhibit learning, and so in practice it is common to attempt to overparameterize networks initially using a large number of hidden units and weights, and then prune or compress them afterwards if necessary. Of course, as the old saying goes, there’s more than one way to skin a neural network.
|
| 32 |
+
|
| 33 |
+
# 2.1 NON-PRUNING BASED GENERALIZATION & COMPRESSION TECHNIQUES
|
| 34 |
+
|
| 35 |
+
The generalization behavior of neural networks has been well studied, and apart from pruning algorithms many heuristics have been used to avoid overfitting, such as dropout (Srivastava et al.
|
| 36 |
+
|
| 37 |
+
(2014)), maxout (Goodfellow et al. (2013)), and cascade correlation (Fahlman & Lebiere (1989)), among others. Of course, while cascade correlation specifically tries to construct of minimal networks, many techniques to improve network generalization do not explicitly attempt to reduce the total number of parameters or the memory footprint of a trained network per se.
|
| 38 |
+
|
| 39 |
+
Model compression often has benefits with respect to generalization performance and the portability of neural networks to operate in memory-constrained or embedded environments. Without explicitly removing parameters from the network, weight quantization allows for a reduction in the number of bytes used to represent each weight parameter, as investigated by Balzer et al. (1991), Dundar & Rose (1994), and Hoehfeld & Fahlman (1992).
|
| 40 |
+
|
| 41 |
+
A recently proposed method for compressing recurrent neural networks (Prabhavalkar et al. (2016)) uses the singular values of a trained weight matrix as basis vectors from which to derive a compressed hidden layer. Øland & Raj (2015) successfully implemented network compression through weight quantization with an encoding step while others such as Han et al. (2016) have tried to expand on this by adding weight-pruning as a preceding step to quantization and encoding.
|
| 42 |
+
|
| 43 |
+
In summary, we can say that there are many different ways to improve network generalization by altering the training procedure, the objective error function, or by using compressed representations of the network parameters. But these are not, strictly speaking, examples of techniques to reduce the number of parameters in a network. For this we must employ some form of pruning criteria.
|
| 44 |
+
|
| 45 |
+
# 2.2 PRUNING TECHNIQUES
|
| 46 |
+
|
| 47 |
+
If we wanted to continually shrink a neural network down to minimum size, the most straightforward brute-force way to do it is to individually switch each element off and measure the increase in total error on the training set. We then pick the element which has the least impact on the total error, and remove it. Rinse and repeat. This is extremely computationally expensive, given a reasonably large neural network and training set. Alternatively, we might accomplish this using any number of much faster off-the-shelf pruning algorithms, such as Skeletonization (Mozer & Smolensky (1989a)), Optimal Brain Damage (LeCun et al. (1989)), or later variants such as Optimal Brain Surgeon (Hassibi & Stork (1993)). In fact, we borrow much of our inspiration from these algorithms, with one major variation: Instead of pruning individual weights, we prune entire neurons, thereby eliminating all of their incoming and outgoing weight parameters in one go, resulting in more memory saved, faster.
|
| 48 |
+
|
| 49 |
+
The algorithm developed for this paper is targeted at reducing the total number of neurons in a trained network, which is one way of reducing its computational memory footprint. This is often a desirable criteria to minimize in the case of resource-constrained or embedded devices, and also allows us to probe the limitations of pruning down to the very last essential network elements. In terms of generalization as well, we can measure the error of the network on the test set as each element is sequentially removed from the network. With an oracle pruning algorithm, what we expect to observe is that the output of the network remains stable as the first few superfluous neurons are removed, and as we start to bite into the more crucial members of the function approximation, the error should start to rise dramatically. In this paper, the brute-force approach described at the beginning of this section serves as a proxy for an oracle pruning algorithm.
|
| 50 |
+
|
| 51 |
+
One reason to choose to rank and prune individual neurons as opposed to weights is that there are far fewer elements to consider. Furthermore, the removal of a single weight from a large network is a drop in the bucket in terms of reducing a network’s core memory footprint. If we want to reduce the size of a network as efficiently as possible, we argue that pruning neurons instead of weights is more efficient computationally as well as practically in terms of quickly reaching a hypothetical target reduction in memory consumption. This approach also offers downstream applications a realistic expectation of the minimal increase in error resulting from the removal of a specified percentage of neurons. Such trade-offs are unavoidable, but performance impacts can be limited if a principled approach is used to find the best candidate neurons for removal.
|
| 52 |
+
|
| 53 |
+
It is well known that too many free parameters in a neural network can lead to overfitting. Regardless of the number of weights used in a given network, as Segee & Carter (1991) assert, the representation of a learned function approximation is almost never evenly distributed over the hidden units, and thus the removal of any single hidden unit at random can actually result in a network fault. Mozer & Smolensky (1989b) argue that only a subset of the hidden units in a neural network actually latch on to the invariant or generalizing properties of the training inputs, and the rest learn to either mutually cancel each other’s influence or begin overfitting to the noise in the data. We leverage this idea in the current work to rank all neurons in pre-trained networks based on their effective contributions to the overall performance. We then remove the unnecessary neurons to reduce the network’s footprint. Through our experiments we not only concretely validate the theory put forth by Mozer & Smolensky (1989b) but we also successfully build on it to prune networks to 40 to 60 $\%$ of their original size without any major loss in performance.
|
| 54 |
+
|
| 55 |
+
# 3 PRUNING NEURONS TO SHRINK NEURAL NETWORKS
|
| 56 |
+
|
| 57 |
+
As discussed in Section 1 our aim is to leverage the highly non-uniform distribution of the learning representation in pre-trained neural networks to eliminate redundant neurons, without focusing on individual weight parameters. Taking this approach enables us to remove all the weights (incoming and outgoing) associated with a non-contributing neuron at once. We would like to note here that in an ideal scenario, based on the neuron interdependency theory put forward by Mozer & Smolensky (1989a), one would evaluate all possible combinations of neurons to remove (one at a time, two at a time, three at a time and so forth) to find the optimal subset of neurons to keep. This is computationally unacceptable, and so we will only focus on removing one neuron at a time and explore more “greedy” algorithms to do this in a more efficient manner.
|
| 58 |
+
|
| 59 |
+
The general approach taken to prune an optimally trained neural network here is to create a ranked list of all the neurons in the network based off of one of the 3 proposed ranking criteria: a brute force approximation, a linear approximation and a quadratic approximation of the neuron’s impact on the output of the network. We then test the effects of removing neurons on the accuracy and error of the network. All the algorithms and methods presented here are easily parallelizable as well.
|
| 60 |
+
|
| 61 |
+
One last thing to note here before moving forward is that the methods discussed in this section involve some non-trivial derivations which are beyond the scope of this paper. We are more focused on analyzing the implications of these methods on our understanding of neural network learning representations. However, a complete step-by-step derivation and proof of all the results presented is provided in the Supplementary Material as an Appendix.
|
| 62 |
+
|
| 63 |
+
# 3.1 BRUTE FORCE REMOVAL APPROACH
|
| 64 |
+
|
| 65 |
+
This is perhaps the most naive yet the most accurate method for pruning the network. It is also the slowest and hence possibly unusable on large-scale neural networks with thousands of neurons. This method explicitly evaluates each neuron in the network. The idea is to manually check the effect of every single neuron on the output. This is done by running a forward propagation on the validation set $K$ times (where $K$ is the total number of neurons in the network), turning off exactly one neuron each time (keeping all other neurons active) and noting down the change in error. Turning a neuron off can be achieved by simply setting its output to 0. This results in all the outgoing weights from that neuron being turned off. This change in error is then used to generate the ranked list.
|
| 66 |
+
|
| 67 |
+
# 3.2 TAYLOR SERIES REPRESENTATION OF ERROR
|
| 68 |
+
|
| 69 |
+
Let us denote the total error from the optimally trained neural network for any given validation dataset by $E$ . $E$ can be seen as a function of $O$ , where $O$ is the output of any general neuron in the network. This error can be approximated at a particular neuron’s output (say $O _ { k }$ ) by using the 2nd order Taylor Series as,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\hat { E } ( \boldsymbol { O } ) \approx E ( \boldsymbol { O } _ { k } ) + ( \boldsymbol { O } - \boldsymbol { O } _ { k } ) \cdot \left. \frac { \partial E } { \partial \boldsymbol { O } } \right| _ { \boldsymbol { O } _ { k } } + 0 . 5 \cdot ( \boldsymbol { O } - \boldsymbol { O } _ { k } ) ^ { 2 } \cdot \left. \frac { \partial ^ { 2 } E } { \partial \boldsymbol { O } ^ { 2 } } \right| _ { \boldsymbol { O } _ { k } } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
When a neuron is pruned, its output $O$ becomes 0.
|
| 76 |
+
|
| 77 |
+
Replacing $O$ by $O _ { k }$ in equation 1 shows us that the error is approximated perfectly by equation 1 at $O _ { k }$ . So:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\Delta E _ { k } = \hat { E } ( 0 ) - \hat { E } ( O _ { k } ) = - O _ { k } \cdot \left. \frac { \partial E } { \partial O } \right| _ { O _ { k } } + 0 . 5 \cdot O _ { k } ^ { 2 } \cdot \left. \frac { \partial ^ { 2 } E } { \partial O ^ { 2 } } \right| _ { O _ { k } } ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\Delta E _ { k }$ is the change in the total error of the network when exactly one neuron $( k )$ is turned off. Most of the terms in this equation are fairly easy to compute, as we have $O _ { k }$ already from the activations of the hidden units and we already compute $\frac { \partial E } { \partial O } \big | _ { O _ { k } } ^ { \star }$ for each training instance during backpropagation. The ∂2E∂O2 |Ok terms are a little more difficult to compute. This is derived in the appendix and summarized in the sections below.
|
| 84 |
+
|
| 85 |
+
# 3.2.1 LINEAR APPROXIMATION APPROACH
|
| 86 |
+
|
| 87 |
+
We can use equation 2 to get the linear error approximation of the change in error due to the $k$ th neuron being turned off and represent it as $\Delta E _ { k } ^ { 1 }$ as follows:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\Delta E _ { k } ^ { 1 } = - O _ { k } \cdot \left. \frac { \partial E } { \partial O } \right| _ { O _ { k } }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
The derivative term above is the first-order gradient which represents the change in error with respect to the output a given neuron. This term can be collected during back-propagation. As we shall see further in this section, linear approximations are not reliable indicators of change in error but they provide us with an interesting basis for comparison with the other methods discussed in this paper.
|
| 94 |
+
|
| 95 |
+
# 3.2.2 QUADRATIC APPROXIMATION APPROACH
|
| 96 |
+
|
| 97 |
+
As above, we can use equation 2 to get the quadratic error approximation of the change in error due to the $k$ th neuron being turned off and represent it as $\Delta E _ { k } ^ { 2 }$ as follows:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\Delta E _ { k } ^ { 2 } = - O _ { k } \cdot \left. \frac { \partial E } { \partial O } \right| _ { O _ { k } } + 0 . 5 \cdot O _ { k } ^ { 2 } \cdot \left. \frac { \partial ^ { 2 } E } { \partial O ^ { 2 } } \right| _ { O _ { k } }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The additional second-order gradient term appearing above represents the quadratic change in error with respect to the output of a given neuron. This term can be generated by performing backpropagation using second order derivatives. Collecting these quadratic gradients involves some non-trivial mathematics, the entire step-by-step derivation procedure of which is provided in the Supplementary Material as an Appendix.
|
| 104 |
+
|
| 105 |
+
# 3.3 PROPOSED PRUNING ALGORITHM
|
| 106 |
+
|
| 107 |
+
Figure 1 shows a random error function plotted against the output of any given neuron. Note that this figure is for illustration purposes only. The error function is minimized at a particular value of the neuron output as can be seen in the figure. The process of training a neural network is essentially the process of finding these minimizing output values for all the neurons in the network. Pruning this particular neuron (which translates to getting a zero output from it will result in a change in the total overall error. This change in error is represented by distance between the original minimum error (shown by the dashed line) and the top red arrow. This neuron is clearly a bad candidate for removal since removing it will result in a huge error increase.
|
| 108 |
+
|
| 109 |
+
The straight red line in the figure represents the first-order approximation of the error using Taylor Series as described before while the parabola represents a second-order approximation. It can be clearly seen that the second-order approximation is a much better estimate of the change in error.
|
| 110 |
+
|
| 111 |
+
One thing to note here is that it is possible in some cases that there is some thresholding required when trying to approximate the error using the 2nd order Taylor Series expansion. These cases might arise when the parabolic approximation undergoes a steep slope change. To take into account such cases, mean and median thresholding were employed, where any change above a certain threshold was assigned a mean or median value respectively.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 1: The intuition behind 1st & 2nd order neuron pruning decisions
|
| 115 |
+
|
| 116 |
+
Two pruning algorithms are proposed here. They are different in the way the neurons are ranked but both of them use $\Delta E _ { k }$ , the approximation of the change in error as the basis for the ranking. $\Delta E _ { k }$ can be calculated using the Brute Force method, or one of the two Taylor Series approximations discussed previously.
|
| 117 |
+
|
| 118 |
+
The first step in both the algorithms is to decide a stopping criterion. This can vary depending on the application but some intuitive stopping criteria can be: maximum number of neurons to remove, percentage scaling needed, maximum allowable accuracy drop etc.
|
| 119 |
+
|
| 120 |
+
# 3.3.1 ALGORITHM I: SINGLE OVERALL RANKING
|
| 121 |
+
|
| 122 |
+
The complete algorithm is shown in Algorithm 1. The idea here is to generate a single ranked list based on the values of $\Delta E _ { k }$ . This involves a single pass of second-order back-propagation (without weight updates) to collect the gradients for each neuron. The neurons from this rank-list (with the lowest values of $\Delta E _ { k }$ ) are then pruned according to the stopping criterion decided. We note here that this algorithm is intentionally naive and is used for comparison only.
|
| 123 |
+
|
| 124 |
+
Data: optimally trained network, training set
|
| 125 |
+
Result: A pruned network
|
| 126 |
+
initialize and define stopping criterion ;
|
| 127 |
+
perform forward propagation over the training set ;
|
| 128 |
+
perform second-order back-propagation without updating weights and collect linear and quadratic gradients ;
|
| 129 |
+
rank the remaining neurons based on $\Delta E _ { k }$ ;
|
| 130 |
+
while stopping criterion is not met do
|
| 131 |
+
remove the last ranked neuron ;
|
| 132 |
+
end
|
| 133 |
+
|
| 134 |
+
Algorithm 1: Single Overall Ranking
|
| 135 |
+
|
| 136 |
+
# 3.3.2 ALGORITHM II: ITERATIVE RE-RANKING
|
| 137 |
+
|
| 138 |
+
In this greedy variation of the algorithm (Algorithm 2), after each neuron removal, the remaining network undergoes a single forward and backward pass of second-order back-propagation (without weight updates) and the rank list is formed again. Hence, each removal involves a new pass through the network. This method is computationally more expensive but takes into account the dependencies the neurons might have on one another which would lead to a change in error contribution every time a dependent neuron is removed.
|
| 139 |
+
|
| 140 |
+
Data: optimally trained network, training set
|
| 141 |
+
Result: A pruned network
|
| 142 |
+
initialize and define stopping criterion ;
|
| 143 |
+
while stopping criterion is not met do perform forward propagation over the training set ; perform second-order back-propagation without updating weights and collect linear and quadratic gradients ; rank the remaining neurons based on $\Delta E _ { k }$ ; remove the worst neuron based on the ranking ;
|
| 144 |
+
end
|
| 145 |
+
|
| 146 |
+
Algorithm 2: Iterative Re-Ranking
|
| 147 |
+
|
| 148 |
+
# 4 EXPERIMENTAL RESULTS
|
| 149 |
+
|
| 150 |
+
# 4.1 EXAMPLE REGRESSION PROBLEM
|
| 151 |
+
|
| 152 |
+
This problem serves as a quick example to demonstrate many of the phenomena described in previous sections. We trained two networks to learn the cosine function, with one input and one output. This is a task which requires no more than 11 sigmoid neurons to solve entirely, and in this case we don’t care about overfitting because the cosine function has a precise definition. Furthermore, the cosine function is a good toy example because it is a smooth continuous function and, as demonstrated by Nielsen (2015), if we were to tinker directly with the weights and bias parameters of the network, we could allocate individual units within the network to be responsible for constrained ranges of inputs, similar to a basis spline function with many control points. This would distribute the learned function approximation evenly across all hidden units, and thus we have presented the network with a problem in which it could productively use as many hidden units as we give it. In this case, a pruning algorithm would observe a fairly consistent increase in error after the removal of each successive unit. In practice however, regardless of the number of experimental trials, this is not what happens. The network will always use 10-11 hidden units and leave the rest to cancel each other’s influence.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 2: Degradation in squared error after pruning a two-layer network trained to compute the cosine function (Left Network: 2 layers, 10 neurons each, 1 output, logistic sigmoid activation, starting test accuracy: 0.9999993, Right Network: 2 layers, 50 neurons each, 1 output, logistic sigmoid activation, starting test accuracy: 0.9999996)
|
| 156 |
+
|
| 157 |
+
Figure 2 shows two graphs. Both graphs demonstrate the use of the iterative re-ranking algorithm and the comparative performance of the brute-force pruning method (in blue), the first order method (in green), and the second order method (in red). The graph on the left shows the performance of these algorithms starting from a network with two layers of 10 neurons (20 total), and the graph on the right shows a network with two layers of 50 neurons (100 total).
|
| 158 |
+
|
| 159 |
+
In the left graph, we see that the brute-force method shows a graceful degradation, and the error only begins to rise sharply after $50 \%$ of the total neurons have been removed. The error is basically constant up to that point. In the first and second order methods, we see evidence of poor decision making in the sense that both made mistakes early on, which disrupted the output function approximation. The first order method made a large error early on, though we see after a few more neurons were removed this error was corrected somewhat (though it only got worse from there). This is direct evidence of the lack of fault tolerance in a trained neural network. This phenomenon is even more starkly demonstrated in the second order method. After making a few poor neuron removal decisions in a row, the error signal rose sharply, and then went back to zero after the 6th neuron was removed. This is due to the fact that the neurons it chose to remove were trained to cancel each others’ influence within a localized part of the network. After the entire group was eliminated, the approximation returned to normal. This can only happen if the output function approximation is not evenly distributed over the hidden units in a trained network.
|
| 160 |
+
|
| 161 |
+
This phenomenon is even more starkly demonstrated in the graph on the right. Here we see the first order method got “lucky” in the beginning and made decent decisions up to about the 40th removed neuron. The second order method had a small error in the beginning which it recovered from gracefully and proceeded to pass the 50 neuron point before finally beginning to unravel. The brute force method, in sharp contrast, shows little to no increase in error at all until $90 \%$ of the neurons in the network have been obliterated. Clearly first and second order methods have some value in that they do not make completely arbitrary choices, but the brute force method is far better at this task.
|
| 162 |
+
|
| 163 |
+
This also demonstrates the sharp dualism in neuron roles within a trained network. These networks were trained to near-perfect precision and each pruning method was applied without any re-training of any kind. Clearly, in the case of the brute force or oracle method, up to $90 \%$ of the network can be completely extirpated before the output approximation even begins to show any signs of degradation. This would be impossible if the learning representation were evenly or equitably distributed. Note, for example, that the degradation point in both cases is approximately the same. This example is not a real-world application of course, but it brings into very clear focus the kind of phenomena we will discuss in the following sections.
|
| 164 |
+
|
| 165 |
+
# 4.2 RESULTS ON MNIST DATASET
|
| 166 |
+
|
| 167 |
+
For all the results presented in this section, the MNIST database of Handwritten Digits by LeCun & Cortes (2010) was used. It is worth noting that due to the time taken by the brute force algorithm we rather used a 5000 image subset of the MNIST database in which we have normalized the pixel values between 0 and 1.0, and compressed the image sizes to $2 0 \mathrm { x } 2 0$ images rather than $2 8 \mathbf { x } 2 8$ , so the starting test accuracy reported here appears higher than those reported by LeCun et al. We do not believe that this affects the interpretation of the presented results because the basic learning problem does not change with a larger dataset or input dimension.
|
| 168 |
+
|
| 169 |
+
# 4.3 PRUNING A 1-LAYER NETWORK
|
| 170 |
+
|
| 171 |
+
The network architecture in this case consisted of 1 layer, 100 neurons, 10 outputs, logistic sigmoid activations, and a starting test accuracy of 0.998.
|
| 172 |
+
|
| 173 |
+
# 4.3.1 SINGLE OVERALL RANKING ALGORITHM
|
| 174 |
+
|
| 175 |
+
We first present the results for a single-layer neural network in Figure 3, using the Single Overall algorithm (Algorithm 1) as proposed in Section 3. (We again note that this algorithm is intentionally naive and is used for comparison only. Its performance should be expected to be poor.) After training, each neuron is assigned its permanent ranking based on the three criteria discussed previously: A brute force “ground truth” ranking, and two approximations of this ranking using first and second order Taylor estimations of the change in network output error resulting from the removal of each neuron.
|
| 176 |
+
|
| 177 |
+
An interesting observation here is that with only a single layer, no criteria for ranking the neurons in the network (brute force or the two Taylor Series variants) using Algorithm 1 emerges superior, indicating that the 1st and 2nd order Taylor Series methods are actually reasonable approximations of the brute force method under certain conditions. Of course, this method is still quite bad in terms of the rate of degradation of the classification accuracy and in practice we would likely follow Algorithm 2 which is takes into account Mozer & Smolensky (1989a)’s observations stated in the Related Work section. The purpose of the present investigation, however, is to demonstrate how much of a trained network can be theoretically removed without altering the network’s learned parameters in any way.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 3: Degradation in squared error (left) and classification accuracy (right) after pruning a single-layer network using The Single Overall Ranking algorithm (Network: 1 layer, 100 neurons, 10 outputs, logistic sigmoid activation, starting test accuracy: 0.998)
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
4.3.2 ITERATIVE RE-RANKING ALGORITHM
|
| 184 |
+
Figure 4: Degradation in squared error (left) and classification accuracy (right) after pruning a single-layer network the iterative re-ranking algorithm (Network: 1 layer, 100 neurons, 10 outputs, logistic sigmoid activation, starting test accuracy: 0.998)
|
| 185 |
+
|
| 186 |
+
In Figure 4 we present our results using Algorithm 2 (The iterative re-ranking Algorithm) in which all remaining neurons are re-ranked after each successive neuron is switched off. We compute the same brute force rankings and Taylor series approximations of error deltas over the remaining active neurons in the network after each pruning decision. This is intended to account for the effects of cancelling interactions between neurons.
|
| 187 |
+
|
| 188 |
+
There are 2 key observations here. Using the brute force ranking criteria, almost $60 \%$ of the neurons in the network can be pruned away without any major loss in performance. The other noteworthy observation here is that the 2nd order Taylor Series approximation of the error performs consistently better than its 1st order version, in most situations, though Figure 21 is a poignant counter-example.
|
| 189 |
+
|
| 190 |
+
# 4.3.3 VISUALIZATION OF ERROR SURFACE & PRUNING DECISIONS
|
| 191 |
+
|
| 192 |
+
As explained in Section 3, these graphs are a visualization of the error surface of the network output with respect to the neurons chosen for removal using each of the 3 ranking criteria, represented in intervals of 10 neurons. In each graph, the error surface of the network output is displayed in log space (left) and in real space (right) with respect to each candidate neuron chosen for removal. We create these plots during the pruning exercise by picking a neuron to switch off, and then multiplying its output by a scalar gain value $\alpha$ which is adjusted from 0.0 to 10.0 with a step size of 0.001. When the value of $\alpha$ is 1.0, this represents the unperturbed neuron output learned during training. Between 0.0 and 1.0, we are graphing the literal effect of turning the neuron off $( \alpha = 0$ ), and when $\alpha > 1 . 0$ we are simulating a boosting of the neuron’s influence in the network, i.e. inflating the value of its outgoing weight parameters.
|
| 193 |
+
|
| 194 |
+
We graph the effect of boosting the neuron’s output to demonstrate that for certain neurons in the network, even doubling, tripling, or quadrupling the scalar output of the neuron has no effect on the overall error of the network, indicating the remarkable degree to which the network has learned to ignore the value of certain parameters. In other cases, we can get a sense of the sensitivity of the network’s output to the value of a given neuron when the curve rises steeply after the red 1.0 line. This indicates that the learned value of the parameters emanating from a given neuron are relatively important, and this is why we should ideally see sharper upticks in the curves for the later-removed neurons in the network, that is, when the neurons crucial to the learning representation start to be picked off. Some very interesting observations can be made in each of these graphs.
|
| 195 |
+
|
| 196 |
+
Remember that lower is better in terms of the height of the curve and minimal (or negative) horizontal change between the vertical red line at 1.0 (neuron on, $\alpha = 1 . 0$ ) and 0.0 (neuron off, $\alpha = 0 . 0$ ) is indicative of a good candidate neuron to prune, i.e. there will be minimal effect on the network output when the neuron is removed.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
4.3.4 VISUALIZATION OF BRUTE FORCE PRUNING DECISIONS
|
| 200 |
+
Figure 5: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the brute force criterion; (Network: 1 layer, 100 neurons, 10 outputs, logistic sigmoid activation, starting test accuracy: 0.998)
|
| 201 |
+
|
| 202 |
+
In Figure ??, we notice how low to the floor and flat most of the curves are. It’s only until the 90th removed neuron that we see a higher curve with a more convex shape (clearly a more sensitive, influential piece of the network).
|
| 203 |
+
|
| 204 |
+
# 4.3.5 VISUALIZATION OF 1ST ORDER APPROXIMATION PRUNING DECISIONS
|
| 205 |
+
|
| 206 |
+
It can be seen in Figure 6 that most choices seem to have flat or negatively sloped curves, indicating that the first order approximation seems to be pretty good, but examining the brute force choices shows they could be better.
|
| 207 |
+
|
| 208 |
+
# 4.3.6 VISUALIZATION OF 2ND ORDER APPROXIMATION PRUNING DECISIONS
|
| 209 |
+
|
| 210 |
+
The method in Figure 7 looks similar to the brute force method choices, though clearly not as good (they’re more spread out). Notice the difference in convexity between the 2nd and 1st order method
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 6: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the 1st order Taylor Series error approximation criterion; (Network: 1 layer, 100 neurons, 10 outputs, logistic sigmoid activation, starting test accuracy: 0.998)
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 7: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the 2nd order Taylor Series error approximation criterion; (Network: 1 layer, 100 neurons, 10 outputs, logistic sigmoid activation, starting test accuracy: 0.998)
|
| 217 |
+
|
| 218 |
+
choices. It’s clear that the first order method is fitting a line and the 2nd order method is fitting a parabola in their approximation.
|
| 219 |
+
|
| 220 |
+
# 4.4 PRUNING A 2-LAYER NETWORK
|
| 221 |
+
|
| 222 |
+
The network architecture in this case consisted of 2 layers, 50 neurons per layer, 10 outputs, logistic sigmoid activations, and a starting test accuracy of 1.000.
|
| 223 |
+
|
| 224 |
+
# 4.4.1 SINGLE OVERALL RANKING ALGORITHM
|
| 225 |
+
|
| 226 |
+
Figure 8 shows the pruning results for Algorithm 1 on a 2-layer network. The ranking procedure is identical to the one used to generate Figure 3. (We again note that this algorithm is intentionally naive and is used for comparison only. Its performance should be expected to be poor.)
|
| 227 |
+
|
| 228 |
+
Unsurprisingly, a 2-layer network is harder to prune because a single overall ranking will never capture the interdependencies between neurons in different layers. It makes sense that this is worse
|
| 229 |
+
|
| 230 |
+

|
| 231 |
+
Figure 8: Degradation in squared error (left) and classification accuracy (right) after pruning a 2- layer network using the Single Overall Ranking algorithm; (Network: 2 layers, 50 neurons/layer, 10 outputs, logistic sigmoid activation, starting test accuracy: 1.000)
|
| 232 |
+
|
| 233 |
+
than the performance on the 1-layer network, even if this method is already known to be bad, and we’d likely never use it in practice.
|
| 234 |
+
|
| 235 |
+
# 4.4.2 ITERATIVE RE-RANKING ALGORITHM
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 9: Degradation in squared error (left) and classification accuracy (right) after pruning a 2- layer network using the iterative re-ranking algorithm; (Network: 2 layers, 50 neurons/layer, 10 outputs, logistic sigmoid activation, starting test accuracy: 1.000)
|
| 239 |
+
|
| 240 |
+
Figure 9 shows the results from using Algorithm 2 on a 2-layer network. We compute the same brute force rankings and Taylor series approximations of error deltas over the remaining active neurons in the network after each pruning decision used to generate Figure 4. Again, this is intended to account for the effects of cancelling interactions between neurons.
|
| 241 |
+
|
| 242 |
+
It is clear that it becomes harder to remove neurons 1-by-1 with a deeper network (which makes sense because the neurons have more interdependencies in a deeper network), but we see an overall better performance with 2nd order method vs. 1st order, except for the first $20 \%$ of the neurons (but this doesn’t seem to make much difference for classification accuracy.)
|
| 243 |
+
|
| 244 |
+
Perhaps a more important observation here is that even with a more complex network, it is possible to remove up to $40 \%$ of the neurons with no major loss in performance which is clearly illustrated by the brute force curve. This shows the clear potential of an ideal pruning technique and also shows how inconsistent 1st and 2nd order Taylor Series approximations of the error can be as ranking criteria.
|
| 245 |
+
|
| 246 |
+
# 4.4.3 VISUALIZATION OF ERROR SURFACE & PRUNING DECISIONS
|
| 247 |
+
|
| 248 |
+
As seen in the case of a single layered network, these graphs are a visualization the error surface of the network output with respect to the neurons chosen for removal using each algorithm, represented in intervals of 10 neurons.
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
4.4.4 VISUALIZATION OF BRUTE FORCE PRUNING DECISIONS
|
| 252 |
+
Figure 10: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the brute force criterion; (Network: 2 layers, 50 neurons/layer, 10 outputs, logistic sigmoid activation, starting test accuracy: 1.000)
|
| 253 |
+
|
| 254 |
+
In Figure 10, it is clear why these neurons got chosen, their graphs clearly show little change when neuron is removed, are mostly near the floor, and show convex behaviour of error surface, which argues for the rationalization of using 2nd order methods to estimate difference in error when they are turned off.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
4.4.5 VISUALIZATION OF 1ST ORDER APPROXIMATION PRUNING DECISIONS
|
| 258 |
+
Figure 11: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the 1st order Taylor Series error approximation criterion; (Network: 2 layers, 50 neurons/layer, 10 outputs, logistic sigmoid activation, starting test accuracy: 1.000)
|
| 259 |
+
|
| 260 |
+
Drawing a flat line at the point of each neurons intersection with the red vertical line (no change in gain) shows that the 1st derivative method is actually accurate for estimation of change in error in these cases, but still ultimately leads to poor decisions.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 12: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the 2nd order Taylor Series error approximation criterion; (Network: 2 layers, 50 neurons/layer, 10 outputs, logistic sigmoid activation, starting test accuracy: 1.000)
|
| 264 |
+
|
| 265 |
+
Clearly these neurons are not overtly poor candidates for removal (error doesn’t change much between 1.0 & zero-crossing left-hand-side), but could be better (as described above in the brute force Criterion discussion).
|
| 266 |
+
|
| 267 |
+
# 4.5 INVESTIGATION OF PRUNING PERFORMANCE WITH IMPERFECT STARTING CONDITIONS
|
| 268 |
+
|
| 269 |
+
In our experiments thus far we have tacitly assumed that we start with a network which has learned an “optimal” representation of the training objective, i.e. it has been trained to the point where we accept its performance on the test set. Here we explore what happens when we prune with a sub-optimal starting network.
|
| 270 |
+
|
| 271 |
+
If the assumptions of this paper regarding the nature of neural network learning are correct, we expect that two processes are essentially at work during back-propagation training. First, we expect that the neurons which directly participate in the fundamental learning representation (even if redundantly) work together to reduce error on the training data. Second, we expect that neurons which do not directly participate in the learning representation work to cancel each other’s negative influence. Furthermore, we expect that these two groups are essentially distinct, as evinced by the fact that multiple neurons can often be removed as a group with little to no effect on the network output. Some non-trivial portion of the training time, then, is spent doing work which has nothing intrinsically to do with the learning representation and essentially functions as noise cancellation.
|
| 272 |
+
|
| 273 |
+
If this is the case, when we attempt to prune a network which has not fully canceled the noisy influence of extraneous or redundant units, we might expect to see the error actually improve after removing a few bad apples. This is in fact what we observe, as demonstrated in the following experiments.
|
| 274 |
+
|
| 275 |
+
For each experiment in this section we trained with the full MNIST training set (LeCun & Cortes (2010)), uncompressed and without any data normalization. We trained three different networks to learn to distinguish a single handwritten digit from the rest of the data. The network architectures were each composed of 784 inputs, 1 hidden layer with 100 neurons, and 2 soft-max outputs; one to say yes, and the other to say no. These networks were trained to distinguish the digits 0, 1, and 2, and their respective starting accuracies were a sub-optimal 0.9757, 0.9881, and 0.9513. Finally, we only consider the iterative re-ranking algorithm, as the single overall ranking algorithm is clearly nonviable.
|
| 276 |
+
|
| 277 |
+
# 4.5.1 MNIST SINGLE DIGIT CLASSIFICATION: DIGIT 0
|
| 278 |
+
|
| 279 |
+
Figure 13 shows the degradation in squared error after removing neurons from a network trained to distinguish the digit 0. What we observe is that the first and second order methods both fail in different ways, though clearly the second order method makes better decisions overall. The first order method explodes spectacularly in the first few iterations. The brute force method, in stark contrast, actually improves in the first few iterations, and remains essentially flat until around the $60 \%$ mark, at which point it begins to gradually increase and meet the other curves.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 13: Degradation in squared error after pruning a single-layer network trained to do a oneversus-all classification of the digit 0 using the iterative re-ranking algorithm
|
| 283 |
+
|
| 284 |
+
The behavior of the brute force method here demonstrates that the network was essentially working to cancel the effect of a few bad neurons when the training convergence criteria were met, i.e. the network was no longer able to make progress on the training set. After removing these neurons during pruning, the output improved. We can investigate this by looking at the error surface with respect to the neurons chosen for removal by each method in turn. Below in Figure 14 is the graph of the brute force method.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 14: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the brute force iterative re-ranking removal criterion
|
| 288 |
+
|
| 289 |
+
Figure 14 shows an interesting phenomenon, which we will see in later experiments as well. The high blue curve corresponding to neuron 0 is negatively sloped in the beginning and clearly after removing this neuron, the output will improve. The rest of the curves, in correspondence with the squared error degradation curve above, are mostly flat and tightly layered together, indicating that they are good neurons to remove.
|
| 290 |
+
|
| 291 |
+
In Figure 15 below, we observe a stark contrast to this. The curves corresponding to neurons 0 and 10 are mostly flat, and fairly lower than the rest, though clearly a mistake was made early on and the rest of the curves are clearly bad choices. In all of these cases however, we see that the curves are easily approximated with a straight line and so the first order method may have been fairly accurate in its predictions, even though it still made poor decisions.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 15: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the first-order iterative re-ranking removal criterion
|
| 295 |
+
|
| 296 |
+
Figure 15 is an example of how things can go south once a few bad mistakes are made at the outset. Figure 16 shows a much better set of choices made by the second order method, though clearly not as good as the brute force method. The log-space plots make it a bit easier to see the difference between the brute force and second order methods in Figures 14 and 16, respectively.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 16: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the second-order iterative re-ranking removal criterion
|
| 300 |
+
|
| 301 |
+
# 4.5.2 MNIST SINGLE DIGIT CLASSIFICATION: DIGIT 1
|
| 302 |
+
|
| 303 |
+
Examining Figure 17, we see a much starker example of the previous phenomenon, in which the brute force method continues to improve the performance of the network after removing $80 \%$ of the neurons in the network. The first and second order methods fail early and proceed in fits and starts (clearly demonstrating evidence of interrelated groups of noise-canceling neurons), and never fully recover. It should be noted that it would be impossible to see curves like this if neural networks evenly distributed the learning representation evenly or equitably over their hidden units.
|
| 304 |
+
|
| 305 |
+
One of the most striking things about the blue curve in Figure 17 is the fact that the network never drops below its starting error until it crosses the $80 \%$ mark, indicating that only $20 \%$ of the neurons in this network are actually essential to the learning the training objective. In this sense, we can only wonder how much of the training time was spent winnowing the error out of the remaining $80 \%$ of the network.
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 17: Degradation in squared error after pruning a single-layer network trained to do a oneversus-all classification of the digit 1 using the iterative re-ranking algorithm
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 18: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the brute force iterative re-ranking removal criterion
|
| 312 |
+
|
| 313 |
+
In Figures 18, 19 and 20 we can examine the choices made by the respective methods. The brute force method serves as our example of a near-optimal pruning regimen, and the rest are first and second order approximations of this. Small differences, clearly, can lead to large effects on the network output as shown in Figure 17.
|
| 314 |
+
|
| 315 |
+
# 4.5.3 MNIST SINGLE DIGIT CLASSIFICATION: DIGIT 2
|
| 316 |
+
|
| 317 |
+
Figure 21 is an interesting case because it shatters our confidence in the reliability of the second order method to make good pruning decisions, and further demonstrates the phenomenon of how much the error can improve if the right neurons are removed after training gets stuck. In this case, though still a poor performance overall, the first order method vastly outperforms the second order method.
|
| 318 |
+
|
| 319 |
+
Figure 22 shows us a clear example of the first element to remove having a negative error slope, and improving the output as a result. The rest of the pruning decisions are reasonable. Comparing with the blue curve in Figure 21, we see the correspondence between the first pruning decision improving the output, and the remaining pruning decisions keeping the output fairly flat. Clearly, however, there isn’t much room to get worse given our starting point with a sub-optimal network, and we see that the ending sum of squared errors is not much higher than the starting point. At the same time, we can still see the contrast in performance if we make optimal pruning decisions, and most of the neurons in this network were clearly doing nothing.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 19: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the first-order iterative re-ranking removal criterion
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 20: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the second-order iterative re-ranking removal criterion
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 21: Degradation in squared error after pruning a single-layer network trained to do a oneversus-all classification of the digit 2 using the iterative re-ranking algorithm
|
| 329 |
+
|
| 330 |
+
In Figure 23, we see a mixed bag in which the decisions are clearly sub-optimal, though much better than Figure 24, in which we can observe how a bad first decision essentially ruined the network for good. The jagged edges of the red curve in Figure 21 correspond with the positive and negative slopes of the cluster of bad pruning decisions in 24. Once again, these are not necessarily bad decisions, but the starting point is already bad and this cannot be recovered without re-training the network.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 22: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the brute force iterative re-ranking removal criterion
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 23: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the first-order iterative re-ranking removal criterion
|
| 337 |
+
|
| 338 |
+
# 4.5.4 ASIDE: IMPLICATIONS OF THIS EXPERIMENT
|
| 339 |
+
|
| 340 |
+
From the three examples above, we see that in each case, starting from a sub-optimal network, a brute force removal technique consistently improves performance for the first few pruning iterations, and the sum of squared errors does not degrade beyond the starting point until around $60 \%$ of the neurons have been removed. This is only possible if we have an essentially strict dichotomy between the roles of different neurons during training. If the network needs only $20 \%$ of the neurons it began with, the training process is essentially dominated by the task of canceling the residual noise of redundant neurons. Furthermore, the network can get stuck in training with redundant units and distort the final output. This is strong evidence of our thesis that the learning representation is neither equitably nor evenly distributed and that most of the neurons which do not directly participate in the learning representation can be removed without any retraining.
|
| 341 |
+
|
| 342 |
+
# 4.6 EXPERIMENTS ON TOY DATASETS
|
| 343 |
+
|
| 344 |
+
As can be seen from the experiments on MNIST, even though the 2nd-order approximation criterion is consistently better than 1st-order, its performance is not nearly as good as brute force based ranking, especially beyond the first layer. What is interesting to note is that from some other experiments conducted on toy datasets (predicting whether a given point would lie inside a given shape on the Cartesian plane), the performance of the 2nd-order method was found to be exceptionally good and produced results very close to the brute force method. The 1st-order method, as expected, performed poorly here as well. Some of these results are illustrated in Figure 25.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 24: Error surface of the network output in log space (left) and real space (right) with respect to each candidate neuron chosen for removal using the second-order iterative re-ranking removal criterion
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 25: Degradation in squared error (left) and classification accuracy (right) after pruning a 2- layer network using the iterative re-ranking algorithm on a toy “diamond” shape dataset (top) and a toy “random shape” dataset (below); (Network: 2 layers, 50 neurons/layer, 10 outputs, logistic sigmoid activation, starting test accuracy: 0.992(diamond); 0.986(random shape)
|
| 351 |
+
|
| 352 |
+
# 5 CONCLUSIONS & FUTURE WORK
|
| 353 |
+
|
| 354 |
+
In conclusion, we must first re-assert that we do not present this work as a bench-marking study of the algorithm we derived and tested. We have merely used this algorithm as a jumping off point to investigate the nature of learning representations in neural networks. What we discovered is that first and second order methods do not make particularly good pruning decisions, and can get hopelessly lost after making a bad pruning decision resulting in a network fault. Furthermore, the brute-force algorithm does surprisingly well, despite being computationally expensive. This method does so well in fact, we argue that further investigation is warranted to make this algorithm computationally tractable, though we do not speculate on how that should be done here.
|
| 355 |
+
|
| 356 |
+
We also observed strong evidence for the hypotheses of Mozer & Smolensky (1989a) regarding the “dualist” nature of hidden units, i.e. that learning representations are divided between units which either participate in the output approximation or learn to cancel each others influence. This suggests that neural networks may in fact learn a minimal network implicitly, though we cannot say for sure that this is the case without further investigation. A necessary experiment to this end would be to compare the size of network constructed using cascade correlation (Fahlman & Lebiere (1989)) and compare it to the results described herein.
|
| 357 |
+
|
| 358 |
+
We have presented a novel algorithm for pruning whole neurons from a trained neural network using a second-order Taylor series approximation of the change in error resulting from the removal a given neuron as a pruning criteria. We compared this method to a first order method and a bruteforce serial removal method which exhaustively found the next best single neuron to remove at each stage. Our algorithm relies on a combination of assumptions similar to the ones made by Mozer & Smolensky (1989a) and LeCun et al. (1989) in the formulation of the Skeletonization and Optimal Brain Damage algorithms.
|
| 359 |
+
|
| 360 |
+
First, we assumed that the error function with respect to each individual neuron can be approximated with a straight line or more precisely with a parabola. Second, for second derivative terms we consider only the diagonal elements of the Hessian matrix, i.e. we assume that each neuron-weight connection can be treated independently of the other elements in the network. Third, we assumed that pruning could be done in a serial fashion in which we find the single least productive element in the network, remove it, and move on. We found that all of these assumptions are deeply flawed in the sense that the true relevance of a neuron can only be partially approximated by a first or second order method, and only at certain stages of the pruning process.
|
| 361 |
+
|
| 362 |
+
For most problems, these methods can usually remove between $10 { - } 3 0 \%$ of the neurons in a trained network, but beyond this point their reliability breaks down. For certain problems, none of the described methods seem to perform very well, though for obvious reasons the brute-force method always exhibits the best results. The reason for this is that the error function with respect to each hidden unit is more complex than a simple second-order Taylor series can approximate. Furthermore, we have not directly taken into account the interdependence of elements within a network, though the work of Hassibi & Stork (1993) could provide some guidance in this regard. This is another critical issue to investigate in the future.
|
| 363 |
+
|
| 364 |
+
Re-training may help in this regard. We freely admit that our algorithm does not use re-training to recover from errors made in pruning decisions. We argue that evaluating a network pruning algorithm using re-training does not allow us to make fair comparisons between the kinds of decisions made by these algorithms. Neural networks are very good at recovering from the removal of individual elements with re-training and so this compensates for sub-optimal pruning criteria.
|
| 365 |
+
|
| 366 |
+
We have observed that pruning whole neurons from an optimally trained network without major loss in performance is not only possible but also enables compressing networks to $40 \%$ of their original size, which is of great importance in constrained memory environments like embedded devices. We cite the results of our experiments using the brute force criterion as evidence of this conclusion. However expensive, it would be extremely easy to parallelize this method, or potentially approximate it using a subset of the training data to decide which neurons to prune. This avoids the problem of trying to approximate the importance of a unit and potentially making a mistake.
|
| 367 |
+
|
| 368 |
+
It would also be interesting to see how these methods perform on deeper networks and on some other popular and real world datasets. In our case, on the MNIST dataset, we observed that it was more difficult to prune neurons from a deeper network than from one with a single layer. We should expect this trend to continue as networks get deeper and deeper, which also calls into further question the reliability of the described first and second order methods. We did investigate the order in which neurons were plucked from each layer of the networks and we found that the brute force method primarily removes neurons from the deepest layer of the network first, but there was no obvious pattern in layer preference for the other two methods.
|
| 369 |
+
|
| 370 |
+
Our experiments using the visualization of error surfaces and pruning decisions concretely establish the fact that not all neurons in a network contribute to its performance in the same way, and the observed complexity of these functions demonstrates limitations of the approximations we used.
|
| 371 |
+
|
| 372 |
+
Finally, we encourage the readers of this work to take these results into consideration when making decisions as to which methods to use to improve network generalization or compress their models. It should be remembered that various heuristics may perform well in practice for reasons which are in fact orthogonal to the accepted justifications given by their proponents.
|
| 373 |
+
|
| 374 |
+
# REFERENCES
|
| 375 |
+
|
| 376 |
+
Wolfgang Balzer, Masanobu Takahashi, Jun Ohta, and Kazuo Kyuma. Weight quantization in boltzmann machines. Neural Networks, 4(3):405–409, 1991.
|
| 377 |
+
|
| 378 |
+
Eric B Baum and David Haussler. What size net gives valid generalization? Neural computation, 1 (1):151–160, 1989.
|
| 379 |
+
|
| 380 |
+
Yves Chauvin. Generalization performance of overtrained back-propagation networks. In Neural Networks, pp. 45–55. Springer, 1990.
|
| 381 |
+
|
| 382 |
+
Gunhan Dundar and Kenneth Rose. The effects of quantization on multilayer neural networks. IEEE transactions on neural networks/a publication of the IEEE Neural Networks Council, 6(6): 1446–1451, 1994.
|
| 383 |
+
|
| 384 |
+
Scott E Fahlman and Christian Lebiere. The cascade-correlation learning architecture. 1989.
|
| 385 |
+
|
| 386 |
+
Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. arXiv preprint arXiv:1302.4389, 2013.
|
| 387 |
+
|
| 388 |
+
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.00149v5, 2016.
|
| 389 |
+
|
| 390 |
+
Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. Morgan Kaufmann, 1993.
|
| 391 |
+
|
| 392 |
+
Markus Hoehfeld and Scott E Fahlman. Learning with limited numerical precision using the cascade-correlation algorithm. IEEE Transactions on Neural Networks, 3(4):602–611, 1992.
|
| 393 |
+
|
| 394 |
+
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010.
|
| 395 |
+
|
| 396 |
+
Yann LeCun, John S Denker, Sara A Solla, Richard E Howard, and Lawrence D Jackel. Optimal brain damage. In NIPs, volume 89, 1989.
|
| 397 |
+
|
| 398 |
+
Michael C Mozer and Paul Smolensky. Skeletonization: A technique for trimming the fat from a network via relevance assessment. In Advances in neural information processing systems, pp. 107–115, 1989a.
|
| 399 |
+
|
| 400 |
+
Michael C Mozer and Paul Smolensky. Using relevance to reduce network size automatically. Connection Science, 1(1):3–16, 1989b.
|
| 401 |
+
|
| 402 |
+
Michael A Nielsen. Neural networks and deep learning. http://neuralnetworksanddeeplearning.com/chap4.html.(visited: 01.11. 2014), 2015.
|
| 403 |
+
|
| 404 |
+
URL:
|
| 405 |
+
|
| 406 |
+
Anders Øland and Bhiksha Raj. Reducing communication overhead in distributed learning by an order of magnitude (almost). In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 2219–2223, 2015.
|
| 407 |
+
|
| 408 |
+
Rohit Prabhavalkar, Ouais Alsharif, Antoine Bruguier, and Lan McGraw. On the compression of recurrent neural networks with an application to lvcsr acoustic modeling for embedded speech recognition. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5970–5974. IEEE, 2016.
|
| 409 |
+
|
| 410 |
+
Russell Reed. Pruning algorithms-a survey. Neural Networks, IEEE Transactions on, 4(5):740–747, 1993.
|
| 411 |
+
|
| 412 |
+
Bruce E Segee and Michael J Carter. Fault tolerance of pruned multilayer networks. In Neural Networks, 1991., IJCNN-91-Seattle International Joint Conference on, volume 2, pp. 447–452. IEEE, 1991.
|
| 413 |
+
|
| 414 |
+
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.
|
| 415 |
+
|
| 416 |
+
# APPENDIX
|
| 417 |
+
|
| 418 |
+
# A SECOND DERIVATIVE BACK-PROPAGATION
|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
Figure 26: A computational graph of a simple feed-forward network illustrating the naming of different variables, where $\sigma ( \cdot )$ is the nonlinearity, MSE is the mean-squared error cost function and $E$ is the overall loss.
|
| 422 |
+
|
| 423 |
+
Name and network definitions:
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
E = { \frac { 1 } { 2 } } \sum _ { i } ( o _ { i } ^ { ( 0 ) } - t _ { i } ) ^ { 2 } \quad o _ { i } ^ { ( m ) } = \sigma ( x _ { i } ^ { ( m ) } ) \quad x _ { i } ^ { ( m ) } = \sum _ { j } w _ { j i } ^ { ( m ) } o _ { j } ^ { ( m + 1 ) } \quad c _ { j i } ^ { ( m ) } = w _ { j i } ^ { ( m ) } o _ { j } ^ { ( m + 1 ) }
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
Superscripts represent the index of the layer of the network in question, with 0 representing the output layer. $E$ is the squared-error network cost function. $o _ { i } ^ { ( m ) }$ is the $i$ th output in layer $m$ generated by the activation function $\sigma$ , which in this paper is is the standard logistic sigmoid . x(m)i i s the weighted sumneuron in the puts to the ith neuron in the layer to the input of the ith $m$ th layer, and ron in the m $c _ { j i } ^ { ( m ) }$ is the contribution of the er. $j$ th $m + 1$
|
| 430 |
+
|
| 431 |
+
# A.1 FIRST AND SECOND DERIVATIVES
|
| 432 |
+
|
| 433 |
+
The first and second derivatives of the cost function with respect to the outputs:
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\frac { \partial E } { \partial o _ { i } ^ { ( 0 ) } } = o _ { i } ^ { ( 0 ) } - t _ { i }
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\frac { \partial ^ { 2 } E } { \partial o _ { i } ^ { ( 0 ) ^ { 2 } } } = 1
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
The first and second derivatives of the sigmoid function in forms depending only on the output:
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\begin{array} { l } { { \sigma ^ { \prime } ( x ) = \sigma ( x ) \left( 1 - \sigma ( x ) \right) } } \\ { { \sigma ^ { \prime \prime } ( x ) = \sigma ^ { \prime } ( x ) \left( 1 - 2 \sigma ( x ) \right) } } \end{array}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
The second derivative of the sigmoid is easily derived from the first derivative:
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
{ \begin{array} { l } { \displaystyle \sigma ^ { \prime } ( x ) = \sigma ( x ) \left( 1 - \sigma ( x ) \right) } \\ { \displaystyle \sigma ^ { \prime \prime } ( x ) = { \frac { \mathrm { d } } { \mathrm { d } x } } { \frac { \sigma ( x ) } { f ( x ) } } { \frac { \left( 1 - \sigma ( x ) \right) } { g ( x ) } } } \\ { \displaystyle \sigma ^ { \prime \prime } ( x ) = f ^ { \prime } ( x ) g ( x ) + f ( x ) g ^ { \prime } ( x ) } \\ { \displaystyle \sigma ^ { \prime \prime } ( x ) = \sigma ^ { \prime } ( x ) \left( 1 - \sigma ( x ) \right) - \sigma ( x ) \sigma ^ { \prime } ( x ) } \\ { \displaystyle \sigma ^ { \prime \prime } ( x ) = \sigma ^ { \prime } ( x ) - 2 \sigma ( x ) \sigma ^ { \prime } ( x ) } \\ { \displaystyle \sigma ^ { \prime \prime } ( x ) = \sigma ^ { \prime } ( x ) \left( 1 - 2 \sigma ( x ) \right) } \end{array} }
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
And for future convenience:
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { l } { { \displaystyle { \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \frac { \mathrm { d } } { \mathrm { d } x _ { i } ^ { ( m ) } } \left( \sigma _ { i } ^ { ( m ) } = \sigma ( x _ { i } ^ { ( m ) } ) \right) } } } \\ { { \displaystyle { \phantom { \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \left( \sigma _ { i } ^ { ( m ) } \right) \left( 1 - \sigma _ { i } ^ { ( m ) } \right) } } } } \\ { { \displaystyle { \phantom { \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \sigma ^ { \prime } \left( x _ { i } ^ { ( m ) } \right) } \left( \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \left( \sigma _ { i } ^ { ( m ) } \right) \left( 1 - \sigma _ { i } ^ { ( m ) } \right) \right) } } } \\ { { \displaystyle { \phantom { \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \frac { \mathrm { d } } { \mathrm { d } x _ { i } ^ { ( m ) } } \left( \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \left( \sigma _ { i } ^ { ( m ) } \right) \left( 1 - 2 \sigma _ { i } ^ { ( m ) } \right) \right) } } } } \\ { \displaystyle { \phantom { \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \left( \sigma _ { i } ^ { ( m ) } \left( 1 - \sigma _ { i } ^ { ( m ) } \right) \right) \left( 1 - 2 \sigma _ { i } ^ { ( m ) } \right) } } } \\ { \displaystyle { \phantom { \frac { \mathrm { d } { \partial _ { i } ^ { ( m ) } } } { \mathrm { d } x _ { i } ^ { ( m ) } } = \sigma ^ { \prime } \left( x _ { i } ^ { ( m ) } \right) } } } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
Derivative of the error with respect to the ith neuron’s input $x _ { i } ^ { ( 0 ) }$ in the output layer:
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { r l } & { \frac { \partial E } { \partial x _ { i } ^ { ( 0 ) } } = \frac { \partial E } { \partial \sigma _ { i } ^ { ( 0 ) } } \frac { \partial \sigma _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) } } } \\ & { \qquad = \underbrace { \left( \sigma _ { i } ^ { ( 0 ) } - t _ { i } \right) } _ { \mathrm { f r o m ~ ( 6 ) } } \underbrace { \sigma \left( x _ { i } ^ { ( 0 ) } \right) \left( 1 - \sigma \left( x _ { i } ^ { ( 0 ) } \right) \right) } _ { \mathrm { f r o m ~ ( 8 ) } } } \\ & { \qquad = \left( \sigma _ { i } ^ { ( 0 ) } - t _ { i } \right) \left( \sigma _ { i } ^ { ( 0 ) } \left( 1 - \sigma _ { i } ^ { ( 0 ) } \right) \right) } \\ & { \qquad = \left( \sigma _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime } \left( x _ { i } ^ { ( 0 ) } \right) } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
Second derivative of the error with respect to the ith neuron’s input $x _ { i } ^ { ( 0 ) }$ in the output layer:
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\begin{array} { r l r } { { \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( 0 ) ^ { 2 } } } = \frac { \partial } { \partial x _ { i } ^ { ( 0 ) } } ( \frac { \partial E } { \partial \sigma _ { i } ^ { ( 0 ) } } \frac { \partial \sigma _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) } } ) } } \\ & { } & { = \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( 0 ) } \partial \sigma _ { i } ^ { ( 0 ) } } \frac { \partial \sigma _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) } } + \frac { \partial E } { \partial \sigma _ { i } ^ { ( 0 ) } } \frac { \partial ^ { 2 } \sigma _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) ^ { 2 } } } } \\ & { } & { = \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( 0 ) } \partial \sigma _ { i } ^ { ( 0 ) } } \underbrace { ( \frac { \sigma _ { i } ^ { ( 0 ) } } { i } ( 1 - \sigma _ { i } ^ { ( 0 ) } ) ) } _ { \mathrm { f r o m ~ ( 8 ) } } + \underbrace { ( \sigma _ { i } ^ { ( 0 ) } - t _ { i } ) } _ { \mathrm { f r o m ~ ( 6 ) } } \underbrace { ( \sigma _ { i } ^ { ( 0 ) } ( 1 - \sigma _ { i } ^ { ( 0 ) } ) ) ( 1 - 2 \sigma _ { i } ^ { ( 0 ) } ) } _ { \mathrm { f r o m ~ ( 9 ) } } } \end{array}
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
\left( \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( 0 ) } \partial \sigma _ { i } ^ { ( 0 ) } } \right) = \frac { \partial } { \partial x _ { i } ^ { ( 0 ) } } \frac { \partial E } { \partial \sigma _ { i } ^ { ( 0 ) } } = \frac { \partial } { \partial x _ { i } ^ { ( 0 ) } } \underbrace { \left( \sigma _ { i } ^ { ( 0 ) } - t _ { i } \right) } _ { \left( \partial x _ { i } ^ { ( 0 ) } \right) } = \frac { \partial \sigma _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) } } = \underbrace { \left( \sigma _ { i } ^ { ( 0 ) } \left( 1 - \sigma _ { i } ^ { ( 0 ) } \right) \right) } _ { \left( \partial x _ { i } ^ { ( 0 ) } \right) }
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { c } { { \displaystyle { \frac { \partial ^ { 2 } E } { \partial { x _ { i } ^ { ( 0 ) } } ^ { 2 } } = \left( o _ { i } ^ { ( 0 ) } \left( 1 - o _ { i } ^ { ( 0 ) } \right) \right) ^ { 2 } + \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \left( o _ { i } ^ { ( 0 ) } \left( 1 - o _ { i } ^ { ( 0 ) } \right) \right) \left( 1 - 2 o _ { i } ^ { ( 0 ) } \right) } } } \\ { { \mathrm { } } } \\ { { \displaystyle { = \left( \sigma ^ { \prime } \left( x _ { i } ^ { ( 0 ) } \right) \right) ^ { 2 } + \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime \prime } \left( x _ { i } ^ { ( 0 ) } \right) } } } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
First derivative of the error with respect to a single input contribution $c _ { j i } ^ { ( 0 ) }$ from neuron $j$ to neuron i with weight w(0)ji in the output layer:
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { r l r } { { \frac { \partial E } { \partial c _ { j i } ^ { ( 0 ) } } = \frac { \partial E } { \partial o _ { i } ^ { ( 0 ) } } \frac { \partial o _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) } } \frac { \partial x _ { i } ^ { ( 0 ) } } { \partial c _ { j i } ^ { ( 0 ) } } } } \\ & { } & { = \underbrace { ( o _ { i } ^ { ( 0 ) } - t _ { i } ) } _ { \mathrm { f r o m ~ ( 6 ) } } \underbrace { ( o _ { i } ^ { ( 0 ) } ( 1 - o _ { i } ^ { ( 0 ) } ) ) } _ { \mathrm { f r o m ~ ( 8 ) } } \frac { \partial x _ { i } ^ { ( 0 ) } } { \partial c _ { j i } ^ { ( 0 ) } } } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\begin{array} { r l } & { \left( \displaystyle \frac { \partial x _ { i } ^ { ( m ) } } { \partial c _ { j i } ^ { ( m ) } } \right) = \displaystyle \frac { \partial } { \partial c _ { j i } ^ { ( m ) } } \left( x _ { i } ^ { ( m ) } = \sum _ { j } w _ { j i } ^ { ( m ) } o _ { j } ^ { ( m + 1 ) } \right) = \displaystyle \frac { \partial } { \partial c _ { j i } ^ { ( m ) } } \left( c _ { j i } ^ { ( m ) } + k \right) = 1 } \\ & { \qquad \displaystyle \frac { \partial E } { \partial c _ { j i } ^ { ( 0 ) } } = \left( o _ { i } ^ { ( 0 ) } - l _ { i } \right) \left( o _ { i } ^ { ( 0 ) } \left( 1 - o _ { i } ^ { ( 0 ) } \right) \right) } \\ & { \qquad \displaystyle = \underbrace { \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime } \left( x _ { i } ^ { ( 0 ) } \right) } _ { \mathrm { t r o m ~ ( 2 5 ) } } } \\ & { \qquad \displaystyle \frac { \partial E } { \partial c _ { j i } ^ { ( 0 ) } } = \frac { \partial E } { \partial x _ { i } ^ { ( 0 ) } } } \end{array}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
Second derivative of the error with respect to a single input contribution $c _ { j i } ^ { ( 0 ) }$ :
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
\begin{array} { r l } { \frac { \partial ^ { 2 } E } { \partial t _ { 3 } ^ { ( 0 ) } } ^ { 2 } = \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( \frac { \partial E } { \partial x _ { 3 } ^ { ( 0 ) } } ^ { 2 } = \underbrace { ( \alpha ^ { ( 0 ) } - i \delta ) \sigma ^ { \prime } ( x _ { 3 } ^ { ( 0 ) } ) } _ { i \mathrm { m i n } ( \infty ( s ) ) } ) } & { } \\ { = \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( ( \varepsilon ( \frac { i \delta } { s } ) ^ { 2 } ) - i _ { z } ) \sigma ^ { \prime } ( \overline { { \alpha } } _ { i } ^ { ( 0 ) } ) } & { } \\ { = \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( \tau ( \sum _ { s } w _ { i } ^ { ( 0 ) } , \sigma _ { i j } ^ { ( 0 ) } + 1 ) - \kappa _ { k } ) \sigma ^ { \prime } ( \sum _ { s } w _ { i } ^ { ( 0 ) } , \sigma _ { j i } ^ { ( 0 + 1 ) } ) } & { } \\ { = \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( \tau ( \sum _ { s } w _ { i } ^ { ( 0 ) } ) - i _ { z } ) \sigma ^ { \prime } ( \sum _ { s } w _ { i } ^ { ( 0 ) } ) } & { } \\ { = \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( \frac { \partial \sigma ( x _ { i j } ^ { ( 0 ) } + k ) } { \partial t _ { 3 } ^ { ( 0 ) } } - 1 ) \sigma ^ { \prime } ( \sum _ { s } w _ { i } ^ { ( 0 ) } ) } & { } \\ = \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } \frac { \partial } { \partial t _ { 3 } ^ { ( 0 ) } } ( \frac { \partial \sigma ( x _ { i j } ^ { ( 0 ) } + k ) } { \partial t _ { 3 } ^ { ( 0 ) } ( \varepsilon ( x _ { i j } ^ { ( 0 ) } ) } - 1 ) \sigma ^ { \prime } ( \sum _ { s } w _ { i } ^ \end{array}
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
We now make use of the abbreviations $f$ and $g$ :
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\begin{array} { r l } & { \quad = \bar { f } \left( \mathcal { L } _ { \beta } ^ { ( 0 ) } \right) g \left( c _ { \beta \gamma } ^ { ( 0 ) } \right) + \bar { f } \left( c _ { \beta \gamma } ^ { ( 0 ) } \right) g ^ { \prime } \left( c _ { \beta \gamma } ^ { ( 0 ) } \right) } \\ & { \quad = \sigma ^ { \prime } \left( c _ { \beta \gamma } ^ { ( 0 ) } + k \right) \sigma ^ { \prime } \left( c _ { \beta \gamma } ^ { ( 0 ) } + k \right) + \left( \sigma \left( c _ { \beta \gamma } ^ { ( 0 ) } + k \right) - l _ { \downarrow } \right) \sigma ^ { \prime \prime } \left( c _ { \beta \gamma } ^ { ( 0 ) } + k \right) } \\ & { \quad = \sigma ^ { \prime } \left( c _ { \beta \gamma } ^ { ( 0 ) } + k \right) ^ { 2 } + \left( \sigma _ { \downarrow } ^ { ( 0 ) } - t _ { \downarrow } \right) \sigma ^ { \prime \prime } \left( c _ { \beta \gamma } ^ { ( 0 ) } + k \right) } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \frac { \partial ^ { 2 } F } { \partial c _ { \beta \gamma } ^ { ( 0 ) } } } \\ & { \quad \quad \quad \quad \quad \frac { \partial ^ { 2 } F } { \partial c _ { \beta \gamma } ^ { ( 0 ) } } ^ { 2 } = \underbrace { \left( \sigma ^ { \prime } \left( x _ { \langle } ^ { ( 0 ) } \right) \right) ^ { 2 } + \left( \sigma _ { \downarrow } ^ { ( 0 ) } - t _ { \downarrow } \right) \sigma ^ { \prime \prime } \left( c _ { \downarrow } ^ { ( 0 ) } \right) } _ { \mathrm { e m ~ \ c a l ~ \lambda \mit t } } } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
# A.1.1 SUMMARY OF OUTPUT LAYER DERIVATIVES
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\frac { \partial E } { \partial o _ { i } ^ { ( 0 ) } } = o _ { i } ^ { ( 0 ) } - t _ { i } \quad \quad \quad \quad \quad \frac { \partial ^ { 2 } E } { { \partial o _ { i } ^ { ( 0 ) } } ^ { 2 } } = 1
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\frac { \partial E } { \partial x _ { i } ^ { ( 0 ) } } = \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime } \left( x _ { i } ^ { ( 0 ) } \right) \quad \quad \frac { \partial ^ { 2 } E } { \partial { x _ { i } ^ { ( 0 ) } } ^ { 2 } } = \left( \sigma ^ { \prime } \left( x _ { i } ^ { ( 0 ) } \right) \right) ^ { 2 } + \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime \prime } \left( x _ { i } ^ { ( 0 ) } \right)
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
{ \frac { \partial E } { \partial c _ { j i } ^ { ( 0 ) } } } = { \frac { \partial E } { \partial x _ { i } ^ { ( 0 ) } } } \qquad { \frac { \partial ^ { 2 } E } { \partial c _ { j i } ^ { ( 0 ) ^ { 2 } } } } = { \frac { \partial ^ { 2 } E } { \partial { x _ { i } ^ { ( 0 ) } } ^ { 2 } } }
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
# A.1.2 HIDDEN LAYER DERIVATIVES
|
| 518 |
+
|
| 519 |
+
The first derivative of the error with respect to a neuron with output $o _ { j } ^ { ( 1 ) }$ in the first hidden layer, summing over all partial derivative contributions from the output layer:
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\frac { \partial E } { \partial o _ { j } ^ { ( 1 ) } } = \sum _ { i } \frac { \partial E } { \partial o _ { i } ^ { ( 0 ) } } \frac { \partial o _ { i } ^ { ( 0 ) } } { \partial x _ { i } ^ { ( 0 ) } } \frac { \partial x _ { i } ^ { ( 0 ) } } { \partial c _ { j i } ^ { ( 0 ) } } \frac { \partial c _ { j i } ^ { ( 0 ) } } { \partial o _ { j } ^ { ( 1 ) } } = \sum _ { i } \underbrace { \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime } \left( x _ { i } ^ { ( 0 ) } \right) } _ { \textit { i } } w _ { j i } ^ { ( 0 ) }
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\begin{array} { c } { { \displaystyle { \frac { \partial c _ { j i } ^ { ( m ) } } { \partial o _ { j } ^ { ( m + 1 ) } } = \frac { \partial } { \partial o _ { j } ^ { ( m + 1 ) } } \left( c _ { j i } ^ { ( m ) } = w _ { j i } ^ { ( m ) } o _ { j } ^ { ( m + 1 ) } \right) = w _ { j i } ^ { ( m ) } } } } \\ { { \displaystyle { \frac { \partial E } { \partial o _ { j } ^ { ( 1 ) } } = \sum _ { i } \frac { \partial E } { \partial x _ { i } ^ { ( 0 ) } } w _ { j i } ^ { ( 0 ) } } } } \end{array}
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
Note that this equation does not depend on the specific form o f ∂E∂x(0) , whether it involves a sigmoid or any other activation function. We can therefore replace the specific indexes with general ones, and use this equation in the future.
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
\frac { \partial E } { \partial o _ { j } ^ { ( m + 1 ) } } = \sum _ { i } \frac { \partial E } { \partial x _ { i } ^ { ( m ) } } w _ { j i } ^ { ( m ) }
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
The second derivative of the error with respect to a neuron with output $o _ { j } ^ { ( 1 ) }$ in the first hidden layer:
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\begin{array} { l } { { \displaystyle { \frac { \partial ^ { 2 } E } { \partial { o _ { j } ^ { ( 1 ) } } ^ { 2 } } = \frac { \partial } { \partial { o _ { j } ^ { ( 1 ) } } } \frac { \partial E } { \partial { o _ { j } ^ { ( 1 ) } } } } } } \\ { { \displaystyle { \ = \frac { \partial } { \partial { o _ { j } ^ { ( 1 ) } } } \sum _ { i } \frac { \partial E } { \partial { x _ { i } ^ { ( 0 ) } } } w _ { j i } ^ { ( 0 ) } } } } \\ { { \displaystyle { \ = \frac { \partial } { \partial { o _ { j } ^ { ( 1 ) } } } \sum _ { i } \left( o _ { i } ^ { ( 0 ) } - t _ { i } \right) \sigma ^ { \prime } \left( { x _ { i } ^ { ( 0 ) } } \right) w _ { j i } ^ { ( 0 ) } } } } \end{array}
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
If we now make use of the fact, that $\begin{array} { r } { o _ { i } ^ { ( 0 ) } = \sigma \left( x _ { i } ^ { ( 0 ) } \right) = \sigma \left( \sum _ { j } \left( w _ { j i } ^ { ( 0 ) } o _ { j } ^ { ( 1 ) } \right) \right) } \end{array}$ , we can evaluate the expression further.
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
\begin{array} { r l } { \frac { \partial \hat { \mathcal { F } } ( R ) } { \partial \theta _ { 0 } ^ { ( 1 ) } } = \frac { \partial } { \partial \theta _ { 0 } ^ { ( 1 ) } } \sum _ { t } ( \underbrace { \sigma ( \sum _ { s } \alpha _ { 0 } ^ { ( 0 , 0 , 1 ) } \alpha _ { 0 } ^ { ( 1 ) } ) } _ { t \in \mathcal { N } _ { 1 } ^ { ( 0 , 1 ) } } - \nu _ { s } ) \cdot ( \sum _ { s } \gamma _ { s } \alpha _ { 0 } ^ { ( 0 , 0 , 0 ) } ) \frac { \alpha _ { 0 } ^ { ( 1 ) } } { s ! } } & { = } \\ & { \quad - \sum _ { s } ( \mathcal { C } ( \frac { \partial ^ { ( 0 , 0 ) } } { \partial s } ) \alpha _ { 0 } ^ { ( 0 , 0 ) } ) - f ( \alpha _ { 0 } ^ { ( 1 ) } - 1 ) \cdot \sqrt { ( \alpha _ { 0 } ^ { ( 0 , 1 ) } ) } } & { = } \\ & { \quad - \sum _ { s ^ { \prime } } ( ( \sum _ { s } \alpha _ { 0 } ^ { ( 0 , 0 ) } \beta _ { 0 } ^ { ( 1 ) } ) \alpha _ { 0 } ^ { ( 0 , 0 ) } - f ( \sum _ { s } \alpha _ { 0 } ^ { ( 1 ) } ) ) \cdot ( \alpha _ { 0 } ^ { ( 0 , 1 ) } ) } \\ & { \quad \sum _ { s ^ { \prime } } ( \varepsilon ( \sum _ { s } \gamma _ { s } ^ { ( 0 , 0 , 1 ) } ) \alpha _ { 0 } ^ { ( 1 ) } - \varepsilon ( \sum _ { s } \alpha _ { 0 } ^ { ( 0 , 0 ) } \beta _ { 0 } ^ { ( 1 ) } ) ) \frac { \alpha _ { 0 } ^ { ( 1 ) } } { s ^ { 2 } } + \dots } \\ & \quad \sum _ { s ^ { \prime } } ( \varepsilon ( \sum _ { s } \gamma _ { s } ^ { ( 0 , 0 , 1 ) } ) - ( \sum _ { s } \gamma _ { s } ^ { ( 0 , 0 , 0 ) } \varepsilon ) \frac { \alpha _ { 0 } ^ { ( 1 ) } } { s ^ { 2 } } ) \cdot ( \sum _ { s } \alpha _ { 0 } ^ { ( 1 ) } \varepsilon ) \frac { \partial ^ { ( 0 , 0 ) } } { \partial s ^ { \prime } } ) ( \varepsilon ( \frac { \partial ^ { ( 0 , 0 ) } } \end{array}
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
Summing up, we obtain the more general expression:
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
\frac { \partial ^ { 2 } E } { { \partial o _ { j } ^ { ( 1 ) } } ^ { 2 } } = \sum _ { i } \frac { \partial ^ { 2 } E } { { \partial x _ { i } ^ { ( 0 ) } } ^ { 2 } } \left( w _ { j i } ^ { ( 0 ) } \right) ^ { 2 }
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
Note that the equation in (65) does not depend on the form o f ∂2E∂x(0)x 2 , which means we can replace the specific indexes with general ones:
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\frac { \partial ^ { 2 } E } { \partial o _ { j } ^ { ( m + 1 ) ^ { 2 } } } = \sum _ { i } \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( m ) ^ { 2 } } } \left( w _ { j i } ^ { ( m ) } \right) ^ { 2 }
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
At this point we are beginning to see the recursion in the form of the 2nd derivative terms which can be thought of analogously to the first derivative recursion which is central to the back-propagation algorithm. The formulation above which makes specific reference to layer indexes also works in the general case.
|
| 560 |
+
|
| 561 |
+
Consider the $i$ th neuron in any layer $m$ with output $o _ { i } ^ { ( m ) }$ and input $x _ { i } ^ { ( m ) }$ . The first and second derivatives of the error $E$ with respect to this neuron’s input are:
|
| 562 |
+
|
| 563 |
+
$$
|
| 564 |
+
\frac { \partial E } { \partial x _ { i } ^ { ( m ) } } = \frac { \partial E } { \partial o _ { i } ^ { ( m ) } } \frac { \partial o _ { i } ^ { ( m ) } } { \partial x _ { i } ^ { ( m ) } }
|
| 565 |
+
$$
|
| 566 |
+
|
| 567 |
+
$$
|
| 568 |
+
\begin{array} { r l } & { \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } = \frac { \partial } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } \frac { \partial E } { \partial x _ { 1 } ^ { ( \mathrm { i n k } ) } } } \\ & { \phantom { \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } = } - \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } \frac { \partial E } { \partial x _ { 1 } ^ { ( \mathrm { i n k } ) } } } \\ & { \phantom { \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } = } - \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } ( \frac { \partial ^ { 2 } E } { \partial z _ { 1 } ^ { ( \mathrm { i n k } ) } } \frac { \partial ^ { 2 } E ^ { ( \mathrm { i n k } ) } } { \partial z _ { 1 } ^ { ( \mathrm { i n k } ) } } ) } \\ & { \phantom { \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } = } - \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } \frac { \partial ^ { 2 } E } { \partial z _ { 1 } ^ { ( \mathrm { i n k } ) } } \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } } \\ & { \phantom { \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } = } \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } \partial z _ { 1 } ^ { ( \mathrm { i n k } ) } } \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } } \\ & \phantom \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } = \frac { \partial ^ { 2 } E } { \partial z _ { 2 } ^ { ( \mathrm { i n k } ) } } ( \frac { \partial ^ { 2 } E } { \partial z _ { 1 } ^ { ( \mathrm { i n k } ) } } - \frac { \partial ^ { 2 } E } \partial z _ { 1 } ^ ( \ \end{array}
|
| 569 |
+
$$
|
| 570 |
+
|
| 571 |
+
Note the form of this equation is the general form of what was derived for the output layer in (31). Both of the above first and second terms are easily computable and can be stored as we propagate back from the output of the network to the input. With respect to the output layer, the first and second derivative terms have already been derived above. In the case of the $m + 1$ hidden layer during back propagation, there is a summation of terms calculated in the mth layer. For the first derivative, we have this from (55).
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
\frac { \partial E } { \partial o _ { j } ^ { ( m + 1 ) } } = \sum _ { i } \frac { \partial E } { \partial x _ { i } ^ { ( m ) } } w _ { j i } ^ { ( m ) }
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
And the second derivative for the $j$ th neuron in the $m + 1$ layer:
|
| 578 |
+
|
| 579 |
+
$$
|
| 580 |
+
\frac { \partial ^ { 2 } E } { \partial x _ { j } ^ { ( m + 1 ) ^ { 2 } } } = \frac { \partial ^ { 2 } E } { \partial o _ { j } ^ { ( m + 1 ) ^ { 2 } } } \left( \sigma ^ { \prime } \left( x _ { j } ^ { ( m + 1 ) } \right) \right) ^ { 2 } + \frac { \partial E } { \partial o _ { j } ^ { ( m + 1 ) } } \sigma ^ { \prime \prime } \left( x _ { j } ^ { ( m + 1 ) } \right)
|
| 581 |
+
$$
|
| 582 |
+
|
| 583 |
+
We can replace both derivative terms with the forms which depend on the previous layer:
|
| 584 |
+
|
| 585 |
+
$$
|
| 586 |
+
\frac { \partial ^ { 2 } E } { \partial x _ { j } ^ { ( m + 1 ) ^ { 2 } } } = \underbrace { \sum _ { i } \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( 0 ) ^ { 2 } } } \left( w _ { j i } ^ { ( 0 ) } \right) ^ { 2 } } _ { \mathrm { f r o m ~ ( 6 6 ) } } \left( \sigma ^ { \prime } \left( x _ { j } ^ { ( m + 1 ) } \right) \right) ^ { 2 } + \underbrace { \sum _ { i } \frac { \partial E } { \partial x _ { i } ^ { ( m ) } } w _ { j i } ^ { ( m ) } } _ { \mathrm { f r o m ~ ( 5 5 ) } } \sigma ^ { \prime \prime } \left( x _ { j } ^ { ( m + 1 ) } \right)
|
| 587 |
+
$$
|
| 588 |
+
|
| 589 |
+
And this horrible mouthful of an equation gives you a general form for any neuron in the $j$ th position of the $m + 1$ layer. Taking very careful note of the indexes, this can be more or less translated painlessly to code. You are welcome, world.
|
| 590 |
+
|
| 591 |
+
# A.1.3 SUMMARY OF HIDDEN LAYER DERIVATIVES
|
| 592 |
+
|
| 593 |
+
$$
|
| 594 |
+
\frac { \partial E } { \partial \sigma _ { j } ^ { ( m + 1 ) } } = \sum _ { i } \frac { \partial E } { \partial x _ { i } ^ { ( m ) } } w _ { j i } ^ { ( m ) } \qquad \frac { \partial ^ { 2 } E } { \partial \sigma _ { j } ^ { ( m + 1 ) ^ { 2 } } } = \sum _ { i } \frac { \partial ^ { 2 } E } { \partial x _ { i } ^ { ( m ) ^ { 2 } } } \left( w _ { j i } ^ { ( m ) } \right) ^ { 2 }
|
| 595 |
+
$$
|
| 596 |
+
|
| 597 |
+
$$
|
| 598 |
+
\begin{array} { r l r } { { \frac { \partial E } { \partial x _ { i } ^ { ( m ) } } = \frac { \partial E } { \partial o _ { i } ^ { ( m ) } } \frac { \partial o _ { i } ^ { ( m ) } } { \partial x _ { i } ^ { ( m ) } } } } \\ & { \frac { \partial ^ { 2 } E } { \partial x _ { j } ^ { ( m + 1 ) ^ { 2 } } } = \frac { \partial ^ { 2 } E } { \partial o _ { j } ^ { ( m + 1 ) ^ { 2 } } } ( \sigma ^ { \prime } ( x _ { j } ^ { ( m + 1 ) } ) ) ^ { 2 } + \frac { \partial E } { \partial o _ { j } ^ { ( m + 1 ) } } \sigma ^ { \prime \prime } ( x _ { j } ^ { ( m + 1 ) } ) } \end{array}
|
| 599 |
+
$$
|
md/train/BkeaEyBYDB/BkeaEyBYDB.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING FEDERATED LEARNING PERSONALIZATION VIA MODEL AGNOSTIC META LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Federated Learning (FL) refers to learning a high quality global model based on decentralized data storage, without ever copying the raw data. A natural scenario arises with data created on mobile phones by the activity of their users. Given the typical data heterogeneity in such situations, it is natural to ask how can the global model be personalized for every such device, individually. In this work, we point out that the setting of Model Agnostic Meta Learning (MAML), where one optimizes for a fast, gradient-based, few-shot adaptation to a heterogeneous distribution of tasks, has a number of similarities with the objective of personalization for FL. We present FL as a natural source of practical applications for MAML algorithms, and make the following observations. 1) The popular FL algorithm, Federated Averaging (McMahan et al., 2017), can be interpreted as a meta learning algorithm. 2) Careful fine-tuning can yield a global model with higher accuracy, which is at the same time easier to personalize. However, solely optimizing for the global model accuracy yields a weaker personalization result. 3) A model trained using a standard datacenter optimization method is much harder to personalize, compared to one trained using Federated Averaging, supporting the first claim. These results raise new questions for FL, MAML, and broader ML research.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In recent years, the growth of machine learning applications was driven by aggregation of large amounts of data in a datacenter, where a model can be trained using large scale distributed system (Dean et al., 2012; LeCun et al., 2015). Both the research community and general public are becoming increasingly aware that there is a variety of scenarios where this kind of data collection comes with significant risks, mainly related to notions of privacy and trust.
|
| 12 |
+
|
| 13 |
+
In the presence of user generated data, such as activity on mobile phones, Federated Learning (FL) (McMahan & Ramage, 2017) proposes an alternative approach for training a high quality global model without ever sending raw data to the cloud. The FL system proposed by Google (Bonawitz et al., 2019) selects a sample of available devices and sends them a model to be trained. The devices compute an update to the model based on an optimization procedure with locally available data, and the central system aggregates the updates from different devices. Such iteration is repeated many times until the model has converged. The users’ training data does not leave their devices. The basic FL algorithm, Federated Averaging (FedAvg) (McMahan et al., 2017), has been used in production applications, for instance for next word prediction in mobile keyboard (Hard et al., 2018), which shows that Federated Learning can outperform the best model trained in a datacenter. Successful algorithmic extensions to the central idea include training a differential private model (McMahan et al., 2018), compression (Konecnˇ y et al., 2016b; Caldas et al., 2018a), secure ´ aggregation (Bonawitz et al., 2017), and a smaller number of always-participating nodes (Yang et al., 2019).
|
| 14 |
+
|
| 15 |
+
FL applications generally face non-i.i.d and unbalanced data available to devices, which makes it challenging to ensure good performance across different devices with a FL-trained global model. Theoretical guarantees are only available under restrictive assumptions and for convex objectives, cf. Li et al. (2019b). In this work, we are interested in personalization methods that adapt the model for data available on each device, individually. We refer to a trained global model as the initial model, and the locally adapted model as the personalized model. Existing FL personalization work directly takes a converged initial model and conducts personalization evaluation via gradient descent (Beaufays et al., 2019). However, in this approach, the training and personalization procedures are completely disconnected, which results in potentially suboptimal personalized models.
|
| 16 |
+
|
| 17 |
+
Meta Learning optimizes the performance after adaptation given few-shot adaptation examples on heterogeneous tasks, and has increasing applications in the context of Supervised Learning and Reinforcement Learning. Model Agnostic Meta Learning (MAML) introduced by Finn et al. (2017) is a solely gradient-based Meta Learning algorithm, which runs in two connected stages; metatraining and meta-testing. Meta-training learns a sensitive initial model which can conduct fast adaptation on a range of tasks, and meta-testing adapts the initial model for a particular task.
|
| 18 |
+
|
| 19 |
+
Both tasks for MAML, and clients for FL, are heterogeneous. For each task in MAML and client in FL, existing algorithms use a variant of gradient descent locally, and send an overall update to a coordinator to update the global model. If we present the FL training process as meta-training in the MAML language, and the FL personalization via gradient descent as meta-testing, we show in Section 2 that FedAvg (McMahan et al., 2017) and Reptile (Nichol et al., 2018), two popular FL and MAML algorithms, are very similar to each other; see also Khodak et al. (2019).
|
| 20 |
+
|
| 21 |
+
In order to make FL personalization useful in practice, we propose that the following objectives must all be addressed, simultaneously.
|
| 22 |
+
|
| 23 |
+
(1) Improved Personalized Model – for a large majority of the clients.
|
| 24 |
+
(2) Solid Initial Model – some clients have limited or even no data for personalization.
|
| 25 |
+
(3) Fast Convergence – reach a high quality model in small number of training rounds.
|
| 26 |
+
|
| 27 |
+
Typically, the MAML algorithms only focus on objective (1); that was the original motivation in Finn et al. (2017). Existing FL works usually focus on objectives (2) and (3), and take the personalized performance as secondary. This is largely due to the fact that it was not obvious that getting a solid initial model is feasible or practical if devices are available occasionally and with limited resources.
|
| 28 |
+
|
| 29 |
+
In this work, we study these three objectives jointly, and our main contributions are:
|
| 30 |
+
|
| 31 |
+
• We point out the connection between two widely used FL and MAML algorithms, and interpret existing FL algorithm in the light of existing MAML algorithms.
|
| 32 |
+
We propose a novel modification of FedAvg, with two stages of training and fine-tuning, for optimizing the three above objectives.
|
| 33 |
+
We empirically demonstrate that FedAvg is already a meta learning algorithm, optimizing for personalized performance, as opposed to quality of the global model. Furthermore, we show that the fine tuning stage enables better and more stable personalized performance.
|
| 34 |
+
• We observe that different global models with the same accuracy, can exhibit very different capacity for personalization.
|
| 35 |
+
• We highlight that these results challenge the existing objectives in the FL literature, and motivate new problems for the broader Machine Learning research community.
|
| 36 |
+
|
| 37 |
+
# 2 INTERPRETING FEDAVG AS A META LEARNING ALGORITHM
|
| 38 |
+
|
| 39 |
+
In this section, we highlight the similarities between the FL and MAML algorithms and interpret FedAvg as a linear combination of a naive baseline and a collection of existing MAML methods.
|
| 40 |
+
|
| 41 |
+
Algorithm 1 presents a conceptual algorithm with nested structure (left column), of which the MAML meta-training algorithm, Reptile (middle column), and FL-training algorithm, FedAvg (right column), are particular instances. We assume that $L$ is a loss function common to all of the following arguments. In each iteration, a MAML algorithm trains across a random batch of tasks $\{ T _ { i } \}$ . For each task $T _ { i }$ , it conducts an inner-loop update, and aggregates gradients from each sampled task with an outer-loop update. In each training round, FL uses a random selection of clients $\{ T _ { i } \}$ . For each client $T _ { i }$ and its weight $w _ { i }$ , it runs an optimization procedure for a number of epochs over the local data, and sends the update to the server, which aggregates the updates to form a new global model. If we simplify the setting and assume all clients have the same amount of data, causing the weights $w _ { i }$ to be identical, Reptile and FedAvg in fact become the same algorithms. Several other MAML algorithms (Finn et al., 2017; Antoniou et al., 2018), or other non-MAML/FL methods (Zhang et al., 2019), can also be viewed as instances of the conceptual method in left column of Algorithm 1.
|
| 42 |
+
|
| 43 |
+
<table><tr><td colspan="3">Algorithm1 Connects FL and MAML (left),Reptile Batch Version(middle),and FedAvg (right).</td></tr><tr><td>OuterLoop/Server learning rate α</td><td>Require::Reptile Step K.</td><td>Require:FedAvg Local Epoch E.</td></tr><tr><td>InnerLoop/Client learning rate β</td><td>functionInnerLoop(0,Ti,β)</td><td>function ClientUpdate(0,T,β)</td></tr><tr><td>Initial model parameters θ</td><td>SampleK-shot data Di,k from Ti.</td><td>Split local dataset into batches B</td></tr><tr><td>while not done do</td><td>0=0</td><td>0=θ</td></tr><tr><td>Sample batch of tasks/clients {Ti}</td><td>for each local step ifrom1to Kdo</td><td>for each local epoch i from 1 to E do</td></tr><tr><td>for Sampled task/client Ti do if FL then</td><td>0=0i-βVθL(0,Di,k)</td><td>for batch b ∈Bdo 0=0-βVθL(0,b)</td></tr><tr><td>gi,Wi= ClientUpdate(0,Ti,β)</td><td></td><td>end for</td></tr><tr><td>else if MAML then</td><td>end for</td><td>end for</td></tr><tr><td>gi=InnerLoop(0,T,β)</td><td>Returngi=0-0</td><td>Return gi=0-0</td></tr><tr><td>end if</td><td>end function</td><td>end function</td></tr><tr><td>end for</td><td>Require::Meta Batch Size M.</td><td>Require:Clients per training round M.</td></tr><tr><td>if FL then</td><td>function OuterLoop(0,{gi},α)</td><td>function ServerUpdate(0,{gi,wi},α</td></tr><tr><td>0= ServerUpdate(0,{gi,wi},α)</td><td></td><td></td></tr><tr><td>else if MAML then 0=OuterLoop(0,{gi},α)</td><td></td><td></td></tr><tr><td>end if</td><td>Return 0</td><td>Return 0</td></tr><tr><td>end while</td><td>end function</td><td>end function</td></tr></table>
|
| 44 |
+
|
| 45 |
+
In the following, we rearrange the summands comprising the update formula of FedAvg/Reptile algorithm to reveal the connection with other existing methods – a linear combination of the Federated SGD (FedSGD) (McMahan et al., 2017) and First Order MAML (FOMAML) algorithms (Finn et al., 2017) with different number of steps. For clarity, we assume identical weights $w _ { i }$ in FedAvg.
|
| 46 |
+
|
| 47 |
+
Consider $T$ participating clients and let $\theta$ be parameters of the relevant model. For each client $i$ define its local loss function as $L _ { i } ( \theta )$ , and let $\bar { \boldsymbol { g } } _ { j } ^ { i }$ be the gradient computed in $j ^ { t h }$ iteration during a local gradient-based optimization process.
|
| 48 |
+
|
| 49 |
+
FedSGD was proposed as a naive baseline against which to compare FL algorithms. For each client, it simply takes a single gradient step based on the local data, which is sent back to the server. It is a sensible baseline because it is a variant of what a traditional optimization method would do if we were to collect all the data in a central location, albeit inefficient in the FL setting. That means that FedSGD optimizes the performance of the initial model, as is the usual objective in datacenter training. The local update produced by FedSGD, $g _ { F e d S G D }$ , can be written as
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
g _ { F e d S G D } = \frac { - \beta } { T } \sum _ { i = 1 } ^ { T } \frac { \partial L _ { i } ( \theta ) } { \partial \theta } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } g _ { 1 } ^ { i } .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Next, we derive the update of FOMAML in similar terms. Assuming client learning rate $\beta$ , the personalized model of client $i$ , obtained after $K$ -step gradient update is $\theta _ { K } ^ { i } = U _ { K } ^ { i } ( \theta ) = \theta -$ $\begin{array} { r } { \beta \sum _ { j = 1 } ^ { K } g _ { j } ^ { i } = \theta - \beta \sum _ { j = 1 } ^ { K } \frac { \partial L _ { i } ( \theta _ { j } ) } { \partial \theta } } \end{array}$ 1 ∂Li(θj )∂θ . Differentiating the client update formula, we get
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\frac { \partial U _ { K } ^ { i } ( \boldsymbol { \theta } ) } { \partial \boldsymbol { \theta } } = I - \beta \frac { \partial \sum _ { j = 1 } ^ { K } g _ { j } ^ { i } } { \partial \boldsymbol { \theta } } = I - \beta \sum _ { j = 1 } ^ { K } \frac { \partial ^ { 2 } L _ { i } ( \theta _ { j } ) } { \partial \theta ^ { 2 } } .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Directly optimizing the current model for the personalized performance after locally adapting $K$ gradient steps, results in the general MAML update proposed by Finn et al. (2017).
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
g _ { M A M L } = \frac { \partial L _ { M A M L } } { \partial \theta } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \frac { \partial L _ { i } ( U _ { K } ^ { i } ( \theta ) ) } { \partial \theta } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } L _ { i } ^ { \prime } ( U _ { K } ^ { i } ( \theta ) ) ( I - \beta \sum _ { j = 1 } ^ { K } \frac { \partial ^ { 2 } L _ { i } ( \theta _ { j } ) } { \partial \theta ^ { 2 } } ) .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
MAML requires to compute 2nd-order gradients, which can be computationally expensive and creates potentially infeasible memory requirements. To avoid computing the 2nd-order term, FOMAML simply ignores it, resulting in a first-order approximation of the objective (Finn et al., 2017). $F O M A M L ( K )$ then uses the $( K + 1 ) ^ { t h }$ gradient as the local update, after $K$ gradient steps.
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
g _ { F O M A M L } ( K ) = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } L _ { i } ^ { \prime } ( U _ { K } ^ { i } ( \theta ) ) I = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } L _ { i } ^ { \prime } ( \theta _ { K } ^ { i } ) = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } g _ { K + 1 } ^ { i } .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
Now we have derived the building blocks of the FedAvg. As presented in Algorithm 1, the update of FedAvg, $g _ { F e d A v g }$ , is the average of client updates, which are the sums of local gradient updates. Rearranging the terms presents its interpretation as a linear combination of the above ideas.
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
g _ { F e d A v g } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \sum _ { j = 1 } ^ { K } g _ { j } ^ { i } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } g _ { 1 } ^ { i } + \sum _ { j = 1 } ^ { K - 1 } \frac { 1 } { T } \sum _ { i = 1 } ^ { T } g _ { j + 1 } ^ { i } = g _ { F e d S G D } + \sum _ { j = 1 } ^ { K - 1 } g _ { F O M A M L } ( j )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Note that interpolating to special case, $g _ { F e d S G D }$ can be seen as $g _ { F O M A M L } ( 0 ) -$ optimizing the performance after 0 local updates, i.e., the current model. This sheds light onto the existing Federated Averaging algorithm, as the linear combination of algorithms optimizing personalized performance after a range of local updates. Note, however, this does not mean that FedAvg optimizes for the linear combination of the objectives of the respective algorithms. Nevertheless, we show in the following section that using $K = 1$ results in a model hard to personalize, and increasing $K$ significantly improves the personalization performance, up until a certain point where the performance of initial model becomes unstable.
|
| 80 |
+
|
| 81 |
+
# 3 PERSONALIZED FEDAVG
|
| 82 |
+
|
| 83 |
+
In this section, we present Personalized FedAvg algorithm, which is the result of experimental adaptation of the core FedAvg algorithm to improve the three objectives proposed in the introduction.
|
| 84 |
+
|
| 85 |
+
We denote $F e d A v g ( E )$ the Federated Averaging method from Algorithm 1, right, run for $E$ local epochs, weighting the updates proportionally to the amount of data available locally. We denote $R e p t i l e ( K )$ the method from Algorithm 1, middle, run in the FL setting for $K$ local steps, irrespective of the amount of data available locally. Based on a variety of experiments we explored, we propose Personalized FedAvg in Algorithm 2.
|
| 86 |
+
|
| 87 |
+
# Algorithm 2 Personalized FedAvg
|
| 88 |
+
|
| 89 |
+
1: Run $F e d A v g ( E )$ with momentum SGD as server optimizer and a relatively larger $E$
|
| 90 |
+
2: Switch to $R e p t i l e ( K )$ with Adam as server optimizer to fine-tune the initial model.
|
| 91 |
+
3: Conduct personalization with the same client optimizer used during training.
|
| 92 |
+
|
| 93 |
+
In general, FedAvg training with several local epochs ensures reasonably fast convergence in terms of number of communication rounds. Due to complexity of production system, this measure was studied as the proxy for convergence speed of FL algorithms. We find that this method with momentum SGD as the server optimizer already optimizes for the personalized model – objective (1) form the introduction – while the initial model – objective (2) – is relatively unstable. Based on prior work, the recommendation to address this problem would be to decrease $E$ or the local learning rate, stabilizing initial model at the cost of slowing down convergence (McMahan et al., 2017; Wang & Joshi, 2018) – objective (3).
|
| 94 |
+
|
| 95 |
+
We propose a fine-tuning stage using $R e p t i l e ( K )$ with small $K$ and Adam as the server optimizer, to improve the initial model, while preserving and stabilizing the personalized model. We observed that Adam yields better results than other optimizers, see Table 3 in Appendix A.1, and makes the best personalized performance achievable with broader set of hyperparameters, see Figure 2. The subsequent deployment and personalization is conducted using the same client optimizer as used for training, as we observe that this choice yields the best results for FedAvg/Reptile-trained models.
|
| 96 |
+
|
| 97 |
+
Experimental setup. We use the EMNIST-62 dataset as our primary benchmark (Caldas et al., 2018b). It is the original source of the MNIST dataset, which comes with author id, and noticable variations in style, pen width, size, etc., making it a suitable source for simulated FL experiments. The dataset contains 3400 users, each with a train/test data split, with a total of 671, 585 train and 77, 483 test images. We choose the first 2, 500 users as the initial training clients, leaving the remaining 900 clients for evaluation of personalization; these clients are not touched during training. The evaluation metrics are the initial and personalized accuracy, uniformly averaged among all of the FL-personalization clients. This is preferred to a weighted average, as in a production system we care about the future performance on each device, regardless of the amount of data available for personalization. Unless specified otherwise, we use the baseline convolutional model available in TensorFlow Federated (Ingerman & Ostrowski, 2019)1, using SGD with learning rate 0.02 and batch size of 20 as the client optimizer, and SGD with momentum of 0.9 and learning rate 1.0 as the server optimizer. Each experiment was repeated 9 times with random initialization, and the mean and standard deviation of initial and personalized accuracies are reported. We also use the shakespeare dataset for next-character prediction, split in a similar manner with first 500 clients used for training and remaining 215 for evaluation of personalization.
|
| 98 |
+
|
| 99 |
+
# 3.1 CONVERGENCE OF FEDAVG
|
| 100 |
+
|
| 101 |
+
In Figure 1, left, we present the convergence of both initial and personalized model during training using the Federated Averaging algorithm. The results correspond to training with $E$ being 2 and 10, with visualization of the empirical mean and variance observed in the 9 replicas of the experiment. Detailed values about performance after 500 rounds of training, and the number of rounds to reach $8 0 \%$ accuracy, are provided in Table 1. These results provide a number of valuable insights.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 1: Training Convergence on EMNIST-62 (left) and Shakespeare (right).
|
| 105 |
+
|
| 106 |
+
First, the personalized accuracy converges significantly higher than the initial accuracy. This clearly validates the EMNIST-62 as an interesting simulated dataset to use to study Federated Learning, with significantly non-i.i.d. data available to each client.
|
| 107 |
+
|
| 108 |
+
Second, it provides empirical support to the claim made in Section 2, that Federated Averaging is already a Meta Learning algorithm. The personalized accuracy not only converges faster and higher, but the results are also of much smaller variance than those of the initial accuracy.
|
| 109 |
+
|
| 110 |
+
Third, the personalized accuracy after training with $E = 1 0$ is significantly higher than the personalized accuracy after training with $E = 2$ . This is despite the fact that the gap in the initial accuracy between these two variants is somewhat smaller. Moreover, the variance of personalized accuracy is nearly 3-times smaller for training with $E = 1 0$ , compared to $E = 2$ , despite the variance of the initial accuracy being smaller for the $E = 2$ case. This supports the insight from Equation 5, that Federated Averaging with more gradient steps locally should emphasize the personalized accuracy more, potentially at the cost of initial accuracy.
|
| 111 |
+
|
| 112 |
+
Finally, this challenges the objectives in the existing literature focusing on the setting of Federated Learning. FedAvg was presented as optimizing the performance of a shared, global model, while in fact it might achieve this only as a necessary partial step towards optimizing the personalized performance. We argue that in the presence of non-i.i.d. data available to different clients, the objective of Federated Learning should also be the personalized performance. Consequently, the recommendations that in order to stabilize the convergence, one might decrease the number of local epochs or the local learning rate (McMahan et al., 2017; Wang & Joshi, 2018), are in some scenarios misguided. In this experiment, even though the initial accuracy is very noisy and roughly constant at a suboptimal level, the personalized accuracy keeps increasing.
|
| 113 |
+
|
| 114 |
+
To evaluate the convergence speed more closely, Table 1 measures the accuracies after 500 rounds of training and the average number of communication rounds where the initial and personalized accuracy first time reaches $8 0 \%$ . While Figure 1 shows results using 5 clients per round, the table below also shows the same experiment with 20 clients per round, which in general provides even better and more stable personalized accuracy. The common pattern is that increasing $E$ initially helps, until a certain threshold. From this experiment, $E$ in the range of $5 - 1 0$ seems to be the best.
|
| 115 |
+
|
| 116 |
+
We conduct a similar experiment with the Shakespeare data. The result is in Figure 1, right, but does not provide any interesting insights, as the personalized performance shows only a small positive improvement. We conjecture that this is due to the nature of the objective – even though the data is non-i.i.d., the next-character prediction is mostly focused on a local structure of the language in general, and is similar across all users.2 We thus do not study this problem further in this paper. It is likely that for a next-word prediction task, personalization would make a more significant difference.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>EMNIST-625clients</td><td>Initial Acc</td><td>Personalized Acc</td><td>Epochs to O.8 (init/pers)</td></tr><tr><td>FedAvg E=2 FedAvg E=5</td><td>0.7473(0.0260) 0.8028 (0.0512)</td><td>0.8292 (0.0061) 0.8712 (0.0049)</td><td>310.0/63.6 111.1/33.9</td></tr><tr><td>FedAvg E=10</td><td>0.7879(0.0316)</td><td>0.8820 (0.0023)</td><td>137.5/30.0</td></tr><tr><td>FedAvg E=20</td><td>0.7430(0.0309)</td><td>0.8782 (0.0021)</td><td>152.5/32.2</td></tr><tr><td>EMNIST-62 20 clients</td><td></td><td></td><td></td></tr><tr><td>FedAvg E=2</td><td>0.8403 (0.0173)</td><td>0.8957 (0.0011)</td><td>82.5/50.0</td></tr><tr><td>FedAvg E=5</td><td>0.8471 (0.0084)</td><td>0.9057 (0.0017)</td><td>65.6/31.25</td></tr><tr><td>FedAvg E=10</td><td>0.8480 (0.0036)</td><td>0.9032 (0.0017)</td><td>68.7/25.0</td></tr><tr><td>FedAvg E=20</td><td>0.8391 1(0.0081)</td><td></td><td></td></tr><tr><td></td><td></td><td>0.8953 (0.0022)</td><td>82.1/46.4</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Table 1: EMNIST-62 performance for 5 and 20 clients per communication round.
|
| 121 |
+
|
| 122 |
+
# 3.2 BEHAVIOR OF PERSONALIZATION
|
| 123 |
+
|
| 124 |
+
In this section, we study the ability of models to personalize more closely. In particular, we look at the personalization performance as a function of the number of local epochs spent personalizing, and the effect of both local personalization optimizer and the optimizer used to train the initial model.
|
| 125 |
+
|
| 126 |
+
In Figure 2, left, we study the performance of three different models, personalized using different local optimizers. The models we test here are: one randomly chosen from the models trained with $E = 1 0$ in the previous section, with initial accuracy of $7 4 . 4 1 \%$ . The other two models are the results of fine-tuning that specific model with Reptile(1) and Reptile(10) and Adam as the server optimizer for further 200 communication rounds, again using 5 clients per round. For all three models, we show the results of personalization using Adam with default parameters and using SGD with learning rate of 0.02 and batch size of 100.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 2: Personalized accuracy as a function of local update epochs. Federated initial models (left), initial models trained by centralizing data and using default Adam optimizer (right).
|
| 130 |
+
|
| 131 |
+
In all three cases, Adam produces reasonable personalized result, but inferior to the result of SGD. We tried SGD with a range of other learning rates, and in all cases we observed this value to work the best. Note that this is the same local optimizer that was used during training and fine tuning, which is similar to the MAML works, where the same algorithm is user for meta-training and meta-testing.
|
| 132 |
+
|
| 133 |
+
The effect of fine-tuning is very encouraging. Using Reptile(10), we get a model with better initial accuracy, which also gets to a slightly improved personalized accuracy. Most importantly, it gets to roughly the same performance for a wide range of local personalization epochs. Such property is of immense value for pracical deployment, as only limited tools for model quality validation can be available on the devices where personalization happens. Using Reptile(1) significantly improves the initial accuracy, but the personalized accuracy actually drops! Even though the Equation 5 suggests that this algorithm should not take into account the personalized performance, it is not clear that such result should be intuitively expected – it does not mean it actively supresses personalization, either, and it is only fine tuning of a model already trained for the personalized performance.
|
| 134 |
+
|
| 135 |
+
We note that this can be seen as an analogous observation to those of Nichol et al. (2018), where Reptile(1) yields a model with clearly inferior personalized performance.
|
| 136 |
+
|
| 137 |
+
Motivated by this somewhat surprising result, we ask the following question: If the training data were available in a central location, and an initial model was trained using standard optimization algorithms, how would the personalization change? We train such “centralized initial model” using Adam with default settings, and evaluate the personalization performance of a model snapshot after 10 and 50 training epochs. These two models have similar initial accuracies as the two models fine tuned with Reptile(10) and Reptile(1), respectively. The results are in Figure 2, right.
|
| 138 |
+
|
| 139 |
+
The main message is that it is significantly harder to personalize these centralized initial models. Using SGD with learning rate of 0.02 is not good – a significantly smaller learning rate is needed to prevent the models from diverging, and then the personalization improvement is relatively small. In this case, using Adam does provide a better result, but still below the fine tuning performance in Figure 2, left. It is worth noting that the personalized performance of this converged model is similar to that of the model we get after fine tuning with Reptile(1), although using different personalization optimizer. At the moment, we are unable to suggest a sound explanation for this similarity.
|
| 140 |
+
|
| 141 |
+
At the start of the Section 3, we recommended using Adam as the server optimizer for fine tuning, and here we only presented such results. We did try different optimizers, and found them to yield worse results with higher variance, especially in terms of the initial accuracy. See Appendix A.1 for more details, where we see that all of the optimizers can deliver higher initial accuracy at the cost of slightly lower personalized accuracy.
|
| 142 |
+
|
| 143 |
+
To strengthen the above observations, we look at the distribution of the initial and personalized accuracies of fine tuned models over multiple experiments. In Figure 3, we look at the same three models as in Figure 2. It is clear that the initial model has a large variance in the initial accuracy, the results are in the range of $1 2 \%$ , but the personalized accuracies are only within the range of $1 \%$ . We chose one model, as indicated by the arrows3, to be fine tuned with $R e p t i l e ( 1 0 )$ and Reptile(1). In both cases, fine tuning results in a more consistent results in both the initial and personalized accuracy. Moreover, the best personalized accuracy with Reptile(1) is worse than the worst personalized accuracy with Reptile(10).
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: Distribution of initial and personalized accuracies of fine tuned models.
|
| 147 |
+
|
| 148 |
+
In Appendix A.2, we look at a similar visualization on a per-client basis for a given model. Studying this distribution is of great importance, as in practical deployment, even a small degradation in a user’s experience might incur disproportionate cost, relative to the benefit of a comparable improvement in the model quality. We do not study this question deeper in this work, though.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Initial Acc</td><td rowspan=1 colspan=1>Personalized Acc</td></tr><tr><td rowspan=1 colspan=1>Reptile(1) Finetuned test clientsReptile(1) Finetuned train clients</td><td rowspan=1 colspan=1>0.8320 (0.0133)0.8577 (0.0019)</td><td rowspan=1 colspan=1>0.8764 (0.0017)0.8927 (0.0015)</td></tr><tr><td rowspan=1 colspan=1>Reptile(1O) Finetuned test clientsReptile(1O) Finetuned train clients</td><td rowspan=1 colspan=1>0.8116 (0.0148)0.8612 (0.0020)</td><td rowspan=1 colspan=1>0.8858 (0.0014)0.9028(0.0009)</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 2: Test performance on clients seen and unseen during FL-training
|
| 153 |
+
|
| 154 |
+
Finally, we look at the performance of fine tuned models discussed above on both train and test clients. Table 2 shows that if we only looked at the initial accuracy, basic ML principles would suggest the Reptile(10) models are over-fitting, due to larger gap between the train and test clients. However, the personalized accuracy tells a different story - the gap is roughly the same for both model types, and for both train and test clients, Reptile(10) provides significantly better personalized accuracy, suggesting we need a novel way to predict the generalization of personalized models.
|
| 155 |
+
|
| 156 |
+
# 4 DISCUSSION AND FUTURE WORK
|
| 157 |
+
|
| 158 |
+
It this work, we argue that in the context of Federated Learning, the accuracy of the global model after personalization should be of much greater interest than it has been. Investigation of the topic reveals close similarities between the fields of Federated Learning and Model Agnostic Meta Learning, and raises new questions for these areas, as well as for the broader Machine Learning community.
|
| 159 |
+
|
| 160 |
+
Challenges for Federated Learning. Framing papers in the area of Federated Learning (McMahan et al., 2017; Konecnˇ y et al., 2016a; Li et al., 2019a), formulate the objective as training of a ´ shared global model, based on a decentralized data storage where each node / client has access to a non-i.i.d sample from the overall distribution. The objective is identical to one the broader ML community would optimize for, had all the data been available in a centralized location.
|
| 161 |
+
|
| 162 |
+
We argue that in this setting, the primary objective should be the adaptation to the statistical heterogeneity present at different data nodes, and demonstrate that the popular FL algorithm, Federated Averaging, does in fact optimize the personalized performance, and while doing so, also improves the performance of the global model. Experiments we perform demonstrate that the algorithm used to train the model has major influence on its capacity to personalize. Moreover, solely optimizing the accuracy of the global model tends to have negative impact on its capacity to personalize, which further questions the correctness of the commonly presented objectives of Federated Learning.
|
| 163 |
+
|
| 164 |
+
Challenges for Model Agnostic Meta Learning. The objectives in the Model Agnostic Meta Learning literature are usually only the model performance after adaptation to given task (Finn et al., 2017). In this work, we present the setting of Federated Learning as a good source of practical applications for MAML algorithms. However, to have impact in FL, these methods need to also consider the performance of the initial model,4 as in practice there will be many clients without data available for personalization. In addition, the connectivity constraints in a production deployment emphasize the importance of fast convergence in terms of number of communication rounds. We suggest these objectives become the subject of MAML works, in addition to the performance after adaptation, and to consider the datasets with a natural user/client structure being established for Federated Learning (Caldas et al., 2018b) as the source of experiments for supervised learning.
|
| 165 |
+
|
| 166 |
+
Challenges for broader Machine Learning. The empirical evaluation in this work raises a number of questions of relevance to Machine Learning research in general. In particular, Figure 2 clearly shows that models with similar initial accuracy can have very different capacity to personalize to a task of the same type as it was trained on. This observation raises obvious questions for which we currently cannot provide an answer. How does the training algorithm impact personalization ability of the trained model? Is there something we can measure that will predict the adaptability of the model? Is it something we can directly optimize for, potentially leading to novel optimization methods? These questions can relate to a gap highlighted in Table 2. While the common measures could suggest the global model is overfitting the training data, this is not true of the personalized model.
|
| 167 |
+
|
| 168 |
+
Transfer Learning is another technique for which our result could inspire a novel solution. It is very common for machine learning practitioners to take a trained model from the research community, replace the final layer with a different output class of interest, and retrain for the new task (Oquab et al., 2014). We conjecture that the algorithms proposed in the FL and MAML communities, could yield base models for which this kind of domain adaptation would yield better results.
|
| 169 |
+
|
| 170 |
+
Finally, we believe that a systematic analysis of optimization algorithms of the inner-outer structure presented in Algorithm 1 could provide novel insights into the connections between optimization and generalization. Apart from the FL and MAML algorithms, Zhang et al. (2019) recently proposed a method that can be interpreted as outer optimizer in the general algorithm, which improves the stability of a variety of existing optimization methods used as the inner optimizer.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Antreas Antoniou, Harrison Edwards, and Amos Storkey. How to train your maml. arXiv preprint arXiv:1810.09502, 2018.
|
| 175 |
+
|
| 176 |
+
Francoise Beaufays, Khe Chai Sim, and Petr Zadrazil. An investigation into on-device personalization of end-to-end automatic speech recognition models. In Interspeech, 2019.
|
| 177 |
+
|
| 178 |
+
Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for privacypreserving machine learning. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 1175–1191. ACM, 2017.
|
| 179 |
+
|
| 180 |
+
Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloe Kiddon, Jakub Kone ´ cnˇ y, Stefano Mazzocchi, H Brendan McMahan, Timon ´ Van Overveldt, David Petrou, Daniel Ramage, and Jason Roselander. Towards federated learning at scale: System design. 2019.
|
| 181 |
+
|
| 182 |
+
Sebastian Caldas, Jakub Konecnˇ y, H Brendan McMahan, and Ameet Talwalkar. Expanding ´ the reach of federated learning by reducing client resource requirements. arXiv preprint arXiv:1812.07210, 2018a.
|
| 183 |
+
|
| 184 |
+
Sebastian Caldas, Peter Wu, Tian Li, Jakub Konecnˇ y, H Brendan McMahan, Virginia Smith, and ´ Ameet Talwalkar. Leaf: A benchmark for federated settings. arXiv preprint arXiv:1812.01097, 2018b.
|
| 185 |
+
|
| 186 |
+
Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Mark Mao, Marc’aurelio Ranzato, Andrew Senior, Paul Tucker, Ke Yang, et al. Large scale distributed deep networks. In Advances in neural information processing systems, pp. 1223–1231, 2012.
|
| 187 |
+
|
| 188 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 1126–1135. JMLR. org, 2017.
|
| 189 |
+
|
| 190 |
+
Andrew Hard, Kanishka Rao, Rajiv Mathews, Franc¸oise Beaufays, Sean Augenstein, Hubert Eichner, Chloe Kiddon, and Daniel Ramage. Federated learning for mobile keyboard prediction. ´ arXiv preprint arXiv:1811.03604, 2018.
|
| 191 |
+
|
| 192 |
+
Alex Ingerman and Krzys Ostrowski. Introducing tensorflow federated, 2019. URL https://medium.com/tensorflow/ introducing-tensorflow-federated-a4147aa20041.
|
| 193 |
+
|
| 194 |
+
Mikhail Khodak, Maria Florina-Balcan, and Ameet Talwalkar. Adaptive gradient-based metalearning methods. arXiv preprint arXiv:1906.02717, 2019.
|
| 195 |
+
|
| 196 |
+
Jakub Konecnˇ y, H Brendan McMahan, Daniel Ramage, and Peter Richt ´ arik. Federated optimization: ´ Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016a.
|
| 197 |
+
|
| 198 |
+
Jakub Konecnˇ y, H Brendan McMahan, Felix X Yu, Peter Richt´ arik, Ananda Theertha Suresh, and´ Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016b.
|
| 199 |
+
|
| 200 |
+
Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 201 |
+
|
| 202 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
|
| 203 |
+
|
| 204 |
+
Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. arXiv preprint arXiv:1908.07873, 2019a.
|
| 205 |
+
|
| 206 |
+
Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the convergence of fedavg on non-iid data. arXiv preprint arXiv:1907.02189, 2019b.
|
| 207 |
+
|
| 208 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273–1282, 2017.
|
| 209 |
+
H Brendan McMahan and Daniel Ramage. Federated learning: Collaborative machine learning without centralized training data, 2017. https://ai.googleblog.com/2017/04/ federated-learning-collaborative.html.
|
| 210 |
+
H Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BJ0hF1Z0b.
|
| 211 |
+
Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
|
| 212 |
+
Maxime Oquab, Leon Bottou, Ivan Laptev, and Josef Sivic. Learning and transferring mid-level image representations using convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1717–1724, 2014.
|
| 213 |
+
Jianyu Wang and Gauri Joshi. Adaptive communication strategies to achieve the best error-runtime trade-off in local-update sgd. arXiv preprint arXiv:1810.08313, 2018.
|
| 214 |
+
Qiang Yang, Yang Liu, Tianjian Chen, and Yongxin Tong. Federated machine learning: Concept and applications. ACM Transactions on Intelligent Systems and Technology (TIST), 10(2):12, 2019.
|
| 215 |
+
Michael R Zhang, James Lucas, Geoffrey Hinton, and Jimmy Ba. Lookahead optimizer: k steps forward, 1 step back. arXiv preprint arXiv:1907.08610, 2019.
|
| 216 |
+
|
| 217 |
+
# A APPENDIX
|
| 218 |
+
|
| 219 |
+
This Appendix contains further details referenced from the main body of the paper.
|
| 220 |
+
|
| 221 |
+
# A.1 FINE TUNING OPTIMIZERS
|
| 222 |
+
|
| 223 |
+
Table 3 summarizes the attempts at fine tuning the model user in main body with different server optimizers. We see that comparing the same client optimizers, Adam consistently provides better and more stable results in terms of initial accuracy.
|
| 224 |
+
|
| 225 |
+
Table 3: Fine-tuning Result of EMNIST-62 with different server optimizers.
|
| 226 |
+
|
| 227 |
+
<table><tr><td rowspan=1 colspan=1>EMNIST-62 Model</td><td rowspan=1 colspan=1>Initial Acc</td><td rowspan=1 colspan=1>Pers Acc</td></tr><tr><td rowspan=1 colspan=1>FedAvg E=10 w/o finetuning Momentum(lr=1.0, 0.9)</td><td rowspan=1 colspan=1>0.7441</td><td rowspan=1 colspan=1>0.8842</td></tr><tr><td rowspan=1 colspan=1>Finetune with FedSGD (Reptile(1)) AdamFinetune with Reptile(5) AdamFinetune with Reptile(10) Adam</td><td rowspan=1 colspan=1>0.8320 (0.0133)0.8265 (0.0160)0.8116 (0.0148)</td><td rowspan=1 colspan=1>0.8764 (0.0017)0.8807 (0.0020)0.8858 (0.0014)</td></tr><tr><td rowspan=1 colspan=1>Finetune with Reptile(1) SGD(lr=0.1)Finetune with Reptile(1) Momentum(lr=0.01, 0.9)</td><td rowspan=1 colspan=1>0.8260 (0.0161)0.8279 (0.0119)</td><td rowspan=1 colspan=1>0.8758 (0.0020)0.8745 (0.0014)</td></tr><tr><td rowspan=1 colspan=1>Finetune with Reptile(5) SGD(lr=0.1)Finetune with Reptile(5) Momentum(lr=0.01, 0.9)</td><td rowspan=1 colspan=1>0.8148 (0.0280)0.8005 (0.0329)</td><td rowspan=1 colspan=1>0.8829 (0.0012)0.8828 (0.0015)</td></tr><tr><td rowspan=1 colspan=1>Finetune with Reptile(10) SGD(lr=0.1)Finetune with Reptile(10) Momentum(lr=0.01, 0.9)</td><td rowspan=1 colspan=1>0.8074 (0.0294)0.8140 (0.0246)</td><td rowspan=1 colspan=1>0.8855 (0.0012)0.8860 (0.0009)</td></tr></table>
|
| 228 |
+
|
| 229 |
+
# A.2 PER-CLIENT PERSONALIZATION RESULTS
|
| 230 |
+
|
| 231 |
+
Figure 4 visualizes the distribution of initial and personalized accuracies on a per-client basis. Each dot represents a random sample of the test clients used for personalization experiments. Studying this distribution is of great importance, as in practical deployment, degrading a user’s experience might incur disproportionate cost, compared to the benefit of comparable improvement. Designing methods that robustly identify the clients below the diagonal line and at least revert to the initial model is worth of future investigation.
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Figure 4: Performance for sample of test clients for EMNIST-62 (left) and Shakespeare (right)
|
md/train/D7bPRxNt_AP/D7bPRxNt_AP.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NeuS: Learning Neural Implicit Surfaces by Volume Rendering for Multi-view Reconstruction
|
| 2 |
+
|
| 3 |
+
Peng Wang†, Lingjie $\mathbf { L i u } ^ { \ddagger * }$ , Yuan $\mathbf { L i u } ^ { \dagger }$ , Christian Theobalt‡, Taku Komura†, Wenping Wang∗
|
| 4 |
+
|
| 5 |
+
†The University of Hong Kong ‡Max Planck Institute for Informatics Texas A&M University †{pwang3,yliu,taku}@cs.hku.hk ‡{lliu,theobalt}@mpi-inf.mpg.de wenping@tamu.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We present a novel neural surface reconstruction method, called NeuS, for reconstructing objects and scenes with high fidelity from 2D image inputs. Existing neural surface reconstruction approaches, such as DVR [Niemeyer et al., 2020] and IDR [Yariv et al., 2020], require foreground mask as supervision, easily get trapped in local minima, and therefore struggle with the reconstruction of objects with severe self-occlusion or thin structures. Meanwhile, recent neural methods for novel view synthesis, such as NeRF [Mildenhall et al., 2020] and its variants, use volume rendering to produce a neural scene representation with robustness of optimization, even for highly complex objects. However, extracting high-quality surfaces from this learned implicit representation is difficult because there are not sufficient surface constraints in the representation. In NeuS, we propose to represent a surface as the zero-level set of a signed distance function (SDF) and develop a new volume rendering method to train a neural SDF representation. We observe that the conventional volume rendering method causes inherent geometric errors (i.e. bias) for surface reconstruction, and therefore propose a new formulation that is free of bias in the first order of approximation, thus leading to more accurate surface reconstruction even without the mask supervision. Experiments on the DTU dataset and the BlendedMVS dataset show that NeuS outperforms the state-of-the-arts in high-quality surface reconstruction, especially for objects and scenes with complex structures and self-occlusion.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Reconstructing surfaces from multi-view images is a fundamental problem in computer vision and computer graphics. 3D reconstruction with neural implicit representations has recently become a highly promising alternative to classical reconstruction approaches [35, 8, 2] due to its high reconstruction quality and its potential to reconstruct complex objects that are difficult for classical approaches, such as non-Lambertian surfaces and thin structures. Recent works represent surfaces as signed distance functions (SDF) [46, 49, 17, 22] or occupancy [29, 30]. To train their neural models, these methods use a differentiable surface rendering method to render a 3D object into images and compare them against input images for supervision. For example, IDR [46] produces impressive reconstruction results, but it fails to reconstruct objects with complex structures that causes abrupt depth changes. The cause of this limitation is that the surface rendering method used in IDR only considers a single surface intersection point for each ray. Consequently, the gradient only exists at this single point, which is too local for effective back propagation and would get optimization stuck in a poor local minimum when there are abrupt changes of depth on images. Furthermore, object masks are needed as supervision for converging to a valid surface. As illustrated in Fig. 1 (a) top, with the radical depth change caused by the hole, the neural network would incorrectly predict the points near the front surface to be blue, failing to find the far-back blue surface. The actual test example in Fig. 1 (b) shows that IDR fails to correctly reconstruct the surfaces near the edges with abrupt depth changes.
|
| 14 |
+
|
| 15 |
+
Recently, NeRF [28] and its variants have explored to use a volume rendering method to learn a volumetric radiance field for novel view synthesis. This volume rendering approach samples multiple points along each ray and perform $\alpha$ -composition of the colors of the sampled points to produce the output pixel colors for training purposes. The advantage of the volume rendering approach is that it can handle abrupt depth changes, because it considers multiple points along the ray and so all the sample points, either near the surface or on the far surface, produce gradient signals for back propagation. For example, referring Fig. 1 (a) bottom, when the near surface (yellow) is found to have inconsistent colors with the input image, the volume rendering approach is capable of training the network to find the far-back surface to produce the correct scene representation. However, since it is intended for novel view synthesis rather than surface reconstruction, NeRF only learns a volume density field, from which it is difficult to extract a high-quality surface. Fig. 1 (b) shows a surface extracted as a level-set surface of the density field learned by NeRF. Although the surface correctly accounts for abrupt depth changes, it contains conspicuous noise in some planar regions.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (a) Illustration of the surface rendering and volume rendering. (b) A toy example of bamboo planter, where there are occlusions on the top of the planter. Compared to the state-of-the-art methods, our approach can handle the occlusions and achieve better reconstruction quality.
|
| 19 |
+
|
| 20 |
+
In this work, we present a new neural rendering scheme, called NeuS, for multi-view surface reconstruction. NeuS uses the signed distance function (SDF) for surface representation and uses a novel volume rendering scheme to learn a neural SDF representation. Specifically, by introducing a density distribution induced by SDF, we make it possible to apply the volume rendering approach to learning an implicit SDF representation and thus have the best of both worlds, i.e. an accurate surface representation using a neural SDF model and robust network training in the presence of abrupt depth changes as enabled by volume rendering. Note that simply applying a standard volume rendering method to the density associated with SDF would lead to discernible bias (i.e. inherent geometric errors) in the reconstructed surfaces. This is a new and important observation that we will elaborate later. Therefore we propose a novel volume rendering scheme to ensure unbiased surface reconstruction in the first-order approximation of SDF. Experiments on both DTU dataset and BlendedMVS dataset demonstrated that NeuS is capable of reconstructing complex 3D objects and scenes with severe occlusions and delicate structures, even without foreground masks as supervision. It outperforms the state-of-the-art neural scene representation methods, namely IDR [46] and NeRF [28], in terms of reconstruction quality.
|
| 21 |
+
|
| 22 |
+
# 2 Related Works
|
| 23 |
+
|
| 24 |
+
Classical Multi-view Surface and Volumetric Reconstruction. Traditional multi-view 3D reconstruction methods can be roughly classified into two categories: point- and surface-based reconstruction [2, 8, 9, 35] and volumetric reconstruction [6, 3, 36]. Point- and surface-based reconstruction methods estimate the depth map of each pixel by exploiting inter-image photometric consistency [8] and then fuse the depth maps into a global dense point cloud [25, 48]. The surface reconstruction is usually done as a post processing with methods like screened Poisson surface reconstruction [16]. The reconstruction quality heavily relies on the quality of correspondence matching, and the difficulties in matching correspondence for objects without rich textures often lead to severe artifacts and missing parts in the reconstruction results. Alternatively, volumetric reconstruction methods circumvent the difficulty of explicit correspondence matching by estimating occupancy and color in a voxel grid from multi-view images and evaluating the color consistency of each voxel. Due to limited achievable voxel resolution, these methods cannot achieve high accuracy.
|
| 25 |
+
|
| 26 |
+
Neural Implicit Representation. Some methods enforce 3D understanding in a deep learning framework by introducing inductive biases. These inductive biases can be explicit representations, such as voxel grids [13, 5, 44], point cloud [7, 24, 18], meshes [41, 43, 14], and implicit representations. The implicit representations encoded by a neural network has gained a lot of attention recently, since it is continuous and can achieve high spatial resolution. This representation has been applied successfully to shape representation [26, 27, 31, 4, 1, 10, 47, 32], novel view synthesis [38, 23, 15, 28, 21, 33, 34, 40, 37] and multi-view 3D reconstruction [46, 29, 17, 12, 22].
|
| 27 |
+
|
| 28 |
+
Our work mainly focuses on learning implicit neural representation encoding both geometry and appearance in 3D space from 2D images via classical rendering techniques. Limited in this scope, the related works can be roughly categorized based on the rendering techniques used, i.e. surface rendering based methods and volume rendering based methods. Surface rendering based methods [29, 17, 46, 22] assume that the color of ray only relies on the color of an intersection of the ray with the scene geometry, which makes the gradient only backpropagated to a local region near the intersection. Therefore, such methods struggle with reconstructing complex objects with severe self-occlusions and sudden depth changes. Furthermore, they usually require object masks as supervision. On the contrary, our method performs well for such challenging cases without the need of masks.
|
| 29 |
+
|
| 30 |
+
Volume rendering based methods, such as NeRF[28], render an image by $\alpha$ -compositing colors of the sampled points along each ray. As explained in the introduction, it can handle sudden depth changes and synthesize high-quality images. However, extracting high-fidelity surface from the learned implicit field is difficult because the density-based scene representation lacks sufficient constraints on its level sets. In contrast, our method combines the advantages of surface rendering based and volume rendering based methods by constraining the scene space as a signed distance function but applying volume rendering to train this representation with robustness. UNISURF [30], a concurrent work, also learns an implicit surface via volume rendering. It improves the reconstruction quality by shrinking the sample region of volume rendering during the optimization. Our method differs from UNISURF in that UNISURF represents the surface by occupancy values, while our method represents the scene by an SDF and thus can naturally extract the surface as the zero-level set of it, yielding better reconstruction accuracy than UNISURF, as will be seen later in the experiment section.
|
| 31 |
+
|
| 32 |
+
# 3 Method
|
| 33 |
+
|
| 34 |
+
Given a set of posed images $\{ \mathcal { T } _ { k } \}$ of a 3D object, our goal is to reconstruct the surface $s$ of it. The surface is represented by the zero-level set of a neural implicit SDF. In order to learn the weights of the neural network, we developed a novel volume rendering method to render images from the implicit SDF and minimize the difference between the rendered images and the input images. This volume rendering approach ensures robust optimization in NeuS for reconstructing objects of complex structures.
|
| 35 |
+
|
| 36 |
+
# 3.1 Rendering Procedure
|
| 37 |
+
|
| 38 |
+
Scene representation. With NeuS, the scene of an object to be reconstructed is represented by two functions: $f : \mathbb { R } ^ { 3 } \mathbb { R }$ that maps a spatial position $\mathbf { x } \in \mathbb { R } ^ { 3 }$ to its signed distance to the object, and $c : \mathbb { R } ^ { 3 } \times \mathbb { S } ^ { \breve { 2 } } \to \mathbb { R } ^ { 3 }$ that encodes the color associated with a point $\bar { \mathbf { x } } \in \mathbb { R } ^ { 3 }$ and a viewing direction $\mathbf { v } \in \mathbb { S } ^ { 2 }$ . Both functions are encoded by Multi-layer Perceptrons (MLP). The surface $s$ of the object is represented by the zero-level set of its SDF, that is,
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { r } { S = \left\{ { \bf x } \in \mathbb { R } ^ { 3 } | f ( { \bf x } ) = 0 \right\} . } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
In order to apply a volume rendering method to training the SDF network, we first introduce a probability density function $\phi _ { s } ( f ( \mathbf { x } ) )$ , called $s$ -density, where $f ( \mathbf { x } )$ , $\mathbf { x } \in \mathbb { R } ^ { 3 }$ , is the signed distance function and $\phi _ { s } ( x ) = s e ^ { - s x } / ( 1 + e ^ { - s x } ) ^ { 2 }$ , commonly known as the logistic density distribution, is the derivative of the Sigmoid function $\dot { \Phi } _ { s } ( x ) = ( 1 \dot { + } e ^ { - s x } ) ^ { - 1 }$ , i.e., $\bar { \phi _ { s } } ( x ) = \Phi _ { s } ^ { \prime } ( x )$ . In principle $\phi _ { s } ( x )$ can be any unimodal (i.e. bell-shaped) density distribution centered at 0; here we choose the logistic density distribution for its computational convenience. Note that the standard deviation of $\phi _ { s } ( x )$ is given by $1 / s$ , which is also a trainable parameter, that is, $1 / s$ approaches to zero as the network training converges.
|
| 45 |
+
|
| 46 |
+
Intuitively, the main idea of NeuS is that, with the aid of the S-density field $\phi _ { s } ( f ( \mathbf { x } ) )$ , volume rendering is used to train the SDF network with only 2D input images as supervision. Upon successful minimization of a loss function based on this supervision, the zero-level set of the network-encoded SDF is expected to represent an accurately reconstructed surface $s$ , with its induced S-density $\phi _ { s } ( f ( \mathbf { x } ) )$ assuming prominently high values near the surface.
|
| 47 |
+
|
| 48 |
+
Rendering. To learn the parameters of the neural SDF and color field, we advise a volume rendering scheme to render images from the proposed SDF representation. Given a pixel, we denote the ray emitted from this pixel as $\{ \mathbf { p } ( t ) = \mathbf { \bar { o } } + t \mathbf { v } | t \geq 0 \}$ , where $\mathbf { o }$ is the center of the camera and $\mathbf { v }$ is the unit direction vector of the ray. We accumulate the colors along the ray by
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
C ( \mathbf { o } , \mathbf { v } ) = \int _ { 0 } ^ { + \infty } w ( t ) c ( \mathbf { p } ( t ) , \mathbf { v } ) \mathrm { d } t ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $C ( \mathbf { o } , \mathbf { v } )$ is the output color for this pixel, $w ( t )$ a weight for the point $\mathbf { p } ( t )$ , and $c ( \mathbf { p } ( t ) , \mathbf { v } )$ the color at the point $\mathbf { p }$ along the viewing direction $\mathbf { v }$ .
|
| 55 |
+
|
| 56 |
+
Requirements on weight function. The key to learn an accurate SDF representation from 2D images is to build an appropriate connection between output colors and SDF, i.e., to derive an appropriate weight function $w ( t )$ on the ray based on the SDF $f$ of the scene. In the following, we list the requirements on the weight function $w ( t )$ .
|
| 57 |
+
|
| 58 |
+
1. Unbiased. Given a camera ray $\mathbf { p } ( t ) , w ( t )$ attains a locally maximal value at a surface intersection point $\mathbf { p } ( t ^ { * } )$ , i.e. with $f ( \mathbf { p } ( t ^ { * } ) ) = 0$ , that is, the point $\mathbf { p } ( t ^ { * } )$ is on the zero-level set of the SDF $\mathbf { \rho } ( \mathbf { x } )$ . 2. Occlusion-aware. Given any two depth values $t _ { 0 }$ and $t _ { 1 }$ satisfying $f ( t _ { 0 } ) = f ( t _ { 1 } )$ , $w ( t _ { 0 } ) >$ 0, $w ( t _ { 1 } ) > 0$ , and $t _ { 0 } < t _ { 1 }$ , there is $w ( t _ { 0 } ) > w ( t _ { 1 } )$ . That is, when two points have the same SDF value (thus the same SDF-induced S-density value), the point nearer to the view point should have a larger contribution to the final output color than does the other point.
|
| 59 |
+
|
| 60 |
+
An unbiased weight function $w ( t )$ guarantees that the intersection of the camera ray with the zero-level set of SDF contributes most to the pixel color. The occlusion-aware property ensures that when a ray sequentially passes multiple surfaces, the rendering procedure will correctly use the color of the surface nearest to the camera to compute the output color.
|
| 61 |
+
|
| 62 |
+
Next, we will first introduce a naive way of defining the weight function $w ( t )$ that directly using the standard pipeline of volume rendering, and explain why it is not appropriate for reconstruction before introducing our novel construction of $w ( t )$ .
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Illustration of (a) weight bias of naive solution, and (b) the weight function defined in our solution, which is unbiased in the first-order approximation of SDF.
|
| 66 |
+
|
| 67 |
+
Naive solution. To make the weight
|
| 68 |
+
|
| 69 |
+
function occlusion-aware, a natural solution is based on the standard volume rendering formulation [28] which defines the weight function by
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
w ( t ) = T ( t ) \sigma ( t ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\sigma ( t )$ is the so-called volume density in classical volume rendering and $\begin{array} { r l } { T ( t ) } & { { } = } \end{array}$ $\begin{array} { r } { \exp ( - \int _ { 0 } ^ { t } \sigma ( u ) \mathrm { d } u ) } \end{array}$ here denotes the accumulated transmittance along the ray. To adopt the standard volume density formulation [28], here $\sigma ( t )$ is set to be equal to the S-density value, i.e. $\sigma ( t ) = \phi _ { s } ( f ( \mathbf { p } ( t ) ) )$ and the weight function $w ( t )$ is computed by Eqn. 3. Although the resulting weight function is occlusion-aware, it is biased as it introduces inherent errors in the reconstructed surfaces. As illustrated in Fig. 2 (a), the weight function $w ( t )$ attains a local maximum at a point before the ray reaches the surface point $\mathbf { p } ( t ^ { * } )$ , satisfying $f ( \dot { \mathbf { p } } ( t ^ { * } ) ) = 0$ . This fact will be proved in the supplementary material.
|
| 76 |
+
|
| 77 |
+
Our solution. To introduce our solution, we first introduce a straightforward way to construct an unbiased weight function, which directly uses the normalized S-density as weights
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
w ( t ) = \frac { \phi _ { s } ( f ( \mathbf { p } ( t ) ) ) } { \int _ { 0 } ^ { + \infty } \phi _ { s } ( f ( \mathbf { p } ( u ) ) ) \mathrm { d } u } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
This construction of weight function is unbiased, but not occlusion-aware. For example, if the ray penetrates two surfaces, the SDF function $f$ will have two zero points on the ray, which leads to two peaks on the weight function $w ( t )$ and the resulting weight function will equally blend the colors of two surfaces without considering occlusions.
|
| 84 |
+
|
| 85 |
+
To this end, now we shall design the weight function $w ( t )$ that is both occlusion-aware and unbiased in the first-order approximation of SDF, based on the aforementioned straightforward construction. To ensure an occlusion-aware property of the weight function $w ( t )$ , we will still follow the basic framework of volume rendering as Eqn. 3. However, different from the conventional treatment as in naive solution above, we define our function $w ( t )$ from the S-density in a new manner. We first define an opaque density function $\rho ( t )$ , which is the counterpart of the volume density $\sigma$ in standard volume rendering. Then we compute the new weight function $w ( t )$ by
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
w ( t ) = T ( t ) \rho ( t ) , \mathrm { w h e r e } T ( t ) = \exp \left( - \int _ { 0 } ^ { t } \rho ( u ) \mathrm { d } u \right) .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
How we derive opaque density $\rho$ . We will first consider a simple case where there is only one surface intersection, and the surface is simply a plane. Since Eqn. 4 indeed satisfies the above requirements under this assumption, we derive the underlying opaque density $\rho$ corresponding to the weight definition of Eqn. 4 using the framework of volume rendering. Then we will generalize this opaque density to the general case of multiple surface intersections.
|
| 92 |
+
|
| 93 |
+
Specifically, in the simple case of a single plane intersection, it is easy to see that the signed distance function $\dot { f ( \mathbf { p } ( t ) ) }$ is $- | \mathrm { { { c o s } } } ( \theta ) | \cdot ( t - t ^ { * } )$ , where $f ( \mathbf { p } ( t ^ { * } ) ) = 0$ , and $\theta$ is the angle between the view direction $\mathbf { v }$ and the outward surface normal vector $\mathbf { n }$ . Because the surface is assumed locally, $| \cos ( \theta ) |$ is a constant. It follows from Eqn. 4 that
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { w ( t ) = \frac { \phi _ { s } \left( f \left( \mathbf { p } ( t ) \right) \right) } { \int _ { - \infty } ^ { + \infty } \phi _ { s } \left( f \left( \mathbf { p } ( u ) \right) \right) \mathrm { d } u } } \\ & { \quad = \frac { \phi _ { s } \left( f \left( \mathbf { p } ( t ) \right) \right) } { \int _ { - \infty } ^ { + \infty } \phi _ { s } \left( - | \cos ( \theta ) | \cdot \left( u - t ^ { * } \right) \right) \mathrm { d } u } } \\ & { \quad = \frac { \phi _ { s } \left( f \left( \mathbf { p } ( t ) \right) \right) } { | \cos ( \theta ) | ^ { - 1 } \cdot \int _ { - \infty } ^ { + \infty } \phi _ { s } \left( u - t ^ { * } \right) \mathrm { d } u } } \\ & { \quad = | \cos ( \theta ) | \phi _ { s } \left( f ( \mathbf { p } ( t ) ) \right) . } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Recall that the weight function within the framework of volume rendering is given by $w ( t ) =$ $T ( t ) \rho ( t )$ , where $\begin{array} { r } { T ( t ) = \exp ( - \int _ { 0 } ^ { t } \rho ( u ) \mathrm { d } u ) } \end{array}$ denotes the accumulated transmittance. Therefore, to derive $\rho ( t )$ , we have
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
T ( t ) \rho ( t ) = | \cos ( \theta ) | \phi _ { s } ( f ( \mathbf { p } ( t ) ) ) .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Since $\begin{array} { r } { T ( t ) = \exp ( - \int _ { 0 } ^ { t } \rho ( u ) \mathrm { d } u ) } \end{array}$ , it is easy to verify that $\begin{array} { r } { T ( t ) \rho ( t ) = - \frac { \mathrm { d } T } { \mathrm { d } t } ( t ) } \end{array}$ . Further, note that $\begin{array} { r } { | \cos ( \theta ) | \phi _ { s } ( f ( \mathbf { p } ( t ) ) ) = - \frac { \mathrm { d } \Phi _ { s } } { \mathrm { d } t } ( f ( \mathbf { p } ( t ) ) ) } \end{array}$ . It follows that $\begin{array} { r } { \frac { \mathrm { d } T } { \mathrm { d } t } ( t ) = \frac { \mathrm { d } \Phi _ { s } } { \mathrm { d } t } ( f ( \mathbf { p } ( t ) ) ) } \end{array}$ . Integrating both sides of this equation yields
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
T ( t ) = \Phi _ { s } ( f ( \mathbf { p } ( t ) ) ) .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Taking the logarithm and then differentiating both sides, we have
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r l r } { { \int _ { - \infty } ^ { t } \rho ( u ) \mathrm { d } u = - \ln ( \Phi _ { s } ( f ( \mathbf { p } ( t ) ) ) ) } } \\ & { } & { \Rightarrow \rho ( t ) = \frac { - \frac { \mathrm { d } \Phi _ { s } } { \mathrm { d } t } ( f ( \mathbf { p } ( t ) ) ) } { \Phi _ { s } ( f ( \mathbf { p } ( t ) ) ) } . } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
This is the formula of the opaque density $\rho ( t )$ in case of single plane intersection. The weight function $w ( t )$ induced by $\rho ( t )$ is shown in Figure 2(b). Now we generalize the opaque density to the general case where there are multiple surface intersections along the ray $\mathbf { p } ( t )$ . In this case, $\begin{array} { r l } { - \frac { \mathrm { d } \Phi _ { s } } { \mathrm { d } t _ { * } } ( f ( \mathbf { p } ( t ) ) ) } & { { } } \end{array}$ becomes negative on the segment of the ray with increasing SDF values. Thus we clip it against zero to ensure that the value of $\rho$ is always non-negative. This gives the following opaque density function $\bar { \rho } ( t )$ in general cases.
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\rho ( t ) = \mathrm { m a x } \left( \frac { - \frac { \mathrm { d } \Phi _ { s } } { \mathrm { d } t } ( f ( \mathbf { p } ( t ) ) ) } { \Phi _ { s } ( f ( \mathbf { p } ( t ) ) ) } , 0 \right) .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 3: Illustration of weight distribution in case of multiple surface intersection.
|
| 125 |
+
|
| 126 |
+
Based on this equation, the weight function $w ( t )$ can be computed with standard volume rendering as in Eqn. 5. The illustration in the case of multiple surface intersection is shown in Figure 3.
|
| 127 |
+
|
| 128 |
+
The following theorem states that in general cases (i.e.,
|
| 129 |
+
including both single surface intersection and multiple surface intersections) the weight function defined by Eqn. 10 and Eqn. 5 is unbiased in the first-order approximation of SDF. The proof is given in the supplementary material.
|
| 130 |
+
|
| 131 |
+
Theorem 1 Suppose that a smooth surface $\mathbb { S }$ is defined by the zero-level set of the signed distance function $f ( \mathbf { x } ) = 0$ , and a ray $\mathbf { p } ( t ) = \mathbf { o } + t \mathbf { v }$ enters the surface $\mathbb { S }$ from outside to inside, with the intersection point at $\mathbf { p } ( t ^ { * } )$ , that is, $f ( \mathbf { p } ( t ^ { * } ) ) = 0$ and there exists an interval $[ t _ { l } , t _ { r } ]$ such that $t ^ { * } \in [ t _ { l } , t _ { r } ]$ and $f ( \mathbf { p } ( t ) )$ is monotonically decreasing in $[ t _ { l } , t _ { r } ]$ . Suppose that in this local interval $[ t _ { l } , t _ { r } ]$ , the surface can be tangentially approximated by a sufficiently small planar patch, i.e., ∇f is regarded as fixed. Then, the weight function $w ( t )$ computed by Eqn. 10 and Eqn. 5 in $[ t _ { l } , t _ { r } ]$ attains its maximum at $t ^ { * }$ .
|
| 132 |
+
|
| 133 |
+
Discretization. To obtain discrete counterparts of the opacity and weight function, we adopt the same approximation scheme as used in NeRF [28], This scheme samples $n$ points $\{ { \bf p } _ { i } = { \bf o } + t _ { i } { \bf v } | i =$ $1 , . . . , n , t _ { i } < t _ { i + 1 } \}$ along the ray to compute the approximate pixel color of the ray as
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\hat { C } = \sum _ { i = 1 } ^ { n } T _ { i } \alpha _ { i } c _ { i } ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $T _ { i }$ is the discrete accumulated transmittance defined by $\begin{array} { r } { T _ { i } = \prod _ { j = 1 } ^ { i - 1 } ( 1 - \alpha _ { j } ) } \end{array}$ , and $\alpha _ { i }$ is discrete opacity values defined by
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\alpha _ { i } = 1 - \exp \left( - \int _ { t _ { i } } ^ { t _ { i + 1 } } \rho ( t ) \mathrm { d } t \right) ,
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
which can further be shown to be
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\alpha _ { i } = \operatorname* { m a x } \left( \frac { \Phi _ { s } ( f ( \mathbf { p } ( t _ { i } ) ) ) - \Phi _ { s } ( f ( \mathbf { p } ( t _ { i + 1 } ) ) ) } { \Phi _ { s } ( f ( \mathbf { p } ( t _ { i } ) ) ) } , 0 \right) .
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
The detailed derivation of this formula for $\alpha _ { i }$ is given in the supplementary material.
|
| 152 |
+
|
| 153 |
+
# 3.2 Training
|
| 154 |
+
|
| 155 |
+
To train NeuS, we minimize the difference between the rendered colors and the ground truth colors, without any 3D supervision. Besides colors, we can also utilize the masks for supervision if provided.
|
| 156 |
+
|
| 157 |
+
Specifically, we optimize our neural networks and inverse standard deviation $s$ by randomly sampling a batch of pixels and their corresponding rays in world space $P = \{ C _ { k } , M _ { k } , \mathbf { o } _ { k } , \mathbf { \bar { v } } _ { k } \}$ , where $C _ { k }$ is its pixel color and $M _ { k } \in \{ 0 , 1 \}$ is its optional mask value, from an image in every iteration. We assume the point sampling size is $n$ and the batch size is $m$ . The loss function is defined as
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\mathcal { L } = \mathcal { L } _ { c o l o r } + \lambda \mathcal { L } _ { r e g } + \beta \mathcal { L } _ { m a s k } .
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
The color loss $\mathcal { L } _ { c o l o r }$ is defined as
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\mathcal { L } _ { c o l o r } = \frac { 1 } { m } \sum _ { k } \mathcal { R } ( \hat { C } _ { k } , C _ { k } ) .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Same as IDR[46], we empirically choose $\mathcal { R }$ as L1 loss, which in our observation is robust to outliers and stable in training.
|
| 170 |
+
|
| 171 |
+
We add an Eikonal term [10] on the sampled points to regularize the SDF of $f _ { \theta }$ by
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\mathcal { L } _ { r e g } = \frac { 1 } { n m } \sum _ { k , i } ( \| \nabla f ( \hat { \mathbf { p } } _ { k , i } ) \| _ { 2 } - 1 ) ^ { 2 } .
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
The optional mask loss $\mathcal { L } _ { m a s k }$ is defined as
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\mathcal { L } _ { m a s k } = \mathbf { B C E } ( M _ { k } , \hat { O } _ { k } ) ,
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
where $\begin{array} { r } { \hat { O } _ { k } = \sum _ { i = 1 } ^ { n } T _ { k , i } \alpha _ { k , i } } \end{array}$ is the sum of weights along the camera ray, and BCE is the binary cross entropy loss.
|
| 184 |
+
|
| 185 |
+
Hierarchical sampling. In this work, we follow a similar hierarchical sampling strategy as in NeRF [28]. We first uniformly sample the points on the ray and then iteratively conduct importance sampling on top of the coarse probability estimation. The difference is that, unlike NeRF which simultaneously optimizes a coarse network and a fine network, we only maintain one network, where the probability in coarse sampling is computed based on the S-density $\phi _ { s } ( f ( \mathbf { x } ) )$ with fixed standard deviations while the probability of fine sampling is computed based on $\phi _ { s } ( f ( \mathbf { x } ) )$ with the learned $s$ Details of hierarchical sampling strategy are provided in supplementary materials.
|
| 186 |
+
|
| 187 |
+
# 4 Experiments
|
| 188 |
+
|
| 189 |
+
# 4.1 Experimental settings
|
| 190 |
+
|
| 191 |
+
Datasets. To evaluate our approach and baseline methods, we use 15 scenes from the DTU dataset [11], same as those used in IDR [46], with a wide variety of materials, appearance and geometry, including challenging cases for reconstruction algorithms, such as non-Lambertian surfaces and thin structures. Each scene contains 49 or 64 images with the image resolution of $1 6 0 0 \times 1 2 0 0$ Each scene was tested with and without foreground masks provided by IDR [46]. We further tested on 7 challenging scenes from the low-res set of the BlendedMVS dataset [45](CC-4 License). Each scene has $3 1 - 1 4 3$ images at $7 6 8 \times 5 7 6$ pixels and masks are provided by the BlendedMVS dataset. We further captured two thin objects with 32 input images to test our approach on thin structure reconstruction.
|
| 192 |
+
|
| 193 |
+
Baselines. (1) The state-of-the-art surface rendering approach – IDR [46]: IDR can reconstruct surface with high quality but requires foreground masks as supervision; Since IDR has demonstrated superior quality compared to another surface rendering based method – DVR [29], we did not conduct a comparison with DVR. (2) The state-of-the-art volume rendering approach – NeRF [28]: We use a threshold of 25 to extract mesh from the learned density field. We validate this choice in the supplementary material. (3) A widely-used classical MVS method – COLMAP [35]: We reconstruct a mesh from the output point cloud of COLMAP with Screened Poisson Surface Reconstruction [16]. (4) The concurrent work which unifies surface rendering and volume rendering with an occupancy field as scene representation – UNISURF [30]. More details of the baseline methods are included in the supplementary material.
|
| 194 |
+
|
| 195 |
+
Implementation details. We assume the region of interest is inside a unit sphere. We sample 512 rays per batch and train our model for $3 0 0 \mathrm { k }$ iterations for 14 hours (for the ‘w/ mask’ setting) and 16 hours (for the ‘w/o mask’ setting) on a single NVIDIA RTX2080Ti GPU. For the ‘w/o mask’ setting, we model the background by $_ \mathrm { N e R F + + }$ [50]. Our network architecture and initialization scheme are similar to those of IDR [46]. More details of the network architecture and training parameters can be found in the supplementary material.
|
| 196 |
+
|
| 197 |
+
# 4.2 Comparisons
|
| 198 |
+
|
| 199 |
+
Table 1: Quantitative evaluation on DTU dataset. COLMAP results are achieved by $\mathrm { { t r i m } = 0 }$ .
|
| 200 |
+
|
| 201 |
+
<table><tr><td></td><td colspan="3">w/mask</td><td colspan="4">w/omask</td></tr><tr><td>ScanID</td><td>IDR</td><td>NeRF</td><td>Ours</td><td>COLMAP</td><td>NeRF</td><td>UNISURF</td><td>Ours</td></tr><tr><td>scan24</td><td>1.63</td><td>1.83</td><td>0.83</td><td>0.81</td><td>1.90</td><td>1.32</td><td>1.00</td></tr><tr><td>scan37</td><td>1.87</td><td>2.39</td><td>0.98</td><td>2.05</td><td>1.60</td><td>1.36</td><td>1.37</td></tr><tr><td>scan40</td><td>0.63</td><td>1.79</td><td>0.56</td><td>0.73</td><td>1.85</td><td>1.72</td><td>0.93</td></tr><tr><td>scan55</td><td>0.48</td><td>0.66</td><td>0.37</td><td>1.22</td><td>0.58</td><td>0.44</td><td>0.43</td></tr><tr><td>scan63</td><td>1.04</td><td>1.79</td><td>1.13</td><td>1.79</td><td>2.28</td><td>1.35</td><td>1.10</td></tr><tr><td>scan65</td><td>0.79</td><td>1.44</td><td>0.59</td><td>1.58</td><td>1.27</td><td>0.79</td><td>0.65</td></tr><tr><td>scan69</td><td>0.77</td><td>1.50</td><td>0.60</td><td>1.02</td><td>1.47</td><td>0.80</td><td>0.57</td></tr><tr><td>scan83</td><td>1.33</td><td>1.20</td><td>1.45</td><td>3.05</td><td>1.67</td><td>1.49</td><td>1.48</td></tr><tr><td>scan97</td><td>1.16</td><td>1.96</td><td>0.95</td><td>1.40</td><td>2.05</td><td>1.37</td><td>1.09</td></tr><tr><td>scan105</td><td>0.76</td><td>1.27</td><td>0.78</td><td>2.05</td><td>1.07</td><td>0.89</td><td>0.83</td></tr><tr><td>scan106</td><td>0.67</td><td>1.44</td><td>0.52</td><td>1.00</td><td>0.88</td><td>0.59</td><td>0.52</td></tr><tr><td>scan110</td><td>0.90</td><td>2.61</td><td>1.43</td><td>1.32</td><td>2.53</td><td>1.47</td><td>1.20</td></tr><tr><td>scan114</td><td>0.42</td><td>1.04</td><td>0.36</td><td>0.49</td><td>1.06</td><td>0.46</td><td>0.35</td></tr><tr><td>scan118</td><td>0.51</td><td>1.13</td><td>0.45</td><td>0.78</td><td>1.15</td><td>0.59</td><td>0.49</td></tr><tr><td>scan122</td><td>0.53</td><td>0.99</td><td>0.45</td><td>1.17</td><td>0.96</td><td>0.62</td><td>0.54</td></tr><tr><td>mean</td><td>0.90</td><td>1.54</td><td>0.77</td><td>1.36</td><td>1.49</td><td>1.02</td><td>0.84</td></tr></table>
|
| 202 |
+
|
| 203 |
+
We conducted the comparisons in two settings,
|
| 204 |
+
|
| 205 |
+
with mask supervision (w/ mask) and without mask supervision (w/o mask). We measure the reconstruction quality with the Chamfer distances in the same way as UNISURF [30] and IDR [46] and report the scores in Table 1. The results show that our approach outperforms the baseline methods on the DTU dataset in both settings – w/ and w/o mask in terms of the Chamfer distance. Note that the reported scores of IDR in the setting of w/ mask and NeRF and UNISURF in the w/o mask setting are from IDR [46] and UNISURF [30].
|
| 206 |
+
|
| 207 |
+
We conduct the qualitative comparisons on the DTU dataset and the BlendedMVS dataset in both settings, w/ mask and w/o mask, in Figure 4 and Figure 5, respectively. As shown in Figure 4 for the setting of w/ mask, IDR shows limited performance for reconstructing thin metals parts in Scan 37 (DTU), and fails to handle sudden depth changes in Stone (BlendedMVS) due to the local optimization process in surface rendering. The extracted meshes of NeRF are noisy since the volume density field has not sufficient constraint on its 3D geometry. Regarding the w/o mask setting, we visually compare our method with NeRF and COLMAP in the setting of w/o mask in Figure 5, which shows our reconstructed surfaces are with more fidelity than baselines. We further show a comparison with UNISURF [30] on two examples in the w/o mask setting. Note that we use the qualitative results of UNISURF reported their paper for comparison. Our method works better for the objects with abrupt depth changes. More qualitative images are included in the supplementary material.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 4: Comparions on surface reconstruction with mask supervision.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 5: Comparions on surface reconstruction without mask supervision.
|
| 214 |
+
|
| 215 |
+
# 4.3 Analysis
|
| 216 |
+
|
| 217 |
+
# Ablation study.
|
| 218 |
+
|
| 219 |
+
To evaluate the effect of the weight calculation, we test three different kinds of weight constructions described in Sec. 3.1: (a) Naive Solution. (b) Straightforward Construction as shown in Eqn. 4. (e) Full Model. As shown in Figure 6, the quantitative result of naive solution is worse than our weight choice (e) in terms of the Chamfer distance. This is because it introduces a bias to the surface reconstruction. If direct construction is used, there are severe artifacts.
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
|
| 223 |
+
We also studied the effect of Eikonal regularization [10] and geometric initialization [1]. Without Eikonal regularization or geometric initialization, the result on Chamfer distance is on par with that of the full model. However, neither of them can correctly output a signed distance function. This is indicated by the MAE(mean absolute error) between the SDF predictions and corresponding ground-truth SDF, as shown in the bottom line of Figure 6. The MAE is computed on uniformly-sampled points in the object’s bounding sphere. Qualitative results of
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 7: Visual comparisons with UNISURF.
|
| 227 |
+
|
| 228 |
+
SDF predictions are provided in the supplementary material.
|
| 229 |
+
|
| 230 |
+
Thin structures. We additionally show results on two challenging thin objects with 32 input images. The plane with rich texture under the object is used for camera calibration. As shown in Fig. 8, our method is able to accurately reconstruct these thin structures, especially on the edges with abrupt depth changes. Furthermore, different from the methods [39, 19, 42, 20] which only target at high-quality thin structure reconstruction, our method can handle the scenes which have a mixture of thin structures and general objects.
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
Figure 8: Comparison on scenes with thin structure objects. Left half is the depth map while right half is the reconstructed surface.
|
| 234 |
+
|
| 235 |
+
# 5 Conclusion
|
| 236 |
+
|
| 237 |
+
We have proposed NeuS, a new approach to multiview surface reconstruction that represents 3D surfaces as neural SDF and developed a new volume rendering method for training the implicit SDF representation. NeuS produces high-quality reconstruction and successfully reconstructs objects with severe occlusions and complex structures. It outperforms the state-of-the-arts both qualitatively and quantitatively. One limitation of our method is that although our method does not heavily rely on correspondence matching of texture features, the performance would still degrade for textureless objects (we show the failure cases in the supplementary material). Moreover, NeuS has only a single scale parameter $s$ that is used to model the standard deviation of the probability distribution for all the spatial location. Hence, an interesting future research topic is to model the probability with different variances for different spatial locations together with the optimization of scene representation, depending on different local geometric characteristics. Negative societal impact: like many other learning-based works, our method requires a large amount of computational resources for network training, which can be a concern for global climate change.
|
| 238 |
+
|
| 239 |
+
# Acknowlegements
|
| 240 |
+
|
| 241 |
+
We thank Michael Oechsle for providing the results of UNISURF. Christian Theobalt was supported by ERC Consolidator Grant 770784. Lingjie Liu was supported by Lise Meitner Postdoctoral Fellowship. Computational resources are mainly provided by HKU GPU Farm.
|
| 242 |
+
|
| 243 |
+
# References
|
| 244 |
+
|
| 245 |
+
[1] Matan Atzmon and Yaron Lipman. Sal: Sign agnostic learning of shapes from raw data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2565–2574, 2020.
|
| 246 |
+
[2] Connelly Barnes, Eli Shechtman, Adam Finkelstein, and Dan B Goldman. Patchmatch: A randomized correspondence algorithm for structural image editing. ACM Trans. Graph., 28(3):24, 2009.
|
| 247 |
+
[3] Adrian Broadhurst, Tom W Drummond, and Roberto Cipolla. A probabilistic framework for space carving. In Proceedings Eighth IEEE International Conference on Computer Vision. ICCV 2001, volume 1, pages 388–393. IEEE, 2001.
|
| 248 |
+
[4] Z. Chen and H. Zhang. Learning implicit fields for generative shape modeling. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 5932–5941, 2019.
|
| 249 |
+
[5] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In European conference on computer vision, pages 628–644. Springer, 2016. [6] Jeremy S De Bonet and Paul Viola. Poxels: Probabilistic voxelized volume reconstruction. In Proceedings of International Conference on Computer Vision (ICCV), pages 418–425, 1999. [7] Haoqiang Fan, Hao Su, and Leonidas J Guibas. A point set generation network for 3d object reconstruction from a single image. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 605–613, 2017.
|
| 250 |
+
[8] Yasutaka Furukawa and Jean Ponce. Accurate, dense, and robust multiview stereopsis. IEEE transactions on pattern analysis and machine intelligence, 32(8):1362–1376, 2009.
|
| 251 |
+
[9] Silvano Galliani, Katrin Lasinger, and Konrad Schindler. Gipuma: Massively parallel multiview stereo reconstruction. Publikationen der Deutschen Gesellschaft für Photogrammetrie, Fernerkundung und Geoinformation e. V, 25(361-369):2, 2016.
|
| 252 |
+
[10] Amos Gropp, Lior Yariv, Niv Haim, Matan Atzmon, and Yaron Lipman. Implicit geometric regularization for learning shapes. arXiv preprint arXiv:2002.10099, 2020.
|
| 253 |
+
[11] Rasmus Jensen, Anders Dahl, George Vogiatzis, Engil Tola, and Henrik Aanæs. Large scale multi-view stereopsis evaluation. In 2014 IEEE Conference on Computer Vision and Pattern Recognition, pages 406–413, 2014.
|
| 254 |
+
[12] Yue Jiang, Dantong Ji, Zhizhong Han, and Matthias Zwicker. Sdfdiff: Differentiable rendering of signed distance fields for 3d shape optimization. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 255 |
+
[13] Abhishek Kar, Christian Häne, and Jitendra Malik. Learning a multi-view stereo machine. arXiv preprint arXiv:1708.05375, 2017.
|
| 256 |
+
[14] Hiroharu Kato, Yoshitaka Ushiku, and Tatsuya Harada. Neural 3d mesh renderer. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3907–3916, 2018.
|
| 257 |
+
[15] Srinivas Kaza et al. Differentiable volume rendering using signed distance functions. PhD thesis, Massachusetts Institute of Technology, 2019.
|
| 258 |
+
[16] Michael Kazhdan and Hugues Hoppe. Screened poisson surface reconstruction. ACM Trans. Graph., 32(3), July 2013.
|
| 259 |
+
[17] Petr Kellnhofer, Lars Jebe, Andrew Jones, Ryan Spicer, Kari Pulli, and Gordon Wetzstein. Neural lumigraph rendering. arXiv preprint arXiv:2103.11571, 2021.
|
| 260 |
+
[18] Chen-Hsuan Lin, Chen Kong, and Simon Lucey. Learning efficient point cloud generation for dense 3d object reconstruction. In proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
|
| 261 |
+
[19] Lingjie Liu, Duygu Ceylan, Cheng Lin, Wenping Wang, and Niloy J. Mitra. Image-based reconstruction of wire art. 36(4):63:1–63:11, 2017.
|
| 262 |
+
[20] Lingjie Liu, Nenglun Chen, Duygu Ceylan, Christian Theobalt, Wenping Wang, and Niloy J. Mitra. Curvefusion: Reconstructing thin structures from rgbd sequences. 37(6), 2018.
|
| 263 |
+
[21] Lingjie Liu, Jiatao Gu, Kyaw Zaw Lin, Tat-Seng Chua, and Christian Theobalt. Neural sparse voxel fields. Advances in Neural Information Processing Systems, 33, 2020.
|
| 264 |
+
[22] Shaohui Liu, Yinda Zhang, Songyou Peng, Boxin Shi, Marc Pollefeys, and Zhaopeng Cui. Dist: Rendering deep implicit signed distance function with differentiable sphere tracing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2019–2028, 2020.
|
| 265 |
+
[23] Stephen Lombardi, Tomas Simon, Jason Saragih, Gabriel Schwartz, Andreas Lehrmann, and Yaser Sheikh. Neural volumes: Learning dynamic renderable volumes from images. ACM Transactions on Graphics (TOG), 38(4):65, 2019.
|
| 266 |
+
[24] Priyanka Mandikal, K L Navaneet, Mayank Agarwal, and R Venkatesh Babu. 3D-LMNet: Latent embedding matching for accurate and diverse 3d point cloud reconstruction from a single image. In Proceedings of the British Machine Vision Conference (BMVC), 2018.
|
| 267 |
+
[25] Paul Merrell, Amir Akbarzadeh, Liang Wang, Philippos Mordohai, Jan-Michael Frahm, Ruigang Yang, David Nistér, and Marc Pollefeys. Real-time visibility-based fusion of depth maps. pages 1–8, 01 2007.
|
| 268 |
+
[26] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4460–4470, 2019.
|
| 269 |
+
[27] Mateusz Michalkiewicz, Jhony K. Pontes, Dominic Jack, Mahsa Baktashmotlagh, and Anders Eriksson. Implicit surface representations as layers in neural networks. In The IEEE International Conference on Computer Vision (ICCV), October 2019.
|
| 270 |
+
[28] Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In European Conference on Computer Vision, pages 405–421. Springer, 2020.
|
| 271 |
+
[29] Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable volumetric rendering: Learning implicit 3d representations without 3d supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3504–3515, 2020.
|
| 272 |
+
[30] Michael Oechsle, Songyou Peng, and Andreas Geiger. Unisurf: Unifying neural implicit surfaces and radiance fields for multi-view reconstruction. arXiv preprint arXiv:2104.10078, 2021.
|
| 273 |
+
[31] Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 165–174, 2019.
|
| 274 |
+
[32] Songyou Peng, Michael Niemeyer, Lars M. Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy networks. ArXiv, abs/2003.04618, 2020.
|
| 275 |
+
[33] Shunsuke Saito, Zeng Huang, Ryota Natsume, Shigeo Morishima, Angjoo Kanazawa, and Hao Li. Pifu: Pixel-aligned implicit function for high-resolution clothed human digitization. ICCV, 2019.
|
| 276 |
+
[34] Shunsuke Saito, Tomas Simon, Jason Saragih, and Hanbyul Joo. Pifuhd: Multi-level pixelaligned implicit function for high-resolution 3d human digitization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 84–93, 2020.
|
| 277 |
+
[35] Johannes L Schönberger, Enliang Zheng, Jan-Michael Frahm, and Marc Pollefeys. Pixelwise view selection for unstructured multi-view stereo. In European Conference on Computer Vision, pages 501–518. Springer, 2016.
|
| 278 |
+
[36] Steven M Seitz and Charles R Dyer. Photorealistic scene reconstruction by voxel coloring. International Journal of Computer Vision, 35(2):151–173, 1999.
|
| 279 |
+
[37] Vincent Sitzmann, Justus Thies, Felix Heide, Matthias Nießner, Gordon Wetzstein, and Michael Zollhofer. Deepvoxels: Learning persistent 3d feature embeddings. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2437–2446, 2019.
|
| 280 |
+
[38] Vincent Sitzmann, Michael Zollhöfer, and Gordon Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. In Advances in Neural Information Processing Systems, pages 1119–1130, 2019.
|
| 281 |
+
[39] A. Tabb. Shape from silhouette probability maps: Reconstruction of thin objects in the presence of silhouette extraction and calibration error. pages 161–168, June 2013.
|
| 282 |
+
[40] Alex Trevithick and Bo Yang. Grf: Learning a general radiance field for 3d scene representation and rendering. arXiv preprint arXiv:2010.04595, 2020.
|
| 283 |
+
[41] Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In Proceedings of the European Conference on Computer Vision (ECCV), pages 52–67, 2018.
|
| 284 |
+
[42] Peng Wang, Lingjie Liu, Nenglun Chen, Hung-Kuo Chu, Christian Theobalt, and Wenping Wang. Vid2curve: Simultaneous camera motion estimation and thin structure reconstruction from an rgb video. ACM Trans. Graph., 39(4), July 2020.
|
| 285 |
+
[43] Chao Wen, Yinda Zhang, Zhuwen Li, and Yanwei Fu. Pixel2mesh++: Multi-view 3d mesh generation via deformation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1042–1051, 2019.
|
| 286 |
+
[44] Haozhe Xie, Hongxun Yao, Xiaoshuai Sun, Shangchen Zhou, and Shengping Zhang. Pix2vox: Context-aware 3d reconstruction from single and multi-view images. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2690–2698, 2019.
|
| 287 |
+
[45] Yao Yao, Zixin Luo, Shiwei Li, Jingyang Zhang, Yufan Ren, Lei Zhou, Tian Fang, and Long Quan. Blendedmvs: A large-scale dataset for generalized multi-view stereo networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1790–1799, 2020.
|
| 288 |
+
[46] Lior Yariv, Yoni Kasten, Dror Moran, Meirav Galun, Matan Atzmon, Basri Ronen, and Yaron Lipman. Multiview neural surface reconstruction by disentangling geometry and appearance. Advances in Neural Information Processing Systems, 33, 2020.
|
| 289 |
+
[47] Wang Yifan, Shihao Wu, Cengiz Oztireli, and Olga Sorkine-Hornung. Iso-points: Optimizing neural implicit surfaces with hybrid representations. arXiv preprint arXiv:2012.06434, 2020.
|
| 290 |
+
[48] Christopher Zach, Thomas Pock, and Horst Bischof. A globally optimal algorithm for robust tv-l1 range image integration. In 2007 IEEE 11th International Conference on Computer Vision, pages 1–8, 2007.
|
| 291 |
+
[49] Kai Zhang, Fujun Luan, Qianqian Wang, Kavita Bala, and Noah Snavely. Physg: Inverse rendering with spherical gaussians for physics-based material editing and relighting. arXiv preprint arXiv:2104.00674, 2021.
|
| 292 |
+
[50] Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. Nerf++: Analyzing and improving neural radiance fields. arXiv preprint arXiv:2010.07492, 2020.
|
md/train/Fo6S5-3Dx_/Fo6S5-3Dx_.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP EVOLUTIONARY LEARNING FOR MOLECULAR DESIGN
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we propose a deep evolutionary learning (DEL) process that integrates fragment-based deep generative model and multi-objective evolutionary computation for molecular design. Our approach enables (1) evolutionary operations in the latent space of the generative model, rather than the structural space, to generate novel promising molecular structures for the next evolutionary generation, and (2) generative model fine-tuning using newly generated highquality samples. Thus, DEL implements a data-model co-evolution concept which improves both sample population and generative model learning. Experiments on two public datasets indicate that sample population obtained by DEL exhibits improved property distributions, and dominates samples generated by multiobjective Bayesian optimization algorithms.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
A drug is a molecule that binds to a target (e.g. protein) to inhibit or activate specific pathways in pathogens or host cells that cause abnormal phenotype. Drug discovery and development is a costly and time-consuming process, which is compounded by personalized medicines development for cancer or other complex and rare diseases. Computational drug discovery has been shown to accelerate the whole discovery process using simulations and machine intelligence. However, challenge remains in this field by demands for a robust and unbiased feature representation theories for molecules and their corresponding receptors, and efficient search algorithms. The rise of AI and data science provides us with a unique opportunity to reevaluate the problem and develop fast intelligent search or design approaches (Gromski et al., 2019; Chen et al., 2018). These new technologies claim differences from the traditional ones in two aspects: (1) features can be automatically learned using embedding techniques on a large number of training samples, and (2) high-level relationships (in supervised case) and complex distributions (in unsupervised case) can be captured using appropriate deep architectures. Recently, new representation theories and architectures have been proposed in the domain of molecular generation. There exist two new major methods to present a molecule for a machine learning algorithm. The first method converts a molecule structure to a string, such as the simplified molecular-input line-entry system (SMILES) string (Weininger, 1988), and adopt natural language processing (NLP) methods for supervised or unsupervised learning. The second uses an undirected graph to present a molecular structure and applies graph convolutional neural networks (Duvenaud et al., 2015). Three major families of AI algorithms have been developed for novel drug discovery: deep generative models (DGMs), reinforcement learning, and the combination of both.
|
| 12 |
+
|
| 13 |
+
As one family of major neural probabilistic models for data modelling, generative autoencoders (e.g. variational autoencoder (VAE) (Kingma & Welling, 2014)) have been adopted to learn on either SMILES strings (Romez-Bombarelli et al., 2018) or molecular graphs (Simonovsky & Komodakis, 2018) with corresponding physical and biochemical properties for molecular generation. By integrating the generative adversarial nets and autoencoders, adversarial autoencoders (AAEs) have also been well applied to molecular design (Kadurin et al., 2017). The advantage of using generative autoencoders is that, molecules, as discrete objects in our world, are mapped to the continuous latent space, whose landscape can be organized by their properties, which helps generate new structures with preferred property values. However, critical problems remain due to imperfect representation methods. When SMILES strings are used in VAE, the model suffers from imbalance of tokens in embedding, generation of invalid structures, and the problem where two almost identical molecules have markedly different canonical SMILES strings. When using graph as molecular representation in VAE, a technical difficulty is to design an effective graph decoder. In addition to other heuristic methods, a SMILES decoder can be used to pair with a graph encoder. While DGMs offer convenience of searching in latent space, reinforcement learning algorithms can directly search in the molecules’ structural space by adding or deleting bounds and atoms (Zhou et al., 2019). In the Markov decision process (MDP) for drug design, the agent is a molecular generator, the molecular structure indicates the state, the actions are modifications to the current structure, and a simulator (e.g. surrogate model) is often used as the environment to provide reward. Furthermore, generative and predictive models can be integrated in MDP to form deep reinforcement learning (DRL) methods, where the generative model is trained as a policy approximation and the predictive model can be used as a value function approximation (You et al., 2018; Popova et al., 2018). Search in the discrete input space and inefficient learning are arguable concerns to be addressed when applying reinforcement-learning-based solutions for compound design.
|
| 14 |
+
|
| 15 |
+
Interestingly, as an old peer of reinforcement learning for black-box optimizations, evolutionary computation (EC) methods (Eiben & Smith, 2015) have been catching up with promising performances in modern optimization, design and modelling problems. Besnard et al. (2012) present a strategy for evolution of ligands along multiple properties in the structural space, where a library of knowledge-based chemical structural transformation is used as the mutation operator. Interactions between EC and neural networks have mainly focused on network evolution and neural surrogate models for fitness functions. For examples, EC has been used at a large scale for neuroevolution that leads to evolution of neural network architectures (Stanley et al., 2019); feedforward neural network is commonly used as fitness function in EC (Mandal et al., 2019). Furthermore, it has been recently discovered that evolutionary strategy (ES) can perform competitively with reinforcement learning in game AI (Salimans et al., 2017). ES (Wierstra et al., 2014) and estimation of distribution algorithms (EDA) (Hauschild & Pelikan, 2011) build parameterized search distributions over promising points and either employ gradient information or sample from such a probabilistic model to find better points. Both probabilistic strategies from EC can potentially be used as alternatives to Bayesian optimization (BO) in (continuous) black-box optimizations. A single-objective BO has been recently applied to molecule optimization in the latent space of VAE (Romez-Bombarelli et al., 2018).
|
| 16 |
+
|
| 17 |
+
Since model learning is essentially parameter estimation from the statistical modelling perspective, the quality of data in deep learning is crucial for model performance. Data augmentation is becoming a new strategy in deep learning to improve the training of a model. For example, in computer vision, transformations (such as rotation and flipping) of images are used to increase the sample size when the original data set is insufficient (Perez & Wang, 2017; Cubuk et al., 2019; Shorten & Khoshgoftaar, 2019). In NLP, a text dataset can be augmented using tricks such as replacing words or phrases with their synonyms (Wei & Zou, 2019), and resorting aids from other language models (e.g. word embedding and neural machine translations) (Sennrich et al., 2016; Wei & Zou, 2019). Basically, these methods either increase the data by transforming existing information which can only alleviate the limit of certain techniques (e.g. convolution), or indirectly borrow new information from other sources (e.g. methods in NLP).
|
| 18 |
+
|
| 19 |
+
In summary, even though modern machine learning, evolutionary computation, and data science methods have been applied to molecular design and achieved promising results, we are still challenged by three chief issues. (1) An effective representation method for compound structures, that is encoding-decoding friendly and invariant to multimorphic forms, is still missing. (2) New ideas are expected for effective representation and coding of discrete structures in EC. And, (3) quality of data can be further improved as current data augmentation tricks only increase the number of samples but does not specifically address data quality. In this paper, we propose a novel deep evolutionary learning (DEL) process that combines the merits of deep generative model and multi-objective evolutionary computation together for molecular design. Specifically, our work has three major contributions. (1) In our approach, latent representations of phenotypic samples in a population serve as genotypic codes for evolutionary operations.This approach differs from traditional evolutionary algorithms that search in the original space of a problem. Specifically, our framework’s DGM encoder projects molecular structures in a population from discrete space to continuous latent space where evolutionary operations are applied to help explore the latent representation space. Subsequently, the DGM decoder maps the genotypic representation to the phenotypic space for generating new molecules with desired property values. (2) In each evolutionary generation, the newly formed population containing novel competitive molecules can be used to further fine-tune the DGM. This approach is an innovative data augmentation strategy that enriches training data with novel highquality samples. The whole DEL process implements a new learning paradigm that co-evolves data and model alternatingly through multiple evolutionary generations. (3) Our comprehensive experiments demonstrate that DEL is able to produce populations of novel samples with improved values of properties and outperforms state-of-the-art multi-objective BO algorithms (MOBO).
|
| 20 |
+
|
| 21 |
+
# 2 METHOD
|
| 22 |
+
|
| 23 |
+
The proposed deep evolutionary learning (DEL) process combines deep learning and multi-objective EC through the latent representation space of molecules. One of the theoretical innovations of our approach is that it demonstrates that EC methods are extendable to corresponding deep versions. The main idea is illustrated in Figure 1a and formally presented in Algorithm 1 (see Appendix A.1). This algorithm consists of the following steps. (a) A VAE (as molecule modeller) and a multilayer perceptron neural network (MLP, property predictor as regularizer) are pretrained using all the original training data to start the first evolutionary generation, or, if not in the first generation, using samples from the previous population. (b) Training samples (if first generation) or population samples (otherwise) are projected to the latent space using the encoder of the VAE. (c) Based on non-dominated ranking and crowding distances of samples with respect to multiple properties, evolutionary operations (selection, recombination/crossover and mutation) are conducted on the latent representations of the samples. (d) Given these new latent codes after evolutionary operations, new molecule samples are generated by the decoder of the VAE. (e) Properties of these generated samples are obtained using a simulator (e.g. RDKit (Landrum, 2006) in our experiment). (f) New samples with good desired properties and good samples from the previous generation form the new population. (g) Steps (b-f) are iterated for multiple generations. (h) The final population is returned.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Deep evolutionary learning process and deep generative model integrated in DEL.
|
| 27 |
+
|
| 28 |
+
The major advantages of our DEL algorithm over existing interactions between EC and neural networks can be explained as follows. (a) We directly evolve a collection of data rather than many neural network structures and parameters. Data evolution tends to be more efficient than direct evolution of model structures and parameters. (b) The single neural network model (i.e. DGM in DEL) can be indirectly improved through learning on the evolved data with modern gradient-based variational learning and inference algorithms. Thus, the improvement of populations along evolutionary generations can be viewed as an effective data augmentation strategy that includes novel and highquality samples for further training of the neural network. (c) The continuous latent representation space established by the encoder of DGM can be naturally used as encoding (genotypic) space for evolutionary computation. Thus, evolutionary operations are carried out in the latent space instead of the discrete structural input space, allowing more efficient and smooth exploration, because the latent space is often multimodal and can be organized by properties (regularized by the property predictor) and evolutionary operations in this space can help the search escape from local regions and explore new regions of interest. (d) The multi-objective operations - non-dominated sorting and crowding distance, can help identify competitive and diverse parent samples to breed offspring. In summary, DEL takes advantages of both multi-objective EC and probabilistic neural model learning. The DGM, multi-objective components (non-dominated sorting and crowding distance), evolutionary operations, formation of new populations are discussed in details as below.
|
| 29 |
+
|
| 30 |
+
# 2.1 FRAGVAE FOR FRAGMENT-BASED MOLECULAR MODELLING
|
| 31 |
+
|
| 32 |
+
In our DEL process, we adopted a VAE model originally for fragment-based molecular generation (Podda et al., 2020). The concept of fragment-based drug design (FBDD) was introduced in (Shuker et al., 1996). In FBDD-based approaches, small organic molecules that bind to proximal subsites of a protein are identified, optimized, and linked together to produce high-affinity ligands. Wet-lab approaches for FBDD include $\mathrm { X }$ -ray crystallography and NMR spectroscopy. Compared to atom-based drug design, FBDD has the following advantages (Erlanson, 2011). (1) The search space in FBDD is much smaller $1 0 ^ { 7 }$ versus $1 0 ^ { 6 0 }$ ). (2) Identifying a fragment with certain affinity to the target may mean finding a pharmacophore. (3) Fragment-based synthesis could be more efficient than high-throughput screening. Majority fragmentation methods, which break a molecule into parts, are based on synthetic accessibility. For examples, RECAP (retrosynthetic combinatorial analysis procedure) is a method that breaks bonds formed by chemical reactions (Lewell et al., 1998); BRICS (breaking of retrosynthetically interesting chemical substructures) generates a more elaborated set of fragmentation rules along synthetically accessible bonds and generates more fragments than RECAP (Degen et al., 2008). BRICS is used in (Podda et al., 2020) to chop a SMILES string into several fragments. Then, fragment embeddings are produced using Word2Vec (Mikolov et al., 2013). Next, the sequences of fragments are modelled by a GRU-based VAE. In our work, a multi-head feedforward neural network component for predicting values of properties is added to the original model such that the latent representations can be regularized by properties of interest. Additionally, we normalize the three loss terms using batch size, and allow tuning of the weights among the loss terms. A crucial implementation bug in the original VAE model was also corrected (see Appendix A.2). Hereafter, we name this modified VAE model for fragments as FragVAE whose architecture is displayed in Figure 1b.
|
| 33 |
+
|
| 34 |
+
We denote the encoder parameter by $\phi$ , the decoder parameter by $\pmb { \theta }$ , and the property predictor network by $f _ { \psi } ( z )$ parameterized by $\psi$ . The objective (to be minimized) of this DGM employed in DEL is a weighted combination of three terms:
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\begin{array} { r } { l _ { \phi , \theta , \psi } = - \mathrm { E } _ { q _ { \phi } ( z | x ) } [ \log p _ { \theta } ( x | h ) ] + \beta \mathrm { K L } \big ( q _ { \phi } ( z | x ) | | p _ { \theta } ( z ) \big ) + \alpha \mathrm { E } _ { q _ { \phi } ( z | x ) } \big [ \mathrm { M S E } ( f _ { \psi } ( z ) , y ) \big ] , } \end{array}
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
where the first term is to reduce the reconstruction error, the second term is to regularize the posterior latent distribution with a simple prior, and the third term uses mean squared error of property prediction to further regularize the posterior distribution of latent codes. Previous studies unveil that VAE can easily fail on modelling text data because of the training imbalance between the reconstruction error (difficult to reduce once the KL divergence becomes very small) and the KL divergence (easy to diminish to zero). Thus, proper trade-off between the reconstruction error and KL divergence through $\beta$ -VAE (Higgins et al., 2017) is vital in text generation and molecular generation (Yan et al., 2020; Bowman et al., 2016). In practice, the value of $\beta$ should be smaller than 1. To look for a suitable value of $\beta$ , we design a versatile function, called $\beta$ -function, as formulated below,
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\beta ( t ) = \operatorname* { m i n } \Big \{ \operatorname* { m a x } \big \{ a e ^ { k ( 1 - \frac { T } { t } ) } , l \big \} , u \Big \} ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $T$ represents the total number of epochs, $t \in \{ 1 , 2 , \cdots , T \}$ indicates the current index of epoch, $k$ controls the incremental speed, $a$ defines the amplitude, $l$ and $u$ serve as lower and upper bounds respectively for the value of $\beta$ . With different settings, a variety of curves of this function are shown in Figure 6 (see Appendix A.7). The value of $\alpha$ can be set similarly in FragVAE.
|
| 47 |
+
|
| 48 |
+
# 2.2 NON-DOMINATION RANK AND CROWDING DISTANCE
|
| 49 |
+
|
| 50 |
+
To get non-domination rank and crowding distance of a feasible solution for guiding the sample selection (Section 2.3) and the population merging (Section 2.4), the fast non-dominated sort and crowding comparison methods are adopted from the classic NSGA-II algorithm for multi-objective optimization (Deb et al., 2002). The properties in molecular design are treated as objectives. In an optimization problem with $K$ objectives $\bar { f } ( z ) = \{ f _ { 1 } ( z ) , \cdot \cdot \cdot , f _ { K } ( \bar { z } ) \}$ , feasible solution $z _ { 1 }$ is said to dominate $z _ { 2 }$ (denoted by $z _ { 1 } \prec z _ { 2 } ,$ ), if $\forall k \in \{ 1 , \cdots , K \}$ : $f _ { k } ( z _ { 1 } ) \leq f _ { k } ( z _ { 2 } )$ and $\exists k \in \{ 1 , \cdots , K \}$ : $f _ { k } ( z _ { 1 } ) < f _ { k } ( z _ { 2 } )$ . Using this concept of domination, all feasible solutions in a collection can be sorted to form Pareto frontiers (or fronts, ranks) $\mathcal { F } = \{ \mathcal { F } _ { 1 } , \mathcal { F } _ { 2 } , \cdot \cdot \cdot \}$ . Samples in the same frontier do not dominate each other. Frontier ${ \mathcal { F } } _ { i }$ dominates ${ \mathcal { F } } _ { j }$ for $j > i$ . Thus, we define function $F ( z )$ to retrieve the rank (i.e. frontier index) of any feasible solution $_ { z }$ in the population.
|
| 51 |
+
|
| 52 |
+
The crowding distance of a feasible solution is computed as the normalized perimeter of the cuboid formed by its immediate neighbours along all objective axes. To compute the crowding distance of $z _ { i }$ , the normalized distance between its nearest neighbours above (denoted by $z _ { a }$ ) and below (denoted by $z _ { b }$ ) it w.r.t. the $k$ -th objective axis is calculated using $\begin{array} { r } { d _ { k } ( z _ { i } ) = \frac { f _ { k } ( z _ { a } ) - f _ { k } ( z _ { b } ) } { f _ { k } ^ { \operatorname* { m a x } } - f _ { k } ^ { \operatorname* { m i n } } } } \end{array}$ , where $f _ { k } ^ { \mathrm { m a x } }$ and idual $f _ { k } ^ { \mathrm { m i n } }$ are respectively the maximal and minimal values ots are summed up to form the crowding distance of h: $k$ these. The $z _ { i }$ $\begin{array} { r } { d ( z _ { i } ) = \sum _ { k = 1 } ^ { K } d _ { k } ( z _ { i } ) } \end{array}$
|
| 53 |
+
|
| 54 |
+
Using the two concepts, partial order can be defined. We say $z _ { 1 } \prec _ { n } z _ { 2 }$ if either (1) $z _ { \mathrm { 1 } } \prec z _ { \mathrm { 2 } }$ (that is $F ( z _ { 1 } ) < F ( z _ { 2 } ) )$ , or (2) $F ( z _ { 1 } ) = F ( z _ { 2 } )$ and $d ( z _ { 1 } ) > d ( z _ { 2 } )$ . When two solutions have same rank, the one with larger crowding distance is preferred because it helps maintain a diverse population.
|
| 55 |
+
|
| 56 |
+
# 2.3 EVOLUTIONARY OPERATIONS
|
| 57 |
+
|
| 58 |
+
The evolutionary operations include parent selection, recombination and mutation to produce new offspring in the evolutionary process. Binary tournament selection is applied to select one out of two randomly drawn samples from the current population. In such a selection process, let us suppose $z _ { 1 }$ and $z _ { 2 }$ are randomly taken from the population and $z _ { 1 } \prec _ { n } z _ { 2 }$ . Sample $z _ { 1 }$ will be selected with selection probability $p _ { s }$ which is close to one, and $z _ { 2 }$ will be selected with a small chance $1 - p _ { s }$ . This selection process is repeated $M$ times to thus find $M$ parents where $M$ is the fixed population size. A pair of such parents will produce two children through recombination and mutation operations. Given two parents’ latent representation $z _ { p 1 }$ and $z _ { p 2 }$ , there are two recombination options - linear and discrete methods, to produce their new children $\hat { z } _ { 1 }$ and $\hat { z } _ { 2 }$ . For linear recombination, $\hat { z } _ { 1 } =$ $z _ { p 1 } + r _ { 1 } \big ( z _ { p 2 } - z _ { p 1 } \big )$ and $\hat { z } _ { 2 } = z _ { p 1 } + r _ { 2 } ( z _ { p 2 } - z _ { p 1 } )$ where $r _ { 1 } = - d \substack { + ( 1 + 2 d ) \alpha _ { 1 } }$ , $r _ { 2 } = - d \ t ( 1 \tplus d ) \alpha _ { 2 }$ , $d = 0 . 2 5$ , and $\alpha _ { 1 } , \alpha _ { 2 } \sim \mathrm { U n i f o r m } ( 0 , 1 )$ . For discrete method, supposing a latent representation vector is of length $L$ , an integer $l$ is randomly drawn from $\{ 1 , \cdots , L - 1 \}$ such that $\begin{array} { r } { \hat { z } _ { 1 } ^ { \ast } = \left[ z _ { p 1 } [ 1 : \right. } \end{array}$ $l ] , z _ { p 2 } [ l + 1 : L ] ]$ and $\hat { z } _ { 2 } ~ = ~ \big [ z _ { p 2 } [ 1 ~ : ~ l ] , z _ { p 1 } [ l ~ + ~ 1 ~ : ~ L ] \big ]$ . After crossover, a new sample $\hat { z } _ { m }$ $( m \in \{ 1 , \cdots , M \} )$ will have a small mutation probability $p _ { m }$ (say 0.01) of getting mutation. For $\hat { z } _ { m }$ , a random value $r$ is drawn from $\mathrm { U n i f o r m } ( 0 , 1 )$ . If $r < p _ { m }$ , then a random integer $l$ is randomly selected from $\{ 1 , \cdots , L \}$ such that the $l$ -th position of $\hat { z } _ { m }$ is replaced with a value drawn from standard Gaussian distribution: $\hat { z } _ { m , l } \sim \mathcal { N } ( 0 , 1 )$ .
|
| 59 |
+
|
| 60 |
+
# 2.4 FORMING NEW POPULATION
|
| 61 |
+
|
| 62 |
+
Ideally we need to maintain excellent and diverse populations. After possible mutation operations, all $M$ genotypic coding vectors will pass through the decoder of the DGM to produce phenotypic samples. All valid samples (supposed in set $\hat { \mathcal { P } } _ { t + 1 } \mathrm { ~ . ~ }$ ) will be kept to merge with the previous population (denoted by $\mathcal { P } _ { t }$ ) to produce a new generation (denoted by $\mathcal { P } _ { t + 1 }$ ). To implement it, all samples in $\hat { \mathcal { P } } _ { t + 1 } + \mathcal { P } _ { t }$ are sorted based on their non-domination ranks first and then on their crowding distances. Finally, only the top $M$ samples are taken from them to form the new population.
|
| 63 |
+
|
| 64 |
+
# 3 EXPERIMENTS
|
| 65 |
+
|
| 66 |
+
The performance of DEL was investigated on the ZINC (Irwin & Shoichet, 2005) and PCBA (Wang et al., 2016) datasets. These data were processed in the work of Podda et al. (2020). ZINC and PCBA are respectively composed of 227,945 and 383,790 molecules with two or more fragments. More statistics of both data can be found in (Podda et al., 2020). We comprehensively investigated the empirical performance of FragVAE and DEL. Three properties (QED: quantitative estimation of drug-likeness, SAS: synthetic accessibility score, and logP: water-octanol partition coefficient) are selected as objectives in DEL. Molecules with large QED, low SAS, and small logP values are prioritized. Incorporation of other properties (e.g. binding affinity, structure-property relationship, and ADME) will be considered in future work. QED, a scalarization of eight molecular properties (including logP) (Bickerton et al., 2012), is an adequate initial screening step for drug candidates. As we dive into more specific applications, selective properties can be tailored for subsequent screening. Thus, explicit usage of logP as one objective in DEL can help better assess lipophilicity, a key factor in drug design for some diseases, e.g. kidney and heart problems.
|
| 67 |
+
|
| 68 |
+
# 3.1 EVALUATION OF FRAGVAE
|
| 69 |
+
|
| 70 |
+
As FragVAE is a significant modification of the original model used in (Podda et al., 2020), we investigated the impact of $\beta$ value to the performance of FragVAE in terms of loss function values through Figure 7 (see Appendix A.7). Other hyperparameter values can be found in Appendix A.3. One can see that a large $\beta$ value can quickly reduce the KL loss to near zero which leads to stagnant reductions of reconstruction error and property regression error – the notorious posterior collapse problem (Goyal et al., 2017), because it is much easier to reduce the KL divergence than the reconstruction error in complex sequence modelling. Using a suitable small value of $\beta$ would allow the continuous decrease of the reconstruction error and property regression error. This observation is consistent with discoveries in language generative models (Yan et al., 2020; Bowman et al., 2016).
|
| 71 |
+
|
| 72 |
+
Table 2 (see Appendix A.6) shows the validity, novelty and diversity of 20,000 samples generated from trained FragVAEs using standard Normal prior to sample $_ { z }$ followed by the decoder. Results of previous language-model-based and graph-based methods are also given for comparison. In general, the validity is defined as the ratio of number of valid generated samples to total number of generated samples. To clarify, the perfect validity reported in Podda et al. (2020) is actually calculated as the ratio of valid generated SMILES strings after discarding invalid fragment sequences versus total number of valid fragment sequences, i.e. Validity (SMILES) in Table 2. We found that this ratio is always 1 in fragment-based models. To have a better understanding about the model, we hence computed the validity of fragment sequences as the percentage of number of valid fragment sequences to total number of generated fragment sequences, i.e. Validity (Fragments) in Table 2. The novelty is defined as the ratio of number of generated novel valid molecules that do not exist in the training data versus total number of generated valid samples. The diversity is calculated as the percentage of generated unique valid samples among total number of generated valid samples. When the value of $\beta$ is very small (0.01), the posterior $p ( \boldsymbol { z } | \boldsymbol { x } )$ is highly different from the simple standard Normal prior $p ( z )$ . Thus, it is reasonable to see relatively low diversity in samples derived using standard Normal distribution. However, it does not imply that FragVAE with a very small value of $\beta$ is poor at learning latent representation. In fact, previous work in $\beta$ -VAE shows that small values of $\beta$ tend to encourage disentangled representations and form latent clusters (Li et al., 2020).
|
| 73 |
+
|
| 74 |
+
The property distributions of generated samples can be important indicators to the proximity of generated samples with actual samples. Figure 2 shows the distributions of QED, SAS and logP in samples generated using standard Normal prior. Large $\beta$ value can lead to the sample SAS distribution appearing at the right side of the actual SAS distribution. Interestingly, the property distributions when using $\beta = 0 . 0 1$ do not resemble actual data, implying that using a very small value of $\beta$ would lead to latent representations that deviate from standard normal distributions. To summarize, $\beta \leq 0 . 1$ can prevent the model training from posterior collapse and can form structured latent representation space which is useful for latent space exploration using optimization techniques.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: Property and structural feature distributions over 20K randomly sampled molecules.
|
| 78 |
+
|
| 79 |
+
# 3.2 DEL PERFORMANCE
|
| 80 |
+
|
| 81 |
+
We executed DEL processes using fixed or annealed loss trade-off weights: (1) $\beta = 0 . 1$ and $\alpha = 1$ , (2) $\beta = 0 . 0 1$ and $\alpha = 1$ , (3) $\beta = 0 . 1$ and $\alpha = 1$ in the initial training of FragVAE, then annealing $\beta$ to 0.4 and $\alpha$ to 4 in the second generation of DEL (denoted by $\beta = 0 . 1 0 . 4$ , $\alpha = 1 4$ ), and similarly (4) $\beta = 0 . 0 1 0 . 4$ , $\alpha = 1 4$ . Other hyperparameter values can be found in Appendix A.4. The change of losses is shown in Figure 8. We observe that (1) all settings lead to similar reconstruction error convergence, (2) smaller values of $\beta$ tend to obtain smaller property prediction error, (3) annealing can help reduce the KL divergence compared to the corresponding fixed settings.
|
| 82 |
+
|
| 83 |
+
Figure 3 shows population validity, novelty and diversity in different DEL processes. In this chart, validity (SMILES) is the validity of SMILES strings in the population; validity (fragments) is the validity of fragment sequences sampled using FragVAE after evolutionary operations; novelty is the ratio of population samples that are not in the training data against the population size; and diversity is the ratio of unique population samples against the population size. We observe that almost all samples in the populations are novel; and the population samples in the last generation are quite diverse, ranging from 0.798 to 0.988. Table 9 lists the increasing numbers of high-quality novel molecules discovered along the DEL processes. In contrast to the training molecules visualized in Figures 9 and 10 (Appendix), DEL is able to discover novel and diverse high-quality molecules (see Figures 11-18 in Appendix). Furthermore, the distributions of properties and structural features of samples along the evolutionary process are compared in Figure 4 (and Figures 19-21 in Appendix). It can be seen that the process can be quite different from the actual data distribution and is able to gradually improve the distributions of QED, SAS and logP in population samples towards the preferred goals. Interestingly, samples randomly generated using standard Normal prior do not clearly show this trend (Figures 22-25 in Appendix).
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 3: Population validity, novelty and diversity during DEL processes.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: Property & structural feature distributions of DEL populations $\mathrm { \beta } = 0 . 0 1 \to 0 . 4$ , $\alpha { = } 1 4$ ).
|
| 90 |
+
|
| 91 |
+
# 3.3 COMPARISON WITH MULTI-OBJECTIVE BAYESIAN OPTIMIZATION
|
| 92 |
+
|
| 93 |
+
DEL was compared with two MOBO methods: q-Pareto Efficient Global Optimization (qParEGO) and $\mathbf { q }$ -Expected Hypervolume Improvement (qEHVI) (Daulton et al., 2020). These MOBO methods were run in the latent space of FragVAE trained in the first generation of DEL using all training samples. Hyperparameter settings of these algorithms are listed in Appendix A.5. Figure 26 shows the hypervolumes of both algorithms and the quasi-random baseline which selects candidates from a scrambled Sobol sequence along batches. Hypervolumes obtained using these models are plotted in Figure 26. It shows that qParEGO and qEHVI work better with $\beta = 0 . 0 1$ than that with $\beta = 0 . 1$ .
|
| 94 |
+
|
| 95 |
+
To qualitatively compare DEL with the MOBO algorithms, the first five Pareto fronts obtained using DEL and last five batches obtained using qParEGO and qEHVI are visualized in Figure 5 and Figure 27 in Appendix. We can see that the solutions from qParEGO and qEHVI are behind the Pareto fronts from DEL. To quantitatively compare DEL with qParEGO and qEHVI, we conducted nondominated sorting on the combination of the first Pareto front of DEL and the last six batches of qParEGO and qEHVI and report the results in Table 1. It shows that all solutions from the DEL Pareto front stay in the new integrated Pareto front, while almost all solutions from qParEGO and qEHVI are behind the integrated Pareto front. Furthermore, as indicated in Table 3 in Appendix,
|
| 96 |
+
|
| 97 |
+
DEL runs more efficiently than these MOBO algorithms, even though the population size (20,000) of DEL is much larger than the batch sizes (8) of MOBO algorithms. It has been a well-known challenge to scale up BO algorithms.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 5: Pareto fronts of DEL and MOBO algorithms $\beta = 0 . 0 1 0 . 4$ ). In the legend, the last batch of qParEGO or qEHVI is written as Front 1.
|
| 101 |
+
|
| 102 |
+
Table 1: Non-dominated sorting of combination of DEL, qParEGO and qEHVI Pareto fronts.
|
| 103 |
+
|
| 104 |
+
<table><tr><td colspan="2"></td><td colspan="3">Pareto Front Size for Comparison</td><td colspan="3">In New Pareto Front</td></tr><tr><td>Data</td><td>DELHyperparameter</td><td>DEL</td><td>qParEGO</td><td>qEHVI</td><td>DEL</td><td>qParEGO</td><td>qEHVI</td></tr><tr><td>ZINC</td><td>β=0.1→0.4</td><td>243</td><td>46</td><td>45</td><td>243 (100%)</td><td>0(0%)</td><td>0(0%)</td></tr><tr><td>ZINC</td><td>β= 0.01→ 0.4</td><td>200</td><td>46</td><td>40</td><td>200 (100%)</td><td>0(0%)</td><td>1(2.5%)</td></tr><tr><td>PCBA</td><td>β=0.1→0.4</td><td>228</td><td>46</td><td>36</td><td>228 (100%)</td><td>0 (0%)</td><td>0(0%)</td></tr><tr><td>PCBA</td><td>β= 0.01→ 0.4</td><td>183</td><td>46</td><td>43</td><td>183 (100%)</td><td>1(2.17%)</td><td>2 (4.65%)</td></tr></table>
|
| 105 |
+
|
| 106 |
+
# 3.4 ABLATION STUDIES
|
| 107 |
+
|
| 108 |
+
By default, DEL uses the property predictor for latent representation regularization, fine-tunes FragVAE using new population data in each generation, forms new child latent codes using the linear crossover method, and fixes the population size to 20K. Variants were created by (1) disabling the property predictor, (2) disabling finetuning, (3) using the discrete crossover method, and (4) allowing a much larger population size (100K). While it is difficult to compare these variants in terms of validity, novelty and diversity of population samples (see Figure 28 in Appendix), it turns out that non-dominated sorting is an informative method for comparison. Table 4, in Appendix A.6, indicates that DEL with the property predictor outperforms the variant without it. Table 5 shows that FragVAE finetuning in DEL can help obtain better Pareto fronts. Table 6 implies that both linear and discrete crossover operations behave well in DEL. Also, DEL with larger population size can form better Pareto fronts (see Table 7). Additionally, we applied non-dominated sorting to compare the quality of Pareto fronts obtained using different values of $\beta$ on DEL, and found that the integrated Pareto front consists of samples relatively evenly from all settings (Table 8).
|
| 109 |
+
|
| 110 |
+
# 4 CONCLUSION
|
| 111 |
+
|
| 112 |
+
In this paper, we presented our DEL framework where a fragment-based VAE is integrated such that evolutionary exploration is conducted in the continuous latent representation space rather than the discrete structural space. Our intensive experiments show that DEL is able to generate novel populations of molecules with improved properties, and outperforms state-of-the-art multi-objective Bayesian optimization algorithms. Applications of DEL are certainly not restricted to design of small molecules. As future work, DEL will be tested on different datasets, other design problems, and more specific applications. Other types of DGMs and search strategies will be explored to further enhance DEL. New MOBO algorithms for latent-space based optimization need to be studied further to address issues such as scalability, unknown invalid domains in latent space, and the curse of dimensionality. Github link of our PyTorch and BoTorch implementation will be available.
|
| 113 |
+
|
| 114 |
+
REFERENCES
|
| 115 |
+
TJ. Besnard, G.F. Ruda, V. Setola, K. Abecassis, R.M. Rodriguiz, X. Huang, S. Norval, M.F. Sassano, A.I. Shin, L.A. Webster, F.R.C. Simeons, L. Stojanovski, A. Prat, N.G. Seidah, D.B. Constam, G.R. Bickerton, K.D. Read, W.C. Wetsel, I.H. Gilbert, B.L. Roth, and A.L. Hopkins. Automated design of ligands to polypharmacological profiles. Nature, 412:215–220, 2012.
|
| 116 |
+
G.R. Bickerton, G.V. Paolini, J. Besnard, S. Muresan, and A.L. Hopkins. Quantifying the chemical beauty of drugs. Nature Chemistry, 4:90–98, 2012.
|
| 117 |
+
S.R. Bowman, L. Vilnis, O. Vinyals, A.M. Dai, R. Jozefowicz, and S. Bengio. Generating sentences from a continuous space. In SIGNLL Conference on Computational Natural Language Learning (CoNLL), pp. 10–21, 2016.
|
| 118 |
+
H. Chen, O. Engkvist, Y. Wang, M. Olivecrona, and T. Blaschke. The rise of deep learning in drug discovery. Drug Discovery Today, 23(6):1241–1259, 2018.
|
| 119 |
+
E.D. Cubuk, B. Zoph, D. Mane, V. Vasudevan, and Q.V. Le. AutoAugment: Learning augmentation strategies from data. In CVPR, 2019.
|
| 120 |
+
S. Daulton, M. Balandat, and E. Bakshy. Differentiable expected hypervolume improvement for parallel multi-objective Bayesian optimization. arXiv Preprint, pp. arXiv:2006.05078, 2020.
|
| 121 |
+
K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan. A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2):182–197, 2002.
|
| 122 |
+
J. Degen, C. Wegscheid-Gerlach, A. Zaliani, and M. Rarey. On the art of compiling and using ‘drug-like’ chemical fragment spaces. ChemMedChem, 3(10):1503–1507, 2008.
|
| 123 |
+
D. Duvenaud, D. Maclaurin, J. Aguilera-Iparraguirre, R. Bombarell, T. Hirzel, A. Aspuru-Guzik, and R.P. Adams. Convolutional networks on graphs for learning molecular fingerprints. In NIPS, 2015.
|
| 124 |
+
A.E. Eiben and J. Smith. From evolutionary computation to the evolution of things. Nature, 521 (2014):476–482, 2015.
|
| 125 |
+
D.A. Erlanson. Introduction to fragment-based drug discovery. Topics in Current Chemistry, 317: 1–32, 2011.
|
| 126 |
+
A. Goyal, A. Sordoni, M. Cote, N.R. Ke, and Y. Bengio. Z-Forcing: Training stochastic recurrent networks. In NIPS, 2017.
|
| 127 |
+
P.S. Gromski, A.B. Henson, J.M. Granda, and L. Cronin. How to explore chemical space using algorithms and automation. Nature Review Chemistry, 3:119–128, 2019.
|
| 128 |
+
M. Hauschild and M. Pelikan. An introduction and survey of estimation of distribution algorithms. Swarm and Evolutionary Computation, 1(3):111–128, 2011.
|
| 129 |
+
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 ICLR, 2017.
|
| 130 |
+
J.J. Irwin and B.K. Shoichet. ZINC - a free database of commercially available compounds for virtual screening. Journal of Chemical Information and Modeling, 45(1):177–182, 2005.
|
| 131 |
+
A. Kadurin, S. Nikolenko, K. Khrabrov, A. Aliper, and A. Zhavoronkov. druGAN: An advanced generative adversarial autoencoder model for de novo generation of new molecules with desired molecular properties in silico. Molecular Pharmaceutics, 14:3098–3104, 2017.
|
| 132 |
+
D.P. Kingma and M. Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014.
|
| 133 |
+
G. Landrum. RDKit: Open-source cheminformatics, 2006. URL http://www.rdkit.org.
|
| 134 |
+
X.Q. Lewell, D.B. Judd, S.P. Watson, and M.M. Hann. RECAP - retrosynthetic combinatorial analysis procedure: a powerful new technique for identifying privileged molecular fragments with useful applications in combinatorial chemistry. Journal of Chemical Information and Computer Sciences, 38(3):511–522, 1998.
|
| 135 |
+
X. Li, I. Kiringa, T. Yeap, X. Zhu, and Y. Li. Anomaly detection based on unsupervised disentangled representation learning in combination with manifold learning. In International Joint Conference on Neural Networks, 2020.
|
| 136 |
+
S. Mandal, T.A. Anderson, J. Gottschlich, S. Zhou, and A. Muzahid. Learning fitness functions for genetic algorithms. arXiv Preprint, pp. arXiv:1908.08783, 2019.
|
| 137 |
+
T. Mikolov, K. Chen, G.S. Corrado, and J. Dean. Efficient estimation of word representations in vector space. In International Conference on Learning Representations, 2013.
|
| 138 |
+
L. Perez and J. Wang. The effectiveness of data augmentation in image classification using deep learning. arXiv Preprint, pp. arXiv:1712.04621, 2017.
|
| 139 |
+
M. Podda, D. Bacciu, and A. Micheli. A deep generative model for fragment-based molecule generation. In International Conference on Artificial Intelligence and Statistics, pp. 2240–2250, 2020.
|
| 140 |
+
M. Popova, O. Isayev, and A. Tropsha. Deep reinforcement learning for de novo drug design. Science Advances, 4:eaap7885, 2018.
|
| 141 |
+
R. Romez-Bombarelli, J.N. Wei, D. Duvenaud, J.M. Hernarndez-Lobato, B. Sanchez-Lengeling, D. Sheberla, J. Aguilera-Iparraguirre, T.D. Hirzel, R.P. Adams, and A. Aspuru-Guzik. Automatic chemical design using a data-driven continuous representation of molecules. ACS Central Science, 4:268–276, 2018.
|
| 142 |
+
T. Salimans, J. Ho, X. Chen, S. Sidor, and I. Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv Reprint, pp. arXiv:1703.03864, 2017.
|
| 143 |
+
R. Sennrich, B. Haddow, and A. Birch. Improving neural machine translation models with monolingual data. In ACL, 2016.
|
| 144 |
+
C. Shorten and T.M. Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 6:60, 2019.
|
| 145 |
+
S.B. Shuker, P.J. Hajduk, R.P. Meadows, and S.W. Fesik. Discovering high-affinity ligands for proteins: SAR by NMR. Science, 274(5292):11531–1534, 1996.
|
| 146 |
+
M. Simonovsky and N. Komodakis. GraphVAE: Towards generation of small graphs using variational autoencoders. In ICANN, pp. 412–422, 2018.
|
| 147 |
+
K.O. Stanley, J. Clune, J. Lehman, and R. Miikkulainen. Designing neural networks through neuroevolution. Nature Machine Intelligence, 1:24–30, 2019.
|
| 148 |
+
Y. Wang, S.H. Bryant, T. Cheng, J. Wang, A. Gindulyte, B.A. Shoemaker, P.A. Thiessen, S. He, and J. Zhang. PubChem BioAssay: 2017 update. Nucleic Acids Research, 45(D1):D955–D963, 2016.
|
| 149 |
+
J. Wei and K. Zou. EDA: Easy data augmentation techniques for boosting performance on text classification tasks. In EMNLP-IJCNLP, 2019.
|
| 150 |
+
D. Weininger. SMILES, a chemical language and information system. 1. introduction to methodology and encoding rules. Journal of Chemical Information and Computer Sciences, 28(1):31–36, 1988.
|
| 151 |
+
D. Wierstra, T. Schaul, T. Glasmachers, Y. Sun, J. Peters, and J. Schmidhuber. Natural evolution strategies. Journal of Machine Learning Research, 15(2014):949–980, 2014.
|
| 152 |
+
C. Yan, S. Wang, J. Yang, T. Xu, and J. Huang. Re-balancing variational autoencoder loss for molecule sequence generation. arXiv Preprint, pp. arXiv:1910.00698, 2020.
|
| 153 |
+
J. You, B. Liu, R. Ying, V. Pande, and J. Leskovec. Graph convolutional policy network for goaldirected molecular graph generation. In NeurIPS, 2018.
|
| 154 |
+
Z. Zhou, S. Kearnes, L. Li, R.N. Zare, and P. Riley. Optimization of molecules vis deep reinforcement learning. Scientific Reports, 9:10752, 2019.
|
| 155 |
+
|
| 156 |
+
# A APPENDIX
|
| 157 |
+
|
| 158 |
+
# A.1 DEL ALGORITHM
|
| 159 |
+
|
| 160 |
+
# Algorithm 1: DEL Algorithm
|
| 161 |
+
|
| 162 |
+
Inputs: $X _ { 0 }$ , $Y _ { 0 }$ : training samples and corresponding properties; Result: population of designed molecules; learned DGM; 1 for each evolutionary generation do 2 if first generation then 3 $X = X _ { 0 }$ ; $Y = Y _ { 0 }$ ; 4 Train DGM using $\{ X , Y \}$ ; // use all training data to learn DGM 5 $X , Y = \operatorname { s u b s e t } ( X , Y , M )$ ; // a subset of $M$ examples from the original training data 6 else 7 Train DGM using $\{ X , Y \}$ ; // use population to further train DGM 8 end 9 end 10 Z = Encoder $( X )$ ; // obtain latent representations of samples in $\boldsymbol { x }$ 11 $r , \mathcal { F } =$ nondominated sort $( Y )$ ; // $\pmb { r }$ : non-domination ranks, $\mathcal { F }$ : Pareto frontiers 12 $d =$ compute crowding distance $( Y , { \mathcal { F } } )$ ; 13 $Z ^ { \prime } = \operatorname { E v { \bar { O p } } } ( Z , r , d )$ ; // evolutionary operations: selection, recombination and mutation 14 X0 = Decoder $( Z ^ { \prime } )$ ; // generate novel samples 15 $\mathbf { Y } ^ { \prime } =$ get property $( X ^ { \prime } )$ ; // obtain properties of the generated samples using a simulator, e.g. RDKit 16 $\boldsymbol { X }$ , $\mathbf { Y } =$ form new population $( { \pmb X } , { \pmb Y } , { \pmb X } ^ { \prime } , { \pmb Y } ^ { \prime } , { \pmb M } )$ ; // keep the top $M$ good samples from the combination of $\{ X , Y \}$ and $\{ X ^ { \prime } , Y ^ { \prime } \}$ 17 end 18 Return X , Y , DGM
|
| 163 |
+
|
| 164 |
+
# A.2 BUG CORRECTION
|
| 165 |
+
|
| 166 |
+
In the VAE implementation by Podda et al. (2020), the incorrect use of view function makes the forward flow of information messed up among different samples in a batch.
|
| 167 |
+
|
| 168 |
+
Listing 1: Wrong use of view function in the original VAE model in (Podda et al., 2020). , s t a t e $=$ s e l f . r n n ( p a c k e d , s t a t e ) # n u m l a y e r s b y b a t c h b y h i d d e n s i z e −> b a t c h b y h i d d e n l a y e r \* h i d d e n s i z e s t a t e $=$ s t a t e . v i e w ( b a t c h s i z e , s e l f . h i d d e n s i z e \* s e l f . h i d d e n l a y e r s ) mean $=$ s e l f . r n n 2 m e a n ( s t a t e ) # mean : b a t c h b y l a t e n t s i z e l o g v a r $=$ s e l f . r n n 2 l o g v ( s t a t e ) # l o g v : b a t c h b y l a t e n t s i z e
|
| 169 |
+
|
| 170 |
+
Listing 2: Our correction.
|
| 171 |
+
|
| 172 |
+
s t a t e $=$ s e l f . r n n ( p a c k e d , s t a t e ) # n u m l a y e r s b y b a t c h b y h i d d e n s i z e −> b a t c h b y n u m l a y e r s b y h i d d e n s i z e s t a t e $=$ s t a t e . t r a n s p o s e $^ { ( 1 , 0 ) }$ s t a t e $=$ s t a t e . f l a t t e n ( s t a r t d i m $= 1$ ) # b a t c h b y h i d d e n l a y e r \* h i d d e n s i z e mean $=$ s e l f . r n n 2 m e a n ( s t a t e ) # mean : b a t c h b y l a t e n t s i z e l o g v a r $=$ s e l f . r n n 2 l o g v ( s t a t e ) # l o g v : b a t c h b y l a t e n t s i z e
|
| 173 |
+
|
| 174 |
+
# A.3 HYPERPARAMETER SETTING FOR FRAGVAE
|
| 175 |
+
|
| 176 |
+
When not specified in the main text, the following values of hyperparameters are used in experiments.
|
| 177 |
+
|
| 178 |
+
• size of the embedding layer: 128
|
| 179 |
+
|
| 180 |
+
• mask low-frequency fragments: Yes
|
| 181 |
+
• masking frequency: 2
|
| 182 |
+
• number of low frequency clusters: 5
|
| 183 |
+
• window for word2vec embedding: 3
|
| 184 |
+
• number of recurrent neurons per layer: 128
|
| 185 |
+
• number of recurrent layers: 2
|
| 186 |
+
• size of the VAE latent space: 64
|
| 187 |
+
• maximum length of the sampled sequence: 10
|
| 188 |
+
• batch size: 128
|
| 189 |
+
• shuffle batches: Yes
|
| 190 |
+
• number of epochs to train: 50
|
| 191 |
+
• learning rate: 0.0005
|
| 192 |
+
• dropout for the recurrent layers: 0.3
|
| 193 |
+
• annealing step size for the scheduler: 4
|
| 194 |
+
• annealing rate for the scheduler: 0.8
|
| 195 |
+
• threshold to clip the gradient norm: 5
|
| 196 |
+
• number of layers in MLP for properties: 2
|
| 197 |
+
• number of hidden units in each hidden layer of MLP: 64
|
| 198 |
+
• weight on property regression loss $( \alpha )$ : 1
|
| 199 |
+
• weight on KL divergence $( \beta )$ : {0.01, 0.1, 1}
|
| 200 |
+
|
| 201 |
+
A.4 HYPERPARAMETER SETTING FOR DEL
|
| 202 |
+
|
| 203 |
+
When not specified in the main text, the following values of hyperparameters are used in experiments.
|
| 204 |
+
|
| 205 |
+
• number of evolutionary generations: 10
|
| 206 |
+
• popularization size: {20000 (default), 100000}
|
| 207 |
+
• number of epochs in the initial training of DGM: 50
|
| 208 |
+
• annealing step size for the scheduler in initial training of DGM: 4
|
| 209 |
+
• annealing rate for the scheduler: 0.8
|
| 210 |
+
• number of epochs in a subsequent training of DGM: 30
|
| 211 |
+
• learning rate in the initial training of DGM: 0.0005
|
| 212 |
+
• annealing step size for the scheduler in initial training: 2
|
| 213 |
+
• probability in tournament selection: 0.95
|
| 214 |
+
• crossover method: {linear (default), discrete}
|
| 215 |
+
• mutation rate: 0.01
|
| 216 |
+
|
| 217 |
+
A.5 HYPERPARAMETER SETTING FOR MOBO
|
| 218 |
+
|
| 219 |
+
When not specified in the main text, the following values of hyperparameters are used in experiments.
|
| 220 |
+
|
| 221 |
+
• number of initial data points: 1000
|
| 222 |
+
• number of batches: 30
|
| 223 |
+
• batch size: 8
|
| 224 |
+
• number of MC samples: 128
|
| 225 |
+
|
| 226 |
+
A.6 ADDITIONAL TABLES
|
| 227 |
+
|
| 228 |
+
Table 2: Performance of FragVAE in comparison with existing methods.
|
| 229 |
+
|
| 230 |
+
<table><tr><td>Model</td><td>Data</td><td>Validity (SMILES)</td><td>Validity (Fragments)</td><td>Novelty</td><td>Diversity</td></tr><tr><td>ChemVAE GrammarVAE SDVAE GraphVAE CGVAE</td><td>ZINC ZINC ZINC ZINC ZINC</td><td>0.170 0.310 0.435 0.140 1.000</td><td></td><td>0.980 1.000 = 1.000 1.000</td><td>0.310 0.108 1 0.316 0.998</td></tr><tr><td>NeVAE FragVAE (β=1.00)</td><td>ZINC ZINC</td><td>1.000 1.000</td><td>■ 0.922</td><td>0.999 1.000</td><td>1.000 0.961</td></tr><tr><td>FragVAE (β=0.10)</td><td>ZINC</td><td>1.000</td><td>0.953</td><td>0.999</td><td>0.985</td></tr><tr><td>FragVAE(β=0.01)</td><td>ZINC</td><td>1.000</td><td>0.655</td><td>0.997</td><td>0.809</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>FragVAE (β=1.00)</td><td>PCBA</td><td>1.000</td><td>0.443</td><td>1.000</td><td>0.925</td></tr><tr><td>FragVAE (β=0.10)</td><td>PCBA</td><td>1.000</td><td>0.481</td><td>0.983</td><td>0.886</td></tr><tr><td></td><td>PCBA</td><td>1.000</td><td>0.777</td><td>0.997</td><td></td></tr><tr><td>FragVAE (β=0.01)</td><td></td><td></td><td></td><td></td><td>0.632</td></tr></table>
|
| 231 |
+
|
| 232 |
+
Table 3: Running time of DEL and MOBO. Since both methods involve training FragVAE, the FragVAE training time was not counted in this table. Format: Hours:Minutes:Seconds. Note: when $\beta$ is annealed to 0.4 in DEL, $\alpha$ is annealed from 1 to 4. All experiments were carried out on a Dell Precision 5820 Workstation equipped with an Intel Xeon W-2255 CPU (10C), RAM of 128GB, and a Nvidia Quadro RTX 6000 (24GB) GPU.
|
| 233 |
+
|
| 234 |
+
<table><tr><td rowspan=1 colspan=1>Data</td><td rowspan=1 colspan=1>DEL Hyperparameter</td><td rowspan=1 colspan=1>DEL</td><td rowspan=1 colspan=1>MOBO</td></tr><tr><td rowspan=1 colspan=1>ZINCZINC</td><td rowspan=1 colspan=1>β=0.1→0.4β = 0.01 → 0.4</td><td rowspan=1 colspan=1>3:03:493:08:09</td><td rowspan=1 colspan=1>25:23:01141:49:37</td></tr><tr><td rowspan=1 colspan=1>PCBAPCBA</td><td rowspan=1 colspan=1>β=0.1→0.4β = 0.01 → 0.4</td><td rowspan=1 colspan=1>3:01:321:50:20</td><td rowspan=1 colspan=1>31:16:1845:31:38</td></tr></table>
|
| 235 |
+
|
| 236 |
+
Table 4: Non-dominated sorting of combination of Pareto fronts from DEL with and without property prediction (PP) component as latent space regularization.
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>Pareto Front Size for Comparison</td><td rowspan=1 colspan=2>InNewPareto Front</td></tr><tr><td rowspan=1 colspan=1>Data</td><td rowspan=1 colspan=1>DELParameter</td><td rowspan=1 colspan=1>With PP</td><td rowspan=1 colspan=1>Without PP</td><td rowspan=1 colspan=1>With PP</td><td rowspan=1 colspan=1>Without PP</td></tr><tr><td rowspan=1 colspan=1>ZINCPCBA</td><td rowspan=1 colspan=1>β=0.1β=0.1</td><td rowspan=1 colspan=1>235224</td><td rowspan=1 colspan=1>234108</td><td rowspan=1 colspan=1>206 (87.66%)216 (96.43%)</td><td rowspan=1 colspan=1>0(0%)0(0%)</td></tr></table>
|
| 239 |
+
|
| 240 |
+
Table 5: Non-dominated sorting of combination of Pareto fronts from DEL with and without DGM finetuning (FT) phrase.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>Pareto Front Size for Comparison</td><td rowspan=1 colspan=2>In New Pareto Front</td></tr><tr><td rowspan=1 colspan=1>Data</td><td rowspan=1 colspan=1>DEL Parameter</td><td rowspan=1 colspan=1>With FT</td><td rowspan=1 colspan=1>Without FT</td><td rowspan=1 colspan=1>With FT</td><td rowspan=1 colspan=1>Without FT</td></tr><tr><td rowspan=1 colspan=1>ZINCPCBA</td><td rowspan=1 colspan=1>β=0.1β=0.1</td><td rowspan=1 colspan=1>235224</td><td rowspan=1 colspan=1>193214</td><td rowspan=1 colspan=1>235 (100%)199 (88.84%)</td><td rowspan=1 colspan=1>0 (0%)0(0%)</td></tr></table>
|
| 243 |
+
|
| 244 |
+
Table 6: Non-dominated sorting of combination of Pareto fronts from DEL with linear or discrete crossover operation. Note: when $\beta$ is annealed to 0.4, $\alpha$ is annealed from 1 to 4.
|
| 245 |
+
|
| 246 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>Pareto Front Size for Comparison</td><td rowspan=1 colspan=2>InNewPareto Front</td></tr><tr><td rowspan=1 colspan=1>Data</td><td rowspan=1 colspan=1>DEL Parameter</td><td rowspan=1 colspan=1>Linear</td><td rowspan=1 colspan=1>Discrete</td><td rowspan=1 colspan=1>Linear</td><td rowspan=1 colspan=1>Discrete</td></tr><tr><td rowspan=1 colspan=1>ZINCPCBA</td><td rowspan=1 colspan=1>β=0.01→0.4β = 0.01 → 0.4</td><td rowspan=1 colspan=1>200183</td><td rowspan=1 colspan=1>181195</td><td rowspan=1 colspan=1>196 (98.00%)146 (79.78%)</td><td rowspan=1 colspan=1>173 (95.58%)184 (94.36%)</td></tr></table>
|
| 247 |
+
|
| 248 |
+
A.7 ADDITIONAL FIGURES
|
| 249 |
+
|
| 250 |
+
Table 7: Non-dominated sorting of combination of Pareto fronts from DEL with population sizes of 20K and 100K. Note: when $\beta$ is annealed to 0.4, $\alpha$ is annealed from 1 to 4.
|
| 251 |
+
|
| 252 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>Pareto Front Size for Comparison</td><td rowspan=1 colspan=2>In New Pareto Front</td></tr><tr><td rowspan=1 colspan=1>Data</td><td rowspan=1 colspan=1>DEL Parameter</td><td rowspan=1 colspan=1>20K</td><td rowspan=1 colspan=1>100K</td><td rowspan=1 colspan=1>20K</td><td rowspan=1 colspan=1>100K</td></tr><tr><td rowspan=1 colspan=1>ZINCPCBA</td><td rowspan=1 colspan=1>β=0.1→0.4β= 0.1 → 0.4</td><td rowspan=1 colspan=1>243228</td><td rowspan=1 colspan=1>316354</td><td rowspan=1 colspan=1>78 (32.10%)88 (38.60%)</td><td rowspan=1 colspan=1>304 (96.20%)334 (94.35%)</td></tr></table>
|
| 253 |
+
|
| 254 |
+
Table 8: Non-dominated sorting of combination Pareto fronts from DEL with different values of $\beta$ Note: when $\beta$ is annealed to 0.4, $\alpha$ is annealed from 1 to 4. Population size: 20K.
|
| 255 |
+
|
| 256 |
+
<table><tr><td></td><td colspan="4">Pareto Front Size for Comparison</td><td colspan="4">In New Pareto Front</td></tr><tr><td>Data</td><td></td><td></td><td></td><td>β=0.1β=0.1→0.4β=0.01β=0.01→0.4</td><td>β=0.1</td><td>β=0.1→0.4</td><td>β=0.01</td><td>β=0.01→0.4</td></tr><tr><td>ZINC</td><td>235</td><td>243</td><td>228</td><td>200</td><td>195(82.98%)</td><td>186(76.54%)</td><td>170(74.56%)</td><td>143(71.50%)</td></tr><tr><td>PCBA</td><td>224</td><td>228</td><td>189</td><td>183</td><td>169(75.45%)</td><td>183(80.26%)</td><td>122(64.55%)</td><td>111(60.66%)</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Table 9: Numbers of novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the 1st, 5th and final (10th) generations of DEL. Numbers of training molecules satisfying same conditions are also given. Note: when $\beta$ is annealed to 0.4, $\alpha$ is annealed from 1 to 4.
|
| 259 |
+
|
| 260 |
+
<table><tr><td>Data</td><td>Hyperparameter</td><td>Train</td><td>DEL(1)</td><td>DEL(5)</td><td>DEL(F)</td></tr><tr><td>ZINC</td><td>β=0.1</td><td>406</td><td>226</td><td>14</td><td>40</td></tr><tr><td>ZINC ZINC</td><td>β= 0.1 → 0.4</td><td>-</td><td></td><td>22</td><td>32</td></tr><tr><td></td><td>β =0.01</td><td>-</td><td></td><td>54</td><td>115</td></tr><tr><td>ZINC</td><td>β = 0.01 →0.4</td><td>1</td><td>3</td><td>9</td><td>20</td></tr><tr><td>PCBA</td><td>β 三 :0.1</td><td>196</td><td>4</td><td>13</td><td>27</td></tr><tr><td>PCBA</td><td>β 三 0.1→ 0.4</td><td>1</td><td>10</td><td>33</td><td>52</td></tr><tr><td>PCBA</td><td>β =0.01</td><td></td><td>0</td><td>8</td><td>16</td></tr><tr><td>PCBA</td><td>β= 0.01 → 0.4</td><td>=</td><td>4</td><td>9</td><td>10</td></tr></table>
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 6: Different of forms of the $\beta$ -function. The total number of epochs is $T = 1 0 0$ .
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 7: Loss of FragVAE in initial training on ZINC and PCBA respectively.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 8: Loss of of FragVAE in DEL on ZINC and PCBA respectively.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 9: ZINC training molecules that satisfy properties QED≥ 0.88, $\mathrm { S A S } { \le } \ 3$ , and $\mathrm { l o g P \le 1 }$ . Note: 196 molecules satisfy these conditions, but 64 are visualized.
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 10: PCBA training molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ . Note: 406 molecules satisfy these conditions, but 64 are visualized.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 11: Novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on ZINC with hyperparameter: $\beta = 0 . 1$ , $\alpha = 1$ .
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 12: Novel molecules that satisfy properties QE $\mathrm { D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on ZINC with hyperparameter: $\beta = 0 . 1 0 . 4$ , $\alpha = 1 4$ .
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 13: Novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on ZINC with hyperparameter: $\beta = 0 . 0 1$ , $\alpha = 1$ .
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 14: Novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8 , \mathrm { S A S } \leq 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on ZINC with hyperparameter: $\beta = 0 . 0 1 0 . 4$ , $\alpha = 1 4$ .
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 15: Novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8 , \mathrm { S A S } \leq 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on PCBA with hyperparameter: $\beta = 0 . 1$ , $\alpha = 1$ .
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 16: Novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on PCBA with hyperparameter: $\beta = 0 . 1 \to 0 . 4$ , $\alpha = 1 4$ .
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 17: Novel molecules that satisfy properties QE $\mathrm { D \geq 0 . 8 8 }$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on PCBA with hyperparameter: $\beta = 0 . 0 1$ , $\alpha = 1$ .
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 18: Novel molecules that satisfy properties $\mathrm { Q E D } \geq 0 . 8 8$ , $\mathrm { S A S } \le 3$ , and $\mathrm { l o g P \le 1 }$ in the final generation of DEL trained on PCBA with hyperparameter: $\beta = 0 . 0 1 0 . 4$ , $\alpha = 1 4$ .
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 19: Property and structural feature distributions of population samples during DEL $\beta = 0 . 1$ ).
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 20: Property and structural feature distributions of population samples during DEL $\beta =$ $0 . 1 0 . 4$ ).
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 21: Property and structural feature distributions of population samples during DEL $\beta =$ 0.01).
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 22: Property and structural feature distributions of randomly sampled molecules using FragVAE during DEL $\beta = 0 . 1 $ ).
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 23: Property and structural feature distributions of randomly sampled molecules using FragVAE during DEL $\beta = 0 . 1 0 . 4$ ).
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 24: Property and structural feature distributions of randomly sampled molecules using FragVAE during DEL ( $\beta = 0 . 0 1$ ).
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 25: Property and structural feature distributions of randomly sampled molecules using FragVAE during DEL $\beta = 0 . 0 1 0 . 4$ ).
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 26: Hypervolume along batches when running Sobol random search, qParEGO, and qEHVI.
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
Figure 27: Pareto fronts of DEL and MOBO algorithms $\beta = 0 . 1 $ . In the legend, the last batch of qParEGO or qEHVI is written as Front 1.
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 28: Validity, novelty and diversity of population samples (after evolutionary operations and before merging with previous population) in different variants of DEL.
|
md/train/GrB-y0SNkQ/GrB-y0SNkQ.md
ADDED
|
@@ -0,0 +1,636 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CobBO: Coordinate Backoff Bayesian Optimization with Two-Stage Kernels
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Bayesian optimization is a popular method for optimizing expensive black-box
|
| 11 |
+
2 functions. Yet it oftentimes struggles in high dimensions where the computation
|
| 12 |
+
3 could be prohibitively expensive and a sufficient estimation of the global landscape
|
| 13 |
+
4 requires more observations. We introduce Coordinate backoff Bayesian optimiza
|
| 14 |
+
5 tion (CobBO) with two-stage kernels to alleviate this problem. In each iteration, a
|
| 15 |
+
6 promising subset of coordinates is selected in the first stage, as past observed points
|
| 16 |
+
7 in the full space are projected to the selected subspace adopting a simple kernel
|
| 17 |
+
8 that sacrifices the approximation accuracy for computational efficiency. Then in
|
| 18 |
+
9 the second stage of the same iteration a more sophisticated kernel is applied for
|
| 19 |
+
10 estimating the landscape in the selected low dimensional subspace where the com
|
| 20 |
+
11 putational cost becomes affordable. Effectively, this second stage kernel refines the
|
| 21 |
+
12 approximation of the global landscape estimated by the first stage kernel through
|
| 22 |
+
13 a sequence of observations in the local subspace. This refinement lasts until a
|
| 23 |
+
14 stopping rule is met determining when to back off from a certain subspace and
|
| 24 |
+
15 switch to another coordinate subset. This decoupling significantly reduces the com
|
| 25 |
+
16 putational burden in high dimensions, while the two-stage kernels of the Gaussian
|
| 26 |
+
17 process regressions fully leverage the observations in the whole space rather than
|
| 27 |
+
18 only relying on observations in each coordinate subspace. Extensive evaluations
|
| 28 |
+
19 show that CobBO finds solutions comparable to or better than other state-of-the-art
|
| 29 |
+
20 methods for dimensions ranging from tens to hundreds, while reducing the trial
|
| 30 |
+
21 complexity and computational costs.
|
| 31 |
+
|
| 32 |
+
# 22 1 Introduction
|
| 33 |
+
|
| 34 |
+
Bayesian optimization (BO) has emerged as an effective zero-order paradigm for optimizing expensive black-box functions. The entire sequence of iterations rely only on the function values of the already queried points without information on their derivatives. Though highly competitive in low dimensions (e.g., the dimension $D \leq 2 0$ [15]), Bayesian optimization based on Gaussian Process (GP) regression has obstacles that impede its effectiveness, especially in high dimensions.
|
| 35 |
+
|
| 36 |
+
Approximation accuracy: GP regression assumes a class of random functions in a probability space as surrogates that iteratively yield posterior distributions by conditioning on the queried points. When suggesting new query points, for complex functions with numerous local optima and saddle points due to local fluctuations, always exactly using the values on the queried points as the conditional events may mismatch the function’s local landscape by overemphasizing the approximation accuracy of the global landscape.
|
| 37 |
+
|
| 38 |
+
Curse of dimensionality: As a sample efficient method, Bayesian optimization often suffers from high dimensions. Fitting the GP model (estimating the parameters, e.g., length_scales [14]), computing the Gaussian process posterior and optimizing the acquisition function in high dimensions all
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 1: Minimize the fluctuated Rastrigin function on $[ - 5 , 1 0 ] ^ { 5 0 }$ with 20 initial samples. [Left] Computation times for training the GP regression model and maximizing the acquisition function at each iteration. CobBO significantly reduces the execution time compared with a vanilla BO, e.g. $\times 1 3$ faster in this case. [Right] The average error between the GP predictions before making queries and the true function values at the queried points (solid curves, the higher the better) and the best observed function value (dashed curves, the lower the better) at iteration $t$ . CobBO captures the global landscape less accurately using the RBF kernel, and then explores selected subspaces $\Omega _ { t }$ more accurately using the Matern kernel. This eventually better exploits the promising subspaces.
|
| 42 |
+
|
| 43 |
+
39 incur large computational costs. It also results in statistical insufficiency of exploration [11, 65]. As
|
| 44 |
+
40 the GP regression’s error grows with dimensions [8], more samples are required to balance that in
|
| 45 |
+
41 high dimensions, which could cubically increase the computational costs in the worst case [45].
|
| 46 |
+
42 To alleviate these issues, we design coordinate backoff Bayesian optimization (CobBO) with two
|
| 47 |
+
43 stage kernels, by challenging a seemingly natural intuition stating that it is always better for Bayesian
|
| 48 |
+
44 optimization to have a more accurate approximation of the objective function at all times. We
|
| 49 |
+
45 demonstrate that this is not necessarily true, by showing that smoothing out local fluctuations and
|
| 50 |
+
46 using the estimated function values instead of the true observations to serve as the conditional events
|
| 51 |
+
47 in selected subspaces can not only significantly reduce the computation time due to the curse of
|
| 52 |
+
48 dimensionality but also help in capturing the large-scale properties of the objective function $f ( x )$ .
|
| 53 |
+
49 Specifically, CobBO introduces the two-stage kernels with a stopping rule. The first stage of each
|
| 54 |
+
50 iteration adopts a simple kernel that sacrifices the approximation accuracy of $f ( x )$ for computational
|
| 55 |
+
51 efficiency. For example, by using a universal radial basis function (RBF) approximation without
|
| 56 |
+
52 learnable parameters [50], CobBO can eliminate the model fitting time in the full space. It captures
|
| 57 |
+
53 a smooth approximation ${ \hat { f } } ( x )$ of the global landscape by interpolating the values of queried points
|
| 58 |
+
54 projected to selected promising subspaces. These projected points serve as the conditional events
|
| 59 |
+
55 for GP regression. In a selected coordinate subspace, the second stage of the same iteration applies
|
| 60 |
+
56 a sophisticated kernel that can tolerate high computational cost in low dimensions. For example,
|
| 61 |
+
57 CobBO uses the Automatic Relevance Determination (ARD) Matérn 5/2 kernel [40]. It refines the
|
| 62 |
+
58 approximation of the local landscape by a sequence of observations determined by a stopping rule that
|
| 63 |
+
59 backs off from a certain subspace and switches to another coordinate subset. In addition, computing
|
| 64 |
+
60 the Gaussian process posterior and optimizing the acquisition function are both efficiently conducted
|
| 65 |
+
61 in the low dimensional subspaces, bypassing the curse of dimensionality.
|
| 66 |
+
62 For iteration $t$ , instead of directly computing the Gaussian process posterior distribution
|
| 67 |
+
63 $\left\{ \hat { f } ( x ) \middle | \mathcal { H } _ { t } = \left\{ ( x _ { i } , y _ { i } ) \right\} _ { i = 1 } ^ { t } , x \in \Omega \right\}$ by conditioning on the observations $y _ { i } = f ( x _ { i } )$ at queried
|
| 68 |
+
64 points $x _ { i }$ in the full space $\Omega \subset \mathbb { R } ^ { D }$ for $i = 1 , \ldots , t$ , we change the conditional events, and consider
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\left\{ \hat { f } ( x ) \Big | R \left( P _ { \Omega _ { t } } ( x _ { 1 } , \dots , x _ { t } ) , \mathcal { H } _ { t } \right) , x \in \Omega _ { t } , \Omega _ { t } \subset \Omega \right\}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
65 for a projection function $P _ { \Omega _ { t } } ( \cdot )$ to a random subspace $\Omega _ { t }$ and an interpolation function $R ( \cdot , \cdot )$ , e.g.,
|
| 75 |
+
66 using a RBF approximation without learnable parameters [50] as the simple kernel for the first
|
| 76 |
+
67 stage. The projection $P _ { \Omega _ { t } } ( \cdot )$ maps the queried points to virtual points on a subspace $\Omega _ { t }$ of a lower
|
| 77 |
+
68 dimension [51]. The interpolation function $R ( \cdot , \cdot )$ estimates the objective values at the virtual points
|
| 78 |
+
69 using the queried points and their values as specified by $\mathcal { H } _ { t }$ . The second stage within the subspace $\Omega _ { t }$
|
| 79 |
+
70 uses the more sophisticated kernel, e.g., Matérn $5 / 2$ kernel [40], which has a number of parameters
|
| 80 |
+
71 that otherwise would be expensive to be learned in high dimensions.
|
| 81 |
+
72 This method can be viewed as a variant of block coordinate ascent tailored to Bayesian optimization by
|
| 82 |
+
73 applying backoff stopping rules for switching coordinate blocks. While similar work exists [43, 48],
|
| 83 |
+
74 CobBO differs by introducing the two-stage kernels and addressing the following three issues:
|
| 84 |
+
|
| 85 |
+
1. Selecting a block of coordinates for ascending requires determining the block size as well as the coordinates therein. CobBO selects the coordinate subsets by a multiplicative weights update method [2] to the preference probability associated with each coordinate. Thus, it samples more promising subspaces with higher probabilities.
|
| 86 |
+
2. A coordinate subspace requires a sufficient number of query points acting as the conditional events for the GP regression. CobBO leverages all observations in the whole space by interpolating the values of queried points projected to selected promising subspaces, rather than simply starting from scratch in each subspace.
|
| 87 |
+
3. Querying a certain subspace, under some trial budget, comes at the expense of exploring other coordinate blocks. Yet prematurely shifting to different subspaces does not fully exploit the full potential of a given subspace. Hence determining the number of consecutive function queries within a subspace makes a trade-off between exploration and exploitation. CobBO uses a stopping rule in each subspace to switch the selected coordinates. When consecutively querying data points in the same subspace, CobBO does not need to conduct the first-stage function approximation in the full space, which is far more efficient.
|
| 88 |
+
|
| 89 |
+
90 Through comprehensive evaluations, CobBO demonstrates appealing performance for dimensions
|
| 90 |
+
91 ranging from tens to hundreds. It obtains comparable or better solutions with fewer queries, in
|
| 91 |
+
92 comparison with the state-of-the-art methods, for most of the problems tested in Section 4.2.
|
| 92 |
+
|
| 93 |
+
# 2 Related work
|
| 94 |
+
|
| 95 |
+
94 Certain assumptions are often imposed on the latent structure in high dimensions. Typical assumptions
|
| 96 |
+
95 include low dimensional structures and additive structures. Their advantages manifest on problems
|
| 97 |
+
96 with a low dimension or a low effective dimension. However, these assumptions do not necessarily
|
| 98 |
+
97 hold for non-separable functions with no redundant dimensions.
|
| 99 |
+
98 Low dimensional structure: The black-box function $f$ is assumed to have a low effective dimen
|
| 100 |
+
99 sion [30, 58], e.g., $f ( x ) = g ( \Phi x )$ with some function $g ( \cdot )$ and a matrix $\Phi$ of $d \times D , d < < D$ . A
|
| 101 |
+
100 number of different methods have been developed, including random embedding [66, 11, 63, 36,
|
| 102 |
+
101 44, 70, 5, 32], low-rank matrix recovery [11, 58], and learning subspaces by derivative informa
|
| 103 |
+
102 tion [11, 13]. In contrast to existing work on subspace selections, e.g., Hashing-enhanced Subspace
|
| 104 |
+
103 BO (HeSBO) [44], Mahalanobis kernel for linear embeddings [33], DROPOUT [35] and LineBO [29]
|
| 105 |
+
104 (which receives a special treatment in Appendix F), CobBO efficiently leverages all the observations
|
| 106 |
+
105 in the whole space using the two-stage kernels and the stopping rule in each subspace for consecutive
|
| 107 |
+
106 observations, rather than only relying on limited observations in each coordinate subspace. It exploits
|
| 108 |
+
107 subspace structure from a perspective of block coordinate ascent, independent of the dimensions,
|
| 109 |
+
108 different from some algorithms that are more suitable for low dimensions, e.g., BADS [1].
|
| 110 |
+
109 Additive structure: A decomposition assumption is often made by $\begin{array} { r } { f ( x ) = \sum _ { i = 1 } ^ { k } f ^ { ( i ) } \left( x _ { i } \right) } \end{array}$ , with $x _ { i }$
|
| 111 |
+
110 defined over low-dimensional components. In this case, the effective dimensionality of the model is
|
| 112 |
+
111 the largest dimension among all additive groups [45], which is usually small. The Gaussian process
|
| 113 |
+
112 is structured as an additive model [17, 28], e.g., projected-additive functions [36], ensemble Bayesian
|
| 114 |
+
113 optimization (EBO) [61], latent additive structural kernel learning (HDBBO) [65] and group additive
|
| 115 |
+
114 models [28, 36]. However, learning the unknown structure incurs a considerable computational
|
| 116 |
+
115 cost [44], and is not applicable for non-separable functions, for which CobBO can still be applied.
|
| 117 |
+
116 Trust regions and space partitions: Trust region BO has been proven effective for high-dimensional
|
| 118 |
+
117 problems. A typical pattern is to alternate between global and local search regions. In the local
|
| 119 |
+
118 trust regions, many efficient methods have been applied, e.g., local Gaussian models (TurBO [14]),
|
| 120 |
+
119 adaptive search on a mesh grid (BADS [1]) or quasi-Newton local optimization (BLOSSOM [41]).
|
| 121 |
+
120 TurBO [14] uses Thompson sampling to allocate samples across multiple regions. A related method is
|
| 122 |
+
121 to use space partitions, e.g., LA-MCTS[60] on a Monte Carlo tree search algorithm to learn efficient
|
| 123 |
+
122 partitions. CobBO differs by selecting low dimensional subspaces. It can also incorporate trust
|
| 124 |
+
123 regions in the first-stage global approximation, as shown in the Appendix.
|
| 125 |
+
125 Without loss of generality, suppose that the goal is to solve a maximization problem $\boldsymbol { x } ^ { * } =$
|
| 126 |
+
126 $\mathrm { { r g m a x } } _ { x \in \Omega } f ( x )$ for a black-box function $f : \Omega \mathbb { R }$ . The domain is normalized $\Omega = [ 0 , 1 ] ^ { D }$
|
| 127 |
+
127 with the coordinates indexed by $I = \{ 1 , 2 , \cdots , D \}$ .
|
| 128 |
+
128 For a sequence of points $\mathcal { X } _ { t } = \{ x _ { 1 } , x _ { 2 } , \cdot \cdot \cdot , x _ { t } \}$ with $t$ indexing the most recent iteration, we observe
|
| 129 |
+
129 $\mathcal { H } _ { t } = \{ ( x _ { i } , y _ { i } = f ( x _ { i } ) ) \} _ { i = 1 } ^ { t }$ . A random subset $C _ { t } \subseteq I$ of the coordinates is selected, forming a
|
| 130 |
+
130 subspace $\Omega _ { t } \subseteq \Omega$ at iteration $t$ . As a variant of coordinate ascent, the subspace $\Omega _ { t }$ contains a pivot
|
| 131 |
+
131 point $V _ { t }$ , which presumably is the maximum point $x _ { t } ^ { M } = \operatorname { a r g m a x } _ { x \in \mathcal { X } _ { t } } { f ( x ) }$ with $M _ { t } = f \left( { { \dot { x } } _ { t } } ^ { M } \right)$ .
|
| 132 |
+
132 CobBO may set $V _ { t }$ different from $x _ { t } ^ { M }$ to escape local optima. Then, BO is conducted within $\Omega _ { t }$ while
|
| 133 |
+
133 fixing all the other coordinates $C _ { t } ^ { c } \bar { = } I \setminus C _ { t }$ , i.e., the complement of $C _ { t }$ .
|
| 134 |
+
|
| 135 |
+
# $\overline { { \mathbf { A l g o r i t h m 1 : C o b B O ( f , \boldsymbol { \tau } , T ) } } }$
|
| 136 |
+
|
| 137 |
+
1 $\mathcal { H } _ { \tau } \gets \mathrm { s a m p l e } ~ $ $\tau$ initial points and evaluate their values
|
| 138 |
+
2 $V _ { \tau } , M _ { \tau } \gets$ Find the tuple with the maximal objective value in $\mathcal { H } _ { \tau }$
|
| 139 |
+
3 $q _ { \tau } \gets 0$ Initialize the number of consecutive failed queries
|
| 140 |
+
4 $\pi _ { \tau } $ Initialize a uniform preference distribution on the coordinates
|
| 141 |
+
5 for $t \tau$ to $T$ do 6 if switch $\Omega _ { t - 1 }$ by the backoff stopping rule (Section 3.2) then 7 $C _ { t } \gets$ Sample a promising coordinate block according to $\pi _ { t }$ (Section 3.1) 8 $\Omega _ { t } \gets$ Take the subspace of $\Omega _ { t }$ over the coordinate block $C _ { t }$ , such that $V _ { t } \in \Omega _ { t }$ 9 else
|
| 142 |
+
10 $\Omega _ { t } \gets \Omega _ { t - 1 }$
|
| 143 |
+
11 $\hat { \mathcal { X } } _ { t } \gets P _ { \Omega _ { t } } ( \mathcal { X } _ { t } )$ hProject $\mathcal { X } _ { t }$ onto $\Omega _ { t }$ to obtain a set of virtual points (Eq. 1)i
|
| 144 |
+
12 $\hat { \mathcal { H } } _ { t } \gets R \left( \hat { \mathcal { X } } _ { t } , \bar { \mathcal { H } } _ { t } \right)$ hSmooth function values on $\hat { \mathcal { X } } _ { t }$ by interpolation using $\mathcal { H } _ { t }$ i
|
| 145 |
+
13 $p \left[ \hat { f } _ { \Omega _ { t } } ( x ) | \hat { \mathcal { H } } _ { t } \right] \gets \mathbf { C } \mathbf { \tau }$ ompute the posterior distribution of the Gaussian process in $\Omega _ { t }$ conditional on $\hat { \mathcal { H } } _ { t }$
|
| 146 |
+
14 $\begin{array} { r } { x _ { t + 1 } \gets \mathrm { a r g m a x } _ { x \in \Omega _ { t } } Q _ { \hat { f } \sim p ( \hat { f } | \hat { \mathcal { H } } _ { t } ) } ( x | \hat { \mathcal { H } } _ { t } ) \ \Big [ } \end{array}$ Suggest the next query in $\Omega _ { t }$ (Section 3)i
|
| 147 |
+
15 $y _ { t + 1 } \gets$ Evaluate the black-box function $y _ { t + 1 } = f ( x _ { t + 1 } )$
|
| 148 |
+
16 if $y _ { t + 1 } > M _ { t }$ then
|
| 149 |
+
17 $| \quad V _ { t + 1 } \gets x _ { t + 1 } , M _ { t + 1 } \gets y _ { t + 1 } , q _ { t + 1 } \gets 0$
|
| 150 |
+
18 else
|
| 151 |
+
19 $V _ { t + 1 } V _ { t }$ , $M _ { t + 1 } \gets M _ { t }$ , $q _ { t + 1 } \gets q _ { t } + 1$
|
| 152 |
+
20 $\pi _ { t + 1 } $ Update $\pi _ { t }$ by a multiplicative weights update method (Eq. 2)
|
| 153 |
+
21 $\mathcal { H } _ { t + 1 } \bar { \mathcal { H } } _ { t } \bigcup \{ ( x _ { t + 1 } , y _ { t + 1 } ) \} , \mathcal { X } _ { t + 1 } \bar { \mathcal { X } } _ { t } \bigcup \{ x _ { t + 1 } \}$
|
| 154 |
+
22 end
|
| 155 |
+
|
| 156 |
+
For BO in 134 $\Omega _ { t }$ , we use Gaussian processes as the random surrogates $\hat { f } = \hat { f } _ { \Omega _ { t } } ( x )$ to describe the 135 Bayesian statistics of $f ( x )$ for $x \in \Omega _ { t }$ . At each iteration, the next query point is generated by solving
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\begin{array} { r } { x _ { t + 1 } = \mathrm { a r g m a x } _ { x \in \Omega _ { t } , V _ { t } \in \Omega _ { t } } Q _ { \hat { f } _ { \Omega _ { t } } ( x ) \sim p ( \hat { f } | \mathcal { H } _ { t } ) } ( x | \mathcal { H } _ { t } ) , } \end{array}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
136 where the acquisition function $Q ( x | \mathcal { H } _ { t } )$ incorporates the posterior distribution of the Gaussian
|
| 163 |
+
137 processes $p ( \hat { f } | \mathcal { H } _ { t } )$ . Typical acquisition functions include the expected improvement (EI) [42, 27],
|
| 164 |
+
138 the upper confidence bound (UCB) [3, 54, 55], the entropy search [24, 25, 64], and the knowledge
|
| 165 |
+
139 gradient [16, 53, 69].
|
| 166 |
+
|
| 167 |
+
Instead of directly computing the posterior distribution 140 $p ( \hat { f } | \mathcal { H } _ { t } )$ , we replace the conditional events 141 $\mathcal { H } _ { t }$ by
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\hat { \mathcal { H } } _ { t } : = R \left( P _ { \Omega _ { t } } \left( \mathcal { X } _ { t } \right) , \mathcal { H } _ { t } \right) = \left\{ \left( \hat { x } _ { i } , \hat { y } _ { i } \right) \right\} _ { i = 1 } ^ { t }
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
with an interpolation function 142 $R ( \cdot , \cdot )$ and a projection function $P _ { \Omega _ { t } } ( \cdot )$ ,
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
P _ { \Omega _ { t } } ( x ) ^ { ( j ) } = { \left\{ \begin{array} { l l } { x ^ { ( j ) } } & { { \mathrm { i f ~ } } j \in C _ { t } } \\ { V _ { t } ^ { ( j ) } } & { { \mathrm { i f ~ } } j \not \in C _ { t } } \end{array} \right. }
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
143 at coordinate $j$ . It simply keeps the values of $x$ whose corresponding coordinates are in $C _ { t }$ and
|
| 180 |
+
144 replaces the rest by the corresponding values of $V _ { t }$ , as illustrated in Fig. 2.
|
| 181 |
+
145 Applying $P _ { \Omega _ { t } } ( \cdot )$ on $\mathcal { X } _ { t }$ and discarding duplicates generate a new set of distinct virtual points $\hat { \mathcal { X } } _ { t } =$
|
| 182 |
+
146 $\{ \hat { x } _ { 1 } , \hat { x } _ { 2 } , \hat { x } _ { 3 } , \cdot \cdot \cdot , \hat { x } _ { \hat { t } } \}$ , $\hat { x } _ { i } \in \Omega _ { t } \forall 1 \leq i \leq \hat { t } \leq t$ . The function values at $\hat { x } _ { i } \in \hat { \mathcal X } _ { t }$ are interpolated as
|
| 183 |
+
147 $\hat { y } _ { i } = R ( \hat { x } _ { i } , \mathcal { H } _ { t } )$ using the standard radial basis function [6, 7] and the observed points in $\mathcal { H } _ { t }$ . It not
|
| 184 |
+
148 only significantly reduces the GP regression time due to the efficiency of RBF [6] and the acquisition
|
| 185 |
+
149 function optimization in low dimensions [11], but also eventually improves the model accuracy using
|
| 186 |
+
150 the more sophisticated kernel applied on $\Omega _ { t }$ .
|
| 187 |
+
151 Note that only a fraction of the points in $\hat { \mathcal X } _ { t } \cap \mathcal X _ { t }$
|
| 188 |
+
152 directly observe the exact function values. The
|
| 189 |
+
153 function values on the rest ones in $\hat { \mathcal { X } } _ { t } \backslash \mathcal { X } _ { t }$ are
|
| 190 |
+
154 estimated by interpolation, which captures the
|
| 191 |
+
155 landscape of $f ( x )$ by smoothing out the local
|
| 192 |
+
156 fluctuations. To control the trade-off between
|
| 193 |
+
157 the inaccurate estimations and the exact obser
|
| 194 |
+
158 vations in $\Omega _ { t }$ , we design a stopping rule that
|
| 195 |
+
159 optimizes the number of consistent queries in
|
| 196 |
+
160 $\Omega _ { t }$ . The more consistent queries conducted in a
|
| 197 |
+
161 given subspace, the more accurate observations
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 2: Two-stage kernels: subspace projection and function value interpolation
|
| 201 |
+
|
| 202 |
+
62 could be obtained, albeit at the expense of a smaller remaining budget for exploring other regions.
|
| 203 |
+
|
| 204 |
+
163 The key features of CobBO are listed in Algorithm 1, with more details in the following sections.
|
| 205 |
+
164 Several auxiliary components are utilized and presented in Appendix C to deal with a larger variety
|
| 206 |
+
165 of problems and corner cases.
|
| 207 |
+
|
| 208 |
+
# 166 3.1 Block coordinate ascent and subspace selection
|
| 209 |
+
|
| 210 |
+
167 For Bayesian optimization, consider an infeasible assumption that each iteration can exactly maximize
|
| 211 |
+
168 the function $f ( x )$ in $\Omega _ { t }$ . This is not possible for one iteration but only if one can consistently query
|
| 212 |
+
169 in $\Omega _ { t }$ , since the points converge to the maximum, e.g., under the expected improvement acquisition
|
| 213 |
+
170 function with fixed priors [59] and the convergence rate can be characterized for smooth functions
|
| 214 |
+
171 in the reproducing kernel Hilbert space [8]. However, even with this infeasible assumption, it is
|
| 215 |
+
172 known that coordinate ascent with fixed blocks can cause stagnation at a non-critical point, e.g., for
|
| 216 |
+
173 non-differentiable [67] or non-convex functions [49]. This motivates us to select a subspace with a
|
| 217 |
+
174 variable-size coordinate block $C _ { t }$ for each query. A good coordinate block can help the iterations
|
| 218 |
+
175 to escape the trapped non-critical points. For example, one condition can be based on the result
|
| 219 |
+
176 in [21] that assumes $f ( x )$ to be differentiable and strictly quasi-convex over a collection of blocks. In
|
| 220 |
+
177 practice, we do not restrict ourselves to these assumptions.
|
| 221 |
+
178 We induce a preference distribution $\pi _ { t }$ over the coordinate set $I$ , and sample a variable-size coordinate
|
| 222 |
+
179 block $C _ { t }$ accordingly. This distribution is updated at iteration $t$ through a multiplicative weights
|
| 223 |
+
180 update method [2]. Specifically, the values of $\pi _ { t }$ at coordinates in $C _ { t }$ starts off uniform and increase
|
| 224 |
+
181 in face of an improvement or decrease otherwise according to different multiplicative ratios $\alpha > 1$
|
| 225 |
+
182 and $\beta > 1$ , respectively,
|
| 226 |
+
|
| 227 |
+
$$
|
| 228 |
+
w _ { t , j } = w _ { t - 1 , j } \cdot \left\{ \begin{array} { l l } { \alpha } & { \mathrm { i f ~ } j \in C _ { t } \mathrm { ~ a n d ~ } y _ { t } > M _ { t - 1 } } \\ { 1 / \beta } & { \mathrm { i f ~ } j \in C _ { t } \mathrm { ~ a n d ~ } y _ { t } \leq M _ { t - 1 } } \\ { 1 } & { \mathrm { i f ~ } j \notin C _ { t } } \end{array} \right. ; \quad w _ { 0 , j } = \frac { 1 } { D } \quad ; \quad \pi _ { t , j } = \frac { w _ { t , j } } { \sum _ { j = 1 } ^ { D } w _ { t , j } }
|
| 229 |
+
$$
|
| 230 |
+
|
| 231 |
+
183 This update characterizes how likely a coordinate block can generate a promising search subspace.
|
| 232 |
+
184 The multiplicative ratio $\alpha$ is chosen to be relatively large, e.g., $\alpha = 2 . 0$ , and $\beta$ relatively small, e.g.,
|
| 233 |
+
185 $\beta = 1 . 1$ , since the queries that improve the best observations $y _ { t } > M _ { t - 1 }$ happen more rarely than
|
| 234 |
+
186 the opposite $y _ { t } \le M _ { t - 1 }$ .
|
| 235 |
+
187 How to dynamically select the size $| C _ { t } | \cdot \cdot$ It is known that Bayesian optimization works well for low
|
| 236 |
+
188 dimensions [15]. Thus, we specify an upper bound for the dimension of the subspace (e.g. $| C _ { t } | \le 3 0 \}$ .
|
| 237 |
+
189 In principle, $| C _ { t } |$ can be any random number in a finite set of possible block sizes $\mathcal { C }$ . This is different
|
| 238 |
+
190 from the method that partitions the coordinates into fixed blocks and selects one according to, e.g.,
|
| 239 |
+
191 cyclic order [68], random sampling or Gauss-Southwell [46].
|
| 240 |
+
|
| 241 |
+
# 192 3.2 Backoff stopping rule for consistent queries
|
| 242 |
+
|
| 243 |
+
Applying BO on $\Omega _ { t }$ requires a strategy to determine the number of consecutive queries for making a sufficient progress. This strategy is based on previous observations, thus forming a stopping rule. In principle, there are two different scenarios, exemplifying exploration and exploitation, respectively. Persistently querying a given subspace refrains from opportunistically exploring other coordinate combinations. Abruptly shifting to different subspaces does not fully exploit the potential of a given subspace.
|
| 244 |
+
|
| 245 |
+
CobBO designs a heuristic stopping rule in compromise. It takes the above two scenarios into joint consideration, by considering not only the number of consecutive queries that fail to improve the objective function but also other factors including the improved difference $M _ { t } - M _ { t - 1 }$ , the point distance $\vert \vert x _ { t } - x _ { t - 1 } \vert \vert$ , the query budget $T$ and the problem dimension $D$ . On the one hand, switching to another subspace $\Omega _ { t + 1 } ~ ( \neq ~ \Omega _ { t } )$ prematurely without fully exploiting $\Omega _ { t }$ incurs an additional approximation error associated with the interpolation of observations in $\Omega _ { t }$ projected to $\Omega _ { t + 1 }$ . On the other hand, it is also possible to over-exploit a subspace, spending high query budget on marginal improvements around local optima. In order to mitigate this, even when a query leads to an improvement, other factors are considered for sampling a new subspace.
|
| 246 |
+
|
| 247 |
+
# 3.3 Theoretical Analysis
|
| 248 |
+
|
| 249 |
+
209 One can view our block coordinate selection approach in section 3.1 as a combinatorial mixture of
|
| 250 |
+
210 experts problem [10], where each coordinate is a single expert and the forecaster aims at choosing
|
| 251 |
+
211 the best combination of experts in each step. Under this view, we bound the regret of our selection
|
| 252 |
+
212 method with respect to the policy of selecting the best (unknown) block of coordinates at each step.
|
| 253 |
+
213 Assume that there is a fixed optimal choice $\mathcal { T } ^ { * }$ for the block of coordinates to pick at all steps. This
|
| 254 |
+
214 block is characterized by improving the objective function for the largest number of times among
|
| 255 |
+
215 all the possible coordinate blocks when performing Bayesian optimization over the corresponding
|
| 256 |
+
216 subspaces. The following particular design of losses expresses this cause:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\ell _ { t , i } = \left\{ \begin{array} { l l } { - \log ( \tilde { \alpha } ) } & { \mathrm { i f ~ } i \in C _ { t } \mathrm { ~ a n d ~ } y _ { t } > M _ { t - 1 } } \\ { \log ( \tilde { \beta } ) } & { \mathrm { i f ~ } i \in C _ { t } \mathrm { ~ a n d ~ } y _ { t } \leq M _ { t - 1 } } \\ { 0 } & { \mathrm { i f ~ } i \not \in C _ { t } } \end{array} \right. ~ ; \quad \tilde { \alpha } , \tilde { \beta } > 1
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
217 as all the coordinates participating in the selected block incur the same loss that effectively rewards
|
| 263 |
+
218 these coordinates for improving the objective and penalizes these for failing to improve the objective.
|
| 264 |
+
219 All other coordinates that are not selected receive a zero loss and remain untouched.
|
| 265 |
+
|
| 266 |
+
Note that $\tilde { \alpha }$ and $\tilde { \beta }$ express the extent of reward and penalty, e.g. for $\tilde { \alpha } = \tilde { \beta } = e$ we have losses of $\ell _ { t , i } \in \{ - 1 , 1 , 0 \}$ . Yet, $\tilde { \alpha }$ is better chosen to be larger than $\tilde { \beta }$ , since the frequency of improving the objective is expected to be smaller.
|
| 267 |
+
|
| 268 |
+
23 The loss received by the forecaster is to reflect the same motivation. This is done by averaging
|
| 269 |
+
24 the losses of the individual coordinates in the selected block, so that the size of the block does not
|
| 270 |
+
25 matter explicitly, i.e. a bigger block should not incur more loss just due to its size but only due to its
|
| 271 |
+
26 performance. Such that for each coordinate block $\mathcal { T } _ { t } \subset \mathcal { T } = \{ 1 , \cdots , D \}$ selected at time step $t$ , the
|
| 272 |
+
27 loss incurred by the forecaster is Lt,It = 1|I | $\begin{array} { r } { L _ { t , \mathcal { T } _ { t } } = \frac { 1 } { | \mathcal { T } _ { t } | } \sum _ { i \in \mathcal { T } _ { t } } \ell _ { t , i } } \end{array}$ . This is also the common loss incurred by
|
| 273 |
+
28 all the coordinates participating in that block.
|
| 274 |
+
|
| 275 |
+
229 In each step we have the following multiplicative update rule of the weights associated with each coordinate (setting 230 $\alpha = \tilde { \alpha } ^ { \eta }$ and $\beta = \widetilde { \beta } ^ { \eta }$ yields the update rule in Eq. 2):
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
w _ { t , i } = w _ { t - 1 , i } \cdot e ^ { - \eta \ell _ { t , i } } = w _ { t - 1 , i } \cdot \left\{ \begin{array} { l l } { \tilde { \alpha } ^ { \eta } } & { \mathrm { i f ~ } i \in C _ { t } \mathrm { ~ a n d ~ } y _ { t } > M _ { t - 1 } } \\ { 1 / \tilde { \beta } ^ { \eta } } & { \mathrm { i f ~ } i \in C _ { t } \mathrm { ~ a n d ~ } y _ { t } \le M _ { t - 1 } } \\ { 1 } & { \mathrm { i f ~ } i \notin C _ { t } } \end{array} \right.
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
The probability $\tilde { \pi } _ { t , \mathcal { T } _ { t } }$ of selecting a certain coordinate block $\mathcal { T } _ { t }$ is induced by $\pi _ { t }$ as specified next. Thus the expected cumulative loss of the foreceaster is:
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
L _ { T } = \sum _ { t = 1 } ^ { T } \sum _ { c \in \mathcal { C } } \sum _ { \mathbb { Z } _ { t } \in \mathcal { S } _ { c } } \tilde { \pi } _ { t , \mathbb { Z } _ { t } } \cdot \frac { 1 } { | \mathbb { Z } _ { t } | } \sum _ { i \in \mathcal { T } _ { t } } \ell _ { t , i }
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
Assume the best coordinate block is $\mathcal { T } ^ { * }$ , then the corresponding cumulative loss is:
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
L _ { T } ^ { * } = \sum _ { t = 1 } ^ { T } { L _ { t , \mathbb { Z } ^ { * } } } = \sum _ { t = 1 } ^ { T } \frac { 1 } { | \mathscr { T } ^ { * } | } \sum _ { i \in \mathscr { T } ^ { * } } \ell _ { t , i }
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
We hence aim at bounding the regret 231 $R e g r e t _ { T } = L _ { T } - L _ { T } ^ { * }$ .
|
| 294 |
+
|
| 295 |
+
232 Theorem 1. Sample from the combinatorial space of all possible coordinate blocks $\textstyle { \mathcal { T } } _ { t } \in \bigcup _ { c \in { \mathcal { C } } } S _ { c }$ with probability 233 $\begin{array} { r } { \tilde { \pi } _ { t , \mathcal { T } _ { t } } ~ = ~ \prod _ { i \in \mathcal { T } _ { t } } \tilde { w } _ { t , \mathcal { T } _ { t } } \Big / \sum _ { c \in \mathcal { C } } \sum _ { \hat { \mathcal { T } } \in \mathcal { S } _ { c } } \prod _ { j \in \hat { \mathcal { T } } } \tilde { w } _ { t , \hat { \mathcal { T } } } . } \end{array}$ . Then the update rule in Eq. 2 with 234 $\alpha = \tilde { \alpha } ^ { \eta }$ , $\beta = \widetilde { \beta } ^ { \eta }$ and $\eta = \log ( \tilde { \alpha } \tilde { \beta } ) ^ { - 1 } \sqrt { T ^ { - 1 } | \mathcal { C } | D \log ( D ) }$ yields:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
R e g r e t _ { t } \le \mathcal { O } \left( ( \log ( \tilde { \alpha } \tilde { \beta } ) \cdot \sqrt { T | \mathcal { C } | D \log ( D ) } ) \right)
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where 235 $\begin{array} { r } { \tilde { w } _ { t , \mathcal { T } _ { t } } = \prod _ { i \in \mathcal { T } _ { t } } w _ { t , i } ^ { 1 / | \mathcal { T } _ { t } | } } \end{array}$ w1/|It|t,i is the geometric mean of weights in block It. The upper bound in Eq. 5 is tight, as the lower bound can be shown to be of 236 $\Omega ( { \sqrt { T \log ( N ) } } )$ [23] where the number of experts is 237 $\begin{array} { r } { N = \sum _ { c \in \mathcal { C } } S _ { c } \leq D ^ { | \mathcal { C } | D } } \end{array}$ in our combinatorial setup, as typically $| \mathcal { C } | \ll D$ .
|
| 302 |
+
|
| 303 |
+
238 In practice, the direct sampling policy introduced in Theorem 1 involves high computational costs due
|
| 304 |
+
239 to the exponential growth of combinations in $D$ . Thus CobBO suggests an alternative computationally
|
| 305 |
+
240 efficient sampling policy with a linear growth in $D$ .
|
| 306 |
+
|
| 307 |
+
Theorem 2. Sample a block size $c \in { \mathcal { C } }$ with probability $p _ { c }$ and c coordinates without replacement according to $\pi _ { t }$ . Assume $c \supset \{ 1 \}$ , then the update rule in Eq. 2, with $\alpha = \tilde { \alpha } ^ { \eta }$ , $\beta = { \tilde { \beta } } ^ { \eta }$ and $\begin{array} { r } { \eta = \sqrt { \frac { \log ( D ) } { T ( \log ( \tilde { \alpha } \tilde { \beta } ) ^ { 2 } - \log ( p _ { 1 } ) ) } } \geq 1 } \end{array}$ ≥ 1 yields:
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
R e g r e t _ { t } \le \mathcal { O } \left( \sqrt { ( \log ( \tilde { \alpha } \tilde { \beta } ) ^ { 2 } - \log ( p _ { 1 } ) ) } \cdot \sqrt { T \log ( D ) } ) \right)
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
where $p _ { c } > 0$ for all $c \in { \mathcal { C } }$ and $\textstyle \sum _ { c \in c } p _ { c } = 1$ , e.g., uniformly set $p _ { c } \equiv | \mathcal { C } | ^ { - 1 }$ .The proof and detailed sampling policy are in Appendix A. The regret upper bound in Eq. 6 is tight, as the lower bound for an easier setup can be shown to be of $\Omega ( { \sqrt { T \log ( D ) } } )$ [23]. The implication on $\eta$ is valid only for settings of a very high dimensionality and low query budget. In particular, CobBO is designed for this kind of problems.
|
| 314 |
+
|
| 315 |
+
Remark: Similar analysis and results follow when incorporating consistent queries from Section 3.2 and sampling a new coordinate block once every several steps. This is done by effectively performing less steps of aggregated temporal losses, as shown in Appendix A.
|
| 316 |
+
|
| 317 |
+
# 4 Numerical Experiments
|
| 318 |
+
|
| 319 |
+
This section presents detailed ablation studies of the key components presented in Section 3 and comparisons with other algorithms.
|
| 320 |
+
|
| 321 |
+
# 4.1 Empirical analysis and ablation study
|
| 322 |
+
|
| 323 |
+
Ablation studies are designed to study the contributions of the key components in Algorithm 1 by experimenting with the Rastrigin function on $[ - 5 , 1 0 ] ^ { 5 0 }$ with 20 initial points. The best performing run out of 5 experiments for each configuration is presented in Figure 3.
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
Figure 3: Ablation study using Rastrigin on $[ - 5 , 1 0 ] ^ { 5 0 }$ with 20 initial random samples
|
| 327 |
+
|
| 328 |
+
259 RBF interpolation: RBF calculation is time efficient. Specifically, this is much beneficial in high
|
| 329 |
+
260 dimensions. Figure 1 (left) shows the computation time of plain Bayesian optimization compared to
|
| 330 |
+
261 CobBO’s. While the former applies GP regression using the Matérn kernel in the high dimensional
|
| 331 |
+
262 space directly, the later applies RBF interpolation in the high dimensional space and GP regression
|
| 332 |
+
263 with the Matérn kernel in the low dimensional subspace. This two-step composite kernel leads to a
|
| 333 |
+
264 significant speed-up. Other time efficient alternatives are, e.g., the inverse distance weighting [26]
|
| 334 |
+
265 and the simple approach of assigning the value of the observed nearest neighbour. Figure 3 (a) shows
|
| 335 |
+
266 that RBF is the most favorable.
|
| 336 |
+
|
| 337 |
+
Backoff stopping rule: CobBO applies a stopping rule to query a variable number of points in subspace $\Omega _ { t }$ (Section 3.2). To validate its effectiveness, we compare it with schemes that use a fixed budget of queries for $\Omega _ { t }$ . Figure 3 (b) shows that the stopping rule yields superior results.
|
| 338 |
+
|
| 339 |
+
70 Coordinate blocks of a varying size: CobBO selects a block of coordinates of a varying size $C _ { t }$
|
| 340 |
+
71 (Section 3.1). Figure 3 (c) shows that a varying size is better than fixed.
|
| 341 |
+
|
| 342 |
+
Preference probability over coordinates: For demonstrating the effectiveness of coordinate selection (Section 3.1), we artificially let the function value only depend on the first 25 coordinates of its input and ignore the rest. It forms two separate sets of active and inactive coordinates, respectively. We expect CobBO to refrain from selecting inactive coordinates. Figure 4 shows the entropy of this preference probability $\pi _ { t }$ over coordinates and the overall probability for picking active and inactive coordinate at each iteration. We see that the entropy decreases, as the preference distribution concentrates on the significant active coordinates.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 4: The preference probability focuses on active coordinates as the entropy decreases
|
| 348 |
+
Figure 5: Performance over low (left) medium (middle) and high (right) dimensional problems
|
| 349 |
+
|
| 350 |
+
# 286 4.2 Comparisons with other methods
|
| 351 |
+
|
| 352 |
+
The default configuration for CobBO is specified in the supplementary materials. CobBO performs on par or outperforms a collection of state-of-the-art methods across the following experiments. Most of the experiments are conducted using the same settings as in TurBO [14], where it is compared with a comprehensive list of baselines, including BFGS, BOCK [47], BOHAMIANN, CMA-ES [22], BOBYQA, EBO [61], GP-TS, HeSBO [44], Nelder-Mead and random search. To avoid repetitions, we only show TuRBO and CMA-ES that achieve the best performance among this list, and additionally compare CobBO with BADS [1], REMBO [63], Differetial Evolution (Diff-Evo) [56], Tree Parzen Estimator (TPE) [4] and Adaptive TPE (ATPE) [12].
|
| 353 |
+
|
| 354 |
+
# 4.2.1 Low dimensional tests
|
| 355 |
+
|
| 356 |
+
To evaluate CobBO on low dimensional problems, we use the lunar landing [38, 14] and robot pushing [62], by following the setup in [14]. Confidence intervals $( 9 5 \% )$ over 30 independent experiments for each problem are shown in Fig. 5.
|
| 357 |
+
|
| 358 |
+
Lunar landing (maximization): This controller learning problem (12 dimensions) is provided by the OpenAI gym [38] and evaluated in [14]. Each algorithm has 50 initial points and a budget of 1, 500 trials. TuRBO is configured with 5 trust regions and a batch size of 50 as in [14]. Fig. 5 (upper left) shows that, among the 30 independent tests, CobBO quickly exceeds 300 along some good sample paths.
|
| 359 |
+
|
| 360 |
+
Robot pushing (maximization): This control problem (14 dimensions) is introduced in [62] and extensively tested in [14]. We follow the setting in [14], where TuRBO is configured with a batch size of 50 and 15 trust regions, each of which has 30 initial points. Each experiment has a budget of 10, 000 evaluations. On average CobBO exceeds 10 within 5500 trials, as shown in Fig. 5 (lower left).
|
| 361 |
+
|
| 362 |
+
# 4.2.2 High dimensional tests
|
| 363 |
+
|
| 364 |
+
Since the duration of each experiment in this section is long, confidence intervals $( 9 5 \% )$ ) over repeated 10 independent experiments for each problem are presented.
|
| 365 |
+
|
| 366 |
+
Additive latent structure (minimization): As mentioned in Section 2, additive latent structures have been exploited in high dimensions. We construct an additive function of 56 dimensions, defined as $f _ { 5 6 } ( x ) \ = \ \mathrm { { A c k l e y } ( x _ { 1 } ) + \mathrm { { L e v y } ( x _ { 2 } ) + \mathrm { { R a s t r i g i n } ( x _ { 3 } ) + \mathrm { { H a r t m a n n } ( x _ { 4 } ) + \mathrm { { R o s e n b r o c k } ( x _ { 5 } ) + \mathrm { { A c k l e y } ( x _ { 6 } ) + \mathrm { { A c k l e y } ( x _ { 7 } ) } } } } } } } $ Schwefel $\left( \mathrm { x } _ { 6 } \right)$ , where the first three terms express the exact functions and domains described in Section 4.2.1, the Hartmann function on $[ 0 , \bar { 1 } ] ^ { 6 }$ and the Rosenbrock and Schwefel functions on $[ - 5 , 1 0 ] ^ { 1 0 }$ and $[ - 5 0 0 , 5 0 0 ] ^ { 1 0 }$ , respectively.
|
| 367 |
+
|
| 368 |
+
We compare CobBO with TPE, BADS, CMA-ES and TuRBO, each with 100 initial points. Specifically, TuRBO is configured with 15 trust regions and a batch size 100. ATPE is excluded as it takes more than 24 hours per run to finish. The results are shown in Fig. 5 (upper middle), where CobBO quickly finds the best solution among the algorithms tested.
|
| 369 |
+
|
| 370 |
+
Rover trajectory planning (maximization): This problem (60 dimensions) is introduced in [62]. The objective is to find a collision-avoiding trajectory of a sequence consisting of 30 positions in a 2-D plane. We compare CobBO with TuRBO, TPE and CMA-ES, each with a budget of 20, 000 evaluations and 200 initial points. TuRBO is configured with 15 trust regions and a batch size of 100, as in [14]. ATPE, BADS and REMBO are excluded for this problem and the following ones, as they all take more than 24 hours per run. Fig. 5 (lower middle) shows that CobBO has a good performance.
|
| 371 |
+
|
| 372 |
+
The 200-dimensional Levy and Ackley functions (minimization): We minimize the Levy and Ackley functions over $[ - 5 , \mathsf { \bar { 1 0 } } ] ^ { 2 0 0 }$ with 500 initial points. TuRBO is configured with 15 trust regions and a batch size of 100. These two problems are challenging and have no redundant dimensions. For Levy, in Fig. 5 (upper right), CobBO reaches 100.0 within 2, 000 trials, while CMA-ES and TuRBO obtain 200.0 after 8, 000 trials. TPE cannot find a comparable solution within 10, 000 trials in this case. For Ackley, in Fig. 5 (lower right), CobBO reaches the best solution among all of the algorithms tested.
|
| 373 |
+
|
| 374 |
+
Regarding running times, for Ackley, CobBO runs for 12.8 CPU hours and TuRBO-1 run for more than 80 CPU hours or $9 . 6 \ : G P U$ hours. Most other methods either cannot make any progress or find far worse solutions.
|
| 375 |
+
|
| 376 |
+
# 5 Conclusion
|
| 377 |
+
|
| 378 |
+
CobBO is a variant of coordinate ascent tailored for Bayesian optimization with a stopping rule to switch coordinate subspaces. The sampling policy of subspaces is proven to have tight regret bounds with respect to the best subspace in hindsight. Combining this projection on random subspaces with a two-stage kernels for function value interpolation and GP regression, we provide a practical Bayesian optimization method of affordable computational costs in high dimensions. Empirically, CobBO consistently finds comparable or better solutions with reduced trial complexity in comparison with the state-of-the-art methods across a variety of benchmarks.
|
| 379 |
+
|
| 380 |
+
348 [1] Luigi Acerbi and Wei Ji Ma. Practical bayesian optimization for model fitting with bayesian
|
| 381 |
+
349 adaptive direct search. In Proceedings of the 31st International Conference on Neural Infor
|
| 382 |
+
350 mation Processing Systems, NIPS’17, page 1834–1844, Red Hook, NY, USA, 2017. Curran
|
| 383 |
+
351 Associates Inc.
|
| 384 |
+
352 [2] Sanjeev Arora, Elad Hazan, and Satyen Kale. The multiplicative weights update method: a
|
| 385 |
+
353 meta-algorithm and applications. Theory of Computing, 8(6):121–164, 2012.
|
| 386 |
+
354 [3] Peter Auer. Using confidence bounds for exploitation-exploration trade-offs. J. Mach. Learn.
|
| 387 |
+
355 Res., 3(null):397–422, Mar. 2003.
|
| 388 |
+
356 [4] James S. Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for hyper
|
| 389 |
+
357 parameter optimization. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q.
|
| 390 |
+
358 Weinberger, editors, Advances in Neural Information Processing Systems 24, pages 2546–2554.
|
| 391 |
+
359 Curran Associates, Inc., 2011.
|
| 392 |
+
360 [5] Mickaël Binois, David Ginsbourger, and Olivier Roustant. On the choice of the low-dimensional
|
| 393 |
+
361 domain for global optimization via random embeddings. Journal of Global Optimization,
|
| 394 |
+
362 76(1):69–90, January 2020.
|
| 395 |
+
363 [6] Martin D. Buhmann. Radial Basis Functions: Theory and Implementations. Cambridge
|
| 396 |
+
364 Monographs on Applied and Computational Mathematics. Cambridge University Press, 2003.
|
| 397 |
+
365 [7] Martin D. Buhmann and M. D. Buhmann. Radial Basis Functions. Cambridge University Press,
|
| 398 |
+
366 USA, 2003.
|
| 399 |
+
367 [8] Adam D. Bull. Convergence rates of efficient global optimization algorithms. Journal of
|
| 400 |
+
368 Machine Learning Research, 12(88):2879–2904, 2011.
|
| 401 |
+
369 [9] Roberto Calandra, André Seyfarth, Jan Peters, and Marc Peter Deisenroth. Bayesian optimiza
|
| 402 |
+
370 tion for learning gaits under uncertainty. Annals of Mathematics and Artificial Intelligence,
|
| 403 |
+
371 76(1):5–23, 2016.
|
| 404 |
+
372 [10] Nicolo Cesa-Bianchi and Gábor Lugosi. Prediction, learning, and games. Cambridge university
|
| 405 |
+
373 press, 2006.
|
| 406 |
+
374 [11] Josip Djolonga, Andreas Krause, and Volkan Cevher. High-dimensional gaussian process
|
| 407 |
+
375 bandits. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger,
|
| 408 |
+
376 editors, Advances in Neural Information Processing Systems 26, pages 1025–1033. Curran
|
| 409 |
+
377 Associates, Inc., 2013.
|
| 410 |
+
378 [12] ElectricBrain. Blog: Learning to optimize, 2018.
|
| 411 |
+
379 [13] David Eriksson, Kun Dong, Eric Lee, David Bindel, and Andrew G Wilson. Scaling gaussian
|
| 412 |
+
380 process regression with derivatives. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N.
|
| 413 |
+
381 Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems 31,
|
| 414 |
+
382 pages 6867–6877. Curran Associates, Inc., 2018.
|
| 415 |
+
383 [14] David Eriksson, Michael Pearce, Jacob Gardner, Ryan D Turner, and Matthias Poloczek.
|
| 416 |
+
384 Scalable global optimization via local bayesian optimization. In Advances in Neural Information
|
| 417 |
+
385 Processing Systems 32, pages 5496–5507. Curran Associates, Inc., 2019.
|
| 418 |
+
386 [15] Peter I. Frazier. A tutorial on bayesian optimization, 2018.
|
| 419 |
+
387 [16] Peter I. Frazier, Warren B. Powell, and Savas Dayanik. A knowledge-gradient policy for
|
| 420 |
+
388 sequential information collection. SIAM J. Control Optim., 47(5):2410–2439, Sept. 2008.
|
| 421 |
+
389 [17] Elad Gilboa, Yunus Saatçi, and John P. Cunningham. Scaling multidimensional Gaussian
|
| 422 |
+
390 processes using projected additive approximations. In Proceedings of the 30th International
|
| 423 |
+
391 Conference on International Conference on Machine Learning - Volume 28, ICML’13, page
|
| 424 |
+
392 I–454–I–461. JMLR.org, 2013.
|
| 425 |
+
393 [18] Daniel Golovin, Benjamin Solnik, Subhodeep Moitra, Greg Kochanski, John Karro, and D
|
| 426 |
+
394 Sculley. Google vizier: A service for black-box optimization. In Proceedings of the 23rd ACM
|
| 427 |
+
395 SIGKDD international conference on knowledge discovery and data mining, pages 1487–1495,
|
| 428 |
+
396 2017.
|
| 429 |
+
397 [19] Rafael Gómez-Bombarelli, Jennifer N Wei, David Duvenaud, José Miguel Hernández-Lobato,
|
| 430 |
+
398 Benjamín Sánchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D Hirzel,
|
| 431 |
+
399 Ryan P Adams, and Alán Aspuru-Guzik. Automatic chemical design using a data-driven
|
| 432 |
+
400 continuous representation of molecules. ACS central science, 4(2):268–276, 2018.
|
| 433 |
+
401 [20] Javier Gonzalez, Zhenwen Dai, Philipp Hennig, and Neil Lawrence. Batch bayesian optimization
|
| 434 |
+
402 via local penalization. In Arthur Gretton and Christian C. Robert, editors, Proceedings of the
|
| 435 |
+
404 of Machine Learning Research, pages 648–657, Cadiz, Spain, 09–11 May 2016. PMLR.
|
| 436 |
+
405 [21] Luigi Grippo and Marco Sciandrone. On the convergence of the block nonlinear gauss-seidel
|
| 437 |
+
406 method under convex constraints. Operations Research Letters, 26(3):127–136, 2000.
|
| 438 |
+
407 [22] Nikolaus Hansen and Andreas Ostermeier. Completely derandomized self-adaptation in evolu
|
| 439 |
+
408 tion strategies. Evolutionary Computation, 9(2):159–195, June 2001.
|
| 440 |
+
409 [23] David Haussler, Jyrki Kivinen, and Manfred K Warmuth. Tight worst-case loss bounds for
|
| 441 |
+
410 predicting with expert advice. In European Conference on Computational Learning Theory,
|
| 442 |
+
411 pages 69–83. Springer, 1995.
|
| 443 |
+
412 [24] Philipp Hennig and Christian J. Schuler. Entropy search for information-efficient global
|
| 444 |
+
413 optimization. J. Mach. Learn. Res., 13(1):1809–1837, June 2012.
|
| 445 |
+
414 [25] José Miguel Henrández-Lobato, Matthew W. Hoffman, and Zoubin Ghahramani. Predictive
|
| 446 |
+
415 entropy search for efficient global optimization of black-box functions. In Proceedings of the
|
| 447 |
+
416 27th International Conference on Neural Information Processing Systems - Volume 1, NIPS’14,
|
| 448 |
+
417 page 918–926, Cambridge, MA, USA, 2014. MIT Press.
|
| 449 |
+
418 [26] IDW. https://en.wikipedia.org/wiki/Inverse_distance_weighting.
|
| 450 |
+
419 [27] Donald R. Jones, Matthias Schonlau, and William J. Welch. Efficient global optimization of
|
| 451 |
+
420 expensive black-box functions. Journal of Global optimization, 13(4):455–492, 1998.
|
| 452 |
+
421 [28] Kirthevasan Kandasamy, Jeff Schneider, and Barnabás Póczos. High dimensional bayesian
|
| 453 |
+
422 optimization and bandits via additive models. In Proceedings of the 32nd International Confer
|
| 454 |
+
423 ence on International Conference on Machine Learning - Volume 37, ICML’15, page 295–304.
|
| 455 |
+
424 JMLR.org, 2015.
|
| 456 |
+
425 [29] Johannes Kirschner, Mojmir Mutny, Nicole Hiller, Rasmus Ischebeck, and Andreas Krause.
|
| 457 |
+
426 Adaptive and safe Bayesian optimization in high dimensions via one-dimensional subspaces. In
|
| 458 |
+
427 Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International
|
| 459 |
+
428 Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research,
|
| 460 |
+
429 pages 3429–3438, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 461 |
+
430 [30] H. J. Kushner. A new method of locating the maximum point of an arbitrary multipeak curve in
|
| 462 |
+
431 the presence of noise. Journal of Basic Engineering, 86(1):97–106, mar 1964.
|
| 463 |
+
432 [31] Rémi Lam, Matthias Poloczek, Peter Frazier, and Karen E Willcox. Advances in bayesian
|
| 464 |
+
433 optimization with applications in aerospace engineering. In 2018 AIAA Non-Deterministic
|
| 465 |
+
434 Approaches Conference, page 1656, 2018.
|
| 466 |
+
435 [32] Ben Letham, Roberto Calandra, Akshara Rai, and Eytan Bakshy. Re-examining linear embed
|
| 467 |
+
436 dings for high-dimensional bayesian optimization. Advances in Neural Information Processing
|
| 468 |
+
437 Systems, 33, 2020.
|
| 469 |
+
438 [33] Ben Letham, Roberto Calandra, Akshara Rai, and Eytan Bakshy. Re-examining linear embed
|
| 470 |
+
439 dings for high-dimensional bayesian optimization. In H. Larochelle, M. Ranzato, R. Hadsell,
|
| 471 |
+
440 M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, vol
|
| 472 |
+
441 ume 33, pages 1546–1558. Curran Associates, Inc., 2020.
|
| 473 |
+
442 [34] Benjamin Letham, Brian Karrer, Guilherme Ottoni, Eytan Bakshy, et al. Constrained bayesian
|
| 474 |
+
443 optimization with noisy experiments. Bayesian Analysis, 14(2):495–519, 2019.
|
| 475 |
+
444 [35] Cheng Li, Sunil Gupta, Santu Rana, Vu Nguyen, Svetha Venkatesh, and Alistair Shilton.
|
| 476 |
+
445 High dimensional bayesian optimization using dropout. In Proceedings of the Twenty-Sixth
|
| 477 |
+
446 International Joint Conference on Artificial Intelligence, IJCAI-17, pages 2096–2102, 2017.
|
| 478 |
+
447 [36] Chun-Liang Li, Kirthevasan Kandasamy, Barnabas Poczos, and Jeff Schneider. High dimen
|
| 479 |
+
448 sional bayesian optimization via restricted projection pursuit models. In Arthur Gretton and
|
| 480 |
+
449 Christian C. Robert, editors, Proceedings of the 19th International Conference on Artificial
|
| 481 |
+
450 Intelligence and Statistics, volume 51 of Proceedings of Machine Learning Research, pages
|
| 482 |
+
451 884–892, Cadiz, Spain, 09–11 May 2016. PMLR.
|
| 483 |
+
452 [37] Daniel J Lizotte, Tao Wang, Michael H Bowling, and Dale Schuurmans. Automatic gait
|
| 484 |
+
453 optimization with gaussian process regression. In IJCAI, volume 7, pages 944–949, 2007.
|
| 485 |
+
454 [38] LunarLander v2. https://gym.openai.com/envs/LunarLander-v2/.
|
| 486 |
+
455 [39] Horia Mania, Aurelia Guy, and Benjamin Recht. Simple random search of static linear policies
|
| 487 |
+
456 is competitive for reinforcement learning. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman,
|
| 488 |
+
457 N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems
|
| 489 |
+
458 31, pages 1800–1809. Curran Associates, Inc., 2018.
|
| 490 |
+
459 [40] Matern kernel. https://scikit-learn.org/stable/modules/generated/sklearn.
|
| 491 |
+
460 gaussian_process.kernels.Matern.html.
|
| 492 |
+
461 [41] Mark McLeod, Michael A. Osborne, and Stephen J. Roberts. Optimization, fast and slow:
|
| 493 |
+
462 Optimally switching between local and bayesian optimization. In ICML, 2018.
|
| 494 |
+
463 [42] J. Mockus. On bayesian methods for seeking the extremum. In G. I. Marchuk, editor, ˇ Optimiza
|
| 495 |
+
464 tion Techniques IFIP Technical Conference Novosibirsk, July 1–7, 1974, pages 400–404, Berlin,
|
| 496 |
+
465 Heidelberg, 1975. Springer Berlin Heidelberg.
|
| 497 |
+
466 [43] Riccardo Moriconi, K. S. Sesh Kumar, and Marc Peter Deisenroth. High-dimensional bayesian
|
| 498 |
+
467 optimization with projections using quantile gaussian processes. Optimization Letters, 14:51–64,
|
| 499 |
+
468 2020.
|
| 500 |
+
69 [44] Alexander Munteanu, Amin Nayebi, and Matthias Poloczek. A framework for Bayesian
|
| 501 |
+
470 optimization in embedded subspaces. In Kamalika Chaudhuri and Ruslan Salakhutdinov,
|
| 502 |
+
471 editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of
|
| 503 |
+
472 Proceedings of Machine Learning Research, pages 4752–4761, Long Beach, California, USA,
|
| 504 |
+
473 09–15 Jun 2019. PMLR.
|
| 505 |
+
74 [45] Mojmir Mutny and Andreas Krause. Efficient high dimensional bayesian optimization with
|
| 506 |
+
475 additivity and quadrature fourier features. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman,
|
| 507 |
+
476 N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems
|
| 508 |
+
77 31, pages 9005–9016. Curran Associates, Inc., 2018.
|
| 509 |
+
78 [46] Julie Nutini, Mark Schmidt, Issam H. Laradji, Michael Friedlander, and Hoyt Koepke. Coordi
|
| 510 |
+
479 nate descent converges faster with the gauss-southwell rule than random selection. ICML’15:
|
| 511 |
+
480 Proceedings of the 32nd International Conference on International Conference on Machine
|
| 512 |
+
481 Learning, 37, July 2015.
|
| 513 |
+
82 [47] ChangYong Oh, Efstratios Gavves, and Max Welling. BOCK $:$ Bayesian optimization with
|
| 514 |
+
483 cylindrical kernels. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th
|
| 515 |
+
484 International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning
|
| 516 |
+
485 Research, pages 3868–3877, Stockholm, Sweden, 10–15 Jul 2018. PMLR.
|
| 517 |
+
486 [48] Rafael Oliveira, Fernando Rocha, Lionel Ott, Vitor Guizilini, Fabio Ramos, and Valdir Jr.
|
| 518 |
+
487 Learning to race through coordinate descent bayesian optimisation. In IEEE International
|
| 519 |
+
488 Conference on Robotics and Automation (ICRA), February 2018.
|
| 520 |
+
489 [49] M.J.D. Powell. On Search Directions for Minimization Algorithms. AERE-TP. AERE, Theoret
|
| 521 |
+
490 ical Physics Division, 1972.
|
| 522 |
+
491 [50] Radial basis function. https://docs.scipy.org/doc/scipy/reference/generated/
|
| 523 |
+
492 scipy.interpolate.Rbf.html.
|
| 524 |
+
493 [51] Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In J. C. Platt,
|
| 525 |
+
494 D. Koller, Y. Singer, and S. T. Roweis, editors, Advances in Neural Information Processing
|
| 526 |
+
495 Systems 20, pages 1177–1184. Curran Associates, Inc., 2008.
|
| 527 |
+
96 [52] Akshara Rai, Rika Antonova, Seungmoon Song, William Martin, Hartmut Geyer, and Christo
|
| 528 |
+
497 pher Atkeson. Bayesian optimization using domain knowledge on the atrias biped. In 2018
|
| 529 |
+
498 IEEE International Conference on Robotics and Automation (ICRA), pages 1771–1778. IEEE,
|
| 530 |
+
499 2018.
|
| 531 |
+
500 [53] Warren Scott, Peter Frazier, and Warren Powell. The correlated knowledge gradient for
|
| 532 |
+
501 simulation optimization of continuous parameters using gaussian process regression. SIAM
|
| 533 |
+
502 Journal on Optimization, 21(3):996–1026, 2011.
|
| 534 |
+
503 [54] Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias Seeger. Gaussian process
|
| 535 |
+
504 optimization in the bandit setting: No regret and experimental design. In Proceedings of the
|
| 536 |
+
505 27th International Conference on International Conference on Machine Learning, ICML’10,
|
| 537 |
+
506 page 1015–1022, Madison, WI, USA, 2010.
|
| 538 |
+
507 [55] N. Srinivas, A. Krause, S. M. Kakade, and M. W. Seeger. Information-theoretic regret bounds
|
| 539 |
+
508 for gaussian process optimization in the bandit setting. IEEE Transactions on Information
|
| 540 |
+
509 Theory, 58(5):3250–3265, 2012.
|
| 541 |
+
10 [56] Rainer Storn and Kenneth Price. Differential evolution–a simple and efficient heuristic for
|
| 542 |
+
511 global optimization over continuous spaces. Journal of global optimization, 11(4):341–359,
|
| 543 |
+
12 1997.
|
| 544 |
+
13 [57] Sonja Surjanovic and Derek Bingham. Optimization test problems, 2013.
|
| 545 |
+
14 [58] Hemant Tyagi and Volkan Cevher. Learning non-parametric basis independent models from
|
| 546 |
+
515 point queries via low-rank methods. Applied and Computational Harmonic Analysis, 37(3):389
|
| 547 |
+
516 – 412, 2014.
|
| 548 |
+
517 [59] Emmanuel Vazquez and Julien Bect. Convergence properties of the expected improvement
|
| 549 |
+
518 algorithm with fixed mean and covariance functions. Journal of Statistical Planning and
|
| 550 |
+
519 Inference, 140(11):3088 – 3095, 2010.
|
| 551 |
+
520 [60] Linnan Wang, Rodrigo Fonseca, and Yuandong Tian. Learning search space partition for
|
| 552 |
+
521 black-box optimization using monte carlo tree search. ArXiv, abs/2007.00708, 2020.
|
| 553 |
+
522 [61] Zi Wang, Clement Gehring, Pushmeet Kohli, and Stefanie Jegelka. Batched large-scale bayesian
|
| 554 |
+
523 optimization in high-dimensional spaces. In International Conference on Artificial Intelligence
|
| 555 |
+
524 and Statistics (AISTATS), 2018.
|
| 556 |
+
525 [62] Zi Wang, Clement Gehring, Pushmeet Kohli, and Stefanie Jegelka. Batched large-scale bayesian
|
| 557 |
+
526 optimization in high-dimensional spaces. In International Conference on Artificial Intelligence
|
| 558 |
+
527 and Statistics, pages 745–754, 2018.
|
| 559 |
+
528 [63] Ziyu Wang, Frank Hutter, Masrour Zoghi, David Matheson, and Nando De Freitas. Bayesian
|
| 560 |
+
529 optimization in a billion dimensions via random embeddings. J. Artif. Int. Res., 55(1):361–387,
|
| 561 |
+
530 Jan. 2016.
|
| 562 |
+
531 [64] Zi Wang and Stefanie Jegelka. Max-value entropy search for efficient Bayesian optimization. In
|
| 563 |
+
532 Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on
|
| 564 |
+
533 Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3627–3635,
|
| 565 |
+
534 International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR.
|
| 566 |
+
535 [65] Zi Wang, Chengtao Li, Stefanie Jegelka, and Pushmeet Kohli. Batched high-dimensional
|
| 567 |
+
536 bayesian optimization via structural kernel learning. In Proceedings of the 34th International
|
| 568 |
+
537 Conference on Machine Learning - Volume 70, ICML’17, page 3656–3664. JMLR.org, 2017.
|
| 569 |
+
538 [66] Ziyu Wang, Masrour Zoghi, Frank Hutter, David Matheson, and Nando De Freitas. Bayesian
|
| 570 |
+
539 optimization in high dimensions via random embeddings. In Proceedings of the Twenty-Third
|
| 571 |
+
540 International Joint Conference on Artificial Intelligence, IJCAI ’13, page 1778–1784. AAAI
|
| 572 |
+
541 Press, 2013.
|
| 573 |
+
542 [67] J. Warga. Minimizing certain convex functions. Journal of the Society for Industrial and
|
| 574 |
+
543 Applied Mathematics, 11(3):588–593, 1963.
|
| 575 |
+
544 [68] Stephen J. Wright. Coordinate descent algorithms. Mathematical Programming: Series A and
|
| 576 |
+
545 B, June 2015.
|
| 577 |
+
546 [69] Jian Wu and Peter I. Frazier. The parallel knowledge gradient method for batch bayesian
|
| 578 |
+
547 optimization. In Proceedings of the 30th International Conference on Neural Information
|
| 579 |
+
548 Processing Systems, NIPS’16, page 3134–3142, Red Hook, NY, USA, 2016. Curran Associates
|
| 580 |
+
549 Inc.
|
| 581 |
+
550 [70] Miao Zhang, Huiqi Li, and Steven Su. High dimensional bayesian optimization via supervised
|
| 582 |
+
551 dimension reduction. In Proceedings of the Twenty-Eighth International Joint Conference on
|
| 583 |
+
552 Artificial Intelligence, IJCAI-19, pages 4292–4298. International Joint Conferences on Artificial
|
| 584 |
+
553 Intelligence Organization, 7 2019.
|
| 585 |
+
554 [71] Yichi Zhang, Daniel W Apley, and Wei Chen. Bayesian optimization for materials design with
|
| 586 |
+
555 mixed quantitative and qualitative variables. Scientific reports, 10(1):1–13, 2020.
|
| 587 |
+
|
| 588 |
+
# 556 Broader Impact
|
| 589 |
+
|
| 590 |
+
As stated in [32], Bayesian optimization is a powerful optimization technique used in a wide range of industries and applications, such as robotics [37, 9, 52], internet tech companies [18, 34], designing novel molecules for pharmaceutics [19], material design for increasing efficiency of solar cells [71], and aerospace engineering [31]. All of these settings have high-dimensional optimization problems, and advances in BO will reflect on improved capabilities on these fields as well. We have fully opensourced our code for CobBO using the MIT license to be available for researchers and practitioners in these fields, and many others. The ability to optimize a larger number of parameters than has previously been possible will bring further improvements to and further accelerate work in these areas.
|
| 591 |
+
|
| 592 |
+
# Checklist
|
| 593 |
+
|
| 594 |
+
67 The checklist follows the references. Please read the checklist guidelines carefully for information on
|
| 595 |
+
68 how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or
|
| 596 |
+
|
| 597 |
+
[N/A] . You are strongly encouraged to include a justification to your answer, either by referencing 0 the appropriate section of your paper or providing a brief inline description. For example:
|
| 598 |
+
|
| 599 |
+
• Did you include the license to the code and datasets? [Yes] See Section ??.
|
| 600 |
+
• Did you include the license to the code and datasets? [No] The code and the data are proprietary.
|
| 601 |
+
• Did you include the license to the code and datasets? [N/A]
|
| 602 |
+
|
| 603 |
+
Please do not modify the questions and only use the provided macros for your answers. Note that the Checklist section does not count towards the page limit. In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
|
| 604 |
+
|
| 605 |
+
1. For all authors...
|
| 606 |
+
|
| 607 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Section 3.
|
| 608 |
+
(b) Did you describe the limitations of your work? [No]
|
| 609 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Broader Impact.
|
| 610 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 611 |
+
|
| 612 |
+
2. If you are including theoretical results...
|
| 613 |
+
|
| 614 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 3.3.
|
| 615 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See the Appendix A.
|
| 616 |
+
|
| 617 |
+
3. If you ran experiments...
|
| 618 |
+
|
| 619 |
+
(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] In the supplemental material.
|
| 620 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Table 2 in the appendix, which contains the default hyperparameters.
|
| 621 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Fig.5 and Fig.8-10.
|
| 622 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See page 9, line 324.
|
| 623 |
+
|
| 624 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 625 |
+
|
| 626 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 627 |
+
(b) Did you mention the license of the assets? [Yes] MIT license; see the appendix.
|
| 628 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 629 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] See Section 4.2.
|
| 630 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] It does not contain personal identifiable information or offensive content.
|
| 631 |
+
|
| 632 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 633 |
+
|
| 634 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 635 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 636 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/H1eCw3EKvH/H1eCw3EKvH.md
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE WEAKNESSES OF REINFORCEMENT LEARNING FOR NEURAL MACHINE TRANSLATION
|
| 2 |
+
|
| 3 |
+
Leshem Choshen1, Lior $\mathbf { F o x } ^ { 2 }$ , Zohar Aizenbud1, Omri Abend1,3
|
| 4 |
+
|
| 5 |
+
1 School of Computer Science and Engineering, 2 The Edmond and Lily Safra Center for Brain Sciences
|
| 6 |
+
3 Department of Cognitive Sciences
|
| 7 |
+
The Hebrew University of Jerusalem
|
| 8 |
+
first.last@mail.huji.ac.il, oabend@cs.huji.ac.il
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Reinforcement learning (RL) is frequently used to increase performance in text generation tasks, including machine translation (MT), notably through the use of Minimum Risk Training (MRT) and Generative Adversarial Networks (GAN). However, little is known about what and how these methods learn in the context of MT. We prove that one of the most common RL methods for MT does not optimize the expected reward, as well as show that other methods take an infeasibly long time to converge. In fact, our results suggest that RL practices in MT are likely to improve performance only where the pre-trained parameters are already close to yielding the correct translation. Our findings further suggest that observed gains may be due to effects unrelated to the training signal, concretely, changes in the shape of the distribution curve.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Reinforcement learning (RL) is an appealing path for advancement in Machine Translation (MT), as it allows training systems to optimize non-differentiable score functions, common in MT evaluation, as well as tackling the “exposure bias” (Ranzato et al., 2015) in standard training, namely that the model is not exposed during training to incorrectly generated tokens, and is thus unlikely to recover from generating such tokens at test time. These motivations have led to much interest in RL for text generation in general and MT in particular (see $\ S 2$ ). Various policy gradient methods have been used, notably REINFORCE (Williams, 1992) and variants thereof (e.g., Ranzato et al., 2015; Edunov et al., 2018) and Minimum Risk Training (MRT; e.g., Och, 2003; Shen et al., 2016). Another popular use of RL is for training GANs (Yang et al., 2018; Tevet et al., 2018). Nevertheless, despite increasing interest and strong results, little is known about what accounts for these performance gains, and the training dynamics involved.
|
| 17 |
+
|
| 18 |
+
We present the following contributions. First, our theoretical analysis shows that commonly used approximation methods are theoretically ill-founded, and may converge to parameter values that do not minimize the risk, nor are local minima thereof (§2.2).
|
| 19 |
+
|
| 20 |
+
Second, using both naturalistic experiments and carefully constructed simulations, we show that performance gains observed in the literature likely stem not from making target tokens the most probable, but from unrelated effects, such as increasing the peakiness of the output distribution (i.e., the probability mass of the most probable tokens). We do so by comparing a setting where the reward is informative, vs. one where it is constant. In $\ S 4$ we discuss this peakiness effect (PKE).
|
| 21 |
+
|
| 22 |
+
Third, we show that promoting the target token to be the mode is likely to take a prohibitively long time. The only case we find, where improvements are likely, is where the target token is among the first 2-3 most probable tokens according to the pretrained model. These findings suggest that REINFORCE (§5) and CMRT $( \ S 6 )$ are likely to improve over the pre-trained model only under the best possible conditions, i.e., where the pre-trained model is “nearly” correct.
|
| 23 |
+
|
| 24 |
+
We conclude by discussing other RL practices in MT which should be avoided for practical and theoretical reasons, and briefly discuss alternative RL approaches that will allow RL to tackle a larger class of errors in pre-trained models (§7).
|
| 25 |
+
|
| 26 |
+
# 2 RL IN MACHINE TRANSLATION
|
| 27 |
+
|
| 28 |
+
An MT system generates tokens $y = ( y _ { 1 } , . . . , y _ { n } )$ from a vocabulary $V$ one token at a time. The probability of generating $y _ { i }$ given preceding tokens $y _ { < i }$ is given by $P _ { \theta } ( \cdot | x , y _ { < i } )$ , where $x$ is the source sentence and $\theta$ are the model parameters. For each generated token $y _ { i }$ , we denote with $r ( y _ { i } ; y _ { < i } , x , y ^ { ( r e f ) } )$ the score, or reward, for generating $y _ { i }$ given $y _ { < i } , x$ , and the reference sentence $y ^ { ( r e f ) }$ . For brevity, we omit parameters where they are fixed within context. For simplicity, we assume $r$ does not depend on following tokens $y _ { > i }$ .
|
| 29 |
+
|
| 30 |
+
We also assume there is exactly one valid target token, as de facto, training is done against a single reference (Schulz et al., 2018). In practice, either a token-level reward is approximated using MonteCarlo methods (e.g., Yang et al., 2018), or a sentence-level (sparse) reward is given at the end of the episode (sentence). The latter is equivalent to a uniform token-level reward.
|
| 31 |
+
|
| 32 |
+
$r$ is often the negative log-likelihood, or a standard MT metric, e.g., BLEU (Papineni et al., 2002). RL’s goal is to maximize the expected episode reward (denoted with $R$ ); i.e., to find
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\theta ^ { * } = \arg \operatorname* { m a x } _ { \theta } \ R ( \theta ) = \arg \operatorname* { m a x } _ { \theta } \ \mathbb { E } _ { y \sim P _ { \theta } } [ r ( y ) ]
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
# 2.1 REINFORCE
|
| 39 |
+
|
| 40 |
+
For a given source sentence, and past predictions $y _ { < i }$ , REINFORCE (Williams, 1992) samples $k$ tokens $k$ is a hyperparameter) $S = \bar { ( { y ^ { ( 1 ) } } , . . . , y ^ { ( k ) } ) }$ from $P _ { \theta }$ and updates $\theta$ according to this rule:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\Delta \theta \propto \frac { 1 } { k } \sum _ { i = 1 } ^ { k } r ( y _ { i } ) \nabla \log ( P _ { \theta } ( y _ { i } ) )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
The right-hand side of equation 2 is an unbiased estimator of the gradient of the objective function, i.e., $\mathbb { E } \left[ \Delta \theta \right] \propto \nabla _ { \theta } R \left( \theta \right)$ . Therefore, REINFORCE is performing a form of stochastic gradient ascent on $R$ , and has similar formal guarantees. From here follows that if $R$ is constant with respect to $\theta$ , then the expected $\Delta \theta$ prescribed by REINFORCE is zero. We note that $r$ may be shifted by a constant term (called a “baseline”), without affecting the optimal value for $\theta$ .
|
| 47 |
+
|
| 48 |
+
REINFORCE is used in MT, text generation, and image-to-text tasks (Liu et al., 2016; Wu et al., 2018; Rennie et al., 2017; Shetty et al., 2017; Hendricks et al., 2016) – in isolation, or as a part of training (Ranzato et al., 2015). Lately, an especially prominent use for REINFORCE is adversarial training with discrete data, where another network predicts the reward (GAN). For some recent work on RL for NMT, see (Zhang et al., 2016; Li et al., 2017; Wu et al., 2017; Yu et al., 2017; Yang et al., 2018).
|
| 49 |
+
|
| 50 |
+
# 2.2 MINIMUM RISK TRAINING
|
| 51 |
+
|
| 52 |
+
The term Minimum Risk Training (MRT) is used ambiguously in MT to refer either to the application of REINFORCE to minimizing the risk (equivalently, to maximizing the expected reward, the negative loss), or more commonly to a somewhat different estimation method, which we term Contrastive MRT (CMRT) and turn now to analyzing. CMRT was proposed by Och (2003), adapted to NMT by Shen et al. (2016), and often used since (Ayana et al., 2016; Neubig, 2016; Shen et al., 2017; Edunov et al., 2018; Makarov & Clematide, 2018; Neubig et al., 2018).
|
| 53 |
+
|
| 54 |
+
The method works as follows: at each iteration, sample $k$ tokens $S = \{ y _ { 1 } , \dots , y _ { k } \}$ from $P _ { \theta }$ , and update $\theta$ according to the gradient of
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\widetilde { R } ( \theta , S ) = \sum _ { i = 1 } ^ { k } Q _ { \theta , S } ( y _ { i } ) r ( y _ { i } ) = \mathbb { E } _ { y \sim Q } \left[ r ( y ) \right]
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
Q _ { \theta , S } ( y _ { i } ) = \frac { P ( y _ { i } ) ^ { \alpha } } { \sum _ { y _ { j } \in S } P ( y _ { j } ) ^ { \alpha } }
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Commonly (but not universally), deduplication is performed, so $\widetilde { R }$ sums over a set of unique values (Sennrich et al., 2017). This changes little in our empirical results and theoretical analysis.
|
| 67 |
+
|
| 68 |
+
Despite the resemblance in definitions of $R$ (equation 1) and $\widetilde { R }$ (indeed, $\widetilde { R }$ is sometimes presented as an approximation of $R$ ), they differ in two important aspects. First, $Q$ ’s support is $S$ , so increasing
|
| 69 |
+
|
| 70 |
+
$Q ( y _ { i } )$ for some $y _ { i }$ necessarily comes at the expense of $Q ( y )$ for some $y \in S$ . In contrast, increasing $P ( y _ { i } )$ , as in REINFORCE, may come at the expense of $P ( y )$ for any $y \in V$ . Second, $\alpha$ is a smoothness parameter: the closer $\alpha$ is to 0, the closer $Q$ is to be uniform.
|
| 71 |
+
|
| 72 |
+
We show in Appendix A.1 that despite its name, CMRT does not optimize $R$ , nor does it optimize $\mathbb { E } [ { \widetilde { R } } ]$ . That is, it may well converge to values that are not local maxima of $R$ , making it theoretically ill-founded.1 However, given CMRT popularity, the strong results it yielded and the absence of theory for explaining it, we discuss it here. Given a sample $S$ , the gradient of $\widetilde { R }$ is given by
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\nabla \widetilde { R } = \alpha \sum _ { i = 1 } ^ { k } \Big ( Q ( y _ { i } ) \cdot r ( y _ { i } ) \cdot \nabla \log P ( y _ { i } ) \Big ) - \mathbb { E } _ { Q } [ r ] \nabla \log Z ( S )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $\begin{array} { r } { Z ( S ) = \sum _ { i } P ( y _ { i } ) ^ { \alpha } } \end{array}$ . See Appendix A.2.
|
| 79 |
+
|
| 80 |
+
Comparing Equations 2 and 3, the differences between REINFORCE and CMRT are reflected again. First, $\nabla \widetilde R$ has an additional term, proportional to $\nabla \log Z ( S )$ , which yields the contrastive effect. This contrast may improve the rate of convergence since it counters the decrease of probability mass for non-sampled tokens.
|
| 81 |
+
|
| 82 |
+
Second, given $S$ , the relative weighting of the gradients $\nabla \log P ( y _ { i } )$ is proportional to $r ( y _ { i } ) Q ( y _ { i } )$ , or equivalently to $r ( y _ { i } ) P ( y _ { i } ) ^ { \alpha }$ . CMRT with deduplication sums over distinct values in $S$ (equation 3), while REINFORCE sums over all values. This means that the relative weight of the unique value $y _ { i }$ is $\frac { r ( y _ { i } ) | \{ y _ { i } \in S \} | } { k }$ in REINFORCE. For $\alpha = 1$ the expected value of these relative weights is the same, and so for $\alpha < 1$ (as is commonly used), more weight is given to improbable tokens, which could also have a positive effect on the convergence rate.2 However, if $\alpha$ is too close to 0, $\nabla \widetilde R$ vanishes, as it is not affected by $\theta$ . This tradeoff explains the importance of tuning $\alpha$ reported in the literature. In $\ S 6$ we present simulations with CMRT, showing very similar trends as presented by REINFORCE.
|
| 83 |
+
|
| 84 |
+
# 3 MOTIVATING DISCUSSION
|
| 85 |
+
|
| 86 |
+
Implementing a stochastic gradient ascent, REINFORCE is guaranteed to converge to a stationary point of $R$ under broad conditions. However, not much is known about its convergence rate under the prevailing conditions in NMT.
|
| 87 |
+
|
| 88 |
+
We begin with a qualitative, motivating analysis of these questions. As work on language generation empirically showed, RNNs quickly learn to output very peaky distributions (Press et al., 2017). This tendency is advantageous for generating fluent sentences with high probability, but may also entail slower convergence rates when using RL to fine-tune the model, because RL methods used in text generation sample from the (pretrained) policy distribution, which means they mostly sample what the pretrained model deems to be likely. Since the pretrained model (or policy) is peaky, exploration of other potentially more rewarding tokens will be limited, hampering convergence.
|
| 89 |
+
|
| 90 |
+
Intuitively, REINFORCE increases the probabilities of successful (positively rewarding) observations, weighing updates by how rewarding they were. When sampling a handful of tokens in each context (source sentence $x$ and generated prefix $y _ { < i , }$ ), and where the number of epochs is not large, it is unlikely that more than a few unique tokens will be sampled from $P _ { \theta } ( \cdot | x , y _ { < i } )$ . (In practice, $k$ is typically between 1 and 20, and the number of epochs between 1 and 100.) It is thus unlikely that anything but the initially most probable candidates will be observed. Consequently, REINFORCE initially raises their probabilities, even if more rewarding tokens can be found down the list.
|
| 91 |
+
|
| 92 |
+
We thus hypothesize the peakiness of the distribution, i.e., the probability mass allocated to the most probable tokens, will increase, at least in the first phase. We call this the peakiness-effect (PKE), and show it occurs both in simulations (§4.1) and in full-scale NMT experiments (§4.2).
|
| 93 |
+
|
| 94 |
+
With more iterations, the most-rewarding tokens will be eventually sampled, and gradually gain probability mass. This discussion suggests that training will be extremely sample-inefficient. We assess the rate of convergence empirically in $\ S 5$ , finding this to be indeed the case.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 1: A histogram of the update size (x-axis) to the total predicted probability of the 10 most probable tokens (left) or the most probable token (right) in the Constant Reward setting. An update is overwhelmingly more probable to increase this probability than to decrease it.
|
| 98 |
+
|
| 99 |
+
# 4 THE PEAKINESS EFFECT
|
| 100 |
+
|
| 101 |
+
We turn to demonstrate that the initially most probable tokens will initially gain probability mass, even if they are not the most rewarding, yielding a PKE.
|
| 102 |
+
|
| 103 |
+
Caccia et al. (2018) recently observed in the context of language modeling using GANs that performance gains similar to those GAN yield can be achieved by decreasing the temperature for the prediction softmax (i.e., making it peakier). However, they proposed no causes for this effect. Our findings propose an underlying mechanism leading to this trend. We return to this point in $^ { \ S 7 }$ . Furthermore, given their findings, it is reasonable to assume that our results are relevant for RL use in other generation tasks, whose output space too is discrete, high-dimensional and concentrated.
|
| 104 |
+
|
| 105 |
+
# 4.1 CONTROLLED SIMULATIONS
|
| 106 |
+
|
| 107 |
+
We experiment with a 1-layer softmax model, that predicts a single token $i \in V$ with probability $\frac { e ^ { \theta _ { i } } } { \sum _ { j } e ^ { \theta _ { j } } }$ . $\theta = \{ \theta _ { j } \} _ { j \in V }$ are the model’s parameters. This model simulates the top of any MT decoder that ends with a softmax layer, as essentially all NMT decoders do. To make experiments realistic, we use similar parameters as those reported in the influential Transformer NMT system (Vaswani et al., 2017). Specifically, the size of $V$ (distinct BPE tokens) is 30,715, and the initial values for $\theta$ were sampled from 1,000 sets of logits taken from decoding the standard newstest2013 development set, using a pretrained Transformer model. The model was pretrained on WMT2015 training data (Bojar et al., 2015). Hyperparameters are reported in Appendix A.3. We define one of the tokens in $V$ to be the target token and denote it with $y _ { b e s t }$ . We assign deterministic token reward, this makes learning easier than when relying on approximations and our predictions optimistic. We experiment with two reward functions:
|
| 108 |
+
|
| 109 |
+
1. Simulated Reward: $r ( y ) = 2$ for $y = y _ { b e s t }$ , $r ( y ) = 1$ if $y$ is one of the 10 initially highest scoring tokens, and $r ( y ) = 0$ otherwise. This simulates a condition where the pretrained model is of decent but sub-optimal quality. $r$ here is at the scale of popular rewards used in MT, such as GAN-based rewards or BLEU (which are between 0 and 1). 2. Constant Reward: $r$ is constantly equal to 1, for all tokens. This setting is aimed to confirm that PKE is not a result of the signal carried by the reward.
|
| 110 |
+
|
| 111 |
+
Experiments with the first setting were run 100 times, each time for 50K steps, updating $\theta$ after each step. With the second setting, it is sufficient to take a single step at a time, as the expected update after each step is zero, and so any $\mathrm { P K E }$ seen in a single step is only accentuated in the next. It is, therefore, more telling to run more repetitions rather than more steps per initialization. We, therefore, sample 10,000 pretrained distributions, and perform a single REINFORCE step.
|
| 112 |
+
|
| 113 |
+
As RL training lasts about 30 epochs before stopping, samples about $1 0 0 \mathrm { K }$ tokens per epoch, and as the network already predicts $y _ { b e s t }$ in about two thirds of the contexts,3 we estimate the number of steps used in practice to be in the order of magnitude of 1M. For visual clarity, we present figures for 50K-100K steps. However, full experiments (with 1M steps) exhibit similar trends: where REINFORCE was not close to converging after 50K steps, the same was true after 1M steps.
|
| 114 |
+
|
| 115 |
+
We evaluate the peakiness of a distribution in terms of the probability of the most probable token (the mode), the total probability of the ten most probable tokens, and the entropy of the distribution (lower entropy indicates more peakiness).
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 2: Token probabilities through REINFORCE training, in the controlled simulations in the Simulated Reward setting. The left/center/right figures correspond to simulations where the target token $( y _ { b e s t } )$ was initially the second/third/fourth most probable token. The green line corresponds to the target token, yellow lines to medium-reward tokens and red lines to no-reward tokens.
|
| 119 |
+
|
| 120 |
+
Results. The distributions become peakier in terms of all three measures: on average, the mode’s probability and the 10 most probable tokens increases, and the entropy decreases. Figure 1a presents the histogram of the update size, the difference in the probability of the $1 0 \mathrm { m o s t }$ probable tokens in the Constant Reward setting, after a single step. Figure 1b depicts similar statistics for the mode. The average entropy in the pretrained model is 2.9 is reduced to 2.85 after one REINFORCE step.
|
| 121 |
+
|
| 122 |
+
Simulated Reward setting shows similar trends. For example, entropy decreases from 3 to about 0.001 in 100K steps. This extreme decrease suggests it is effectively a deterministic policy. $\mathrm { P K E }$ is achieved in a few hundred steps, usually before other effects become prominent (see Figure 2), and is stronger than for Constant Reward.
|
| 123 |
+
|
| 124 |
+
# 4.2 NMT EXPERIMENTS
|
| 125 |
+
|
| 126 |
+
We turn to analyzing a real-world application of REINFORCE to NMT. Important differences between this and the previous simulations are: (1) it is rare in NMT for REINFORCE to sample from the same conditional distribution more than a handful of times, given the number of source sentences $x$ and sentence prefixes $y _ { < i }$ (contexts); and (2) in NMT $P _ { \theta } ( \cdot | x , y _ { < i } )$ shares parameters between contexts, which means that updating $P _ { \theta }$ for one context may influence $P _ { \theta }$ for another.
|
| 127 |
+
|
| 128 |
+
We follow the same pretraining as in $\ S 4 . 1$ . We then follow Yang et al. (2018) in defining the reward function based on the expected BLEU score. Expected BLEU is computed by sampling suffixes for the sentence, and averaging the BLEU score of the sampled sentences against the reference.
|
| 129 |
+
|
| 130 |
+
We use early stopping with a patience of 10 epochs, where each epoch consists of 5,000 sentences sampled from the WMT2015 (Bojar et al., 2015) German-English training data. We use $k = 1$ . We retuned the learning-rate, and positive baseline settings against the development set. Other hyper-parameters were an exact replication of the experiments reported in (Yang et al., 2018).
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 3: The cumulative distribution of the probability of the most likely token in the NMT experiments. The green distribution corresponds to the pretrained model, and the blue corresponds to the reinforced model. The yaxis is the proportion of conditional probabilities with a mode of value $\leq x$ (the $\mathbf { X }$ -axis). Note that a lower cumulative percentage means a more peaked output distribution. A lower cumulative percentage means a more peaked output distribution.
|
| 134 |
+
|
| 135 |
+
Results. Results indicate an increase in the peakiness of the conditional distributions. Our results are based on a sample of 1,000 contexts from the pretrained model, and another (independent) sample from the reinforced model.
|
| 136 |
+
|
| 137 |
+
The modes of the conditional distributions tend to increase. Figure 3 presents the distribution of the modes’ probability in the reinforced conditional distributions compared with the pretrained model, showing a shift of probability mass towards higher probabilities for the mode, following RL. Another indication of the increased peakiness is the decrease in the average entropy of $P _ { \theta }$ , which was reduced from 3.45 in the pretrained model to an average of 2.82 following RL. This more modest reduction in entropy (compared to $\ S 4 . 1$ ) might also suggest that the procedure did not converge to the optimal value for $\theta$ , as then we would have expected the entropy to substantially drop if not to 0 (overfit), then to the average entropy of valid next tokens (given the source and a prefix of the sentence).
|
| 138 |
+
|
| 139 |
+
# 5 PERFORMANCE FOLLOWING REINFORCE
|
| 140 |
+
|
| 141 |
+
We now turn to assessing under what conditions it is likely that REINFORCE will lead to an improvement in the performance of an NMT system. As in the previous section, we use both controlled simulations and NMT experiments.
|
| 142 |
+
|
| 143 |
+
# 5.1 CONTROLLED SIMULATIONS
|
| 144 |
+
|
| 145 |
+
We use the same model and experimental setup described in Section 4.1, this time only exploring the Simulated Reward setting, as a Constant Reward is not expected to converge to any meaningful $\theta$ . Results are averaged over 100 conditional distributions sampled from the pretrained model.
|
| 146 |
+
|
| 147 |
+
Caution should be exercised when determining the learning rate (LR). Common LRs used in the NMT literature are of the scale of $1 0 ^ { - 4 }$ . However, in our simulations, no LR smaller than 0.1 yielded any improvement in $R$ . We thus set the LR to be 0.1. We note that in our simulations, a higher learning rate means faster convergence as our reward is noise-free: it is always highest for the best option. In practice, increasing the learning rate may deteriorate results, as it may cause the system to overfit to the sampled instances. Indeed, when increasing the learning rate in our NMT experiments (see below) by an order of magnitude, early stopping caused the RL procedure to stop without any parameter updates.
|
| 148 |
+
|
| 149 |
+
Figure 2 shows the change in $P _ { \theta }$ over the first 50K REINFORCE steps (probabilities are averaged over 100 repetitions), for a case where $y _ { b e s t }$ was initially the second, third and fourth most probable. Although these are the easiest settings, and despite the high learning rate, it fails to make $y _ { b e s t }$ the mode of the distribution within $1 0 0 \mathrm { K }$ steps, unless $y _ { b e s t }$ was initially the second most probable. In cases where $y _ { b e s t }$ is initially of a lower rank than four, it is hard to see any increase in its probability, even after 1M steps.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 4: Cumulative percentage of contexts where the pretrained model ranks $y _ { b e s t }$ in rank $_ x$ or below and where it does not rank $y _ { b e s t }$ first $( x = 0$ ). In about half the cases it is ranked fourth or below.
|
| 153 |
+
|
| 154 |
+
# 5.2 NMT EXPERIMENTS
|
| 155 |
+
|
| 156 |
+
We trained an NMT system, using the same procedure as in Section 4.2, and report BLEU scores over the news2014 test set. After training with an expected BLEU reward, we indeed see a minor improvement which is consistent between trials and pretrained models. While the pretrain BLEU score is 30.31, the reinforced one is 30.73.
|
| 157 |
+
|
| 158 |
+
Analyzing what words were influenced by the RL procedure, we begin by computing the cumulative probability of the target token $y _ { b e s t }$ to be ranked lower than a given rank according to the pretrained model. Results (Figure 4) show that in about half of the cases, $y _ { b e s t }$ is not among the top three choices of the pretrained model, and we thus expect it not to gain substantial probability following REINFORCE, according to our simulations.
|
| 159 |
+
|
| 160 |
+
We next turn to compare the ranks the reinforced model assigns to the target tokens, and their ranks according to the pretrained model. Figure 6 presents the difference in the probability that $y _ { b e s t }$ is ranked at a given rank following RL and the probability it is ranked there initially. Results indicate that indeed more target tokens are ranked first, and less second, but little consistent shift of probability mass occurs otherwise across the ten first ranks. It is possible that RL has managed to push $y _ { b e s t }$ in some cases between very low ranks $( < 1 , 0 0 0 )$ to medium-low ranks (between 10 and 1,000). However, token probabilities in these ranks are so low that it is unlikely to affect the system outputs in any way. This fits well with the results of our simulations that predicted that only the initially top-ranked tokens are likely to change.
|
| 161 |
+
|
| 162 |
+
In an attempt to explain the improved BLEU score following RL with PKE, we repeat the NMT experiment this time using a constant reward of 1. Our results present a nearly identical improvement in BLEU, achieving 30.72, and a similar pattern in the change of the target tokens’ ranks (see Appendix 8). Therefore, there is room to suspect that even in cases where RL yields an improvement in BLEU, it may partially result from reward-independent factors, such as PKE.4
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 5: The probability of different tokens following CMRT, in the controlled simulations in the Simulated Reward setting. The left/right figures correspond to simulations where the target token $( y _ { b e s t } )$ was initially the second/third most probable token. The green line corresponds to the target token, yellow lines to medium-reward tokens and red lines to tokens with $r ( y ) = 0$ .
|
| 166 |
+
|
| 167 |
+
# 6 EXPERIMENTS WITH CONTRASTIVE MRT
|
| 168 |
+
|
| 169 |
+
In $\ S 2 . 2$ we showed that CMRT does not, in fact, maximize $R$ , and so does not enjoy the same theoretical guarantees as REINFORCE and similar policy gradient methods. However, being the RL procedure of choice in much recent work we repeat the simulations described in $\ S 4$ and $\ S 5$ , assessing CMRT’s performance in these conditions. We experiment with $\alpha = 0 . 0 0 5$ and $k = 2 0$ , common settings in the literature, and average over 100 trials.
|
| 170 |
+
|
| 171 |
+
Figure 5 shows how the distribution $P _ { \theta }$ changes over the course of 50K update steps to $\theta$ , where $y _ { b e s t }$ is taken to be the second and third initially most probable token (Simulated Reward setting). Results are similar in trends to those obtained with REINFORCE: MRT succeeds in pushing $y _ { b e s t }$ to be the highest ranked token if it was initially second, but struggles where it was initially ranked third or below. We only observe a small $\mathrm { P K E }$ in MRT. This is probably due to the contrastive effect, which means that tokens that were not sampled do not lose probability mass.
|
| 172 |
+
|
| 173 |
+
All graphs we present here allow sampling the same token more than once in each batch (i.e., $S$ is a sample with replacements). Simulations with deduplication show similar results.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 6: Difference between the ranks of $y _ { b e s t }$ in the reinforced and the pretrained model. Each column $_ x$ corresponds to the difference in the probability that $y _ { b e s t }$ is ranked in rank $x$ in the reinforced model, and the same probability in the pretrained model.
|
| 177 |
+
|
| 178 |
+
# 7 DISCUSSION
|
| 179 |
+
|
| 180 |
+
In this paper, we showed that the type of distributions used in NMT entail that promoting the target token to be the mode is likely to take a prohibitively long times for existing RL practices, except under the best conditions (where the pretrained model is “nearly” correct). This leads us to conclude that observed improvements from using RL for NMT are likely due either to fine-tuning the most probable tokens in the pretrained model (an effect which may be more easily achieved using reranking methods, and uses but little of the power of RL methods), or to effects unrelated to the signal carried by the reward, such as PKE. Another contribution of this paper is in showing that CMRT does not optimize the expected reward and is thus theoretically unmotivated.
|
| 181 |
+
|
| 182 |
+
A number of reasons lead us to believe that in our NMT experiments, improvements are not due to the reward function, but to artefacts such as PKE. First, reducing a constant baseline from $r$ , so as to make the expected reward zero, disallows learning. This is surprising, as REINFORCE, generally and in our simulations, converges faster where the reward is centered around zero, and so the fact that this procedure here disallows learning hints that other factors are in play. As PKE can be observed even where the reward is constant (if the expected reward is positive; see $\ S 4 . 1 \ r _ { \cdot }$ ), this suggests PKE may play a role here. Second, we observe more peakiness in the reinforced model and in such cases, we expect improvements in BLEU (Caccia et al., 2018). Third, we achieve similar results with a constant reward in our NMT experiments (§5.2). Fourth, our controlled simulations show that asymptotic convergence is not reached in any but the easiest conditions (§5.1).
|
| 183 |
+
|
| 184 |
+
Our analysis further suggests that gradient clipping, sometimes used in NMT (Zhang et al., 2016; Wieting et al., 2019), is expected to hinder convergence further. It should be avoided when using REINFORCE as it violates REINFORCE’s assumptions.
|
| 185 |
+
|
| 186 |
+
The per-token sampling as done in our experiments is more exploratory than beam search (Wu et al., 2018), reducing PKE. Furthermore, the latter does not sample from the behavior policy, but does not properly account for being off-policy in the parameter updates.
|
| 187 |
+
|
| 188 |
+
Adding the reference to the sample $S$ , which some implementations allow (Sennrich et al., 2017) may help reduce the problems of never sampling the target tokens. However, as Edunov et al. (2018) point out, this practice may lower results, as it may destabilize training by leading the model to improve over outputs it cannot generalize over, as they are very different from anything the model assigns a high probability to, at the cost of other outputs.
|
| 189 |
+
|
| 190 |
+
# 8 CONCLUSION
|
| 191 |
+
|
| 192 |
+
The standard MT scenario poses several uncommon challenges for RL. First, the action space in MT problems is a high-dimensional discrete space (generally in the size of the vocabulary of the target language or the product thereof for sentences). This contrasts with the more common scenario studied by contemporary RL methods, which focuses mostly on much smaller discrete action spaces (e.g., video games (Mnih et al., 2015; 2016)), or continuous action spaces of relatively low dimensions (e.g., simulation of robotic control tasks (Lillicrap et al., 2015)). Second, reward for MT is naturally very sparse – almost all possible sentences are “wrong” (hence, not rewarding) in a given context. Finally, it is common in MT to use RL for tuning a pretrained model. Using a pretrained model ameliorates the last problem. But then, these pretrained models are in general quite peaky, and because training is done on-policy – that is, actions are being sampled from the same model being optimized – exploration is inherently limited.
|
| 193 |
+
|
| 194 |
+
Here we argued that, taken together, these challenges result in significant weaknesses for current RL practices for NMT, that may ultimately prevent them from being truly useful. At least some of these challenges have been widely studied in the RL literature, with numerous techniques developed to address them, but were not yet adopted in NLP. We turn to discuss some of them.
|
| 195 |
+
|
| 196 |
+
Off-policy methods, in which observations are sampled from a different policy than the one being currently optimized, are prominent in RL (Watkins & Dayan, 1992; Sutton & Barto, 1998), and were also studied in the context of policy gradient methods (Degris et al., 2012; Silver et al., 2014). In principle, such methods allow learning from a more “exploratory” policy. Moreover, a key motivation for using $\alpha$ in CMRT is smoothing; off-policy sampling allows smoothing while keeping convergence guarantees.
|
| 197 |
+
|
| 198 |
+
In its basic form, exploration in REINFORCE relies on stochasticity in the action-selection (in MT, this is due to sampling). More sophisticated exploration methods have been extensively studied, for example using measures for the exploratory usefulness of states or actions (Fox et al., 2018), or relying on parameter-space noise rather than action-space noise (Plappert et al., 2017).
|
| 199 |
+
|
| 200 |
+
For MT, an additional challenge is that even effective exploration (sampling diverse sets of observations), may not be enough, since the state-action space is too large to be effectively covered, with almost all sentences being not rewarding. Recently, diversity-based and multi-goal methods for RL were proposed to tackle similar challenges (Andrychowicz et al., 2017; Ghosh et al., 2018; Eysenbach et al., 2019). We believe the adoption of such methods is a promising path forward for the application of RL in NLP.
|
| 201 |
+
|
| 202 |
+
# 9 ACKNOWLEDGMENTS
|
| 203 |
+
|
| 204 |
+
This work was supported by the Israel Science Foundation (grant no. 929/17) and by the HUJI Cyber Security Research Center in conjunction with the Israel National Cyber Bureau in the Prime Minister’s Office.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems, pp. 5048–5058, 2017.
|
| 209 |
+
|
| 210 |
+
Shiqi Shen Ayana, Zhiyuan Liu, and Maosong Sun. Neural headline generation with minimum risk training. arXiv preprint arXiv:1604.01904, 2016.
|
| 211 |
+
|
| 212 |
+
Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Barry Haddow, Matthias Huck, Chris Hokamp, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Matt Post, Carolina Scarton, Lucia Specia, and Marco Turchi. Findings of the 2015 workshop on statistical machine translation. In WMT@EMNLP, 2015.
|
| 213 |
+
|
| 214 |
+
Massimo Caccia, Lucas Caccia, William Fedus, Hugo Larochelle, Joelle Pineau, and Laurent Charlin. Language gans falling short. arXiv preprint arXiv:1811.02549, 2018. URL https: //arxiv.org/pdf/1811.02549.pdf.
|
| 215 |
+
|
| 216 |
+
Thomas Degris, Martha White, and Richard S Sutton. Off-policy actor-critic. arXiv preprint arXiv:1205.4839, 2012.
|
| 217 |
+
|
| 218 |
+
Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Classical structured prediction losses for sequence to sequence learning. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 355–364. Association for Computational Linguistics, 2018. doi: 10.18653/v1/N18-1033. URL http://aclweb.org/anthology/ N18-1033.
|
| 219 |
+
|
| 220 |
+
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, 2019. URL https://openreview.net/forum?id $=$ SJx63jRqFm.
|
| 221 |
+
|
| 222 |
+
Lior Fox, Leshem Choshen, and Yonatan Loewenstein. Dora the explorer: Directed outreaching reinforcement action-selection. ICLR, abs/1804.04012, 2018.
|
| 223 |
+
|
| 224 |
+
Dibya Ghosh, Avi Singh, Aravind Rajeswaran, Vikash Kumar, and Sergey Levine. Divide-andconquer reinforcement learning. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJwelMbR-.
|
| 225 |
+
|
| 226 |
+
Lisa Anne Hendricks, Zeynep Akata, Marcus Rohrbach, Jeff Donahue, Bernt Schiele, and Trevor Darrell. Generating visual explanations. In ECCV, 2016.
|
| 227 |
+
|
| 228 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015.
|
| 229 |
+
|
| 230 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondrej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open source toolkit for statistical machine translation. In Proceedings of the 45th Annual Meeting of the Association for Computational Linguistics Companion Volume Proceedings of the Demo and Poster Sessions, pp. 177–180, 2007.
|
| 231 |
+
|
| 232 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Sébastien Jean, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2157–2169, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/ D17-1230.
|
| 233 |
+
|
| 234 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 235 |
+
|
| 236 |
+
Siqi Liu, Zhenhai Zhu, Ning Ye, Sergio Guadarrama, and Kevin Murphy. Optimization of image description metrics using policy gradient methods. CoRR, abs/1612.00370, 2, 2016.
|
| 237 |
+
|
| 238 |
+
Peter Makarov and Simon Clematide. Neural transition-based string transduction for limitedresource setting in morphology. In COLING, 2018.
|
| 239 |
+
|
| 240 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 241 |
+
|
| 242 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pp. 1928–1937, 2016.
|
| 243 |
+
|
| 244 |
+
Graham Neubig. Lexicons and minimum risk training for neural machine translation: Naist-cmu at wat2016. In WAT@COLING, 2016.
|
| 245 |
+
|
| 246 |
+
Graham Neubig, Matthias Sperber, Xinyi Wang, Matthieu Felix, Austin Matthews, Sarguna Padmanabhan, Ye Qi, Devendra Singh Sachan, Philip Arthur, Pierre Godard, John Hewitt, Rachid Riad, and Liming Wang. Xnmt: The extensible neural machine translation toolkit. In AMTA, 2018.
|
| 247 |
+
|
| 248 |
+
Franz Josef Och. Minimum error rate training in statistical machine translation. In Proceedings of the 41st Annual Meeting on Association for Computational Linguistics-Volume 1, pp. 160–167. Association for Computational Linguistics, 2003.
|
| 249 |
+
|
| 250 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002. URL https://www.aclweb.org/anthology/P02-1040.pdf.
|
| 251 |
+
|
| 252 |
+
Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter space noise for exploration. arXiv preprint arXiv:1706.01905, 2017.
|
| 253 |
+
|
| 254 |
+
O. Press, A. Bar, B. Bogin, J. Berant, and L. Wolf. Language generation with recurrent generative adversarial networks without pre-training. In Fist Workshop on Learning to Generate Natural Language@ICML, 2017.
|
| 255 |
+
|
| 256 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. arXiv preprint arXiv:1511.06732, 2015.
|
| 257 |
+
|
| 258 |
+
Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7008–7024, 2017.
|
| 259 |
+
|
| 260 |
+
Keisuke Sakaguchi, Matt Post, and Benjamin Van Durme. Grammatical error correction with neural reinforcement learning. arXiv preprint arXiv:1707.00299, 2017.
|
| 261 |
+
|
| 262 |
+
Philip Schulz, Wilker Aziz, and Trevor Cohn. A stochastic decoder for neural machine translation. In ACL, 2018.
|
| 263 |
+
|
| 264 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1715–1725, 2016. URL http://www. aclweb.org/anthology/P16-1162.
|
| 265 |
+
|
| 266 |
+
Rico Sennrich, Orhan Firat, Kyunghyun Cho, Alexandra Birch, Barry Haddow, Julian Hitschler, Marcin Junczys-Dowmunt, Samuel Läubli, Antonio Valerio Miceli Barone, Jozef Mokry, and Maria Nadejde. Nematus: a toolkit for neural machine translation. In EACL, 2017.
|
| 267 |
+
|
| 268 |
+
Shiqi Shen, Yong Cheng, Zhongjun He, Wei He, Hua Wu, Maosong Sun, and Yang Liu. Minimum risk training for neural machine translation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1683–1692. Association for Computational Linguistics, 2016. doi: 10.18653/v1/P16-1159. URL http://aclweb. org/anthology/P16-1159.
|
| 269 |
+
|
| 270 |
+
Shiqi Shen, Yang Liu, and Maosong Sun. Optimizing non-decomposable evaluation metrics for neural machine translation. Journal of Computer Science and Technology, 32:796–804, 2017.
|
| 271 |
+
|
| 272 |
+
Rakshith Shetty, Marcus Rohrbach, Lisa Anne Hendricks, Mario Fritz, and Bernt Schiele. Speaking the same language: Matching machine to human captions by adversarial training. In 2017 IEEE International Conference on Computer Vision (ICCV), pp. 4155–4164. IEEE, 2017.
|
| 273 |
+
|
| 274 |
+
David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In ICML, 2014.
|
| 275 |
+
|
| 276 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 1998.
|
| 277 |
+
|
| 278 |
+
G. Tevet, G. Habib, V. Shwartz, and J. Berant. Evaluating text GANs as language models. arXiv preprint arXiv:1810.12686, 2018.
|
| 279 |
+
|
| 280 |
+
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):26– 31, 2012.
|
| 281 |
+
|
| 282 |
+
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. URL https://papers.nips.cc/paper/ 7181-attention-is-all-you-need.pdf.
|
| 283 |
+
|
| 284 |
+
Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8(3-4):279–292, 1992.
|
| 285 |
+
|
| 286 |
+
John Wieting, Taylor Berg-Kirkpatrick, Kevin Gimpel, and Graham Neubig. Beyond BLEU: Training neural machine translation with semantic similarity. In The 57th Annual Meeting of the Association for Computational Linguistics (ACL), Florence, Italy, July 2019. URL https: //arxiv.org/abs/1909.06694.
|
| 287 |
+
|
| 288 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 289 |
+
|
| 290 |
+
Lijun Wu, Yingce Xia, Li Zhao, Fei Tian, Tao Qin, Jianhuang Lai, and Tie-Yan Liu. Adversarial neural machine translation. arXiv preprint arXiv:1704.06933, 2017.
|
| 291 |
+
|
| 292 |
+
Lijun Wu, Fei Tian, Tao Qin, Jianhuang Lai, and Tie-Yan Liu. A study of reinforcement learning for neural machine translation. In EMNLP, 2018.
|
| 293 |
+
|
| 294 |
+
Zhen Yang, Wei Chen, Feng Wang, and Bo Xu. Improving neural machine translation with conditional sequence generative adversarial nets. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1346–1355. Association for Computational Linguistics, 2018. doi: 10.18653/v1/N18-1122. URL http://aclweb.org/anthology/N18-1122.
|
| 295 |
+
|
| 296 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, pp. 2852–2858, 2017.
|
| 297 |
+
|
| 298 |
+
Jiac heng Zhang, Yanzhuo Ding, Shiqi Shen, Yong Cheng, Maosong Sun, Huanbo Luan, and Yang Liu. Thumt: An open source toolkit for neural machine translation. arXiv preprint arXiv:1706.06415, 2017.
|
| 299 |
+
|
| 300 |
+
Yizhe Zhang, Zhe Gan, and Lawrence Carin. Generating text via adversarial training. In NIPS workshop on Adversarial Training, volume 21, 2016.
|
| 301 |
+
|
| 302 |
+
# A APPENDIX
|
| 303 |
+
|
| 304 |
+
A.1 CONTRASTIVE MRT DOES NOT MAXIMIZE THE EXPECTED REWARD
|
| 305 |
+
|
| 306 |
+
We hereby detail a simple example where following the Contrastive MRT method (see $\ S 2 . 2$ ) does not converge to the parameter value that maximizes $R$ .
|
| 307 |
+
|
| 308 |
+
Let $\theta$ be a real number in $[ 0 , 0 . 5 ]$ , and let $P _ { \theta }$ be a family of distributions over three values $a , b , c$ such that:
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
P _ { \theta } ( x ) = { \left\{ \begin{array} { l l } { \theta } & { x = a } \\ { 2 \theta ^ { 2 } } & { x = b } \\ { 1 - \theta - 2 \theta ^ { 2 } } & { x = c } \end{array} \right. }
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
Let $r ( a ) = 1 , r ( b ) = 0 , r ( c ) = 0 . 5$ . The expected reward as a function of $\theta$ is:
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
R ( \theta ) = \theta + 0 . 5 ( 1 - \theta - 2 \theta ^ { 2 } )
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
$R ( \theta )$ is uniquely maximized by $\theta ^ { * } = 0 . 2 5$ .
|
| 321 |
+
|
| 322 |
+
Table 1 details the possible samples of size $k = 2$ , their probabilities, the corresponding $\widetilde { R }$ and its gradient. Standard numerical methods show that $\mathbb { E } [ \nabla \widetilde { R } ]$ over possible samples $S$ is positive for $\theta \in ( 0 , \gamma )$ and negative for $\theta \in ( \gamma , 0 . 5 ]$ , where $\gamma \approx 0 . 2 9 5$ . This means that for any initialization of $\theta \in ( 0 , 0 . 5 ]$ , Contrastive MRT will converge to $\gamma$ if the learning rate is sufficiently small. For $\theta = 0$ , $\widetilde { R } \equiv 0 . 5$ , and there will be no gradient updates, so the method will converge to $\theta = 0$ . Neither of these values maximizes $R ( \theta )$ .
|
| 323 |
+
|
| 324 |
+
We note that by using some $g \left( \theta \right)$ the $\gamma$ could be arbitrarily far from $\theta ^ { * }$ . $g$ could also map to $( - i n f , i n f )$ more often used in neural networks parameters.
|
| 325 |
+
|
| 326 |
+
We further note that resorting to maximizing $\mathbb { E } [ { \widetilde { R } } ]$ instead, does not maximize $R ( \theta )$ either. Indeed, plotting $\mathbb { E } [ { \widetilde { R } } ]$ as a function of $\theta$ for this example, yields a maximum at $\theta \approx 0 . 3 2$ .
|
| 327 |
+
|
| 328 |
+
<table><tr><td rowspan=1 colspan=1>S</td><td rowspan=1 colspan=1>P(S)</td><td rowspan=1 colspan=1>R</td><td rowspan=1 colspan=1>VR</td></tr><tr><td rowspan=1 colspan=1>{a,b}</td><td rowspan=1 colspan=1>403</td><td rowspan=1 colspan=1>11+20</td><td rowspan=1 colspan=1>-2(1+20)2</td></tr><tr><td rowspan=1 colspan=1>{a,c}</td><td rowspan=1 colspan=1>20(1-0-202)</td><td rowspan=1 colspan=1>0.5 + θ2-402</td><td rowspan=1 colspan=1>2x²+12(1-202)2</td></tr><tr><td rowspan=1 colspan=1>{b,c}</td><td rowspan=1 colspan=1>402(1-0-202)</td><td rowspan=1 colspan=1>1-0-2022-20</td><td rowspan=1 colspan=1>0²-20(1-0)2</td></tr><tr><td rowspan=1 colspan=1>a,a</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>b,b</td><td rowspan=1 colspan=1>404</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>c,c</td><td rowspan=1 colspan=1>(1-0-202)2</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0</td></tr></table>
|
| 329 |
+
|
| 330 |
+
Table 1: The gradients of $\widetilde { R }$ for each possible sample $S$ . The batch size is $k = 2$ . Rows correspond to different sampled outcomes. $\nabla \widetilde R$ is the gradient of $\widetilde { R }$ given the corresponding value for $S$ .
|
| 331 |
+
|
| 332 |
+
# A.2 DERIVING THE GRADIENT OF $\widetilde { R }$
|
| 333 |
+
|
| 334 |
+
Given $S$ , recall the definition of $\widetilde { R }$ :
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\widetilde { R } ( \theta , S ) = \sum _ { i = 1 } ^ { k } Q _ { \theta , S } ( y _ { i } ) r ( y _ { i } )
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Taking the deriviative w.r.t. $\theta$ :
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 7: The probability of different tokens following REINFORCE, in the controlled simulations in the Constant Reward setting. The left/center/right figures correspond to simulations where the target token $( y _ { b e s t } )$ was initially the second/third/fourth most probable token. The green line corresponds to the target token, yellow lines to medium-reward tokens and red lines to tokens with $\bar { \boldsymbol { r } } ( y ) = 0$ .
|
| 344 |
+
|
| 345 |
+
# A.3 NMT IMPLEMENTATION DETAILS
|
| 346 |
+
|
| 347 |
+
True casing and tokenization were used (Koehn et al., 2007), including escaping html symbols and "-" that represents a compound was changed into a separate token of $=$ . Some preprocessing used before us converted the latter to ##AT##-##AT## but standard tokenizers in use process that into 11 different tokens, which over-represents the significance of that character when BLEU is calculated. BPE (Sennrich et al., 2016) extracted 30,715 tokens. For the MT experiments we used 6 layers in the encoder and the decoder. The size of the embeddings was 512. Gradient clipping was used with size of 5 for pre-training (see Discussion on why not to use it in training). We did not use attention dropout, but 0.1 residual dropout rate was used. In pretraining and training sentences of more than 50 tokens were discarded. Pretraining and training were considered finished when BLEU did not increase in the development set for 10 consecutive evaluations, and evaluation was done every 1,000 and 5,000 for batches of size 100 and 256 for pretraining and training respectively. Learning rate used for rmsprop (Tieleman & Hinton, 2012) was 0.01 in pretraining and for adam (Kingma & Ba, 2015) with decay was 0.005 for training. 4,000 learning rate warm up steps were used. Pretraining took about 7 days with 4 GPUs, afterwards, training took roughly the same time. Monte Carlo used 20 sentence rolls per word.
|
| 348 |
+
|
| 349 |
+
# A.4 DETAILED RESULTS FOR CONSTANT REWARD SETTING
|
| 350 |
+
|
| 351 |
+
We present graphs for the constant reward setting in Figures 8 and 7. Trends are similar to the ones obtained for the Simulated Reward setting.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 8: Difference between the ranks of $y _ { b e s t }$ in the reinforced with constant reward and the pretrained model. Each column $_ x$ corresponds to the difference in the probability that $y _ { b e s t }$ is ranked in rank $x$ in the reinforced model, and the same probability in the pretrained model.
|
md/train/H1gBsgBYwH/H1gBsgBYwH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/H1xwNhCcYm/H1xwNhCcYm.md
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DO DEEP GENERATIVE MODELS KNOW WHAT THEY DON’T KNOW?
|
| 2 |
+
|
| 3 |
+
Eric Nalisnick∗†, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, Balaji Lakshminarayanan∗ DeepMind
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
A neural network deployed in the wild may be asked to make predictions for inputs that were drawn from a different distribution than that of the training data. A plethora of work has demonstrated that it is easy to find or synthesize inputs for which a neural network is highly confident yet wrong. Generative models are widely viewed to be robust to such mistaken confidence as modeling the density of the input features can be used to detect novel, out-of-distribution inputs. In this paper we challenge this assumption. We find that the density learned by flow-based models, VAEs, and PixelCNNs cannot distinguish images of common objects such as dogs, trucks, and horses (i.e. CIFAR-10) from those of house numbers (i.e. SVHN), assigning a higher likelihood to the latter when the model is trained on the former. Moreover, we find evidence of this phenomenon when pairing several popular image data sets: FashionMNIST vs MNIST, CelebA vs SVHN, ImageNet vs CIFAR-10 / CIFAR-100 / SVHN. To investigate this curious behavior, we focus analysis on flow-based generative models in particular since they are trained and evaluated via the exact marginal likelihood. We find such behavior persists even when we restrict the flows to constant-volume transformations. These transformations admit some theoretical analysis, and we show that the difference in likelihoods can be explained by the location and variances of the data and the model curvature. Our results caution against using the density estimates from deep generative models to identify inputs similar to the training distribution until their behavior for out-of-distribution inputs is better understood.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has achieved impressive success in applications for which the goal is to model a conditional distribution $p ( y | \mathbf { \boldsymbol { x } } )$ , with $y$ being a label and $_ { \textbf { \em x } }$ the features. While the conditional model $p ( y | \mathbf { \boldsymbol { x } } )$ may be highly accurate on inputs $_ { \textbf { \em x } }$ sampled from the training distribution, there are no guarantees that the model will work well on $_ { \textbf { \em x } }$ ’s drawn from some other distribution. For example, Louizos & Welling (2017) show that simply rotating an MNIST digit can make a neural network predict another class with high confidence (see their Figure 1a). Ostensibly, one way to avoid such overconfidently wrong predictions would be to train a density model $p ( { \pmb x } ; { \pmb \theta } )$ (with $\pmb \theta$ denoting the parameters) to approximate the true distribution of training inputs $p ^ { * } ( { \pmb x } )$ and refuse to make a prediction for any $_ { \textbf { \em x } }$ that has a sufficiently low density under $p ( { \pmb x } ; { \pmb \theta } )$ . The intuition is that the discriminative model $p ( y | \mathbf { \boldsymbol { x } } )$ likely did not observe enough samples in that region to make a reliable decision for those inputs. This idea has been proposed by various papers, cf. (Bishop, 1994), and as recently as in the panel discussion at Advances in Approximate Bayesian Inference (AABI) 2017 (Blei et al., 2017).
|
| 12 |
+
|
| 13 |
+
Anomaly detection is just one motivating example for which we require accurate densities, and others include information regularization (Szummer & Jaakkola, 2003), open set recognition (Herbei & Wegkamp, 2006), uncertainty estimation, detecting covariate shift, active learning, model-based reinforcement learning, and transfer learning. Accordingly, these applications have lead to widespread interest in deep generative models, which take many forms such as variational auto-encoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), generative adversarial networks (GANs) (Goodfellow et al., 2014), auto-regressive models (van den Oord et al., 2016b;a), and invertible latent variable models (Tabak & Turner, 2013). The last two classes—auto-regressive and invertible models—are especially attractive since they offer exact computation of the marginal likelihood, requiring no approximate inference techniques.
|
| 14 |
+
|
| 15 |
+
In this paper, we investigate if modern deep generative models can be used for anomaly detection, as suggested by Bishop (1994) and the AABI pannel (Blei et al., 2017), expecting a well-calibrated model to assign higher density to the training data than to some other data set. However, we find this to not be the case: when trained on CIFAR-10 (Krizhevsky & Hinton, 2009), VAEs, autoregressive models, and flow-based generative models all assign a higher density to SVHN (Netzer et al., 2011) than to the training data. We find this observation to be quite problematic and unintuitive since SVHN’s digit images are so visually distinct from the dogs, horses, trucks, boats, etc. found in CIFAR-10. Yet this phenomenon is not restricted to CIFAR-10 vs SVHN, and we report similar findings for models trained on CelebA and ImageNet. We go on to study these curious observations in flow-based models in particular since they allow for exact marginal density calculations. When the flow is restricted to have constant volume across inputs, we show that the out-of-distribution behavior can be explained in terms of the data’s variance and the model’s curvature.
|
| 16 |
+
|
| 17 |
+
To the best of our knowledge, we are the first to report these unintuitive findings for a variety of deep generative models and image data sets. Moreover, our experiments with flow-based models isolate some crucial experimental variables such as the effect of constant-volume vs non-volume-preserving transformations. Lastly, our analysis provides some simple but general expressions for quantifying the gap in the model density between two data sets. We close the paper by urging more study of the out-of-training-distribution properties of deep generative models. Understanding their behaviour in this setting is crucial for their deployment to the real world.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND
|
| 20 |
+
|
| 21 |
+
We begin by establishing notation and reviewing the necessary background material. We denote matrices with upper-case and bold letters (e.g. $\boldsymbol { X }$ ), vectors with lower-case and bold (e.g. $\textbf { \em x }$ ), and scalars with lower-case and no bolding (e.g. $x )$ . As our focus is on generative models, let the collection of all observations be denoted by $\mathbf { \bar { X } } = \{ \pmb { x } _ { n } \} _ { n = 1 } ^ { N }$ with $_ { \textbf { \em x } }$ representing a vector containing all features and, if present, labels. All examples are assumed independently and identically drawn from some population $\pmb { x } \sim p ^ { * } ( \pmb { x } )$ (which is unknown) with support denoted $\mathcal { X }$ . We define the model density function to be $p ( { \pmb x } ; { \pmb \theta } )$ where $\theta \in \Theta$ are the model parameters, and let the model likelihood be denoted $\begin{array} { r } { p ( X ; \pmb { \theta } ) = \prod _ { n = 1 } ^ { N } p ( \pmb { x } _ { n } ; \pmb { \theta } ) } \end{array}$ .
|
| 22 |
+
|
| 23 |
+
# 2.1 TRAINING NEURAL GENERATIVE MODELS
|
| 24 |
+
|
| 25 |
+
Given (training) data $\boldsymbol { X }$ and a model class $\{ p ( \cdot ; \pmb \theta ) : \pmb \theta \in \Theta \}$ , we are interested in finding the parameters $\pmb \theta$ that make the model closest to the true but unknown data distribution $p ^ { * } ( { \pmb x } )$ . We can quantify this gap in terms of a Kullback–Leibler divergence (KLD):
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\mathrm { K L D } [ p ^ { * } ( x ) | | p ( x ; \pmb \theta ) ] = \int p ^ { * } ( \pmb x ) \log \frac { p ^ { * } ( \pmb x ) } { p ( \pmb x ; \pmb \theta ) } d \pmb x \approx - \frac { 1 } { N } \log p ( \pmb X ; \pmb \theta ) - \mathbb { H } [ p ^ { * } ]
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
where the first term in the right-most expression is the average log-likelihood and the second is the entropy of the true distribution. As the latter is a fixed constant, minimizing the KLD amounts to finding the parameter settings that maximize the data’s log density: $\begin{array} { r } { \pmb { \theta } ^ { * } = \arg \operatorname* { m a x } _ { \pmb { \theta } } \log p ( \pmb { X } ; \pmb { \theta } ) = } \end{array}$ arg $\begin{array} { r } { \operatorname* { m a x } _ { \pmb { \theta } } \sum _ { n = 1 } ^ { N } \log p ( \pmb { x } _ { n } ; \pmb { \theta } ) } \end{array}$ . Note that $p ( { \pmb x } _ { n } ; { \pmb \theta } )$ alone does not have any interpretation as a probability. To extract probabilities from the model density, we need to integrate over some region $\begin{array} { r } { \Omega \colon \bar { P } ( \Omega ) = \int _ { \Omega } p ( \dot { \mathbf { x } } ; \pmb { \theta } ) d x } \end{array}$ . Adding noise to the data during model optimization can mock this integration step, encouraging the density model to output something nearer to probabilities (Theis et al., 2016):
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\log \int p ( { \pmb x } _ { n } + { \pmb \delta } ; { \pmb \theta } ) p ( { \pmb \delta } ) d { \pmb \delta } \geq \mathbb { E } _ { { \pmb \delta } } \left[ \log p ( { \pmb x } _ { n } + { \pmb \delta } ; { \pmb \theta } ) \right] \approx \log p ( { \pmb x } _ { n } + { \tilde { \pmb \delta } } ; { \pmb \theta } )
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\tilde { \delta }$ is a sample from $p ( \delta )$ . The resulting objective is a lower-bound, making it a suitable optimization target. All models in all of the experiments that we report are trained with input noise.
|
| 38 |
+
|
| 39 |
+
Due to this ambiguity between densities and probabilities, we call the quantity $\log p ( X + \tilde { \Delta } ; \pmb { \theta } )$ a ‘log-likelihood,’ even if $\boldsymbol { X }$ is drawn from a distribution unlike the training data.
|
| 40 |
+
|
| 41 |
+
Regarding the choice of density model, we could choose one of the standard density functions for $p ( { \pmb x } _ { n } ; { \pmb \theta } )$ , e.g. a Gaussian, but these may not be suitable for modeling the complex, high-dimensional data sets we often observe in the real world. Hence, we want to parametrize the model density with some high-capacity function $f$ , which is usually chosen to be a neural network. That way the model has a somewhat compact representation and can be optimized via gradient ascent. We experiment with three variants of neural generative models: autoregressive, latent variable, and invertible. In the first class, we study the PixelCNN (van den Oord et al., 2016b), and due to space constraints, we refer the reader to van den Oord et al. (2016b) for its definition. As a representative of the second class, we use a $V A E$ (Kingma & Welling, 2014; Rezende et al., 2014). See Rosca et al. (2018) for descriptions of the precise versions we use. Lastly, invertible flow-based generative models are the third class. We define them in detail below since we study them with the most depth.
|
| 42 |
+
|
| 43 |
+
# 2.2 GENERATIVE MODELS VIA CHANGE OF VARIABLES
|
| 44 |
+
|
| 45 |
+
The VAE and many other generative models are defined as a joint distribution between the observed and latent variables. However, another path forward is to perform a change of variables. In this case $_ { \textbf { \em x } }$ and $_ { z }$ are one and the same, and there is no longer any notion of a product space $\mathcal { X } \times \mathcal { Z }$ . Let $f : \mathcal X \mapsto \mathcal Z$ be a diffeomorphism from the data space $\mathcal { X }$ to a latent space $\mathcal { Z }$ . Using $f$ then allows us to compute integrals over $_ z$ as an integral over $_ { \textbf { \em x } }$ and vice versa:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\int _ { z } p _ { z } ( z ) d z = \int _ { x } p _ { z } ( f ( x ) ) \left| { \frac { \partial f } { \partial x } } \right| d x = \int _ { x } p _ { x } ( x ) d x = \int _ { z } p _ { x } ( f ^ { - 1 } ( z ) ) \left| { \frac { \partial f ^ { - 1 } } { \partial z } } \right| d z
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $| \partial f / \partial x |$ and $| \partial f ^ { - 1 } / \partial z |$ are known as the volume elements as they adjust for the volume change under the alternate measure. Specifically, when the change is w.r.t. coordinates, the volume element is the determinant of the diffeomorphism’s Jacobian matrix, which we denote as $| \partial f / \partial x |$ .
|
| 52 |
+
|
| 53 |
+
The change of variables formula is a powerful tool for generative modeling as it allows us to define a distribution $p ( { \pmb x } )$ entirely in terms of an auxiliary distribution $p ( z )$ , which we are free to choose, and $f$ . Denote the parameters of the change of variables model as $\pmb \theta = \{ \phi , \psi \}$ with $\phi$ being the diffeomorphism’s parameters, i.e. $f ( { \pmb x } ; \phi )$ , and $\psi$ being the auxiliary distribution’s parameters, i.e. $p ( z ; \psi )$ . We can perform maximum likelihood estimation for the model as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\theta ^ { * } = \underset { \theta } { \arg \operatorname* { m a x } } \log p _ { x } ( X ; \theta ) = \underset { \phi , \psi } { \arg \operatorname* { m a x } } \sum _ { n = 1 } ^ { N } \log p _ { z } ( f ( x _ { n } ; \phi ) ; \psi ) + \log \left| \frac { \partial f _ { \phi } } { \partial x _ { n } } \right| .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Optimizing $\psi$ must be done carefully so as to not result in a trivial model. For instance, optimization could make $p ( z ; \psi )$ close to uniform if there are no constraints on its variance. For this reason, most implementations leave $\psi$ as fixed (usually a standard Gaussian) in practice. Likewise, we assume it as fixed from here forward, thus omitting $\psi$ from equations to reduce notational clutter. After training, samples can be drawn from the model via the inverse transform: $\tilde { \pmb { x } } = f ^ { - 1 } ( \tilde { z } ; \phi ) , \tilde { z } \sim p ( \mathbf { z } )$ .
|
| 60 |
+
|
| 61 |
+
For the particular form of $f$ , most work to date has constructed the bijection from affine coupling layers (ACLs) (Dinh et al., 2017), which transform $_ { \textbf { \em x } }$ by way of translation and scaling operations. Specifically, ACLs take the form: $f _ { \mathrm { A C L } } ( \pmb { x } ; \pmb { \phi } ) = [ \mathrm { e x p } \{ s ( \pmb { x } _ { d : } ; \phi _ { s } ) \} \odot \pmb { x } _ { : d } + t ( \pmb { x } _ { d : } ; \phi _ { t } ) , \pmb { x } _ { d : } ] .$ , where $\odot$ denotes an element-wise product. This transformation, firstly, splits the input vector in half, i.e. $\pmb { x } = [ \pmb { x } _ { : d } , \pmb { x } _ { d : } ]$ (using Python list syntax). Then the second half of the vector is fed into two arbitrary neural networks (possibly with tied parameters) whose outputs are denoted $t ( x _ { d } ; \phi _ { t } )$ and $s ( \pmb { x } _ { d : } ; \phi _ { s } )$ , with $\phi$ · being the collection of weights and biases. Finally, the output is formed by (1) scaling the first half of the input by one neural network output, i.e. $\mathrm { e x p } \{ s ( { \pmb x } _ { d : } ; \phi _ { s } ) \} \odot { \pmb x } _ { : d }$ , (2) translating the result of the scaling operation by the second neural network output, i.e. $( \cdot ) + t ( { \pmb x } _ { d : } ; \phi _ { t } )$ , and (3) copying the second half of $_ { \textbf { \em x } }$ forward, making it the second half of $f _ { \mathrm { A C L } } ( \pmb { x } ; \dot { \phi } )$ , i.e. $f _ { d : } = \pmb { x } _ { d : }$ . ACLs are stacked to make rich hierarchical transforms, and the latent representation $_ z$ is output from this composition, i.e. $z _ { n } = f ( \pmb { x } _ { n } ; \phi )$ . A permutation operation is required between ACLs to ensure the same elements are not repeatedly used in the copy operations. We use $f$ without subscript to denote the complete transform and overload the use of $\phi$ to denote the parameters of all constituent layers.
|
| 62 |
+
|
| 63 |
+
This class of transform is known as non-volume preserving (NVP) (Dinh et al., 2017) since the volume element does not necessarily evaluate to one and can vary with each input $_ { \textbf { \em x } }$ . Although non-zero, the log determinant of the Jacobian is still tractable: $\begin{array} { r } { \log | \partial f _ { \phi } / \partial \pmb { x } | = \sum _ { j = d } ^ { D } s _ { j } ( \pmb { x } _ { d } ; \pmb { \phi } _ { s } ) } \end{array}$ A diffeomorphic transform can also be defined with just translation operations, as was done in earlier work by Dinh et al. (2015), and this transformation is volume preserving (VP) since the volume term is one and thus has no influence in the likelihood calculation. We will examine another class of flows we term constant-volume (CV) since the volume, while not preserved, is constant across all $_ { \textbf { \em x } }$ . Appendix A provides additional details on implementing flow-based generative models.
|
| 64 |
+
|
| 65 |
+
# 3 MOTIVATING OBSERVATIONS
|
| 66 |
+
|
| 67 |
+
Given the impressive advances of deep generative models, we sought to test their ability to quantify when an input comes from a different distribution than that of the training set. This calibration w.r.t. out-of-distribution data is essential for applications such as safety—if we were using the generative model to filter the inputs to a discriminative model—and for active learning. For the experiment, we trained the same Glow architecture described in Kingma & Dhariwal (2018)—except small enough that it could fit on one $\mathrm { G P U ^ { 1 } }$ —on FashionMNIST and CIFAR-10. Appendix A provides additional implementation details. We then calculated the log-likelihood (higher value is better) and bits-per-dimension (BPD, lower value is better)2 of the test split of two different data sets of the same dimensionality—MNIST $( 2 8 \times 2 8 )$ and SVHN $( 3 2 \times 3 2 \times 3 )$ respectively. We expect the models to assign a lower probability to this data because they were not trained on it. Samples from the Glow models trained on each data set are shown in Figure 13 in the Appendix.
|
| 68 |
+
|
| 69 |
+
Data Set Avg. Bits Per Dimension
|
| 70 |
+
|
| 71 |
+
<table><tr><td colspan="2">Glow Trained on CIFAR-10</td></tr><tr><td>CIFAR10-Train</td><td>3.386</td></tr><tr><td>CIFAR10-Test SVHN-Test</td><td>3.464 2.389</td></tr><tr><td colspan="2">Glow Trained on SVHN</td></tr><tr><td>SVHN-Test</td><td>2.057</td></tr></table>
|
| 72 |
+
|
| 73 |
+
Data Set Avg. Bits Per Dimension
|
| 74 |
+
Figure 1: Testing Out-of-Distribution. Log-likelihood (expressed in bits per dimension) calculated from Glow (Kingma & Dhariwal, 2018) on MNIST, FashionMNIST, SVHN, CIFAR-10.
|
| 75 |
+
|
| 76 |
+
<table><tr><td>DataSet Avg.BitsPerDimension</td></tr><tr><td>Glow Trained on FashionMNIST</td></tr><tr><td>FashionMNIST-Train 2.902 FashionMNIST-Test 2.958</td></tr><tr><td>MNIST-Test 1.833</td></tr><tr><td>Glow Trained on MNIST</td></tr><tr><td></td></tr><tr><td>MNIST-Test 1.262</td></tr></table>
|
| 77 |
+
|
| 78 |
+
Beginning with FashionMNIST vs MNIST, the left subtable of Figure 1 shows the average BPD of the training data (FashionMNIST-Train), the in-distribution test data (FashionMNIST-Test), and the out-of-distribution data (MNIST-Test). We see a peculiar result: the MNIST split has the lowest BPD, more than one bit less than the FashionMNIST train and test sets. To check if this is due to outliers skewing the average, we report a (normalized) histogram in Figure 2 (a) of the log-likelihoods for the three splits. We see that MNIST (red bars) is clearly and systematically shifted to the RHS of the plot (highest likelihood).
|
| 79 |
+
|
| 80 |
+
Moving on to CIFAR-10 vs SVHN, the right subtable of Figure 1 again reports the BPD of the training data (CIFAR10-Train), the in-distribution test data (CIFAR10-Test), and the out-of-distribution data (SVHN-Test). We again see the phenomenon: the SVHN BPD is one bit lower than that of both in-distribution data sets. Figure 2 (b) shows a similar histogram of the log-likelihoods. Clearly the SVHN examples (red bars) have a systematically higher likelihood, and therefore the result is not caused by any outliers.
|
| 81 |
+
|
| 82 |
+
Subfigures (c) and (d) of Figure 2 show additional results for CelebA and ImageNet. When trained on CelebA, Glow assigns a higher likelihood to SVHN (red bars), a data set the model has never seen before. Similarly, when trained on ImageNet, Glow assigns a higher likelihood to the test splits of SVHN (red), CIFAR-10 (yellow), and CIFAR-100 (green). The difference is quite drastic in the case of SVHN (red) but modest for the two CIFAR splits. This phenomenon is not symmetric. CIFAR-10 does not have a higher likelihood under a Glow trained on SVHN; see Figure 6 in Appendix B for these results. We report results only for Glow, but we observed the same behavior for RNVP transforms (Dinh et al., 2017).
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: Histogram of Glow log-likelihoods for FashionMNIST vs MNIST (a), CIFAR-10 vs SVHN (b), CelebA vs SVHN (c), and ImageNet vs CIFAR-10 / CIFAR-100 / SVHN (d).
|
| 86 |
+
|
| 87 |
+
We next tested if the phenomenon occurs for other common deep generative models: PixelCNNs and VAEs. We do not include GANs in the comparison since evaluating their likelihood is an open problem. Figure 3 reports the same histograms as above for these models, showing the distribution of $\log p ( { \pmb x } )$ evaluations for FashionMNIST vs MNIST (a, b) and CIFAR-10 vs SVHN (c, d). The training splits are again denoted with black bars, and the test splits with blue, and the out-of-distribution splits with red. The red bars are shifted to the right in all four plots, signifying the behavior exists in spite of the differences between model classes.
|
| 88 |
+
|
| 89 |
+
# 4 DIGGING DEEPER INTO THE FLOW-BASED MODEL
|
| 90 |
+
|
| 91 |
+
While we observed the out-of-distribution phenomenon for PixelCNN, VAE, and Glow, now we narrow our investigation to just the class of invertible generative models. The rationale is that they allow for better experimental control as, firstly, they can compute exact marginal likelihoods (unlike VAEs), and secondly, the transforms used in flow-based models have Jacobian constraints that simplify the analysis we present in Section 5. To further analyze the high likelihood of the out-of-distribution (non-training) samples, we next report the contributions to the likelihood of each term in the change-of-variables formula. At first this suggested the volume element was the primary cause of SVHN’s high likelihood, but further experiments with constant-volume flows show the problem exists with them as well.
|
| 92 |
+
|
| 93 |
+
Decomposing the change-of-variables objective. To further examine this curious phenomenon, we inspect the change-of-variables objective itself, investigating if one or both terms give the outof-distribution data a higher value. We report the constituent $\log p ( z )$ and $\log | \partial f _ { \phi } / \partial x |$ terms for NVP-Glow in Figure 4, showing histograms for $\log p ( z )$ in subfigure (a) and for $\dot { \log { | \partial \dot { f } _ { \phi } / \partial x | } }$ in subfigure (b). We see that $p ( z )$ behaves mostly as expected. The red bars (SVHN) are clearly shifted to the left, representing lower likelihoods under the latent distribution. Moving on to the volume element, this term seems to cause SVHN’s higher likelihood. Subfigure (b) shows that all of the
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: PixelCNN and VAE. Log-likelihoods calculated by PixelCNN (a, c) and VAE (b, d) on FashionMNIST vs MNIST (a, b) and CIFAR-10 vs SVHN (c, d). VAE models are the convolutional categorical variant described by Rosca et al. (2018).
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 4: Decomposing the Likelihood of NVP-Glow / CV-Glow Results. The histograms in (a) and (b) show NVP-Glow’s log-likelihood decomposed into contributions from the $_ z$ -distribution and volume element, respectively, for CIFAR-10 vs SVHN. Subfigure (c) shows log-likelihood evaluations for constant-volume (CV) Glow, again when trained on CIFAR-10 and tested on SVHN. Subfigure (d) reports NVP-Glow’s BPD over the course of training, showing that the phenomenon happens throughout and could not be prevented by early stopping.
|
| 100 |
+
|
| 101 |
+
SVHN log-volume evaluations (red) are conspicuously shifted to the right—to higher values—when compared to CIFAR-10’s (blue and black). Since SVHN’s $p ( z )$ evaluations are only slightly less than CIFAR-10’s, the volume term dominates, resulting in SVHN having a higher likelihood.
|
| 102 |
+
|
| 103 |
+
Is the volume the culprit? In addition to the empirical evidence against the volume element, we notice that one of the terms in the change-of-variables objective—by rewarding the maximization of the Jacobian determinant—encourages the model to increase its sensitivity to perturbations in $\mathcal { X }$ . This behavior starkly contradicts a long history of derivative-based regularization penalties that reward the model for decreasing its sensitivity to input directions. For instance, Girosi et al. (1995) and Rifai et al. (2011) propose penalizing the Frobenius norm of a neural network’s Jacobian for classifiers and autoencoders respectively. See Appendix C for more analysis of the log volume element.
|
| 104 |
+
|
| 105 |
+
To experimentally control for the effect of the volume term, we trained Glow with constant-volume (CV) transformations. We modify the affine layers to use only translation operations (Dinh et al., 2015) but keep the $1 \times 1$ convolutions as is. The log-determinant-Jacobian is then $\begin{array} { r } { H W \sum _ { k } \log \left| U _ { k } \right| } \end{array}$ where $| U _ { k } |$ is the determinant of the convolutional weights $U _ { k }$ for the $k$ th flow. This makes the volume element constant across all inputs $_ { \textbf { \em x } }$ , allowing us to isolate its effect while still keeping the model expressive. Subfigures (c) and (d) of Figure 4 show the results for this model, which we term CV-Glow (constant-volume Glow). Subfigure (c) shows a histogram of the $\log p ( { \pmb x } )$ evaluations, just as shown before in Figure 2, and we see that SVHN (red) still achieves a higher likelihood (lower BPD) than the CIFAR-10 training set. Subfigure (d) shows the SVHN vs CIFAR-10 BPD over the course of training for NVP-Glow. Notice that there is no cross-over point in the curves.
|
| 106 |
+
|
| 107 |
+
Other experiments: random and constant images, ensembles. Other work on generative models (Sønderby et al., 2017; van den Oord et al., 2018) has noted that they often assign the highest likelihood to constant inputs. We also test this case, reporting the BPD in Appendix Figure 8 for NVP-Glow models. We find constant inputs have the highest likelihood for our models as well: 0.589 BPD for CIFAR-10. We also include in the table the BPD of random inputs for comparison.
|
| 108 |
+
|
| 109 |
+
We also hypothesized that averaging over the parameters may mitigate the phenomenon. While integration over the entire parameter space would be ideal, this is analytically and computationally difficult for Glow. Lakshminarayanan et al. (2017) show that deep ensembles can guard against over-confidence for anomalous inputs while being more practical to implement. We opted for this approach, training five Glow models independently and averaging their likelihoods to evaluate test data. Each model was given a different initialization of the parameters to help diversify the ensemble. Figure 9 in Appendix F reports a histogram of the $\log p ( { \pmb x } )$ evaluations when averaging over the ensemble. We see nearly identical results: SVHN is still assigned a higher likelihood than the CIFAR-10 training data.
|
| 110 |
+
|
| 111 |
+
# 5 SECOND ORDER ANALYSIS
|
| 112 |
+
|
| 113 |
+
In this section, we aim to provide a more direct analysis of when another distribution might have higher likelihood than the one used for training. We propose analyzing the phenomenon by way of linearizing the difference in expected log-likelihoods. This approach undoubtedly gives a crude approximation, but as we show below, it agrees with and gives insight into some of the observations reported above. Consider two distributions: the training distribution $\ b { x } \sim p ^ { * }$ and some dissimilar distribution $x \sim q$ also with support on $\mathcal { X }$ . For a given generative model $p ( { \pmb x } ; { \pmb \theta } )$ , the adversarial distribution $q$ will have a higher likelihood than the training data’s if $\mathbb { E } _ { q } [ \log p ( { \pmb x } ; { \pmb \theta } ) ] - \mathbb { E } _ { p ^ { * } } [ \log p ( { \pmb x } ; { \pmb \theta } ) ] > 0$ . This expression is hard to analyze directly so we perform a second-order expansion of the log-likelihood around an interior point $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ . Applying the expansion $\begin{array} { r } { \log p ( { \pmb x } ; { \pmb \theta } ) \approx \log \bar { p } ( { \pmb x } _ { 0 } ; { \pmb \theta } ) + \nabla _ { { \pmb x } _ { 0 } } \log p ( { \pmb x } _ { 0 } ; { \pmb \theta } ) ^ { T } ( { \pmb x } - { \pmb x } _ { 0 } ) + } \end{array}$ $\begin{array} { r } { \frac { 1 } { 2 } \operatorname { T r } \{ \nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log p ( \pmb { x } _ { 0 } ; \mathbf { \hat { \theta } } ) ( \pmb { x } - \pmb { x } _ { 0 } ) ( \mathbf { \hat { x } } - \pmb { x } _ { 0 } ) ^ { T } \} } \end{array}$ 0 to both likelihoods, taking expectations, and canceling the common terms, we have:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\begin{array} { r l } & { 0 < \mathbb { E } _ { q } [ \log p ( \pmb { x } ; \pmb { \theta } ) ] - \mathbb { E } _ { p ^ { * } } [ \log p ( \pmb { x } ; \pmb { \theta } ) ] } \\ & { \quad \approx \nabla _ { \pmb { x } _ { 0 } } \log p ( x _ { 0 } ; \pmb { \theta } ) ^ { T } ( \mathbb { E } _ { q } [ \pmb { x } ] - \mathbb { E } _ { p ^ { * } } [ \pmb { x } ] ) + \frac { 1 } { 2 } \operatorname { T r } \{ \nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log p ( \pmb { x } _ { 0 } ; \pmb { \theta } ) ( \pmb { \Sigma } _ { q } - \pmb { \Sigma } _ { p ^ { * } } ) \} } \end{array}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\pmb { \Sigma } = \mathbb { E } \left[ ( \pmb { x } - \pmb { x } _ { 0 } ) ( \pmb { x } - \pmb { x } _ { 0 } ) ^ { T } \right]$ , the covariance matrix, and $\operatorname { T r } \{ \cdot \}$ is the trace operation. Since the expansion is accurate only locally around $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ , we next assume that $\mathbb { E } _ { q } [ { \pmb x } ] = \mathbb { E } _ { p ^ { * } } [ { \pmb x } ] = { \pmb x } _ { 0 }$ . While this at first glance may seem like a strong assumption, it is not too removed from practice since data is usually centered before being fed to the model. For SVHN and CIFAR-10 in particular, we find this assumption to hold; see Figure 5 (a) for the empirical means of each dimension of CIFAR-10 (green) and SVHN (orange). All of SVHN’s means fall within the empirical range of CIFAR-10’s, and the maximum difference between any dimension is less than 38 pixel values. Assuming equal means, we then have:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { l } { 0 < \mathbb { E } _ { q } [ \log p ( \pmb { x } ; \pmb { \theta } ) ] - \mathbb { E } _ { p ^ { * } } [ \log p ( \pmb { x } ; \pmb { \theta } ) ] \approx \displaystyle \frac { 1 } { 2 } \operatorname { T r } \{ \nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log p ( \pmb { x } _ { 0 } ; \pmb { \theta } ) ( \pmb { \Sigma } _ { q } - \pmb { \Sigma } _ { p ^ { * } } ) \} } \\ { = \displaystyle \frac { 1 } { 2 } \operatorname { T r } \left\{ \left[ \nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log p _ { z } ( f ( \pmb { x } _ { 0 } ; \phi ) ) + \nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log \left| \frac { \partial f _ { \phi } } { \partial \pmb { x } _ { 0 } } \right| \right] ( \pmb { \Sigma } _ { q } - \pmb { \Sigma } _ { p ^ { * } } ) \right\} , } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where the second line assumes the generative model to be flow-based.
|
| 126 |
+
|
| 127 |
+
Analysis of CV-Glow. We use the expression in Equation 5 to analyze the behavior of CV-Glow on CIFAR-10 vs SVHN, seeing if the difference in likelihoods can be explained by the model curvature
|
| 128 |
+
|
| 129 |
+
and data’s second moment. The second derivative terms simplify considerably for CV-Glow with a
|
| 130 |
+
spherical latent density. Given a $C \times C$ kernel $U _ { k }$ , with $k$ indexing the flow and $C$ the number of
|
| 131 |
+
input channels, tspatial height andderivative is then $\begin{array} { r } { \partial f _ { h , w , c } / \partial x _ { h , w , c } = \prod _ { k } \sum _ { j = 1 } ^ { C } u _ { k , c , j } } \end{array}$ , with olutio $h$ and l ker $w$ indexing thel. The second $j$ $k$ $1 \times 1$ $\partial ^ { 2 } f _ { h , w , c } / \bar { \partial x } _ { h , w , c } ^ { 2 } = 0$
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { l } { { \mathrm { T r } \left\{ \left[ \nabla _ { x _ { 0 } } ^ { 2 } \log p ( x _ { 0 } ; \theta ) \right] ( \Sigma _ { q } - \Sigma _ { p ^ { * } } ) \right\} } } \\ { { \mathrm { } = \displaystyle \frac { \partial ^ { 2 } } { \partial z ^ { 2 } } \log p ( z ; \psi ) \sum _ { c = 1 } ^ { C } \left( \prod _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { C } u _ { k , c , j } \right) ^ { 2 } \sum _ { h , w } ( \sigma _ { q , h , w , c } ^ { 2 } - \sigma _ { p ^ { * } , h , w , c } ^ { 2 } ) . } } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
The derivation is given in Appendix G. Plugging in the second derivative of the Gaussian’s log density—a common choice for the latent distribution in flow models (Dinh et al., 2017; Kingma & Dhariwal, 2018)—and the empirical variances, we have:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r l } & { \mathbb { E } _ { \mathrm { s v \pi } } [ \log p ( \boldsymbol { x } ; \boldsymbol { \theta } ) ] - \mathbb { E } _ { \mathrm { c I F A R - 1 0 } } [ \log p ( \boldsymbol { x } ; \boldsymbol { \theta } ) ] } \\ & { \qquad \approx \displaystyle \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } \left[ \alpha _ { 1 } ^ { 2 } ( 4 9 . 6 - 6 1 . 9 ) + \alpha _ { 2 } ^ { 2 } ( 5 2 . 7 - 5 9 . 2 ) + \alpha _ { 3 } ^ { 2 } ( 5 3 . 6 - 6 8 . 1 ) \right] } \\ & { \qquad \quad = \displaystyle \frac { 1 } { 2 \sigma _ { \psi } ^ { 2 } } \left[ \alpha _ { 1 } ^ { 2 } \cdot 1 2 . 3 + \alpha _ { 2 } ^ { 2 } \cdot 6 . 5 + \alpha _ { 3 } ^ { 2 } \cdot 1 4 . 5 \right] \ge 0 \quad \mathrm { w h e r e } \alpha _ { c } = \prod _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { C } u _ { k , c , j } } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
and where $\sigma _ { \psi } ^ { 2 }$ is the variance of the latent distribution. We know the final expression is greater than or equal to zero since all $\alpha _ { c } ^ { 2 } \geq 0$ . Equality is achieved only for $\sigma _ { \psi _ { - } } ^ { 2 } \to \infty$ or in the unusual case of at least one all-zero row in any convolutional kernel for all channels. Thus, the second-order expression does indeed predict we should see a higher likelihood for SVHN than for CIFAR-10. Moreover, we leave the CV-Glow’s parameters as constants to emphasize the expression is non-negative for any parameter setting. This finding is supported by our observations that using an ensemble of Glows resulted in an almost identical likelihood gap (Figure 9) and that the gap remained relatively constant over the course of training (Figure 4d). Furthermore, the $\partial ^ { 2 } \log p ( z ; \bar { \psi } ) / \partial z ^ { 2 }$ term would be negative for any log-concave density function, meaning that changing the latent density to Laplace or logistic would not change the result.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
(a) Histogram of per-dimension means and variances (empirical). (b) Graying images increases likelihood.
|
| 147 |
+
Figure 5: Empirical Distributions and Graying Effect. Note that pixels are converted from 0-255 scale to 0-1 scale by diving by 256. See Figure 10 for results on datasets of $2 8 \times 2 8 \times 1$ images.
|
| 148 |
+
|
| 149 |
+
Our conclusion is that SVHN simply "sits inside of" CIFAR-10—roughly same mean, smaller variance—resulting in its higher likelihood. This insight also holds true for the additional results presented in subfigures (c) and (d) of Figure 2. Examining Figure 5 (a) again, we see that ImageNet, the CIFARs, and SVHN all have nearly overlapping means and that ImageNet has the highest variance. Therefore we expect SVHN and the CIFARs to have a higher likelihood than ImageNet on an ImageNet-trained model, which is exactly what we observe in Figure 2 (d). Moreover, the degree of the differences in likelihoods agrees with the differences in variances. SVHN clearly has the smallest variance and the largest likelihood. In turn, we can artificially increase the likelihood of a data set by shrinking its variance. For RGB images, shrinking the variance is equivalent to ’graying’ the images, i.e. making the pixel values closer to 128. We show in Figure 5 (b) that doing exactly this improves the likelihood of both CIFAR-10 and SVHN. Reducing the variance of the latent representations has the same effect, which is shown by Figure 12 in the Appendix.
|
| 150 |
+
|
| 151 |
+
# 6 RELATED WORK
|
| 152 |
+
|
| 153 |
+
This paper is inspired by and most related to recent work on evaluation of generative models. Worthy of foremost mention is the work of Theis et al. (2016), which showed that high likelihood is neither sufficient nor necessary for the model to produce visually satisfying samples. However, their paper does not consider out-of-distribution inputs. In this regard, there has been much work on adversarial inputs (Szegedy et al., 2014). While the term is used broadly, it commonly refers to inputs that have been imperceptibly modified so that the model can no longer provide an accurate output (a mis-classification, usually). Adversarial attacks on generative models have been studied by (at least) Tabacof et al. (2016) and Kos et al. (2018), but these methods of attack require access to the model. We, on the other hand, are interested in model calibration for any out-of-distribution set and especially for common data sets not constructed with any nefarious intentions nor for attack on a particular model. Various papers (Hendrycks & Gimpel, 2017; Lakshminarayanan et al., 2017; Liang et al., 2018) have reported that discriminative neural networks can produce overconfident predictions on out-of-distribution inputs. In a related finding, Lee et al. (2018) reported that it was much harder to recognize an input as out-of-distribution when the classifier was trained on CIFAR-10 in comparison to training on SVHN.
|
| 154 |
+
|
| 155 |
+
Testing the robustness of deep generative models to out-of-distribution inputs had not been investigated previously, to the best of our knowledge. However, there is work concurrent with ours that has tested their ability to detect anomalous inputs. Shafaei et al. (2018) and Hendrycks et al. (2019) also observe that $\mathrm { P i x e l C N N + + }$ cannot provide reliable outlier detection. Hendrycks et al. (2019) mitigate the CIFAR-10 vs SVHN issue by exposing the model to outliers during training. They do not consider flow-based models. Škvára et al. (2018) experimentally compare VAEs and GANs against $\mathbf { k }$ -nearest neighbors (kNNs), showing that VAEs and GANs outperform kNNs only when known outliers can be used for hyperparameter selection. In the work most similar to ours, Choi & Jang (2018) report the same CIFAR-10 vs SVHN phenomenon for Glow—independently confirming our motivating observation. As a fix, they propose training an ensemble of generative models with an adversarial objective and testing for out-of-training-distribution inputs by computing the WatanabeAkaike information criterion via the ensemble. This work is complementary to ours since they focus on providing a detection method whereas we are interested in understanding how and when the phenomenon can arise. The results we present in Equation 6 do not apply to Choi & Jang (2018)’s models since they use scaling operations in their affine coupling layers, making them NVP.
|
| 156 |
+
|
| 157 |
+
# 7 DISCUSSION
|
| 158 |
+
|
| 159 |
+
We have shown that comparing the likelihoods of deep generative models alone cannot identify the training set or inputs like it. Therefore we urge caution when using these models with outof-training-distribution inputs or in unprotected user-facing systems. Moreover, our analysis in Section 5 shows that the CIFAR-10 vs SVHN phenomenon would persist for any constant-volume Glow no matter the parameter values nor the choice of latent density (as long as it is log-concave). While we cannot conclude that this is a pathology in deep generative models, it does suggest the need for further work on generative models and their evaluation. The models we tested seem to be capturing low-level statistics rather than high-level semantics, and better inductive biases, optimization procedures, or uncertainty quantification may be necessary. Yet, deep generative models can detect out-of-distribution inputs when using alternative metrics (Choi & Jang, 2018) and modified training procedures (Hendrycks et al., 2019). The problem then may be a fundamental limitation of high-dimensional likelihoods. Until these open problems are better understood, we must temper the enthusiasm with which we preach the benefits of deep generative models.
|
| 160 |
+
|
| 161 |
+
# ACKNOWLEDGMENTS
|
| 162 |
+
|
| 163 |
+
We thank Aaron van den Oord, Danilo Rezende, Eric Jang, Florian Stimberg, Josh Dillon, Mihaela Rosca, Rui Shu, Sander Dieleman, and the anonymous reviewers for their helpful feedback and discussions.
|
| 164 |
+
|
| 165 |
+
# REFERENCES
|
| 166 |
+
|
| 167 |
+
Christopher M Bishop. Novelty Detection and Neural Network Validation. IEE Proceedings-Vision, Image and Signal processing, 141(4):217–222, 1994.
|
| 168 |
+
|
| 169 |
+
Christopher M Bishop. Training with Noise is Equivalent to Tikhonov Regularization. Neural Computation, 7(1):108–116, 1995.
|
| 170 |
+
|
| 171 |
+
David Blei, Katherine Heller, Tim Salimans, Max Welling, and Zoubin Ghahramani. Panel Discussion. Advances in Approximate Bayesian Inference, December 2017. URL https://youtu.be/ x1UByHT60mQ?t $= 4$ 6m2s. NeurIPS Workshop.
|
| 172 |
+
|
| 173 |
+
Hyunsun Choi and Eric Jang. Generative Ensembles for Robust Anomaly Detection. ArXiv e-Print arXiv:1810.01392, 2018.
|
| 174 |
+
|
| 175 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-Linear Independent Components Estimation. ICLR Workshop Track, 2015.
|
| 176 |
+
|
| 177 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density Estimation Using Real NVP. In International Conference on Learning Representations (ICLR), 2017.
|
| 178 |
+
|
| 179 |
+
Federico Girosi, Michael Jones, and Tomaso Poggio. Regularization Theory and Neural Networks Architectures. Neural Computation, 7(2):219–269, 1995.
|
| 180 |
+
|
| 181 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aäron Courville, and Yoshua Bengio. Generative Adversarial Nets. In Advances in Neural Information Processing Systems (NeurIPS), 2014.
|
| 182 |
+
|
| 183 |
+
Dan Hendrycks and Kevin Gimpel. A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 184 |
+
|
| 185 |
+
Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep Anomaly Detection with Outlier Exposure. In International Conference on Learning Representations (ICLR), 2019.
|
| 186 |
+
|
| 187 |
+
Radu Herbei and Marten H Wegkamp. Classification with Reject Option. Canadian Journal of Statistics, 34(4):709–721, 2006.
|
| 188 |
+
|
| 189 |
+
Diederik P. Kingma and Prafulla Dhariwal. Glow: Generative Flow with Invertible 1x1 Convolutions. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 190 |
+
|
| 191 |
+
Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. International Conference on Learning Representations (ICLR), 2014.
|
| 192 |
+
|
| 193 |
+
Jernej Kos, Ian Fischer, and Dawn Song. Adversarial Examples for Generative Models. In 2018 IEEE Security and Privacy Workshops (SPW), pp. 36–42. IEEE, 2018.
|
| 194 |
+
|
| 195 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning Multiple Layers of Features from Tiny Images. Technical report, University of Toronto, 2009.
|
| 196 |
+
|
| 197 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and Scalable Predictive Uncertainty Estimation Using Deep Ensembles. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 198 |
+
|
| 199 |
+
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training Confidence-Calibrated Classifiers for Detecting Out-of-Distribution Samples. In International Conference on Learning Representations (ICLR), 2018.
|
| 200 |
+
|
| 201 |
+
Shiyu Liang, Yixuan Li, and R Srikant. Enhancing the Reliability of Out-of-Distribution Image Detection in Neural Networks. International Conference on Learning Representations (ICLR), 2018.
|
| 202 |
+
|
| 203 |
+
Christos Louizos and Max Welling. Multiplicative Normalizing Flows for Variational Bayesian Neural Networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
Danilo Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic Backpropagation and Approximate Inference in Deep Generative Models. In Proceedings of the 31st International Conference on Machine Learning (ICML), pp. 1278–1286, 2014.
|
| 208 |
+
|
| 209 |
+
Salah Rifai, Pascal Vincent, Xavier Muller, Xavier Glorot, and Yoshua Bengio. Contractive AutoEncoders: Explicit Invariance During Feature Extraction. In Proceedings of the 28th International Conference on Machine Learning (ICML), 2011.
|
| 210 |
+
|
| 211 |
+
Mihaela Rosca, Balaji Lakshminarayanan, and Shakir Mohamed. Distribution matching in variational inference. ArXiv e-Print arXiv:1802.06847, 2018.
|
| 212 |
+
|
| 213 |
+
Alireza Shafaei, Mark Schmidt, and James J Little. Does Your Model Know the Digit 6 Is Not a Cat? A Less Biased Evaluation of “Outlier" Detectors. ArXiv e-Print arXiv:1809.04729, 2018.
|
| 214 |
+
|
| 215 |
+
Vít Škvára, Tomáš Pevny, and Václav Šmídl. Are Generative Deep Models for Novelty Detection \` Truly Better? KDD Workshop on Outlier Detection De-Constructed (ODD v5.0), 2018.
|
| 216 |
+
|
| 217 |
+
Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszár. Amortised MAP Inference for Image Super-Resolution. International Conference on Learning Representations (ICLR), 2017.
|
| 218 |
+
|
| 219 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing Properties of Neural Networks. International Conference on Learning Representations (ICLR), 2014.
|
| 220 |
+
|
| 221 |
+
Martin Szummer and Tommi S Jaakkola. Information Regularization with Partially Labeled Data. In Advances in Neural Information Processing Systems (NeurIPS), 2003.
|
| 222 |
+
|
| 223 |
+
Pedro Tabacof, Julia Tavares, and Eduardo Valle. Adversarial Images for Variational Autoencoders. ArXiv e-Print, 2016.
|
| 224 |
+
|
| 225 |
+
EG Tabak and Cristina V Turner. A Family of Nonparametric Density Estimation Algorithms. Communications on Pure and Applied Mathematics, 66(2):145–164, 2013.
|
| 226 |
+
|
| 227 |
+
Lucas Theis, Aäron van den Oord, and Matthias Bethge. A Note on the Evaluation of Generative Models. In International Conference on Learning Representations (ICLR), 2016.
|
| 228 |
+
|
| 229 |
+
Aäron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A Generative Model for Raw Audio. ArXiv e-Print, 2016a.
|
| 230 |
+
|
| 231 |
+
Aäron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixel CNN decoders. In Advances in Neural Information Processing Systems (NeurIPS), 2016b.
|
| 232 |
+
|
| 233 |
+
Aaron van den Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George van den Driessche, Edward Lockhart, Luis Cobo, Florian Stimberg, Norman Casagrande, Dominik Grewe, Seb Noury, Sander Dieleman, Erich Elsen, Nal Kalchbrenner, Heiga Zen, Alex Graves, Helen King, Tom Walters, Dan Belov, and Demis Hassabis. Parallel WaveNet: Fast high-fidelity speech synthesis. In Proceedings of the 35th International Conference on Machine Learning (ICML), pp. 3918–3926, 2018.
|
| 234 |
+
|
| 235 |
+
# A ADDITIONAL IMPLEMENTATION DETAILS
|
| 236 |
+
|
| 237 |
+
# A.1 FLOW-BASED MODELS
|
| 238 |
+
|
| 239 |
+
We have described the core building blocks of invertible generative models above, but there are several other architectural choices required in practice. Due to space requirements, we only describe them briefly, referring the reader to the original papers for details. In the most recent extension of this line of work, Kingma & Dhariwal (2018) propose the Glow architecture, with its foremost contribution being the use of $1 \times 1$ convolutions in place of discrete permutation operations. Convolutions of this form can be thought of as a relaxed but generalized permutation, having all the representational power of the discrete version with the added benefit of parameters amenable to gradient-based training. As the transformation function becomes deeper, it becomes prone to the same scale pathologies as deep neural networks and therefore requires a normalization step of some form. Dinh et al. (2017) propose incorporating batch normalization and describe how to compute its contribution to the log-determinant-Jacobian term. Kingma & Dhariwal (2018) apply a similar normalization, which they call actnorm, but it uses trainable parameters instead of batch statistics. Lastly, both Dinh et al. (2017) and Kingma & Dhariwal (2018) use multi-scale architectures that factor out variables at regular intervals, copying them forward to the final latent representation. This gradually reduces the dimensionality of the transformations, improving upon computational costs.
|
| 240 |
+
|
| 241 |
+
For our MNIST experiments, we used a Glow architecture of 2 blocks of 16 affine coupling layers, squeezing the spatial dimension in between the 2 blocks. For our CIFAR experiments, we used 3 blocks of 8 affine coupling blocks, applying the multi-scale architecture between each block. For all coupling blocks, we used a 3-layer Highway network with 200 hidden units for MNIST and 400 hidden units for CIFAR. The networks we trained were shallower than those in Kingma & Dhariwal (2018). We also found that initializing the last layer of the coupling networks to 0 was sufficient to prevent scale pathologies, hence we did not use any form of normalization (batchnorm nor actnorm) for ease of initialization and training in a distributed setting. Convolution kernels were initialized with a truncated normal with variance $1 / \sqrt { D }$ where $D$ is fan-in size, except where zero-initialization is prescribed by Glow. All networks were trained with the RMSProp optimizer, with a learning rate of $1 e - 5$ for 100K steps, decaying by half at 80K and 90K steps. We used a prior with zero mean and unit variance for all experiments. We applied L2 regularization of $5 e - 2$ to CIFAR experiments. All experiments used batch size 32.
|
| 242 |
+
|
| 243 |
+
For CV-Glow, we used additive rather than affine coupling blocks, which removes the influence of coupling blocks on the log-det-Jacobian term. The volume change of the $1 \times 1$ convolutions depend on its weights rather than the input, so the network has a constant volume change.
|
| 244 |
+
|
| 245 |
+
# A.2 PIXELCNN
|
| 246 |
+
|
| 247 |
+
We trained a GatedPixelCNN with a categorical distribution. For FashionMNIST, we used a network with 5 gated layers with 32 features, and the final skip connection layer with size 256. We trained for 100K steps with the Adam optimizer and an initial learning rate of $1 e - 4$ , and decaying at 80K and 90K steps. For CIFAR experiments, we used 15 dated layers with 128 features, and a skip connection size of 1024. Convolutions were initialized with Tensorflow’s variance scaling initializer with a uniform distribution and a scale of 1. We trained for 200K steps with the RMSProp optimizer with an initial learning rate of $1 e - 4$ , decaying by $1 / 3$ at 120K, 180K, and 195K steps. All experiments used batch size 32.
|
| 248 |
+
|
| 249 |
+
# A.3 VARIATIONAL AUTO-ENCODERS
|
| 250 |
+
|
| 251 |
+
We refer to (Rosca et al., 2018, Appendix K) for additional details on the VAEs used in our CIFAR experiments. We used the CIFAR configurations without modification. For FashionMNIST, we used the encoder given in Table 4 of (Rosca et al., 2018, Appendix K, Table 4) and a decoder composed of one linear layer with $7 * 7 * 6 4$ hidden units, followed by a reshape and three transposed convolutions of feature sizes 32, 32, 256 and strides 2, 2, 1. Weights were initialized with a normal distribution with variance 0.02. We trained for 200K steps using the RMSProp optimizer, with a constant learning rate of $1 e - 4$ .
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 6: Histogram of Glow log-likelihoods for MNIST vs FashionMNIST and SVHN vs CIFAR-10. Note that the model trained on SVHN (MNIST) is able to assign lower likelihood to CIFAR-10 (FashionMNIST), which illustrates the asymmetry compared to Figure 2.
|
| 255 |
+
|
| 256 |
+
# C ANALYZING THE CHANGE-OF-VARIABLES FORMULA AS ANOPTIMIZATION FUNCTION
|
| 257 |
+
|
| 258 |
+
Consider the intuition underlying the volume term in the change of variables objective (Equation 3). As we are maximizing the Jacobian’s determinant, it means that the model is being encouraged to maximize the $\partial f _ { j } / \partial { \bar { x } } _ { j }$ partial derivatives. In other words, the model is rewarded for making the transformation sensitive to small changes in $_ { \textbf { \em x } }$ . This behavior starkly contradicts a long history of derivative-based regularization penalties. Dating back at least to (Girosi et al., 1995), penalizing the Frobenius norm of a neural network’s Jacobian—which upper bounds the volume term3—has been shown to improve generalization. This agrees with intuition since we would like the model to be insensitive to small changes in the input, which are likely noise. Moreover, Bishop (1995) showed that training a network under additive Gaussian noise is equivalent to Jacobian regularization, and Rifai et al. (2011) proposed contractive autoencoders, which penalize the Jacobian-norm of the encoder. Allowing invertible generative models to maximize the Jacobian term without constraint suggests, at minimum, that these models will not learn robust representations.
|
| 259 |
+
|
| 260 |
+
Limiting Behavior. We next attempt to quantify the limiting behavior of the log volume element. Let us assume, for the purposes of a general treatment, that the bijection $f _ { \phi }$ is an $L$ -Lipschitz function. Both terms in Equation 3 can be bounded as follows:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\log p ( { \pmb x } ; \pmb \theta ) = \underbrace { \log p _ { z } ( f ( { \pmb x } ; \phi ) ) } _ { \mathcal { O } ( \operatorname* { m a x } _ { z } \log p _ { z } ( z ) } + \underbrace { \log \left| \frac { \partial f _ { \phi } } { \partial { \pmb x } } \right| } _ { \mathcal { O } ( D \log L ) } \le \operatorname* { m a x } _ { z } \log p _ { z } ( z ) + D \log L
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where $L$ is the Lipschitz constant, $D$ the dimensionality, and $\mathcal { O } ( \operatorname* { m a x } _ { z } \log p _ { z } ( z ) )$ an expression for the (log) mode of $p ( z )$ . We will make this mode term for concrete for Gaussian distributions below. The bound on the volume term follows from Hadamard’s inequality:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\log \left| \frac { \partial f _ { \phi } } { \partial x } \right| \leq \log \prod _ { j = 1 } ^ { D } \left| \frac { \partial f _ { \phi } } { \partial x } e _ { j } \right| \leq \log ( L \left| e _ { \cdot } \right| ) ^ { D } = D \log L
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
where $e _ { j }$ is an eigenvector. While this expression is too general to admit any strong conclusions, we can see from it that the ‘peakedness’ of the distribution represented by the mode must keep pace with the Lipschitz constant, especially as dimensionality increases, in order for both terms to contribute equally to the objective.
|
| 273 |
+
|
| 274 |
+
We can further illuminate the connection between $L$ and the concentration of the latent distribution through the following proposition:
|
| 275 |
+
|
| 276 |
+
Proposition 1. Assume $x \sim p ^ { * }$ is distributed with moments $\mathbb { E } [ x ] = \mu _ { x }$ and $V a r [ x ] = \sigma _ { x } ^ { 2 }$ . Moreover, let $f : \mathcal X \mapsto \mathcal Z$ be $L$ -Lipschitz and $f ( \mu _ { x } ) = \mu _ { z }$ . We then have the following concentration inequality for some constant $\delta$ :
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
P \left( | f ( x ) - \mu _ { z } | \geq \delta \right) \leq \frac { L ^ { 2 } \sigma _ { x } ^ { 2 } } { \delta ^ { 2 } } .
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
Proof : From the fact that $f$ is $L$ -Lipschitz, we know $| f ( x ) - \mu _ { z } | \leq L \left| x - f ^ { - 1 } ( \mu _ { z } ) \right|$ . Assuming $\mu _ { x } = f ^ { - 1 } ( \mu _ { z } ) )$ , we can apply Chebyshev’s inequality to the RHS: $\begin{array} { r } { P r ( L \left| x - f ^ { - 1 } ( \dot { \mu } _ { z } ) \right| \ge \delta ) \le } \end{array}$ $L ^ { 2 } \sigma _ { x } ^ { 2 } / \delta ^ { 2 }$ . Since $L \left| x - f ^ { - 1 } ( \mu _ { z } ) \right| \geq | f ( x ) - \mu _ { z } |$ , we can plug the RHS into the inequality and the bound will continue to hold.
|
| 283 |
+
|
| 284 |
+
From the inequality we can see that the latent distribution can be made more concentrated by decreasing $L$ and/or the data’s variance $\sigma _ { x } ^ { 2 }$ . Since the latter is fixed, optimization only influences $L$ Yet, recall that the volume term in the change-of-variables objective rewards increasing $f$ ’s derivatives and thus $L$ . While we have given an upper bound and therefore cannot say that increasing $L$ will necessarily decrease concentration in latent space, it is for certain that leaving $L$ unconstrained does not directly pressure the $f ( { \pmb x } )$ evaluations to concentrate.
|
| 285 |
+
|
| 286 |
+
Previous work (Dinh et al., 2015; 2017; Kingma & Dhariwal, 2018) has almost exclusively used a factorized zero-mean Gaussian as the latent distribution, and therefore we examine this case in particular. The log-mode can be expressed as $- D / 2 \cdot \log 2 \pi \sigma _ { z } ^ { 2 }$ , making the likelihood bound
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\log \mathrm { N } ( f ( x ; \phi ) ; \mathbf { 0 } , \sigma _ { z } ^ { 2 } \mathbb { I } ) + \log \left| \frac { \partial f _ { \phi } } { \partial x } \right| \leq \frac { - D } { 2 } \log 2 \pi \sigma _ { z } ^ { 2 } + D \log L .
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
We see that both terms scale with $D$ although in different directions, with the contribution of the $z$ -distribution becoming more negative and the volume term’s becoming more positive. We performed a simulation to demonstrate this behavior on the two moons data set, which is shown in Figure 7 (a). We replicated the original two dimensions to create data sets of dimensionality of up to 100. The results are shown in Figure 7 (b). The empirical values of the two terms are shown by the solid lines, and indeed, we see they exhibit the expected diverging behavior as dimensionality increases.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 7: Limiting Bounds. We trained an RNVP transformation on two moons data sets—which is shown in (a) for 2 dimensions—of increasing dimensionality, tracking the empirical value of each term against the upper bounds. Subfigure (b) shows Glow with an exp parametrization for the scales and (c) shows Glow with a sigmoid parametrization.
|
| 296 |
+
|
| 297 |
+
# D GLOW WITH SIGMOID PARAMETRIZATION
|
| 298 |
+
|
| 299 |
+
Upon reading the open source implementation of Glow,4 we found that Kingma & Dhariwal (2018) in practice parametrize the scaling factor as sigmoid $\left( s ( \pmb { x } _ { d : } ; \phi _ { s } ) \right)$ instead of $\exp \{ s ( \pmb { x } _ { d } ; \pmb { \phi } _ { s } ) \}$ . This
|
| 300 |
+
|
| 301 |
+
choice allows the volume only to decrease and thus results in the volume term being bounded as (ignoring the convolutional transforms)
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
\log \left| \frac { \partial f _ { \phi } } { \partial \pmb { x } } \right| = \sum _ { f = 1 } ^ { F } \sum _ { j = 1 } ^ { d _ { f } } \log \textnormal { s i g m o i d } ( s _ { f , j } ( \pmb { x } _ { d _ { f } ; } \phi _ { s } ) ) \leq F D \log 1 = 0
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
where $f$ indexes the flows and $d _ { f }$ the dimensionality at flow $f$ . Interestingly, this parametrization has a fixed upper bound of zero, removing the dependence on $D$ found in Equation 8. We demonstrate the change in behavior introduced by the alternate parametrization via the same two moon simulation. The only difference is that the RNVP transforms use a sigmoid parametrizations for the scaling operation. See Figure 7 (c) for the results: we see that now both change-of-variable terms are oriented downward as dimensionality grows. We conjecture this parametrization helps condition the log-likelihood, limiting the volume term’s influence, when training the large models $( \sim 9 0$ flows) used by Kingma & Dhariwal (2018). However, it does not fix the out-of-distribution over-confidence we report in Section 3.
|
| 308 |
+
|
| 309 |
+
# E CONSTANT AND RANDOM INPUTS
|
| 310 |
+
|
| 311 |
+
<table><tr><td>Data Set</td><td>Avg.Bits Per Dimension</td></tr><tr><td>Glow Trained on FashionMNIST</td><td></td></tr><tr><td>Random</td><td>8.686</td></tr><tr><td>Constant (0)</td><td>0.339</td></tr></table>
|
| 312 |
+
|
| 313 |
+
Figure 8: Random and constant images. Log-likelihood (expressed in bits per dimension) of random and constant inputs calculated from NVP-Glow for models trained on FashionMNIST (left) and CIFAR-10 (right).
|
| 314 |
+
|
| 315 |
+
<table><tr><td>Data Set Avg.</td><td>Bits Per Dimension</td></tr><tr><td>Glow Trained on CIFAR-10</td><td></td></tr><tr><td>Random</td><td>15.773</td></tr><tr><td>Constant (128)</td><td>0.589</td></tr></table>
|
| 316 |
+
|
| 317 |
+
# F ENSEMBLING GLOWS
|
| 318 |
+
|
| 319 |
+
The likelihood function technically measures how likely the parameters are under the data (and not how likely the data is under the model), and perhaps a better quantity would be the posterior predictive distribution $\begin{array} { r } { p ( { \pmb x } _ { t e s t } | { \pmb x } _ { t r a i n } ) = \frac { 1 } { M } \sum _ { m } \hat { p ( { \pmb x } _ { t e s t } | { \pmb \theta } _ { m } ) } } \end{array}$ where we draw samples from posterior distribution $\pmb { \theta } _ { m } \sim p ( \pmb { \theta } | \pmb { x } _ { t r a i n } )$ . Intutitively, it seems that such an integration would be more robust than a single maximum likelihood point estimate. As a crude approximation to Bayesian inference, we tried averaging over ensembles of generative models since Lakshminarayanan et al. (2017) showed that ensembles of discriminative models are robust to out-of-distribution inputs. We compute an “ensemble predictive distribution” as $\begin{array} { r } { p ( { \pmb x } ) = \frac { 1 } { M } \sum _ { m } p ( { \pmb x } ; { \pmb \theta } _ { m } ) } \end{array}$ , where $m$ indexes over models. However, as Figure 9 shows, ensembles did not significantly change the relative difference between in-distribution (CIFAR-10, black and blue) and out-of-distribution (SVHN, red).
|
| 320 |
+
|
| 321 |
+
# G DERIVATION OF CV-GLOW’S LIKELIHOOD DIFFERENCE
|
| 322 |
+
|
| 323 |
+
We start with Equation 5:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\frac { 1 } { 2 } \operatorname { T r } \left\{ \left[ \nabla _ { x _ { 0 } } ^ { 2 } \log { p _ { z } ( f ( x _ { 0 } ; \phi ) ) } + \nabla _ { x _ { 0 } } ^ { 2 } \log { \left| \frac { \partial f _ { \phi } } { \partial x _ { 0 } } \right| } \right] ( \pmb { \Sigma } _ { q } - \pmb { \Sigma } _ { p ^ { * } } ) \right\} .
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
The volume element for CV-Glow does not depend on $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ and therefore drops from the equation:
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log \left| \frac { \partial { f _ { \phi } } } { \partial \pmb { x } _ { 0 } } \right| = \nabla _ { \pmb { x } _ { 0 } } ^ { 2 } H W \sum _ { k } \log \left| U _ { k } \right| = 0
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 9: Ensemble of Glows. The plot above shows a histogram of log-likelihoods computed using an ensemble of Glow models trained on CIFAR-10, tested on SVHN. Ensembles were not found to be robust against this phenomenon.
|
| 337 |
+
|
| 338 |
+
where $U _ { k }$ denotes the $k$ th $1 \times 1$ -convolution’s kernel. Moving on to the first term, the log probability under the latent distribution, we have:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\begin{array} { l } { \nabla _ { x _ { 0 } } ^ { 2 } \log p ( f ( x _ { 0 } ) ; \psi ) = \nabla _ { x _ { 0 } } ^ { 2 } \left\{ \displaystyle \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } | | f ( x _ { 0 } ) | | _ { 2 } ^ { 2 } - \frac { D } { 2 } \log 2 \pi \sigma _ { \psi } ^ { 2 } \right\} } \\ { = \nabla _ { x _ { 0 } } \left\{ \displaystyle \frac { - 1 } { \sigma _ { \psi } ^ { 2 } } \left( \sum _ { d } f _ { d } ( x _ { 0 } ) \right) \nabla _ { x _ { 0 } } f ( x _ { 0 } ) \right\} } \\ { = \displaystyle \frac { - 1 } { \sigma _ { \psi } ^ { 2 } } \left[ \nabla _ { x _ { 0 } } f ( x _ { 0 } ) ( \nabla _ { x _ { 0 } } f ( x _ { 0 } ) ) ^ { T } + \left( \sum _ { d } f _ { d } ( x _ { 0 } ) \right) \nabla _ { x _ { 0 } } ^ { 2 } f ( x _ { 0 } ) \right] . } \end{array}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Since $f$ is comprised of translation operations and $1 \times 1$ convolutions, its partial derivatives involve just the latter (as the former are all ones), and therefore we have the partial derivatives:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\frac { \partial f _ { h , w , c } ( \pmb { x } _ { 0 } ) } { \partial x _ { h , w , c } } = \prod _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { C _ { k } } u _ { k , c , j } , \quad \frac { \partial ^ { 2 } f _ { h , w , c } ( \pmb { x } _ { 0 } ) } { \partial x _ { h , w , c } ^ { 2 } } = 0
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
where $h$ and $w$ index the input spatial dimensions, $c$ the input channel dimensions, $k$ the series of flows, and $j$ the column dimensions of the $C _ { k } \times C _ { k }$ -sized convolutional kernel $U _ { k }$ . The diagonal elements of $\nabla _ { { \pmb x } _ { 0 } } f ( { \pmb x } _ { 0 } ) ( \nabla _ { { \pmb x } _ { 0 } } f ( { \pmb x } _ { 0 } ) ) ^ { T }$ are then $( \textstyle \prod _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { C _ { k } } u _ { k , c , j } ) ^ { 2 }$ , and the diagonal element of $\nabla _ { \pmb { x } _ { 0 } } ^ { 2 } f ( \pmb { x } _ { 0 } )$ are all zero.
|
| 351 |
+
|
| 352 |
+
Then returning to the full equation, for the constant-volume Glow model we have:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { r l } & { \frac { 1 } { 2 } \operatorname { T r } \left\{ \left[ \nabla _ { x _ { 0 } } ^ { 2 } \log p ( f ( x _ { 0 } ) ) + \nabla _ { x _ { 0 } } ^ { 2 } \log \left| \frac { \partial f } { \partial x _ { 0 } } \right| \right] ( \Sigma _ { q } - \Sigma _ { p ^ { * } } ) \right\} } \\ & { \quad = \frac { 1 } { 2 } \operatorname { T r } \left\{ \left[ \nabla _ { x _ { 0 } } ^ { 2 } \log p ( f ( x _ { 0 } ) ) \right] ( \Sigma _ { q } - \Sigma _ { p ^ { * } } ) \right\} } \\ & { \quad = \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } \operatorname { T r } \left\{ \left[ \nabla _ { x _ { 0 } } f ( x _ { 0 } ) ( \nabla _ { x _ { 0 } } f ( x _ { 0 } ) ) ^ { T } + \left( \sum _ { d } f _ { d } ( x _ { 0 } ) \right) \nabla _ { x _ { 0 } } ^ { 2 } f ( x _ { 0 } ) \right] ( \Sigma _ { q } - \Sigma _ { p ^ { * } } ) \right\} } \\ & { \quad = \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } \sum _ { l , m } \left\{ \left[ \nabla _ { x _ { 0 } } f ( x _ { 0 } ) ( \nabla _ { x _ { 0 } } f ( x _ { 0 } ) ) ^ { T } + \left( \sum _ { d } f _ { d } ( x _ { 0 } ) \right) \nabla _ { x _ { 0 } } ^ { 2 } f ( x _ { 0 } ) \right] \odot ( \Sigma _ { q } - \Sigma _ { p ^ { * } } ) \right\} _ { l , m } . } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Lastly, we assume that both $\Sigma _ { q }$ and $\Sigma _ { p ^ { * } }$ are diagonal and thus the element-wise multiplication with $\nabla _ { \pmb { x } _ { 0 } } ^ { 2 } \log p ( f ( \pmb { x } _ { 0 } ) )$ collects only its diagonal elements:
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { l } { \displaystyle \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } \displaystyle \sum _ { l , m } \left\{ \left[ \nabla _ { x _ { 0 } } f ( { \bf x } _ { 0 } ) \big ( \nabla _ { x _ { 0 } } f ( { \bf x } _ { 0 } ) \big ) ^ { T } + \left( \sum _ { d } f _ { d } ( { \bf x } _ { 0 } ) \right) \nabla _ { x _ { 0 } } ^ { 2 } f ( { \bf x } _ { 0 } ) \right] \odot \big ( \Sigma _ { q } - \Sigma _ { p ^ { * } } \big ) \right\} _ { l , m } } \\ { \displaystyle = \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } \displaystyle \sum _ { h } \sum _ { w } \sum _ { c } \left( \prod _ { k = 1 } ^ { H } \sum _ { j = 1 } ^ { C _ { k } } u _ { k , c , j } \right) ^ { 2 } \big ( \sigma _ { q , h , w , c } ^ { 2 } - \sigma _ { p ^ { * } , h , w , c } ^ { 2 } \big ) } \\ { \displaystyle = \frac { - 1 } { 2 \sigma _ { \psi } ^ { 2 } } \displaystyle \sum _ { c } ^ { C } \left( \prod _ { k = 1 } ^ { H } \sum _ { j = 1 } ^ { C _ { k } } u _ { k , c , j } \right) ^ { 2 } \sum _ { h } ^ { H } \sum _ { w } ^ { W } \big ( \sigma _ { q , h , w , c } ^ { 2 } - \sigma _ { p ^ { * } , h , w , c } ^ { 2 } \big ) } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
where we arrived at the last line by rearranging the sum to collect the shared channel terms.
|
| 365 |
+
|
| 366 |
+
# H HISTOGRAM OF DATA STATISTICS
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 10: Data statistics: Histogram of per-dimensional mean, computed as $\begin{array} { r } { \mu _ { d } = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } x _ { n d } } \end{array}$ and per-dimensional variance, computed as 1N−1 PNn=1(xnd − µd)2. Note that pixels are converted from 0-255 scale to 0-1 scale by diving by 256. See Figure 5a for results on datasets of $3 2 \times 3 2 \times 3$ images: SVHN, CIFAR-10, CIFAR-100, CelebA and ImageNet.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 11: Analysis of codes obtained using CV-Glow model. Histogram of means (left column) $\begin{array} { r } { \mu _ { d } = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } z _ { n d } } \end{array}$ , standard deviation (middle column) $\begin{array} { r } { \sigma _ { d } = \sqrt { \frac { 1 } { N - 1 } \sum _ { n = 1 } ^ { N } ( z _ { n d } - \mu _ { d } ) ^ { 2 } } } \end{array}$ 1 PNn=1(znd − µd)2 and norms normalized by $\sqrt { D }$ (right column) computed as $\begin{array} { r } { \frac { | z _ { n } | } { \sqrt { D } } = \sqrt { \frac { 1 } { D } \sum _ { d } z _ { n d } ^ { 2 } } } \end{array}$ .
|
| 373 |
+
|
| 374 |
+
# I RESULTS ILLUSTRATING EFFECT OF GRAYING ON CODES
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 12 shows the effect of graying on codes.
|
| 378 |
+
|
| 379 |
+
Figure 12: Effect of graying on codes. Left (mean), middle (standard deviation) and norm (right).
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 13: Samples. Samples from CV-Glow models used for analysis.
|
md/train/HJ1kmv9xx/HJ1kmv9xx.md
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LR-GAN: LAYERED RECURSIVE GENERATIVE ADVERSARIAL NETWORKS FOR IMAGE GENERATION
|
| 2 |
+
|
| 3 |
+
Jianwei Yang∗ Virginia Tech Blacksburg, VA jw2yang@vt.edu
|
| 4 |
+
|
| 5 |
+
Anitha Kannan Facebook AI Research Menlo Park, CA akannan@fb.com
|
| 6 |
+
|
| 7 |
+
Dhruv Batra∗and Devi Parikh∗ Georgia Institute of Technology Atlanta, GA {dbatra, parikh}@gatech.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We present LR-GAN: an adversarial image generation model which takes scene structure and context into account. Unlike previous generative adversarial networks (GANs), the proposed GAN learns to generate image background and foregrounds separately and recursively, and stitch the foregrounds on the background in a contextually relevant manner to produce a complete natural image. For each foreground, the model learns to generate its appearance, shape and pose. The whole model is unsupervised, and is trained in an end-to-end manner with gradient descent methods. The experiments demonstrate that LR-GAN can generate more natural images with objects that are more human recognizable than DCGAN.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Generative adversarial networks (GANs) (Goodfellow et al., 2014) have shown significant promise as generative models for natural images. A flurry of recent work has proposed improvements over the original GAN work for image generation (Radford et al., 2015; Denton et al., 2015; Salimans et al., 2016; Chen et al., 2016; Zhu et al., 2016; Zhao et al., 2016), multi-stage image generation including part-based models (Im et al., 2016; Kwak & Zhang, 2016), image generation conditioned on input text or attributes (Mansimov et al., 2015; Reed et al., 2016b;a), image generation based on 3D structure (Wang & Gupta, 2016), and even video generation (Vondrick et al., 2016).
|
| 16 |
+
|
| 17 |
+
While the holistic ‘gist’ of images generated by these approaches is beginning to look natural, there is clearly a long way to go. For instance, the foreground objects in these images tend to be deformed, blended into the background, and not look realistic or recognizable.
|
| 18 |
+
|
| 19 |
+
One fundamental limitation of these methods is that they attempt to generate images without taking into account that images are 2D projections of a 3D visual world, which has a lot of structures in it. This manifests as structure in the 2D images that capture this world. One example of this structure is that images tend to have a background, and foreground objects are placed in this background in contextually relevant ways.
|
| 20 |
+
|
| 21 |
+
We develop a GAN model that explicitly encodes this structure. Our proposed model generates images in a recursive fashion: it first generates a background, and then conditioned on the background generates a foreground along with a shape (mask) and a pose (affine transformation) that together define how the background and foreground should be composed to obtain a complete image. Conditioned on this composite image, a second foreground and an associated shape and pose are generated, and so on. As a byproduct in the course of recursive image generation, our approach generates some object-shape foreground-background masks in a completely unsupervised way, without access to any object masks for training. Note that decomposing a scene into foreground-background layers is a classical ill-posed problem in computer vision. By explicitly factorizing appearance and transformation, LR-GAN encodes natural priors about the images that the same foreground can be ‘pasted’ to the different backgrounds, under different affine transformations. According to the experiments, the absence of these priors result in degenerate foreground-background decompositions, and thus also degenerate final composite images.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Generation results of our model on CUB-200 (Welinder et al., 2010). It generates images in two timesteps. At the first timestep, it generates background images, while generates foreground images, masks and transformations at the second timestep. Then, they are composed to obtain the final images. From top left to bottom right (row major), the blocks are real images, generated background images, foreground images, foreground masks, carved foreground images, carved and transformed foreground images, final composite images, and their nearest neighbor real images in the training set. Note that the model is trained in a completely unsupervised manner.
|
| 25 |
+
|
| 26 |
+
We mainly evaluate our approach on four datasets: MNIST-ONE (one digit) and MNIST-TWO (two digits) synthesized from MNIST (LeCun et al., 1998), CIFAR-10 (Krizhevsky & Hinton, 2009) and CUB-200 (Welinder et al., 2010). We show qualitatively (via samples) and quantitatively (via evaluation metrics and human studies on Amazon Mechanical Turk) that LR-GAN generates images that globally look natural and contain clear background and object structures in them that are realistic and recognizable by humans as semantic entities. An experimental snapshot on CUB-200 is shown in Fig. 1. We also find that LR-GAN generates foreground objects that are contextually relevant to the backgrounds (e.g., horses on grass, airplanes in skies, ships in water, cars on streets, etc.). For quantitative comparison, besides existing metrics in the literature, we propose two new quantitative metrics to evaluate the quality of generated images. The proposed metrics are derived from the sufficient conditions for the closeness between generated image distribution and real image distribution, and thus supplement existing metrics.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Early work in parametric texture synthesis was based on a set of hand-crafted features (Portilla & Simoncelli, 2000). Recent improvements in image generation using deep neural networks mainly fall into one of the two stochastic models: variational autoencoders (VAEs) (Kingma et al., 2016) and generative adversarial networks (GANs) (Goodfellow et al., 2014). VAEs pair a top-down probabilistic generative network with a bottom up recognition network for amortized probabilistic inference. Two networks are jointly trained to maximize a variational lower bound on the data likelihood. GANs consist of a generator and a discriminator in a minmax game with the generator aiming to fool the discriminator with its samples with the latter aiming to not get fooled.
|
| 31 |
+
|
| 32 |
+
Sequential models have been pivotal for improved image generation using variational autoencoders: DRAW (Gregor et al., 2015) uses attention based recurrence conditioning on the canvas drawn so far. In Eslami et al. (2016), a recurrent generative model that draws one object at a time to the canvas was used as the decoder in VAE. These methods are yet to show scalability to natural images. Early compelling results using GANs used sequential coarse-to-fine multiscale generation and classconditioning (Denton et al., 2015). Since then, improved training schemes (Salimans et al., 2016) and better convolutional structure (Radford et al., 2015) have improved the generation results using
|
| 33 |
+
|
| 34 |
+
GANs. PixelRNN (van den Oord et al., 2016) is also recently proposed to sequentially generates a pixel at a time, along the two spatial dimensions.
|
| 35 |
+
|
| 36 |
+
In this paper, we combine the merits of sequential generation with the flexibility of GANs. Our model for sequential generation imbibes a recursive structure that more naturally mimics image composition by inferring three components: appearance, shape, and pose. One closely related work combining recursive structure with GAN is that of Im et al. (2016) but it does not explicitly model object composition and follows a similar paradigm as by Gregor et al. (2015). Another closely related work is that of Kwak & Zhang (2016). It combines recursive structure and alpha blending. However, our work differs in three main ways: (1) We explicitly use a generator for modeling the foreground poses. That provides significant advantage for natural images, as shown by our ablation studies; (2) Our shape generator is separate from the appearance generator. This factored representation allows more flexibility in the generated scenes; (3) Our recursive framework generates subsequent objects conditioned on the current and previous hidden vectors, and previously generated object. This allows for explicit contextual modeling among generated elements in the scene. See Fig. 17 for contextually relevant foregrounds generated for the same background, or Fig. 6 for meaningful placement of two MNIST digits relative to each.
|
| 37 |
+
|
| 38 |
+
Models that provide supervision to image generation using conditioning variables have also been proposed: Style/Structure GANs (Wang & Gupta, 2016) learns separate generative models for style and structure that are then composed to obtain final images. In Reed et al. (2016a), GAN based image generation is conditioned on text and the region in the image where the text manifests, specified during training via keypoints or bounding boxes. While not the focus of our work, the model proposed in this paper can be easily extended to take into account these forms of supervision.
|
| 39 |
+
|
| 40 |
+
# 3 PRELIMINARIES
|
| 41 |
+
|
| 42 |
+
# 3.1 GENERATIVE ADVERSARIAL NETWORKS
|
| 43 |
+
|
| 44 |
+
Generative Adversarial Networks (GANs) consist of a generator $G$ and a discriminator $D$ that are simultaneously trained with competing goals: The generator $G$ is trained to generate samples that can ‘fool’ a discriminator $D$ , while the discriminator is trained to classify its inputs as either real (coming from the training dataset) or fake (coming from the samples of $G$ ). This competition leads to a minmax formulation with a value function:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\operatorname* { m i n } _ { \theta _ { G } } \operatorname* { m a x } _ { \theta _ { D } } \Big ( \mathrm { E } _ { a \sim p _ { d a t a } ( x ) } [ \log ( D ( x ; \theta _ { D } ) ) ] + \mathrm { E } _ { z \sim p _ { z } ( z ) } [ \log ( 1 - D ( G ( z ; \theta _ { G } ) ; \theta _ { D } ) ) ] \Big ) ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $_ { z }$ is a random vector from a standard multivariate Gaussian or a uniform distribution $p _ { z } ( z )$ , $G ( z ; \theta _ { G } )$ maps $_ z$ to the data space, $D ( { \pmb x } )$ is the probability that $_ { \textbf { \em x } }$ is real estimated by $D$ . The advantage of the GANs formulation is that it lacks an explicit loss function and instead uses the discriminator to optimize the generative model. The discriminator, in turn, only cares whether the sample it receives is on the data manifold, and not whether it exactly matches a particular training example (as opposed to losses such as MSE). Hence, the discriminator provides a gradient signal only when the generated samples do not lie on the data manifold so that the generator can readjust its parameters accordingly. This form of training enables learning the data manifold of the training set and not just optimizing to reconstruct the dataset, as in autoencoder and its variants.
|
| 51 |
+
|
| 52 |
+
While the GANs framework is largely agnostic to the choice of $G$ and $D$ , it is clear that generative models with the ‘right’ inductive biases will be more effective in learning from the gradient information (Denton et al., 2015; Im et al., 2016; Gregor et al., 2015; Reed et al., 2016a; Yan et al., 2015). With this motivation, we propose a generator that models image generation via a recurrent process – in each time step of the recurrence, an object with its own appearance and shape is generated and warped according to a generated pose to compose an image in layers.
|
| 53 |
+
|
| 54 |
+
# 3.2 LAYERED STRUCTURE OF IMAGE
|
| 55 |
+
|
| 56 |
+
An image taken of our 3D world typically contains a layered structure. One way of representing an image layer is by its appearance and shape. As an example, an image $_ { \textbf { \em x } }$ with two layers, foreground $f$ and background $^ { b }$ may be factorized as:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\pmb { x } = \pmb { f } \odot \pmb { m } + \pmb { b } \odot ( 1 - \pmb { m } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $_ { \mathbf { \nabla } } \mathbf { m } _ { \mathbf { \nabla } }$ is the mask depicting the shapes of image layers, and $\odot$ the element wise multiplication operator. Some existing methods assume the access to the shape of the object either during training (Isola & Liu, 2013) or both at train and test time (Reed et al., 2016a; Yan et al., 2015). Representing images in layered structure is even straightforward for video with moving objects (Darrell & Pentland, 1991; Wang & Adelson, 1994; Kannan et al., 2005). Vondrick et al. (2016) generates videos by separately generating a fixed background and moving foregrounds. A similar way of generating single image can be found in Kwak & Zhang (2016).
|
| 63 |
+
|
| 64 |
+
Another way is modeling the layered structure with object appearance and pose as:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\pmb { x } = S T ( \pmb { f } , \pmb { a } ) + \pmb { b } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $f$ and $^ { b }$ are foreground and background, respectively; $\textbf { \em a }$ is the affine transformation; $S T$ is the spatial transformation operator. Several works fall into this group (Roux et al., 2011; Huang & Murphy, 2015; Eslami et al., 2016). In Huang & Murphy (2015), images are decomposed into layers of objects with specific poses in a variational autoencoder framework, while the number of objects (i.e., layers) is adaptively estimated in Eslami et al. (2016).
|
| 71 |
+
|
| 72 |
+
To contrast with these works, LR-GAN uses a layered composition, and the foreground layers simultaneously model all three dominant factors of variation: appearance $f$ , shape $_ { \mathbf { \nabla } } \mathbf { m }$ and pose $\textbf { \em a }$ . We will elaborate it in the following section.
|
| 73 |
+
|
| 74 |
+
# 4 LAYERED RECURSIVE GAN (LR-GAN)
|
| 75 |
+
|
| 76 |
+
The basic structure of LR-GAN is similar to GAN: it consists of a discriminator and a generator that are simultaneously trained using the minmax formulation of GAN, as described in $\ S . 3 . 1$ . The key innovation of our work is the layered recursive generator, which is what we describe in this section.
|
| 77 |
+
|
| 78 |
+
The generator in LR-GAN is recursive in that the image is constructed recursively using a recurrent network. Layered in that each recursive step composes an object layer that is ‘pasted’ on the image generated so far. Object layer at timestep $t$ is parameterized by the following three constituents – ‘canonical’ appearance $\pmb { f } _ { t }$ , shape (or mask) $\mathbf { \nabla } m _ { t }$ , and pose (or affine transformation) $\mathbf { } \mathbf { a } _ { t }$ for warping the object before pasting in the image composition.
|
| 79 |
+
|
| 80 |
+
Fig. 2 shows the architecture of the LR-GAN with the generator architecture unrolled for generating background $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ $( \doteq \pmb { x } _ { b } )$ and foreground $\scriptstyle { \mathbf { { \vec { x } } } } _ { 1 }$ and $\mathbf { x } _ { 2 }$ . At each time step $t$ , the generator composes the next image $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ via the following recursive computation:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r l } { x _ { t } = \mathrm { ~ { \mathcal { S } } ~ } T ( m _ { t } , a _ { t } ) , \quad \odot \quad } & { { } { \mathcal { S } } T ( f _ { t } , a _ { t } ) , \quad \quad + ( 1 - { S T } ( m _ { t } , a _ { t } ) ) \odot x _ { t - 1 , } , \quad \forall t \in [ 1 , T ] } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $S T ( \circ , \pmb { a } _ { t } )$ is a spatial transformation operator that outputs the affine transformed version of $\diamond$ with $\mathbf { } \mathbf { a } _ { t }$ indicating parameters of the affine transformation.
|
| 87 |
+
|
| 88 |
+
Since our proposed model has an explicit transformation variable $\mathbf { } \mathbf { a } _ { t }$ that is used to warp the object, it can learn a canonical object representation that can be re-used to generate scenes where the object occurs as mere transformations of it, such as different scales or rotations. By factorizing the appearance, shape and pose, the object generator can focus on separately capturing regularities in these three factors that constitute an object. We will demonstrate in our experiments that removing these factorizations from the model leads to its spending capacity in variability that may not solely be about the object in Section 5.5 and 5.6.
|
| 89 |
+
|
| 90 |
+
# 4.1 DETAILS OF GENERATOR ARCHITECTURE
|
| 91 |
+
|
| 92 |
+
Fig. 2 shows our LR-GAN architecture in detail – we use different shapes to indicate different kinds of layers (convolutional, fractional convolutional, (non)linear, etc), as indicated by the legend. Our model consists of two main pieces – a background generator $G _ { b }$ and a foreground generator $G _ { f }$ . $G _ { b }$ and $G _ { f }$ do not share parameters with each other. $G _ { b }$ computation happens only once, while $G _ { f }$ is recurrent over time, i.e., all object generators share the same parameters. In the following, we will introduce each module and connections between them.
|
| 93 |
+
|
| 94 |
+
Temporal Connections. LR-GAN has two kinds of temporal connections – informally speaking, one on ‘top’ and one on ‘bottom’. The ‘top’ connections perform the act of sequentially ‘pasting’ object layers (Eqn. 4). The ‘bottom’ connections are constructed by a LSTM on the noise vectors $z _ { \mathrm { 0 } } , z _ { \mathrm { 1 } } , z _ { \mathrm { 2 } }$ . Intuitively, this noise-vector-LSTM provides information to the foreground generator about what else has been generated in past. Besides, when generating multiple objects, we use a pooling layer $P _ { f } ^ { c }$ and a fully-connected layer $E _ { f } ^ { c }$ to extract the information from previous generated object response map. By this way, the model is able to ‘see’ previously generated objects.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 2: LR-GAN architecture unfolded to three timesteps. It mainly consists of one background generator, one foreground generator, temporal connections and one discriminator. The meaning of each component is explained in the legend.
|
| 98 |
+
|
| 99 |
+
Background Generator. The background generator $G _ { b }$ is purposely kept simple. It takes the hidden state of noise-vector-LSTM $h _ { l } ^ { 0 }$ as the input and passes it to a number of fractional convolutional layers (also called ‘deconvolution’ layer in some papers) to generate images at its end. The output of background generator $\scriptstyle { \mathbf { \mathcal { x } } } _ { b }$ will be used as the canvas for the following generated foregrounds.
|
| 100 |
+
|
| 101 |
+
Foreground Generator. The foreground generator $G _ { f }$ is used to generate an object with appearance and shape. Correspondingly, $G _ { f }$ consists of three sub-modules, $G _ { f } ^ { c }$ , which is a common ‘trunk’ whose outputs are shared by $G _ { f } ^ { i }$ and $G _ { f } ^ { m }$ . $G _ { f } ^ { i }$ is used to generate the foreground appearance $\pmb { f } _ { t }$ , while $G _ { f } ^ { m }$ generates the mask $\mathbf { \nabla } m _ { t }$ for the foreground. All three sub-modules consists of one or more fractional convolutional layers combined with batch-normalization and nonlinear layers. The generated foreground appearance and mask have the same spatial size as the background. The top of $G _ { f } ^ { m }$ is a sigmoid layer in order to generate one channel mask whose values range in $( 0 , 1 )$ .
|
| 102 |
+
|
| 103 |
+
Spatial Transformer. To spatially transform foreground objects, we need to estimate the transformation matrix. As in Jaderberg et al. (2015), we predict the affine transformation matrix with a linear layer $T _ { f }$ that has six-dimensional outputs. Then based on the predicted transformation matrix, we use a grid generator $G _ { g }$ to generate the corresponding sampling coordinates in the input for each location at the output. The generated foreground appearance and mask share the same transformation matrix, and thus the same sampling grid. Given the grid, the sampler $S$ will simultaneously sample the $\pmb { f } _ { t }$ and ${ \mathbf { } } m _ { t }$ to obtain $\hat { f } _ { t }$ and $\hat { m } _ { t }$ , respectively. Different from Jaderberg et al. (2015), our sampler here normally performs downsampling, since the the foreground typically has smaller size than the background. Pixels in $\hat { f } _ { t }$ and $\hat { m } _ { t }$ that are from outside the extent of $\pmb { f } _ { t }$ and ${ \mathbf { } } m _ { t }$ are set to zero. Finally, $\hat { f } _ { t }$ and $\hat { m } _ { t }$ are sent to the compositor $C$ which combines the canvas ${ \mathbf { } } _ { { \mathbf { } } { \mathbf { } } { \mathbf { } } - 1 }$ and $\hat { f } _ { t }$ through layered composition with blending weights given by $\hat { m } _ { t }$ (Eqn. 4).
|
| 104 |
+
|
| 105 |
+
Pseudo-code for our approach and detailed model configuration are provided in the Appendix.
|
| 106 |
+
|
| 107 |
+
# 4.2 NEW EVALUATION METRICS
|
| 108 |
+
|
| 109 |
+
Several metrics have been proposed to evaluate GANs, such as Gaussian parzen window (Goodfellow et al., 2014), Generative Adversarial Metric (GAM) (Im et al., 2016) and Inception Score (Salimans et al., 2016). The common goal is to measure the similarity between the generated data distribution $P _ { g } ( \pmb { x } ) = G ( \pmb { z } ; \theta _ { z } )$ and the real data distribution $P ( { \pmb x } )$ . Most recently, Inception Score has been used in several works (Salimans et al., 2016; Zhao et al., 2016). However, it is an assymetric metric and could be easily fooled by generating centers of data modes.
|
| 110 |
+
|
| 111 |
+
In addition to these metrics, we present two new metrics based on the following intuition – a sufficient (but not necessary) condition for closeness of $P _ { g } ( \pmb { x } )$ and $P ( { \pmb x } )$ is closeness of $P _ { g } ( \pmb { x } | y )$ and $P ( { \pmb x } | { \pmb y } )$ , i.e., distributions of generated data and real data conditioned on all possible variables of interest $y$ , e.g., category label. One way to obtain this variable of interest $y$ is via human annotation. Specifically, given the data sampled from $P _ { g } ( \pmb { x } )$ and $P ( { \pmb x } )$ , we ask people to label the category of the samples according to some rules. Note that such human annotation is often easier than comparing samples from the two distributions (e.g., because there is no 1:1 correspondence between samples to conduct forced-choice tests).
|
| 112 |
+
|
| 113 |
+
After the annotations, we need to verify whether the two distributions are similar in each category. Clearly, directly comparing the distributions $P _ { g } ( \pmb { x } | y )$ and $P ( { \pmb x } | { \pmb y } )$ may be as difficult as comparing $P _ { g } ( \pmb { x } )$ and $P ( { \pmb x } )$ . Fortunately, we can use Bayes rule and alternatively compare $P _ { g } ( y | \mathbf { \boldsymbol { x } } )$ and $P ( y | \bar { \mathbf { x } } )$ , which is a much easier task. In this case, we can simply train a discriminative model on the samples from $P _ { g } ( \pmb { x } )$ and $P ( { \pmb x } )$ together with the human annotations about categories of these samples. With a slight abuse of notation, we use $P _ { g } ( y | \mathbf { \boldsymbol { x } } )$ and $P ( y | \pmb { x } )$ to denote probability outputs from these two classifiers (trained on generated samples vs trained on real samples). We can then use these two classifiers to compute the following two evaluation metrics:
|
| 114 |
+
|
| 115 |
+
Adversarial Accuracy: Computes the classification accuracies achieved by these two classifiers on a validation set, which can be the training set or another set of real images sampled from $P ( { \pmb x } )$ . If $P _ { g } ( \pmb { x } )$ is close to $P ( { \pmb x } )$ , we expect to see similar accuracies.
|
| 116 |
+
|
| 117 |
+
Adversarial Divergence: Computes the KL divergence between $P _ { g } ( y | \mathbf { \boldsymbol { x } } )$ and $P ( \boldsymbol { y } | \boldsymbol { x } )$ . The lower the adversarial divergence, the closer two distributions are. The low bound for this metric is exactly zero, which means $\bar { P _ { g } } ( y | \mathbf { x } ) = P ( y | \mathbf { x } )$ for all samples in the validation set.
|
| 118 |
+
|
| 119 |
+
As discussed above, we need human efforts to label the real and generated samples. Fortunately, we can further simplify this. Based on the labels given on training data, we split the training data into categories, and train one generator for each category. With all these generators, we generate samples of all categories. This strategy will be used in our experiments on the datasets with labels given.
|
| 120 |
+
|
| 121 |
+
# 5 EXPERIMENT
|
| 122 |
+
|
| 123 |
+
We conduct qualitative and quantitative evaluations on three datasets: 1) MNIST (LeCun et al., 1998); 2) CIFAR-10 (Krizhevsky & Hinton, 2009); 3) CUB-200 (Welinder et al., 2010). To add variability to the MNIST images, we randomly scale (factor of 0.8 to 1.2) and rotate $( - \frac { \pi } { 4 }$ to $\frac { \pi } { 4 }$ ) the digits and then stitch them to $4 8 \times 4 8$ uniform backgrounds with random grayscale value between [0, 200]. Images are then rescaled back to $3 2 \times 3 2$ . Each image thus has a different background grayscale value and a different transformed digit as foreground. We rename this sythensized dataset as MNIST-ONE (single digit on a gray background). We also synthesize a dataset MNIST-TWO containing two digits on a grayscale background. We randomly select two images of digits and perform similar transformations as described above, and put one on the left and the other on the right side of a $7 8 \times 7 8$ gray background. We resize the whole image to $6 4 \times 6 4$ .
|
| 124 |
+
|
| 125 |
+
We develop LR-GAN based on open source code1. We assume the number of objects is known. Therefore, for MNIST-ONE, MNIST-TWO, CIFAR-10, and CUB-200, our model has two, three, two, and two timesteps, respectively. Since the size of foreground object should be smaller than that of canvas, we set the minimal allowed scale 2 in affine transforamtion to be 1.2 for all datasets except for MNIST-TWO, which is set to 2 (objects are smaller in MNIST-TWO). In LR-GAN, the background generator and foreground generator have similar architectures. One difference is that the number of channels in the background generator is half of the one in the foreground generator. We compare our results to that of DCGAN (Radford et al., 2015). Note that LR-GAN without LSTM at the first timestep corresponds exactly to the DCGAN. This allows us to run controlled experiments. In both generator and discriminator, all the (fractional) convolutional layers have $4 \times$ 4 filter size with stride 2. As a result, the number of layers in the generator and discriminator automatically adapt to the size of training images. Please see the Appendix (Section 6.2) for details about the configurations. We use three metrics for quantitative evaluation, including Inception Score (Salimans et al., 2016) and the proposed Adversarial Accuracy, Adversarial Divergence. Note that we report two versions of Inception Score. One is based on the pre-trained Inception net, and the other one is based on the pre-trained classifier on the target datasets.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Generated images on CIFAR-10 based on our model.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: Generated images on CUB-200 based on our model.
|
| 132 |
+
|
| 133 |
+
# 5.1 QUALITATIVE RESULTS
|
| 134 |
+
|
| 135 |
+
In Fig. 3 and 4, we show the generated samples for CIFAR-10 and CUB-200, respectively. MNIST results are shown in the next subsection. As we can see from the images, the compositional nature of our model results in the images being free of blending artifacts between backgrounds and foregrounds. For CIFAR-10, we can see the horses and cars with clear shapes. For CUB-200, the bird shapes tend to be even sharper.
|
| 136 |
+
|
| 137 |
+
# 5.2 MNIST-ONE AND MNIST-TWO
|
| 138 |
+
|
| 139 |
+
We now report the results on MNIST-ONE and MNIST-TWO. Fig. 5 shows the generation results of our model on MNIST-ONE. As we can see, our model generates the background and the foreground in separate timestep, and can disentagle the foreground digits from background nearly perfectly. Though initial values of the mask randomly distribute in the range of $( 0 , 1 )$ , after training, the masks are nearly binary and accurately carve out the digits from the generated foreground. More results on MNIST-ONE (including human studies) can be found in the Appendix (Section 6.3).
|
| 140 |
+
|
| 141 |
+
Fig. 6 shows the generation results for MNIST-TWO. Similarly, the model is also able to generate background and the two foreground objects separately. The foreground generator tends to generate a single digit at each timestep. Meanwhile, it captures the context information from the previous time steps. When the first digit is placed to the left side, the second one tends to be placed on the right side, and vice versa.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 5: Generation results of our model on MNIST-ONE. From left to right, the image blocks are real images, generated background images, generated foreground images, generated masks and final composite images, respectively.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: Generation results of our model on MNIST-TWO. From top left to bottom right (row major), the image blocks are real images, generated background images, foreground images and masks at the second timestep, composite images at the second time step, generated foreground images and masks at the third timestep and the final composite images, respectively.
|
| 148 |
+
|
| 149 |
+
# 5.3 CUB-200
|
| 150 |
+
|
| 151 |
+
We study the effectiveness of our model trained on the CUB-200 bird dataset. In Fig. 1, we have shown a random set of generated images, along with the intermediate generation results of the model. While being completely unsupervised, the model, for a large fraction of the samples, is able to successfully disentangle the foreground and the background. This is evident from the generated bird-like masks.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 7: Matched pairs of generated images based on DCGAN and LR-GAN, respectivedly. The odd columns are generated by DCGAN, and the even columns are generated by LR-GAN. These are paired according to the perfect matching based on Hungarian algorithm.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 8: Qualitative comparison on CIFAR-10. Top three rows are images generated by DCGAN; Bottom three rows are by LR-GAN. From left to right, the blocks display generated images with increasing quality level as determined by human studies.
|
| 158 |
+
|
| 159 |
+
We do a comparative study based on Amazon Mechanical Turk (AMT) between DCGAN and LRGAN to quantify relative visual quality of the generated images. We first generated 1000 samples from both the models. Then, we performed perfect matching between the two image sets using the Hungarian algorithm on $L 2$ norm distance in the pixel space. This resulted in 1000 image pairs. Some examplar pairs are shown in Fig. 7. For each image pair, 9 judges are asked to choose the one that is more realistic. Based on majority voting, we find that our generated images are selected $6 8 . 4 \%$ times, compared with $3 1 . 6 \%$ times for DCGAN. This demonstrates that our model has generated more realistic images than DCGAN. We can attribute this difference to our model’s ability to generate foreground separately from the background, enabling stronger edge cues.
|
| 160 |
+
|
| 161 |
+
# 5.4 CIFAR-10
|
| 162 |
+
|
| 163 |
+
We now qualitatively and quantitatively evaluate our model on CIFAR-10, which contains multiple object categories and also various backgrounds.
|
| 164 |
+
|
| 165 |
+
Comparison of image generation quality: We conduct AMT studies to compare the fidelity of image generation. Towards this goal, we generate 1000 images from DCGAN and LR-GAN, respectively. We ask 5 judges to label each image to either belong to one of the 10 categories or as ‘non recognizable’ or ‘recognizable but not belonging to the listed categories’. We then assign each image a quality level between [0,5] that captures the number of judges that agree with the majority choice. Fig. 8 shows the images generated by both approaches, ordered by increasing quality level. We merge images at quality level 0 (all judges said non-recognizable) and 1 together, and similarly images at level 4 and 5. Visually, the generated samples by our model have clearer boundaries and object structures. We also computed the fraction of non-recognizable images: Our model had a $10 \%$ absolute drop in non-recognizability rate $( 6 7 . 3 \%$ for ours vs. $7 7 . 7 \%$ for DCGAN). For reference, $1 1 . 4 \%$ of real CIFAR images were categorized as non-recognizable. Fig. 9 shows more generated (intermediate) results of our model.
|
| 166 |
+
|
| 167 |
+
Quantitative evaluation on generators: We evaluate the generators based on three metrics: 1) Inception Score; 2) Adversarial Accuracy; 3) Adversarial Divergence. To obtain a classifier model for evaluation, we remove the top layer in the discriminator used in our model, and then append two fully connected layers on the top of it. We train this classifier using the training samples of CIFAR-10 based on the annotations. Following Salimans et al. (2016), we generated 50,000 images based on DCGAN and LR-GAN, repsectively. We compute two types of Inception Scores. The standard Inception Score is based on the Inception net as in Salimans et al. (2016), and the contextual Inception Score is based on our trained classifier model. To distinguish, we denote the standard one as ‘Inception Score†’, and the contextual one as ‘Inception Score††’. To obtain the Adversarial Accuracy and Adversarial Divergence scores, we train one generator on each of 10 categories for DCGAN and LR-GAN, respectively. Then, we use these generators to generate samples of different categories. Given these generated samples, we train the classifiers for DCGAN and LR-GAN separately. Along with the classifier trained on the real samples, we compute the Adversarial Accuracy and Adversarial Divergence on the real training samples. In Table 1, we report the Inception Scores, Adversarial Accuracy and Adversarial Divergence for comparison. We can see that our model outperforms DCGAN across the board. To point out, we obtan different Inception Scores based on different classifier models, which indicates that the Inception Score varies with different models.
|
| 168 |
+
|
| 169 |
+
Table 1: Quantitative comparison between DCGAN and LR-GAN on CIFAR-10.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Training Data</td><td>Real Images</td><td>DCGAN</td><td>Ours</td></tr><tr><td>Inception Scoret</td><td>11.18±0.18</td><td>6.64±0.14</td><td>7.17±0.07</td></tr><tr><td>Inception Scorett</td><td>7.23±0.09</td><td>5.69±0.07</td><td>6.11±0.06</td></tr><tr><td>Adversarial Accuracy</td><td>83.33±0.08</td><td>37.81±0.02</td><td>44.22 ±0.08</td></tr><tr><td>Adversarial Divergence</td><td>0</td><td>7.58±0.04</td><td>5.57±0.06</td></tr></table>
|
| 172 |
+
|
| 173 |
+
†Evaluate using the pre-trained Inception net as Salimans et al. (2016) ††Evaluate using the supervisedly trained classifier based on the discriminator in LR-GAN.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 9: Generation results of our model on CIFAR-10. From left to right, the blocks are: generated background images, foreground images, foreground masks, foreground images carved out by masks, carved foregrounds after spatial transformation, final composite images and nearest neighbor training images to the generated images.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 10: Category specific generation results of our model on CIFAR-10 categories of horse, frog, and cat (top to bottom). The blocks from left to right are: generated background images, foreground images, foreground masks, foreground images carved out by masks, carved foregrounds after spatial transformation and final composite images.
|
| 180 |
+
|
| 181 |
+
Quantitative evaluation on discriminators: We evaluate the discriminator as an extractor for deep representations. Specifically, we use the output of the last convolutional layer in the discriminator as features. We perform a 1-NN classification on the test set given the full training set. Cosine similarity is used as the metric. On the test set, our model achieves $6 2 . 0 9 \% \pm 0 . 0 1 \%$ compared to DCGAN’s $5 6 . 0 5 \% \pm 0 . 0 2 \%$ .
|
| 182 |
+
|
| 183 |
+
Contextual generation: We also show the efficacy of our approach to generate diverse foregrounds conditioned on fixed background. The results in Fig. 17 in Appendix showcase that the foreground generator generates objects that are compatible with the background. This indicates that the model has captured contextual dependencies between the image layers.
|
| 184 |
+
|
| 185 |
+
Category specific models: The objects in CIFAR-10 exhibit huge variability in shapes. That can partly explain why some of the generated shapes are not as compelling in Fig. 9. To test this hypothesis, we reuse the generators trained for each of 10 categories used in our metrics to obtain the generation results. Fig. 10 shows results for categories ‘horse’, ‘frog’ and ‘cat’. We can see that the model is now able to generate object-specific appearances and shapes, similar in vein to our results on the CUB-200 dataset.
|
| 186 |
+
|
| 187 |
+
# 5.5 IMPORTANCE OF TRANSFORMATIONS
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 11: Generation results from an ablated LR-GAN model without affine transformations. From top to bottom, the block rows correspond to different datasets: MNIST-ONE, CUB-200, CIFAR-10. From left to right, the blocks show generated background images, foreground images, foreground masks, and final composite images. For comparison, the rightmost column block shows final generated images from a non-ablated model with affine transformations.
|
| 191 |
+
|
| 192 |
+
Fig. 11 shows results from an ablated model without affine transformations in the foreground layers, and compares the results with the full model that does include these transformations. We note that one significant problem emerges that the decompositions are degenerate, in the sense that the model is unable to break the symmetry between foreground and background layers, often generating object appearances in the model’s background layer and vice versa. For CUB-200, the final generated images have some blendings between foregrounds and backgrounds. This is particularly the case for those images without bird-shape masks. For CIFAR-10, a number of generated masks are inverted. In this case, the background images are carved out as the foreground objects. The foreground generator takes almost all the duty to generate the final images, which make it harder to generate images as clear as the model with transformation. From these comparisons, we qualitatively demonstrate the importance of modeling transformations in the foreground generation process. Another merit of using transformation is that the intermediate outputs of the model are more interpretable and faciliate to the downstreaming tasks, such as scene paring, which is demonstrated in Section 6.8.
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 12: Generation results from an ablated LR-GAN model without mask generator. The block rows correspond to different datasets (from top to bottom: MNIST-ONE, CUB-200, CIFAR-10). From left to right, the blocks show generated background images, foreground images, transformed foreground images, and final composite images. For comparison, the rightmost column block shows final generated images from a non-ablated model with mask generator.
|
| 196 |
+
|
| 197 |
+
# 5.6 IMPORTANCE OF SHAPES
|
| 198 |
+
|
| 199 |
+
We perform another ablation study by removing the mask generator to understand the importance of modeling object shapes. In this case, the generated foreground is simply pasted on top of the generated background after being transformed. There is no alpha blending between the foregrounds and backgrounds. The generation results for three datasets, MNIST-ONE, CUB-200, CIFAR-10 are shown in Fig. 12. As we can see, though the model works well for the generation of MNIST-ONE, it fails to generate reasonable images across the other datasets. Particularly, the training does not even converge for CUB-200. Based on these results, we qualitatively demonstrate that mask generator in our model is fairly important to obtain plausible results, especially for realistic images.
|
| 200 |
+
|
| 201 |
+
# REFERENCES
|
| 202 |
+
|
| 203 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. arXiv preprint arXiv:1606.03657, 2016.
|
| 204 |
+
|
| 205 |
+
Trevor Darrell and Alex Pentland. Robust estimation of a multi-layered motion representation. IEEE Workshop on Visual Motion, 1991.
|
| 206 |
+
|
| 207 |
+
Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in neural information processing systems, pp. 1486–1494, 2015.
|
| 208 |
+
S. M. Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, Koray Kavukcuoglu, and Geoffrey E. Hinton. Attend, infer, repeat: Fast scene understanding with generative models. CoRR, abs/1603.08575, 2016.
|
| 209 |
+
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.
|
| 210 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.046239, 2015.
|
| 211 |
+
Gary B. Huang, Manu Ramesh, Tamara Berg, and Erik Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. Technical Report 07-49, University of Massachusetts, Amherst, October 2007.
|
| 212 |
+
Jonathan Huang and Kevin Murphy. Efficient inference in occlusion-aware generative models of images. CoRR, abs/1511.06362, 2015.
|
| 213 |
+
Daniel Jiwoong Im, Chris Dongjoo Kim, Hui Jiang, and Roland Memisevic. Generating images with recurrent adversarial networks. arXiv preprint arXiv:1602.05110, 2016.
|
| 214 |
+
Phillip Isola and Ce Liu. Scene collaging: Analysis and synthesis of natural images with semantic layers. In IEEE International Conference on Computer Vision, pp. 3048–3055, 2013.
|
| 215 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, and koray kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems 28, pp. 2017–2025, 2015.
|
| 216 |
+
Anitha Kannan, Nebojsa Jojic, and Brendan Frey. Generative model for layers of appearance and deformation. AISTATS, 2005.
|
| 217 |
+
Diederik P Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. arXiv preprint arXiv:1606.04934, 2016.
|
| 218 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 219 |
+
Hanock Kwak and Byoung-Tak Zhang. Generating images part by part with composite generative adversarial networks. arXiv preprint arXiv:1607.05387, 2016.
|
| 220 |
+
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.
|
| 221 |
+
Elman Mansimov, Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Generating images from captions with attention. arXiv preprint arXiv:1511.02793, 2015.
|
| 222 |
+
Javier Portilla and Eero P Simoncelli. A parametric texture model based on joint statistics of complex wavelet coefficients. International journal of computer vision, 40(1):49–70, 2000.
|
| 223 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 224 |
+
Scott Reed, Zeynep Akata, Santosh Mohan, Samuel Tenka, Bernt Schiele, and Honglak Lee. Learning what and where to draw. arXiv preprint arXiv:1610.02454, 2016a.
|
| 225 |
+
Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. arXiv preprint arXiv:1605.05396, 2016b.
|
| 226 |
+
Nicolas Le Roux, Nicolas Heess, Jamie Shotton, and John Winn. Learning a generative model of images by factoring appearance and shape. Neural Computation, 23:593–650, 2011.
|
| 227 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. arXiv preprint arXiv:1606.03498, 2016.
|
| 228 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks.¨ CoRR, abs/1601.06759, 2016.
|
| 229 |
+
Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. arXiv preprint arXiv:1609.02612, 2016.
|
| 230 |
+
John Wang and Edward Adelson. Representing moving images with layers. IEEE Transactions on Image Processing, 1994.
|
| 231 |
+
Xiaolong Wang and Abhinav Gupta. Generative image modeling using style and structure adversarial networks. arXiv preprint arXiv:1603.05631, 2016.
|
| 232 |
+
P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech-UCSD Birds 200. Technical Report CNS-TR-2010-001, California Institute of Technology, 2010.
|
| 233 |
+
Xinchen Yan, Jimei Yang, Kihyuk Sohn, and Honglak Lee. Attribute2image: Conditional image generation from visual attributes. CoRR, abs/1512.00570, 2015.
|
| 234 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
# 6 APPENDIX
|
| 238 |
+
|
| 239 |
+
# 6.1 ALGORITHM
|
| 240 |
+
|
| 241 |
+
Algo. 1 illustrates the generative process in our model. $g ( \star )$ evaluates the function $g$ at $\star$ . $\circ$ is a composition operator that composes its operands so that $f \circ g ( \star ) = f ( g ( \star ) )$ .
|
| 242 |
+
|
| 243 |
+
Algorithm 1 Stochastic Layered Recursive Image Generation
|
| 244 |
+
|
| 245 |
+
<table><tr><td>1: zo ~ N(0,I)</td></tr><tr><td>2: xg=Gb(z0) >background generator</td></tr><tr><td>4:c←0 5: fort∈[1..·T] do 6: zt ~ N(0,I)</td></tr><tr><td>7: ht,ct ←LSTM([zt,ht-1,ct-1]) > pass through LSTM</td></tr><tr><td>8: if t=1 then</td></tr><tr><td>9: yt←ht 10: else</td></tr><tr><td>11: yt←E(hth-1) > pass through non-linear embedding layers El</td></tr><tr><td>12: end if</td></tr><tr><td>13: St←G(yt) V predict shared cube for G'f and Gm</td></tr><tr><td>14: at←Tf(yt) Vobject transformation</td></tr><tr><td>15: ft←G(st) Vgenerate object appearance</td></tr><tr><td>16: mt←Gm(st) generate object shape</td></tr><tr><td>17: h←EoPf(st) > predict shared represenation embedding</td></tr><tr><td>18: xt ← ST(mt,at) ① ST(ft,at) +(1- ST(mt,at)) ① xt-1 19: end for</td></tr></table>
|
| 246 |
+
|
| 247 |
+
# 6.2 MODEL CONFIGURATIONS
|
| 248 |
+
|
| 249 |
+
Table 2 lists the information and model configuration for different datasets. The dimensions of random vectors and hidden vectors are all set to 100. We also compare the number of parameters in DCGAN and LR-GAN. The numbers before $" / "$ are our model, after $\cdot / { \cdot }$ are DCGAN. Based on the same notation used in (Zhao et al., 2016), the architectures for the different datasets are:
|
| 250 |
+
|
| 251 |
+
Table 2: Information and model configurations on different datasets.
|
| 252 |
+
|
| 253 |
+
<table><tr><td>Dataset</td><td>MNIST-ONE</td><td>MNIST-TWO</td><td>CIFAR-10</td><td>CUB-200</td></tr><tr><td>Image Size</td><td>32</td><td>64</td><td>32</td><td>64</td></tr><tr><td>#Images</td><td>60,000</td><td>60,000</td><td>50,000</td><td>5,994</td></tr><tr><td>#Timesteps</td><td>2</td><td>3</td><td>2</td><td>2</td></tr><tr><td>#Parameters</td><td>5.25M/4.11M</td><td>7.53M/6.33M</td><td>5.26M/4.11M</td><td>27.3M/6.34M</td></tr></table>
|
| 254 |
+
|
| 255 |
+
• MNIST-ONE: $G _ { b }$ : (256)4c-(128)4c2s-(64)4c2s-(3)4c2s; $G _ { f } ^ { c }$ : (512)4c-(256)4c2s$( 1 2 8 ) 4 \mathrm { c } 2 \mathrm { s }$ ; ${ \cal G } _ { f } ^ { i }$ : $( 3 ) 4 \mathrm { c } 2 \mathrm { s }$ ; $G _ { f } ^ { m }$ : (1)4c2s; D: (64)4c2s-(128)4c2s-(256)4c2s-(256)4p4s-1
|
| 256 |
+
MNIST-TWO: $G _ { b }$ : (256)4c-(128)4c2s-(64)4c2s-(32)4c2s-(3)4c2s; $G _ { f } ^ { c }$ : (512)4c(256)4c2s-(128)4c2s-(64)4c2s; ${ \cal G } _ { f } ^ { i }$ : (3)4c2s; $G _ { f } ^ { m }$ : (1)4c2s;D: (64)4c2s-(128)4c2s(256)4c2s-(512)4c2s-(512)4p4s-1 CUB-200: $G _ { b }$ : (512)4c-(256)4c2s-(128)4c2s-(64)4c2s-(3)4c2s; $G _ { f } ^ { c }$ : (1024)4c-(512)4c2s(256)4c2s-(128)4c2s; ${ G } _ { f } ^ { i }$ : (3)4c2s; $G _ { f } ^ { m }$ : (1)4c2s;D: (128)4c2s-(256)4c2s-(512)4c2s(1024)4c2s-(1024)4p4s-1
|
| 257 |
+
CIFAR-10: $G _ { b }$ : $( 2 5 6 ) 4 \mathrm { c } - ( 1 2 8 ) 4 \mathrm { c } 2 \mathrm { s } - ( 6 4 ) 4 \mathrm { c } 2 \mathrm { s } - ( 3 ) 4 \mathrm { c } 2 \mathrm { s } ;$ $G _ { f } ^ { c }$ : (512)4c-(256)4c2s-(128)4c2s; ${ G } _ { f } ^ { i }$ : (3)4c2s; $G _ { f } ^ { m }$ : (1)4c2s $D$ : (64)4c2s-(128)4c2s-(256)4c2s-(256)4p4s-1
|
| 258 |
+
|
| 259 |
+
# 6.3 RESULTS ON MNIST-ONE
|
| 260 |
+
|
| 261 |
+
We conduct human studies on generation results on MNIST-ONE. Specifically, we generate 1,000 images using both LR-GAN and DCGAN. As references, we also include 1000 real images. Then we ask the users on AMT to label each image to be one of the digits (0-9). We also provide them an option ‘non recognizable’ in case the generated image does not seem to contain a digit. Each image was judged by 5 unique workers. Similar to CIFAR-10, if an image is recognized to be the same digit by all 5 users, it is assigned to quality level 5. If it is not recognizable according to all users, it is assigned to quality level 0. Fig. 13 (left) shows the number of images assigned to all six quality levels. Compared to DCGAN, our model generated more samples with high quality levels. As expected, the real images have many samples with high quality levels. In Fig. 13 (right), we show the number of images that are recognized to each digit category (0-9). For qualitative comparison, we show examplar images at each quality level in Fig. 14. From left to right, the quality level increases from 0 to 5. As expected, the images with higher quality level are more clear.
|
| 262 |
+
|
| 263 |
+
For quantitative evaluation, we use the same way as for CIFAR-10. The classifier model used for contextual Inception Score is trained based on the training set. We generate 60,000 samples based on DCGAN and LR-GAN for evaluation, respectively. To obtain the Adversarial Accuracy and Adversarial Divergence, we first train 10 generators for 10 digit categories separately, and then use the generated samples to train the classifier. As shown in Table 3, our model has higher scores than DCGAN on both standard and contextual Inception Score. Also, our model has a slightly higher adversarial accuracy, and lower adversarial divergence than DCGAN. We find that the all three image sets have low standard Inception Scores. This is mainly because the Inception net is trained on ImageNet, which has a very different data distribution from the MNIST dataset. Based on this, we argue that the standard Inception Score is not suitable for some image datasets.
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 13: Statistics of annotations in human studies on MNIST-ONE. Left: distribution of quality level; Right: distribution of recognized digit categories.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 14: Qualitative comparison on MNIST-ONE. Top three rows are samples generated by DCGAN. Bottom three rows are samples generated by LR-GAN. The quality level increases from left to right as determined via human studies.
|
| 270 |
+
|
| 271 |
+
Table 3: Quantitative comparison on MNIST-ONE.
|
| 272 |
+
|
| 273 |
+
<table><tr><td>Training Data</td><td>Real Images</td><td>DCGAN</td><td>Ours</td></tr><tr><td>Inception Score†</td><td>1.83±0.01</td><td>2.03±0.01</td><td>2.06±0.01</td></tr><tr><td>Inception Scorett</td><td>9.15±0.04</td><td>6.42±0.03</td><td>7.15±0.04</td></tr><tr><td>Adversarial Accuracy</td><td>95.22 ± 0.25</td><td>26.12 ± 0.07</td><td>26.61 ± 0.06</td></tr><tr><td>Adversarial Divergence Score</td><td>0</td><td>8.47 ± 0.03</td><td>8.39 ± 0.04</td></tr></table>
|
| 274 |
+
|
| 275 |
+
†Evaluate using the pre-trained Inception net as Salimans et al. (2016) ††Evaluate using the supervisedly trained classifier based on the discriminator in LR-GAN.
|
| 276 |
+
|
| 277 |
+
# 6.4 MORE RESULTS ON CUB-200
|
| 278 |
+
|
| 279 |
+
In this experiment, we reduce the minimal allowed object scale to 1.1, which allows the model to generate larger foreground objects. The results are shown in Fig. 15. Similar to the results when the constraint is 1.2, the crisp bird-like masks are generated automatically by our model.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 15: Generation results of our model on CUB-200 when setting minimal allowed scale to 1.1. From left to right, the blocks show the generated background images, foreground images, foreground masks, foreground images carved out by masks, carved foreground images after spatial transformation. The sixth and seventh blocks are final composite images and the nearest neighbor real images.
|
| 283 |
+
|
| 284 |
+
# 6.5 MORE RESULTS ON CIFAR-10
|
| 285 |
+
|
| 286 |
+
# 6.5.1 QUALITATIVE RESULTS
|
| 287 |
+
|
| 288 |
+
In Fig. 16, we show more results on CIFAR-10 when setting minimal allowed object scale to 1.1. The rightmost column block also shows the training images that are closest to the generated images (cosine similarity in pixel space). We can see our model does not memorize the training data.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 16: Generation results of our model on CIFAR-10 with minimal allowed scale be 1.1, From left to right, the layout is same to Fig. 15.
|
| 292 |
+
|
| 293 |
+
# 6.5.2 WALKING IN THE LATENT SPACE
|
| 294 |
+
|
| 295 |
+
Similar to DCGAN, we also show results by walking in the latent space. Note that our model has two or more inputs. So we can walk along any of them or their combination. In Fig. 17, we generate multiple foregrounds for the same fixed generated background. We find that our model consistently generates contextually compatible foregrounds. For example, for the grass-like backgrounds, the foreground generator generates horses and deer, and airplane-like objects for the blue sky.
|
| 296 |
+
|
| 297 |
+
# 6.5.3 WORD CLOUD BASED ON HUMAN STUDY
|
| 298 |
+
|
| 299 |
+
As we mentioned above, we conducted human studies on CIFAR-10. Besides asking people to select a name from a list for an image, we also conducted another human study where we ask people to use one word (free-form) to describe the main object in the image. Each image was ‘named’ by 5 unique people. We generate word clouds for real images, images generated by DCGAN and LR-GAN, as shown in Fig. 18.
|
| 300 |
+
|
| 301 |
+
# 6.6 RESULTS ON LFW FACE DATASET
|
| 302 |
+
|
| 303 |
+
We conduct experiment on face images in LFW dataset (Huang et al., 2007). Different from previous works which work on cropped and aligned faces, we directly generate the original images which contains a large portion of backgrounds. This configuration helps to verify the efficiency of LR-GAN to model the object appearance, shape and pose. In Fig. 19, we show the (intermediate) generation results of LR-GAN. Surprisingly, without any supervisions, the model generated background and faces in separate steps, and the generated masks accurately depict face shapes. Moreover, the model learns where to place the generated faces so that the whole image looks natural. For comparison, please refer to (Kwak & Zhang, 2016) which does not model the transformation. We can find the generation results degrade much.
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 17: Walking in the latent foreground space by fixing backgrounds in our model on CIFAR10. From left to right, the blocks are: generated background images, foreground images, foreground masks, foreground images carved out by masks, carved out foreground images after spatial transformation, and final composite images. Each row has the same background, but different foregrounds.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 18: Statistics of annotations in human studies on CIFAR-10. Left to right: word cloud for real images, images generated by DCGAN, images generated by LR-GAN.
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 19: Generation results of our model on LFW. From left to right, the blocks are: generated background images, foreground images, foreground masks, carved out foreground images after spatial transformation, and final composite images.
|
| 313 |
+
|
| 314 |
+
# 6.7 STATISTICS ON TRANSFORMATION MATRICES
|
| 315 |
+
|
| 316 |
+
In this part, we analyze the statistics on the transformation matrices generated by our model for different datasets, including MNIST-ONE, CUB-200, CIFAR-10 and LFW. We used affine transformation in our model. So there are 6 parameters, scaling in the $\mathbf { X }$ coordinate $( s _ { x } )$ , scaling in the y coordinate $( s _ { y } )$ , translation in the x coordinate $( t _ { x } )$ , translation in the y coordinate $( t _ { y } )$ , rotation in the x coordinate $( r _ { x } )$ and rotation in the y coordinate $( r _ { y } )$ . In Fig. 20, we show the histograms on different parameters for different datasets.These histograms show that the model produces non-trivial varied scaling, translation and rotation on all datasets. For different datasets, the learned transformation have different patterns. We hypothesize that this is mainly determined by the configurations of objects in the images. For example, on MNIST-ONE, all six parameters have some fluctuations since the synthetic dataset contains digits randomly placed at different locations. For the other three datasets, the scalings converge to single value since the object sizes do not vary much, and the variations on rotation and translation suffice to generate realistic images. Specifically, we can find the generator largely relies on the translation on x coordinate for generating CUB-200. This makes sense since birds in the images have similar scales, orientations but various horizontal locations. For CIFAR-10, since there are 10 different object categories, the configurations are more diverse, hence the generator uses all parameters for generation except for the scaling. For LFW, since faces have similar configurations, the learned transformations have less fluctuation as well. As a result, we can see that LR-GAN indeed models the transformations on the foreground to generate images.
|
| 317 |
+
|
| 318 |
+
# 6.8 CONDITIONAL IMAGE GENERATION
|
| 319 |
+
|
| 320 |
+
Considering our model can generate object-like masks (shapes) for images, we conducted an experiment to evaluate whether our model can be potentially used for image segmentation and object detection. We make some changes to the model. For the background generator, the input is a real image instead of a random vector. Then the image is passed through an encoder to extract the hidden features, which replaces the random vector $z _ { \mathrm { 0 } }$ and are fed to the background generator. For the foreground generator, we subtract the image generated by the background generator from the input image to obtain a residual image. Then this residual image is fed to the same encoder to get the hidden features, which are used as the input for foreground generator. In our conditional model, we want to reconstruct the image, so we add a reconstruction loss along with the adversarial loss. We train this conditional model on CIFAR-10. The (intermediate) outputs of the model is shown in Fig. 21. Interestingly, the model successfully learned to decompose the input images into background and foreground. The background generator tends to do an image inpainting by generating a complete background without object, while the foreground generator works as a segmentation model to get object mask from the input image.
|
| 321 |
+
|
| 322 |
+
Similarly, we also run the conditional LR-GAN on LFW dataset. As we can see in Fig. 22, the foreground generator automatically and consistently learned to generate the face regions, even though there are large portion of background in the input images. In other words, the conditional LR-GAN successfully learned to detection faces in images. We suspect this success is due to that it has low cost for the generator to generate similar images, and thus converge to the case that the first generator generate background, and the second generator generate face images.
|
| 323 |
+
|
| 324 |
+
Based on these experiments, we argue that our model can be possibly used for image segmentation and object detection in a generative and unsupervised manner. One future work would be verifying this by applying it to high-resolution and more complicate datasets.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 20: Histograms of transformation parameters learnt in our model for different datasets. From left to right, the datasets are: MNIST-ONE, CUB-200, CIFAR-10 and LFW. From top to bottom, they are scaling $s _ { x }$ , $s _ { y }$ , translation $t _ { x } , t _ { y }$ , and rotation $r _ { x }$ , $r _ { y }$ in $x$ and $y$ coordinate, respectively.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 21: Conditional generation results of our model on CIFAR-10. From left to right, the blocks are: real images, generated background images, foreground images, foreground masks, foreground images carved out by masks, carved foreground images after spatial transformation, and final composite (reconstructed) images.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 22: Conditional generation results of our model on LFW, displayed with the same layout to Fig. 21.
|
md/train/HJxeWnCcF7/HJxeWnCcF7.md
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING MIXED-CURVATURE REPRESENTATIONS IN PRODUCTS OF MODEL SPACES
|
| 2 |
+
|
| 3 |
+
Albert Gu, Frederic Sala, Beliz Gunel & Christopher Re´
|
| 4 |
+
Computer Science Department
|
| 5 |
+
Stanford University
|
| 6 |
+
Stanford, CA 94305
|
| 7 |
+
{albertgu,fredsala,bgunel}@stanford.edu, chrismre@cs.stanford.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
The quality of the representations achieved by embeddings is determined by how well the geometry of the embedding space matches the structure of the data. Euclidean space has been the workhorse for embeddings; recently hyperbolic and spherical spaces have gained popularity due to their ability to better embed new types of structured data—such as hierarchical data—but most data is not structured so uniformly. We address this problem by proposing learning embeddings in a product manifold combining multiple copies of these model spaces (spherical, hyperbolic, Euclidean), providing a space of heterogeneous curvature suitable for a wide variety of structures. We introduce a heuristic to estimate the sectional curvature of graph data and directly determine an appropriate signature—the number of component spaces and their dimensions—of the product manifold. Empirically, we jointly learn the curvature and the embedding in the product space via Riemannian optimization. We discuss how to define and compute intrinsic quantities such as means—a challenging notion for product manifolds—and provably learnable optimization functions. On a range of datasets and reconstruction tasks, our product space embeddings outperform single Euclidean or hyperbolic spaces used in previous works, reducing distortion by $3 2 . 5 5 \%$ on a Facebook social network dataset. We learn word embeddings and find that a product of hyperbolic spaces in 50 dimensions consistently improves on baseline Euclidean and hyperbolic embeddings, by 2.6 points in Spearman rank correlation on similarity tasks and 3.4 points on analogy accuracy.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
With four decades of use, Euclidean space is the venerable elder of embedding spaces. Recently, non-Euclidean spaces—hyperbolic (Nickel & Kiela, 2017; Sala et al., 2018) and spherical (Wilson et al., 2014; Liu et al., 2017)—have gained attention by providing better representations for certain types of structured data. The resulting embeddings offer better reconstruction metrics: higher mean average precision (mAP) and lower distortion compared to their Euclidean counterparts. These three spaces are the model spaces of constant curvature (Lee, 1997), and this improvement in representation fidelity arises from the correspondence between the structure of the data (hierarchical, cyclical) and the geometry of non-Euclidean space (hyperbolic: negatively curved, spherical: positively curved). The notion of curvature plays the key role.
|
| 16 |
+
|
| 17 |
+
To improve representations for a variety of types of data—beyond hierarchical or cyclical—we seek spaces with heterogeneous curvature. The motivation for such mixed spaces is intuitive: our data may have complicated, varying structure, in some regions tree-like, in others cyclical, and we seek the best of all worlds. We expect mixed spaces to match the geometry of the data and thus provide higher quality representations. However, to employ these spaces, we face several key obstacles. We must perform a challenging manifold optimization to learn both the curvature and the embedding. Afterwards, we also wish to operate on the embedded points. For example, analogy operations for word embeddings in Euclidean vector space (e.g., $a - b + c )$ must be lifted to manifolds.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Three component spaces: sphere $\mathbb { S } ^ { 2 }$ , Euclidean plane $\mathbb { E } ^ { 2 }$ , and hyperboloid $\mathbb { H } ^ { 2 }$ . Thick lines are geodesics; these get closer in positively curved $K = + 1 )$ space $\mathbb { S } ^ { 2 }$ , remain equidistant in flat $K = 0$ ) space $\mathbb { E } ^ { 2 }$ , and get farther apart in negatively curved ( $K = - 1 ,$ ) space $\mathbb { H } ^ { 2 }$ .
|
| 21 |
+
|
| 22 |
+
We propose embedding into product spaces in which each component has constant curvature. As we show, this allows us to capture a wider range of curvatures than traditional embeddings, while retaining the ability to globally optimize and operate on the resulting embeddings. Specifically, we form a Riemannian product manifold combining hyperbolic, spherical, and Euclidean components and equip it with a decomposable Riemannian metric. While each component space in the product has constant curvature (positive for spherical, negative for hyperbolic, and zero for Euclidean), the resulting mixed space has non-constant curvature. However, selecting appropriate curvatures for the embedding space is a potential challenge. We directly learn the curvature for each component space along with the embedding (via Riemannian optimization), recovering the correct curvature, and thus the matching geometry, directly from data. We show empirically that we can indeed recover non-uniform curvatures and improve performance on reconstruction metrics.
|
| 23 |
+
|
| 24 |
+
Another technical challenge is to select the underlying number of components and dimensions of the product space; we call this the signature. This concept is vacuous in Euclidean space: the product of $\mathbb { E } ^ { r _ { 1 } } , \ldots , \mathbb { E } ^ { r _ { n } }$ is identical to the single space $\mathbb { E } ^ { r _ { 1 } + \ldots + \bar { r } _ { n } }$ . However, this is not the case with spherical and hyperbolic spaces. For example, the product of the spherical space $\mathbb { S } ^ { 1 }$ (the circle) with itself is the torus $\mathbb { S } ^ { 1 } \times \mathbb { S } ^ { \hat { 1 } }$ , which is topologically distinct from the sphere $\bar { \mathbb { S } } ^ { 2 }$ . We address this challenge by introducing a theory-guided heuristic estimator for the signature. We do so by matching an empirical notion of discrete curvature in our data with the theoretical distribution of the sectional curvature, a fine-grained measure of curvature on Riemannian manifolds that is amenable to analysis in products. We verify that this approach recovers the correct signature on reconstruction tasks.
|
| 25 |
+
|
| 26 |
+
Standard techniques such as PCA require centering so that the embedded directions capture components of variation. Centering in turn needs an appropriate generalization of the mean. We develop a formulation of mean for embedded points that exploits the decomposability of the distance and has theoretical guarantees. For $T = \{ p _ { 1 } , \ldots , p _ { n } \}$ in a manifold $\mathcal { M }$ with dimension $r$ , the mean is $\begin{array} { r } { \mu ( T ) : = \arg \operatorname* { m i n } _ { p } \sum _ { i } d _ { \mathcal { M } } ^ { 2 } ( p , p _ { i } ) } \end{array}$ . We give a global existence result: under symmetry conditions on the distribution of the points in $T$ on the spherical components, gradient descent recovers $\mu ( T )$ with error $\varepsilon$ in time $O ( n r \log \varepsilon ^ { - 1 } )$ .
|
| 27 |
+
|
| 28 |
+
We demonstrate the advantages of product space embeddings through a variety of experiments; products are at least as good as single spaces, but can offer significant improvements when applied to structures not suitable for single spaces. We measure reconstruction quality (via mAP and distortion) for synthetic and real datasets over various allocations of embedding spaces. We observe a $3 2 . 5 5 \%$ improvement in distortion versus any single space on a Facebook social network graph. Beyond reconstruction, we apply product spaces to skip-gram word embeddings, a popular technique with numerous downstream applications, which crucially require the use of the manifold structure. We find that products of hyperbolic spaces improve performance on benchmark evaluations—suggesting that words form multiple smaller hierarchies rather than one larger one. We see an improvement of 3.4 points over baseline single spaces on the Google word analogy benchmark and of 2.6 points in Spearman rank correlation on a word similarity task using the WS-353 corpus. Our results and initial exploration suggest that mixed product spaces are a promising area for future study.
|
| 29 |
+
|
| 30 |
+
# 2 PRELIMINARIES & BACKGROUND
|
| 31 |
+
|
| 32 |
+
Embeddings For metric spaces1 $U , V$ equipped with distances $d _ { U } , d _ { V }$ , an embedding is a mapping $f : U \to V$ . The quality of an embedding is measured by various fidelity measures. A standard measure is average distortion $D _ { \mathrm { a v g } }$ . The distortion of a pair of points $a , b$ is $( | d _ { V } ( f ( a ) , f ( b ) ) - $ ${ d _ { U } ( a , b ) | ) } / { d _ { U } ( a , \bar { b } ) }$ , and $D _ { \mathrm { a v g } }$ is the average over all pairs of points.
|
| 33 |
+
|
| 34 |
+
Distortion is a global metric; it considers the explicit value of all distances. At the other end of the global-local spectrum of fidelity measures is mean average precision (mAP), which applies to unweighted graphs. Let $G = ( { \dot { V } } , E )$ be a graph and node $a \in V$ have neighborhood $\bar { \mathcal { N } } _ { a } =$ $\{ b _ { 1 } , \dotsc , b _ { \deg ( a ) } \}$ , where $\deg ( a )$ is the degree of $a$ . In the embedding $f$ , define $R _ { a , b _ { i } }$ to be the smallest ball around $f ( a )$ that contains $b _ { i }$ (that is, $R _ { a , b _ { i } }$ is the smallest set of nearest points required to retrieve the ith neighbor of a in f ). Then, mAP(f ) = 1|V | Pa∈V 1deg(a) $\begin{array} { r } { \mathrm { m A P } ( f ) = \frac { 1 } { | V | } \sum _ { a \in V } \frac { 1 } { \deg ( a ) } \sum _ { i = 1 } ^ { | N _ { a } | } | N _ { a } \cap R _ { a , b _ { i } } | / | R _ { a , b _ { i } } | . } \end{array}$ .
|
| 35 |
+
|
| 36 |
+
Note that mAP does not track explicit distances; it is a ranking-based measure for local neighborhoods. Observe that $\operatorname* { m A P } ( f ) \leq \mathrm { i }$ (higher is better) while $d _ { \mathrm { a v g } } \geq 0$ (lower is better).
|
| 37 |
+
|
| 38 |
+
Riemannian Manifolds We briefly review some notions from manifolds and Riemannian geometry. A more in-depth treatment can be found in standard texts (Lee, 2012; do Carmo, 1992). Let $M$ be a smooth manifold, $p \in M$ be a point, and $T _ { p } M$ be the tangent space to the point $p$ . If $M$ is equipped with a Riemannian metric $g$ , then the pair $( M , g )$ is called a Riemannian manifold. The shortest-distance paths on manifolds are called geodesics. To compute distance functions on a Riemannian manifold, the metric tensor $g$ is integrated along the geodesic. This is a smoothly varying function (in $p$ ) $g : T _ { p } M \times T _ { p } M \to \mathbb { R }$ that induces geometric notions such as length and angle by defining an inner product on the tangent space. For example, the norm of $v \in T _ { p } M$ is defined as $\| v \| _ { g } : = g _ { p } ( v , v ) ^ { \frac { 1 } { 2 } }$ . In Euclidean space $\mathbb { R } ^ { d }$ , each tangent space $T _ { p } \mathbb { R } ^ { d }$ is canonically identified with $\mathbb { R } ^ { d }$ , and the metric tensor $g ^ { E }$ is simply the normal inner product.
|
| 39 |
+
|
| 40 |
+
Product Manifolds Consider a sequence of smooth manifolds $M _ { 1 } , M _ { 2 } , \ldots , M _ { k }$ . The product manifold is defined as the Cartesian product $M = M _ { 1 } \times M _ { 2 } \times . . . \times M _ { k }$ . Notationally, we write points $p \in M$ through their coordinates $p = ( p _ { 1 } , \dotsc , p _ { k } ) : p _ { i } \in M _ { i }$ , and similarly a tangent vector $v \in T _ { p } M$ can be written $( v _ { 1 } , \ldots , v _ { k } ) : v _ { i } \in T _ { p _ { i } } M _ { i }$ . If the $M _ { i }$ are equipped with metric tensor $g _ { i }$ , then the product $M$ is also Riemannian with metric tensor $\begin{array} { r } { g ( u , v ) = \sum _ { i = 1 } ^ { k } g _ { i } ( u _ { i } , v _ { i } ) . } \end{array}$ . That is, the product metric decomposes into the sum of the constituent metrics.
|
| 41 |
+
|
| 42 |
+
Geodesics and Distances Optimization on manifolds requires a notion of taking a step. This step can be performed in the tangent space and transferred to the manifold via the exponential map $\mathrm { E x p } _ { p } : T _ { p } M \to M$ . In a product manifold $\mathcal { P }$ , for tangent vectors $v = ( v _ { 1 } , \ldots , v _ { k } )$ at $p =$ $( p _ { 1 } , \dots , p _ { k } ) \in M$ , the exponential map simply decomposes, as do squared distances (Ficken, 1939; Turaga & Srivastava, 2016):
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathrm { E x p } _ { p } ( v ) = ( \mathrm { E x p } _ { p _ { 1 } } ( v _ { 1 } ) , \ldots , \mathrm { E x p } _ { p _ { k } } ( v _ { k } ) ) , \qquad d _ { \mathcal { P } } ^ { 2 } ( x , y ) = \sum _ { i = 1 } ^ { k } d _ { i } ^ { 2 } ( x _ { i } , y _ { i } ) .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
In other words, the shortest path between points in the product travels along the shortest paths in each component simultaneously. Note the analogy to Euclidean products $\mathbb { R } ^ { d } \equiv ( \mathbb { R } ^ { 1 } ) ^ { d }$ .
|
| 49 |
+
|
| 50 |
+
Hyperbolic and Spherical Model We use the hyperboloid model of hyperbolic space, with points in $\mathbb { R } ^ { d + 1 }$ . Let $J \in \mathsf { \bar { R } } ^ { ( d + 1 ) \times ( d + 1 ) }$ be the diagonal matrix with $J _ { 0 0 } = - 1$ and $J _ { i i } = 1 : i > 0$ . For $p , q \in \mathbb { R } ^ { d + 1 }$ , the Minkowski inner product is $\langle p , q \rangle _ { \ast } : = p ^ { T } J q = - p _ { 0 } q _ { 0 } + p _ { 1 } q _ { 1 } + . . . + p _ { d } q _ { d }$ , and the corresponding norm is $\| p \| _ { * } = \langle p , p \rangle _ { * } ^ { \frac { 1 } { 2 } }$ . For any $K > 0$ , the hyperboloid $\mathbb { H } _ { K } ^ { d }$ is defined on the
|
| 51 |
+
|
| 52 |
+
subset $\{ p \in \mathbb { R } ^ { d + 1 } : \| p \| _ { * } = - K ^ { 1 / 2 } , p _ { 0 } > 0 \}$ . When the subscript $K$ is omitted, it is taken to be 1.
|
| 53 |
+
The hyperbolic distance on $\mathbb { H } ^ { d }$ is $d _ { H } ( p , q ) = \mathrm { a c o s h } ( - \langle p , q \rangle _ { * } )$ .
|
| 54 |
+
|
| 55 |
+
Similarly, spherical space $\mathbb { S } _ { K } ^ { d }$ is most easily defined when embedded in $\mathbb { R } ^ { d + 1 }$ . The manifold is defined on the subset $\{ p \in \mathbb { R } ^ { d + 1 } : \| p \| _ { 2 } = K ^ { 1 / 2 } \}$ , with metric $g ^ { S }$ induced by the Euclidean metric on $\mathbb { R } ^ { d + 1 }$ . The spherical distance on $\mathbb { S } ^ { d }$ is $d _ { S } ( p , q ) = \operatorname { a r c c o s } ( \langle p , q \rangle )$ .
|
| 56 |
+
|
| 57 |
+
# 3 PRODUCT SPACES AND CONSTRUCTIONS
|
| 58 |
+
|
| 59 |
+
We now tackle the challenges of mixed spaces. First, we introduce a product manifold embedding space $\mathcal { P }$ composed of multiple copies of simple model spaces, providing heterogeneous curvature. Next, in Section 3.1, given the signature of $\mathcal { P }$ (the number of components of each type and their dimensions), we describe how to simultaneously learn an embedding and the curvature for each component through optimization. In Section 3.2, we provide a heuristic to choose the signature by estimating a discrete notion of curvature for given data. Finally, in Section 3.3, given an embedding in $\mathcal { P }$ , we introduce a Karcher-style mean which can be recovered efficiently.
|
| 60 |
+
|
| 61 |
+
Let $\mathbb { S } _ { K } ^ { d }$ and $\mathbb { H } _ { K } ^ { d }$ be the spherical and hyperbolic spaces of dimension $d$ and curvature $K , - K$ , respectively, and $\mathbb { E } ^ { d }$ the Euclidean space of dimension $d$ .2 We describe our main embedding space: for sequences of dimensions $s _ { 1 } , s _ { 2 } , \ldots , s _ { m }$ , $h _ { 1 } , \ldots , h _ { n }$ , and $e$ , we write
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathcal { P } = \mathbb { S } ^ { s _ { 1 } } \times \mathbb { S } ^ { s _ { 2 } } \times \dots \times \mathbb { S } ^ { s _ { m } } \times \mathbb { H } ^ { h _ { 1 } } \times \mathbb { H } ^ { h _ { 2 } } \times \dots \times \mathbb { H } ^ { h _ { n } } \times \mathbb { E } ^ { e }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
a product manifold with $m + n + 1$ component spaces and total dimension $\begin{array} { r } { \sum _ { i } s _ { i } + \sum _ { j } h _ { j } + e . } \end{array}$ . We refer to each ${ \mathbb S } ^ { s _ { i } } , { \mathbb H } ^ { h _ { i } } , { \mathbb E } ^ { e }$ as components or factors. We refer to the decomposition, e.g., $( \mathbb { H } ^ { 2 } ) ^ { 2 } =$ $\mathbb { H } ^ { 2 } \times \mathbb { H } ^ { 2 }$ , as the signature. For convenience, let $M _ { 1 } , \dots , M _ { m + n + 1 }$ refer to the factors in the product.
|
| 68 |
+
|
| 69 |
+
Distances on $\mathcal { P }$ As discussed in Section 2, the product $\mathcal { P }$ is a Riemannian manifold defined by the structure of its components. For $p , q \in \mathcal { P }$ , we write $d _ { M _ { i } } ( p , q )$ for the distance $d _ { M _ { i } }$ restricted to the appropriate components of $p$ and $q$ in the product. In particular, the squared distance in the product decomposes via (1). In other words, $d _ { \mathcal { P } }$ is simply the $\ell _ { 2 }$ norm of the component distances $d _ { M _ { i } }$ .
|
| 70 |
+
|
| 71 |
+
We note that $\mathcal { P }$ can also be equipped with different distances (ignoring the Riemannian structure), leading to a different embedding space. Without the underlying manifold structure, we cannot freely operate on the embedded points such as taking geodesics and means, but some simple applications only interact through distances. For such settings, we consider the $\ell _ { 1 }$ distance $\begin{array} { r } { d _ { \mathcal { P } , \ell _ { 1 } } ( p , q ) = \sum _ { i = 1 } ^ { s _ { m } } d _ { S _ { i } } ( p , q ) + \sum _ { i = 1 } ^ { h _ { n } } d _ { H _ { i } } ( p , q ) + d _ { E } ( p , q ) } \end{array}$ and the min distance $d _ { \mathcal { P } , \operatorname* { m i n } } ( p , q ) =$ min $\{ d _ { S _ { 1 } } ( p , q ) , \ldots , d _ { H _ { 1 } } ( p , q ) , \ldots , d _ { E } ( p , q ) \}$ . These distances provide simple and interpretable embedding spaces using $\mathcal { P }$ , enabling us to introduce combinatorial constructions that allow for embeddings without the need for optimization. We give an example below and discuss further in the Appendix. We then focus on the Riemannian distance, which allows Riemannian optimization directly on the manifold, and enables full use of the manifold structure in generic downstream applications.
|
| 72 |
+
|
| 73 |
+
Example Consider the graph $G$ shown on the right of Figure 2. This graph has a backbone cycle with 9 nodes, each attached to a tree; such topologies are common in networking. If a single edge $( a , b )$ is removed from the cycle, the result is a tree embeddable arbitrarily well into hyperbolic space (Sala et al., 2018). However, $a , b$ (and their subtrees) would then incur an additional distance of $8 - 1 = 7$ , being forced to go the other way around the cycle. But using the $\ell _ { 1 }$ distance, we can embed $G _ { \mathrm { t r e e } }$ into $\bar { \mathbb { H } } ^ { 2 }$ and $G _ { \mathrm { c y c l e } }$ into $\mathbb { S } ^ { 1 }$ , yielding arbitrarily low distortion for $G$ . We give the full details and another combinatorial construction for the min-distance in the Appendix.
|
| 74 |
+
|
| 75 |
+
# 3.1 OPTIMIZATION & COMPONENT CURVATURES
|
| 76 |
+
|
| 77 |
+
To compute embeddings, we optimize the placement of points through an auxiliary loss function. Given graph distances $\bar { \{ d _ { G } ( X _ { i } , X _ { j } ) \} _ { i j } }$ , our loss function of choice is
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } ( x ) = \sum _ { 1 \leq i \leq j \leq n } \left. \left( \frac { d _ { \mathcal { P } } ( x _ { i } , x _ { j } ) } { d _ { G } ( X _ { i } , X _ { j } ) } \right) ^ { 2 } - 1 \right. ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 2: Left: Riemannian SGD decomposes per component. Subscripts $i$ index components in the product. Right: Ring of trees graph $G$ . Neither hyperbolic nor spherical space is suitable for $G$ , but the product $\mathbb { H } \times \mathbb { S }$ captures it with low distortion. Note the decomposition into tree and cycle.
|
| 85 |
+
|
| 86 |
+
which captures the average distortion. (2) depends on hyperbolic distance $d _ { H }$ (for which the gradient is unstable) only through the square $d _ { H } ^ { 2 }$ , which is continuously differentiable (Sala et al., 2018).
|
| 87 |
+
|
| 88 |
+
In any Riemannian manifold, a loss function can be optimized through standard Riemannian optimization methods such as RSGD (Bonnabel, 2013) and RSVRG (Zhang et al., 2016). We write down the full RSGD specialized to our product spaces in Algorithm 1. This proceeds by first computing the Euclidean gradient $\nabla L ( x )$ with respect to the ambient space of the embedding (Step 4), and then converting it to the Riemannian gradient by applying the Riemannian correction (multiply by the inverse of the metric tensor $g _ { \mathcal { P } } ^ { - 1 }$ ). This overall strategy has been detailed in previous work in the hyperboloid model (Nickel & Kiela, 2018; Wilson & Leimeister, 2018), and the same calculations apply to our hyperbolic components.
|
| 89 |
+
|
| 90 |
+
Since $g _ { \mathcal { P } }$ is block diagonal on a product manifold, it suffices to apply the correction and perform the gradient step in each component $M _ { i }$ independently. In the spherical and hyperboloid models, which have smaller dimension than the ambient space, this is performed by first projecting the gradient vector $h$ onto the tangent space $T _ { x } M$ via $\mathrm { p r o j } _ { x } ^ { S } ( h ) = h - \langle h , x \rangle x$ (Step 6) and $\mathrm { { p r o j } } _ { x } ^ { H } ( h ) =$ $\bar { h } + \langle h , x \rangle _ { * } x$ (Step 8). In the hyperboloid model, a final rescaling by the inverse of the metric $J$ is needed (Step 9). This is not required in the spherical model since it inherits the same metric from the ambient Euclidean space.
|
| 91 |
+
|
| 92 |
+
Learning the Curvature There exists a spherical model for every curvature $K > 0$ (for example, the sphere $\mathbb { S } _ { K } ^ { d }$ of radius $K ^ { - 1 / 2 }$ ) and a hyperbolic model for every $K < 0$ (the hyperboloid $\mathbb { H } _ { - K } ^ { d } )$ . We jointly optimize the curvature $K _ { i }$ of every non-Euclidean factor $M _ { i }$ along with the embeddings.
|
| 93 |
+
|
| 94 |
+
The idea is that distances on the spherical and hyperboloid models of arbitrary curvature can be emulated through distances on the standard models $\mathbb { S } , \mathbb { H }$ of curvature 1. For example, given $p , q$ on the sphere $\mathbb { S } _ { 1 / R ^ { 2 } }$ of radius $R$ , then $d ( p , q ) = R \cdot d _ { \mathbb { S } _ { 1 } } ( p / R , q / R )$ where $p / R , q / R$ lie on the unit sphere. Therefore the radius $R$ , which is monotone in the curvature $K$ , can be treated as a parameter as well, so that we can optimize $K$ and implicitly represent points lying on the manifold of curvature $K$ , while explicitly only needing to store and optimize points in the standard model of curvature 1 via Algorithm 1. The hyperboloid model is analogous. Moreover, the loss (2) depends only on squared distances on the product manifold, which are simple functions of distances in the components through (1), so we can optimize the curvature of each factor in $\mathcal { P }$ .
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 3: Geodesic triangles in differently curved spaces: compared to Euclidean geometry in which it satisfies the parallelogram law (Center), the median am is longer in cycle-like positively curved space (Left), and shorter in tree-like negatively curved space (Right). The relative length of $a m$ can be used as a heuristic to estimate discrete curvature.
|
| 98 |
+
|
| 99 |
+
# 3.2 ESTIMATING THE SIGNATURE
|
| 100 |
+
|
| 101 |
+
To choose the signature of an appropriate space $\mathcal { P }$ corresponding to given data, we again turn to curvature. We use the sectional curvature, a finer-grained notion defined over all two-dimensional subspaces passing through a point. Unlike coarser notions like scalar curvature, this is not constant in a product of basic spaces. Given linearly independent $u , v \in T _ { p } M$ spanning a two-dimensional subspace $U$ , the sectional curvature $K _ { p } ( u , v )$ or $K _ { p } ( U )$ is defined as the Gaussian curvature of the surface $\operatorname { E x p } ( U ) \subseteq M$ . Intuitively, this captures the rate that geodesics on the surface emanating from $p$ spread apart, which relates to volume growth. In Appendix C.2, we show that the sectional curvature of $\mathcal { P }$ interpolates between the sectional curvatures of the factors, enabling us to better capture a wider range of structures in our embeddings:
|
| 102 |
+
|
| 103 |
+
Lemma 1. Let $M = M _ { 1 } \times M _ { 2 }$ where $M _ { i }$ has constant curvature $K _ { i }$ . For any $u , v \in T _ { p } M ,$ if $K _ { 1 } , K _ { 2 }$ are both non-negative, the sectional curvature satisfies $K ( u , v ) \in [ 0 , \operatorname* { m a x } \{ K _ { 1 } , \bar { K _ { 2 } } \} ]$ . If $K _ { 1 } , K _ { 2 }$ are both non-positive, the sectional curvature satisfies $K ( u , v ) \in [ \operatorname* { m i n } \{ K _ { 1 } , K _ { 2 } \} , 0 ]$ . If $K _ { i } < 0$ and $K _ { j } > 0$ for $i \neq j$ , then $K ( u , v ) \in [ K _ { i } , K _ { j } ]$ .
|
| 104 |
+
|
| 105 |
+
Our estimation technique employs a triangle comparison theorem following from Toponogov’s theorem and the law of cosines, which characterizes sectional curvature through the behavior of small triangles (note that a triangle determines a 2-dimensional submanifold). Let $a b c$ be a geodesic triangle in manifold (or metric space) $M$ and $m$ be the (geodesic) midpoint of $b c$ , and consider the quantity
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\xi _ { M } ( a , b , c ) : = d _ { M } ( a , m ) ^ { 2 } + d _ { M } ( b , c ) ^ { 2 } / 4 - \left( d _ { M } ( a , b ) ^ { 2 } + d _ { M } ( a , c ) ^ { 2 } \right) / 2 .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
This is non-negative (resp. non-positive) when the curvature is non-negative (resp. non-positive). Note that consequently the equality case occurs exactly when the curvature is $0$ , and equation 3 becomes the parallelogram law of Euclidean geometry (Figure 3).
|
| 112 |
+
|
| 113 |
+
Analogous to sectional curvature, which is a function of a point $p$ and two directions $x , y$ from $p$ , in an undirected graph $G$ we define an analog for every node $m$ and two neighbors $b , c$ . Given a reference node $a$ we set: $\xi _ { G } ( m ; b , c ; a ) = \overline { { { 2 d _ { G } ( a , m ) } } } \bar { \xi } _ { G } ( a , b , c )$ 12dG(a,m) ξG(a, b, c). This is exactly the expression from equation 3, normalized suitably so as to yield the correct scaling for trees and cycles. Our curvature estimation is then a simple average $\begin{array} { r } { \xi _ { G } ( m ; b , c ) = \frac { 1 } { | V | - 1 } \sum _ { a \ne m } \xi _ { G } ( m ; b , c ; a ) } \end{array}$ .
|
| 114 |
+
|
| 115 |
+
Importantly, $\xi _ { G }$ recovers the right curvature for graph atoms such as lines, cycles, and trees (Appendix C.2, Lemma 4,5), and the correct sign for other special discrete objects like polyhedra (Thurston, 1998). The curvature is zero for lines, positive for cycles, and negative for trees.
|
| 116 |
+
|
| 117 |
+
For a generic graph $G$ , we use this to generate a potential product manifold to embed in. An empirical sectional curvature of $G$ is estimated via Algorithm 3, which is based off the homogeneity of product manifolds (i.e. isometries act transitively), implying that it suffices to analyze the curvature at a random point. In particular, we moment-match the distributions of sectional curvature through uniformly random 2-planes in the graph and in the manifold through Algorithms 3,2 (Appendix C.2).
|
| 118 |
+
|
| 119 |
+
# 3.3 MEANS IN THE PRODUCT MANIFOLD
|
| 120 |
+
|
| 121 |
+
A critical operation on manifolds is that of taking the mean; it is necessary for many downstream applications, including, for example, analogy tasks with word embeddings, for clustering, and for centering before applying PCA. Even in simple settings like the circle $\mathbb { S } ^ { 1 }$ , defining a mean is nontrivial. A classic approach is to take the Euclidean mean (in $\mathbb { E } ^ { 2 }$ ) of the points and to project back onto $\mathbb { S } ^ { 1 }$ —but this operation fails in the case where the points are uniformly spaced on $\bar { \mathbb { S } } ^ { 1 }$ . A further roadblock is the varying curvature of $\mathcal { P }$ . Fortunately, we can exploit the decomposability of the distance on $\mathcal { P }$ , reducing the challenge to breaking symmetries in the component spaces. To do so, we introduce the following Karcher-style weighted mean. Let $T = \{ p _ { 1 } , p _ { 2 } , . . . , \bar { p } _ { n } \}$ be a set of points in $\mathcal { P }$ and $w _ { 1 } , \ldots , w _ { n }$ be positive weights satisfying $\textstyle \sum _ { i = 1 } ^ { n } w _ { i } = 1$ . Then the mean $\mu ( T )$ is $\begin{array} { r } { \arg \operatorname* { m i n } _ { p \in \mathcal { P } } \sum _ { i = 1 } ^ { n } w _ { i } d _ { \mathcal { P } } ^ { 2 } ( p , p _ { i } ) } \end{array}$ i=1 . In special cases, this matches commonly used means (the centroid in the Euclidean case $\mathbb { E } ^ { d }$ , the spherical average for $\mathbb { S } ^ { 2 }$ in Buss & Fillmore (2001)). We further note that when $w _ { i } \geq 0$ , the squared-distance components above are individually convex: this is trivial in the Euclidean term, holds in the hyperbolic case (cf. Theorem 4.1 (Bishop & O’Neill, 1969)), and holds in the spherical case under certain restrictions, e.g., when the points in $T$ lie entirely in one hemisphere of $\mathbb { S } ^ { r }$ (Buss & Fillmore, 2001). Moreover, in this case, peforming the optimization on the mean with gradient descent via the exponential map offers linear rate convergence:
|
| 122 |
+
|
| 123 |
+
emmand $\mathcal { P }$ be a product of moweights satisfying ces oand on . M $r _ { \mathrm { { ; } } }$ , $T = \{ p _ { 1 } , \ldots , p _ { n } \}$ points inonents of $\mathcal { P }$ $w _ { 1 } , \ldots , w _ { n }$ $w _ { i } \geq 0$ $\textstyle \sum _ { i = 1 } ^ { n } w _ { i } = 1$ the points in $\mathcal { P }$ , $p _ { i | \mathbb { S } ^ { j } }$ restricted to each spherical component space $\mathbb { S } ^ { j }$ fall in one hemisphere of $\mathbb { S } ^ { j }$ . Then, Riemannian gradient descent recovers the mean $\mu ( T )$ within distance $\epsilon$ in time $O ( n r \log \epsilon ^ { - 1 } )$ .
|
| 124 |
+
|
| 125 |
+
This is a global result; with weaker assumptions, we can derive local results; for example, in the case where some of the $w _ { i }$ are negative, which is useful for analogy operations.
|
| 126 |
+
|
| 127 |
+
In summary, we offer the following key takeaways of our development:
|
| 128 |
+
|
| 129 |
+
• Product manifolds of model spaces capture heterogeneous curvature while providing tractable optimization,
|
| 130 |
+
• Each component’s curvature can be learned empirically through a reparametrization,
|
| 131 |
+
• A signature for the product can be found by matching discrete notions of curvature on graphs with sectional curvature on manifolds,
|
| 132 |
+
• There exists an easily-computed formulation of mean with theoretical guarantees.
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
We evaluate the proposed approach, comparing the representation quality of synthetic graphs and real datasets among different embedding spaces by measuring the reconstruction fidelity (through average distortion and mAP). We expect that mixed product spaces perform better for nonhomogeneous data. We consider the curvature of graphs, reporting the curvatures learned through optimization as well as the theoretical allocation from Section 3.2. Beyond reconstruction, we evaluate the intrinsic performance of product space embeddings in a skip-gram word embedding model, by defining tasks with generic manifold operations such as means.
|
| 137 |
+
|
| 138 |
+
# 4.1 GRAPH RECONSTRUCTION
|
| 139 |
+
|
| 140 |
+
Datasets We examine synthetic datasets—trees, cycles, the ring of trees shown in Figure 1, confirming that each matches its theoretically optimal embedding space. We then compare on several real-world datasets with describable structure, including the USCA312 dataset of distances between North American cities (Burkardt); a tree-like graph of computer science Ph.D. advisor-advisee relationships (De Nooy et al., 2011) reported in previous hyperbolics work (Sala et al., 2018); a powergrid distribution network with backbone structure (Watts & Strogatz, 1998); and a dense social network from Facebook (McAuley & Leskovec, 2012). For the former two graphs with well-defined structure, we expect optimal embeddings in spaces of positive and negative curvature, respectively. We hypothesize that the backbone network embeds well into simple products of hyperbolic and spherical spaces as in Figure 2, and the dense graph also benefits from a mixture of spaces.
|
| 141 |
+
|
| 142 |
+
Approaches We minimize the loss (2) using Algorithm 1. We fix a total dimension $d$ and consider the most natural ways to construct product manifolds of the given dimension, through iteratively doubling the number of factors. These models include the products consisting of only a constantcurvature base space, ranging to various combinations of $\mathbb { S } _ { 2 } ^ { \hat { d } / 2 } , \mathbb { H } _ { 2 } ^ { d / 2 }$ comprising factors of dimension 2.3 For a given signature, the curvatures are initialized to the appropriate value in $\{ - 1 , 0 , 1 \}$ and then learned using the technique in Section 3.1. We additionally compare to the outputs of Algorithms 2,3 for heuristically selecting a combination of spaces in which to embed these datasets.
|
| 143 |
+
|
| 144 |
+
Table 1: Matching geometries: Average distortion on canonical graphs (tree, cycle, ring of trees) with 40 nodes, comparing four spaces with total dimension 3. The best distortion is achieved by the space with matching geometry.
|
| 145 |
+
|
| 146 |
+
<table><tr><td></td><td>Cycle</td><td>Tree</td><td>Ring of Trees</td></tr><tr><td></td><td>|V|= 40,|E| =40</td><td>|V|= 40,|E|=39</td><td>|V|= 40,|E|= 40</td></tr><tr><td>(E3)1</td><td>0.1064</td><td>0.1483</td><td>0.0997</td></tr><tr><td>(H)1</td><td>0.1638</td><td>0.0321</td><td>0.0774</td></tr><tr><td>(s3)1</td><td>0.0007</td><td>0.1605</td><td>0.1106</td></tr><tr><td>(H²)×(S1)1</td><td>0.1108</td><td>0.0538</td><td>0.0616</td></tr></table>
|
| 147 |
+
|
| 148 |
+
Quality We focus on the average distortion—which our loss function (2) optimizes—as our main metric for reconstruction, and additionally report the mAP metric for the unweighted graphs. As expected, for the synthetic graphs (tree, cycle, ring of trees), the matching geometries (hyperbolic, spherical, product of hyperbolic and spherical) yield the best distortion (Table 1). Next, we report in Table 2 the quality of embedding different graphs across a variety of allocations of spaces, fixing total dimension $d = 1 0$ following previous work (Nickel & Kiela, 2018). We confirm that the structure of each graph informs the best allocation of spaces. In particular, the cities graph—which has intrinsic structure close to $\mathbb { S } ^ { 2 }$ —embeds well into any space with a spherical component, and the treelike Ph.D.s graph embeds well into hyperbolic products. We emphasize that even for such datasets that theoretically match a single constant-curvature space, the products thereof perform no worse. In general, the product construction achieves high quality reconstruction: the traditional Euclidean approach is often well below several other signatures. We additionally report the learned curvatures associated with the optimal signature, finding that the resulting curvatures are non-uniform even for products of identical spaces (cf. Ph.D.s). Finally, Table 3 reports the signature estimations of Algorithms 2, 3 for the unweighted graphs. Among the signatures over two components, the estimated curvature signs agree with best distortion results from Table 2.
|
| 149 |
+
|
| 150 |
+
# 4.2 WORD EMBEDDINGS
|
| 151 |
+
|
| 152 |
+
To investigate the performance of product space embeddings in applications requiring the underlying manifold structure, we learned word embeddings and evaluated them on benchmark datasets for word similarity and analogy. In particular, we extend results on hyperbolic skip-gram embeddings from Leimeister & Wilson (2018) (LW), who found that hyperbolic embeddings perform favorably against Euclidean word vectors in low dimensions $( d = 5 , 2 0 )$ , but less so in higher dimensions $( d = 5 0 , 1 0 0 )$ ). Building on these results, we hypothesize that in high dimensions, a product of multiple smaller-dimension hyperbolic spaces will substantially improve performance.
|
| 153 |
+
|
| 154 |
+
Setup We use the standard skip-gram model (Mikolov et al., 2013) and extend the loss function to a generic objective suitable for arbitrary manifolds, which is a variant of the objective proposed by LW. Concretely, given a word $u$ and target $w$ , with label $y = 1$ if $w$ is a context word for $u$ and $y = 0$ if it is a negative sample, the model is $P ( y | w , u ) = \sigma \left( ( - 1 ) ^ { 1 - y } ( - \cosh ( d ( \alpha _ { u } , \gamma _ { w } ) ) + \theta ) \right)$ .
|
| 155 |
+
|
| 156 |
+
Training followed the setup of LW, building on the fastText skip-gram implementation. Euclidean results are reported directly from fastText. Aside from choice of model, the training setup including hyperparameters (window size, negative samples, etc.) is identical to LW for all models.
|
| 157 |
+
|
| 158 |
+
Word Similarity We measure the Spearman rank correlation $\rho$ between our scores and annotated ratings on the word similarity datasets WS-353 (Finkelstein et al., 2001), Simlex-999 (Hill et al.,
|
| 159 |
+
|
| 160 |
+
Table 2: Graph reconstruction: fidelity measures for graph embeddings using $d = 1 0$ total dimensions, with varying allocations of spaces and dimensions. Our loss function (2) targets distortion, and for each dataset the best model reflects the structure of the data. Even on near-perfectly spherical or hierarchical data, products of $\mathbb { S }$ (resp. $\mathbb { H }$ ) perform no worse than the single copy.
|
| 161 |
+
|
| 162 |
+
<table><tr><td></td><td>Cities</td><td colspan="2">CS PhDs</td><td colspan="2">Power</td><td colspan="2">Facebook</td></tr><tr><td></td><td>|V|=312</td><td colspan="2">|V|=1025,|E|=1043</td><td colspan="2">|V|=4941,|E|=6594</td><td colspan="2">|V|=4039,|E|=88234</td></tr><tr><td></td><td>Davg</td><td>Davg</td><td>mAP</td><td>Davg</td><td>mAP</td><td>Davg</td><td>mAP</td></tr><tr><td>E10</td><td>0.0735</td><td>0.0543</td><td>0.8691</td><td>0.0917</td><td>0.8860</td><td>0.0653</td><td>0.5801</td></tr><tr><td>H10</td><td>0.0932</td><td>0.0502</td><td>0.9310</td><td>0.0388</td><td>0.8442</td><td>0.0596</td><td>0.7824</td></tr><tr><td>s10</td><td>0.0598</td><td>0.0569</td><td>0.8329</td><td>0.0500</td><td>0.7952</td><td>0.0661</td><td>0.5562</td></tr><tr><td>(H5)2</td><td>0.0756</td><td>0.0382</td><td>0.9628</td><td>0.0365</td><td>0.8605</td><td>0.0430</td><td>0.7742</td></tr><tr><td>(s5)2</td><td>0.0593</td><td>0.0579</td><td>0.7940</td><td>0.0471</td><td>0.8059</td><td>0.0658</td><td>0.5728</td></tr><tr><td>Hxs5</td><td>0.0622</td><td>0.0509</td><td>0.9141</td><td>0.0323</td><td>0.8850</td><td>0.0402</td><td>0.7414</td></tr><tr><td>(H2)5</td><td>0.0687</td><td>0.0357</td><td>0.9694</td><td>0.0396</td><td>0.8739</td><td>0.0525</td><td>0.7519</td></tr><tr><td>(s25</td><td>0.0638</td><td>0.0570</td><td>0.8334</td><td>0.0483</td><td>0.8818</td><td>0.0631</td><td>0.5808</td></tr><tr><td>(H²)²×E²×(S²)²</td><td>0.0765</td><td>0.0391</td><td>0.8672</td><td>0.0380</td><td>0.8152</td><td>0.0474</td><td>0.5951</td></tr><tr><td>Best model</td><td>Si.0xsi1</td><td></td><td>H×HxH2.5×(H2.2)²</td><td>H ×</td><td>Si2.6</td><td>H.3</td><td>×S.5</td></tr><tr><td>Davg improvement over single space</td><td>0.8%</td><td>28.89%</td><td></td><td>16.75%</td><td></td><td>32.55%</td><td></td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 3: Heuristic allocation: estimated signatures for embedding unweighted graphs from Table 2 into two factors, using Algorithms 2,3 to match the empirical distribution of graph curvature. The resulting curvature signs agree with results from Table 2 for choosing among two-component spaces.
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td>CS PhDs</td><td>Power</td><td>Facebook</td></tr><tr><td>Estimated Signature</td><td>HXH.2H8×S.HxS6</td><td></td><td></td></tr></table>
|
| 167 |
+
|
| 168 |
+
2015) and MEN (Bruni et al., 2014). The results are in Table 4. Notably, we find that hyperbolic word embeddings are consistently competitive with or better than the Euclidean embeddings, and the improvement increases with more factors in the product. This suggests that word embeddings implicitly contain multiple distinct but smaller hierarchies rather than forming a single larger one.
|
| 169 |
+
|
| 170 |
+
Analogies In manifolds, there is no exact analog of the “word arithmetic” of conventional word embeddings arising from vector space structure. However, analogies can still be defined via intrinsic product manifold operations. In particular, note that the loss function depends on the embeddings solely through their pairwise distances. We thus define analogies $a : b : : c : d$ by matching the distances $d ^ { 2 } \bar { ( } a , b ) = \dot { d } ^ { 2 } ( c , d )$ and $d ^ { 2 } ( a , c ) = d ^ { 2 } ( b , d )$ through constructing an analog of the parallelogram, by geodesically reflecting $a$ through the geodesic midpoint (i.e. mean) $m$ of $b , c$ . Note that this defines both the loss function and the intrinsic tasks purely in terms of distances and manifold operations. Hence, unlike traditional word embeddings, this formulation is generic to any space.
|
| 171 |
+
|
| 172 |
+
Our evaluation, shown in Table 5, uses the standard Google word analogy benchmark (Mikolov et al., 2013). We observe a $22 \%$ accuracy improvement over single-space hyperbolic embeddings in 50 dimensions and similar improvements over a single hyperbolic space in 100 dimensions. As with similarity, accuracy on the analogy task consistently improves as the number of factors increases.
|
| 173 |
+
|
| 174 |
+
# 5 CONCLUSION
|
| 175 |
+
|
| 176 |
+
Product spaces enable improved representations by better matching the geometry of the embedding space to the structure of the data. We introduced a tractable Riemannian product manifold class that combines Euclidean, spherical, and hyperbolic spaces. We showed how to learn embeddings and curvatures, estimate the product signature, and defined a tractable formulation of mean. We hope that our techniques encourage further research on non-Euclidean embedding spaces.
|
| 177 |
+
|
| 178 |
+
Table 4: Spearman rank correlation on similarity datasets. Top: Previous results from embeddings into spaces of fixed curvature. Bottom: Embeddings into products of $\mathbb { H }$ with fixed total dimension.
|
| 179 |
+
|
| 180 |
+
<table><tr><td></td><td colspan="3">Dim 50</td><td colspan="3">Dim 100</td></tr><tr><td></td><td>WS-353</td><td>Simlex</td><td>MEN</td><td>WS-353</td><td>Simlex</td><td>MEN</td></tr><tr><td>Euclidean</td><td>0.6628</td><td>0.2738</td><td>0.7217</td><td>0.6986</td><td>0.2923</td><td>0.7473</td></tr><tr><td>Hyperbolic</td><td>0.6787</td><td>0.2784</td><td>0.7117</td><td>0.6846</td><td>0.2832</td><td>0.7217</td></tr><tr><td>2 Hyperbolics</td><td>0.6955</td><td>0.2870</td><td>0.7246</td><td>0.7297</td><td>0.3168</td><td>0.7450</td></tr><tr><td>5 Hyperbolics</td><td>0.7048</td><td>0.2837</td><td>0.7270</td><td>0.7379</td><td>0.3212</td><td>0.7530</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Table 5: Accuracy on the Google word analogy dataset. Taking products of smaller hyperbolic spaces significantly improves performance. Unlike conventional embeddings, the operations in hyperbolic and product spaces are defined solely through distances and manifold operations.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Total Dim d / Model</td><td>Rd</td><td>(Hd)1</td><td>(Hd/2)2</td><td>(Hd/5)5</td><td>(H2)d/2</td></tr><tr><td>50</td><td>0.3866</td><td>0.3424</td><td>0.3928</td><td>0.4181</td><td>0.4209</td></tr><tr><td>100</td><td>0.5513</td><td>0.3738</td><td>0.4310</td><td>0.4731</td><td>0.5216</td></tr></table>
|
| 185 |
+
|
| 186 |
+
# ACKNOWLEDGMENTS
|
| 187 |
+
|
| 188 |
+
We gratefully acknowledge the support of DARPA under Nos. FA87501720095 (D3M) and FA86501827865 (SDH), NIH under No. N000141712266 (Mobilize), NSF under Nos. CCF1763315 (Beyond Sparsity) and CCF1563078 (Volume to Velocity), ONR under No. N000141712266 (Unifying Weak Supervision), the Moore Foundation, NXP, Xilinx, LETI-CEA, Intel, Google, NEC, Toshiba, TSMC, ARM, Hitachi, BASF, Accenture, Ericsson, Qualcomm, Analog Devices, the Okawa Foundation, and American Family Insurance, and members of the Stanford DAWN project: Intel, Microsoft, Teradata, Facebook, Google, Ant Financial, NEC, SAP, and VMWare. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of DARPA, NIH, ONR, or the U.S. Government.
|
| 189 |
+
|
| 190 |
+
# REFERENCES
|
| 191 |
+
|
| 192 |
+
R. L. Bishop and B. O’Neill. Manifolds of negative curvature. Trans. American Mathematical Society, 145:1–49, 1969.
|
| 193 |
+
S. Bonnabel. Stochastic gradient descent on Riemannian manifolds. IEEE Trans. Automatic Control, 58(9):2217–2229, 2013.
|
| 194 |
+
M. M. Bronstein, J. Bruna, Y. LeCun, A. Szlam, and P. Vandergheynst. Geometric deep learning: Going beyond Euclidean data. IEEE Signal Processing Magazine, 34:18–42, 2017.
|
| 195 |
+
E. Bruni, N.-K. Tran, and M. Baroni. Multimodal distributional semantics. J. Artificial Intelligence Research, 49:1–47, 2014.
|
| 196 |
+
J Burkardt. Cities–city distance datasets.
|
| 197 |
+
S. Buss and J. P. Fillmore. Spherical averages and applications to spherical splines and interpolation. ACM Trans. Graphics, 20(2):95–126, 2001.
|
| 198 |
+
B. P. Chamberlain, J. R. Clough, and M. P. Deisenroth. Neural embeddings of graphs in hyperbolic space. arXiv preprint, arXiv:1705.10359, 2017.
|
| 199 |
+
H. Cho, B. Demeo, J. Peng, and B. Berger. Large-margin classification in hyperbolic space. CoRR, abs/1806.00437, 2018.
|
| 200 |
+
|
| 201 |
+
W. De Nooy, A. Mrvar, and V. Batagelj. Exploratory social network analysis with Pajek. Cambridge University Press, 2011.
|
| 202 |
+
|
| 203 |
+
B. Dhingra, C. J. Shallue, M. Norouzi, A. M. Dai, and G. E. Dahl. Embedding text in hyperbolic spaces. In TextGraphs@NAACL-HLT, 2018.
|
| 204 |
+
|
| 205 |
+
M. P. do Carmo. Riemannian Geometry. Birkhauser, 1992. ¨
|
| 206 |
+
|
| 207 |
+
Y. Enokida, A. Suzuki, and K. Yamanishi. Stable geodesic update on hyperbolic space and its application to Poincare embeddings. ´ CoRR, abs/1805.10487, 2018.
|
| 208 |
+
|
| 209 |
+
Frederick Arthur Ficken. The Riemannian and affine differential geometry of product-spaces. Annals of Mathematics, pp. 892–913, 1939.
|
| 210 |
+
|
| 211 |
+
L. Finkelstein, E. Gabrilovich, Y. Matias, E. Rivlin, Z. Solan, G. Wolfman, and E. Ruppin. Placing search in context: the concept revisited. In WWW, 2001.
|
| 212 |
+
|
| 213 |
+
P. Fletcher, C. Lu, S. Pizer, and S. Joshi. Principal geodesic analysis for the study of nonlinear statistics of shape. IEEE Transactions on Medical Imaging, 23(8):995–1005, 2004.
|
| 214 |
+
|
| 215 |
+
O. Ganea, G. Becigneul, and T. Hofmann. Hyperbolic entailment cones for learning hierarchical ´ embeddings. In 35th International Conference on Machine Learning (ICML), pp. 1646–1655, Stockholm, Sweden, 2018a.
|
| 216 |
+
|
| 217 |
+
Octavian Ganea, Gary Becigneul, and Thomas Hofmann. Hyperbolic neural networks. In ´ Advances in Neural Information Processing Systems, pp. 5350–5360, 2018b.
|
| 218 |
+
|
| 219 |
+
C. Gulcehre, M. Denil, M. Malinowski, A. Razavi, R. Pascanu, K. M. Hermann, P. Battaglia, V. Bapst, D. Raposo, A. Santoro, and N. de Freitas. Hyperbolic attention networks. arXiv preprint, arXiv:1805.09786, 2018.
|
| 220 |
+
|
| 221 |
+
Felix Hill, Roi Reichart, and Anna Korhonen. Simlex-999: Evaluating semantic models with (genuine) similarity estimation. Computational Linguistics, 41:665–695, 2015.
|
| 222 |
+
|
| 223 |
+
S. Huckemann, T. Hotz, and A. Munk. Intrinsic shape analysis: Geodesic PCA for Riemannian manifolds modulo isometric Lie group actions. Statistica Sinica, 20(1):1–58, 2010.
|
| 224 |
+
|
| 225 |
+
J. Lamping and R. Rao. Laying out and visualizing large trees using a hyperbolic space. In Proc. of the 7th annual ACM Symposium on User Interface Software and Technology (UIST 94), pp. 13–14, Marina del Rey, California, 1994.
|
| 226 |
+
|
| 227 |
+
J. Lee. Riemannian Manifolds: An Introduction to Curvature. Springer, 1997.
|
| 228 |
+
|
| 229 |
+
J. Lee. Introduction to Smooth Manifolds. Springer, 2012.
|
| 230 |
+
|
| 231 |
+
M. Leimeister and B. J. Wilson. Skip-gram word embeddings in hyperbolic space. arXiv preprint, arXiv:1809.01498, 2018.
|
| 232 |
+
|
| 233 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Sphereface: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 212–220, 2017.
|
| 234 |
+
|
| 235 |
+
J. J. McAuley and J. Leskovec. Learning to discover social circles in ego networks. In Advances in Neural Information Processing Systems 25 (NIPS 2012), pp. 4599–4607, Lake Tahoe, NV, 2012.
|
| 236 |
+
|
| 237 |
+
Tomas Mikolov, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013.
|
| 238 |
+
|
| 239 |
+
M. Nickel and D. Kiela. Poincare embeddings for learning hierarchical representations. In ´ Advances in Neural Information Processing Systems 30 (NIPS 2017), Long Beach, CA, 2017.
|
| 240 |
+
|
| 241 |
+
M. Nickel and D. Kiela. Learning continuous hierarchies in the Lorentz model of hyperbolic geometry. In 35th International Conference on Machine Learning (ICML), pp. 3779–3788, Stockholm, Sweden, 2018.
|
| 242 |
+
|
| 243 |
+
Yann Ollivier. Ricci curvature of Markov chains on metric spaces. Journal of Functional Analysis, 256(3):810–864, 2009.
|
| 244 |
+
|
| 245 |
+
Yann Ollivier. A visual introduction to Riemannian curvatures and some discrete generalizations. Analysis and Geometry of Metric Measure Spaces: Lecture Notes of the 50th Seminaire de ´ Mathematiques Sup ´ erieures (SMS), Montr ´ eal ´ , 56:197–219, 2011.
|
| 246 |
+
|
| 247 |
+
X. Pennec. Hessian of the Riemannian squared distance: Supplement A of barycentric subspace analysis on manifolds.
|
| 248 |
+
|
| 249 |
+
X. Pennec. Barycentric subspace analysis on manifolds. The Annals of Statistics, 46(6A):2711– 2746, 2018.
|
| 250 |
+
|
| 251 |
+
F Sala, C. De Sa, A. Gu, and C. Re. Representation tradeoffs for hyperbolic embeddings. In ´ 35th International Conference on Machine Learning (ICML), pp. 4460–4469, Stockholm, Sweden, 2018.
|
| 252 |
+
|
| 253 |
+
Y. Tay, L. A. Tuan, and S. C. Hui. Hyperbolic representation learning for fast and efficient neural question answering. In Proc. of the Eleventh ACM International Conference on Web Search and Data Mining (WSDM 2018), pp. 583–591, Los Angeles, California, 2018.
|
| 254 |
+
|
| 255 |
+
William P Thurston. Shapes of polyhedra and triangulations of the sphere. Geometry and Topology monographs, 1:511–549, 1998.
|
| 256 |
+
|
| 257 |
+
Pavan K Turaga and Anuj Srivastava. Riemannian computing in computer vision. Springer, 2016.
|
| 258 |
+
|
| 259 |
+
C. Udriste. Convex Functions and Minimization Methods on Riemannian Manifolds. Springer, 1994.
|
| 260 |
+
|
| 261 |
+
J. A. Walter. H-MDS: a new approach for interactive visualization with multidimensional scaling in the hyperbolic space. Information Systems, 29(4):273–292, 2004.
|
| 262 |
+
|
| 263 |
+
D. J. Watts and S. H. Strogatz. Collective dynamics of small-world networks. Nature, 393:440–442, 1998.
|
| 264 |
+
|
| 265 |
+
Melanie Weber, Emil Saucan, and Jurgen Jost. Characterizing complex networks with forman-ricci ¨ curvature and associated geometric flows. Journal of Complex Networks, 5(4):527–550, 2017.
|
| 266 |
+
|
| 267 |
+
Benjamin Wilson and Matthias Leimeister. Gradient descent in hyperbolic space. arXiv preprint arXiv:1805.08207, 2018.
|
| 268 |
+
|
| 269 |
+
R.C. Wilson, E.R. Hancock, E. Pekalska, and R. Duin. Spherical and hyperbolic embeddings of data. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(11):2255–2269, 2014.
|
| 270 |
+
|
| 271 |
+
H. Zhang and S. Sra. First-order methods for geodesically convex optimization. In Proc. of the 29th Conference on Learning Theory (COLT), pp. 1617–1638, New York, NY, 2016.
|
| 272 |
+
|
| 273 |
+
H. Zhang and S. Sra. Towards Riemannian accelerated gradient methods. CoRR, abs/1806.02812, 2018.
|
| 274 |
+
|
| 275 |
+
H. Zhang, S. J. Reddi, and S. Sra. Riemannian SVRG: Fast stochastic optimization on Riemannian manifolds. In Advances in Neural Information Processing Systems 29 (NIPS 2016), pp. 4599– 4607, Barcelona, Spain, 2016.
|
| 276 |
+
|
| 277 |
+
The Appendix starts with a glossary of symbols and a discussion of related work. Afterwards, we provide the proof of Lemma 2. We continue with a more in-depth treatment of the curvature estimation algorithm. We then introduce two combinatorial constructions—embedding techniques that do not require optimization—that rely on the alternative product distances. We give additional details on our experimental setup. Finally, we additionally evaluate the interpretability of these embeddings (i.e., do the separate components in the embedding manifold capture intrinsic qualities of the data?) through visualizations of the synthetic example from Figure 1.
|
| 278 |
+
|
| 279 |
+
# A GLOSSARY OF SYMBOLS
|
| 280 |
+
|
| 281 |
+
We provide a glossary of commonly-used terms in our paper.
|
| 282 |
+
|
| 283 |
+
Table 6: Glossary of variables and symbols used in this paper.
|
| 284 |
+
|
| 285 |
+
<table><tr><td>Symbol</td><td>Used for</td></tr><tr><td>mAP(f) D(f)</td><td>the mean average precision fidelity measure of the embedding f the distortion fidelity measure of the embedding f</td></tr><tr><td>Dwc(f)</td><td>the worst-case distortion fidelity measure of the embedding f</td></tr><tr><td></td><td></td></tr><tr><td>G</td><td>a graph, typically with node set V and edge set E</td></tr><tr><td>T</td><td>a tree</td></tr><tr><td>a,b,c</td><td>nodes in a graph or tree</td></tr><tr><td>f</td><td>an embedding</td></tr><tr><td>Na</td><td>neighborhood around node α in a graph</td></tr><tr><td>Ra,b</td><td>the smallest set of closest points to node a in an embedding f that contains node b</td></tr><tr><td>M</td><td>a manifold; when equipped with a metric g,M is Riemannian</td></tr><tr><td>p</td><td>a point in a manifold,p ∈ M</td></tr><tr><td>TpM</td><td>the tangent space of point p in M (a vector space)</td></tr><tr><td>g</td><td>a Riemannian metric defining an inner product on TpM</td></tr><tr><td>Ed</td><td>d-dimensional Euclidean space</td></tr><tr><td>sd</td><td>d-dimensional spherical space</td></tr><tr><td>Hd</td><td>d-dimensional hyperbolic space</td></tr><tr><td>P</td><td>product manifold consisting of spherical, Euclidean,hyperbolic factors</td></tr><tr><td>Expx(u)</td><td>the exponential map for tangent vector U at point x</td></tr><tr><td>R</td><td>the Riemannian curvature tensor</td></tr><tr><td>K(x,y)</td><td>the sectional curvature for a subspace spanned by linearly independent x,y E TpM</td></tr><tr><td>dE</td><td>metric distance between two points in Euclidean space</td></tr><tr><td>ds</td><td>metric distance between two points in spherical space</td></tr><tr><td>dH</td><td>metric distance between two points in hyperbolic space</td></tr><tr><td>du</td><td>metric distance between two points in metric space U</td></tr><tr><td>dG</td><td>metric distance between two points in a graph G = (V, E)</td></tr><tr><td>μ(T)</td><td>mean of a set of points T = {P1,...,Pn} in P</td></tr><tr><td>In</td><td></td></tr></table>
|
| 286 |
+
|
| 287 |
+
# B RELATED WORK
|
| 288 |
+
|
| 289 |
+
Hyperbolic space has recently been proposed as an alternative to Euclidean space to learn embeddings in cases where there is a (possibly latent) hierarchical structure. In fact, many types of data (from various domains) such as social networks, word frequencies, metabolic-mass relationships, and phylogenetic trees of DNA sequences exhibit a non-Euclidean latent structure, as shown in Bronstein et al. (2017).
|
| 290 |
+
|
| 291 |
+
Initial works on hyperbolic embeddings include Nickel & Kiela (2017) and Chamberlain et al. (2017). In Chamberlain et al. (2017), neural graph embeddings are performed in hyperbolic space and used to classify the vertices of complex networks. A similar application is link prediction in Nickel & Kiela (2017) for the lexical database WordNet; this work also measured predicted lexical entailment on the HyperLex benchmark dataset. The follow-up work Nickel & Kiela (2018) performs optimizations in the hyperboloid (i.e. Lorentz) model instead of the Poincare model. ´
|
| 292 |
+
|
| 293 |
+
Tay et al. (2018) proposed a neural ranking based question answering (Q/A) system in hyperbolic space that outperformed many state-of-the-art models using fewer parameters compared to competitor learning models. Ganea et al. (2018a) proposed hyperbolic embeddings of entailment relations, described by directed acyclic graphs by applying hyperbolic cones as a heuristic and showed improvements over baselines in terms of representational capacity and generalization. Sala et al. (2018) developed a combinatorial construction for efficiently embedding trees and tree-like graphs without optimization, studied the fundamental tradeoffs of hyperbolic embeddings, and explored PCA-like algorithms in hyperbolic space.
|
| 294 |
+
|
| 295 |
+
Unlike Euclidean space, most Riemannian manifolds are not vector spaces, and thus even basic operations such as vector addition, vector translation and matrix multiplication do not have universal interpretations. In more complex geometries, closed form expressions for basic objects like distances, geodesics, and parallel transport do not exist. As a result, standard machine learning or deep learning tools, such as convolutional neural networks, long short term memory networks (LSTMs), logistic regression, support vector machines, and attention mechanisms, do not have exact correspondences in these complex geometries.
|
| 296 |
+
|
| 297 |
+
A pair of recent approaches seek to formulate standard machine learning methods in hyperbolic space. Gulcehre et al. (2018) introduces a hyperbolic version of the attention mechanism using the hyperboloid model. This work shows improvements in terms of generalization on several downstream applications including neural machine translation, learning on graphs and visual question answering tasks, while having compact neural representations. Ganea et al. (2018b) formulates basic machine learning tools in hyperbolic space including multinomial logistic regression, feed-forward and recurrent neural networks like gated recurrent units and LSTMs in order to embed sequential data and perform classification in hyperbolic space. They demonstrate empirical improvements on textual entailment and noisy-prefix recognition tasks using hyperbolic sentence embeddings. Cho et al. (2018) introduced a hyperbolic formulation for support vector machine classifiers and demonstrated performance improvements for multi-class prediction tasks on real-world complex networks as well as simulated datasets.
|
| 298 |
+
|
| 299 |
+
Zipf’s law states that word-frequency distributions obey a power law, which defines a hierarchy based on semantic specificities. Concretely, semantically general words that occur in a wider range of contexts are closer to the root of the hierarchy while rarer words are further down in the hierarchy. In order to capture the latent hierarchy in the natural language, there has been several proposals for training word embeddings in hyperbolic space. Dhingra et al. (2018) trains word embeddings using the algorithm from Nickel & Kiela (2017). They show that resulting hyperbolic word embeddings perform better on inferring lexical entailment relation than Euclidean embeddings trained with skip-gram model which is a standard method for training word embeddings, initially proposed by Mikolov et al. (2013). Leimeister & Wilson (2018) formulated the skip-gram loss function in hyperboloid model of hyperbolic space and evaluated on the standard the intrinsic evaluation tasks for word embeddings such as similarity and analogy in hyperbolic space.
|
| 300 |
+
|
| 301 |
+
Finally, the popularity of hyperbolic embeddings has stimulated interest in descent methods suitable for hyperbolic space optimization. In addition to tools like Bonnabel (2013) and Zhang et al. (2016), Zhang & Sra (2016) offers convergence rate analysis for a variety of algorithms and settings for Hadamard manifolds. Enokida et al. (2018) proposes an explicit update rule along geodesics in a hyperbolic space with a theoretical guarantee on convergence, and Zhang & Sra (2018) introduces an accelerated Riemannian gradient methods.
|
| 302 |
+
|
| 303 |
+
Our work also touches on previous work on maximum distance scaling (MDS) and PCA-like algorithms in hyperbolic, spherical, and more general manifolds. MDS-like algorithms in hyperbolic space are developed for visualization in Walter (2004) and Lamping & Rao (1994). Embeddings into spherical or into hyperbolic space with a PCA-like loss function were developed in Wilson et al. (2014). General forms of PCA include Geodesic PCA (Huckemann et al., 2010) and principal geodesics analysis (PGA) (Fletcher et al., 2004). A very general study of PCA-like algorithms is found in Pennec (2018).
|
| 304 |
+
|
| 305 |
+
# C MANIFOLD CONCEPTS AND PROOFS
|
| 306 |
+
|
| 307 |
+
Below, we include proofs of our results and further discuss manifold notions such as curvature.
|
| 308 |
+
|
| 309 |
+
# C.1 MEANS IN PRODUCT SPACES
|
| 310 |
+
|
| 311 |
+
We begin with Lemma 2, restated below for convenience.
|
| 312 |
+
|
| 313 |
+
emmand $\mathcal { P }$ be a product of moweights satisfying ces oand on . M $r$ , o $T = \{ p _ { 1 } , \ldots , p _ { n } \}$ points inonents of $\mathcal { P }$ $w _ { 1 } , \ldots , w _ { n }$ $w _ { i } \geq 0$ $\textstyle \sum _ { i = 1 } ^ { n } w _ { i } = 1$ the points in $\mathcal { P }$ , $p _ { i | \mathbb { S } ^ { j } }$ restricted to each spherical component space $\mathbb { S } ^ { j }$ fall in one hemisphere of $\mathbb { S } ^ { j }$ . Then, Riemannian gradient descent recovers the mean $\mu ( T )$ within distance $\epsilon$ in time $O ( n r \log \epsilon ^ { - 1 } )$ .
|
| 314 |
+
|
| 315 |
+
Proof. Consider the squared distance $d ^ { 2 } ( p , q )$ for $p , q \in M$ for a manifold $M$ . Fix $q$ . We denote the Hessian in $p$ by $H _ { p , M } ( q )$ . Then, we have the following expressions for the Hessian of the squared distance of a sphere, derived in Pennec
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
H _ { p , \mathbb { S } ^ { r } } ( q ) = 2 u u ^ { T } + 2 \frac { \theta \cos \theta } { \sin \theta } ( \mathbb { I } _ { r } - p p ^ { T } - u u ^ { t } ) ,
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
where $\mathbb { I } _ { r }$ is the identity matrix, $\theta = \operatorname { a c o s } ( p \cdot q )$ is the distance $d _ { \mathbb { S } ^ { r } } ( p , q )$ and $u = ( \mathbb { I } _ { r } - p p ^ { T } ) q / \sin { \theta }$ . In Pennec, it is shown that the eigenvectors of $H _ { p , \mathbb { S } ^ { r } } ( q )$ are $0 , 1$ , and $\theta \cot ( \theta )$ ; thus the Hessian is bounded and if $\theta \in [ 0 , \pi / 2 ]$ , it is also positive definite (PD).
|
| 322 |
+
|
| 323 |
+
For hyperbolic space (under the hyperboloid model), the Hessian is
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { r } { H _ { p , \mathbb H ^ { r } } ( q ) = 2 u u ^ { T } J + 2 \theta \coth \theta ( J + p p ^ { T } - u u ^ { T } ) J . } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Here $\theta \ = \ \mathrm { a c o s h } ( - \langle p , q \rangle _ { * } )$ , $J$ is the matrix associated with the Minkowski inner product, i.e., $\langle p , q \rangle _ { * } = p ^ { T } J q$ , and $u \doteq \log _ { p } ( q ) / \theta$ . The log here refers to the logarithmic map. That is, if $q = \exp _ { p } ( v )$ , then $v = \log _ { p } ( q )$ . Moreover, exact expressions for the eigenvalues of $H _ { p , \mathbb { H } ^ { r } } ( q )$ in terms of $\dot { \boldsymbol { \theta } }$ imply that it is always bounded and PD.
|
| 330 |
+
|
| 331 |
+
The Hessian for Euclidean space is $H _ { p , \mathbb { E } ^ { r } } ( q ) = 2 \mathbb { I } _ { r }$ , which is also PD.
|
| 332 |
+
|
| 333 |
+
Now we can express the Hessian of the weighted mean. We write $H _ { p , \mathcal { P } }$ for the Hessian of the weighted variance $\scriptstyle \sum _ { i = 1 } ^ { n } w _ { i } d _ { \mathcal { P } } ^ { 2 } ( p , p _ { i } )$ (recall that $\begin{array} { r } { \mu ( p _ { 1 } , \dots , p _ { n } ) \ = \ \arg \operatorname* { m i n } _ { p } \sum _ { i = 1 } ^ { n } w _ { i } d _ { \mathcal { P } } ^ { 2 } ( p , p _ { i } ) ) } \end{array}$ . We have, by the decomposability of the distance, that
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\sum _ { i = 1 } ^ { n } w _ { i } d _ { \mathcal { P } } ^ { 2 } ( p , p _ { i } ) = \sum _ { j = 1 } ^ { s } \sum _ { i = 1 } ^ { n } w _ { i } d _ { s _ { j } } ^ { 2 } ( p , p _ { i } ) + \sum _ { j = 1 } ^ { h } \sum _ { i = 1 } ^ { n } w _ { i } d _ { h _ { j } } ^ { 2 } ( p , p _ { i } ) + \sum _ { i = 1 } ^ { n } w _ { i } d _ { E } ^ { 2 } ( p , p _ { i } ) .
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
Taking the Hessian,
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
H _ { p , \mathcal { P } } = \sum _ { j = 1 } ^ { s } \sum _ { i = 1 } ^ { n } w _ { i } H _ { p , \mathbb { S } ^ { s _ { j } } } \left( p _ { i } \right) + \sum _ { j = 1 } ^ { h } \sum _ { i = 1 } ^ { n } w _ { i } H _ { p , \mathbb { H } ^ { h _ { j } } } \left( p _ { i } \right) + 2 n \mathbb { I } _ { e } .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Now, by assumption, the spherical components for our points in each of the spheres, $p _ { i | \mathbb { S } ^ { j } }$ , fall within one hemisphere, and we may initialize our gradient descent (that is, our $p _ { 0 }$ ) within this hemisphere. Then, the angle $\theta$ in each of the spherical distances is in $[ 0 , \pi / 2 ]$ , so that the corresponding Hessians are PD.
|
| 346 |
+
|
| 347 |
+
Since each term in the sum is PD and the weights satisfy $w _ { i } \geq 0$ , with at least one positive weight, $H _ { p , \mathcal { P } }$ is also PD. Moreover, these Hessians are bounded. Then we apply Theorem 4.2 (Chap. 7.4) in Udriste (1994)), which shows linear rate convergence, as desired. □
|
| 348 |
+
|
| 349 |
+
# C.2 CURVATURE ESTIMATION
|
| 350 |
+
|
| 351 |
+
We discuss the notions of curvature relevant to our product manifold in more depth. We start with a high-level overview of various definitions of curvature. Afterwards, we introduce the formal definitions for curvature and apply them to the product construction.
|
| 352 |
+
|
| 353 |
+
Definitions of Curvature There are multiple notions of curvature, with varying granularity. Some of these notions are suitable for working with manifolds abstractly (without reference to an ambient space, that is, intrinsic). Others, in particular older definitions pre-dating the development of the formal mechanisms underpinning differential geometry, require the use of the ambient space. Gauss defined the first intrinsic notion of curvature, Gaussian curvature. It is the product of the principal curvatures, which can be thought of as the smallest and largest curvature in different directions.4Below we consider several such notions.
|
| 354 |
+
|
| 355 |
+
Scalar curvature is a single value associated with a point $p \in M$ and intuitively relates to the area of geodesic balls. Negative curvature means volumes grow faster than in Euclidean space, positive means volumes grow slower.
|
| 356 |
+
|
| 357 |
+
A more fine-grained notion of curvature is that of sectional curvature: it varies over all “sheets” passing through $p$ . Note that curvature is inherently a notion of two-dimensional surfaces, and the sectional curvature fully captures the most general notion of curvature (the Riemannian curvature tensor). More formally, for every two dimensional subspace $U$ of the tangent space $T _ { p } M$ , the sectional curvature $K ( U )$ is equal to the Gaussian curvature of the sheet $\mathrm { E x p } _ { p } ( U )$ . Intuitively, it measures how far apart two geodesics emanating from $p$ diverge. In positively curved spaces like the sphere, they diverge more slowly than in flat Euclidean space.
|
| 358 |
+
|
| 359 |
+
The Ricci curvature of a tangent vector $v$ at $p$ is the average of the sectional curvature $K ( U )$ over all planes $U$ containing $v$ . Geometrically the Ricci curvature measures how much the volume of a small cone around direction $v$ compares to the corresponding Euclidean cone. Positive curvature implies smaller volumes, and negative implies larger. Note that this is natural from the way geodesics bend in various curvatures. The scalar curvature is in fact defined as an average over the Ricci curvature, giving the intuitive relation between scalar curvature and volume. It is thus also an average over the sectional curvature.
|
| 360 |
+
|
| 361 |
+
Discrete Analogs of Curvature Discrete data such as graphs do not have manifold structure. The goal of curvature analogs such as $\xi$ is to provide a discrete analog of curvature which satisfies similar properties to curvature; we use this to facilitate choosing an appropriate Riemannian manifold to embed discrete data into. In this work, we focus on the sectional curvature, but discrete versions of other curvatures have been proposed such as the the Forman-Ricci (Weber et al., 2017) and OllivierRicci (Ollivier, 2009) curvatures.
|
| 362 |
+
|
| 363 |
+
The input to the discrete curvature estimation from Section 3.2 is analogous to other discrete curvature analogs. For example, the Ricci curvature is defined for a point $p$ and a tangent vector $u$ , and the coarse Ricci curvature is defined for a node $p$ and neighbor $x$ (Ollivier, 2011). Similarly, the sectional curvature is defined for a point and two tangent vectors, and $\xi$ is defined for a a node and two neighbors.
|
| 364 |
+
|
| 365 |
+
Sectional Curvature in Product Spaces Now we are ready to tackle the question of curvature in our proposed product space. Let $M$ be our Riemannian manifold and $\mathcal { X } ( M )$ be the set of vector fields on $M$ . The curvature $R$ of $M$ assigns a function $R ( X , Y ) : { \mathcal { X } } ( M ) \to { \mathcal { X } } ( M )$ to each pair of vector fields $( X , Y ) \in { \mathcal { X } } \times { \mathcal { X } }$ . For a vector field $Z$ in $\mathcal { X } ( M )$ , the function $R ( X , Y )$ can be written
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
R ( X , Y ) Z = \nabla _ { Y } \nabla _ { X } Z - \nabla _ { X } \nabla _ { Y } Z + \nabla _ { [ X , Y ] } Z .
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Here $\nabla$ is the Riemannian connection for the manifold $M$ , and $[ X , Y ]$ is the Lie bracket of the vector fields $X , Y$ .
|
| 372 |
+
|
| 373 |
+
For convenience, we shall write the inner product $\langle R ( X , Y ) Z , T \rangle$ as $( X , Y , Z , T )$ ; this is the Riemannian curvature tensor. Then, the sectional curvature is defined as follows. Let us take $\nu$ to be a two-dimensional subspace of $T _ { p } M$ and $x , y \in \nu$ be linearly independent (so that they span $\nu$ ). Then, the sectional curvature at $p$ for subspace $\nu$ is
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
K ( x , y ) : = { \frac { ( x , y , x , y ) } { \| x \| ^ { 2 } \| y \| ^ { 2 } - \langle x , y \rangle ^ { 2 } } } .
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
The model spaces $\mathbb { S } , \mathbb { H } , \mathbb { E }$ are the spaces of constant curvature, where $K$ is constant for all points $p$ and 2-subspaces $\nu$ .
|
| 380 |
+
|
| 381 |
+
For simplicity, suppose we are working with $M = M _ { 1 } \times M _ { 2 }$ ; the approach extends easily for larger products. We write $\boldsymbol { x } = ( x _ { 1 } , x _ { 2 } )$ for $x \in T _ { p } M$ . Similarly, let $R _ { 1 } , R _ { 2 }$ be the curvatures and $K _ { 1 } , K _ { 2 }$ be the sectional curvatures of $M _ { 1 } , M _ { 2 }$ at $p$ , respectively. Then the curvature tensor decomposes as
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
R ( X , Y ) Z = ( R _ { 1 } ( X _ { 1 } , Y _ { 1 } ) Z _ { 1 } , R _ { 2 } ( X _ { 2 } , Y _ { 2 } ) Z _ { 2 } ) .
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Our goal is to evaluate the sectional curvature $K ( ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) )$ for the product manifold $M$ We show the following, re-stated for convenience:
|
| 388 |
+
|
| 389 |
+
Lemma 1. Let $M = M _ { 1 } \times M _ { 2 }$ where $M _ { i }$ has constant curvature $K _ { i }$ . For any $u , v \in T _ { p } M ,$ if $K _ { 1 } , K _ { 2 }$ are both non-negative, the sectional curvature satisfies $K ( u , v ) \in [ 0 , \operatorname* { m a x } \{ K _ { 1 } , \bar { K _ { 2 } } \} ]$ . If $K _ { 1 } , K _ { 2 }$ are both non-positive, the sectional curvature satisfies $K ( u , v ) \in [ \operatorname* { m i n } \{ K _ { 1 } , K _ { 2 } \} , 0 ]$ . If $K _ { i } < 0$ and $K _ { j } > 0$ for $i \neq j$ , then $K ( u , v ) \in [ K _ { i } , K _ { j } ]$ .
|
| 390 |
+
|
| 391 |
+
Proof. Let us start with the numerator of equation (4):
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { r l } & { ( x , y , x , y ) = ( ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) , ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) ) } \\ & { \qquad = \langle R ( ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) ) ( ( x _ { 1 } , x _ { 2 } ) ) , ( y _ { 1 } , y _ { 2 } ) \rangle } \\ & { \qquad = \langle ( R _ { 1 } ( x _ { 1 } , y _ { 1 } ) x _ { 1 } ) , ( R _ { 2 } ( x _ { 2 } , y _ { 2 } ) x _ { 2 } ) \rangle ( y _ { 1 } , y _ { 2 } ) \rangle } \\ & { \qquad = \langle R _ { 1 } ( x _ { 1 } , y _ { 1 } ) x _ { 1 } , y _ { 1 } \rangle + \langle R _ { 2 } ( x _ { 2 } , y _ { 2 } ) x _ { 2 } , y _ { 2 } \rangle } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Here, we used equation 5 in the third line.
|
| 398 |
+
|
| 399 |
+
Note that when $x _ { 1 } , y _ { 1 }$ are linearly independent, then $\langle R _ { 1 } ( x _ { 1 } , y _ { 1 } ) x _ { 1 } , y _ { 1 } \rangle \ = \ K _ { 1 } ( \| x _ { 1 } \| ^ { 2 } \| y _ { 1 } \| ^ { 2 } \ -$ $\langle x _ { 1 } , y _ { 1 } \rangle ^ { 2 } )$ by (4). Otherwise, this still holds since it is 0. So we can relate the above to $K _ { 1 } , K _ { 2 }$ :
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
( x , y , x , y ) = K _ { 1 } ( \| x _ { 1 } \| ^ { 2 } \| y _ { 1 } \| ^ { 2 } - \langle x _ { 1 } , y _ { 1 } \rangle ^ { 2 } ) + K _ { 2 } ( \| x _ { 2 } \| ^ { 2 } \| y _ { 2 } \| ^ { 2 } - \langle x _ { 2 } , y _ { 2 } \rangle ^ { 2 } ) .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
For convenience, we write $\alpha _ { i } = \| x _ { i } \| ^ { 2 } \| y _ { i } \| ^ { 2 } - \langle x _ { i } , y _ { i } \rangle ^ { 2 }$ for $i = 1 , 2$ . Then the numerator is simply $K _ { 1 } \alpha _ { 1 } + K _ { 2 } \alpha _ { 2 }$ . Next, we consider the denominator of (equation 4):
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\begin{array} { r l } & { \| x \| ^ { 2 } \| y \| ^ { 2 } - \langle x , y \rangle ^ { 2 } = \| ( x _ { 1 } , x _ { 2 } ) \| ^ { 2 } \| ( y _ { 1 } , y _ { 2 } ) \| ^ { 2 } - \langle ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) \rangle ^ { 2 } } \\ & { \qquad = ( \| x _ { 1 } \| ^ { 2 } + \| x _ { 2 } \| ^ { 2 } ) ( \| y _ { 1 } \| ^ { 2 } + \| y _ { 2 } \| ^ { 2 } ) - ( \langle x _ { 1 } , y _ { 1 } \rangle + \langle x _ { 2 } , y _ { 2 } \rangle ) } \\ & { \qquad = \alpha _ { 1 } + \alpha _ { 2 } + \| x _ { 1 } \| ^ { 2 } \| y _ { 2 } \| ^ { 2 } + \| x _ { 2 } \| ^ { 2 } \| y _ { 1 } \| ^ { 2 } } \\ & { \qquad = \alpha _ { 1 } + \alpha _ { 2 } + \beta , } \end{array}
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
where we set $\beta = \| x _ { 1 } \| ^ { 2 } \| y _ { 2 } \| ^ { 2 } + \| x _ { 2 } \| ^ { 2 } \| y _ { 1 } \| ^ { 2 }$ . Thus, we have that
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
K ( ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) ) = { \frac { \alpha _ { 1 } K _ { 1 } } { \alpha _ { 1 } + \alpha _ { 2 } + \beta } } + { \frac { \alpha _ { 2 } K _ { 2 } } { \alpha _ { 1 } + \alpha _ { 2 } + \beta } } .
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
Now, note that $\beta > 0$ , since we assumed that $x _ { 1 } , y _ { 1 }$ and $x _ { 2 } , y _ { 2 }$ are linearly independent. By CauchySchwarz, $\alpha _ { i } \geq 0$ . Then, if $K _ { i } \geq 0$ , we have that $( \alpha _ { i } K _ { i } ) / ( \bar { \alpha } _ { 1 } + \alpha _ { 2 } + \bar { \beta ( \cdot ) } \leq ( \bar { \alpha } _ { i } K _ { i } ) / ( \alpha _ { 1 } \dot { + } \alpha _ { 2 } )$ , so that
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
0 \leq K ( ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) ) \leq \frac { \alpha _ { 1 } } { \alpha _ { 1 } + \alpha _ { 2 } } K _ { 1 } + \frac { \alpha _ { 2 } } { \alpha _ { 1 } + \alpha _ { 2 } } K _ { 2 } .
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
Thus, we relate the product sectional curvature to a convex combination of the factor sectional curvatures $K _ { 1 } , K _ { 2 }$ . We have for non-negative $K _ { 1 } , K _ { 2 }$ (e.g., Euclidean and spherical spaces) that $K ( ( x _ { 1 } , x _ { 2 } ) , ( y _ { 1 } , y _ { 2 } ) ) \in [ 0 , \operatorname* { m a x } \{ K _ { 1 } , K _ { 2 } \} ]$ . A similar result holds for the non-positive (Euclidean and hyperbolic) case. The last case (one negative, one positive space) follows along the same lines.
|
| 424 |
+
|
| 425 |
+
Distribution of $K$ The range of curvatures from Lemma 1 can be easily extended to a more refined distributional analysis. In particular, consider sampling any point $p$ and a random plane $\gamma \subseteq T _ { p } M$ . By homogeneity, we can equivalently fix $p$ . The 2-subspaces of $T _ { p } M \simeq \mathbb { R } ^ { d }$ forms the Grassmannian manifold $\bar { \mathbf { G r } } ( 2 , T _ { p } M )$ . The uniform measure on this (i.e. invariant to multiplication by an orthogonal matrix) can be recovered from the Haar measure on the orthogonal group ${ \bf O } ( d )$ , which
|
| 426 |
+
|
| 427 |
+
# Algorithm 2 Sectional curvature distribution
|
| 428 |
+
|
| 429 |
+
<table><tr><td>1: Input: Dimensions d1, d2 2:a1←x²(d1-1) 3: :b←x²(d-1) 4: t1 ←Beta(d1 -1)/2,(d1-1)/2) 5: c↑a 6: a2←x²(d-1) 7: b←x²(d-1)</td><td>t2 ←Beta((d2-1)/2,(d2-1)/2)</td></tr></table>
|
| 430 |
+
|
| 431 |
+
itself can be constructed by orthonormalizing independent random normal vectors. In particular, it suffices to consider $\nu$ spanned by independent Gaussians $x , y \sim \mathcal { N } ( 0 , I )$ .
|
| 432 |
+
|
| 433 |
+
Furthermore, we do not actually need to sample $d$ -dimensional vectors $x , y$ to compute the relevant curvature in equation 6. It suffices to sample the quantitities $\left. x _ { 1 } , y _ { 1 } \right.$ , $\langle x _ { 1 } , x _ { 1 } \rangle , \langle y _ { 1 } , y _ { 1 } \rangle$ and $\langle x _ { 2 } , y _ { 2 } \rangle , \langle x _ { 2 } , x _ { 2 } \rangle , \langle { \bar { y } } _ { 2 } , y _ { 2 } \rangle$ directly. Note that $\alpha : = \langle x _ { 1 } , x _ { 1 } \rangle$ and $\beta : = \langle y _ { 1 } , y _ { 1 } \rangle$ are $\chi ^ { 2 }$ -distributed, while $\langle x _ { 1 } , y _ { 1 } \rangle \sim \sqrt { \alpha \beta } \gamma$ , where $\gamma$ is distributed as the dot product of two uniformly random unit vectors. By rotational invariance, this is the same as the first coordinate of a random unit vector, which in turn is distributed as $X _ { 1 } ^ { 2 } / ( X _ { 1 } ^ { 2 } + \cdots + X _ { d } ^ { 2 } )$ for independent normal $X _ { i }$ , and therefore $( \gamma + 1 ) / 2 \sim \mathrm { B e t a } ( ( d - 1 ) / 2 , ( d - 1 ) / 2 )$ .
|
| 434 |
+
|
| 435 |
+
Thus a random $K ( \nu )$ can be computed by sampling from well known distributions in constant time, via Algorithm 2.
|
| 436 |
+
|
| 437 |
+
Furthermore, without knowing $K _ { 1 } , K _ { 2 }$ a priori, an estimate for these curvatures can be found by matching the distribution of sectional curvature from Algorithm 2 to the empirical curvature computed from Algorithm 3. In particular, Algorithm 2 can be used to generate samples for $\frac { \alpha _ { 1 } } { \alpha _ { 1 } + \alpha _ { 2 } + \beta }$ and $\frac { \alpha _ { 2 } } { \alpha _ { 1 } + \alpha _ { 2 } + \beta }$ . The overall moments are then simple functions of $K _ { 1 } , K _ { 2 }$ , and the sample moments of the above quantities, so that $K _ { 1 } , K _ { 2 }$ can then be found by matching moments.
|
| 438 |
+
|
| 439 |
+
Curvature Estimation We prove the facts we mentioned in the main body of the paper relating to the evaluation of $\xi$ over fundamental pieces of graphs: lines, cycles, and trees.
|
| 440 |
+
|
| 441 |
+
Lemma 3. Suppose a lies on the same geodesic line as $b , m , c ;$ in other words, WLOG $d _ { G } ( a , b ) \leq$ $d _ { G } ( a , c )$ and suppose $d _ { G } ( a , c ) = d _ { G } ( a , \bar { b } ) + d _ { G } ( b , m ) + d _ { G } ( m , c )$ . Then $\xi ( m ; b , c ; a ) = 0$ .
|
| 442 |
+
|
| 443 |
+
Lemma 4. Consider a cycle graph $C$ with nodes $b , m , c$ such that $( m , b )$ and $( m , c )$ are neighbors.
|
| 444 |
+
Then for all $a \in C$ , $\xi ( m ; b , c ; a )$ is either 0 or positive.
|
| 445 |
+
|
| 446 |
+
Proof. Without loss of generality, let the cycle have an even number of vertices $n$ . Let $k$ be the node diametrically opposite from $m$ . Note that for any vertex $a \neq n , a , b , m , c$ lie on a geodesic line, and therefore $\xi ( m ; b , c ; a ) = 0$ . On the other hand,
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\xi ( m ; b , c ; a ) = { \frac { 1 } { 2 \cdot n / 2 } } \left( \left( { \frac { n } { 2 } } \right) ^ { 2 } + 1 - { \frac { 1 } { 2 } } \left( ( n / 2 - 1 ) ^ { 2 } + ( n / 2 - 1 ) ^ { 2 } \right) \right) = 1 .
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
The case when $n$ is odd is similar, where we find that two nodes $a$ satisfy $\xi ( m ; b , c ; a ) = n / ( n - 1 )$ and the rest are 0.
|
| 453 |
+
|
| 454 |
+
Lemma 5. Consider a tree graph $T$ with nodes $b , m , c$ such that $( m , b )$ and $( m , c )$ are neighbors.
|
| 455 |
+
Then for all $a \in T$ , $\xi ( m ; b , c ; a )$ is either 0 or negative.
|
| 456 |
+
|
| 457 |
+
# Algorithm 3 Empirical estimation of sectional curvature distribution
|
| 458 |
+
|
| 459 |
+
1: Input: Graph $G = ( V , E )$
|
| 460 |
+
2: $m \gets \mathrm { U n i f o r m } ( V )$
|
| 461 |
+
3: $b \gets \mathrm { U n i f o r m } ( \mathcal { N } ( m ) ) \left\{ \mathcal { N } ( v ) \right.$ is the neighbor set of $v \}$
|
| 462 |
+
4: $c \gets \mathrm { U n i f o r m } ( \mathcal { N } ( m ) )$
|
| 463 |
+
5: $a \gets \operatorname { U n i f o r m } ( V )$
|
| 464 |
+
6: $K \gets \xi ( m ; b , c ; a )$
|
| 465 |
+
7: return $K$
|
| 466 |
+
|
| 467 |
+
Proof. Due to the tree structure, $a$ is either geodesic with $b , m , c ,$ or $a$ is connected to $m$ with a path that does not pass through $b$ or $c$ . In the former case, $\xi ( m ; b , c ; a ) = 0$ . In the latter case,
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\xi ( m ; b , c ; a ) = \frac { 1 } { 2 d } \left( d ^ { 2 } + 1 - ( d + 1 ) ^ { 2 } \right) = - 1 ,
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
where $d = d _ { G } ( a , m )$ .
|
| 474 |
+
|
| 475 |
+
Given a graph, the distribution of $\xi ( m ; b , c )$ over random “planes” (i.e. pairs of neighbors $b , c )$ is easily calculable. This yields a distribution that can then be averaged over $m$ to obtain an average sectional curvature distribution. To simplify this, we find the distribution via sampling (Algorithm 3) in the calculations for Table 3, before being fed into Algorithm 2 to estimate $K _ { i }$ .
|
| 476 |
+
|
| 477 |
+
As a corollary of Lemma 5, note that the $\xi$ becomes more negative for trees of higher degree, matching the intuition that higher degree trees are more appropriate for hyperbolic space embeddings (Sala et al., 2018).
|
| 478 |
+
|
| 479 |
+
We additionally note that a line of work has studied discrete analogs of curvature for regular objects such as triangular planar tessellations (including polyhedra) (Thurston, 1998). For example, these notions assign positive curvature to regular polyhedra (the tetrahedron, octahedron, icosahedron), zero curvature to the flat planar tessellation, and positive curvature to the order-7 triangular tiling of the hyperbolic plane. It is easily checked that Algorithm 3 assigns the right curvature sign to each of these objects.
|
| 480 |
+
|
| 481 |
+
# C.3 COMBINATORIAL CONSTRUCTIONS
|
| 482 |
+
|
| 483 |
+
The $\ell _ { 1 }$ and min-based distances are suitable for combinatorial constructions where we do not learn embeddings by optimizing a surrogate loss function, but rather by directly placing points in the product space, often via recursive procedures. Such constructions offer superior speed and other benefits. On the other hand,they are only available for certain classes of graphs. Additionally, since the constructions rely on the $\ell _ { 1 }$ and min distances, they do not take advantage of the Riemannian structure, and thus do not have the same applicability downstream.
|
| 484 |
+
|
| 485 |
+
We often exploit the combinatorial construction for trees from Sala et al. (2018) as a building block; it offers worst-case distortion5 $1 + \varepsilon$ when embedding a tree into $\mathbb { H } ^ { r }$ for all $r \geq 2$ , where we can control $\varepsilon$ .
|
| 486 |
+
|
| 487 |
+
Hanging Tree Construction Consider the class of graphs $G = ( V , E )$ where $V = B \cup T _ { 1 } \cup$ $T _ { 2 } \dots \cup T _ { | B | }$ , so that $B$ is a base set of nodes and for each node $a \in B$ , there is a tree $T _ { a }$ connected to $a$ (the hanging trees). We show how to use $\mathcal { P }$ with the $\ell _ { 1 }$ distance to reduce the cost of embedding $G$ to that of embedding the subgraph induced by $B$ .
|
| 488 |
+
|
| 489 |
+
We embed $G$ into the product space $\mathcal { P } = \mathcal { P } ^ { \prime } \times \mathbb { H } ^ { r }$ equipped with the $\ell _ { 1 }$ distance. Here, $\mathcal { P } ^ { \prime }$ is some product manifold. We do the embedding in two steps:
|
| 490 |
+
|
| 491 |
+
1. Embed the subgraph induced by $B$ into $\mathcal { P } ^ { \prime }$ by any method; let the resulting worst-case distortion be $1 + \delta$ . Embed every node in $T _ { i }$ into the embedded image of node $i$ ,
|
| 492 |
+
|
| 493 |
+
2. Form the tree $T$ by connecting each of the $T _ { 1 } , \dots , T _ { | B | }$ to a single node (equivalent to crushing all the nodes in $B$ into a single node), and embed $T$ into $\mathbb { H } ^ { r }$ by using the combinatorial construction. Additionally, all of the nodes in $B$ are embedded into the image of the single central node in $\mathbb { H } ^ { r }$ .
|
| 494 |
+
|
| 495 |
+
We can check the distortion. For nodes $x _ { a } , y _ { b }$ in subtrees hanging off $a , b \in B$ , the distance is $d _ { G } ( x _ { a } , y _ { b } ) = d _ { T } ( x _ { a } , y _ { b } ) + d _ { B } ( x , y )$ . Since the distortion for the two embeddings are given by $1 + \delta$ and $1 + \varepsilon$ , it is easy to check that the overall distortion is at most $\operatorname* { m a x } \{ 1 + \delta , 1 + \varepsilon \}$ .
|
| 496 |
+
|
| 497 |
+
As a concrete example, consider the ring of trees in Figure 1. Then, $B = C _ { r }$ , the cycle on $r$ nodes. In this case, we can embed $B$ into $\mathcal { P } ^ { \prime } = \mathbb { S } ^ { 1 }$ . Let the nodes of $B$ be indexed $a _ { 1 } , \ldots , a _ { r }$ . We embed $a _ { i }$ into $\begin{array} { r } { A _ { i } = ( \cos ( \frac { 2 \pi i } { d } ) , \sin ( \frac { 2 \pi i } { d } ) ) } \end{array}$ . Then, for $i < j$ ,
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\begin{array} { r l } & { d _ { S } ( A _ { i } , A _ { j } ) = \operatorname { a c o s } ( A _ { i } \cdot A _ { j } ) } \\ & { \qquad = \operatorname { a c o s } \left( \cos \left( \frac { 2 \pi i } { d } \right) \cos \left( \frac { 2 \pi j } { d } \right) + \sin \left( \frac { 2 \pi i } { d } \right) \sin \left( \frac { 2 \pi j } { d } \right) \right) } \\ & { \qquad = \operatorname { a c o s } \left( \cos \left( \frac { 2 \pi ( i - j ) } { d } \right) \right) } \\ & { \qquad = \frac { 2 \pi ( | j - i | ) } { d } . } \end{array}
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
Thus indeed, the embedding has worst-case distortion 1. Thus, the overall distortion for the ring of trees is $1 + \varepsilon$ . Since we control $\varepsilon$ , we can achieve arbitrarily good distortion for the ring of trees. The complexity of this algorithm is linear in the number of nodes, since embedding the trees and ring is linear time.
|
| 504 |
+
|
| 505 |
+
General Graph Construction Now we use the min distance space to construct an embedding of any graph $G$ on $r$ nodes with arbitrarily low distortion via the space $\mathcal { P } = \mathbb { H } ^ { 2 } \times \mathbb { H } ^ { 2 } \times \dots \times \mathbb { H } ^ { 2 }$ with $r - 1$ copies. As we shall see, this construction is ideal (arbitrarily low distortion, any graph) other than requiring $O ( r )$ spaces.
|
| 506 |
+
|
| 507 |
+
Let the nodes of $G$ be $V = \{ a _ { 1 } , \ldots , a _ { r } \}$ . Now, for each $a _ { i }$ , $1 \leq i \leq r - 1$ , form the minimum distance tree $T _ { i }$ rooted at $a _ { i }$ . Then, embed $T _ { i }$ into the ith copy of $\mathbb { H } ^ { 2 }$ via the combinatorial construction. Then, for any nodes $a _ { i } , a _ { j } \in V$ , the distance $d _ { G } ( a _ { i } , a _ { j } )$ is attained by $d _ { T _ { i } } ( a _ { i } , a _ { j } )$ , or $d _ { T _ { j } } \left( a _ { j } , a _ { i } \right)$ in the case $i = r$ . Since at least one of $T _ { i }$ or $T _ { j }$ , say $T _ { i }$ , is embedded in $\mathbb { H } ^ { 2 }$ with distortion $1 + \varepsilon$ , if we make $\varepsilon$ small enough, the smallest distance among the embedded copies is indeed that for $T _ { i }$ , so our overall distortion is still $1 + \varepsilon$ .
|
| 508 |
+
|
| 509 |
+
# D VISUALIZATIONS AND INTERPRETABILITY
|
| 510 |
+
|
| 511 |
+
The combinatorial construction using the $\ell _ { 1 }$ distance (Section C.3) can embed the hanging tree graph arbitrarily well, unlike any single type of space. Unlike a single space, this also lends more interpretability to the embedding, as each component displays different qualitative aspects of the underlying graph structure. Figure 4 shows that this phenomenon does in fact happen empirically, even using the optimization approach over the $\ell _ { 2 }$ (Riemannian) instead of $\ell _ { 1 }$ distance.
|
| 512 |
+
|
| 513 |
+
# E EXPERIMENTAL DETAILS
|
| 514 |
+
|
| 515 |
+
We provide some additional details for our experimental setups.
|
| 516 |
+
|
| 517 |
+
Graph Reconstruction The optimization framework was implemented in PyTorch. The loss function (2) was optimized with SGD using minibatches of 65536 edges for the real-world datasets, and ran for 2000 epochs. For the Cities graph, the learning rate was chosen among $\{ 0 . 0 0 1 , 0 . 0 0 3 , 0 . 0 1 \}$ . For the rest of the datasets, the learning rate was chosen from a grid search among $\{ 1 0 , 3 0 , 1 0 0 , 3 0 0 , 1 0 0 0 \}$ for each method.6
|
| 518 |
+
|
| 519 |
+

|
| 520 |
+
Figure 4: Ring of trees graph embedding into $( \mathbb { H } ^ { 2 } ) ^ { 1 } \times ( \mathbb { S } ^ { 1 } ) ^ { 1 }$ ; left: early epoch, right: completion. Only accessing graph distances, the optimization separates the different intrinsic structures of the underlying graph—the cycle and the trees—into interpretable components. Compare to Figure 2.
|
| 521 |
+
|
| 522 |
+
Each point in the embedding is initialized randomly according to a uniform or Normal distribution in each coordinate with standard deviation $1 0 ^ { - 3 }$ . (In the hyperboloid and spherical models, all but the first coordinate is chosen randomly, and the first coordinate is a function of the rest.)
|
| 523 |
+
|
| 524 |
+
Table 2 uses only Algorithm 1, and initializes the curvatures to $- 1$ for hyperbolic components and 1 for spherical components. These curvatures are learned using the method described in Section 3.1, and the “Best model” row reports the final curvatures of the best signature.
|
| 525 |
+
|
| 526 |
+
Word Embeddings Following LW, the input corpus is a 2013 dump of Wikipedia that has been preprocessed by lower casing and removing punctuation, and filtered to remove articles few page views. All other hyperparameters are chosen exactly as in as LW, including their numbers for Euclidean embeddings from fastText. The datasets used for similarity (WS-353, Simlex-999, MEN) and analogy (Google) are also identical to the previous setup.
|
md/train/HyGhN2A5tm/HyGhN2A5tm.md
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTI-AGENT DUAL LEARNING
|
| 2 |
+
|
| 3 |
+
Yiren Wang†∗, Yingce $\mathbf { X _ { i } } \mathbf { a } ^ { \ddag }$ , Tianyu $\mathbf { H e } ^ { \ S }$ , Fei $\mathbf { T i a n } ^ { \dagger }$ , Tao $\mathbf { Q } \mathbf { i } \mathbf { n } ^ { \ddag }$ , ChengXiang Zhai†, Tie-Yan Liu‡
|
| 4 |
+
|
| 5 |
+
†University of Illinois at Urbana-Champaign
|
| 6 |
+
‡Microsoft Research
|
| 7 |
+
§University of Science and Technology of China
|
| 8 |
+
†{yiren, czhai}@illinois.edu
|
| 9 |
+
‡{Yingce.Xia, fetia, taoqin, tie-yan.liu}@microsoft.com
|
| 10 |
+
§hetianyu@mail.ustc.edu.cn
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Dual learning has attracted much attention in machine learning, computer vision and natural language processing communities. The core idea of dual learning is to leverage the duality between the primal task (mapping from domain $\mathcal { X }$ to domain $\mathcal { V }$ ) and dual task (mapping from domain $\mathcal { V }$ to $\mathcal { X }$ ) to boost the performances of both tasks. Existing dual learning framework forms a system with two agents (one primal model and one dual model) to utilize such duality. In this paper, we extend this framework by introducing multiple primal and dual models, and propose the multi-agent dual learning framework. Experiments on neural machine translation and image translation tasks demonstrate the effectiveness of the new framework. In particular, we set a new record on IWSLT 2014 German-to-English translation with a 35.44 BLEU score, achieve a 31.03 BLEU score on WMT 2014 English-toGerman translation with over 2.6 BLEU improvement over the strong Transformer baseline, and set a new record of 49.61 BLEU score on the recent WMT 2018 English-to-German translation.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Motivated by the dual nature of many tasks, e.g., English-to-German vs. German-to-English in machine translation, photo-to-Monet vs. Monet-to-photo in image translation, and speech recognition vs. speech synthesis, dual learning is proposed (He et al., 2016) and applied to many applications including neural machine translation (NMT) (He et al., 2016; Xia et al., 2017a;b), image-to-image translation (Zhu et al., 2017; Yi et al., 2017; Luo et al., 2017), question answering (Duan et al., 2017; Sun et al., 2019) and image captioning (Huang et al., 2018). The basic idea of dual learning is to leverage the duality between the two tasks as the feedback signal to regularize training. The regularization has been implemented with different ways in existing works, such as maximizing the likelihood of data reconstruction (He et al., 2016), constraining joint probabilistic consistency (Xia et al., 2017b), and encouraging the model-level information sharing (Xia et al., 2018). Among them, the principle of likelihood maximization of data reconstruction has been mostly adopted (Zhu et al., 2017; He et al., 2016), in which dual learning is formulated as a two-agent game: One agent targets at learning the mapping $f : \mathcal { X } \mapsto \mathcal { Y }$ , while the other learning the mapping of opposite direction $g : \mathcal { V } \mapsto \mathcal { X }$ . Here $\mathcal { X }$ and $\mathcal { V }$ are two domains. In dual learning, $x \in \mathcal { X }$ is first mapped to $\hat { y } \in \mathcal { V }$ through $f$ and then reconstructed to ${ \hat { x } } \in { \mathcal { X } }$ by $g ( \hat { y } )$ . The distortion between $x$ and $\hat { x }$ , denoted as $\Delta _ { x } ( x , { \hat { x } } )$ , is used as the feedback signal to regularize training. Similar reconstruction error can also be constructed in $\mathcal { V }$ and further used for training.
|
| 19 |
+
|
| 20 |
+
In such a two-agent game, $g$ and $f$ can be viewed as an evaluator for each other. $g$ is used to evaluate the quality of $\hat { y }$ generated by $f$ and return the feedback signal $\Delta _ { x } ( x , g ( \hat { y } ) )$ back to $f$ , and vice versa. The quality of such evaluation plays an important role to improve the training of the mapping functions. In the current dual learning framework, only one agent $g$ is used to evaluate and provide feedback signals to the mapping function $f$ in the other direction. In this work, we introduce multiple agents into the learning system to further exploit the potential of dual learning. The agents in the same direction have similar capability and certain level of diversity to map one domain to the other domain, i.e., $\mathcal { X } \mathcal { V }$ or $\mathcal { V } \mathcal { X }$ . Different agents can be obtained by training multiple $f$ ’s and $g$ ’s independently with different random seeds for initialization and data access order. Then for the output of each $f$ (or $g$ ), multiple $g$ ’s (or $f$ ’s) will provide feedback signals. Intuitively, more agents can lead to more reliable and robust feedback, just like the majority voting of multiple experts, and it is expected to achieve better final performance. We name this new dual learning framework with multiple agents as multi-agent dual learning1.
|
| 21 |
+
|
| 22 |
+
Although multiple agents are involved in multi-agent dual learning, we still focus on training two mappings $f _ { 0 } : \mathcal { X } \mathcal { Y }$ and $g _ { 0 } : \mathcal { V } \to \mathcal { X }$ , similar to the traditional two-agent dual learning. The additionally introduced agents play the role of facilitating the training of $f _ { 0 }$ and $g _ { 0 }$ . The parameters of the additional agents are fixed during training and have no part to play during testing/inference. Therefore, the inference of multi-agent dual learning is of the same complexity as it is of the standard two-agent dual learning. More precisely, apart from the two agents $f _ { 0 }$ and $g _ { 0 }$ , we further employ $2 ( N - 1 )$ additional agents, $N \geq 2$ , which are pre-trained before optimizing $f _ { 0 }$ and $g _ { 0 }$ and subsequently held constant. Among them, $N - 1$ agents are leveraged to model the mapping $f _ { i } : \mathcal { X } \mapsto \mathcal { Y }$ and the others $N - 1$ agents model $g _ { i } : \mathcal { V } \mapsto \mathcal { X }$ , $i \in \{ 1 , 2 , \cdots , N - 1 \}$ .2 All these $2 ( N - 1 )$ agents are used to facilitate the training of $f _ { 0 }$ and $g _ { 0 }$ in a similar manner as the standard dual learning with minor revisions: To help the training of $f _ { 0 }$ , for any $x \in \mathcal { X }$ , we first map $x$ to $\hat { y }$ by $f _ { 0 }$ , build the feedback signals by adaptively summing $\Delta _ { x } ( x , g _ { i } ( \hat { y } ) )$ for any $i \in \{ 0 , 1 , \cdots , N - 1 \}$ , and then regularize training with the feedback signals. The training of $g _ { 0 }$ is performed similarly.
|
| 23 |
+
|
| 24 |
+
We conduct experiments on two benchmark tasks of dual learning, NMT and image-to-image translation, to verify our proposed framework. For NMT, we work on the English German translation task with different scales of bilingual data. On IWSLT 2014 translation task with $1 5 3 K$ bilingual data and no monolingual data, we achieve 29.52 and 35.44 BLEU scores for English German and German English translations respectively, setting a new record on this task. On WMT 2014 translation task with $4 . 5 M$ bilingual sentence, we achieve 30.05/31.03 and 33.32/35.64 BLEU scores without/with monolingual data, which are the best results of the same settings. On the recent WMT 2018 English German translation task, we set a new record of 49.61 BLEU score, improving the previous best system by over 1.3 BLEU score. On WMT 2016 unsupervised NMT task, where no bilingual data is available and only $5 0 M$ monolingual data is provided, we achieve 19.26/23.85 BLEU scores, outperforming all the previous pure NMT based systems. We work on two groups of tasks for image-to-image translation, pain photo translations (paint including Van Gogh, Monet, Ukiyo-e and Cezanne), and cityscapes label photo translation. Experimental results show that we can generate better images than CycleGAN.
|
| 25 |
+
|
| 26 |
+
The remaining part of this paper is organized as follows. We introduce the basic framework in Section 2. The applications to NMT and image translation are presented in Section 3 and Section 4. We conclude this paper and discuss the future directions in the last section.
|
| 27 |
+
|
| 28 |
+
# 2 FRAMEWORK
|
| 29 |
+
|
| 30 |
+
In this section, we mathematically formulate the multi-agent dual learning framework, and compare it with previous learning settings.
|
| 31 |
+
|
| 32 |
+
Consider two domains of interests, $\mathcal { X }$ and $\mathcal { V }$ . Let $\mathcal { D } _ { x }$ and $\mathcal { D } _ { y }$ denote the collection of training data from $\mathcal { X }$ and $\mathcal { V }$ respectively, $\mathcal { D } _ { x } \subset \mathcal { X }$ , $\mathcal { D } _ { y } \subset \mathcal { D }$ . We aim to learn two agents $f _ { 0 } : \mathcal { X } \mapsto \mathcal { Y }$ , and $g _ { 0 } :$ $\mathcal { V } \mathcal { X }$ . Without loss of generality, we refer to learning $f _ { 0 }$ and $g _ { 0 }$ as the primal task and the dual task respectively. Let $\Delta _ { x } ( x , x ^ { \prime } )$ be a mapping $\mathcal { X } \times \mathcal { X } \mathbb { R }$ , representing the dissimilarity/distance/error between $x$ and $x ^ { \prime }$ where $x , x ^ { \prime } \in { \mathcal { X } }$ , and $\Delta _ { y } ( y , y ^ { \prime } )$ denote the dissimilarity between the two elements $y$ and $y ^ { \prime }$ in space $\mathcal { V }$ . The standard dual learning loss (He et al., 2016) is formulated as
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\frac { 1 } { | D _ { x } | } \sum _ { x \in \mathcal { D } _ { x } } \Delta _ { x } ( x , g _ { 0 } ( f _ { 0 } ( x ) ) ) + \frac { 1 } { | \mathcal { D } _ { y } | } \sum _ { y \in \mathcal { D } _ { y } } \Delta _ { y } ( y , f _ { 0 } ( g _ { 0 } ( y ) ) ) ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $| \mathcal { D } _ { x } |$ and $| \mathcal { D } _ { y } |$ denote the number of elements in $\mathcal { D } _ { x }$ and $\mathcal { D } _ { y }$ . In a multi-agent dual learning framework, as a prerequisite there are $N - 1$ pretrained primal models $f _ { i } : \mathcal { X } \mathcal { Y }$ and $N - 1$ dual models $g _ { i } : \mathcal { V } \to \mathcal { X }$ , $i = \{ 1 , 2 , \cdots , N - 1 \}$ .
|
| 39 |
+
|
| 40 |
+
Each $f _ { i }$ is pretrained by minimizing the cross entropy loss $\begin{array} { r } { - \sum _ { ( x , y ) } \log P ( y | x ; f _ { i } ) } \end{array}$ via stochastic gradient descent where $( x , y )$ is the paired data, or using unsupervised learning techniques to obtain like unsupervised NMT (Lample et al., 2018) or unsupervised image translation (Zhu et al., 2017). Different methods can be used to obtain diverse agents $f _ { i } , i \in \{ 1 , \bar { 2 } , \cdots , N - 1 \}$ , including using various random seeds to affect weight initialization and input order of the training samples, different model architectures, or training over different subsets. The same holds for $g _ { i } , i \in \{ 1 , 2 , \cdots , N - 1 \}$ . In the training process of $f _ { 0 }$ and $g _ { 0 }$ , all these pretrained $2 ( N - 1 )$ models remain fixed, and are linearly aggregated with $f _ { 0 } , g _ { 0 }$ into two mixed models $F _ { \alpha }$ and $G _ { \beta }$ . Specifically, given any $\alpha _ { i } \geq 0$ and $\beta _ { i } \geq 0$ for any $i \in \{ 0 , 1 , \cdots , N - 1 \}$ ,
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
F _ { \alpha } = \sum _ { i = 0 } ^ { N - 1 } \alpha _ { i } f _ { i } , G _ { \beta } = \sum _ { j = 0 } ^ { N - 1 } \beta _ { j } g _ { j } ; \mathrm { ~ s . t . ~ } \sum _ { i = 0 } ^ { N - 1 } \alpha _ { i } = 1 , \sum _ { j = 0 } ^ { N - 1 } \beta _ { j } = 1 .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
For multi-agent dual learning, the duality feedback signal is built upon $F _ { \alpha }$ and $G _ { \beta }$ . Following the basic framework of dual learning (He et al., 2016), for any $x \in \mathcal { X }$ , all agents first cooperate to generate a $\hat { y } \in \mathcal { V }$ by $\hat { y } = F _ { \alpha } ( x )$ , and then jointly reconstruct the ${ \hat { x } } \in { \mathcal { X } }$ through $\hat { x } = G _ { \beta } ( \hat { y } )$ . The reconstruction error between $y \in \mathcal { V }$ and $\hat { y } \overset { \cdot } { = } F _ { \alpha } \overset { \cdot } { ( G _ { \beta } ( y ) ) }$ is similarly constructed. The out-coming dual learning loss is defined as
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\ell _ { \mathrm { d u a l } } ( \mathcal { D } _ { x } , \mathcal { D } _ { y } ; F _ { \alpha } , G _ { \beta } ) = \frac { 1 } { | \mathcal { D } _ { x } | } \sum _ { x \in \mathcal { D } _ { x } } \Delta _ { x } ( x , G _ { \beta } ( F _ { \alpha } ( x ) ) ) + \frac { 1 } { | \mathcal { D } _ { y } | } \sum _ { y \in \mathcal { D } _ { y } } \Delta _ { y } ( y , F _ { \alpha } ( G _ { \beta } ( y ) ) ) .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
In this way, $N$ agent pairs (prima-dual model pairs) are involved to jointly train and improve $f _ { 0 }$ and $g _ { 0 }$ . When $N = 1$ , Our algorithm degenerates to standard dual learning. No labeled information is required for building $\ell _ { \mathrm { d u a l } }$ . We can apply it on either labeled data or unlabeled data.
|
| 53 |
+
|
| 54 |
+
Note that Eqn. (3) is the loss about duality. Other training objectives could also be included. For example, in NMT, if bilingual data is available, the cross entropy loss can be included to guide the training; in image-to-image translation, the GAN loss could also be included to enforce the generated images into the correct categories. In the next two sections, we will discuss how to adapt Eqn. (3) to different applications.
|
| 55 |
+
|
| 56 |
+
Discussion. While there are existing works using multiple agents to boost the model performance, none of them has leveraged the duality. We use the $\mathcal { X } \mathcal { V }$ mapping task to compare the previous work with our proposed framework, following the notations defined in Section 2.
|
| 57 |
+
|
| 58 |
+
(1) Ensemble learning (Zhou, 2012) is a straightforward way to combine multiple models during inference. To predict the label of $x \in \mathcal { X }$ , all agents vote together and the final label would be arg $\begin{array} { r } { \operatorname* { m i n } _ { y \in \mathcal { V } } \sum _ { i = 0 } ^ { \mathrm { \tilde { N } - 1 } } \alpha _ { i } \ell ( f _ { i } ( x ) , y ) } \end{array}$ , where $\ell$ is the loss function over space $\mathcal { X } \times \mathcal { V }$ . The $\alpha _ { i }$ ’s can be simply set as $1 / N$ or adaptively set according to the quality of each agent. There are several differences between ensemble learning and our work: 1) ensemble learning does not use multiple agents in training as we do; 2) our multi-agent dual learning uses only one model $f _ { 0 }$ in inference, which is more efficient than ensemble learning that uses multiple agents; and 3) duality is not considered in conventional ensemble learning.
|
| 59 |
+
|
| 60 |
+
(2) Knowledge distillation with multiple agents (Hinton et al., 2015; Kim & Rush, 2016). Knowledge distillation consists of two steps: first, all $f _ { i }$ ’s generate soft labels for $x \in \mathcal { X }$ , e.g., $\hat { y } =$ arg $\begin{array} { r } { \operatorname* { m i n } _ { y \in \mathcal { V } } \sum _ { i = 0 } ^ { N - 1 } \alpha _ { i } \ell ( f _ { i } ( x ) , y ) } \end{array}$ ; the generated pairs $( x , \hat { y } )$ ’s are together used to train a new model. Each $( x , \hat { y } )$ is regarded as labeled data without evaluating the quality of $\hat { y }$ or considering whether it is good enough for model training. In our proposed framework, we leverage the duality to build a feedback loop so as to evaluate the quality of generated pairs.
|
| 61 |
+
|
| 62 |
+
# 3 APPLICATION TO NEURAL MACHINE TRANSLATION
|
| 63 |
+
|
| 64 |
+
In this section, we introduce how to adapt the proposed multi-agent dual learning framework to Neural Machine Translation (NMT), and present evaluation on several public translation datasets.
|
| 65 |
+
|
| 66 |
+
# 3.1 ADAPTION
|
| 67 |
+
|
| 68 |
+
Note that for NMT, $\mathcal { X }$ and $\mathcal { V }$ stands for the collection of all possible sentences of two given languages, while $\mathcal { D } _ { x }$ and $\mathcal { D } _ { y }$ is the dataset. Denote the parameters of mapping $f _ { 0 }$ and $g _ { 0 }$ as $\theta _ { 0 } ^ { f }$ and $\theta _ { 0 } ^ { g }$ respectively. Following the common practice in NMT, the $\Delta _ { x }$ and $\Delta _ { y }$ is specified as the negative log-likelihood, that is, for any $x \in \mathcal { D } _ { x }$ or $x \in \mathcal { X }$ ,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { l } { { \displaystyle \Delta _ { x } ( x , G _ { \beta } ( F _ { \alpha } ( x ) ) ) = - \log \sum _ { \hat { y } \in \mathcal { Y } } P ( F _ { \alpha } ( x ) = \hat { y } | x ; F _ { \alpha } , G _ { \beta } ) P ( G _ { \beta } ( \hat { y } ) = x | x , F _ { \alpha } ( x ) = \hat { y } ; F _ { \alpha } , G _ { \beta } ) } } \\ { { \displaystyle { } } } \\ { { \displaystyle { } ^ { \mathrm { } = - \log \sum _ { \hat { y } \in \mathcal { Y } } P ( F _ { \alpha } ( x ) = \hat { y } | x ; F _ { \alpha } ) P ( G _ { \beta } ( \hat { y } ) = x | \hat { y } ; G _ { \beta } ) . } } } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
For ease of reference, we briefly denote Eqn. (4) as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\Delta _ { x } ( x , G _ { \beta } ( F _ { \alpha } ( x ) ) ) = - \log \sum _ { \hat { y } \in \mathcal { Y } } P ( \hat { y } | x ; F _ { \alpha } ) P ( x | \hat { y } ; G _ { \beta } ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Similarly, for any $y \in \mathcal { V }$ , we have
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\Delta _ { y } ( y , F _ { \alpha } ( G _ { \beta } ( y ) ) ) = - \log \sum _ { \hat { x } \in \mathcal { X } } P ( \hat { x } | y ; G _ { \beta } ) P ( y | \hat { x } ; F _ { \alpha } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Following Hassan et al. (2018), we minimize the upper bounds of $\Delta _ { x }$ and $\Delta _ { y }$ for ease of optimization, which are respectively denoted as $\bar { \Delta } _ { x }$ and $\bar { \Delta } _ { y }$ :
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r l } & { \bar { \Delta } _ { x } ( x , G _ { \beta } ( F _ { \alpha } ( x ) ) ) = - \displaystyle \sum _ { \hat { y } \in \mathcal { V } } P ( \hat { y } | x ; F _ { \alpha } ) \log P ( x | \hat { y } ; G _ { \beta } ) \geq \Delta _ { x } ( x , G _ { \beta } ( F _ { \alpha } ( x ) ) ) ; } \\ & { \bar { \Delta } _ { y } ( y , F _ { \alpha } ( G _ { \beta } ( y ) ) ) = - \displaystyle \sum _ { \hat { x } \in \mathcal { X } } P ( \hat { x } | y ; G _ { \beta } ) \log P ( y | \hat { x } ; F _ { \alpha } ) \geq \Delta _ { y } ( y , F _ { \alpha } ( G _ { \beta } ( y ) ) ) . } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where two $\geq$ ’s hold due to Jensen’s inequality. Then we turn to minimize
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\tilde { \ell } _ { \mathrm { d u a l } } ( \mathcal { D } _ { x } , \mathcal { D } _ { y } ; F _ { \alpha } , G _ { \beta } ) = \frac { 1 } { | \mathcal { D } _ { x } | } \sum _ { x \in \mathcal { D } _ { x } } \bar { \Delta } _ { x } ( x , G _ { \beta } ( F _ { \alpha } ( x ) ) ) + \frac { 1 } { | \mathcal { D } _ { y } | } \sum _ { y \in \mathcal { D } _ { y } } \bar { \Delta } _ { y } ( y , F _ { \alpha } ( G _ { \beta } ( y ) ) ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Directly calculating the gradients for $\bar { \Delta } _ { x }$ w.r.t $\theta _ { 0 } ^ { f }$ and $\theta _ { 0 } ^ { g }$ is difficult in that: i) $\mathcal { V }$ is exponentially large since it represents all possible sentences of a language, which makes the computation intractable . ii) All $f _ { i }$ ’s and $g _ { i }$ ’s $( i \geq 1 )$ ) need to be loaded into the memory, although they will not be updated, which makes the computation inefficient. Similar issues exist for computing the gradients of $\bar { \Delta } _ { y }$ w.r.t $\theta _ { 0 } ^ { f }$ and $\theta _ { 0 } ^ { g }$ .
|
| 99 |
+
|
| 100 |
+
We use importance sampling to address the above two difficulties. Define $\gamma = ( 0 , \frac { 1 } { N - 1 } , \cdot \cdot \cdot , \frac { 1 } { N - 1 } )$ , thus $F _ { \gamma }$ and $G _ { \gamma }$ represent the combined model from all the pre-trained agents without the target models $f _ { 0 }$ and $g _ { 0 }$ (see Eqn. (2)). Define
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\delta ( x , \hat { y } ) = \left( \frac { P ( \hat { y } | x ; F _ { \alpha } ) } { P ( \hat { y } | x ; F _ { \gamma } ) } \right) \log P ( x | \hat { y } ; G _ { \beta } ) , \ \phi ( y , \hat { x } ) = \left( \frac { P ( \hat { x } | y ; G _ { \beta } ) } { P ( \hat { x } | y ; G _ { \gamma } ) } \right) \log P ( y | \hat { x } ; F _ { \alpha } ) .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Then the gradients for $\bar { \Delta } _ { x }$ w.r.t $\theta _ { 0 } ^ { f }$ is: $\begin{array} { r } { \frac { \partial \bar { \Delta } _ { x } } { \partial \theta _ { 0 } ^ { f } } = - \sum _ { \hat { y } \in \mathcal { V } } P ( \hat { y } | x ; F _ { \gamma } ) \frac { \partial \delta ( x , \hat { y } ) } { \partial \theta _ { 0 } ^ { f } } } \end{array}$ , and can be estimated by:
|
| 107 |
+
|
| 108 |
+
(i) Given an $x \in \mathcal { D } _ { x }$ and $y \in \mathcal { D } _ { y }$ , sample a $\hat { y }$ according to the distribution $P ( \cdot | x ; F _ { \gamma } )$ ; sample an $\hat { x }$ according to the distribution $P ( \cdot | y ; G _ { \gamma } )$ ;
|
| 109 |
+
|
| 110 |
+
(ii) Estimate the gradients of $\bar { \Delta } _ { x }$ w.r.t $\theta _ { 0 } ^ { f }$ as follows (and similarly for $\theta _ { 0 } ^ { g }$ without loss of generality):
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\frac { \partial \bar { \Delta } _ { x } } { \partial \theta _ { 0 } ^ { f } } = \mathbb { E } _ { \hat { y } \sim P ( \cdot \vert x ; F _ { \gamma } ) } \left[ - \frac { \partial \delta ( x , \hat { y } ) } { \partial \theta _ { 0 } ^ { f } } \right] \approx - \frac { \partial \delta ( x , \hat { y } ) } { \partial \theta _ { 0 } ^ { f } } .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Our method is summarized in Algorithm 1. We do the offline sampling by sampling $\hat { x }$ ’s and $\hat { y }$ ’s in advance (step 3); and computing the probabilities related to $f _ { i }$ ’s and $g _ { i }$ ’s $i \geq 1$ in advance (step 4). When bilingual data is available, denoted as $\boldsymbol { B } = \{ ( x _ { k } , y _ { k } ) \} _ { k = 1 } ^ { \tilde { M } }$ where $M$ is the number of training data, we can also apply the negative log-likelihood loss on bilingual data.
|
| 117 |
+
|
| 118 |
+
<table><tr><td></td><td>Algorithm 1: Algorithm for multi-agent dual learning.</td></tr><tr><td></td><td> Input: Data Dx and Dy; learning rate n; fi and gi i∈ {0,1,.. ,N - 1}; mini-batch size K;</td></tr><tr><td></td><td>bilingual data B if possible;</td></tr><tr><td></td><td>Defineγ= (0,N-1,,N1) andα=β=(,,…,,);</td></tr><tr><td></td><td> Sample the datasets Dx and Dy; obtain Dy= {y~ Fγ(x)|x ∈ Dx},Dx = {x ~ Gγ(y)ly ∈ Dy};</td></tr><tr><td></td><td>Compute the probabilities P(g|x;Fγ) and P(xly; Gγ);</td></tr><tr><td></td><td>while not converged do Randomly sample two batches of Bxg C Dx × Dy and Bxy C Dx × Dy,each of size K;</td></tr><tr><td>6 7</td><td>Following Eqn.(9) and Eqn. (1O),calculate Gradf and Gradgo as follows:</td></tr><tr><td></td><td>Σ(x,g)∈Bxg 88(x,0) ∑(a,y)eBy (y,) Gradf。←- 1 and Bg 80 By 80</td></tr><tr><td></td><td>Gradgo←-Bx∑(x,j)∈Bg a8(x,9) d(y,). Bay∑(a,y)eBay 1 00 00</td></tr><tr><td>8</td><td>If bilingual data is available, sample a batch Bxy C B of size K,calculate</td></tr><tr><td></td><td>Gradf←Gradfo-kVt∑(x,y)eBlogP(ylx;fo)and</td></tr><tr><td></td><td></td></tr><tr><td></td><td>Gradgo←Gradgo - kVθg∑(𝑥,y)∈By log P(xly; g0);</td></tr><tr><td>9</td><td></td></tr><tr><td></td><td>Update the parameters: θf←θf-ηGradfo,0←θg-ηGradg;</td></tr><tr><td></td><td></td></tr><tr><td>10 end</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 119 |
+
|
| 120 |
+
# 3.2 EXPERIMENT SETTINGS
|
| 121 |
+
|
| 122 |
+
Dataset We use multiple benchmark NMT datasets to evaluate the effectiveness of the proposed framework, including IWSLT 2014 English German translation, WMT 2014 English German translation and WMT 2016 unsupervised English German translation. English and German is denoted as “En” and “De” respectively for ease of reference. For IWSLT $2 0 1 4 ~ \mathrm { E n } \mathrm { D e }$ translation, following Edunov et al. (2018b), we lowercase all the sentences, and split them into training/validation/test set with $1 5 3 k / 7 k / 7 k$ sentences respectively. For WMT $2 0 1 4 { \mathrm { E n } } { \mathrm { D } } { \mathrm { \Omega } }$ e translation, we choose WMT 2014 training set and filter out $4 . 5 M$ sentences pairs following Gehring et al. (2017) and Vaswani et al. (2017). We concatenate newstest 2012 and newstest 2013 as the validation set and use newstest 2014 as the test set. We also select $8 M$ English and $8 M$ German monolingual sentences from newscrawl 2013 as monolingual dataset. For unsupervised $\mathrm { E n } { } \mathrm { D e }$ , following Lample et al. (2018), we choose 50M monolingual English and German sentences and use newstest 2016 as the test set for a fair comparison with the previous work. We preprocess the words into word-pieces in the same way as Wu et al. (2016).
|
| 123 |
+
|
| 124 |
+
Model Architecture We use Transformer (Vaswani et al., 2017) as the basic model structure. For IWSLT $\mathrm { E n } { } \mathrm { D e }$ , we use the transformer small configuration with 4 and 8 blocks to verify the generality of our model with different structures (a 4-block setting refer to transformer with 4 encoder blocks and 4 decoder blocks), where the word embedding dimension, hidden state dimension and non-linear layer dimension is set to be 256, 256 and 1024 respectively. For the WMT task, following Vaswani et al. (2017), we use the transformer big setting with 6 blocks, where the word embedding dimension, hidden state dimension and non-linear layer dimension is 1024, 1024 and 4096 respectively. For the unsupervised NMT task, we choose transformer base setting following Lample et al. (2018), where the above three dimensions are 512, 512 and 2048. The dropout rates for the three settings are 0.2, 0.1 and 0.1 respectively.
|
| 125 |
+
|
| 126 |
+
Optimization and Evaluation We choose Adam (Kingma & Ba, 2015) to optimize the network. The $\eta$ in Algorithm 1 is set as $2 \times 1 0 ^ { - 4 }$ . The learning rate decay rule and the two $\beta$ ’s of Adam are the same as Vaswani et al. (2017). For the three tasks, we use one, eight and four M40 GPUs to train those networks for three, five and six days respectively. Beam search is applied to generate translations for all the models, where the beam sizes for the three tasks are 6, 4 and 4 respectively.
|
| 127 |
+
|
| 128 |
+
The evaluation metric is BLEU score (Papineni et al., 2002), which is the geometric mean of $n$ -gram precisions, $n \in \{ 1 , 2 , 3 , 4 \}$ .
|
| 129 |
+
|
| 130 |
+
Baselines We implement three types of important baselines3, including back translation (Sennrich et al., 2015; Edunov et al., 2018a), knowledge distillation (Kim & Rush, 2016) and the two-agent dual learning (He et al., 2016). Take the $f : \mathcal X \mapsto \mathcal y$ translation as an example: 1) To use back translation, a reversed translation model $g : \mathcal { V } \mapsto \mathcal { X }$ is first trained on the original bilingual dataset, then the dataset $\{ ( g ( y ) , y ) | y \in \mathcal { D } _ { y } \}$ is constructed, which is then concatenated with the original dataset and train another model $f$ . 2) To use knowledge distillation, we pre-train a teacher model $f _ { T } : \mathcal { X } \to \mathcal { Y }$ , and use it to generate the corresponding dataset $\{ ( x , \bar f _ { T } ( x ) ) | x \in \mathcal { D } _ { x } \}$ , which is then mixed with the ground truth data and used to train a new model4. For these two baselines, we generate sentences using both a single model and multiple models. 3) Two-agent dual learning, which uses $f$ together with $g$ to build the feedback signal to regularize the training (see Eqn. (1)), which we denote as “Dual- $1 ^ { \circ }$ . Our multi-agent models are denoted as “Dual- $\because \ d s ( i > 1 )$
|
| 131 |
+
|
| 132 |
+
# 3.3 RESULTS OF NMT ON IWSLT DATASET
|
| 133 |
+
|
| 134 |
+
We regard the English and German sentences in the IWSLT14 bilingual corpus as $\mathcal { D } _ { x }$ and $\mathcal { D } _ { y }$ in Algorithm 1. We use 4-block networks (i.e. $F _ { \gamma }$ in Algorithm 1) to generate translations, which are then used to train both 4-block (4B) and 8-block (8B) networks. We compare dual learning (Dual$\ddot { \imath }$ ) with the standard baseline (Standard), knowledge distillation (KD-i) and back translation (BT- $\ddot { \cdot } \dot { \imath }$ ) with different number of primal-dual model pairs $i \in \{ 1 , 5 \}$ . Specifially, Dual-1 is the two-agent dual learning baseline, and Dual-5 is our multi-agent model with 4 additional pairs of agents.
|
| 135 |
+
|
| 136 |
+
The results of IWSLT $\mathrm { E n } { } \mathrm { D e }$ are presented in Table 1. We can observe that: 1) Dual learning has brought significant improvement over all the baselines (Standard, KD and BT) in both single-agent and multi-agent settings, demonstrating the effectiveness of dual learning; 2) Involving multiple agents into the learning system leads to better performances, which shows the importance of additional feedback signals from other agents. In particular, Dual-5 outperforms Dual-1 by around 0.5 BLEU in 4B setting and around 0.8 BLEU in 8B setting, which proves that dual learning can benefit from cooperating with more agents and demonstrates the effectiveness of our proposed algorithm. Particularly, dual learning with $N = 5$ agent pairs under 8B setting sets a new record of 35.44 BLEU in $\mathrm { D e } { } \mathrm { E n }$ and 29.52 BLEU in $\mathrm { E n } { } \mathrm { D e }$ translations.
|
| 137 |
+
|
| 138 |
+
Table 1: BLEU scores on IWSLT $_ { \mathrm { D e } \mathrm { E n } }$ translation. “KD”, “BT” and “Dual” stands for knowledge distillation, back translation and dual learning respectively.
|
| 139 |
+
|
| 140 |
+
<table><tr><td></td><td>Standard</td><td>KD-1</td><td>KD-5</td><td>BT-1</td><td>BT-5</td><td>Dual-1</td><td>Dual-5</td></tr><tr><td>De-→En (4B)</td><td>33.42</td><td>33.89</td><td>34.20</td><td>33.71</td><td>33.61</td><td>34.25</td><td>34.70</td></tr><tr><td>En-→De (4B)</td><td>27.89</td><td>28.45</td><td>28.65</td><td>28.35</td><td>28.22</td><td>28.63</td><td>28.99</td></tr><tr><td>De-→En (8B)</td><td>34.01</td><td>34.36</td><td>34.85</td><td>33.87</td><td>33.77</td><td>34.57</td><td>35.44</td></tr><tr><td>En-→De (8B)</td><td>27.95</td><td>28.74</td><td>29.18</td><td>28.28</td><td>28.25</td><td>29.07</td><td>29.52</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Study on different number of agents. We study the performances of our proposed algorithm with respect to different numbers of agent pairs, i.e., $N$ and explore the optimal value of $N$ . We enumerate within $N = \{ 1 , \cdots , 5 \}$ and did not try larger $N$ values due to the limitation of computational resources. As we can see from Figure 1, more agents can bring better performance for all settings. While it appears that the performance becomes better with more pair of agents involved into the learning system, the gain becomes more and more marginal (e.g., the maximum difference for $N = 4$ and $N = 5$ across all settings is around 0.1 BLEU). Furthermore, larger $N$ leads to higher computational costs such as GPU resources. Thus, it is the most practical to leverage $N = 3$ agent pairs, where we can benefit from the substantial gain over baselines without too much computational costs. We employ $N = 3$ for the rest of our experiments.
|
| 143 |
+
|
| 144 |
+
Study on diversity of agents. We further study the influence of diversity among the agents. We show that diversity is important but not the focus of our algorithm. Detailed results and discussion is presented in Appendix A due to the space limitation.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 1: BLEU scores on IWSLT $\scriptstyle \mathrm { { D e } } $ En w.r.t the number of agents pairs.
|
| 148 |
+
|
| 149 |
+
Study on translation tasks for other language pairs. We carry out another three groups of IWSLT14 experiments, English Spanish (Es), English Russian $\mathbf { \left( R u \right) }$ and English Hebrew $\mathrm { ( H e ) }$ translations to verify the generality of our framework on different languages. As is illustrated in Table 2, we achieve consistent improvements across different translation tasks (for all languages and all translation directions), further demonstrating the effectiveness and robustness of our algorithm.
|
| 150 |
+
|
| 151 |
+
Table 2: BLEU scores on the translations between $\{ \mathrm { E s , R u , H e } \}$ and En.
|
| 152 |
+
|
| 153 |
+
<table><tr><td></td><td>Es-→En</td><td>En→Es</td><td>Ru→En</td><td>En→Ru</td><td>He-→En</td><td>En→He</td></tr><tr><td>Standard</td><td>40.50</td><td>37.95</td><td>18.94</td><td>16.06</td><td>33.25</td><td>22.20</td></tr><tr><td>Dual-1</td><td>42.14</td><td>38.09</td><td>21.14</td><td>16.31</td><td>35.42</td><td>22.75</td></tr><tr><td>Dual-3</td><td>42.41</td><td>38.62</td><td>21.56</td><td>16.71</td><td>36.08</td><td>23.80</td></tr></table>
|
| 154 |
+
|
| 155 |
+
# 3.4 RESULTS OF NMT ON WMT DATASET
|
| 156 |
+
|
| 157 |
+
We work with two settings on WMT $\mathrm { E n } ]$ De task, where (1) only bilingual data is available; and (2) additional monolingual data is provided. The results are summarized in Table 3.
|
| 158 |
+
|
| 159 |
+
Table 3: BLEU scores on WMT14 En ${ } \mathrm { D e }$ translation. “Bitext” and “Mono” respectively represents using bilingual data only and using the mix of bilingual&monolingual data.
|
| 160 |
+
|
| 161 |
+
<table><tr><td></td><td>Standard</td><td>KD-1</td><td>KD-3</td><td>BT-1</td><td>BT-3</td><td>Dual-1</td><td>Dual-3</td></tr><tr><td>En→De (Bitext)</td><td>28.4</td><td>29.17</td><td>29.28</td><td>28.26</td><td>27.79</td><td>29.44</td><td>30.05</td></tr><tr><td>De-→En (Bitext)</td><td>32.15</td><td>32.43</td><td>31.38</td><td>32.41</td><td>32.68</td><td>32.99</td><td>33.32</td></tr><tr><td>En-→De (Mono)</td><td>28.4</td><td>29.20</td><td>29.36</td><td>29.42</td><td>29.68</td><td>29.93</td><td>31.03</td></tr><tr><td>De-→En (Mono)</td><td>32.15</td><td>32.28</td><td>32.43</td><td>34.58</td><td>34.77</td><td>34.98</td><td>35.64</td></tr></table>
|
| 162 |
+
|
| 163 |
+
From this table, we can see that the proposed algorithm achieves the best performances for all settings, and we observe that: 1) With WMT 2014 bilingual data only, the proposed multi-agent dual learning (Dual-3) achieves the state-of-the-art results to our knowledge, with 30.05 BLEU for $\mathrm { E n } { } \mathrm { D e }$ and 33.32 BLEU for $\mathrm { D e } \to \mathrm { E n } ^ { 5 }$ . 2) Compared with the traditional two-agent dual learning in He et al. (2016), we can achieve 0.61 BLEU score improvement on $\mathrm { E n } { } \mathrm { D e }$ and 0.33 on $_ \mathrm { D e \to E n }$ with bilingual data only. For the setting of using monolingual data, the improvements are 1.10 and 0.66 respectively. 3) Although KD and BT can bring improvements under different settings, the results are not as consistent as dual learning. For example, the performance of BT is not as good as KD under bilingual setting, but is better than KD under monolingual setting. We conjecture the reason is that with feedback signals to a generated sentence in the dual learning framework, the dataset is not only enlarged through sampling, but also guaranteed with good quality of generation.
|
| 164 |
+
|
| 165 |
+
Study on generality of the algorithm. We apply our method to the state-of-the-art systems on WMT 2016, 2017 and 2018 English-to-German translation challenge to verify the generality of our method. We work with the degenerated case where $f _ { 0 }$ is warm started with a state-of-the-art model provided by $\mathrm { F A I R } ^ { 6 }$ and $g _ { 0 }$ is fixed. We adopt the commercial system Google Translator (crawled on Oct 16, 2018), the champion system of WMT18 En De: MS-Marian (Junczys-Dowmunt, 2018), and FAIR’s single and ensemble models (Edunov et al., 2018a) as our baselines. The models are evaluated by sacreBLEU7. More details are left in Appendix B.
|
| 166 |
+
|
| 167 |
+
As can be seen from Table 4, our method is capable of further improving the strong model by a large margin. Both single and ensemble models with our algorithm outperform the previous best systems and set state-of-the-art results on these tasks, demonstrating the effectiveness of our method.
|
| 168 |
+
|
| 169 |
+
Table 4: BLEU scores on WMT {16, 17, 18} En De. The single models are independently trained for six times, with mean and standard derivation values reported; the ensemble models are the ensemble results of all different runs.
|
| 170 |
+
|
| 171 |
+
<table><tr><td></td><td>2016</td><td>2017</td><td>2018</td></tr><tr><td>Google Translator</td><td>38.03</td><td>31.41</td><td>47.67</td></tr><tr><td>FAIR (Single)</td><td>37.04 ± 0.16</td><td>31.86 ± 0.21</td><td>44.63 ± 0.12</td></tr><tr><td>Ours (Single)</td><td>40.68 ± 0.11</td><td>33.47 ± 0.16</td><td>48.89 ± 0.13</td></tr><tr><td>MS-Marian (Ensemble)</td><td>39.6</td><td>31.9</td><td>48.3</td></tr><tr><td>FAIR (Ensemble)</td><td>37.99</td><td>32.80</td><td>46.05</td></tr><tr><td>Ours (Ensemble)</td><td>41.23</td><td>34.01</td><td>49.61</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 3.5 RESULTS OF NMT WITH MONOLINGUAL DATA ONLY
|
| 174 |
+
|
| 175 |
+
Unsupervised NMT is studied recently to learn two translation models without bilingual data (details in Appendix C). We pre-train two unsupervised NMT models with different initialization, use them to translate the $5 0 M$ monolingual sentences, and apply KD, BT and dual learning algorithms.
|
| 176 |
+
|
| 177 |
+
Table 5: BLEU scores on WMT 2016 unsupvised NMT En De translation.
|
| 178 |
+
|
| 179 |
+
<table><tr><td></td><td> Standard</td><td>KD-1</td><td>KD-3</td><td>BT-1</td><td>BT-3</td><td>Dual-1</td><td>Dual-3</td></tr><tr><td>En-→De</td><td>17.52</td><td>17.33</td><td>18.27</td><td>17.50</td><td>18.15</td><td>18.01</td><td>19.26</td></tr><tr><td>De→En</td><td>22.12</td><td>22.10</td><td>22.71</td><td>22.51</td><td>22.91</td><td>22.17</td><td>23.85</td></tr></table>
|
| 180 |
+
|
| 181 |
+
As is shown in Table 5, with one pair of agents, KD-1 and BT-1 obtains almost the same results as the standard baseline, while Dual-1 achieves slightly better results on $\mathrm { E n } { } \mathrm { D e }$ translation. When we increase the number of agents, there are substantial improvements for KD-3, BT-3 and Dual-3. Especially, multi-agent dual learning (Dual-3) achieves 19.26 and 23.85 BLEU scores, setting new records for unsupervised NMT with pure NMT models.
|
| 182 |
+
|
| 183 |
+
# 4 APPLICATION TO IMAGE TRANSLATION
|
| 184 |
+
|
| 185 |
+
In this section, We apply the multi-agent dual learning framework to image translation tasks. Different from Ciregan et al. which also uses multiple agents (several columns of deep neural networks), we leverage the duality of translation tasks and only use one model during inference. We follow the setting of CycleGAN (Zhu et al., 2017), the most popular implementation of image translation that combines the ideas of GAN and dual learning.
|
| 186 |
+
|
| 187 |
+
# 4.1 ADAPTION
|
| 188 |
+
|
| 189 |
+
Following the common practice in image translation (Zhu et al., 2017), for each term in Eqn. (3), the $\Delta _ { x }$ and $\Delta _ { y }$ are specified as the $L 1$ norm of pixel-level difference between two images. We set $\alpha = \beta = ( \textstyle { \frac { 1 } { N } } , \top , \top , \top , \top )$ . Since there is few literature focusing on generating consensus images using multiple models, we switch Eqn. (3) to a simpler form:
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\ell _ { \mathrm { d u a l } } ( \mathcal { D } _ { x } , \mathcal { D } _ { y } ; F _ { \alpha } , G _ { \beta } ) = \frac { 1 } { | \mathcal { D } _ { x } | } \sum _ { x \in \mathcal { D } _ { x } } \| x - G _ { \beta } ( f _ { 0 } ( x ) ) \| _ { 1 } + \frac { 1 } { | \mathcal { D } _ { y } | } \sum _ { y \in \mathcal { D } _ { y } } \| y - F _ { \alpha } ( g _ { 0 } ( y ) ) \| _ { 1 } ,
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
where $\mathcal { D } _ { x }$ and $\mathcal { D } _ { y }$ are the datasets of domain $\mathcal { X }$ and domain $\mathcal { V }$ . The remaining parts of our model, including the model components, the objective functions, are exactly the same as the standard CycleGAN. There are two discriminators $d _ { \mathcal { X } } : \mathcal { X } \mapsto [ 0 , 1 ]$ and $d y : \mathcal { V } \mapsto [ 0 , 1 ]$ used to differentiate the generated images from natural images. The outputs of $d _ { \mathcal { X } }$ and $d _ { \mathcal { Y } }$ represent the probability that the input image is a natural one. The GAN loss (Goodfellow et al., 2014) is defined as
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\ L _ { \mathrm { G A N } } = \frac { 1 } { | \mathcal { D } _ { x } | } \sum _ { x \in \mathcal { X } } [ \log d _ { \mathcal { X } } ( x ) + \log \left( 1 - d _ { \mathcal { Y } } ( f _ { 0 } ( x ) ) \right) ] + \frac { 1 } { | \mathcal { D } _ { \mathcal { Y } } | } \sum _ { y \in \mathcal { Y } } [ \log d _ { \mathcal { Y } } ( y ) + \log \left( 1 - d _ { \mathcal { X } } ( g _ { 0 } ( y ) ) \right) ] .
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
During the optimization process, the two discriminators will try to maximize $\ell _ { \mathrm { G A N } }$ , while the $f _ { 0 }$ and $g _ { 0 }$ will minimize $\ell _ { \mathrm { d u a l } } ( \bar { D _ { x } } , \mathcal { D } _ { y } ; F _ { \alpha } , G _ { \beta } ) + \lambda \ell _ { \mathrm { G A N } }$ in cooperation with other provided agents, where $\lambda$ is a hyper-parameter to be tuned. In the experiments, we follow Zhu et al. (2017) to set $\lambda$ as 10.
|
| 202 |
+
|
| 203 |
+
# 4.2 SETTINGS
|
| 204 |
+
|
| 205 |
+
We use the same datasets, model configuration and optimization algorithm as Zhu et al. (2017). We implement our method based on CycleGAN8. We choose two tasks, the photo painting translations where the art styles include Monet, Van Gogh, Ukiyo-e, Cezanne, and cityscapes label photo translation. All the images are cropped to $2 5 6 \times 2 5 6$ . The configuration details can be found at Appendix D.1, which follows the same settings as Zhu et al. (2017).
|
| 206 |
+
|
| 207 |
+
# 4.3 RESULTS OF PAINTING-TO-PHOTO TRANSLATION
|
| 208 |
+
|
| 209 |
+
The task of painting photo translation is to translate an input painting with specific art style to the original photo captured by a camera. We present case studies on painting photo translations in Figure 2. Indeed, there are several cases that our algorithm is clearly better than CycleGAN: For the images in the top-left corner, CycleGAN fails to recover the tree while our algorithm succeeds, with many details correctly included like the branches and leaves. In the bottom right corner, the texture of the ground is kept by our results, which is missing from the images generated by CycleGAN.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 2: Four groups of experiments on painting photo translations.
|
| 213 |
+
|
| 214 |
+
We further present quantitative evaluation with Frechet Inception Distance (briefly, FID), which is ´ introduced in Heusel et al. (2017) and verified to be a reasonable metric by Lucic et al. (2018), to evaluate the quality of painting photo translations. FID captures the distance between generated images and the real ones, and a smaller FID score indicates the better model quality. As is shown in Table 6, our method yields consistent improvements across all datasets. More results in photo painting are left in Appendix D.2 due to space limitation.
|
| 215 |
+
|
| 216 |
+
Table 6: FID scores on painting photos translation.
|
| 217 |
+
|
| 218 |
+
<table><tr><td></td><td>Cezanne</td><td>Monet</td><td>Ukiyo-e</td><td>Vangogh</td></tr><tr><td>CycleGAN</td><td>189.40</td><td>134.25</td><td>197.30</td><td>91.19</td></tr><tr><td>Ours</td><td>173.92</td><td>129.86</td><td>184.69</td><td>89.32</td></tr></table>
|
| 219 |
+
|
| 220 |
+
# 4.4 RESULTS OF CITYSCAPES LABEL-TO-PHOTO TRANSLATION
|
| 221 |
+
|
| 222 |
+
We present case studies and quantitative evaluation of label photo translation on cityscapes images in Figure 3 and Table 7. As can be seen from Figure 3, both CycleGAN and our method can transfer the input label to a matching natural scene, while results of ours are clearer with less noise. For example, in the top left corner, our method can generate flatten roads, clearer cars and buildings and the baseline model fails. In Table 7, we present quantitative evaluation with “FCN-scores” following Isola et al. (2017). Our method achieves better results on the three evaluation metrics. More details about FCN-score and results on photo label translation are left in Appendix D.3.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 3: Cityscapes labels photos translation.
|
| 226 |
+
|
| 227 |
+
Table 7: FCN-scores on cityscapes labels photos translation.
|
| 228 |
+
|
| 229 |
+
<table><tr><td></td><td>Per-pixel Acc.</td><td>Per-class Acc.</td><td>Class IOU</td></tr><tr><td>CycleGAN</td><td>0.52</td><td>0.17</td><td>0.11</td></tr><tr><td>Ours</td><td>0.57</td><td>0.19</td><td>0.14</td></tr></table>
|
| 230 |
+
|
| 231 |
+
# 5 CONCLUSION
|
| 232 |
+
|
| 233 |
+
In this paper, we proposed a new framework, multi-agent dual learning, in which multiple primal models and dual models are involved in the learning process. We empirically verified the effectiveness of the proposed framework on multiple machine translation tasks and image translation tasks.
|
| 234 |
+
|
| 235 |
+
Extending the multi-agent dual learning framework to more applications would be an interesting direction for future research. For example, we can apply our framework to improve the recent non-autoregressive machine translation, which is known to have high inference efficiency yet poor translation quality (Gu et al., 2018; Wang et al., 2019; Guo et al., 2019). It is also worth studying how to apply the framework to other dual learning paradigms, including dual supervised learning (Xia et al., 2017b) and dual transfer learning (Wang et al., 2018). Furthermore, it is challenging yet important to improve the training efficiency while maintaining the substantial improvements.
|
| 236 |
+
|
| 237 |
+
# ACKNOWLEDGEMENT
|
| 238 |
+
|
| 239 |
+
This work is partially supported by the National Science Foundation under Grant No. 1801652.
|
| 240 |
+
|
| 241 |
+
# REFERENCES
|
| 242 |
+
|
| 243 |
+
Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 2017.
|
| 244 |
+
|
| 245 |
+
Dan Ciregan, Ueli Meier, and Jurgen Schmidhuber. Multi-column deep neural networks for image classification. In 2012 IEEE Conference on Computer Vision and Pattern Recognition.
|
| 246 |
+
|
| 247 |
+
Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2016.
|
| 248 |
+
|
| 249 |
+
Nan Duan, Duyu Tang, Peng Chen, and Ming Zhou. Question generation for question answering. In EMNLP, 2017.
|
| 250 |
+
|
| 251 |
+
Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. Understanding back-translation at scale. In EMNLP, 2018a.
|
| 252 |
+
|
| 253 |
+
Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Classical structured prediction losses for sequence to sequence learning. In NAACL, 2018b.
|
| 254 |
+
|
| 255 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In International Conference on Machine Learning, 2017.
|
| 256 |
+
|
| 257 |
+
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, 2014.
|
| 258 |
+
|
| 259 |
+
Jiatao Gu, James Bradbury, Caiming Xiong, Victor OK Li, and Richard Socher. Non-autoregressive neural machine translation. ICLR, 2018.
|
| 260 |
+
|
| 261 |
+
Junliang Guo, Tan Xu, Di He, Tao Qin, Linli Xu, and Tie-Yan Liu. Non-autoregressive neural machine translation with enhanced decoder input. In Thirty-Third AAAI Conference on Artificial Intelligence, 2019.
|
| 262 |
+
|
| 263 |
+
Hany Hassan, Anthony Aue, Chang Chen, Vishal Chowdhary, Jonathan Clark, Christian Federmann, Xuedong Huang, Marcin Junczys-Dowmunt, William Lewis, Mu Li, et al. Achieving human parity on automatic chinese to english news translation. arXiv preprint arXiv:1803.05567, 2018.
|
| 264 |
+
|
| 265 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Advances in neural information processing systems, 2016.
|
| 266 |
+
|
| 267 |
+
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 BIPS, 2017.
|
| 268 |
+
|
| 269 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015.
|
| 270 |
+
|
| 271 |
+
Qiuyuan Huang, Pengchuan Zhang, Dapeng Wu, and Lei Zhang. Turbo learning for captionbot and drawingbot. In Advances in neural information processing systems, 2018.
|
| 272 |
+
|
| 273 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on. IEEE, 2017.
|
| 274 |
+
|
| 275 |
+
Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, et al. Google’s multilingual neural ´ machine translation system: enabling zero-shot translation. TACL, 2017.
|
| 276 |
+
|
| 277 |
+
Marcin Junczys-Dowmunt. Microsoft’s submission to the wmt2018 news translation task: How i learned to stop worrying and love the data. Proceedings of the Third Conference on Machine Translation (WMT), 2018.
|
| 278 |
+
|
| 279 |
+
Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In EMNLP, 2016.
|
| 280 |
+
|
| 281 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 282 |
+
|
| 283 |
+
Guillaume Lample, Myle Ott, Alexis Conneau, Ludovic Denoyer, and Marc’Aurelio Ranzato. Phrase-based & neural unsupervised machine translation. In EMNLP, 2018.
|
| 284 |
+
|
| 285 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2015.
|
| 286 |
+
|
| 287 |
+
Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are gans created equal? a large-scale study. In Advances in neural information processing systems, 2018.
|
| 288 |
+
|
| 289 |
+
Ping Luo, Guangrun Wang, Liang Lin, and Xiaogang Wang. Deep dual learning for semantic image segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 290 |
+
|
| 291 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, 2002.
|
| 292 |
+
|
| 293 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation models with monolingual data. arXiv preprint arXiv:1511.06709, 2015.
|
| 294 |
+
|
| 295 |
+
Yibo Sun, Duyu Tang, Nan Duan, Shujie Liu, Zhao Yan, Ming Zhou, Yuanhua Lv, Wenpeng Yin, Xiaocheng Feng, Bing Qin, et al. Joint learning of question answering and question generation. IEEE Transactions on Knowledge and Data Engineering, 2019.
|
| 296 |
+
|
| 297 |
+
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, 2017.
|
| 298 |
+
|
| 299 |
+
Yijun Wang, Yingce Xia, Li Zhao, Jiang Bian, Tao Qin, Guiquan Liu, and T Liu. Dual transfer learning for neural machine translation with marginal distribution regularization. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 300 |
+
|
| 301 |
+
Yiren Wang, Fei Tian, Di He, Tao Qin, Zhai ChengXiang, and Tie-Yan Liu. Non-autoregressive machine translation with auxiliary regularization. In Thirty-Third AAAI Conference on Artificial Intelligence, 2019.
|
| 302 |
+
|
| 303 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, ukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. CoRR, 2016. URL http://arxiv.org/abs/1609.08144.
|
| 304 |
+
|
| 305 |
+
Yingce Xia, Jiang Bian, Tao Qin, Nenghai Yu, and Tie-Yan Liu. Dual inference for machine learning. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, 2017a.
|
| 306 |
+
|
| 307 |
+
Yingce Xia, Tao Qin, Wei Chen, Jiang Bian, Nenghai Yu, and Tie-Yan Liu. Dual supervised learning. In International Conference on Machine Learning, 2017b.
|
| 308 |
+
|
| 309 |
+
Yingce Xia, Xu Tan, Fei Tian, Tao Qin, Nenghai Yu, and Tie-Yan Liu. Model-level dual learning. In International Conference on Machine Learning, 2018.
|
| 310 |
+
|
| 311 |
+
Zili Yi, Hao (Richard) Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for -image translation. In ICCV, 2017.
|
| 312 |
+
|
| 313 |
+
Zhi-Hua Zhou. Ensemble methods: foundations and algorithms. Chapman and Hall/CRC, 2012.
|
| 314 |
+
|
| 315 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017.
|
| 316 |
+
|
| 317 |
+
# A STUDY ON DIVERSITY OF AGENTS
|
| 318 |
+
|
| 319 |
+
We further study how the diversity among agents influences the performances of our algorithm on the IWSLT $_ { \mathrm { D e } \mathrm { E n } }$ dataset. We compare three group of agents: (1) Agents with independent runs (“Independent Run”): We use the same agents as Section 3.3, which have the same model architecture and hyperparameters, and are trained through independent runs with different random seeds. (2) Agents with different architectures (“Different Arch”): The agents have different hidden dimensions (256, 512) with different numbers of heads (2, 4). They are also trained through independent runs with different random seeds. Intuitively, this group of agents with different architectures could be more diverse than the first group. (3) Agents from a same run (“Homogeneous”): In comparison to the first two groups where different methods (i.e., different random seeds, different model architecture) are used to encourage diversity among agents, in this group, we use model checkpoints at different (but very close) iterations from a same run. At the late stage of training, the learning rate becomes smaller. Thus the diversity among agents would naturally be very poor.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 4: BLEU scores on IWSLT $\mathrm { D e } ]$ En with different pools of agents.
|
| 323 |
+
|
| 324 |
+
We train 8-block (8B) networks as Section 3.3 with $N = \{ 1 , . . . , 5 \}$ pairs of agents from the above three groups respectively. The same training and inference procedures as Section 3.3 are applied here. As is shown from results in Figure 4, we have the following observations and conclusions:
|
| 325 |
+
|
| 326 |
+
1. Diversity among agents plays an important role in our method. The Homogeneous agents with poor diversity has the worst performances among the three groups. That is, introducing more homogeneous agents brings very marginal gain.
|
| 327 |
+
|
| 328 |
+
2. A more diverse group of agents can potentially bring further improvements, yet diversity is not the key focus of our algorithm. Independent Run achieves comparable performances with Different Arch, suggesting that our framework can achieve substantial improvements with a reasonable level of diversity among agents.
|
| 329 |
+
|
| 330 |
+
# B DETAILS ON WMT18 EN DE CHALLENGES
|
| 331 |
+
|
| 332 |
+
For the study on generality of the algorithm on WMT18 En De challenges, the training data, $F _ { \gamma } ( \cdot )$ and $G _ { \gamma } ( \cdot )$ are the same as those used in Section 3.4. We work with a degenerated case where $g _ { 0 }$ (i.e., the De En model) is pre-trained before optimizing $f _ { 0 }$ and subsequently hold constant. The $f _ { 0 }$ is warm started by the models from https://dl.fbaipublicfiles.com/fairseq/ models/wmt18.en-de.ensemble.tar.bz2, which are well trained with tremendous resources. We degenerate our algorithm to optimize the single direction due to the limitation that only $\mathrm { E n } { }$ De model checkpoints are released.
|
| 333 |
+
|
| 334 |
+
We train the model on 8 M40 GPUs for 2 days with PyTorch implementation of our algorithm based on FairSeq Toolkit9 . The batch size is 4096 tokens. We use Adam optimizer and the learning rate is automatically calculated by the system based on the reloaded checkpoint. The dropout ratio is 0.3. We use beam search with beam size 5 to generate candidates.
|
| 335 |
+
|
| 336 |
+
# C INTRODUCTION TO UNSUPERVISED NMT
|
| 337 |
+
|
| 338 |
+
We briefly introduce the recent state-of-the-art unsupervised NMT algorithm in (Lample et al., 2018). Similar to the standard NMT model with bilingual training data, an unsupervised NMT model is also based on the encoder-decoder architecture. The source sentences and target sentences are mapped into a same vocabulary using BPE techniques. The shared embedding is pretrained with fastText Bojanowski et al. (2017) to get good initial values. The proposed model can handle both source-to-target translation and target-to-source translation like Johnson et al. (2017).
|
| 339 |
+
|
| 340 |
+
The training loss usually consists of two parts, a language model loss and a back-translation loss.
|
| 341 |
+
Let $P _ { \mathcal { X } \mathcal { Y } }$ denote the translation from space $\mathcal { X }$ to space $\mathcal { V }$ , and so for the other similar notations.
|
| 342 |
+
|
| 343 |
+
(1) Language model loss, implemented by a denoising autoencoder. Mathematically,
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
L _ { 1 } = \mathbb { E } _ { x \sim \mathcal { X } } [ - \log P _ { \mathcal { X } \mathcal { X } } ( x | C ( x ) ) ] + \mathbb { E } _ { y \sim \mathcal { Y } } [ - \log P _ { \mathcal { Y } \mathcal { Y } } ( y | C ( y ) ) ] ,
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
where $C ( \cdot )$ is a noise model with randomly dropping several words, swapping words, etc.
|
| 350 |
+
|
| 351 |
+
(2) Back translation loss, implemented by back-translating the monolingual data and feeding into the reversed models. Mathematically,
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
L _ { 2 } = \mathbb { E } _ { x \sim \mathcal { X } } [ - \log P _ { \mathcal { V } \mathcal { X } } ( x | \hat { y } ( x ) ) ] + \mathbb { E } _ { y \sim \mathcal { V } } [ - \log P _ { \mathcal { X } \mathcal { V } } ( y | \hat { x } ( y ) ) ] ,
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
in which $\begin{array} { r } { \hat { y } ( x ) = \arg \operatorname* { m a x } _ { u \in \mathcal { V } } P _ { \mathcal { X } \mathcal { V } } ( u | x ) } \end{array}$ and $\begin{array} { r } { \hat { x } ( y ) = \arg \operatorname* { m a x } _ { v \in \mathcal { X } } P _ { \mathcal { Y } \mathcal { X } } ( v | y ) } \end{array}$ . Note that the four $P . . .$ ’s are implemented in a single encoder-decoder based model, where each translation task has a different “task embedding”, i.e., a learnable vector indicating the translating directions.
|
| 358 |
+
|
| 359 |
+
# D IMAGE-TO-IMAGE TRANSLATION
|
| 360 |
+
|
| 361 |
+
# D.1 NETWORK ARCHITECTURE
|
| 362 |
+
|
| 363 |
+
We follow Zhu et al. (2017) to configure the model architectures for all tasks on image-to-image translation. For the generator, the network contains 2 stride-2 convolutions, 9 residual blocks, and 2 convolutional layers with stride $\begin{array} { l } { { \frac { 1 } { 2 } } } \end{array}$ , (i.e., the transposed convolutional layers). Instance normalization is applied to the network. For the discriminator, the $7 0 \times 7 0$ PatchGANs (Isola et al., 2017), which aim to classify whether $7 0 \times 7 0$ overlapping image patches are real or fake. Such a patch-level discriminator architecture has fewer parameters than a full-image discriminator and can work on arbitrarily-sized images in a fully convolutional fashion.
|
| 364 |
+
|
| 365 |
+
# D.2 RESULTS OF PHOTO-TO-PAINTING TRANSLATION
|
| 366 |
+
|
| 367 |
+
We present results on photo painting translation in Figure 5. As we can see, both standard CycleGAN and our algorithm successfully translates the inputs to the corresponding target domains. Our model outperforms the baseline in two aspects: 1) multi-agent dual learning can generate clearer images with less block artifact (the Monet column and Ukiyo-e column); and 2) the images generated by our algorithm are faithful to the original images in semantics. For example, the sun is missing from CycleGAN generated images in the top Ukiyo-e column and the bottom Cezanne column, while our algorithm is able to keep the sun.
|
| 368 |
+
|
| 369 |
+
# D.3 RESULTS OF CITYSCAPES PHOTO-TO-LABEL TRANSLATION
|
| 370 |
+
|
| 371 |
+
FCN Evaluation FCN-scores are used in Zhu et al. (2017) and Isola et al. (2017) to quantitatively evaluate Cityscape photo to semantic label translation. A pre-trained fully convolutional network (Long et al., 2015), briefly, FCN, is used to convert the photo to the corresponding semantic label, and then calculate the per-pixel accuracy, per-class accuracy and mean class IntersectionOver-Union(Class IOU) (Cordts et al., 2016) against the ground truth labels.
|
| 372 |
+
|
| 373 |
+
Results on photo label translation The example cases and quantitative evaluation with FCNscores of photo labels on cityscapes images are shown in Figure 6 and Table $8 ^ { 1 0 }$ respectively. We can observe improvements but the gap is not significant. Note that CycleGAN is a very strong baseline, and we leave further improving photo label translation to future work.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 5: Two groups of experiments on photo painting translations.
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 6: Cityscapes photo labels translation
|
| 380 |
+
|
| 381 |
+
Table 8: Classification performances of Cityscapes photo labels translation.
|
| 382 |
+
|
| 383 |
+
<table><tr><td></td><td>Per-pixel Acc.</td><td>Per-class Acc.</td><td>Class IOU</td></tr><tr><td>Standard</td><td>0.56</td><td>0.19</td><td>0.15</td></tr><tr><td>Dual-3</td><td>0.57</td><td>0.20</td><td>0.15</td></tr></table>
|
md/train/Hyx6Bi0qYm/Hyx6Bi0qYm.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADVERSARIAL DOMAIN ADAPTATION FOR STABLE BRAIN-MACHINE INTERFACES
|
| 2 |
+
|
| 3 |
+
Ali Farshchian, Juan A. Gallego, Lee E. Miller & Sara A. Solla Northwestern University, Evanston, IL, USA {a-farshchiansadegh,juan.gallego,lm,solla}@northwestern.edu
|
| 4 |
+
|
| 5 |
+
Joseph P. Cohen & Yoshua Bengio
|
| 6 |
+
University of Montreal, Montreal, Canada
|
| 7 |
+
cohenjos@iro.umontreal.ca,yoshua.bengio@umontreal.ca
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Brain-Machine Interfaces (BMIs) have recently emerged as a clinically viable option to restore voluntary movements after paralysis. These devices are based on the ability to extract information about movement intent from neural signals recorded using multi-electrode arrays chronically implanted in the motor cortices of the brain. However, the inherent loss and turnover of recorded neurons requires repeated recalibrations of the interface, which can potentially alter the day-to-day user experience. The resulting need for continued user adaptation interferes with the natural, subconscious use of the BMI. Here, we introduce a new computational approach that decodes movement intent from a low-dimensional latent representation of the neural data. We implement various domain adaptation methods to stabilize the interface over significantly long times. This includes Canonical Correlation Analysis used to align the latent variables across days; this method requires prior point-to-point correspondence of the time series across domains. Alternatively, we match the empirical probability distributions of the latent variables across days through the minimization of their Kullback-Leibler divergence. These two methods provide a significant and comparable improvement in the performance of the interface. However, implementation of an Adversarial Domain Adaptation Network trained to match the empirical probability distribution of the residuals of the reconstructed neural signals outperforms the two methods based on latent variables, while requiring remarkably few data points to solve the domain adaptation problem.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Individuals with tetraplegia due to spinal cord injury identify restoration of hand function as their highest priority (Anderson, 2004). Over $50 \%$ of respondents with a C1-C4 injury would be willing to undergo brain surgery to restore grasp (Blabe et al., 2015). Brain-Machine Interfaces (BMIs) aim to restore motor function by extracting movement intent from neural signals. Despite its great promise, current BMI technology has significant limitations. A BMI that maps neural activity in primary motor cortex (M1) onto motor intent commands should ideally provide a stable day-to-day user experience. However, the gradual alterations of the activity recorded by chronically implanted multi-electrode arrays, due to neuron turnover or electrode movement and failure (Barrese et al., 2013), causes considerable variation in the actions produced by the BMI. This turnover may occur within a single day (Downey et al., 2018), and is estimated to be on the order of $40 \%$ over two weeks (Dickey et al., 2009). In the face of changing neural signals, performance can be maintained by daily retraining the interface, but this is not a viable solution as it requires the user to keep on adapting to a new interface (Ajiboye et al., 2017).
|
| 16 |
+
|
| 17 |
+
There is a high degree of correlation across the M1 neural signals. This redundancy implies that the dimensionality of the underlying motor command is much lower than the number of M1 neurons, and even lower than the number of recorded M1 neurons (Gallego et al., 2017). The use of dimensionality reduction methods is thus a common practice in BMI design, as it provides a more compact and denoised representation of neural activity, and a low-dimensional predictor of movement intent. Most of the earlier work used linear dimensionality reduction methods such as Principal Components Analysis (PCA) and Factor Analysis (FA) (Yu et al., 2009; Shenoy et al., 2013; Sadtler et al., 2014; Gallego et al., 2017); more recently, autoencoders (AEs) have been used for the nonlinear dimensionality reduction of neural signals (Pandarinath et al., 2018). Here we develop a deep learning architecture to extract a low-dimensional representation of recorded M1 activity constrained to include features related to movement intent. This is achieved by the simultaneous training of a deep, nonlinear autoencoder network based on neural signals from M1, and a network that predicts movement intent from the inferred low-dimensional signals. We show that this architecture significantly improves predictions over the standard sequential approach of first extracting a low-dimensional, latent representation of neural signals, followed by training a movement predictor based on the latent signals.
|
| 18 |
+
|
| 19 |
+
To stabilize the resulting BMI against continuous changes in the neural recordings, we introduce a novel approach based on the Generative Adversarial Network (GAN) architecture (Goodfellow et al., 2014). This new approach, the Adversarial Domain Adaptation Network (ADAN), focuses on the probability distribution function (PDF) of the residuals of the reconstructed neural signals to align the residual’s PDF at a later day to the PDF of the first day the BMI was calculated. The alignment of residual PDFs results in the alignment of the PDFs of the neural data and of their latent representation across multiple days. We show that this method results in a significantly more stable performance of the BMI over time than the stability achieved using several other domain adaptation methods. The use of an ADAN thus results in a BMI that remains stable and consistent to the user over long periods of time. A successful domain adaptation of the neural data eliminates the need for frequent recalibration of the BMI, which remains fixed. This strategy is expected to alleviate the cognitive burden on the user, who would no longer need to learn novel strategies to compensate for a changing interface.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Current approaches to solving the stability problem for BMIs based on spiking activity recorded using chronically implanted multi-electrode arrays include gradually updating interface parameters using an exponentially weighted sliding average (Orsborn et al., 2012; Dangi et al., 2013), adjusting interface parameters by tracking recording nonstationarities (Zhang & Chase, 2013; Bishop et al., 2014) or by retrospectively inferring the user intention among a set of fixed targets (Jarosiewicz et al., 2015), cancelling out neural fluctuations by projecting the recorded activity onto a very lowdimensional space (Nuyujukian et al., 2014), training the interface with large data volumes collected over a period of several months to achieve robustness against future changes in neural recordings (Sussillo et al., 2016), and a semi-unsupervised approach based on aligning the PDF of newly predicted movements to a previously established PDF of typical movements (Dyer et al., 2017).
|
| 24 |
+
|
| 25 |
+
Other approaches, more similar to ours, are based on the assumption that the relationship between latent dynamics and movement intent will remain stable despite changes in the recorded neural signals. Recent studies reveal the potential of latent dynamics for BMI stability. Kao et al. (2017) use past information about population dynamics to partially stabilize a BMI even under severe loss of recorded neurons, by aligning the remaining neurons to previously learned dynamics. Pandarinath et al. (2018) extract a single latent space from concatenating neural recordings over five months, and show that a predictor of movement kinematics based on these latent signals is reliable across all the recorded sessions.
|
| 26 |
+
|
| 27 |
+
# 3 EXPERIMENTAL SETUP
|
| 28 |
+
|
| 29 |
+
A male rhesus monkey (Macaca mulatta) sat in a primate chair with the forearm restrained and its hand secured into a padded, custom fit box. A torque cell with six degrees of freedom was mounted onto the box. The monkey was trained to generate isometric torques that controlled a computer cursor displayed on a screen placed at eye-level, and performed a 2D center-out task in which the cursor moved from a central target to one of eight peripheral targets equally spaced along a circle centered on the central target (Figure 1A) (Oby et al., 2012).
|
| 30 |
+
|
| 31 |
+
To record neural activity, we implanted a 96-channel microelectrode array (Blackrock Microsystems, Salt Lake City, Utah) into the hand area of primary motor cortex (M1). Prior to implanting the array, we intraoperatively identified the hand area of M1 through sulcal landmarks, and by stimulating the surface of the cortex to elicit twitches of the wrist and hand muscles. We also implanted electrodes in 14 muscles of the forearm and hand, allowing us to record the electromyograms (EMGs) that quantify the level of activity in each of the muscles. Data was collected in five experimental sessions spanning 16 days. All methods were approved by Northwestern Universitys IACUC and carried out in accordance with the Guide for the Care and Use of Laboratory Animals.
|
| 32 |
+
|
| 33 |
+
# 4 METHODS
|
| 34 |
+
|
| 35 |
+
# 4.1 COMPUTATIONAL INTERFACE
|
| 36 |
+
|
| 37 |
+
Our goal is to reliably predict the actual patterns of muscle activity during task execution, based on the recorded neural signals. Similar real-time predictions of kinematics are the basis of BMIs used to provide control of a computer cursor or a robotic limb to a paralyzed person (Taylor et al., 2002; Hochberg et al., 2006; Collinger et al., 2013). Predictions of muscle activity have been used to control the intensity of electrical stimulation of muscles that are temporarily paralyzed by a pharmacological peripheral nerve block (Ethier et al., 2012), a procedure that effectively bypasses the spinal cord to restore voluntary control of the paralyzed muscles. Similar methods have been attempted recently in humans (Bouton et al., 2016; Ajiboye et al., 2017).
|
| 38 |
+
|
| 39 |
+
The BMI is a computational interface that transforms neural signals into command signals for movement control, in this case the EMG patterns. Here we propose an interface that consists of two components, a neural autoencoder (AE) and an EMG predictor (Figure 1B). The AE is a fully connected multilayer network consisting of an input layer, five layers of hidden units, and an output layer. The reconstruction aims at minimizing the mean square error (MSE) between input and output signals. Units in the latent and output layers implement linear readouts of the activity of the preceding layer. Units in the remaining hidden layers implement a linear readout followed by an exponential nonlinearity. To provide inputs to the AE, we start with neural data $\mathbf { } _ \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf { }$ consisting of the spike trains recorded from $n$ electrodes at time $t$ . We bin neural spikes at $5 0 ~ \mathrm { m s }$ intervals and apply a Gaussian filter with a standard deviation of $1 2 5 ~ \mathrm { m s }$ to the binned spike counts to obtain $n$ -dimensional smoothed firing rates $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . The output layer provides $n$ -dimensional estimates $\widehat { \mathbf { x } } _ { t }$ of the inputs $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . The latent layer activity ${ \boldsymbol { z } } _ { t }$ consist of $l$ latent variables, with $l < n$ .
|
| 40 |
+
|
| 41 |
+
The EMG data ${ \mathbf { } } _ { \pmb { y } _ { t } }$ is the envelope of the muscle activity recorded from $m$ muscles, with $m < n$ . The $l$ -dimensional latent activity ${ \boldsymbol { z } } _ { t }$ is mapped onto the $m$ -dimensional EMGs through a long-short term memory (LSTM) (Hochreiter & Schmidhuber, 1997) layer with $m$ units, followed by a linear layer $\widehat { \pmb { y } } _ { t } = \dot { \pmb { W } } ^ { T } L S T M ( \pmb { z } _ { t } )$ . To train the model, we minimize a loss function $\mathcal { L }$ that simultaneously baccounts for two losses: $\mathcal { L } ^ { \dot { \pmb { x } } } : \mathbb { R } ^ { n } \mathbb { R } ^ { + }$ is the MSE of the reconstruction of the smooth firing rates, and $\mathcal { L } ^ { y } : \mathbb { R } ^ { m } \mathbb { R } ^ { + }$ is the MSE of the EMG predictions:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathcal { L } = \lambda \mathcal { L } ^ { \pmb { x } } + \mathcal { L } ^ { \pmb { y } } = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \left( \lambda | | \widehat { \pmb x } _ { t } - { \pmb x } _ { t } | | ^ { 2 } + | | \widehat { \pmb y } _ { t } - { \pmb y } _ { t } | | ^ { 2 } \right)
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Here $T$ is the number of time samples, and $t$ labels the time-ordered data points that constitute the training set. The factor $\lambda$ that multiplies the AE loss adjusts for the different units and different value ranges of firing rates and EMGs; it equalizes the contributions of the two terms in the loss function so that the learning algorithm does not prioritize one over the other. The value of $\lambda$ is updated for each new training iteration; it is computed as the ratio $\begin{array} { r } { \lambda = \frac { \mathcal { L } ^ { y } } { \mathcal { L } ^ { x } } } \end{array}$ of the respective losses at the end of the preceding iteration. Once the neural AE and the EMG predictor networks have been trained on the data acquired on the first recording session, indicated as day-0, their weights remain fixed.
|
| 48 |
+
|
| 49 |
+
# 4.2 DOMAIN ADAPTATION
|
| 50 |
+
|
| 51 |
+
To stabilize a fixed BMI, we need to align the latent space of later days to that of the first day, when the fixed interface was initially built. This step is necessary to provide statistically stationary inputs to the EMG predictor. We first use two different approaches to align latent variables across days: Canonical Correlation Analysis (CCA) between latent trajectories and Kullback-Leibler (KL)
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 1: Experimental setup and methods. A. The isometric wrist center-out task with its eight targets, color coded. BMI schematics: recorded neural activity predicts muscle activity. B. The BMI consists of two networks: a neural AE and an EMG predictor. Recorded neural activity is binned and smoothed to provide an input to the AE. The activity of the low-dimensional latent space provides an input to the predictor of muscle activity. C. The ADAN architecture that aligns the firing rates of day- $k$ to those of day-0, when the BMI was built.
|
| 55 |
+
|
| 56 |
+
divergence minimization between latent distributions. We then use an ADAN to align the distributions of the residuals of the reconstructed neural data. This procedure results in the alignment of the distributions of the neural data and of their latent representation across days.
|
| 57 |
+
|
| 58 |
+
# 4.2.1 CANONICAL CORRELATION ANALYSIS (CCA)
|
| 59 |
+
|
| 60 |
+
Consider the latent activities $Z _ { 0 }$ corresponding to day-0 and $Z _ { k }$ corresponding to a later day- $k$ ; the AE is fixed after being trained with day-0 data. Both $Z _ { 0 }$ and $Z _ { k }$ are matrices of dimension $l$ by $8 \tau$ , where $l$ is the dimensionality of the latent space and $\tau$ is the average time duration of each trial; the factor of 8 arises from concatenating the averaged latent activities for each of the eight targets. The goal of CCA is to find a linear transformation of the latent variables $Z _ { k }$ so that they are maximally correlated with a linear transformation of the latent variables $Z _ { 0 }$ (Bach & Jordan, 2002). This well established approach, involving only linear algebra, has been successfully applied to the analysis of M1 neural data (Sussillo et al., 2015; Gallego et al., 2018; Russo et al., 2018). In summary, the analysis starts with a $Q R$ decomposition of the transposed latent activity matrices, $Z _ { 0 } ^ { T } = \dot { Q _ { 0 } } R _ { 0 }$ , $Z _ { k } ^ { T } = Q _ { k } R _ { k }$ . Next, we construct the inner product matrix of $Q _ { 0 }$ and $Q _ { k }$ , and perform a singular value decomposition to obtain $Q _ { 0 } ^ { T } Q _ { k } = U S V ^ { T }$ . The new latent space directions along which correlations are maximized are given by $M _ { 0 } = R _ { 0 } ^ { - 1 } U$ , and $M _ { k } = R _ { k } ^ { - 1 } V$ , respectively.
|
| 61 |
+
|
| 62 |
+
The implementation of CCA requires a one-to-one correspondence between data points in the two sets; this restricts its application to neural data that can be matched in time across days. Matching is achieved here through the repeated execution of highly stereotypic movements; the correspondence is then established by pairing average trials to a given target across different days. In a real-life scenario, motor behaviors are not structured and moment-to-moment movement intent is less clear, interfering with the possibility of establishing such a correspondence. Alignment using CCA requires a supervised calibration through the repetition of stereotyped tasks, but ideally the alignment would be achieved based on data obtained during natural, voluntary movements. A successful unsupervised approach to the alignment problem is thus highly desirable.
|
| 63 |
+
|
| 64 |
+
# 4.2.2 KULLBACK-LEIBLER DIVERGENCE MINIMIZATION (KLDM)
|
| 65 |
+
|
| 66 |
+
For the unsupervised approach, we seek to match the probability distribution of the latent variables of day- $k$ to that of day-0, without a need for the point-to-point correspondence provided in CCA by their time sequence. We use the fixed AE trained on day-0 data to map the neural data of day-0 and day- $k$ onto two sets of $l$ -dimensional latent variables, $\{ z _ { 0 } \}$ and $\left\{ z _ { k } \right\}$ , respectively. We then compute the mean and covariance matrices for each of these two empirical distributions, and capture their first and second order statistics by approximating these two distributions by multivariate Gaussians: $p _ { 0 } ( z _ { 0 } ) \sim \mathcal { N } ( z _ { 0 } ; \pmb { \mu } _ { 0 } , \pmb { \Sigma } _ { 0 } )$ and $\dot { p _ { k } } ( \bar { z } _ { k } ^ { - } ) \sim \mathcal { N } ( z _ { k } ; \mu _ { k } , \Sigma _ { k } )$ . We then minimize the KL divergence between them,
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
D _ { \mathrm { K L } } ( p _ { k } ( z _ { k } ) | | p _ { 0 } ( z _ { 0 } ) ) = { \frac { 1 } { 2 } } { \Big ( } t r ( \Sigma _ { 0 } ^ { - 1 } \Sigma _ { k } ) + ( \mu _ { 0 } - \mu _ { k } ) ^ { T } \Sigma _ { 0 } ^ { - 1 } ( \mu _ { 0 } - \mu _ { k } ) ) - l + l n { \frac { | \Sigma _ { 0 } | } { | \Sigma _ { k } | } } { \Big ) }
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
To minimize the KL divergence, we implemented a map from neural activity to latent activity using a network with the same architecture as the encoder section of the BMI’s AE. This network was initialized with the weights obtained after training the BMI’s AE on the day-0 data. Subsequent training was driven by the gradient of the cost function of equation 2, evaluated on a training set provided by day- $k$ recordings of neural activity. This process aligns the day- $k$ latent PDF to that of day-0 through two global linear operations: a translation through the match of the means, and a rotation through the match of the eigenvectors of the covariance matrices; a nonuniform scaling follows from the match of the eigenvalues of the covariance matrices.
|
| 73 |
+
|
| 74 |
+
To improve on the Gaussian assumption for the distribution of latent variables, we have trained an alternative BMI in which the AE (Figure 1B) is replaced by a Variational AE (Kingma & Welling, 2013). We train the VAE by adding to the interface loss function (equation 1) a regularizer term: the Kullback-Leibler (KL) divergence $D _ { \mathrm { K L } } ( p _ { 0 } ( z _ { 0 } ) \vert \vert q ( z _ { 0 } ) )$ between the probability distribution $p _ { 0 } ( z _ { 0 } )$ of the latent activity on day-0 and $q ( z _ { 0 } ) = \mathcal { N } ( z _ { 0 } ; 0 , I )$ . The latent variables of the VAE are thus subject to the additional soft constraint of conforming to a normal distribution.
|
| 75 |
+
|
| 76 |
+
# 4.2.3 ADVERSARIAL DOMAIN ADAPTATION NETWORK (ADAN)
|
| 77 |
+
|
| 78 |
+
In addition to matching the probability distributions of latent variables of day- $k$ to those of day-0, we seek an alternative approach: to match the probability distributions of the residuals of the reconstructed firing rates (Zhao et al., 2016), as a proxy for matching the distributions of the neural recordings and their corresponding latent variables. To this end, we train an ADAN whose architecture is very similar to that of a Generative Adversarial Network (GAN): it consists of two deep neural networks, a distribution alignment module and a discriminator module (Figure 1C).
|
| 79 |
+
|
| 80 |
+
The discriminator is an AE (Zhao et al., 2016) with the same architecture as the one used for the BMI (Figure 1B). The discriminator parameters $\theta _ { D }$ are initialized with the weights of the BMI AE, trained on the day-0 neural data. The goal of the discriminator is to maximize the difference between the neural reconstruction losses of day- $k$ and day-0. The great dissimilarity between the probability distribution of day-0 residuals and that of day- $k$ residuals obtained with the discriminator in its initialized state results in a strong signal that facilitates subsequent discriminator training.
|
| 81 |
+
|
| 82 |
+
The distribution alignment module works as an adversary to the discriminator by minimizing the neural reconstruction losses of day- $k$ (Warde-Farley & Bengio, 2017). It consists of a hidden layer with exponential units and a linear readout layer, each with $n$ fully connected units. The aligner parameters $\theta _ { A }$ , the weights of the $n$ by $n$ connectivity matrices from input to hidden and from hidden to output, are initialized as the corresponding identity matrices. The aligner module receives as inputs the firing rates $X _ { k }$ of day- $k$ . During training, the gradients through the discriminator bring the output $A ( X _ { k } )$ of the aligner closer to $X _ { 0 }$ . The adversarial mechanism provided by the discriminator allows us to achieve this alignment in an unsupervised manner.
|
| 83 |
+
|
| 84 |
+
To train the ADAN, we need to quantify the reconstruction losses. Given input data $\boldsymbol { X }$ , the discriminator outputs $\hat { \pmb X } = \hat { \pmb X } ( \pmb X , \bar { \theta } _ { D } )$ , with residuals $R ( X , \theta _ { D } ) = \left( X - \hat { X } ( X , \theta _ { D } ) \right)$ . Consider the scalar reconstruction losses $\mathbf { r }$ obtained by taking the $L ^ { 1 }$ norm of each column of $\pmb { R }$ . Let $\rho _ { 0 }$ and $\rho _ { k }$ be the distributions of the scalar losses for day-0 and day- $k$ , respectively, and let $\mu _ { 0 }$ and $\mu _ { k }$ be their corresponding means. We measure the dissimilarity between these two distributions by a lower bound to the Wasserstein distance (Arjovsky et al., 2017), provided by the absolute value of the difference between the means: $W ( \rho _ { 0 } , \rho _ { k } ) \geq | \mu _ { 0 } - \mu _ { k } |$ (Berthelot et al., 2017). The discriminator is trained to learn features that discriminate between the two distributions by maximizing the corresponding Wasserstein distance. The discriminator initialization implies $\mu _ { k } > \mu _ { 0 }$ when the ADAN training begins. By maximizing $\left( \mu _ { k } - \mu _ { 0 } \right)$ , equivalent to minimizing $\left( \mu _ { 0 } - \mu _ { k } \right)$ , this relation is maintained during training. Since scalar residuals and their means are nonnegative, the maximization of $W ( \rho _ { 0 } , \rho _ { k } )$ is achieved by decreasing $\mu _ { 0 }$ while increasing $\mu _ { k }$ .
|
| 85 |
+
|
| 86 |
+
Given discriminator and aligner parameters $\theta _ { D }$ and $\theta _ { A }$ , respectively, the discriminator and aligner loss functions $\mathcal { L } _ { D }$ and $\mathcal { L } _ { A }$ to be minimized can be expressed as
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\left\{ \begin{array} { l l } { \mathcal { L } _ { D } = \mu _ { 0 } ( X _ { 0 } ; \theta _ { D } ) - \mu _ { k } ( A ( X _ { k } ; \theta _ { A } ) ; \theta _ { D } ) } & { \mathrm { ~ f o r } \theta _ { D } } \\ { \mathcal { L } _ { A } = \mu _ { k } ( A ( X _ { k } ; \theta _ { A } ) ; \theta _ { D } ) } & { \mathrm { ~ f o r } \theta _ { A } } \end{array} \right.
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
# 5 RESULTS
|
| 93 |
+
|
| 94 |
+
Figure 2A illustrates the firing rates $n = 9 6$ ), the latent variables $( l = 1 0 )$ ), the reconstructed firing rates, and the actual and predicted muscle activity for two representative muscles, a wrist flexor and an extensor, over a set of eight trials (one trial per target location) of a test data set randomly selected from day-0 data. The overall performance of the interface is summarized in Figure 2B, quantified using the percentage of the variance accounted for $( \% \mathrm { { V A F } ) }$ for five-fold cross-validated data. The blue bar shows the accuracy of EMG predictions directly obtained from the $n$ -dimensional firing rates, without the dimensionality reduction step; this EMG predictor consists of an LSTM layer with $n$ units, followed by a linear layer. The green bar shows the accuracy of EMG predictions when the interface is trained sequentially: first the AE is trained in an unsupervised manner, and then the EMG predictor is trained with the resulting $l$ -dimensional latent variables as input. The performance of the sequentially trained interface is worse than that of an EMG predictor trained directly on neural activity as input; the difference is small but significant (paired t-test, $\scriptstyle \mathrm { p = 0 . 0 0 6 } )$ ). In contrast, when the EMG predictor is trained simultaneously with the AE (red bar), there is no significant difference (paired t-test, $\mathrm { p { = } 0 . 9 7 1 }$ ) in performance between EMG predictions based on the $n$ -dimensional neural activity and the $l$ -dimensional latent variables. In simultaneous training, the AE is trained using the joint loss function of equation 1 that includes not only the unsupervised neural reconstruction loss but also a supervised regression loss that quantifies the quality of EMG predictions. Therefore, the supervision of the dimensionality reduction step through the integration of relevant movement information leads to a latent representation that better captures neural variability related to movement intent.
|
| 95 |
+
|
| 96 |
+
For the implementation of the domain adaptation techniques, the interface was trained using only the data of day-0 and remained fixed afterward. Both CCA and KLDM were designed to match latent variables across days. Therefore, when using these methods, we first use the encoder part of the fixed AE to map neural activity of subsequent days onto latent activity, we then apply CCA or KLDM to align day- $k$ latent activity to that of day-0, and finally use the fixed EMG predictor to predict EMGs from the aligned latent activity. While KLDM explicitly seeks to match first and second order statistics of the latent variables through a Gaussian approximation, CCA aligns the latent variables using a point-to point correspondence across days provided by the latent trajectories. The effect of CCA alignment is illustrated in Figure 3A, where we show 2D t-SNE visualizations of 10D latent trajectories. Each trajectory is an average over all trials for a given target. The differences between day-16 and day-0 latent trajectories reflect the impact of turnover in the recorded neurons. Comparison between these two sets of trajectories reveals a variety of transformations, including nonuniform rotation, scaling, and skewing. In spite of the complexity of these transformations, the available point-to-point correspondence along these trajectories allows CCA to achieve a good alignment. The mechanism underlying KLDM alignment is illustrated in 3B, where we show the empirical probability distribution of the latent variables along a randomly chosen, representative direction within the 10D latent space. Results are shown for day-0 (blue), for day-16 (red), and for day-16 after alignment with KLDM (yellow). The effects of using a BMI based on a VAE instead of the AE are shown in Supplementary Figure S1.
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 2: Neural to muscle BMI. A. Example firing rates recorded from the hand area of primary motor cortex while the monkey performed the isometric wrist task; we also show latent variables and reconstructed firing rates. The quality of EMG predictions is illustrated by comparison to actual EMGs for two representative muscles, for each of the eight target directions. B. Performance comparison between EMG predictions from $n$ -dimensional firing rates (blue) and EMG predictions from $l$ -dimensional latent variables, obtained either by training the predictor sequentially (green) or simultaneously (red) with the neural AE. Error bars represent standard deviation of the mean.
|
| 100 |
+
|
| 101 |
+
In contrast to CCA and KLDM, ADAN is designed to match the high-dimensional neural recordings across days via the $L ^ { 1 }$ norm of their residuals. In the ADAN architecture, the discriminator module is an AE that receives as inputs the neural activity of day-0 or day- $k$ and outputs their reconstructions. The residuals of the reconstruction of neural signals follow from the difference between the discriminator’s inputs and outputs. The ADAN aligns the day- $k$ residual statistics to those of day-0 by focusing on the $L ^ { 1 }$ norm of the residuals and minimizing the distance between these scalar PDFs across days; this procedure results in the alignment of the neural recordings and consequently their latent representation. The aligner module of ADAN aligns day- $k$ neural activity to that of day-0; this aligned neural activity is then used as input to the fixed BMI. Figure 3C shows the 1D distribution of the $L ^ { 1 }$ norm of the vector residuals, and in Figure 3D a 2D t-SNE (Maaten & Hinton, 2008) visualization of the vector residuals based on 1000 randomly sampled data points. Residuals correspond to the errors in firing rate reconstructions using the day-0 fixed AE for both day-0 data (blue) and day-16 data (red). Residuals for the day-16 data after alignment with ADAN are shown in yellow. Figure 3E shows the empirical probability distribution of the latent variables along the same representative, randomly chosen dimension within the 10D latent space used in Figure 3B. Results are shown for latent variables on day-0 using the fixed AE (blue), for the latent variables on day16 along the same dimension using the same, fixed AE (red), and for day-16 latent variables after alignment with ADAN (yellow). A 2D t-SNE visualization of latent variables aligned with ADAN is shown in comparison to the results of a simple center-and-scale alignment in Supplementary Figure S2.
|
| 102 |
+
|
| 103 |
+
The performance of the BMI before and after domain adaptation with CCA, KLDM, and ADAN is summarized in Figure 4A and quantified using the $\% \mathrm { V A F }$ in EMG predictions. We report mean and standard deviation for five-fold cross-validated data. Blue symbols indicate the performance of an interface that is updated on each day; this provides an upper bound for the potential benefits of neural domain adaptation. Red symbols illustrate the natural deterioration in the performance of a fixed interface due to the gradual deterioration of neural recordings. Green, orange, and purple symbols indicate the extent to which the performance of a fixed interface improves after alignment using CCA, KLDM, and ADAN, respectively. The comparable performance of CCA and KLDM reflects that both methods achieve alignment based on latent statistics; the use of ADAN directly for latent space alignment does not produce better results than these two methods. In contrast, when ADAN is used for alignment based on residual statistics, interface stability improves. This ADAN provides a better alignment because the residuals amplify the mismatch that results when a fixed day-0 AE is applied to later-day data (see Figures 3C and D). Although the improvement achieved for day-16 with ADAN over its competitors is small, about $6 \%$ , it is statistically significant (one-way ANOVA with Tukey’s test, $p < 0 . 0 1 $ ). We have been unable to achieve this degree of improvement with any of the many other domain adaptation approaches we tried. This improvement is even more remarkable given that domain adaptation with ADAN requires a surprisingly small amount of data. Figure 4B shows the percentage improvement in EMG predictions as a function of the amount of training data. Subsequent symbols are obtained by adding 6s of data (120 samples) to the training set, and computing the average percentage improvement for the entire day $2 0 \mathrm { m i n }$ recordings), for all days after day-0. EMG prediction accuracy saturates at ${ \sim } 1 \mathrm { m i n }$ ; this need for a small training set is ideal for practical applications.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Domain adaptation. A. 2D t-SNE visualization of the averaged 10D latent neural trajectories as the monkey performed the isometric wrist task for day-0, day-16 before alignment, and day-16 after alignment with CCA. B. Probability distribution of the 10D latent variables along a randomly chosen, representative direction. We show the distribution at day-0, and the distribution at day-16 before and after alignment using KLDM. C. Probability distribution of the $L ^ { 1 }$ norm of the vector residuals of the reconstructed firing rates for day-0 and day-16, before and after adversarial alignment using ADAN. D. 2D t-SNE visualization of the vector residuals of the reconstructed firing rates for day-0 and day-16, before and after adversarial alignment using ADAN. E. Same as $\mathbf { B }$ , but for alignment using ADAN.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: A. EMG prediction performance using a fixed BMI decoder. Blue symbols represent the sustained performance of interfaces retrained on a daily basis. Red symbols illustrate the deterioration in performance of a fixed interface without domain adaptation. The performance of a fixed interface after domain adaptation is shown for CCA (green), KLDM (orange), and ADAN (purple). Error bars represent standard deviation of the mean. B. Average improvements in EMG prediction performance for alignment using ADAN as a function of the amount of training data needed for domain adaptation at the beginning of each day, averaged over all days after day-0. Shading represents standard deviation of the mean.
|
| 110 |
+
|
| 111 |
+
# 6 CONCLUSION
|
| 112 |
+
|
| 113 |
+
We address the problem of stabilizing a fixed Brain-Machine Interface against performance deterioration due to the loss and turnover of recorded neural signals. We introduce a new approach to extracting a low-dimensional latent representation of the neural signals while simultaneously inferring movement intent. We then implement various domain adaption methods to stabilize the latent representation over time, including Canonical Correlation Analysis and the minimization of a Kullback-Leibler divergence. These two methods provide comparable improvement in the performance of the interface. We find that an Adversarial Domain Adaptation Network trained to match the empirical probability distribution of the residuals of the reconstructed neural recordings restores the latent representation of neural trajectories and outperforms the two methods based on latent variables, while requiring remarkably little data to solve the domain adaptation problem. In addition, ADAN solves the domain adaptation problem in a manner that is not task specific, and thus is potentially applicable to unconstrained movements.
|
| 114 |
+
|
| 115 |
+
Here we report on improvements in interface stability obtained offline, without a user in the loop. Online, closed-loop performance is not particularly well correlated with offline accuracy; in an online evaluation of performance, the user’s ability to adapt at an unknown rate and to an unknown extent to an imperfect BMI obscures the performance improvements obtained with domain adaptation. Although the open-loop performance improvement demonstrated here is encouraging, additional experiments, both open and closed-loop, with additional animals and involving additional tasks, are required to fully validate our results and to establish that the improvements demonstrated here facilitate the sustained use of a brain-machine interface.
|
| 116 |
+
|
| 117 |
+
# ACKNOWLEDGMENTS
|
| 118 |
+
|
| 119 |
+
These results are based upon work supported the National Institute of Neurological Disorders and Stroke (NINDS) under Grant No. 5R01NS053603-12. We thank F. Mussa-Ivaldi, E. Perreault, X. Ma, K. Bodkin, E. Altan, and M. Medina for discussions and comments.
|
| 120 |
+
|
| 121 |
+
REFERENCES
|
| 122 |
+
A Bolu Ajiboye, Francis R Willett, Daniel R Young, William D Memberg, Brian A Murphy, Jonathan P Miller, Benjamin L Walter, Jennifer A Sweet, Harry A Hoyen, and Michael W Keith. Restoration of reaching and grasping movements through brain-controlled muscle stimulation in a person with tetraplegia: a proof-of-concept demonstration. The Lancet, 389(10081):1821–1830, 2017. ISSN 0140-6736.
|
| 123 |
+
Kim D Anderson. Targeting recovery: priorities of the spinal cord-injured population. Journal of Neurotrauma, 21(10):1371–1383, 2004. ISSN 0897-7151.
|
| 124 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In Proceedings of Machine Learning Research, volume 70, pp. 214–223, 2017.
|
| 125 |
+
Francis R Bach and Michael I Jordan. Kernel independent component analysis. Journal of Machine Learning Research, 3(Jul):1–48, 2002.
|
| 126 |
+
James C Barrese, Naveen Rao, Kaivon Paroo, Corey Triebwasser, Carlos Vargas-Irwin, Lachlan Franquemont, and John P Donoghue. Failure mode analysis of silicon-based intracortical microelectrode arrays in non-human primates. Journal of Neural Engineering, 10(6):066014, 2013. ISSN 1741-2552.
|
| 127 |
+
David Berthelot, Thomas Schumm, and Luke Metz. Began: boundary equilibrium generative adversarial networks. arXiv:1703.10717, 2017.
|
| 128 |
+
William Bishop, Cynthia C Chestek, Vikash Gilja, Paul Nuyujukian, Justin D Foster, Stephen I Ryu, Krishna V Shenoy, and M Yu Byron. Self-recalibrating classifiers for intracortical braincomputer interfaces. Journal of Neural Engineering, 11(2):026001, 2014. ISSN 1741-2552.
|
| 129 |
+
Christine H Blabe, Vikash Gilja, Cindy A Chestek, Krishna V Shenoy, Kim D Anderson, and Jaimie M Henderson. Assessment of brain machine interfaces from the perspective of people with paralysis. Journal of Neural Engineering, 12(4):043002, 2015. ISSN 1741-2552.
|
| 130 |
+
Chad E Bouton, Ammar Shaikhouni, Nicholas V Annetta, Marcia A Bockbrader, David A Friedenberg, Dylan M Nielson, Gaurav Sharma, Per B Sederberg, Bradley C Glenn, and W Jerry Mysiw. Restoring cortical control of functional movement in a human with quadriplegia. Nature, 533 (7602):247, 2016. ISSN 1476-4687.
|
| 131 |
+
Jennifer L Collinger, Brian Wodlinger, John E Downey, Wei Wang, Elizabeth C Tyler-Kabara, Douglas J Weber, Angus JC McMorland, Meel Velliste, Michael L Boninger, and Andrew B Schwartz. High-performance neuroprosthetic control by an individual with tetraplegia. The Lancet, 381 (9866):557–564, 2013. ISSN 0140-6736.
|
| 132 |
+
Siddharth Dangi, Amy L Orsborn, Helene G Moorman, and Jose M Carmena. Design and analysis of closed-loop decoder adaptation algorithms for brain-machine interfaces. Neural Computation, 25(7):1693–1731, 2013. ISSN 0899-7667.
|
| 133 |
+
Adam S Dickey, Aaron Suminski, Yali Amit, and Nicholas G Hatsopoulos. Single-unit stability using chronically implanted multielectrode arrays. Journal of Neurophysiology, 102(2):1331– 1339, 2009. ISSN 0022-3077.
|
| 134 |
+
John E Downey, Nathaniel Schwed, Steven M Chase, Andrew B Schwartz, and Jennifer L Collinger. Intracortical recording stability in human brain–computer interface users. Journal of Neural Engineering, 15(4):046016, 2018.
|
| 135 |
+
Eva L Dyer, Mohammad Gheshlaghi Azar, Matthew G Perich, Hugo L Fernandes, Stephanie Naufel, Lee E Miller, and Konrad P Kording. A cryptography-based approach for movement decoding. ¨ Nature Biomedical Engineering, 1(12):967, 2017.
|
| 136 |
+
Christian Ethier, Emily R Oby, MJ Bauman, and Lee E Miller. Restoration of grasp following paralysis through brain-controlled stimulation of muscles. Nature, 485(7398):368, 2012. ISSN 1476-4687.
|
| 137 |
+
|
| 138 |
+
Juan A Gallego, Matthew G Perich, Lee E Miller, and Sara A Solla. Neural manifolds for the control of movement. Neuron, 94(5):978–984, 2017.
|
| 139 |
+
|
| 140 |
+
Juan A Gallego, Matthew G Perich, Stephanie N Naufel, Christian Ethier, Sara A Solla, and Lee E Miller. Cortical population activity within a preserved manifold underlies multiple motor behaviors. Nature Communications, 9:4233, 2018.
|
| 141 |
+
|
| 142 |
+
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.
|
| 143 |
+
|
| 144 |
+
Leigh R Hochberg, Mijail D Serruya, Gerhard M Friehs, Jon A Mukand, Maryam Saleh, Abraham H Caplan, Almut Branner, David Chen, Richard D Penn, and John P Donoghue. Neuronal ensemble control of prosthetic devices by a human with tetraplegia. Nature, 442(7099):164, 2006. ISSN 1476-4687.
|
| 145 |
+
|
| 146 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997. ISSN 0899-7667.
|
| 147 |
+
|
| 148 |
+
Beata Jarosiewicz, Anish A Sarma, Daniel Bacher, Nicolas Y Masse, John D Simeral, Brittany Sorice, Erin M Oakley, Christine Blabe, Chethan Pandarinath, and Vikash Gilja. Virtual typing by people with tetraplegia using a self-calibrating intracortical brain-computer interface. Science Translational Medicine, 7(313):313ra179, 2015. ISSN 1946-6234.
|
| 149 |
+
|
| 150 |
+
Jonathan C Kao, Stephen I Ryu, and Krishna V Shenoy. Leveraging neural dynamics to extend functional lifetime of brain-machine interfaces. Scientific Reports, 7(1):7395, 2017.
|
| 151 |
+
|
| 152 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv:1312.6114, 2013.
|
| 153 |
+
|
| 154 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
|
| 155 |
+
|
| 156 |
+
Paul Nuyujukian, Jonathan C Kao, Joline M Fan, Sergey D Stavisky, Stephen I Ryu, and Krishna V Shenoy. Performance sustaining intracortical neural prostheses. Journal of Neural Engineering, 11(6):066003, 2014.
|
| 157 |
+
|
| 158 |
+
Emily R Oby, Christian Ethier, and Lee E Miller. Movement representation in the primary motor cortex and its contribution to generalizable emg predictions. Journal of Neurophysiology, 109(3): 666–678, 2012.
|
| 159 |
+
|
| 160 |
+
Amy L Orsborn, Siddharth Dangi, Helene G Moorman, and Jose M Carmena. Closed-loop decoder adaptation on intermediate time-scales facilitates rapid bmi performance improvements independent of decoder initialization conditions. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 20(4):468–477, 2012. ISSN 1534-4320.
|
| 161 |
+
|
| 162 |
+
Chethan Pandarinath, Daniel J O’Shea, Jasmine Collins, Rafal Jozefowicz, Sergey D Stavisky, Jonathan C Kao, Eric M Trautmann, Matthew T Kaufman, Stephen I Ryu, Leigh R Hochberg, Jaimie M Henderson, Krishna V Shenoy, LF Abbott, and David Susillo. Inferring single-trial neural population dynamics using sequential auto-encoders. Nature Methods, 15:805–815, 2018.
|
| 163 |
+
|
| 164 |
+
Abigail A Russo, Sean R Bittner, Sean M Perkins, Jeffrey S Seely, Brian M London, Antonio H Lara, Andrew Miri, Najja J Marshall, Adam Kohn, Thomas M Jessell, LF Abbott, John P Cunningham, and Mark M Churchland. Motor cortex embeds muscle-like commands in an untangled population response. Neuron, 97(4):953–966, 2018.
|
| 165 |
+
|
| 166 |
+
Patrick T Sadtler, Kristin M Quick, Matthew D Golub, Steven M Chase, Stephen I Ryu, Elizabeth C Tyler-Kabara, M Yu Byron, and Aaron P Batista. Neural constraints on learning. Nature, 512 (7515):423, 2014. ISSN 1476-4687.
|
| 167 |
+
|
| 168 |
+
Krishna V Shenoy, Maneesh Sahani, and Mark M Churchland. Cortical control of arm movements: a dynamical systems perspective. Annual Review of Neuroscience, 36:337–359, 2013.
|
| 169 |
+
|
| 170 |
+
David Sussillo, Mark M Churchland, Matthew T Kaufman, and Krishna V Shenoy. A neural network that finds a naturalistic solution for the production of muscle activity. Nature Neuroscience, 18 (7):1025, 2015.
|
| 171 |
+
|
| 172 |
+
David Sussillo, Sergey D Stavisky, Jonathan C Kao, Stephen I Ryu, and Krishna V Shenoy. Making brainmachine interfaces robust to future neural variability. Nature Communications, 7:13749, 2016. ISSN 2041-1723.
|
| 173 |
+
|
| 174 |
+
Dawn M Taylor, Stephen I Helms Tillery, and Andrew B Schwartz. Direct cortical control of 3d neuroprosthetic devices. Science, 296(5574):1829–1832, 2002. ISSN 0036-8075.
|
| 175 |
+
|
| 176 |
+
David Warde-Farley and Yoshua Bengio. Improving generative adversarial networks with denoising feature matching. In International Conference on Learning Representations (ICLR), 2017.
|
| 177 |
+
|
| 178 |
+
Byron M Yu, John P Cunningham, Gopal Santhanam, Stephen I Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. In Advances in Neural Information Processing Systems, pp. 1881–1888, 2009.
|
| 179 |
+
|
| 180 |
+
Yin Zhang and Steve M Chase. A stabilized dual kalman filter for adaptive tracking of braincomputer interface decoding parameters. In Engineering in Medicine and Biology Society (EMBC), 2013 35th Annual International Conference of the IEEE, pp. 7100–7103. IEEE, 2013.
|
| 181 |
+
|
| 182 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv:1609.03126, 2016.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure S1: Variational autoencoder. A. EMG prediction performance using a different BMI, based on a VAE decoder, in comparison to the performance of a BMI based on the traditional autoencoder. Blue symbols represent the sustained performance of an interface retrained on a daily basis. Red symbols illustrate the deterioration in the performance of a fixed interface without domain adaptation. Orange symbols represent the performance of a fixed interface when the latent variables are aligned using KLDM. For each of these three cases, solid lines represent the performance of an AE-based BMI, and dashed lines that of a VAE-based BMI. Error bars represent standard deviation of the mean. B. Probability distribution of the 10D latent variables along the same dimension used in Figure 3B, now obtained with the fixed VAE trained on day-0. We show the distribution at day-0, and the distribution at day-16 before and after alignment using KLDM. In comparison to Figure 3B, the use of a VAE greatly improves the Gaussian nature of the latent variables’ distribution. However, this additional constraint in the autoencoder results in a slight deterioration of the BMI’s ability to predict EMGs, as shown in A.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure S2: Visualization of the probability distribution of latent variables in 2D using t-SNE. A. Latent variables on day-0. B. Latent variables on day-16, before alignment. C. Latent variables on day-16, after alignment to those of day-0 using T&S: a global translation to match the respective means followed by a global scaling to match the respective variances (yellow). Also shown, latent variables on day-0 (blue) on the same projection. D. Latent variables on day-16, after alignment to those of day-0 using ADAN (yellow). Also shown, latent variables on day-0 (blue) on the same projection.
|
md/train/Ig53hpHxS4/Ig53hpHxS4.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FLOWTRON: AN AUTOREGRESSIVE FLOW-BASED GENERATIVE NETWORK FOR TEXT-TO-SPEECH SYNTHESIS
|
| 2 |
+
|
| 3 |
+
Rafael Valle, Kevin J. Shih, Ryan Prenger & Bryan Catanzaro
|
| 4 |
+
NVIDIA
|
| 5 |
+
rafaelvalle@nvidia.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In this paper we propose Flowtron: an autoregressive flow-based generative network for text-to-speech synthesis with style transfer and speech variation. Flowtron borrows insights from Autoregressive Flows and revamps Tacotron 2 in order to provide high-quality and expressive mel-spectrogram synthesis. Flowtron is optimized by maximizing the likelihood of the training data, which makes training simple and stable. Flowtron learns an invertible mapping of data to a latent space that can be used to modulate many aspects of speech synthesis (timbre, expressivity, accent). Our mean opinion scores (MOS) show that Flowtron matches state-ofthe-art TTS models in terms of speech quality. We provide results on speech variation, interpolation over time between samples and style transfer between seen and unseen speakers. Code and pre-trained models are publicly available at https://github.com/NVIDIA/flowtron.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Current speech synthesis methods do not give the user enough control over how speech actually sounds. Automatically converting text to audio that successfully communicates the text was achieved a long time ago (Umeda et al., 1968; Badham et al., 1983). However, communicating only the text information leaves out the acoustic properties of the voice that convey much of the meaning and human expressiveness. In spite of this, the typical speech synthesis problem is formulated as a text to speech (TTS) problem in which the user inputs only text since the 1960s. This work proposes a normalizing flow model (Kingma & Dhariwal, 2018; Huang et al., 2018) that learns an unsupervised mapping from non-textual information to manipulable latent Gaussian distributions.
|
| 14 |
+
|
| 15 |
+
Taming the non-textual information in speech is difficult because the non-textual is unlabeled. A voice actor may speak the same text with different emphasis or emotion based on context, but it is unclear how to label a particular reading. Without labels for the non-textual information, recent approaches (Shen et al., 2017; Arik et al., 2017a;b; Ping et al., 2017) have formulated speech synthesis as a TTS problem wherein the non-textual information is implicitly learned. Despite their success in recreating non-textual information in the training set, the user has limited insight and control over it.
|
| 16 |
+
|
| 17 |
+
It is possible to formulate an unsupervised learning problem in such a way that the user can exploit the unlabeled characteristics of a data set. One way is to formulate the problem such that the data is assumed to have a representation in some latent space, and have the model learn that representation. This latent space can then be investigated and manipulated to give the user more control over the generative model’s output. Such approaches have been popular in image generation, allowing users to interpolate smoothly between images and to identify portions of the latent space that correlate with various features (Radford et al., 2015; Kingma & Dhariwal, 2018; Izmailov et al., 2019).
|
| 18 |
+
|
| 19 |
+
Recent deep learning approaches to expressive speech synthesis have combined text and learned latent embeddings for non-textual information (Wang et al., 2018; Skerry-Ryan et al., 2018; Hsu et al., 2018; Habib et al., 2019; Sun et al., 2020). These approaches impose an undesirable paradox: they require making assumptions before hand about the dimensionality of the embeddings when the correct dimensionality can only be determined after the model is trained. Even then, these embeddings are not guaranteed to contain all the non-textual information it takes to reconstruct speech, often
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+
(a) Time-averaged $_ { z }$ -values from multiple samples from 3 speakers with different timbres. $^ +$ is the centroid computed over samples from the same speaker.
|
| 26 |
+
|
| 27 |
+
(b) Time-averaged $_ { z }$ -values from multiple samples from 123 LibriTTS speakers. Each color represents a speaker. $^ +$ is Male (lower $F _ { 0 }$ , third quadrant). is Female (higher $F _ { 0 }$ , first quadrant).
|
| 28 |
+
|
| 29 |
+
Figure 1: T-SNE plot showing Flowtron partitioning the $_ z$ -space according to acoustic characteristics.
|
| 30 |
+
|
| 31 |
+
resulting in models with dummy or uninterpretable latent dimensions and not enough capacity, as the appendices in Wang et al. (2018); Skerry-Ryan et al. (2018); Hsu et al. (2018) confirm.
|
| 32 |
+
|
| 33 |
+
Furthermore, most models are not able to manipulate speech characteristics over time due to fixedlength embeddings. Their assumption is that variable-length embeddings are not robust to text and speaker perturbations (Skerry-Ryan et al., 2018), which we show not to be the case. Finally, although VAEs and GANs (Sun et al., 2020; Habib et al., 2019; Hsu et al., 2018; Binkowski et al., 2019; ´ Akuzawa et al., 2018) provide a latent embedding that can be manipulated, they may be difficult to train, are limited to approximate latent variable prediction, and rely on an implicit generative model or ELBO estimate to perform MLE in the latent space (Kingma & Dhariwal, 2018; Lucic et al., 2018; Kingma et al., 2016).
|
| 34 |
+
|
| 35 |
+
In this paper we propose Flowtron: an autoregressive flow-based generative network for melspectrogram synthesis with style transfer over time and speech variation. Flowtron learns an invertible function that maps a distribution over mel-spectrograms to a latent $_ z$ -space parameterized by a spherical Gaussian. Figure 1 shows that acoustic characteristics like timbre and $F _ { 0 }$ correlate with portions of the $_ z$ -space of Flowtron models trained without speaker embeddings.
|
| 36 |
+
|
| 37 |
+
With our formalization, we can generate samples containing specific speech characteristics manifested in mel-space by finding and sampling the corresponding region in $_ z$ -space (Gambardella et al., 2019). Our formulation also allows us to impose a structure to the $_ z$ -space and to parametrize it with a Gaussian mixture, similar to Hsu et al. (2018). In our simplest setup, we generate samples with a zero mean spherical Gaussian prior and control the amount of variation by adjusting its variance.
|
| 38 |
+
|
| 39 |
+
Compared to VAEs and GANs and their disadvantages enumerated in Kingma & Dhariwal (2018), manipulating a latent prior in Flowtron comes at no cost in speech quality nor optimization challenges. Flowtron is able to generalize and produce sharp mel-spectrograms, even at high $\sigma ^ { 2 }$ values, by simply maximizing the likelihood of the data while not requiring any additional Prenet or Postnet layer (Wang et al., 2017), nor compound loss functions required by most SOTA models (Shen et al., 2017; Ping et al., 2017; Skerry-Ryan et al., 2018; Wang et al., 2018; Binkowski et al., 2019). ´
|
| 40 |
+
|
| 41 |
+
In summary, Flowtron is optimized by maximizing the exact likelihood of the training data, which makes training simple and stable. Using normalizing flows, it learns an invertible mapping from data to latent space that can be manipulated to modulate many aspects of speech synthesis. Concurrent with this work are Glow-TTS (Kim et al., 2020) and Flow-TTS (Miao et al., 2020), both of which incorporate normalizing flows into the TTS task. Our work differs from these two in that Flowtron is an autoregressive architecture where we explore the use of flow to modulate speech and style variation. In contrast, Glow-TTS and Flow-TTS are parallel architectures that focus on inference speed. Our mean opinion scores (MOS) show that Flowtron matches SOTA TTS models in terms of speech quality. Further, we provide results on speech variation, interpolation between samples and interpolation between styles over time, and style transfer between seen and unseen speakers with equal or different sentences. We hope this work, the first to show evidence that normalizing flows can be used for expressive text-to-speech synthesis and style transfer, will further stimulate developments in normalizing flows.
|
| 42 |
+
|
| 43 |
+
# 2 FLOWTRON
|
| 44 |
+
|
| 45 |
+
Flowtron is an autoregressive flow that generates a sequence of mel-spectrogram frames. A normalizing flow generates samples by first sampling a latent variable from a known distribution $p ( z )$ , and applying a series of invertible transformations to produce a sample from the target distribution $p ( { \pmb x } )$ . These invertible transformations $f$ are known as steps of flow:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\pmb { x } = \pmb { f } _ { 1 } \circ \pmb { f } _ { 2 } \circ . . . \pmb { f } _ { k } ( z )
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Because each transformation is invertible, we can directly evaluate the exact log-likelihood of the target distribution $p ( { \pmb x } )$ using the change of variables:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { l } { \log p _ { \theta } ( \pmb { x } ) = \log p _ { \theta } ( z ) + \displaystyle \sum _ { i = 1 } ^ { k } \log \vert \operatorname* { d e t } ( \pmb { J } ( \pmb { f } _ { i } ^ { - 1 } ( \pmb { x } ) ) ) \vert } \\ { z = \pmb { f } _ { k } ^ { - 1 } \circ \pmb { f } _ { k - 1 } ^ { - 1 } \circ . . . \pmb { f } _ { 1 } ^ { - 1 } ( \pmb { x } ) } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Where $\textbf { { J } }$ is the Jacobian of the inverse transform $f _ { i } ^ { - 1 } ( { \pmb x } )$ . By cleverly choosing the latent distribution $p ( z )$ and the invertible transformations, the exact log-likelihood becomes simple and tractable.
|
| 58 |
+
|
| 59 |
+
# 2.1 LATENT DISTRIBUTIONS
|
| 60 |
+
|
| 61 |
+
We consider two simple distributions for the latent distribution $_ z$ : a zero-mean spherical Gaussian and a mixture of spherical Gaussians with fixed or learnable parameters.
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
z \sim \mathcal { N } ( z ; 0 , I ) \quad \mathrm { o r } \quad z \sim \sum _ { k } \hat { \phi } _ { k } \mathcal { N } ( z ; \hat { \mu } _ { k } , \hat { \Sigma } _ { k } )
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
The zero-mean spherical Gaussian has a simple log-likelihood. The mixture of the spherical Gaussians, has inherent clusters that might result in interesting aspects of the audio information.
|
| 68 |
+
|
| 69 |
+
# 2.2 INVERTIBLE TRANSFORMATIONS
|
| 70 |
+
|
| 71 |
+
Normalizing flows are typically constructed using coupling layers (Dinh et al., 2014; 2016; Kingma & Dhariwal, 2018). In our case, we use an autoregressive affine coupling layer (Dinh et al., 2016). The latent variable $_ z$ has the same number of dimensions and frames as the resulting mel-spectrogram sample. The previous frames $z _ { 1 : t - 1 }$ produce scale and bias terms, $\mathbf { } _ { s _ { t } }$ and $\mathbf { } _ { b _ { t } }$ respectively, that affine-transform the succeeding time step ${ \boldsymbol { z } } _ { t }$ :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { c } { { ( \log s _ { t } , b _ { t } ) = N N ( z _ { 1 : t - 1 } , t e x t , s p e a k e r ) } } \\ { { f ( z _ { t } ) = ( z _ { t } - b _ { t } ) \div s _ { t } } } \\ { { f ^ { - 1 } ( z _ { t } ) = s _ { t } \odot z _ { t } + b _ { t } } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Here, $N N ( )$ can be any autoregressive causal transformation (Shumway & Stoffer, 2017). The affine coupling layer is a reversible transformation, even though $N N ( )$ itself need not be invertible. We use a 0-vector for obtaining the scaling and bias terms what will affine transform $z _ { 1 }$ . This 0-vector constant also guarantees that the first $_ z$ is always known.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 2: Mapping data $\mathbf { \rho } ( \mathbf { x } )$ to the latent dimension ${ \bf \Pi } ( { \bf z } )$ for K steps of flow. The right side shows a unrolled view of the $N N ( )$ architecture. Text and speaker embeddings are channel-wise concatenated to produce context matrix $c$ . At every time step $t$ , a recurrent attention mechanism computes a weighting distribution over the context matrix $c$ to produce a weighted-sum reduction over $c$ , which is then passed through an LSTM-Conv decoder architecture to generate affine parameters for transforming $x _ { t + 1 } \to x _ { t + 1 } ^ { \prime }$ . As predicted parameters are always for the next time step, the first iteration is conditioned on a pre-defined 0-vector.
|
| 81 |
+
|
| 82 |
+
With an affine coupling layer, only the $\mathbf { \delta } _ { s _ { t } }$ term changes the volume of the mapping and adds a change of variables term to the loss. This term also penalizes the model for non-invertible affine mappings.
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\log | \operatorname* { d e t } ( J ( f _ { c o u p l i n g } ^ { - 1 } ( \pmb { x } ) ) ) | = \log | s |
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
To evaluate the likelihood, we take the mel-spectrograms and pass them through the inverse steps of flow conditioned on the text and optional speaker ids, adding the corresponding $\log | s |$ penalties, and evaluate the result based on the Gaussian likelihoods.
|
| 89 |
+
|
| 90 |
+
With this setup, it is also possible to reverse the ordering of the mel-spectrogram frames in time without loss of generality. We reverse the order of frames on even steps of flow, defining a step of flow as a full pass over the input sequence. This allows the model to learn dependencies both forward and backwards in time while remaining causal and invertible.
|
| 91 |
+
|
| 92 |
+
# 2.3 MODEL ARCHITECTURE
|
| 93 |
+
|
| 94 |
+
Our text encoder modifies the text encoder in Tacotron 2 by replacing batch-norm with instance-norm. Our decoder and $N N$ architecture, depicted in Figure 2, removes the Prenet and Postnet layers from Tacotron previously thought to be essential (Shen et al., 2017). Please compare Figure 2 describing our architecture and Figure 8 in A.4.4 describing Tacotron’s architecture. We also provide model summary views in A.6
|
| 95 |
+
|
| 96 |
+
We use the content-based tanh attention described in Vinyals et al. (2015), which can be easily modified to become also location sensitive. We use the Mel Encoder described in Hsu et al. (2018) to predict the parameters of the Gaussian Mixture. Following (Valle et al., 2019b), we use speakerembeddings channel-wise concatenated with the encoder outputs at every token. We use a single shared embedding for models not conditioned on speaker id.
|
| 97 |
+
|
| 98 |
+
The step of flow closest to the latent variable $_ { z }$ has a gating mechanism that prunes extra frames from the $_ z$ -values provided to the model during inference. The length of $_ z$ -values remains fixed on the next steps of flow.
|
| 99 |
+
|
| 100 |
+
# 2.4 INFERENCE
|
| 101 |
+
|
| 102 |
+
Inference, given a trained model, is simply a matter of sampling $_ z$ values from a spherical Gaussian, or Gaussian Mixture, and running them through the network in the forward direction $f$ , e.g. Eq. 1. The parameters of the Gaussian mixture are either fixed or predicted by Flowtron. Training was conducted with $\sigma ^ { 2 } = 1$ , but we explore the effects of different values for $\sigma ^ { \bar { 2 } }$ in section 3.3. In general, we found that sampling $_ z$ from a Gaussian with lower standard deviation than used during training resulted in better sounding mel-spectrograms, as similarly concluded in Kingma & Dhariwal (2018) and (Parmar et al., 2018). Our inference results use $\sigma ^ { \mathrm { 2 } } = 0 . 5$ while sampling the prior and the posterior variance while sampling the posterior.
|
| 103 |
+
|
| 104 |
+
# 2.5 POSTERIOR INFERENCE
|
| 105 |
+
|
| 106 |
+
Figure 1 shows that several speech characteristics present in mel-spectrograms are clustered into regions of the $_ z$ -space. Knowing this, we can treat the latent distribution as a prior $q ( z ) = \mathcal { N } ( 0 , I )$ and obtain a posterior over the latent space of the flow model $q ( z | \zeta _ { 1 : m } )$ conditioned on the evidence $\zeta _ { 1 : m }$ , which are $m$ data observations $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ mapped to the latent space using $\zeta _ { i } = f ^ { - 1 } ( { \pmb x } _ { i } )$ . We can use a Gaussian likelihood function with covariance matrix $\Sigma$ to compute the posterior above analytically, $q ( z | \boldsymbol { \zeta } _ { 1 : m } ) = \mathcal { N } ( \mu _ { p } , \boldsymbol { \Sigma } _ { p } )$ . Following the approach in Gambardella et al. (2019), defining $\bar { \zeta }$ as the mean of $\zeta _ { i }$ and using $\lambda$ as a hyperparameter, we define the parameters of the posterior below. Please see A.2, Algorithm 1 and Gambardella et al. (2019) for implementation details and a full derivation.
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\pmb { \mu } _ { p } = \frac { \frac { m } { \lambda } \bar { \zeta } } { \frac { m } { \lambda } + 1 } \quad \pmb { \Sigma } _ { p } = \frac { 1 } { \frac { m } { \lambda } + 1 } \pmb { I }
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
# 3 EXPERIMENTS
|
| 113 |
+
|
| 114 |
+
This section describes our training setup and provides quantitative and qualitative results. Our quantitative results show that Flowtron has mean opinion scores that are comparable to the state of the art. Our qualitative results demonstrate many features that are either impossible or inefficient to achieve using Tacotron, Tacotron 2 GST and Tacotron GM-VAE. These features include variation control in speech, interpolation between samples, and style transfer over time.
|
| 115 |
+
|
| 116 |
+
We decode all mel-spectrograms into waveforms with a WaveGlow (Prenger et al., 2019) model available on github (Valle et al., 2019a). This suggests that WaveGlow can be used as an universal decoder. In addition to our illustrated and quantitative results, we ask that the readers listen to Flowtron samples in our supplementary materials corresponding to our qualitative experiments.
|
| 117 |
+
|
| 118 |
+
# 3.1 TRAINING SETUP
|
| 119 |
+
|
| 120 |
+
We train Flowtron, Tacotron 2 and Tacotron 2 GST models using a dataset (LSH) that combines the LJSpeech dataset (Ito et al., 2017) with two proprietary single speaker datasets with 20 and 10 hours each (Sally and Helen). We also train a Flowtron model on the train-clean-100 subset of LibriTTS (Zen et al., 2019) with 123 speakers and 25 minutes on average per speaker. Speakers with less than 5 minutes of data and files that are larger than 10 seconds are filtered out. For each dataset, we use at least 180 samples for the validation set, and the remainder for the training set.
|
| 121 |
+
|
| 122 |
+
The models are trained on uniformly sampled normalized text and ARPAbet encodings obtained from the CMU Pronouncing Dictionary (Weide, 1998). We do not perform any data augmentation. We adapt public Tacotron 2 and Tacotron 2 GST repos to include speaker embeddings as described in Section 2. We use the same mel-spectrogram representation used in WaveGlow (Prenger et al., 2019). We train Flowtron with a pre-trained text encoder, progressively adding steps of flow once the last step of flow has learned to attend to text. Flowtron models used in our experiments have 2 steps of flow. We forward readers to A.3 and A.4 for details on our training setup and ablation studies.
|
| 123 |
+
|
| 124 |
+
# 3.2 MEAN OPINION SCORE (MOS) COMPARISON
|
| 125 |
+
|
| 126 |
+
We use the LJS voice as a reference and compare MOS between real samples, samples from Flowtron with 2 steps of flow, and samples from Tacotron 2. Following guidelines in (Prenger et al., 2019), we crowd-sourced MOS tests on Amazon Mechanical Turk using 30 volume normalized utterances disjoint from the training set for evaluation, and randomly chose the utterances for each subject. The scores provided in (Prenger et al., 2019) are used for real samples.
|
| 127 |
+
|
| 128 |
+
The mean opinion scores are shown in Table 1 with $9 5 \%$ confidence intervals computed over approximately 250 scores per source. The results roughly match our subjective qualitative assessment. The larger advantage of Flowtron is in the control over the amount of speech variation and the manipulation of the latent space.
|
| 129 |
+
|
| 130 |
+
Table 1: Mean Opinion Scores
|
| 131 |
+
|
| 132 |
+
<table><tr><td> Source</td><td>Flows</td><td>MOS</td></tr><tr><td>Real</td><td>1</td><td>4.27 ± 0.13</td></tr><tr><td>Flowtron</td><td>2</td><td>3.66 ± 0.16</td></tr><tr><td>Tacotron 2</td><td>1</td><td>3.52 ± 0.17</td></tr></table>
|
| 133 |
+
|
| 134 |
+
# 3.3 SAMPLING THE PRIOR
|
| 135 |
+
|
| 136 |
+
The simplest approach to generating samples with Flowtron is to sample from a prior distribution $z \sim \mathcal { N } ( 0 , \sigma ^ { 2 } )$ and adjust $\sigma ^ { 2 }$ to control the amount of variation. Whereas $\sigma ^ { 2 } = { \overset { \cdot } { 0 } }$ completely removes variation and produces outputs based on the model bias, increasing $\sigma ^ { 2 }$ will increase the amount of variation in speech.
|
| 137 |
+
|
| 138 |
+
# 3.3.1 SPEECH VARIATION
|
| 139 |
+
|
| 140 |
+
We illustrate the relationship between $\sigma ^ { 2 }$ and control over variability by synthesizing Flowtron samples with $\sigma ^ { 2 } \in \{ 0 . 0 , 0 . 5 , 1 . 0 \}$ . All samples are generated conditioned on the speaker Sally and the text “How much variation is there?". Despite the variability added by increasing $\sigma ^ { 2 }$ , all Flowtron-synthesized samples produce high quality speech.
|
| 141 |
+
|
| 142 |
+
Figure 3 shows that contrary to commonly held wisdom (Shen et al., 2017; Arik et al., 2017a;b; Ping et al., 2017; Skerry-Ryan et al., 2018; Wang et al., 2018; Binkowski et al., 2019), Flowtron generates ´ sharp harmonics and well resolved formants without a compound loss nor Prenet or Postnet layers.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 3: Flowtron Mel-spectrograms illustrate increasing variability by using different $\sigma ^ { 2 }$ and that Flowtron is able to produce sharp harmonics with high $\sigma ^ { \tilde { 2 } }$ and without Prenet or Postnet layers.
|
| 146 |
+
|
| 147 |
+
Now we show that adjusting $\sigma ^ { 2 }$ is a simple and valuable approach that provides more variation and control thereof than Tacotron, without sacrificing speech quality and despite of having a similar but simpler architecture. For this, we synthesize 10 samples with Tacotron 2 using different values for the Prenet dropout probability $p \in \{ 0 . 4 5 , 0 . 5 , 0 . 5 5 \}$ , scaling outputs accordingly. Samples computed on values of $p \in [ 0 . 3 , 0 . 8 ]$ are not included because they sound unintelligible.
|
| 148 |
+
|
| 149 |
+
Figure 4 provides plots of $F _ { 0 }$ contours extracted with the YIN algorithm (De Cheveigné & Kawahara, 2002), with minimum $F _ { 0 }$ , maximum $F _ { 0 }$ , and harmonicity threshold equal to $8 0 \mathrm { H z }$ , $4 0 0 \mathrm { H z }$ and 0.3 respectively. Our results are similar to the previous sample duration analysis. As expected, $\sigma ^ { 2 } = 0$ provides no variation in $F _ { 0 }$ contour1, while increasing $\sigma ^ { \bar { 2 } }$ will increase variation in $F _ { 0 }$ contours.
|
| 150 |
+
|
| 151 |
+
Our results in Figure 4 also show that Flowtron samples are considerably less monotonous than the samples produced with Tacotron 2 at no cost and with a similar but simpler architecture. Whereas increasing $\sigma ^ { 2 }$ considerably increases variation in $F _ { 0 }$ , modifying $p$ barely produces any variation. This is valuable because expressive speech is associated with non-monotonic $F _ { 0 }$ contours. In A.1 we show similar results with respect to sentence duration.
|
| 152 |
+
|
| 153 |
+
# 3.3.2 INTERPOLATION BETWEEN SAMPLES
|
| 154 |
+
|
| 155 |
+
With Flowtron, we can perform interpolation in $_ { z }$ -space to achieve interpolation in mel-spectrogram space. This experiment evaluates Flowtron models with and without speaker embeddings. For the experiment with speaker embeddings, we choose the speaker Sally and the phrase $^ { 6 6 } I t$ is well known that deep generative models have a rich latent space.". We generate mel-spectrograms by sampling $z \sim \mathcal { N } ( 0 , 0 . 8 )$ twice and interpolating between them over 100 timesteps. For the experiment without speaker embeddings we interpolate between Sally and Helen using the phrase “We are testing this model.".
|
| 156 |
+
|
| 157 |
+
First, we perform inference by sampling $z \sim \mathcal { N } ( 0 , 0 . 5 )$ until we find $_ z$ values, $_ { z _ { h } }$ and $z _ { s }$ , that produce mel-spectrograms with Helen’s and Sally’s voice respectively. We then generate samples by performing inference while linearly interpolating between $z _ { h }$ and $z _ { s }$ . Our same speaker interpolation samples show that Flowtron is able to interpolate between multiple samples while producing correct alignment maps. Our different speaker interpolation samples show that Flowtron is able to gradually and smoothly morph one voice into another.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 4: $F _ { 0 }$ contours obtained from samples generated by Flowtron and Tacotron 2 with different values for $\sigma ^ { 2 }$ and $p$ . Flowtron provides more variability and expressivity than Tacotron 2.
|
| 161 |
+
|
| 162 |
+
# 3.4 SAMPLING THE POSTERIOR (STYLE TRANSFER)
|
| 163 |
+
|
| 164 |
+
We generate samples with Flowtron by sampling a posterior distribution conditioned on the evidence containing speech characteristics of interest, as described in 2.5 and Gambardella et al. (2019). Tacotron 2 GST Wang et al. (2018) has an equivalent posterior sampling approach. During inference, the model is conditioned on a weighted sum of global style tokens (posterior) queried through an embedding of existing audio samples (evidence). We evaluate Tacotron 2 GST using a single sample to query a style token, or multiple samples to compute an average style token. For complete results, please refer to audio samples in the supplemental material corresponding to the following sections.
|
| 165 |
+
|
| 166 |
+
# 3.4.1 SEEN SPEAKER
|
| 167 |
+
|
| 168 |
+
In this section we run two style transfer experiments: the first one (Expressive) uses samples with high variance in pitch, which we use as a proxy for comparing expressivity in speech; the second (High Pitch), uses samples with high average pitch. In these experiments, we provide comparisons between Pitch Mean and Pitch Standard Deviation from the Reference samples providing the style, a Flowtron Baseline and after style transfer using Flowtron Posterior and Tacotron 2 GST.
|
| 169 |
+
|
| 170 |
+
Our experiments show that by sampling from the posterior or interpolating between the posterior and the Gaussian prior over time, Flowtron makes a monotonic speaker gradually sound more expressive. Architectures similar to Tacotron 2 GST with fixed-latent embeddings are not able to perform gradual changes in style over time. Table 2 provides pitch summary statistics computed over 5 phrases and 10 takes each and shows that Flowtron is overall closer to the reference providing the style than Tacotron 2 GST. Our supplemental materials also show that Tacotron 2 GST sentences are repetitive and contain vocal-fry like distortions.
|
| 171 |
+
|
| 172 |
+
<table><tr><td colspan="2"></td><td colspan="2">Pitch Mean</td><td colspan="3">Pitch Standard Deviation</td></tr><tr><td>Model</td><td>Style Expressive</td><td>High Pitch</td><td>Surprised</td><td>Expressive</td><td>High Pitch</td><td>Surprised</td></tr><tr><td>Reference</td><td>53.6</td><td>55.2</td><td>58.2</td><td>4.5</td><td>2.3</td><td>1.0</td></tr><tr><td>FTA Posterior</td><td>53.4</td><td>53.3</td><td>55.5</td><td>2.5</td><td>2.3</td><td>3.0</td></tr><tr><td>FTA Baseline</td><td>53.1</td><td>52.6</td><td>52.8</td><td>2.2</td><td>1.9</td><td>1.9</td></tr><tr><td>Tacotron 2 GST</td><td>51.7</td><td>53.6</td><td>51.6</td><td>2.0</td><td>2.4</td><td>1.7</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 2: Values closer to the Reference are better. Comparison between pitch (MIDI number) summary statistics from Reference providing the style, Flowtron with standard Gaussian prior (FTA Baseline) and samples after style transfer with Flowtron (FTA Posterior) and Tacotron 2 GST. Our results show that FTA Posterior is overall more effective than Tacotron 2 GST in emulating the Reference by better matching its pitch summary statistics.
|
| 175 |
+
|
| 176 |
+
# 3.4.2 SEEN SPEAKER WITH UNSEEN STYLE
|
| 177 |
+
|
| 178 |
+
We compare samples generated with Flowtron and Tacotron 2 GST to evaluate their ability to emulate a speaking style unseen during training of a speaker seen during training. While Sally’s data used during training consists of news article readings, the evaluation samples contain Sally’s interpretation of the somber and vampiresque novel, Born of Darkness (BOD).
|
| 179 |
+
|
| 180 |
+
Our samples show that while Tacotron 2 GST fails to emulate the somber timbre in Born of Darkness, Flowtron succeeds in transferring not only the somber timbre, but also the low $F _ { 0 }$ and the long pauses associated with the narrative style.
|
| 181 |
+
|
| 182 |
+
# 3.4.3 UNSEEN SPEAKER
|
| 183 |
+
|
| 184 |
+
In this experiment we compare Flowtron and Tacotron 2 GST samples to evaluate their ability to emulate the speaking style of a speaker not seen during training. The styles comes from speaker ID 24 and her “surprised" samples in RAVDESS (Livingstone & Russo, 2018), a dataset with emotion labels. Table 2 shows that while the samples generated with Tacotron 2 GST are not able to emulate the high-pitched style from RAVDESS, Flowtron is able to make Sally sound high-pitched as in the “surprised" style.
|
| 185 |
+
|
| 186 |
+
# 3.5 INTERPOLATION BETWEEN STYLES (PRIOR AND POSTERIOR)
|
| 187 |
+
|
| 188 |
+
In this experiment we illustrate how to control the speaking style at inference time by adjusting the parameter $\lambda$ in Equation 9 to interpolate between a baseline style (prior) and a target style (posterior). We use a model trained on LibriTTS and use a single sample from Sally’s (unseen speaker) Born of Darkness dataset as evidence providing the target style. We synthesize posterior samples generated with Flowtron with $\lambda \in \{ 0 . 1 , \bar { 0 } . 6 6 6 , \bar { 1 . 0 } , 2 . 0 \}$ . Figure 5 reflects the interpolation in style as interpolation in spectral profiles. Our supplemental materials aurally reflect a similar interpolation in other non-textual characteristics.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 5: Spectral profiles from the target style, from the Flowtron baseline generated using the prior, and from Flowtron samples generated using the posterior with different values for $\lambda$ . These images show that by decreasing the value of $\lambda$ we gradually move the spectral profile from the baseline style (prior) to the target style (posterior).
|
| 192 |
+
|
| 193 |
+
# 3.6 SAMPLING THE GAUSSIAN MIXTURE
|
| 194 |
+
|
| 195 |
+
In this last section we provide samples from Flowtron Gaussian Mixture (GM) and visualizations. We replicate the experiments in Tacotron GM-VAE (Hsu et al., 2018) to visualize how speakers are assigned to mixture components and provide samples in which we modulate speech characteristics by translating one of the dimensions of an individual mixture component.
|
| 196 |
+
|
| 197 |
+
For these experiments, Flowtron GM-LibriTTS is trained on LibriTTS without speaker embeddings and a Gaussian mixture with 8 component with predicted mean, covariance and component assignment probabilities; Flowtron GM-LSH is trained on LSH with speaker embeddings and a Gaussian Mixture with 8 components, fixed mean and covariances and predicted component assignment probabilities.
|
| 198 |
+
|
| 199 |
+
# 3.6.1 VISUALIZING ASSIGNMENTS
|
| 200 |
+
|
| 201 |
+
We evaluate model interpretability on a subset of LibriTTS with 123 speakers and 1410 utterances, 180 of which come from the validation set. Following Hsu et al. (2018), each utterance is assigned to the component with the highest posterior probability a $\cdot \mathrm { g } \operatorname* { m a x } _ { k } p ( \hat { \phi } _ { k } \mid \mathbf { x } )$ . We obtain posterior probabilities per utterance by using the Mel Encoder described in Section 2.3 and averaging the predicted component assignment probabilities over time. Figure 6 suggests that information in each component of Flowtron GM-LibriTTS is gender dependent.
|
| 202 |
+
|
| 203 |
+
e quant al. (201 the association between gender and mixture components with the The assignment consistency with respect to gender is defined as $\begin{array} { r } { \frac { 1 } { M } \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N _ { i } } \mathbb { 1 } y _ { i j } = } \end{array}$ $\hat { y } _ { i }$ $M$ is the component assignment of utterance $j$ from speaker $i$ , and ugge $\hat { y } _ { i }$ is the mode of ng that the co $\{ y _ { i j } \} _ { j = 1 } ^ { N _ { i } }$ . The assignment consistency in Flowtron GM-LibriTTS is group utterances by speaker and group speakers by gend $8 2 . 4 \%$ provide visualizations in Figure 6.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 6: Component assignments suggest that information in each component is gender dependent.
|
| 207 |
+
|
| 208 |
+
# 3.6.2 TRANSLATING DIMENSIONS
|
| 209 |
+
|
| 210 |
+
We use the model Flowtron GM-LSH and focus on translating one of the dimensions of a single mixture component by adding an offset. The samples in our supplementary material show that we are able to modulate specific speech characteristics like pitch and word duration. Although the samples generated by translating one the dimensions associated with pitch height have different pitch contours, they have the same duration. Similarly, our samples show that translating the dimension associated with length of the first word does not modulate the pitch of the first word. We provide visualizations in Figure 9 in A.5.
|
| 211 |
+
|
| 212 |
+
# 4 CONCLUSION
|
| 213 |
+
|
| 214 |
+
We propose a new text to mel-spectrogram synthesis model based on autoregressive flows that is optimized by maximizing the likelihood and allows for speech variation and style transfer. Our results show that samples generated with Flowtron achieve mean opinion scores similar to SOTA TTS models. We demonstrate that our model learns a latent space that stores non-textual information, supervised using only MLE. Flowtron is able to produce high quality speech with high variability by adjusting $\sigma ^ { 2 }$ .
|
| 215 |
+
|
| 216 |
+
Our results show that the latent space over non-textual features that can be investigated and manipulated to give the user more control over the generative model’s output. We provide many examples that showcase this, including transferring the style from speakers seen and unseen during training to another speaker using sentences with similar or different text, and making a monotonic speaker sound more expressive. For future work, we are interested in using normalizing flows for few-shot speech synthesis, speech compression and in semi-supervised settings to exploit datasets with limited labels.
|
| 217 |
+
|
| 218 |
+
# REFERENCES
|
| 219 |
+
|
| 220 |
+
Kei Akuzawa, Yusuke Iwasawa, and Yutaka Matsuo. Expressive speech synthesis via modeling expressions with variational autoencoder. arXiv preprint arXiv:1804.02135, 2018.
|
| 221 |
+
|
| 222 |
+
Sercan Arik, Mike Chrzanowski, Adam Coates, Gregory Diamos, Andrew Gibiansky, Yongguo Kang, Xian Li, John Miller, Andrew Ng, Jonathan Raiman, et al. Deep voice: Real-time neural text-to-speech. arXiv preprint arXiv:1702.07825, 2017a.
|
| 223 |
+
|
| 224 |
+
Sercan Arik, Gregory Diamos, Andrew Gibiansky, John Miller, Kainan Peng, Wei Ping, Jonathan Raiman, and Yanqi Zhou. Deep voice 2: Multi-speaker neural text-to-speech. arXiv preprint arXiv:1705.08947, 2017b.
|
| 225 |
+
|
| 226 |
+
John Badham, Lawrence Lasker, Walter F Parkes, Arthur B Rubinstein, Matthew Broderick, Dabney Coleman, and John Wood. Wargames, 1983.
|
| 227 |
+
|
| 228 |
+
Mikołaj Binkowski, Jeff Donahue, Sander Dieleman, Aidan Clark, Erich Elsen, Norman Casagrande, ´ Luis C Cobo, and Karen Simonyan. High fidelity speech synthesis with adversarial networks. arXiv preprint arXiv:1909.11646, 2019.
|
| 229 |
+
|
| 230 |
+
Alain De Cheveigné and Hideki Kawahara. Yin, a fundamental frequency estimator for speech and music. The Journal of the Acoustical Society of America, 111(4):1917–1930, 2002.
|
| 231 |
+
|
| 232 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 233 |
+
|
| 234 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
|
| 235 |
+
|
| 236 |
+
Andrew Gambardella, Atılım Güne¸s Baydin, and Philip HS Torr. Transflow learning: Repurposing flow models without retraining. arXiv preprint arXiv:1911.13270, 2019.
|
| 237 |
+
|
| 238 |
+
Raza Habib, Soroosh Mariooryad, Matt Shannon, Eric Battenberg, RJ Skerry-Ryan, Daisy Stanton, David Kao, and Tom Bagby. Semi-supervised generative modeling for controllable speech synthesis. arXiv preprint arXiv:1910.01709, 2019.
|
| 239 |
+
|
| 240 |
+
Wei-Ning Hsu, Yu Zhang, Ron J Weiss, Heiga Zen, Yonghui Wu, Yuxuan Wang, Yuan Cao, Ye Jia, Zhifeng Chen, Jonathan Shen, et al. Hierarchical generative modeling for controllable speech synthesis. arXiv preprint arXiv:1810.07217, 2018.
|
| 241 |
+
|
| 242 |
+
Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. arXiv preprint arXiv:1804.00779, 2018.
|
| 243 |
+
|
| 244 |
+
Keith Ito et al. The LJ speech dataset, 2017.
|
| 245 |
+
|
| 246 |
+
Pavel Izmailov, Polina Kirichenko, Marc Finzi, and Andrew Gordon Wilson. Semi-supervised learning with normalizing flows. arXiv preprint arXiv:1912.13025, 2019.
|
| 247 |
+
|
| 248 |
+
Jaehyeon Kim, Sungwon Kim, Jungil Kong, and Sungroh Yoon. Glow-tts: A generative flow for text-to-speech via monotonic alignment search. arXiv preprint arXiv:2005.11129, 2020.
|
| 249 |
+
|
| 250 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 251 |
+
|
| 252 |
+
Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. arXiv preprint arXiv:1807.03039, 2018.
|
| 253 |
+
|
| 254 |
+
Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pp. 4743–4751, 2016.
|
| 255 |
+
|
| 256 |
+
Steven R Livingstone and Frank A Russo. The ryerson audio-visual database of emotional speech and song (ravdess): A dynamic, multimodal set of facial and vocal expressions in north american english. PloS one, 13(5), 2018.
|
| 257 |
+
|
| 258 |
+
Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are gans created equal? a large-scale study. In Advances in neural information processing systems, pp. 700–709, 2018.
|
| 259 |
+
|
| 260 |
+
C. Miao, S. Liang, M. Chen, J. Ma, S. Wang, and J. Xiao. Flow-tts: A non-autoregressive network for text to speech based on flow. In ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 7209–7213, 2020.
|
| 261 |
+
|
| 262 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
|
| 263 |
+
|
| 264 |
+
Wei Ping, Kainan Peng, Andrew Gibiansky, Sercan Arik, Ajay Kannan, Sharan Narang, Jonathan Raiman, and John Miller. Deep voice 3: 2000-speaker neural text-to-speech. arXiv preprint arXiv:1710.07654, 2017.
|
| 265 |
+
|
| 266 |
+
Ryan Prenger, Rafael Valle, and Bryan Catanzaro. Waveglow: A flow-based generative network for speech synthesis. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3617–3621. IEEE, 2019.
|
| 267 |
+
|
| 268 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 269 |
+
|
| 270 |
+
Jonathan Shen, Ruoming Pang, Ron J Weiss, Mike Schuster, Navdeep Jaitly, Zongheng Yang, Zhifeng Chen, Yu Zhang, Yuxuan Wang, RJ Skerry-Ryan, et al. Natural tts synthesis by conditioning wavenet on mel spectrogram predictions. arXiv preprint arXiv:1712.05884, 2017.
|
| 271 |
+
|
| 272 |
+
Robert H Shumway and David S Stoffer. Time series analysis and its applications: with R examples. Springer, 2017.
|
| 273 |
+
|
| 274 |
+
RJ Skerry-Ryan, Eric Battenberg, Ying Xiao, Yuxuan Wang, Daisy Stanton, Joel Shor, Ron J Weiss, Rob Clark, and Rif A Saurous. Towards end-to-end prosody transfer for expressive speech synthesis with tacotron. arXiv preprint arXiv:1803.09047, 2018.
|
| 275 |
+
|
| 276 |
+
Guangzhi Sun, Yu Zhang, Ron J Weiss, Yuan Cao, Heiga Zen, and Yonghui Wu. Fully-hierarchical fine-grained prosody modeling for interpretable speech synthesis. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6264–6268. IEEE, 2020.
|
| 277 |
+
|
| 278 |
+
Noriko Umeda, E Matsui, Torazo Suzuki, and Hiroshi Omura. Synthesis of fairy tales using an analog vocal tract. In Proceedings of 6th International Congress on Acoustics, pp. B159–162, 1968.
|
| 279 |
+
|
| 280 |
+
Rafael Valle, Jason Li, Ryan Prenger, and Bryan Catanzaro. Mellotron github repo, 2019a. URL https://github.com/NVIDIA/mellotron.
|
| 281 |
+
|
| 282 |
+
Rafael Valle, Jason Li, Ryan Prenger, and Bryan Catanzaro. Mellotron: Multispeaker expressive voice synthesis by conditioning on rhythm, pitch and global style tokens. arXiv preprint arXiv:1910.11997, 2019b.
|
| 283 |
+
|
| 284 |
+
Oriol Vinyals, Łukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In Advances in neural information processing systems, pp. 2773–2781, 2015.
|
| 285 |
+
|
| 286 |
+
Yuxuan Wang, RJ Skerry-Ryan, Daisy Stanton, Yonghui Wu, Ron J Weiss, Navdeep Jaitly, Zongheng Yang, Ying Xiao, Zhifeng Chen, Samy Bengio, et al. Tacotron: A fully end-to-end text-to-speech synthesis model. arXiv preprint arXiv:1703.10135, 2017.
|
| 287 |
+
|
| 288 |
+
Yuxuan Wang, Daisy Stanton, Yu Zhang, RJ Skerry-Ryan, Eric Battenberg, Joel Shor, Ying Xiao, Fei Ren, Ye Jia, and Rif A Saurous. Style tokens: Unsupervised style modeling, control and transfer in end-to-end speech synthesis. arXiv preprint arXiv:1803.09017, 2018.
|
| 289 |
+
|
| 290 |
+
Robert L Weide. The CMU pronouncing dictionary. URL: http://www.speech.cs.cmu.edu/cgibin/cmudict, 1998.
|
| 291 |
+
|
| 292 |
+
Heiga Zen, Viet Dang, Rob Clark, Yu Zhang, Ron J Weiss, Ye Jia, Zhifeng Chen, and Yonghui Wu. Libritts: A corpus derived from librispeech for text-to-speech. arXiv preprint arXiv:1904.02882, 2019.
|
| 293 |
+
|
| 294 |
+
# A APPENDIX
|
| 295 |
+
|
| 296 |
+
# A.1 SPEECH VARIATION
|
| 297 |
+
|
| 298 |
+
Figure 7 provides plots from sample durations in seconds. Our results show that larger values of $\sigma ^ { 2 }$ produces samples with more variation in duration, whereas $\sigma ^ { 2 } = 0$ is fully deterministic. These results demonstrate that our latent space is able to model duration, which is a critical non-textual component to expressiveness in speech.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 7: Sample duration given $\sigma ^ { 2 }$ and $p$ show that Flowtron provides more variation in sample duration than Tacotron.
|
| 302 |
+
|
| 303 |
+
# A.2 POSTERIOR INFERENCE
|
| 304 |
+
|
| 305 |
+
We generate posterior samples with Flowtron by sampling a posterior distribution conditioned on evidence containing speech characteristics of interest, as described in (Gambardella et al., 2019). We collect the evidence by performing a forward pass with Flowtron using with a speaker embedding, $( s \sim \mathcal { N } ( 0 , I ) )$ , the observed mel-spectrogram, and the text from a set of samples with the speech characteristics of interest. We use a specific speaker embedding when we want to factor out information about a specific speaker from $\zeta$ .
|
| 306 |
+
|
| 307 |
+
Next, we compute $\bar { \zeta }$ by averaging $\zeta _ { i , k }$ over batch $( i )$ or over batch and time $( i , k )$ and use Equation 9 to compute the parameters of the posterior. When averaging over batch, we repeat the $\mathbf { Z }$ -values over the time dimension until they reach the desired length. We find in our experiments that averaging over batch is more efficient for transfering the style than averaging over batch and time. In all experiments, we select the best performing samples given $\lambda$ values between $m * 0 . 1$ and $m * 4$ , where $m$ is the number of samples in the evidence. While small $\lambda$ values move the mean of the posterior closer to the evidence and decreases its variance, large $\lambda$ values move the mean of the posterior closer to the prior and increase the variance.
|
| 308 |
+
|
| 309 |
+
Once the parameters of the posterior distribution are computed, we can sample the posterior distribution and perform inference with the desired text and speaker. Algorithm 1 provides a description of posterior inference with Flowtron.
|
| 310 |
+
|
| 311 |
+
# A.3 TRAINING DETAILS
|
| 312 |
+
|
| 313 |
+
We use the ADAM (Kingma & Ba, 2014) optimizer with default parameters, 1e-4 learning rate and1e-6 weight decay for Flowtron and 1e-3 learning rate and 1e-5 weight decay for the other models,following Wang et al. (2017). We anneal the learning rate once the generalization error starts toplateau and stop training once the the generalization error stops significantly decreasing or startsincreasing. Flowtron models with 2 steps of flow were trained on the LSH dataset for approximately1000 epochs, then fine-tuned on LibriTTS for 500 epochs. Tacotron 2 and Tacotron 2 GST are trained for approximately 500 epochs. Each model is trained on a single NVIDIA DGX-1 with 8 GPUs.
|
| 314 |
+
|
| 315 |
+
Algorithm 1: Flowtron Posterior inference
|
| 316 |
+
|
| 317 |
+
Input : Trained Flowtron model $f$ , evidence audio samples ${ \boldsymbol { \mathbf { \mathit { x } } } } _ { 1 : m }$ Output : Posterior sample
|
| 318 |
+
|
| 319 |
+
1 For each $m e l _ { i , k } , t e x t _ { i }$ , speakeri ∈ x1:m
|
| 320 |
+
|
| 321 |
+
2 if average over batch then
|
| 322 |
+
|
| 323 |
+
3 repeat each $\zeta _ { k }$ over the time dimension until target length is achieve
|
| 324 |
+
4 $\bar { \zeta _ { k } } \gets \mathrm { C o m p u }$ te $\zeta _ { i , k }$ average over batch $k$
|
| 325 |
+
5 else
|
| 326 |
+
6 ¯ζ ← Compute $\zeta _ { i , k }$ average over batch and time $k$
|
| 327 |
+
7 end
|
| 328 |
+
8 $\mu _ { p }$ , $\Sigma _ { p } $ Compute posterior parameters using Equation 9
|
| 329 |
+
9 Initialize $\boldsymbol { Z } _ { p } \sim \mathcal { N } ( \pmb { \mu } _ { p } , \pmb { \Sigma } _ { p } )$
|
| 330 |
+
10 Sample $z _ { p }$ from $Z _ { p }$
|
| 331 |
+
11 Perform inference with Flowtron using $z _ { p }$ , text and speaker
|
| 332 |
+
|
| 333 |
+
# A.4 ABLATION STUDIES
|
| 334 |
+
|
| 335 |
+
# A.4.1 COMPOSING FLOWS
|
| 336 |
+
|
| 337 |
+
We evaluated Flowtron models with 2, 3 and 6 steps of flow and found that more steps of flow have better likelihood but no significant qualitative improvement, while increasing inference time significantly. Hence, we chose to report results on Flowtron models with 2 steps of flow.
|
| 338 |
+
|
| 339 |
+
# A.4.2 BIDIRECTIONAL PROCESSING
|
| 340 |
+
|
| 341 |
+
We compared the bidirectional (reversing the ordering of the mel-spectrogram frames in time on even numbered steps of flows) and unidirectional processing and found that bidirectional processing provides better likelihood and audio quality. Hence, we use bidirectional processing in all our Flowtron models.
|
| 342 |
+
|
| 343 |
+
# A.4.3 ADDITIVE VS AFFINE TRANSFORMATIONS
|
| 344 |
+
|
| 345 |
+
The Tacotron 2 baseline without the postnet layer can be interpreted as additive single step autoregressive normalizing flow (ASSANF). By comparing Flowtron with Tacotron 2, we’re comparing with a model that is better than an (ASSANF), as Tacotron 2 sans Postnet does not have sharp harmonics. Hence, we prefer affine over additive transformations.
|
| 346 |
+
|
| 347 |
+
# A.4.4 COMPARISON WITH TACOTRON 2
|
| 348 |
+
|
| 349 |
+
The Tacotron 2 baseline without the postnet layer can be interpreted as additive single step autoregressive normalizing flow (ASSANF). By comparing Flowtron with Tacotron 2, we’re comparing with a model that is better than an (ASSANF), as Tacotron 2 sans Postnet does not have sharp harmonics. Hence, we prefer affine over additive transformations.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 8: Visualization of the decoder in Tacotron 2 during training. Unlike Flowtron, Tacotron 2 requires Prenet and Postnet layers to learn attention and produce sharp harmonics.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 9: (a) shows that by translating one of the dimensions of $_ z$ we are able to alter the pitch contour of the sentence while keeping the length fixed. (b) shows that by translation one of the dimensions of $_ z$ we are able to alter the length of the sentence while keeping a similar pitch contour.
|
| 356 |
+
|
| 357 |
+
# A.6 FLOWTRON AND TACOTRON SUMMARY VIEW
|
| 358 |
+
|
| 359 |
+
Flowtron( (speaker_embedding): Embedding(3, 128) (embedding): Embedding(185, 512) (flows): ModuleList( (0): AR_Step( (conv): Conv1d(1024, 160, kernel_size $=$ (1,), stride $=$ (1,)) (lstm): LSTM(1664, 1024, num_layers $^ { = 2 }$ ) (attention_lstm): LSTM(80, 1024) (attention_layer): Attention( (softmax): Softmax(dim $^ { = 2 }$ ) (query): LinearNorm( (linear_layer): Linear(in_features=1024, out_features $= 6 4 0$ , bias=False) ) (key): LinearNorm( (linear_layer): Linear(in_features $= 6 4 0$ , out_feature $_ { 3 } = 6 4 0$ , bias $\mathbf { \tau } = \dot { }$ False) ) (value): LinearNorm( (linear_layer): Linear(in_features $= 6 4 0$ , out_feature $\mathord { : } = 6 4 0$ , bias=False) ) (v): LinearNorm( (linear_layer): Linear(in_features $= 6 4 0$ , out_features $: = 1$ , bias=False) ) ) (dense_layer): DenseLayer( (layers): ModuleList( (0): LinearNorm( (linear_layer): Linear(in_features=1024, out_features=1024, bias=True) ) (1): LinearNorm( (linear_layer): Linear(in_feature $\mathord { \mathrm { 3 } } = 1 0 2 4$ , out_features $_ { \mathrm { : = 1 0 2 4 } }$ , bias $= "$ True) )
|
| 360 |
+
|
| 361 |
+
(1): AR_Back_Step( (ar_step): AR_Step( (conv): Conv1d(1024, 160, kernel_size $=$ (1,), stride $=$ (1,)) (lstm): LSTM(1664, 1024, num_layers $^ { = 2 }$ ) (attention_lstm): LSTM(80, 1024) (attention_layer): Attention( (softmax): Softmax(dim $^ { = 2 }$ ) (query): LinearNorm( (linear_layer): Linear(in_feature $\mathord { \mathrm { 3 } } = 1 0 2 4$ , out_feature $\mathtt { s } = 6 4 0$ , bias $=$ False) ) (key): LinearNorm( (linear_layer): Linear(in_feature $\mathord { : } = 6 4 0$ , out_features $= 6 4 0$ , bias ${ } = \mathbb { E }$ alse) (value): LinearNorm( (linear_layer): Linear(in_features $_ { : = 6 4 0 }$ , out_features $= 6 4 0$ , bias=False) ) (v): LinearNorm( (linear_layer): Linear(in_features $_ { : = 6 4 0 }$ , out_features $^ { = 1 }$ , bias $=$ False) ) ) (dense_layer): DenseLayer( (layers): ModuleList( (0): LinearNorm( (linear_layer): Linear(in_features $\mathbf { \Psi } = \mathbf { \dot { \Psi } }$ 1024, out_features $\mathbf { \Psi } = \mathbf { \dot { \Psi } }$ 1024, bias ${ } , = { }$ True) ) (1): LinearNorm( (linear_layer): Linear(in_features $= 1$ 1024, out_features $=$ 1024, bias $=$ True) ) (gate_layer): LinearNorm( (linear_layer): Linear(in_features $^ { = 1 }$ 664, out_features $^ { = 1 }$ , bias $= "$ True) )
|
| 362 |
+
)
|
| 363 |
+
(encoder): Encoder( (convolutions): ModuleList( (0): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding=(2,)) ) (1): InstanceNorm1d(512, eps=1e-05, momentum=0.1, affine $=$ True, track_running_ )
|
| 364 |
+
|
| 365 |
+
(1): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding=(2,)) ) (1): InstanceNorm1d(512, ep $\mathrm { 3 } { = } 1 \mathrm { e } { - } 0 5$ , momentum $\ i { = } 0 \cdot 1$ , affine $= ^ { \prime }$ True, track_running_stats=False) ) (2): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding=(2,)) ) (1): InstanceNorm1d(512, eps $=$ 1e-05, momentum $\ i { = } 0 \cdot 1$ , affine $=$ True, track_running_stats=False) ) ) (lstm): LSTM(512, 256, batch_first $= "$ True, bidirectional $=$ True) ) )
|
| 366 |
+
|
| 367 |
+
acotron2(
|
| 368 |
+
(embedding): Embedding(185, 512)
|
| 369 |
+
(encoder): Encoder( (convolutions): ModuleList( (0): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $: =$ (5,), stride $=$ (1,), padding=(2,)) ) (1): BatchNorm1d(512, ep $\mathtt { s } = 1 \mathtt { e } - 0 5$ , momentum $\iota { = } 0 \cdot 1$ , affine $=$ True, track_running_stat $s =$ True) ) (1): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding ${ } = { }$ (2,)) ) (1): BatchNorm1d(512, ep $\mathsf { s } { = } 1 \mathsf { e } { - } 0 5$ , momentum $\iota { = } 0 \cdot 1$ , affine $: =$ True, track_running_stat ${ \mathfrak { s } } =$ True) ) (2): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding=(2,)) ) (1): BatchNorm1d(512, eps $=$ 1e-05, momentum $\iota { = } 0 \cdot 1$ , affine $: =$ True, track_running_stats $; =$ True) ) ) (lstm): LSTM(512, 256, batch_first $=$ True, bidirectional ${ } = { }$ True)
|
| 370 |
+
)
|
| 371 |
+
(decoder): Decoder( (prenet): Prenet( (layers): ModuleList( (0): LinearNorm( (linear_layer): Linear(in_features $= 8 0$ , out_feature $_ { 5 } = 2 5 6$ , bias $=$ False) ) (1): LinearNorm( (linear_layer): Linear(in_features=256, out_features=256, bias=False) ) ) (attention_rnn): LSTMCell(896, 1024) (attention_layer): Attention( (query_layer): LinearNorm( (linear_layer): Linear(in_features=1024, out_features=128, bias=False) ) (memory_layer): LinearNorm( (linear_layer): Linear(in_feature $\mathord { 5 } = 6 4 0$ , out_features $^ { - 1 2 8 }$ , bias $\fallingdotseq$ False) ) (v): LinearNorm( (linear_layer): Linear(in_feature $\mathord { \left. \mathrm { = } \right.} 1 2 8 $ , out_features $^ { = 1 }$ , bias=False) ) (location_layer): LocationLayer( (location_conv): ConvNorm( (conv): Conv1d(2, 32, kernel_size $=$ (31,), stride $\mathbf { \Omega } : = \left( \mathbb { 1 } , \right)$ , padding $=$ (15,), bia $: =$ False) ) (location_dense): LinearNorm( (linear_layer): Linear(in_features $= 3 2$ , out_features $= 1 2 8$ , bias $=$ False) ) ) (decoder_rnn): LSTMCell(1664, 1024, bias $^ { = 1 }$ ) (linear_projection): LinearNorm( (linear_layer): Linear(in_features $^ { = 1 }$ 664, out_features ${ \mathfrak { s } } = 8 0$ , bias $= "$ True) ) (gate_layer): LinearNorm( (linear_layer): Linear(in_features=1664, out_features $^ { = 1 }$ , bias=True) )
|
| 372 |
+
)
|
| 373 |
+
(postnet): Postnet( (convolutions): ModuleList( (0): Sequential( (0): ConvNorm( (conv): Conv1d(80, 512, kernel_size $=$ (5,), stride $=$ (1,), padding $=$ (2,)) ) (1): BatchNorm1d(512, eps=1e-05, momentum $= 0 \cdot 1$ , affine $=$ wTrue, track_running_stats $= ^ { \prime }$ True) ) (1): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $: =$ (5,), stride $=$ (1,), padding $\bf \tilde { \tau } =$ (2,)) ) (1): BatchNorm1d(512, eps $= 1 \mathrm { e } - 0 5$ , momentum $\iota { = } 0 \cdot 1$ , affine $=$ True, track_running_stat $\bar { \mathsf { z } } = \mathsf { ^ { \prime } }$ True) ) (2): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding ${ } = { }$ (2,)) ) (1): BatchNorm1d(512, ep $\mathtt { s } = 1 \mathtt { e } - 0 5$ , momentum $\iota { = } 0 \cdot 1$ , affine $: =$ True, track_running_stat ${ \tt S } =$ True) ) (3): Sequential( (0): ConvNorm( (conv): Conv1d(512, 512, kernel_size $=$ (5,), stride $=$ (1,), padding=(2,)) ) (1): BatchNorm1d(512, eps $=$ 1e-05, momentum $\iota { = } 0 \cdot 1$ , affine $: =$ True, track_running_stat $s =$ True) ) (4): Sequential( (0): ConvNorm( (conv): Conv1d(512, 80, kernel_size $=$ (5,), stride $=$ (1,), padding $=$ (2,)) ) (1): BatchNorm1d(80, eps=1e-05, momentum $\mathord { \mathrm { 1 } } = 0 \cdot 1$ , affine $=$ True, track_running_stats $=$ True) )
|
| 374 |
+
(speaker_embedding): Embedding(3, 128)
|
md/train/QpU7n-6l0n/QpU7n-6l0n.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE CONSISTENCY LOSS FOR LEVERAGING AUGMENTED DATA TO LEARN ROBUST AND INVARIANT REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Data augmentation is one of the most popular techniques for improving the robustness of neural networks. In addition to directly training the model with original samples and augmented samples, a torrent of methods regularizing the distance between embeddings/representations of the original samples and their augmented counterparts have been introduced. In this paper, we explore these various regularization choices, seeking to provide a general understanding of how we should regularize the embeddings. Our analysis suggests the ideal choices of regularization correspond to various assumptions. With an invariance test, we argue that regularization is important if the model is to be used in a broader context than accuracy-driven setting because non-regularized approaches are limited in learning the concept of invariance, despite equally high accuracy. Finally, we also show that the generic approach we identified (squared $\ell _ { 2 }$ norm regularized augmentation) outperforms several recent methods, which are each specially designed for one task and significantly more complicated than ours, over three different tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent advances in deep learning has delivered remarkable empirical performance over i.i.d test data, and the community continues to investigate the more challenging and realistic scenario when models are tested in robustness over non-i.i.d data (e.g., Ben-David et al., 2010; Szegedy et al., $\boxed { 2 0 1 3 }$ . Recent studies suggest that one cause of the fragility is the model’s tendency in capturing undesired signals $( \overline { { \mathbb { W } \mathrm { a n g ~ e t ~ a l . } } } ) \textcircled { 2 0 2 0 } )$ , thus combating this tendency may be a key to robust models.
|
| 12 |
+
|
| 13 |
+
To help models ignore the undesired signals, data augmentation (i.e., diluting the undesired signals of training samples by applying transformations to existing examples) is often used. Given its widely usage, we seek to answer the question: how should we train with augmented samples so that the assistance of augmentation can be taken to the fullest extent to learn robust and invariant models?
|
| 14 |
+
|
| 15 |
+
In this paper, We analyze the generalization behaviors of models trained with augmented data and associated regularization techniques. We investigate a set of assumptions and compare the worstcase expected risk over unseen data when i.i.d samples are allowed to be transformed according to a function belonging to a family. We bound the expected risk with terms that can be computed during training, so that our analysis can inspire how to regularize the training procedure. While all the derived methods have an upper bound of the expected risk, with progressively stronger assumptions, we have progressively simpler regularization, allowing practical choices to be made according to the understanding of the application. Our contributions of this paper are as follows:
|
| 16 |
+
|
| 17 |
+
• We offer analyses of the generalization behaviors of augmented models trained with different regularizations: these regularizations require progressively stronger assumptions of the data and the augmentation functions, but progressively less computational efforts. For example, with assumptions pertaining to augmentation transformation functions, the Wasserstein distance over the original and augmented empirical distributions can be calculated through simple $\ell _ { 1 }$ norm distance. • We test and compare these methods and offer practical guidance on how to choose regularizations in practice. In short, regularizing the squared $\ell _ { 2 }$ distance of logits between the augmented samples and original samples is a favorable method, suggested by both theoretical and empirical evidence.
|
| 18 |
+
|
| 19 |
+
• With an invariance test, we argue that vanilla augmentation does not utilize the augmented samples to the fullest extent, especially in learning invariant representations, thus may not be ideal unless the only goal of augmentation is to improve the accuracy over a specific setting.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK & KEY DIFFERENCES
|
| 22 |
+
|
| 23 |
+
Data augmentation has been used effectively for years. Tracing back to the earliest convolutional neural networks, we notice that even the LeNet applied on MNIST dataset has been boosted by mixing the distorted images to the original ones $\mathrm { ( \mathbb { L } e C u n \ e t \ a l . ) } \ \mathrm { [ 9 9 8 ] ) }$ . Later, the rapidly growing machine learning community has seen a proliferate development of data augmentation techniques (e.g., flipping, rotation, blurring etc.) that have helped models climb the ladder of the state-of-theart (one may refer to relevant survey (Shorten & Khoshgoftaar, 2019) for details). Recent advances expanded the conventional concept of data augmentation and invented several new approaches, such as leveraging the information in unlabelled data (Xie et al., 2019), automatically learning augmentation functions (Ho et al., 2019; Hu et al., 2019; Wang et al., 2019c; Zhang et al., 2020; Zoph et al., $\boxed { 2 0 1 9 }$ , and generating the samples (with constraint) that maximize the training loss along training (Fawzi et al., 2016), which is later widely accepted as adversarial training (Madry et al., 2018).
|
| 24 |
+
|
| 25 |
+
While the above works mainly discuss how to generate the augmented samples, in this paper, we mainly answer the question about how to train the models with augmented samples. For example, instead of directly mixing augmented samples with the original samples, one can consider regularizing the representations (or outputs) of original samples and augmented samples to be close under a distance metric (also known as a consistency loss). Many concrete ideas have been explored in different contexts. For example, $\ell _ { 2 }$ distance and cosine similarities between internal representations in speech recognition (Liang et al., 2018), squared $\ell _ { 2 }$ distance between logits (Kannan et al., 2018) , or KL divergence between softmax outputs $( \mathbb { Z } \mathrm { h a n g ~ e t ~ a l . } ) , \underline { 2 0 1 9 \mathrm { a } } )$ in adversarially robust vision models, Jensen–Shannon divergence (of three distributions) between embeddings for texture invariant image classification (Hendrycks et al., $\boxed { 2 0 2 0 }$ . These are but a few highlights of the concrete and successful implementations for different applications out of a huge collection (e.g., (Wu et al., 2019; Guo et al., 2019; Zhang et al., 2019b; Shah et al., 2019; Asai & Hajishirzi, $\boxed { 2 0 2 0 } ;$ Sajjadi et al., 2016; Zheng et al., 2016; Xie et al., 2015)), and one can easily imagine methods permuting these three elements (distance metrics, representation or outputs, and applications) to be invented. Even further, although we are not aware of the following methods in the context of data augmentation, given the popularity of GAN $\left( \overline { { \mathrm { G o o d f e l l o w } } } , \overline { { \mathrm { 2 0 1 6 } } } \right)$ and domain adversarial neural network $\mathrm { ( } \mathrm { G a n i n ~ e t ~ a l . , } \mathrm { ) } \mathrm { . } \mathrm { \overline { { 2 0 1 6 } } \mathrm { ) } }$ , one can also expect the distance metric generalizes to a specialized discriminator (i.e. a classifier), which can be intuitively understood as a calculated (usually maximized) distance measure, Wasserstein-1 metric as an example (Arjovsky et al., 2017; Gulrajani et al., 2017)
|
| 26 |
+
|
| 27 |
+
Key Differences: With this rich collection of regularizing choices, which one method should we consider in general? More importantly, do we actually need the regularization at all? These questions are important for multiple reasons, especially considering that there are paper suggesting that these regularizations may lead to worse results $( \overbrace { \mathrm { J e o n g ~ e t ~ a l . } } ^ { \bullet } ) \widetilde { \mathbb { Z } \mathrm { 0 1 9 } } )$ . In this paper, we answer the first question with a proved upper bound of the worst case generalization error, and our upper bound explicitly describes what regularizations are needed. For the second question, we will show that regularizations can help the model to learn the concept of invariance.
|
| 28 |
+
|
| 29 |
+
There are also several previous discussions regarding the detailed understandings of data augmentation (Yang et al., 2019; Chen et al., 2019; Hernandez-Garc ´ ´ıa & Konig, 2018; Rajput et al., 2019; ¨ $\boxed { \mathrm { D a o e t ~ a l . } , \boxed { 2 0 1 9 } }$ , among which, $\overline { { \mathbb { Y } \mathrm { a n g ~ e t ~ a l . } \mathrm { | } \mathrm { \mathscr { L } 0 1 9 | } } }$ is probably the most relevant as it also defends the usage of regularizations. However, we believe our discussions are more comprehensive and supported theoretically, since our analysis directly suggests the ideal regularization. Also, empirically, we design an invariance test in addition to the worst-case accuracy used in the preceding work.
|
| 30 |
+
|
| 31 |
+
# 3 TRAINING STRATEGIES WITH AUGMENTED DATA
|
| 32 |
+
|
| 33 |
+
Notations $( \mathbf { X } , \mathbf { Y } )$ denotes the data, where $\mathbf { X } \in \mathcal { R } ^ { n \times p }$ and $\mathbf { Y } \in \{ 0 , 1 \} ^ { n \times k }$ (one-hot vectors for $k$ classes), and $f ( \cdot , \theta )$ denotes the model, which takes in the data and outputs the softmax (probabilities of the prediction) and $\theta$ denotes the corresponding parameters. $g ( \ u )$ completes the prediction (i.e., mapping softmax to one-hot prediction). $l ( \cdot , \cdot )$ denotes a generic loss function. $\overset { \cdot } { a } ( \cdot )$ denotes a transformation that alters the undesired signals of a sample, i.e., the data augmentation method. $a \in { \mathcal { A } }$ , which is the set of transformation functions. $\mathcal { P }$ denotes the distribution of $\displaystyle ( \mathbf { x } , \mathbf { y } )$ . For any sampled $\displaystyle ( \mathbf { x } , \mathbf { y } )$ , we can have $( a ( \mathbf { x } ) , \mathbf { y } )$ , and we use $\mathcal { P } _ { a }$ to denote the distribution of these transformed samples. $r ( \cdot ; \theta )$ denotes the risk of model $\theta . { \widehat { \cdot } }$ denotes the estimated term $\cdot$ .
|
| 34 |
+
|
| 35 |
+
# 3.1 WELL-BEHAVED DATA TRANSFORMATION FUNCTION
|
| 36 |
+
|
| 37 |
+
Despite the strong empirical performance data augmentation has demonstrated, it should be intuitively expected that the performance can only be improved when the augmentation is chosen wisely. Therefore, before we proceed to analyze the behaviors of training with data augmentations, we need first regulate some basic properties of the data transformation functions used. Intuitively, we will consider the following three properties.
|
| 38 |
+
|
| 39 |
+
• “Dependence-preservation” with two perspectives: Label-wise, the transformation cannot alter the label of the data, which is a central requirement of almost all the data augmentation practice. Feature-wise, the transformation will not introduce new dependencies between the samples. • “Efficiency”: the augmentation should only generate new samples of the same label as minor perturbations of the original one. If a transformation violates this property, there should exist other simpler transformations that can generate the same target sample. • “Vertices”: There are extreme cases of the transformations. For example, if one needs the model to be invariant to rotations from $0 ^ { \circ }$ to $6 0 ^ { \circ }$ , we consider the vertices to be $0 ^ { \circ }$ rotation function (thus identity map) and $6 0 ^ { \circ }$ rotation function. In practice, one usually selects the transformation vertices with intuitions and domain knowledge.
|
| 40 |
+
|
| 41 |
+
We now formally define these three properties. The definition will depend on the model, thus these properties are not only regulating the transformation functions, but also the model. We introduce the Assumptions A1-A3 corresponding to the properties.
|
| 42 |
+
|
| 43 |
+
A1: Dependence-preservation: the transformation function will not alter the dependency regarding the label (i.e., for any $a ( ) \in { \mathcal { A } }$ , $a ( \mathbf { x } )$ will have the same label as $\mathbf { x }$ ) or the features (i.e., for any $a _ { 1 } ( \ l ) , a _ { 2 } ( \ l ) \in \mathcal { A } , a _ { 1 } ( \mathbf { x } _ { 1 } ) \ \perp \ l \ a _ { 1 } ( \mathbf { x } _ { 2 } )$ for any $\mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } \in \mathbf { X }$ that $\mathbf { x } _ { 1 } \neq \mathbf { x } _ { 2 }$ ).
|
| 44 |
+
|
| 45 |
+
A2: Efficiency: for $\widehat { \theta }$ and any $a ( ) \in { \mathcal { A } }$ , $f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ is closer to $\mathbf { x }$ than any other samples under a distance metric $d _ { e } ( \cdot , \cdot )$ , i.e., $\begin{array} { r } { \big \langle d _ { e } \big ( f \big ( a ( \mathbf { x } ) ; \widehat { \theta } \big ) , f ( \mathbf { x } ; \widehat { \theta } ) \big ) \leq \operatorname* { m i n } _ { \mathbf { x } ^ { \prime } \in \mathbf { X } - \mathbf { x } } d _ { e } \big ( f \big ( a ( \mathbf { x } ) ; \widehat { \theta } \big ) , f ( \mathbf { x } ^ { \prime } ; \widehat { \theta } ) \big ) } \end{array}$ .
|
| 46 |
+
|
| 47 |
+
A3: Vertices: For a model $\widehat { \theta }$ and a transformation $a ( )$ , we use $\mathcal { P } _ { a , \widehat { \theta } }$ to denote the distribution of $f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ for $( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P }$ . “Vertices” argues that exists two extreme elements in $\mathcal { A }$ , namely $a ^ { + }$ and $a ^ { - }$ , with certain metric $d _ { x } ( \cdot , \cdot )$ , we have
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
d _ { x } ( \mathcal { P } _ { a ^ { + } , \widehat { \theta } } , \mathcal { P } _ { a ^ { - } , \widehat { \theta } } ) = \operatorname* { s u p } _ { a _ { 1 } , a _ { 2 } \in \mathcal { A } } d _ { x } ( \mathcal { P } _ { a _ { 1 } , \widehat { \theta } } , \mathcal { P } _ { a _ { 2 } , \widehat { \theta } } )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Note that $d _ { x } ( \cdot , \cdot )$ is a metric over two distributions and $d _ { e } ( \cdot , \cdot )$ is a metric over two samples. Also, slightly different from the intuitive understanding of “vertices” above, A3 regulates the behavior of embedding instead of raw data. All of our follow-up analysis will require A1 to hold, but with more assumptions held, we can get computationally lighter methods with bounded error.
|
| 54 |
+
|
| 55 |
+
# 3.2 BACKGROUND, ROBUSTNESS, AND INVARIANCE
|
| 56 |
+
|
| 57 |
+
One central goal of machine learning is to understand the generalization error. When the test data and train data are from the same distribution, many previous analyses can be sketched as:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
r _ { \mathcal { P } } ( \widehat { \theta } ) \leq \widehat { r } _ { \mathcal { P } } ( \widehat { \theta } ) + \phi ( | \Theta | , n , \delta )
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
which states that the expected risk can be bounded by the empirical risk and a function of hypothesis space $| \Theta |$ and number of samples $n$ ; $\delta$ accounts for the probability when the bound holds. $\phi ( )$ is a function of these three terms. Dependent on the details of different analyses, different concrete examples of this generic term will need different assumptions. We use a generic assumption A4 to denote the assumptions required for each example. More concrete discussions are in Appendix A
|
| 64 |
+
|
| 65 |
+
Robustness In addition to the generalization error above, we also study the robustness by following the established definition as in the worst case expected risk when the test data is allowed to be shifted to some other distributions by transformation functions in $\mathcal { A }$ . Formally, we study
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
r _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } } \operatorname* { m a x } _ { a \sim \mathcal { A } } \mathbb { I } ( g ( f ( a ( \mathbf { x } ) ; \widehat { \theta } ) ) \neq \mathbf { y } )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
As $r _ { \mathcal { P } } ( \widehat { \theta } ) \leq r _ { \mathcal { P ^ { \prime } } } ( \widehat { \theta } )$ , we only need to study $\textcircled{3}$ . We will analyze $\textcircled{3}$ in different scenarios involving different assumptions and offer formalizations of the generalization bounds under each scenario. Our bounds shall also immediately inspire the development of methods in each scenario as the terms involved in our bound are all computable within reasonable computational loads.
|
| 72 |
+
|
| 73 |
+
Invariance In addition to robustness, we are also interested in whether the model learns to be invariant to the undesired signals. Intuitively, if data augmentation is used to help dilute the undesired signals from data by altering the undesired signals with $a ( ) \in { \mathcal { A } }$ , a successfully trained model with augmented data will map the raw data with various undesired signals to the same embedding. Thus, we study the following metric to quantify the model’s ability in learning invariant representations:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { I ( \widehat { \theta } , \mathcal { P } ) = \underset { a _ { 1 } , a _ { 2 } \in \mathcal { A } } { \operatorname* { s u p } } d _ { x } ( \mathcal { P } _ { a _ { 1 } , \widehat { \theta } } , \mathcal { P } _ { a _ { 2 } , \widehat { \theta } } ) , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\mathcal { P } _ { a , \widehat { \theta } }$ to denote the distribution of $f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ for $( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } . ~ d _ { x } ( )$ is a distance over two distributions, and we suggest to use Wasserstein metric given its favorable properties (e.g., see practical examples in Figure 1 of (Cuturi & Doucet, $\boxed { 2 0 1 4 }$ or theoretical discussions in $\mathrm { ( \overline { { V i l l a n i } } , \overline { { 2 0 0 8 } } ) } \mathrm { ) }$ ). Due to the difficulties in assessing ${ \widehat { f ( a ( \mathbf { x } ) ; { \widehat { \theta } } ) } }$ (as it depends on $\widehat { \theta } _ { . }$ ), we mainly study $( 4 )$ empirically, and argue that models trained with explicit regularization of the empirical counterpart of $\bar { ( 4 ) }$ will have favorable invariance property.
|
| 80 |
+
|
| 81 |
+
# 3.3 WORST-CASE AUGMENTATION (ADVERSARIAL TRAINING)
|
| 82 |
+
|
| 83 |
+
We consider robustness first. $( 3 )$ can be written equivalently into the expected risk over a pseudo distribution ${ \mathcal { P } } ^ { \prime }$ (see Lemma 1 in $\boxed { \mathrm { I u ~ e t ~ a l . } } \boxed { 2 0 1 9 } )$ , which is the distribution that can sample the data leading to the worst expected risk. Thus, equivalently, we can consider $\operatorname* { s u p } _ { { \mathcal { P } } ^ { \prime } \in T ( { \mathcal { P } } , A ) } r _ { { \mathcal { P } } ^ { \prime } } ( { \widehat { \theta } } )$ . With an assumption relating the worst distribution of expected risk and the worst distribution of the empirical risk (namely, A5, in Appendix A), the bound of our interest (i.e., $\operatorname* { s u p } _ { { \mathcal { P } } ^ { \prime } \in T ( { \mathcal { P } } , A ) } r _ { { \mathcal { P } } ^ { \prime } } ( { \widehat { \theta } } ) )$ can be analogously analyzed through $\begin{array} { r } { \operatorname* { s u p } _ { \mathcal { P } ^ { \prime } \in T ( \mathcal { P } , \mathcal { A } ) } ^ { - } \widehat { r } _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) } \end{array}$ . By the definition of ${ \mathcal { P } } ^ { \prime }$ , we can have:
|
| 84 |
+
|
| 85 |
+
Lemma 3.1. With Assumptions A1, A4, and A5, with probability at least $1 - \delta$ , we have
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\operatorname* { s u p } _ { \mathcal { P } ^ { \prime } \in T ( \mathcal { P } , A ) } r _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) \leq \frac { 1 } { n } \sum _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } } \operatorname* { s u p } _ { a \in \mathcal { A } } \mathbb { I } \big ( g \big ( f ( a ( \mathbf { x } ) ; \widehat { \theta } ) ) \neq \mathbf { y } \big ) + \phi \big ( | \Theta | , n , \delta \big )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
This result is a straightforward follow-up of the preceding discussions. In practice, it aligns with the adversarial training $\mathrm { ( } \mathbf { M a d r y \ e t \ a l . } , \mathbf { \bar { 2 0 1 8 } } \mathrm { ) }$ , a method that has demonstrated impressive empirical successes in the robust machine learning community.
|
| 92 |
+
|
| 93 |
+
While the adversarial training has been valued by its empirical superiorities, it may still have the following two directions that can be improved: firstly, it lacks an explicit enforcement of the concept of invariance between the original sample and the transformed sample; secondly, it assumes that elements of $\mathcal { A }$ are enumerable, thus $\frac { 1 } { n } \sum _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } } \operatorname* { s u p } _ { a \in \cal A } \mathbb { I } ( g ( f ( a ( \mathbf { x } ) ; \widehat { \boldsymbol { \theta } } ) ) \neq \mathbf { y } )$ is computable. The remaining discussions expand along these two directions.
|
| 94 |
+
|
| 95 |
+
# 3.4 REGULARIZED WORST-CASE AUGMENTATION
|
| 96 |
+
|
| 97 |
+
To force the concept of invariance, the immediate solution might be to apply some regularizations to minimize the distance between the embeddings learned from the original sample and the ones learned from the transformed samples. We have offered a summary of these methods in Section 2.
|
| 98 |
+
|
| 99 |
+
To have a model with small invariance score, the direct approach will be regularizing the empirical counterpart of $\textcircled{4}$ . We notice that existing methods barely consider this regularization, probably because of the computational difficulty of Wasserstein distance. Conveniently, we have the following result that links the $\ell _ { 1 }$ regularization to the Wasserstein-1 metric in the context of data augmentation.
|
| 100 |
+
|
| 101 |
+
Proposition 3.2. With $A 2$ , and $d _ { e } ( \cdot , \cdot )$ in $A 2$ chosen to be $\ell _ { 1 }$ norm, for any $a \in { \mathcal { A } }$ , we have
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\sum _ { i } | | f ( \mathbf { x } _ { i } ; \widehat { \boldsymbol { \theta } } ) - f ( a ( \mathbf { x } _ { i } ) ; \widehat { \boldsymbol { \theta } } ) | | _ { 1 } = W _ { 1 } ( f ( \mathbf { x } ; \widehat { \boldsymbol { \theta } } ) , f ( a ( \mathbf { x } ) ; \widehat { \boldsymbol { \theta } } ) )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
This result conveniently allows us to use $\ell _ { 1 }$ norm distance to replace Wasserstein metric, integrating the advantages of Wasserstein metric while avoiding practical issues such as computational complexity and difficulty to pass the gradient back during backpropagation.
|
| 108 |
+
|
| 109 |
+
We continue to discuss the generalization behaviors. Our analysis remains in the scope of multiclass classification, where the risk is evaluated as misclassification rate, and the model is optimized with cross-entropy loss (with the base chosen to be log base in cross-entropy loss). This setup aligns with A4, and should represent the modern neural network studies well enough.
|
| 110 |
+
|
| 111 |
+
Before we proceed, we need another technical assumption A6 (details in Appendix A), which can be intuitively considered as a tool that allows us to relax classification error into cross-entropy error, so that we can bound the generalization error with the terms we can directly optimize during training.
|
| 112 |
+
|
| 113 |
+
We can now offer another technical result:
|
| 114 |
+
|
| 115 |
+
Theorem 3.3. With Assumptions A1, A2, A4, A5, and A6, and $d _ { e } ( \cdot , \cdot )$ in $A 2$ is $\ell _ { 1 }$ norm, with probability at least $1 - \delta$ , the worst case generalization risk will be bounded as
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\operatorname* { s u p } _ { \mathcal { P } ^ { \prime } \in T ( \mathcal { P } , \mathcal { A } ) } r _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) \leq \widehat { r } _ { \mathcal { P } } ( \widehat { \theta } ) + \sum _ { i } | | f ( \mathbf { x } _ { i } ; \widehat { \theta } ) - f ( \mathbf { x } _ { i } ^ { \prime } ; \widehat { \theta } ) | | _ { 1 } + \phi ( | \Theta | , n , \delta )
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
and $\mathbf { x } ^ { \prime } = a ( \mathbf { x } )$ , where $a = \arg \operatorname* { m a x } _ { a \in \mathcal { A } } \mathbf { y } ^ { \top } f ( a ( \mathbf { x } ) ; \widehat { \theta } ) .$
|
| 122 |
+
|
| 123 |
+
This technical result also immediately inspires the method to guarantee worst case performance, as well as to explicitly enforce the concept of invariance. Notice that $a = \arg \operatorname* { m a x } _ { a \in \mathcal { A } } \mathbf { y } ^ { \top } f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ is simply selecting the augmentation function maximizing the cross-entropy loss, a standard used by many worst case augmenting method (e.g., Madry et al., 2018).
|
| 124 |
+
|
| 125 |
+
# 3.5 REGULARIZED TRAINING WITH VERTICES
|
| 126 |
+
|
| 127 |
+
As $\mathcal { A }$ in practice is usually a set with a large number of (and possibly infinite) elements, we may not always be able to identify the worst case transformation function with reasonable computational efforts. This limitation also prevents us from effective estimating the generalization error as the bound requires the identification of the worst case transformation.
|
| 128 |
+
|
| 129 |
+
Our final discussion is to leverage the vertex property of the transformation function to bound the worst case generalization error:
|
| 130 |
+
|
| 131 |
+
Lemma 3.4. With Assumptions A1-A6, and $d _ { e } ( \cdot , \cdot )$ in $A 2$ chosen as $\ell _ { 1 }$ norm distance, $d _ { x } ( \cdot , \cdot )$ in $A 3$ chosen as Wasserstein-1 metric, assuming there is a $a ^ { \prime } ( ) \in { \mathcal { A } }$ where $\begin{array} { r } { \widehat { r } _ { \mathcal { P } _ { a ^ { \prime } } } ( \widehat { \theta } ) = \frac { 1 } { 2 } \big ( \widehat { r } _ { \mathcal { P } _ { a ^ { + } } } ( \widehat { \theta } ) + } \end{array}$ ${ \widehat { r } } _ { { \mathcal { P } } _ { a } - } ( { \widehat { \theta } } ) \big )$ , with probability at least $1 - \delta$ , we have:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\operatorname* { s u p } _ { \substack { 2 \prime \in T ( P , A ) } } r _ { P ^ { \prime } } ( \widehat { \theta } ) \leq \frac { 1 } { 2 } \big ( \widehat { r } _ { \mathcal { P } _ { a } + } ( \widehat { \theta } ) + \widehat { r } _ { \mathcal { P } _ { a } - } ( \widehat { \theta } ) \big ) + \sum _ { i } | | f ( a ^ { + } ( \mathbf { x } _ { i } ) ; \widehat { \theta } ) - f ( a ^ { - } ( \mathbf { x } ^ { \prime } ) ; \widehat { \theta } ) | | _ { 1 } + \phi ( | \Theta | , n , \delta )
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
This result inspires the method that can directly guarantee the worst case generalization result and can be optimized conveniently without searching for the worst-case transformations. However, this method requires a good domain knowledge of the vertices of the transformation functions.
|
| 138 |
+
|
| 139 |
+
# 3.6 ENGINEERING SPECIFICATION OF RELEVANT METHODS
|
| 140 |
+
|
| 141 |
+
Our theoretical analysis has lead to a line of methods, however, not every method can be effectively implemented, especially due to the difficulties of passing gradient back for optimizations. Therefore, to boost the influence of the loss function through backpropagation, we recommend to adapt the methods with the following two changes: 1) the regularization is enforced on logits instead of softmax; 2) we use squared $\ell _ { 2 }$ norm instead of $\ell _ { 1 }$ norm because $\ell _ { 1 }$ norm is not differentiable everywhere. We discuss the effects of these compromises in ablation studies in Appendix E.
|
| 142 |
+
|
| 143 |
+
Also, in the cases where we need to identify the worst case transformation functions, we iterate through all the transformation functions and identify the function with the maximum loss.
|
| 144 |
+
|
| 145 |
+
Overall, our analysis leads to the following main training strategies:
|
| 146 |
+
|
| 147 |
+
• VA (vanilla augmentation): mix the augmented samples of a vertex function to the original ones for training (original samples are considered as from another vertex in following experiments). • VWA (vanilla worst-case augmentation): at each iteration, identify the worst-case transformation functions and train with samples generated by them (also known as adversarial training). • RA (regularized augmentation): regularizing the squared $\ell _ { 2 }$ distance over logits between the original samples and the augmented samples of a fixed vertex transformation function. • RWA (regularized worst-case augmentation): regularizing the squared $\ell _ { 2 }$ distance over logits between the original samples and the worst-case augmented samples identified at each iteration.
|
| 148 |
+
|
| 149 |
+
# 4 EXPERIMENTS
|
| 150 |
+
|
| 151 |
+
We first use some synthetic experiments to verify our assumptions and inspect the consequences when the assumptions are not met (in Appendix $\dot { \mathbf { C } } )$ . Then, in the following paragraphs, we test the methods discussed to support our arguments in learning robustness and invariance. Finally, we show the power of our discussions by competing with advanced methods designed for specific tasks.
|
| 152 |
+
|
| 153 |
+
# 4.1 EXPERIMENTS FOR LEARNING ROBUST & INVARIANT REPRESENTATION
|
| 154 |
+
|
| 155 |
+
Experiment Setup: We first test our arguments with two data sets and three different sets of the augmentations. We study MNIST dataset with LeNet architecture, and CIFAR10 dataset with ResNet18 architecture. To examine the effects of the augmentation strategies, we disable all the heuristics that are frequently used to boost the test accuracy of models, such as the default augmentation many models trained for CIFAR10 adopted, and the BatchNorm (also due to the recent arguments against the effects of BatchNorm in learning robust features $( \overline { { \mathrm { W a n g ~ e t ~ a l . } } } , \overline { { 2 0 2 0 } } ) )$ , although forgoing these heuristics will result in a lower overall performance than one usually expects.
|
| 156 |
+
|
| 157 |
+
We consider three different sets of transformation functions: texture, rotation, and contrast. The details of these transformation functions and the experiment setup are in Appendix D.
|
| 158 |
+
|
| 159 |
+
We consider three different evaluation metrics:
|
| 160 |
+
|
| 161 |
+
• Clean: test accuracy on the original test data, mainly reported as a reference for other metrics.
|
| 162 |
+
• Robustness: the worst accuracy when each sample can be transformed with $a \in { \mathcal { A } }$ .
|
| 163 |
+
Invariance: A metric to test whether the models learns the concept of invariance (details to follow).
|
| 164 |
+
|
| 165 |
+
Invariance-test: To test whether a model can truly learns the concept of invariance within ${ \mathcal { A } } =$ $\{ a _ { 1 } ( ) , a _ { 2 } ( ) , \ldots , a _ { t } ( ) \}$ of $t$ elements, we design a new evaluation metric: for a sampled collection of data of the sample label $i$ , denoted as $\mathbf { X } ^ { ( i ) }$ , we generate the transformed copies of it with $\mathcal { A }$ , resulting in $\mathbf { X } _ { a _ { 1 } } ^ { ( i ) } , \mathbf { X } _ { a _ { 2 } } ^ { ( i ) } , \ldots , \mathbf { X } _ { a _ { t } } ^ { ( i ) }$ . We combined these copies into a dataset, denoted as $\chi ^ { ( i ) }$ . For every sample $\mathbf { x }$ in $\chi ^ { ( i ) }$ , we retrieve its $t$ nearest neighbors of other samples in $\chi ^ { ( i ) }$ , and calculate the overlap of the retrieved samples and $\{ a _ { 1 } ( \mathbf { x } ) , a _ { 2 } ( \mathbf { x } ) , \ldots , a _ { t } ( \mathbf { x } ) \}$ . Since the identify map is in $\mathcal { A }$ , so the calculated overlap score will be in $[ 1 / t , 1 ]$ . The distance used is $d ( \cdot , \cdot ) = | | f ( \cdot ; \widehat { \theta } ) - f ( \cdot ; \widehat { \theta } ) | | _ { 1 }$ , where $\widehat { \theta }$ is the model we are interested to examine. Finally, we report the averaged score for every label. Thus, a high overlap score indicates the prediction of model $\widehat { \theta }$ is invariant to the augmentation functions in $\mathcal { A }$ . If we use other distance functions, the reported values may differ, but we notice that the rank of the methods compared in terms of this test barely changes.
|
| 166 |
+
|
| 167 |
+
Results: We show the results in Table 1 and Table $\bigtriangledown$ (in Appendix) for MNIST and CIFAR10 respectively. Table $^ 1$ shows that RWA is generally a superior method, in terms of all the metrics, especially the invariance evaluation as it shows a much higher invariance score than competing methods. We believe this advantage of invariance comes from two sources: regularizations and the fact that RWA has seen all the augmentation functions in $\boldsymbol { A }$ . In comparison, RA also has regularization but only sees the vertices in $\mathcal { A }$ , so the invariance score of RA is not compatitable to RWA, although better than VA. Table $\boxed { 6 }$ roughly tells the same story. More discussions are in Appendix D.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Texture</td><td colspan="3">Rotation</td><td colspan="3">Contrast</td></tr><tr><td>C</td><td>R</td><td>I</td><td>C</td><td>R</td><td>I</td><td>C</td><td>R</td><td>I</td></tr><tr><td>Base</td><td>0.9921</td><td>0.9860</td><td>0.9236</td><td>0.9921</td><td>0.2960</td><td>0.2056</td><td>0.9921</td><td>0.2699</td><td>0.2003</td></tr><tr><td>VA</td><td>0.9928</td><td>0.9906</td><td>0.9876</td><td>0.9884</td><td>0.9336</td><td>0.5628</td><td>0.9922</td><td>0.9837</td><td>0.4153</td></tr><tr><td>RA</td><td>0.9909</td><td>0.9904</td><td>1</td><td>0.9930</td><td>0.9525</td><td>0.6044</td><td>0.9936</td><td>0.9823</td><td>0.4166</td></tr><tr><td>VWA</td><td>0.9922</td><td>0.9903</td><td>0.9940</td><td>0.9466</td><td>0.9408</td><td>0.6284</td><td>0.536</td><td>0.4470</td><td>0.2210</td></tr><tr><td>RWA</td><td>0.9915</td><td>0.9911</td><td>1</td><td>0.9934</td><td>0.9882</td><td>0.8856</td><td>0.994</td><td>0.9893</td><td>0.8786</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 1: Results of MNIST data (“C” stands for clean accuracy, “R” stands for robustness, and “I” stands for invariance score): invariance score shows big differences while accuracy does not.
|
| 172 |
+
|
| 173 |
+
Other results (Appendix $\mathbf { E } )$ : The strength of RWA can also be shown in several other different scenarios, even in the out-of-domain test scenario where the transformation functions are not in $\mathcal { A }$ . RWA generally performs the best, although not the best in every single test. We also perform ablation test to validate the choice of squared $\ell _ { 2 }$ norm over logits in contrast to other distance metrics. Our choice performs the best in the worst-case performance. This advantage is expected as our choice is validated by theoretical arguments as well as consideration of engineering convenience.
|
| 174 |
+
|
| 175 |
+
Overall, the empirical performances align with our expectation from the theoretical discussion: while all methods discussed have a bounded worst case performance, we do not intend to compare the upper bounds because smaller upper bounds do not necessarily guarantee a smaller risk. However, worst case augmentation methods tend to show a better worst case performances because they have been augmented with all the elements in $\mathcal { A }$ . Also, there is no clear evidence suggesting the difference between augmentation methods and its regularized versions in terms of the worst case performance, but it is clear that regularization helps to learn the concept of invariance.
|
| 176 |
+
|
| 177 |
+
# 4.2 COMPARISON TO ADVANCED METHODS
|
| 178 |
+
|
| 179 |
+
Finally, we also compete our generic data augmentation methods against several specifically designed methods in different applications. We use the four generic methods (VA, RA, VWA, and RWA) with generic transformation functions $\mathcal { A }$ of “rotation”, “contrast”, or ”texture” used in the synthetic experiments). We compare our methods with techniques invented for three different topics of study (rotation invariant, texture perturbation, and cross-domain generalization), and each of these topics has seen a long line of method development. We follow each own tradition (e.g., rotation methods are usually tested in CIFAR10 dataset, seemingly due to the methods’ computational requirements), test over each own most challenging dataset (e.g., ImageNet-Sketch is the most recent and challenging dataset in domain generalization, although less studied), and report each own evaluation metric (e.g., methods tested with ImageNet-C are usually evaluated with mCE).
|
| 180 |
+
|
| 181 |
+
Overall, the performances of our generic methods outperform these advanced SOTA techniques. Thus, the main conclusion, as validated by these challenging scenarios, are (1) usage of data augmentation can outperform carefully designed methods; (2) usage of the consistency loss can further improve the performances; (3) regularized worst-case augmentation generally works the best.
|
| 182 |
+
|
| 183 |
+
Due to the limitation of space, we leave the background details of these experiments in Appendix F, where we introduce the detailed experiment settings, and explain the acronyms in Tables 2-4
|
| 184 |
+
|
| 185 |
+
Rotation-invariant Image Classification We test the models with nine different rotations including $0 ^ { \circ }$ . Augmentation related methods only use the $\mathcal { A }$ of “rotation” in synthetic experiments, so the testing scenario goes beyond what the augmentation methods have seen during training. The results in Table $\bigtriangledown$ strongly endorses the efficacy of augmentation-based methods. Interestingly, regularized augmentation methods probably with the benefit of learning the concept of invariance, tend to behave well in the transformations not considered during training. Also, RA outperforms VWA on average.
|
| 186 |
+
|
| 187 |
+
Texture-perturbed ImageNet classification We also test the performance on the image classification over multiple perturbations. We train the model over standard ImageNet training set and test the model with ImageNet-C data (Hendrycks & Dietterich, 2019), which is a perturbed version of ImageNet by corrupting the original ImageNet validation set with a collection of noises. The results
|
| 188 |
+
|
| 189 |
+
<table><tr><td></td><td>300</td><td>315</td><td>330</td><td>345</td><td>0</td><td>15</td><td>30</td><td>45</td><td>60</td><td>avg.</td></tr><tr><td>Base</td><td>0.2196</td><td>0.2573</td><td>0.3873</td><td>0.6502</td><td>0.8360</td><td>0.6938</td><td>0.4557</td><td>0.3281</td><td>0.2578</td><td>0.4539</td></tr><tr><td>ST</td><td>0.2391</td><td>0.2748</td><td>0.4214</td><td>0.7049</td><td>0.8251</td><td>0.7147</td><td>0.4398</td><td>0.2838</td><td>0.2300</td><td>0.4593</td></tr><tr><td>GC</td><td>0.1540</td><td>0.1891</td><td>0.2460</td><td>0.3919</td><td>0.5859</td><td>0.4145</td><td>0.2534</td><td>0.1827</td><td>0.1507</td><td>0.2853</td></tr><tr><td>ETN</td><td>0.3855</td><td>0.4844</td><td>0.6324</td><td>0.7576</td><td>0.8276</td><td>0.7730</td><td>0.7324</td><td>0.6245</td><td>0.5060</td><td>0.6358</td></tr><tr><td>VA</td><td>0.2233</td><td>0.2832</td><td>0.4318</td><td>0.6364</td><td>0.8124</td><td>0.6926</td><td>0.5973</td><td>0.7152</td><td>0.7923</td><td>0.5761</td></tr><tr><td>RA</td><td>0.3198</td><td>0.3901</td><td>0.5489</td><td>0.7170</td><td>0.8487</td><td>0.7904</td><td>0.7455</td><td>0.8005</td><td>0.8282</td><td>0.6655</td></tr><tr><td>VWA</td><td>0.3383</td><td>0.3484</td><td>0.3835</td><td>0.4569</td><td>0.7474</td><td>0.866</td><td>0.8776</td><td>0.8738</td><td>0.8629</td><td>0.6394</td></tr><tr><td>RWA</td><td>0.4012</td><td>0.4251</td><td>0.4852</td><td>0.6765</td><td>0.8708</td><td>0.8871</td><td>0.8869</td><td>0.8870</td><td>0.8818</td><td>0.7113</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 2: Comparison to advanced rotation-invariant models. We report the test accuracy on the test sets clockwise rotated, $0 ^ { \circ } \ – 6 0 ^ { \circ }$ and $3 0 0 ^ { \circ } - 3 6 0 ^ { \circ }$ . Average accuracy is also reported. Augmentation methods only consider $0 ^ { \circ } \ – 6 0 ^ { \circ }$ clockwise rotations during training.
|
| 192 |
+
|
| 193 |
+
Table 3: Summary comparison to advanced models over ImageNet-C data. Performance reported (mCE) follows the standard in ImageNet-C data: clean error and mCE are both the smaller the better.
|
| 194 |
+
|
| 195 |
+
<table><tr><td></td><td>Base</td><td>SU</td><td>AA</td><td>MBP</td><td>SIN</td><td>AM</td><td>AMS</td><td>VA</td><td>RA</td><td>VWA</td><td>RWA</td></tr><tr><td>Clean</td><td>23.9</td><td>24.5</td><td>22.8</td><td>23</td><td>27.2</td><td>22.4</td><td>25.2</td><td>23.7</td><td>23.6</td><td>23.3</td><td>22.4</td></tr><tr><td>mCE</td><td>80.6</td><td>74.3</td><td>72.7</td><td>73.4</td><td>73.3</td><td>68.4</td><td>64.9</td><td>76.3</td><td>75.6</td><td>74.8</td><td>64.6</td></tr></table>
|
| 196 |
+
|
| 197 |
+
<table><tr><td></td><td>Base</td><td>InfoDrop</td><td>HEX</td><td>PAR</td><td>VA</td><td>RA</td><td>VWA</td><td>RWA</td></tr><tr><td>Top-1</td><td>0.1204</td><td>0.1224</td><td>0.1292</td><td>0.1306</td><td>0.1362</td><td>0.1405</td><td>0.1432</td><td>0.1486</td></tr><tr><td>Top-5</td><td>0.2408</td><td>0.256</td><td>0.2564</td><td>0.2627</td><td>0.2715</td><td>0.2793</td><td>0.2846</td><td>0.2933</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Table 4: Comparison to advanced cross-domain image classification models, over ImageNet-Sketch dataset. We report top-1 and top-5 accuracy following standards on ImageNet related experiments.
|
| 200 |
+
|
| 201 |
+
are reported in Table $^ { 3 , }$ which shows that our generic method can outperform the current SOTA methods after a continued finetuning process with reducing learning rates.
|
| 202 |
+
|
| 203 |
+
Cross-domain ImageNet-Sketch Classification We also compare to the methods used for crossdomain evaluation. with the most challenging setup in this scenario: train the models with standard ImageNet training data, and test the model over ImageNet-Sketch data $( \mathbb { W } \mathrm { a n g ~ e t ~ a l . } ] { \underline { { 2 0 1 9 \mathrm { a } } } } )$ , which is a collection of sketches following the structure ImageNet validation set. Similarly, we only augment the samples with a generic augmentation set ( $\mathcal { A }$ of “contrast” in synthetic experiments, Appendix D) The results in Table 4 again support the strength of the correct usage of data augmentation.
|
| 204 |
+
|
| 205 |
+
# 5 CONCLUSION
|
| 206 |
+
|
| 207 |
+
In this paper, we conducted a systematic inspection to study the proper regularization techniques that are provably related to the generalization error of a machine learning model, when the test distribution are allowed to be perturbed by a family of transformation functions. With progressively more specific assumptions, we identified progressively simpler methods that can bound the worst case risk. We summarize the main take-home messages below:
|
| 208 |
+
|
| 209 |
+
• Regularizing a norm distance between the logits of the originals samples and the logits of the augmented samples enjoys several merits: the trained model tend to have good worst cast performance, and can learn the concept of invariance (as shown in our invariance test). Although our theory suggests $\ell _ { 1 }$ norm, but we recommend squared $\ell _ { 2 }$ norm in practice considering the difficulties of passing the (sub)gradient of $\ell _ { 1 }$ norm in backpropagation. • With the vertex assumption held (it usually requires domain knowledge to choose the vertex functions), one can use “regularized training with vertices” method and get good empirical performance in both accuracy and invariance, and the method is at the same complexity order of vanilla training without data augmentation. When we do not have the domain knowledge (thus are not confident in the vertex assumption), we recommend “regularized worst-case augmentation”, which has the best performance overall, but requires extra computations to identify the worst-case augmentated samples at each iteration.
|
| 210 |
+
|
| 211 |
+
# REFERENCES
|
| 212 |
+
|
| 213 |
+
Alessandro Achille and Stefano Soatto. Information dropout: Learning optimal representations through noisy computation. IEEE transactions on pattern analysis and machine intelligence, 40 (12):2897–2905, 2018.
|
| 214 |
+
|
| 215 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan, 2017. ´
|
| 216 |
+
|
| 217 |
+
Akari Asai and Hannaneh Hajishirzi. Logic-guided data augmentation and regularization for consistent question answering, 2020.
|
| 218 |
+
|
| 219 |
+
Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1-2):151–175, 2010.
|
| 220 |
+
|
| 221 |
+
Sergey Bobkov and Michel Ledoux. One-dimensional empirical measures, order statistics, and Kantorovich transport distances, volume 261. American Mathematical Society, 2019.
|
| 222 |
+
|
| 223 |
+
Olivier Bousquet, Stephane Boucheron, and G ´ abor Lugosi. Introduction to statistical learning the- ´ ory. In Summer School on Machine Learning, pp. 169–207. Springer, 2003.
|
| 224 |
+
|
| 225 |
+
Shuxiao Chen, Edgar Dobriban, and Jane H Lee. A group-theoretic framework for data augmentation, 2019.
|
| 226 |
+
|
| 227 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In International conference on machine learning, pp. 2990–2999, 2016.
|
| 228 |
+
|
| 229 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 113–123, 2019.
|
| 230 |
+
|
| 231 |
+
Marco Cuturi and Arnaud Doucet. Fast computation of wasserstein barycenters. 2014.
|
| 232 |
+
|
| 233 |
+
Tri Dao, Albert Gu, Alexander Ratner, Virginia Smith, Chris De Sa, and Christopher Re. A kernel ´ theory of modern data augmentation. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 1528–1537. PMLR, 2019.
|
| 234 |
+
|
| 235 |
+
Alhussein Fawzi, Horst Samulowitz, Deepak S. Turaga, and Pascal Frossard. Adaptive data augmentation for image classification. In 2016 IEEE International Conference on Image Processing, ICIP 2016, Phoenix, AZ, USA, September 25-28, 2016, pp. 3688–3692. IEEE, 2016.
|
| 236 |
+
|
| 237 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 238 |
+
|
| 239 |
+
Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 240 |
+
|
| 241 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans, 2017.
|
| 242 |
+
|
| 243 |
+
Hao Guo, Kang Zheng, Xiaochuan Fan, Hongkai Yu, and Song Wang. Visual attention consistency under image transforms for multi-label image classification. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 729– 739. Computer Vision Foundation / IEEE, 2019.
|
| 244 |
+
|
| 245 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019.
|
| 246 |
+
|
| 247 |
+
Dan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 248 |
+
|
| 249 |
+
Alex Hernandez-Garc ´ ´ıa and Peter Konig. Data augmentation instead of explicit regularization, 2018. ¨
|
| 250 |
+
|
| 251 |
+
Daniel Ho, Eric Liang, Xi Chen, Ion Stoica, and Pieter Abbeel. Population based augmentation: Efficient learning of augmentation policy schedules. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 2731–2741. PMLR, 2019.
|
| 252 |
+
|
| 253 |
+
Zhiting Hu, Bowen Tan, Russ R Salakhutdinov, Tom M Mitchell, and Eric P Xing. Learning data manipulation for augmentation and weighting. In Advances in Neural Information Processing Systems, pp. 15738–15749, 2019.
|
| 254 |
+
|
| 255 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pp. 2017–2025, 2015.
|
| 256 |
+
|
| 257 |
+
Jisoo Jeong, Seungeui Lee, Jeesoo Kim, and Nojun Kwak. Consistency-based semi-supervised learning for object detection. In Advances in Neural Information Processing Systems, pp. 10758– 10767, 2019.
|
| 258 |
+
|
| 259 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing, 2018.
|
| 260 |
+
|
| 261 |
+
Risi Kondor, Zhen Lin, and Shubhendu Trivedi. Clebsch–gordan nets: a fully fourier space spherical convolutional neural network. In Advances in Neural Information Processing Systems, pp. 10117– 10126, 2018.
|
| 262 |
+
|
| 263 |
+
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.
|
| 264 |
+
|
| 265 |
+
Davis Liang, Zhiheng Huang, and Zachary C Lipton. Learning noise-invariant representations for robust speech recognition. In 2018 IEEE Spoken Language Technology Workshop (SLT), pp. 56–63. IEEE, 2018.
|
| 266 |
+
|
| 267 |
+
Percy Liang. Cs229t/stat231: Statistical learning theory (winter 2016), 2016.
|
| 268 |
+
|
| 269 |
+
Raphael Gontijo Lopes, Dong Yin, Ben Poole, Justin Gilmer, and Ekin D Cubuk. Improving robustness without sacrificing accuracy with patch gaussian augmentation. arXiv preprint arXiv:1906.02611, 2019.
|
| 270 |
+
|
| 271 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
|
| 272 |
+
|
| 273 |
+
Shashank Rajput, Zhili Feng, Zachary Charles, Po-Ling Loh, and Dimitris Papailiopoulos. Does data augmentation lead to positive margin? In International Conference on Machine Learning, pp. 5321–5330, 2019.
|
| 274 |
+
|
| 275 |
+
Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In Advances in neural information processing systems, pp. 1163–1171, 2016.
|
| 276 |
+
|
| 277 |
+
Meet Shah, Xinlei Chen, Marcus Rohrbach, and Devi Parikh. Cycle-consistency for robust visual question answering. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 278 |
+
|
| 279 |
+
Connor Shorten and Taghi M Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 6(1):60, 2019.
|
| 280 |
+
|
| 281 |
+
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.
|
| 282 |
+
|
| 283 |
+
Kai Sheng Tai, Peter Bailis, and Gregory Valiant. Equivariant transformer networks. arXiv preprint arXiv:1901.11399, 2019.
|
| 284 |
+
|
| 285 |
+
Zhuozhuo Tu, Jingwei Zhang, and Dacheng Tao. Theoretical analysis of adversarial learning: A minimax approach. In Advances in Neural Information Processing Systems, pp. 12259–12269, 2019.
|
| 286 |
+
|
| 287 |
+
Cedric Villani. ´ Topics in optimal transportation. Number 58. American Mathematical Soc., 2003.
|
| 288 |
+
|
| 289 |
+
Cedric Villani. ´ Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
|
| 290 |
+
|
| 291 |
+
Haohan Wang, Songwei Ge, Eric P. Xing, and Zachary C. Lipton. Learning robust global representations by penalizing local predictive power, 2019a.
|
| 292 |
+
|
| 293 |
+
Haohan Wang, Zexue He, Zachary C. Lipton, and Eric P. Xing. Learning robust representations by projecting superficial statistics out. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019b.
|
| 294 |
+
|
| 295 |
+
Haohan Wang, Xindi Wu, Zeyi Huang, and Eric P. Xing. High frequency component helps explain the generalization of convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 296 |
+
|
| 297 |
+
Yulin Wang, Xuran Pan, Shiji Song, Hong Zhang, Gao Huang, and Cheng Wu. Implicit semantic data augmentation for deep networks. In Advances in Neural Information Processing Systems, pp. 12614–12623, 2019c.
|
| 298 |
+
|
| 299 |
+
Xindi Wu, Yijun Mao, Haohan Wang, Xiangrui Zeng, Xin Gao, Eric P. Xing, and Min Xu. Regularized adversarial training (RAT) for robust cellular electron cryo tomograms classification. In Illhoi Yoo, Jinbo Bi, and Xiaohua Hu (eds.), 2019 IEEE International Conference on Bioinformatics and Biomedicine, BIBM 2019, San Diego, CA, USA, November 18-21, 2019, pp. 1–6. IEEE, 2019.
|
| 300 |
+
|
| 301 |
+
Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. Unsupervised data augmentation. arXiv preprint arXiv:1904.12848, 2019.
|
| 302 |
+
|
| 303 |
+
Saining Xie, Tianbao Yang, Xiaoyu Wang, and Yuanqing Lin. Hyper-class augmented and regularized deep learning for fine-grained image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2645–2654, 2015.
|
| 304 |
+
|
| 305 |
+
Fanny Yang, Zuowen Wang, and Christina Heinze-Deml. Invariance-inducing regularization using worst-case transformations suffices to boost accuracy and spatial robustness. In Advances in Neural Information Processing Systems, pp. 14757–14768, 2019.
|
| 306 |
+
|
| 307 |
+
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 Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 7472–7482. PMLR, 2019a.
|
| 308 |
+
|
| 309 |
+
Richard Zhang. Making convolutional networks shift-invariant again. arXiv preprint arXiv:1904.11486, 2019.
|
| 310 |
+
|
| 311 |
+
Xinyu Zhang, Qiang Wang, Jian Zhang, and Zhao Zhong. Adversarial autoaugment. In International Conference on Learning Representations, 2020.
|
| 312 |
+
|
| 313 |
+
Zhirui Zhang, Shuangzhi Wu, Shujie Liu, Mu Li, Ming Zhou, and Tong Xu. Regularizing neural machine translation by target-bidirectional agreement. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 443–450, 2019b.
|
| 314 |
+
|
| 315 |
+
Stephan Zheng, Yang Song, Thomas Leung, and Ian Goodfellow. Improving the robustness of deep neural networks via stability training. In Proceedings of the ieee conference on computer vision and pattern recognition, pp. 4480–4488, 2016.
|
| 316 |
+
|
| 317 |
+
Barret Zoph, Ekin D. Cubuk, Golnaz Ghiasi, Tsung-Yi Lin, Jonathon Shlens, and Quoc V. Le. Learning data augmentation strategies for object detection, 2019.
|
md/train/RQfcckT1M_4/RQfcckT1M_4.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Self-Supervised Learning Disentangled Group Representation as Feature
|
| 2 |
+
|
| 3 |
+
Tan Wang1 Zhongqi Yue1,3 Jianqiang Huang1,3 Qianru Sun2 Hanwang Zhang1 1Nanyang Technological University 2Singapore Management University 3Damo Academy, Alibaba Group {tan317,yuez0003,hanwangzhang}@ntu.edu.sg jianqiang.jqh@gmail.com qianrusun@smu.edu.sg
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
A good visual representation is an inference map from observations (images) to features (vectors) that faithfully reflects the hidden modularized generative factors (semantics). In this paper, we formulate the notion of “good” representation from a group-theoretic view using Higgins’ definition of disentangled representation [40], and show that existing Self-Supervised Learning (SSL) only disentangles simple augmentation features such as rotation and colorization, thus unable to modularize the remaining semantics. To break the limitation, we propose an iterative SSL algorithm: Iterative Partition-based Invariant Risk Minimization (IP-IRM), which successfully grounds the abstract semantics and the group acting on them into concrete contrastive learning. At each iteration, IP-IRM first partitions the training samples into two subsets that correspond to an entangled group element. Then, it minimizes a subset-invariant contrastive loss, where the invariance guarantees to disentangle the group element. We prove that IP-IRM converges to a fully disentangled representation and show its effectiveness on various benchmarks. Codes are available at https://github.com/Wangt-CN/IP-IRM.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep learning is all about learning feature representations [5]. Compared to the conventional end-to-end supervised learning, Self-Supervised Learning (SSL) first learns a generic feature representation (e.g., a network backbone) by training with unsupervised pretext tasks such as the prevailing contrastive objective [36, 16], and then the above stage-1 feature is expected to serve various stage-2 applications with proper fine-tuning. SSL for visual representation is so fascinating that it is the first time that we can obtain “good” visual features for free, just like the trending pre-training in NLP community [26, 8]. However, most SSL works only care how much stage-2 performance an SSL feature can improve, but overlook what feature SSL is learning, why it can be learned, what cannot be learned, what the gap between SSL and Supervised Learning (SL) is, and when SSL can surpass SL?
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: Disentangled representation is an equivariant map between the semantic space $\mathcal { U }$ and the vector space $\mathcal { X }$ , which is decomposed into “color” and “digit”.
|
| 15 |
+
|
| 16 |
+
The crux of answering those questions is to formally understand what a feature representation is and what a good one is. We postulate the classic world model of visual generation and feature representation [1, 69] as in Figure 1. Let $\mathcal { U }$ be a set of (unseen) semantics, e.g., attributes such as “digit” and “color”. There is a set of independent and causal mechanisms [66] $\varphi : \mathcal { U } \to \mathcal { T }$ , generating images from semantics, e.g., writing a digit $ { { } ^ { 6 } } 0 ^ { 9 }$ when thinking of $\mathbf { \vec { \nabla } } _ { 0 } , \mathbf { \vec { \mathbf { \phi } } } _ { }$ [74]. A visual representation is the inference process $\phi : \mathcal { T } \mathcal { X }$ that maps image pixels to vector space features, e.g., a neural network. We define semantic representation as the functional composition $f : \mathcal { U } \to \mathcal { T } \to \mathcal { X }$ . In this paper, we are only interested in the parameterization of the inference process for feature extraction, but not the generation process, i.e., we assume $\forall I \in \mathcal { T }$ , $\exists u \in \mathcal { U }$ , such that $I = \varphi ( u )$ is fixed as the observation of each image sample. Therefore, we consider semantic and visual representations the same as feature representation, or simply representation, and we slightly abuse ${ \dot { \phi } } ( I ) : = f \left( \varphi ^ { - 1 } ( I ) \right)$ , i.e., $\phi$ and $f$ share the same trainable parameters. We call the vector $\mathbf { x } = \phi ( I )$ as feature, where $\mathbf { x } \in \mathcal { X }$ .
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 2: (a) The heat map visualizes feature dimensions related to augmentations (aug. related) and unrelated to augmentations (aug. unrelated), whose respective classification accuracy is shown in the bar chart below. Dashed bar denotes the accuracy using full feature dimensions. Experiment was performed on STL10 [22] with representation learnt with SimCLR [16] and our IP-IRM. (b) Visualization of CNN activations [77] of 4 filters on layer 29 and 18 of VGG [75] trained on ImageNet100 [81]. The filters were chosen by first clustering the aug. unrelated filters with $k$ -means $k = 4$ ) and then selecting the filters corresponding to the cluster centers.
|
| 20 |
+
|
| 21 |
+
# We propose to use Higgins’ definition of disentangled representation [40] to define what is “good”.
|
| 22 |
+
|
| 23 |
+
Definition 1. (Disentangled Representation) Let $\mathcal { G }$ be the group acting on $\mathcal { U }$ , i.e., $g \cdot u \in \mathcal { U } \times \mathcal { U }$ transforms $u \in \mathcal { U }$ , e.g., a “turn green” group element changing the semantic from “red” to “green”. Suppose there is a direct product decomposition1 $\mathcal { G } = g _ { 1 } \times . . . \times g _ { m }$ and ${ \mathcal { U } } = { \mathcal { U } } _ { 1 } \times \ldots \times { \mathcal { U } } _ { m }$ , where $g _ { i }$ acts on $\mathcal { U } _ { i }$ respectively. A feature representation is disentangled if there exists a group $\mathcal { G }$ acting on $\mathcal { X }$ such that:
|
| 24 |
+
|
| 25 |
+
1. Equivariant: $\forall g \in \mathcal { G } , \forall u \in \mathcal { U }$ , $f ( g \cdot u ) = g \cdot f ( u )$ , e.g., the feature of the changed semantic: “red” to “green” in $\mathcal { U }$ , is equivalent to directly change the color vector in $\mathcal { X }$ from “red” to “green”.
|
| 26 |
+
2. Decomposable: there is a decomposition ${ \mathcal { X } } = { \mathcal { X } } _ { 1 } \times \ldots \times { \mathcal { X } } _ { m } ,$ , such that each $\mathcal { X } _ { i }$ is fixed by the action of all $g _ { j } , j \neq i$ and affected only by $g _ { i }$ , e.g., changing the “color” semantic in $\mathcal { U }$ does not affect the “digit” vector in $\mathcal { X }$ .
|
| 27 |
+
|
| 28 |
+
Compared to the previous definition of feature representation which is a static mapping, the disentangled representation in Definition 1 is dynamic as it explicitly incorporate group representation [35], which is a homomorphism from group to group actions on a space, e.g., $\mathcal { G } \mathcal { X } \times \mathcal { X }$ , and it is common to use the feature space $\mathcal { X }$ as a shorthand—this is where our title stands.
|
| 29 |
+
|
| 30 |
+
Definition 1 defines “good” features in the common views: 1) Robustness: a good feature should be invariant to the change of environmental semantics, such as external interventions [45, 87] or domain shifts [32]. By the above definition, a change is always retained in a subspace $\mathcal { X } _ { i }$ , while others are not affected. Hence, the subsequent classifier will focus on the invariant features and ignore the ever-changing $\mathcal { X } _ { i }$ . 2) Zero-shot Generalization: even if a new combination of semantics is unseen in training, each semantic has been learned as features. So, the metrics of each $\mathcal { X } _ { i }$ trained by seen samples remain valid for unseen samples [95].
|
| 31 |
+
|
| 32 |
+
Are the existing SSL methods learning disentangled representations? No. We show in Section 4 that they can only disentangle representations according to the hand-crafted augmentations, e.g., color jitter and rotation. For example, in Figure 2 (a), even if we only use the augmentation-related feature, the classification accuracy of a standard SSL (SimCLR [16]) does not lose much as compared to the full feature use. Figure 2 (b) visualizes that the CNN features in each layer are indeed entangled (e.g., tyre, motor, and background in the motorcycle image). In contrast, our approach IP-IRM, to be introduced below, disentangles more useful features beyond augmentations.
|
| 33 |
+
|
| 34 |
+
In this paper, we propose Iterative Partition-based Invariant Risk Minimization (IP-IRM [ai"p@:m]) that guarantees to learn disentangled representations in an SSL fashion. We present the algorithm in Section 3, followed by the theoretical justifications in Section 4. In a nutshell, at each iteration, IP-IRM first partitions the training data into two disjoint subsets, each of which is an orbit of the already disentangled group, and the cross-orbit group corresponds to an entangled group element $g _ { i }$ Then, we adopt the Invariant Risk Minimization (IRM) [2] to implement a partition-based SSL, which disentangles the representation $\mathcal { X } _ { i }$ w.r.t. $g _ { i }$ . Iterating the above two steps eventually converges to a fully disentangled representation w.r.t. $\textstyle \prod _ { i = 1 } ^ { m } g _ { i }$ . In Section 5, we show promising experimental results on various feature disentanglement and SSL benchmarks.
|
| 35 |
+
|
| 36 |
+
# 2 Related Work
|
| 37 |
+
|
| 38 |
+
Self-Supervised Learning. SSL aims to learn representations from unlabeled data with hand-crafted pretext tasks [28, 63, 33]. Recently, Contrastive learning [65, 61, 38, 80, 16] prevails in most state-ofthe-art methods. The key is to map positive samples closer, while pushing apart negative ones in the feature space. Specifically, the positive samples are from the augmented views [82, 3, 94, 42] of each instance and the negative ones are other instances. Along this direction, follow-up methods are mainly four-fold: 1) Memory-bank [90, 61, 36, 18]: storing the prototypes of all the instances computed previously into a memory bank to benefit from a large number of negative samples. 2) Using siamese network [7] to avoid representation collapse [34, 19, 83]. 3) Assigning clusters to samples to integrate inter-instance similarity into contrastive learning [11, 12, 13, 88, 56]. 4) Seeking hard negative samples with adversarial training or better sampling strategies [73, 20, 44, 48]. In contrast, our proposed IP-IRM jumps out of the above frame and introduces the disentangled representation into SSL with group theory to show the limitations of existing SSL and how to break through them.
|
| 39 |
+
|
| 40 |
+
Disentangled Representation. This notion dates back to [4], and henceforward becomes a highlevel goal of separating the factors of variations in the data [84, 79, 86, 58]. Several works aim to provide a more precise description [27, 29, 72] by adopting an information-theoretic view [17, 27] and measuring the properties of a disentangled representation explicitly [29, 72]. We adopt the recent group-theoretic definition from Higgins et al. [40], which not only unifies the existing, but also resolves the previous controversial points [78, 59]. Although supervised learning of disentangled representation is a well-studied field [100, 43, 10, 70, 49], unsupervised disentanglement based on GAN [17, 64, 57, 71] or VAE [39, 15, 99, 50] is still believed to be theoretically challenging [59]. Thanks to the Higgins’ definition, we prove that the proposed IP-IRM converges with full-semantic disentanglement using group representation theory. Notably, IP-IRM learns a disentangled representation with an inference process, without using generative models as in all the existing unsupervised methods, making IP-IRM applicable even on large-scale datasets.
|
| 41 |
+
|
| 42 |
+
Group Representation Learning. A group representation has two elements [47, 35]: 1) a homomorphism (e.g., a mapping function) from the group to its group action acting on a vector space, and 2) the vector space. Usually, when there is no ambiguity, we can use either element as the definition. Most existing works focus on learning the first element. They first define the group of interest, such as spherical rotations [24] or image scaling [89, 76], and then learn the parameters of the group actions [23, 46, 68]. In contrast, we focus on the second element; more specifically, we are interested in learning a map between two vector spaces: image pixel space and feature vector space. Our representation learning is flexible because it delays the group action learning to downstream tasks on demand. For example, in a classification task, a classifier can be seen as a group action that is invariant to class-agnostic groups but equivariant to class-specific groups (see Section 4).
|
| 43 |
+
|
| 44 |
+
# 3 IP-IRM Algorithm
|
| 45 |
+
|
| 46 |
+
Notations. Our goal is to learn the feature extractor $\phi$ in a self-supervised fashion. We define a partition matrix $\bar { \mathbf { P } } \in \{ 0 , 1 \} ^ { N \times 2 }$ that partitions $N$ training images into 2 disjoint subsets. $P _ { i , k } = 1$ if the $i$ -th image belongs to the $k$ -th subset and 0 otherwise. Suppose we have a pretext task loss
|
| 47 |
+
|
| 48 |
+
function $\mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } )$ defined on the samples in the $k$ -th subset, where $\theta = 1$ is a “dummy” parameter used to evaluate the invariance of the SSL loss across the subsets (later discussed in Step 1). For example, $\mathcal { L }$ can be defined as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } ) = \sum _ { \mathbf { x } \in \mathcal { X } _ { k } } - \log \frac { \exp \left( \mathbf { x } ^ { T } \mathbf { x } ^ { * } \cdot \theta \right) } { \sum _ { \mathbf { x ^ { \prime } } \in \mathcal { X } _ { k } \cup \mathcal { X } ^ { * } \setminus \mathbf { x } } \exp \left( \mathbf { x } ^ { T } \mathbf { x } ^ { \prime } \cdot \theta \right) } ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\mathcal { X } _ { k } = \phi ( \{ I _ { i } | P _ { i , k } = 1 \} )$ , and $\mathbf { x } ^ { * } \in \mathcal { X } ^ { * }$ is the augmented view feature of $\mathbf { x } \in \mathcal { X } _ { k }$ .
|
| 55 |
+
|
| 56 |
+
Input. $N$ training images. Randomly initialized $\phi$ . A partition matrix $\mathbf { P }$ initialized such that the first column of $\mathbf { P }$ is 1, i.e., all samples belong to the first subset. Set $\mathcal { P } = \{ \bf P \}$ .
|
| 57 |
+
|
| 58 |
+
Output. Disentangled feature extractor $\phi$ .
|
| 59 |
+
|
| 60 |
+
Step 1 [Update $\phi ]$ . We update $\phi$ by:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\operatorname* { m i n } _ { \phi } \sum _ { \mathbf { P } \in \mathcal { P } } \sum _ { k = 1 } ^ { 2 } \left[ \mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } ) + \lambda _ { 1 } \left. \nabla _ { \theta = 1 } \mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } ) \right. ^ { 2 } \right] ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\lambda _ { 1 }$ is a hyper-parameter. The second term delineates how far the contrast in one subset is from a constant baseline $\theta = 1$ . The minimization of both of them encourages $\phi$ in different subsets close to the same baseline, i.e., invariance across the subsets. See IRM [2] for more details. In particular, the first iteration corresponds to the standard SSL with $\mathcal { X } _ { 1 }$ in Eq. (1) containing all training images.
|
| 67 |
+
|
| 68 |
+
Step 2 [Update P]. We fix $\phi$ and find a new partition $\mathbf { P } ^ { * }$ by
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
{ \bf P } ^ { * } = \arg \operatorname* { m a x } _ { { \bf P } } \sum _ { { \bf k } = 1 } ^ { 2 } \left[ \mathcal { L } ( \phi , \theta = 1 , k , { \bf P } ) + \lambda _ { 2 } \| \nabla _ { \theta = 1 } \mathcal { L } ( \phi , \theta = 1 , k , { \bf P } ) \| ^ { 2 } \right] ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\lambda _ { 2 }$ is a hyper-parameter. In practice, we use a continuous partition matrix in $\mathbb { R } ^ { N \times 2 }$ during optimization and then threshold it to $\{ 0 , 1 \} ^ { N \times 2 }$ .
|
| 75 |
+
|
| 76 |
+
We update $\mathcal { P } \mathcal { P } \cup \mathbf { P ^ { * } }$ and iterate the above two steps until convergence.
|
| 77 |
+
|
| 78 |
+
# 4 Justification
|
| 79 |
+
|
| 80 |
+
Recall that IP-IRM uses training sample partitions to learn the disentangled representations w.r.t. $\textstyle \prod _ { i = 1 } ^ { m } g _ { i }$ . As we have a $\mathcal { G }$ -equivariant feature map between the sample space $\mathcal { T }$ and feature space $\mathcal { X }$ (the equivariance is later guaranteed by Lemma 1), we slightly abuse the notation by using to denote both spaces. Also, we assume that $\mathcal { X }$ is a homogeneous space of $\mathcal { G }$ , i.e., any sample $\mathbf { x } ^ { \prime } \in \mathcal { X }$ can be transited from another sample $\mathbf { x }$ by a group action $g \cdot { \bf x }$ . Intuitively, $\mathcal { G }$ is all you need to describe the diversity of the training set. It is worth noting that $g$ is any group element in $\mathcal { G }$ while $g _ { i }$ is a Cartesian “building block” of $\mathcal { G }$ , e.g., $g$ can be decomposed by $( g _ { 1 } , g _ { 2 } , . . . , g _ { m } )$ .
|
| 81 |
+
|
| 82 |
+
We show that partition and group are tightly connected by the concept of orbit. Given a sample $\mathbf { x } \in \mathcal { X }$ , its group orbit w.r.t. $\mathcal { G }$ is a sample set $\mathcal { G } ( \mathbf { x } ) = \{ g \cdot \mathbf { \dot { x } } \mid g \in \mathcal { G } \}$ . As shown in Figure 3 (a), if $\mathcal { G }$ is a set of attributes shared by classes, e.g., “color” and “pose ”, the orbit is the sample set of the class of $\mathbf { x }$ ; in Figure 3 (b), if $\mathcal { G }$ denotes augmentations, the orbit is the set of augmented images. In particular, we can see that the disjoint orbits in Figure 3 naturally form a partition. Formally, we have the following definition:
|
| 83 |
+
|
| 84 |
+
Definition 2. (Orbit & Partition [47]) Given a subgroup $\mathcal { D } \subset \mathcal { G }$ , it partitions $\mathcal { X }$ into the disjoint subsets: $\{ \mathcal { D } ( c _ { 1 } \cdot \mathbf { x } ) , . . . , D ( c _ { k } \cdot \mathbf { x } ) \}$ , where $k$ is the number of cosets $\{ c _ { 1 } \mathcal { D } , . . . , c _ { k } \mathcal { D } \}$ , and the cosets form a factor group1 $\mathcal { G } / \mathcal { D } = \{ c _ { i } \} _ { i = 1 } ^ { k }$ . In particular, $c _ { i } \cdot \mathbf { x }$ can be considered as a sample of the i-th class, transited from any sample $\mathbf { x } \in \mathcal { X }$ .
|
| 85 |
+
|
| 86 |
+
Interestingly, the partition offers a new perspective for the training data format in Supervised Learning (SL) and Self-Supervised Learning (SSL). In SL, as shown in Figure 3 (a), the data is labeled with $k$ classes, each of which is an orbit with $\mathcal { D } ( c _ { i } \cdot \mathbf { x } )$ training samples, whose variations are depicted by the class-sharing attribute group $\mathcal { D }$ . The cross-orbit group action, e.g., $c _ { \mathrm { d o g } } \cdot \mathbf { x }$ , can be read as “turn $\mathbf { x }$ into a dog” and such “turn” is always valid due to the assumption that $\mathcal { X }$ is a homogeneous space of $\mathcal { G }$ . In SSL, as shown in Figure 3 (b), each training sample $\mathbf { x }$ is augmented by the group $\mathcal { D }$ . So, $\mathcal { D } ( c _ { i } \cdot \mathbf { x } )$ consists of all the augmentations of the $i$ -th sample, where the cross-orbit group action $c _ { i } \cdot \mathbf { x }$ can be read as “turn $\mathbf { x }$ into the $i$ -th sample”.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 3: Each orbit only illustrates with 5 samples. (a) Orbit: the training samples of a class; $\mathcal { D }$ in-orbit actions: intra-class variations $\cdot { } 2$ :standing, $2 3$ :blacken, $3 { } 4$ :jumping, $4 { } 5$ :whiten, $5 { } 1$ :running); $\mathcal { G } / \mathcal { D }$ cross-orbit actions: inter-class variations. (b) Orbit: a sample and its augmented samples; $\mathcal { D }$ in-orbit actions: augmentations $1 \to 2$ :clock-wise rotation, $2 3$ :color jitter, $3 { } 4$ :gray scale, $4 { } 5$ :counterclockwise rotation, $5 { } 1$ :color); $\mathcal { G } / \mathcal { D }$ cross-orbit actions: inter-sample variations. (c) Step 2 in IP-IRM discovers 2 orbits, where the cross-orbit action corresponds to a group action “green to red” or “red to green”, which is yet disentangled.
|
| 90 |
+
|
| 91 |
+
Thanks to the orbit and partition view of training data, we are ready to revisit model generalization in a group-theoretic view by using invariance and equivariance—the two sides of the coin, whose name is disentanglement. For SL, we expect that a good feature is disentangled into a class-agnostic part and a class-specific part: the former (latter) is invariant (equivariant) to $\mathcal { G } / \mathcal { D }$ —cross-orbit traverse, but equivariant (invariant) to $\mathcal { D }$ —in-orbit traverse. By using such feature, a model can generalize to diverse testing samples (limited to $| \mathcal D |$ variations) by only keeping the class-specific feature. Formally, we prove that we can achieve such disentanglement by contrastive learning:
|
| 92 |
+
|
| 93 |
+
Lemma 1. (Disentanglement by Contrastive Learning) Training loss $\begin{array} { r } { - \log \frac { \exp ( \mathbf { x } _ { i } ^ { T } \mathbf { x } _ { j } ) } { \sum _ { \mathbf { x } \in \mathcal { X } } \exp ( \mathbf { x } _ { j } ^ { T } \mathbf { x } ) } } \end{array}$ disentangles $\mathcal { X }$ w.r.t. $( \mathcal { G } / \mathcal { D } ) \times \mathcal { D }$ , where $\mathbf { x } _ { i }$ and $\mathbf { x } _ { j }$ are from the same orbit.
|
| 94 |
+
|
| 95 |
+
We can draw the following interesting corollaries from Lemma 1 (details in Appendix):
|
| 96 |
+
|
| 97 |
+
1. If we use all the samples in the denominator of the loss, we can approximate to $\mathcal { G }$ -equivariant features given limited training samples. This is because the loss minimization guarantees $\forall ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) { \overset { - } { \in } } { \mathcal { X } } \times { \mathcal { X } } , i \neq j { \bar { \mathbf { x } } } _ { i } \neq { \bar { \mathbf { x } _ { j } } }$ , i.e., any pair corresponds to a group action.
|
| 98 |
+
2. Conventional cross-entropy loss in SL is a special case, if we define $\mathbf { x } \in \mathcal { X } = \{ \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { k } \}$ as $k$ classifier weights. So, SL does not guarantee the disentanglement of $\mathcal { G } / \mathcal { D }$ , which causes generalization error if the class domain of downstream task is different from SL pre-training, e.g., a subset of $\mathcal { G } / \mathcal { D }$ .
|
| 99 |
+
3. In contrastive learning based SSL, $\mathcal { D } =$ “augmentations” (recall Figure 2), and the number of augmentations $| \mathcal { D } _ { \mathrm { a u g } } |$ is generally much smaller compared to the class-wise sample diversity $| \mathcal { D } _ { \mathrm { S L } } |$ in SL. This enables the SL model to generalize to more diverse testing samples $( | \mathcal { D } _ { \mathrm { S L } } | )$ by filtering out the class-agnostic features (e.g., background) and focusing on the class-specific ones (e.g., foreground), which explains why SSL is worse than SL in downstream classification.
|
| 100 |
+
4. In SL, if the number of training samples per orbit is not enough, i.e., smaller than $\left| \mathcal { D } ( c _ { i } \cdot \mathbf { x } ) \right|$ , the disentanglement between $\mathcal { D }$ and $\mathcal { G } / \mathcal { D }$ cannot be guaranteed, such as the challenges in few-shot learning [96]. Fortunately, in SSL, the number is enough as we always include all the augmented samples in training. Moreover, we conjecture that $\mathcal { D } _ { \mathrm { a u g } }$ only contains simple cyclic group elements such as rotation and colorization, which are easier for representation learning.
|
| 101 |
+
|
| 102 |
+
Lemma 1 does not guarantee the decomposability of each $d \in \mathcal { D }$ . Nonetheless, the downstream model can still generalize by keeping the class-specific features affected by $\mathcal { G } / \mathcal { D }$ . Therefore, the key to fill the gap or even let SSL surpass SL is to achieve the full disentanglement of $\mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ .
|
| 103 |
+
|
| 104 |
+
Table 1: Results on disentanglement metrics of existing unsupervised disentanglement methods, standard SSL (SimCLR [16]) and IP-IRM using CMNIST [2] and Shapes3D [50]. Note that IRS is based on intervening the semantics which requires access to the labels of all the semantics, and hence not applicable for CMNIST dataset. Results are averaged over 4 trails (mean $\pm$ std).
|
| 105 |
+
|
| 106 |
+
<table><tr><td></td><td>Method</td><td>DCI</td><td>IRS</td><td>MOD</td><td>EXP</td><td>LR</td><td>GBT</td><td>Average</td></tr><tr><td rowspan="6">CSINI</td><td>VAE [51]</td><td>0.948±0.004</td><td>1</td><td>0.664±0.121</td><td>0.968±0.007</td><td>0.824±0.019</td><td>0.948±0.004</td><td>0.849±0.057</td></tr><tr><td>β-VAE [41]</td><td>0.945±0.002</td><td>=</td><td>0.705±0.073</td><td>0.963±0.006</td><td>0.809±0.013</td><td>0.945±0.003</td><td>0.874±0.015</td></tr><tr><td>β-AnnealVAE [9]</td><td>0.911±0.002</td><td></td><td>0.790±0.075</td><td>0.965±0.007</td><td>0.821±0.022</td><td>0.911±0.002</td><td>0.880±0.016</td></tr><tr><td>β-TCVAE[15]</td><td>0.914±0.008</td><td></td><td>0.864±0.095</td><td>0.962±0.010</td><td>0.801±0.024</td><td>0.914±0.008</td><td>0.891±0.014</td></tr><tr><td>Factor-VAE [50]</td><td>0.916±0.004</td><td>=</td><td>0.893±0.056</td><td>0.947±0.011</td><td>0.770±0.025</td><td>0.916±0.005</td><td>0.888±0.014</td></tr><tr><td>SimCLR [16]</td><td>0.882±0.019</td><td></td><td>0.767±0.025</td><td>0.976±0.011</td><td>0.863±0.036</td><td>0.876±0.015</td><td>0.873±0.016</td></tr><tr><td rowspan="7">ssssder</td><td>IP-IRM (Ours)</td><td>0.917±0.008</td><td></td><td>0.785±0.031</td><td>0.990±0.002</td><td>0.921±0.009</td><td>0.916±0.007</td><td>0.906±0.011</td></tr><tr><td>VAE [51]</td><td>0.351±0.026</td><td>0.284±0.009</td><td>0.820±0.015</td><td>0.802±0.054</td><td>0.421±0.079</td><td>0.352±0.027</td><td>0.505±0.028</td></tr><tr><td>β-VAE [41]</td><td>0.369±0.021</td><td>0.283±0.012</td><td>0.782±0.034</td><td>0.807±0.018</td><td>0.427±0.025</td><td>0.368±0.023</td><td>0.506±0.011</td></tr><tr><td>β-AnnealVAE [9]</td><td>0.327±0.069</td><td>0.412±0.049</td><td>0.743±0.070</td><td>0.643±0.013</td><td>0.259±0.021</td><td>0.328±0.070</td><td>0.452±0.023</td></tr><tr><td>β-TCVAE[15]</td><td>0.470±0.035</td><td>0.291±0.023</td><td>0.777±0.031</td><td>0.821±0.054</td><td>0.439±0.084</td><td>0.469±0.034</td><td>0.545±0.032</td></tr><tr><td>Factor-VAE [50]</td><td>0.340±0.021</td><td>0.316±0.016</td><td>0.815±0.041</td><td>0.738±0.043</td><td>0.319±0.045</td><td>0.339±0.021</td><td>0.478±0.020</td></tr><tr><td>SimCLR[16]</td><td>0.535±0.016</td><td>0.439±0.030</td><td>0.678±0.050</td><td>0.949±0.005</td><td>0.733±0.055</td><td>0.536±0.015</td><td>0.645±0.026</td></tr><tr><td></td><td>IP-IRM (Ours)</td><td>0.565±0.023</td><td>0.420±0.014</td><td>0.766±0.036</td><td>0.959±0.007</td><td>0.757±0.025</td><td>0.565±0.023</td><td>0.672±0.017</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Theorem 1. The representation is fully disentangled w.r.t. $\mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ if and only $\vert f \forall c _ { i } \in \mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ , the contrastive loss in Eq. (1) is invariant to the 2 orbits of partition $\{ \mathcal { G } ^ { \prime } ( c _ { i } \cdot \mathbf { x } ) , \mathcal { G } ^ { \prime } ( c _ { i } ^ { - 1 } \cdot \mathbf { x } ) \}$ , where $\mathcal { G } ^ { \prime } = \mathcal { G } / c _ { i } = \mathcal { D } _ { \mathrm { a u g } } \times c _ { 1 } \times . . . \times c _ { i - 1 } \times c _ { i + 1 } \times . . . \times c _ { k }$ .
|
| 109 |
+
|
| 110 |
+
The maximization in Step 2 is based on the contra-position of the sufficient condition of Theorem 1. Denote the currently disentangled group as $\mathcal { D }$ (initially $\mathcal { D } _ { \mathrm { a u g . } }$ ). If we can find a partition $\mathbf { P } ^ { * }$ to maximize the loss in Eq. (3), i.e., SSL loss is variant across the orbits, then $\exists h \in { \mathcal { G } } / { \mathcal { D } }$ such that the representation of $h$ is entangled, i.e., $\mathbf { P ^ { * } } = \{ { \mathcal { D } } ( h \cdot \mathbf { x } ) , { \mathcal { D } } ( h ^ { - 1 } \cdot \mathbf { x } ) \}$ . Figure 3 (c) illustrates a discovered partition about color. The minimization in Step 1 is based on the necessary condition of Theorem 1. Based on the discovered $\mathbf { P } ^ { * }$ , if we minimize Eq. (2), we can further disentangle $h$ and update $\mathcal { D } \mathcal { D } \times h$ . Overall, IP-IRM converges as $\mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ is finite. Note that an improved contrastive objective [92] can further disentangle each $d \in \mathcal { D } _ { \mathrm { a u g } }$ and achieve full disentanglement w.r.t. $\mathcal { G }$ .
|
| 111 |
+
|
| 112 |
+
# 5 Experiments
|
| 113 |
+
|
| 114 |
+
# 5.1 Unsupervised Disentanglement
|
| 115 |
+
|
| 116 |
+
Datasets. We used two datasets. CMNIST [2] has 60,000 digit images with semantic labels of digits (0-9) and colors (red and green). These images differ in other semantics (e.g., slant and font) that are not labeled. Moreover, there is a strong correlation between digits and colors (most 0-4 in red and 5-9 in green), increasing the difficulty to disentangle them. Shapes3D [50] contains 480,000 images with 6 labelled semantics, i.e., size, type, azimuth, as well as floor, wall and object color. Note that we only considered the first three semantics for evaluation, as the standard augmentations in SSL will contaminate any color-related semantics.
|
| 117 |
+
|
| 118 |
+
Settings. We adopted 6 representative disentanglement metrics: Disentangle Metric for Informativeness (DCI) [29], Interventional Robustness Score (IRS) [79], Explicitness Score (EXP) [72], Modularity Score (MOD) [72] and the accuracy of predicting the ground-truth semantic labels by two classification models called logistic regression (LR) and gradient boosted trees (GBT) [59]. Specifically, DCI and EXP measure the explicitness, i.e., the values of semantics can be decoded from the feature using a linear transformation. MOD and IRS measure the modularity, i.e., whether each feature dimension is equivariant to the shift of a single semantic. See Appendix for more detailed formula of the metrics. In evaluation, we trained CNN-based feature extractor backbones with comparable number of parameters for all the baselines and our IP-IRM. The full implementation details are in Appendix.
|
| 119 |
+
|
| 120 |
+
Results. In Table 1, we compared the proposed IP-IRM to the standard SSL method SimCLR [16] as well as several generative disentanglement methods [51, 41, 9, 15, 50]. On both CMNIST and Shapes3D dataset, IP-IRM outperforms SimCLR regarding all metrics except for only IRS where the most relative gain is $8 . 8 \%$ for MOD. For this MOD, we notice that VAE performs better than our IP-IRM by 6 points, i.e., 0.82 v.s. 0.76 for Shapes3D. This is because VAE explicitly pursues a high modularity score through regularizing the dimension-wise independence in the feature space. However, this regularization is adversarial to discriminative objectives [14, 95]. Indeed, we can observe from the column of LR (i.e., the performance of downstream linear classification) that VAE methods have clearly poor performance especially on the more challenging dataset Shapes3D. We can draw the same conclusion from the results of GBT. Different from VAE methods, our IP-IRM is optimized towards disentanglement without such regularization, and is thus able to outperform the others in downstream tasks while obtaining a competitive value of modularity.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: The t-SNE [85] visualizations of learned feature spaces using SimCLR [16] and IP-IRM on CMNIST [2] and STL10 [22]. For CMIST in (a), we annotate the digit and color near each cluster. We annotate only half of the feature points for SimCLR to avoid clutter. For STL10 in (b), we show the labels of the classes.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: (a) Visualization of the obtained partitions $\mathbf { P } ^ { * }$ during training. Each partition has two subset and the displayed images are randomly sampled from each subset. (b) Visualization of the variance of each feature dimension when perturbing the semantic indicated on the left. The most equivariant dimensions are indicated by triangles and their corresponding indices.
|
| 127 |
+
|
| 128 |
+
What do IP-IRM features look like? Figure 4 visualizes the features learned by SimCLR and our IP-IRM on two datasets: CMNIST in Figure 4 (a) and STL10 dataset in Figure 4 (b). In the following, we use Figure 4 (a) as the example, and can easily draw the similar conclusions from Figure 4 (b). On the left-hand side of Figure 4 (a), it is obvious that there is no clear boundary to distinguish the semantic of color in the SimCLR feature space. Besides, the features of the same digit semantic are scattered in two regions. On the right-hand side of (a), we have 3 observations for IP-IRM. 1) The features are well clustered and each cluster corresponds to a specific semantic of either digit or color. This validates the equivariant property of IP-IRM representation that it responds to any changes of the existing semantics, e.g., digit and color on this dataset. 2) The feature space has the symmetrical structure for each individual semantic, validating the decomposable property of IP-IRM representation. More specifically, i) mirroring a feature (w.r.t. “\*” in the figure center) indicates the change on the only semantic of color, regardless of the other semantic (digit); and ii) a counterclockwise rotation (denoted by black arrows from same-colored 1 to 7) indicates the change on the only semantic of digit. 3) IP-IRM reveals the true distribution (similarity) of different classes. For example, digits 3, 5, 8 sharing sub-parts (curved bottoms and turnings) have closer feature points in the IP-IRM feature space.
|
| 129 |
+
|
| 130 |
+
How does IP-IRM disentangle features? 1) Discovered $\mathbf { P } ^ { * }$ : To visualize the discovered partitions $\mathbf { P } ^ { * }$ at each maximization step, we performed an experiment on a binary CMNIST (digit 0 and 1 in color red and green), and show the results in Figure 5 (a). Please kindly refer to Appendix for the full results on CMNIST. First, each partition tells apart a specific semantic into two subsets, e.g., in Partition #1, red and green digits are separated. Second, besides the obvious semantics—digit and color (labelled on the dataset), we can discover new semantics, e.g., the digit slant shown in Partition #3. 2) Disentangled Representation: In Figure 5 (b), we aim to visualize how equivariant each feature dimension is to the change of each semantic, i.e., a darker color shows that a dimension is more equivariant w.r.t. the semantic indicated on the left. We can see that SimCLR fails to learn the decomposable representation, e.g., the 8-th dimension captures azimuth, type and size in Shapes3D. In contrast, our IP-IRM achieves disentanglement by representing the semantics into interpretable dimensions, e.g., the 6-th and 7-th dimensions captures the size, the 4-th for type and the 2-nd and 9-th for azimuth on the Shapes3D. Overall, the results support the justification in Section 4, i.e., we discover a new semantic (affected by $h$ ) through the partition $\mathbf { P } ^ { * }$ at each iteration and IP-IRM eventually converges with a disentangled representation.
|
| 131 |
+
|
| 132 |
+
# 5.2 Self-Supervised Learning
|
| 133 |
+
|
| 134 |
+
Datasets and Settings. We conducted the SSL evaluations on 2 standard benchmarks following [88, 20, 48]. Cifar100 [54] contains 60,000 images in 100 classes and STL10 [22] has 113,000 images in 10 classes. We used SimCLR [16], DCL [20] and HCL [48] as baselines, and learned the representations for 400 and 1000 epochs. We evaluated both linear and $k$ -NN $k = 2 0 0$ ) accuracies for the downstream classification task. Implementation details are in appendix.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">STL10</td><td colspan="2">Cifar100</td></tr><tr><td>k-NN</td><td>Linear</td><td>k-NN</td><td>Linear</td></tr><tr><td colspan="5">400 epoch training</td></tr><tr><td>SimCLR[16]</td><td>73.60</td><td>78.89</td><td>54.94</td><td>66.63</td></tr><tr><td>DCL [20]</td><td>78.82</td><td>82.56</td><td>57.29</td><td>68.59</td></tr><tr><td>HCL [48]</td><td>80.06</td><td>87.60</td><td>59.61</td><td>69.22</td></tr><tr><td>SimCLR+IP-IRM</td><td>79.66</td><td>84.44</td><td>59.10</td><td>69.55</td></tr><tr><td>DCL+IP-IRM</td><td>81.51</td><td>85.36</td><td>58.37</td><td>68.76</td></tr><tr><td>HCL+IP-IRM</td><td>84.29</td><td>87.81</td><td>60.05</td><td>69.95</td></tr><tr><td colspan="5">1,000 epoch training</td></tr><tr><td>SimCLR[16]</td><td>78.60</td><td>84.24</td><td>59.45</td><td>68.73</td></tr><tr><td>SimCLR† [55]</td><td>79.80</td><td>85.56</td><td>63.67</td><td>72.18</td></tr><tr><td>SimCLR+IP-IRM</td><td>85.08</td><td>89.91</td><td>65.82</td><td>73.99</td></tr><tr><td>Supervised*</td><td>=</td><td>=</td><td>=</td><td>73.72</td></tr><tr><td>Supervised*+MixUp [97]</td><td></td><td>=</td><td>=</td><td>74.19</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 2: Accuracy $( \% )$ of $k$ -NN and linear classifiers on STL10 [22] and Cifar100 [54] using the representations of SimCLR [16], DCL [20], HCL [48] and those after incorporating our IPIRM. ${ \bf S i m C L R } ^ { \dagger }$ denotes $\mathrm { S i m C L R }$ with MixUp regularization. Supervised∗ represents the supervised learning that keeps the same codebase, optimizer and parameters with SSL stage-2 fine-tuning while only adds the learning rate decay at 60 and 80 epoch.
|
| 139 |
+
|
| 140 |
+
Results. We demonstrate our results and compare with baselines in Table 2. Incorporating IP-IRM to the 3 baselines brings consistent performance boosts to downstream classification models in all settings, e.g., improving the linear models by $5 . 5 5 \%$ on STL10 and $2 . 9 2 \%$ on Cifar100. In particular, we observe that IP-IRM brings huge performance gain with $k$ -NN classifiers, e.g., $4 . 2 3 \%$ using $\mathrm { H C L + I P }$ -IRM on STL10, i.e., the distance metrics in the IP-IRM feature space more faithfully reflects the class semantic differences. This validates that our algorithm further disentangles compared to the standard SSL Moreover, by extending the training process to 1,000 epochs with MixUp [55], SimCLR+IP-IRM achieves further performance boost on both datasets, e.g., $5 . 2 8 \%$ for $k$ -NN and $4 . 3 5 \%$ for linear classifier over SimCLR baseline on STL10 dataset.
|
| 141 |
+
|
| 142 |
+
Notably, our SimCLR $^ +$ IP-IRM surpasses vanilla supervised learning on Cifar100 under the same evaluation setting. Still, the quality of disentanglement cannot be fully evaluated when the training and test samples are identically distributed—while the improved accuracy demonstrates that IP-IRM representation is more equivariant to class semantics, it does not reveal if the representation is decomposable. Hence we present an out-of-distribution (OOD) setting in Section 5.3 to further show this property.
|
| 143 |
+
|
| 144 |
+
Is IP-IRM sensitive to the values of hyper-parameters? 1) $\lambda _ { 1 }$ and $\lambda _ { 2 }$ in $E q$ . (2) and $E q$ . (3). In Figure 6 (a), we observe that the best performance is achieved with $\lambda _ { 1 }$ and $\lambda _ { 2 }$ taking values from 0.2 to 0.5 on both datasets. All accuracies drop sharply if using $\lambda _ { 1 } = 1 . 0$ . The reason is that a higher $\lambda _ { 1 }$ forces the model to push the $\phi$ -induced similarity to fixed baseline $\theta = 1$ , rather than decrease the loss $\mathcal { L }$ on the pretext task, leading to poor convergence. 2) The number of epochs. In Figure 6 (b), we plot the Top-1 accuracies of using $k$ -NN classifiers along the 700-epoch training of two kinds of SSL representations—SimCLR and IP-IRM. It is obvious that IP-IRM converges faster and achieves a higher accuracy than SimCLR. It is worth to highlight that on the STL10, the accuracy of SimCLR starts to oscillate and grow slowly after the 150-th epoch, while ours keeps on improving. This is an empirical evidence that IP-IRM keeps on disentangling more and more semantics in the feature space, and has the potential of improvement through long-term training.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: Our ablation study on the STL10 and Cifar100 datasets. (a) The Top-1 accuracy $( \% )$ of linear classifiers using different values of $\lambda _ { 1 }$ and $\lambda _ { 2 }$ (in Eq. (2) and Eq. (3)), by training for 200 epochs on two datasets. (b) The Top-1 accuracy $( \% )$ of $k$ -NN classifiers on two datasets, for which we trained the models for 700 epochs and updated $\mathbf { P }$ every 50 epochs.
|
| 148 |
+
|
| 149 |
+
# 5.3 Potential on Large-Scale Data
|
| 150 |
+
|
| 151 |
+
Datasets. We evaluated on the standard benchmark of supervised learning ImageNet ILSVRC2012 [25] which has in total 1,331,167 images in 1,000 classes. To further reveal if a representation is decomposable, we used NICO [37], which is a real-world image dataset designed for OOD evaluations. It contains 25,000 images in 19 classes, with a strong correlation between the foreground and background in the train split (e.g., most dogs on grass). We also studied the transferability of the learned representation following [30, 52]: FGVC Aircraft (Aircraft) [60], Caltech-101 (Caltech) [31], Stanford Cars (Cars) [93], Cifar10 [53], Cifar100 [53], DTD [21], Oxford 102 Flowers (Flowers) [62], Food-101 (Food) [6], Oxford-IIIT Pets (Pets) [67] and SUN397 (SUN) [91]. These datasets include coarse- to fine-grained classification tasks, and vary in the amount of training data (2,000-75,000 images) and classes (10-397 classes), representing a wide range of transfer learning settings.
|
| 152 |
+
|
| 153 |
+
Settings. For the ImageNet, all the representations were trained for 200 epochs due to limited computing resources. We followed the common setting [80, 36], using a linear classifier, and report Top-1 classification accuracies. For NICO, we fixed the ImageNet pre-trained ResNet-50 backbone and fine-tuned the classifier. See appendix for more training details. For the transfer learning, we followed [30, 52] to report the classification accuracies on Cars, Cifar-10, Cifar-100, DTD, Food, SUN and the average per-class accuracies on Aircraft, Caltech, Flowers, Pets. We call them uniformly as Accuracy. We used the few-shot $n$ -way- $k$ -shot setting for model evaluation. Specifically, we randomly sampled 2,000 episodes from the test splits of above datasets. An episode contains $n$ classes, each with $k$ training samples and 15 testing samples, where we fine-tuned the linear classifier (backbone weights frozen) for 100 epochs on the training samples, and evaluated the classifier on the testing samples. We evaluated with $n = k = 5$ (results of $n = 5 , k = 2 0$ in Appendix).
|
| 154 |
+
|
| 155 |
+
ImageNet and NICO. In Table 3 ImageNet accuracy, our IP-IRM achieves the best performance over all baseline models. Yet we believe that this does not show the full potential of IP-IRM, because ImageNet is a larger-scale dataset with many semantics, and it is hard to achieve a full disentanglement of all semantics within the limited 200 epochs. To evaluate the feature decomposability of IPIRM, we compared the performance on NICO with various SSL baselines in Table 3, where our approach significantly outperforms the baselines by $1 . 5 – 4 . 2 \%$ . This validates IP-IRM feature is more decomposable—if each semantic feature (e.g., background) is decomposed in some fixed dimensions and some classes vary with such semantic, then the classifier will recognize this as a non-discriminative variant feature and hence focus on other more discriminative features (i.e., foreground). In this way, even though some classes are confounded by those non-discriminative features (e.g., most of the “dog” images are with “grass” background), the fixed dimensions still help classifiers neglect those non-discriminative ones. We further visualized the CAM [98] on NICO in Figure 7, which indeed shows that IP-IRM helps the classifier focus on the foreground regions.
|
| 156 |
+
|
| 157 |
+
Table 3: ImageNet and NICO Top-1 Accuracy $( \% )$ of linear classifiers trained on the representations learnt with different SSL methods.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Method</td><td>ImageNet</td><td>NICO</td></tr><tr><td>InsDis [90]</td><td>56.5</td><td>65.6</td></tr><tr><td>PCL [56]</td><td>61.5</td><td>72.6</td></tr><tr><td>PIRL [61]</td><td>63.6</td><td>69.1</td></tr><tr><td>MoCo-v1 [36]</td><td>60.6</td><td>69.3</td></tr><tr><td>SimCLR (repro.) [16]</td><td>63.1</td><td>64.5</td></tr><tr><td>MoCo-v2 (repro.)[18]</td><td>67.3</td><td>78.0</td></tr><tr><td>SimSiam (repro.) [19]</td><td>68.8</td><td>66.7</td></tr><tr><td>SimCLR+IP-IRM</td><td>64.8</td><td>66.7</td></tr><tr><td>MoCo-v2+IP-IRM</td><td>67.6</td><td>79.5</td></tr><tr><td>SimSiam+IP-IRM</td><td>69.1</td><td></td></tr><tr><td></td><td></td><td>70.9</td></tr></table>
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 7: Visualization of CAM [98] on images from NICO [37] dataset using representations of the baseline MoCo-v2 [18] and our IP-IRM.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Method</td><td>Aircraft</td><td>Caltech</td><td>Cars</td><td>Cifar10</td><td>Cifar100</td><td>DTD</td><td>Flowers</td><td>Food</td><td>Pets</td><td>SUN</td><td>Average</td></tr><tr><td>InsDis [90]</td><td>35.07</td><td>75.97</td><td>37.49</td><td>51.49</td><td>57.61</td><td>69.38</td><td>77.35</td><td>50.01</td><td>66.38</td><td>74.97</td><td>59.57</td></tr><tr><td>PCL [56]</td><td>36.86</td><td>90.72</td><td>39.68</td><td>59.26</td><td>60.78</td><td>69.53</td><td>67.50</td><td>57.06</td><td>88.31</td><td>84.51</td><td>65.42</td></tr><tr><td>PIRL [61]</td><td>36.70</td><td>78.63</td><td>39.21</td><td>49.85</td><td>55.23</td><td>70.43</td><td>78.37</td><td>51.61</td><td>69.40</td><td>76.64</td><td>60.61</td></tr><tr><td>MoCo-v1 [36]</td><td>35.31</td><td>79.60</td><td>36.35</td><td>46.96</td><td>51.62</td><td>68.76</td><td>75.42</td><td>49.77</td><td>68.32</td><td>74.77</td><td>58.69</td></tr><tr><td>MoCo-v2[18]</td><td>31.98</td><td>92.32</td><td>41.47</td><td>56.50</td><td>63.33</td><td>78.00</td><td>80.05</td><td>57.25</td><td>83.23</td><td>88.10</td><td>67.22</td></tr><tr><td>IP-IRM (Ours)</td><td>32.98</td><td>93.16</td><td> 42.87</td><td>60.73</td><td>68.54</td><td>79.30</td><td>82.68</td><td>59.61</td><td>85.23</td><td>89.38</td><td>69.44</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 4: Accuracy $( \% )$ of 5-way-5-shot few-shot evaluation using the image representation learned on ImageNet [25]. More detailed results are given in Appendix.
|
| 167 |
+
|
| 168 |
+
Few-Shot Tasks. As shown in Table 4, our IP-IRM significantly improves the performance of 5-way-5-shot setting, e.g., we outperform the baseline MoCo-v2 by $2 . 2 \%$ . This is because IP-IRM can further disentangled $\mathcal { G } \backslash \mathcal { D } _ { \mathrm { a u g } }$ over SSL, which is essential for representations to generalize to different downstream class domains (recall Corollary 2 of Lemma 1). This is also in line with recent works [86] showing that a disentangled representation is especially beneficial in low-shot scenarios, and further demonstrates the importance of disentanglement in downstream tasks.
|
| 169 |
+
|
| 170 |
+
# 6 Conclusion
|
| 171 |
+
|
| 172 |
+
We presented an unsupervised disentangled representation learning method called Iterative Partitionbased Invariant Risk Minimization (IP-IRM), based on Self-Supervised Learning (SSL). IP-IRM iteratively partitions the dataset into semantic-related subsets, and learns a representation invariant across the subsets using SSL with an IRM loss. We show that with theoretical guarantee, IP-IRM converges with a disentangled representation under the group-theoretical view, which fundamentally surpasses the capabilities of existing SSL and fully-supervised learning. Our proposed theory is backed by strong empirical results in disentanglement metrics, SSL classification accuracy and transfer performance. IP-IRM achieves disentanglement without using generative models, making it widely applicable on large-scale visual tasks. As future directions, we will continue to explore the application of group theory in representation learning and seek additional forms of inductive bias for faster convergence.
|
| 173 |
+
|
| 174 |
+
# Acknowledgments and Disclosure of Funding
|
| 175 |
+
|
| 176 |
+
The authors would like to thank all reviewers for their constructive suggestions. This research is partly supported by the Alibaba-NTU Joint Research Institute, the A\*STAR under its AME YIRG Grant (Project No. A20E6c0101), and the Singapore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 2 grant.
|
| 177 |
+
|
| 178 |
+
References [1] Philip W Anderson. More is different. Science, 1972. [2] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. [3] Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. arXiv preprint arXiv:1906.00910, 2019. [4] Yoshua Bengio. Learning deep architectures for AI. Now Publishers Inc, 2009. [5] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013. [6] Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101–mining discriminative components with random forests. In European conference on computer vision, 2014. [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:737–744, 1993. [8] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems, 2020. [9] Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in $\beta$ -vae. arXiv preprint arXiv:1804.03599, 2018.
|
| 179 |
+
[10] Ruichu Cai, Zijian Li, Pengfei Wei, Jie Qiao, Kun Zhang, and Zhifeng Hao. Learning disentangled semantic representation for domain adaptation. In IJCAI: proceedings of the conference, 2019.
|
| 180 |
+
[11] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 132–149, 2018.
|
| 181 |
+
[12] Mathilde Caron, Piotr Bojanowski, Julien Mairal, and Armand Joulin. Unsupervised pretraining of image features on non-curated data. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2959–2968, 2019.
|
| 182 |
+
[13] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020.
|
| 183 |
+
[14] Long Chen, Hanwang Zhang, Jun Xiao, Wei Liu, and Shih-Fu Chang. Zero-shot visual recognition using semantics-preserving adversarial embedding networks. In CVPR, 2018.
|
| 184 |
+
[15] Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in neural information processing systems, 2018.
|
| 185 |
+
[16] 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.
|
| 186 |
+
[17] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in neural information processing systems, 2016.
|
| 187 |
+
[18] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020.
|
| 188 |
+
[19] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566, 2020.
|
| 189 |
+
[20] Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning. arXiv preprint arXiv:2007.00224, 2020.
|
| 190 |
+
[21] Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2014.
|
| 191 |
+
[22] Adam Coates, Andrew $\mathrm { N g }$ , 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, pages 215–223. JMLR Workshop and Conference Proceedings, 2011.
|
| 192 |
+
[23] Taco Cohen and Max Welling. Learning the irreducible representations of commutative lie groups. In International Conference on Machine Learning, 2014.
|
| 193 |
+
[24] Taco S Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical cnns. In ICLR, 2018.
|
| 194 |
+
[25] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 195 |
+
[26] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. 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), 2019.
|
| 196 |
+
[27] Kien Do and Truyen Tran. Theory and evaluation metrics for learning disentangled representations. In International conference on learning representations, 2020.
|
| 197 |
+
[28] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE international conference on computer vision, pages 1422–1430, 2015.
|
| 198 |
+
[29] Cian Eastwood and Christopher KI Williams. A framework for the quantitative evaluation of disentangled representations. In International conference on learning representations, 2018.
|
| 199 |
+
[30] Linus Ericsson, Henry Gouk, and Timothy M. Hospedales. How Well Do Self-Supervised Models Transfer? In CVPR, 2021.
|
| 200 |
+
[31] Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In 2004 conference on computer vision and pattern recognition workshop, 2004.
|
| 201 |
+
[32] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 2016.
|
| 202 |
+
[33] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 203 |
+
[34] 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.
|
| 204 |
+
[35] W.F.J. Harris, W. Fulton, and J. Harris. Representation Theory: A First Course. 1991.
|
| 205 |
+
[36] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
|
| 206 |
+
|
| 207 |
+
[37] Yue He, Zheyan Shen, and Peng Cui. Towards non-iid image classification: A dataset and baselines. Pattern Recognition, 110:107383, 2021.
|
| 208 |
+
|
| 209 |
+
[38] Olivier Henaff. Data-efficient image recognition with contrastive predictive coding. In International Conference on Machine Learning, pages 4182–4192. PMLR, 2020.
|
| 210 |
+
|
| 211 |
+
[39] I. Higgins, Loïc Matthey, A. Pal, C. Burgess, Xavier Glorot, M. Botvinick, S. Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017.
|
| 212 |
+
|
| 213 |
+
[40] Irina Higgins, David Amos, David Pfau, Sebastien Racaniere, Loic Matthey, Danilo Rezende, and Alexander Lerchner. Towards a definition of disentangled representations. arXiv preprint arXiv:1812.02230, 2018.
|
| 214 |
+
|
| 215 |
+
[41] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. International conference on learning representations, 2017.
|
| 216 |
+
|
| 217 |
+
[42] 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.
|
| 218 |
+
|
| 219 |
+
[43] Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li Fei-Fei, and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In Advances in neural information processing systems, 2018.
|
| 220 |
+
|
| 221 |
+
[44] 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.
|
| 222 |
+
|
| 223 |
+
[45] Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems, 2019.
|
| 224 |
+
|
| 225 |
+
[46] Andrew Jaegle, Stephen Phillips, Daphne Ippolito, and Kostas Daniilidis. Understanding image motion with group representations. 2018.
|
| 226 |
+
|
| 227 |
+
[47] Thomas W. Judson. Abstract Algebra: Theory and Applications (The Prindle, Weber & Schmidt Series in Advanced Mathematics). Prindle Weber & Schmidt, 1994.
|
| 228 |
+
|
| 229 |
+
[48] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. arXiv preprint arXiv:2010.01028, 2020.
|
| 230 |
+
|
| 231 |
+
[49] Theofanis Karaletsos, Serge Belongie, and Gunnar Rätsch. Bayesian representation learning with oracle constraints. International conference on learning representations, 2015.
|
| 232 |
+
|
| 233 |
+
[50] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, 2018.
|
| 234 |
+
|
| 235 |
+
[51] Diederik Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
|
| 236 |
+
|
| 237 |
+
[52] Simon Kornblith, Jonathon Shlens, and Quoc V Le. Do better imagenet models transfer better? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019.
|
| 238 |
+
|
| 239 |
+
[53] Alex Krizhevsky. Learning multiple layers of features from tiny images. 2012.
|
| 240 |
+
|
| 241 |
+
[54] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 242 |
+
|
| 243 |
+
[55] Kibok Lee, Yian Zhu, Kihyuk Sohn, Chun-Liang Li, Jinwoo Shin, and Honglak Lee. i-mix: A domain-agnostic strategy for contrastive representation learning. In ICLR, 2021.
|
| 244 |
+
|
| 245 |
+
[56] Junnan Li, Pan Zhou, Caiming Xiong, Richard Socher, and Steven CH Hoi. Prototypical contrastive learning of unsupervised representations. arXiv preprint arXiv:2005.04966, 2020.
|
| 246 |
+
[57] Zinan Lin, Kiran Thekumparampil, Giulia Fanti, and Sewoong Oh. Infogan-cr and modelcentrality: Self-supervised model training and selection for disentangling gans. In International Conference on Machine Learning, 2020.
|
| 247 |
+
[58] F. Locatello, M. Tschannen, S. Bauer, G. Rätsch, B. Schölkopf, and O. Bachem. Disentangling factors of variations using few labels. In 8th International Conference on Learning Representations (ICLR), 2020.
|
| 248 |
+
[59] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In international conference on machine learning, 2019.
|
| 249 |
+
[60] Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Finegrained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
|
| 250 |
+
[61] 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.
|
| 251 |
+
[62] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, 2008.
|
| 252 |
+
[63] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European conference on computer vision, pages 69–84. Springer, 2016.
|
| 253 |
+
[64] Utkarsh Ojha, Krishna Kumar Singh, Cho-Jui Hsieh, and Yong Jae Lee. Elastic-infogan: Unsupervised disentangled representation learning in class-imbalanced data. In Advances in neural information processing systems, 2020.
|
| 254 |
+
[65] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 255 |
+
[66] Giambattista Parascandolo, Niki Kilbertus, Mateo Rojas-Carulla, and Bernhard Schölkopf. Learning independent causal mechanisms. In Proceedings of the 35th International Conference on Machine Learning, pages 4036–4044, 2018.
|
| 256 |
+
[67] Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, 2012.
|
| 257 |
+
[68] Robin Quessard, Thomas Barrett, and William Clements. Learning disentangled representations and group structure of dynamical environments. Advances in Neural Information Processing Systems, 2020.
|
| 258 |
+
[69] Rajesh PN Rao and Daniel L Ruderman. Learning lie groups for invariant visual perception. Advances in neural information processing systems, 1999.
|
| 259 |
+
[70] Scott Reed, Kihyuk Sohn, Yuting Zhang, and Honglak Lee. Learning to disentangle factors of variation with manifold interaction. In International conference on machine learning, 2014.
|
| 260 |
+
[71] Xuanchi Ren, Tao Yang, Yuwang Wang, and Wenjun Zeng. Do generative models know disentanglement? contrastive learning is all you need. arXiv preprint arXiv:2102.10543, 2021.
|
| 261 |
+
[72] Karl Ridgeway and Michael C Mozer. Learning deep disentangled embeddings with the f-statistic loss. In Advances in neural information processing systems, 2018.
|
| 262 |
+
[73] Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka. Contrastive learning with hard negative samples. arXiv preprint arXiv:2010.04592, 2020.
|
| 263 |
+
[74] Bernhard Schölkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. On causal and anticausal learning. In Proceedings of the 29th International Conference on Machine Learning, 2012.
|
| 264 |
+
[75] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In 3rd International Conference on Learning Representations, 2015.
|
| 265 |
+
[76] Ivan Sosnovik, Michał Szmaja, and Arnold Smeulders. Scale-equivariant steerable networks. 2020.
|
| 266 |
+
[77] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 267 |
+
[78] Raphael Suter, Djordje Miladinovic, Stefan Bauer, and Bernhard Schölkopf. Interventional robustness of deep latent variable models. arXiv, 2018.
|
| 268 |
+
[79] Raphael Suter, Djordje Miladinovic, Bernhard Schölkopf, and Stefan Bauer. Robustly disentangled causal mechanisms: Validating deep representations for interventional robustness. In International Conference on Machine Learning, 2019.
|
| 269 |
+
[80] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019.
|
| 270 |
+
[81] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, European conference on computer vision, 2020.
|
| 271 |
+
[82] 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.
|
| 272 |
+
[83] Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. arXiv preprint arXiv:2102.06810, 2021.
|
| 273 |
+
[84] Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning gan for poseinvariant face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 274 |
+
[85] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
|
| 275 |
+
[86] Sjoerd Van Steenkiste, Francesco Locatello, Jürgen Schmidhuber, and Olivier Bachem. Are disentangled representations helpful for abstract visual reasoning? In Advances in neural information processing systems, 2019.
|
| 276 |
+
[87] Tan Wang, Chang Zhou, Qianru Sun, and Hanwang Zhang. Causal attention for unbiased visual recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
|
| 277 |
+
[88] Xudong Wang, Ziwei Liu, and Stella X Yu. Unsupervised feature learning by cross-level discrimination between instances and groups. arXiv preprint arXiv:2008.03813, 2020.
|
| 278 |
+
[89] Daniel E Worrall and Max Welling. Deep scale-spaces: Equivariance over scale. In NeurIPS, 2019.
|
| 279 |
+
[90] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3733–3742, 2018.
|
| 280 |
+
[91] Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition, 2010.
|
| 281 |
+
[92] Tete Xiao, Xiaolong Wang, Alexei A Efros, and Trevor Darrell. What should not be contrastive in contrastive learning. In International Conference on Learning Representations, 2021.
|
| 282 |
+
[93] Linjie Yang, Ping Luo, Chen Change Loy, and Xiaoou Tang. A large-scale car dataset for fine-grained categorization and verification. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 283 |
+
[94] Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6210–6219, 2019.
|
| 284 |
+
[95] Zhongqi Yue, Tan Wang, Hanwang Zhang, Qianru Sun, and Xian-Sheng Hua. Counterfactual zero-shot and open-set visual recognition. In CVPR, 2021.
|
| 285 |
+
[96] Zhongqi Yue, Hanwang Zhang, Qianru Sun, and Xian-Sheng Hua. Interventional few-shot learning. In NeurIPS, 2020.
|
| 286 |
+
[97] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018.
|
| 287 |
+
[98] 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, pages 2921–2929, 2016.
|
| 288 |
+
[99] Yizhe Zhu, Martin Renqiang Min, Asim Kadav, and Hans Peter Graf. S3vae: Self-supervised sequential vae for representation disentanglement and data generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020.
|
| 289 |
+
[100] Zhenyao Zhu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Multi-view perceptron: a deep model for learning face identity and view representations. Advances in Neural Information Processing Systems 27 (NIPS 2014), 2014.
|
md/train/RtNpzLdHUAW/RtNpzLdHUAW.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC SUBSET SELECTION FOR EFFICIENT TRAINING AND INFERENCE OF NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Current machine learning algorithms are designed to work with huge volumes of high dimensional data such as images. However, these algorithms are being increasingly deployed to resource constrained systems such as mobile devices and embedded systems. Even in cases where large computing infrastructure is available, the size of each data instance, as well as datasets, can provide a huge bottleneck in data transfer across communication channels. Also, there is a huge incentive both in energy and monetary terms in reducing both the computational and memory requirements of these algorithms. For non-parametric models that require to leverage the stored training data at the inference time, the increased cost in memory and computation could be even more problematic. In this work, we aim to reduce the volume of data these algorithms must process through an endto-end two-stage neural subset selection model, where the first stage selects a set of candidate points using a conditionally independent Bernoulli mask followed by an iterative coreset selection via a conditional Categorical distribution. The subset selection model is trained by meta-learning with a distribution of sets. We validate our method on set reconstruction and classification tasks with feature selection as well as the selection of representative samples from a given dataset, on which our method outperforms relevant baselines. We also show in our experiments that our method enhances scalability of non-parametric models such as Neural Processes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The recent success of deep learning algorithms partly owes to the availability of huge volume of data (Deng et al., 2009; Krizhevsky et al., 2009; Liu et al., 2015), which enables training of very large deep neural networks. However, the high dimensionality of each data instance and the large size of datasets makes it difficult, especially for resource-limited devices (Chan et al., 2018; Li et al., 2019; Bhatia et al., 2019), to store and transfer the dataset, or perform on-device learning with the data. This problem becomes more problematic for non-parametric models such as Neural Processes (Hensel, 1973; Kim et al., 2019a) which require the training dataset to be stored for inference. Therefore, it is appealing to reduce the size of the dataset, both at the instance (Dovrat et al., 2019; Li et al., 2018b;b) and the dataset level, such that we selects only a small number of samples from the dataset, each of which contains only few selected input features (e.g. pixels). Then, we could use the selected subset for the reconstruction of the entire set (either each instance or the entire dataset) or for a prediction task, such as classification.
|
| 12 |
+
|
| 13 |
+
The simplest way to obtain such a subset is random sampling, but it is highly sub-optimal in that it treats all elements in the set equally. However, the pixels from each image and examples from each dataset will have varying degree of importance (Katharopoulos & Fleuret, 2018) to a target task, whether it is reconstruction or prediction, and thus random sampling will generally incur large loss of accuracy for the target task. There exist some work on coreset construction (Huggins et al., 2016; Campbell & Broderick, 2018; 2019) which proposed to construct a small subset with the most important samples for Bayesian posterior inference. However, these methods cannot be applied straightforwardly to deep learning with an arbitrary target task. How can we then sample elements from the given set to construct a subset, such that it suffers from minimal accuracy loss on any target task? To this end, we propose to learn a sampler that learns to sample the most important samples for a given task, by training it jointly with the target task and additionally meta-learn a sampler over a distribution of datasets for instance selection in the classification task.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Concept: Our Stochastic Subset Selection method is generic and can be applied to many type of sets. (a) Selecting a subset of features (pixels) out of an image. This reduces communication cost in data transfer between devices and allows faster training or inference on resource-constrained devices due to the reduced computational cost. (b) Selecting a subset of instances out of a dataset. This helps resource-constrained system to train faster, or to make non-parametric inference more scalable.
|
| 17 |
+
|
| 18 |
+
Specifically, we learn the sampling rate for individual samples in two stages. First we learn a Bernoulli sampling rate for individual sample to efficiently screen out less important elements. Then, to select the most important elements out of this candidate set considering relative importance, we use a Categorical distribution to model the conditional distribution of sampling each element given a set of selected elements. After learning the sampling probability for each stage, we could perform stochastic selection of a given set, with linear time complexity. Our Stochastic Subset Selection (SSS) is a general framework to sample elements from a set, and it can be applied to both feature sampling and instance sampling. SSS can reduce the memory and computation cost required to process data while retaining performance on downstream tasks.
|
| 19 |
+
|
| 20 |
+
Our model can benefit from a wide range of practical applications. For example, when sending an image to an edge device with low computing power, instead of sending the entire image, we could send a subset of pixels with their coordinates, which will reduce both communication and inference cost. Similarly, edge devices may need to perform inference on a huge amount of data that could be represented as a set (e.g. video, point clouds) in real-time, and our feature selection could be used to speed up the inference. Moreover, our model could also help with on-device learning on personal data (e.g. photos), as it can select out examples to train the model at a reduced cost. Finally, it can help with the scalability of non-parametric models which requires storage of training examples, such as Neural Processes, to scale up to large-scale problems.
|
| 21 |
+
|
| 22 |
+
We validate our SSS model on multiple datasets for 1D function regression and 2D image reconstruction and classification for both feature selection and instance selection. The results show that our method is able to select samples with minimal decrease on the target task accuracy, largely outperforming random or an existing sampling method. Our contribution in this work is threefold:
|
| 23 |
+
|
| 24 |
+
• We propose a novel two-stage stochastic subset selection method that learns to sample a subset from a larger set with linear time complexity, with minimal loss of accuracy at the downstream task. We propose a framework that trains the subset selection model via meta-learning, such that it can generalize to unseen tasks. We validate the efficacy and generality of our model on various datasets for feature selection from an instance and instance selection from a dataset, on which it significantly outperforms relevant baselines.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Set encoding - Permutation invariant networks Recently, extensive research efforts have been made in the area of set representation learning with the goal of obtaining order-invariant (or equivariant) and size-invariant representations. Many propose simple methods to obtain set representations by applying non-linear transformations to each element before a pooling layer (e.g. average pooling or max pooling) (Ravanbakhsh et al., 2016; Qi et al., 2017b; Zaheer et al., 2017; Sannai et al., 2019). However, these models are known to have limited expressive power and sometimes not capable of capturing high moments of distributions. Yet approaches such as Stochastic Deep Network (De Bie et al., 2018) and Set Transformer (Lee et al., 2018) consider the pairwise (or higher order) interactions among set elements and hence can capture more complex statistics of the distributions . These methods often result in higher performance in classification/regression tasks; however, they have run time complexities of $O ( n ^ { \mathbf { \bar { 2 } } } )$ or higher.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: Overview. The subset $D _ { s }$ is sampled by a stochastic 2-stage subset selection process. Dark shaded boxes correspond to selected elements while lightly shaded boxes correspond to non-selected elements in the given set. Also, Ber and Cat correspond to the Bernoulli and Categorical distributions respectively. (a) Candidate(in blue) Selection. (b) Core Subset(in green) Selection using continuous relaxations of discrete distributions.
|
| 32 |
+
|
| 33 |
+
Subset sampling There exist some works which have been proposed to handle large sets. Dovrat et al. (2019) proposed to learn to sample a subset from a set by generating $k$ virtual points, then matching them back to a subset of the original set. However, such element generation and matching process is highly inefficient. Our method on the other hand only learns to select from the original elements and does not suffer from such overhead. Wang et al. (2018) proposed to distill the knowledge of a large dataset to a small number of artificial data instances. However, these artificial data instances are only for faster training and doesn’t capture the statistics of the original set. Moreover, the instances are generated artificially and can differ from the original set making the method less applicable to other tasks. Also several works (Qi et al., 2017a;c; Li et al., 2018b; Eldar et al., 1997; Moenning & Dodgson, 2003) propose farthest point sampling, which selects $k$ points from a set by ensuring that the selected samples are far from each other on a given metric space.
|
| 34 |
+
|
| 35 |
+
Image Compression Due to the huge demand for image and video transfer over the internet, a number of works have attempted to compress images with minimal distortion. These models (Toderici et al., 2017; Rippel & Bourdev, 2017; Mentzer et al., 2018; Li et al., 2018a) typically consist of a pair of encoder and decoder, where the encoder will transfer the image into a compact matrix to reduce the memory footprint and communication cost, while the decoder is used to reconstruct the image back. These methods, while achieving huge successes in the image compression problem, are less flexible than ours. Firstly, our model can be applied to any type of sets (and instances represented as sets), while the aforementioned models mainly work for images represented in tensor form. Furthermore, our method can be applied both at the instance and dataset level.
|
| 36 |
+
|
| 37 |
+
Representation learning Our instance-sampling model is also related to the Variational Auto Encoder (VAE) (Kingma & Welling, 2013). However, while VAE learns a compact representation of a data point, our model learns a compact representation of a set. Balın et al. (2019) learns a global feature selection model for reconstruction of the input data from selected features via unsupervised learning. Chen et al. (2018) learns instancewise feature selection with the goal of model interpretation by extracting subset of features most informative for a given sample. Our method also falls in this category.
|
| 38 |
+
|
| 39 |
+
Active Learning Active learning methods are aimed at selection of data points for labeling given a small labelled set. This domain is different from our method since active learning does not consider the label information but our method does utilize label information. Also, our motivation is quite different. We focus on efficiency in inference and training of non-parametric models by reducing the sizes of the inputs, be it pixels or instances and this greatly differs from the goal of active learning. Methods such as (Sener & Savarese, 2017; Coleman et al., 2019; Wei et al., 2015) all tackle the data selection problem in the active learning setting.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: Graphical Models: (a) Feature Selection for Reconstruction. (b) Feature Selection for Prediction Task. (c) Instance Selection model. (d) Instance Selection model for Classification
|
| 43 |
+
|
| 44 |
+
# 3 APPROACH
|
| 45 |
+
|
| 46 |
+
# 3.1 PRELIMINARIES
|
| 47 |
+
|
| 48 |
+
In this work, we consider data of the type $D = \{ d _ { 1 } , \ldots , d _ { n } \}$ where individual $d _ { i }$ ’s are possibly represented as input $x _ { i }$ and target $y _ { i }$ . $D$ is the complete set and we assume that within $D$ , there exists a subset $D _ { s } = \{ s _ { i } , \ldots , s _ { k } \} \subset D$ such that $k \ll n$ and that for an arbitrarily defined loss function $\ell ( . , D )$ that we are interested in optimizing over the full set $D$ , $D _ { s }$ can be used as a proxy for $D$ such that $\ell ( . , D ) \approx \ell ( . , D _ { s } )$ . In what follows, we present a method that learns the conditional distribution $p ( D _ { s } | D )$ of the subset $D _ { s }$ via a two stage selection procedure dubbed candidate selection and autoregressive subset selection. The overall objective is then to minimize the loss function with respect to the subset $D _ { s }$ , $\mathbb { E } _ { p ( D _ { s } | D ) } [ \ell ( . , D _ { s } ) ]$ . When the set $D$ itself follows a distribution of sets as in the meta-learning framework, then the objective becomes $\mathbb { E } _ { D } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ \ell ( . , D _ { s } ) ] ]$ . In essence, we seek to construct a subset $D _ { s }$ that is optimally representative of the full set $D$ w.r.t $\ell ( . )$ .
|
| 49 |
+
|
| 50 |
+
# 3.2 STOCHASTIC SUBSET SELECTION
|
| 51 |
+
|
| 52 |
+
In order to select $D _ { s }$ , we need to model the interactions among the elements of $D$ and construct $D _ { s }$ based on said interactions. However, when the cardinality $| D |$ of the set $D$ is large or it’s elements $d _ { i }$ ’s are high dimensional, modeling such pairwise interactions becomes computationally infeasible. As such, we first present the candidate selection procedure used to construct a smaller set, $D _ { c }$ , without considering inter-sample dependencies. This is then followed by the autoregressive subset selection procedure used to construct $D _ { s }$ from $D _ { c }$ by modeling inter-sample dependencies. The complete model is depicted in Figure 2.
|
| 53 |
+
|
| 54 |
+
# 3.3 CANDIDATE SELECTION
|
| 55 |
+
|
| 56 |
+
We model the task of candidate selection as a random Bernoulli process where the logits of the Bernoulli function are conditioned on the set representation of the full set $D$ and the individual elements $d _ { i } \in D$ . For a set $D$ with cardinality $n$ we define $Z : = \{ z _ { i } \} _ { i = 1 } ^ { n }$ such that $z _ { i } \in \{ 0 , 1 \}$ and $z _ { i } = 1$ implies that $d _ { i } \in D _ { c }$ and for each $d _ { i }$ , $z _ { i }$ is computed according to:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
p ( z _ { i } | d _ { i } , D ) = \mathtt { B e r } ( z _ { i } ; \rho ( d _ { i } , r ( D ) ) ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $r ( D )$ is a permutation-invariant function that compresses $D$ into a single vector set representation and $\rho ( d _ { i } , r ( D ) )$ computes the logits used to calculate the probability of $d _ { i }$ belonging to $D _ { c }$ . We implement both $r ( D )$ and $\rho ( d _ { i } , r ( D ) )$ as neural networks and specifically for $r ( D )$ , we use Deep Sets (Zaheer et al., 2017). Since Ber is non-differentiable, we use the continuous relaxations of the Bernoulli distribution introduced in (Maddison et al., 2016; Jang et al., 2016; Gal et al., 2017).
|
| 63 |
+
|
| 64 |
+
Specifically, to sample $z _ { i }$ , we execute the following computational routine:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
z _ { i } = \sigma \Big ( \frac { 1 } { \tau } \Big ( \log \frac { \pi _ { i } } { 1 - \pi _ { i } } + \log \frac { u } { 1 - u } \Big ) \Big ) , \quad \pi _ { i } = \rho ( d _ { i } , r ( D ) ) , \quad u \sim \mathrm { U n i f } ( 0 , 1 ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\sigma$ is the Sigmoid function, $\tau$ is the temperature for the continuous relaxation and $u$ is sampled from the uniform distribution. $\tau$ is set to 0.05 in all our experiments. Given that pair-wise interactions
|
| 71 |
+
|
| 72 |
+
<table><tr><td colspan="2">Algorithm1Fixed Size Subset Selection</td></tr><tr><td>Input OutputDg= {s1,S2,..., sk} (selected subset)</td><td>k(subset size),q(# elements selected at each iteration),D= {d1,d2,...,dn} (Full Set)</td></tr><tr><td colspan="2">1:procedure STOCHASTIC SUBSET SELECTION(k,q, D)</td></tr><tr><td>2: 3:</td><td>(π1,π2,.:.,πn) ←(p(di,r(D)),...,p(dn,r(D)))</td></tr><tr><td></td><td>Zi~Ber(πi) fori=1,...,n.</td></tr><tr><td>4: 5:</td><td>Dc←{di fori=1:nif zi} Candidate Selection</td></tr><tr><td>6:</td><td>Ds← for i=1,...,k/q do AutoRegressive Subset Selection</td></tr><tr><td>7:</td><td>Ds←DUAUTOSELECT(q,Ds,Dc) Select q elements</td></tr><tr><td>8:</td><td>return D s</td></tr><tr><td>9:</td><td>procedure AUTOSELECT(q,Dg,Dc)</td></tr><tr><td colspan="2">10: C={w1,w2,...,wm} ←Dc\Ds</td></tr><tr><td>11:</td><td>(p1,p2,...,Pm)←(f(w1,Dc,Ds),f(w2,Dc,Ds),...,f(wm,Dc,Ds))</td></tr><tr><td>12:</td><td>(p1,P2,...,Pm) ← (pi,p2,...,Pm)/∑j=1Pj</td></tr><tr><td>13: 14:</td><td>Q ← Select q elements from C with probability (pi,P2,..., pm)</td></tr><tr><td></td><td>return Q</td></tr></table>
|
| 73 |
+
|
| 74 |
+
between elements are not considered in this stage, learning $p ( z _ { i } | d _ { i } , D )$ ensures that highly activating samples are selected instead of a random subset of the original set.
|
| 75 |
+
|
| 76 |
+
# 3.4 AUTOREGRESSIVE SUBSET SELECTION
|
| 77 |
+
|
| 78 |
+
The candidate selection stage can introduce samples with redundant information in $D _ { c }$ since no effort was made to compare the informativity of the elements. To alleviate this issue, we must first model the interactions between the elements of $D _ { c }$ and construct $D _ { s }$ based on the relative importance of individual elements. To construct a representative subset $D _ { s }$ with $| D _ { s } | = k$ , $k$ iterative steps are required and at step $i$ the probability of an element in $D _ { c } \setminus D _ { s } ^ { ( i - 1 ) }$ belonging to $D _ { s }$ is computed according to:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
p ( s _ { i } = d | D _ { c } , D _ { s } ^ { ( i - 1 ) } ) = \frac { f ( d , D _ { c } , D _ { s } ^ { ( i - 1 ) } ) } { \sum _ { d ^ { \prime } \in D _ { c } \backslash D _ { s } ^ { ( i - 1 ) } } f ( d ^ { \prime } , D _ { c } , D _ { s } ^ { ( i - 1 ) } ) } \quad \forall d \in D _ { c } \setminus D _ { s } ^ { ( i - 1 ) } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $D _ { s } ^ { ( i - 1 ) }$ is the constructed subset at iteration $i - 1$ and $f$ is a positive function. The key to avoiding samples with redundant information in $D _ { s } ^ { ( k ) }$ lies in the fact that for each element added to $D _ { s }$ , it’s selection is conditioned on both $D _ { c }$ and all elements in $D _ { s } ^ { ( i - 1 ) }$ . We further propose a method that samples $q$ elements from $\mathbf { C a t } ( p _ { 1 } , \ldots , p _ { m } )$ in a single pass for efficient training. Specifically, instead of sampling $q$ times from the categorical distribution, we can sample the selection mask for element $j$ from $\mathrm { B e r } ( q * p _ { j } )$ . In this routine, the probability of the element $j$ being selected is $q * p _ { j }$ which is very close to the original distribution. Algorithm 1 details the entire procedure. The inference complexity depends heavily on the choice of the function $f$ . If $f$ considers the pairwise interactions between all candidate elements and the selected elements, the inference complexity is $O ( n ) { + } O ( k ^ { 2 } d / q )$ where $n , d , k$ correspond to $| D |$ , $| D _ { c } |$ and $| D _ { s } |$ respectively. In our experiments, for the choice of the function $f$ , we utilize either a Set Transformer(Lee et al., 2018) or DeepSets(Zaheer et al., 2017) to model the pairwise interactions between the elements of a given set.
|
| 85 |
+
|
| 86 |
+
# 3.5 CONSTRAINING THE SIZE OF $D _ { c }$
|
| 87 |
+
|
| 88 |
+
For computational efficiency, we may desire to restrict the size of $D _ { c }$ to save computational cost when constructing $D _ { s }$ . We adopt the idea of Information Bottleneck and constrain the distribution of $Z$ for $D _ { c }$ . Specifically,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbb { E } _ { p ( D ) } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ \ell ( . , D _ { s } ) ] + \beta \mathbf { K } \mathbf { L } [ p ( Z | D ) | | r ( Z ) ] ]
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 4: Models’ performance on set reconstruction and classification task (lighter-color areas present the standard deviations). (a) 1D Function reconstruction. (b) CelebA (reconstruction). (c) CelebA (classification)
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 5: 1D Function Reconstruction.
|
| 99 |
+
|
| 100 |
+
where $r ( Z )$ is a sparse prior. In our experiments, we set the parameter of the Bernoulli spares prior $r ( Z )$ to either 0.1 or 0.01 for different levels of sparsity and $\beta$ is set to 1.0 or 0.001.
|
| 101 |
+
|
| 102 |
+
# 3.6 TASKS
|
| 103 |
+
|
| 104 |
+
We now present four tasks for which the described subset selection method is applied.
|
| 105 |
+
|
| 106 |
+
Set Reconstruction Given $D _ { s }$ and a network $p _ { \theta } ( Y | X , D _ { s } )$ parameterized by $\theta$ , the task is to reconstruct $D = ( X , Y )$ . The objective function for this task is given as:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r } { \mathbb { E } _ { p ( D ) } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ - \log p _ { \theta } ( Y | X , D _ { s } ) ] + \beta \mathbf { K L } [ p ( Z | D ) | | r ( Z ) ] ] } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Minimizing this objective ensures that we learn a compact subset $( D _ { s } )$ most representative of $D$ and $D _ { s }$ can then be used for other tasks. We implement $p _ { \theta } ( Y | X , D _ { s } )$ as an Attentive Neural Process (ANP) (Kim et al., 2019b). An ANP takes as input a context $D _ { s }$ in this case) and predicts a distribution of the elements in the original set $D$ . It mimics the behaviour of a Gaussian Process but with reduced inference complexity. The complete model is depicted in Figure 3a.Experimental results for this task can be found in Section 4.1.
|
| 113 |
+
|
| 114 |
+
Set Classification/Prediction We can also opt to train the network to predict a single target $y _ { D }$ for the set $D$ . For instance, the target could be the class of an image(classification) or the statistics of the set(regression problem). Here, $p _ { \theta } ( y _ { D } | D _ { s } )$ is a neural network that predicts the target $y _ { D }$ . A set in this task, may be the features from a single example like an image and experimental results can be found in Section 4.2.The model for this task is depicted in Figure 3b. The objective function for this task is given as:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbb { E } _ { p ( D ) } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ - \log p _ { \theta } ( y _ { D } | D _ { s } ) ] + \beta \mathbf { K L } [ p ( Z | D ) | | r ( Z ) ] ]
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Dataset Distillation: Instance Selection For this task, we are given a dataset $\begin{array} { r l } { \mathcal { D } } & { { } = } \end{array}$ $\{ D _ { 1 } , \ldots , D _ { n } \}$ where each $D _ { i }$ is a set of data points sampled from the entire dataset. Using CelebA as in illustrative example, some $D _ { i }$ may consist of $| D _ { i } |$ randomly sampled faces from the whole dataset. The goal is to construct $D _ { s }$ for each $D _ { i } \in \mathcal { D }$ . We describe a model capable of taking as input $D _ { i } \in \mathcal { D }$ to perform a task such as the reconstruction of all elements in the given dataset.
|
| 121 |
+
|
| 122 |
+
Table 1: CelebA Attributes Classification.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Model</td><td>#Pixels</td><td>Storage</td><td>mAUC</td></tr><tr><td>Full Image</td><td>All 38804</td><td>114KB</td><td>0.9157</td></tr><tr><td>RS</td><td>500</td><td>5KB</td><td>0.8471</td></tr><tr><td>SSS(rec)</td><td>500</td><td>5KB</td><td>0.8921</td></tr><tr><td>SSS(MC)</td><td>500</td><td>5*5KB</td><td>0.9132</td></tr><tr><td>SSS(ours)</td><td>500</td><td>5KB</td><td>0.9093</td></tr></table>
|
| 125 |
+
|
| 126 |
+
For a single dataset $D _ { i } \in \mathcal { D }$ , we apply the subset construction method already described to a $D _ { s }$ that can be used to reconstruct all the elements in $D _ { i }$ . In essence, $D _ { i }$ is distilled into a new dataset $D _ { s }$ with $k < | D _ { i } |$ elements. The task then is to reconstruct the entire set $D _ { i }$ back conditioned only on $D _ { s }$ . As a first step, we represent $D _ { s }$ as a unique representative vector $c$ for each element in the dataset akin to the statistics network used in the Neural Statistician (Edwards & Storkey, 2016) model. Specifically, to reconstruct an element $d _ { i } \in D _ { i }$ given $D _ { s }$ , $c$ is computed by applying a stochastic cross-attention
|
| 127 |
+
|
| 128 |
+
Table 2: . FID Score for varying Instance Selection
|
| 129 |
+
|
| 130 |
+
<table><tr><td>#Instances</td><td>2</td><td>5</td><td>10</td><td>15</td><td>20</td><td>30</td></tr><tr><td>FPS</td><td>6.50</td><td>4.51</td><td>3.07</td><td>2.75</td><td>2.71</td><td>2.29</td></tr><tr><td>Random</td><td>3.73</td><td>1.16</td><td>0.90</td><td>0.38</td><td>0.39</td><td>0.20</td></tr><tr><td>SSS(ours)</td><td>2.53</td><td>1.02</td><td>0.59</td><td>0.33</td><td>0.24</td><td>0.17</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 3: Accuracy on miniImagenet
|
| 133 |
+
|
| 134 |
+
<table><tr><td>#Instances</td><td>1</td><td>2</td><td>5</td><td>10</td></tr><tr><td>FPS</td><td>0.432</td><td>0.501</td><td>0.598</td><td>0.636</td></tr><tr><td>Random</td><td>0.444</td><td>0.525</td><td>0.618</td><td>0.663</td></tr><tr><td>SSS(ours)</td><td>0.475</td><td>0.545</td><td>0.625</td><td>0.664</td></tr></table>
|
| 135 |
+
|
| 136 |
+
mechanism on $D _ { s }$ where the stochasticity is supplied by a query $\alpha$ which is computed using $d _ { i }$ . To obtain varying styles in the generated images, we additionally learn a latent variable $w$ used to perturb $c$ and both are combined to obtain a new element $x$ . The graphical model for this process is depicted in Figure 3c. Additionally, to ensure that $c$ is properly learnt, we add an informativity loss by reconstructing $c$ from the generated samples from the given dataset. The objective for the model depicted in Figure 3c for a single dataset $D$ is :
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r } { \mathcal { L } ( \theta , \phi , \psi ) = \displaystyle \sum _ { d _ { i } \in D } \big [ \mathbb { E } _ { q _ { \phi } ( w _ { i } \mid d _ { i } ) } \big [ p _ { \theta } ( d _ { i } \vert w _ { i } , c _ { i } ) \big ] - \mathbf { K L } [ q _ { \phi } ( w _ { i } \vert d _ { i } ) \vert \vert p _ { \psi } ( w ) \big ] } \\ { - \mathbf { K L } \big [ q _ { \phi } ( \alpha _ { i } \vert d _ { i } ) \vert \vert p _ { \psi } ( \alpha ) \big ] - \mathbf { K L } \big [ q _ { \phi } ( c _ { i } \vert D _ { s } , \alpha _ { i } ) \vert \vert p _ { \phi } ( c ) \big ] \big ] } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $p _ { \psi } ( \cdot )$ are priors on their respective latent variables and $q _ { \phi } ( \cdot )$ ’s are implemented with neural networks. All priors are chosen to be Gaussian with zero mean and unit variance. This objective is combined with the informativity loss on all samples in $D _ { i }$ . It is important to note that $c$ is computed using only $D _ { i }$ for every element in $D$ . In addition to Equation 7 and the informativity loss, the model is optimized together with the subset selection model already described. When the model is fully optimized, it is applied to the instance selection task on the given dataset. In summary, the purpose of the generative model introduced is to train the subset selection module for the instance selection task. Experimetal results for this task can be found in Section 4.3.
|
| 143 |
+
|
| 144 |
+
Dataset Distillation: Classification Finally in the dataset distillation task, we consider the problem of selecting prototypes to be used for few-shot classification. Here, we adopt Prototypical Networks (Snell et al., 2017) and apply the subset selection model to the task of selecting representative prototypes from each class to be used for classifying new instances. By learning to select the prototypes, we can remove outliers that would otherwise change the class prediction boundaries in the classification task. The complete graphical model for this task is given in Figure 3d where again $D _ { s }$ corresponds to the selected prototypes and $x _ { * }$ and $y _ { * }$ correspond to query and class label respectively. Experimental results for this task can be found in Section 4.3.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
In this section, we present our experimental results. Model architectures and training hyper parameters are specified in the Appendix C.
|
| 149 |
+
|
| 150 |
+
# 4.1 FEATURE SELECTION EXPERIMENTS
|
| 151 |
+
|
| 152 |
+
Function Reconstruction - Approximation Our first experiment is on 1D function reconstruction. Suppose that we have a function ${ \bar { f } } : [ a , b ] \to \mathbb { R }$ . We first construct a set of data points of that function: $D = \{ ( x _ { 1 } , y _ { 1 } = f ( x _ { 1 } ) ) , ( x _ { 2 } , y _ { 2 } = f ( x _ { 2 } ) ) , \ldots , ( x _ { n } , y _ { n } = f ( x _ { n } ) ) \}$ where $( x _ { 1 } , x _ { 2 } , \ldots , x _ { n } )$ are uniformly distributed along the $\mathbf { X }$ -axis within the interval $[ a , b ]$ . Now if we have a family of functions $( f ^ { ( 1 ) } , f ^ { ( 2 ) } , \dots , f ^ { ( N ) } )$ , this will lead to a family of sets $( \bar { D } ^ { ( 1 ) } , D ^ { ( 2 ) } , \dots , D ^ { ( N ) } )$ . We train our model which consists of the subset selection model $p ( D _ { s } | D )$ and a task network $p ( \dot { Y } | X , D _ { s } )$ (e.g. ANP), on this data set and report the reconstruction loss, which is the negative log-likelihood.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: CelebA reconstruction samples with varying number of pixels.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 7: Instance Selection Samples from a dataset of size 200.
|
| 159 |
+
|
| 160 |
+
We compare SSS with Random Select(RS) (randomly selects a subset of $D$ and uses an ANP to reconstruct the set), and Learning to Sample (LTS) (Dovrat et al., 2019) to sample k elements and uses an ANP to reconstruct the set). Figure 4a shows the performance (reconstruction loss) of our models(SSS) and the baselines.
|
| 161 |
+
|
| 162 |
+
SSS out-performs Random Select (RS), verifying that the subset selection model $p ( D _ { s } | D )$ can learn a meaningful distribution for the selected elements. Our model also out-performs the Learning to Sample (LTS) baseline.
|
| 163 |
+
|
| 164 |
+
Through the visualization of the selected points in Figure 5, we can see that out model tends to pick out more points (presented as red dots) in the drifting parts of the curve, which is reasonable since these parts are harder to reconstruct. The other two baselines sometimes fails to do that, which leads to inaccurate reconstructions.
|
| 165 |
+
|
| 166 |
+
Image Reconstruction Given an image we learn to select a core subset of pixels that best reconstructs the original image. Here, $x$ is 2-dimensional and $y$ is 3-dimensional for RGB images. An ANP is then used to reconstruct the remaining pixels from a set of context elements (selected subset in our case). We conduct this experiment on the CelebA dataset (Liu et al., 2018). Figure 4b shows that our model significantly outperforms ANP with RS (as in the original ANP paper) and the LTS baseline. Figure 6 shows the reconstruction samples of our model which are visually better than the reconstruction of the baselines for the same number of pixels.
|
| 167 |
+
|
| 168 |
+
# 4.2 CLASSIFICATION/REGRESSION
|
| 169 |
+
|
| 170 |
+
In this subsection, we validate our model on the prediction task. The goal is to learn to select a subset for a target task such as classification or regression. We again use the CelebA dataset, but this time the selected pixels are used to give predictions for 40 attributes of a celebrity’s face (in a multi-task learning setting). For our proposed model, only the selected pixels are used for prediction (other pixels’ values are set to zeros). Table 1 shows that using only 500 pixels $( \sim 1 . 3 \%$ of total pixels in an image), we can achieve a mean AUC of 0.9093 $9 9 . 3 \%$ of the accuracy obtained with the full image). Figure $\cdot$ shows the classification performance (in terms of mean AUC) versus the number of pixels selected. The AUC with selected pixels learned from our SSS is significantly higher than that of the random pixels baseline, showing the effectiveness of our subset selection method. We also include another baseline, namely SSS(rec). This is our stochastic subset selection model trained for reconstruction, but then later used for classification. Our model outperforms this variant, showing the effectiveness of training with the target task. Note that LTS cannot be applied to this experimental setup because during training, the generated virtual points cannot be converted back to an image in matrix form (due to the virtual coordinate), thus we cannot train the LTS model with CNN-based classification on the target task.
|
| 171 |
+
|
| 172 |
+
Ablation Study Since our method is stochastic, the predictive distribution can be written as $\mathbb { E } _ { p ( D _ { s } | D ) } \left[ p _ { \theta } ( \dot { y } _ { D } | D _ { s } ) \right]$ , and we can use Monte Carlo sampling to get the prediction in practice. However, throughout the experiment section, we only reported the result with one sampled subset, since it gives the best reduction in memory and computational cost. This can be seen as MC sampling with one sample. We compare it against another variant: SSS(MC) with MC sampling (5 samples). It should be noted that by doing MC sampling with 5 samples, the computational cost (inference) is increased by 5 times, and the memory requirement can be increased by up to 5 times too. Table 1 shows that our model achieves comparable performance with that variant, thus justifying that it can achieve good performance for target tasks, while reducing memory and computation requirement.
|
| 173 |
+
|
| 174 |
+
# 4.3 DATASET DISTILLATION
|
| 175 |
+
|
| 176 |
+
Instance Selection We present results on the instance selection task applied to a whole dataset. In this task, we use the CelebA dataset since it has an imbalance both in terms of gender and race. A dataset is constructed by sampling 200 random images from the full dataset. In this experiment, we seek to select only a few(5-30) representative images from these generated datasets. On this task, our subset selection module is trained via the procedure detailed in Section 3.6 on instance selection. To evaluate the effectiveness of the SSS model, we evaluate the model in terms of the diversity in the selected subset using the Fréchet Inception Distance(FID Score) (Heusel et al., 2017) which measures the similarity and diversity between two datasets. We compare our model with the model that randomly samples instances from the full dataset. Additionally, we compare our method with the Farthest Point Sampling(FPS) algorithm which selects $k$ points from a given set by computing distances on a metric space between all elements and selecting those elements that are furthest from each other. FPS in general seeks to obtain a wide coverage over a given set and hence is a suitable baseline. The results of this experiment is presented in Table 4 where our selection method achieves a lower FID score compared to FPS and Random Sampling. Additionally, given that the dataset is highly imbalanced, FPS performs worst since by selecting the furthest elements in the given set it cannot capture the true representation of the whole dataset even when compared with Random Sampling. Also for small sample selection, our method outperforms FPS and Random Sampling significantly since our method is able to model the interactions within the full dataset and hence can select the most representative subset.
|
| 177 |
+
|
| 178 |
+
Classification We use the miniImageNet dataset (Vinyals et al., 2016) and go from a 20 shot classification task to one of 1,2,5 or 10 shot classification task. We again compare with Random Sampling and FPS and apply them together with SSS for the reduction in shot. The results for this experiment is shown in Table 3, where it can be observed that SSS can learn to select more representative prototypes compared to the other methods especially in the few-shot problems where the choice of prototypes matters more. All models were trained for 300 epochs and the best model was picked using a validation set.
|
| 179 |
+
|
| 180 |
+
# 5 CONCLUSION
|
| 181 |
+
|
| 182 |
+
In this paper, we have proposed a stochastic subset selection method to reduce the size of an arbitrary set while preserving performance on a target task. Our selection method utilizes a Bernoulli mask to perform candidate selection, and a stack of Categorical distributions to iteratively select a core subset from the candidate set. As a result, the selection process does take the dependencies of the set’s members into account. Hence, it can select a compact set that avoids samples with redundant information. By using the compact subset in place of the original set for a target task, we can save memory, communication and computational cost. We hope that this can facilitate the use of machine learning algorithm in resource-limited systems such as mobile and embedded devices.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Muhammed Fatih Balın, Abubakar Abid, and James Zou. Concrete autoencoders: Differentiable feature selection and reconstruction. In International Conference on Machine Learning, pp. 444–453, 2019.
|
| 187 |
+
Abhinav Bhatia, Pradeep Varakantham, and Akshat Kumar. Resource constrained deep reinforcement learning. In Proceedings of the International Conference on Automated Planning and Scheduling, volume 29, pp. 610–620, 2019.
|
| 188 |
+
Trevor Campbell and Tamara Broderick. Bayesian coreset construction via greedy iterative geodesic ascent. arXiv preprint arXiv:1802.01737, 2018.
|
| 189 |
+
Trevor Campbell and Tamara Broderick. Automated scalable bayesian inference via hilbert coresets. The Journal of Machine Learning Research, 20(1):551–588, 2019.
|
| 190 |
+
Michael Chan, Daniel Scarafoni, Ronald Duarte, Jason Thornton, and Luke Skelly. Learning network architectures of deep cnns under resource constraints. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 1703–1710, 2018.
|
| 191 |
+
|
| 192 |
+
Jianbo Chen, Le Song, Martin J Wainwright, and Michael I Jordan. Learning to explain: An information-theoretic perspective on model interpretation. arXiv preprint arXiv:1802.07814, 2018.
|
| 193 |
+
|
| 194 |
+
Cody Coleman, Christopher Yeh, Stephen Mussmann, Baharan Mirzasoleiman, Peter Bailis, Percy Liang, Jure Leskovec, and Matei Zaharia. Selection via proxy: Efficient data selection for deep learning. arXiv preprint arXiv:1906.11829, 2019.
|
| 195 |
+
|
| 196 |
+
Gwendoline De Bie, Gabriel Peyré, and Marco Cuturi. Stochastic deep networks. arXiv preprint arXiv:1811.07429, 2018.
|
| 197 |
+
|
| 198 |
+
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. Ieee, 2009.
|
| 199 |
+
|
| 200 |
+
Oren Dovrat, Itai Lang, and Shai Avidan. Learning to sample. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2760–2769, 2019.
|
| 201 |
+
|
| 202 |
+
Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
|
| 203 |
+
|
| 204 |
+
Yuval Eldar, Michael Lindenbaum, Moshe Porat, and Yehoshua Y Zeevi. The farthest point strategy for progressive image sampling. IEEE Transactions on Image Processing, 6(9):1305–1315, 1997.
|
| 205 |
+
|
| 206 |
+
Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Advances in neural information processing systems, pp. 3581–3590, 2017.
|
| 207 |
+
|
| 208 |
+
HERBERT Hensel. Neural processes in thermoregulation. Physiological Reviews, 53(4):948–1017, 1973.
|
| 209 |
+
|
| 210 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, pp. 6626–6637, 2017.
|
| 211 |
+
|
| 212 |
+
Jonathan Huggins, Trevor Campbell, and Tamara Broderick. Coresets for scalable bayesian logistic regression. In Advances in Neural Information Processing Systems, pp. 4080–4088, 2016.
|
| 213 |
+
|
| 214 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 215 |
+
|
| 216 |
+
Angelos Katharopoulos and François Fleuret. Not all samples are created equal: Deep learning with importance sampling. arXiv preprint arXiv:1803.00942, 2018.
|
| 217 |
+
|
| 218 |
+
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, 2019a.
|
| 219 |
+
|
| 220 |
+
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, 2019b.
|
| 221 |
+
|
| 222 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 223 |
+
|
| 224 |
+
Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-10 and cifar-100 datasets. URl: https://www. cs. toronto. edu/kriz/cifar. html, 6, 2009.
|
| 225 |
+
|
| 226 |
+
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer. arXiv preprint arXiv:1810.00825, 2018.
|
| 227 |
+
|
| 228 |
+
Mengtian Li, Ersin Yumer, and Deva Ramanan. Budgeted training: Rethinking deep neural network training under resource constraints. arXiv preprint arXiv:1905.04753, 2019.
|
| 229 |
+
|
| 230 |
+
Mu Li, Wangmeng Zuo, Shuhang Gu, Debin Zhao, and David Zhang. Learning convolutional networks for content-weighted image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3214–3223, 2018a.
|
| 231 |
+
|
| 232 |
+
Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. Pointcnn: Convolution on x-transformed points. In Advances in neural information processing systems, pp. 820–830, 2018b.
|
| 233 |
+
|
| 234 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 235 |
+
|
| 236 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Large-scale celebfaces attributes (celeba) dataset. Retrieved August, 15:2018, 2018.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
Fabian Mentzer, Eirikur Agustsson, Michael Tschannen, Radu Timofte, and Luc Van Gool. Conditional probability models for deep image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4394–4402, 2018.
|
| 241 |
+
|
| 242 |
+
Carsten Moenning and Neil A Dodgson. Fast marching farthest point sampling. Technical report, University of Cambridge, Computer Laboratory, 2003.
|
| 243 |
+
|
| 244 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652–660, 2017a.
|
| 245 |
+
|
| 246 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652–660, 2017b.
|
| 247 |
+
|
| 248 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet $^ { + + }$ : Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pp. 5099–5108, 2017c.
|
| 249 |
+
|
| 250 |
+
Siamak Ravanbakhsh, Jeff Schneider, and Barnabas Poczos. Deep learning with sets and point clouds. arXiv preprint arXiv:1611.04500, 2016.
|
| 251 |
+
|
| 252 |
+
Oren Rippel and Lubomir Bourdev. Real-time adaptive image compression. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2922–2930. JMLR. org, 2017.
|
| 253 |
+
|
| 254 |
+
Akiyoshi Sannai, Yuuki Takai, and Matthieu Cordonnier. Universal approximations of permutation invariant/equivariant functions by deep neural networks. arXiv preprint arXiv:1903.01939, 2019.
|
| 255 |
+
|
| 256 |
+
Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint arXiv:1708.00489, 2017.
|
| 257 |
+
|
| 258 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pp. 4077–4087, 2017.
|
| 259 |
+
|
| 260 |
+
George Toderici, Damien Vincent, Nick Johnston, Sung Jin Hwang, David Minnen, Joel Shor, and Michele Covell. Full resolution image compression with recurrent neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5306–5314, 2017.
|
| 261 |
+
|
| 262 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pp. 3630–3638, 2016.
|
| 263 |
+
|
| 264 |
+
Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros. Dataset distillation. arXiv preprint arXiv:1811.10959, 2018.
|
| 265 |
+
|
| 266 |
+
Kai Wei, Rishabh Iyer, and Jeff Bilmes. Submodularity in data subset selection and active learning. In International Conference on Machine Learning, pp. 1954–1963, 2015.
|
| 267 |
+
|
| 268 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in neural information processing systems, pp. 3391–3401, 2017.
|
| 269 |
+
|
| 270 |
+
# A APPENDIX
|
| 271 |
+
|
| 272 |
+
Organization This supplementary file is organized as follows. We provide the full pseudo-code for the Greedy Training Algorithm.We then show some visualization of our method for feature selection (in both 1D function and CelebA dataset) and report the results with multiple runs of the instance selection experiment, as well as its visualization. Qualitative results for Instance Selection as applied to the few-shot classification task are provided together with model specifications.
|
| 273 |
+
|
| 274 |
+
# A.1 GREEDY TRAINING ALGORITHM
|
| 275 |
+
|
| 276 |
+
Algorithm 2 shows our greedy training algorithm with stochastic gradient descent. The idea of the greedy training algorithm is to train the auto-regressive model to select the best next $q$ elements from the candidate set to minimize the target loss on the selected samples. By doing this, we do not have to run the auto-regressive model $k / q$ time during training, thus reducing the computational cost.
|
| 277 |
+
|
| 278 |
+
<table><tr><td colspan="2">Algorithm2 Greedy Training Algorithm</td></tr><tr><td rowspan="4">Input</td><td>k(max subset size)</td></tr><tr><td>q(# elements selected at each iteration)</td></tr><tr><td>p(D) (distribution of sets)</td></tr><tr><td>α (learning rate)</td></tr><tr><td>Output</td><td>a target task with loss function l(·, ·) trained model with converged θ and </td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">1:0,←initialization 2:while not converged do</td></tr><tr><td></td><td></td></tr><tr><td>3:</td><td> Sample a minibatch with m sets D(1), D(2),..,D(m) from p(D)</td></tr><tr><td>4: 5:</td><td>D)~ p(D)|D()) for j=1...m</td></tr><tr><td>6:</td><td>i~ random sample from (O,...,k - q) I()~ random i-element subset of D) for j = 1... m</td></tr><tr><td>7:</td><td>Q()~ select a q-element subset from Di)\1(i) (with the auto-regressive model)</td></tr><tr><td>8:</td><td></td></tr><tr><td></td><td>0←0-avθ∑j=-1e(.,10)UQの),Φ←Φ-aVm∑j=1e(,1))UQ))</td></tr></table>
|
| 279 |
+
|
| 280 |
+
# B INSTANCE SELECTION SAMPLES
|
| 281 |
+
|
| 282 |
+
In this section, we show more examples of our 1D and CelebA experiments on how the models select the set elements for the target task.
|
| 283 |
+
|
| 284 |
+
# B.0.1 1D FUNCTION - RECONSTRUCTION
|
| 285 |
+
|
| 286 |
+
Figure 8 shows the reconstruction samples of our model on the 1D function dataset, which is objectively better than that of Learning to Sample (LTS) or Random Subset (RS). Since RS selects the set elements randomly, it can leave out important part of the 1D curve leading to wrong reconstructions. LTS also selects insufficient amount of set elements in some parts of the curves, resulting in suboptimal reconstructions.
|
| 287 |
+
|
| 288 |
+
# B.1 CELEBA
|
| 289 |
+
|
| 290 |
+
Figure 9 shows the selected pixels of our model for both the classification and reconstruction task. For the attribute classification task, the model tends to select pixels mainly from the face, since the task is to classify characteristics of the person. For reconstruction, the selected pixels are more evenly distributed, since the background also contributes significantly to the reconstruction loss.
|
| 291 |
+
|
| 292 |
+
# B.2 DATASET DISTILLATION: INSTANCE SELECTION
|
| 293 |
+
|
| 294 |
+
In Table 4, we represent the full results for the Instance Selection model on the CelebA dataset. For these experiments, we construct a set by randomly sampling 200 face images from the full dataset. To evaluate the model, we create multiple such datasets and run the baselines(Random Sampling and FPS) and SSS on the same datasets. The FID metric is then computed on the instances and averaged on all the randomly constructed datasets. For FPS, we use the open-source implementation in https://github.com/rusty1s/pytorch_cluster. Further, we provide qualitative results on a single dataset in Figure 10 where we show how our model picks 5 instances from the full set of 200 images face images.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 8: Reconstruction samples of 1D functions with different selection methods
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 9: Selected pixels for different tasks on CelebA.
|
| 301 |
+
|
| 302 |
+
Table 4: . FID Score for varying Instance Selection
|
| 303 |
+
|
| 304 |
+
<table><tr><td>#Instances</td><td>2</td><td>5</td><td>10</td><td>15</td><td>20</td><td>30</td></tr><tr><td>FPS</td><td>6.5014 ± 4.3502</td><td>4.5098± 2.3809</td><td>3.0746 ± 1.0979</td><td>2.7458 ± 0.6201</td><td>2.7118 ± 1.0410</td><td>2.2943± 0.8010</td></tr><tr><td>Random</td><td>3.7309 ± 1.1690</td><td>1.1575 ± 0.6532</td><td>0.8970 ± 0.4867</td><td>0.3843 ± 0.2171</td><td>0.3877 ± 0.1906</td><td>0.1980 ±0.1080</td></tr><tr><td>SSS</td><td>2.5307 ± 1.3583</td><td>1.0186 ± 0.1982</td><td>0.5922 ± 0.3181</td><td>0.3331 ± 0.1169</td><td>0.2381 ± 0.1153</td><td>0.1679 ± 0.0807</td></tr></table>
|
| 305 |
+
|
| 306 |
+
# B.3 DATASET DISTILLATION: CLASSIFICATION
|
| 307 |
+
|
| 308 |
+
In Figure 11 we provide visualizations for the instance selection problem as applied to the few-shot classification task. Here, we go from a 20-shot to a 1-shot classification problem where the prototype is selected from the support using SSS.
|
| 309 |
+
|
| 310 |
+
# C MODEL SPECIFICATIONS
|
| 311 |
+
|
| 312 |
+
SSS consists of $r ( D )$ , $\rho ( d _ { i } , r ( D ) )$ and $f ( d , D _ { c } , D _ { s } ^ { ( i - 1 ) }$ . We describe the models in this section.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 10: Visualization of a set with 200 images for instance selection. The two stage selection method in SSS is visualized as Candidate Set and SSS. A coreset of size 5 is visualized.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 11: Sample visualization of prototype selection for the miniImagenet dataset on the few-shot classification task. Each row represents a set that corresponds to the support from which a prototype is selected for the few-shot classification task.
|
| 319 |
+
|
| 320 |
+
For all experiments, $r ( D )$ is implemented as DeepSets. This means that we take the mean of all the samples in a set to obtain the set representation.
|
| 321 |
+
|
| 322 |
+
$\rho ( d _ { i } , r ( D ) )$ is implemented as a neural network with the following specifications: there are 3 Linear layers each followed by ReLU activation. Also, all inputs are projected into feature space using 3 Linear layers, each followed by ReLU activation.
|
| 323 |
+
|
| 324 |
+
In the set classification task, $f ( d , D _ { c } , D _ { s } ^ { ( i - 1 ) }$ is implemented as a Set Transformer network. All other experiments use DeepSets.
|
md/train/S1eK3i09YQ/S1eK3i09YQ.md
ADDED
|
@@ -0,0 +1,680 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRADIENT DESCENT PROVABLY OPTIMIZES OVER-PARAMETERIZED NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Simon S. Du∗ Machine Learning Department Carnegie Mellon University ssdu@cs.cmu.edu
|
| 4 |
+
|
| 5 |
+
Xiyu Zhai∗
|
| 6 |
+
Department of EECS
|
| 7 |
+
Massachusetts Institute of Technology
|
| 8 |
+
xiyuzhai $@$ mit.edu
|
| 9 |
+
|
| 10 |
+
# Aarti Singh
|
| 11 |
+
|
| 12 |
+
Barnabas Pocz ´ os´ Machine Learning Department Carnegie Mellon University bapozos@cs.cmu.edu
|
| 13 |
+
|
| 14 |
+
Machine Learning Department Carnegie Mellon University aartisingh@cmu.edu
|
| 15 |
+
|
| 16 |
+
# ABSTRACT
|
| 17 |
+
|
| 18 |
+
One of the mysteries in the success of neural networks is randomly initialized first order methods like gradient descent can achieve zero training loss even though the objective function is non-convex and non-smooth. This paper demystifies this surprising phenomenon for two-layer fully connected ReLU activated neural networks. For an $m$ hidden node shallow neural network with ReLU activation and $n$ training data, we show as long as $m$ is large enough and no two inputs are parallel, randomly initialized gradient descent converges to a globally optimal solution at a linear convergence rate for the quadratic loss function.
|
| 19 |
+
|
| 20 |
+
Our analysis relies on the following observation: over-parameterization and random initialization jointly restrict every weight vector to be close to its initialization for all iterations, which allows us to exploit a strong convexity-like property to show that gradient descent converges at a global linear rate to the global optimum. We believe these insights are also useful in analyzing deep models and other first order methods.
|
| 21 |
+
|
| 22 |
+
# 1 INTRODUCTION
|
| 23 |
+
|
| 24 |
+
Neural networks trained by first order methods have achieved a remarkable impact on many applications, but their theoretical properties are still mysteries. One of the empirical observation is even though the optimization objective function is non-convex and non-smooth, randomly initialized first order methods like stochastic gradient descent can still find a global minimum. Surprisingly, this property is not correlated with labels. In Zhang et al. (2016), authors replaced the true labels with randomly generated labels, but still found randomly initialized first order methods can always achieve zero training loss.
|
| 25 |
+
|
| 26 |
+
A widely believed explanation on why a neural network can fit all training labels is that the neural network is over-parameterized. For example, Wide ResNet (Zagoruyko and Komodakis) uses $1 0 0 \mathrm { x }$ parameters than the number of training data. Thus there must exist one such neural network of this architecture that can fit all training data. However, the existence does not imply why the network found by a randomly initialized first order method can fit all the data. The objective function is neither smooth nor convex, which makes traditional analysis technique from convex optimization not useful in this setting. To our knowledge, only the convergence to a stationary point is known (Davis et al., 2018).
|
| 27 |
+
|
| 28 |
+
In this paper we demystify this surprising phenomenon on two-layer neural networks with rectified linear unit (ReLU) activation. Formally, we consider a neural network of the following form.
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
f ( \mathbf { W } , \mathbf { a } , \mathbf { x } ) = \frac { 1 } { \sqrt { m } } \sum _ { r = 1 } ^ { m } a _ { r } \sigma \left( \mathbf { w } _ { r } ^ { \top } \mathbf { x } \right)
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $\mathbf { x } \in \mathbb { R } ^ { d }$ is the input, ${ \bf w } _ { r } \in \mathbb { R } ^ { d }$ is the weight vector of the first layer, $a _ { r } \in \mathbb { R }$ is the output weight and $\sigma \left( \cdot \right)$ is the ReLU activation function: $\sigma \left( z \right) = z$ if $z \geq 0$ and $\sigma \left( z \right) = 0$ if $z < 0$ .
|
| 35 |
+
|
| 36 |
+
We focus on the empirical risk minimization problem with a quadratic loss. Given a training data set $\{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ , we want to minimize
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
L ( \mathbf { W } , \mathbf { a } ) = \sum _ { i = 1 } ^ { n } { \frac { 1 } { 2 } } \left( f ( \mathbf { W } , \mathbf { a } , \mathbf { x } _ { i } ) - y _ { i } \right) ^ { 2 } .
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
Our main focus of this paper is to analyze the following procedure. We fix the second layer and apply gradient descent (GD) to optimize the first layer1
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathbf { W } ( k + 1 ) = \mathbf { W } ( k ) - \eta \frac { \partial L ( \mathbf { W } ( k ) , \mathbf { a } ) } { \partial \mathbf { W } ( k ) } .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\eta > 0$ is the step size. Here the gradient formula for each weight vector is 2
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\frac { \partial L ( \mathbf { W } , \mathbf { a } ) } { \partial \mathbf { w } _ { r } } = \frac { 1 } { \sqrt { m } } \sum _ { i = 1 } ^ { n } ( f ( \mathbf { W } , \mathbf { a } , \mathbf { x } _ { i } ) - y _ { i } ) \mathbf { a } _ { r } \mathbf { x } _ { i } \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 \right\} .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
Though this is only a shallow fully connected neural network, the objective function is still nonsmooth and non-convex due to the use of ReLU activation function. 3 Even for this simple function, why randomly initialized first order method can achieve zero training error is not known. Many previous works have tried to answer this question or similar ones. Attempts include landscape analysis (Soudry and Carmon, 2016), partial differential equations (Mei et al.), analysis of the dynamics of the algorithm (Li and Yuan, 2017), optimal transport theory (Chizat and Bach, 2018), to name a few. These results often make strong assumptions on the labels and input distributions or do not imply why randomly initialized first order method can achieve zero training loss. See Section 2 for detailed comparisons between our result and previous ones.
|
| 55 |
+
|
| 56 |
+
In this paper, we rigorously prove that as long as no two inputs are parallel and $m$ is large enough, with randomly initialized a and $\mathbf { W } ( 0 )$ , gradient descent achieves zero training loss at a linear convergence rate, i.e., it finds a solution $\dot { \mathbf { W } } ( K )$ with $L ( \mathbf { W } ( K ) ) \leq \epsilon$ in $K = O ( \bar { \log { ( 1 / \epsilon ) } } )$ iterations.4 Thus, our theoretical result not only shows the global convergence but also gives a quantitative convergence rate in terms of the desired accuracy.
|
| 57 |
+
|
| 58 |
+
Analysis Technique Overview Our proof relies on the following insights. First we directly analyze the dynamics of each individual prediction $f ( \mathbf { W } , \mathbf { a } , \mathbf { x } _ { i } )$ for $i = 1 , \ldots , n$ . This is different from many previous work (Du et al., 2017b; Li and Yuan, 2017) which tried to analyze the dynamics of the parameter (W) we are optimizing. Note because the objective function is non-smooth and non-convex, analysis of the parameter space dynamics is very difficult. In contrast, we find the dynamics of prediction space is governed by the spectral property of a Gram matrix (which can vary in each iteration, c.f. Equation (6)) and as long as this Gram matrix’s least eigenvalue is lower bounded, gradient descent enjoys a linear rate. It is easy to show as long as no two inputs are parallel, in the initialization phase, this Gram matrix has a lower bounded least eigenvalue. (c.f. Theorem 3.1). Thus the problem reduces to showing the Gram matrix at later iterations is close to that in the initialization phase. Our second observation is this Gram matrix is only related to the activation patterns $\begin{array} { r } { ( \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 \right\} ) } \end{array}$ ) and we can use matrix perturbation analysis to show if most of the patterns do not change, then this Gram matrix is close to its initialization. Our third observation is we find over-parameterization, random initialization, and the linear convergence jointly restrict every weight vector ${ \bf w } _ { r }$ to be close to its initialization. Then we can use this property to show most of the patterns do not change. Combining these insights we prove the first global quantitative convergence result of gradient descent on ReLU activated neural networks for the empirical risk minimization problem. Notably, our proof only uses linear algebra and standard probability bounds so we believe it can be easily generalized to analyze deep neural networks.
|
| 59 |
+
|
| 60 |
+
Notations We let $[ n ] = \{ 1 , 2 , \dots , n \}$ . Given a set $S$ , we use unif $\{ S \}$ to denote the uniform distribution over $S$ . Given an event $E$ , we use $\mathbb { I } \left\{ A \right\}$ to be the indicator on whether this event happens. We use ${ \cal N } ( { \bf 0 } , { \bf I } )$ to denote the standard Gaussian distribution. For a matrix A, we use $\mathbf { A } _ { i j }$ to denote its $( i , j )$ -th entry. We use $\lVert \cdot \rVert _ { 2 }$ to denote the Euclidean norm of a vector, and use $\left\| \cdot \right\| _ { F }$ to denote the Frobenius norm of a matrix. If a matrix $\mathbf { A }$ is positive semi-definite, we use $\lambda _ { \operatorname* { m i n } } ( \mathbf { A } )$ to denote its smallest eigenvalue. We use $\langle \cdot , \cdot \rangle$ to denote the standard Euclidean inner product between two vectors.
|
| 61 |
+
|
| 62 |
+
# 2 COMPARISON WITH PREVIOUS RESULTS
|
| 63 |
+
|
| 64 |
+
In this section, we survey an incomplete list of previous attempts in analyzing why first order methods can find a global minimum.
|
| 65 |
+
|
| 66 |
+
Landscape Analysis A popular way to analyze non-convex optimization problems is to identify whether the optimization landscape has some good geometric properties. Recently, researchers found if the objective function is smooth and satisfies (1) all local minima are global and (2) for every saddle point, there exists a negative curvature, then the noise-injected (stochastic) gradient descent (Jin et al., 2017; Ge et al., 2015; Du et al., 2017a) can find a global minimum in polynomial time. This algorithmic finding encouraged researchers to study whether the deep neural networks also admit these properties.
|
| 67 |
+
|
| 68 |
+
For the objective function defined in Equation (2), some partial results were obtained. Soudry and Carmon (2016) showed if $m d \geq n$ , then at every differentiable local minimum, the training error is zero. However, since the objective is non-smooth, it is hard to show gradient descent convergences to a differentiable local minimum. Xie et al. (2017) studied the same problem and related the loss to the gradient norm through the least singular value of the “extended feature matrix” $\mathbf { D }$ at the stationary points. However, they did not prove the convergence rate of the gradient norm. Interestingly, our analysis relies on the Gram matrix which is $\mathbf { D } \mathbf { D } ^ { \top }$ .
|
| 69 |
+
|
| 70 |
+
Landscape analyses of ReLU activated neural networks for other settings have also been studied in many previous works (Ge et al., 2017; Safran and Shamir, 2016; Zhou and Liang, 2017; Freeman and Bruna, 2016; Hardt and Ma, 2016; Nguyen and Hein, 2018). These works establish favorable landscape properties but none of them implies that gradient descent converges to a global minimizer of the empirical risk. More recently, some negative results have also been discovered (Safran and Shamir, 2018; Yun et al., 2018a) and new procedures have been proposed to test local optimality and escape strict saddle points at non-differentiable points (Yun et al., 2018b). However, the new procedures cannot find global minima as well. For other activation functions, some previous works showed the landscape does have the desired geometric properties (Du and Lee, 2018; Soltanolkotabi et al., 2018; Nguyen and Hein, 2017; Kawaguchi, 2016; Haeffele and Vidal, 2015; Andoni et al., 2014; Venturi et al., 2018; Yun et al., 2018a). However, it is unclear how to extend their analyses to our setting.
|
| 71 |
+
|
| 72 |
+
Analysis of Algorithm Dynamics Another way to prove convergence result is to analyze the dynamics of first order methods directly. Our paper also belongs to this category. Many previous works assumed (1) the input distribution is Gaussian and (2) the label is generated according to a planted neural network. Based on these two (unrealistic) conditions, it can be shown that randomly initialized (stochastic) gradient descent can learn a ReLU (Tian, 2017; Soltanolkotabi, 2017), a single convolutional filter (Brutzkus and Globerson, 2017), a convolutional neural network with one filter and one output layer (Du et al., 2018b) and residual network with small spectral norm weight matrix (Li and Yuan, 2017).5 Beyond Gaussian input distribution, Du et al. (2017b) showed for learning a convolutional filter, the Gaussian input distribution assumption can be relaxed but they still required the label is generated from an underlying true filter. Comparing with these work, our paper does not try to recover the underlying true neural network. Instead, we focus on providing theoretical justification on why randomly initialized gradient descent can achieve zero training loss, which is what we can observe and verify in practice.
|
| 73 |
+
|
| 74 |
+
Jacot et al. (2018) established an asymptotic result showing for the multilayer fully-connected neural network with a smooth activation function, if every layer’s weight matrix is infinitely wide, then for finite training time, the convergence of gradient descent can be characterized by a kernel. Our proof technique relies on a Gram matrix which is the kernel matrix in their paper. Our paper focuses on the two-layer neural network with ReLU activation function (non-smooth) and we are able to prove the Gram matrix is stable for infinite training time.
|
| 75 |
+
|
| 76 |
+
The most related paper is by Li and Liang (2018) who observed that when training a two-layer full connected neural network, most of the patterns $\begin{array} { r } { ( \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 \right\} ) } \end{array}$ ) do not change over iterations, which we also use to show the stability of the Gram matrix. They used this observation to obtain the convergence rate of GD on a two-layer over-parameterized neural network for the cross-entropy loss. They need the number of hidden nodes $m$ scales with $\mathrm { p o l y } ( 1 / \epsilon )$ where $\epsilon$ is the desired accuracy. Thus unless the number of hidden nodes $m \infty$ , their result does not imply GD can achieve zero training loss. We improve by allowing the amount of over-parameterization to be independent of the desired accuracy and show GD can achieve zero training loss. Furthermore, our proof is much simpler and more transparent so we believe it can be easily generalized to analyze other neural network architectures.
|
| 77 |
+
|
| 78 |
+
Other Analysis Approaches Chizat and Bach (2018) used optimal transport theory to analyze continuous time gradient descent on over-parameterized models. They required the second layer to be infinitely wide and their results on ReLU activated neural network is only at the formal level. Mei et al. analyzed SGD for optimizing the population loss and showed the dynamics can be captured by a partial differential equation in the suitable scaling limit. They listed some specific examples on input distributions including mixture of Gaussians. However, it is still unclear whether this framework can explain why first order methods can minimize the empirical risk. Daniely (2017) built connection between neural networks with kernel methods and showed stochastic gradient descent can learn a function that is competitive with the best function in the conjugate kernel space of the network. Again this work does not imply why first order methods can achieve zero training loss.
|
| 79 |
+
|
| 80 |
+
# 3 CONTINUOUS TIME ANALYSIS
|
| 81 |
+
|
| 82 |
+
In this section, we present our result for gradient flow, i.e., gradient descent with infinitesimal step size. The analysis of gradient flow is a stepping stone towards understanding discrete algorithms and this is the main topic of recent work (Arora et al., 2018; Du et al., 2018a). In the next section, we will modify the proof and give a quantitative bound for gradient descent with positive step size. Formally, we consider the ordinary differential equation6 defined by:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\frac { d \mathbf w _ { r } ( t ) } { d t } = - \frac { \partial L ( \mathbf W ( t ) , \mathbf a ) } { \partial \mathbf w _ { r } ( t ) }
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
for $r \in [ m ]$ . We denote $u _ { i } ( t ) = f ( \mathbf { W } ( t ) , \mathbf { a } , \mathbf { x } _ { i } )$ the prediction on input $\mathbf { x } _ { i }$ at time $t$ and we let $\mathbf { u } ( t ) = ( { \dot { u } } _ { 1 } { \bar { ( t ) } } , \dots , u _ { n } ( t ) ) \in \mathbb { R } ^ { n }$ be the prediction vector at time $t$ . We state our main assumption.
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } { \mathbf { \sigma } _ { | \mathbf { X } _ { i } ^ { \top } \mathbf { X } _ { j } | } ^ { \mathbf { n } } \frac { 3 \cdot \mathbf { 1 } . 1 } { D e f i n e } \qquad m a t r i x \qquad \mathbf { H } ^ { \infty } \qquad \in \qquad \mathbb { R } ^ { n \times n } \qquad w i t h \qquad \mathbf { H } _ { i j } ^ { \infty } \qquad } & { = } \\ { [ \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \mathbb { I } \{ \mathbf { w } ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } ^ { \top } \mathbf { x } _ { j } \geq 0 \} ] . \mathrm { ~ } W e \ a s s u m e \lambda _ { 0 } \triangleq \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ^ { \infty } ) > 0 . } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$\mathbf { H } ^ { \infty }$ is the Gram matrix induced by the ReLU activation function and the random initialization. Later we will show that during the training, though the Gram matrix may change (c.f. Equation (6)), it is still close to $\mathbf { H } ^ { \infty }$ . Furthermore, as will be apparent in the proof (c.f. Equation (7)), $\mathbf { H } ^ { \infty }$ is the fundamental quantity that determines the convergence rate. Interestingly, various properties of this $\mathbf { H } ^ { \infty }$ matrix has been studied in previous works (Xie et al., 2017; Tsuchida et al., 2017). Now to justify this assumption, the following theorem shows if no two inputs are parallel the least eigenvalue is strictly positive.
|
| 95 |
+
|
| 96 |
+
Theorem 3.1. If for any $i \neq j$ , $\mathbf { x } _ { i } \parallel \mathbf { x } _ { j }$ , then $\lambda _ { 0 } > 0$ .
|
| 97 |
+
|
| 98 |
+
Note for most real world datasets, no two inputs are parallel, so our assumption holds in general.
|
| 99 |
+
Now we are ready to state our main theorem in this section.
|
| 100 |
+
|
| 101 |
+
Theorem 3.2 (Convergence Rate of Gradient Flow). Suppose Assumption 3.1 holds and for all $i \in [ n ] ;$ , $\| \mathbf { x } _ { i } \| _ { 2 } = 1$ and $| y _ { i } | \le C$ for some constant $C$ . Then if we set the number of hidden nodes $\begin{array} { r } { m = \Omega \left( \frac { n ^ { 6 } } { \lambda _ { 0 } ^ { 4 } \delta ^ { 3 } } \right) } \end{array}$ and we i.i.d. initialize $\mathbf { w } _ { r } \sim N ( \mathbf { 0 } , \mathbf { I } )$ , ar ∼ unif $[ \{ - 1 , 1 \} ]$ for $r \in [ m ]$ , then with probability at least $1 - \delta$ over the initialization, we have
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\left\| \mathbf { u } ( t ) - \mathbf { y } \right\| _ { 2 } ^ { 2 } \leq \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { u } ( 0 ) - \mathbf { y } \right\| _ { 2 } ^ { 2 } .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
This theorem establishes that if $m$ is large enough, the training error converges to 0 at a linear rate. Here we assume $\| \mathbf { x } _ { i } \| _ { 2 } = 1$ only for simplicity and it is not hard to relax this condition.7 The bounded label condition also holds for most real world data set. The number of hidden nodes $m$ required is $\begin{array} { r } { \Omega \left( \frac { n ^ { 6 } } { \lambda _ { 0 } ^ { 4 } \delta ^ { 3 } } \right) } \end{array}$ , which depends on the number of samples $n$ , $\lambda _ { 0 }$ , and the failure probability $\delta$ . Over-parameterization, i.e., the fact $m = \mathrm { p o l y } ( n , 1 / \lambda _ { 0 } , 1 / \delta )$ , plays a crucial role in guaranteeing gradient descent to find the global minimum. In this paper, we only use the simplest concentration inequalities (Hoeffding’s and Markov’s) in order to have the cleanest proof. We believe using a more advanced concentration analysis we can further improve the dependency. Lastly, we note the specific convergence rate depends on $\lambda _ { 0 }$ but independent of the number of hidden nodes $m$ .
|
| 108 |
+
|
| 109 |
+
# 3.1 PROOF OF THEOREM 3.2
|
| 110 |
+
|
| 111 |
+
Our first step is to calculate the dynamics of each prediction.
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { l } { \displaystyle \frac { d } { d t } u _ { i } ( t ) = \sum _ { r = 1 } ^ { m } \langle \frac { \partial f ( \mathbf { W } ( t ) , \mathbf { a } , \mathbf { x } _ { i } ) } { \partial \mathbf { w } _ { r } ( t ) } , \frac { d \mathbf { w } _ { r } ( t ) } { d t } \rangle } \\ { \displaystyle \qquad = \sum _ { j = 1 } ^ { n } ( y _ { j } - u _ { j } ) \sum _ { r = 1 } ^ { m } \langle \frac { \partial f ( \mathbf { W } ( t ) , \mathbf { a } , \mathbf { x } _ { i } ) } { \partial \mathbf { w } _ { r } ( t ) } , \frac { \partial f ( \mathbf { W } ( t ) , \mathbf { a } , \mathbf { x } _ { j } ) } { \partial \mathbf { w } _ { r } ( t ) } \rangle \triangleq \sum _ { j = 1 } ^ { n } ( y _ { j } - u _ { j } ) \mathbf { H } _ { i j } ( t ) } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $\mathbf H ( t )$ is an $n \times n$ matrix with $( i , j )$ -th entry
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\mathbf { H } _ { i j } ( t ) = \frac { 1 } { m } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \sum _ { r = 1 } ^ { m } \mathbb { I } \left\{ \mathbf { x } _ { i } ^ { \top } \mathbf { w } _ { r } ( t ) \geq 0 , \mathbf { x } _ { j } ^ { \top } \mathbf { w } _ { r } ( t ) \geq 0 \right\} .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
With this $\mathbf { H } ( t )$ matrix, we can write the dynamics of predictions in a compact way:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\frac { d } { d t } { \bf u } ( t ) = { \bf H } ( t ) ( { \bf y } - { \bf u } ( t ) ) .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Remark 3.1. Note Equation (7) completely describes the dynamics of the predictions. In the rest of this section, we will show $( l )$ at initialization $\| \mathbf { H } ( 0 ) - \mathbf { H } ^ { \infty } \| _ { 2 }$ is $O ( \sqrt { 1 / m } )$ and (2) for all $t > 0$ , $\| \mathbf { H } ( t ) - \mathbf { H } ( 0 ) \| _ { 2 }$ is $O ( \sqrt { 1 / m } )$ . Therefore, according to Equation (7), as $m \infty$ , the dynamics of the predictions are characterized by $\mathbf { H } ^ { \infty }$ . This is the main reason we believe $\mathbf { H } ^ { \infty }$ is the fundamental quantity that describes this optimization process.
|
| 130 |
+
|
| 131 |
+
$\mathbf { H } ( t )$ is a time-dependent symmetric matrix. We first analyze its property when $t = 0$ . The following lemma shows if $m$ is large then $\mathbf { H } ( 0 )$ has a lower bounded least eigenvalue with high probability. The proof is by the standard concentration bound so we defer it to the appendix.
|
| 132 |
+
|
| 133 |
+
Lemma 3.1. If $\begin{array} { r } { m = \Omega \left( \frac { n ^ { 2 } } { \lambda _ { 0 } ^ { 2 } } \log \left( \frac { n } { \delta } \right) \right) } \end{array}$ , we have with probability at least $1 - \delta$ , $\begin{array} { r } { \| \mathbf { H } ( 0 ) - \mathbf { H } ^ { \infty } \| _ { 2 } \le \frac { \lambda _ { 0 } } { 4 } } \end{array}$ and $\lambda _ { \mathrm { m i n } } ( { \bf H } ( 0 ) ) \ge \textstyle { \frac { 3 } { 4 } } \lambda _ { 0 }$ .
|
| 134 |
+
|
| 135 |
+
Our second step is to show $\mathbf { H } ( t )$ is stable in terms of $\mathbf { W } ( t )$ . Formally, the following lemma shows for any $\mathbf { W }$ close to $\mathbf { W } ( 0 )$ , the induced Gram matrix $\mathbf { H }$ is close to $\mathbf { H } ( 0 )$ and has a lower bounded least eigenvalue.
|
| 136 |
+
|
| 137 |
+
Lemma 3.2. If $\mathbf { w } _ { 1 } , \ldots , \mathbf { w } _ { m }$ are i.i.d. generated from ${ \cal N } ( { \bf 0 } , { \bf I } )$ , then with probability at least $1 - \delta$ , the following holds. For any set of weight vectors $\mathbf { w } _ { 1 } , \hdots , \mathbf { w } _ { m } \in \mathbb { R } ^ { d }$ that satisfy for any $r \in [ m ]$ , $\begin{array} { r } { \| \mathbf { w } _ { r } ( 0 ) - \mathbf { w } _ { r } \| _ { 2 } \leq \frac { c \delta \lambda _ { 0 } } { n ^ { 2 } } \triangleq R } \end{array}$ for some small positive constant c, then the matrix $\mathbf { H } \in \mathbb { R } ^ { n \times n }$ defined by
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r l } & { \mathbf { H } _ { i j } = \displaystyle \frac { 1 } { m } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \sum _ { r = 1 } ^ { m } \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { j } \geq 0 \right\} } \\ & { \frac { \lambda _ { 0 } } { 4 } a n d \lambda _ { \operatorname* { m i n } } \left( \mathbf { H } \right) > \frac { \lambda _ { 0 } } { 2 } . } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
satisfies $\begin{array} { r } { \| \mathbf { H } - \mathbf { H } ( 0 ) \| _ { 2 } < \frac { \lambda _ { 0 } } { 4 } } \end{array}$
|
| 144 |
+
|
| 145 |
+
This lemma plays a crucial role in our analysis so we give the proof below.
|
| 146 |
+
|
| 147 |
+
Proof of Lemma 3.2 We define the event
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
A _ { i r } = \left\{ \exists \mathbf { w } : \left\| \mathbf { w } - \mathbf { w } _ { r } ( 0 ) \right\| \leq R , \mathbb { I } \left\{ \mathbf { x } _ { i } ^ { \top } \mathbf { w } _ { r } ( 0 ) \geq 0 \right\} \neq \mathbb { I } \left\{ \mathbf { x } _ { i } ^ { \top } \mathbf { w } \geq 0 \right\} \right\} .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
Note this event happens if and only if $| { \bf w } _ { r } ( 0 ) ^ { \top } { \bf x } _ { i } | < R$ . Recall $\mathbf { w } _ { r } ( 0 ) \sim N ( \mathbf { 0 } , \mathbf { I } )$ . By anticoncentration inequality of Gaussian, we have $\begin{array} { r } { P ( A _ { i r } ) = P _ { z \sim N ( 0 , 1 ) } \left( | z | < R \right) \le \frac { 2 R } { \sqrt { 2 \pi } } } \end{array}$ . Therefore, for any set of weight vectors $\mathbf { w } _ { 1 } , \ldots , \mathbf { w } _ { m }$ that satisfy the assumption in the lemma, we can bound the entry-wise deviation on their induced matrix $\mathbf { H }$ : for any $( i , j ) \in [ n ] \times [ n ]$
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\begin{array} { r l } & { \quad \mathbb E [ | \mathbf H _ { i j } ( 0 ) - \mathbf H _ { i j } | ] } \\ & { = \mathbb E [ \frac 1 m | \mathbf x _ { i } ^ { \top } \mathbf x _ { j } \sum _ { r = 1 } ^ { m } ( \mathbb I \{ \mathbf w _ { r } ( 0 ) ^ { \top } \mathbf x _ { i } \geq 0 , \mathbf w _ { r } ( 0 ) ^ { \top } \mathbf x _ { j } \geq 0 \} - \mathbb I \{ \mathbf w _ { r } ^ { \top } \mathbf x _ { i } \geq 0 , \mathbf w _ { r } ^ { \top } \mathbf x _ { j } \geq 0 \} ) ] } \\ & { \leq \frac { 1 } { m } \displaystyle \sum _ { r = 1 } ^ { m } \mathbb E [ \mathbb I \{ A _ { i r } \cup A _ { j r } \} ] \leq \frac { 4 R } { \sqrt { 2 \pi } } } \end{array}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
where the expectation is taken over the random initialization of $\mathbf { w } _ { 1 } ( 0 ) , \ldots , \mathbf { w } _ { m } ( 0 )$ . Summing over
|
| 160 |
+
$( i , j )$ $\begin{array} { r } { \mathbb { E } \left[ \sum _ { ( i , j ) = ( 1 , 1 ) } ^ { ( n , n ) } | \mathbf { H } _ { i j } - \mathbf { H } _ { i j } ( 0 ) | \right] \leq \frac { 4 n ^ { 2 } R } { \sqrt { 2 \pi } } } \end{array}$ Thus by Markov’s inequality, with proba-. Next, we use matrix perturbation theory $1 - \delta$ $\begin{array} { r } { \sum _ { ( i , j ) = ( 1 , 1 ) } ^ { ( n , n ) } | { \bf H } _ { i j } - { \bf H } _ { i j } ( 0 ) | \leq \frac { 4 n ^ { 2 } R } { \sqrt { 2 \pi } \delta } } \end{array}$
|
| 161 |
+
to bound the deviation from the initialization
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\left\| \mathbf { H } - \mathbf { H } ( 0 ) \right\| _ { 2 } \leq \left\| \mathbf { H } - \mathbf { H } ( 0 ) \right\| _ { F } \leq \sum _ { ( i , j ) = ( 1 , 1 ) } ^ { ( n , n ) } \left| \mathbf { H } _ { i j } - \mathbf { H } _ { i j } ( 0 ) \right| \leq { \frac { 4 n ^ { 2 } R } { \sqrt { 2 \pi } \delta } } .
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
Lastly, we lower bound the smallest eigenvalue by plugging in $R$
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\lambda _ { \mathrm { m i n } } ( \mathbf { H } ) \geq \lambda _ { \mathrm { m i n } } ( \mathbf { H } ( 0 ) ) - \frac { 4 n ^ { 2 } R } { \sqrt { 2 \pi } \delta } \geq \frac { \lambda _ { 0 } } { 2 } . \quad \bigsqcup
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
The next lemma shows two facts if the least eigenvalue of $\mathbf { H } ( t )$ is lower bounded. First, the loss converges to 0 at a linear convergence rate. Second, $\mathbf { w } _ { r } ( t )$ is close to the initialization for every $r \in [ m ]$ . This lemma clearly demonstrates the power of over-parameterization.
|
| 174 |
+
|
| 175 |
+
Lemma 3.3. Suppose for $0 ~ \leq ~ s ~ \leq ~ t$ , $\begin{array} { r } { \lambda _ { \mathrm { m i n } } \left( \mathbf { H } ( s ) \right) ~ \ge ~ \frac { \lambda _ { 0 } } { 2 } } \end{array}$ . Then we have $\| \mathbf { y } - \mathbf { u } ( t ) \| _ { 2 } ^ { 2 } ~ \leq$ exp(−λ0t) ky − u(0)k22 and for any r ∈ [m], kwr(t) − wr(0)k2 ≤ nky−u(0)k√ 2mλ , R0.
|
| 176 |
+
|
| 177 |
+
Proof of Lemma 3.3 Recall we can write the dynamics of predictions as $\begin{array} { r } { \frac { d } { d t } { \bf u } ( t ) = { \bf H } ( { \bf y } - { \bf u } ( t ) ) } \end{array}$ . We can calculate the loss function dynamics
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\begin{array} { r l } & { \displaystyle \frac { d } { d t } \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } = - 2 \left( \mathbf { y } - \mathbf { u } ( t ) \right) ^ { \top } \mathbf { H } ( t ) \left( \mathbf { y } - \mathbf { u } ( t ) \right) } \\ & { \quad \quad \leq - \lambda _ { 0 } \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } . } \end{array}
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
Thus we have $\begin{array} { r } { \frac { d } { d t } \left( \exp ( \lambda _ { 0 } t ) \| \mathbf { y } - \mathbf { u } ( t ) \| _ { 2 } ^ { 2 } \right) \leq 0 } \end{array}$ and $\exp ( \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 }$ is a decreasing function with respect to $t$ . Using this fact we can bound the loss
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } \leq \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 } .
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
Therefore, ${ \bf u } ( t ) { \bf y }$ exponentially fast. Now we bound the gradient norm. Recall for $0 \leq s \leq t$ ,
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\begin{array} { r l r } { { \| \frac { d } { d s } \mathbf { w } _ { r } ( s ) \| _ { 2 } = \| \sum _ { i = 1 } ^ { n } ( y _ { i } - u _ { i } ) \frac { 1 } { \sqrt { m } } a _ { r } \mathbf { x } _ { i } \mathbb { I } \{ \mathbf { w } _ { r } ( s ) ^ { \top } \mathbf { x } _ { i } \geq 0 \} \| _ { 2 } } } \\ & { } & { \leq \frac { 1 } { \sqrt { m } } \displaystyle \sum _ { i = 1 } ^ { n } | y _ { i } - u _ { i } ( s ) | \leq \frac { \sqrt { n } } { \sqrt { m } } \| \mathbf { y } - \mathbf { u } ( s ) \| _ { 2 } \leq \frac { \sqrt { n } } { \sqrt { m } } \exp ( - \lambda _ { 0 } s ) \| \mathbf { y } - \mathbf { u } ( 0 ) \| _ { 2 } . } \end{array}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
Integrating the gradient, we can bound the distance from the initialization
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq \int _ { 0 } ^ { t } \left\| { \frac { d } { d s } } \mathbf { w } _ { r } ( s ) \right\| _ { 2 } d s \leq { \frac { { \sqrt { n } } \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } } { { \sqrt { m } } \lambda _ { 0 } } } . \quad \prod
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
The next lemma shows if $R ^ { \prime } < R$ , the conditions in Lemma 3.2 and 3.3 hold for all $t \geq 0$ . The proof is by contradiction and we defer it to appendix.
|
| 202 |
+
|
| 203 |
+
Lemma 3.4. If $\smash { R ^ { \prime } { \mathrm { ~ ~ } } ^ { } < { \mathrm { ~ ~ } } R }$ , we have for all $t ~ \geq ~ 0$ , $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( t ) ) ~ \geq ~ \frac { 1 } { 2 } \lambda _ { 0 } } \end{array}$ , for all $r \in [ m ]$ $\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R ^ { \prime }$ and $\left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } \leq \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 }$ .
|
| 204 |
+
|
| 205 |
+
Thus it is sufficient to show $R ^ { \prime } < R$ which is equivalent to $\begin{array} { r } { m = \Omega \left( \frac { n ^ { 5 } \lVert \mathbf { y } - \mathbf { u } ( 0 ) \rVert _ { 2 } ^ { 2 } } { \lambda _ { 0 } ^ { 4 } \delta ^ { 2 } } \right) } \end{array}$ . We bound
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\mathbb { \Sigma } \left[ \Vert \mathbf { y } - \mathbf { u } ( 0 ) \Vert _ { 2 } ^ { 2 } \right] = \sum _ { i = 1 } ^ { n } ( y _ { i } ^ { 2 } + y _ { i } \mathbb { E } \left[ f ( \mathbf { W } ( 0 ) , \mathbf { a } , \mathbf { x } _ { i } ) \right] + \mathbb { E } \left[ f ( \mathbf { W } ( 0 ) , \mathbf { a } , \mathbf { x } _ { i } ) ^ { 2 } \right] ) = \sum _ { i = 1 } ^ { n } ( y _ { i } ^ { 2 } + 1 ) = O ( n ) .
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
Thus by Markov’s inequality, we have with probability at least 1 − δ, $\begin{array} { r } { \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 } = O ( \frac { n } { \delta } ) } \end{array}$ . Plugging in this bound we prove the theorem.
|
| 212 |
+
|
| 213 |
+
# 3.2 JOINTLY TRAINING BOTH LAYERS
|
| 214 |
+
|
| 215 |
+
In this subsection, we showcase our proof technique can be applied to analyze the convergence of gradient flow for jointly training both layers. Formally, we consider the ordinary differential equation defined by:
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
\frac { d \mathbf w _ { r } ( t ) } { d t } = - \frac { \partial L ( \mathbf W ( t ) , \mathbf a ( t ) ) } { \partial \mathbf w _ { r } ( t ) } \mathrm { ~ a n d ~ } \frac { d \mathbf w _ { r } ( t ) } { d t } = - \frac { \partial L ( \mathbf W ( t ) , \mathbf a ( t ) ) } { \partial \mathbf a _ { r } ( t ) }
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
for $r = 1 , \ldots , m$ . The following theorem shows using gradient flow to jointly train both layers, we can still enjoy linear convergence rate towards zero loss.
|
| 222 |
+
|
| 223 |
+
Theorem 3.3 (Convergence Rate of Gradient Flow for Training Both Layers). Under the same assumptions as in Theorem 3.2, if we set the number of hidden nodes $\begin{array} { r } { m = \dot { \Omega } \left( \frac { n ^ { 6 } \log ( m / \delta ) } { \lambda _ { 0 } ^ { 4 } \delta ^ { 3 } } \right) } \end{array}$ and we i.i.d. initialize $\mathbf { w } _ { r } \sim N ( \mathbf { 0 } , \mathbf { I } )$ , $a _ { r } \sim \mathrm { u n i f } \left[ \left\{ - 1 , 1 \right\} \right]$ for $r \in [ m ]$ , with probability at least $1 - \delta$ over the initialization we have
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
\left\| \mathbf { u } ( t ) - \mathbf { y } \right\| _ { 2 } ^ { 2 } \leq \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { u } ( 0 ) - \mathbf { y } \right\| _ { 2 } ^ { 2 } .
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
Theorem 3.3 shows under the same assumptions as in Theorem 3.2, we can achieve the same convergence rate as that of only training the first layer. The proof of Theorem 3.3 relies on the same arguments as the proof of Theorem 3.2. Again we consider the dynamics of the predictions and this dynamics is characterized by a Gram matrix. We can show for all $t > 0$ , this Gram matrix is close to the Gram matrix at the initialization phase. We refer readers to appendix for the full proof.
|
| 230 |
+
|
| 231 |
+
# 4 DISCRETE TIME ANALYSIS
|
| 232 |
+
|
| 233 |
+
In this section, we show randomly initialized gradient descent with a constant positive step size converges to the global minimum at a linear rate. We first present our main theorem.
|
| 234 |
+
|
| 235 |
+
Theorem 4.1 (Convergence Rate of Gradient Descent). Under the same assumptions as in Theorem 3.2, if we set the number of hidden nodes $\begin{array} { r } { m = \Omega \left( \frac { n ^ { 6 } } { \lambda _ { 0 } ^ { 4 } \delta ^ { 3 } } \right) } \end{array}$ , we i.i.d. initialize $\mathbf { w } _ { r } \sim N ( \mathbf { 0 } , \mathbf { I } )$ , $a _ { r } \sim \mathrm { u n i f } \left[ \{ - 1 , 1 \} \right] f o r r \in [ m ]$ , and we set the step size $\begin{array} { r } { \eta = O \left( \frac { \lambda _ { 0 } } { n ^ { 2 } } \right) } \end{array}$ then with probability at least $1 - \delta$ over the random initialization we have for $k = 0 , 1 , 2 , \ldots$ .
|
| 236 |
+
|
| 237 |
+
$$
|
| 238 |
+
\left\| \mathbf { u } ( k ) - \mathbf { y } \right\| _ { 2 } ^ { 2 } \leq \left( 1 - \frac { \eta \lambda _ { 0 } } { 2 } \right) ^ { k } \left\| \mathbf { u } ( 0 ) - \mathbf { y } \right\| _ { 2 } ^ { 2 } .
|
| 239 |
+
$$
|
| 240 |
+
|
| 241 |
+
Theorem 4.1 shows even though the objective function is non-smooth and non-convex, gradient descent with a constant step size still enjoys a linear convergence rate. Our assumptions on the least eigenvalue and the number of hidden nodes are exactly the same as the theorem for gradient flow.
|
| 242 |
+
|
| 243 |
+
# 4.1 PROOF OF THEOREM 4.1
|
| 244 |
+
|
| 245 |
+
We prove Theorem 4.1 by induction. Our induction hypothesis is just the following convergence rate of the empirical loss.
|
| 246 |
+
|
| 247 |
+
Condition 4.1. At the k-th iteration, we have $\begin{array} { r } { \| \mathbf { y } - \mathbf { u } ( k ) \| _ { 2 } ^ { 2 } \leq ( 1 - \frac { \eta \lambda _ { 0 } } { 2 } ) ^ { k } \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 } . } \end{array}$
|
| 248 |
+
|
| 249 |
+
A directly corollary of this condition is the following bound of deviation from the initialization. The proof is similar to that of Lemma 3.3 so we defer it to appendix.
|
| 250 |
+
|
| 251 |
+
Corollary 4.1. If Condition 4.1 holds for $k ^ { \prime } = 0 , \ldots , k$ , then we have for every $r \in [ m ]$
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\| \mathbf { w } _ { r } ( k + 1 ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq \frac { 4 \sqrt { n } \| \mathbf { y } - \mathbf { u } ( 0 ) \| _ { 2 } } { \sqrt { m } \lambda _ { 0 } } \triangleq R ^ { \prime } .
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
Now we show Condition 4.1 holds for every $k = 0 , 1 , \ldots$ . For the base case $k = 0$ , by definition Condition 4.1 holds. Suppose for $k ^ { \prime } = 0 , \ldots , k$ , Condition 4.1 holds and we want to show Condition 4.1 holds for $k ^ { \prime } = k + 1$ .
|
| 258 |
+
|
| 259 |
+
Our strategy is similar to the proof of Theorem 3.2. We define the event
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
A _ { i r } = \left\{ \exists \mathbf { w } : \left\| \mathbf { w } - \mathbf { w } _ { r } ( 0 ) \right\| \leq R , \mathbb { I } \left\{ \mathbf { x } _ { i } ^ { \top } \mathbf { w } _ { r } ( 0 ) \geq 0 \right\} \neq \mathbb { I } \left\{ \mathbf { x } _ { i } ^ { \top } \mathbf { w } \geq 0 \right\} \right\} .
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
where $\begin{array} { r } { R \ = \ \frac { c \lambda _ { 0 } } { n ^ { 2 } } } \end{array}$ for some small positive constant $c$ . Different from gradient flow, for gradient descent we need a more refined analysis. We let $S _ { i } = \{ r \in [ m ] : \mathbb { I } \{ A _ { i r } \} = 0 \}$ and $S _ { i } ^ { \perp } = [ m ] \setminus S _ { i }$ . The following lemma bounds the sum of sizes of $S _ { i } ^ { \perp }$ . The proof is similar to the analysis used in Lemma 3.2. See Section A for the whole proof.
|
| 266 |
+
|
| 267 |
+
Lemma 4.1. With probability at least $1 - \delta$ over the initialization, we have $\begin{array} { r } { \sum _ { i = 1 } ^ { n } \left| S _ { i } ^ { \perp } \right| \leq \frac { C m n R } { \delta } } \end{array}$ for some positive constant $C > 0$ .
|
| 268 |
+
|
| 269 |
+
Next, we calculate the difference of predictions between two consecutive iterations, analogue to $\frac { d u _ { i } ( t ) } { d t }$ term in Section 3.
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
\begin{array} { r l } & { u _ { i } ( k + 1 ) - u _ { i } ( k ) = \displaystyle \frac { 1 } { \sqrt { m } } \sum _ { r = 1 } ^ { m } a _ { r } \left( \sigma \left( \mathbf { w } _ { r } ( k + 1 ) ^ { \top } \mathbf { x } _ { i } \right) - \sigma \left( \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \right) \right) } \\ & { \quad \quad \quad \quad = \displaystyle \frac { 1 } { \sqrt { m } } \sum _ { r = 1 } ^ { m } a _ { r } \left( \sigma \left( \left( \mathbf { w } _ { r } ( k ) - \eta \frac { \partial L \left( \mathbf { W } ( k ) \right) } { \partial \mathbf { w } _ { r } ( k ) } \right) ^ { \top } \mathbf { x } _ { i } \right) - \sigma \left( \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \right) \right) . } \end{array}
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
Here we divide the right hand side into two parts. $I _ { 1 } ^ { i }$ accounts for terms that the pattern does not change and $I _ { 2 } ^ { i }$ accounts for terms that pattern may change.
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
\begin{array} { r l } & { I _ { 1 } ^ { i } \triangleq \frac { 1 } { \sqrt { m } } \displaystyle \sum _ { r \in S _ { i } } a _ { r } \left( \sigma \left( \left( \mathbf { w } _ { r } ( k ) - \eta \frac { \partial L \left( \mathbf { W } ( k ) \right) } { \partial \mathbf { w } _ { r } ( k ) } \right) ^ { \top } \mathbf { x } _ { i } \right) - \sigma \left( \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \right) \right) } \\ & { I _ { 2 } ^ { i } \triangleq \frac { 1 } { \sqrt { m } } \displaystyle \sum _ { r \in S _ { i } ^ { \perp } } a _ { r } \left( \sigma \left( \left( \mathbf { w } _ { r } ( k ) - \eta \frac { \partial L \left( \mathbf { W } ( k ) \right) } { \partial \mathbf { w } _ { r } ( k ) } \right) ^ { \top } \mathbf { x } _ { i } \right) - \sigma \left( \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \right) \right) } \end{array}
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
We view $I _ { 2 } ^ { i }$ as a perturbation and bound its magnitude. Because ReLU is a 1-Lipschitz function and $\left| a _ { r } \right| = 1$ , we have
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
I _ { 2 } ^ { i } \big | \leq \frac { \eta } { \sqrt { m } } \sum _ { r \in S _ { i } ^ { \perp } } \left| \left( \frac { \partial L ( \mathbf { W } ( k ) ) } { \partial \mathbf { w } _ { r } ( k ) } \right) ^ { \top } \mathbf { x } _ { i } \right| \leq \frac { \eta \left| S _ { i } ^ { \perp } \right| } { \sqrt { m } } \operatorname* { m a x } _ { r \in [ m ] } \left\| \frac { \partial L ( \mathbf { W } ( k ) ) } { \partial \mathbf { w } _ { r } ( k ) } \right\| _ { 2 } \leq \frac { \eta \left| S _ { i } \right| ^ { \perp } \sqrt { n } \left\| \mathbf { u } ( k ) - \mathbf { y } \right\| _ { 2 } } { m } .
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
To analyze $I _ { 1 } ^ { i }$ , by Corollary 4.1, we know $\| \mathbf { w } _ { r } ( k ) - \mathbf { w } _ { r } ( 0 ) \| \leq R ^ { \prime }$ and $\| \mathbf { w } _ { r } ( k ) - \mathbf { w } _ { r } ( 0 ) \| \leq R ^ { \prime }$ fo r all $r \in [ m ]$ . Furthermore, because $R ^ { \prime } < R$ , we know $\mathbb { I } \left\{ \mathbf { w } _ { r } ( k + 1 ) ^ { \top } \mathbf { x } _ { i } \geq 0 \right\} = \mathbb { I } \left\{ \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \geq 0 \right\}$ for $r \in S _ { i }$ . Thus we can find a more convenient expression of $I _ { 1 } ^ { i }$ for analysis
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
\begin{array} { l } { { \displaystyle I _ { 1 } ^ { i } = - \frac { \eta } { m } \sum _ { j = 1 } ^ { n } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \left( u _ { j } - y _ { j } \right) \sum _ { r \in S _ { i } } \mathbb { I } \left\{ \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \ge 0 , \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { j } \ge 0 \right\} } } \\ { { \displaystyle \quad = - \eta \sum _ { j = 1 } ^ { n } ( u _ { j } - y _ { j } ) ( \mathbf { H } _ { i j } ( k ) - \mathbf { H } _ { i j } ^ { \bot } ( k ) ) } } \end{array}
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
where $\begin{array} { r l r } { \mathbf { H } _ { i j } ( k ) } & { { } = } & { \frac { 1 } { m } \sum _ { r = 1 } ^ { m } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \mathbb { I } \left\{ \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { j } \geq 0 \right\} } \end{array}$ is just the $( i , j )$ -th entry of a discrete version of Gram matrix defined in Section 3 and $\begin{array} { r l } { \mathbf { H } _ { i j } ^ { \perp } ( k ) } & { { } = } \end{array}$ $\begin{array} { r } { \frac { 1 } { m } \sum _ { r \in S _ { i } ^ { \perp } } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \mathbb { I } \left\{ \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } _ { r } ( k ) ^ { \top } \mathbf { x } _ { j } \geq 0 \right\} } \end{array}$ is a perturbation matrix. Let $\mathbf { H } ^ { \perp } ( k )$ be the $n \times n$ matrix with $( i , j )$ -th entry being $\mathbf { H } _ { i j } ^ { \perp } ( k )$ . Using Lemma 4.1, we obtain an upper bound of the operator norm
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\big \| \mathbf { H } ^ { \bot } ( k ) \big \| _ { 2 } \leq \sum _ { ( i , j ) = ( 1 , 1 ) } ^ { ( n , n ) } \big | \mathbf { H } _ { i j } ^ { \bot } ( k ) \big | \leq \frac { n \sum _ { i = 1 } ^ { n } \big | S _ { i } ^ { \bot } \big | } { m } \leq \frac { C n ^ { 2 } m R } { \delta m } \leq \frac { C n ^ { 2 } R } { \delta } .
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
Similar to the classical analysis of gradient descent, we also need bound the quadratic term.
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\left\| { \mathbf { u } ( k + 1 ) - \mathbf { u } ( k ) } \right\| _ { 2 } ^ { 2 } \leq \eta ^ { 2 } \sum _ { i = 1 } ^ { n } \frac { 1 } { m } \left( \sum _ { r = 1 } ^ { m } \left\| \frac { \partial L ( \mathbf { W } ( k ) ) } { \partial \mathbf { w } _ { r } ( k ) } \right\| _ { 2 } \right) ^ { 2 } \leq \eta ^ { 2 } n ^ { 2 } \left\| \mathbf { y } - \mathbf { u } ( k ) \right\| _ { 2 } ^ { 2 } .
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
With these estimates at hand, we are ready to prove the induction hypothesis.
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { r l } & { \left\| { \mathbf { y } - \mathbf { u } ( k + 1 ) } \right\| _ { 2 } ^ { 2 } = \left\| { \mathbf { y } - \mathbf { u } ( k ) - ( \mathbf { u } ( k + 1 ) - \mathbf { u } ( k ) ) } \right\| _ { 2 } ^ { 2 } } \\ & { \qquad = \left\| { \mathbf { y } - \mathbf { u } ( k ) } \right\| _ { 2 } ^ { 2 } - 2 ( { \mathbf { y } - \mathbf { u } ( k ) } ) ^ { \top } \left( \mathbf { u } ( k + 1 ) - \mathbf { u } ( k ) \right) + \left\| \mathbf { u } ( k + 1 ) - \mathbf { u } ( k ) \right\| _ { 2 } ^ { 2 } } \\ & { \qquad = \left\| { \mathbf { y } - \mathbf { u } ( k ) } \right\| _ { 2 } ^ { 2 } - 2 \eta \left( { \mathbf { y } - \mathbf { u } ( k ) } \right) ^ { \top } \mathbf { H } ( k ) \left( { \mathbf { y } - \mathbf { u } ( k ) } \right) } \\ & { \qquad + 2 \eta \left( { \mathbf { y } - \mathbf { u } ( k ) } \right) ^ { \top } \mathbf { H } ( k ) ^ { \bot } \left( { \mathbf { y } - \mathbf { u } ( k ) } \right) - 2 ( { \mathbf { y } - \mathbf { u } ( k ) } ) ^ { \top } \mathbf { I } _ { 2 } } \\ & { \qquad + \left\| \mathbf { u } ( k + 1 ) - \mathbf { u } ( k ) \right\| _ { 2 } ^ { 2 } } \\ & { \qquad \le ( 1 - \eta \lambda _ { 0 } + \frac { 2 C \eta m ^ { 2 } R } { \delta } + \frac { 2 C \eta m ^ { 3 / 2 } R } { \delta } + \eta ^ { 2 } n ^ { 2 } ) \left\| { \mathbf { y } - \mathbf { u } ( k ) } \right\| _ { 2 } ^ { 2 } } \\ & { \qquad \le ( 1 - \frac { \eta \lambda _ { 0 } } { 2 } ) \left\| { \mathbf { y } - \mathbf { u } ( k ) } \right\| _ { 2 } ^ { 2 } . } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
The third equality we used the decomposition of $\mathbf u ( k + 1 ) - \mathbf u ( k )$ . The first inequality we used the Lemma 3.2, the bound on the step size, the bound on $\mathbf { I } _ { 2 }$ , the bound on $\left\| \mathbf { H } ( k ) ^ { \perp } \right\| _ { 2 }$ and the bound on $\| \mathbf { u } ( k + 1 ) - \mathbf { u } ( k ) \| _ { 2 } ^ { 2 }$ . The last inequality we used the bound of the step size and the bound of $R$ . Therefore Condition 4.1 holds for $k ^ { \prime } = k + 1$ . Now by induction, we prove Theorem 4.1. □
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 1: Results on synthetic data.
|
| 315 |
+
|
| 316 |
+
# 5 EXPERIMENTS
|
| 317 |
+
|
| 318 |
+
In this section, we use synthetic data to corroborate our theoretical findings. We use the initialization and training procedure described in Section 1. For all experiments, we run 100 epochs of gradient descent and use a fixed step size. We uniformly generate $n = 1 0 0 0$ data points from a $d = 1 0 0 0$ dimensional unit sphere and generate labels from a one-dimensional standard Gaussian distribution.
|
| 319 |
+
|
| 320 |
+
We test three metrics with different widths $( m )$ . First, we test how the amount of overparameterization affects the convergence rates. Second, we test the relation between the amount of over-parameterization and the number of pattern changes. Formally, at a given iteration $k$ , we check Pmi=1 Pmr=1 I{sign(wr(0)>xi)6=sign(wr(k)>xi)} (there are mn patterns). This aims to verify Lemma 3.2. Last, we test the relation between the amount of over-parameterization and the maximum of the distances between weight vectors and their initializations. Formally, at a given iteration $k$ , we check $\begin{array} { r } { \operatorname* { m a x } _ { r \in [ m ] } \| \mathbf { w } _ { r } ( k ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } } \end{array}$ . This aims to verify Lemma 3.3 and Corollary 4.1.
|
| 321 |
+
|
| 322 |
+
Figure 1a shows as $m$ becomes larger, we have better convergence rate. We believe the reason is as $m$ becomes larger, $\mathbf { H } ( t )$ matrix becomes more stable, and thus has larger least eigenvalue. Figure 1b and Figure 1c show as $m$ becomes larger, the percentiles of pattern changes and the maximum distance from the initialization become smaller. These empirical findings are consistent with our theoretical results.
|
| 323 |
+
|
| 324 |
+
# 6 CONCLUSION AND DISCUSSION
|
| 325 |
+
|
| 326 |
+
In this paper we show with over-parameterization, gradient descent provable converges to the global minimum of the empirical loss at a linear convergence rate. The key proof idea is to show the over-parameterization makes Gram matrix remain positive definite for all iterations, which in turn guarantees the linear convergence. Here we list some future directions.
|
| 327 |
+
|
| 328 |
+
First, we believe our approach can be generalized to deep neural networks. We elaborate the main idea here for gradient flow. Consider a deep neural network of the form
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
f ( \mathbf { x } , \mathbf { W } , \mathbf { a } ) = \mathbf { a } ^ { \top } \sigma \left( \mathbf { W } ^ { ( H ) } \cdots \sigma \left( \mathbf { W } ^ { ( 1 ) } \mathbf { x } \right) \right)
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $\mathbf { x } \in \mathbb { R } ^ { d }$ is the input, $\mathbf { W } ^ { ( 1 ) } \in \mathbb { R } ^ { m \times d }$ is the first layer, $\mathbf { W } ^ { ( h ) } \in \mathbb { R } ^ { m \times m }$ for $h = 2 , \ldots , H$ are the middle layers and $\mathbf { a } \in \mathbb { R } ^ { m }$ is the output layer. Recall $u _ { i }$ is the $i$ -th prediction. If we use the quadratic loss, we can compute
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\frac { d \mathbf { W } ^ { ( h ) } ( t ) } { d t } = - \frac { \partial L ( \mathbf { W } ( t ) ) } { \partial \mathbf { W } ^ { ( h ) } ( t ) } = \sum _ { i = 1 } ^ { n } \left( y _ { i } - u _ { i } ( t ) \right) \frac { \partial u _ { i } ( t ) } { \partial \mathbf { W } ^ { ( h ) } ( t ) } .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Similar to Equation (5), we can calculate
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\frac { d u _ { i } ( t ) } { d t } = \sum _ { h = 1 } ^ { H } \langle \frac { \partial u _ { i } ( t ) } { \partial \mathbf { W } ^ { ( h ) } } , \frac { \partial \mathbf { W } ^ { ( h ) } } { d t } \rangle = \sum _ { j = 1 } ^ { n } ( y _ { j } - u _ { j } ( t ) ) \sum _ { h = 1 } ^ { H } \mathbf { G } _ { i j } ^ { ( h ) } ( t )
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
where $\mathbf { G } ^ { ( h ) } ( t ) \in \mathbb { R } ^ { n \times n }$ with ) (t) = h ∂ui(t)W(h)(t) , ∂uj (t)W(h)(t) i . Therefore, similar to Equation (7), we can write
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\frac { d { \bf u } ( t ) } { d t } = \sum _ { h = 1 } ^ { H } { \bf G } ^ { ( h ) } ( t ) \left( { { \bf y } } - { \bf u } ( t ) \right) .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Note for every $h \in [ H ]$ , $\mathbf { G } ^ { ( h ) }$ is a Gram matri and thus it is positive semidefinite. If $\textstyle \sum _ { h = 1 } ^ { H } \mathbf { G } ^ { ( h ) } ( t )$ has a lower bounded least eigenvalue for all $t$ , then similar to Section 3, gradient flow converges to zero training loconjecture that if $m$ at a linear conveis large enough, $\textstyle \sum _ { h = 1 } ^ { H } \mathbf { G } ^ { ( h ) } ( 0 )$ sed on our observations inis close to a fixed matrix $\textstyle \sum _ { h = 1 } ^ { H } \mathbf { G } _ { \infty } ^ { ( h ) }$ , weand $\textstyle \sum _ { h = 1 } ^ { H } \mathbf { G } ^ { ( h ) } ( t )$ is close its initialization $\textstyle \sum _ { h = 1 } ^ { H } \mathbf { G } ^ { ( h ) } ( 0 )$ for all $t > 0$ . Therefore, using the same arguments as we used in Section 3, as long as $\textstyle \sum _ { h = 1 } ^ { H } \mathbf { G } _ { \infty } ^ { ( h ) }$ has a lower bounded least eigenvalue, gradient flow converges to zero training loss at a linear convergence rate.
|
| 353 |
+
|
| 354 |
+
Second, we believe the number of hidden nodes $m$ required can be reduced. For example, previous work (Soudry and Carmon, 2016) showed $\textstyle m \geq { \frac { n } { d } }$ is enough to make all differentiable local minima global. In our setting, using advanced tools from probability and matrix perturbation theory to analyze $\mathbf H ( t )$ , we may be able to tighten the bound.
|
| 355 |
+
|
| 356 |
+
Lastly, in our paper, we used the empirical loss as a potential function to measure the progress. If we use another potential function, we may be able to prove the convergence rates of accelerated methods. This technique has been exploited in Wilson et al. (2016) for analyzing convex optimization. It would be interesting to bring their idea to analyze other first order methods for optimizing neural networks.
|
| 357 |
+
|
| 358 |
+
# ACKNOWLEDGMENTS
|
| 359 |
+
|
| 360 |
+
This research was partly funded by AFRL grant FA8750-17-2-0212 and DARPA D17AP00001. We thank Wei Hu, Jason D. Lee and Ruosong Wang for useful discussions.
|
| 361 |
+
|
| 362 |
+
# REFERENCES
|
| 363 |
+
|
| 364 |
+
Alexandr Andoni, Rina Panigrahy, Gregory Valiant, and Li Zhang. Learning polynomials with neural networks. In International Conference on Machine Learning, pages 1908–1916, 2014.
|
| 365 |
+
Sanjeev Arora, Nadav Cohen, and Elad Hazan. On the optimization of deep networks: Implicit acceleration by overparameterization. arXiv preprint arXiv:1802.06509, 2018.
|
| 366 |
+
Alon Brutzkus and Amir Globerson. Globally optimal gradient descent for a ConvNet with gaussian inputs. In International Conference on Machine Learning, pages 605–614, 2017.
|
| 367 |
+
Lenaic Chizat and Francis Bach. On the global convergence of gradient descent for overparameterized models using optimal transport. arXiv preprint arXiv:1805.09545, 2018.
|
| 368 |
+
Amit Daniely. SGD learns the conjugate kernel class of the network. In Advances in Neural Information Processing Systems, pages 2422–2430, 2017.
|
| 369 |
+
Damek Davis, Dmitriy Drusvyatskiy, Sham Kakade, and Jason D Lee. Stochastic subgradient method converges on tame functions. arXiv preprint arXiv:1804.07795, 2018.
|
| 370 |
+
Simon S Du and Jason D Lee. On the power of over-parametrization in neural networks with quadratic activation. Proceedings of the 35th International Conference on Machine Learning, pages 1329–1338, 2018.
|
| 371 |
+
Simon S Du, Chi Jin, Jason D Lee, Michael I Jordan, Aarti Singh, and Barnabas Poczos. Gradient descent can take exponential time to escape saddle points. In Advances in Neural Information Processing Systems, pages 1067–1077, 2017a.
|
| 372 |
+
Simon S Du, Jason D Lee, and Yuandong Tian. When is a convolutional filter easy to learn? arXiv preprint arXiv:1709.06129, 2017b.
|
| 373 |
+
Simon S Du, Wei Hu, and Jason D Lee. Algorithmic regularization in learning deep homogeneous models: Layers are automatically balanced. arXiv preprint arXiv:1806.00900, 2018a.
|
| 374 |
+
Simon S Du, Jason D Lee, Yuandong Tian, Barnabas Poczos, and Aarti Singh. Gradient descent learns one-hidden-layer cnn: Don’t be afraid of spurious local minima. Proceedings of the 35th International Conference on Machine Learning, pages 1339–1348, 2018b.
|
| 375 |
+
C Daniel Freeman and Joan Bruna. Topology and geometry of half-rectified network optimization. arXiv preprint arXiv:1611.01540, 2016.
|
| 376 |
+
Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points − online stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, pages 797–842, 2015.
|
| 377 |
+
Rong Ge, Jason D Lee, and Tengyu Ma. Learning one-hidden-layer neural networks with landscape design. arXiv preprint arXiv:1711.00501, 2017.
|
| 378 |
+
Benjamin D Haeffele and Rene Vidal. Global optimality in tensor factorization, deep learning, and ´ beyond. arXiv preprint arXiv:1506.07540, 2015.
|
| 379 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016.
|
| 380 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and gen- ´ eralization in neural networks. arXiv preprint arXiv:1806.07572, 2018.
|
| 381 |
+
Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M. Kakade, and Michael I. Jordan. How to escape saddle points efficiently. In Proceedings of the 34th International Conference on Machine Learning, pages 1724–1732, 2017.
|
| 382 |
+
Kenji Kawaguchi. Deep learning without poor local minima. In Advances In Neural Information Processing Systems, pages 586–594, 2016.
|
| 383 |
+
Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. arXiv preprint arXiv:1808.01204, 2018.
|
| 384 |
+
Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with relu activation. In Advances in Neural Information Processing Systems, pages 597–607, 2017.
|
| 385 |
+
Song Mei, Andrea Montanari, and Phan-Minh Nguyen. A mean field view of the landscape of two-layers neural networks. Proceedings of the National Academy of Sciences.
|
| 386 |
+
Quynh Nguyen and Matthias Hein. The loss surface of deep and wide neural networks. In International Conference on Machine Learning, pages 2603–2612, 2017.
|
| 387 |
+
Quynh Nguyen and Matthias Hein. Optimization landscape and expressivity of deep cnns. In International Conference on Machine Learning, pages 3727–3736, 2018.
|
| 388 |
+
Itay Safran and Ohad Shamir. On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, pages 774–782, 2016.
|
| 389 |
+
Itay Safran and Ohad Shamir. Spurious local minima are common in two-layer ReLU neural networks. In International Conference on Machine Learning, pages 4433–4441, 2018.
|
| 390 |
+
Mahdi Soltanolkotabi. Learning ReLus via gradient descent. In Advances in Neural Information Processing Systems, pages 2007–2017, 2017.
|
| 391 |
+
Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. IEEE Transactions on Information Theory, 2018.
|
| 392 |
+
Daniel Soudry and Yair Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv preprint arXiv:1605.08361, 2016.
|
| 393 |
+
Yuandong Tian. An analytical formula of population gradient for two-layered ReLU network and its applications in convergence and critical point analysis. In International Conference on Machine Learning, pages 3404–3413, 2017.
|
| 394 |
+
Russell Tsuchida, Farbod Roosta-Khorasani, and Marcus Gallagher. Invariance of weight distributions in rectified mlps. arXiv preprint arXiv:1711.09090, 2017.
|
| 395 |
+
Luca Venturi, Afonso Bandeira, and Joan Bruna. Neural networks with finite intrinsic dimension have no spurious valleys. arXiv preprint arXiv:1802.06384, 2018.
|
| 396 |
+
Ashia C Wilson, Benjamin Recht, and Michael I Jordan. A Lyapunov analysis of momentum methods in optimization. arXiv preprint arXiv:1611.02635, 2016.
|
| 397 |
+
Bo Xie, Yingyu Liang, and Le Song. Diverse neural network learns true target functions. In Artificial Intelligence and Statistics, pages 1216–1224, 2017.
|
| 398 |
+
Chulhee Yun, Suvrit Sra, and Ali Jadbabaie. A critical view of global optimality in deep learning. arXiv preprint arXiv:1802.03487, 2018a.
|
| 399 |
+
Chulhee Yun, Suvrit Sra, and Ali Jadbabaie. Efficiently testing local optimality and escaping saddles for relu networks. arXiv preprint arXiv:1809.10858, 2018b.
|
| 400 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. NIN, 8:35–67.
|
| 401 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 402 |
+
Yi Zhou and Yingbin Liang. Critical points of neural networks: Analytical forms and landscape properties. arXiv preprint arXiv:1710.11205, 2017.
|
| 403 |
+
|
| 404 |
+
# A TECHNICAL PROOFS FOR SECTION 3
|
| 405 |
+
|
| 406 |
+
Proof of Theorem 3.1. The proof of this lemma just relies on standard real and functional analysis. Let $\mathcal { H }$ be the Hilbert space of integrable $d$ -dimensional vector fields on $\mathbb { R } ^ { d }$ : $\textbf { \textit { f } } \in$ $\mathcal { H }$ if ${ \mathbb E } _ { { \mathbf w } \sim N ( { \mathbf 0 } , { \mathbf I } ) } \left[ \big | f ( { \mathbf w } ) \big | ^ { 2 } \right] ~ < ~ \infty$ . The inner product of this space is then $\begin{array} { r l } { \langle f , g \rangle _ { \mathcal { H } } } & { { } = } \end{array}$ $\mathbb { E } _ { \mathbf { w } \sim N ( \mathbf { 0 } , \mathbf { I } ) } \left[ f ( \mathbf { w } ) ^ { \top } g ( \mathbf { w } ) \right]$ .
|
| 407 |
+
|
| 408 |
+
ReLU activation induces an infinite-dimensional feature map $\phi$ which is defined as for any $\mathbf { x } \in \mathbb { R } ^ { d }$ , $( \phi ( \mathbf { x } ) ) ( \mathbf { w } ) = \mathbf { x } \mathbb { I } \left\{ \mathbf { w } ^ { \top } \mathbf { x } \geq 0 \right\}$ where w can be viewed as the index. Now to prove $\mathbf { H } ^ { \infty }$ is strictly positive definite, it is equivalent to show $\phi ( \mathbf { x } _ { 1 } ) , \ldots , \phi ( \mathbf { x } _ { n } ) \in \mathcal { H }$ are linearly independent. Suppose that there are $\alpha _ { 1 } , \cdots , \alpha _ { n } \in \mathbb { R }$ such that
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\alpha _ { 1 } \phi ( \mathbf { x } _ { i } ) + \cdot \cdot \cdot + \alpha _ { n } \phi ( \mathbf { x } _ { n } ) = 0 \mathrm { i n } \mathcal { H } .
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
This means that
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\alpha _ { 1 } \phi ( \mathbf { x } _ { 1 } ) ( \mathbf { w } ) + \cdot \cdot \cdot + \alpha _ { n } \phi ( \mathbf { x } _ { n } ) ( \mathbf { w } ) = 0 \mathrm { a . e . }
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
Now we prove $\alpha _ { i } = 0$ for all $i$ .
|
| 421 |
+
|
| 422 |
+
We define $D _ { i } = \left\{ \mathbf { w } \in \mathbb { R } ^ { d } : \mathbf { w } ^ { \top } \mathbf { x } _ { i } = 0 \right\}$ . This is set of discontinuities of $\phi ( \mathbf { x } _ { i } )$ . The following lemma characterizes the basic property of these discontinuity sets.
|
| 423 |
+
|
| 424 |
+
Lemma A.1. If for any $i \neq j , \mathbf { x } _ { i } \parallel \neq \pmb { \mathrm { x } } _ { j }$ , then for any $i \in [ m ] , D _ { i } \notin \bigcup _ { j \neq i } D _ { j } .$ .
|
| 425 |
+
|
| 426 |
+
Now for a fixed $i \in [ n ]$ , since $D _ { i } \not \subset \bigcup _ { j \neq i } D _ { j }$ , we can choose $\mathbf { z } \in D _ { i } \setminus \bigcup _ { j \neq i } D _ { j }$ . Note $D _ { j } , j \neq i$ are closed sets. We can pick $r _ { 0 } > 0$ small enough such that $B ( \mathbf { z } , r ) \cap D _ { j } = \emptyset , \forall j \neq i , r \leq r _ { 0 }$ . Let $B ( { \bf z } , r ) = B _ { r } ^ { + } \sqcup B _ { r } ^ { - }$ where
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
B _ { r } ^ { + } = B ( \mathbf { z } , r ) \cap \{ \mathbf { w } \in \mathbb { R } ^ { d } : \mathbf { w } ^ { \top } \mathbf { x } _ { i } > 0 \} .
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
For $j \neq i$ , $\phi ( \mathbf { x } _ { j } ) ( \mathbf { w } )$ is continuous in a neighborhood of $\mathbf { z }$ , then for any $\epsilon > 0$ there is a small enough $r > 0$ such that
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\forall \mathbf { w } \in B ( \mathbf { z } , r ) , | \phi ( \mathbf { x } _ { j } ) ( \mathbf { w } ) - \phi ( \mathbf { x } _ { j } ) ( \mathbf { z } ) | < \epsilon .
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
Let $\mu$ be the Lebesgue measure on $\mathbb { R } ^ { d }$ . We have
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\left| \frac { 1 } { \mu ( B _ { r } ^ { + } ) } \int _ { B _ { r } ^ { + } } \phi ( \mathbf { x } _ { j } ) ( \mathbf { w } ) d \mathbf { w } - \phi ( \mathbf { x } _ { j } ) ( \mathbf { z } ) \right| \leq \frac { 1 } { \mu ( B _ { r } ^ { + } ) } \int _ { B _ { r } ^ { + } } | \phi ( \mathbf { x } _ { j } ) ( \mathbf { w } ) - \phi ( \mathbf { x } _ { j } ) ( \mathbf { z } ) | d \mathbf { w } < \epsilon
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
and similarly
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
\left| \frac { 1 } { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } \phi ( \mathbf { x } _ { j } ) ( \mathbf { w } ) d \mathbf { w } - \phi ( \mathbf { x } _ { j } ) ( \mathbf { z } ) \right| \leq \frac { 1 } { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } | \phi ( \mathbf { x } _ { j } ) ( \mathbf { w } ) - \phi ( \mathbf { x } _ { j } ) ( \mathbf { z } ) | d \mathbf { w } < \epsilon .
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
Thus, we have
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\operatorname* { l i m } _ { r \to 0 + } { \frac { 1 } { \mu ( B _ { r } ^ { + } ) } } \int _ { B _ { r } ^ { + } } \phi ( { \mathbf { x } } _ { j } ) ( { \mathbf { w } } ) d { \mathbf { w } } = \operatorname* { l i m } _ { r \to 0 + } { \frac { 1 } { \mu ( B _ { r } ^ { - } ) } } \int _ { B _ { r } ^ { - } } \phi ( { \mathbf { x } } _ { j } ) ( { \mathbf { w } } ) d { \mathbf { w } } = \phi ( { \mathbf { x } } _ { j } ) ( { \mathbf { z } } ) .
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
Therefore, as $r 0 +$ , by continuity, we have
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\forall j \neq i , \frac { 1 } { \mu ( B _ { r } ^ { + } ) } \int _ { B _ { r } ^ { + } } \phi ( { \bf x } _ { j } ) ( { \bf w } ) d { \bf w } - \frac { 1 } { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } \phi ( { \bf x } _ { j } ) ( { \bf w } ) d { \bf w } 0
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
Next recall that $( \phi ( \mathbf { x } ) ) ( \mathbf { w } ) = \mathbf { x } \mathbb { I } \left\{ \mathbf { x } ^ { \top } \mathbf { w } > 0 \right\}$ , so for $\mathbf { w } \in B _ { r } ^ { + }$ and $\mathbf { x } _ { i }$ , $( \phi ( \mathbf { x } _ { i } ) ) ( \mathbf { w } ) = \mathbf { x } _ { i }$ . Then, we have
|
| 463 |
+
|
| 464 |
+
$$
|
| 465 |
+
\operatorname* { l i m } _ { r \to 0 + } { \frac { 1 } { \mu ( B _ { r } ^ { + } ) } } \int _ { B _ { r } ^ { + } } \phi ( \mathbf { x } _ { j } ) ( \mathbf { w } ) d \mathbf { w } = \operatorname* { l i m } _ { r \to 0 + } { \frac { 1 } { \mu ( B _ { r } ^ { + } ) } } \int _ { B _ { r } ^ { + } } \mathbf { x } _ { i } d \mathbf { w } = \mathbf { x } _ { i } .
|
| 466 |
+
$$
|
| 467 |
+
|
| 468 |
+
For ${ \bf w } \in B _ { r } ^ { - }$ and $\mathbf { x } _ { i }$ , we know $( \phi ( \mathbf { x } _ { i } ) ) ( \mathbf { w } ) = 0$ . Then we have
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
\operatorname* { l i m } _ { r \to 0 + } \frac { 1 } { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } \phi ( \mathbf { x } _ { i } ) ( \mathbf { w } ) d \mathbf { w } = \operatorname* { l i m } _ { r \to 0 + } \frac { 1 } { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } 0 d \mathbf { w } = 0
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
Now recall $\begin{array} { r } { \sum _ { i } \alpha _ { i } \phi ( \mathbf { x } _ { i } ) \equiv 0 } \end{array}$ . Using Equation (9), (10) and (11), we have
|
| 475 |
+
|
| 476 |
+
$$
|
| 477 |
+
\begin{array} { l } { { \displaystyle 0 = \operatorname* { l i m } _ { r \to 0 + } \frac 1 { \mu ( B _ { r } ^ { + } ) } \int _ { B _ { r } ^ { + } } \sum _ { j } \alpha _ { j } \phi ( { \bf x } _ { j } ) ( { \bf w } ) d { \bf w } - \operatorname* { l i m } _ { r \to 0 + } \frac 1 { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } \sum _ { j } \alpha _ { j } \phi ( { \bf x } _ { j } ) ( { \bf w } ) d { \bf w } } } \\ { { \displaystyle = \sum _ { j } \alpha _ { j } \left( \operatorname* { l i m } _ { r \to 0 + } \frac 1 { \mu ( B _ { r } ^ { + } ) } \int _ { B _ { r } ^ { + } } \phi ( { \bf x } _ { j } ) ( { \bf w } ) d { \bf w } - \operatorname* { l i m } _ { r \to 0 + } \frac 1 { \mu ( B _ { r } ^ { - } ) } \int _ { B _ { r } ^ { - } } \phi ( { \bf x } _ { j } ) ( { \bf w } ) d { \bf w } \right) } } \\ { { \displaystyle = \sum _ { j } \alpha _ { j } \left( \delta _ { i j } { \bf x } _ { i } \right) } } \\ { \displaystyle - \dots , \} } \end{array}
|
| 478 |
+
$$
|
| 479 |
+
|
| 480 |
+
Since $\mathbf { x } _ { i } \neq 0$ , we must have $\alpha _ { i } = 0$ . We complete the proof.
|
| 481 |
+
|
| 482 |
+
Proof of Lemma A.1. Let $\mu$ be the canonical Lebesgue measure on $D _ { i }$ . We have $\begin{array} { r } { \sum _ { j \neq i } \mu ( D _ { i } \cap D _ { j } ) = } \end{array}$ 0 because $D _ { i } \cap D _ { j }$ is a hyperplane in $D _ { i }$ . Now we bound
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\mu ( D _ { i } \cap \bigcup _ { j \neq i } D _ { j } ) \leq \sum _ { j \neq i } \mu ( D _ { i } \cap D _ { j } ) = 0 .
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
This implies our desired result.
|
| 489 |
+
|
| 490 |
+
Proof of Lemma 3.1. For every fixed $( i , j )$ pair, ${ \bf { H } } _ { i j } ( 0 )$ is an average of independent random variables. Therefore, by Hoeffding inequality, we have with probability $1 - \delta ^ { \prime }$ ,
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\big | \mathbf { H } _ { i j } ( 0 ) - \mathbf { H } _ { i j } ^ { \infty } \big | \leq \frac { 2 \sqrt { \log ( 1 / \delta ^ { \prime } ) } } { \sqrt { m } } .
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
Setting $\delta ^ { \prime } \mathit { \Pi } = \mathit { n } ^ { 2 } \delta$ and applying union bound over $( i , j )$ pairs, we have for every $( i , j )$ pair with probability at least $1 - \delta$
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
\big | \mathbf { H } _ { i j } ( 0 ) - \mathbf { H } _ { i j } ^ { \infty } \big | \leq \frac { 4 \sqrt { \log ( n / \delta ) } } { \sqrt { m } } .
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
Thus we have
|
| 503 |
+
|
| 504 |
+
$$
|
| 505 |
+
\| \mathbf { H } ( 0 ) - \mathbf { H } ^ { \infty } \| _ { 2 } ^ { 2 } \leq \| \mathbf { H } ( 0 ) - \mathbf { H } ^ { \infty } \| _ { F } ^ { 2 } \leq \sum _ { i , j } \left| \mathbf { H } _ { i j } ( 0 ) - \mathbf { H } _ { i j } ^ { \infty } \right| ^ { 2 } \leq \frac { 1 6 n ^ { 2 } \log ( n / \delta ) } { m } .
|
| 506 |
+
$$
|
| 507 |
+
|
| 508 |
+
Thus if $\begin{array} { r } { m = \Omega \left( \frac { n ^ { 2 } \log ( n / \delta ) } { \lambda _ { 0 } ^ { 2 } } \right) } \end{array}$ we have the desired result.
|
| 509 |
+
|
| 510 |
+
Proof of Lemma 3.4. Suppose the conclusion does not hold at time $t$ . If there exists $r \in [ m ]$ , $\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| \geq R ^ { \prime }$ or $\left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } > \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 }$ , then by Lemma 3.3 we know there exists $s \leq t$ such that $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( s ) ) < \frac { 1 } { 2 } \lambda _ { 0 } } \end{array}$ . By Lemma 3.2 we know there exists
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
t _ { 0 } = \operatorname* { i n f } \left\{ t > 0 : \operatorname* { m a x } _ { r \in [ m ] } \| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } ^ { 2 } \geq R \right\} .
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
Thus at $t _ { 0 }$ , there exists $r \in [ m ] , \| \mathbf { w } _ { r } ( t _ { 0 } ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } ^ { 2 } = R$ . Now by Lemma 3.2, we know $\mathbf { H } ( t _ { 0 } ) \geq$ $\scriptstyle { \frac { 1 } { 2 } } \lambda _ { 0 }$ for $t ^ { \prime } \leq t _ { 0 }$ . However, by Lemma 3.3, we know $\| \mathbf { w } _ { r } ( t _ { 0 } ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } < R ^ { \prime } < R$ . Contradiction.
|
| 517 |
+
|
| 518 |
+
For the other case, at time $t$ , $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( t ) ) < \frac { 1 } { 2 } \lambda _ { 0 } } \end{array}$ we know there exists
|
| 519 |
+
|
| 520 |
+
$$
|
| 521 |
+
t _ { 0 } = \operatorname* { i n f } \left\{ t \geq 0 : \operatorname* { m a x } _ { r \in [ m ] } \| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } ^ { 2 } \geq R \right\} .
|
| 522 |
+
$$
|
| 523 |
+
|
| 524 |
+
The rest of the proof is the same as the previous case.
|
| 525 |
+
|
| 526 |
+
# A.1 PROOF OF THEOREM 3.3
|
| 527 |
+
|
| 528 |
+
In this section we show using gradient flow to jointly train both the first layer and the output layer we can still achieve 0 training loss. We follow the same approach we used in Section 3. Recall the gradient for a.
|
| 529 |
+
|
| 530 |
+
$$
|
| 531 |
+
\frac { \partial L ( \mathbf { w } , \mathbf { a } ) } { \partial \mathbf { a } } = \frac { 1 } { \sqrt { m } } \sum _ { i = 1 } ^ { n } \left( f \left( \mathbf { w } , \mathbf { a } , \mathbf { x } _ { i } \right) - y _ { i } \right) \binom { \sigma \left( \mathbf { w } _ { 1 } ^ { \top } \mathbf { x } _ { i } \right) } { \sigma \left( \mathbf { w } _ { m } ^ { \top } \mathbf { x } _ { i } \right) } .
|
| 532 |
+
$$
|
| 533 |
+
|
| 534 |
+
We compute the dynamics of an individual prediction.
|
| 535 |
+
|
| 536 |
+
$$
|
| 537 |
+
\frac { d u _ { i } ( t ) } { d t } = \sum _ { r = 1 } ^ { m } \langle \frac { \partial u _ { i } ( t ) } { \partial \mathbf { w } _ { r } ( t ) } , \frac { \partial \mathbf { w } _ { r } ( t ) } { \partial t } \rangle + \sum _ { r = 1 } ^ { m } \frac { d u _ { i } ( t ) } { d a _ { r } ( t ) } \cdot \frac { d a _ { r } ( t ) } { d t } .
|
| 538 |
+
$$
|
| 539 |
+
|
| 540 |
+
Recall we have found a convenient expression for the first term.
|
| 541 |
+
|
| 542 |
+
$$
|
| 543 |
+
\sum _ { r = 1 } ^ { m } \langle \frac { \partial u _ { i } ( t ) } { \partial \mathbf { w } _ { r } ( t ) } , \frac { \partial \mathbf { w } _ { r } ( t ) } { \partial t } \rangle = \sum _ { j = 1 } ^ { n } \left( y _ { j } - u _ { j } ( t ) \right) \mathbf { H } _ { i j } ( t )
|
| 544 |
+
$$
|
| 545 |
+
|
| 546 |
+
where
|
| 547 |
+
|
| 548 |
+
$$
|
| 549 |
+
\mathbf { H } _ { i j } ( t ) = \frac { 1 } { m } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \sum _ { r = 1 } ^ { m } a _ { r } ^ { 2 } ( t ) \mathbb { I } \left\{ \mathbf { x } _ { i } ^ { \top } \mathbf { w } _ { r } ( t ) \geq 0 , \mathbf { x } _ { j } ^ { \top } \mathbf { w } _ { r } ( t ) \geq 0 \right\} .
|
| 550 |
+
$$
|
| 551 |
+
|
| 552 |
+
For the second term, it easy to derive
|
| 553 |
+
|
| 554 |
+
$$
|
| 555 |
+
\sum _ { r = 1 } ^ { m } { \frac { d u _ { i } ( t ) } { d { \bf a } _ { r } } } \cdot { \frac { d { \bf a } _ { r } ( t ) } { d t } } = \sum _ { r = 1 } ^ { m } \left( y _ { j } - u _ { j } ( t ) \right) { \bf G } _ { i j } ( t )
|
| 556 |
+
$$
|
| 557 |
+
|
| 558 |
+
where
|
| 559 |
+
|
| 560 |
+
$$
|
| 561 |
+
\mathbf { G } _ { i j } ( t ) = \frac { 1 } { m } \sigma \left( \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \right) \sigma \left( \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { j } \right) .
|
| 562 |
+
$$
|
| 563 |
+
|
| 564 |
+
Therefore we have
|
| 565 |
+
|
| 566 |
+
$$
|
| 567 |
+
\frac { d \mathbf { u } ( t ) } { d t } = \left( \mathbf { H } ( t ) + \mathbf { G } ( t ) \right) \left( \mathbf { y } - \mathbf { u } ( t ) \right) .
|
| 568 |
+
$$
|
| 569 |
+
|
| 570 |
+
First use the same concentration arguments as in Lemma 3.1, we can show $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( 0 ) ) ~ \geq ~ \frac { 3 \lambda _ { 0 } } { 4 } } \end{array}$ with $1 - \delta$ probability over the initialization. In the following, our arguments will base on that $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( 0 ) ) \geq \frac { 3 \lambda _ { 0 } } { 4 } } \end{array}$ .
|
| 571 |
+
|
| 572 |
+
The following lemma shows as long as $\mathbf { H } ( t )$ has lower bounded least eigenvalue, gradient flow enjoys a linear convergence rate. The proof is analogue to the first part of the proof of Lemma 3.3.
|
| 573 |
+
|
| 574 |
+
Lemma A.2. If for $ \operatorname { 0 } \quad \leq \quad s \quad \leq \quad t ,$ , $\begin{array} { r l r } { \lambda _ { \mathrm { m i n } } ( { \bf H } ( s ) ) } & { { } \ge } & { \frac { \lambda _ { 0 } } { 2 } } \end{array}$ , we have $\begin{array} { r l } { \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } } & { { } \leq } \end{array}$ $\exp ( - \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 }$ .
|
| 575 |
+
|
| 576 |
+
Proof of Lemma A.2. We can calculate the loss function dynamics
|
| 577 |
+
|
| 578 |
+
$$
|
| 579 |
+
\begin{array} { r l } { \displaystyle \frac { d } { d t } \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } = - 2 \left( \mathbf { y } - \mathbf { u } ( t ) \right) ^ { \top } \left( \mathbf { H } ( t ) + \mathbf { G } ( t ) \right) \left( \mathbf { y } - \mathbf { u } ( t ) \right) } & { } \\ { \leq - 2 \left( \mathbf { y } - \mathbf { u } ( t ) \right) ^ { \top } \left( \mathbf { H } ( t ) \right) \left( \mathbf { y } - \mathbf { u } ( t ) \right) } & { } \\ { \leq - \lambda _ { 0 } \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } } \end{array}
|
| 580 |
+
$$
|
| 581 |
+
|
| 582 |
+
where in the first inequality we use the fact that $\mathbf G ( t )$ is Gram matrix thus it is positive.8 Thus we have $\begin{array} { r } { \frac { d } { d t } \left( \exp ( \lambda _ { 0 } t ) \| \mathbf { y } - \mathbf { u } ( t ) \| _ { 2 } ^ { 2 } \right) \leq 0 } \end{array}$ and $\exp ( \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 }$ is a decreasing function with respect to $t$ . Using this fact we can bound the loss
|
| 583 |
+
|
| 584 |
+
$$
|
| 585 |
+
\left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } \leq \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 } .
|
| 586 |
+
$$
|
| 587 |
+
|
| 588 |
+
We continue to follow the analysis in Section 3. For convenience, we define
|
| 589 |
+
|
| 590 |
+
$$
|
| 591 |
+
R _ { w } = \frac { \sqrt { 2 \pi } \lambda _ { 0 } \delta } { 3 2 n ^ { 2 } } , R _ { a } = \frac { \lambda _ { 0 } } { 1 6 n ^ { 2 } } , R _ { w } ^ { \prime } = \frac { 4 \sqrt { n } \left\| \mathbf { y } - \mathbf { u } _ { 0 } \right\| _ { 2 } } { \sqrt { m } \lambda _ { 0 } } , R _ { a } ^ { \prime } = \frac { 8 \sqrt { n } \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } \sqrt { \log ( m n / \delta ) } } { \sqrt { m } \lambda _ { 0 } } .
|
| 592 |
+
$$
|
| 593 |
+
|
| 594 |
+
The first lemma characterizes how the perturbation in a and $\mathbf { W }$ affect the Gram matrix.
|
| 595 |
+
|
| 596 |
+
Lemma A.3. With probability at least $1 - \delta$ over initialization, if a set of weight vectors $\left\{ { \bf w } _ { r } \right\} _ { r = 1 } ^ { m }$ and the output weight a satisfy for all $r \in [ m ]$ , $\| \mathbf { w } _ { r } - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w }$ and $| a _ { r } - a _ { r } ( 0 ) | \leq \mathrm { \bar { \it R } } _ { a }$ , then the matrix $\mathbf { H } \in \mathbb { R } ^ { n \times n }$ defined by
|
| 597 |
+
|
| 598 |
+
$$
|
| 599 |
+
\mathbf { H } _ { i j } = \frac { 1 } { m } \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \sum _ { r = 1 } ^ { m } \mathbf { a } _ { r } ^ { 2 } \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { j } \geq 0 \right\}
|
| 600 |
+
$$
|
| 601 |
+
|
| 602 |
+
satisfies $\begin{array} { r } { \| \mathbf { H } - \mathbf { H } ( 0 ) \| _ { 2 } \le \frac { \lambda _ { 0 } } { 4 } } \end{array}$ and $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } \left( \mathbf { H } \right) > \frac { \lambda _ { 0 } } { 2 } } \end{array}$
|
| 603 |
+
|
| 604 |
+
Proof of Lemma A.3. Define a surrogate Gram matrix,
|
| 605 |
+
|
| 606 |
+
$$
|
| 607 |
+
\mathbf { H } ^ { \prime } = \frac { 1 } { m } \sum _ { r = 1 } ^ { m } \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { j } \geq 0 \right\} .
|
| 608 |
+
$$
|
| 609 |
+
|
| 610 |
+
Using the same analysis for Lemma 3.3, we know $\begin{array} { r } { \| \mathbf { H } ^ { \prime } - \mathbf { H } ( 0 ) \| _ { 2 } \le \frac { 4 n ^ { 2 } R _ { w } } { \sqrt { 2 \pi } \delta } } \end{array}$ 4n2√ Rw . Now we bound H−H0. For fixed $( i , j ) \in [ n ] \times [ n ]$ , we have
|
| 611 |
+
|
| 612 |
+
$$
|
| 613 |
+
\mathbf { H } _ { i j } - \mathbf { H } _ { i j } ^ { \prime } = \left| \mathbf { x } _ { i } ^ { \top } \mathbf { x } _ { j } \frac { 1 } { m } \sum _ { r = 1 } ^ { m } ( \mathbf { a } _ { r } ^ { 2 } - 1 ) \mathbb { I } \left\{ \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { i } \geq 0 , \mathbf { w } _ { r } ^ { \top } \mathbf { x } _ { j } \geq 0 \right\} \right| \leq \operatorname* { m a x } _ { r \in [ m ] } \left| \mathbf { a } _ { r } ^ { 2 } - 1 \right| \leq 2 R _ { a } .
|
| 614 |
+
$$
|
| 615 |
+
|
| 616 |
+
Therefore, we have $\begin{array} { r } { \| \mathbf { H } - \mathbf { H } ^ { \prime } \| _ { 2 } \leq \sum _ { ( i , j ) \in [ n ] \times [ n ] } \left| \mathbf { H } _ { i j } - \mathbf { H } _ { i j } ^ { \prime } \right| \leq 2 n ^ { 2 } R _ { a } } \end{array}$ . Combing these two inequalities we have $\begin{array} { r } { \| \mathbf { H } - \mathbf { H } ( 0 ) \| _ { 2 } \le \frac { 4 n ^ { 2 } R _ { w } } { \sqrt { 2 \pi } \delta } + 2 n ^ { 2 } R _ { a } \le \frac { \lambda _ { 0 } } { 4 } } \end{array}$ . □
|
| 617 |
+
|
| 618 |
+
Lemma A.4. Suppose for 0 ≤ s ≤ t, $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } \left( \mathbf { H } ( s ) \right) \geq \frac { \lambda _ { 0 } } { 2 } } \end{array}$ and $| \mathbf { a } _ { r } ( s ) - \mathbf { a } _ { r } ( 0 ) | \leq R _ { a }$ . Then we have $\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w } ^ { \prime }$ .
|
| 619 |
+
|
| 620 |
+
Proof of Lemma A.4. We bound the gradient. Recall for $0 \leq s \leq t$ ,
|
| 621 |
+
|
| 622 |
+
$$
|
| 623 |
+
\begin{array} { r l r } { { \| \frac { d } { d t } \mathbf { w } _ { r } ( s ) \| _ { 2 } = \| \sum _ { i = 1 } ^ { n } ( y _ { i } - u _ { i } ) \frac { 1 } { \sqrt { m } } a _ { r } ( t ) \mathbf { x } _ { i } \mathbb { I } \{ \mathbf { w } _ { r } ( t ) ^ { \top } \mathbf { x } _ { i } \geq 0 \} \| _ { 2 } } } \\ & { } & { \leq \frac { 1 } { \sqrt { m } } \sum _ { i = 1 } ^ { n } | y _ { i } - u _ { i } ( s ) | | a _ { r } ( 0 ) + R _ { a } | } \\ & { } & { \leq \frac { 2 \sqrt { n } } { \sqrt { m } } \| \mathbf { y } - \mathbf { u } ( s ) \| _ { 2 } \leq \frac { 2 \sqrt { n } } { \sqrt { m } } \exp ( - \lambda _ { 0 } s / 2 ) \| \mathbf { y } - \mathbf { u } ( 0 ) \| _ { 2 } . } \end{array}
|
| 624 |
+
$$
|
| 625 |
+
|
| 626 |
+
Integrating the gradient and using Lemma A.2, we can bound the distance from the initialization
|
| 627 |
+
|
| 628 |
+
$$
|
| 629 |
+
\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq \int _ { 0 } ^ { t } \left\| \frac { d } { d s } \mathbf { w } _ { r } ( s ) \right\| _ { 2 } d s \leq \frac { 4 \sqrt { n } \| \mathbf { y } - \mathbf { u } ( 0 ) \| _ { 2 } } { \sqrt { m } \lambda _ { 0 } } .
|
| 630 |
+
$$
|
| 631 |
+
|
| 632 |
+
Lemma A.5. With probability at least $1 - \delta$ over initialization, the following holds. Suppose for $0 \leq s \leq t _ { \cdot }$ , $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } \left( \mathbf { H } ( s ) \right) \geq \frac { \lambda _ { 0 } } { 2 } } \end{array}$ and $\| \mathbf { w } _ { r } ( s ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w }$ . Then we have $| a ( t ) - a _ { r } ( 0 ) | \leq R _ { a } ^ { \prime }$ for all $r \in [ m ]$ .
|
| 633 |
+
|
| 634 |
+
Proof of Lemma A.5. Note for any $i \in [ n ]$ and $r \in [ m ]$ , $\mathbf { w } _ { r } ( 0 ) ^ { \top } \mathbf { x } _ { i } \sim N ( 0 , 1 )$ . Therefore applying Gaussian tail bound and union bound we have with probability at least $1 - \delta$ , for all $i \in [ n ]$ and
|
| 635 |
+
|
| 636 |
+
$\begin{array} { r } { r \in [ m ] , \left| \mathbf { w } _ { r } ( 0 ) ^ { \top } \mathbf { x } _ { i } \right| \leq 3 \sqrt { \log \left( \frac { m n } { \delta } \right) } . } \end{array}$ . Now we bound the gradient. Recall for $0 \leq s \leq t$ ,
|
| 637 |
+
|
| 638 |
+
$$
|
| 639 |
+
\begin{array} { r l } { \displaystyle \frac { d } { d s } a _ { r } ( s ) \bigg | = \left| \frac { 1 } { \sqrt { m } } \sum _ { i = 1 } ^ { n } \left( f \left( \mathbf { w } ( s ) , \mathbf { a } ( s ) , \mathbf { x } _ { i } \right) - y _ { i } \right) \left( \sigma \left( \mathbf { w } _ { r } ( s ) ^ { \top } \mathbf { x } _ { i } \right) \right) \right| } & { { } } \\ { \displaystyle \leq \frac { 1 } { \sqrt { m } } \sqrt { n } \left\| \mathbf { y } - \mathbf { u } ( s ) \right\| _ { 2 } \left( \left| \mathbf { w } _ { r } ( s ) ^ { \top } \mathbf { x } _ { i } \right| + R _ { w } \right) } & { { } } \\ { \displaystyle } & { { } \displaystyle \leq \frac { 1 } { \sqrt { m } } \sqrt { n } \left\| \mathbf { y } - \mathbf { u } ( s ) \right\| _ { 2 } \left( 3 \sqrt { \log \left( \frac { m n } { \delta } \right) } + R _ { w } \right) \leq \frac { 4 \sqrt { n } \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| \exp \left( - \lambda _ { 0 } s / 2 \right) \sqrt { \log \left( \frac { m n } { \delta } \right) } } { \sqrt { m } } \left| \mathbf { x } _ { i } ( 0 ) \right| } & { { } } \end{array}
|
| 640 |
+
$$
|
| 641 |
+
|
| 642 |
+
Integrating the gradient, we can bound the distance from the initialization
|
| 643 |
+
|
| 644 |
+
$$
|
| 645 |
+
\| \mathbf { a } _ { r } ( t ) - \mathbf { a } _ { r } ( 0 ) \| _ { 2 } \leq \int _ { 0 } ^ { t } \left\| { \frac { d } { d s } } \mathbf { w } _ { r } ( s ) \right\| _ { 2 } d s \leq { \frac { 8 { \sqrt { n } } \| \mathbf { y } - \mathbf { u } ( 0 ) \| _ { 2 } { \sqrt { \log ( m n / \delta ) } } } { { \sqrt { m } } \lambda _ { 0 } } } .
|
| 646 |
+
$$
|
| 647 |
+
|
| 648 |
+
Lemma A.6. If $R _ { w } ^ { \prime } < R _ { w }$ and $R _ { a } ^ { \prime } < R _ { a }$ , we have for all $t \geq 0$ , $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( t ) ) \geq \frac { 1 } { 2 } \lambda _ { 0 } , } \end{array}$ , for all $r \in [ m ]$ , $\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w } ^ { \prime }$ , $| a _ { r } ( t ) - a _ { r } ( 0 ) | \leq R _ { a } ^ { \prime }$ and $\left\| \mathbf { y } - \mathbf { u } ( t ) \right\| _ { 2 } ^ { 2 } \leq \exp ( - \lambda _ { 0 } t ) \left\| \mathbf { y } - \mathbf { u } ( 0 ) \right\| _ { 2 } ^ { 2 }$ .
|
| 649 |
+
|
| 650 |
+
Proof of Lemma A.6. We prove by contradiction. Let $t > 0$ be the smallest time that the conclusion does not hold. Then either $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { H } ( t ) ) < \frac { \lambda _ { 0 } } { 2 } } \end{array}$ or there exists $r \in [ m ]$ , $\| \mathbf { w } _ { r } ( t ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w } ^ { \prime }$ or there exists $r \in [ m ]$ , $| a _ { r } - a _ { r } ( 0 ) | \ \leq \ R _ { a } ^ { \prime }$ . If $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( { \bf H } ( t ) ) \ < \ \frac { \lambda _ { 0 } } { 2 } } \end{array}$ , by Lemma A.3, we know there exists $s < t$ such that either there exists $r \in [ m ]$ , $\| \mathbf { w } _ { r } ( s ) - \tilde { \mathbf { w } } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w }$ or there exists $r \in [ m ]$ , $| a _ { r } ( s ) - a _ { r } ( 0 ) | \leq R _ { a }$ . However, since $R _ { w } ^ { \prime } < R _ { w }$ and $R _ { a } ^ { \prime } < R _ { a }$ . This contradicts with the minimality of $t$ . If there exists $r \in [ m ] , \| \mathbf { w } _ { r } - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \leq R _ { w } ^ { \prime }$ , then by Lemma A.4, we know $s < t$ t . $r \in [ m ]$ , n $| a _ { r } ( s ) - a _ { r } ( 0 ) | \leq R _ { a }$ or mal $\begin{array} { r } { \lambda _ { \mathrm { m i n } } ( \mathbf { H } ( s ) ) < \frac { \lambda _ { 0 } } { 2 } } \end{array}$ . However, sincease is similar for $R _ { w } ^ { \prime } < R _ { w }$ $R _ { a } ^ { \prime } < R _ { a }$ $t$ which we can simply apply Lemma A.5. □
|
| 651 |
+
|
| 652 |
+
Based on Lemma A.2, we only need to ensure $R _ { w } ^ { \prime } < R _ { w }$ and $R _ { a } < R _ { a } ^ { \prime }$ . By the proof in Section 3, we know with probability at least $\delta$ , $\begin{array} { r } { \| \mathbf { y } - \mathbf { u } ( 0 ) \| _ { 2 } \le \frac { C \sqrt { n } } { \delta } } \end{array}$ for some large constant $C$ . Note our section on $m$ in Theorem 3.3 suffices to ensure $\bar { R } _ { w } ^ { \prime } < \breve { R } _ { w }$ and $R _ { a } < R _ { a } ^ { \prime }$ . We now complete the proof.
|
| 653 |
+
|
| 654 |
+
# B TECHNICAL PROOFS FOR SECTION 4
|
| 655 |
+
|
| 656 |
+
Proof of Corollary 4.1. We use the norm of gradient to bound this distance.
|
| 657 |
+
|
| 658 |
+
$$
|
| 659 |
+
\begin{array} { r l } { \| \mathbf { w } _ { r } ( k + 1 ) - \mathbf { w } _ { r } ( 0 ) \| _ { 2 } \le \eta \displaystyle \sum _ { k \ge 0 } ^ { k } \left\| \frac { \partial L ( \mathbf { W } ( k ^ { \prime } ) ) } { \partial \mathbf { w } _ { r } ( k ^ { \prime } ) } \right\| _ { 2 } } & { } \\ & { \le \eta \displaystyle \sum _ { k ^ { \prime } = 0 } ^ { k } \frac { \sqrt { n } } { \sqrt { m } } \| y - \mathbf { u } ( k ^ { \prime } ) \| _ { 2 } } \\ & { \le \eta \displaystyle \sum _ { k ^ { \prime } = 0 } ^ { k } \frac { \sqrt { n } \big ( 1 - \frac { n \lambda } { 2 } \big ) ^ { k ^ { \prime } / 2 } } { \sqrt { m } } \| y - \mathbf { u } ( k ^ { \prime } ) \| _ { 2 } } \\ & { \le \eta \displaystyle \sum _ { k ^ { \prime } = 0 } ^ { k } \frac { \sqrt { n } \big ( 1 - \frac { n \lambda } { 2 } \big ) ^ { k ^ { \prime } / 2 } } { \sqrt { m } } \| y - \mathbf { u } ( k ^ { \prime } ) \| _ { 2 } } \\ & { \le \eta \displaystyle \sum _ { k ^ { \prime } = 0 } ^ { \infty } \frac { \sqrt { n } \big ( 1 - \frac { n \lambda } { 2 } \big ) ^ { k ^ { \prime } / 2 } } { \sqrt { m } } \| y - \mathbf { u } ( k ^ { \prime } ) \| _ { 2 } } \\ & { = \frac { 4 \sqrt { n } } { \sqrt { m } \lambda _ { 0 } } \mathbf { u } ( 0 ) \| _ { 2 } . } \end{array}
|
| 660 |
+
$$
|
| 661 |
+
|
| 662 |
+
a 4.1. For a fixed . Thus we can bou $i \in [ n ]$ and ize o $r \in [ m ]$ , by anti-concentration inequality, we knowxpectation. $\begin{array} { r } { \mathbb { P } ( A _ { i r } ) \le \frac { 2 R } { \sqrt { 2 \pi } } } \end{array}$ $S _ { i } ^ { \perp }$
|
| 663 |
+
|
| 664 |
+
$$
|
| 665 |
+
\mathbb { E } \left[ \left| S _ { i } ^ { \perp } \right| \right] = \sum _ { r = 1 } ^ { m } \mathbb { P } ( A _ { i r } ) \leq \frac { 2 m R } { \sqrt { 2 \pi } } .
|
| 666 |
+
$$
|
| 667 |
+
|
| 668 |
+
Summing over $i = 1 , \ldots , n$ , we have
|
| 669 |
+
|
| 670 |
+
$$
|
| 671 |
+
\mathbb { E } \left[ \sum _ { i = 1 } ^ { n } \left. S _ { i } ^ { \perp } \right. \right] \leq \frac { 2 m n R } { \sqrt { 2 \pi } } .
|
| 672 |
+
$$
|
| 673 |
+
|
| 674 |
+
Thus by Markov’s inequality, we have with probability at least $1 - \delta$
|
| 675 |
+
|
| 676 |
+
$$
|
| 677 |
+
\sum _ { i = 1 } ^ { n } \left. S _ { i } ^ { \perp } \right. \leq \frac { C m n R } { \delta } .
|
| 678 |
+
$$
|
| 679 |
+
|
| 680 |
+
for some large positive constant $C > 0$ .
|
md/train/S1lF8xHYwS/S1lF8xHYwS.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNSUPERVISED DOMAIN ADAPTATION THROUGH SELF-SUPERVISION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper addresses unsupervised domain adaptation, the setting where labeled training data is available on a source domain, but the goal is to have good performance on a target domain with only unlabeled data. Like much of previous work, we seek to align the learned representations of the source and target domains while preserving discriminability. The way we accomplish alignment is by learning to perform auxiliary self-supervised task(s) on both domains simultaneously. Each self-supervised task brings the two domains closer together along the direction relevant to that task. Training this jointly with the main task classifier on the source domain is shown to successfully generalize to the unlabeled target domain. The presented objective is straightforward to implement and easy to optimize. We achieve state-of-the-art results on four out of seven standard benchmarks, and competitive results on segmentation adaptation. We also demonstrate that our method composes well with another popular pixel-level adaptation method.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Visual distribution shifts are fundamental to our constantly evolving world. We humans face them all the time, e.g. when we navigate a foreign city, read text in a new font, or recognize objects in an environment we have never encountered before. These real-world challenges to the human visual perception have direct parallels in computer vision. Formally, a distribution shift happens when a model is trained on data from one distribution (source), but the goal is to make good predictions on some other distribution (target) that shares the label space with the source. Often computational models struggle even for pairs of distributions that humans find intuitively similar.
|
| 12 |
+
|
| 13 |
+
Our paper studies the setting of unsupervised domain adaptation, with labeled data in the source domain, but only unlabeled data in the target domain. The general philosophy of the field is to induce alignment of the source and target domains through some transformation. In the context of deep learning, a convolutional neural network maps images to learned representations in some feature space, so inducing alignment is done by making the distribution shifts small between the source and target in this shared feature space (Csurka, 2017; Wang & Deng, 2018; Gopalan et al., 2011). If, in addition, such representations preserve discriminability on the source domain, then we can learn a good classifier on the source, which now generalizes to the target under the reasonable assumption that the representations of the two domains have the same ground truth.
|
| 14 |
+
|
| 15 |
+
Most existing approaches implement this philosophy of alignment by minimizing a measurement of distributional discrepancy in the feature space (details in section 2), often some form of maximum mean discrepancy (MMD) e.g. Long et al. (2017), or a learned discriminator of the source and target as an approximation to the total variation distance e.g. Ganin et al. (2016). Both measurements lead to the formulation of the training objective as a minimax optimization problem a.k.a. adversarial learning, which is known to be very difficult to solve. Unless carefully balanced, the push and pull in opposite directions can often cause wild fluctuations in the discrepancy loss and lead to sudden divergence (details in section 2). Therefore, we propose to avoid minimax optimization altogether through a very different approach.
|
| 16 |
+
|
| 17 |
+
Our main idea is to achieve alignment between the source and target domains by training a model on the same task in both domains simultaneously. Indeed, if we had labels in both domains, we could simply use our original classification task for this. However, since we lack labels in the target domain, we propose to use a self-supervised auxiliary task, which creates its own labels directly from the data (see section 3). In fact, we can use multiple self-supervised tasks, each one aligning the two domains along a direction of variation relevant to that task. Jointly training all the self-supervised tasks on both domains together with the original task on the source domain produces well-aligned representations as shown in Figure 1.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: We propose a method for unsupervised domain adaptation that uses self-supervision to align the learned representations of two domains in a shared feature space. Here we visualize how these representations might be aligned in the feature space. a) Without our method, the source domain is far away from the target domain, and a source classifier cannot generalize to the target. b) Training a shared representation to support one self-supervised task on both domains can align the source and target along one direction. c) Using multiple self-supervised tasks can further align the domains along multiple directions. Now the source and target are close in this shared feature space, and the source classifier can hope to generalize to the target.
|
| 21 |
+
|
| 22 |
+
Like all of deep learning, we can only empirically verify that at least in our experiments, the model does not overfit by internally creating a different decision boundary for each domain along different dimensions, which would then yield bad results. Recent research suggests that stochastic gradient descent is indeed unlikely to find such overfitting solutions with a costly decision boundary of high complexity (implicit regularization), even though the models have enough capacity (Zhang et al., 2016a; Neyshabur et al., 2017b; Arora et al., 2018).
|
| 23 |
+
|
| 24 |
+
The key contribution of our work is to draw a connection between unsupervised domain adaptation and self-supervised learning. While we do not propose any fundamentally new self-supervised tasks, we offer insights in section 3 on how to select the right ones for adaptation, and propose in section 4 a novel training algorithm on those tasks, using batches of samples from both domains. Additionally, we demonstrate that domain alignment could be achieved with a simple and stable algorithm, without the need for adversarial learning. In section 5, we report state-of-the-art results on several standard benchmarks.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
In this section we provide a brief overview of the two fields that our work would like to bridge.
|
| 29 |
+
|
| 30 |
+
# 2.1 UNSUPERVISED DOMAIN ADAPTATION
|
| 31 |
+
|
| 32 |
+
Methods for unsupervised domain adaptation in computer vision can be divided into three broad classes. The dominant class, which our work belongs to, aims to induce alignment between the source and the target domains in some feature space. This has been done by optimizing for some measurement of distributional discrepancy. One popular measurement is the maximum mean discrepancy (MMD) – the distance between the mean of the two domains in some reproducing kernel Hilbert space, where the kernel is chosen to maximize the distance (Bousmalis et al., 2016; Long et al., 2015; 2017). Another way to obtain a measurement of discrepancy is to train an adversarial discriminator that distinguishes between the two domains (Ganin & Lempitsky, 2014; Ganin et al., 2016; Tzeng et al., 2017). However, both MMD and adversarial training are formulated as minimax optimization problems, which are widely known, both in theory and practice, to be very difficult (Fedus et al., 2017; Duchi et al., 2016; Liang, 2017; Jin et al., 2019). Since the optimization landscape is much more complex than in standard supervised learning, training often does not converge or converges to a bad local minimum (Goodfellow, 2016; Nagarajan & Kolter, 2017; Li et al., 2017), and requires carefully balancing the two sets of parameters (for minimization and maximization) so one does not dominate the other (Salimans et al., 2016; Neyshabur et al., 2017a).
|
| 33 |
+
|
| 34 |
+
To make minimax optimization easier, researchers have proposed numerous modifications to the loss function, network design, and training procedure (Arjovsky et al., 2017; Gulrajani et al., 2017; Karras et al., 2017; Courty et al., 2017; Sun & Saenko, 2016; Shu et al., 2018; Sener et al., 2016). Over the years, these modifications have yielded practical improvements on many standard benchmarks, but have also made the state-of-the-art algorithms very complicated. Often practitioners are not sure which tricks are necessary for which applications, and implementing these tricks can be bug-prone and frustrating. To make matters worse, since there is no labeled target data available for a validation set, practitioners have no way to perform hyper-parameter tuning or early stopping.
|
| 35 |
+
|
| 36 |
+
The second class of methods directly transforms the source images to resemble the target images with generative models (Taigman et al., 2016; Hoffman et al., 2017; Bousmalis et al., 2017). While similar to the first class in the philosophy of alignment, these methods operate on image pixels directly instead of an intermediate representation space, and therefore can benefit from an additional round of adaptation in some representation space. In subsection 5.2 we demonstrate that composing our method with a popular pixel-level method yields stronger performance than either alone.
|
| 37 |
+
|
| 38 |
+
The third class of methods uses a model trained on the labeled source data to estimate labels on the target data, then trains on some of those estimated pseudo-labels (e.g. the most confident ones), therefore bootstrapping through the unlabeled target data. Sometimes called self-ensembling (French et al., 2017), this technique is borrowed from semi-supervised learning, where it is called co-training (Saito et al., 2017; Zou et al., 2018; Chen et al., 2018; 2011). In contrast, our method uses joint training (of the main and self-supervised tasks), different from co-training in every aspect except the name.
|
| 39 |
+
|
| 40 |
+
# 2.2 SELF-SUPERVISED FEATURE LEARNING
|
| 41 |
+
|
| 42 |
+
The emerging field of self-supervised learning uses the machinery of supervised learning on problems where external supervision is not available. The idea is to use data itself as supervision for auxiliary (also called “pretext”) tasks that learn deep feature representations which will hopefully be informative for downstream “real” tasks. Many such auxiliary tasks have been proposed in the literature, including colorization (predicting the chrominance channels of an image given its luminance) (Zhang et al., 2016b; Larsson et al., 2017; Zhang et al., 2017), image inpainting Pathak et al. (2016), spatial context prediction (Doersch et al., 2015), solving jigsaw puzzles (Noroozi & Favaro, 2016), image rotation prediction (Gidaris et al., 2018), predicting audio from video (Owens et al., 2016), contrastive predictive coding (Oord et al., 2018), etc. Researchers have also experimented with self-supervision on videos (Wang & Gupta, 2015; Wang et al., 2019), and combining multiple self-supervised tasks together (Doersch & Zisserman, 2017).
|
| 43 |
+
|
| 44 |
+
Typically, self-supervision is used as a pre-training step on unlabeled data (e.g. the ImageNet training set without labels) to initialize a deep learning model, followed by fine-tuning on a labeled training set (e.g. PASCAL VOC) and evaluating on the corresponding test set. Instead, in this paper, we train the self-supervised tasks together with the main supervised task, encouraging a consistent representation that both aligns the two domains and does well on the main task1.
|
| 45 |
+
|
| 46 |
+
Recently, self-supervision has also been used for other problem settings, such as improving robustness (Hendrycks et al., 2019), domain generalization (Carlucci et al., 2019) and few-short learning (Su et al., 2019). The most relevant paper to us is Ghifary et al. (2016), which uses self-supervision for unsupervised domain adaptation, but not through alignment. Their algorithm trains a denoising autoencoder Vincent et al. (2008) only on the target data, together with the main classifier only on the labeled source data. They argue theoretically that this is better than training the autoencoder on both domains together. However, their theory is based on the critical assumption that the domains are already aligned, which is rarely true in practice. Consequently, their empirical results are much weaker than ours, as discussed in section 5. Please see Appendix A for more detailed comparisons with these works.
|
| 47 |
+
|
| 48 |
+
The design of auxiliary self-supervised tasks is an exciting area of research in itself, with many successful examples listed in section 2. However, not all of them are suitable for unsupervised domain adaptation. In order to induce alignment between the source and target, the labels created by selfsupervision should not require capturing information on the very factors where the domains are meaninglessly different, i.e. the factors of variation that we are trying to eliminate through adaptation.
|
| 49 |
+
|
| 50 |
+
A particularly unsuitable tasks are these that try to predict pixels of the original image, as image inpainting (Pathak et al., 2016), colorization (Zhang et al., 2016b; Larsson et al., 2017; Zhang et al., 2017) or denoising autoencoder(Vincent et al., 2008). The success of pixel-wise reconstruction depends strongly on brightness information, or other factors of variation in overall appearance (e.g. sunny vs. coudy) that are typically irrelevant to high-level visual concepts. Thus, instead of inducing alignment, learning a pixel reconstruction task would instead serve to further separate the domains. We have experimented with using the colorization task and the denoising autoencoder for our training algorithm, and found their performance little better than the source only baseline, sometimes even worse! 2
|
| 51 |
+
|
| 52 |
+
Table 1: Transformations and labels on a sample input image created by two of the self-supervised tasks used in our work.
|
| 53 |
+
|
| 54 |
+
<table><tr><td>Task</td><td colspan="3">Images and self-supervised labels</td></tr><tr><td>Rotation</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">Location</td><td></td><td></td><td>90°180°270°</td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>(0,0)(1,0)(0,1)(1,1)</td><td></td></tr></table>
|
| 55 |
+
|
| 56 |
+
In general, classification tasks that predict structural labels seems better suited for our purpose than reconstruction tasks that predict pixels. Therefore, we have settled on three classification-based self-supervised tasks that combine simplicity with high performance:
|
| 57 |
+
|
| 58 |
+
Rotation Prediction: (Gidaris et al., 2018) An input image is rotated in 90-degree increments i.e. $0 ^ { \circ }$ , $9 0 ^ { \circ }$ , $1 8 0 ^ { \circ }$ , and $2 7 0 ^ { \circ }$ ; the task is to predict the angle of rotation as a four-way classification problem.
|
| 59 |
+
|
| 60 |
+
Flip Prediction: An input image is randomly flipped vertically; the task is to predict whether the image is flipped or not 3.
|
| 61 |
+
|
| 62 |
+
Patch Location Prediction: Patches are randomly cropped out of an input image; the task is to predict where the patches come from 4.
|
| 63 |
+
|
| 64 |
+
Consider a trivial illustrative example where the source and target are exactly the same except that the target pixels are all scaled down by a constant factor (e.g. daylight to dusk transition). All three of the aforementioned forms of self-supervision are suitable for this example, because pixel scaling i.e. brightness is “orthogonal” to the prediction of rotation, flip and location.
|
| 65 |
+
|
| 66 |
+
# 4 METHOD
|
| 67 |
+
|
| 68 |
+
Our training algorithm is simple once a set of $K$ self-supervised tasks are selected. We already have the loss function on the main prediction task, denoted $L _ { 0 }$ , that we do not have target labels for. Each self-supervised task corresponds to a loss function $\mathcal { L } _ { k }$ for $k = 1 . . . K$ . So altogether, our optimization problem is set up as a combination of these $K + 1$ loss functions, as is done for standard multi-task learning (see Figure 2). Implementation details are included in Appendix B.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 2: Our method jointly trains a supervised head on labeled source data and self-supervised heads on unbaled data from both domains. The heads use high-level features from a shared encoder, which learns to align the feature distributions.
|
| 72 |
+
|
| 73 |
+
Each loss function corresponds to a different “head” $h _ { k }$ for $k = 0 . . . K$ , which produces predictions in the respective label space. All the task-specific heads (including $h _ { 0 }$ for the actual prediction task) share a common feature extractor $\phi$ . Altogether, the parameters of $\phi$ and $h _ { k } , k = 0 , . . k$ are the learned variables i.e. the free parameters of our optimization problem.
|
| 74 |
+
|
| 75 |
+
In our paper, $\phi$ is a deep convolutional neural network, and every $h _ { k }$ is simply a linear layer i.e. multiplication by a matrix of size output space dimension $\times$ feature space dimension. If $k \mathrm { t h }$ task is classification in nature, then $h _ { k }$ also has a softmax or sigmoid (for multi-class or binary) following the linear layer. The output space dimension is only four for rotation and location classification, and two for flip and location regression. Depending on the network architecture used, the feature space dimension ranges between 64 and 512. The point is to make every $h _ { k }$ low capacity, so the heads are forced to share high-level features, as is desirable for inducing alignment. A linear map from the highest-level features to the output is the smallest possible head and performs well empirically.
|
| 76 |
+
|
| 77 |
+
Let ${ \cal { S } } = \{ ( x _ { i } , y _ { i } ) , i = 1 . . . m \}$ contain the labeled source data, and $T = \{ ( x _ { i } ) , i = 1 . . . n \}$ contain the unlabeled target data. $L _ { 0 }$ for the main prediction task takes in the labeled source data, and produces the following term in our objective:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } _ { 0 } \big ( S ; \phi , h _ { 0 } \big ) = \sum _ { ( x , y ) \in S } L _ { 0 } \big ( h _ { 0 } \big ( \phi ( x ) \big ) , y \big ) .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Each self-supervised task $F _ { k }$ for $k = 1 . . . K$ modifies the input samples with some transformation $f _ { k }$ and creates labels $\tilde { y }$ . Denote $F _ { k } ( S ) = \{ ( f _ { k } ( x _ { i } ) , \tilde { y } _ { i } ) , i = 1 . . . m \}$ as the self-supervised samples generated from the source samples (with the original labels discarded), and $F _ { k } ( \bar { T ( \cdot ) } = \{ ( f _ { k } ( x _ { i } ) \bar { , } \tilde { y } _ { i } ) , \bar { \cdot } =$ $\left. 1 . . n \right\}$ from the target. Then the loss $L _ { k }$ of each task $k = 1 . . . K$ produces the following term:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { L } _ { k } ( S , T ; \phi , h _ { k } ) = \sum _ { ( f _ { k } ( x ) , \tilde { y } ) \in F ( S ) } L _ { k } ( h _ { k } ( \phi ( f _ { k } ( x ) ) ) , \tilde { y } ) + \sum _ { ( f _ { k } ( x ) , \tilde { y } ) \in F ( T ) } L _ { k } ( h _ { k } ( \phi ( f _ { k } ( x ) ) ) , \tilde { y } ) .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Note that $\mathcal { L } _ { k } ( S , T ; \phi , h _ { k } )$ for $k = 1 . . . K$ , unlike $\mathcal { L } _ { 0 } ( S ; \phi , h _ { 0 } )$ , take in both the source and target data; as we emphasize for many times throughout the paper, this is critical for inducing alignment. Altogether, our optimization problem can be formalized as in multi-task learning 5:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\operatorname* { m i n } _ { \phi , h _ { k } , k = 1 \ldots K } \quad { \mathcal { L } } _ { 0 } ( S ; \phi , h _ { 0 } ) + \sum _ { k = 1 } ^ { K } { \mathcal { L } } _ { k } ( S , T ; \phi , h _ { k } ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: Results on MNIST MNIST-M (left) and CIFAR- $\mathrm { \cdot 1 0 { } S T L \mathrm { - } 1 0 }$ (right). Test error converges smoothly on the source and target domains for the main task as well as the self-supervised task. This kind of smooth convergence is often seen in supervised learning, but rarely in adversarial learning. The centroid distance (linear MMD) between the feature distributions of the two domains converges alongside, even though it is never explicitly optimized for.
|
| 97 |
+
|
| 98 |
+
At test-time, we discard the self-supervised heads and use $h _ { 0 } ( \phi ( x ) )$ .
|
| 99 |
+
|
| 100 |
+
# 4.1 A HEURISTIC FOR HYPER-PARAMETER TUNING AND EARLY STOPPING
|
| 101 |
+
|
| 102 |
+
As previously mentioned, in the unsupervised domain adaptation setting, there is no target label available and therefore no target validation set, so typical strategies for hyper-parameter tuning and early stopping that require a validation set cannot be applied. This problem remains underappreciated; in fact, it is often unclear how previous works select their hyper-parameters or detemine when training is finished, both of which can be important factors that impact performance, especially for complex algorithms using adversarial learning. In this subsection we describe a simple heuristic 6, merely as rule-of-thumb to make things work instead of a technical innovation. Like almost all of deep learning, there is no statistical guarantee on this heuristic, but it is shown to be practically effective in our experiments (see Figure 3). We only hope that it serves as the first guess of a solution towards this underappreciated problem.
|
| 103 |
+
|
| 104 |
+
The main idea is that, because our method never explicitly optimizes for any measurement of distributional discrepancy, these measurements can instead be used for hyper-parameter tuning and early stopping. Since it would be counterproductive to introduce additional parameters in order to perform hyper-parameter tuning, we simply use the distance between the mean of the source and target samples in the learned representation space, as produced by $\phi$ . Formally, this can be expressed as
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
D ( S ^ { \prime } , T ^ { \prime } ; \phi ) = \biggl \| \frac { 1 } { m } \sum _ { x \in S ^ { \prime } } \phi ( x ) - \frac { 1 } { n } \sum _ { x \in T ^ { \prime } } \phi ( x ) \biggl \| _ { 2 } ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $S ^ { \prime }$ and $T ^ { \prime }$ are unlabeled source and target validation sets 7.
|
| 111 |
+
|
| 112 |
+
Our heuristic combines $D ( S ^ { \prime } , T ^ { \prime } ; \phi )$ and the main task error on the (labeled) source validation set. Denote $\mathbf { v } = ( v _ { 1 } , . . . , v _ { T } )$ and $\mathbf { w } = ( w _ { 1 } , . . . , w _ { T } )$ the measurement vectors of those two quantities respectively over $T$ epochs. The final measurement vector is $\mathbf { u } = \mathbf { v } / \operatorname* { m i n } ( \mathbf { v } ) + \mathbf { w } / \operatorname* { m i n } ( \mathbf { \bar { w } } )$ i.e. a normalized sum of the two vectors; the epoch at which we perform early stopping is then simply arg $\operatorname* { m i n } _ { t \in \{ 1 . . . T \} } \mathbf { u } _ { t }$ . Intuitively, this heuristic roughly corresponds to our goal of inducing alignment while preserving discriminability.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Source Target</td><td>MNIST MNIST-M</td><td>MNIST SVHN</td><td>SVHN MNIST</td><td>MNIST USPS</td><td>USPS MNIST</td><td>CIFAR-10 STL-10</td><td>STL-10 CIFAR-10</td></tr><tr><td>DANN (Ganin et al.,2016)</td><td>81.5</td><td>35.7</td><td>73.6</td><td>-</td><td>-</td><td>-</td><td>=</td></tr><tr><td>DRCN (Ghifary et al.,2016)</td><td>-</td><td>40.1</td><td>82.0</td><td>=</td><td></td><td>66.4</td><td>58.7</td></tr><tr><td>DSN (Bousmalis et al., 2016)</td><td>83.2</td><td>=</td><td>82.7</td><td></td><td>=</td><td>1</td><td>1</td></tr><tr><td>kNN-Ad (Sener et al., 2016)</td><td>86.7</td><td>40.3</td><td>78.8</td><td>=</td><td></td><td>=</td><td>1</td></tr><tr><td>PixelDA (Bousmalis et al., 2017)</td><td>98.2</td><td></td><td></td><td></td><td></td><td>=</td><td>=</td></tr><tr><td>ATT (Saito et al., 2017)</td><td>94.2</td><td>52.8</td><td>86.2</td><td></td><td></td><td>-</td><td>1</td></tr><tr><td>II-Model (French et al., 2017)</td><td>-</td><td>71.4</td><td>92.0</td><td>=</td><td></td><td>76.3</td><td>64.2</td></tr><tr><td>ADDA (Tzeng et al., 2017)</td><td>=</td><td>1</td><td>76.0</td><td>89.4</td><td>90.1</td><td>-</td><td>1</td></tr><tr><td>CyCADA (Hoffman et al., 2017)</td><td>=</td><td>-</td><td>90.4</td><td>95.6</td><td>96.5</td><td>1</td><td>1</td></tr><tr><td>VADA (Shu et al.,2018)</td><td>97.7</td><td>47.5</td><td>97.9</td><td>1</td><td>1</td><td>80.0</td><td>73.5</td></tr><tr><td>DIRT-T (Shu et al., 2018)</td><td>98.9</td><td>54.5</td><td>99.4</td><td>=</td><td>1</td><td>-</td><td>75.3</td></tr><tr><td>VADA (IN) (Shu et al., 2018)</td><td>95.7</td><td>73.3</td><td>94.5</td><td>=</td><td></td><td>78.3</td><td>71.4</td></tr><tr><td>DIRT-T (IN) (Shu et al., 2018)</td><td>98.7</td><td>76.5</td><td>99.4</td><td>-</td><td>-</td><td>1</td><td>73.3</td></tr><tr><td>Source only VADA & DIRT-T</td><td>58.5</td><td>27.9</td><td>77.0</td><td>-</td><td></td><td>76.3</td><td>63.6</td></tr><tr><td>Source only VADA & DIRT-T (IN)</td><td>59.9</td><td>40.9</td><td>82.4</td><td>-</td><td>-</td><td>77.0</td><td>62.6</td></tr><tr><td>Source only our method</td><td>44.9</td><td>30.5</td><td>92.2</td><td>94.7</td><td>81.4</td><td>75.6</td><td>58.8</td></tr><tr><td>R</td><td>98.9</td><td>61.3</td><td>85.88</td><td>96.5</td><td>90.2</td><td>81.2</td><td>66.9</td></tr><tr><td>R+L+F</td><td>-</td><td>1</td><td>=</td><td>-</td><td>1</td><td>82.1</td><td>75.5</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 2: Test accuracy $( \% )$ on standard domain adaptation benchmarks. Our results are organized according to the self-supervised task(s) used: R for rotation, L for location, and F for flip. We achieve state-of-the-art accuracy on four out of the seven benchmarks.
|
| 117 |
+
|
| 118 |
+
# 5 EXPERIMENTS
|
| 119 |
+
|
| 120 |
+
# 5.1 SEVEN BENCHMARKS FOR OBJECT RECOGNITION
|
| 121 |
+
|
| 122 |
+
The seven benchmarks are based on the six datasets described in Appendix D, each with a predefined training set / test set split, and labels are available on both splits. Previous works (cited in Table 2) have created those seven benchmarks by picking pairs of datasets with the same label space, treating one as the source and the other as the target, and training on the training set of the source with labels revealed and of the target with labels hidden. Following the standard setup of the field, labels on the target test set should only be used for evaluation, not for hyper-parameter tuning or early stopping; therefore we apply the heuristic described in subsection 4.1.
|
| 123 |
+
|
| 124 |
+
For the two natural scene benchmarks, we use all three tasks described in section 3: rotation, location and flip prediction. For the five benchmarks on digits we do not use location because it yields trivial solutions that do not encourage the learning of semantic concepts. Given the image of a digit cropped into the four quadrants, location prediction can be trivially solved by looking at the four corners where a white stroke determines the category. Adding flip to the digits does not hurt performance, but does not improve significantly either, so we do not report those results separately.
|
| 125 |
+
|
| 126 |
+
As shown in Table 2, despite the simplicity of our method, we achieve state-of-the-art accuracy on four out of the seven benchmarks. In addition, we show the source only results from our closest competitor (VADA and DIRT-T), and note that our source only results are in fact lower than theirs on those very benchmarks that we perform the best on; this indicates that our success is indeed due to effectiveness in adaptation instead of the base architecture.
|
| 127 |
+
|
| 128 |
+
Our method fails on the pair of benchmarks with SVHN, on which rotation yields trivial solutions. Because SVHN digits are cropped from house numbers with multiple digits, majority of the images have parts of the adjacent digits on the side. The main task head needs to look at the center, but the rotation head learns to look at the periphery and cheat. This failure case shows that the success of our method is tied to how well the self-supervised task fits the application. Practioners should use their domain knowledge evaluate how well the task fits, instead of blithely apply it to everything.
|
| 129 |
+
|
| 130 |
+
Also seen in Table 2 is that our method excels at object recognition in natural scenes, especially with all three tasks together. For STL- $1 0 { }$ CIFAR-10, our base model is considerably worse than that of VADA and DIRT-T, but still beats all the baselines. Adding location and flip gives an improvement of $8 \%$ , on top of the $8 \%$ already over source only. This is not surprising since those tasks were originally developed for ImageNet pre-training i.e. object recognition in natural scenes – our method is very successful when the task fits the application well.
|
| 131 |
+
|
| 132 |
+
Table 3: Test accuracy $( \% )$ on $\mathrm { G T A } 5 $ Cityscapes. Our method significantly improves over source only, and also over CyCADA when combined. This indicates that additional self-supervision using our training algorithm further aligns the domains.
|
| 133 |
+
|
| 134 |
+
<table><tr><td></td><td colspan="13">GTA5→ Cityscapes</td><td colspan="7"></td></tr><tr><td></td><td></td><td>seeapra 12.7</td><td>Buiping 39.6</td><td></td><td></td><td></td><td></td><td>trggee</td><td>usrs ogen</td><td>enee</td><td>Eirrin</td><td>3</td><td>uos.iad</td><td></td><td>u</td><td></td><td>1</td><td></td><td></td><td>mooiritte</td><td>aeleir</td><td>mIoU</td></tr><tr><td>Source only Ours</td><td>28.8 69.9</td><td></td><td>22.7</td><td>69.7</td><td>9.4 18.1</td><td>3.5 9.9</td><td>18.1 13.5</td><td>22.7 18.7</td><td>9.4 8.9</td><td>80.9 80.3</td><td>12.4 19.4</td><td>45.8 58.4</td><td></td><td>53.9 53.8</td><td>9.6 2.6</td><td>74.7 75.1</td><td>20.9 13.6</td><td>15.0 5.2</td><td>0.0 0.3</td><td>19.4 8.1</td><td>3.9 1.2</td><td>25.3 28.9</td></tr><tr><td>CyCADA</td><td></td><td>79.1 33.1</td><td>77.923.4</td><td></td><td></td><td>17.332.1</td><td></td><td></td><td>33.3 31.8 81.5</td><td></td><td>26.7</td><td>69.0</td><td>62.8</td><td></td><td></td><td>14.774.520.925.6</td><td></td><td></td><td>6.9</td><td></td><td>18.820.4</td><td>39.5</td></tr><tr><td>Ours + CyCADA</td><td>86.6</td><td>37.8</td><td>80.8</td><td>29.7</td><td></td><td>16.4</td><td>28.9</td><td>30.9</td><td>22.2</td><td>83.8</td><td>37.1</td><td>76.9</td><td>60.1</td><td>7.8</td><td>84.1</td><td></td><td>30.8</td><td>32.1</td><td>1.2</td><td>23.2</td><td>13.3</td><td>41.2</td></tr><tr><td>Oracle</td><td>97.3</td><td>79.8</td><td>88.6</td><td>32.5</td><td></td><td>48.2</td><td>56.3</td><td>63.6</td><td>73.3</td><td>89.0</td><td>58.9</td><td>93.0</td><td>78.2</td><td>55.2</td><td>92.2</td><td></td><td>45.0</td><td>67.3</td><td>39.6</td><td>49.9</td><td>73.6</td><td>67.4</td></tr></table>
|
| 135 |
+
|
| 136 |
+
# 5.2 BENCHMARK FOR SEMANTIC SEGMENTATION
|
| 137 |
+
|
| 138 |
+
To experiment with our method in more diverse applications, we also evaluate on a challenging simulation-to-real benchmark for semantic segmentation – $\mathbf { \partial } \cdot \mathbf { G T A } 5 \mathbf { \langle }$ Cityscapes. GTA5 (Richter et al., 2016) contains 24,966 video frames taken from the computer game, where dense segmentation labels are automatically given by the game engine. Cityscapes (Cordts et al., 2016) contains 5,000 video frames taken from real-world dash-cams. The main task is to classify every pixel in an image as one of the 19 classes shared across both datasets, and accuracy is measured by intersection over union (IoU). The best possible results are given as the oracle, when the labels on Cityscapes are available for training, so typical supervised learning methods are applicable.
|
| 139 |
+
|
| 140 |
+
Our results are shown in Table 3, and implementation details in Appendix F. Our self-supervised tasks were designed for classification, where the label on an image depends on its global content, while in segmentation the labels tend to be highly local. Nevertheless, with very little modification, we see significant improvements over the source only baseline. In Appendix G we provide visualizations of the segmentation results, and make qualitative comparisons between those produced by the baseline and our method.
|
| 141 |
+
|
| 142 |
+
We also experiment with combining our method with another popular unsupervised domain adaptation method – CyCADA (Hoffman et al., 2017), designed specifically for segmentation. Surprisingly, when operating on top of images produced by this already very strong baseline, our method further improves performance. This demonstrates that pixel-level adaptation methods might still benefit from an additional round of adaptation by inducing alignment through self-supervision. We emphasize that these results are obtained with a very simple instantiation of our method, as a start towards the development of self-supervised tasks more suitable for semantic segmentation.
|
| 143 |
+
|
| 144 |
+
# 6 DISCUSSION
|
| 145 |
+
|
| 146 |
+
We hope that this work encourages future researchers in unsupervised domain adaptation to consider the study of self-supervision as an alternative to adversarial learning, and researchers in selfsupervision to consider designing tasks and evaluating them in our problem setting. Most selfsupervised tasks today were originally designed for pre-training and evaluated in terms of accuracy gains on a downstream recognition, localization or detection tasks. It will be interesting to see if new self-supervised tasks can arise from the motivation of adaptation, for which alignment is the key objective. Moreover, domain experts could perhaps incorporate their dataset specific knowledge into the design of a self-supervised task specifically for their application.
|
| 147 |
+
|
| 148 |
+
One additional advantage of our method, not considered in this paper, is that it might be particularly amenable to very small target sample size, when those other methods based on adversarial learning cannot accurately estimate the target distribution. We leave this topic for the future work.
|
| 149 |
+
|
| 150 |
+
# REFERENCES
|
| 151 |
+
|
| 152 |
+
Pablo Arbelaez, Michael Maire, Charless Fowlkes, and Jitendra Malik. Contour detection and hierarchical image segmentation. IEEE transactions on pattern analysis and machine intelligence, 33(5):898–916, 2011.
|
| 153 |
+
|
| 154 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 155 |
+
|
| 156 |
+
Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach. arXiv preprint arXiv:1802.05296, 2018.
|
| 157 |
+
|
| 158 |
+
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.
|
| 159 |
+
|
| 160 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3722–3731, 2017.
|
| 161 |
+
|
| 162 |
+
Fabio M Carlucci, Antonio D’Innocente, Silvia Bucci, Barbara Caputo, and Tatiana Tommasi. Domain generalization by solving jigsaw puzzles. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2229–2238, 2019.
|
| 163 |
+
|
| 164 |
+
Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. 2017. URL http://arxiv.org/abs/1706.05587.
|
| 165 |
+
|
| 166 |
+
Minmin Chen, Kilian Q Weinberger, and John Blitzer. Co-training for domain adaptation. In Advances in neural information processing systems, pp. 2456–2464, 2011.
|
| 167 |
+
|
| 168 |
+
Xilun Chen, Yu Sun, Ben Athiwaratkun, Claire Cardie, and Kilian Weinberger. Adversarial deep averaging networks for cross-lingual sentiment classification. Transactions of the Association for Computational Linguistics, 6:557–570, 2018.
|
| 169 |
+
|
| 170 |
+
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.
|
| 171 |
+
|
| 172 |
+
Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 173 |
+
|
| 174 |
+
Nicolas Courty, Remi Flamary, Devis Tuia, and Alain Rakotomamonjy. Optimal transport for do- ´ main adaptation. IEEE transactions on pattern analysis and machine intelligence, 39(9):1853– 1865, 2017.
|
| 175 |
+
|
| 176 |
+
Gabriela Csurka. Domain adaptation for visual applications: A comprehensive survey. arXiv preprint arXiv:1702.05374, 2017.
|
| 177 |
+
|
| 178 |
+
D. Das and C. S. George Lee. Unsupervised domain adaptation using regularized hyper-graph matching. In 2018 25th IEEE International Conference on Image Processing (ICIP), pp. 3758– 3762, Oct 2018. doi: 10.1109/ICIP.2018.8451152.
|
| 179 |
+
|
| 180 |
+
Debasmit Das and C. S. George Lee. Graph matching and pseudo-label guided deep unsupervised domain adaptation. In Vera K ˇ urkov ˚ a, Yannis Manolopoulos, Barbara Hammer, Lazaros Iliadis, ´ and Ilias Maglogiannis (eds.), Artificial Neural Networks and Machine Learning – ICANN 2018, pp. 342–352, Cham, 2018. Springer International Publishing. ISBN 978-3-030-01424-7.
|
| 181 |
+
|
| 182 |
+
Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2051–2060, 2017.
|
| 183 |
+
|
| 184 |
+
Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1422–1430, 2015.
|
| 185 |
+
|
| 186 |
+
John C Duchi, John Lafferty, Yuancheng Zhu, et al. Local minimax complexity of stochastic convex optimization. In Advances in Neural Information Processing Systems, pp. 3423–3431, 2016.
|
| 187 |
+
|
| 188 |
+
William Fedus, Mihaela Rosca, Balaji Lakshminarayanan, Andrew M Dai, Shakir Mohamed, and Ian Goodfellow. Many paths to equilibrium: Gans do not need to decrease a divergence at every step. arXiv preprint arXiv:1710.08446, 2017.
|
| 189 |
+
|
| 190 |
+
Geoffrey French, Michal Mackiewicz, and Mark Fisher. Self-ensembling for domain adaptation. arXiv preprint arXiv:1706.05208, 2017.
|
| 191 |
+
|
| 192 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. arXiv preprint arXiv:1409.7495, 2014.
|
| 193 |
+
|
| 194 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 195 |
+
|
| 196 |
+
Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, David Balduzzi, and Wen Li. Deep reconstruction-classification networks for unsupervised domain adaptation. In European Conference on Computer Vision, pp. 597–613. Springer, 2016.
|
| 197 |
+
|
| 198 |
+
Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 199 |
+
|
| 200 |
+
Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 201 |
+
|
| 202 |
+
Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Domain adaptation for object recognition: An unsupervised approach. In 2011 international conference on computer vision, pp. 999–1006. IEEE, 2011.
|
| 203 |
+
|
| 204 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017.
|
| 205 |
+
|
| 206 |
+
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1321–1330. JMLR. org, 2017.
|
| 207 |
+
|
| 208 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016.
|
| 209 |
+
|
| 210 |
+
Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. arXiv preprint arXiv:1906.12340, 2019.
|
| 211 |
+
|
| 212 |
+
Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei A Efros, and Trevor Darrell. Cycada: Cycle-consistent adversarial domain adaptation. arXiv preprint arXiv:1711.03213, 2017.
|
| 213 |
+
|
| 214 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European conference on computer vision, pp. 646–661. Springer, 2016.
|
| 215 |
+
|
| 216 |
+
Chi Jin, Praneeth Netrapalli, and Michael I Jordan. Minmax optimization: Stable limit points of gradient descent ascent are locally optimal. arXiv preprint arXiv:1902.00618, 2019.
|
| 217 |
+
|
| 218 |
+
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.
|
| 219 |
+
|
| 220 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 221 |
+
|
| 222 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Colorization as a proxy task for visual understanding. In CVPR, 2017.
|
| 223 |
+
|
| 224 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied ´ to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 225 |
+
|
| 226 |
+
Jerry Li, Aleksander Madry, John Peebles, and Ludwig Schmidt. On the limitations of first-order approximation in gan dynamics. arXiv preprint arXiv:1706.09884, 2017.
|
| 227 |
+
|
| 228 |
+
Tengyuan Liang. How well can generative adversarial networks learn densities: A nonparametric view. arXiv preprint arXiv:1712.08244, 2017.
|
| 229 |
+
|
| 230 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I Jordan. Learning transferable features with deep adaptation networks. arXiv preprint arXiv:1502.02791, 2015.
|
| 231 |
+
|
| 232 |
+
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep transfer learning with joint adaptation networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 2208–2217. JMLR. org, 2017.
|
| 233 |
+
|
| 234 |
+
Vaishnavh Nagarajan and J Zico Kolter. Gradient descent gan optimization is locally stable. In Advances in Neural Information Processing Systems, pp. 5585–5595, 2017.
|
| 235 |
+
|
| 236 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 237 |
+
|
| 238 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, and Ayan Chakrabarti. Stabilizing gan training with multiple random projections. arXiv preprint arXiv:1705.07831, 2017a.
|
| 239 |
+
|
| 240 |
+
Behnam Neyshabur, Ryota Tomioka, Ruslan Salakhutdinov, and Nathan Srebro. Geometry of optimization and implicit regularization in deep learning. arXiv preprint arXiv:1705.03071, 2017b.
|
| 241 |
+
|
| 242 |
+
Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 2016.
|
| 243 |
+
|
| 244 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 245 |
+
|
| 246 |
+
Andrew Owens, Jiajun Wu, Josh H McDermott, William T Freeman, and Antonio Torralba. Ambient sound provides supervision for visual learning. In European Conference on Computer Vision (ECCV), 2016.
|
| 247 |
+
|
| 248 |
+
Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2536–2544, 2016.
|
| 249 |
+
|
| 250 |
+
Stephan R Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun. Playing for data: Ground truth from computer games. In European Conference on Computer Vision, pp. 102–118. Springer, 2016.
|
| 251 |
+
|
| 252 |
+
Kuniaki Saito, Yoshitaka Ushiku, and Tatsuya Harada. Asymmetric tri-training for unsupervised domain adaptation. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 2988–2997. JMLR. org, 2017.
|
| 253 |
+
|
| 254 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in neural information processing systems, pp. 2234–2242, 2016.
|
| 255 |
+
|
| 256 |
+
Ozan Sener, Hyun Oh Song, Ashutosh Saxena, and Silvio Savarese. Learning transferrable representations for unsupervised domain adaptation. In Advances in Neural Information Processing Systems, pp. 2110–2118, 2016.
|
| 257 |
+
|
| 258 |
+
Rui Shu, Hung H Bui, Hirokazu Narui, and Stefano Ermon. A dirt-t approach to unsupervised domain adaptation. arXiv preprint arXiv:1802.08735, 2018.
|
| 259 |
+
|
| 260 |
+
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.
|
| 261 |
+
|
| 262 |
+
Jong-Chyi Su, Subhransu Maji, and Bharath Hariharan. Boosting supervision with self-supervision for few-shot learning. arXiv preprint arXiv:1906.07079, 2019.
|
| 263 |
+
|
| 264 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European Conference on Computer Vision, pp. 443–450. Springer, 2016.
|
| 265 |
+
|
| 266 |
+
Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. arXiv preprint arXiv:1611.02200, 2016.
|
| 267 |
+
|
| 268 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7167–7176, 2017.
|
| 269 |
+
|
| 270 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103. ACM, 2008.
|
| 271 |
+
|
| 272 |
+
Mei Wang and Weihong Deng. Deep visual domain adaptation: A survey. Neurocomputing, 312: 135–153, 2018.
|
| 273 |
+
|
| 274 |
+
Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In ICCV, 2015.
|
| 275 |
+
|
| 276 |
+
Xiaolong Wang, Allan Jabri, and Alexei A. Efros. Learning correspondence from the cycleconsistency of time. In CVPR, 2019.
|
| 277 |
+
|
| 278 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016a.
|
| 279 |
+
|
| 280 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pp. 649–666. Springer, 2016b.
|
| 281 |
+
|
| 282 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1058–1067, 2017.
|
| 283 |
+
|
| 284 |
+
Yang Zou, Zhiding Yu, BVK Vijaya Kumar, and Jinsong Wang. Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 289–305, 2018.
|
| 285 |
+
|
| 286 |
+
# APPENDIX
|
| 287 |
+
|
| 288 |
+
# A ADDITIONAL DISCUSSION ON SPECIFIC PAPERS RELATED TO OURS
|
| 289 |
+
|
| 290 |
+
In this section we discuss the four papers mentioned in section 2 that are related to ours, but different in training algorithm, philosophy or problem setting.
|
| 291 |
+
|
| 292 |
+
Deep Reconstruction-Classification Networks (Ghifary et al., 2016). This method works in unsupervised domain adaptation, the same problem setting as ours. It learns a denoising autoencoder on the target, together with the main classifier on the source. However, they use only the target domain for reconstruction, claiming both empirically and theoretically that it is better than using both domains together. In contrast, we use both the source and target for self-supervision. These two algorithmic differences really reflect our fundamental difference in philosophy. They take the target data as analogous to the unlabeled (source) data in semi-supervised learning, so any form of self-supervision suitable for semi-supervised learning is good enough; their theoretical analysis is also directly borrowed from that of semi-supervised learning, which concludes that it is necessary and sufficient to only use the target data for self-supervision. We take data from both domains for self-supervision in order to align their feature distributions; also, both conceptually and empirically, we cannot use reconstruction tasks because they are unsuitable for inducing alignment (see section 3).
|
| 293 |
+
|
| 294 |
+
Empirical experiments further support our arguments in three ways: 1) If we were to only use the target for our self-supervision tasks, we would perform barely better than the source only baseline, even on MNIST MNIST-M, the easiest benchmark where we would otherwise observe a huge improvement. 2) If we were to use the reconstruction task i.e. a denoising autoencoder, we would again perform barely better than the source only baseline, and sometimes even worse, as described in section 3. 3) As shown in Table 2, our results are much better than theirs on all of the benchmarks by a large margin. This shows that implementing the philosophy of alignment, developed for unsupervised domain adaptation, is much superior in our problem setting to blithely borrowing from semi-supervised learning.
|
| 295 |
+
|
| 296 |
+
In addition to the three classes of methods covered in section 2, unsupervised domain adaptation has also been studied using sample-to-sample correspondence through graph matching (Das & George Lee, 2018; Das & Lee, 2018); these methods are less relevant to ours and not discussed in detail.
|
| 297 |
+
|
| 298 |
+
Using Self-Supervised Learning Can Improve Model Robustness and Uncertainty (Hendrycks et al., 2019). This paper studies the setting of robustness, where there is no sample provided, even unlabeled, from the target domain. Their method jointly trains for the main task and the self-supervised task only on the source domain, really because there is no target data of any kind. Because their problem setting is very challenging (with so little information provided on the target), their primary evaluation is on a dataset of CIFAR-10 images with the addition of 15 types of common corruptions (e.g. impulse noise, JPEG compression, snow weather, motion blur and pixelation), simulated by an algorithm. No idea on unsupervised domain adaptation is mentioned.
|
| 299 |
+
|
| 300 |
+
Domain Generalization by Solving Jigsaw Puzzles (Carlucci et al., 2019). This paper studies two setting. The first is the robustness setting, exactly the same as in Hendrycks et al. (2019), except that evaluation is done on MNIST MNIST-M and MNIST ${ } ^ { \prime } { } S \mathbf { V } \mathbf { H } \mathbf { N }$ . Their baseline is also a method from the robustness community that trains on adversarial examples and uses no target data. Again, because their problem setting is very challenging, the accuracy is low for both their proposed method and the baseline. The second setting is called domain generalization, which is very similar to meta-learning. The goal is to perform well simultaenously on multiple distributions, all labeled. Evaluation is done using the mean accuracy on all the domains. Beside the name, there is little similarity between the setting of unsupervised domain adaptation and domain generalization, which has no unsupervised component.
|
| 301 |
+
|
| 302 |
+
Boosting Supervision with Self-Supervision for Few-shot Learning (Su et al., 2019). As evident from the title, this paper studies the setting of few-shot learning, where the goal is to perform well on a very small dataset. Again, there is no unsupervised component and little connection to our setting.
|
| 303 |
+
|
| 304 |
+
Most of our results have already been produced when Carlucci et al. (2019) and Su et al. (2019) were presented at a conference. Hendrycks et al. (2019) was submitted to NeurIPS 2019 and should be considered concurrent work.
|
| 305 |
+
|
| 306 |
+
# B ADDITIONAL ALGORITHMIC DETAILS
|
| 307 |
+
|
| 308 |
+
In practice and for our experiments, the source and target datasets are often imbalanced in size. If we were to blithely solve for the objective in Equation 2, the domain with a larger dataset would carry more weight for every $\mathcal { L } _ { k } ( S , T ; \phi , h _ { k } ) , k = 1 . . . K$ because we are summing over all samples in both datasets. We would like to keep the two sums inside $\mathcal { L } _ { k }$ roughly balanced such that in terms of features produced by $\phi$ , neither of the two domains would dominate the other. This is easy to achieve in our implementation through balanced batches. When we need to sample a batch for task $k$ , we simply sample half the batch from the source, and another half from the target, then put them together. In the end, our implementation requires little change on top of an existing supervised learning codebase. Each self-supervised task is defined as a module, and adding a new one only amounts to defining the structural modifications and the loss function.
|
| 309 |
+
|
| 310 |
+
We optimize the objective in Equation 2 with stochastic gradient descent (SGD). One can simply take a joint step on Equation 2, which covers all the losses for $k = 0$ and $k = 1 . . . K$ . However, the implementation would then have to store the gradients with respect to all $K + 1$ losses together. For memory efficiency, our implementation loops over $k = 1 . . . K$ ; for each self-supervised task $k$ , it samples a batch of combined source and target data (without their original labels), structurally modifies the images by $f _ { k }$ , creates new labels according to the modification, and obtains a loss for $h _ { k }$ and $\phi$ on this batch. So a gradient step is taken for each $k = 1 . . . K$ , before finally a batch of original source images and labels are sampled for a gradient step on $h _ { 0 }$ and $\phi$ . In terms of test accuracy, these two implementations make little difference (usually less than $1 \%$ ), and the choice simply comes down to a time-memory trade-off.
|
| 311 |
+
|
| 312 |
+
Because our source only baseline on $\mathrm { S T L } { \cdot } 1 0 \mathrm { C I F A R } { \cdot } 1 0$ is considerably worse than the closest competitor DIRT-T, we borrow from their implementation and use dropout regularization (Srivastava et al., 2014) with $p = 0 . 5$ , only on this benchmark. This makes our source only baseline closer to theirs, so to allow for a fair comparison of the adaptation methods. Without this modification, our accuracy for source only, R, and $\mathrm { R + L + F }$ are respectively 56.1, 65.6 and $7 4 . 0 \%$ .
|
| 313 |
+
|
| 314 |
+
# C ADDITIONAL DISCUSSION ON THE MEAN DISTANCE
|
| 315 |
+
|
| 316 |
+
In this section we answer some potential questions about our selection rule, which uses the mean distance, from the perspective of a possibly confused reader.
|
| 317 |
+
|
| 318 |
+
$Q$ : The motivation of the paper is that methods based on minimax optimization, such as those using kernel-MMD, are difficult to optimize. Since you are using the mean distance (MMD under the linear kernel) for hyper-parameter tuning and early stopping, which is a form of model selection, how are you different from those other methods and why is optimization easy for you?
|
| 319 |
+
|
| 320 |
+
$A$ : Our method is fundamentally different from those other methods based on MMD, and therefore more amenable to optimization in the following two ways: 1) Even though we use the mean distance, which is a form of MMD, we never pose a minimax optimization problem. The model parameters minimize the loss functions of the tasks, which we hope makes the mean distance small (see Figure 3). Model selection using subsection 4.1 also minimizes the mean distance. In our method, all the loss functions, for model parameters and hyper-parameters, work towards the same goal of inducing alignment, so optimization is easier. 2) Even though hyper-parameter tuning and early stopping are a forms of model selection just like training, there is a qualitative difference in the degrees of freedom involved. For subsection 4.1, when performing early stopping for example, optimization amounts to a grid search over the epochs after training is finished, and there is only one degree of freedom.
|
| 321 |
+
|
| 322 |
+
$Q$ : Why is the mean distance suitable for model selection when it comes to hyper-parameter tuning and early stopping, but not regular training?
|
| 323 |
+
|
| 324 |
+
$A$ : Again, we agree that hyper-parameter tuning and early stopping are a forms of model selection. However, unlike model parameters ranging in the hundred of thousands, there are at most a few hyper-parameters and only one parameter for early stopping. Model parameters can easily overfit to the mean distance while those few degrees of freedom we use cannot. This is precisely also the reason why previous works using MMD resort to minimax optimization.
|
| 325 |
+
|
| 326 |
+
# D DETAILS OF THE SIX DATASETS USED FOR OBJECT RECOGNITION
|
| 327 |
+
|
| 328 |
+
1) MNIST (LeCun et al., 1998): greyscale images of handwritten digits 0 to 9; 60,000 samples in the training set and 10,000 in the test set.
|
| 329 |
+
|
| 330 |
+
2) MNIST-M (Ganin et al., 2016): constructed by blending MNIST digits with random color patches from the BSDS500 dataset Arbelaez et al. (2011); same training / test set size as MNIST.
|
| 331 |
+
|
| 332 |
+
3) SVHN (Netzer et al., 2011): colored images of cropped out house numbers from Google Street View; the task is to classify the digit at the center; 73,257 samples in the training set, 26,032 in the test set and 531,131 easier samples for additional training.
|
| 333 |
+
|
| 334 |
+
4) USPS: greyscale images of handwritten digits only slightly different from MNIST; 7291 samples in the training set and 2007 in the test set.
|
| 335 |
+
|
| 336 |
+
5) CIFAR-10 (Krizhevsky & Hinton, 2009): colored images of 10 classes of centered natural scene objects; 50,000 samples in the training set and 10,000 in the test set.
|
| 337 |
+
|
| 338 |
+
6) STL-10 (Coates et al., 2011): colored images of objects only slightly different from CIFAR-10;
|
| 339 |
+
5000 samples in the training set and 8000 in the test set.
|
| 340 |
+
|
| 341 |
+
Because CIFAR-10 and STL-10 differ in one class category, we follow common practice (Shu et al., 2018; French et al., 2017; Ghifary et al., 2016) and delete the offending categories, so each of these two datasets actually only has 9 classes.
|
| 342 |
+
|
| 343 |
+
# E IMPLEMENTATION DETAILS ON THE OBJECT RECOGNITION BENCHMARKS
|
| 344 |
+
|
| 345 |
+
We use a 26-layer pre-activation ResNet (He et al., 2016) as our test-time model $h _ { 0 } ( \phi ( x ) )$ , where $h _ { 0 }$ is the last linear layer that makes the predictions, and $\phi$ is everything before that. For unsupervised domain adaptation, there is no consensus on what base architecture to use among the previous works. Our choice is simply base on the widespread adoption of the ResNet architecture and the ease of implementation. In Table 2 we provide the source only results using our base architecture, and the ones from Shu et al. (2018), our closest competitor. Our source only results are in fact worse than theirs, indicating that our improvements are indeed made through adaptation.
|
| 346 |
+
|
| 347 |
+
At training time, the self-supervised heads $h _ { k } , k = 1 . . . K$ are simply linear layers connected to the end of $\phi$ as discussed in section 4. There is no other modification on the standard ResNet. For all experiments on the object recognition benchmarks, we optimize our model with SGD using weight decay 5e-4 and momentum 0.9, with a batch size of 128. We use an initial learning rate of 0.1 and a two milestone schedule, where the learning rate drops by a factor of 10 at each milestone. All these optimization hyper-parameters are taken directly from the standard literature (He et al., 2016; Huang et al., 2016; Guo et al., 2017) without any modification for our problem setting. We select the total number of epochs and the two milestones based on convergence of the source classifier $h _ { 0 }$ and unsupervised classifiers $h _ { 1 } , . . . , h _ { K }$ . Early stopping is done using the selection heuristic discussed in subsection 4.1. For fair comparison with our baselines, we do not perform data augmentation, following previous works (Hoffman et al., 2017; Sener et al., 2016; Ghifary et al., 2016).
|
| 348 |
+
|
| 349 |
+
# F IMPLEMENTATION DETAILS ON GTA5 CITYSCAPES
|
| 350 |
+
|
| 351 |
+
For our experiments, we initialize our model from the DeepLab-v3 architecture (Chen et al., 2017), pre-trained on ImageNet, as commonly done in the field. Each self-supervised head consists of a global average pooling layer on the pre-logit layer, followed by a single linear layer. To take advantage of the large size of the natural scene images, we use the continuous i.e. regression version of location prediction. The self-supervised head is trained on the square loss, to regress the coordinates (in two dimensions) that the patch is cropped from. Natural for the regression version, instead of cropping from the quadrants like for the classification version on the small datasets, we instead crop out $4 0 0 \times 4 0 0$ patches taken at random from the segmentation scenes. We optimize our model with SGD using a learning rate of 0.007 for 15,000 iterations, with a batch size of 48. Once again, we use the selection heuristic in subsection 4.1 for early-stopping.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Table 4: Qualitative comparison of segmentation results using our method, the baseline, and the ground truth label.
|
| 355 |
+
|
| 356 |
+
# G QUALITATIVE COMPARISON ON GTA5 CITYSCAPES
|
| 357 |
+
|
| 358 |
+
We thank the anonymous Reviewer 3 for suggeting us to add these visualizations. This section shows segmentation results produced before and after adaptation(as shown in Table 4), alongside the original input image and the ground truth label.
|
| 359 |
+
|
| 360 |
+
Qualitatively, from visual inspection of these images, we can see that the quality of produced segmentations improves drastically after adaptation with our method. In particular, we note that location prediction as a self-supervised task helps to prevent nonsensical label configurations, which are often produced by the baseline. For example, the baseline model sometimes predicts “building” or “terrain” for pixels directly in front of a car. These errors are largely corrected for by our proposed adaptation method, leading to more accurate “road” predictions.
|
md/train/SJlKrkSFPH/SJlKrkSFPH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SJx7Jrtgl/SJx7Jrtgl.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP UNSUPERVISED CLUSTERING WITH GAUSSIAN MIXTURE VARIATIONAL AUTOENCODERS
|
| 2 |
+
|
| 3 |
+
Nat Dilokthanakul1,∗, Pedro A. M. Mediano1, Marta Garnelo1, Matthew C. H. Lee1, Hugh Salimbeni1, Kai Arulkumaran2 & Murray Shanahan1
|
| 4 |
+
|
| 5 |
+
1Department of Computing, 2Department of Bioengineering
|
| 6 |
+
Imperial College London
|
| 7 |
+
London, UK
|
| 8 |
+
$^ { * } \mathrm { n }$ .dilokthanakul14@imperial.ac.uk
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
We study a variant of the variational autoencoder model (VAE) with a Gaussian mixture as a prior distribution, with the goal of performing unsupervised clustering through deep generative models. We observe that the known problem of over-regularisation that has been shown to arise in regular VAEs also manifests itself in our model and leads to cluster degeneracy. We show that a heuristic called minimum information constraint that has been shown to mitigate this effect in VAEs can also be applied to improve unsupervised clustering performance with our model. Furthermore we analyse the effect of this heuristic and provide an intuition of the various processes with the help of visualizations. Finally, we demonstrate the performance of our model on synthetic data, MNIST and SVHN, showing that the obtained clusters are distinct, interpretable and result in achieving competitive performance on unsupervised clustering to the state-of-the-art results.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Unsupervised clustering remains a fundamental challenge in machine learning research. While longestablished methods such as $k$ -means and Gaussian mixture models (GMMs) (Bishop, 2006) still lie at the core of numerous applications (Aggarwal & Reddy, 2013), their similarity measures are limited to local relations in the data space and are thus unable to capture hidden, hierarchical dependencies in latent spaces. Alternatively, deep generative models can encode rich latent structures. While they are not often applied directly to unsupervised clustering problems, they can be used for dimensionality reduction, with classical clustering techniques applied to the resulting low-dimensional space (Xie et al., 2015). This is an unsatisfactory approach as the assumptions underlying the dimensionality reduction techniques are generally independent of the assumptions of the clustering techniques.
|
| 17 |
+
|
| 18 |
+
Deep generative models try to estimate the density of observed data under some assumptions about its latent structure, i.e., its hidden causes. They allow us to reason about data in more complex ways than in models trained purely through supervised learning. However, inference in models with complicated latent structures can be difficult. Recent breakthroughs in approximate inference have provided tools for constructing tractable inference algorithms. As a result of combining differentiable models with variational inference, it is possible to scale up inference to datasets of sizes that would not have been possible with earlier inference methods (Rezende et al., 2014). One popular algorithm under this framework is the variational autoencoder (VAE) (Kingma & Welling, 2013; Rezende et al., 2014).
|
| 19 |
+
|
| 20 |
+
In this paper, we propose an algorithm to perform unsupervised clustering within the VAE framework. To do so, we postulate that generative models can be tuned for unsupervised clustering by making the assumption that the observed data is generated from a multimodal prior distribution, and, correspondingly, construct an inference model that can be directly optimised using the reparameterization trick. We also show that the problem of over-regularisation in VAEs can severely effect the performance of clustering, and that it can be mitigated with the minimum information constraint introduced by Kingma et al. (2016).
|
| 21 |
+
|
| 22 |
+
# 1.1 RELATED WORK
|
| 23 |
+
|
| 24 |
+
Unsupervised clustering can be considered a subset of the problem of disentangling latent variables, which aims to find structure in the latent space in an unsupervised manner. Recent efforts have moved towards training models with disentangled latent variables corresponding to different factors of variation in the data. Inspired by the learning pressure in the ventral visual stream, Higgins et al. (2016) were able to extract disentangled features from images by adding a regularisation coefficient to the lower bound of the VAE. As with VAEs, there is also effort going into obtaining disentangled features from generative adversarial networks (GANs) (Goodfellow et al., 2014). This has been recently achieved with InfoGANs (Chen et al., 2016a), where structured latent variables are included as part of the noise vector, and the mutual information between these latent variables and the generator distribution is then maximised as a mini-max game between the two networks. Similarly, Tagger (Greff et al., 2016), which combines iterative amortized grouping and ladder networks, aims to perceptually group objects in images by iteratively denoising its inputs and assigning parts of the reconstruction to different groups. Johnson et al. (2016) introduced a way to combine amortized inference with stochastic variational inference in an algorithm called structured VAEs. Structured VAEs are capable of training deep models with GMM as prior distribution. Shu et al. (2016) introduced a VAE with a multimodal prior where they optimize the variational approximation to the standard variational objective showing its performance in video prediction task.
|
| 25 |
+
|
| 26 |
+
The work that is most closely related to ours is the stacked generative semi-supervised model $( \mathbf { M } 1 { + } \mathbf { M } 2 )$ ) by Kingma et al. (2014). One of the main differences is the fact that their prior distribution is a neural network transformation of both continuous and discrete variables, with Gaussian and categorical priors respectively. The prior for our model, on the other hand, is a neural network transformation of Gaussian variables, which parametrise the means and variances of a mixture of Gaussians, with categorical variables for the mixture components. Crucially, Kingma et al. (2014) apply their model to semi-supervised classification tasks, whereas we focus on unsupervised clustering. Therefore, our inference algorithm is more specific to the latter.
|
| 27 |
+
|
| 28 |
+
We compare our results against several orthogonal state-of-the-art techniques in unsupervised clustering with deep generative models: deep embedded clustering (DEC) (Xie et al., 2015), adversarial autoencoders (AAEs) (Makhzani et al., 2015) and categorial GANs (CatGANs) (Springenberg, 2015).
|
| 29 |
+
|
| 30 |
+
# 2 VARIATIONAL AUTOENCODERS
|
| 31 |
+
|
| 32 |
+
VAEs are the result of combining variational Bayesian methods with the flexibility and scalability provided by neural networks (Kingma & Welling, 2013; Rezende et al., 2014). Using variational inference it is possible to turn intractable inference problems into optimisation problems (Wainwright & Jordan, 2008), and thus expand the set of available tools for inference to include optimisation techniques as well. Despite this, a key limitation of classical variational inference is the need for the likelihood and the prior to be conjugate in order for most problems to be tractably optimised, which in turn can limit the applicability of such algorithms. Variational autoencoders introduce the use of neural networks to output the conditional posterior (Kingma & Welling, 2013) and thus allow the variational inference objective to be tractably optimised via stochastic gradient descent and standard backpropagation. This technique, known as the reparametrisation trick, was proposed to enable backpropagation through continuous stochastic variables. While under normal circumstances backpropagation through stochastic variables would not be possible without Monte Carlo methods, this is bypassed by constructing the latent variables through the combination of a deterministic function and a separate source of noise. We refer the reader to Kingma & Welling (2013) for more details.
|
| 33 |
+
|
| 34 |
+
# 3 GAUSSIAN MIXTURE VARIATIONAL AUTOENCODERS
|
| 35 |
+
|
| 36 |
+
In regular VAEs, the prior over the latent variables is commonly an isotropic Gaussian. This choice of prior causes each dimension of the multivariate Gaussian to be pushed towards learning a separate continuous factor of variation from the data, which can result in learned representations that are structured and disentangled. While this allows for more interpretable latent variables (Higgins et al., 2016), the Gaussian prior is limited because the learnt representation can only be unimodal and does not allow for more complex representations. As a result, numerous extensions to the VAE have been developed, where more complicated latent representations can be learned by specifying increasingly complex priors (Chung et al., 2015; Gregor et al., 2015; Eslami et al., 2016).
|
| 37 |
+
|
| 38 |
+
In this paper we choose a mixture of Gaussians as our prior, as it is an intuitive extension of the unimodal Gaussian prior. If we assume that the observed data is generated from a mixture of Gaussians, inferring the class of a data point is equivalent to inferring which mode of the latent distribution the data point was generated from. While this gives us the possibility to segregate our latent space into distinct classes, inference in this model is non-trivial. It is well known that the reparametrisation trick which is generally used for VAEs cannot be directly applied to discrete variables. Several possibilities for estimating the gradient of discrete variables have been proposed (Glynn, 1990; Titsias & Lazaro-Gredilla, 2015). Graves (2016) also suggested an algorithm for backpropagation through ´ GMMs. Instead, we show that by adjusting the architecture of the standard VAE, our estimator of the variational lower bound of our Gaussian mixture variational autoencoder (GMVAE) can be optimised with standard backpropagation through the reparametrisation trick, thus keeping the inference model simple.
|
| 39 |
+
|
| 40 |
+
# 3.1 GENERATIVE AND RECOGNITION MODELS
|
| 41 |
+
|
| 42 |
+
Consider the generative model $\begin{array} { r } { p _ { \beta , \theta } ( { \pmb y } , { \pmb x } , { \pmb w } , { \pmb z } ) = p ( { \pmb w } ) p ( { \pmb z } ) p _ { \beta } ( { \pmb x } | { \pmb w } , { \pmb z } ) p _ { \theta } ( { \pmb y } | { \pmb x } ) } \end{array}$ , where an observed sample $\pmb { y }$ is generated from a set of latent variables ${ \pmb x } , { \pmb w }$ and $\pmb { z }$ under the following process:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { c } { { \displaystyle \pmb { w } \sim \mathcal { N } ( 0 , I ) } } \\ { { \displaystyle z \sim M u l t ( \pmb { \pi } ) } } \\ { { \displaystyle x | z , \pmb { w } \sim \prod _ { k = 1 } ^ { K } \mathcal { N } \left( \pmb { \mu } _ { z _ { k } } ( \pmb { w } ; \beta ) , d i a g \left( \pmb { \sigma } _ { z _ { k } } ^ { 2 } ( \pmb { w } ; \beta ) \right) \right) ^ { z _ { k } } } } \\ { { \displaystyle y | \pmb { x } \sim \mathcal { N } \left( \pmb { \mu } ( \pmb { x } ; \theta ) , d i a g \left( \pmb { \sigma } ^ { 2 } ( \pmb { x } ; \theta ) \right) \right) \ \mathrm { o r } \ \mathcal { B } ( \pmb { \mu } ( \pmb { x } ; \theta ) ) \ . } } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $K$ is a predefined number of components in the mixture, and $\pmb { \mu } _ { z _ { k } } ( \cdot ; \beta ) , \pmb { \sigma } _ { z _ { k } } ^ { 2 } ( \cdot ; \beta ) , \pmb { \mu } ( \cdot ; \theta )$ , and $\sigma ^ { 2 } ( \cdot ; \theta )$ are given by neural networks with parameters $\beta$ and $\theta$ , respectively. That is, the observed sample $\pmb { y }$ is generated from a neural network observation model parametrised by $\theta$ and the continuous latent variable $\pmb { x }$ . Furthermore, the distribution of ${ \pmb x } | { \pmb w }$ is a Gaussian mixture with means and variances specified by another neural network model parametrised by $\beta$ and with input $\pmb { w }$ .
|
| 49 |
+
|
| 50 |
+
More specifically, the neural network parameterised by $\beta$ outputs a set of $K$ means $\pmb { \mu } _ { z _ { k } }$ and $K$ variances $\pmb { \sigma } _ { z _ { k } } ^ { 2 }$ , given $\pmb { w }$ as input. A one-hot vector $\textit { \textbf { z } }$ is sampled from the mixing probability $\pi$ , which chooses one component from the Gaussian mixture. We set the parameter $\pi _ { k } = K ^ { - 1 }$ to make $_ { z }$ uniformly distributed. The generative and variational views of this model are depicted in Fig. 1.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 1: Graphical models for the Gaussian mixture variational autoencoder (GMVAE) showing the generative model (left) and the variational family (right).
|
| 54 |
+
|
| 55 |
+
# 3.2 INFERENCE WITH THE RECOGNITION MODEL
|
| 56 |
+
|
| 57 |
+
The generative model is trained with the variational inference objective, i.e. the log-evidence lower bound (ELBO), which can be written as
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathcal { L } _ { E L B O } = \mathbb { E } _ { q } \left[ \frac { p _ { \beta , \theta } ( \pmb { y } , \pmb { x } , \pmb { w } , z ) } { q ( \pmb { x } , \pmb { w } , z | \pmb { y } ) } \right] .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
We assume the mean-field variational family $q ( { \pmb x } , { \pmb w } , z | { \pmb y } )$ as a proxy to the posterior which factorises as $\begin{array} { r } { q ( { \pmb x } , { \pmb w } , z | { \pmb y } ) = \prod _ { i } q _ { \phi _ { x } } ( { \pmb x } _ { i } | { \pmb y } _ { i } ) q _ { \phi _ { w } } ( { \pmb w } _ { i } | \pmb { \bar { y } } _ { i } ) \tilde { p _ { \beta } } ( z _ { i } | { \pmb x } _ { i } , \pmb w _ { i } ) } \end{array}$ , where $i$ indexes over data points. To simplify further notation, we will drop $i$ and consider one data point at a time. We parametrise each variational factor with the recognition networks $\phi _ { x }$ and $\phi _ { w }$ that output the parameters of the variational distributions and specify their form to be Gaussian posteriors. We derived the $z$ -posterior, $p _ { \beta } ( \pmb { z } | \pmb { x } , \pmb { w } )$ , as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { p _ { \beta } ( z _ { j } = 1 | \pmb { x } , \pmb { w } ) = \frac { p ( z _ { j } = 1 ) p ( \pmb { x } | z _ { j } = 1 , \pmb { w } ) } { \sum _ { k = 1 } ^ { K } p ( z _ { k } = 1 ) p ( \pmb { x } | z _ { j } = 1 , \pmb { w } ) } } \\ { = \frac { \pi _ { j } \mathcal { N } ( \pmb { x } | \mu _ { j } ( \pmb { w } ; \beta ) , \sigma _ { j } ( \pmb { w } ; \beta ) ) } { \sum _ { k = 1 } ^ { K } \pi _ { k } \mathcal { N } ( \pmb { x } | \mu _ { k } ( \pmb { w } ; \beta ) , \sigma _ { k } ( \pmb { w } ; \beta ) ) } . } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
The lower bound can then be written as,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r l } & { \mathcal { L } _ { E L B O } = \mathbb { E } _ { q ( \pmb { x } | \pmb { y } ) } \big [ \log p _ { \theta } ( \pmb { y } | \pmb { x } ) \big ] - \mathbb { E } _ { q ( \pmb { w } | \pmb { y } ) p ( \pmb { z } | \pmb { x } , \pmb { w } ) } \big [ K L \big ( q _ { \phi _ { x } } ( \pmb { x } | \pmb { y } ) | | p _ { \beta } ( \pmb { x } | \pmb { w } , \pmb { z } ) \big ) \big ] } \\ & { \qquad - K L \big ( q _ { \phi _ { w } } ( \pmb { w } | \pmb { y } ) | | p ( \pmb { w } ) \big ) - \mathbb { E } _ { q ( \pmb { x } | \pmb { y } ) q ( \pmb { w } | \pmb { y } ) } \big [ K L \big ( p _ { \beta } ( \pmb { z } | \pmb { x } , \pmb { w } ) | | p ( \pmb { z } ) \big ) \big ] . } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
We refer to the terms in the lower bound as the reconstruction term, conditional prior term, $w$ -prior term and $z$ -prior term respectively.
|
| 76 |
+
|
| 77 |
+
# 3.2.1 THE CONDITIONAL PRIOR TERM
|
| 78 |
+
|
| 79 |
+
The reconstruction term can be estimated by drawing Monte Carlo samples from $q ( { \pmb x } | { \pmb y } )$ , where the gradient can be backpropagated with the standard reparameterisation trick (Kingma & Welling, 2013). The $w$ -prior term can be calculated analytically.
|
| 80 |
+
|
| 81 |
+
Importantly, by constructing the model this way, the conditional prior term can be estimated using Eqn. 5 without the need to sample from the discrete distribution $p ( \pmb { z } | \pmb { x } , \pmb { w } )$ .
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { c } { { \displaystyle \mathbb { E } _ { q ( { \pmb w } | { \pmb y } ) p ( { \pmb z } | { \pmb x } , { \pmb w } ) } \Big [ K L \big ( q _ { \phi _ { x } } ( { \pmb x } | { \pmb y } ) | | p _ { \beta } ( { \pmb x } | { \pmb w } , { \pmb z } ) \big ) \Big ] \approx } } \\ { { \displaystyle \frac { 1 } { M } \sum _ { j = 1 } ^ { M } \sum _ { k = 1 } ^ { K } p _ { \beta } ( z _ { k } = 1 | { \pmb x } ^ { ( j ) } , { \pmb w } ^ { ( j ) } ) K L \left( q _ { \phi _ { x } } ( { \pmb x } | { \pmb y } ) | | p _ { \beta } ( { \pmb x } | { \pmb w } ^ { ( j ) } , z _ { k } = 1 ) \right) } } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Since $p _ { \beta } ( \pmb { z } | \pmb { x } , \pmb { w } )$ can be computed for all $\textit { \textbf { z } }$ with one forward pass, the expectation over it can be calculated in a straightforward manner and backpropagated as usual. The expectation over $q _ { \phi _ { w } } ( \pmb { w } | \pmb { y } )$ can be estimated with $M$ Monte Carlo samples and the gradients can be backpropagated via the reparameterisation trick. This method of calculating the expectation is similar to the marginalisation approach of Kingma et al. (2014), with a subtle difference. Kingma et al. (2014) need multiple forward passes to obtain each component of the $z$ -posterior. Our method requires wider output layers of the neural network parameterised by $\beta$ , but only need one forward pass. Both methods scale up linearly with the number of clusters.
|
| 88 |
+
|
| 89 |
+
# 3.3 THE KL COST OF THE DISCRETE LATENT VARIABLE
|
| 90 |
+
|
| 91 |
+
The most unusual term in our ELBO is the $z$ -prior term. The $z$ -posterior calculates the clustering assignment probability directly from the value of $x$ and $w$ , by asking how far $x$ is from each of the cluster positions generated by $w$ . Therefore, the $z$ -prior term can reduce the KL divergence between the $z$ -posterior and the uniform prior by concurrently manipulating the position of the clusters and the encoded point $x$ . Intuitively, it would try to merge the clusters by maximising the overlap between them, and moving the means closer together. This term, similar to other KLregularisation terms, is in tension with the reconstruction term, and is expected to be over-powered as the amount of training data increases.
|
| 92 |
+
|
| 93 |
+
# 3.4 THE OVER-REGULARISATION PROBLEM
|
| 94 |
+
|
| 95 |
+
The possible overpowering effect of the regularisation term on VAE training has been described numerous times in the VAE literature (Bowman et al., 2015; Sønderby et al., 2016; Kingma et al., 2016; Chen et al., 2016b). As a result of the strong influence of the prior, the obtained latent representations are often overly simplified and poorly represent the underlying structure of the data. So far there have been two main approaches to overcome this effect: one solution is to anneal the KL term during training by allowing the reconstruction term to train the autoencoder network before slowly incorporating the regularization from the KL term (Sønderby et al., 2016). The other main approach involves modifying the objective function by setting a cut-off value that removes the effect of the KL term when it is below a certain threshold (Kingma et al., 2016). As we show in the experimental section below, this problem of over-regularisation is also prevalent in the assignment of the GMVAE clusters and manifests itself in large degenerate clusters. While we show that the second approach suggested by Kingma et al. (2016) does indeed alleviate this merging phenomenon, finding solutions to the over-regularization problem remains a challenging open problem.
|
| 96 |
+
|
| 97 |
+
# 4 EXPERIMENTS
|
| 98 |
+
|
| 99 |
+
The main objective of our experiments is not only to evaluate the accuracy of our proposed model, but also to understand the optimisation dynamics involved in the construction of meaningful, differentiated latent representations of the data. This section is divided in three parts:
|
| 100 |
+
|
| 101 |
+
1. We first study the inference process in a low-dimensional synthetic dataset, and focus in particular on how the over-regularisation problem affects the clustering performance of the GMVAE and how to alleviate the problem;
|
| 102 |
+
2. We then evaluate our model on an MNIST unsupervised clustering task; and
|
| 103 |
+
3. We finally show generated images from our model, conditioned on different values of the latent variables, which illustrate that the GMVAE can learn disentangled, interpretable latent representations.
|
| 104 |
+
|
| 105 |
+
Throughout this section we make use of the following datasets:
|
| 106 |
+
|
| 107 |
+
• Synthetic data: We create a synthetic dataset mimicking the presentation of Johnson et al. (2016), which is a 2D dataset with 10,000 data points created from the arcs of 5 circles. MNIST: The standard handwritten digits dataset, composed of $2 8 \mathbf { x } 2 8$ grayscale images and consisting of 60,000 training samples and 10,000 testing samples (LeCun et al., 1998). SVHN: A collection of $3 2 \mathrm { x } 3 2 $ images of house numbers (Netzer et al., 2011). We use the cropped version of the standard and the extra training sets, adding up to a total of approximately 600,000 images.
|
| 108 |
+
|
| 109 |
+
# 4.1 SYNTHETIC DATA
|
| 110 |
+
|
| 111 |
+
We quantify clustering performance by plotting the magnitude of the $z$ -prior term described in Eqn. 6 during training. This quantity can be thought of as a measure of how much different clusters overlap. Since our goal is to achieve meaningful clustering in the latent space, we would expect this quantity to go down as the model learns the separate clusters.
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathcal { L } _ { z } = - \mathbb { E } _ { q ( \pmb { x } | \pmb { y } ) q ( \pmb { w } | \pmb { y } ) } \left[ K L ( p _ { \beta } ( \pmb { z } | \pmb { x } , \pmb { w } ) | | p ( \pmb { z } ) ) \right]
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Empirically, however, we have found this not to be the case. The latent representations that our model converges to merges all classes into the same large cluster instead of representing information about the different clusters, as can be seen in Figs. 2d and 3a. As a result, each data point is equally likely to belong to any of clusters, rendering our latent representations completely uninformative with respect to the class structure.
|
| 118 |
+
|
| 119 |
+
We argue that this phenomenon can be interpreted as the result of over-regularisation by the $z$ -prior term. Given that this quantity is driven up by the optimisation of KL term in the lower bound, it reaches its maximum possible value of zero, as opposed to decreasing with training to ensure encoding of information about the classes. We suspect that the prior has too strong of an influence in the initial training phase and drives the model parameters into a poor local optimum that is hard to be driven out off by the reconstruction term later on.
|
| 120 |
+
|
| 121 |
+
This observation is conceptually very similar to the over-regularisation problem encountered in regular VAEs and we thus hypothesize that applying similar heuristics should help alleviate the problem. We show in Fig. 2f that by using the previously mentioned modification to the lower-bound proposed by Kingma et al. (2016), we can avoid the over-regularisation caused by the $z$ -prior. This is achieved by maintaining the cost from the $z$ -prior at a constant value $\lambda$ until it exceeds that threshold. Formally, the modified $z$ -prior term is written as:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r } { \mathcal { L } _ { z } ^ { \prime } = - \operatorname* { m a x } \bigr ( \lambda , \mathbb { E } _ { q ( \pmb { x } | \pmb { y } ) q ( \pmb { w } | \pmb { y } ) } \left[ K L \big ( p _ { \beta } \big ( z | \pmb { x } , \pmb { w } \big ) | | p ( \pmb { z } ) \big ) \right] \bigr ) } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
This modification suppresses the initial effect of the $z$ -prior to merge all clusters thus allowing them to spread out until the cost from the $z$ -prior cost is high enough. At that point its effect is significantly reduced and is mostly limited to merging individual clusters that are overlapping sufficiently. This can be seen clearly in Figs. 2e and 2f. The former shows the clusters before the $z$ -prior cost is taken into consideration, and as such the clusters have been able to spread out. Once the $z$ -prior is activated, clusters that are very close together will be merged as seen in Fig. 2f.
|
| 128 |
+
|
| 129 |
+
Finally, in order to illustrate the benefits of using neural networks for the transformation of the distributions, we compare the density observed by our model (Fig. 2c) with a regular GMM (Fig. 2c) in data space. As illustrated by the figures, the GMVAE allows for a much richer, and thus more accurate representations than regular GMMs, and is therefore more successful at modelling nonGaussian data.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 2: Visualisation of the synthetic dataset: (a) Data is distributed with 5 modes on the 2 dimensional data space. (b) GMVAE learns the density model that can model data using a mixture of non-Gaussian distributions in the data space. (c) GMM cannot represent the data as well because of the restrictive Gaussian assumption. (d) GMVAE, however, suffers from over-regularisation and can result in poor minima when looking at the latent space. (e) Using the modification to the ELBO (Kingma et al., 2016) allows the clusters to spread out. (f) As the model converges the $z$ -prior term is activated and regularises the clusters in the final stage by merging excessive clusters.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: Plot of $z$ -prior term: (a) Without information constraint, GMVAE suffers from overregularisation as it converges to a poor optimum that merges all clusters together to avoid the KL cost. (b) Before reaching the threshold value (dotted line), the gradient from the $z$ -prior term can be turned off to avoid the clusters from being pulled together (see text for details). By the time the threshold value is reached, the clusters are sufficiently separated. At this point the activated gradient from the $z$ -prior term only merges very overlapping clusters together. Even after activating its gradient the value of the $z$ -prior continues to decrease as it is over-powered by other terms that lead to meaningful clusters and better optimum.
|
| 136 |
+
|
| 137 |
+
# 4.2 UNSUPERVISED IMAGE CLUSTERING
|
| 138 |
+
|
| 139 |
+
We now assess the model’s ability to represent discrete information present in the data on an image clustering task. We train a GMVAE on the MNIST training dataset and evaluate its clustering performance on the test dataset. To compare the cluster assignments given by the GMVAE with the true image labels we follow the evaluation protocol of Makhzani et al. (2015), which we summarise here for clarity. In this method, we find the element of the test set with the highest probability of belonging to cluster $i$ and assign that label to all other test samples belonging to $i$ . This is then repeated for all clusters $i = 1 , . . . , K$ , and the assigned labels are compared with the true labels to obtain an unsupervised classification error rate.
|
| 140 |
+
|
| 141 |
+
While we observe the cluster degeneracy problem when training the GMVAE on the synthetic dataset, the problem does not arise with the MNIST dataset. We thus optimise the GMVAE using the ELBO directly, without the need for any modifications. A summary of the results obtained on the MNIST benchmark with the GMVAE as well as other recent methods is shown in Table 1. We achieve classification scores that are competitive with the state-of-the-art techniques1, except for adversarial autoencoders (AAE). We suspect the reason for this is, again, related to the KL terms in the VAE’s objective. As indicated by Hoffman et al., the key difference in the adversarial autoencoders objective is the replacement of the KL term in the ELBO by an adversarial loss that allows the latent space to be manipulated more carefully (Hoffman & Johnson, 2016). Details of the network architecture used in these experiments can be found in Appendix A.
|
| 142 |
+
|
| 143 |
+
Empirically, we observe that increasing the number of Monte Carlo samples and the number of clusters makes the GMVAE more robust to initialisation and more stable as shown in Fig. 4. If fewer samples or clusters are used then the GMVAE can occasionally converge faster to poor local minima, missing some of the modes of the data distribution.
|
| 144 |
+
|
| 145 |
+
Table 1: Unsupervised classification accuracy for MNIST with different numbers of clusters (K) (reported as percentage of correct labels)
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Method</td><td>K</td><td>Best Run</td><td>Average Run</td></tr><tr><td>CatGAN (Springenberg,2015)</td><td>20</td><td>90.30</td><td></td></tr><tr><td>AAE (Makhzani et al., 2015)</td><td>16</td><td>=</td><td>90.45 ± 2.05</td></tr><tr><td>AAE (Makhzani et al., 2015)</td><td>30</td><td></td><td>95.90 ± 1.13</td></tr><tr><td>DEC (Xie et al., 2015)</td><td>10</td><td>84.30</td><td>=</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>GMVAE (M= 1)</td><td>10</td><td>87.31</td><td>77.78 ± 5.75</td></tr><tr><td>GMVAE (M= 10)</td><td>10</td><td>88.54</td><td>82.31 ± 3.75</td></tr><tr><td>GMVAE (M= 1)</td><td>16</td><td>89.01</td><td>85.09 ± 1.99</td></tr><tr><td>GMVAE (M= 10)</td><td>16</td><td>96.92</td><td>87.82 ± 5.33</td></tr><tr><td>GMVAE (M= 1)</td><td>30</td><td>95.84</td><td>92.77 ± 1.60</td></tr><tr><td>GMVAE (M= 10)</td><td>30</td><td>93.22</td><td>89.27 ± 2.50</td></tr></table>
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Clustering Accuracy with different numbers of clusters $\mathbf { \eta } ^ { ( \mathbf { K } ) }$ and Monte Carlo samples $\mathbf { ( M ) } \colon$ After only few epochs, the GMVAE converges to a solution. Increasing the number of clusters improves the quality of the solution considerably.
|
| 151 |
+
|
| 152 |
+
# 4.2.1 IMAGE GENERATION
|
| 153 |
+
|
| 154 |
+
So far we have argued that the GMVAE picks up natural clusters in the dataset, and that these clusters share some structure with the actual classes of the images. Now we train the GMVAE with $K = 1 0$ on MNIST to show that the learnt components in the distribution of the latent space actually represent meaningful properties of the data. First, we note that there are two sources of stochasticity in play when sampling from the GMVAE, namely
|
| 155 |
+
|
| 156 |
+
1. Sampling $\pmb { w }$ from its prior, which will generate the means and variances of $\pmb { x }$ through a neural network $\beta$ ; and
|
| 157 |
+
2. Sampling $\pmb { x }$ from the Gaussian mixture determined by $\pmb { w }$ and $_ { z }$ , which will generate the image through a neural network $\theta$ .
|
| 158 |
+
|
| 159 |
+
In Fig. 5a we explore the latter option by setting ${ \pmb w } = 0$ and sampling multiple times from the resulting Gaussian mixture. Each row in Fig. 5a corresponds to samples from a different component of the Gaussian mixture, and it can be clearly seen that samples from the same component consistently result in images from the same class of digit. This confirms that the learned latent representation contains well differentiated clusters, and exactly one per digit. Additionally, in Fig. 5b we explore the sensitivity of the generated image to the Gaussian mixture components by smoothly varying $\pmb { w }$ and sampling from the same component. We see that while $\textit { \textbf { z } }$ reliably controls the class of the generated image, $\pmb { w }$ sets the “style” of the digit.
|
| 160 |
+
|
| 161 |
+
Finally, in Fig. 6 we show images sampled from a GMVAE trained on SVHN, showing that the GMVAE clusters visually similar images together.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 5: Generated MNIST samples: (a) Each row contains 10 randomly generated samples from different Gaussian components of the Gaussian mixture. The GMVAE learns a meaningful generative model where the discrete latent variables $z$ correspond directly to the digit values in an unsupervised manner. (b) Samples generated by traversing around $w$ space, each position of $w$ correspond to a specific style of the digit.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 6: Generated SVHN samples: Each row corresponds to 10 samples generated randomly from different Gaussian components. GMVAE groups together images that are visually similar.
|
| 168 |
+
|
| 169 |
+
# 5 CONCLUSION
|
| 170 |
+
|
| 171 |
+
We have introduced a class of variational autoencoders in which one level of the latent encoding space has the form of a Gaussian mixture model, and specified a generative process that allows us to formulate a variational Bayes optimisation objective. We then discuss the problem of overregularisation in VAEs. In the context of our model, we show that this problem manifests itself in the form of cluster degeneracy. Crucially, we show that this specific manifestation of the problem can be solved with standard heuristics.
|
| 172 |
+
|
| 173 |
+
We evaluate our model on unsupervised clustering tasks using popular datasets and achieving competitive results compared to the current state of the art. Finally, we show via sampling from the generative model that the learned clusters in the latent representation correspond to meaningful features of the visible data. Images generated from the same cluster in latent space share relevant high-level features (e.g. correspond to the same MNIST digit) while being trained in an entirely unsupervised manner.
|
| 174 |
+
|
| 175 |
+
It is worth noting that GMVAEs can be stacked by allowing the prior on $w$ to be a Gaussian mixture distribution as well. A deep GMVAE could scale much better with number of clusters given that it would be combinatorial with regards to both number of layers and number of clusters per layer. As such, while future research on deep GMVAEs for hierarchical clustering is a possibility, it is crucial to also address the enduring optimisation challenges associated with VAEs in order to do so.
|
| 176 |
+
|
| 177 |
+
# ACKNOWLEDGMENTS
|
| 178 |
+
|
| 179 |
+
We would like to acknowledge the NVIDIA Corporation for the donation of a GeForce GTX Titan Z used in our experiments. We would like to thank Jason Rolfe, Rui Shu and the reviewers for useful comments. Importantly, we would also like to acknowledge that the variational family which we used throughout this version of the paper was suggested by an anonymous reviewer.
|
| 180 |
+
|
| 181 |
+
# REFERENCES
|
| 182 |
+
|
| 183 |
+
Charu C Aggarwal and Chandan K Reddy. Data clustering: algorithms and applications. CRC Press, 2013.
|
| 184 |
+
|
| 185 |
+
Christopher M Bishop. Pattern recognition and machine learning. 2006.
|
| 186 |
+
|
| 187 |
+
Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.
|
| 188 |
+
|
| 189 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. arXiv preprint arXiv:1606.03657, 2016a.
|
| 190 |
+
|
| 191 |
+
Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016b.
|
| 192 |
+
|
| 193 |
+
J. Chung, K. Kastner, L. Dinh, K. Goel, A. Courville, and Y. Bengio. A Recurrent Latent Variable Model for Sequential Data. ArXiv e-prints, June 2015.
|
| 194 |
+
|
| 195 |
+
SM Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, Koray Kavukcuoglu, and Geoffrey E Hinton. Attend, infer, repeat: Fast scene understanding with generative models. arXiv preprint arXiv:1603.08575, 2016.
|
| 196 |
+
|
| 197 |
+
PW Glynn. Likelihood ratio gradient estimation for stochastic systems. Communications of the ACM, 33(10):75–84, 1990.
|
| 198 |
+
|
| 199 |
+
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.
|
| 200 |
+
|
| 201 |
+
Alex Graves. Stochastic backpropagation through mixture density distributions. arXiv preprint arXiv:1607.05690, 2016.
|
| 202 |
+
|
| 203 |
+
Klaus Greff, Antti Rasmus, Mathias Berglund, Tele Hotloo Hao, Jurgen Schmidhuber, and Harri ¨ Valpola. Tagger: Deep unsupervised perceptual grouping. arXiv preprint arXiv:1606.06724, 2016.
|
| 204 |
+
|
| 205 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In Proceedings of The 32nd International Conference on Machine Learning, pp. 1462–1471, 2015.
|
| 206 |
+
|
| 207 |
+
I. Higgins, L. Matthey, X. Glorot, A. Pal, B. Uria, C. Blundell, S. Mohamed, and A. Lerchner. Early Visual Concept Learning with Unsupervised Deep Learning. ArXiv e-prints, June 2016.
|
| 208 |
+
|
| 209 |
+
Matthew D. Hoffman and Matthew J. Johnson. Elbo surgery: yet another way to carve up the variational evidence lower bound. Workshop in Advances in Approximate Bayesian Inference, NIPS, 2016.
|
| 210 |
+
|
| 211 |
+
Matthew J Johnson, David Duvenaud, Alexander B Wiltschko, Sandeep R Datta, and Ryan P Adams. Composing graphical models with neural networks for structured representations and fast inference. arXiv preprint arXiv:1603.06277, 2016.
|
| 212 |
+
|
| 213 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 214 |
+
|
| 215 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 216 |
+
|
| 217 |
+
Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in Neural Information Processing Systems, pp. 3581–3589, 2014.
|
| 218 |
+
|
| 219 |
+
Diederik P Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. arXiv preprint arXiv:1606.04934, 2016.
|
| 220 |
+
|
| 221 |
+
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.
|
| 222 |
+
|
| 223 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, and Ian Goodfellow. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 224 |
+
|
| 225 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 226 |
+
|
| 227 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 228 |
+
|
| 229 |
+
R. Shu, J. Brofos, F. Zhang, M. Ghavamzadeh, H. Bui, and M. Kochenderfer. Stochastic video prediction with conditional density estimation. In European Conference on Computer Vision (ECCV) Workshop on Action and Anticipation for Visual Learning, 2016.
|
| 230 |
+
|
| 231 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. How to train deep variational autoencoders and probabilistic ladder networks. arXiv preprint arXiv:1602.02282, 2016.
|
| 232 |
+
|
| 233 |
+
Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015.
|
| 234 |
+
|
| 235 |
+
Michalis Titsias and Miguel Lazaro-Gredilla. Local expectation gradients for black box variational ´ inference. In Advances in Neural Information Processing Systems, pp. 2638–2646, 2015.
|
| 236 |
+
|
| 237 |
+
Martin J Wainwright and Michael I Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 1(1-2):1–305, 2008.
|
| 238 |
+
|
| 239 |
+
Junyuan Xie, Ross Girshick, and Ali Farhadi. Unsupervised deep embedding for clustering analysis. arXiv preprint arXiv:1511.06335, 2015.
|
| 240 |
+
|
| 241 |
+
# A NETWORK PARAMETERS
|
| 242 |
+
|
| 243 |
+
For optimisation, we use Adam (Kingma & Ba, 2014) with a learning rate of $1 0 ^ { - 4 }$ and standard hyperparameter values $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ and $\epsilon = 1 0 ^ { - 8 }$ . The model architectures used in our experiments are shown in Tables A.1, A.2 and A.3.
|
| 244 |
+
|
| 245 |
+
Table A.1: Neural network architecture models of $q _ { \phi } ( { \pmb x } , { \pmb w } )$ : The hidden layers are shared between ${ \pmb q } ( { \pmb x } )$ and $q ( { \pmb w } )$ , except the output layer where the neural network is split into 4 output streams, 2 with dimension $N _ { x }$ and the other 2 with dimension $N _ { w }$ . We exponentiate the variance components to keep their value positive. An asterisk $( ^ { * } )$ indicates the use of batch normalization and a ReLU nonlinearity. For convolutional layers, the numbers in parentheses indicate stride-padding.
|
| 246 |
+
|
| 247 |
+
<table><tr><td>Dataset</td><td>Input</td><td>Hidden</td><td> Output</td></tr><tr><td>Synthetic2</td><td></td><td>fc120 ReLU120 ReLU</td><td>Nω = 2,Nω =2(Exp), Nx =2,Nx =2 (Exp)</td></tr><tr><td>MNIST</td><td>28x28</td><td>conv 16x6x6*(1-0) 32x6x6* (1-0) 64x4x4* (2-1) 500*</td><td>Nw = 150, Nω = 150 (Exp), Nx = 200,Nx = 200 (Exp)</td></tr><tr><td>SVHN</td><td>32x32</td><td>conv 64x4x4* (2-1) 128x4x4* (2-1) 246x4x4* (2-1) 500*</td><td>Nω = 150,Nω = 150 (Exp), Nx = 200,Nx = 200 (Exp)</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Table A.2: Neural network architecture models of $p _ { \beta } ( \pmb { x } | \pmb { w } , z )$ : The output layers are split into $2 K$ streams of output, where $K$ streams return mean values and the other $K$ streams output variances of all the clusters.
|
| 250 |
+
|
| 251 |
+
<table><tr><td>Dataset</td><td>Input</td><td>Hidden</td><td>Output</td></tr><tr><td>Synthetic</td><td>2</td><td>fc 120 Tanh</td><td>{Nx=2}2K</td></tr><tr><td>MNIST</td><td>150</td><td>fc 500 Tanh</td><td>{Nx = 200}2K</td></tr><tr><td>SVHN</td><td>150</td><td>fc 500 Tanh</td><td>{Nx = 200}2K</td></tr></table>
|
| 252 |
+
|
| 253 |
+
Table A.3: Neural network architecture models of $p _ { \boldsymbol { \theta } } ( \pmb { y } | \pmb { x } )$ : The network outputs are Gaussian parameters for the synthetic dataset and Bernoulli parameters for MNIST and SVHN, where we use the logistic function to keep value of Bernoulli parameters between 0 and 1. An asterisk $( ^ { * } )$ indicates the use of batch normalization and a ReLU nonlinearity. For convolutional layers, the numbers in parentheses indicate stride-padding.
|
| 254 |
+
|
| 255 |
+
<table><tr><td>Dataset</td><td>Input</td><td>Hidden</td><td>Output</td></tr><tr><td>Synthetic2</td><td></td><td>fc 120 ReLU120 ReLU</td><td>{22</td></tr><tr><td>MNIST</td><td>200</td><td>500* full-conv 64x4x4* (2-1) 32x6x6* (1-0) 16x6x6* (1-0)</td><td>28x28 (Sigmoid)</td></tr><tr><td>SVHN</td><td>200</td><td>500* full-conv 246x4x4* (2-1) 128x4x4*(2-1) 32x32 (Sigmoid) 64x4x4* (2-1)</td><td></td></tr></table>
|
md/train/SkgHtkrYPH/SkgHtkrYPH.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FAST SPARSE CONVNETS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Historically, the pursuit of efficient inference has been one of the driving forces behind the research into new deep learning architectures and building blocks. Some of the recent examples include: the squeeze-and-excitation module of (Hu et al., 2018), depthwise separable convolutions in Xception (Chollet, 2017), and the inverted bottleneck in MobileNet v2 (Sandler et al., 2018). Notably, in all of these cases, the resulting building blocks enabled not only higher efficiency, but also higher accuracy, and found wide adoption in the field. In this work, we further expand the arsenal of efficient building blocks for neural network architectures; but instead of combining standard primitives (such as convolution), we advocate for the replacement of these dense primitives with their sparse counterparts. While the idea of using sparsity to decrease the parameter count is not new (Mozer & Smolensky, 1989), the conventional wisdom is that this reduction in theoretical FLOPs does not translate into real-world efficiency gains. We aim to correct this misconception by introducing a family of efficient sparse kernels for several hardware platforms, which we plan to open-source for the benefit of the community. Equipped with our efficient implementation of sparse primitives, we show that sparse versions of MobileNet v1 and MobileNet v2 architectures substantially outperform strong dense baselines on the efficiency-accuracy curve. On Snapdragon 835 our sparse networks outperform their dense equivalents by $1 . 1 - 2 . 2 \times$ – equivalent to approximately one entire generation of improvement. We hope that our findings will facilitate wider adoption of sparsity as a tool for creating efficient and accurate deep learning architectures.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Convolutional neural networks (CNNs) have proven to be excellent at solving a diverse range of tasks (Bhandare et al., 2016). Standard network architectures are used in classification, segmentation, object detection and generation tasks (Pan et al., 2019; Long et al., 2015; Zhao et al., 2019). Given their wide utility, there has been significant effort to design efficient architectures that are capable of being run on mobile and other low power devices while still achieving high classification accuracy on benchmarks such as ImageNet (Russakovsky et al., 2015). For example, MobileNets (Howard et al., 2017; Sandler et al., 2018) employ the depthwise separable convolutions introduced in (Sifre & Mallat, 2014) to significantly reduce resource requirements over previous architectures. Inference time and computational complexity in these architectures are dominated by the $1 \times 1$ convolutions, which directly map to matrix-matrix multiplications.
|
| 12 |
+
|
| 13 |
+
Weight sparsity is generally known to lead (Cheng et al., 2017) to theoretically smaller and more computationally efficient (in terms of number of floating-point operations) models, but it is often disregarded as a practical means of accelerating models because of the misconception that sparse operations cannot be fast enough to achieve actual speedups during inference. In this work we introduce fast kernels for Sparse Matrix-Dense Matrix Multiplication (SpMM) specifically targeted at the accceleration of sparse neural networks. The main distinction of our $\mathbf { S p M M }$ kernel from prior art (Nagasaka et al., 2018; Yang et al., 2018) is that we focus on a different point in the design space. While prior work focused on extremely sparse problems (typically ${ > } 9 9 \%$ , found in scientific and graph problems), we target the sparsity range of $\bar { 7 } 0 { - } 9 5 \%$ , more common when inducing weight sparsity in neural networks. As a result our kernels outperform both the Intel MKL (Intel, 2009) and the TACO compiler (Kjolstad et al., 2017).
|
| 14 |
+
|
| 15 |
+
Using these kernels, we demonstrate the effectiveness of weight sparsity across three generations of MobileNet (Howard et al., 2017; Sandler et al., 2018; Tan et al., 2018; Tan & Le, 2019) architectures.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: MobileNet v1 and v2 and EfficientNet models. Sparse models: blue, dense models: red. Sparse models include the cost of storing the location of non-zeros for sparse tensors as a bitmask converted back into parameter count. That is every 32 values in the bitmask contributes one “parameter”.
|
| 19 |
+
|
| 20 |
+
Sparsity leads to an approximately one generation improvement in each architecture, with a sparse EfficientNet significantly more efficient than all previous models. These models represent a new generation of efficient CNNs, which reduces inference times by $1 . 1 - 2 . 2 \times$ , parameter counts by over $2 \times$ and number of floating-point operations (FLOPs) by up to $3 \times$ relative to the previous generations.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
Improvements in convolutional network architectures (Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; He et al., 2016; Huang et al., 2017), as measured by increased classification accuracy on benchmark tasks such as ImageNet (Russakovsky et al., 2015), have generally been concomitant with increases in model parameter counts, FLOPs and memory requirements. Recently this evolution has led to networks found through neural architecture search (Zoph et al., 2017; Real et al., 2019) which can achieve over $82 \%$ top-1 accuracy, but require nearly 25 GFLOPs for one inference.
|
| 25 |
+
|
| 26 |
+
Given these prohibitive inference costs, there have been many lines of work attempting to improve CNN efficiency, which is often defined as one of three metrics:
|
| 27 |
+
|
| 28 |
+
1. Inference speedup on real hardware
|
| 29 |
+
2. Theoretical speedup through FLOPs reduction
|
| 30 |
+
3. Model size reduction
|
| 31 |
+
|
| 32 |
+
These axes are neither parallel nor orthogonal. The effect of (3) and (2) on (1) in particular can be quite complicated and highly varied depending on the hardware in question.
|
| 33 |
+
|
| 34 |
+
The MobileNet family of architectures (Howard et al., 2017; Sandler et al., 2018) has focused on improving efficiency by taking advantage of the depthwise separable convolutions introduced in (Sifre & Mallat, 2014), which can be thought of as a hand-crafted sparsification of full convolutions with a predefined sparse topology, and which are responsible for the parameter efficiency of these architectures. MobileNet v1 (MBv1) used layers of $1 \times 1$ convolutions followed by depthwise convolutions. MobileNet v2 (MBv2) introduced the inverted residual block which consists of a $1 \times 1$ convolution expanding the channel count, a depthwise convolution on the expanded channel count, and then a $1 \times 1$ convolution reducing the parameter count. Across MobileNet architectures, the depthwise convolutions account for only a small fraction of the total FLOPs, parameters, and inference time of these models. In MBv1, they account for less than $2 \%$ of the total FLOPs and in MBv2 less than $3 \%$ .
|
| 35 |
+
|
| 36 |
+
A different line of work attempted to make more efficient CNNs by directly pruning the weights of full convolutional filters accompanied by the necessary inference kernels (Park et al., 2016; Liu et al., 2015). Park et al. (2016) was not able to accelerate $1 \times 1$ convolutions, Liu et al. (2015) did not attempt it. The latter also required generating a new set of kernels for each instance of a model, which is often impractical for deployment. Due to the difficultly of accelerating sparse computation, channel pruning approaches have been preferred (Gordon et al., 2018; Dai et al., 2018; Luo et al., 2017; Louizos et al., 2018; Theis et al., 2018; He et al., 2018). These approaches prune away entire filters leaving the final model dense, and function more as an architecture search over channel counts.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Sparse 1x1 Convolution as SpMM. Left: Unstructured sparsity (or block size 1). Right: Output channel block size of 4
|
| 40 |
+
|
| 41 |
+
Full Neural Architecture Search has also been applied directly to architectures resembling MBv2 resulting in MobileNet v3 (Tan et al., 2018), FBNet (Wu et al., 2019), and EfficientNet (Tan & Le, 2019).
|
| 42 |
+
|
| 43 |
+
Alternatively, factorizations of the $1 \times 1$ convolutions have been considered in ShuffleNet (Zhang et al., 2017) and Learnable Butterfly Factorizations (Dao et al., 2019). ShuffleNet factorizes the weight matrix into a product of a permutation matrix and block diagonal matrix. Butterfly Factorizations factorize the weight matrix into a sequence of permutation matrices and weight matrices with special structure that can represent many common $\bar { O } ( N l o g N )$ transforms such as Fast Fourier Transforms.
|
| 44 |
+
|
| 45 |
+
Work in Text-to-Speech (TTS) (Kalchbrenner et al., 2018) demonstrated that increasing sparsity and concomitant increase in state size in RNN models lead to increased model quality for a given non-zero parameter count. They additionally demonstrated fast block-sparse matrix-vector (SpMV) multiplication routines necessary for RNN inference.
|
| 46 |
+
|
| 47 |
+
# 3 METHODS
|
| 48 |
+
|
| 49 |
+
To understand how to design the most efficient convolutional models, we investigate both how to construct and train sparse MBv1, MBv2 and EfficientNet models and also the performance of our SpMM kernels.
|
| 50 |
+
|
| 51 |
+
# 3.1 SPARSIFYING NETWORKS
|
| 52 |
+
|
| 53 |
+
We train on the ImageNet (Russakovsky et al., 2015) dataset with standard augmentation and report top-1 accuracies on the provided 50k example validation set. To make the networks sparse we use the gradual magnitude pruning technique of (Zhu & Gupta, 2018).
|
| 54 |
+
|
| 55 |
+
We do not prune the first dense convolution at the beginning of all three networks. Its overall contribution to the parameter count, FLOP count, and runtime is small and does not warrant introducing a new sparse operator. Instead, we implement a dense convolutional kernel which takes as input the image in the standard HWC layout and outputs the CHW layout consumed by the sparse operators in the rest of the network. In HWC layout, the values for different channels corresponding to one spatial location are adjacent in memory. In CHW layout, the values of all the spatial locations for one channel are adjacent in memory.
|
| 56 |
+
|
| 57 |
+
We also do not prune the squeeze-excitation (Hu et al., 2018) blocks in EfficientNet as they contribute ${ < } 1 \%$ of the total FLOPs to the dense model. The last fully-connected layer in all models also contributes insignificantly $( < 1 \% )$ to the total FLOP count, but does contribute a significant fraction $( 2 0 - 5 0 \% )$ of total parameters, especially after the rest of the model is pruned. As we are concerned with maximizing top-1 accuracy for a given runtime, we do not prune the final layer in MobileNet v1 and v2 as doing so leads to a small decrease in top-1 accuracy. Standard EfficientNets do not scale the number of filters in the last convolution by the width of the model, however we find that when introducing sparsity it is beneficial to do this; in all sparse EfficientNet models we double the units from 1280 to 2560. We also find that it is possible to make the fully-connected layer sparse without loss of accuracy in EfficientNet, so we do so.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 3: Visualization of the memory reads and writes of our algorithm. In step 1, we load 8 spatial locations simultaneously for each of the non-zero weights in the first row of the weight matrix. We multiply each scalar weight by its corresponding row, accumulate the results, and in the end write them out. Step 2 performs the same calculation for the next output channel. After steps 1 and 2, all values for these spatial locations are in the cache, so future loads in steps 3 and 4 will be fast, despite being random access.
|
| 61 |
+
|
| 62 |
+
# 3.2 KERNEL IMPLEMENTATION
|
| 63 |
+
|
| 64 |
+
A diagram of the $1 \times 1$ convolution as a SpMM is seen in figure 2. Our scheme requires activation tensors be stored in CHW format, in contrast to dense mobile inference libraries (Jacob, 2017; Dukhan et al., 2019; Jacob, 2019) which favor HWC.
|
| 65 |
+
|
| 66 |
+
There are two key insights enabling the high performance of our kernels:
|
| 67 |
+
|
| 68 |
+
1. While the weight matrix is sparse, the activation matrix is dense. This means that we can perform vector loads from the activation matrix and process multiple spatial locations simultaneously. 2. By processing the matrix in the right order we can keep values that will be randomly accessed in the L1 cache, from which random access is fast and constant time.
|
| 69 |
+
|
| 70 |
+
Figure 3 shows the memory read and write patterns of a few steps of the kernel. The figure shows 8 elements being processed together but other values are possible and we also implement 4 and 16. The outer loop is over columns and the inner loop is over rows; this allows each strip of 4, 8 or 16 spatial locations in the activations to remain in the L1 cache until it is no longer needed. In figure 3 steps 1 and 2 prime the cache, while subsequent steps 3 and 4 load all right hand side values from the L1 cache.
|
| 71 |
+
|
| 72 |
+
In addition to the vectorization in the $H W$ dimension, taking advantage of small amounts of structure in the weight matrix can offer significant performance boosts by increasing data reuse after values are loaded into registers. Constraining the sparsity pattern so that multiple output or input channels all share the same zero/non-zero pattern creates ‘blocks’ in the weight matrix (see figure 3 right). Blocks in the output channel dimension allow for more data reuse than blocks in the input channel dimension. Experiments (see figure 6) show that either choice has the same effect on accuracy, so we implement output channel blocking with sizes of 2 and 4. Our nomenclature for kernels is to give their spatial vectorization width followed by the output channel block size $- 1 6 \times 2$ means 16 pixels and 2 output channels are processed in the inner loop.
|
| 73 |
+
|
| 74 |
+
We implement the ARM kernels in C with NEON intrinsics unlike current production libraries (Jacob, 2017; Dukhan et al., 2019; Jacob, 2019) which rely on expert-optimized assembly. As reference, the code for the $4 \times 1$ inner loop is available in appendix A.
|
| 75 |
+
|
| 76 |
+
# 3.3 LIBRARY
|
| 77 |
+
|
| 78 |
+
We provide a library that can run sparse models trained with the model pruning library in TensorFlow (Abadi et al., 2015). This includes conversion from a dense representation to a Block Compressed Sparse Row (BCSR)-like representation suitable for inference. In addition to the high performance $1 \times 1$ convolutions, we also provide all supporting CHW kernels – depthwise convolutions, global average pooling and a $3 \times 3$ stride-2 dense convolution – necessary for running all three generations of models. While we provide high performance versions of these kernels, we do not detail them here. They are included in end-to-end measurements.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 4: FLOPs with increasing layer depth. All measurements taken on a Snapdragon (SD) 835.
|
| 82 |
+
|
| 83 |
+
# 4 RESULTS
|
| 84 |
+
|
| 85 |
+
In the main text we mainly include results for MBv1 and MBv2 due to space limitations. EfficientNets generally follow the same trends as MBv2 models, plots for EfficientNet can be found in appendix C.
|
| 86 |
+
|
| 87 |
+
First we reveal performance results for our SpMM kernels, then we show how the networks respond to sparsity and then finally we combine this information to find the models with the lowest inference time.
|
| 88 |
+
|
| 89 |
+
# 4.1 ARM KERNEL PERFORMANCE
|
| 90 |
+
|
| 91 |
+
We use Ruy (Jacob, 2019), the current TensorFlow Lite ARM64 backend written largely in handcoded assembly, as the dense baseline. For a sparse baseline we use the kernel generated by the TACO compiler (Kjolstad et al., 2017). We present results by plotting the FLOPs achieved at each layer in the model, with increasing depth to the right in figure 4. For MBv1 we use a width multiplier of 1.4 and $90 \%$ sparse and for MBV2 we use a width multiplier of 1.4 and $80 \%$ sparse as these configurations approximately match the top-1 accuracy of the width 1 dense models. The kernel variants that process 16 spatial locations at a time (e.g. $1 6 \times 1$ , etc.) are the highest performing and all reported numbers are from these kernel variants. TACO only supports unstructured sparsity and should be compared with the $\beth 6 \times \beth$ kernels.
|
| 92 |
+
|
| 93 |
+
The raw performance of the sparse kernels falls in the range of $40 { - } 9 0 \%$ of the dense kernels. And as they must do much less work, when taking the sparsity of the layer into account, the effective FLOPs are in the $2 { - } 7 \times$ range. In MBv1 performance falls significantly in the last two layers of the model when the number of channels (1024) causes the size of one “strip” of spatial locations to exceed the size of the L1 cache. In MBv2 the sawtooth pattern is caused by the alternating expand and contract operations. The performance is higher for the expand kernels due to greater data reuse of each “strip” that is brought into the L1 cache.
|
| 94 |
+
|
| 95 |
+
# 4.2 X86-64 KERNEL PERFORMANCE
|
| 96 |
+
|
| 97 |
+
We implement an AVX-512 version of our scheme with intrinsics to compare with the Intel MKL (Intel, 2009) SpMM. Results are in figure 5. In the majority of layers our scheme outperforms the MKL. The geometric mean speedup over all layers is 1.20 in both MBv1 and MBv2.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 5: FLOPs with increasing layer depth. Measurements taken on an Intel Xeon W-2135.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 6: Effect of block size on top-1 accuracy. It only matters how many elements are in a block, the configuration is unimportant.
|
| 104 |
+
|
| 105 |
+
# 4.3 MODEL PERFORMANCE
|
| 106 |
+
|
| 107 |
+
The hyper-parameters used to train MBv1 and MBv2 are listed in table 2, they were found with a grid search on dense models with a width multiplier of 1.0 to reproduce the original results, which used RMSProp, with SGD with momentum. The same hyper-parameters are used to train sparse models. This change allows us to match or exceed the reported accuracies with only $4 5 \mathrm { k }$ iterations of training.
|
| 108 |
+
|
| 109 |
+
The hyper-parameters used to train EfficientNet are largely unmodified from their code release, with the exception of extending training from 350 to 550 epochs and increasing the learning rate decay exponent to .985 from .97 so that the learning rate decays more slowly. These changes do not improve the dense baseline.
|
| 110 |
+
|
| 111 |
+
We induce sparsity in MBv1 and MBv2 by starting the sparsification process at iteration 7,000 and stopping at 28,000 with a pruning frequency of 2,000. For EfficientNet we start at iteration 23,000 and end at iteration 105,000, also with a pruning frequency of 2,000.
|
| 112 |
+
|
| 113 |
+
We train on the ImageNet (Russakovsky et al., 2015) dataset with standard data augmentation. Top-1 accuracies are reported on the validation set with center single-crops.
|
| 114 |
+
|
| 115 |
+
To understand the effect of block size, we plot in figure 6 accuracy against flops for different block sizes. In these plots, every sparse tensor in the network uses the same output channel block size. The tradeoff for block sparsity only appears to involve how many elements are in each block, and not their configuration. For example, in MBv1, the $1 \times 4$ , $4 \times 1$ and $2 \times 2$ curves all lie on top of one another. The loss in accuracy due to blocking seems to decrease slightly for larger width models.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 7: Effect of sparsity on top-1 accuracy. The sparser a model is, the fewer flops it requires to achieve a given Top-1 accuracy.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 8: The $\mathbf { X }$ -axis corresponds to turning that layer and all following layers to block size 4, the prior layers are unstructured. The y-axis is the efficiency of making this change over an unstructured model given as a ratio where the numerator is the speedup of changing the block(s) from unstructured to block size 4 and the denominator is the decrease in top-1 accuracy that occurs by making this change.
|
| 122 |
+
|
| 123 |
+
To understand how the sparsity level affects the efficiency of the models, we train models at $70 \%$ , $80 \%$ and $90 \%$ unstructured sparsity which is constant throughout the model. The results are plotted in figure 7. MBv1 and MBv2 are more efficient the more sparse they become, confirming that the results of Kalchbrenner et al. (2018) hold not just for RNNs, but also for convolutional models as well.
|
| 124 |
+
|
| 125 |
+
In figure 1 we plot Top-1 accuracy vs. FLOPs for all three generations of sparse and dense models. MobileNet v1 is $90 \%$ sparse, the other models are $80 \%$ sparse. A sparse MBv1 exceeds MBv2 in terms of FLOP and parameter efficiency; a sparse MBv2 matches EfficientNet in terms of FLOP and parameter efficiency; and a sparse EfficientNet exceeds all other models in both categories.
|
| 126 |
+
|
| 127 |
+
# 4.4 MODEL DESIGN
|
| 128 |
+
|
| 129 |
+
To design the models with the best top-1 accuracy vs. inference time frontiers we make the following assumptions to reduce the search space:
|
| 130 |
+
|
| 131 |
+
1. We leave the models themselves unchanged.
|
| 132 |
+
2. We consider only block size 1 and block size 4 variants.
|
| 133 |
+
3. We induce the same level of sparsity in all $1 \times 1$ convolutions.
|
| 134 |
+
|
| 135 |
+
Table 1: All input image sizes are $2 2 4 \mathbf { x } 2 2 4$ . Sparse MBv1 models are $90 \%$ sparse, Sparse MBv2 models are $80 \%$ sparse. In sparse MBv1 models, layer 12 uses a block size of 4. This is almost as efficient as the models in 4.4 and matches the top-1 scores of the dense models more closely. In sparse MBv2 width multiplier 2.0 model, layers 14-16 use block size of 4. In all other MBv2 models, layers 11-16 use a block size of 4.
|
| 136 |
+
|
| 137 |
+
<table><tr><td></td><td>Model</td><td>Width</td><td>Top-1</td><td>Mega-Params</td><td>Time (ms) SD835</td><td>Time (ms) SD670</td></tr><tr><td rowspan="2">MBv1</td><td>Dense</td><td>1.0</td><td>70.9</td><td>4.24</td><td>125</td><td>106</td></tr><tr><td>Sparse</td><td>1.4</td><td>72.0</td><td>2.31</td><td>63</td><td>63</td></tr><tr><td rowspan="2">MBv1</td><td>Dense</td><td>.75</td><td>68.4</td><td>2.59</td><td>73</td><td>64</td></tr><tr><td>Sparse</td><td>1.0</td><td>68.4</td><td>1.48</td><td>33</td><td>34</td></tr><tr><td rowspan="2">MBv1</td><td>Dense</td><td>.5</td><td>63.3</td><td>1.34</td><td>36</td><td>33</td></tr><tr><td>Sparse</td><td>.75</td><td>64.4</td><td>1.29</td><td>21</td><td>20</td></tr><tr><td rowspan="2">MBv2</td><td>Dense</td><td>1.4</td><td>75.0</td><td>6.06</td><td>150</td><td>129</td></tr><tr><td>Sparse</td><td>2.0</td><td>74.9</td><td>4.63</td><td>127</td><td>118</td></tr><tr><td rowspan="2">MBv2</td><td>Dense</td><td>1.0</td><td>71.8</td><td>3.47</td><td>83</td><td>74</td></tr><tr><td>Sparse</td><td>1.4</td><td>72.0</td><td>2.86</td><td>63</td><td>56</td></tr><tr><td rowspan="2">MBv2</td><td>Dense</td><td>.75</td><td>69.8</td><td>2.61</td><td>64</td><td>57</td></tr><tr><td>Sparse</td><td>1.0</td><td>68.6</td><td>1.85</td><td>35</td><td>33</td></tr><tr><td rowspan="2">MBv2</td><td>Dense</td><td>.5</td><td>65.4</td><td>2.61</td><td>33</td><td>30</td></tr><tr><td>Sparse</td><td>.75</td><td>65.2</td><td>1.65</td><td>29</td><td>25</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Then we do a search at width multiplier 1.4 over $N$ models when there are $N$ residual blocks in a model. An $\mathbf { X }$ -axis location of $n$ corresponds to a model in which the first $n$ residual blocks are unstructured and the last $N - n$ residual blocks have an output channel block size of 4. We train each model, note its top-1 accuracy and then measure its inference time. From this we can calculate the ratio of inference time reduction relative to a fully unstructured model and top-1 lost, which are plotted in figure 9. We choose the model with the highest ratio and train models at all widths with this choice. This amounts to making layers 6 and deeper block size 4 in MBv1 models and layers 11 and deeper block size 4 in MBv2.
|
| 140 |
+
|
| 141 |
+
A full Neural Architecture Search (Zoph & Le, 2017; Liu et al., 2019) will likely lead to even more efficient models, but we leave this to future work.
|
| 142 |
+
|
| 143 |
+
Table 1 contains the timings for running our sparse models on a single big core of two different processors, a Snapdragon 835 and a Snapdragon 670. We compare them with MBv1 and MBv2 models from their official repositories (Google, 2018a;b) run on the dense-inference TF Lite framework with the standard Ruy backend.
|
| 144 |
+
|
| 145 |
+
# 5 CONCLUSION
|
| 146 |
+
|
| 147 |
+
We demonstrate that for a constant computational budget, sparse convolutional networks are more accurate than dense ones; this corroborates the findings of Kalchbrenner et al. (2018), which demonstrated that for a set number of floating-point operations, sparse RNNs are more accurate than dense RNNs. We enable the use of weight sparsity to accelerate state-of-the-art convolutional networks by providing fast SpMM kernels along with all necessary supporting kernels for ARM processors. On Snapdragon 835 the sparse networks we present in this paper outperform their dense equivalents by $1 . 1 - 2 . 2 \times$ – equivalent to approximately one entire generation of improvement. By overturning the misconception that “sparsity is slow”, we hope to open new avenues of research that would previously not be considered.
|
| 148 |
+
|
| 149 |
+
# A CODE LISTING
|
| 150 |
+
|
| 151 |
+
We present the code for the $4 \times 1$ kernel here for reference. ARM intrinsics have been renamed for clarity and casts have been removed for brevity.
|
| 152 |
+
|
| 153 |
+
size_t $\mathrm { ~ n ~ } = \mathrm { ~ H W ~ }$ ;
|
| 154 |
+
while $\mathrm { ~ ~ { ~ \langle ~ n ~ \rangle ~ } ~ } ! = \mathrm { ~ ~ { ~ 0 ~ } ~ }$ ) { // Loop over spatial positions float $\star$ w; // Weights, non-zeros are stored consecutively int32_t $\star$ widx_dmap; // Deltas between columns in bytes uint32_t $\star$ nnzmap; // Non-zeros per row size_t k $=$ OutputChannels; do { // Loop over output channels uint32_t nnz $=$ \*nnzmap++; // This next line loads the bias float32x4_t vacc $=$ load_1_f32_value_and_broadcast $( \mathbb { W } ^ { + + } )$ ; while (nnz-- ! $\ : \ 0$ ) { // Loop over non-zero input channels intptr_t diff $=$ \*dmap++; // get delta in bytes and advance float32x4_t vx $=$ load_4_f32_values(x); // Load activations x $+ =$ diff; // advance the activations for the next non-zero float32x4_t vw $=$ load_1_f32_value_and_broadcast $( \mathbb { w } + + )$ ; vacc $=$ multiply_add_4_f32(vacc, vx, vw); // vacc $\begin{array} { r l } { + = } & { { } \nabla \times } \end{array}$ \* vw } store_4_f32_values(y, vacc); y $+ =$ HW; // advance down the output strip } while $\mathrm { ~ ~ \omega ~ } : = \mathrm { ~ ~ 0 ~ }$ ); // Reset pointers for the next strip of spatial locations
|
| 155 |
+
y $- =$ OutputChannels $\star$ HW; y $+ = 4$ ; x $+ = 4$ ; $\mathrm { ~ n ~ \ -- = ~ 4 ~ }$ ;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
# B HYPER PARAMETERS
|
| 159 |
+
|
| 160 |
+
Table 2: Hyper-parameters for MBv1 and MBv2 training. Learning rates are specified in a reduced space and then multiplied by a factor of 16 due to the batch size.
|
| 161 |
+
|
| 162 |
+
<table><tr><td></td><td>MBv1</td><td>MBv2</td></tr><tr><td>learning rate</td><td>.35 *16= 5.6</td><td>.24 *16= 3.84</td></tr><tr><td>momentum</td><td>0.9</td><td>0.92</td></tr><tr><td>12 coefficient</td><td>5e-5</td><td>4e-5</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# C EFFICIENTNET PLOTS
|
| 165 |
+
|
| 166 |
+
Here we present the plots for EfficientNet corresponding to those in the main text for scaling with sparsity and block size. The same trend for block size is observed - the configuration of the blocks isn’t important, only the total size of the block. EfficientNet exhibits less improvement as sparsity increases.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
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 Watten- ´ berg, 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.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 9: (left) EfficientNet scaling with block size. (right) EfficientNet scaling with sparsity.
|
| 174 |
+
|
| 175 |
+
Ashwin Bhandare, Maithili Bhide, Pranav Gokhale, and Rohan Chandavarkar. Applications of convolutional neural networks. International Journal of Computer Science and Information Technologies, 7(5):2206–2215, 2016.
|
| 176 |
+
|
| 177 |
+
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.
|
| 178 |
+
|
| 179 |
+
F. Chollet. Xception: Deep learning with depthwise separable convolutions. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1800–1807, July 2017. doi: 10.1109/CVPR.2017.195.
|
| 180 |
+
|
| 181 |
+
Bin Dai, Chen Zhu, Baining Guo, and David Wipf. Compressing neural networks using the variational information bottleneck. 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. 1135–1144, Stockholmsmssan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/dai18d.html.
|
| 182 |
+
|
| 183 |
+
Tri Dao, Albert Gu, Matthew Eichhorn, Atri Rudra, and Christopher Re. Learning fast algorithms ´ for linear transforms using butterfly factorizations. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pp. 1517–1527, 2019. URL http://proceedings.mlr.press/v97/dao19a.html.
|
| 184 |
+
|
| 185 |
+
Marat Dukhan, Yiming Wu, and Hao Lu. Qnnpack: Open source library for optimized mobile deep learning, 2019. URL https://engineering.fb.com/ml-applications/ qnnpack/.
|
| 186 |
+
|
| 187 |
+
Google, 2018a. URL https://github.com/tensorflow/models/blob/master/ research/slim/nets/mobilenet_v1.md.
|
| 188 |
+
|
| 189 |
+
Google, 2018b. URL https://github.com/tensorflow/models/tree/master/ research/slim/nets/mobilenet.
|
| 190 |
+
|
| 191 |
+
A. Gordon, E. Eban, O. Nachum, B. Chen, H. Wu, T. Yang, and E. Choi. Morphnet: Fast simple resource-constrained structure learning of deep networks. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1586–1595, June 2018. doi: 10.1109/CVPR.2018. 00171.
|
| 192 |
+
|
| 193 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778, 2016.
|
| 194 |
+
|
| 195 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. AMC: automl for model compression and acceleration on mobile devices. In Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part VII, pp. 815–832, 2018.
|
| 196 |
+
|
| 197 |
+
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.
|
| 198 |
+
|
| 199 |
+
J. Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7132–7141, June 2018. doi: 10.1109/CVPR.2018. 00745.
|
| 200 |
+
|
| 201 |
+
G. Huang, Z. Liu, L. v. d. Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2261–2269, July 2017. doi: 10.1109/CVPR.2017.243.
|
| 202 |
+
|
| 203 |
+
Intel. Intel Math Kernel Library. Reference Manual. Intel Corporation, Santa Clara, USA, 2009. ISBN 630813-054US.
|
| 204 |
+
|
| 205 |
+
Benoit Jacob. gemmlowp: a small self-contained low-precision gemm library, 2017. URL https: //github.com/google/gemmlowp.
|
| 206 |
+
|
| 207 |
+
Benoit Jacob. Ruy, 2019. URL https://github.com/tensorflow/tensorflow/ tree/master/tensorflow/lite/experimental/ruy.
|
| 208 |
+
|
| 209 |
+
Nal Kalchbrenner, Erich Elsen, Karen Simonyan, Seb Noury, Norman Casagrande, Edward Lockhart, Florian Stimberg, Aaron van den Oord, Sander Dieleman, and Koray Kavukcuoglu. Efficient ¨ Neural Audio Synthesis. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , pp. 2415–2424, 2018.
|
| 210 |
+
|
| 211 |
+
Fredrik Kjolstad, Shoaib Kamil, Stephen Chou, David Lugato, and Saman Amarasinghe. The tensor algebra compiler. Proceedings of the ACM on Programming Languages, 1(OOPSLA):77, 2017.
|
| 212 |
+
|
| 213 |
+
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. URL http://papers.nips.cc/paper/ 4824-imagenet-classification-with-deep-convolutional-neural-networks. pdf.
|
| 214 |
+
|
| 215 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall F. Tappen, and Marianna Pensky. Sparse convolutional neural networks. 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 806–814, 2015.
|
| 216 |
+
|
| 217 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id ${ . } = { }$ S1eYHoC5FX.
|
| 218 |
+
|
| 219 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3431–3440, 2015.
|
| 220 |
+
|
| 221 |
+
Christos Louizos, Max Welling, and Diederik P. Kingma. Learning sparse neural networks through l0 regularization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } = \underline { { \underline { { \mathbf { \delta \pi } } } } } .$ H1Y8hhg0b.
|
| 222 |
+
|
| 223 |
+
Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A Filter Level Pruning Method for Deep Neural Network Compression. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 5068–5076, 2017.
|
| 224 |
+
|
| 225 |
+
Michael C. Mozer and Paul Smolensky. Using relevance to reduce network size automatically. Connection Science, 1(1):3–16, 1989. doi: 10.1080/09540098908915626. URL https:// doi.org/10.1080/09540098908915626.
|
| 226 |
+
|
| 227 |
+
Yusuke Nagasaka, Satoshi Matsuoka, Ariful Azad, and Aydın Buluc¸. High-performance sparse matrix-matrix products on intel knl and multicore architectures. In Proceedings of the 47th International Conference on Parallel Processing Companion, ICPP ’18, pp. 34:1–34:10, New York, NY, USA, 2018. ACM. ISBN 978-1-4503-6523-9. doi: 10.1145/3229710.3229720. URL http://doi.acm.org/10.1145/3229710.3229720.
|
| 228 |
+
|
| 229 |
+
Z. Pan, W. Yu, X. Yi, A. Khan, F. Yuan, and Y. Zheng. Recent progress on generative adversarial networks (gans): A survey. IEEE Access, 7:36322–36333, 2019. doi: 10.1109/ACCESS.2019. 2905015.
|
| 230 |
+
|
| 231 |
+
Jongsoo Park, Sheng R. Li, Wei Wen, Hai Li, Yiran Chen, and Pradeep Dubey. Holistic sparsecnn: Forging the trident of accuracy, speed, and size. CoRR, abs/1608.01409, 2016. URL http: //arxiv.org/abs/1608.01409.
|
| 232 |
+
|
| 233 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 4780–4789, 2019.
|
| 234 |
+
|
| 235 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li FeiFei. Imagenet large scale visual recognition challenge. Int. J. Comput. Vision, 115(3):211– 252, December 2015. ISSN 0920-5691. doi: 10.1007/s11263-015-0816-y. URL http: //dx.doi.org/10.1007/s11263-015-0816-y.
|
| 236 |
+
|
| 237 |
+
M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4510–4520, June 2018. doi: 10.1109/CVPR.2018.00474.
|
| 238 |
+
|
| 239 |
+
Laurent Sifre and Prof Stephane Mallat. Ecole polytechnique, CMAP phd thesis rigid-motion scattering for image classification, 2014.
|
| 240 |
+
|
| 241 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015.
|
| 242 |
+
|
| 243 |
+
Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. CoRR, abs/1905.11946, 2019. URL http://arxiv.org/abs/1905.11946.
|
| 244 |
+
|
| 245 |
+
Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, and Quoc V. Le. Mnasnet: Platformaware neural architecture search for mobile. CoRR, abs/1807.11626, 2018. URL http:// arxiv.org/abs/1807.11626.
|
| 246 |
+
|
| 247 |
+
Lucas Theis, Iryna Korshunova, Alykhan Tejani, and Ferenc Huszar. Faster gaze prediction with ´ dense networks and Fisher pruning. CoRR, abs/1801.05787, 2018. URL http://arxiv. org/abs/1801.05787.
|
| 248 |
+
|
| 249 |
+
Bichen Wu, Xiaoliang Dai, Peizhao Zhang, Yanghan Wang, Fei Sun, Yiming Wu, Yuandong Tian, Peter Vajda, Yangqing Jia, and Kurt Keutzer. Fbnet: Hardware-aware efficient convnet design via differentiable neural architecture search. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 250 |
+
|
| 251 |
+
Carl Yang, Aydm Buluc, and John D. Owens. Design principles for sparse matrix multiplication on the gpu. International European Conference on Parallel and Distributed Computing - EUROPAR, 8 2018.
|
| 252 |
+
|
| 253 |
+
Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6848–6856, 2017.
|
| 254 |
+
|
| 255 |
+
Zhong-Qiu Zhao, Peng Zheng, Shou-tao Xu, and Xindong Wu. Object detection with deep learning: A review. IEEE transactions on neural networks and learning systems, 2019.
|
| 256 |
+
|
| 257 |
+
Michael Zhu and Suyog Gupta. To Prune, or Not to Prune: Exploring the Efficacy of Pruning for Model Compression. In International Conference on Learning Representations, 2018.
|
| 258 |
+
|
| 259 |
+
Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017. URL https://openreview.net/forum? id $=$ r1Ue8Hcxg.
|
| 260 |
+
|
| 261 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8697–8710, 2017.
|
md/train/SkxKPDv5xl/SkxKPDv5xl.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SAMPLERNN: AN UNCONDITIONAL END-TO-END NEURAL AUDIO GENERATION MODEL
|
| 2 |
+
|
| 3 |
+
Soroush Mehri University of Montreal
|
| 4 |
+
|
| 5 |
+
Kundan Kumar IIT Kanpur
|
| 6 |
+
|
| 7 |
+
Ishaan Gulrajani University of Montreal
|
| 8 |
+
|
| 9 |
+
Rithesh Kumar SSNCE
|
| 10 |
+
|
| 11 |
+
Shubham Jain IIT Kanpur
|
| 12 |
+
|
| 13 |
+
Jose Sotelo University of Montreal
|
| 14 |
+
|
| 15 |
+
Aaron Courville University of Montreal CIFAR Fellow
|
| 16 |
+
|
| 17 |
+
Yoshua Bengio University of Montreal CIFAR Senior Fellow
|
| 18 |
+
|
| 19 |
+
# ABSTRACT
|
| 20 |
+
|
| 21 |
+
In this paper we propose a novel model for unconditional audio generation based on generating one audio sample at a time. We show that our model, which profits from combining memory-less modules, namely autoregressive multilayer perceptrons, and stateful recurrent neural networks in a hierarchical structure is able to capture underlying sources of variations in the temporal sequences over very long time spans, on three datasets of different nature. Human evaluation on the generated samples indicate that our model is preferred over competing models. We also show how each component of the model contributes to the exhibited performance.
|
| 22 |
+
|
| 23 |
+
# 1 INTRODUCTION
|
| 24 |
+
|
| 25 |
+
Audio generation is a challenging task at the core of many problems of interest, such as text-tospeech synthesis, music synthesis and voice conversion. The particular difficulty of audio generation is that there is often a very large discrepancy between the dimensionality of the the raw audio signal and that of the effective semantic-level signal. Consider the task of speech synthesis, where we are typically interested in generating utterances corresponding to full sentences. Even at a relatively low sample rate of 16kHz, on average we will have 6,000 samples per word generated. 1
|
| 26 |
+
|
| 27 |
+
Traditionally, the high-dimensionality of raw audio signal is dealt with by first compressing it into spectral or hand-engineered features and defining the generative model over these features. However, when the generated signal is eventually decompressed into audio waveforms, the sample quality is often degraded and requires extensive domain-expert corrective measures. This results in complicated signal processing pipelines that are to adapt to new tasks or domains. Here we propose a step in the direction of replacing these handcrafted systems.
|
| 28 |
+
|
| 29 |
+
In this work, we investigate the use of recurrent neural networks (RNNs) to model the dependencies in audio data. We believe RNNs are well suited as they have been designed and are suited solutions for these tasks (see Graves (2013), Karpathy (2015), and Siegelmann (1999)). However, in practice it is a known problem of these models to not scale well at such a high temporal resolution as is found when generating acoustic signals one sample at a time, e.g., 16000 times per second. This is one of the reasons that Oord et al. (2016) profits from other neural modules such as one presented by Yu & Koltun (2015) to show extremely good performance.
|
| 30 |
+
|
| 31 |
+
In this paper, an end-to-end unconditional audio synthesis model for raw waveforms is presented while keeping all the computations tractable.2 Since our model has different modules operating at different clock-rates (which is in contrast to WaveNet), we have the flexibility in allocating the amount of computational resources in modeling different levels of abstraction. In particular, we can potentially allocate very limited resource to the module responsible for sample level alignments operating at the clock-rate equivalent to sample-rate of the audio, while allocating more resources in modeling dependencies which vary very slowly in audio, for example identity of phoneme being spoken. This advantage makes our model arbitrarily flexible in handling sequential dependencies at multiple levels of abstraction.
|
| 32 |
+
|
| 33 |
+
Hence, our contribution is threefold:
|
| 34 |
+
|
| 35 |
+
1. We present a novel method that utilizes RNNs at different scales to model longer term dependencies in audio waveforms while training on short sequences which results in memory efficiency during training.
|
| 36 |
+
2. We extensively explore and compare variants of models achieving the above effect.
|
| 37 |
+
3. We study and empirically evaluate the impact of different components of our model on three audio datasets. Human evaluation also has been conducted to test these generative models.
|
| 38 |
+
|
| 39 |
+
# 2 SAMPLERNN MODEL
|
| 40 |
+
|
| 41 |
+
In this paper we propose SampleRNN (shown in Fig. 1), a density model for audio waveforms. SampleRNN models the probability of a sequence of waveform samples $X ~ = ~ \{ x _ { 1 } , x _ { 2 } , \ldots , x _ { T } \}$ (a random variable over input data sequences) as the product of the probabilities of each sample conditioned on all previous samples:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
p ( X ) = \prod _ { i = 0 } ^ { T - 1 } p ( x _ { i + 1 } \vert x _ { 1 } , \dotsc , x _ { i } )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
RNNs are commonly used to model sequential data which can be formulated as:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { c } { h _ { t } = \mathcal { H } ( h _ { t - 1 } , x _ { i = t } ) } \\ { p ( x _ { i + 1 } | x _ { 1 } , \dots , x _ { i } ) = S o f t m a x ( M L P ( h _ { t } ) ) } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
with $\mathcal { H }$ being one of the known memory cells, Gated Recurrent Units (GRUs) (Chung et al., 2014), Long Short Term Memory Units (LSTMs) (Hochreiter & Schmidhuber, 1997), or their deep variations (Section 3). However, raw audio signals are challenging to model because they contain structure at very different scales: correlations exist between neighboring samples as well as between ones thousands of samples apart.
|
| 54 |
+
|
| 55 |
+
SampleRNN helps to address this challenge by using a hierarchy of modules, each operating at a different temporal resolution. The lowest module processes individual samples, and each higher module operates on an increasingly longer timescale and a lower temporal resolution. Each module conditions the module below it, with the lowest module outputting sample-level predictions. The entire hierarchy is trained jointly end-to-end by backpropagation.
|
| 56 |
+
|
| 57 |
+
# 2.1 FRAME-LEVEL MODULES
|
| 58 |
+
|
| 59 |
+
Rather than operating on individual samples, the higher-level modules in SampleRNN operate on non-overlapping frames of $F S ^ { ( k ) }$ (“Frame Size”) samples at the $k ^ { \mathrm { { t h } } }$ level up in the hierarchy at a time (frames denoted by $f ^ { ( k ) }$ ). Each frame-level module is a deep RNN which summarizes the history of its inputs into a conditioning vector for the next module downward.
|
| 60 |
+
|
| 61 |
+
The variable number of frames we condition upon up to timestep $t - 1$ is expressed by a fixed length hidden state or memory $h _ { t } ^ { ( k ) }$ where $t$ is related to clock rate at that tier. The RNN makes a memory update at timestep $t$ as a function of the previous memory $h _ { t - 1 } ^ { ( k ) }$ and an input ${ i n p } _ { t } ^ { ( k ) }$ . This input for top tier $k = K$ is simply the input frame. For intermediate tiers $1 < k < K$ ) this input is a linear combination of conditioning vector from higher tier and current input frame. See Eqs. 4–5.
|
| 62 |
+
|
| 63 |
+
Because different modules operate at different temporal resolutions, we need to upsample each vector $c$ at the output of a module into a series of $r ^ { ( k ) }$ vectors (where $r ^ { ( k ) }$ is the ratio between the temporal resolutions of the modules) before feeding it into the input of the next module downward (Eq. 6). We do this with a set of $r ^ { ( k ) }$ separate linear projections.
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 1: Snapshot of the unrolled model at timestep $i$ with $K = 3$ tiers. As a simplification only one RNN and up-sampling ratio $r = 4$ is used for all tiers.
|
| 67 |
+
|
| 68 |
+
Here we are formalizing the frame-level module in tier $k$ . Note that following equations are exclusive to tier $k$ and timestep $t$ for that specific tier. To increase the readability, unless necessary superscript $( k )$ is not shown for $\bar { t } , i n p ^ { ( k ) } , \bar { W } _ { x } ^ { ( k ) } , h ^ { ( k ) } , \mathcal { H } ^ { ( k ) } , W _ { j } ^ { ( k ) }$ , and $r ^ { ( k ) }$ .
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { c c } { i n p _ { t } = \left\{ \begin{array} { l l } { W _ { x } f _ { t } ^ { ( k ) } + c _ { t } ^ { ( k + 1 ) } ; } & { 1 < k < K } \\ { f _ { t } ^ { ( k = K ) } ; } & { k = K } \end{array} \right. } \\ { h _ { t } = \mathcal { H } ( h _ { t - 1 } , i n p _ { t } ) } \\ { c _ { ( t - 1 ) * r + j } ^ { ( k ) } = W _ { j } h _ { t } ; } & { 1 \leq j \leq r } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Our approach of upsampling with $r ^ { ( k ) }$ linear projections is exactly equivalent to upsampling by adding zeros and then applying a linear convolution. This is sometimes called “perforated” upsampling in the context of convolutional neural networks (CNNs). It was first demonstrated to work well in Dosovitskiy et al. (2016) and is a fairly common upsampling technique.
|
| 75 |
+
|
| 76 |
+
# 2.2 SAMPLE-LEVEL MODULE
|
| 77 |
+
|
| 78 |
+
The lowest module (tier $k = 1$ ; Eqs. 7–9) in the SampleRNN hierarchy outputs a distribution over a sample $x _ { i + 1 }$ , conditioned on the $F S ^ { ( 1 ) }$ preceding samples as well as a vector $c _ { i } ^ { ( k = 2 ) }$ from the next higher module which encodes information about the sequence prior to that frame. As $F S ^ { ( 1 ) }$ is usually a small value and correlations in nearby samples are easy to model by a simple memoryless module, we implement it with a multilayer perceptron (MLP) rather than RNN which slightly speeds up the training. Assuming $e _ { i }$ represents $x _ { i }$ after passing through embedding layer (section 2.2.1), conditional distribution in Eq. 1 can be achieved by following and for further clarity two consecutive sample-level frames are shown. In addition, $W _ { x }$ in Eq. 8 is simply used to linearly combine a frame and conditioning vector from above.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r } { f _ { i - 1 } ^ { ( 1 ) } = f l a t t e n ( \left[ e _ { i - F S ^ { ( 1 ) } } , \dots , e _ { i - 1 } \right] ) } \\ { f _ { i } ^ { ( 1 ) } = f l a t t e n ( \left[ e _ { i - F S ^ { ( 1 ) } + 1 } , \dots , e _ { i } \right] ) } \\ { i n p _ { i } ^ { ( 1 ) } = W _ { x } ^ { ( 1 ) } f _ { i } ^ { ( 1 ) } + c _ { i } ^ { ( 2 ) } \qquad } \\ { p ( x _ { i + 1 } | x _ { 1 } , \dots , x _ { i } ) = S o f t m a x ( M L P ( i n p _ { i } ^ { ( 1 ) } ) ) } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
We use a Softmax because we found that better results were obtained by discretizing the audio signals (also see van den Oord et al. (2016)) and outputting a Multinoulli distribution rather than using a Gaussian or Gaussian mixture to represent the conditional density of the original real-valued signal. When processing an audio sequence, the MLP is convolved over the sequence, processing each window of $F S ^ { ( 1 ) }$ samples and predicting the next sample. At generation time, the MLP is run repeatedly to generate one sample at a time. Table 1 shows a considerable gap between the baseline model RNN and this model, suggesting that the proposed hierarchically structured architecture of SampleRNN makes a big difference.
|
| 85 |
+
|
| 86 |
+
# 2.2.1 OUTPUT QUANTIZATION
|
| 87 |
+
|
| 88 |
+
The sample-level module models its output as a $q$ -way discrete distribution over possible quantized values of $x _ { i }$ (that is, the output layer of the MLP is a $q$ -way Softmax).
|
| 89 |
+
|
| 90 |
+
To demonstrate the importance of a discrete output distribution, we apply the same architecture on real-valued data by replacing the $q$ -way Softmax with a Gaussian Mixture Models (GMM) output distribution. Table 2 shows that our model outperforms an RNN baseline even when both models use real-valued outputs. However, samples from the real-valued model are almost indistinguishable from random noise.
|
| 91 |
+
|
| 92 |
+
In this work we use linear quantization with $q = 2 5 6$ , corresponding to a per-sample bit depth of 8. Unintuitively, we realized that even linearly decreasing the bit depth (resolution of each audio sample) from 16 to 8 can ease the optimization procedure while generated samples still have reasonable quality and are artifact-free.
|
| 93 |
+
|
| 94 |
+
In addition, early on we noticed that the model can achieve better performance and generation quality when we embed the quantized input values before passing them through the sample-level MLP (see Table 4). The embedding steps maps each of the $q$ discrete values to a real-valued vector embedding. However, real-valued raw samples are still used as input to the higher modules.
|
| 95 |
+
|
| 96 |
+
# 2.2.2 CONDITIONALLY INDEPENDENT SAMPLE OUTPUTS
|
| 97 |
+
|
| 98 |
+
To demonstrate the importance of a sample-level autoregressive module, we try replacing it with “Multi-Softmax” (see Table 4), where the prediction of each sample $x _ { i }$ depends only on the conditioning vector $c$ from Eq. 9. In this configuration, the model outputs an entire frame of $F S ^ { ( 1 ) }$ samples at a time, modeling all samples in a frame as conditionally independent of each other. We find that this Multi-Softmax model (which lacks a sample-level autoregressive module) scores significantly worse in terms of log-likelihood and fails to generate convincing samples. This suggests that modeling the joint distribution of the acoustic samples inside each frame is very important in order to obtain good acoustic generation. We found this to be true even when the frame size is reduced, with best results always with a frame size of 1, i.e., generating only one acoustic sample at a time.
|
| 99 |
+
|
| 100 |
+
# 2.3 TRUNCATED BPTT
|
| 101 |
+
|
| 102 |
+
Training recurrent neural networks on long sequences can be very computationally expensive. Oord et al. (2016) avoid this problem by using a stack of dilated convolutions instead of any recurrent connections. However, when they can be trained efficiently, recurrent networks have been shown to be very powerful and expressive sequence models. We enable efficient training of our recurrent model using truncated backpropagation through time, splitting each sequence into short subsequences and propagating gradients only to the beginning of each subsequence. We experiment with different subsequence lengths and demonstrate that we are able to train our networks, which model very long-term dependencies, despite backpropagating through relatively short subsequences.
|
| 103 |
+
|
| 104 |
+
Table 3 shows that by increasing the subsequence length, performance substantially increases alongside with train-time memory usage and convergence time. Yet it is noteworthy that our best models have been trained on subsequences of length 512, which corresponds to 32 milliseconds, a small fraction of the length of a single a phoneme of human speech while generated samples exhibit longer word-like structures.
|
| 105 |
+
|
| 106 |
+
Despite the aforementioned fact, this generative model can mimic the existing long-term structure of the data which results in more natural and coherent samples that is preferred by human listeners. (More on this in Sections 3.2–3.3.) This is due to the fast updates from TBPTT and specialized frame-level modules (Section 2.1) with top tiers designed to model a lower resolution of signal while leaving the process of filling the details to lower tiers.
|
| 107 |
+
|
| 108 |
+
# 3 EXPERIMENTS AND RESULTS
|
| 109 |
+
|
| 110 |
+
In this section we are introducing three datasets which have been chosen to evaluate the proposed architecture for modeling raw acoustic sequences. The description of each dataset and their preprocessing is as follows:
|
| 111 |
+
|
| 112 |
+
Blizzard which is a dataset presented by Prahallad et al. (2013) for speech synthesis task, contains 315 hours of a single female voice actor in English; however, for our experiments we are using only 20.5 hours. The training/validation/test split is $8 6 \% - 7 \% - 7 \%$ .
|
| 113 |
+
|
| 114 |
+
Onomatopoeia3, a relatively small dataset with 6,738 sequences adding up to 3.5 hours, is human vocal sounds like grunting, screaming, panting, heavy breathing, and coughing. Diversity of sound type and the fact that these sounds were recorded from 51 actors and many categories makes it a challenging task. To add to that, this data is extremely unbalanced. The training/validation/test split is $9 2 \% - 4 \% - 4 \%$ .
|
| 115 |
+
|
| 116 |
+
Music dataset is the collection of all 32 Beethoven’s piano sonatas publicly available on https://archive.org/ amounting to 10 hours of non-vocal audio. The training/validation/test split is $8 8 \% - 6 \% - 6 \%$ .
|
| 117 |
+
|
| 118 |
+
See Fig. 2 for a visual demonstration of examples from datasets and generated samples. For all the datasets we are using a $1 6 ~ \mathrm { k H z }$ sample rate and 16 bit depth. For the Blizzard and Music datasets, preprocessing simply amounts to chunking the long audio files into 8 seconds long sequences on which we will perform truncated backpropagation through time. Each sequence in the Onomatopoeia dataset is few seconds long, ranging from 1 to 11 seconds. To train the models on this dataset, zero-padding has been applied to make all the sequences in a mini-batch have the same length and corresponding cost values (for the predictions over the added 0s) would be ignored when computing the gradients.
|
| 119 |
+
|
| 120 |
+
We particularly explored two gated variants of RNNs—GRUs and LSTMs. For the case of LSTMs, the forget gate bias is initialized with a large positive value of 3, as recommended by Zaremba (2015) and Gers (2001), which has been shown to be beneficial for learning long-term dependencies.
|
| 121 |
+
|
| 122 |
+
As for models that take real-valued input, e.g. the RNN-GMM and SampleRNN-GMM (with 4 components), normalization is applied per audio sample with the global mean and standard deviation obtained from the train split. For most of our experiments where the model demands discrete input, binning was applied per audio sample.
|
| 123 |
+
|
| 124 |
+
All the models have been trained with teacher forcing and stochastic gradient decent (mini-batch size 128) to minimize the Negative Log-Likelihood (NLL) in bits per dimension (per audio sample). Gradients were hard-clipped to remain in [-1, 1] range. Update rules from the Adam optimizer (Kingma & Ba, 2014) $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , and $\epsilon = 1 e { - 8 } )$ with an initial learning rate of 0.001 was used to adjust the parameters. For training each model, random search over hyper-parameter values (Bergstra & Bengio, 2012) was conducted. The initial RNN state of all the RNN-based models was always learnable. Weight Normalization (Salimans & Kingma, 2016) has been used for all the linear layers in the model (except for the embedding layer) to accelerate the training procedure. Size of the embedding layer was 256 and initialized by standard normal distribution. Orthogonal weight matrices used for hidden-to-hidden connections and other weight matrices initialized similar to He et al. (2015). In final model, we found GRU to work best (slightly better than LSTM). 1024 was the the number of hidden units for all GRUs (1 layer per tier for 3-tier and 3 layer for 2-tier model) and MLPs (3 fully connected layers with ReLU activation with output dimension being 1024 for first two layers and 256 for the final layer before softmax). Also $F \bar { S } ^ { ( 1 ) } = F S ^ { ( 2 ) } = 2$ and $F S ^ { ( 3 ) } = 8 $ were found to result in lowest NLL.
|
| 125 |
+
|
| 126 |
+
# 3.1 WAVENET RE-IMPLEMENTATION
|
| 127 |
+
|
| 128 |
+
We implemented the WaveNet architecture as described in Oord et al. (2016). Ideally, we would have liked to replicate their model exactly but owing to missing details of architecture and hyperparameters, as well as limited compute power at our disposal, we made our own design choices so that the model would fit on a single GPU while having a receptive field of around 250 milliseconds, while having a reasonable number of updates per unit time. Although our model is very similar to WaveNet, the design choices, e.g. number of convolution filters in each dilated convolution layer, length of target sequence to train on simultaneously (one can train with a single target with all samples in the receptive field as input or with target sequence length of size T with input of size receptive field $+ \mathrm { ~ T ~ } - 1$ ), batch-size, etc. might make our implementation different from what the authors have done in the original WaveNet model. Hence, we note here that although we did our best at exactly reproducing their results, there would very likely be different choice of hyper-parameters between our implementation and the one of the authors.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 2: Examples from the datasets compared to samples from our models. In the first 3 rows, 2 seconds of audio are shown. In the bottom 3 rows, 100 milliseconds of audio are shown. Rows 1 and 4 are ground truth from which one can see how the datasets look different and have complex structure in low resolution which the frame-level component of the SampleRNN is designed to capture. Samples also to some extent mimic the same global structure. At the same time, zoomed-in samples of our model shows that it can perfectly resemble the high resolution structure present in the data as well.
|
| 132 |
+
|
| 133 |
+
Table 1: Test NLL in bits for three presented datasets.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Model</td><td>Blizzard</td><td>Onomatopoeia</td><td>Music</td></tr><tr><td>RNN (Eq.2)</td><td>1.434</td><td>2.034</td><td>1.410</td></tr><tr><td>WaveNet (re-impl.)</td><td>1.480</td><td>2.285</td><td>1.464</td></tr><tr><td>SampleRNN (2-tier)</td><td>1.392</td><td>2.026</td><td>1.076</td></tr><tr><td>SampleRNN (3-tier)</td><td>1.387</td><td>1.990</td><td>1.159</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 2: Average NLL on Blizzard test set for real-valued models.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Model</td><td>Average Test NLL</td></tr><tr><td>RNN-GMM</td><td>-2.415</td></tr><tr><td>SampleRNN-GMM (2-tier)</td><td>-2.782</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 3: Effect of subsequence length on NLL (bits per audio sample) computed on the Blizzard validation set.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Subsequence Length</td><td>32</td><td>64</td><td>128</td><td>256</td><td>512</td></tr><tr><td>NLL Validation</td><td>1.575</td><td>1.468</td><td>1.412</td><td>1.391</td><td>1.364</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Table 4: Test (validation) set NLL (bits per audio sample) for Blizzard. Variants of SampleRNN are provided to compare the contribution of each component in performance.
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Model</td><td>NLL Test (Validation)</td></tr><tr><td>SampleRNN (2-tier)</td><td>1.392 (1.369)</td></tr><tr><td>Without Embedding</td><td>1.566 (1.539)</td></tr><tr><td>Multi-Softmax</td><td>1.685 (1.656)</td></tr></table>
|
| 148 |
+
|
| 149 |
+
For our WaveNet implementation, we have used 4 dilated convolution blocks each having 10 dilated convolution layers with dilation 1, 2, 4, 8 up to 512. Hence, our network has a receptive field of 4092 acoustic samples i.e. the parameters of multinomial distribution of sample at time step t, $p ( x _ { i } ) = f _ { \boldsymbol { \theta } } ( x _ { i - 1 } , \bar { x _ { i - 2 } } , \dots x _ { i - 4 0 9 2 } )$ where $\theta$ is model parameters. We train on target sequence length of 1600 and use batch size of 8. Each dilated convolution filter has size 2 and the number of output channels is 64 for each dilated convolutional layer (128 filters in total due to gated nonlinearity). We trained this model using Adam optimizer with a fixed global learning rate of 0.001 for Blizzard dataset and 0.0001 for Onomatopoeia and Music datasets. We trained these models for about one week on a GeForce GTX TITAN X. We dropped the learning rate in the Blizzard experiment to 0.0001 after around 3 days of training.
|
| 150 |
+
|
| 151 |
+
# 3.2 HUMAN EVALUATION
|
| 152 |
+
|
| 153 |
+
Apart from reporting NLL, we conducted AB preference tests for random samples from four models trained on the Blizzard dataset. For unconditional generation of speech which at best sounds like mumbling, this type of test is the one which is more suited. Competing models were the RNN, SampleRNN (2-tier), SampleRNN (3-tier), and our implementation of WaveNet. The rest of the models were excluded as the quality of samples were definitely lower and also to keep the number of pair comparison tests manageable. We will release the samples that have been used in this test too.
|
| 154 |
+
|
| 155 |
+
All the samples were set to have the same volume. Every user is then shown a set of twenty pairs of samples with one random pair at a time. Each pair had samples from two different models. The human evaluator is asked to listen to the samples and had the option of choosing between the two model or choosing not to prefer any of them. Hence, we have a quantification of preference between every pair of models. We used the online tool made publicly available by Jillings et al. (2015).
|
| 156 |
+
|
| 157 |
+
Results in Fig. 3 clearly points out that SampleRNN (3-tier) is a winner by a huge margin in terms of preference by human raters, then SampleRNN (2-tier) and afterward two other models, which matches with the performance comparison in Table 1.
|
| 158 |
+
|
| 159 |
+
The same evaluation was conducted for Music dataset except for an additional filtering process of samples. Specific to only this dataset, we observed that a batch of generated samples from competing models (this time restricted to RNN, SampleRNN (2-tier), and SampleRNN (3-tier)) were either music-like or random noise. For all these models we only considered random samples that were not random noise. Fig. 4 is dedicated to result of human evaluation on Music dataset.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 3: Pairwise comparison of 4 best models based on the votes from listeners conducted on samples generated from models trained on Blizzard dataset.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 4: Pairwise comparison of 3 best models based on the votes from listeners conducted on samples generated from models trained on Music dataset.
|
| 166 |
+
|
| 167 |
+
# 3.3 QUANTIFYING INFORMATION RETENTION
|
| 168 |
+
|
| 169 |
+
For the last experiment we are interested in measuring the memory span of the model. We trained our model, SampleRNN (3-tier), with best hyper-parameters on a dataset of 2 speakers reading audio books, one male and one female, respectively, with mean fundamental frequency of 125.3 and $2 0 1 . 8 \mathrm { H z }$ . Each speaker has roughly 10 hours of audio in the dataset that has been preprocessed similar to Blizzard. We observed that it learned to stay consistent generating samples from the same speaker without having any knowledge about the speaker ID or any other conditioning information. This effect is more apparent here in comparison to the unbalanced Onomatopoeia that sometimes mixes two different categories of sounds.
|
| 170 |
+
|
| 171 |
+
Another experiment was conducted to test the effect of memory and study the effective memory horizon. We inject 1 second of silence in the middle of sampling procedure in order to see if it will remember to generate from the same speaker or not. Initially when sampling we let the model generate 2 seconds of audio as it normally do. From 2 to 3 seconds instead of feeding back the generated sample at that timestep a silent token (zero amplitude) would be fed. From 3 to 5 seconds again we sample normally; feeding back the generated token.
|
| 172 |
+
|
| 173 |
+
We did classification based on mean fundamental frequency of speakers for the first and last 2 seconds. In $83 \%$ of samples SampleRNN generated from the same person in two separate segments.
|
| 174 |
+
|
| 175 |
+
This is in contrast to a model with fixed past window like WaveNet where injecting 16000 silent tokens (3.3 times the receptive field size) is equivalent to generating from scratch which has $50 \%$ chance (assuming each 2-second segment is coherent and not a mixed sound of two speakers).
|
| 176 |
+
|
| 177 |
+
# 4 RELATED WORK
|
| 178 |
+
|
| 179 |
+
Our work is related to earlier work on auto-regressive multi-layer neural networks, starting with Bengio & Bengio (1999), then NADE (Larochelle & Murray, 2011) and more recently PixelRNN (van den Oord et al., 2016). Similar to how they tractably model joint distribution over units of the data (e.g. words in sentences, pixels in images, etc.) through an auto-regressive decomposition, we transform the joint distribution of acoustic samples using Eq. 1.
|
| 180 |
+
|
| 181 |
+
The idea of having part of the model running at different clock rates is related to multi-scale RNNs (Schmidhuber, 1992; El Hihi & Bengio, 1995; Koutnik et al., 2014; Sordoni et al., 2015; Serban et al., 2016).
|
| 182 |
+
|
| 183 |
+
Chung et al. (2015) also attempt to model raw audio waveforms which is in contrast to traditional approaches which use spectral features as in Tokuda et al. (2013), Bertrand et al. (2008), and Lee et al. (2009).
|
| 184 |
+
|
| 185 |
+
Our work is closely related to WaveNet (Oord et al., 2016), which is why we have made the above comparisons, and makes it interesting to compare the effect of adding higher-level RNN stages working at a low resolution. Similar to this work, our models generate one acoustic sample at a time conditioned on all previously generated samples. We also share the preprocessing step of quantizing the acoustics into bins. Unlike this model, we have different modules in our models running at different clock-rates. In contrast to WaveNets, we mitigate the problem of long-term dependency with hierarchical structure and using stateful RNNs, i.e. we will always propagate hidden states to the next training sequence although the gradient of the loss will not take into account the samples in previous training sequence.
|
| 186 |
+
|
| 187 |
+
# 5 DISCUSSION AND CONCLUSION
|
| 188 |
+
|
| 189 |
+
We propose a novel model that can address unconditional audio generation in the raw acoustic domain, which typically has been done until recently with hand-crafted features. We are able to show that a hierarchy of time scales and frequent updates will help to overcome the problem of modeling extremely high-resolution temporal data. That allows us, for this particular application, to learn the data manifold directly from audio samples. We show that this model can generalize well and generate samples on three datasets that are different in nature. We also show that the samples generated by this model are preferred by human raters.
|
| 190 |
+
|
| 191 |
+
Success in this application, with a general-purpose solution as proposed here, opens up room for more improvement when specific domain knowledge is applied. This method, however, proposed with audio generation application in mind, can easily be adapted to other tasks that require learning the representation of sequential data with high temporal resolution and long-range complex structure.
|
| 192 |
+
|
| 193 |
+
# ACKNOWLEDGMENTS
|
| 194 |
+
|
| 195 |
+
The authors would like to thank Joao Felipe Santos and Kyle Kastner for insightful comments and ˜ discussion. We would like to thank the Theano Development Team $\left( 2 0 1 6 \right) ^ { 4 }$ and MILA staff. We acknowledge the support of the following agencies for research funding and computing support: NSERC, Calcul Quebec, Compute Canada, the Canada Research Chairs and CIFAR. Jose Sotelo ´ also thanks the Consejo Nacional de Ciencia y Tecnolog´ıa (CONACyT) as well as the Secretar´ıa de Educacion P ´ ublica (SEP) for their support. This work was a collaboration with Ubisoft. ´
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Yoshua Bengio and Samy Bengio. Modeling high-dimensional discrete data with multi-layer neural networks. In NIPS, volume 99, pp. 400–406, 1999.
|
| 200 |
+
|
| 201 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13(Feb):281–305, 2012.
|
| 202 |
+
|
| 203 |
+
Alexander Bertrand, Kris Demuynck, Veronique Stouten, et al. Unsupervised learning of auditory filter banks using non-negative matrix factorisation. In 2008 IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 4713–4716. IEEE, 2008.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In Advances in neural information processing systems, pp. 2980–2988, 2015.
|
| 208 |
+
|
| 209 |
+
Alexey Dosovitskiy, Jost Springenberg, Maxim Tatarchenko, and Thomas Brox. Learning to generate chairs, tables and cars with convolutional networks. 2016.
|
| 210 |
+
|
| 211 |
+
Salah El Hihi and Yoshua Bengio. Hierarchical recurrent neural networks for long-term dependencies. In NIPS, volume 400, pp. 409. Citeseer, 1995.
|
| 212 |
+
|
| 213 |
+
Felix Gers. Long short-term memory in recurrent neural networks. PhD thesis, Universitat Han- ¨ nover, 2001.
|
| 214 |
+
|
| 215 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
|
| 216 |
+
|
| 217 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1026–1034, 2015.
|
| 218 |
+
|
| 219 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 220 |
+
|
| 221 |
+
Nicholas Jillings, David Moffat, Brecht De Man, and Joshua D. Reiss. Web Audio Evaluation Tool: A browser-based listening test environment. In 12th Sound and Music Computing Conference, July 2015.
|
| 222 |
+
|
| 223 |
+
Andrej Karpathy. The unreasonable effectiveness of recurrent neural networks. Andrej Karpathy blog, 2015.
|
| 224 |
+
|
| 225 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 226 |
+
|
| 227 |
+
Jan Koutnik, Klaus Greff, Faustino Gomez, and Juergen Schmidhuber. A clockwork rnn. arXiv preprint arXiv:1402.3511, 2014.
|
| 228 |
+
|
| 229 |
+
Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In AISTATS, volume 1, pp. 2, 2011.
|
| 230 |
+
|
| 231 |
+
Honglak Lee, Peter Pham, Yan Largman, and Andrew Y Ng. Unsupervised feature learning for audio classification using convolutional deep belief networks. In Advances in neural information processing systems, pp. 1096–1104, 2009.
|
| 232 |
+
|
| 233 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 234 |
+
|
| 235 |
+
Kishore Prahallad, Anandaswarup Vadapalli, Naresh Elluru, G Mantena, B Pulugundla, P Bhaskararao, HA Murthy, S King, V Karaiskos, and AW Black. The blizzard challenge 2013– indian language task. In Blizzard Challenge Workshop 2013, 2013.
|
| 236 |
+
|
| 237 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. arXiv preprint arXiv:1602.07868, 2016.
|
| 238 |
+
|
| 239 |
+
Jurgen Schmidhuber. Learning complex, extended sequences using the principle of history com-¨ pression. Neural Computation, 4(2):234–242, 1992.
|
| 240 |
+
|
| 241 |
+
Iulian V Serban, Alessandro Sordoni, Yoshua Bengio, Aaron Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In Proceedings of the 30th AAAI Conference on Artificial Intelligence (AAAI-16), 2016.
|
| 242 |
+
|
| 243 |
+
Hava T Siegelmann. Computation beyond the turing limit. In Neural Networks and Analog Computation, pp. 153–164. Springer, 1999.
|
| 244 |
+
|
| 245 |
+
Alessandro Sordoni, Yoshua Bengio, Hossein Vahabi, Christina Lioma, Jakob Grue Simonsen, and Jian-Yun Nie. A hierarchical recurrent encoder-decoder for generative context-aware query suggestion. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 553–562. ACM, 2015.
|
| 246 |
+
|
| 247 |
+
Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016. URL http://arxiv.org/abs/ 1605.02688.
|
| 248 |
+
|
| 249 |
+
Keiichi Tokuda, Yoshihiko Nankaku, Tomoki Toda, Heiga Zen, Junichi Yamagishi, and Keiichiro Oura. Speech synthesis based on hidden markov models. Proceedings of the IEEE, 101(5): 1234–1252, 2013.
|
| 250 |
+
|
| 251 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016.
|
| 252 |
+
|
| 253 |
+
Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015.
|
| 254 |
+
|
| 255 |
+
Wojciech Zaremba. An empirical exploration of recurrent network architectures. 2015.
|
| 256 |
+
|
| 257 |
+
# APPENDIX A
|
| 258 |
+
|
| 259 |
+
A MODEL VARIANT: SAMPLERNN-WAVENET HYBRID
|
| 260 |
+
|
| 261 |
+
SampleRNN-WaveNet model has two modules operating at two different clock-rate. The slower clock-rate module (frame-level module) sees one frame (each of which has size $F S$ ) at a time while the faster clock-rate component(sample-level component) sees one acoustic sample at a time i.e. the ratio of clock-rates for these two modules would be the size of a single frame. Number of sequential steps for frame-level component would be $F S$ times lower. We repeat the output of each step of frame-level component $F S$ times so that number of time-steps for output of both the components match. The output of both these modules are concatenated for every time-step which is further operated by non-linearities for every time-step independently before generating the final output.
|
| 262 |
+
|
| 263 |
+
In our experiments, we kept size of a single frame $( F S )$ to be 128. We tried two variants of this model: 1. fully convolutional WaveNet and 2. RNN-WaveNet. In fully convolutional WaveNet, both modules described above are implemented using dilated convolutions as described in original WaveNet model. In RNN-WaveNet, we use high capacity RNN in the frame-level module to model the dependency between frames. The sample-level WaveNet in RNN-WaveNet has receptive field of size 509 samples from the past.
|
| 264 |
+
|
| 265 |
+
Although these models are designed with the intention of combining the two models to harness their best features, preliminary experiments show that this variant is not meeting our expectations at the moment which directs us to a possible future work.
|
md/train/Sy1f0e-R-/Sy1f0e-R-.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN EMPIRICAL STUDY ON EVALUATION METRICS OF GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Despite the widespread interest in generative adversarial networks (GANs), few works have studied the metrics that quantitatively evaluate GANs’ performance. In this paper, we revisit several representative sample-based evaluation metrics for GANs, and address the important problem of how to evaluate the evaluation metrics. We start with a few necessary conditions for metrics to produce meaningful scores, such as distinguishing real from generated samples, identifying mode dropping and mode collapsing, and detecting overfitting. Then with a series of carefully designed experiments, we are able to comprehensively investigate existing sample-based metrics and identify their strengths and limitations in practical settings. Based on these results, we observe that kernel Maximum Mean Discrepancy (MMD) and the 1-Nearest-Neighbour (1-NN) two-sample test seem to satisfy most of the desirable properties, provided that the distances between samples are computed in a suitable feature space. Our experiments also unveil interesting properties about the behavior of several popular GAN models, such as whether they are memorizing training samples, and how far these state-of-the-art GANs are from perfect.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative adversarial networks (GANs) (Goodfellow et al., 2014) have been studied extensively in recent years. Besides producing surprisingly plausible images of faces (Radford et al., 2015; Larsen et al., 2015) and bedrooms (Radford et al., 2015; Arjovsky et al., 2017; Gulrajani et al., 2017), they have also been innovatively applied in, for example, semi-supervised learning (Odena, 2016; Makhzani et al., 2015), image-to-image translation (Isola et al., 2016; Zhu et al., 2017), and simulated image refinement (Shrivastava et al., 2016). However, despite the availability of a plethora of GAN models (Arjovsky et al., 2017; Qi, 2017; Radford et al., 2015; Zhao et al., 2016), their evaluation is still predominantly qualitative, very often resorting to manual inspection of the visual fidelity of generated images. Such evaluation is time-consuming, subjective and possibly misleading. Given the inherent limitations of qualitative evaluations, proper quantitative metrics are crucial for the development of GANs to avoid the human factors and guide the design of better models.
|
| 12 |
+
|
| 13 |
+
Possibly the most popular metric is the Inception Score (Salimans et al., 2016), which measures the quality and diversity of the generated images using an external model, the Google Inception network (Szegedy et al., 2014), trained on the large scale ImageNet dataset (Deng et al., 2009). Some other metrics are less widely used but still very valuable. Wu et al. (2016) proposed a sampling method to estimate the log-likelihood of generative models, by assuming a Gaussian observation model with a fixed variance. Bounliphone et al. (2015) propose to use maximum mean discrepancies (MMDs) for model selection in generative models. Lopez-Paz & Oquab (2016) apply the classifier two-sample test, a well-studied tool in statistics, to assess the difference between the generated and target distribution.
|
| 14 |
+
|
| 15 |
+
Although these evaluation metrics are shown to be effective on various tasks, it is unclear in which scenarios their scores are meaningful, and in which other scenarios, prone to misinterpretations. Given that evaluating GANs is already challenging, it can only be more difficult to evaluate the evaluation metrics themselves. Most existing works attempt to justify their proposed metrics by showing a strong correlation with human evaluation (Salimans et al., 2016; Lopez-Paz & Oquab, 2016). However, human evaluation tends to be biased towards the visual quality of generated samples and neglect the overall distributional characteristics, which are arguably just as important for unsupervised learning.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: A schematic layout of the typical approach for sample based GAN evaluation methods.
|
| 19 |
+
|
| 20 |
+
In this paper we comprehensively examine the existing literature on sample-based quantitative evaluation of GANs. We address the challenge of evaluating the metrics themselves by carefully designing a series of experiments, through which we hope to answer the following important questions: 1.) What are reasonable characterizations of the behavior of existing sample-based metrics for GANs? 2.) What are the strengths and limitations of these metrics? 3.) Which metrics are preferred accordingly? 4.) How are the metrics helpful in understanding and improving GANs?
|
| 21 |
+
|
| 22 |
+
Ultimately, we hope that this paper will establish good principles on choosing, applying, interpreting and designing evaluation metrics for GANs in practical settings. We will also release the source code for all experiments and metrics examined, providing the community with off-the-shelf tools to debug and improve their GAN algorithms.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
We briefly review the original GAN framework proposed by Goodfellow et al. (2014). Description of the GAN variants used in our experiments is deferred to the Appendix A.
|
| 27 |
+
|
| 28 |
+
# 2.1 GENERATIVE ADVERSARIAL NETWORKS
|
| 29 |
+
|
| 30 |
+
Let $\mathcal { X } = \mathbb { R } ^ { d \times d }$ be the space of natural images. Given i.i.d. samples $S _ { r } = \{ \mathbf { x } _ { 1 } ^ { r } , \ldots , \mathbf { x } _ { n } ^ { r } \}$ drawn from a real distribution $\mathbb { P } _ { r }$ over $\mathcal { X }$ , we would like to learn a parameterized distribution $\mathbb { P } _ { g }$ that approximates the distribution $\mathbb { P } _ { r }$ .
|
| 31 |
+
|
| 32 |
+
The setup of generative adversarial networks is as follows. We define two networks, the discriminator $D : \mathcal { X } [ 0 , 1 )$ and the generator $G : { \mathcal { Z } } \to { \mathcal { X } }$ , where $\mathcal { Z }$ is some latent space. Given a distribution $\mathbb { P } _ { z }$ over $\mathcal { Z }$ (usually an isotropic Gaussian), the distribution $\mathbb { P } _ { g }$ is defined as $G ( \mathbb { P } _ { z } )$ . Optimization is performed with respect to a joint loss for $D$ and $G$
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } L ( D , G ) = \mathbb { E } _ { \mathbf { x } \sim \mathbb { P } _ { r } } \log { [ D ( \mathbf { x } ) ] } + \mathbb { E } _ { \mathbf { z } \sim \mathbb { P } _ { z } } \left[ \log ( 1 - D ( G ( \mathbf { z } ) ) ) \right] .
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
Intuitively, the discriminator $D$ outputs a probability for every $\mathbf { x } \in \mathcal { X }$ that corresponds to its likelihood of being drawn from $\mathbb { P } _ { r }$ , and the loss function encourages the generator $G$ to produce samples that maximize this probability. Practically, the loss is approximated with finite samples from $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , and optimized with alternating steps for $D$ and $G$ using gradient descent.
|
| 39 |
+
|
| 40 |
+
To evaluate the generator, we would like to design a metric $\rho$ that measures the “dissimilarity" between $\mathbb { P } _ { g }$ to $\mathbb { P } _ { r }$ .1 In theory, with both distributions known, common choices of $\rho$ include the Kullback-Leibler divergence (KLD), Jensen-Shannon divergence (JSD) and total variation. However, in practical scenarios, $\mathbb { P } _ { r }$ is unknown and only the finite samples in $S _ { r }$ are observed. Furthermore, it is almost always intractable to compute the exact density of $S _ { g } = \{ \mathbf { x } _ { 1 } ^ { g } , . . . , \mathbf { x } _ { m } ^ { \bar { g } } \} \sim \mathbb { P } _ { q } ^ { m }$ specially so for GANs). Given these limitations, we focus on empiricalof “dissimilarity" between samples from two distributions. $\mathbb { P } _ { g }$ , but much easier to sample $\hat { \rho } : \mathcal X ^ { n } \times \mathcal X ^ { m } \stackrel { \smile } { } \mathbb R$
|
| 41 |
+
|
| 42 |
+
# 2.2 SAMPLE BASED METRICS
|
| 43 |
+
|
| 44 |
+
We mainly focus on sample based evaluation metrics that follow a common setup illustrated in Figure 1. The metric calculator is the key element, for which we briefly introduce five representative methods: Inception Score (Salimans et al., 2016), Mode Score (Che et al., 2016) , Kernel MMD (Gretton et al., 2007), Wasserstein distance, Fréchet Inception Distance (FID) (Heusel et al., 2017), and 1-nearest neighbor (1-NN)-based two sample test (Lopez-Paz & Oquab, 2016). All of them are model agnostic and require only finite samples from the generator.
|
| 45 |
+
|
| 46 |
+
The Inception Score is arguably the most widely adopted metric in the literature. It uses a image classification model $\mathcal { M }$ , the Google Inception network (Szegedy et al., 2016), pre-trained on the ImageNet (Deng et al., 2009) dataset, to compute
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathrm { I S } ( \mathbb { P } _ { g } ) = e ^ { \mathbb { E } _ { \mathbf { x } \sim \mathbb { P } _ { g } } [ K L ( p _ { \mathcal { M } } ( y | \mathbf { x } ) | | p _ { \mathcal { M } } ( y ) ) ] } ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $p _ { \mathcal { M } } ( y | \mathbf { x } )$ denotes the label distribution of $\mathbf { x }$ as predicted by $\mathcal { M }$ , and $\begin{array} { r } { p _ { \mathcal M } ( y ) = \int _ { \mathbf x } p _ { \mathcal M } ( y | \mathbf x ) d \mathbb P _ { g } } \end{array}$ , i.e. the marginal of $p _ { \mathcal { M } } ( y | \mathbf { x } )$ over the probability measure $\mathbb { P } _ { g }$ . The expectation and the integral in $p _ { \mathcal { M } } ( y | \mathbf { x } )$ can be approximated with i.i.d. samples from $\mathbb { P } _ { g }$ . A higher IS has $p _ { \mathcal { M } } ( y | \mathbf { x } )$ close to a point mass, which happens when the Inception network is very confident that the image belongs to a particular ImageNet category, and has $p _ { \mathcal { M } } ( y )$ close to uniform, i.e. all categories are equally represented. This suggests that the generative model has both high quality and diversity. Salimans et al. (2016) show that the Inception Score has a reasonable correlation with human judgment of image quality. We would like to highlight two specific properties: 1) the distributions on both sides of the KL are dependent on $\mathcal { M }$ , and 2) the distribution of the real data $\mathbb { P } _ { r }$ , or even samples thereof, are not used anywhere.
|
| 53 |
+
|
| 54 |
+
The Mode Score is an improved version of the Inception Score. Formally, it is given by
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\mathrm { M S } ( \mathbb { P } _ { g } ) = e ^ { \mathbb { E } _ { \mathbf { x } \sim \mathbb { P } _ { g } } [ K L ( p _ { \mathcal { M } } ( y | \mathbf { x } ) | | p _ { \mathcal { M } } ( y ) ) ] - K L ( p _ { \mathcal { M } } ( y ) | | p _ { \mathcal { M } } ( y ^ { \ast } ) ) } ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $\begin{array} { r } { p _ { \mathcal M } ( y ^ { \ast } ) = \int _ { \mathbf x } p _ { \mathcal M } ( y | \mathbf x ) d \mathbb P _ { r } } \end{array}$ is the marginal label distribution for the samples from the real data distribution. Unlike the Inception Score, it is able to measure the dissimilarity between the real distribution $\mathbb { P } _ { r }$ and generated distribution $\mathbb { P } _ { g }$ through the term $K L ( p _ { \mathcal { M } } ( y ) | | p _ { \mathcal { M } } ( \bar { y } ^ { * } ) )$ .
|
| 61 |
+
|
| 62 |
+
The Kernel MMD (Maximum Mean Discrepancy), defined as
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \mathrm { M M D } ( \mathbb { P } _ { r } , \mathbb { P } _ { g } ) = \biggl ( \mathbb { E } _ { \mathbf { x } _ { r } , \mathbf { x } _ { r } ^ { \prime } \sim \mathbb { P } _ { r } , } \biggl [ k ( \mathbf { x } _ { r } , \mathbf { x } _ { r } ^ { \prime } ) - 2 k ( \mathbf { x } _ { r } , \mathbf { x } _ { g } ) + k ( \mathbf { x } _ { g } , \mathbf { x } _ { g } ^ { \prime } ) \biggr ] \biggr ) ^ { \frac { 1 } { 2 } } , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
measures the dissimilarity between $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ for some fixed kernel function $k$ . Given two sets of samples from $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , the empirical MMD between the two distributions can be computed with finite sample approximation of the expectation. A lower MMD means that $\mathbb { P } _ { g }$ is closer to $\mathbb { P } _ { r }$ . The Parzen window estimate (Gretton et al., 2007) can be viewed as a specialization of Kernel MMD.
|
| 69 |
+
|
| 70 |
+
The Wasserstein distance between $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ is defined as
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname { W D } ( \mathbb { P } _ { r } , \mathbb { P } _ { g } ) = \operatorname* { i n f } _ { \substack { \gamma \in \Gamma ( \mathbb { P } _ { r } , \mathbb { P } _ { g } ) } } \mathbb { E } _ { ( \mathbf { x } ^ { r } , \mathbf { x } ^ { g } ) \sim \gamma } \left[ d ( \mathbf { x } ^ { r } , \mathbf { x } ^ { g } ) \right] ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\Gamma ( \mathbb { P } _ { r } , \mathbb { P } _ { g } )$ denotes the set of all joint distributions (i.e. probabilistic couplings) whose marginals are respectively $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , and $d ( \mathbf { x } ^ { r } , \mathbf { x } ^ { g } )$ denotes the base distance between the two samples. For discrete distributions with densities $p _ { r }$ and $p _ { g }$ , the Wasserstein distance is often referred to as the Earth Mover’s Distance (EMD), and corresponds to the solution to the optimal transport problem
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
N \mathrm { D } ( p _ { r } , p _ { g } ) = \operatorname* { m i n } _ { w \in \mathbb { R } ^ { n \times m } } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } w _ { i j } d ( \mathbf { x } _ { i } ^ { r } , \mathbf { x } _ { j } ^ { g } ) \quad \mathrm { s . t . } \quad \sum _ { j = 1 } ^ { m } w _ { i , j } = p _ { r } ( \mathbf { x } _ { i } ^ { r } ) \ \forall i , \sum _ { i = 1 } ^ { n } w _ { i , j } = p _ { g } ( \mathbf { x } _ { j } ^ { g } ) \ \forall j .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
This is the finite sample approximation of $\mathrm { W D } ( \mathbb { P } _ { r } , \mathbb { P } _ { g } )$ used in practice. Similar to MMD, the Wasserstein distance is lower when two distributions are more similar.
|
| 83 |
+
|
| 84 |
+
The Fréchet Inception Distance (FID) was recently introduced by Heusel et al. (2017) to evaluate GANs. Formally, it is given by
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathrm { F I D } ( \mathbb { P } _ { r } , \mathbb { P } _ { g } ) = \| \mu _ { r } - \mu _ { g } \| + \operatorname { T r } ( \mathbf { C } _ { r } + \mathbf { C } _ { g } - 2 ( \mathbf { C } _ { r } \mathbf { C } _ { g } ) ^ { 1 / 2 } ) ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\mu _ { r } \left( \mu _ { g } \right)$ and $\mathbf { C } _ { r }$ $( \mathbf { C } _ { g } )$ are the mean and covariance of the real (generated) distribution, respectively. Note that under the Gaussian assumption on both $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , the Fréchet distance is equivalent to the Wasserstein-2 distance.
|
| 91 |
+
|
| 92 |
+
The 1-Nearest Neighbor classifier is used in two-sample tests to assess whether two distributions are identical. Given two sets of samples $S _ { r } \sim \mathbb { P } _ { r } ^ { n }$ and $S _ { g } \sim \mathbb { P } _ { g } ^ { m }$ , with $| S _ { r } | = | S _ { g } |$ , one can compute the leave-one-out (LOO) accuracy of a 1-NN classifier trained on $S _ { r }$ and $S _ { g }$ with positive labels for $S _ { r }$ and negative labels for $S _ { g }$ . Different from the most common use of accuracy, here the 1-NN classifier should yield a $\sim 5 0 \%$ LOO accuracy when $| S _ { r } | = | S _ { g } |$ is large. This is achieved when the two distributions match. The LOO accuracy can be lower than $5 0 \%$ , which happens when the GAN overfits $\mathbb { P } _ { g }$ to $S _ { r }$ . In the (hypothetical) extreme case, if the GAN were to memorize every sample in $S _ { r }$ and re-generate it exactly, i.e. $S _ { g } = S _ { r }$ , the accuracy would be $0 \%$ , as every sample from $S _ { r }$ would have it nearest neighbour from $S _ { g }$ with zero distance. The 1-NN classifier belongs to the two-sample test family, for which any binary classifier can be adopted in principle. We will only consider the 1-NN classifier because it requires no special training and little hyperparameter tuning.
|
| 93 |
+
|
| 94 |
+
Lopez-Paz & Oquab (2016) considered the 1-NN accuracy primarily as a statistic for two-sample testing. In fact, it is more informative to analyze it for the two classes separately. For example, a typical outcome of GANs is that for both real and generated images, the majority of their nearest neighbors are generated images due to mode collapse. In this case, the LOO 1-NN accuracy of the real images would be relatively low (desired): the mode(s) of the real distribution are usually well captured by the generative model, so a majority of real samples from $S _ { r }$ are surrounded by generated samples from $S _ { g }$ , leading to low LOO accuracy; whereas the LOO accuracy of the generated images is high (not desired): generative samples tend to collapse to a few mode centers, thus they are surrounded by samples from the same class, leading to high LOO accuracy. For the rest of the paper, we distinguish these two cases as 1-NN accuracy (real) and 1-NN accuracy (fake).
|
| 95 |
+
|
| 96 |
+
# 2.3 OTHER METRICS
|
| 97 |
+
|
| 98 |
+
All of the metrics above are, what we refer to as “model agnostic": they use the generator as a black box to sample the generated images $S _ { g }$ . Model agnostic metrics should not require a density estimation from the model. We choose to only experiment with model agnostic metrics, which allow us to support as many generative models as possible for evaluation without modification to their structure. We will briefly mention some other evaluation metrics not included in our experiments.
|
| 99 |
+
|
| 100 |
+
Kernel density estimation (KDE, or Parzen window estimation) is a well-studied method for estimating the density function of a distribution from samples. For a probability kernel $K$ (most often an isotropic Gaussian) and i.i.d samples $\mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n }$ , we can define the density function at $\mathbf { x }$ as $p ( \mathbf { x } ) \approx$ $\textstyle { \frac { 1 } { z } } \sum _ { i = 1 } ^ { n ^ { \cdot } } K ( \mathbf { x } - \mathbf { x } _ { i } )$ , where $z$ is a normalizing constant. This allows the use of classical metrics such as KLD and JSD. However, despite the widespread adoption of this technique to various applications, its suitability to estimating the density of $\mathbb { P } _ { r }$ or $\mathbb { P } _ { g }$ for GANs has been questioned by Theis et al. (2015) since the probability kernel depends on the Euclidean distance between images.
|
| 101 |
+
|
| 102 |
+
More recently, Wu et al. (2016) applied annealed importance sampling (AIS) to estimate the marginal distribution $p ( \mathbf { x } )$ of a generative model. This method is most natural for models that define a conditional distribution $p ( \mathbf { x } | \mathbf { z } )$ where $\mathbf { z }$ is the latent code, which is not satisfied by most GAN models. Nevertheless, AIS has been applied to GAN evaluation by assuming a Gaussian observation model. We exclude this method from our experiments as it needs the access to the generative model to compute the likelihood, instead of only depending on a finite sample set $S _ { g }$ .
|
| 103 |
+
|
| 104 |
+
# 3 EXPERIMENTS WITH GAN EVALUATION METRICS
|
| 105 |
+
|
| 106 |
+
# 3.1 FEATURE SPACE
|
| 107 |
+
|
| 108 |
+
All the metrics introduced in the previous section, except for the Inception Score and Mode Score, access the samples $\mathbf { x }$ only through pair-wise distances. The Kernel MMD requires a fixed kernel function $k$ , typically set to an isotopic Gaussian; the Wasserstein distance and 1-NN accuracy use the underlying distance metric $d$ directly; all of these methods are highly sensitive to the choice that distance.
|
| 109 |
+
|
| 110 |
+
It is well-established that pixel representations of images do not induce meaningful Euclidean distances (Forsyth & Ponce, 2011). Small translations, rotations, or changes in illumination can increase distances dramatically with little effect on the image content. To quantity the similarity between distributions of images, it is therefore desirable to use distances invariant to such transformations. The choice of distance function can be re-interpreted as a choice of representation, by defining the distance in a more general form as $d ( \mathbf { x } , \mathbf { x } ^ { \prime } ) = \| \boldsymbol { \phi } ( \mathbf { x } ) - \boldsymbol { \phi } ( \mathbf { x } ^ { \prime } ) \| _ { 2 }$ , where $\phi ( \cdot )$ is some general mapping of the input into a semantically meaningful feature space. For Kernel MMD, this corresponds to computing the usual inner product in the feature space $\phi ( \mathcal { X } )$ .
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 2: Distinguishing a set of real images (in the training set) from a mixed set of real images and GAN generated images. For the metric to be discriminative, its score should increase as the fraction of generated samples in the mix increases. RIS and RMS fail as they decrease with the fraction of generated samples in $S _ { g }$ on LSUN. Wasserstein and 1-NN accuracy (real) fail in pixel space as they do not increase.
|
| 114 |
+
|
| 115 |
+
Inspired by recent works from Upchurch et al. (2017); Larsen et al. (2015) which show that convolutional neural networks may linearize the image manifold, we propose to operate in the feature space of an external model pre-trained on the ImageNet dataset. For efficiency, we use a 34-layer ResNet2 as the feature extractor. Our experiments show that other models such as VGG or Inception give very similar results.
|
| 116 |
+
|
| 117 |
+
To illustrate our point, we show failure examples of the pixel space distance for evaluating GANs in this section, and highlight that using a proper feature space is key to obtaining meaningful results when applying the distance-based metrics. The usage of a well-suited feature space enables us to draw more optimistic conclusions on GAN evaluation metrics than in Theis et al. (2015).
|
| 118 |
+
|
| 119 |
+
# 3.2 SETUP
|
| 120 |
+
|
| 121 |
+
For the rest of this major section, we introduce what in our opinion are necessary conditions for good metrics for GANs. After the introduction of each condition, we use it as a criterion to judge the effectiveness of the metrics presented in Section 2, through carefully designed empirical experiments.
|
| 122 |
+
|
| 123 |
+
The experiments are performed on two standard benchmark datasets for generative models, CelebA3and LSUN bedrooms4. To remove the degree of freedom induced by feature representation, we use the Inception Score (IS) and Mode Score (MS) computed from the softmax probabilities of the same ResNet-34 model as the other metrics, instead of the Inception model. We also compute the Inception Score over the real training data $S _ { r }$ as an upper bound, which we denote as $\mathrm { I S } _ { \mathrm { 0 } }$ . Moreover, to be consistent with other metrics where lower values correspond to better models, we report the relative inverse Inception Score $R I S = \left( 1 - { \mathrm { I S } } / { \mathrm { I S } } _ { 0 } \right)$ in tables and plots, after computing IS the Inception Score. We similarly report the relative inverse Mode Score (RMS). Although RIS and RMS operate in the softmax space, we always compare them together with other metrics in the convolutional space for simplicity. For all the plots in this paper, shaded areas denote the standard deviations, computed by running the same experiment 5 times with different random seeds.
|
| 124 |
+
|
| 125 |
+
# 3.3 DISCRIMINABILITY
|
| 126 |
+
|
| 127 |
+
Mixing of generated images. Arguably, the most important property of a metric $\hat { \rho }$ for measuring GANs is the ability to distinguish generated images from real images. To test this property, we sample a set $S _ { r }$ consisting of $n$ ( $n = 2 0 0 0$ if not otherwise specified) real images uniformly from the training set, and a set $S _ { g } ( t )$ of the same size $n$ consisting of a mix of real samples and generated images from a DCGAN (Radford et al., 2015) trained on the same training set, where $t$ denotes the ratio of generated images.
|
| 128 |
+
|
| 129 |
+
The computed values of various metrics between $S _ { r }$ and $S _ { g } ( t )$ for $t \in [ 0 , 1 ]$ are shown in Figure 2. Since $\mathbb { P } _ { r }$ should serve as a lower bound for any metric, we expect that any reasonable $\hat { \rho }$ should increase as the ratio of generated images increases. This is indeed satisfied for all the metrics except:
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: Experiment on simulated mode collapsing. A metric score should increase to reflect the mismatch between true distribution and generated distribution as more modes are collapsed towards their cluster center. All metrics respond correctly in convolutional space. In pixel space, both Wasserstein distance and 1-NN accuracy (real) fail as they decrease in response to more collapsed clusters.
|
| 133 |
+
|
| 134 |
+
1) RIS and RMS (red and green curves) on LSUN, which decrease as more fake samples are in the mix; 2) 1-NN accuracy of real samples (dotted magenta curve) computed in pixel space, which also appears to be a decreasing function; and 3) Wasserstein Distance (cyan curve), which almost remains unchanged when $t$ varies.
|
| 135 |
+
|
| 136 |
+
The reason that RIS and RMS do not work well here is likely because they are not suitable for images beyond the ImageNet categories. Although other metrics operate in the convolutional feature space also depend on a network pretrained on ImageNet, the convolutional features are much more general than the specific softmax representation. The failure of Wasserstein Distance is possibly due to an insufficient number of samples, which we will discuss in more detail when we analyze the sample efficiency of various metrics in a latter subsection. The last paragraph of Section 2.2 explains why the 1-NN accuracy for real samples (dotted magenta curve) is always lower than that for generated samples (dashed magenta curve). In the pixel space, more than half of the samples from $S _ { r }$ have the nearest neighbor from $S _ { g } ( t )$ , indicating that the DCGAN is able to represent the modes in the pixel space quite well.
|
| 137 |
+
|
| 138 |
+
We also conducted the same experiment using 1) random noise images and 2) images from an entirely different distribution (e.g. CIFAR-10), instead of DCGAN generated images to construct $S _ { g } ( t )$ . We call these injected samples as out-of-domain violations since they are not in $\mathcal { X }$ , the domain of the real images. These settings yield similar results as in Figure 2, thus we omit their plots.
|
| 139 |
+
|
| 140 |
+
Mode collapsing and mode dropping. In realistic settings, $\mathbb { P } _ { r }$ is usually very diverse since natural images are inherently multimodal. Many have conjectured that $\mathbb { P } _ { g }$ differs from $\mathbb { P } _ { r }$ by reducing diversity, possibly due to the lack of model capacity or inadequate optimization (Arora et al., 2017). This is often manifested itself for generative models in a mix of two ways: mode dropping, where some hard-to-represent modes of $\mathbb { P } _ { r }$ are simply “ignored" by $\mathbb { P } _ { g }$ ; and mode collapsing, where several modes of $\mathbb { P } _ { r }$ are “averaged" by $\mathbb { P } _ { g }$ into a single mode, possibly located at a midpoint. An ideal metric should be sensitive to these two phenomena.
|
| 141 |
+
|
| 142 |
+
To test for mode collapsing, we first randomly sample both $S _ { r }$ and $S _ { r } ^ { \prime }$ as two disjoint sets of 2000 real images. Next, we find 50 clusters in the whole training set with $k$ -means and progressively replace each cluster by its respective cluster center to simulate mode collapse. Figure 3 shows computed values of $\hat { \rho } ( S _ { r } , S _ { r } ^ { \prime } )$ as the number of replaced (collapsed) clusters, denoted as $C$ increases. Ideally, we expect the scores increase as $C$ grows. We first observe that all the metrics are able to respond correctly when distances are computed in the convolutional feature space. However, the Wasserstein metric (cyan curve) breaks down in pixel space, as it considers a collapsed sample set (with $C > 0$ ) being closer to the real sample set than another set of real images (with $C = 0$ ). Moreover, although the overall 1-NN accuracy (solid magenta curve) follows the desired trend, the real and fake parts follow opposite trends: 1-NN real accuracy (dotted magenta curve) decreases while 1-NN fake accuracy (dashed magenta curve) increases. Again, this is inline with our explanation given in the last paragraph of Section 2.2.
|
| 143 |
+
|
| 144 |
+
To test for mode dropping, we take $S _ { r }$ as above and construct $S _ { r } ^ { \prime }$ by randomly removing clusters. To keep the size of $S _ { r } ^ { \prime }$ constant, we replace images from the removed cluster with images randomly selected from the remaining clusters. Figure 4 shows how different metrics react to the number of removed clusters, also denoted as $C$ . All scores effectively discriminate against mode dropping except the RIS and RMS - they remain almost indifferent when some modes are dropped. Again, this is perhaps caused by the fact that the Inception/Mode Score were originally designed for datasets with classes overlapping with the ImageNet dataset, and they do not generalize well to other datasets.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 4: Experiment on simulated mode dropping. A metric score should increase to reflect the mismatch between true distribution and generated distribution as more modes are dropped. All metrics except RIS and RMS respond correctly, as they only increase slightly in value even when almost all modes are dropped.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 5: Experiment on robustness of each metric to small transformations (rotations and translations). All metrics should remain constant across all mixes of real and transformed real samples, since the transformations do not alter semantics of the image. All metrics respond correctly in convolutional space, but behave incorrectly in pixel space. This experiment illustrates the unsuitability of distances in pixel space.
|
| 151 |
+
|
| 152 |
+
# 3.4 ROBUSTNESS TO TRANSFORMATIONS
|
| 153 |
+
|
| 154 |
+
GANs are widely used for image datasets, which have the property that certain transformations to the input do not change its semantic meaning. Thus an ideal evaluation metric should be invariant to such transformations to some extent. For example, a generator trained on CelebA should not be penalized by a metric if its generated faces are shifted by a few pixels or rotated by a small angle.
|
| 155 |
+
|
| 156 |
+
Figure 5 shows how the various metrics react to such small transformation to the images. In this experiment, $S _ { r }$ and $S _ { r } ^ { \prime }$ are two disjoint sets of 2000 real images sampled from the training data. However, a proportion of images from $S _ { r } ^ { \prime }$ are randomly shifted (up to 4 pixels) or rotated (up to 15 degrees). We can observe from the results that metrics operating in the convolutional space (or softmax space for RIS and RMS) are robust to these transformations, as all the curves are approximated horizontal as the ratio of transformed samples increases. This is not that surprising as convolutional networks are well know for being invariant to certain transformations (Mallat, 2016). In comparison, in the pixel space all the metrics consider the shifted/rotated images as drawn from a different distribution, highlighting the importance of computing distances in a proper feature space.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 7: Measurement of wall-clock time for computing various metrics as a function of the number of samples. All metrics are practical to compute for a sample of size 2000, but Wasserstein distance does not scale to large sample sizes.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 6: The score of various metrics as a function of the number of samples. An ideal metric should result in a large gap between the real-real (R-R; $\hat { \rho } ( S _ { r } , S _ { r } ^ { \prime } ) )$ ) and real-fake (R-G; $\hat { \rho } ( \bar { S } _ { r } , S _ { g } ) \rangle$ ) curves in order to distinguish between real and fake distributions using as few samples as possible. Compared with Wasserstein distance, MMD and 1-NN accuracy require much fewer samples to discriminate real and generated images, while RIS totally fails on LSUN as it scores generated images even better (lower) than real images.
|
| 163 |
+
|
| 164 |
+
# 3.5 EFFICIENCY
|
| 165 |
+
|
| 166 |
+
A practical GAN evaluation metric should be able to compute “accurate” scores from a reasonable number of samples and within an affordable computation cost, such that it can be computed, for example, after each training epoch to monitor the training process.
|
| 167 |
+
|
| 168 |
+
Sample efficiency. Here we measure the sample efficiency of various metrics by investigating how many samples are needed for each of them in order to discriminate a set of generated samples $S _ { g }$ (from DCGAN) from a set of real samples $S _ { r } ^ { \prime }$ . To do this, we introduce a reference set $S _ { r }$ , which is also uniformly sampled from the real training data, but is disjoint with $S _ { r } ^ { \prime }$ . All three sample sets have the same size, i.e., $| S _ { r } | = | S _ { r } ^ { \prime } | = | S _ { g } | = n$ . We expect that an ideal metric $\rho$ should correctly score $\hat { \rho } ( S _ { r } , S _ { r } ^ { \prime } )$ lower than $\hat { \rho } ( S _ { r } , S _ { g } )$ with a relatively small $n$ . In other words, the number of samples $n$ needed for the metric to distinguish $S _ { r } ^ { \prime }$ and $S _ { g }$ can be viewed as its sample complexity.
|
| 169 |
+
|
| 170 |
+
In Figure 6 we show the individual scores as a function of $n$ . We can observe that MMD, FID and 1-NN accuracy computed in convolution feature space are able to distinguish the two set of images $S _ { g }$ (solid blue and magenta curves) and $S _ { r } ^ { \prime }$ (dotted solid blue and magenta curves) with relatively few samples. The Wasserstein distance (cyan curves) is not discriminative with samples size less than 1000, while the RIS even considers the generated samples to be more “real” than the real samples on the LSUN dataset (the red curves in the third panel). The dotted lines in Figure 6 also quantify how fast the scores converge to their expectations as we increase the sample size. Note that MMD for $\hat { \rho } ( S _ { r } , S _ { r } ^ { \prime } )$ converges very quickly to zero and gives discriminative scores with few samples, making it a practical metric for comparing GAN models.
|
| 171 |
+
|
| 172 |
+
Computational efficiency. Fast computation of the empirical metric is of practical concern as it helps researchers monitor the training process and diagnose problems early on, or perform early stopping. In Figure 7 we investigate the computational efficiency of the above metrics by showing the wall-clock time (in log scale) to compute them as a function of the number of samples. For a typical number of 2000 samples, it only takes about 8 seconds to compute each of these metrics on an NVIDIA TitanX GPU. In fact, the majority of time is spent on extracting features from the ResNet model. Only the Wasserstein distance becomes prohibitively slow for large sample sizes.
|
| 173 |
+
|
| 174 |
+
# 3.6 DETECTING OVERFITTING
|
| 175 |
+
|
| 176 |
+
Overfitting is an artifact of training with finite samples. If a GAN successfully memorizes the training images, i.e., $\mathbb { P } _ { g }$ is a uniform distribution over the training sample set $S _ { r } ^ { t r }$ , then the generated samples $S _ { g }$ becomes a uniformly drawn set of $n$ samples from $S _ { r } ^ { t r }$ , and any reasonable $\hat { \rho }$ should be close to 0. The Wasserstein distance, MMD and 1-NN two sample test are able to detect overfitting in the following sense: if we hold out a validation set $S _ { r } ^ { v a l }$ , then $\hat { \rho } ( S _ { g } , S _ { r } ^ { v a l } )$ should be significantly higher than $\hat { \rho } ( S _ { g } , S _ { r } ^ { t r } )$ when $\mathbb { P } _ { g }$ memorizes a part of $S _ { r } ^ { t r }$ . The difference between them can informally be viewed as a form of “generalization gap".
|
| 177 |
+
|
| 178 |
+
We simulate the overfitting process by defining $S _ { r } ^ { \prime }$ as a mix of samples from the training set $S _ { r } ^ { t r }$ and a second holdout set, disjoint from both $S _ { r } ^ { t r }$ and $S _ { r } ^ { v a l }$ . Figure 8 shows the gap $\hat { \rho } ( S _ { g } , S _ { r } ^ { v a l } ) - \hat { \rho } ( \mathbf { \dot { } { } } S _ { g } , S _ { r } ^ { t r } )$ of the various metrics as a function of the overlapping ratio between $S _ { r } ^ { \prime }$ and $S _ { r } ^ { t r }$ . The left most point of each curve can be viewed as the score $\hat { \rho } ( S _ { r } ^ { \prime } , S _ { r } ^ { v a l } )$ computed on a validation set since the overlap ratio is 0. For better visualization, we normalize the Wasserstein distance and MMD by dividing their corresponding score when $S _ { r } ^ { \prime }$ and $S _ { r }$ have no overlap. As shown in Figure 8, all the metrics except RIS and RMS reflect that the “generalization gap" increases as $S _ { r } ^ { \prime }$ overfits more to $S _ { r }$ . The failure of RIS is not surprising: it totally ignores the real data distribution as we discussed in Section 2.2. While the reason that RMS also fails to detect overfitting may again be its lack of generalization to datasets with classes not contained in the ImageNet dataset. In addition, RMS operates in the softmax space, the features in which might be too specific compared to the features in the convolutional space.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 8: Experiment on detecting overfitting of generated samples. As more generated samples overlap with real samples from the training set, the gap between validation and training score should increase to signal overfitting. All metrics behave correctly except for RIS and RMS, as these two metrics do not increase when the fraction of overlapping samples increases.
|
| 182 |
+
|
| 183 |
+
# 4 DISCUSSIONS AND CONCLUSION
|
| 184 |
+
|
| 185 |
+
Based on the above analysis, we can summarize the advantages and inherent limitations of the five evaluation metrics, and conditions under which they produce meaningful results. With some of the metrics, we are able to study the problem of overfitting (see Appendix C), perform model selection on GAN models and compare GAN models without resorting to human evaluation based on cherry-picked samples (see Appendix D).
|
| 186 |
+
|
| 187 |
+
The Inception Score does show a reasonable correlation with the quality and diversity of generated images, which explains the wide usage in practice. However, it is ill-posed mostly because it only evaluates $\mathbb { P } _ { g }$ as an image generation model rather than its similarity to $\mathbb { P } _ { r }$ . Blunt violations like mixing in natural images from an entirely different distribution completely deceives the Inception Score. As a result, it may encourage the models to simply learn sharp and diversified images (or even some adversarial noise), instead of $\mathbb { P } _ { r }$ . This also applies to the Mode Score. Moreover, the Inception Score is unable to detect overfitting since it cannot make use of a holdout validation set.
|
| 188 |
+
|
| 189 |
+
Kernel MMD works surprising well when it operates in the feature space of a pre-trained ResNet. It is always able to identify generative/noise images from real images, and both its sample complexity and computational complexity are low. Given these advantages, even though MMD is biased, we recommend its use in practice.
|
| 190 |
+
|
| 191 |
+
Wasserstein distance works well when the base distance is computed in a suitable feature space. However, it has a high sample complexity, a fact that has been independently observed by (Arora et al., 2017). Another key weakness is that computing the exact Wasserstein distance has a time complexity of $O ( n ^ { 3 } )$ , which is prohibitively expensive as sample size increases. Compared to other methods, Wasserstein distance is less appealing as a practical evaluation metric.
|
| 192 |
+
|
| 193 |
+
Fréchet Inception Distance performs well in terms of discriminability, robustness and efficiency. It appears to be a good evaluation metric for GANs, even it only takes into consideration the first two order moments of the distributions.
|
| 194 |
+
|
| 195 |
+
1-NN classifier seems to be an ideal metric for evaluating GANs. Not only does it enjoy all the advantages of the other metrics, it also outputs a score in the interval [0, 1], similar to the accuracy/error in classification problems. When the generative distribution perfectly match the true distribution, perfect score (i.e., $5 0 \%$ accuracy) is attainable with a reasonable (e.g., 1000) sample size. From Figure 2, we find that typical GAN models tend to achieve lower LOO accuracy for real samples (1-NN accuracy (real)), while higher LOO accuracy for generated samples (1-NN accuracy (fake)). This suggests that GANs are able to capture modes from the training distribution, such that the majority of training samples distributed around the mode centers have their nearest neighbor from the generated images, yet most of the generated images are still surrounded by generated images as they are collapsed. The observation indicates that the mode collapse problem is prevalent for typical GAN models. We also note that this problem, however, cannot be effectively detected by human evaluation or the widely used Inception Score.
|
| 196 |
+
|
| 197 |
+
Overall, our empirical study suggests that the choice of feature space in which to compute various metrics is crucial. In the convolutional space of a ResNet pretrained on ImageNet, both MMD and 1-NN accuracy appear to be good metrics in terms of discriminability, robustness and efficiency. Wasserstein distance has very poor sample efficiency, while Inception Score and Mode Score appear to be unsuitable for datasets that are very different from ImageNet. We will release our source code for all these metrics, providing researchers with an off-the-shelf tool to compare and improve GAN algorithms.
|
| 198 |
+
|
| 199 |
+
Based on the two most prominent metrics, MMD and 1-NN accuracy, we study the overfitting problem of DCGAN and WGAN (in Appendix C). Despite the widespread belief that GANs are overfitting to the training data, we find that this does not occur unless there are very few training samples. This raises an interesting question regarding the generalization of GANs in comparison to the supervised setting. We hope that future work can contribute to explaining this phenomenon.
|
| 200 |
+
|
| 201 |
+
# REFERENCES
|
| 202 |
+
|
| 203 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. arXiv preprint arXiv:1701.07875, 2017.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
Wacha Bounliphone, Eugene Belilovsky, Matthew B Blaschko, Ioannis Antonoglou, and Arthur Gretton. A test of relative similarity for model selection in generative models. arXiv preprint arXiv:1511.04581, 2015.
|
| 208 |
+
|
| 209 |
+
Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016.
|
| 210 |
+
|
| 211 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. IEEE, 2009.
|
| 212 |
+
|
| 213 |
+
David Forsyth and Jean Ponce. Computer vision: a modern approach. Upper Saddle River, NJ; London: Prentice Hall, 2011.
|
| 214 |
+
|
| 215 |
+
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.
|
| 216 |
+
|
| 217 |
+
Arthur Gretton, Karsten M Borgwardt, Malte Rasch, Bernhard Schölkopf, Alexander J Smola, et al. A kernel method for the two-sample-problem. Advances in neural information processing systems, 19:513, 2007.
|
| 218 |
+
|
| 219 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
|
| 220 |
+
|
| 221 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Günter Klambauer, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
|
| 222 |
+
|
| 223 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint arXiv:1611.07004, 2016.
|
| 224 |
+
|
| 225 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. In Tech Report, 2009.
|
| 226 |
+
|
| 227 |
+
Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. arXiv preprint arXiv:1512.09300, 2015.
|
| 228 |
+
|
| 229 |
+
David Lopez-Paz and Maxime Oquab. Revisiting classifier two-sample tests. arXiv preprint arXiv:1610.06545, 2016.
|
| 230 |
+
|
| 231 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 232 |
+
|
| 233 |
+
Stéphane Mallat. Understanding deep convolutional networks. Phil. Trans. R. Soc. A, 374(2065): 20150203, 2016.
|
| 234 |
+
|
| 235 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. arXiv preprint ArXiv:1611.04076, 2016.
|
| 236 |
+
|
| 237 |
+
Augustus Odena. Semi-supervised learning with generative adversarial networks. arXiv preprint arXiv:1606.01583, 2016.
|
| 238 |
+
|
| 239 |
+
Guo-Jun Qi. Loss-sensitive generative adversarial networks on lipschitz densities. arXiv preprint arXiv:1701.06264, 2017.
|
| 240 |
+
|
| 241 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 242 |
+
|
| 243 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In Advances in Neural Information Processing Systems, pp. 2226–2234, 2016.
|
| 244 |
+
|
| 245 |
+
Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Josh Susskind, Wenda Wang, and Russ Webb. Learning from simulated and unsupervised images through adversarial training. arXiv preprint arXiv:1612.07828, 2016.
|
| 246 |
+
|
| 247 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. arXiv preprint arXiv:1409.4842, 2014.
|
| 248 |
+
|
| 249 |
+
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.
|
| 250 |
+
|
| 251 |
+
Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844, 2015.
|
| 252 |
+
|
| 253 |
+
Paul Upchurch, Jacob R. Gardner, Kavita Bala, Robert Pless, Noah Snavely, and Kilian Q. Weinberger. Deep feature interpolation for image content changes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. in press ..., 2017.
|
| 254 |
+
|
| 255 |
+
Yuhuai Wu, Yuri Burda, Ruslan Salakhutdinov, and Roger Grosse. On the quantitative analysis of decoder-based generative models. arXiv preprint arXiv:1611.04273, 2016.
|
| 256 |
+
|
| 257 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 258 |
+
|
| 259 |
+
Junbo Jake Zhao, Michaël Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 260 |
+
|
| 261 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017.
|
| 262 |
+
|
| 263 |
+
# A GAN VARIANTS USED IN OUR EXPERIMENTS
|
| 264 |
+
|
| 265 |
+
Many GAN variants have been proposed recently. In this paper we consider several of them, which we briefly review in this section.
|
| 266 |
+
|
| 267 |
+
DCGAN (Radford et al., 2015). The generator of a DCGAN takes a lower dimensional input from a uniform noise distribution, then projects and reshapes it to a small convolutional representation with many feature maps. After applying a series of four fractionally-strided convolutions, the generator converts this representation into a $6 4 \times 6 4$ pixel image. DCGAN is optimized by minimizing the Jensen-Shannon divergence between the real and generated images.
|
| 268 |
+
|
| 269 |
+
WGAN (Arjovsky et al., 2017). A critic network that outputs unconstrained real values is used in place of the discriminator. When the critic is Lipschitz, this network approximates the Wasserstein distance between $S _ { r }$ and $S _ { g }$ . A Lipschitz condition is enforced by clipping the critic networks’ parameters to stay within a predefined bounding box.
|
| 270 |
+
|
| 271 |
+
WGAN with gradient penalty (Gulrajani et al., 2017) improves upon WGAN by enforcing the Lipschitz condition with a gradient penalty term. This method significantly improves the convergence speed and the quality of the images generated by a WGAN.
|
| 272 |
+
|
| 273 |
+
LSGAN (Mao et al., 2016). Least Squares GAN adopts the least squares loss function instead of the commonly used sigmoid cross entropy loss for the discriminator, essentially minimizing the Pearson $\chi ^ { 2 }$ divergence between the real distribution $\mathbb { P } _ { r }$ and generative distribution $\mathbb { P } _ { g }$ .
|
| 274 |
+
|
| 275 |
+
# B THE CHOICE OF FEATURE SPACE
|
| 276 |
+
|
| 277 |
+
The choice of features space is crucial for all these metrics. Here we consider several alternatives to the convolutional features from the 34-layer ResNet trained on ImageNet. In particular, we compute various metrics using the features extracted by (1) the VGG and Inception networks; (2) a 34-layer ResNet with random weights; (3) a ResNet classifier trained on the same dataset as the GAN models. We use the features extracted from these models to test all metrics in the discriminative experiments we performed in Section 3. All experimental settings are identical except for the third experiments, which is performed on the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) instead as we need class labels to train the classifier. Note that we consider setting (3) only for analytical purposes. It is not a practical choice as GANs are mainly designed for unsupervised learning and we should not assume the existence of ground truth labels.
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
Figure 9: Comparison of all metrics in different feature spaces. When using different trained networks, the trends of all metrics are very similar. Most metrics work well even in a random network, but Wasserstein distance has very high variance and the magnitude of increase for 1-NN accuracy is small.
|
| 281 |
+
|
| 282 |
+
The results are shown in Figure 9 and Figure 10, from which several observations can be made: (1) switching from ResNet-34 to VGG or Inception has little effect to the metric scores; (2) the features from a random network still works for MMD, while it makes the Wasserstein distance unstable and 1-NN accuracy less discriminative. Not surprisingly, the Inception Score and Mode Score becomes meaningless if we use the softmax values from the random network; (3) features extracted from the classifier trained on the same dataset as the GAN model also offers high discriminability for these metrics, especially for the Wasserstein distance. However, this may be simply due to the fact that the feature dimensionality of the ResNet trained on CIFAR-10 is much smaller than that of the ResNet-34 trained on ImageNet (64 v.s. 512).
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 10: Using features extracted from a ResNet trained on CIFAR-10 (right plot) to evaluate a GAN model trained on the same dataset. Compared to using an extractor trained on ImageNet, the metrics appear to have lower variance. However, this may due to the feature dimensionality being smaller for CIFAR-10.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 11: Training curves of DCGAN and WGAN on a large (left two panels), small (middle two panels) and tiny (right two panels) subsets of CelebA. Note that for the first four plots, blue (yellow) curves almost overlap with the red (green) curves, indicating no overfitting detected by the two metrics. Overfitting only observed on the tiny training set, with MMD score and 1-NN accuracy significantly worse (higher) on the validation set.
|
| 289 |
+
|
| 290 |
+
# C ARE GANS OVERFITTING TO THE TRAINING DATA?
|
| 291 |
+
|
| 292 |
+
We trained two representative GAN models, DCGAN (Radford et al., 2015) and WGAN (Arjovsky et al., 2017) on the CelebA dataset. Out of the ${ \sim } 2 0 0 { , } 0 0 0$ images in total, we holdout 20,000 images for validation, and the rest for training. As the training set is sufficiently large, which makes overfitting unlikely to occur, we also create a small training set and a tiny training set respectively with only 2000 and 10 images sampled from the full training set.
|
| 293 |
+
|
| 294 |
+
The training setting for DCGAN and WGAN strictly follow their original implementation, except that we change the default number of training iterations such that both models are sufficiently updated. For each metric, we compute their score on 2000 real samples and 2000 generated samples, where the real samples are drawn from either the training set or the validation set, giving rise to training and validation scores. The results are shown in Figure 11, from which we can make several observations:
|
| 295 |
+
|
| 296 |
+
• The training and validation scores almost overlap with each other with 2000 or $1 8 0 \mathrm { k }$ training samples, showing that both DCGAN and WGAN do not overfit to the training data under of these metrics. Even when using only 2000 training samples, there is still no significant difference between the training score and validation score. This shows that the training process of GANs behaves quite differently from those of supervised deep learning models, where a model can easily achieve 0 training error while behaving like random guess on the validation set (Zhang et al., 2016). 5
|
| 297 |
+
|
| 298 |
+
Table 1: Comparison of several GAN models on the LSUN dataset
|
| 299 |
+
|
| 300 |
+
<table><tr><td colspan="2"></td><td>Real</td><td>DCGAN</td><td>WGAN</td><td>WGAN-GP</td><td>LSGAN</td></tr><tr><td rowspan="4">Conv Space</td><td>MMD</td><td>0.019</td><td>0.205</td><td>0.270</td><td>0.194</td><td>0.232</td></tr><tr><td>1-NN Accuracy</td><td>0.499</td><td>0.825</td><td>0.920</td><td>0.812</td><td>0.871</td></tr><tr><td>1-NN Accuracy (real)</td><td>0.495</td><td>0.759</td><td>0.880</td><td>0.765</td><td>0.804</td></tr><tr><td>1-NN Accuracy (fake)</td><td>0.503</td><td>0.892</td><td>0.961</td><td>0.860</td><td>0.938</td></tr></table>
|
| 301 |
+
|
| 302 |
+
• DCGAN outperforms WGAN on the full training set under both metrics, and converges faster. However, WGAN is much more stable on the small training set, and converges to better positions.
|
| 303 |
+
|
| 304 |
+
# D COMPARISON OF POPULAR GAN MODELS BASED ON QUANTITATIVE EVALUATION METRICS
|
| 305 |
+
|
| 306 |
+
Based on our analysis, we chose MMD and 1-NN accuracy in the feature space of a 34-layer ResNet trained on ImageNet to compare several state-of-the-art GAN models. All scores are computed using 2000 samples from the holdout set and 2000 generated samples. The GAN models evaluated include DCGAN (Radford et al., 2015), WGAN (Arjovsky et al., 2017), WGAN with gradient penalty (WGAN-GP ) (Gulrajani et al., 2017), and LSGAN (Mao et al., 2016) , all trained on the CelebA dataset. The results are reported in Table 1, from which we highlight three observations:
|
| 307 |
+
|
| 308 |
+
• WGAN-GP performs the best under most of the metrics.
|
| 309 |
+
DCGAN achieves 0.759 overall 1-NN accuracy on real samples, slightly better than 0.765 achieved by WGAN-GP; while the 1-NN accuracy on generated (fake) samples achieved by DCGAN is higher than that by WGAN-GP (0.892 v.s. 0.860). This seems to suggest that DCGAN is better at capturing modes in the training data distribution, while its generated samples are more collapsed compared to WGAN-GP. Such subtle difference is unlikely to be discovered by the Inception Score or human evaluation.
|
| 310 |
+
• The 1-NN accuracy for all evaluated GAN models are higher than 0.8 , far above the ground truth of 0.5. The MMD score of the four GAN models are also much larger than that of ground truth (0.019). This indicates that even state-of-the-art GAN models are far from learning the true distribution.
|
md/train/UZgGf92u5N0/UZgGf92u5N0.md
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On the Effects of Data Distortion on Model Analysis and Training
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Data modification can introduce artificial information. It is often assumed that
|
| 11 |
+
2 the resulting artefacts are detrimental to training, whilst being negligible when
|
| 12 |
+
3 analysing models. We investigate these assumptions and conclude that in some
|
| 13 |
+
4 cases they are unfounded and lead to incorrect results. Specifically, we show current
|
| 14 |
+
5 shape bias identification methods and occlusion robustness measures are biased
|
| 15 |
+
6 and propose a fairer alternative for the latter. Subsequently, through a series of
|
| 16 |
+
7 experiments we seek to correct and strengthen the community’s perception of how
|
| 17 |
+
8 distorting data affects learning. Based on our empirical results we argue that the
|
| 18 |
+
9 impact of the artefacts must be understood and exploited rather than eliminated.
|
| 19 |
+
|
| 20 |
+
# 10 1 Motivation
|
| 21 |
+
|
| 22 |
+
11 Modifying data has become commonplace both when training and analysing models, yet the wider
|
| 23 |
+
12 implications are often disregarded. We delve into some of the side-effects and point out that this
|
| 24 |
+
13 practice has resulted in the creation of biased model interpretation tools and poorly informed theories.
|
| 25 |
+
14 On the analysis side, we take as examples occlusion robustness and shape bias identification methods.
|
| 26 |
+
15 On the training side, we focus on some instances of Mixed Sample Data Augmentation (MSDA),
|
| 27 |
+
16 where two images are combined to obtain a new training sample. Visual examples of each can
|
| 28 |
+
17 be found in Figure 1. In this paper we study a number of assumptions that lie at the heart of the
|
| 29 |
+
18 aforementioned methods, which we briefly introduce below.
|
| 30 |
+
19 Shape-texture bias: Deep models are known to be sensitive to interventions that are imperceptible
|
| 31 |
+
20 to humans [35, 13], as well as to other forms of distribution shifts [1, 6, 8]. It has been argued that
|
| 32 |
+
21 this is intimately linked to networks tending to use texture rather than shape information [2, 11].
|
| 33 |
+
22 Recently, input distortions have become a popular way of assessing a model’s texture bias. To this end,
|
| 34 |
+
23 images are divided into a grid and the resulting patches are randomly shuffled such that information
|
| 35 |
+
24 is preserved locally, while the global shape is altered [32, 27, 25, 41]. It is implicitly assumed that
|
| 36 |
+
25 patch-shuffling does not introduce misleading shape or texture that could affect model evaluation.
|
| 37 |
+
26 Occlusion robustness: A widely adopted method for measuring occlusion robustness is through the
|
| 38 |
+
27 accuracy obtained after superimposing a rectangular patch on an image [5, 9, 39, 42, 20]. We refer
|
| 39 |
+
28 to this approach as CutOcclusion throughout the paper. Just as for shape bias, this method relies on
|
| 40 |
+
29 information introduced not to interfere with a model’s learnt representations such that a decrease in
|
| 41 |
+
30 performance can be directly attributed to lack of robustness.
|
| 42 |
+
31 Data augmentation studies: In statistical learning, training with augmented data is termed Vicinal
|
| 43 |
+
32 Risk Minimisation (VRM) [37, 4] and it is seen as injecting prior knowledge about the neighbourhood
|
| 44 |
+
33 of the data samples. The intuition behind augmentation caused researchers to interpret its effect
|
| 45 |
+
34 through the similarity between original and augmented data distributions. This perspective is often
|
| 46 |
+
35 challenged by methods which, despite generating samples that do not appear to fall under the
|
| 47 |
+
36 distribution of natural images, lead to strong learners. Gontijo-Lopes et al. [12] argue it is the
|
| 48 |
+
37 perceived distribution shift that needs to be minimised, while maximising the sample vicinity.
|
| 49 |
+
38 Formalising these concepts, they introduce augmentation “diversity” and “affinity”. Diversity is
|
| 50 |
+
39 defined as the training loss when learning with artificial samples, while affinity quantifies the
|
| 51 |
+
40 difference between the accuracy on original test data and augmented test data for a reference model.
|
| 52 |
+
41 The latter penalises augmentations that introduce artificial information to which the model is not
|
| 53 |
+
42 invariant, implicitly assuming that training with that information is detrimental to generalisation.
|
| 54 |
+
43 In summary, it is currently assumed that the artefacts introduced by changes in the data are negligible
|
| 55 |
+
44 when evaluating models, while those introduced when training are important and undesirable. Does
|
| 56 |
+
45 the artificial information added by analysis methods not have major side-effects or does it lead to
|
| 57 |
+
46 biased results? Conversely, are the artefacts important when training with modified data? Do they
|
| 58 |
+
47 cause models to learn better or worse representations?
|
| 59 |
+
48 We set out to answer these questions and find that when the secondary effects of data manipulation
|
| 60 |
+
49 are not accounted for, results can be misleading, especially in comparative studies. Subsequently, we
|
| 61 |
+
50 construct empirical counter-examples which disprove common beliefs in the literature and highlight
|
| 62 |
+
51 the importance of understanding the changes MSDAs introduce. Our contributions are:
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 1: Examples of image distortions. For test-time distortions (Occlusion and Shuffled grid) only Image 1 was used. For mixing augmentations, the first row was generated with a mixing factor of 0.2, while the second one with 0.5.
|
| 66 |
+
|
| 67 |
+
• We show that increasingly popular model interpretation and analysis methods are biased, relying on unfounded assumptions (Section 2);
|
| 68 |
+
• For measuring occlusion robustness, we propose a fairer alternative (Section 3);
|
| 69 |
+
• We show that, in contrast to what is widely assumed, not preserving the data distribution can lead to learning better representations (Section 4).
|
| 70 |
+
|
| 71 |
+
# 57 2 Are artefacts negligible when analysing classifiers?
|
| 72 |
+
|
| 73 |
+
58 To verify whether distorting data at evaluation time could have side-effects previously not considered,
|
| 74 |
+
59 we look at the increase in misclassifications per category. That is, from the number of incorrect
|
| 75 |
+
60 predictions of a model evaluated on modified data, we subtract the incorrect predictions when testing
|
| 76 |
+
61 on original data. If there is a significant increase for a specific class, it indicates that the distortion
|
| 77 |
+
62 introduces features the model associates with that class. We refer to this phenomenon as “data
|
| 78 |
+
63 interference”. Considering only positive differences, we denote the increase in the percentage of
|
| 79 |
+
64 misclassifications for class $c$ of a given model $m$ by $i _ { c } ^ { m }$ . We define the Data Interference $D I$ index as
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
D I = \frac { i _ { c _ { m a x } } } { \sum _ { c } i _ { c } } i _ { c _ { m a x } } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
65 where $c _ { m a x }$ is the class with highest mean increase across all runs. The $D I$ index measures the
|
| 86 |
+
66 percentage represented by the dominant class $c _ { m a x }$ weighted by its increase. A high index value
|
| 87 |
+
67 indicates a sharp increase for a particular class which is consistent across runs. We associate this with
|
| 88 |
+
68 an overlap between introduced artefacts and learnt representations. In Appendix B.1 we experiment
|
| 89 |
+
69 with an alternative index, where we weight by the highest increase of a model across the 5 runs, so as
|
| 90 |
+
70 to obtain a worst-case analysis. As expected, we observe a more accentuated bias in this case.
|
| 91 |
+
71 To obtain models with different behaviours in a controlled manner, we make use of data augmentation.
|
| 92 |
+
72 Since it is sufficient to identify some common cases in which models are disfavoured, we choose to
|
| 93 |
+
73 reduce our environmental impact by restricting the analysis to simple MSDAs that combine images
|
| 94 |
+
74 without incurring additional computation time or external models. As will be argued in Section 3, we
|
| 95 |
+
75 expect the unfairness to be present in most settings, thus the exact choice of augmentation is irrelevant.
|
| 96 |
+
76 We focus on two popular MSDAs, MixUp [40] and CutMix [39]. MixUp linearly interpolates between
|
| 97 |
+
77 two images to obtain a new training example, while CutMix masks out a rectangular region of an
|
| 98 |
+
78 image with the corresponding region of another image. Besides the aforementioned methods, we
|
| 99 |
+
79 also employ FMix due to its irregularly shaped masks sampled from Fourier space, which will play
|
| 100 |
+
80 an important role in our analysis. Note that although the masking methods sample the size of the
|
| 101 |
+
81 occluding patch from the same distribution, in CutMix part of the rectangle can be outside the image,
|
| 102 |
+
82 which leads to less occluded samples overall. We refer to models by the augmentations they were
|
| 103 |
+
83 trained with and use “basic” to label the models trained without MSDA.
|
| 104 |
+
84 Throughout the paper, we do 5 runs of each experiment with PreAct-ResNet18 [15] as the default
|
| 105 |
+
85 architecture. We include results for BagNet [2] and VGG [33] in the Appendices. The main data sets
|
| 106 |
+
86 we report results on are CIFAR-10/100 [21], Tiny ImageNet [34], FashionMNIST [38], ImageNet [29].
|
| 107 |
+
87 For ImageNet we use pretrained ResNet-101 models made publicly available by Harris et al. [14].
|
| 108 |
+
88 Note that the only experiments for which we are unable to run repeats are those on ImageNet, since
|
| 109 |
+
89 only one model per augmentation is provided. For full experimental details, see Appendix A. Total
|
| 110 |
+
90 emissions of training the models evaluated in this paper are estimated [22] to be $3 8 . 0 7 \mathrm { k g C O _ { 2 } e q }$ , to
|
| 111 |
+
91 which $1 3 . 1 1 \mathrm { k g C O _ { 2 } e q }$ more are added during the analysis. The hope is that our findings will lead to a
|
| 112 |
+
92 better understanding which in the long run would help reduce erroneous research directions without
|
| 113 |
+
93 needing to empirically disprove them, lessening the future carbon footprint of the community.
|
| 114 |
+
|
| 115 |
+
Table 1: DI index $( \% )$ for PreAct-ResNet18 on grid-shuffled images for four different types of models. Results with the highest average are given in italic and the lowest in bold. Information introduced when shuffling tends to interfere less with the representations of FMix and CutMix models.
|
| 116 |
+
|
| 117 |
+
<table><tr><td></td><td>basic</td><td>MixUp</td><td>FMix</td><td>CutMix</td></tr><tr><td>CIFAR-10</td><td>2.90±1.10</td><td>2.54±1.29</td><td>0.60±0.26</td><td>0.33±0.17</td></tr><tr><td>CIFAR-100</td><td>1.05±0.59</td><td>0.93±0.44</td><td>0.23±0.29</td><td>0.11±0.10</td></tr><tr><td>FashionMNIST</td><td>1.12±0.63</td><td>2.73±1.64</td><td>1.12±0.61</td><td>0.70±0.22</td></tr><tr><td>Tiny ImageNet</td><td>2.58±4.73</td><td>0.54±0.27</td><td>0.38±0.12</td><td>0.14±0.12</td></tr><tr><td>ImageNet</td><td>0.82</td><td>1.49</td><td>0.58</td><td>1</td></tr></table>
|
| 118 |
+
|
| 119 |
+
# 94 2.1 Shape bias
|
| 120 |
+
|
| 121 |
+
95 For assessing shape bias through sample manipulation, the standard procedure is to choose between
|
| 122 |
+
96 dividing the image in 4, 16 or 64 patches to be shuffled. Since FashionMNIST images are smaller,
|
| 123 |
+
97 we choose a $2 \times 2$ grid, for CIFAR-10/100 and Tiny ImageNet $4 \times 4$ , while for ImageNet we use
|
| 124 |
+
98 an $8 \times 8$ grid. However, similar results are obtained for different grid sizes (Appendix B.2). The
|
| 125 |
+
99 large DI index in Table 1 indicates that either basic or MixUp models tend to associate the features
|
| 126 |
+
100 artificially introduced by patch-shuffling with a certain class. We take a closer look at the distribution
|
| 127 |
+
101 of misclassifications for CIFAR-10 and notice that the basic model tends to wrongly predict the class
|
| 128 |
+
102 “Truck” (Figure 2). This is not at all surprising, given that the strong horizontal and vertical edges are
|
| 129 |
+
103 highly indicative of this class. Similar observations can be made for other data sets (Appendix B.3).
|
| 130 |
+
104 Thus, we believe the grid-shuffling approach is causing models which are not invariant to strong
|
| 131 |
+
105 horizontal and vertical edges to appear to rely more heavily on shape information. A model not
|
| 132 |
+
106 affected by this transformation could be considered texture-biased if we accept the larger definition
|
| 133 |
+
107 of texture as local information. However, there is a question about the extent to which the reciprocal
|
| 134 |
+
108 is true; A model can be invariant to the aforementioned edges because it is indeed relying on texture
|
| 135 |
+
109 information or simply because it uses different shape-related features.
|
| 136 |
+
110 Is a model necessarily more affected by patch-shuffling if it has a higher shape bias? To answer
|
| 137 |
+
111 this question, we can use another method of determining shape and texture bias to find a counter
|
| 138 |
+
112 example. We analyse the ImageNet models on the Geirhos Style-Transfer (GST) [11] data set. GST
|
| 139 |
+
113 contains artificially generated images where the shape belongs to one class and the texture to another.
|
| 140 |
+
114 There are 16 coarse classes that encompass a number of ImageNet categories to which they are
|
| 141 |
+
115 mapped. The bias of the models is given by the accuracy obtained when the label is set to either the
|
| 142 |
+
116 shape or texture. Using this well-known method of identifying shape bias we want to find models
|
| 143 |
+
117 which have similar biases but different DI indices when patch-shuffling. This would indicate that
|
| 144 |
+
118 sensitivity to shuffling is not necessarily linked to increased shape bias.
|
| 145 |
+
119 The results in Table 2 show that the basic model does not have a higher shape bias than masking
|
| 146 |
+
120 methods although it has a significantly higher DI index, as we have seen in Table 1. We repeat the
|
| 147 |
+
121 same experiment on the Tiny ImageNet [34] data set. Geirhos et al. [11] use WordNet [26] to map the
|
| 148 |
+
122 1000 categories to the 16 classes of the GST data set. A number of ImageNet categories that belong
|
| 149 |
+
123 to the 16 higher-level classes of GST are missing. For this reason, a poorer overall performance is
|
| 150 |
+
124 expected and the results could differ slightly given a better fit between the sets. Nonetheless, we find
|
| 151 |
+
125 again no significant correlation between masking augmentation and texture bias. We also include in
|
| 152 |
+
126 Table B.2 the results for BagNet models, which have smaller receptive fields and so are forced to use
|
| 153 |
+
127 more local information. Even in this case, we find a high DI for the basic model and no difference
|
| 154 |
+
128 in texture bias compared to MSDA. Thus, a model which is more affected by patch-shuffling is not
|
| 155 |
+
129 necessary more shaped-bias. In other words, models can appear to have vastly different shape bias
|
| 156 |
+
130 when evaluated on randomly rearranged patches, albeit in reality their bias is similar. The inability of
|
| 157 |
+
131 this method to account for artefacts makes it unfair and unreliable.
|
| 158 |
+
|
| 159 |
+
Table 2: Accuracy of augmentation-trained ImageNet and Tiny ImageNet models on the GST data set when the label is taken to be either the shape or texture. There is no clear correlation between masking methods and low texture bias.
|
| 160 |
+
|
| 161 |
+
<table><tr><td colspan="3">ImageNet</td><td colspan="2">Tiny ImageNet</td></tr><tr><td></td><td>Shape</td><td>Texture</td><td>Shape</td><td>Texture</td></tr><tr><td>basic</td><td>20.31</td><td>53.28</td><td>10.56±0.65</td><td>26.04±1.77</td></tr><tr><td>MixUp</td><td>24.14</td><td>60.31</td><td>12.02±0.33</td><td>27.77±1.56</td></tr><tr><td>FMix</td><td>21.25</td><td>53.43</td><td>10.40±0.39</td><td>19.90±2.12</td></tr><tr><td>CutMix</td><td>1</td><td>1</td><td>10.54±0.38</td><td>23.72±2.42</td></tr></table>
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 2: Difference in incorrect predictions on CIFAR-10 for the basic model.
|
| 165 |
+
|
| 166 |
+
# 2.2 Occlusion measurement
|
| 167 |
+
|
| 168 |
+
133 We want to determine whether the same issue identified in the case of shape bias evaluation applies
|
| 169 |
+
134 to occlusion robustness measures. We focus on CutOcclusion, where a rectangular black patch is
|
| 170 |
+
135 superimposed on test images and the robustness is given by the resulting accuracy. We perform
|
| 171 |
+
136 the same experiment as before, where the $D I$ index is now measured when testing on rectangle
|
| 172 |
+
137 occluded images. There is no standardised distortion when measuring CutOcclusion, with the size
|
| 173 |
+
138 and positioning of the obstructing patch varying between studies. Most often in prior art a lack of
|
| 174 |
+
139 robustness is noted for large occluders [e.g. 5, 42]. For this reason, we sample the size of the patch
|
| 175 |
+
140 from a Beta(2,1) distribution, allowing the occluding patch to lie outside the image (as it is done for
|
| 176 |
+
141 augmenting with CutMix and CutOut [7]). This allows us to capture both the cases in which either
|
| 177 |
+
142 the centre or the border area is masked out but requires a non-uniform distribution to counter for the
|
| 178 |
+
143 patches existing outside the image. We also sample from a uniform distribution where the occluder is
|
| 179 |
+
144 restricted to be positioned within the image boundaries and obtain similar results (See Appendix C.1).
|
| 180 |
+
145 Table 3 shows that a significant gap in the DI index can be identified for each of the data sets. This
|
| 181 |
+
146 indicates that some models will again be disadvantaged. We additionally find that data interference is
|
| 182 |
+
147 present for different architectures, when overlapping patches from external images or using differently
|
| 183 |
+
148 shaped masks (Appendix B.4). Thus, the result of CutOcclusion and its variants is highly dependent
|
| 184 |
+
149 on the problem at hand. That is, whether the artefacts introduced by the artificial occlusion are
|
| 185 |
+
150 salient features of the model depends on what features are naturally distinctive for the model. Just as
|
| 186 |
+
151 for randomly shuffling tiles, by occluding images using a particularly shaped patch, one implicitly
|
| 187 |
+
152 measures a model’s affinity to certain features, albeit those features might be discriminative. This
|
| 188 |
+
153 deems such methods inappropriate for fairly assessing robustness and texture bias.
|
| 189 |
+
154 A related observation was made by Hooker et al. [17] who note the pitfalls of manipulating data to
|
| 190 |
+
155 determine feature importance. They point out that when simply superimposing uniform patches over
|
| 191 |
+
156 image features, it is difficult to asses how much of the reduction in accuracy is caused by the absence
|
| 192 |
+
157 of those features and how much is due to images becoming out of distribution. To address this, the
|
| 193 |
+
158 most important features identified by an estimator are masked out both on train and test data, closing
|
| 194 |
+
159 the gap between the two sets. Hooker et al. then train and evaluate models on the newly generated
|
| 195 |
+
160 images. Unlike for interpretability methods, the subject of occlusion robustness studies is the model
|
| 196 |
+
161 itself, which makes training with a modified version of the data an inviable option. In the following
|
| 197 |
+
162 section we explore ways of overcoming this bias when measuring occlusion robustness.
|
| 198 |
+
|
| 199 |
+
Table 3: DI index $( \% )$ when occluding with black patches. The highest results are given in italic and the lowest in bold. For each data set, there exists a non-negligible gap in the DI index.
|
| 200 |
+
|
| 201 |
+
<table><tr><td></td><td>basic</td><td>MixUp</td><td>FMix</td><td>CutMix</td></tr><tr><td>CIFAR-10</td><td>5.48±1.31</td><td>0.75±0.55</td><td>0.87±0.92</td><td>2.87±3.04</td></tr><tr><td>CIFAR-100</td><td>3.25±1.31</td><td>0.80±0.46</td><td>1.28±2.48</td><td>1.36±0.63</td></tr><tr><td>FashionMNIST</td><td>0.44±0.34</td><td>2.59±1.05</td><td>0.92±1.79</td><td>0.97±1.82</td></tr><tr><td>Tiny</td><td>2.40±0.82</td><td>1.88±0.61</td><td>0.47±0.41</td><td>4.62±4.93</td></tr><tr><td>Imagenet</td><td>1.28</td><td>4.50</td><td>1.02</td><td></td></tr></table>
|
| 202 |
+
|
| 203 |
+
# 163 3 What are fairer alternatives?
|
| 204 |
+
|
| 205 |
+
164 We propose a simple, more carefully defined measure that aims to decouple the machine’s edge bias
|
| 206 |
+
165 from the occlusion robustness, which we refer to as “interplay occlusion” (iOcclusion). Interplay
|
| 207 |
+
166 occlusion reflects the change in the interplay between performance on seen and unseen data. Formally,
|
| 208 |
+
|
| 209 |
+
$$
|
| 210 |
+
i O c c l u s i o n _ { i } = \left| \frac { \mathcal { A } ( \mathcal { D } _ { t r a i n } ^ { i } ) - \mathcal { A } ( \mathcal { D } _ { t e s t } ^ { i } ) } { \mathcal { A } ( \mathcal { D } _ { t r a i n } ) - \mathcal { A } ( \mathcal { D } _ { t e s t } ) } \right| ,
|
| 211 |
+
$$
|
| 212 |
+
|
| 213 |
+
167 where $\mathcal A ( \mathcal D )$ denotes the accuracy on a given data set $\mathcal { D }$ , and $\mathcal { D } ^ { i }$ is the data set resulting from
|
| 214 |
+
168 removing $i \%$ pixels of each image. The intuition is that on train data robust models are less sensitive
|
| 215 |
+
169 to the artefacts of the occlusion policy for small levels of occlusion, resulting in a large difference in
|
| 216 |
+
170 accuracy from that on unseen data. The performance of both train and test gets close to random as
|
| 217 |
+
171 the percentage of occluded data approaches $90 \%$ and we expect the gap to fall off quicker for less
|
| 218 |
+
172 robust models. This change in interplay is taken with respect to the generalisation gap of the model,
|
| 219 |
+
173 such that the quality of the model fit in itself does not interfere with the robustness measure.
|
| 220 |
+
174 Although iOcclusion reduces data interference, other factors have to also be considered when choosing
|
| 221 |
+
175 a masking method for computing $\mathcal { D } ^ { i }$ , such as the number of contiguous components or the amount of
|
| 222 |
+
176 salient information masked out. In this paper we choose to generate masks using Grad-CAM [30],
|
| 223 |
+
177 such that the area with most salient $\mathrm { i } \%$ pixels is covered. It must be noted that this method implicitly
|
| 224 |
+
178 assumes there could be multiple occluders and has the downside of incurring a higher environmental
|
| 225 |
+
179 cost. For this, we also experiment with using rectangular or Fourier-sampled masks and conclude
|
| 226 |
+
180 that although random masking makes the process noisier, the exact choice of masking method is of
|
| 227 |
+
181 secondary importance as long as the occluder’s granularity is accounted for. Appendix C.4 provides
|
| 228 |
+
182 discussion and results on these alternative instances of iOcclusion, as well as differences in their
|
| 229 |
+
183 carbon footprint. For a fair comparison, throughout this section we do not allow the obstructing patch
|
| 230 |
+
184 when measuring CutOcclusion to lie outside the image such that the fraction removed is exact.
|
| 231 |
+
185 Assessing the correctness of such a measure is difficult in the absence of a baseline. For the remainder
|
| 232 |
+
186 of this section we will build varied experiments to attest the validity of our method. We focus on the
|
| 233 |
+
187 key results, but include additional ones and further experiments in Appendix C. Since occlusion in
|
| 234 |
+
188 real-life scenarios could be caused by non-uniformly coloured objects, an appropriate measure must
|
| 235 |
+
189 generalise across colour patterns. When computing iOcclusion and CutOcclusion, we superimpose
|
| 236 |
+
190 patches from images belonging to a different data set and compare the results to those obtained
|
| 237 |
+
191 when occluding with black patches only. For visual clarity, Figure 3 presents the results for the
|
| 238 |
+
192 least and most robust models (see Appendix C.2 for a full comparison). For iOcclusion, using
|
| 239 |
+
193 uniform occluders gives similar results to its non-uniform version, whereas the CutOcclusion measure
|
| 240 |
+
194 provides an inconsistent model evaluation.
|
| 241 |
+
195 As we have argued, in addition to not being sensitive to the colour pattern of the patch, a fair measure
|
| 242 |
+
196 must also be invariant to the shape of the patch. To empirically confirm iOcclusion reduces the
|
| 243 |
+
197 importance of edge information, we aim to obtain a model that is robust to occlusion, but at the same
|
| 244 |
+
198 time has a high DI index (it is sensitive to edge information). To this end, we create a variation of
|
| 245 |
+
199 FMix, Random Masks (RM), where at the beginning of the training process three masks are randomly
|
| 246 |
+
200 sampled from Fourier space. For each batch, one of the three is chosen uniformly at random. While
|
| 247 |
+
201 the RM models are not sensitive to black-patch occlusion, when masking with patterned patches they
|
| 248 |
+
202 have a higher DI index than FMix, as desired. Table 4 gives results for a fraction of 0.3 pixels covered
|
| 249 |
+
203 by a non-uniform occluder. Our measure reflects the robustness of training with RM, situating it close
|
| 250 |
+
204 to other masking methods. On the other hand, because CutOcclusion implicitly penalises models
|
| 251 |
+
205 with high DI index, according to this measure RM appears almost as sensitive to occlusion as MixUp.
|
| 252 |
+
206 Figure B.4 shows results for a wider range of fractions.
|
| 253 |
+
207 Another problem that occurs when purely looking at post-masking accuracy is weaker models would
|
| 254 |
+
208 erroneously appear less robust. We show this by reversing the problem: we evaluate the same model
|
| 255 |
+
209 on two different subsets of the CIFAR-100 data set: typical and tail images as categorised by Feldman
|
| 256 |
+
210 and Zhang [10]. They consider a train-test sample pair to belong to the tail of the data distribution if
|
| 257 |
+
211 the test sample is correctly classified when a model is trained with the train sample and incorrectly
|
| 258 |
+
212 without it. CutOcclusion would indicate that models are significantly more robust to occluding typical
|
| 259 |
+
213 examples. However, a closer analysis makes us doubt this conclusion. The raw accuracy on both
|
| 260 |
+
214 train and test data for tail examples is lower than for the typical ones. In fact, the performance when
|
| 261 |
+
215 occluding images decreases at the same rate for the two subsets. By way of definition, iOcclusion
|
| 262 |
+
216 allows a fair comparison of robustness regardless of the overall performance of a model (Figure 4).
|
| 263 |
+
217 As we evidenced through controlled experiments, there are many cases that CutOcclusion does not
|
| 264 |
+
218 properly address. From a model analysis perspective, correctly assessing the occlusion robustness
|
| 265 |
+
219 could lead to better understanding and development of models and training procedures. Equally
|
| 266 |
+
220 important, it has applicability for real-world deployments where no prior knowledge exists about the
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 3: CutOcclusion (left) and iOcclusion (right) when occluding with black patches (uniform) and patches taken from other images (nonuniform). iOcclusion gives more consistent results.
|
| 270 |
+
|
| 271 |
+
Table 4: DI index $( \% )$ and occlusion robustness for models trained on CIFAR-10 when obstructing $30 \%$ of the image pixels with non-uniform patches. When measuring the robustness with CutOcclusion, RM appears significantly less robust than CutMix due to its sensitivity to patching with rectangles, while iOcclusion highlights the robustness specific to training with FMix-like masks. Given in bold is the closest result to that of RM for each evaluation.
|
| 272 |
+
|
| 273 |
+
<table><tr><td></td><td>basic</td><td>MixUp</td><td>CutMix</td><td>FMix</td><td>RM</td></tr><tr><td>DI index</td><td>1.67±0.27</td><td>1.00±0.31</td><td>0.17±0.16</td><td>0.15±0.03</td><td>0.39±0.07</td></tr><tr><td>CutOcclusion</td><td>47.97±0.52</td><td>58.65±1.01</td><td>76.56±6.36</td><td>78.00±0.45</td><td>60.79±5.03</td></tr><tr><td>iOcclusion</td><td>0.21±0.10</td><td>0.57±0.18</td><td>1.09±0.17</td><td>1.46±0.07</td><td>1.20±0.23</td></tr></table>
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 4: CutOcclusion (left) and iOcclusion (right) for the basic and FMix models on two subsets of the same data set: tail and typical. Evaluating the models with iOcclusion on the two types of samples leads to mostly overlapping robustness levels. That is, they do not differ outside the margin of error. On the contrary, CutOcclusion incorrectly finds the models to be less robust on tail data.
|
| 277 |
+
|
| 278 |
+
Table 5: Augmentation comparison on CIFAR-10. We consider two variants when calculating diversity. One is computing the cross-entropy loss using the label of the majority class (Diversity), as for mixing in [19]. The alternative, MixDiversity, takes a linear combination of the two cross-entropy losses.
|
| 279 |
+
Table 6: DI index $( \% )$ measured for nonuniform occlusion when training without the class with highest increase in incorrect predictions. Again, a gap can be noted, supporting the idea that data interference is not specific to peculiar cases.
|
| 280 |
+
|
| 281 |
+
<table><tr><td></td><td>Affinity</td><td>Diversity</td><td>MixDiversity</td><td></td><td>CIFAR-10</td><td>CIFAR-100</td></tr><tr><td>MixUp</td><td>-12.58±0.14</td><td>0.41±0.01</td><td>0.84±0.00</td><td>MixUp</td><td>0.39±0.15</td><td>1.22±0.19</td></tr><tr><td>FMix</td><td>-25.55±0.26</td><td>0.34±0.01</td><td>0.65±0.00</td><td>FMix</td><td>0.08±0.06</td><td>0.50±0.21</td></tr></table>
|
| 282 |
+
|
| 283 |
+
possible shapes of the obstructions. While this aspect of generality is the strength of our approach, it must be stressed that when there exists a limited set of known possible occluders, evaluating robustness specifically to them could be safer. Incorrectly assessing robustness can have severe effects especially when applied to autonomous vehicles or medical imaging. We do not propose a universal solution, but rather suggest an alternative to the biased approach for the common scenario in which the environment is not controlled and little is known about all the potential occluders. However, even in this case, our metric should be taken as a guide when analysing models. Although iOcclusion aims to address data interference, since a ground-truth does not exist, it cannot be guaranteed that this method provides fair results in the absolute.
|
| 284 |
+
|
| 285 |
+
230 The strength of the bias will depend on the data in question and some applications will be more heavily
|
| 286 |
+
231 affected than others. We have seen that for natural images this bias does exist. To confirm that we have
|
| 287 |
+
232 not just identified isolated cases, we remove the class that has the highest increase in mispredictions
|
| 288 |
+
233 and retrain the models on the remaining classes. We find that the bias is again present (Table 6),
|
| 289 |
+
234 but with respect to another class. For example, in the case of CIFAR-10, after removing the “Truck”
|
| 290 |
+
235 class, models mispredict rectangle-occluded images as “Boat” (Appendix D). Thus, the edge artefacts
|
| 291 |
+
236 are very likely to interfere with learnt representations since they are such fundamental features. From
|
| 292 |
+
237 an evaluation perspective, as we have seen, this impacts assessment methods and must be accounted
|
| 293 |
+
238 for. From the training perspective, such a widespread data interference of masking distortions would
|
| 294 |
+
239 indicate a large perceptual shift in the data when performing MSDA. In the following section we
|
| 295 |
+
240 investigate the importance of the artefacts in this case and their implications.
|
| 296 |
+
|
| 297 |
+
# 241 4 Is the magnitude of the distribution shift important?
|
| 298 |
+
|
| 299 |
+
Traditionally it was believed that a good augmentation should have minimal distribution shift. Most recently, it has been argued that it is the degree of the perceived shift that determines augmentation quality [12]. We start with the perceptual gap of training with MSDA, as proposed in Gontijo-Lopes et al. [12]. Reiterating, this is given by the difference between the performance of the baseline model when presented with original test data and augmented test data and is termed “affinity”. Subsequently,
|
| 300 |
+
|
| 301 |
+
247 we address the gap in the wider sense, as is often sought in prior art. We first argue that high affinity
|
| 302 |
+
248 and high diversity are not necessarily desirable. Indeed, on CIFAR-10, we find FMix, a better
|
| 303 |
+
249 performing augmentation, to have both lower affinity and lower diversity than MixUp (Table 5). For
|
| 304 |
+
250 diversity, we compute the cross-entropy loss where the label is taken to be that of the majority class.
|
| 305 |
+
251 Similar results are obtained with the MixUp loss, where a weighted average of the true labels is taken.
|
| 306 |
+
252 While intuitively for a high level of affinity, high diversity could correspond to better methods,
|
| 307 |
+
253 the converse does not hold. We argue this is because affinity is rather an analysis of the learnt
|
| 308 |
+
254 representations of the reference model and cannot give an insight into the quality of the augmentation
|
| 309 |
+
255 or its effect on learning. The limitations of affinity are intimately linked to those of CutOcclusion.
|
| 310 |
+
256 We have seen in Section 3 that the bias of the basic model is present not only when obstructing an
|
| 311 |
+
257 image with a uniform patch, but also when mask-mixing. As such, an augmentation will have a
|
| 312 |
+
258 lower affinity if it introduces artefacts that could otherwise lead to learning better representations
|
| 313 |
+
259 when used in the training process. We believe this issue extends to other approaches that aim to
|
| 314 |
+
260 motivate the success of MSDA through reduced distribution shift. Henceforth, we focus on bringing
|
| 315 |
+
261 further supporting evidence that the importance lies in the invariance introduced by the shift and its
|
| 316 |
+
262 interaction with the given problem rather than its magnitude.
|
| 317 |
+
|
| 318 |
+
# 263 4.1 If it is not the magnitude that matters, is it the direction?
|
| 319 |
+
|
| 320 |
+
264 We use empirical evidence to argue against previous assumptions behind the success of MSDA and
|
| 321 |
+
265 propose the study of introduced bias as a more informative research direction. Here we use the term
|
| 322 |
+
266 “bias” to refer to a drift in the learnt representations introduced by the change in the training procedure.
|
| 323 |
+
267 A fundamental difference to classical training is that in the case of augmentation the samples are no
|
| 324 |
+
268 longer independent. Mixed-sampling takes this even further. An immediate question is, does the
|
| 325 |
+
269 added correlation lead to more meaningful representations? It is claimed that the strength of MixUp
|
| 326 |
+
270 lies in causing the model to behave linearly between two images [40] or in pushing the examples
|
| 327 |
+
271 towards their mean [3]. Both of these claims rely on the combined images to be generated from the
|
| 328 |
+
272 same distribution. We want to verify to which extent this is necessary for a successful augmentation.
|
| 329 |
+
|
| 330 |
+
It has been argued that label mixing has a negligible effect on the final model performance [19, 18, 14, 24]. We use the reformulated objective setting [18, 14], where targets are not mixed and the mixing coefficient is drawn from an imbalanced Beta distribution. This allows us to apply MSDA between data sets. Thus, for training a model on a data set, we use an additional one whose targets will be ignored. As an example, a model that is learning to predict CIFAR-10 images will be trained on a combination of CIFAR-10 and CIFAR-100 images, with the target of the former. This scenario breaks the added correlation between training examples. Note that when mixing between data sets we use the same procedure as when performing regular MSDA, without improving the process.
|
| 331 |
+
|
| 332 |
+
281 Table 7 contains the results of this experiment, showing that an accuracy similar to or better than that
|
| 333 |
+
282 of regular MSDA can be obtained by performing inter-dataset MSDA.This invalidates the argument
|
| 334 |
+
283 that the power of MixUp resides in causing the model to act linearly between samples. Another
|
| 335 |
+
284 observation is that for FMix and MixUp, introducing elements from CIFAR-100 when training
|
| 336 |
+
285 models on the CIFAR-10 problem does not harm the learning process. The reciprocal, however, does
|
| 337 |
+
286 not hold. Hence, the “distribution shift” is more intimately linked to the problem at hand and aiming
|
| 338 |
+
287 to characterise an augmentation based on the distance from the original distribution is a limiting
|
| 339 |
+
288 approach, especially when the distance is measured as perceived by a reference model.
|
| 340 |
+
289 We believe an explanation is that the artefacts created when putting together images from CIFAR-10
|
| 341 |
+
290 with those of CIFAR-100 could introduce information that makes the separation of the 10 classes
|
| 342 |
+
291 easier. However, if the information happens to interfere with a feature that is important for separating
|
| 343 |
+
292 the CIFAR-100 categories, the performance could degrade on this data set. This singular experiment
|
| 344 |
+
293 is not sufficient to draw any general conclusions. However, it does show that shifting two distributions
|
| 345 |
+
294 by the same amount can have different effects on the model performance. Thus, the specifics of the
|
| 346 |
+
295 bias introduced could be more important than its magnitude. While some level of data similarity has
|
| 347 |
+
296 to be preserved when performing MSDA, it is far from being the objective of such data-distorting
|
| 348 |
+
297 approaches which, as we will argue further, should be rather seen as forms of regularisation.
|
| 349 |
+
298 We have seen that for all considered data sets, artefacts introduced by masking methods seem to
|
| 350 |
+
299 overlap with common features. This has led us to believe that MSDA training could help bypass
|
| 351 |
+
300 some of the simplicity bias. The simplicity bias refers to the tendency of deep models to find simple
|
| 352 |
+
301 representations and has been used to justify the success of deep models [28, 36]. Recent research
|
| 353 |
+
302 shows that this propensity causes models to ignore complex features that explain the data well in
|
| 354 |
+
303 favour of elementary features, even when they lead to worse performance [31, 16].
|
| 355 |
+
|
| 356 |
+
Table 7: Accuracy on CIFAR-10 (left) and CIFAR-100 (right) upon mixing with samples from a different data set. The baseline is the accuracy when training with a single data set using the reformulated objective. In the interest of space, CIFAR-110 is used to refer to mixing with CIFAR100 when training on the CIFAR-10 problem and vice-versa.
|
| 357 |
+
|
| 358 |
+
<table><tr><td></td><td>MixUp</td><td>FMix</td><td>CutMix</td><td>MixUp</td><td>FMix</td><td>CutMix</td></tr><tr><td>baseline</td><td>94.18±0.34</td><td>94.36±0.28</td><td>94.67±0.20</td><td>74.68±0.37</td><td>75.75±0.31</td><td>74.19±0.50</td></tr><tr><td>CIFAR-110</td><td>94.70±0.27</td><td>94.80±0.32</td><td>94.66±0.12</td><td>72.36±1.04</td><td>74.80±0.55</td><td>74.47±0.39</td></tr><tr><td>Fashion</td><td>92.28±0.28</td><td>95.03±0.10</td><td>94.61±0.19</td><td>66.40±1.86</td><td>74.46±0.57</td><td>74.06±0.28</td></tr></table>
|
| 359 |
+
|
| 360 |
+
Although it could seem natural that since MSDAs are not augmentations in the VRM sense, they will increase the complexity of the problem, we design an experiment to support this claim. Similarly to Shah et al. [31], we combine CIFAR-10 and MNIST [23] samples. Since they have the same number of classes, we can easily associate each class of one data set with a corresponding one from the other. Thus, we stack a padded image from the $k$ th class of MNIST on top of a sample from the kth class of CIFAR-10, such that a $3 \times 6 4 \times 3 2$ image is obtained. We then randomly combine the test images and separately compute the accuracy with respect to the targets of each data set.
|
| 361 |
+
|
| 362 |
+
311 The predictions with respect to the CIFAR-10 labels are no better than random $( 1 0 . 0 4 _ { \pm 0 . 1 1 } )$ , while
|
| 363 |
+
312 the accuracy with respect to the MNIST images remains high $( 9 9 . 5 7 _ { \pm 0 . 7 2 } )$ . Thus, models trained
|
| 364 |
+
313 on this combination are mostly relying on MNIST images to make predictions. Similar behaviours
|
| 365 |
+
314 have previously been associated with simplicity bias. Subsequently, when training, we perform FMix
|
| 366 |
+
315 only on MNIST images and observe that this is enough to reverse the results. Evaluating against the
|
| 367 |
+
316 CIFAR-10 label gives an accuracy of $8 6 . 6 0 _ { \pm 0 . 3 4 }$ , while testing against the MNIST label only gives
|
| 368 |
+
317 $1 1 . 6 1 _ { \pm 0 . 3 0 }$ . We find that this also holds true for the other MSDAs. Thus, performing these distortions
|
| 369 |
+
318 on the simpler data set increases its complexity to the point where it surpasses that of CIFAR-10.
|
| 370 |
+
319 Previously, we presented evidence that masking MSDA does not necessarily promote learning neither
|
| 371 |
+
320 more shape nor texture information. In the light of this fact along with the results from this section,
|
| 372 |
+
321 we believe image distortions force the model to learn more complex both shape and texture-specific
|
| 373 |
+
322 features. Thus, in this paper we pointed out that the shift in learnt representations can lead to better
|
| 374 |
+
323 models and simply quantifying the distribution shift can be misleading. An open question remains:
|
| 375 |
+
324 How can we better capture the bias that is introduced and its quality? We believe understanding how
|
| 376 |
+
325 a relatively small change in the data distribution impacts learnt representations could lead the way to
|
| 377 |
+
326 characterising the relationship between data and model generalisation.
|
| 378 |
+
|
| 379 |
+
# 327 5 Conclusions
|
| 380 |
+
|
| 381 |
+
328 Distorting data is such a commonplace procedure, yet little effort has been devoted to investigating its
|
| 382 |
+
329 broader effects. This is particularly problematic when image modifications are applied in analyses. We
|
| 383 |
+
330 show a number of cases in which this leads to biased results. For occlusion robustness measurement,
|
| 384 |
+
331 we propose an alternative. The insights we gain from this endeavour point towards the study of data
|
| 385 |
+
332 characteristics as a cornerstone of our understanding and raise a number of questions about mixed
|
| 386 |
+
333 sample data augmentation, on which we subsequently focus. We note that they interfere with features
|
| 387 |
+
334 that are consistently found across a number of data sets and conclude that the methods commonly
|
| 388 |
+
335 used are forms of mixed sample regularisation rather than augmentation. A limitation of previous
|
| 389 |
+
336 studies that aim to explain their success is the focus on trying to argue similarity with original data,
|
| 390 |
+
337 rather than explaining the bias introduced by the distortion. Correctly interpreting it is important
|
| 391 |
+
338 not only for making the models trustable but also for injecting more informed prior knowledge in
|
| 392 |
+
339 future applications. Beyond their practical benefits, we believe MSDAs have the potential to help
|
| 393 |
+
340 characterise the interplay between data and learnt representations. Overall, the purpose of our paper
|
| 394 |
+
341 is to encourage better practice when dealing with all forms of data distortions.
|
| 395 |
+
|
| 396 |
+
References
|
| 397 |
+
[1] Rocío Alaiz-Rodríguez and Nathalie Japkowicz. Assessing the impact of changing environments on classifier performance. In Conference of the Canadian Society for Computational Studies of Intelligence, pages 13–24. Springer, 2008.
|
| 398 |
+
[2] Wieland Brendel and Matthias Bethge. Approximating CNNs with bag-of-local-features models works surprisingly well on imagenet. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\equiv$ SkfMWhAqYQ.
|
| 399 |
+
[3] Luigi Carratino, Moustapha Cissé, Rodolphe Jenatton, and Jean-Philippe Vert. On mixup regularization. arXiv preprint arXiv:2006.06049, 2020.
|
| 400 |
+
[4] Olivier Chapelle, Jason Weston, Léon Bottou, and Vladimir Vapnik. Vicinal risk minimization. In Advances in neural information processing systems, pages 416–422, 2001.
|
| 401 |
+
[5] Sanghyuk Chun, Seong Joon Oh, Sangdoo Yun, Dongyoon Han, Junsuk Choe, and Youngjoon Yoo. An empirical evaluation on robustness and uncertainty of regularization methods. arXiv preprint arXiv:2003.03879, 2020.
|
| 402 |
+
[6] David A Cieslak and Nitesh V Chawla. A framework for monitoring classifiers’ performance: when and why failure occurs? Knowledge and Information Systems, 18(1):83–108, 2009.
|
| 403 |
+
[7] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 404 |
+
[8] Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. Exploring the landscape of spatial robustness. In International Conference on Machine Learning, pages 1802–1811. PMLR, 2019.
|
| 405 |
+
[9] Alhussein Fawzi and Pascal Frossard. Measuring the effect of nuisance variables on classifiers. In Edwin R. Hancock Richard C. Wilson and William A. P. Smith, editors, Proceedings of the British Machine Vision Conference (BMVC), pages 137.1–137.12. BMVA Press, September 2016. ISBN 1-901725-59-6. doi: 10.5244/C.30.137. URL https://dx.doi.org/10.5244/ C.30.137.
|
| 406 |
+
[10] Vitaly Feldman and Chiyuan Zhang. What neural networks memorize and why: Discovering the long tail via influence estimation. Advances in Neural Information Processing Systems, 33, 2020.
|
| 407 |
+
[11] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\equiv$ Bygh9j09KX.
|
| 408 |
+
[12] Raphael Gontijo-Lopes, Sylvia J Smullin, Ekin D Cubuk, and Ethan Dyer. Affinity and diversity: Quantifying mechanisms of data augmentation. arXiv preprint arXiv:2002.08973, 2020.
|
| 409 |
+
[13] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 410 |
+
[14] Ethan Harris, Antonia Marcu, Matthew Painter, Mahesan Niranjan, Adam Prügel-Bennett, and Jonathon Hare. Understanding and enhancing mixed sample data augmentation. arXiv preprint arXiv:2002.12047, 2020.
|
| 411 |
+
[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pages 630–645. Springer, 2016.
|
| 412 |
+
[16] Katherine Hermann and Andrew Lampinen. What shapes feature representations? exploring datasets, architectures, and training. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 9995–10006. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/ paper/2020/file/71e9c6620d381d60196ebe694840aaaa-Paper.pdf. [17] Sara Hooker, Dumitru Erhan, Pieter-Jan Kindermans, and Been Kim. A benchmark for interpretability methods in deep neural networks. In Advances in Neural Information Processing Systems, pages 9737–9748, 2019.
|
| 413 |
+
392 [18] Ferenc Huszár. mixup: Data-dependent data augmentation, 2017. URL http://www. inference.vc/mixup-data-dependent-data-augmentation/. [19] Hiroshi Inoue. Data augmentation by pairing samples for images classification. arXiv preprint arXiv:1801.02929, 2018. [20] Narine Kokhlikyan, Vivek Miglani, Miguel Martin, Edward Wang, Bilal Alsallakh, Jonathan Reynolds, Alexander Melnikov, Natalia Kliushkina, Carlos Araya, Siqi Yan, et al. Captum: A unified and generic model interpretability library for pytorch. arXiv preprint arXiv:2009.07896, 2020. [21] Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009. [22] Alexandre Lacoste, Alexandra Luccioni, Victor Schmidt, and Thomas Dandres. Quantifying the carbon emissions of machine learning. arXiv preprint arXiv:1910.09700, 2019. [23] Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http: //yann.lecun.com/exdb/mnist/. [24] Daojun Liang, Feng Yang, Tian Zhang, and Peter Yang. Understanding mixup training methods. IEEE Access, 6:58774–58783, 2018. [25] Tiange Luo, Tianle Cai, Mengxiao Zhang, Siyu Chen, Di He, and Liwei Wang. Defective convolutional layers learn robust CNNs. arXiv preprint arXiv:1911.08432, 2019. [26] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11): 39–41, 1995. [27] Chaithanya Kumar Mummadi, Ranjitha Subramaniam, Robin Hutmacher, Julien Vitay, Volker Fischer, and Jan Hendrik Metzen. Does enhanced shape bias improve neural network robustness to common corruptions? In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=yUxUNaj2Sl. [28] Preetum Nakkiran, Gal Kaplun, Dimitris Kalimeris, Tristan Yang, Benjamin L Edelman, Fred Zhang, and Boaz Barak. SGD on neural networks learns functions of increasing complexity. arXiv preprint arXiv:1905.11604, 2019.
|
| 414 |
+
418 [29] 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. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y. [30] 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, pages 618–626, 2017. [31] Harshay Shah, Kaustav Tamuly, Aditi Raghunathan, Prateek Jain, and Praneeth Netrapalli. The pitfalls of simplicity bias in neural networks. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 9573–9585. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/6cfe0e6127fa25df2a0ef2ae1067d915-Paper.pdf.
|
| 415 |
+
431 [32] Baifeng Shi, Dinghuai Zhang, Qi Dai, Zhanxing Zhu, Yadong Mu, and Jingdong Wang. Informative dropout for robust representation learning: A shape-bias perspective. In International Conference on Machine Learning, pages 8828–8839. PMLR, 2020. [33] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015.
|
| 416 |
+
[34] Stanford. Tiny imagenet visual recognition challenge, 2015. URL https://tiny-imagenet. herokuapp.com/.
|
| 417 |
+
[35] 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.
|
| 418 |
+
[36] Guillermo Valle-Perez, Chico Q. Camargo, and Ard A. Louis. Deep learning generalizes because the parameter-function map is biased towards simple functions. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id ${ } = { }$ rye4g3AqFm.
|
| 419 |
+
[37] Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 1999.
|
| 420 |
+
[38] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 421 |
+
[39] 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 Proceedings of the IEEE International Conference on Computer Vision, pages 6023–6032, 2019.
|
| 422 |
+
[40] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=r1Ddp1-Rb.
|
| 423 |
+
[41] Tianyuan Zhang and Zhanxing Zhu. Interpreting adversarially trained convolutional neural networks. In International Conference on Machine Learning, pages 7502–7511. PMLR, 2019.
|
| 424 |
+
[42] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, number 34(07), pages 13001–13008, 2020.
|
| 425 |
+
|
| 426 |
+
# Checklist
|
| 427 |
+
|
| 428 |
+
1. For all authors...
|
| 429 |
+
|
| 430 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] (b) Did you describe the limitations of your work? [Yes] See lines 174–184, 221–229,
|
| 431 |
+
292–294. (c) Did you discuss any potential negative societal impacts of your work? [Yes] See lines
|
| 432 |
+
221–229 as well as 89–93 and Appendix C.4. (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 433 |
+
|
| 434 |
+
2. If you are including theoretical results...
|
| 435 |
+
|
| 436 |
+
(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]
|
| 437 |
+
|
| 438 |
+
3. If you ran experiments...
|
| 439 |
+
|
| 440 |
+
(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]
|
| 441 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix A.
|
| 442 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] The only exception is when using publicly available models, as mentioned in Section 2.
|
| 443 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix A.
|
| 444 |
+
|
| 445 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 446 |
+
|
| 447 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See lines 84–93 and Appendix A.
|
| 448 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 449 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 450 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 451 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 452 |
+
|
| 453 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 454 |
+
|
| 455 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 456 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 457 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/VKVShLsAuZ/VKVShLsAuZ.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NeuroLKH: Combining Deep Learning Model with Lin-Kernighan-Helsgaun Heuristic for Solving the Traveling Salesman Problem
|
| 2 |
+
|
| 3 |
+
Liang Xin Nanyang Technological University Singapore XINL0003@e.ntu.edu.sg
|
| 4 |
+
|
| 5 |
+
Wen Song Shandong Unviersity Qingdao, China wensong@email.sdu.edu.cn
|
| 6 |
+
|
| 7 |
+
Zhiguang Cao∗ Singapore Institute of Manufacturing Technology Singapore zhiguangcao@outlook.com
|
| 8 |
+
|
| 9 |
+
Jie Zhang Nanyang Technological University Singapore jzhang@ntu.edu.sg
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
We present NeuroLKH, a novel algorithm that combines deep learning with the strong traditional heuristic Lin-Kernighan-Helsgaun (LKH) for solving Traveling Salesman Problem. Specifically, we train a Sparse Graph Network (SGN) with supervised learning for edge scores and unsupervised learning for node penalties, both of which are critical for improving the performance of LKH. Based on the output of SGN, NeuroLKH creates the edge candidate set and transforms edge distances to guide the searching process of LKH. Extensive experiments firmly demonstrate that, by training one model on a wide range of problem sizes, NeuroLKH significantly outperforms LKH and generalizes well to much larger sizes. Also, we show that NeuroLKH can be applied to other routing problems such as Capacitated Vehicle Routing Problem (CVRP), Pickup and Delivery Problem (PDP), and CVRP with Time Windows (CVRPTW).
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Traveling Salesman Problem (TSP) is an important NP-hard Combinatorial Optimization Problem with extensive industrial applications in various domains. Exact methods have the exponential worstcase computational complexity, which renders them impractical for solving large-scale problems in reality, even for highly optimized solvers such as Concorde. In contrast, although lacking optimality guarantees and non-trivial theoretical analysis, heuristic solvers search for near-optimal solutions with much lower complexity. They are usually desirable for real-life applications where statistically better performance is the goal.
|
| 18 |
+
|
| 19 |
+
Traditional heuristic methods are manually designed based on expert knowledge which is usually human-interpretable. However, supported by the recent development of deep learning technology, modern methods train powerful deep neural networks to learn the complex patterns from the TSP instances generated from some specific distributions [32, 1, 6, 21, 18, 34, 33, 35]. The performances of deep learning models for solving TSP are constantly improved by these works, which unfortunately are still far worse than the strong traditional heuristic solver and generally limited to relatively small problem sizes.
|
| 20 |
+
|
| 21 |
+
We believe that learning-based methods should be combined with strong traditional heuristic algorithms, which is also suggested by [2]. In such a way, while learning the complex patterns from data samples, the efficient heuristics highly optimized by researchers for decades can be effectively utilized, especially for problems such as TSP which are well-studied due to their importance.
|
| 22 |
+
|
| 23 |
+
The Lin-Kernighan-Helsgaun (LKH) algorithm [12, 13] is generally considered as a very strong heuristic for solving TSP, which is developed based on the Lin-Kernighan (LK) heuristic [25]. LKH iteratively searches for $\lambda$ -opt moves to improve the existing solution where $\lambda$ edges of the tour are exchanged for another $\lambda$ edges to form a shorter tour. To save the searching time, the edges to add are limited to a small edge candidate set, which is created before search. One of the most significant contributions of LKH is to generate the edge candidate set based on Minimum Spanning Tree, rather than using the nearest neighbor method in the LK heuristic. Furthermore, LKH applies penalty values to the nodes which are iteratively optimized using subgradient optimization (will be detailed in Section 3). The optimized node penalties are used by LKH to transform the edge distances for the $\lambda$ -opt searching process and improve the quality of edge candidate sets, both of which help find better solutions.
|
| 24 |
+
|
| 25 |
+
However, the edge candidate set generation in LKH is still guided by hand-crafted rules, which could limit the quality of edge candidates and hence the search performance. Moreover, the iterative optimization of node penalties is time-consuming, especially for large-scale problems. To address these limitations, we propose NeuroLKH, a novel learning-based method featuring a Sparse Graph Network (SGN) combined with the highly efficient $\lambda$ -opt local search of LKH. SGN outputs the edge scores and node penalties simultaneously, which are trained by supervised learning and unsupervised learning, respectively. NeuroLKH transforms the edge distances based on the node penalties learned inductively from training instances, instead of performing iterative optimization for each instance, therefore saving a significant amount of time. More importantly, at the same time the edge scores are used to create the edge candidate set, leading to substantially better sets than those created by LKH. NeuroLKH trains one single network on TSP instances across a wide range of sizes and generalizes well to substantially larger problems with minutes of unsupervised offline fine-tuning to adjust the node penalty scales for different sizes.
|
| 26 |
+
|
| 27 |
+
Same as existing works on deep learning models for solving TSP, NeuroLKH aims to learn complex patterns from data samples to find better solutions for instances following specific distributions. Following the evaluation process in these works, we perform extensive experiments. Results show that NeuroLKH improves the baseline algorithms by large margins, not only across the wide range of training problem sizes, but also on much larger problem sizes not used in training. Furthermore, NeuroLKH trained with instances of relatively simple distributions generalizes well to traditional benchmark with various node distributions such as the TSPLIB [27]. Also, we show that NeuroLKH can be applied to guide the extension of LKH [14] for more complicated routing problems such as the Capacitated Vehicle Routing Problem (CVRP), Pickup and Delivery Problem (PDP) and CVRP with Time Windows (CVRPTW), using generated test datasets and traditional benchmarks [28, 30].
|
| 28 |
+
|
| 29 |
+
# 2 Related works
|
| 30 |
+
|
| 31 |
+
Till now, for routing problems such as TSP, most works focus on learning construction heuristics, where deep neural networks are trained to sequentially select the nodes to visit with supervised learning [32, 15] or reinforcement learning [1, 6, 26, 21, 22]. Similarly, networks are trained to pick edges in [18, 20]. In another line of works [4, 33, 16, 9, 5], researchers employ deep learning models to learn the actions for improving existing solutions, such as picking regions and rules or selecting nodes for the 2-opt heuristic. However, the performance of these works is still quite far from the strong non-learning heuristics such as LKH. In addition, they focus only on relatively small-sized problems (up to hundreds of nodes).
|
| 32 |
+
|
| 33 |
+
A recent work [8] generalizes a network pre-trained on fixed-size small graphs to solve larger size problems by sampling small sub-graphs to infer and merging the results. This interesting idea can be applied to very large graphs, however, the performance is still inferior to LKH and deteriorates rapidly with the increase of problem size.
|
| 34 |
+
|
| 35 |
+
In a concurrent work [36], a VSR-LKH method is proposed which also applies a learning method in combination with LKH. However, very different from our method, VSR-LKH applies traditional reinforcement learning during the searching process for each instance, instead of learning patterns for a class of instances. Moreover, VSR-LKH aims to guide the decision on edge selections within the edge candidate set, which is generated using the original procedure of LKH. NeuroLKH significantly outperforms VSR-LKH by large margins in all the settings of our experiments on testing instances following the training distributions, especially when the time limits are short. Even more impressively, NeuroLKH achieves performance similar to VSR-LKH on traditional benchmark TSPLIB [27] with various node distributions, which are very different from the training distributions for NeuroLKH.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: NeuroLKH algorithm and the original LKH algorithm.
|
| 39 |
+
|
| 40 |
+
# 3 Preliminaries: LKH algorithm
|
| 41 |
+
|
| 42 |
+
The Lin-Kernighan-Helsgaun (LKH) algorithm [12, 13] is a local optimization algorithm developed based on the $\lambda$ -opt move [24], where $\lambda$ edges in the current tour are exchanged by another set of $\lambda$ edges to achieve a shorter tour. While solving one instance, the LKH algorithm can conduct multiple trials to find better solutions. In each trial, starting from a randomly initialized tour, it iteratively searches for $\lambda$ -opt exchanges that improve the tour, until no such exchanges can be found. In each iteration, the $\lambda$ -opt exchanges are searched in the ascending order of variable $\lambda$ and the tour will be replaced once an exchange is found to reduce the tour distance.
|
| 43 |
+
|
| 44 |
+
One central rule is that the $\lambda$ -opt searching process is restricted and directed by an edge candidate set, which is created before search based on the $\alpha$ -measure using sensitivity analysis of the Minimum Spanning Tree. Here we briefly introduce the related concepts. A TSP graph can be viewed as an undirected graph $G = ( V , E )$ with $V$ as the set of $| V |$ nodes and $E$ as the set of edges weighted by distances. A spanning tree of $G$ is a connected graph with $| V | - 1$ edges from $G$ and no cycles where any pair of nodes is connected by a path. A 1-tree of $G$ is a spanning tree for the graph of node set $V \backslash \{ 1 \}$ } combined with two edges in $E$ connected to node 1, an arbitrary special node in $V$ . A minimum 1-tree is the 1-tree with minimum length. The $\alpha$ -measure of an edge $( i , j ) \in E$ for graph $G$ is defined as $\alpha ( i , j ) = \mathbb { L } ( T ^ { + } ( i , j ) ) - \mathbb { L } ( T )$ , where $\mathbb { L } ( T )$ is the length of Minimum 1-Tree $T$ and $\mathbb { L } ( T ^ { + } ( i , j ) )$ is the length of Minimum 1-Tree $T ^ { + } ( i , j )$ required to include the edge $( i , j )$ . The $\alpha$ -measure of an edge can be viewed as the extra length of the Minimum 1-Tree to include this edge.
|
| 45 |
+
|
| 46 |
+
The edge candidate set consists of the $k$ edges with the smallest $\alpha$ -measures connected to each node $k = 5$ as default). During the $\lambda$ -opt searching process, the edges to be included into the new tour are limited to the edges in this candidate set, and edges with smaller $\alpha$ -measures will have higher priorities to be searched over. Therefore this candidate set not only restricts but also directs the search.
|
| 47 |
+
|
| 48 |
+
Moreover, the quality of $\alpha$ -measures can be improved significantly by a subgradient optimization method. If we add a penalty $\pi _ { i }$ to each node $i$ and transform the original distance $s _ { i , j }$ of the edge $( i , j )$ to a new distance $c _ { i , j }$ as $c _ { i , j } = s _ { i , j } + \pi _ { i } + \pi _ { j }$ , the optimal tour for the TSP will stay the same but the Minimum 1-Tree usually will change. Because by definition, a Minimum 1-Tree with node degrees all equal to 2 is an optimal solution for the corresponding TSP instance. With the length of Minimum 1-Tree resulting from the penalty $\pi = ( \pi _ { 1 } , . . . , \pi _ { | V | } )$ as $\mathsf { \bar { L } } ( T _ { \pi } )$ , $w ( \pi ) = \mathbb { L } ( T _ { \pi } ) - 2 \bar { \Sigma _ { i } } \pi _ { i }$ is a lower bound of the optimal tour distance for the original TSP instance. LKH applies subgradient optimization [11] to iteratively maximize this lower bound for multiple steps until convergence by applying $\pi ^ { \tau + 1 } = \pi ^ { \tau } + t ^ { \tau } ( d ^ { \tau } - 2 )$ at step $\tau$ , where $t ^ { \tau }$ is the scalar step size, $d ^ { \tau }$ is the vector of node degrees in the Minimum 1-Tree with penalty $\pi ^ { \tau }$ . Therefore, the node degrees are pushed towards 2. The $\alpha$ -measures after this optimization will substantially improve the quality of edge candidate set. Furthermore, the transformed edge distance $c _ { i , j }$ after this optimization helps find better solutions when used during the searching process for $\lambda$ -opt exchanges.
|
| 49 |
+
|
| 50 |
+
# 4 The proposed NeuroLKH algorithm
|
| 51 |
+
|
| 52 |
+
The subgradient optimization in LKH can substantially improve the quality of edge candidate sets based on the $\alpha$ -measures, and transform the edge distances effectively to achieve reasonably good performance. However, it still has major limitations as the optimization process is over one instance iteratively until convergence, which costs a large amount of time, especially for large-scale problems. Moreover, even after subgradient optimization, some critical patterns could be missed by the relatively straightforward sensitivity analysis of spanning tree. Therefore, the quality of edge candidate set could be further improved by large margins, which will in turn improve the overall performance.
|
| 53 |
+
|
| 54 |
+
We propose the NeuroLKH algorithm, which employs a Sparse Graph Network to learn the complex patterns associated with the TSP instances generated from a distribution. Concretely, the network will learn the edge scores and node penalties simultaneously with a multi-task training process. The edge scores are trained with supervised learning for creating the edge candidate set, while the node penalties are trained with unsupervised learning for transforming the edge distances. The architecture of NeuroLKH is presented in Figure 1, along with the original LKH algorithm. We will detail the Sparse Graph Network, the training process and the proposed NeuroLKH algorithm in the following.
|
| 55 |
+
|
| 56 |
+
# 4.1 Sparse Graph Network
|
| 57 |
+
|
| 58 |
+
For the Sparse Graph Network (SGN), we format the TSP instance as a sparse directed graph $G ^ { * } = ( V , E ^ { * } )$ containing the node set $V$ and a sparse edge set $E ^ { * }$ which only includes the $\gamma$ shortest edges pointed from each node, as shown in the leftmost green box in Figure 1, where the circles represent the nodes and the diamonds represent the directed edges. Sparsification of the graph is crucial for effectively training the deep learning model on large TSP instances and generalizing to even larger sizes. Note that edge $( i , j )$ belongs to $E ^ { * }$ does not necessarily mean that the oppositedirection edge $( j , i )$ belongs to $E ^ { * }$ . The node inputs $x _ { v } \in \mathbb { R } ^ { 2 }$ are the node coordinates and the edge inputs $x _ { e } \in \mathbb { R }$ are the edge distances. Though we focus on 2-dimensional TSP with Euclidean distance as the other deep learning literature like [21], the model can be applied to other kinds of TSP.
|
| 59 |
+
|
| 60 |
+
The SGN consists of 1) one encoder embedding the edge and node inputs into the corresponding feature vectors, and 2) two decoders for the edge scores and node penalties, respectively.
|
| 61 |
+
|
| 62 |
+
Encoder. The encoder first linearly projects the node inputs and the edge inputs into feature vectors $v _ { i } ^ { 0 } \in \mathbb { R } ^ { D }$ and $e _ { i , j } ^ { 0 } \in \mathbb { R } ^ { j }$ , respectively, where $D$ is the feature dimension, $i \in V$ and $( i , j ) \in E ^ { * }$ . Then the node and edge features are embedded with $L$ Sparse Graph Convolutional Layers, which are defined formally as follows:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { c l } { { a t t n _ { i , j } ^ { \iota } = e x p ( W _ { a } ^ { \iota } e _ { i , j } ^ { { \iota - 1 } } ) \oslash \displaystyle \sum _ { ( i , m ) \in E * } e x p ( W _ { a } ^ { \iota } e _ { i , m } ^ { { \iota - 1 } } ) , } } \\ { { \strut } } \\ { { \displaystyle v _ { i } ^ { l } = v _ { i } ^ { l - 1 } + R e L U ( B N ( W _ { s } ^ { \iota } v _ { i } ^ { { \iota - 1 } } + \sum _ { ( i , j ) \in E ^ { * } } a t t n _ { i , j } ^ { \iota } \odot W _ { n } ^ { \iota } v _ { j } ^ { { \iota - 1 } } ) ) , } } \\ { { \strut } } \\ { { \strut } } \\ { { \displaystyle r _ { i , j } ^ { l } = \left\{ W _ { \iota } ^ { l } e _ { j , i } ^ { { \iota - 1 } } , \begin{array} { l l } { { \mathrm { i f ~ } ( j , i ) \in E ^ { * } } } \\ { { W _ { \iota } ^ { \iota } p ^ { l } , } } \end{array} \right. } } & { { \mathrm { o t h e r w i s e } } } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
e _ { i , j } ^ { l } = e _ { i , j } ^ { l - 1 } + R e L U ( B N ( W _ { f } ^ { l } v _ { i } ^ { l - 1 } + W _ { t } ^ { l } v _ { j } ^ { l - 1 } + W _ { o } ^ { l } e _ { i , j } ^ { l - 1 } + r _ { i , j } ^ { l } ) ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\odot$ and $\oslash$ represent the element-wise multiplication and the element-wise division, respectively; $l = 1 , 2 , . . . , L$ is the layer index; $W _ { a } ^ { l } , W _ { s } ^ { l } , W _ { n } ^ { l } , \dot { W } _ { r } ^ { l } , W _ { f } ^ { l } , W _ { t } ^ { l } , W _ { o } ^ { l } \in \mathbb { R } ^ { D \times D }$ and $p ^ { l } \in \mathbb { R } ^ { D }$ are trainable parameters; Eqs. (2) and (4) consist of a Skip-Connection layer [10] and a Batch Normalization layer [17] in each; and the idea of element-wise attention in Eq. (1) is adopted from [3]. As the input graph $G ^ { * }$ is directed and sparse, edges with different directions are embedded separately. But obviously the embedding of an edge $( i , j )$ should benefit from knowing whether its opposite-direction counterpart $( j , i )$ is also in the graph and the information of $( j , i )$ , which motivates our design of Eqs. (3) and (4).
|
| 73 |
+
|
| 74 |
+
Decoders. The edge decoder takes the edge embeddings $e _ { i , j } ^ { L }$ from the encoder and embeds them with two layers of linear projection followed by ReLU activation into efi,j . Then the edge scores $\beta _ { i , j }$ are calculated as follows:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\beta _ { i , j } = \frac { e x p ( W _ { \beta } e _ { i , j } ^ { f } ) } { \sum _ { ( i , m ) \in E ^ { * } } e x p ( W _ { \beta } e _ { i , m } ^ { f } ) } ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Algorithm 1 NeuroLKH Algorithm
|
| 81 |
+
|
| 82 |
+
<table><tr><td>Input: TSP instance,number of trials K Output: TSP solution BestTour</td></tr><tr><td></td></tr><tr><td>1: Convert the TSP instance to SGN input G*,xu, xe</td></tr><tr><td>2: Calculate the edge scores βi,j and the node penalties Ti with Eqs. (5) and (6)</td></tr><tr><td>3: EdgeDistance=TransformEdgeDistance(π)</td></tr><tr><td></td></tr><tr><td>4: EdgeCandidateSet=CreateEdgeCandidateSet(β) 5: BestTour=LKHSearchingTrials(EdgeDistance,EdgeCandidateSet,K)</td></tr></table>
|
| 83 |
+
|
| 84 |
+
Similarly, the node decoder first embeds the node embeddings $v _ { i } ^ { L }$ with two layers of linear projection and ReLU activation into $v _ { i } ^ { f }$ . Then the node penalties $\pi _ { i }$ are calculated as follows:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\pi _ { i } = C \operatorname { t a n h } ( W _ { \pi } v _ { i } ^ { f } ) ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $W _ { \beta }$ ${ \sf \Psi } _ { 3 } , W _ { \pi } \in \mathbb { R } ^ { D \times 1 }$ are trainable parameters; $C = 1 0$ is used to keep the node penalties in the range of $[ - 1 0 , 1 0 ]$ .
|
| 91 |
+
|
| 92 |
+
# 4.2 Training process
|
| 93 |
+
|
| 94 |
+
We train the network to learn the edge scores with supervised learning. And the edge loss $\mathcal { L } _ { \beta }$ is detailed as follows:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } _ { \beta } = - \frac { 1 } { \gamma | V | } \sum _ { ( i , j ) \in E ^ { * } } ( \mathbb { 1 } \{ ( i , j ) \in E _ { o } ^ { * } \} \log \beta _ { i , j } + \mathbb { 1 } \{ ( i , j ) \notin E _ { o } ^ { * } \} \log ( 1 - \beta _ { i , j } ) ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $E _ { o } ^ { * } = \{ ( i , j ) \in E ^ { * } | ( i , j )$ in the optimal tour}. Effectively, we increase the edge scores $\beta _ { i , j }$ if the edge $( i , j )$ belongs to the optimal tour and decrease them otherwise.
|
| 101 |
+
|
| 102 |
+
The node penalties are trained by unsupervised learning. Similar to the goal of subgradient optimization in LKH, we are trying to transform the Minimum 1-Tree generated from the TSP graph $G$ closer to a tour where all nodes have a degree of 2. An important distinction from LKH is that we are learning the patterns for a class of TSP instances following a distribution, instead of optimizing the penalties for a specific TSP instance. The node loss ${ \mathcal { L } } _ { \pi }$ is detailed as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathcal { L } _ { \pi } = - \frac { 1 } { \vert V \vert } \sum _ { i \in V } ( d _ { i } ( \pi ) - 2 ) \pi _ { i } ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $d _ { i } ( \pi )$ is the degree of node $i$ in the Minimum 1-Tree $T _ { \pi }$ induced with penalty $\pi = ( \pi _ { 1 } , . . . , \pi _ { | V | } )$ The penalties are increased for nodes with degrees larger than 2 and decreased for nodes with smaller degrees. The SGN is trained for the task of outputting the edge scores and node penalties simultaneously with the loss function $\mathcal { L } = \mathcal { L } _ { \beta } + \eta _ { \pi } \mathcal { L } _ { \pi }$ , where $\eta _ { \pi }$ is the coefficient for balancing the two losses.
|
| 109 |
+
|
| 110 |
+
# 4.3 NeuroLKH algorithm
|
| 111 |
+
|
| 112 |
+
The process of using NeuroLKH to solve one instance is shown in Algorithm 1. Firstly, the TSP instance is converted to a sparse directed graph $G ^ { * }$ . Then the SGN encoder embeds the nodes and edges in $G ^ { * }$ into feature embeddings, based on which the decoders output the node penalties $\pi$ and edge scores $\beta$ . Afterwards, NeuroLKH creates powerful edge candidate set and transforms the distance of each edge effectively, which further guides NeuroLKH to conduct multiple LKH trials to find good solutions. We detail each part as follows.
|
| 113 |
+
|
| 114 |
+
Transform Edge Distance. Based on the node penalties $\pi _ { i }$ , the original edge distances $s _ { i , j }$ are transformed into new distances $c _ { i , j } = s _ { i , j } + \pi _ { i } + \pi _ { j }$ , which will be used in the search process. With such a transformation, the optimal solution tour will stay the same. And the tour distance calculated with the transformed edge distances will be subtracted by $2 \sum _ { i \in V } \pi _ { i }$ to restore the tour distance for the original TSP.
|
| 115 |
+
|
| 116 |
+
Create Edge Candidate Set. For each node $i \in V$ , the edge scores $\beta _ { i , j }$ are sorted for $( i , j ) \in E ^ { * }$ and the edges with the top- $k$ largest scores are included in the edge candidate set. Edges with larger scores have higher priorities in the candidate set, which will be tried first for adding in the exchange during the LKH search process. Note that neither the original LKH nor NeuroLKH can guarantee all the edges in the optimal tour to be included in the edge candidate set. However, optimal solutions are still likely to be found during the multiple trials.
|
| 117 |
+
|
| 118 |
+
LKH Searching Trials. To solve one TSP instance, LKH conducts multiple trials to find better solutions. In each trial, one tour is initialized randomly, and iterations of LKH search are conducted for the $\lambda$ -opt exchanges until the tour can no longer be improved by such exchanges. In each iteration, LKH searches in the ascending order of $\lambda$ for $\lambda$ -opt exchanges to reduce tour length, which will be applied once found.
|
| 119 |
+
|
| 120 |
+
Based on the trained SGN network, NeuroLKH infers the edge distance transformation and candidate set to guide the LKH trials, which is done by performing forward calculation through the model. This is much faster than the corresponding procedure in the original LKH, which employs subgradient optimization on each instance iteratively until convergence and is apparently time-consuming especially for large-scale problems. More importantly, rather than using the hand-crafted rules based on sensitivity analysis in the original LKH, NeuroLKH learns to create edge candidate set of much higher quality with the powerful deep model, leading to significantly better performance.
|
| 121 |
+
|
| 122 |
+
# 5 Experiments
|
| 123 |
+
|
| 124 |
+
In this section, we conduct extensive experiments on TSP with various sizes and show the effective performance of NeuroLKH compared to the baseline algorithms. Our code is publicly available.1
|
| 125 |
+
|
| 126 |
+
Dataset distribution. Closely following the existing works such as [21], we experiment with the 2-dimensional TSP instances in the Euclidean distance space where both coordinates of each node are generated independently from a unit uniform distribution. We train only one network using TSP instances ranging from 101 to 500 nodes. Since the amount of supervision and feedback during training is linearly related to the number of nodes. We generate $\bar { 5 } 0 0 0 0 0 0 / | V |$ instances for each size $| V |$ in the training dataset, resulting in approximately 780000 instances in total. Therefore the amounts of supervision and feedback are kept similar across different sizes. We use Concorde 2 to get the optimal edges $E _ { o } ^ { * }$ for the supervised training of edge scores. For testing, we generate 1000 instances for each testing problem size.
|
| 127 |
+
|
| 128 |
+
Hyperparameters. We choose the number of directed edges pointed from one node in the sparse edge set $E ^ { * }$ as $\gamma = 2 0$ , which results in only $0 . 0 1 \%$ of the edges in the optimal tours missed in $E ^ { * }$ for the training dataset. We also conduct experiments to justify this choice in Appendix Section A. The hidden dimension is set to $D = 1 2 8$ in the network with $L = 3 0$ Sparse Graph Convolutional Layers. The node penalty coefficient in the loss function is $\eta _ { \pi } = 1$ . The network is trained by Adam Optimizer [19] with learning rate of 0.0001 for 16 epochs, which takes approximately 4 days. The deep learning models are trained and evaluated with one RTX-2080Ti GPU. The other parts of experiments without deep models for NeuroLKH and other baselines are conducted with random seed 1234 on an Intel(R) Core(TM) i9-10940X CPU unless stated otherwise. Hyperparameters for the LKH searching process are consistent with the example script for TSP given by LKH available online 3 and those used in [36].
|
| 129 |
+
|
| 130 |
+
# 5.1 Comparative study on TSP
|
| 131 |
+
|
| 132 |
+
Here, we compare NeuroLKH with the original LKH algorithm [13] and the recently proposed VSR-LKH algorithm [36]. We do not compare with other deep learning based methods here because their performances are rather inferior to LKH, and most of them can hardly generalize to problems with more than 100 nodes. One exception is the method in [8], which is tested on large problems but the performances are still far worse than LKH.
|
| 133 |
+
|
| 134 |
+
All algorithms are run once for each testing instance as we find running multiple times only provides very marginal improvement. For each testing problem size, we run the original LKH for 1, 10, 100, and 1000 trials, and record the total amounts of time in solving the 1000 instances. Then we impose the same amounts of time as time limits to NeuroLKH and VSR-LKH for solving the same 1000 instances for fair comparison. Note that for NeuroLKH, the solving time is the summation of the inference time of SGN on GPU and LKH searching time on CPU. In the following tables, for each size and time limit, we report the average performance (tour distance) and the total solving time for the 1000 testing instances.
|
| 135 |
+
|
| 136 |
+
Table 1: Comparative results on training sizes
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Time(s)</td><td colspan="2">|V|=100</td><td rowspan="2">Time(s)</td><td colspan="2">|V|= 200</td><td rowspan="2"></td><td colspan="2">|V|= 500</td><td rowspan="2">Gap(%oo)</td></tr><tr><td>Obj</td><td>Gap(%oo)</td><td></td><td>Obj Gap(%oo)</td><td>Time(s)</td><td>Obj</td></tr><tr><td>Concorde</td><td>207</td><td>*7.753246</td><td>0.000</td><td>1072</td><td></td><td>*10.701303</td><td>0.000</td><td>17022</td><td>*16.541830</td><td>0.000</td></tr><tr><td rowspan="3">LKH (1 trial) VSR-LKH</td><td rowspan="3">33</td><td>7.755071</td><td>2.353</td><td rowspan="3"></td><td>10.707043</td><td></td><td rowspan="3"></td><td></td><td></td><td>9.009</td></tr><tr><td>7.754980</td><td>2.236</td><td>80</td><td>10.706739</td><td>5.364 5.080</td><td>16.556733 16.557297</td><td>9.350</td></tr><tr><td>7.753332</td><td>0.111</td><td>10.701873</td><td></td><td>338</td><td>16.543197</td><td>0.826</td></tr><tr><td rowspan="3">NeuroLKH LKH (10 trials) VSR-LKH</td><td rowspan="3">43</td><td></td><td></td><td></td><td></td><td>0.533</td><td></td><td></td><td></td><td></td></tr><tr><td>7.754177</td><td>1.200</td><td>111</td><td>10.703724</td><td></td><td>2.263</td><td>445</td><td>16.548017</td><td>3.740</td></tr><tr><td>7.754184 7.753311</td><td>1.209 0.083</td><td></td><td>10.703997 10.701623</td><td>2.518</td><td></td><td></td><td>16.549591 16.542880</td><td>4.692 0.634</td></tr><tr><td rowspan="2">NeuroLKH LKH (100 trials) VSR-LKH</td><td rowspan="2">127</td><td></td><td>0.263</td><td></td><td></td><td></td><td>0.299 0.423</td><td></td><td></td><td></td></tr><tr><td>7.753450 7.753407</td><td>0.207</td><td>368</td><td>10.701755 10.701687</td><td></td><td>0.359</td><td>1147</td><td>16.543707 16.543085</td><td>1.134 0.759</td></tr><tr><td rowspan="2">NeuroLKH LKH (1000 trials)</td><td rowspan="2"></td><td>7.753270</td><td>0.030</td><td></td><td></td><td>10.701381</td><td>0.073</td><td></td><td>16.542163</td><td>0.201</td></tr><tr><td></td><td></td><td></td><td>10.701351</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">VSR-LKH NeuroLKH</td><td rowspan="2">938</td><td>7.753254</td><td>0.010 0.097</td><td>2805</td><td></td><td>10.701336</td><td>0.045 0.031</td><td>7527</td><td>16.542125 16.541934</td><td>0.178</td></tr><tr><td>7.753322 7.753247</td><td>0.000</td><td></td><td>10.701303</td><td></td><td>0.000</td><td></td><td>16.541847</td><td>0.063 0.010</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Comparison on training sizes. In Table 1, we report the performances of LKH, VSR-LKH and NeuroLKH on three testing datasets with 100, 200 and 500 nodes, which are within the size range of instances used in training. Note that we train only one SGN Network on a wide range of problem sizes and here we use these three sizes to demonstrate the testing performances. We also use the exact solver Concorde on these instances to obtain the optimal solutions and compute the optimality gap for each method. As shown in this table, it is clear that NeuroLKH outperforms both LKH and VSR-LKH significantly and consistently across different problem sizes and with different time limits. Notably, the optimality gaps are reduced by at least an order of magnitude for most of the cases, which is a significant improvement.
|
| 141 |
+
|
| 142 |
+
Generalization analysis on larger sizes. We further show the generalization ability of NeuroLKH on much larger graph sizes of 1000, 2000 and 5000 nodes. Note that while the edge scores in SGN generalize well without any modification, it is hard for the node penalties to directly generalize. This is because they are trained unsupervisedly and SGN does not have any knowledge about how to penalize the nodes for larger TSP instances. Nevertheless, this could be resolved by a simple fine-tuning step. As the learned node embeddings are very powerful, we only fine-tune the very small amount of parameters in the SGN node decoder and keep the other parameters fixed. Specifically, for each of the large sizes, we fine-tune the node decoder for 100 iterations with batch size of $5 0 0 0 / | V |$ , which only takes less than one minute for each size of 1000, 2000 and 5000. This fast fine-tuning process is for TSPs of one size generated from the distribution instead of specific instances, and may be viewed as adjusting the scale of penalties for large sizes. The generalization results are summarized in Table 2. Note that we do not run Concorde here due to the prohibitively long running time, and the gaps are with respect to the best value found by all methods. Clearly, NeuroLKH generalizes well to substantially larger problem sizes and the improvement of NeuroLKH over baselines is significant and consistent across all the settings.
|
| 143 |
+
|
| 144 |
+
Further discussion. The inference time of SGN in NeuroLKH for the 1000 instances of 100, 200, 500, 1000, 2000 and 5000 nodes is 3s, 6s, 16s, 33s, 63s and 208s, which is approximately linear with the number of nodes $| V |$ . In contrast, the subgradient optimization in LKH and VSR-LKH needs 20s, 51s, 266s, 1028s, 4501s and 38970s, which grows superlinearly with $| V |$ and is much longer than SGN inference, especially for large-scale problems. For NeuroLKH, the saved time is used to conduct more trials, which effectively helps to find better solutions. This effect is more salient with short time limit. Meanwhile, the number of trials is also small for short time limit and the algorithm only searches a small number of solutions, in which case the guidance of edge candidate set is more important. Due to these two reasons, the improvement of NeuroLKH over baselines is particularly substantial for short time limit. This is a desirable property especially for time-critical applications and solving large-scale problems, for which large numbers of trials are not feasible.
|
| 145 |
+
|
| 146 |
+
Table 2: Comparative results on generalization sizes
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Time(s)</td><td colspan="2">|V|= 1000 Obj</td><td colspan="3">IV|= 2000</td><td colspan="3">IV|= 5000</td></tr><tr><td></td><td>Gap(%00)</td><td>Time(s)</td><td>Obj</td><td>Gap(%o0)</td><td>Time(s)</td><td>Obj</td><td>Gap(%0)</td></tr><tr><td>LKH(1 trial)</td><td rowspan="2">1183</td><td>23.155916</td><td>10.593</td><td rowspan="2">4843</td><td>32.483851</td><td>11.264</td><td rowspan="2">40048</td><td>51.025519</td><td>12.284</td></tr><tr><td>VSR-LKH</td><td>23.154946</td><td>10.173</td><td>32.485551</td><td>11.788</td><td>51.025539</td><td>12.288</td></tr><tr><td rowspan="2">NeuroLKH LKH(10 trials)</td><td rowspan="2"></td><td>23.133494</td><td>0.899</td><td rowspan="2"></td><td>32.449752</td><td>0.755</td><td rowspan="2"></td><td>50.965382</td><td>0.484</td></tr><tr><td>23.143435</td><td>5.197</td><td>32.466953</td><td>6.056</td><td>50.998721</td><td>7.026</td></tr><tr><td rowspan="2">VSR-LKH NeuroLKH</td><td rowspan="2">1414</td><td>23.143347</td><td>5.159</td><td rowspan="2">5322</td><td>32.467997</td><td>6.377</td><td rowspan="2">41523</td><td>51.000093</td><td>7.295</td></tr><tr><td>23.133066</td><td>0.714</td><td>32.449519</td><td>0.683</td><td>50.965219</td><td>0.452</td></tr><tr><td rowspan="2">LKH(100 trials)</td><td rowspan="2">2567</td><td>23.135427</td><td>1.735</td><td rowspan="2"></td><td>32.455454</td><td>2.512</td><td rowspan="2"></td><td>50.976677</td><td>2.700</td></tr><tr><td>23.134426</td><td>1.302</td><td>32.454427</td><td>2.195</td><td>50.979317</td><td>3.218</td></tr><tr><td rowspan="2">VSR-LKH NeuroLKH</td><td rowspan="2"></td><td>23.132258</td><td>0.365</td><td rowspan="2">7371</td><td>32.448666</td><td>0.420</td><td rowspan="2">47884</td><td>50.964677</td><td>0.345</td></tr><tr><td>23.132216</td><td>0.347</td><td></td><td>0.509</td><td></td><td>0.455</td></tr><tr><td rowspan="2">LKH(1000 trials) VSR-LKH</td><td rowspan="2">12884</td><td>23.131658</td><td>0.105</td><td rowspan="2">25613</td><td>32.448954 32.447953</td><td>0.200</td><td rowspan="2">103885</td><td>50.965233 50.965300</td><td>0.468</td></tr><tr><td>23.131414</td><td>0.000</td><td>32.447304</td><td>0.000</td><td>50.962916</td><td>0.000</td></tr></table>
|
| 149 |
+
|
| 150 |
+
In Figure 2, we plot the performance of the LKH, VSR-LKH and NeuroLKH algorithms for solving the testing datasets with different numbers of nodes against different running time to visualize the improvement process (the resulting objective values after each trial). The time limits are set to the longest ones used in Table 1 and Table 2, which are the running time of LKH with 1000 trials. Clearly, NeuroLKH outperforms both LKH and VSR-LKH significantly and consistently across different problem sizes and with different time limits. In particular, NeuroLKH is superior as it not only reaches good solutions fast but also converges to better solutions eventually. With the same performance (i.e. objective value), NeuroLKH considerably reduces the computational time. We can also conclude that when the time limit is short, the improvement of NeuroLKH over baselines is particularly substantial. In addition, we show that the subgradient optimization is necessary for LKH and VSR-LKH. As exhibited in Figure 2, the performances of both LKH and VSR-LKH are much worse without subgradient optimization (w/o SO). More impressively, even ignoring the preprocessing time (IPT) used for subgradient optimization (pertaining to LKH and VSR-LKH) and Sparse Graph Network inferring (pertaining to NeuroLKH), NeuroLKH still outstrips both LKH and VSR-LKH. Note that this comparison is unfair for NeuroLKH as LKH and VSR-LKH consume much longer preprocessing time which is unavoidable.
|
| 151 |
+
|
| 152 |
+
For the results reported in Table 1 and Table 2, almost all the improvements of NeuroLKH over LKH and VSR-LKH on different sizes and with different time limits are statistically significant with confidence levels larger than $9 9 \%$ . The only one exception is the performance on TSP with 100 nodes and the running time of LKH with 1000 trials where the confidence levels are $9 0 . 5 \%$ and $9 7 . 6 \%$ for the improvements, respectively.
|
| 153 |
+
|
| 154 |
+
In the Appendix Section A, we also show that NeuroLKH substantially outperforms other deep learning based methods [21, 20, 33, 18, 15, 8, 22, 5].
|
| 155 |
+
|
| 156 |
+
Generalization to TSPLIB benchmark. Besides generalization to larger sizes, generalization to different distributions remains a crucial challenge for deep learning based methods in existing works. The TSPLIB benchmark contains instances with various node distributions, making it extremely hard for such methods. We test on all the 72 TSPLIB instances with Euclidean distances and less than 10000 nodes. The number of trials is set to be the number of nodes and the algorithms are run 10 times for each instance following the convention for TSPLIB in [12, 36]. With the various unknown node distributions, we do not fine-tune the model for the node penalties and only use the edge scores in NeuroLKH. For the 24 instances labeled as hard in [36], which the original LKH fails to solve optimally during at least one of the 10 runs, NeuroLKH trained with uniformly distributed data is able to find optimal solutions 6.13 times on average, which is much better than LKH (3.75 times). As an active learning method, VSR-LKH finds optimal solutions 6.42 times on average, slightly better than NeuroLKH. While NeuroLKH improves the results on most hard instances, it could generalize poorly on instances with certain special patterns such as where most nodes are located along several horizontal lines, making it fail to solve 11 of the 48 easy instances optimally for some runs.
|
| 157 |
+
|
| 158 |
+
With the same training dataset size, we trained another model NeuroLKH_M using a mixture of instances with uniformly distributed nodes, clustered nodes with 3-8 clusters, half uniform and half clustered nodes following [30]. NeuroLKH_M finds optimal solutions 6.79 times on average for the hard instances and fails to solve only 5 easy instances optimally for some runs, better than the
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: Performances of LKH, VSR-LKH and NeuroLKH for solving TSP with different sizes against different running time
|
| 162 |
+
|
| 163 |
+
NeuroLKH trained with only uniformly distributed instances. For all the 72 instances, NeuroLKH_M finds optimal solutions 8.74 times on average, which is much better than LKH (7.92 times) but slightly worse than VSR-LKH (8.78 times). Detailed results of each instance are listed in the Appendix Section B.
|
| 164 |
+
|
| 165 |
+
# 5.2 Experiments on other routing problems
|
| 166 |
+
|
| 167 |
+
Finally, we show that NeuroLKH can be easily extended to solve much more complicated routing problems such as the Capacitated Vehicle Routing Problem (CVRP), the Pickup and Delivery Problem (PDP) and CVRP with Time Windows (CVRPTW). We briefly introduce the problems in the Appendix Section C. Different from TSP, the node penalties do not apply to these problems. Therefore, NeuroLKH only learns the edge candidate set. As these three problems are very hard to solve and the optimal solutions are not available in a reasonable amount of time, we use LKH with 10000 trials to get solutions as training labels. The demands, capacities, starts and ends in the time windows are taken as node inputs along with the coordinates. For PDP, we add connections between each pair of pickup and delivery nodes and assign weight matrices for these connections in Eq. (2). For PDP and CVRPTW, the edge directions affect the tour feasibility therefore the model learns the in-direction edge scores and out-direction edge scores for each node with Eq. (5).
|
| 168 |
+
|
| 169 |
+
The node coordinates are also generated uniformly from the unit square for all three problems, following [21, 23]. For CVRP, the demands of customers are generated uniformly from integers $\{ 1 . . 9 \}$ with the capacity fixed as $4 0 + 0 . 1 \times | V |$ , compatible with the largest CVRP (100 nodes) studied in [21]. For CVRPTW, we use the same way to generate demands, capacity, serving time and time windows as [7]. A training dataset for CVRP with 101-500 nodes and $1 2 0 0 0 0 / | V |$ instances for each size (about 180000 in total) is used to train the SGN for 10 epochs. PDP and CVRPTW are harder to solve therefore we use a training dataset with 41-200 nodes and $2 4 0 0 0 0 / | V |$ instances for each size. The other hyperparameters in SGN are the same as TSP and those for LKH searching process are consistent with example scripts given by LKH for CVRP, PDP and CVRPTW (with the SPECIAL hyperparameter).
|
| 170 |
+
|
| 171 |
+
In Table 3, we show the performance of NeuroLKH and the original LKH on testing datasets with 1000 instances for the smallest and largest graph sizes (number of customers) used in training as well as a much larger generalization size. We use the solving time of LKH with 100, 1000, 10000 trials as the time limits. For 100 trials, both methods fail to find feasible solutions for less than $1 \%$ of the PDP and CVRPTW test instances with 300 nodes. Whenever this happens, we push the infeasible visits to the end to get feasible solutions. The inferring time of SGN is 1s, 3s, 7s, 10s, 19s and 40s in total for the 1000 instances in the testing datasets with 40, 100, 200, 300, 500 and 1000 nodes, which is a tiny fraction compared to the LKH searching process. As shown in Table 3, NeuroLKH significantly improves the solution quality compared with the original LKH which is a very strong heuristic solver for all three problems, showing its potential in handling various types of routing problems.
|
| 172 |
+
|
| 173 |
+
Table 3: Comparative results for other routing problems
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Method</td><td></td><td>Time(s)</td><td>Obj</td><td>Gap(%)</td><td>Time(s)</td><td>Obj</td><td>Gap(%)</td><td>Time(s)</td><td>Obj</td><td>Gap(%)</td></tr><tr><td rowspan="5">GRRP</td><td></td><td></td><td>|V|= 100</td><td></td><td></td><td>|V|= 500</td><td></td><td>Generalization |V|</td><td></td><td>=1000</td></tr><tr><td>LKH (100 trials) NeuroLKH</td><td>485</td><td>15.8363 15.7770</td><td>1.675 1.295</td><td>2043</td><td>42.1621 41.7311</td><td>5.394 4.316</td><td>4607</td><td>58.1372 56.6469</td><td>9.750 6.937</td></tr><tr><td>LKH (1000 trials) NeuroLKH</td><td>4520</td><td>15.6483 15.6295</td><td>0.468 0.348</td><td>15812</td><td>40.6103 40.4974</td><td>1.515 1.233</td><td>30133</td><td>54.3412 54.0499</td><td>2.584 2.034</td></tr><tr><td>LKH(10000 trials) NeuroLKH</td><td>45435</td><td>15.5823 15.5754</td><td>0.044 0.000</td><td>166875</td><td>40.0670 40.0043</td><td>0.157 0.000</td><td>319368</td><td>53.1093 52.9723</td><td>0.259 0.000</td></tr><tr><td>LKH (100 trials)</td><td></td><td>|V|= 40</td><td></td><td></td><td>|V|= 200</td><td></td><td>Generalization |V|</td><td></td><td>=300</td></tr><tr><td rowspan="3">P</td><td>NeuroLKH</td><td>115</td><td>6.2495 6.2241</td><td>0.819 0.409</td><td>2832</td><td>13.8390 13.6246</td><td>5.535 3.899</td><td>7939</td><td>17.0913 16.7867</td><td>6.916 5.011</td></tr><tr><td>LKH(1000 trials) NeuroLKH</td><td>845</td><td>6.2088 6.2041</td><td>0.163 0.087</td><td>21216</td><td>13.2850 13.2443</td><td>1.310 0.999</td><td>55643</td><td>16.2447 16.1857</td><td>1.620 1.251</td></tr><tr><td>LKH(10000 trials) NeuroLKH</td><td>7989</td><td>6.1998 6.1988</td><td>0.018 0.000</td><td>195220</td><td>13.1387 13.1132</td><td>0.194 0.000</td><td>515377</td><td>16.0119 15.9857</td><td>0.163 0.000</td></tr><tr><td rowspan="5">CIPRRA</td><td></td><td>一</td><td>|V|= 40</td><td></td><td></td><td>|V|= 200</td><td></td><td>Generalization |V|</td><td></td><td>=300</td></tr><tr><td>LKH(100 trials) NeuroLKH</td><td>147</td><td>9.3051 9.2606</td><td>1.081 0.597</td><td>813</td><td>26.1757 25.4000</td><td>7.124 3.949</td><td>1746</td><td>34.2301 32.9676</td><td>8.798 4.786</td></tr><tr><td>LKH(1000 trials) NeuroLKH</td><td>1017</td><td>9.2276 9.2207</td><td>0.239 0.164</td><td>4525</td><td>24.9770 24.7857</td><td>2.218 1.435</td><td>7820</td><td>32.2671 32.0224</td><td>2.559 1.781</td></tr><tr><td>LKH(10000 rials) NeuroLKH</td><td>9624</td><td>9.2073 9.2056</td><td>0.018 0.000</td><td>45509</td><td>24.5338 24.4350</td><td>0.405 0.000</td><td>75481</td><td>31.5719 31.4620</td><td>0.350 0.000</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Performance on traditional benchmarks. To show the effectiveness of NeuroLKH on complicated routing problems with various distributions, we perform experiments on CVRPLIB [30] and Solomon [28] benchmark datasets. CVRPLIB [30] contains various sized CVRP instances with a combination of 3 depot positioning, 3 customer positioning and 7 demand distributions. Solomon benchmark [28] contains CVRPTW instances with 100 customers and various distributions of time windows. We detail the benchmarks, the training datasets and the results for each instance in the Appendix Section D. In summary, tested on the 43 instances with 100-300 nodes in CVRPLIB [30], NeuroLKH improves the average performances on 38, 38 and 31 instances when the time limits are set to the time of LKH with 100, 1000 and 10000 trials, respectively. On the 11 Solomon R2-type instances, NeuroLKH outperforms LKH almost consistently with all the settings (32 out of the 33).
|
| 178 |
+
|
| 179 |
+
# 6 Conclusion
|
| 180 |
+
|
| 181 |
+
In this paper, we propose an algorithm utilizing the great power of deep learning models to combine with a strong heuristic for TSP. Specifically, one Sparse Graph Network is trained to predict the edge scores and the node penalties for generating the edge candidate set and transforming the edge distances, respectively. As shown in the extensive experiments, the improvement of NeuroLKH over baseline algorithms within different time limits is consistent and significant. And NeuroLKH generalizes well to instances with much larger graph sizes than training sizes and traditional benchmarks with various node distributions. Also, we use CVRP, PDP and CVRPTW to demonstrate that NeuroLKH effectively applies to other routing problems. NeuroLKH can effectively learn the routing patterns for TSP which generalize well to much larger sizes and different distributions of nodes. However, for other complicated routing problems such as CVRP and CVRPTW, although NeuroLKH generalizes well to larger sizes, it is hard to directly generalize to other distributions of demands and time windows without training, which is a limitation of NeuroLKH and is left for future research. In addition, NeuroLKH can be further combined with other learning based techniques such as sparsifying the TSP graph [29] and other strong traditional algorithms such as the Hybrid Genetic Search [31].
|
| 182 |
+
|
| 183 |
+
# Acknowledgments and Disclosure of Funding
|
| 184 |
+
|
| 185 |
+
This work was supported by the A\*STAR Cyber-Physical Production System (CPPS) – Towards Contextual and Intelligent Response Research Program, under the RIE2020 IAF-PP Grant A19C1a0018, and Model Factory $@$ SIMTech, in part by the National Natural Science Foundation of China under Grant 61803104 and Grant 62102228, and in part by the Young Scholar Future Plan of Shandong University under Grant 62420089964188.
|
| 186 |
+
|
| 187 |
+
# References
|
| 188 |
+
|
| 189 |
+
[1] I. Bello, H. Pham, Q. V. Le, M. Norouzi, and S. Bengio. Neural combinatorial optimization with reinforcement learning. In Proceedings of International Conference on Learning Representations (ICLR)., 2016. [2] Y. Bengio, A. Lodi, and A. Prouvost. Machine learning for combinatorial optimization: a methodological tour d’horizon. European Journal of Operational Research, 2020.
|
| 190 |
+
[3] X. Bresson and T. Laurent. Residual gated graph convnets. arXiv preprint arXiv:1711.07553, 2017.
|
| 191 |
+
[4] X. Chen and Y. Tian. Learning to perform local rewriting for combinatorial optimization. In Advances in Neural Information Processing Systems, pages 6278–6289, 2019.
|
| 192 |
+
[5] P. R. d. O. da Costa, J. Rhuggenaath, Y. Zhang, and A. Akcay. Learning 2-opt heuristics for the traveling salesman problem via deep reinforcement learning. In Asian Conference on Machine Learning, pages 465–480. PMLR, 2020. [6] H. Dai, E. Khalil, Y. Zhang, B. Dilkina, and L. Song. Learning combinatorial optimization algorithms over graphs. In Advances in Neural Information Processing Systems, pages 6348– 6358, 2017.
|
| 193 |
+
[7] J. K. Falkner and L. Schmidt-Thieme. Learning to solve vehicle routing problems with time windows through joint attention. arXiv preprint arXiv:2006.09100, 2020.
|
| 194 |
+
[8] Z.-H. Fu, K.-B. Qiu, and H. Zha. Generalize a small pre-trained model to arbitrarily large tsp instances. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
|
| 195 |
+
[9] S. Y. Hao Lu, Xingwen Zhang. A learning-based iterative method for solving vehicle routing problems. In Proceedings of International Conference on Learning Representations (ICLR)., 2020.
|
| 196 |
+
[10] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770– 778, 2016.
|
| 197 |
+
[11] M. Held and R. M. Karp. The traveling-salesman problem and minimum spanning trees: Part ii. Mathematical programming, 1(1):6–25, 1971.
|
| 198 |
+
[12] K. Helsgaun. An effective implementation of the lin–kernighan traveling salesman heuristic. European Journal of Operational Research, 126(1):106–130, 2000.
|
| 199 |
+
[13] K. Helsgaun. General k-opt submoves for the lin–kernighan tsp heuristic. Mathematical Programming Computation, 1(2-3):119–163, 2009.
|
| 200 |
+
[14] K. Helsgaun. An extension of the lin-kernighan-helsgaun tsp solver for constrained traveling salesman and vehicle routing problems. Roskilde: Roskilde University, 2017.
|
| 201 |
+
[15] A. Hottung, B. Bhandari, and K. Tierney. Learning a latent search space for routing problems using variational autoencoders. In Proceedings of International Conference on Learning Representations (ICLR)., 2021.
|
| 202 |
+
[16] A. Hottung and K. Tierney. Neural large neighborhood search for the capacitated vehicle routing problem. In European Conference on Artificial Intelligence, 2020.
|
| 203 |
+
[17] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pages 448–456, 2015.
|
| 204 |
+
[18] C. K. Joshi, T. Laurent, and X. Bresson. An efficient graph convolutional network technique for the travelling salesman problem. arXiv preprint arXiv:1906.01227, 2019.
|
| 205 |
+
[19] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In Proceedings of International Conference on Learning Representations (ICLR)., 2014.
|
| 206 |
+
[20] W. Kool, H. van Hoof, J. Gromicho, and M. Welling. Deep policy dynamic programming for vehicle routing problems. arXiv preprint arXiv:2102.11756, 2021.
|
| 207 |
+
[21] W. Kool, H. van Hoof, and M. Welling. Attention, learn to solve routing problems! In Proceedings of International Conference on Learning Representations (ICLR)., 2019.
|
| 208 |
+
[22] Y.-D. Kwon, J. Choo, B. Kim, I. Yoon, Y. Gwon, and S. Min. Pomo: Policy optimization with multiple optima for reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, 2020.
|
| 209 |
+
[23] J. Li, L. Xin, Z. Cao, A. Lim, W. Song, and J. Zhang. Heterogeneous attentions for solving pickup and delivery problem via deep reinforcement learning. IEEE Transactions on Intelligent Transportation Systems, 2021.
|
| 210 |
+
[24] S. Lin. Computer solutions of the traveling salesman problem. Bell System Technical Journal, 44(10):2245–2269, 1965.
|
| 211 |
+
[25] S. Lin and B. W. Kernighan. An effective heuristic algorithm for the traveling-salesman problem. Operations research, 21(2):498–516, 1973.
|
| 212 |
+
[26] M. Nazari, A. Oroojlooy, L. Snyder, and M. Takác. Reinforcement learning for solving the vehicle routing problem. In Advances in Neural Information Processing Systems, pages 9839– 9849, 2018.
|
| 213 |
+
[27] G. Reinelt. Tsplib—a traveling salesman problem library. ORSA journal on computing, 3(4):376–384, 1991.
|
| 214 |
+
[28] M. M. Solomon. Algorithms for the vehicle routing and scheduling problems with time window constraints. Operations research, 35(2):254–265, 1987.
|
| 215 |
+
[29] Y. Sun, A. Ernst, X. Li, and J. Weiner. Generalization of machine learning for problem reduction: a case study on travelling salesman problems. OR Spectrum, 43(3):607–633, 2021.
|
| 216 |
+
[30] E. Uchoa, D. Pecin, A. Pessoa, M. Poggi, T. Vidal, and A. Subramanian. New benchmark instances for the capacitated vehicle routing problem. European Journal of Operational Research, 257(3):845–858, 2017.
|
| 217 |
+
[31] T. Vidal, T. G. Crainic, M. Gendreau, N. Lahrichi, and W. Rei. A hybrid genetic algorithm for multidepot and periodic vehicle routing problems. Operations Research, 60(3):611–624, 2012.
|
| 218 |
+
[32] O. Vinyals, M. Fortunato, and N. Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, volume 28, 2015.
|
| 219 |
+
[33] Y. Wu, W. Song, Z. Cao, J. Zhang, and A. Lim. Learning improvement heuristics for solving routing problems. IEEE Transactions on Neural Networks and Learning Systems, 2021.
|
| 220 |
+
[34] L. Xin, W. Song, Z. Cao, and J. Zhang. Step-wise deep learning models for solving routing problems. IEEE Transactions on Industrial Informatics, 17(7):4861–4871, 2020.
|
| 221 |
+
[35] L. Xin, W. Song, Z. Cao, and J. Zhang. Multi-decoder attention model with embedding glimpse for solving vehicle routing problems. In Proceedings of the 35th AAAI Conference on Artificial Intelligence, pages 12042–12049, 2021.
|
| 222 |
+
[36] J. Zheng, K. He, J. Zhou, Y. Jin, and C.-m. Li. Combining reinforcement learning with linkernighan-helsgaun algorithm for the traveling salesman problem. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
|
md/train/VRgITLy0l2/VRgITLy0l2.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A PRIORI GUARANTEES OF FINITE-TIME CONVERGENCE FOR DEEP NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we perform Lyapunov based analysis of the loss function to derive an a priori upper bound on the settling time of deep neural networks. While previous studies have attempted to understand deep learning using control theory framework, there is limited work on a priori finite time convergence analysis. Drawing from the advances in analysis of finite-time control of non-linear systems, we provide a priori guarantees of finite-time convergence in a deterministic control theoretic setting. We formulate the supervised learning framework as a control problem where weights of the network are control inputs and learning translates into a tracking problem. An analytical formula for finite-time upper bound on settling time is provided a priori under the assumptions of boundedness of input. Finally, we prove that our loss function is robust against input perturbations.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Over the past decade, Deep neural networks have achieved human-like performance in various machine learning tasks, such as classification, natural language processing and speech recognition. Despite the popularity of deep learning, the underlying theoretical understanding remains relatively less explored. While attempts have been made to develop deep learning theory by drawing inspiration from other related fields such as statistical learning and information theory, a comprehensive theoretical framework is still in an early developmental stage. It is difficult to perform mathematical analysis on Deep neural networks due to the large number of parameters involved. Other problems in deep neural networks revolve around the stability and desired convergence rate of the training. Since the performance of the network depends highly on the training data and the choice of the optimization algorithm, there is no guarantee that the training will converge. Our work attempts to give finite-time convergence guarantees for training of a deep neural network by utilizing an established stabilization framework from control theory.
|
| 12 |
+
|
| 13 |
+
Existing works in deep learning theory have attempted to bridge the gap in understanding deep learning dynamics by focusing on simple models of neural networks [Saxe et al. (2013), Li & Yuan (2017), Arora et al. (2018), Jacot et al. (2018)]. This could be attributed to the fact that current state-of-the-art deep learning models are highly complex structures to analyze. Jacot et al. (2018) proved that a multilayer fully-connected network with infinite width converges to a deterministic limit at initialization and the rate of change of weights goes to zero. Saxe et al. (2013) analyzed deep linear networks and proved that these networks, surprisingly, have a rich non-linear structure. The study shows that given the right initial conditions, deep linear networks are a finite amount slower than shallow networks. Following this work, Arora et al. (2018) proved the convergence of gradient descent to global minima for networks with dimensions of every layer being full rank in dimensions. While these studies give important insights into the design of neural network architecture and the behavior of training, their results may need to be modified in order to provide convergence guarantees for the conventional deep neural networks. Du et al. (2018) extended the work of Jacot et al. (2018) further by proving convergence for gradient descent to achieve zero training loss in deep neural networks with residual connections.
|
| 14 |
+
|
| 15 |
+
When it comes to convergence of certain state variables of a dynamical system, control theory provides a rich mathematical framework which can be utilized for analyzing the non-linear dynamics of deep learning [Liu & Theodorou (2019)]. One of the early works relating deep learning to control theory was of LeCun et al. (1988), which used the concept of optimal control and formulated back-propagation as an optimization problem with non-linear constraints. Non-linear control has gained increasing attention over the past few years in the context of neural networks, especially for recurrent neural networks [Allen-Zhu et al. (2019), Xiao (2017)] and reinforcement learning [Xu et al. (2013), Gupta et al. (2019), Wang et al. (2019), Kaledin et al. (2020)]. A new class of recurrent neural networks, called Zhang Neural Networks (ZNN), was developed that expressed dynamics of the network as a set of ordinary differential equations and used non-linear control to prove global or exponential stability for time-varying Sylvester equation [Zhang et al. (2002), Guo et al. (2011)]. Li et al. (2013) introduced the sign bi-power activation function for Zhang Neural Networks (ZNN) which helps to prove the existence of finite-time convergence property. Haber & Ruthotto (2017) presents deep learning as a parameter estimation problem of non-linear dynamical systems to tackle the exploding and vanishing gradients.
|
| 16 |
+
|
| 17 |
+
The focus of this paper is on deriving a priori guarantee of attaining finite-time convergence of training in a supervised learning framework under some assumptions on inputs. The novelty lies in the fact that the weight update is cast as a finite-time control synthesis such that the loss function is proven to be a valid Lyapunov function. The resulting training update is derived as a function of time such that it ensures the convergence of Lyapunov function in finite time. The only assumption used is that the magnitude of atleast one input is greater than zero. Thus, the learning problem is converted into a finite time stabilization problem as studied rigorously in Bhat & Bernstein (2000). The contributions of the proposed study are twofold. First, we propose a Lyapunov candidate function to be used as loss function. Second, we modify the weight update of the neural network in such a way that the supervised training is converted into a dynamical control system. This allows us to use results from Bhat & Bernstein (2000) to a priori guarantee finite time convergence on the training. To the best of our knowledge, a guarantee of finite-time convergence is being studied for the first time in context of training a general multi-layer neural network. The proposed results will enable time bound training that will be useful in real-time applications.
|
| 18 |
+
|
| 19 |
+
The paper is organized as follows. Section 2 starts with introducing the Lyapunov function from the control theory perspective. Section 2.1 derives the weight update and lyapunov loss function for a single neuron case and proves that it satisfies the conditions required for finite-time stability theorems developed in Bhat & Bernstein (2000) to be applicable. Section 2.2 then proves that a similar result extends to a multi-layer perceptron network under reasonable assumptions on the input. In Section 2.3, we state the equations to compute upper bounds on the convergence time for training neural networks. Section 2.4 provides an extension to the case when bounded perturbations are admitted at the input and convergence guarantees are shown to hold true. In Section 3, some numerical simulations are presented for both single neuron and multi-layer perceptron cases for regression. Section 4 collects conclusions and discusses future scope.
|
| 20 |
+
|
| 21 |
+
# 2 PROPOSED METHOD TO CONVERT SUPERVISED LEARNING INTO DYNAMICAL CONTROL SYSTEM
|
| 22 |
+
|
| 23 |
+
This section motivates the development of a priori bounds on settling time with certain assumptions on the input. The weight update problem for supervised learning in neural networks is similar to the tracking problem of non-linear control systems. The idea is to synthesize a feedback control law based on certain Lyapunov function $V ( x )$ . A Lyapunov function is a positive definite function, i.e. $V ( x ) > 0$ , and its time derivative is negative definite along the given system dynamics, i.e. $\dot { V } < 0$ . We cast the supervised learning problem as a dynamical system which admits a valid Lyapunov function as the loss function with the weight update is designed as a function of time.
|
| 24 |
+
|
| 25 |
+
# 2.1 SINGLE NEURON CASE
|
| 26 |
+
|
| 27 |
+
We start with a simplistic single neuron case. Let $x \in \mathbb { R } ^ { n }$ be the input to the network where $x = [ x _ { 1 } \quad x _ { 2 } \quad \ldots \quad x _ { n } ] ^ { \top } , | x _ { i } | < c , i = 1 , 2 , \cdots n$ $c \in \mathsf { \Gamma } ( 0 , \infty )$ . Let with i $y ^ { \star }$ beuts e target oand bias tput and . The de $\textstyle z = \sum _ { i = 1 } ^ { n } w _ { i } x _ { i } + b$ holds true for some a priori but arbitrary scalar be the linear comction used here is $w _ { i }$ $x _ { i }$ $b$ $\mathrm { s i g n } ( x ) =$ $1 , \forall x > 0 , { \mathrm { s i g n } } ( x ) = - 1 , \forall x < 0 , { \mathrm { s i g n } } ( x ) \in [ - 1 , 1 ] , x = 0$ . For our analysis, we choose sigmoid function as our activation function, i.e. $\begin{array} { r } { \sigma ( z ) \doteq \frac { 1 ^ { - } } { 1 + e ^ { - z } } } \end{array}$ . The output of the neural network is given by $y = \sigma ( z )$ . Let the error in output be defined as $\bar { e } = y - y ^ { * }$ . The first objective is to convert our loss function into a candidate Lyapunov function in order to apply the control theoretic principles. Consider a continuous function $E ( \bar { e } )$ to be a candidate Lyapunov function as follows:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
E = \frac { | \bar { e } | ^ { ( \alpha + 1 ) } } { ( \alpha + 1 ) }
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $\alpha \in ( 0 , 1 )$ is a user-defined parameter. The second objective is to define the temporal rate of weight as the control input to enforce the stability of the origin $\bar { e } = 0$ as $t \to \infty$ . The Lyapunov function in (1) is used to show that it is indeed plausible to achieve this asymptotic stability goal. Taking the temporal derivative of the candidate Lyapunov function (1) produces (by chain rule of differentiation)
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\frac { \mathrm { d } E } { \mathrm { d } t } = \frac { \mathrm { d } E } { \mathrm { d } \bar { e } } \frac { \mathrm { d } \bar { e } } { \mathrm { d } y } \frac { \mathrm { d } y } { \mathrm { d } z } \frac { \mathrm { d } z } { \mathrm { d } w } \frac { \mathrm { d } w } { \mathrm { d } t }
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\frac { \mathrm { d } E } { \mathrm { d } \bar { e } } \frac { \mathrm { d } \bar { e } } { \mathrm { d } y } \frac { \mathrm { d } y } { \mathrm { d } z } \frac { \mathrm { d } z } { \mathrm { d } w }$ is the weight update for standard gradient descent algorithm and $\textstyle { \frac { \mathrm { d } w } { \mathrm { d } t } }$ is the additional term we introduce to the weight update equation. Using (1), we get:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\frac { d E } { d t } = | \bar { e } | ^ { \alpha } \mathrm { s i g n } ( \bar { e } ) \left( \frac { e ^ { - z } } { ( 1 + e ^ { - z } ) ^ { 2 } } \right) \left( x _ { 1 } \dot { w } _ { 1 } + x _ { 2 } \dot { w } _ { 2 } + \cdot \cdot \cdot + x _ { n } \dot { w } _ { n } \right)
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Define, $u _ { 1 } \triangleq \dot { w } _ { 1 } , u _ { 2 } \triangleq \dot { w } _ { 2 } , \cdot \cdot \cdot , u _ { n } \triangleq \dot { w } _ { n }$ , and
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
u _ { i } = - k _ { i } \mathrm { s i g n } ( x _ { i } ) \mathrm { s i g n } ( \bar { e } ) e ^ { z } ( 1 + e ^ { - z } ) ^ { 2 } , \quad i = 1 , 2 , \cdots , n ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $k _ { i } > 0$ , for all $i$ , are tuning parameters to be chosen by the user. It can be noted that all control inputs $u _ { 1 } , u _ { 2 } , \cdots , u _ { n }$ remain bounded due to boundedness assumption of all the inputs $x _ { i }$ and that of $e ^ { z }$ . Substituting (3) into (2) produces
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\frac { d E } { d t } = - | \bar { e } | ^ { \alpha } \left( \sum _ { i = 1 } ^ { n } k _ { i } | x _ { i } | \right)
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Assumption 1. At least one input of all $x _ { i } , i = 1 , 2 , \cdots , n$ is non-zero such that $| x _ { j } | > \gamma > 0$ where $\gamma$ is a priori known scalar for some integers $j \in [ 1 , n ]$ .
|
| 58 |
+
|
| 59 |
+
It can be noted that Assumption 1 is reasonable for many practical applications in that some inputs will always be nonzero with a known lower bound on its magnitude. First main result of the paper is in order.
|
| 60 |
+
|
| 61 |
+
Theorem 1. Assuming Assumption 1 holds true, let the output of the neural network be given by $y = \sigma ( z )$ . Let all the inputs $x _ { i } , i = 1 , 2 , \cdots , n$ be bounded by some a priori known scalar $a \in$ $( 0 , \infty )$ such that $| x _ { i } | < a$ holds true for all $i$ . Then, weight update (3) causes the error $\bar { e } = y - y ^ { * }$ to converge to zero in finite time.
|
| 62 |
+
|
| 63 |
+
Proof. The proof of the theorem is furnished using standard Lyapunov analysis arguments. Consider $E$ defined by (1) as a candidate Lyapunov function. Observing (4), it can be concluded that the right hand side of the temporal derivative of remains negative definite since it involves power terms and norm of inputs. Furthermore, (4) can be rewritten under the assumption 1 as follows:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\frac { d E } { d t } \leq - k _ { \operatorname* { m i n } } \gamma E ^ { \beta }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\begin{array} { r } { k _ { \operatorname* { m i n } } = \operatorname* { m i n } ( k _ { i } ) , i = 1 , 2 , \cdots , n , \beta = \frac { \alpha } { \alpha + 1 } } \end{array}$ = αα+1 and |e¯|α = |e¯|α+1 αα+1 = Eβ has been utilized. Noting that $E$ is a positive definite function and scalars $k _ { \mathrm { m i n } }$ and $\gamma$ are always positive, the proof is complete by applying (Bhat & Bernstein, 2000, Theorem 4.2). □
|
| 70 |
+
|
| 71 |
+
# 2.2 MULTI NEURON CASE
|
| 72 |
+
|
| 73 |
+
Consider a multi-layer perceptron with $N$ layers where the layers are connected in a feed-forward manner (Bishop, 1995, Chapter 4). Let $\boldsymbol { x } \in \mathbb { R } ^ { n }$ be the input to the network where $x \quad =$ $\left[ x _ { 1 } \quad x _ { 2 } \quad \cdots \quad x _ { n } \right] ^ { \top }$ and $| x _ { i } | < c , i = 1 , 2 , \cdot \cdot \cdot n$ holds true for some a priori but arbitrary scalar $c \in$ $( 0 , \infty )$ . Let $y \in \mathbb { R } ^ { m }$ define the multi-neuron output to the network where $y = [ y _ { 1 } \quad y _ { 2 } \quad \cdot \cdot \cdot \quad y _ { m } ]$ . Let $y ^ { \star } \in \mathbb { R } ^ { m }$ define the target output values of the network where $y ^ { \star } = [ y _ { 1 } ^ { \star } \quad y _ { 2 } ^ { \star } \quad \cdot \cdot \quad y _ { m } ^ { \star } ]$ . The error in the output layer can be expressed as $\bar { e } = [ \left| y _ { 1 } - y _ { 1 } ^ { \star } \right| \quad \left| y _ { 2 } - y _ { 2 } ^ { \star } \right| \quad \cdot \cdot \quad \left| y _ { m } - y _ { m } ^ { \star } \right| ]$ . Hence, the scalar candidate Lyapunov function can be written as follows:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
E = E _ { 1 } + \cdot \cdot \cdot + E _ { m } = { \frac { | { \bar { e } } _ { 1 } | ^ { ( \alpha + 1 ) } } { ( \alpha + 1 ) } } + \cdot \cdot \cdot + { \frac { | { \bar { e } } _ { m } | ^ { ( \alpha + 1 ) } } { ( \alpha + 1 ) } }
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
As is usually done in the case of feed-forward networks, consider unit $j$ of layer $l$ that computes its output
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
a _ { j } ^ { l } = \sum _ { i } w _ { j i } ^ { l } z _ { i } ^ { l }
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
using its inputs $z _ { i } ^ { l }$ from layer $l$ where bias parameter has been embedded inside the linear combination and $z _ { j } ^ { l } = \sigma ( a _ { j } ^ { l - 1 } )$ , where $\sigma$ is non-linear activation function. The aim of this section is to extend the single neuron case to a multi-neuron one. The simplest way do achieve this is to find sensitivity of $E$ to the weight $w _ { j i } ^ { l }$ of a given layer $l$ , which is given by
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\frac { \partial E _ { m } } { \partial w _ { j i } ^ { l } } = \frac { \partial E _ { m } } { \partial a _ { j } ^ { l } } \frac { \partial a _ { j } ^ { l } } { \partial w _ { j i } ^ { l } }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Using standard notation $\begin{array} { r } { \delta _ { j } ^ { l } \triangleq \frac { \partial E _ { m } } { \partial a _ { j } ^ { l } } } \end{array}$ with (7) results in:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\frac { \partial E _ { m } } { \partial w _ { j i } ^ { l } } = \delta _ { j } ^ { l } z _ { i } ^ { l }
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
It is straightforward to compute $\delta _ { m } ^ { L }$ that belongs to the output layer $L$ as shown below:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\delta _ { m } ^ { L } = \frac { \partial E _ { m } } { \partial a _ { m } ^ { L } } = \sigma ^ { \prime } ( a _ { m } ^ { L } ) \frac { \partial E _ { m } } { \partial y _ { m } }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $z _ { m } ^ { L }$ is replaced by $y _ { m }$ as it is the output layer. Finally, computation of $\delta _ { j } ^ { l }$ for all hidden units is given by
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\delta _ { j } ^ { l } = \frac { \partial E _ { m } } { \partial a _ { j } ^ { l } } = \sum _ { k } \frac { \partial E _ { m } } { \partial a _ { k } ^ { l + 1 } } \frac { \partial a _ { k } ^ { l + 1 } } { \partial a _ { j } ^ { l } }
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where units with a label $k$ includes either hidden layer units or an output unit in layer $l + 1$ . Combining (7), $z _ { j } ^ { l } = \sigma ( a _ { j } ^ { l } )$ and $\begin{array} { r } { \delta _ { j } ^ { l } \triangleq \frac { \partial E _ { m } } { \partial a _ { j } ^ { l } } } \end{array}$ produces
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\delta _ { j } ^ { l } = \sigma ^ { \prime } ( a _ { j } ^ { l } ) \sum _ { k } w _ { k j } ^ { l + 1 } \delta _ { k } ^ { l + 1 }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
A slightly modified version of assumption 1 is required before the next result of the paper is presented.
|
| 116 |
+
|
| 117 |
+
Assumption 2. At least one input of all $z _ { i } , i = 1 , 2 , \cdots , L$ is non-zero such that $\left| z _ { n } \right| > \gamma > 0$ where $\gamma$ is a priori known scalar for some integers $n \in [ 1 , L ]$ where $L$ is the number of units in layer $l$ .
|
| 118 |
+
|
| 119 |
+
Theorem 2. Let the weight update for connecting unit $i$ of layer $l$ to unit $j$ of layer $l + 1$ of $a$ multi-layer neural network be given by
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r } { \dot { w } _ { j i } ^ { l } = - k _ { j i } ^ { l } \mathrm { s i g n } ( \delta _ { j } ^ { l } z _ { i } ^ { l } ) | \delta _ { j } ^ { l } z _ { i } ^ { l } | ^ { \alpha } E ^ { \beta } } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
with some scalar $\beta \in ( 0 , 1 )$ such that $\alpha + \beta < 1$ and $k _ { j i } > 0$ is a tuning parameter. Then the output vector y converges to $y ^ { * }$ in finite time.
|
| 126 |
+
|
| 127 |
+
Proof. Consider the candidate Lyapunov function $E$ given by (6). The temporal derivative of the Lyapunov function is given by
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\dot { E } = \sum _ { m } \dot { E } _ { m } = \sum _ { m } \frac { \partial E _ { m } } { \partial w _ { j i ^ { l } } } \dot { w } _ { j i } ^ { l }
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
which can be simplified using (13) and (9) as
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\dot { E } = - E ^ { \beta } \sum _ { m } k _ { j i } ^ { l } | \delta _ { j } ^ { l } z _ { i } ^ { l } | ^ { \alpha + 1 }
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Using Assumption 2 it is easy to conclude that for some $k _ { \mathrm { m i n } } = \operatorname* { m i n } _ { i , j , l } k _ { j i } ^ { l } > 0$ , the following inequality holds true:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\dot { E } \le - k _ { \mathrm { m i n } } \gamma ^ { \alpha + 1 } E ^ { \beta }
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Noting that $E$ is a positive definite function and scalars $k _ { \mathrm { m i n } }$ , $\gamma$ are always positive, the proof is complete by applying (Bhat & Bernstein, 2000, Theorem 4.2). □
|
| 146 |
+
|
| 147 |
+
Remark 1. It can be seen that weight update $( I 3 )$ (or respectively (3)) is in a feedback control form where state $z _ { i }$ and $\delta _ { j }$ (respectively $x _ { i }$ and $\bar { e }$ ) are being used for influencing the learning process.
|
| 148 |
+
|
| 149 |
+
# 2.3 SETTLING TIME FOR NEURAL NETWORK TRAINING
|
| 150 |
+
|
| 151 |
+
Theorem 1 and 2 prove that using candidate Lyapunov function as the loss function and the temporal rate of change of the loss function as the weight update equation, we can convert supervised learning framework into a control problem. (Bhat & Bernstein, 2000, Theorem 4.2) states that if there is continuous function that is positive definite and it’s rate of change with respect to time is negative definite, then it’s finite time stable equilibrium is at origin. The theorem also gives the settling time when the above conditions are satisfied by the control system. For our case, this means that the Lyapunov based loss function will converge in finite time and time taken to converge is as given below:
|
| 152 |
+
|
| 153 |
+
The settling time for Single Neuron case:
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
T \leq \frac { 1 } { k _ { m i n } \gamma ( 1 - \beta ) } E _ { i n i } ^ { ( 1 - \beta ) }
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
The settling time for Multi Neuron case:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
T \leq \frac { 1 } { k _ { m i n } \gamma ^ { \alpha + 1 } ( 1 - \beta ) } E _ { i n i } ^ { ( 1 - \beta ) }
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $\gamma$ is the lower bound on the inputs, $k _ { m i n }$ is the minimum value of tuning parameter $k , \alpha$ is the scalar used in the Lyapunov loss function and $E _ { i n i }$ is the initial value of loss, i.e. loss at $\mathrm { { t } } = 0$ .
|
| 166 |
+
|
| 167 |
+
# 2.4 SENSITIVITY TO PERTURBATIONS
|
| 168 |
+
|
| 169 |
+
This section considers the robustness of training a neural network based on our proposed algorithm. In control theoretic terms, perturbation can be understood either as a disturbance to the process or as modelling uncertainty. When supervised learning is viewed as a control process, perturbation in each neuron of the input layer can be seen as external noise. This perturbation could cause the control system to diverge. In this section, we develop theoretical claims that even with perturbed inputs, training a neural network with the proposed algorithm will converge. The following assumption of the upper bound on the perturbation of inputs is invoked.
|
| 170 |
+
|
| 171 |
+
Assumption 3. There exists an a priori known constant $M \ > \ 0$ such that all inputs $x _ { i } , i \ =$ $1 , 2 , \cdots , N$ admit additive perturbations $\Delta x _ { i }$ such that
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
| \Delta x _ { i } | \leq M | x _ { i } | ^ { \alpha }
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
for all i where $N$ is the number of inputs.
|
| 178 |
+
|
| 179 |
+
The following result is in order.
|
| 180 |
+
|
| 181 |
+
Theorem 3. Let assumptions 2 and 3 hold true. Let the weight update for connecting unit i of layer $l$ to unit $j$ of layer $l + 1$ of a multi-layer neural network be given by (13). Then the output vector $y$ converges to $y ^ { * }$ in finite time in the presence of additive perturbations $\Delta x _ { n } , n \in \left[ 1 , L \right] i \bar { f } k _ { \operatorname* { m i n } } > M$ .
|
| 182 |
+
|
| 183 |
+
Proof. It can be seen that the perturbation is considered only in inputs. Hence all hidden layer weights are updated as done in the proof of Theorem 2. Hence, the dynamics of learning results in the following revised temporal derivative of Lyapunov function:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\dot { E } = - E ^ { \beta } \sum _ { m } k _ { j i } | \delta _ { j } z _ { i } | ^ { \alpha + 1 } + \sum _ { p = 0 } ^ { n } k _ { 1 p } | \delta _ { p } x _ { p } | ^ { \alpha } \mathrm { s i g n } ( \delta _ { p } x _ { p } ) \delta _ { p } \Delta x _ { p }
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
where $k _ { 1 p }$ is the gain parameter for training of all the input layer weights. The expression in (20) can be simplified using Assumption 3 as follows:
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\begin{array} { l } { \displaystyle \dot { E } \leq - E ^ { \beta } \sum _ { m } k _ { j i } | \delta _ { j } z _ { i } | ^ { \alpha + 1 } + E ^ { \beta } \sum _ { p = 0 } ^ { n } { k _ { 1 p } | \delta _ { p } x _ { p } | ^ { \alpha + 1 } M } , } \\ { \displaystyle \leq - E ^ { \beta } \sum _ { m } ( k _ { j i } - M ) | \delta _ { j } z _ { i } | ^ { \alpha + 1 } } \end{array}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
where inputs $z _ { i }$ now collect inputs $x _ { i }$ as well. Similar to the proof of Theorem 2, (21) can be re-written by applying Assumption 2 as follows:
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\dot { E } \le - ( k _ { \operatorname* { m i n } } - M ) \gamma E ^ { \beta }
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
Since $k _ { \operatorname* { m i n } { } } > M$ , the proof is complete by applying (Bhat & Bernstein, 2000, Theorem 4.2).
|
| 202 |
+
|
| 203 |
+
# 3 EXPERIMENTS
|
| 204 |
+
|
| 205 |
+
This section presents empirical evidence that the theoretical results derived in the above sections hold for real-life applications.
|
| 206 |
+
|
| 207 |
+
Convergence Rate for training. To analyze the training convergence rate of the proposed method, we train a multi-layer perceptron (covered in Section 2.2) to perform regression on the Boston Housing dataset (Harrison Jr & Rubinfeld (1978)). Experiment on single neuron case is covered in Appendix A.2.2
|
| 208 |
+
|
| 209 |
+
Training details. We compare our proposed method (Lyapunov based loss and modified weight update equation) with traditional $L _ { 1 }$ , $L _ { 2 }$ loss functions and standard SGD weight update equation. The modifications to the weight update equation for Lyapunov loss are as stated in (15) for multi-neuron case. We plot the training and test loss with respect to time in Figure 1.
|
| 210 |
+
|
| 211 |
+
The details about the training examples, epochs, learning rate etc. are specified under the description of the figures. We observe that the Lyapunov Loss function converges faster than $L _ { 1 }$ and $L _ { 2 }$ loss functions, demonstrating the results proven extensively in Section 2. This is attributed mainly to the non-Lipschitz weight updates given by (3) and (13).
|
| 212 |
+
|
| 213 |
+
The settling time as well as metrics of the trained networks are reported in Table 1. The time taken by the proposed algorithm to converge falls within the a priori upper bound. We also observe that the metrics (Accuracy for single neuron case and rmse (Root mean square error) for multi-neuron case) achieved by the proposed method is better than the baselines. Admittedly, the theoretical upper bound on settling time for single neuron and multi-layer perceptron produced by (5) and (16) are very conservative, yet it is an a priori deterministic upper bound and the aggressive learning proves to be faster than traditional loss functions in the scenarios considered here.
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 1: Comparison of convergence with respect to time for the multi-layer perceptron trained on the Boston Housing dataset. All networks are trained for 4000 epochs with learning rate $= 0 . 0 2$ and $\alpha = 0 . 6 8$ .
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Experiment</td><td rowspan="2">Theoretical Upper Bound</td><td colspan="3">Exp. Convergence Time (in seconds)</td><td colspan="3">Metric</td></tr><tr><td>(in seconds)</td><td>L1</td><td>L2</td><td>Lyap.</td><td>L1</td><td>L2</td><td>Lyap.</td></tr><tr><td>SingleNeuron (acc)</td><td>~3.4e3</td><td>0.065</td><td>0.064</td><td>0.025</td><td>0.95</td><td>0.95</td><td>1.0</td></tr><tr><td>MLP (rmse)</td><td>~ 1.4e10</td><td>4.3e3</td><td>3.4e3</td><td>3.1e3</td><td>0.091</td><td>0.179</td><td>0.085</td></tr></table>
|
| 219 |
+
|
| 220 |
+
Table 1: Settling time in seconds for each experiment conducted. We compare the time taken for convergence by three different loss functions, $L _ { 1 }$ , $L _ { 2 }$ and Lyapunov Loss function. The training conditions were similar for individual cases in the experiment. The single neuron case is trained on Iris dataset and the metric used is Accuracy (higher is better). For Multi-layer perceptron, we use Boston Housing dataset and the metric used for this is rmse (lower is better).
|
| 221 |
+
|
| 222 |
+
This can be attributed to the fact that we operate in the realm of non-smooth functions which tend to be more aggressive than the smooth $L _ { 2 }$ function we usually encounter in most learning problems. We can clearly observe that the loss value does not converge to zero. According to (Bhat & Bernstein, 2000, Theorem 5.2), a control system will converge to a non-zero value at steady state, if there is constant perturbation in the input. Usually in real life datasets, there is an inherent bias or constant perturbation, which prevents the loss to converge to zero. Of course, by setting $\alpha = 0$ , we can reject all persisting disturbances (Orlov (2005)) and force the loss to converge to zero, but this may result in discontinuity in back propagation (discussed in Appendix A.1) and result into large numerical errors.
|
| 223 |
+
|
| 224 |
+
Hyperparameter analysis and its effect on training. In this section, we attempt to give an empirical analysis as to how changes in the hyperparameters like $k$ and $\alpha$ affect the training of the neural network. In order to study the effect of tuning $k$ , we work with the single neuron case for simplicity and ease of understanding. We use Iris dataset for this experiment Dua & Graff (2017). Existing literature in control theory suggests that a monotonic increase in the tuning parameter, $k$ should result in a monotonic decrease in the corresponding loss. In neural network terminology, $k$ can be considered as the ’learning rate’. We can clearly see in Figure 2 that $k$ behaves like learning rate parameter where increasing $k$ makes the learning more aggressive.
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 2: Comparison of training and test convergence with respect to time for different values of tuning parameter, $k$ in a single neuron trained on the Iris dataset. We convert the problem into a binary classification problem by considering only two output classes. All networks are trained for 600 epochs with 80 training examples and 20 test examples. The learning rate for all $L _ { 1 }$ , $L _ { 2 }$ and Lyapunov is set to the tuning parameter value $k$ and $\alpha = 0 . 8$
|
| 228 |
+
|
| 229 |
+
From Table 2, we observe that the settling time for the training loss of our Lyapunov loss function is always less than $L _ { 1 }$ and $L _ { 2 }$ . We also observe that the Accuracy of our method is either better or similar to the baselines, which shows that the optimized solution achieved by our method is either better or on par with the baselines. For the multi-neuron case, we have defined $k _ { i j } ^ { l }$ for every weight. Similar to adaptive learning rate, we can either tune $k _ { i j } ^ { l }$ for every weight (which can be quite cumbersome for larger neural networks) or we can set it arbitrarily to the same value for all weights. It must be noted that $k _ { i j } ^ { l }$ can be set to any value greater than an a priori known positive constant $M$ .
|
| 230 |
+
|
| 231 |
+
<table><tr><td rowspan="2">Experiment for single neuron case on Iris dataset</td><td rowspan="2">Theoretical Upper Bound (in seconds)</td><td colspan="3">Exp. Convergence Time (in seconds)</td><td colspan="3">Accuracy on Test Set</td></tr><tr><td>L1</td><td>L2</td><td>Lyap.</td><td>L1</td><td>L2</td><td>Lyap.</td></tr><tr><td>k=0.001</td><td>~ 37213.848</td><td>0.312</td><td>0.310</td><td>0.0918</td><td>0.6</td><td>0.95</td><td>0.95</td></tr><tr><td>k = 0.005</td><td>~7442.769</td><td>0.0943</td><td>0.0942</td><td>0.0344</td><td>0.95</td><td>1.0</td><td>1.0</td></tr><tr><td>k= 0.01</td><td>~ 3721.385</td><td>0.0566</td><td>0.0573</td><td>0.0221</td><td>0.95</td><td>1.0</td><td>1.0</td></tr></table>
|
| 232 |
+
|
| 233 |
+
Table 2: Settling time in seconds for different values of tuning parameter, $k$ for the single neuron case on Iris dataset. We compare the time taken for convergence by three different loss functions, $L _ { 1 }$ , $L _ { 2 }$ and Lyapunov Loss function. The training conditions were similar for individual cases in the experiment.
|
| 234 |
+
|
| 235 |
+
We will discuss the impact of different values of $\alpha$ on the training process of our neural network. For the given experiments, we tested the network for various values of $\alpha$ ranging between $( 0 , 1 )$ . We observed that the training loss follows equations proved in above sections as long as $\alpha \in ( 0 . 5 , 0 . 9 )$ . If $\alpha$ happens to be too close to zero, the resulting control law becomes discontinuous thereby resulting in numerical instabilities owing to the fact that the current ODE solvers are unable to handle functions that are discontinuous. More details about the case $\alpha = 0$ is given in Appendix A.1 (Bhat & Bernstein, 2000, Theorem 5.2).
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Stability of learning in the presence of amplitude-bounded perturbations.
|
| 239 |
+
Figure 3: Comparison of training loss convergence with respect to time for different values of input perturbations, $\Delta x$ for a multi-layer perceptron trained on the IMDB Wiki Faces dataset.The a priori upper bound on input perturbations are as follows: (a) $\Delta x = 0 . 1$ , (b) $\Delta x = 0 . 2$ , $( \mathrm { c } ) \Delta x = 0 . 3$ Learning rate $k = 0 . 0 0 0 9$ , $\alpha = 0 . 8$ , epochs $_ { \mathrm { - } 1 0 0 }$
|
| 240 |
+
|
| 241 |
+
In this section, we present results that demonstrate the robustness of proposed algorithm to bounded perturbations in the input while maintaining convergence of training dynamics. For this case, we train a multi-layer perceptron on a regression task of predicting the age given the image of a face. We use IMDB Wiki Faces Dataset Rothe et al. (2015) which has over 0.5 million face images of celebrities with their age and gender labels. Only part of the dataset is used for this experiment, i.e. 20,000 images for training and 4,000 images each for validation and test.
|
| 242 |
+
|
| 243 |
+
For adding input perturbations, we asssume that an a priori upper bound, $M$ is known on the amplitude of possible input perturbations following Assumption 3. We add input perturbations to each pixel in the image using a randomized uniform distribution ranging from $( - \Delta x , \Delta x )$ . Hence, our additive noise remains in the abovementioned a priori bounds. We vary the values of $M$ from (0.1, 0.3) with a 0.1 increment, giving us three training cases. Figure 3 shows that the proposed training loss still manages to achieve steady state error and does not diverge due to perturbations introduced in the input dataset. Since we are dealing with noisy data, the loss values converge to a non-zero value in the steady-state
|
| 244 |
+
|
| 245 |
+
Experiments on larger datasets. In this section, we present results to demonstrate the performance of our proposed algorithm on a larger dataset. We use the entire IMDB Wiki Faces Dataset Rothe et al. (2015) with 0.5 million images for this experiment. Training dataset consists of ${ \sim } 0 . 2$ million images and the test and validation set consists of ${ \sim } 0 . 1$ million images each. As described in the previous section, a multi-layer perceptron is trained to predict the age from the image of a face. The MLP is trained for 100 epochs with learning rate 0.0005 for all three loss functions and with $\alpha = 0 . 7$ for Lyapunov loss function. From Figure 4 and Table 3, we can see that our proposed algorithm achieves similar generalization / testing rmse (Root mean square error) as $L _ { 1 }$ and $L _ { 2 }$ baselines while providing finite time convergence guarantees even on large datasets. The convergence time is also within the theoretically derived upper bound.
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 4: Comparison of training convergence with respect to time for 0.5 million IMDB Wiki dataset
|
| 249 |
+
|
| 250 |
+
<table><tr><td>Experiment</td><td>Theoretical Upper Bound</td><td colspan="3">Exp. Convergence Time (in seconds)</td><td colspan="3">Metric</td></tr><tr><td></td><td>(in seconds)</td><td>L1</td><td>L2</td><td>Lyap.</td><td>L1</td><td>rmse L2</td><td>Lyap.</td></tr><tr><td>IMDBWiki</td><td>8.3e6</td><td>980.40</td><td>712.99</td><td>467.96</td><td>0.414</td><td>0.415</td><td>0.416</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 3: rmse on IMDB Wiki test dataset for $L _ { 1 }$ , $L _ { 2 }$ and Lyapunov Loss function.
|
| 253 |
+
|
| 254 |
+
# 4 CONCLUSION AND FUTURE WORK
|
| 255 |
+
|
| 256 |
+
This paper studies the training of a deep neural network from control theory perspective. We pose the supervised learning problem as a control problem by jointly designing loss function as Lyapunov function and weight update as temporal derivative of the Lyapunov function. Control theory principles are then applied to provide guarantees on finite time convergence and settling time of the neural network. Through experiments on benchmark datasets, our proposed method converges within the a priori bounds derived from theory. It is also observed that in some cases our method enforces faster convergence as compared to standard $L _ { 1 }$ and $L _ { 2 }$ loss functions. We also prove that our method is robust to any perturbations in the input and convergence guarantees still hold true. The given a priori guarantees for the convergence time is a desirable result for training networks that are extremely difficult to converge, specifically in Reinforcement Learning. A future scope of this work may be to convert the continuous time analysis framework to discrete time. This study introduces a novel perspective of viewing neural networks as control systems and opens up the field of machine learning research to a plethora of new results that can be derived from control theory.
|
| 257 |
+
|
| 258 |
+
# REFERENCES
|
| 259 |
+
|
| 260 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. On the convergence rate of training recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 6673–6685, 2019.
|
| 261 |
+
|
| 262 |
+
Sanjeev Arora, Nadav Cohen, Noah Golowich, and Wei Hu. A convergence analysis of gradient descent for deep linear neural networks. arXiv preprint arXiv:1810.02281, 2018.
|
| 263 |
+
|
| 264 |
+
S.P. Bhat and D.S. Bernstein. Finite-Time Stability of Continuous Autonomous Systems. SIAM Journal of Control and Optimization, 38(3):751–766, 2000.
|
| 265 |
+
|
| 266 |
+
Christopher M. Bishop. Neural Networks for Pattern Recognition. OXFORD University Press, 1995.
|
| 267 |
+
|
| 268 |
+
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, 2018.
|
| 269 |
+
|
| 270 |
+
Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive. ics.uci.edu/ml.
|
| 271 |
+
|
| 272 |
+
Dongsheng Guo, Chenfu Yi, and Yunong Zhang. Zhang neural network versus gradient-based neural network for time-varying linear matrix equation solving. Neurocomputing, 74(17):3708–3712, 2011.
|
| 273 |
+
|
| 274 |
+
Harsh Gupta, R Srikant, and Lei Ying. Finite-time performance bounds and adaptive learning rate selection for two time-scale reinforcement learning. In Advances in Neural Information Processing Systems, pp. 4706–4715, 2019.
|
| 275 |
+
|
| 276 |
+
Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. Inverse Problems, 34(1):014004, 2017.
|
| 277 |
+
|
| 278 |
+
David Harrison Jr and Daniel L Rubinfeld. Hedonic housing prices and the demand for clean air. 1978.
|
| 279 |
+
|
| 280 |
+
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.
|
| 281 |
+
|
| 282 |
+
Maxim Kaledin, Eric Moulines, Alexey Naumov, Vladislav Tadic, and Hoi-To Wai. Finite time analysis of linear two-timescale stochastic approximation with markovian noise. arXiv preprint arXiv:2002.01268, 2020.
|
| 283 |
+
|
| 284 |
+
Yann LeCun, D Touresky, G Hinton, and T Sejnowski. A theoretical framework for backpropagation. In Proceedings of the 1988 connectionist models summer school, volume 1, pp. 21–28. CMU, Pittsburgh, Pa: Morgan Kaufmann, 1988.
|
| 285 |
+
|
| 286 |
+
Shuai Li, Sanfeng Chen, and Bo Liu. Accelerating a recurrent neural network to finite-time convergence for solving time-varying sylvester equation by using a sign-bi-power activation function. Neural processing letters, 37(2):189–205, 2013.
|
| 287 |
+
|
| 288 |
+
Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with relu activation. In Advances in neural information processing systems, pp. 597–607, 2017.
|
| 289 |
+
|
| 290 |
+
Guan-Horng Liu and Evangelos A Theodorou. Deep learning theory review: An optimal control and dynamical systems perspective. arXiv preprint arXiv:1908.10920, 2019.
|
| 291 |
+
|
| 292 |
+
Yury Orlov. Finite-Time Stability and Robust Control Synthesis of Uncertain Switched Systems. SIAM Journal of Control and Optimization, 43(4):1253–1271, 2005.
|
| 293 |
+
|
| 294 |
+
Rasmus Rothe, Radu Timofte, and Luc Van Gool. Dex: Deep expectation of apparent age from a single image. In IEEE International Conference on Computer Vision Workshops (ICCVW), December 2015.
|
| 295 |
+
|
| 296 |
+
Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
|
| 297 |
+
|
| 298 |
+
Gang Wang, Bingcong Li, and Georgios B Giannakis. A multistep lyapunov approach for finite-time analysis of biased stochastic approximation. arXiv preprint arXiv:1909.04299, 2019.
|
| 299 |
+
|
| 300 |
+
Lin Xiao. Accelerating a recurrent neural network to finite-time convergence using a new design formula and its application to time-varying matrix square root. Journal of the Franklin Institute, 354(13):5667–5677, 2017.
|
| 301 |
+
|
| 302 |
+
Bin Xu, Chenguang Yang, and Zhongke Shi. Reinforcement learning output feedback nn control using deterministic learning technique. IEEE Transactions on Neural Networks and Learning Systems, 25(3):635–641, 2013.
|
| 303 |
+
|
| 304 |
+
Yunong Zhang, Danchi Jiang, and Jun Wang. A recurrent neural network for solving sylvester equation with time-varying coefficients. IEEE Transactions on Neural Networks, 13(5):1053– 1063, 2002.
|
| 305 |
+
|
| 306 |
+
# A APPENDIX
|
| 307 |
+
|
| 308 |
+
# A.1 IMPACT OF $\alpha$ ON TRAINING
|
| 309 |
+
|
| 310 |
+
The case when $\alpha = 0$ , as depicted in Figure 5, raises continuity issues.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 5: Depiction of the numerical instability observed when we take $\alpha = 0$ . Effectively, at this point, the loss function contains a discontinuous signum function.
|
| 314 |
+
|
| 315 |
+
Consider the left and right limits of the function $f ( \varrho ) = | \varrho | ^ { \alpha } \mathrm { s i g n } ( \varrho )$ , where $\varrho = \delta _ { j } z _ { i }$ as appearing in (15). It can be seen that $\begin{array} { r } { \operatorname* { l i m } _ { \varrho \to 0 ^ { - } } f ( \varrho ) = \operatorname* { l i m } _ { \varrho \to 0 ^ { + } } f ( \varrho ) = 0 } \end{array}$ for $\alpha \in ( 0 , 1 )$ . However, for $\alpha = 0$ , $\begin{array} { r } { \operatorname* { l i m } _ { \varrho \to 0 ^ { - } } f ( \varrho ) = - 1 } \end{array}$ and $\begin{array} { r } { \operatorname* { l i m } _ { \varrho \to 0 ^ { + } } f ( \varrho ) = 1 } \end{array}$ . It should be noted that function $f ( \varrho )$ is non-Lipschitz since $\partial f / \partial \varrho$ tends to infinity in the limit $\varrho \to 0$ . We agree that $\alpha = 0$ reduces the loss function to L1 loss, but the control update becomes purely discontinuous due to the presence of $f ( \varrho )$ in (15). We do not deal with this case for the reasons of continuity as mentioned in the main paper.
|
| 316 |
+
|
| 317 |
+
# A.2 EXPERIMENTS
|
| 318 |
+
|
| 319 |
+
# A.2.1 EXPERIMENTAL SETUP
|
| 320 |
+
|
| 321 |
+
For our experiments, we use the NVIDIA GEFORCE GTX1080Ti GPU card with 12GB RAM, 4- core CPU with 32GB of RAM for training. The training code is in Python. All networks are trained on data with an $8 0 \% - 2 0 \%$ train data-test data split.
|
| 322 |
+
|
| 323 |
+
# A.2.2 CONVERGENCE EXPERIMENTS ON SINGLE NEURON
|
| 324 |
+
|
| 325 |
+
In this experiment, we perform binary classification on the Iris dataset (Dua & Graff (2017)) as a representative example of single neuron case presented in Section 2.1.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 6: Comparison of convergence with respect to time for a single neuron trained on the Iris dataset. We convert the problem into a binary classification problem by considering only two of the three output classes. All networks are trained for 2100 epochs with 80 training examples and 20 test examples, $\alpha = 0 . 8$ , learning rate $/ \operatorname { k } = 0 . 0 1$
|
| 329 |
+
|
| 330 |
+
From the Figure 6, we can clearly see that Lyapunov loss function with control weight update converges much faster towards zero as compared to $L _ { 1 }$ and $L _ { 2 }$ loss with standard gradient descent weight update. This shows that explicitly adding a control weight update (15) that drives the loss towards zero is helpful in reaching convergence faster.
|
| 331 |
+
|
| 332 |
+
# A.2.3 BOSTON HOUSING DATASET EXPERIMENT WITH PERTURBATIONS
|
| 333 |
+
|
| 334 |
+
The Boston Housing Dataset predicts the price of houses in various areas of Boston Mass, given 14 different relevant attributes, like per capita crime rate and pupil-teacher ratio by town. The 506 examples in the data are divided into a 80-20 training-test split to give us 505 training examples and 101 test examples respectively. We consider three cases here, $M = 0 . 1$ , $M = 0 . 2$ ,and $M = 0 . 3$ . Table 4 presents the theoretical upper bounds for the proposed Lyapunov function’s settling time and experimental results for the training conducted for different upper bounds assumed for the input perturbation. We observe that the settling time for the proposed Lyapunov function is similar to the one observed for $L _ { 2 }$ loss function whereas it performs way better than the $L _ { 1 }$ loss function.
|
| 335 |
+
|
| 336 |
+
<table><tr><td rowspan="2">Experiment for MLP case on Boston</td><td rowspan="2">Theoretical Upper Bound (in seconds)</td><td colspan="3">Exp. Convergence Time to within 10e-9 (in seconds)</td><td colspan="3">Metric rmse</td></tr><tr><td>L1</td><td>L2</td><td>Lyap.</td><td>L1</td><td>L2</td><td>Lyap.</td></tr><tr><td>dataset M=0.1</td><td>~1.97e11</td><td>1277.66</td><td>906.61</td><td>755.59</td><td>0.095</td><td>0.145</td><td>0.092</td></tr><tr><td>M= 0.2</td><td>~ 5.67e10</td><td>1297.11</td><td>1097.62</td><td>914.78</td><td>0.096</td><td>0.146</td><td>0.093</td></tr><tr><td>M= 0.3</td><td>~2.73e10</td><td>1290.48</td><td>1197.53</td><td>998.05</td><td>0.093</td><td>0.147</td><td>0.101</td></tr></table>
|
| 337 |
+
|
| 338 |
+
Table 4: Settling time in seconds for different values of the upper bound on additive input perturbations, $M$ for the multi layer perceptron case on Boston Housing dataset. We compare the time taken for convergence by three different loss functions, $L _ { 1 }$ , $L _ { 2 }$ and Lyapunov Loss function. The training conditions were similar for individual cases in the experiment.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 7: Pictorial representation of the effect of random additive noise with an upper bound of 0.2 on IMDB Wiki Faces Dataset. In this experiment, we work with monochrome images for the sake of simplicity.
|
| 342 |
+
|
| 343 |
+
Figure 7 shows us how the noise affects the training images. We take the specific case where $M =$ 0.2. We can clearly observe that the images obtained after adding input perturbations happens to be quite noisy. Figure 8 and Figure 9 show that even when inputs are perturbed, our proposed method converges in finite time.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 8: Comparison of training loss convergence with respect to time for different values of input perturbations, $\Delta x$ for a multi-layer perceptron trained on the IMDB Wiki Faces dataset. The a priori upper bound on input perturbations are as follows: (a) $\Delta x = 0 . 1$ , (b) $\Delta x = 0 . 2$ , $( \mathrm { c } ) \Delta x = 0 . 3$ , (d) $\Delta x = 0 . 4$ , (e) $\Delta x = 0 . 5$ , and (f) $\Delta x = 1 . 2$ .
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 9: Comparison of test loss convergence with respect to time for different values of input perturbations, $\Delta x$ for a multi-layer perceptron trained on the IMDB Wiki Faces dataset.The a priori upper bound on input perturbations are as follows: (a) $\Delta x = 0 . 1$ , (b) $\Delta x = 0 . 2$ , $( \mathrm { c } ) \Delta x = 0 . 3$ , (d) $\Delta x = 0 . 4$ , (e) $\Delta x = 0 . 5$ , and (f) $\Delta x = 1 . 2$ .
|
md/train/WGWzwdjm8mS/WGWzwdjm8mS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/XZDeL25T12l/XZDeL25T12l.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAN STUDENTS OUTPERFORM TEACHERS IN KNOWLEDGE DISTILLATION BASED MODEL COMPRESSION?
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Knowledge distillation (KD) is an effective technique to compress a large model (teacher) to a compact one (student) by knowledge transfer. The ideal case is that the teacher is compressed to the small student without any performance dropping. However, even for the state-of-the-art (SOTA) distillation approaches, there is still an obvious performance gap between the student and the teacher. The existing literature usually attributes this to model capacity differences between them. However, model capacity differences are unavoidable in model compression. In this work, we systematically study this question. By designing exploratory experiments, we find that model capacity differences are not necessarily the root reason, and the distillation data matters when the student capacity is greater than a threshold. In light of this, we propose to go beyond in-distribution distillation and accordingly develop $\mathrm { K D + }$ . $\mathrm { K D + }$ is superior to the original KD as it outperforms KD and the other SOTA approaches substantially and is more compatible with the existing approaches to further improve their performances significantly 1.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have achieved remarkable performances in various domains, but they require large amounts of computation and memory. This seriously limits their deployment with limited resources or a strict latency requirement. One solution to this problem is knowledge distillation which transfers the knowledge from a large network (teacher) to a small one (student).
|
| 12 |
+
|
| 13 |
+
Hinton et al. (2015) proposed the original knowledge distillation 2 (KD) which uses softened logits of a teacher as supervision to train a student. To make the student better capture the knowledge from the teacher, the existing studies focus on aligning their representations by using different criteria. However, there is still a significant performance gap between the teacher and the student. Figuring out the reason for this gap is essential for further improving the student performance.
|
| 14 |
+
|
| 15 |
+
Mirzadeh et al. (2020) argue that the model capacity difference causes the failure for transferring the knowledge from a large teacher to a small student, thus leading to a large performance gap. Similarly, Cho & Hariharan (2019) point out that as the teacher grows in capacity and accuracy, it is difficult for the student to emulate the teacher. In this paper, we systematically study why students underperform teachers and how students can match or outperform teachers. We find that in most experimental settings of the existing literature, the root reason for the performance gap is not necessarily the capacity differenc as the student is powerful enough to memorize the teacher’s outputs. The reason lies in the distillation dataset on which the knowledge is transferred.
|
| 16 |
+
|
| 17 |
+
As an old proverb says, indigo comes from blue, but it is bluer than blue. In reality, it is not rare for human students to do better than their teachers. These excellent human students not only well capture the knowledge from their teachers but also learn more related knowledge on their own. This gives an insight for students in KD to match or outperform their teachers. We find that currently the students in KD have not well captured the knowledge in their teachers as they only mimic the behavior of the teachers on sparse training data points. In light of this, we propose $\mathrm { K D + }$ which goes beyond in-distribution distillation to substantially reduce the performance gap between students and teachers.
|
| 18 |
+
|
| 19 |
+
Our main contributions are summarized as follows:
|
| 20 |
+
|
| 21 |
+
• Different from the common belief that model capacity differences result in the performance gap between students and teachers, we find that capacity differences are not necessarily the root reason and instead the distillation data matters when students’ capacities are greater than a threshold. To our best knowledge, this is the first work that systematically explores why small students underperform teachers and how students can outperform large teachers. • By designing exploratory experiments, we find the following: (1) only fitting teachers’ outputs at sparse training data points cannot make students well capture the local, indistribution shapes of the teacher functions; (2) different from the case on standard supervised learning, out-of-distribution data (but not all) can be beneficial to knowledge distillation. Different from the existing work focusing on using different criteria to align representations or logits between teachers and students, we address knowledge distillation from a novel (data) perspective by going beyond in-distribution distillation and accordingly develop $\mathrm { K D + }$ . Extensive experiments demonstrate that $\mathrm { K D + }$ largely reduces the performance gap between students and teachers, and even enables students to match or outperform their teachers. $\mathrm { K D + }$ is superior to KD as it outperforms KD and more than 10 SOTA methods substantially and shows a better compatibility with the existing methods and superiority in few-shot scenario.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
The objective function of knowledge distillation can be simply expressed as a combination of the regular cross-entropy objective and a distillation objective. According to the distillation objective, the existing literature can be divided into logit-based approaches (Hinton et al., 2015) and representationbased approaches (Romero et al., 2015). Logit-based approaches construct the distillation objective based on output logits. Hinton et al. (2015) propose KD which penalizes the softened logit differences between a teacher and a student. Park et al. (2019) propose to transfer data sample relations from a teacher to a student by aligning their logit-based structures. On the other hand, representation-based approaches design the distillation objective based on feature maps. FitNet (Romero et al., 2015) aligns the features of a teacher and a student through regressions. AT (Zagoruyko & Komodakis, 2017) distills feature attention from a teacher into a student. CRD (Tian et al., 2020) maximizes the mutual information between student and teacher representations. Other representation-based methods (Yim et al., 2017; Huang & Wang, 2017; Kim et al., 2018; Liu et al., 2019; Srinivas & Fleuret, 2018; Wang et al., 2018; Heo et al., 2019a; Cho & Hariharan, 2019; Ahn et al., 2019; Koratana et al., 2019; Aguilar et al., 2019; Shen & Savvides, 2020) use different criteria to align feature representations. SSKD (Xu et al., 2020) introduces extra self-supervision tasks to assist KD. Online knowledge distillation (Zhang et al., 2018b; Chen et al., 2020; Anil et al., 2018; Chung et al., 2020; Zhu et al., 2018) trains multiple students simultaneously. Self-distillation (Furlanello et al., 2018; Yuan et al., 2020) approaches train a DNN by using itself as the teacher. It is observed that the existing studies focus on designing different criteria to align teacher-student representations or logits on in-distribution data. In this work, we address knowledge distillation from a data perspective by embedding out-of-distribution distillation into a regularizer.
|
| 26 |
+
|
| 27 |
+
Mirzadeh et al. (2020) observe that the model capacity gap results in the failure for transferring knowledge from a large teacher to a small student, thus causing a performance gap. To reduce this gap, they propose a multi-step knowledge distillation framework by using several intermediate-size networks (teacher assistants). However, the students still underperform the teachers substantially. Cho & Hariharan (2019) argue that as the teacher grows in capacity and accuracy, it is difficult for the student to emulate the teacher. To reduce the influence of the large capacity gap, they regularize both the teacher and the knowledge distillation by early stopping. We find that capacity differences are not necessarily the root reason when student capacities are greater than a threshold.
|
| 28 |
+
|
| 29 |
+
On the other hand, $\mathrm { K D + }$ goes beyond in-distribution distillation by exploring the knowledge between two training samples. Similar techniques have been used in many applications with different goals and mechanisms. Mixup (Zhang et al., 2018a) enforces local linearity of a DNN by linearly interpolating a random pair of training samples and their one-hot labels simultaneously. However, simply interpolating two labels may not match the generated sample as pointed out in (Guo et al., 2019). $\mathrm { K D + }$ does not have the above issue as it teaches a student to mimic the local shape of a powerful teacher. MixMatch (Berthelot et al., 2019b) linearly interpolates labeled and unlabeled data to improve the semi-supervised learning performances. ReMixMatch (Berthelot et al., 2019a) improves MixMatch by introducing distribution alignment and augmentation anchoring. DivideMix (Li et al., 2020) aims to learn with noisy labels by modifying MixMatch with label co-refinement and label co-guessing on labeled and unlabeled samples, respectively. AugMix (Hendrycks et al., 2019) linearly interpolates original training samples and augmented training samples to improves the robustness and uncertainty estimates of DNNs.
|
| 30 |
+
|
| 31 |
+
# 3 REFORMULATING KD
|
| 32 |
+
|
| 33 |
+
Hinton et al. (2015) propose KD which minimizes the softened logit differences between a student and a teacher over training data $D _ { t } = \left( X _ { t } , Y _ { t } \right)$ where $X _ { t }$ and $Y _ { t }$ are the training samples and the ground truth, respectively. The complete objective is:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathcal { L } _ { K D } = \sum _ { ( x _ { t } , y _ { t } ) \in ( X _ { t } , Y _ { t } ) } [ \alpha \mathcal { L } _ { C E } ( f _ { S } , x _ { t } , y _ { t } ) + \beta \mathcal { L } _ { K L } ( f _ { S } , f _ { T } , x _ { t } ) ]
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\alpha$ and $\beta$ are balancing weights and $\mathcal { L } _ { C E }$ is the regular cross-entropy objective:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathcal { L } _ { C E } ( f _ { S } , x _ { t } , y _ { t } ) = H ( y _ { t } , \sigma ( f _ { S } ( x _ { t } ) ) )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $H ( . )$ is the cross-entropy and $\sigma$ is softmax. $\mathcal { L } _ { K L }$ in (1) is the distillation objective:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathcal { L } _ { K L } \left( f _ { S } , f _ { T } , x _ { t } \right) = \tau ^ { 2 } K L \left( \sigma \left( \frac { f _ { T } \left( x _ { t } \right) } { \tau } \right) , \sigma \left( \frac { f _ { S } \left( x _ { t } \right) } { \tau } \right) \right)
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\tau$ is a temperature to generate soft labels and $K L$ represents KL-divergence. KD can be considered as using one function $( f _ { S } )$ to fit the outputs of another function $( f _ { T } )$ .
|
| 52 |
+
|
| 53 |
+
We notice that in (1), $\mathcal { L } _ { C E }$ requires both data samples $X _ { t }$ and the corresponding ground truth $Y _ { t }$ while $\mathcal { L } _ { K L }$ only needs data samples $X _ { t }$ for distilling the teacher knowledge. In light of the difference, we consider KD from semi-supervised perspective and reformulate (1) in a more general form:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathcal { L } = \sum _ { ( x _ { t } , y _ { t } ) \in ( X _ { t } , Y _ { t } ) } \alpha \mathcal { L } _ { C E } ( f _ { S } , x _ { t } , y _ { t } ) + \sum _ { x _ { d } \in ( X _ { d } ) } \beta \mathcal { L } _ { K L } ( f _ { S } , f _ { T } , x _ { d } )
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where we introduce a new concept: distillation dataset $X _ { d }$ is a set of samples on which the knowledge is transferred from a teacher to a student. The first term in the right hand side of (4) is supervised while the second term is unsupervised. It is obvious that the widely used objective (1) is a special case of (4) when $X _ { d }$ is set to $X _ { t }$ .
|
| 60 |
+
|
| 61 |
+
# 4 WHY SMALL STUDENTS UNDERPERFORM LARGE TEACHERS?
|
| 62 |
+
|
| 63 |
+
In this part, we systematically analyze the reason for the performance gap between students and teachers in KD based model compression. We first introduce several definitions.
|
| 64 |
+
|
| 65 |
+
Definition 4.1 Memorization Error $( M E )$ : For a given task with data distribution $P ( X , Y )$ , ME measures the degree of a student $f _ { S }$ fitting the outputs of a teacher $f _ { T }$ over the data distribution:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
E ( f _ { S } , f _ { T } , P ) = \underset { x \sim P \left( X \right) } { \mathbb { E } } M ( f _ { T } \left( x \right) , f _ { S } \left( x \right) )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $M$ denotes a distance metric such as KL-divergence or mean square error. When ME is 0, it means that the student can completely memorize the outputs of the teacher over the data distribution. In this paper, we take KL-divergence as $M$ .
|
| 72 |
+
|
| 73 |
+
Definition 4.2 Capable Students (CSTs) and Incapable Students (ISTs): network $f _ { S }$ with parameters $\Theta _ { S }$ is a CST of teacher $f _ { T }$ if there exists $\Theta _ { S }$ such that $E ( f _ { S } , f _ { T } , P ) = 0 ,$ , otherwise, it is an IST.
|
| 74 |
+
|
| 75 |
+
Obviously, a CST is able to fully fit the teacher outputs over data distribution $P ( X , Y )$ . In contrast, an IST does not have the capacity to fit the teacher. For ISTs, the common belief holds that the student-teacher capacity gap causes the performance gap. For example, we cannot expect a two-layer neural network with 1000 parameters to fit the outputs of ResNet-101 with $1 . 7 \mathbf { M }$ parameters on
|
| 76 |
+
|
| 77 |
+
Table 1: ME of different networks on CIFAR-10, CIFAR-100, and Tiny ImageNet
|
| 78 |
+
|
| 79 |
+
<table><tr><td>Teacher Student</td><td>WRN-40-2 WRN-16-2</td><td>VGG-13 VGG-8</td><td>ResNet32×4 ResNet8×4</td><td>ResNet-110 VGG-8</td><td>ResNet32×4 ShuffleNetV2</td><td>VGG-13 SN2</td><td>VGG-13 SN3</td></tr><tr><td>CIFAR-10</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.7</td><td>0.1</td></tr><tr><td>CIFAR-100</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>2.4</td><td>0.3</td></tr><tr><td>Tiny ImageNet</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>4.2</td><td>1.9</td></tr></table>
|
| 80 |
+
|
| 81 |
+
Table 2: Simulation results on CIFAR-100 in terms of test accuracy $( \% )$
|
| 82 |
+
|
| 83 |
+
<table><tr><td>Teacher Student</td><td>ResNet32×4 ResNet8×4</td><td>WRN-40-2 WRN-16-2</td><td>VGG-13 VGG-8</td><td>ResNet32×4 ShuffleNetV2</td><td>VGG-13 SN2</td><td>VGG-13 SN3</td></tr><tr><td>Teacher</td><td>79.52</td><td>75.81</td><td>74.97</td><td>79.52</td><td>74.97</td><td>74.97</td></tr><tr><td>Vanilla Student</td><td>72.50</td><td>73.26</td><td>70.36</td><td>71.82</td><td>26.29</td><td>55.31</td></tr><tr><td>Student Type</td><td>CST</td><td>CST</td><td>CST</td><td>CST</td><td>IST</td><td>IST</td></tr><tr><td>KD</td><td>73.33</td><td>74.92</td><td>72.98</td><td>72.14</td><td>26.04</td><td>55.32</td></tr><tr><td>Simulation KD</td><td>79.91</td><td>78.46</td><td>77.99</td><td>81.64</td><td>25.58</td><td>57.50</td></tr></table>
|
| 84 |
+
|
| 85 |
+
CIFAR-100. However, in the current SOTA approaches and applications, the commonly used students are modern neural network architectures, such as ResNet-20, ResNet- $\cdot 8 \times 4$ , VGG-8, and WRN-40-1. We empirically show that these models are CSTs on commonly used benchmark datasets.
|
| 86 |
+
|
| 87 |
+
To check whether student $f _ { S }$ is a CST of teacher $f _ { T }$ on a task, we minimize ME to check whether $E ( f _ { S } , f _ { T } , P )$ can achieve 0. However, in practice, it is impossible to calculate $E ( f _ { S } , f _ { T } , P )$ as the data distribution $P$ is typically unknown. Fortunately, we have the access to a set of training data $( X _ { t } , Y _ { t } )$ . With the training data, we approximate ME $E ( f _ { S } , f _ { T } , P )$ with the empirical error:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
E _ { e m } ( f _ { S } , f _ { T } , X _ { t } ) = \frac { 1 } { \left| X _ { t } \right| } \sum _ { x _ { t } \in X _ { t } } M ( f _ { T } \left( x _ { t } \right) , f _ { S } \left( x _ { t } \right) )
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
For comparison, we also evaluate two small neural networks which are expected to be ISTs, i.e., SN-2 and SN-3 with two and three layers, respectively. We report the ME in Table $1 ^ { 3 }$ , where we adopt the students and the teachers that share the same architectures (e.g., WRN-40-2 and WRN-16-2) or use different architectures (e.g., ResNet-110 and VGG-8). As expected, the widely used students achieve $\mathrm { M E } \left. . 0 \right.$ on these benckmark datasets, i.e., CIFAR-10, CIFAR-100, and Tiny ImageNet while the small networks (i.e., SN2 and SN3) have large ME (e.g., 2.4 and 4.2), which demonstrates that the widely used students are CSTs. However, as observed in the existing literature, these CSTs underperform the teachers by a significant margin on the test data. This suggests that these students have well captured the knowledge on sparse training data points but have not well captured the local shapes of the teachers within the data distribution.
|
| 94 |
+
|
| 95 |
+
Corollary 4.1 In KD, for CSTs, only fitting the outputs of teachers on sparse training data points cannot enable them to well capture the local, in-distribution shapes of the teachers, thus leading to a performance gap. For ISTs, capacity differences cause the performance gap.
|
| 96 |
+
|
| 97 |
+
Proof: We empirically show this by comparing the student performances in the following two settings: (a) setting the distillation dataset to training data points; (b) setting the distillation dataset to real data distribution $P ( X )$ . As $P ( X )$ is typically unknown in practice, we conduct a simulation experiment on CIFAR-100. We suppose that the union of the training dataset and the test dataset in CIFAR-100 can accurately represent the real data distribution for this task. Then we randomly draw data samples from the vicinity around the training data and the test data as the distillation dataset, i.e., $X _ { d }$ in (4). Consequently, the distillation dataset can sufficiently represent the real data sample distribution. Note that in the experiments, we never spy the ground truth of the test samples, since the distillation dataset does not use ground truth as shown in (4). This means that the students are trained without any additional supervision compared with the teachers as training datset $( X _ { t } , Y _ { t } )$ in (4) does not change. As CSTs are able to fully memorize the outputs of the teachers, we expect them to achieve the same accuracies as or higher accuracies than those of the teachers. In contrast, we expect ISTs to achieve lower accuracies than those of the teachers. Table 2 shows the simulation results. As expected, all the CSTs outperform the teachers in the simulation experiments (i.e., Simulation KD). This is due to the following facts: first, by using the simulated distillation dataset, the distillation objective in (4) makes the CSTs fully capture the knowledge of the teachers within the data distribution; second, the cross-entropy objective in (4) enables the CSTs to learn their own knowledge. Consequently, CSTs contain both the teacher knowledge and the knowledge learned on their own, which results in better performances than those of the teachers. SN2 and SN3 still underperform the teachers in the simulation experiments due to their limited capacities. These results empirically prove Corollary 4.1.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 1: KD with training data
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 2: KD with augmentation
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: KD+
|
| 107 |
+
|
| 108 |
+
The simulation experiments also suggest a way for CSTs to outperform teachers. That is to sufficiently distill the knowledge in the teachers with a well representative distillation dataset. Unfortunately, it is impossible to have such a distillation datset as the real data sample distribution $P ( X )$ is typically unknown in practice. Motivated by this, we propose to go beyond in-distribution distillation.
|
| 109 |
+
|
| 110 |
+
# 5 GOING BEYOND IN-DISTRIBUTION DISTILLATION
|
| 111 |
+
|
| 112 |
+
# 5.1 DIFFERENCES BETWEEN SUPERVISED LEARNING AND KNOWLEDGE DISTILLATION
|
| 113 |
+
|
| 114 |
+
As analyzed above, the reason for the performance gap lies in distillation datasets. Distillation datasets are different from training datsets. As shown in (4), training datsets contain both samples and their ground truth, which are used for standard supervised learning. In contrast, distillation datsets only contain samples without ground truth, which are used for knowledge distillation. Knowledge distillation and standard supervised learning differ substantially. Standard supervised learning is to learn a function $f$ (e.g., a DNN) for mapping $x$ to $y$ where $( x , y )$ follows real data distribution $P ( X , Y )$ . The quality of $f$ is constrained by the training data $( X _ { t } , Y _ { t } )$ that we have. In contrast, knowledge distillation is to learn a function (i.e., a student $f _ { S } )$ for mapping $x$ to $z$ where $( x , z )$ follows a teacher-defined distribution $Q ( X , Z )$ and $\begin{array} { r } { Z = \sigma ( \frac { f _ { T } ( X ) } { \tau } ) } \end{array}$ . $Q ( X , Z )$ is different from $P ( X , Y )$ unless teacher $f _ { T }$ is perfect. The advantage of knowledge distillation is that $Q ( X , Z )$ is more tractable than $P ( X , Y )$ , since for given any sample $x$ , $f _ { T }$ can always give output $f _ { T } ( x )$ , and $\textstyle ( x , \sigma ( { \frac { f _ { T } ( x ) } { \tau } } ) )$ follows $Q ( X , Z )$ . Even for out-of-distribution samples, $f _ { T }$ can still output soft labels although these soft labels are semantically meaningless. However, the existing literature ignores this advantage as they only distill the knowledge on sparse training data points.
|
| 115 |
+
|
| 116 |
+
# 5.2 IMPROVING KD BY FURTHER EXPLORING TEACHER-DEFINED DISTRIBUTION
|
| 117 |
+
|
| 118 |
+
The simulation experiments demonstrate that only fitting sparse individual data points cannot necessarily enable students to well capture the local shapes of the teacher functions. As shown in Figure 1 where the yellow regions denote real data sample distribution $P ( X )$ , even if student $f _ { S }$ perfectly fits teacher $f _ { T }$ at each training data point, i.e., $x _ { 1 }$ , $x _ { 2 }$ , and $x _ { 3 }$ , their local shapes near these samples can still be highly different. To mitigate this issue, the typically used strategy is data augmentation Simard et al. (1998) formalized by the Vicinal Risk Minimization (VRM) Chapelle et al. (2001) principle. In VRM, human knowledge is necessary to define a vicinity or neighborhood around each training data point. Then, additional new data points can be drawn from the vicinity distribution of the training data. For example, in image classification, it is common to define the vicinity of an image as the set of its random crops after mildly padding and flipping. Nevertheless, data augmentation has its own limitation that a newly generated data point is very close to the original training data point, since they contain almost the identical objective only with different backgrounds caused by padding or cropping. Due to this limitation, as shown in Figure 2, even if the student $f _ { S }$ fits the teacher $f _ { T }$ at all the training data points (i.e., $x _ { 1 } , x _ { 2 }$ , and $x _ { 3 }$ ) and the augmented data points (i.e., $x _ { 1 } ^ { a u g } , x _ { 2 } ^ { a u g }$ , and $x _ { 3 } ^ { a u g }$ ), their local shapes can still differ substantially.
|
| 119 |
+
|
| 120 |
+
Table 3: Ablation study on CIFAR-100 in terms of test accuracy $( \% )$
|
| 121 |
+
|
| 122 |
+
<table><tr><td></td><td colspan="4">Teacher:WRN-4O-2, Student: WRN-40-1</td><td colspan="4">Teacher:ResNet32×4,Student:ShuffleNetV2</td></tr><tr><td>KD</td><td colspan="4">73.54±0.20</td><td colspan="4">74.45±0.27</td></tr><tr><td></td><td>p=2</td><td>p=3</td><td>p=5</td><td>p=10</td><td>p=2</td><td>p=3</td><td>p=5</td><td>p=10</td></tr><tr><td>r=2:1</td><td>75.10±0.13</td><td>74.79±0.17</td><td>74.72±0.19</td><td>74.68±0.24</td><td>75.72±0.32</td><td>76.03±0.15</td><td>75.77±0.12</td><td>76.03±0.17</td></tr><tr><td>r=1:1</td><td>75.21±0.14</td><td>75.35±0.16</td><td>75.13±0.17</td><td>74.72±0.31</td><td>76.80±0.08</td><td>77.22±0.21</td><td>76.42±0.27</td><td>76.44±0.29</td></tr><tr><td>r=1:2</td><td>75.00±0.11</td><td>75.25±0.12</td><td>74.76±0.32</td><td>74.76±0.41</td><td>76.50±0.07</td><td>77.21±0.14</td><td>76.57±0.17</td><td>76.01±0.38</td></tr><tr><td>r=1:5</td><td>74.40±0.18</td><td>75.15±0.14</td><td>74.16±0.42</td><td>74.25±0.34</td><td>75.35±0.34</td><td>76.02±0.37</td><td>75.17±0.35</td><td>75.50±0.32</td></tr></table>
|
| 123 |
+
|
| 124 |
+
To address the above issue, we propose $\mathrm { K D + }$ that regularizes KD by enforcing students to mimic the behavior of teachers on the region between two training (or augmented) samples. As shown in Figure 3, $\mathrm { K D + }$ first defines $p - 1$ points (i.e., $p _ { 1 } , p _ { 2 } , . . . , p _ { p - 1 } )$ that evenly divide the region between two training samples (i.e., $x _ { 1 }$ and $x _ { 2 }$ ) into $p$ pieces. We denote the set of $p _ { 1 }$ , $p _ { 2 }$ , ..., and $p _ { p - 1 }$ by P. P contains in-distribution points and out-of-distribution points. $\mathrm { K D + }$ enforces the students to mimic the behavior of the teachers on P, which serves as a data-driven regularizer. $\mathrm { K D + }$ goes beyond in-distribution distillation as it also uses out-of-distribution points in the regulaizer. As seen from Figure 3, the regularizer can make the student better explore and capture the local shape of the teacher. Consequently, the complete objective of $\mathrm { K D + }$ is written as:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathcal { L } _ { K D + } = \mathcal { L } _ { K D } + \lambda \sum _ { p _ { i } \in P } \mathcal { L } _ { K L } ( f _ { S } , f _ { T } , p _ { i } )
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\lambda$ is a balancing weight and simply setting $\lambda$ to 1 works pretty well. $\mathrm { K D + }$ is a very concise approach without requiring complex hyperparameter tuning and can sufficiently explore the knowledge in the teacher by using freely obtained in-distribution and out-of-distribution points as a regularizer.
|
| 131 |
+
|
| 132 |
+
# 6 EXPERIMENTS FOR EVALUATING $\mathrm { K D + }$
|
| 133 |
+
|
| 134 |
+
In this section, We first conduct ablation study. Then we show that $\mathrm { K D + }$ is superior to KD by (1) comparing $\mathrm { K D + }$ with KD and other SOTA approaches, (2) showing that $\mathrm { K D + }$ is more compatible with these approaches, (3) showing the superiority of $\mathrm { K D + }$ under few-shot setting.
|
| 135 |
+
|
| 136 |
+
6.1 DATASETS, ARCHITECTURES, COMPETITORS, AND HYPER-PARAMETERS
|
| 137 |
+
|
| 138 |
+
Experiments are conducted on three benchmark datasets. CIFAR-100 (Krizhevsky & Hinton, 2009) has 100 classes with $5 0 \mathrm { k }$ training images and 10k test images. Tiny ImageNet 4 has 200 classes with 100k training images and $1 0 \mathrm { k }$ test images. ImageNet (Deng et al., 2009) has 1000 classes with 1.28M training images and 50k validation images. We use the standard data augmentation strategy for each dataset. We adopt various modern architectures, i.e., ResNet (He et al., 2016), WRN (Zagoruyko & Komodakis, 2016), VGG (Simonyan & Zisserman, 2015), MobileNet (Sandler et al., 2018), and ShuffleNet (Ma et al., 2018). We compare $\mathrm { K D + }$ with KD and several SOTA methods, i.e., FitNet (Romero et al., 2015), AT (Zagoruyko & Komodakis, 2017), SP (Tung & Mori, 2019), FT (Kim et al., 2018), NST (Huang & Wang, 2017), CC (Peng et al., 2019), FSP (Yim et al., 2017), PKT (Passalis & Tefas, 2018), AB (Heo et al., 2019b), VID (Ahn et al., 2019), RKD (Park et al., 2019), CRD (Tian et al., 2020), and SSKD (Xu et al., 2020). For these SOTA approaches, we report the author-reported results, or use author-provided codes and the optimal hyper-parameters if they are publicly available. Otherwise, we use the implementation of Tian et al. (2020).
|
| 139 |
+
|
| 140 |
+
We follow KD and set $\alpha$ , $\beta$ , $\lambda$ and $\tau$ to 0.1, 0.9, 1, and 4, respectively, on all the datasets except on ImageNet where we follow the existing literature to set $\alpha = 1$ and $\tau = 3$ . We have trained all the networks for 240, 100, and 120 epochs with SGD with momentum 0.9 on CIFAR-100, Tiny ImageNet, and ImageNet, respectively. We set the initial learning rate to 0.05 for for ResNet, WRN, and VGG, and 0.01 for MobileNet and ShuffleNet. On CIFAR, the learning rate is divided by 10 every 30 epochs after the first 150 epochs. On Tiny ImageNet, the learning rate is divided by 5 every 30 epochs. On ImageNet, the learning rate is initilized to 0.1 and is divided by 10 every 30 epochs. More implementation details are reported in Appendix A.
|
| 141 |
+
|
| 142 |
+
Table 4: Test accuracy on CIFAR-100. Underline denotes that students match or outperform teachers.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Teacher Student</td><td>VGG-13 VGG-8</td><td>ResNet32×4 ResNet8×4</td><td>WRN-40-2 WRN-40-1</td><td>ResNet-110 ResNet-32</td><td>WRN-40-2 VGG-8</td><td>ResNet32×4 ShuffleNetV2</td></tr><tr><td>Teacher Vanilla Student</td><td>74.64 70.36</td><td>79.42 72.50</td><td>75.61 71.98</td><td>74.31 71.14</td><td>75.61 70.36</td><td>79.42 71.86</td></tr><tr><td>KD</td><td>72.98±0.19</td><td>73.33±0.25</td><td>73.54±0.20</td><td>73.08±0.18</td><td>73.51±0.17</td><td>74.45±0.27</td></tr><tr><td>KD+</td><td>75.05±0.24</td><td>76.19±0.19</td><td>75.35±0.16</td><td>74.22±0.21</td><td>75.47±0.13</td><td>77.22±0.21</td></tr><tr><td>FitNet</td><td>71.02±0.31</td><td>73.50±0.28</td><td>72.24±0.24</td><td>71.06±0.13</td><td>71.14±0.17</td><td>73.54±0.22</td></tr><tr><td>AT</td><td>71.43±0.09</td><td>73.44±0.19</td><td>72.77±0.10</td><td>72.31±0.08</td><td>70.30±0.21</td><td>72.73±0.09</td></tr><tr><td>SP</td><td>72.68±0.19</td><td>72.94±0.23</td><td>72.43±0.27</td><td>72.69±0.41</td><td>73.12±0.18</td><td>74.56±0.22</td></tr><tr><td>CC</td><td>70.71±0.24</td><td>72.97±0.17</td><td>72.21±0.25</td><td>71.48±0.21</td><td>70.64±0.20</td><td>71.29±0.38</td></tr><tr><td>VID</td><td>71.23±0.06</td><td>73.09±0.21</td><td>73.30±0.13</td><td>72.61±0.28</td><td>71.86±0.23</td><td>73.40±0.17</td></tr><tr><td>RKD</td><td>71.48±0.05</td><td>71.90±0.11</td><td>72.22±0.20</td><td>71.82±0.34</td><td>71.00±0.19</td><td>73.21±0.28</td></tr><tr><td>PKT</td><td>72.88±0.09</td><td>73.64±0.18</td><td>73.45±0.19</td><td>72.61±0.17</td><td>72.74±0.42</td><td>74.69±0.34</td></tr><tr><td>AB</td><td>70.94±0.18</td><td>73.17±0.31</td><td>72.38±0.31</td><td>70.98±0.39</td><td>72.21±0.41</td><td>74.31±0.11</td></tr><tr><td>FT</td><td>70.58±0.08</td><td>72.86±0.12</td><td>71.59±0.15</td><td>72.37±0.31</td><td>68.33±0.22</td><td>72.50±0.15</td></tr><tr><td>CRD</td><td>73.94±0.22</td><td>75.51±0.18</td><td>74.14±0.22</td><td>73.48±0.13</td><td>74.08±0.20</td><td>75.65±0.10</td></tr><tr><td>NST</td><td>71.53±0.13</td><td>73.30±0.25</td><td>72.24±0.22</td><td>71.96±0.07</td><td>69.56±0.24</td><td>74.68±0.26</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 5: Test accuracies $( \% )$ on Tiny ImageNet.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Teacher</td><td>Student</td><td>KD</td><td>KD+</td><td>FitNet</td><td>AT</td><td>CC</td><td>SP</td><td>VID</td><td>RKD</td><td>CRD</td><td>PKT</td><td>AB</td></tr><tr><td>VGG-13 (61.62)</td><td>VGG-8 (55.46)</td><td>60.21 ±0.19</td><td>62.20 ±0.11</td><td>55.26 ±0.20</td><td>56.82 ±0.46</td><td>54.14 ±0.19</td><td>56.99 ±0.42</td><td>54.57 ±0.26</td><td>56.60 ±0.13</td><td>59.95 ±0.23</td><td>56.36 ±0.17</td><td>55.41 ±0.36</td></tr><tr><td>WRN-40-2 (61.84)</td><td>WRN-40-1 (55.39)</td><td>56.25 ±0.15</td><td>57.65 ±0.25</td><td>55.41 ±0.31</td><td>55.84 ±0.41</td><td>55.10 ±0.43</td><td>54.09 ±0.26</td><td>56.07 ±0.23</td><td>55.37 ±0.29</td><td>56.75 ±0.33</td><td>56.31 ±0.22</td><td>55.76 ±0.26</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 6: Comparison results on ImageNet
|
| 151 |
+
|
| 152 |
+
<table><tr><td></td><td>Teacher</td><td>Student</td><td>KD</td><td>KD+</td><td>AT</td><td>CRD</td><td>SP</td><td>CC</td></tr><tr><td>TOP-1</td><td>73.31</td><td>69.75</td><td>70.66</td><td>71.81</td><td>70.70</td><td>71.17</td><td>70.22</td><td>69.96</td></tr><tr><td>TOP-5</td><td>91.42</td><td>89.07</td><td>89.88</td><td>90.72</td><td>90.00</td><td>90.13</td><td>89.80</td><td>89.17</td></tr></table>
|
| 153 |
+
|
| 154 |
+
6.2 ABLATION STUDY AND OUT-OF-DISTRIBUTION DISTILLATION
|
| 155 |
+
|
| 156 |
+
We investigate how the performance varies with the values of $p$ . We also check how the performance varies with the number of points used in the regularizer of $\mathrm { K D + }$ as $\mathrm { \bf P }$ contains much more samples than the training dataset. We use $r$ to denote the ratio of the number of training samples to the number of samples used in the regularizer. Table 3 reports the results of $\mathrm { K D + }$ with different $p$ and $r$ . The value of $p$ determines what points are included in the regularzier of $\mathrm { K D + }$ . When $\scriptstyle p = 2$ , it means that we only use the middle points between two training (or augmented) samples in the regularizer. These middle points have a high probability of being out-of-distribution as they do not belong to any predefined classes. As seen from Table 3, by distilling on these middle points (i.e., $p { = } 2 \rangle$ ) as a regularizer, $\mathrm { K D + }$ outperforms KD significantly (e.g., from 73.54 to 75.21 on WRN-40-1), which demonstrates that the out-of-distribution samples can be beneficial to knowledge distillation. Note that not all out-of-distribution samples are useful(e.g., randomly generated samples from normal distribution are harmful as shown in Appendix D). The reason for the usefulness of these middle points may be that these points are not far from the real data distribution as they share some statistics with the training data (e.g., the mean, the variance, and the relation among data dimensions). We also notice that the performance of $\mathrm { K D + }$ is not sensitive to the values of $r$ and $p$ . The best performance is achieved when $r { = } 1 { : } 1$ and $\scriptstyle { p = 3 }$ . Thus, we simply set $r { = } 1 { : } 1$ and $\scriptstyle { p = 3 }$ in the rest of the experiments.
|
| 157 |
+
|
| 158 |
+
# 6.3 COMPARISON WITH KD AND SOTA APPROACHES
|
| 159 |
+
|
| 160 |
+
Table 4 summarizes the comparison results on CIFAR-100. We have the following observations. First, there is an obvious performance gap between the students and the teachers for the existing approaches (e.g., KD, FitNet, and AT). Second, with a simple regularizer, $\mathrm { K D + }$ substantially reduces the performance gap on all the six teacher-student pairs, and even matches or outperforms the teachers on four pairs (that are denoted by underline). On the other two teacher-student pairs, although the students still underperform the teachers, the performance gap is largely reduced by $\mathrm { K D + }$ . Note that there is no guarantee for $\mathrm { K D + }$ to make students match or outperform teachers as the regularizer in $\mathrm { K D + }$ cannot fully compensate for the unknown data sample distribution. Third, $\mathrm { K D + }$ consistently outperforms KD and the other SOTA approaches by a large margin across different architectures, which demonstrates the superiority of $\mathrm { K D + }$ . Fourth, on the pair of WRN-40-2 and VGG-8, almost all the representation-based approaches (e.g., FitNet and AT) fail to transfer knowledge from the teacher to the student, even underperform the vanilla student. The reason is that WRN-40-2 and VGG-8 have extremely different architectures. Aligning their feature maps hurts the student performance. In contrast, $\mathrm { K D + }$ shows its robustness and superiority in this case, and even enables student VGG-8 to match the performance of teacher WRN-40-2.
|
| 161 |
+
|
| 162 |
+
Table 7: Compatibility performances on CIFAR-100
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Teacher Student</td><td>ResNet32×4 ResNet8×4</td><td>VGG-13 VGG-8</td><td>ResNet-50 VGG-8</td><td>ResNet32×4 ShuffleNetV2</td><td>ResNet-110 ResNet-20</td><td>WRN-40-2 WRN-16-2</td></tr><tr><td>FitNet+KD</td><td>74.66±0.26 76.22±0.23</td><td>73.22±0.21 74.68±0.16</td><td>73.24±0.27 75.48±0.22</td><td>75.15±0.19 77.90±0.28</td><td>70.67±0.21 71.27±0.26</td><td>75.12±0.33 75.89±0.15</td></tr><tr><td>FitNet+KD+ AT+KD</td><td>74.53±0.18</td><td>73.48±0.19</td><td>74.01±0.25</td><td>75.39±0.29</td><td>70.97±0.17</td><td>75.32±0.15</td></tr><tr><td>AT+KD+</td><td>75.41±0.17</td><td>74.08±0.25</td><td>74.93±0.13</td><td>75.97±0.31</td><td>71.23±0.23</td><td>75.87±0.18</td></tr><tr><td>SP+KD SP+KD+</td><td>74.02±0.24 75.34±0.28</td><td>73.49±0.19 74.77±0.16</td><td>73.52±0.25 75.22±0.23</td><td>74.88±0.16 76.24±0.18</td><td>71.02±0.22 71.21±0.24</td><td>74.98±0.28 75.23±0.18</td></tr><tr><td>CC+KD</td><td>74.21±0.26</td><td>73.04±0.15</td><td>73.48±0.29</td><td>74.71±0.21</td><td>70.88±0.20</td><td>75.09±0.23</td></tr><tr><td>CC+KD+ VID+KD</td><td>76.28±0.23 74.56±0.10</td><td>74.45±0.22 73.19±0.20</td><td>75.33±0.27 73.46±0.25</td><td>77.35±0.19 74.85±0.28</td><td>71.32±0.27 71.10±0.18</td><td>75.88±0.26 75.14±0.15</td></tr><tr><td>VID+KD+</td><td>76.07±0.19</td><td>75.08±0.24</td><td>75.63±0.17</td><td>77.00±0.29</td><td>71.48±0.16</td><td>75.70±0.23</td></tr><tr><td>RKD+KD RKD+KD+</td><td>73.79±0.18</td><td>72.97±0.08</td><td>73.51±0.33</td><td>74.55±0.23</td><td>70.77±0.16</td><td>74.89±0.20</td></tr><tr><td></td><td>75.81±0.28</td><td>74.49±0.12</td><td>75.58±0.31</td><td>76.47±0.16</td><td>71.32±0.17</td><td>75.20±0.22</td></tr><tr><td>PKT+KD</td><td>74.23±0.13</td><td>73.25±0.21</td><td>73.61±0.28</td><td>74.66±0.30</td><td>70.72±0.24</td><td>75.33±0.18</td></tr><tr><td>PKT+KD+</td><td>76.12±0.22</td><td>74.80±0.19</td><td>75.70±0.15</td><td>76.63±0.12</td><td>71.36±0.20</td><td>75.65±0.29</td></tr><tr><td>CRD+KD</td><td>75.46±0.25</td><td>74.29±0.12</td><td></td><td></td><td></td><td></td></tr><tr><td>CRD+KD+</td><td></td><td></td><td>74.58±0.27</td><td>76.05±0.09</td><td>71.56±0.16</td><td>75.64±0.21</td></tr><tr><td></td><td>76.84±0.19</td><td>74.74±0.21</td><td>75.82±0.17</td><td>76.89±0.12</td><td>72.00±0.23</td><td>76.08±0.20</td></tr><tr><td>AB+KD</td><td>74.40±0.27</td><td>73.35±0.20</td><td>73.65±0.41</td><td>74.99±0.35</td><td>70.97±0.19</td><td>70.27±0.17</td></tr><tr><td>AB+KD+</td><td>75.95±0.33</td><td>74.92±0.21</td><td>76.11±0.18</td><td>77.85±0.16</td><td>71.75±0.27</td><td>71.35±0.29</td></tr><tr><td>NST+KD</td><td></td><td>73.33±0.15</td><td></td><td></td><td></td><td></td></tr><tr><td>NST+KD+</td><td>74.28±0.22</td><td></td><td>71.74±0.29</td><td>75.24±0.40</td><td>71.01±0.24</td><td>74.67±0.26</td></tr><tr><td></td><td>75.60±0.19</td><td>74.53±0.23</td><td>73.85±0.17</td><td>77.67±0.27</td><td>71.13±0.29</td><td>75.68±0.32</td></tr><tr><td>SSKD</td><td>76.20±0.36</td><td>75.33±0.27</td><td>75.76±0.40</td><td>78.61±0.33</td><td>71.38±0.26</td><td>76.04±0.21</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SSKD+</td><td>76.59±0.11</td><td>75.60±0.21</td><td>76.01±0.25</td><td>78.75±0.18</td><td>71.54±0.20</td><td>76.34±0.27</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 5 reports the comparison results on Tiny ImageNet. $\mathrm { K D + }$ beats KD and the other approaches significantly, and even outperforms teacher VGG-13, which demonstrates the effectiveness of $\mathrm { K D + }$
|
| 167 |
+
|
| 168 |
+
We further evaluate $\mathrm { K D + }$ on large scale dataset ImageNet. Limited by computation resources, we only adopt one teacher-student pair on ImageNet. We follow CRD and use ResNet-34 and ResNet-18 as the teacher and the student, respectively. As shown in Table 6, $\mathrm { K D + }$ improves the accuracy over KD and the other approaches significantly, which demonstrates the applicability and usefulness of $\mathrm { K D + }$ on large scale datasets. We also notice that there is still an obvious performance gap between the teacher and the student on ImageNet. The reason can be the model capacity difference as we find that ResNet-18 is an IST of ResNet-34 on the large and complex dataset ImageNet.
|
| 169 |
+
|
| 170 |
+
# 6.4 COMPATIBILITY WITH SOTA APPROACHES
|
| 171 |
+
|
| 172 |
+
The existing SOTA approaches can be combined with KD to obtain further performance gain. We show that these approaches combined with $\mathrm { K D + }$ are able to obtain more performance gain. As shown in Table 7, the existing approaches when combined with $\mathrm { K D + }$ consistently achieve much better performances than when combined with KD in all the settings where the teachers and the students use similar or different architectures. This demonstrates that $\mathrm { K D + }$ has a better compatibility than KD and the regularizer of going beyond in-distribution distillation also benefits the existing approaches.
|
| 173 |
+
|
| 174 |
+
Table 8: Test accuracies on CIFAR-100 under few-shot scenario
|
| 175 |
+
|
| 176 |
+
<table><tr><td></td><td colspan="2">60% Training Data</td><td colspan="2">40% TrainingData</td><td colspan="2">20% Training Data</td><td colspan="2">10% Training Data</td></tr><tr><td>Teacher</td><td>ResNet32×4</td><td>VGG-13</td><td>ResNet32×4</td><td>VGG-13</td><td>ResNet32×4</td><td>VGG-13</td><td>ResNet32×4</td><td>VGG-13</td></tr><tr><td>Student</td><td>ResNet8×4</td><td>VGG-8</td><td>ResNet8×4</td><td>VGG-8</td><td>ResNet8×4</td><td>VGG-8</td><td>ResNet8×4</td><td>VGG-8</td></tr><tr><td>Teacher Vanilla Student</td><td>79.42</td><td>74.64</td><td>79.42</td><td>74.64</td><td>79.42</td><td>74.64</td><td>79.42</td><td>74.64</td></tr><tr><td></td><td>68.54</td><td>65.57</td><td>64.35</td><td>61.45</td><td>54.70</td><td>52.50</td><td>42.76</td><td>39.30</td></tr><tr><td>KD</td><td>69.12</td><td>69.90</td><td>66.44</td><td>66.89</td><td>58.23</td><td>59.14</td><td>47.95</td><td>49.00</td></tr><tr><td>KD+</td><td>73.65</td><td>72.10</td><td>70.75</td><td>70.53</td><td>65.68</td><td>64.94</td><td>57.00</td><td>56.50</td></tr><tr><td>FitNet</td><td>69.61</td><td>66.60</td><td>66.97</td><td>62.06</td><td>60.18</td><td>53.57</td><td>51.46</td><td>39.89</td></tr><tr><td>AT</td><td>69.35</td><td>67.36</td><td>66.19</td><td>65.12</td><td>57.72</td><td>58.16</td><td>44.70</td><td>47.16</td></tr><tr><td>SP</td><td>69.62</td><td>69.76</td><td>65.82</td><td>66.40</td><td>59.00</td><td>58.57</td><td>45.44</td><td>40.27</td></tr><tr><td>CC</td><td>68.37</td><td>65.37</td><td>64.26</td><td>60.60</td><td>54.68</td><td>51.27</td><td>42.74</td><td>39.16</td></tr><tr><td>VID</td><td>69.12</td><td>67.29</td><td>65.87</td><td>62.58</td><td>57.31</td><td>54.86</td><td>44.41</td><td>41.07</td></tr><tr><td>RKD</td><td>67.71</td><td>66.18</td><td>63.51</td><td>62.32</td><td>52.29</td><td>52.13</td><td>39.19</td><td>39.70</td></tr><tr><td>PKT</td><td>70.48</td><td>69.21</td><td>66.41</td><td>65.97</td><td>59.06</td><td>58.08</td><td>43.50</td><td>41.15</td></tr><tr><td>CRD</td><td>71.29</td><td>70.46</td><td>68.15</td><td>66.27</td><td>59.38</td><td>57.57</td><td>48.23</td><td>46.33</td></tr><tr><td>AB</td><td>69.25</td><td>65.98</td><td>65.30</td><td>63.07</td><td>58.48</td><td>56.55</td><td>48.61</td><td>48.27</td></tr><tr><td>FT</td><td>67.05</td><td>64.88</td><td>63.38</td><td>60.37</td><td>53.85</td><td>50.42</td><td>39.55</td><td>38.10</td></tr><tr><td>NST</td><td>69.87</td><td>67.12</td><td>66.24</td><td>63.56</td><td>60.27</td><td>56.63</td><td>51.91</td><td>47.44</td></tr></table>
|
| 177 |
+
|
| 178 |
+
# 6.5 FEW-SHOT SCENARIO
|
| 179 |
+
|
| 180 |
+
In reality, it can happen that a powerful model is released, but only a few data samples are publicly accessible due to the privacy or confidentiality issues. We evaluate $\mathrm { K D + }$ under few-shot scenario where knowledge is transferred from a powerful teacher to a student with limited data. Table 8 presents the comparison results. We observe that $\mathrm { K D + }$ outperforms KD and the other approaches by a large margin in all the cases with $60 \%$ , $40 \%$ , $20 \%$ , and $10 \%$ training data available. The superiority of $\mathrm { K D + }$ becomes more obvious under few-shot scenario, e.g., $9 . 0 5 \%$ accuracy improvement over KD on $\mathrm { R e s N e t } 8 { \times } 4$ with $10 \%$ training data. The reason is that under few-shot scenario, the training data becomes extremely sparse. Corollary 4.1 holds strongly that only fitting sparse data points cannot enable the students to well capture the local shapes of the teachers. $\mathrm { K D + }$ substantially mitigates this issue by using a regularizer to go beyond the sparse in-distribution distillation.
|
| 181 |
+
|
| 182 |
+
# 7 CONCLUSION
|
| 183 |
+
|
| 184 |
+
In this paper, we systematically study why students underperform teachers and how students can outperform teachers under KD based model compression. Through designing exploratory experiments, we find that model capacity differences are not necessarily the root reason and the distillation data matters when the student capacity is greater than a threshold. Inspired by this, we propose $\mathrm { K D + }$ which goes beyond in-distribution distillation. Extensive experiments demonstrate that $\mathrm { K D + }$ is superior to KD as it outperforms KD and the other SOTA approaches substantially, is more compatible with the existing approaches, and shows obvious superiority in few-shot scenario.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Gustavo Aguilar, Yuan Ling, Yu Zhang, Benjamin Yao, Xing Fan, and Edward Guo. Knowledge distillation from internal representations. arXiv preprint arXiv:1910.03723, 2019.
|
| 189 |
+
|
| 190 |
+
Sungsoo Ahn, Shell Xu Hu, Andreas Damianou, Neil D Lawrence, and Zhenwen Dai. Variational information distillation for knowledge transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9163–9171, 2019.
|
| 191 |
+
|
| 192 |
+
Rohan Anil, Gabriel Pereyra, Alexandre Passos, Robert Ormandi, George E Dahl, and Geoffrey E Hinton. Large scale distributed neural network training through online distillation. arXiv preprint arXiv:1804.03235, 2018.
|
| 193 |
+
|
| 194 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 195 |
+
|
| 196 |
+
David Berthelot, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, and Colin Raffel. Remixmatch: Semi-supervised learning with distribution alignment and augmentation anchoring. arXiv preprint arXiv:1911.09785, 2019a.
|
| 197 |
+
|
| 198 |
+
David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, pp. 5049–5059, 2019b.
|
| 199 |
+
|
| 200 |
+
Olivier Chapelle, Jason Weston, Leon Bottou, and Vladimir Vapnik. Vicinal risk minimization. In ´ Advances in neural information processing systems, pp. 416–422, 2001.
|
| 201 |
+
|
| 202 |
+
Defang Chen, Jian-Ping Mei, Can Wang, Yan Feng, and Chun Chen. Online knowledge distillation with diverse peers. In Thirty-Forth AAAI Conference on Artificial Intelligence, 2020.
|
| 203 |
+
|
| 204 |
+
Jang Hyun Cho and Bharath Hariharan. On the efficacy of knowledge distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 4794–4802, 2019.
|
| 205 |
+
|
| 206 |
+
Inseop Chung, SeongUk Park, Jangho Kim, and Nojun Kwak. Feature-map-level online adversarial knowledge distillation. In Proceedings of International Conference on Machine Learning, 2020.
|
| 207 |
+
|
| 208 |
+
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.
|
| 209 |
+
|
| 210 |
+
Tommaso Furlanello, Zachary C Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. arXiv preprint arXiv:1805.04770, 2018.
|
| 211 |
+
|
| 212 |
+
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.
|
| 213 |
+
|
| 214 |
+
Hongyu Guo, Yongyi Mao, and Richong Zhang. Mixup as locally linear out-of-manifold regularization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3714–3722, 2019.
|
| 215 |
+
|
| 216 |
+
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.
|
| 217 |
+
|
| 218 |
+
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. arXiv preprint arXiv:1912.02781, 2019.
|
| 219 |
+
|
| 220 |
+
Byeongho Heo, Jeesoo Kim, Sangdoo Yun, Hyojin Park, Nojun Kwak, and Jin Young Choi. A comprehensive overhaul of feature distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1921–1930, 2019a.
|
| 221 |
+
|
| 222 |
+
Byeongho Heo, Minsik Lee, Sangdoo Yun, and Jin Young Choi. Knowledge transfer via distillation of activation boundaries formed by hidden neurons. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3779–3787, 2019b.
|
| 223 |
+
|
| 224 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 225 |
+
|
| 226 |
+
Zehao Huang and Naiyan Wang. Like what you like: Knowledge distill via neuron selectivity transfer. arXiv preprint arXiv:1707.01219, 2017.
|
| 227 |
+
|
| 228 |
+
Jangho Kim, SeongUk Park, and Nojun Kwak. Paraphrasing complex network: Network compression via factor transfer. In Advances in Neural Information Processing Systems, pp. 2760–2769, 2018.
|
| 229 |
+
|
| 230 |
+
Animesh Koratana, Daniel Kang, Peter Bailis, and Matei Zaharia. Lit: Learned intermediate representation training for model compression. In International Conference on Machine Learning, pp. 3509–3518, 2019.
|
| 231 |
+
|
| 232 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 233 |
+
|
| 234 |
+
Junnan Li, Richard Socher, and Steven CH Hoi. Dividemix: Learning with noisy labels as semisupervised learning. arXiv preprint arXiv:2002.07394, 2020.
|
| 235 |
+
|
| 236 |
+
Ruishan Liu, Nicolo Fusi, and Lester Mackey. Teacher-student compression with generative adversarial networks. arXiv preprint arXiv:1812.02271, 2018.
|
| 237 |
+
|
| 238 |
+
Yufan Liu, Jiajiong Cao, Bing Li, Chunfeng Yuan, Weiming Hu, Yangxi Li, and Yunqiang Duan. Knowledge distillation via instance relationship graph. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7096–7104, 2019.
|
| 239 |
+
|
| 240 |
+
Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 116–131, 2018.
|
| 241 |
+
|
| 242 |
+
Seyed-Iman Mirzadeh, Mehrdad Farajtabar, Ang Li, Nir Levine, Akihiro Matsukawa, and Hassan Ghasemzadeh. Improved knowledge distillation via teacher assistant. AAAI Conference on Artificial Intelligence, 2020.
|
| 243 |
+
|
| 244 |
+
Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3967–3976, 2019.
|
| 245 |
+
|
| 246 |
+
Nikolaos Passalis and Anastasios Tefas. Learning deep representations with probabilistic knowledge transfer. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 268–284, 2018.
|
| 247 |
+
|
| 248 |
+
Baoyun Peng, Xiao Jin, Jiaheng Liu, Dongsheng Li, Yichao Wu, Yu Liu, Shunfeng Zhou, and Zhaoning Zhang. Correlation congruence for knowledge distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5007–5016, 2019.
|
| 249 |
+
|
| 250 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In International Conference on Learning Representations, 2015.
|
| 251 |
+
|
| 252 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4510–4520, 2018.
|
| 253 |
+
|
| 254 |
+
Zhiqiang Shen and Marios Savvides. Meal v2: Boosting vanilla resnet-50 to $80 \text{‰}$ top-1 accuracy on imagenet without tricks. arXiv preprint arXiv:2009.08453, 2020.
|
| 255 |
+
|
| 256 |
+
Patrice Y Simard, Yann A LeCun, John S Denker, and Bernard Victorri. Transformation invariance in pattern recognition—tangent distance and tangent propagation. In Neural networks: tricks of the trade, pp. 239–274. Springer, 1998.
|
| 257 |
+
|
| 258 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015.
|
| 259 |
+
|
| 260 |
+
Suraj Srinivas and Francois Fleuret. Knowledge transfer with Jacobian matching. 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. 4723–4731, Stockholmsmassan, ¨ Stockholm Sweden, 10–15 Jul 2018. PMLR.
|
| 261 |
+
|
| 262 |
+
Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In International Conference on Learning Representations, 2020.
|
| 263 |
+
|
| 264 |
+
Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1365–1374, 2019.
|
| 265 |
+
|
| 266 |
+
Xiaojie Wang, Rui Zhang, Yu Sun, and Jianzhong Qi. Kdgan: Knowledge distillation with generative adversarial networks. In Advances in Neural Information Processing Systems, pp. 775–786, 2018.
|
| 267 |
+
|
| 268 |
+
Guodong Xu, Ziwei Liu, Xiaoxiao Li, and Chen Change Loy. Knowledge distillation meets selfsupervision. In European Conference on Computer Vision, pp. 588–604. Springer, 2020.
|
| 269 |
+
|
| 270 |
+
Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4133–4141, 2017.
|
| 271 |
+
|
| 272 |
+
Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3903–3911, 2020.
|
| 273 |
+
|
| 274 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016.
|
| 275 |
+
|
| 276 |
+
Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In International Conference on Learning Representations, 2017.
|
| 277 |
+
|
| 278 |
+
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. International Conference on Learning Representations, 2018a. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ r1Ddp1-Rb.
|
| 279 |
+
|
| 280 |
+
Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep mutual learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4320–4328, 2018b.
|
| 281 |
+
|
| 282 |
+
Xiatian Zhu, Shaogang Gong, et al. Knowledge distillation by on-the-fly native ensemble. In Advances in neural information processing systems, pp. 7517–7527, 2018.
|
| 283 |
+
|
| 284 |
+
# A MORE IMPLEMENTATION DETAILS
|
| 285 |
+
|
| 286 |
+
The code for this work will be released online. Besides the hyper-parameters reported in the paper, below we report more implementation details.
|
| 287 |
+
|
| 288 |
+
We adopt the standard preprocessing and data augmentation strategies for each dataset. Each image is preprocessed by subtracting the mean of the whole training set and dividing it by the standard deviation. We use the standard data augmentation strategy, i.e., randomly flipping horizontally, padding 4 pixels for CIFAR (8 pixels for Tiny ImageNet), and then cropping to $3 2 \times 3 2$ for CIFAR $6 4 \times 6 4$ for Tiny ImageNet). On ImageNet, we use the widely used scale and aspect ratio augmentation strategy.
|
| 289 |
+
|
| 290 |
+
On exploratory experiments, the architectures of SN2 and SN3 are Conv(128)-BN-AvgPooling(32)- FC and Conv(128)-BN-ReLU-Covn(256)-BN-ReLU-AvgPooling(16)-FC, respectively.
|
| 291 |
+
|
| 292 |
+
Following KD, we set $\alpha$ , $\beta , \lambda$ and $\tau$ to 0.1, 0.9, 1, and 4, respectively. On CIFAR-100, we have trained all the networks for 240 epochs with SGD with momentum 0.9 and batch size 64. On Tiny ImageNet, all the networks are trained with SGD with momentum 0.9 for 100 epochs with batch size 64. On ImageNet, we have the network for 120 epochs with SGD with momentum 0.9 and batch size 256.
|
| 293 |
+
|
| 294 |
+
For the SOTA approaches, their objective is a combination of the regular cross-entropy loss and a distillation loss:
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\mathcal { L } = \mathcal { L } _ { C E } + c \mathcal { L } _ { d i s t i l l }
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
where $c$ is a weight for balancing the two terms. We report the author-reported results, or use author-provided codes and the optimal hyper-parameters from the original papers if they are publicly available. Otherwise, we use the implementation of Tian et al. (2020). Specifically, the hyperparameters for each method are: (1) FitNet: $c = 1 0 0$ ; (2) AT: $c = 1 0 0 0$ ; (3) SP: $c = 3 0 0 0$ ; (4) CC: $c = 0 . 0 2$ ; (5) VID: $c = 1$ ; (6) RKD: $c _ { 1 } = 2 5$ for the distance metric and $c _ { 2 } = 5 0$ for the angle metric; both terms are combined following the original paper; (7) PKT: $c = 3 0 0 0 0$ ; (8) AB: $c = 0$ ; distillation happens in the pre-training stage where only distillation objective is used; (9) FT: $c = 5 0 0$ ; (10) CRD: $c = 0 . 8$ ; (11) FSP: $c = 0$ ; distillation happens in the pre-training stage where only distillation objective is used; (12) NST: $c = 5 0$ ; (13) the KD objective is (1); $\alpha , \beta$ and $\tau$ is set to 0.1, 0.9, and 4, respectively.
|
| 301 |
+
|
| 302 |
+
For compatibility experiments, $\mathrm { K D + }$ is combined with the existing SOTA approaches. The objective is written as:
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\mathcal { L } _ { C o m p K D + } = \mathcal { L } _ { K D + } + c \mathcal { L } _ { d i s t i l l }
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
The values of $c$ have been reported above.
|
| 309 |
+
|
| 310 |
+
When the state-of-the-art approaches are combined with KD, the objective is:
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\mathcal { L } _ { C o m p K D } = \mathcal { L } _ { K D } + c \mathcal { L } _ { d i s t i l l }
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
For all the experiments, we report the last epoch test accuracy over 3 runs.
|
| 317 |
+
|
| 318 |
+
# B TEACHER-STUDENT SHAPE DIFFERENCES
|
| 319 |
+
|
| 320 |
+
As stated in Corollary 4.1, only fitting the teacher outputs at sparse data points cannot enable students to well capture the local, in-distribution shapes of teachers. In this part, we show that the students trained with $\mathrm { K D + }$ can better capture the local shapes of the teachers than those trained with KD. The
|
| 321 |
+
|
| 322 |
+
local shape of a function can be represented by a set of pairs $( x , y )$ where $x$ is the input and $y$ is the output of the function. To measure the shape difference, we report the average mean square student-teacher output logit differences (S-T DIFs) by using test data as inputs. As
|
| 323 |
+
|
| 324 |
+
Table 9: S-T DIFs (Shape differences) on CIFAR-100
|
| 325 |
+
|
| 326 |
+
<table><tr><td>Teacher Student</td><td>ResNet32×4 ResNet8×4</td><td>WRN-40-2 WRN-16-2</td><td>WRN-40-2 WRN-40-1</td><td>VGG-13 VGG-8</td></tr><tr><td>KD</td><td>2.81</td><td>2.74</td><td>2.94</td><td>1.77</td></tr><tr><td>KD+</td><td>1.45</td><td>2.02</td><td>2.10</td><td>1.11</td></tr></table>
|
| 327 |
+
|
| 328 |
+
shown in Table 9, S-T DIFs of $\mathrm { K D + }$ are consistently smaller than those of KD, which demonstrates that the student shapes of $\mathrm { K D + }$ are closer to the teacher shapes and indicates that the regularizer benefits the students in capturing the local shpaes of the teachers.
|
| 329 |
+
|
| 330 |
+
# C COMPARISON WITH THE REGULARIZER OF INJECTING NOISE TO INPUTS
|
| 331 |
+
|
| 332 |
+
$\mathrm { K D + }$ goes beyond in-distribution distillation by using a data-driven regularizer. We compare the regularizer in $\mathrm { K D + }$ with the regularizer of injecting small noise to inputs. Intuitively, distilling on noise-injected samples can also explore more knowledge in the teacher. We call this method NoiseKD. We compare $\mathrm { K D + }$ with NoiseKD. We grid search the best hyperparameter for NoiseKD by using different levels of Gaussian noise, i.e., $\mathcal { N } ( 0 , 0 . 1 )$ , $\mathcal { N } ( 0 , 0 . 0 5 )$ , $\mathcal { N } ( 0 , 0 . 0 1 )$ , and $\mathcal { N } ( 0 , 0 . 0 0 5 )$ . Table ?? reports the comparison results. It is observed that when the noise in NoiseKD is large (e.g., $\mathcal { N } ( 0 , 0 . 1 )$ and $\mathcal { N } ( 0 , 0 . 0 5 ) ,$ , NoiseKD even underperforms KD, which indicates that large noise is harmful for knowledge distillation. When noise is relatively small (e.g., $\mathcal { N } ( 0 , 0 . 0 1 ) )$ , NoiseKD slightly improves the performances over KD, which indicates that small noise is useful for knowledge distillation. We also see that $\mathrm { K D + }$ consistently outperforms NoiseKD with different levels of noise as regularzers, which demonstrates the superiority of the proposed regularizer.
|
| 333 |
+
|
| 334 |
+
# D NOT ALL OUT-OF-DISTRIBUTION SAMPLES ARE USEFUL
|
| 335 |
+
|
| 336 |
+
In $\mathrm { K D + }$ , when $p = 2$ , the regularizer almost only uses out-of-distribution samples as the middle points of two samples do not belong to any predefined class. The experimental results in Table 3 have shown that by distillation on these out-of-distribution samples as a regularizer, the student performance is improved substantially. Here, we show that not all out-of-distribution samples are useful for knowledge distillation. We randomly draw image-size noise from a normal distribution. And then we distill on these randomly generated noisy samples as a regularizer for KD (we denote this method by NoiseRegKD). The results are reported in Table 10. It is not surprising that the performances drop significantly, e.g., from 72.98 to 6.59 on VGG-8. This indicates that the out-of-distribution samples far from the real data distribution are harmful for knowledge distillation.
|
| 337 |
+
|
| 338 |
+
# E LEARNING DATA DISTRIBUTION WITH GENERATIVE MODELS
|
| 339 |
+
|
| 340 |
+
As stated in Corollary 4.1, only fitting the teacher outputs at sparse data points cannot enable students to well capture the local, in-distribution shapes of teachers. One natural idea is to use generative adversarial networks (GAN) Goodfellow et al. (2014); Arjovsky et al. (2017); Liu et al. (2018) to learn the data distribution and then use the generator to generate fake data for knowledge distillation. However, there are two issues: first, training GAN is computationally expensive especially for large datasets (e.g., ImageNet) while $\mathrm { K D + }$ can use freely obtained in-distribution and out-of-distribution points; second, the diversity and quality of the generated fake data from GAN are highly limited by sparse training data, which means that it cannot accurately learn the real data sample distribution, just like we cannot obtain $100 \%$ test accuracy by training a deep neural network on the training data samples and their ground truth of CIFAR-100.
|
| 341 |
+
|
| 342 |
+
Table 10: Out-of-distribution distillation as regularizes on CIFAR-100
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Teacher Student</td><td>VGG-13 VGG-8</td><td>WRN-40-2 WRN-16-2</td><td>ResNet32×4 ShuffleNetV2</td><td>ResNet32×4 ResNet8×4</td></tr><tr><td>Teacher</td><td>74.64</td><td>75.61</td><td>75.61</td><td>79.42</td></tr><tr><td>Vanilla Student</td><td>70.36</td><td>73.26</td><td>71.98</td><td>72.50</td></tr><tr><td>KD</td><td>72.98</td><td>74.92</td><td>73.54</td><td>73.33</td></tr><tr><td>NoiseRegKD</td><td>6.59</td><td>6.32</td><td>16.35</td><td>3.26</td></tr></table>
|
| 345 |
+
|
| 346 |
+
Table 11: KD with GAN as a regularize on CIFAR-10
|
| 347 |
+
|
| 348 |
+
<table><tr><td>Teacher Student</td><td>WRN-40-2 WRN-16-1</td><td>VGG-13 MobileNetV2</td></tr><tr><td>Teacher</td><td>94.80</td><td>93.65</td></tr><tr><td>Vanilla Student</td><td>91.32</td><td>89.19</td></tr><tr><td>KD</td><td>91.77</td><td>89.21</td></tr><tr><td>KD-GAN</td><td>92.23</td><td>89.25</td></tr><tr><td>KD+</td><td>93.15</td><td>90.51</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 12: Compatibility performances on CIFAR-100 under few-shot scenario
|
| 351 |
+
|
| 352 |
+
<table><tr><td colspan="2">60% Training Data</td><td colspan="2">40% Training I Data</td><td>10% Training I</td><td>Data</td></tr><tr><td>Teacher Student</td><td>ResNet32×4 ResNet8×4</td><td>VGG-13 ResNet32×4 VGG-8 ResNet8×4</td><td>VGG-13 VGG-8</td><td>ResNet32×4 ResNet8×4</td><td>VGG-13 VGG-8</td></tr><tr><td>Teacher Vanilla Student</td><td>79.42 68.54</td><td>74.64 65.57</td><td>79.42 74.64 64.35 61.45</td><td>79.42 42.76</td><td>74.64 39.30</td></tr><tr><td>FitNet+KD FitNet+KD+</td><td>72.09 74.57</td><td>69.21 69.64 72.23 72.34</td><td>65.94 69.94</td><td>54.72 62.43</td><td>46.30 56.43</td></tr><tr><td>AT+KD AT+KD+</td><td>71.54 73.15</td><td>70.61 68.01 71.88 70.47</td><td>68.22 69.58</td><td>50.22 56.20</td><td>53.91 57.08</td></tr><tr><td>SP+KD SP+KD+</td><td>70.45 72.42</td><td>69.70 67.22 72.03 70.42</td><td>66.73 70.28</td><td>49.94 55.82</td><td>45.62 54.42</td></tr><tr><td>CC+KD CC+KD+</td><td>70.67 73.71</td><td>69.38 66.81 72.70 70.72</td><td>66.27 70.53</td><td>48.54 57.00</td><td>48.37 57.32</td></tr><tr><td>VID+KD VID+KD+</td><td>70.00 73.86</td><td>69.54 67.65 72.59</td><td>66.42</td><td>47.84</td><td>46.81</td></tr><tr><td>RKD+KD RKD+KD+</td><td>70.33 72.85 72.49</td><td>71.25 69.74 66.63</td><td>70.76 66.15 70.47 69.79</td><td>57.38 46.43</td><td>56.98 48.20</td></tr></table>
|
| 353 |
+
|
| 354 |
+
Table 13: Training time of KD and $\mathrm { K D + }$
|
| 355 |
+
|
| 356 |
+
<table><tr><td>Teacher Student</td><td>VGG-13 VGG-8</td><td>ResNet32×4 ResNet8×4</td><td>WRN-40-2 WRN-40-1</td></tr><tr><td>KD</td><td>7.32s/epoch</td><td>17.21s/epoch</td><td>15.62s/epoch</td></tr><tr><td>KD+</td><td>13.32s/epoch</td><td>32.18s/epoch</td><td>28.40s/epoch</td></tr></table>
|
| 357 |
+
|
| 358 |
+
Table 14: Comparison between baselines and baselines+
|
| 359 |
+
|
| 360 |
+
<table><tr><td>Teacher Student</td><td>VGG-13 VGG-8</td><td>WRN-40-2 WRN-16-2</td></tr><tr><td>FitNet</td><td>71.02</td><td>72.24</td></tr><tr><td>FitNet+</td><td>74.15</td><td>75.09</td></tr><tr><td>AT</td><td>71.43 73.55</td><td>72.77 74.81</td></tr><tr><td>AT+</td><td></td><td></td></tr><tr><td>SP SP+</td><td>72.68 73.81</td><td>72.43 74.59</td></tr><tr><td></td><td></td><td></td></tr><tr><td>CC</td><td>70.71</td><td>72.21</td></tr><tr><td>CC+</td><td>74.21</td><td>74.99</td></tr><tr><td>PKT</td><td>72.88</td><td>73.45</td></tr><tr><td>PKT+</td><td>74.39</td><td>75.01</td></tr></table>
|
| 361 |
+
|
| 362 |
+
We conduct an exploratory experiment by using GAN to learn the data sample distribution on CIFAR10 Krizhevsky & Hinton (2009) as GAN can easily converge on CIFAR-10. And then we distill on the generated fake data as a regularizer for KD. The Results are reported in Table 11. It is obsrved that the GAN regularizer (i.e., KD-GAN) improves the performances over KD, but it underperforms $\mathrm { K D + }$ substantially. This indicates that GAN can generate some useful fake samples for knowledge distillation, but the diversity and usefulness of these samples are highly constrained by the training data. As it is almost impossible to learn the real data sample distribution from sparse training data points, $\mathrm { K D + }$ compensates this by going beyond in-distribution distillation and thus beats KD and the other approaches by a large margin.
|
| 363 |
+
|
| 364 |
+
# F COMPATIBILITY WITH SOTA APPROACHES UNDER FEW-SHOT SCENARIO
|
| 365 |
+
|
| 366 |
+
In this part, we report the compatibility of $\mathrm { K D + }$ with the existing approaches under few-shot scenario as this case can happen in reality where only a few samples are available due to the privacy or confidentiality issues. The comparison results are reported in Table 12. It is observed that the existing approaches when combined with $\mathrm { K D + }$ obtain much better performances than when combined with KD. Moreover, the overall accuracy improvement becomes larger when less training data samples are available. The reason is that when the training data become extremely sparse, Corollary 4.1 holds strongly that only fitting sparse data points cannot enable the students to well capture the local shapes of the teachers. $\mathrm { K D + }$ substantially mitigates this issue by using a regularizer to go beyond the sparse in-distribution distillation.
|
| 367 |
+
|
| 368 |
+
# G TRAINING TIME OF KD AND $\mathrm { K D + }$
|
| 369 |
+
|
| 370 |
+
As $\mathrm { K D + }$ explores more knowledge in the teacher by going beyond in-distribution distillation, it is more computationally expensive than KD. We report the training data on CIFAR-100 with GPU RTX 2080Ti. Both KD and $\mathrm { K D + }$ are trained for 240 epochs. The training time is reported in Table 13.
|
| 371 |
+
|
| 372 |
+
# H COMPARISON RESULTS BETWEEN BASELINES AND BASELINES+
|
| 373 |
+
|
| 374 |
+
To further explore the performances of the proposed approaches on different distillation methods, we compare baselines with baselines+. Baselines $^ +$ are obtained by using the P points to assist the baselines (note that the $\mathrm { K D + }$ objective is not included). The comparison results are reported in Table 14. We observe that the beselines+ consistently outperform the baselines by a large margin (e.g., $3 . 1 3 \%$ accuracy improvement from FitNet to FitNet+), which demonstrates the generalization and effectiveness of the proposed strategy across different distillation approaches.
|
md/train/YicbFdNTTy/YicbFdNTTy.md
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN IMAGE IS WORTH 16X16 WORDS: TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE
|
| 2 |
+
|
| 3 |
+
Alexey Dosovitskiy∗,†, Lucas Beyer∗, Alexander Kolesnikov∗, Dirk Weissenborn∗, Xiaohua Zhai∗, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby∗,†
|
| 4 |
+
|
| 5 |
+
∗equal technical contribution, †equal advising Google Research, Brain Team {adosovitskiy, neilhoulsby}@google.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
While the Transformer architecture has become the de-facto standard for natural language processing tasks, its applications to computer vision remain limited. In vision, attention is either applied in conjunction with convolutional networks, or used to replace certain components of convolutional networks while keeping their overall structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.), Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.1
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Self-attention-based architectures, in particular Transformers (Vaswani et al., 2017), have become the model of choice in natural language processing (NLP). The dominant approach is to pre-train on a large text corpus and then fine-tune on a smaller task-specific dataset (Devlin et al., 2019). Thanks to Transformers’ computational efficiency and scalability, it has become possible to train models of unprecedented size, with over 100B parameters (Brown et al., 2020; Lepikhin et al., 2020). With the models and datasets growing, there is still no sign of saturating performance.
|
| 14 |
+
|
| 15 |
+
In computer vision, however, convolutional architectures remain dominant (LeCun et al., 1989; Krizhevsky et al., 2012; He et al., 2016). Inspired by NLP successes, multiple works try combining CNN-like architectures with self-attention (Wang et al., 2018; Carion et al., 2020), some replacing the convolutions entirely (Ramachandran et al., 2019; Wang et al., 2020a). The latter models, while theoretically efficient, have not yet been scaled effectively on modern hardware accelerators due to the use of specialized attention patterns. Therefore, in large-scale image recognition, classic ResNetlike architectures are still state of the art (Mahajan et al., 2018; Xie et al., 2020; Kolesnikov et al., 2020).
|
| 16 |
+
|
| 17 |
+
Inspired by the Transformer scaling successes in NLP, we experiment with applying a standard Transformer directly to images, with the fewest possible modifications. To do so, we split an image into patches and provide the sequence of linear embeddings of these patches as an input to a Transformer. Image patches are treated the same way as tokens (words) in an NLP application. We train the model on image classification in supervised fashion.
|
| 18 |
+
|
| 19 |
+
When trained on mid-sized datasets such as ImageNet without strong regularization, these models yield modest accuracies of a few percentage points below ResNets of comparable size. This seemingly discouraging outcome may be expected: Transformers lack some of the inductive biases inherent to CNNs, such as translation equivariance and locality, and therefore do not generalize well when trained on insufficient amounts of data.
|
| 20 |
+
|
| 21 |
+
However, the picture changes if the models are trained on larger datasets (14M-300M images). We find that large scale training trumps inductive bias. Our Vision Transformer (ViT) attains excellent results when pre-trained at sufficient scale and transferred to tasks with fewer datapoints. When pre-trained on the public ImageNet-21k dataset or the in-house JFT-300M dataset, ViT approaches or beats state of the art on multiple image recognition benchmarks. In particular, the best model reaches the accuracy of $8 8 . 5 5 \%$ on ImageNet, $9 0 . 7 2 \%$ on ImageNet-ReaL, $9 4 . 5 5 \%$ on CIFAR-100, and $7 7 . 6 3 \%$ on the VTAB suite of 19 tasks.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Transformers were proposed by Vaswani et al. (2017) for machine translation, and have since become the state of the art method in many NLP tasks. Large Transformer-based models are often pre-trained on large corpora and then fine-tuned for the task at hand: BERT (Devlin et al., 2019) uses a denoising self-supervised pre-training task, while the GPT line of work uses language modeling as its pre-training task (Radford et al., 2018; 2019; Brown et al., 2020).
|
| 26 |
+
|
| 27 |
+
Naive application of self-attention to images would require that each pixel attends to every other pixel. With quadratic cost in the number of pixels, this does not scale to realistic input sizes. Thus, to apply Transformers in the context of image processing, several approximations have been tried in the past. Parmar et al. (2018) applied the self-attention only in local neighborhoods for each query pixel instead of globally. Such local multi-head dot-product self attention blocks can completely replace convolutions (Hu et al., 2019; Ramachandran et al., 2019; Zhao et al., 2020). In a different line of work, Sparse Transformers (Child et al., 2019) employ scalable approximations to global selfattention in order to be applicable to images. An alternative way to scale attention is to apply it in blocks of varying sizes (Weissenborn et al., 2019), in the extreme case only along individual axes (Ho et al., 2019; Wang et al., 2020a). Many of these specialized attention architectures demonstrate promising results on computer vision tasks, but require complex engineering to be implemented efficiently on hardware accelerators.
|
| 28 |
+
|
| 29 |
+
Most related to ours is the model of Cordonnier et al. (2020), which extracts patches of size $2 \times 2$ from the input image and applies full self-attention on top. This model is very similar to ViT, but our work goes further to demonstrate that large scale pre-training makes vanilla transformers competitive with (or even better than) state-of-the-art CNNs. Moreover, Cordonnier et al. (2020) use a small patch size of $2 \times 2$ pixels, which makes the model applicable only to small-resolution images, while we handle medium-resolution images as well.
|
| 30 |
+
|
| 31 |
+
There has also been a lot of interest in combining convolutional neural networks (CNNs) with forms of self-attention, e.g. by augmenting feature maps for image classification (Bello et al., 2019) or by further processing the output of a CNN using self-attention, e.g. for object detection (Hu et al., 2018; Carion et al., 2020), video processing (Wang et al., 2018; Sun et al., 2019), image classification (Wu et al., 2020), unsupervised object discovery (Locatello et al., 2020), or unified text-vision tasks (Chen et al., 2020c; Lu et al., 2019; Li et al., 2019).
|
| 32 |
+
|
| 33 |
+
Another recent related model is image GPT (iGPT) (Chen et al., 2020a), which applies Transformers to image pixels after reducing image resolution and color space. The model is trained in an unsupervised fashion as a generative model, and the resulting representation can then be fine-tuned or probed linearly for classification performance, achieving a maximal accuracy of $72 \%$ on ImageNet.
|
| 34 |
+
|
| 35 |
+
Our work adds to the increasing collection of papers that explore image recognition at larger scales than the standard ImageNet dataset. The use of additional data sources allows to achieve state-ofthe-art results on standard benchmarks (Mahajan et al., 2018; Touvron et al., 2019; Xie et al., 2020). Moreover, Sun et al. (2017) study how CNN performance scales with dataset size, and Kolesnikov et al. (2020); Djolonga et al. (2020) perform an empirical exploration of CNN transfer learning from large scale datasets such as ImageNet-21k and JFT-300M. We focus on these two latter datasets as well, but train Transformers instead of ResNet-based models used in prior works.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Model overview. We split an image into fixed-size patches, linearly embed each of them, add position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder. In order to perform classification, we use the standard approach of adding an extra learnable “classification token” to the sequence. The illustration of the Transformer encoder was inspired by Vaswani et al. (2017).
|
| 39 |
+
|
| 40 |
+
# 3 METHOD
|
| 41 |
+
|
| 42 |
+
In model design we follow the original Transformer (Vaswani et al., 2017) as closely as possible. An advantage of this intentionally simple setup is that scalable NLP Transformer architectures – and their efficient implementations – can be used almost out of the box.
|
| 43 |
+
|
| 44 |
+
# 3.1 VISION TRANSFORMER (VIT)
|
| 45 |
+
|
| 46 |
+
An overview of the model is depicted in Figure 1. The standard Transformer receives as input a 1D sequence of token embeddings. To handle 2D images, we reshape the image $\mathbf { x } \in \mathbb { R } ^ { H \times W \times \dot { C } }$ into a sequence of flattened 2D patches $\mathbf { x } _ { p } \in \mathbb { R } ^ { N \times ( P ^ { 2 } \cdot C ) }$ , where $( H , W )$ is the resolution of the original image, $C$ is the number of channels, $( P , P )$ is the resolution of each image patch, and $N = H W / P ^ { 2 }$ is the resulting number of patches, which also serves as the effective input sequence length for the Transformer. The Transformer uses constant latent vector size $D$ through all of its layers, so we flatten the patches and map to $D$ dimensions with a trainable linear projection (Eq. 1). We refer to the output of this projection as the patch embeddings.
|
| 47 |
+
|
| 48 |
+
Similar to BERT’s [class] token, we prepend a learnable embedding to the sequence of embedded patches $( \mathbf { z } _ { 0 } ^ { 0 } = \mathbf { x } _ { \mathrm { c l a s s } } )$ , whose state at the output of the Transformer encoder $( \mathbf { \bar { z } } _ { L } ^ { 0 } )$ serves as the image representation y (Eq. 4). Both during pre-training and fine-tuning, a classification head is attached to $\mathbf { z } _ { L } ^ { 0 }$ . The classification head is implemented by a MLP with one hidden layer at pre-training time and by a single linear layer at fine-tuning time.
|
| 49 |
+
|
| 50 |
+
Position embeddings are added to the patch embeddings to retain positional information. We use standard learnable 1D position embeddings, since we have not observed significant performance gains from using more advanced 2D-aware position embeddings (Appendix D.3). The resulting sequence of embedding vectors serves as input to the encoder.
|
| 51 |
+
|
| 52 |
+
The Transformer encoder (Vaswani et al., 2017) consists of alternating layers of multiheaded selfattention (MSA, see Appendix A) and MLP blocks (Eq. 2, 3). Layernorm (LN) is applied before every block, and residual connections after every block (Wang et al., 2019; Baevski & Auli, 2019).
|
| 53 |
+
|
| 54 |
+
The MLP contains two layers with a GELU non-linearity.
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r l r l } & { \mathbf z _ { 0 } = [ \mathbf x _ { \mathrm { c l a s s } } ; \mathbf x _ { p } ^ { 1 } \mathbf E ; \mathbf x _ { p } ^ { 2 } \mathbf E ; \cdot \cdot \cdot \cdot \cdot \cdot ; \mathbf x _ { p } ^ { N } \mathbf E ] + \mathbf E _ { p o s } , } & & { \mathbf E \in \mathbb R ^ { ( P ^ { 2 } \cdot C ) \times D } , \mathbf E _ { p o s } \in \mathbb R ^ { ( N + 1 ) \times D } } \\ & { \mathbf z ^ { \prime } _ { \ell } = \mathrm { M S A } ( \mathrm { L N } ( \mathbf z _ { \ell - 1 } ) ) + \mathbf z _ { \ell - 1 } , } & & { \ell = 1 \dots L } \\ & { \mathbf z _ { \ell } = \mathrm { M L P } ( \mathrm { L N } ( \mathbf z ^ { \prime } _ { \ell } ) ) + \mathbf z ^ { \prime } _ { \ell } , } & & { \ell = 1 \dots L } \\ & { \mathbf y = \mathrm { L N } ( \mathbf z _ { L } ^ { 0 } ) } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
Inductive bias. We note that Vision Transformer has much less image-specific inductive bias than CNNs. In CNNs, locality, two-dimensional neighborhood structure, and translation equivariance are baked into each layer throughout the whole model. In ViT, only MLP layers are local and translationally equivariant, while the self-attention layers are global. The two-dimensional neighborhood structure is used very sparingly: in the beginning of the model by cutting the image into patches and at fine-tuning time for adjusting the position embeddings for images of different resolution (as described below). Other than that, the position embeddings at initialization time carry no information about the 2D positions of the patches and all spatial relations between the patches have to be learned from scratch.
|
| 61 |
+
|
| 62 |
+
Hybrid Architecture. As an alternative to raw image patches, the input sequence can be formed from feature maps of a CNN (LeCun et al., 1989). In this hybrid model, the patch embedding projection $\mathbf { E }$ (Eq. 1) is applied to patches extracted from a CNN feature map. As a special case, the patches can have spatial size 1x1, which means that the input sequence is obtained by simply flattening the spatial dimensions of the feature map and projecting to the Transformer dimension. The classification input embedding and position embeddings are added as described above.
|
| 63 |
+
|
| 64 |
+
# 3.2 FINE-TUNING AND HIGHER RESOLUTION
|
| 65 |
+
|
| 66 |
+
Typically, we pre-train ViT on large datasets, and fine-tune to (smaller) downstream tasks. For this, we remove the pre-trained prediction head and attach a zero-initialized $D \times K$ feedforward layer, where $K$ is the number of downstream classes. It is often beneficial to fine-tune at higher resolution than pre-training (Touvron et al., 2019; Kolesnikov et al., 2020). When feeding images of higher resolution, we keep the patch size the same, which results in a larger effective sequence length. The Vision Transformer can handle arbitrary sequence lengths (up to memory constraints), however, the pre-trained position embeddings may no longer be meaningful. We therefore perform 2D interpolation of the pre-trained position embeddings, according to their location in the original image. Note that this resolution adjustment and patch extraction are the only points at which an inductive bias about the 2D structure of the images is manually injected into the Vision Transformer.
|
| 67 |
+
|
| 68 |
+
# 4 EXPERIMENTS
|
| 69 |
+
|
| 70 |
+
We evaluate the representation learning capabilities of ResNet, Vision Transformer (ViT), and the hybrid. To understand the data requirements of each model, we pre-train on datasets of varying size and evaluate many benchmark tasks. When considering the computational cost of pre-training the model, ViT performs very favourably, attaining state of the art on most recognition benchmarks at a lower pre-training cost. Lastly, we perform a small experiment using self-supervision, and show that self-supervised ViT holds promise for the future.
|
| 71 |
+
|
| 72 |
+
# 4.1 SETUP
|
| 73 |
+
|
| 74 |
+
Datasets. To explore model scalability, we use the ILSVRC-2012 ImageNet dataset with 1k classes and 1.3M images (we refer to it as ImageNet in what follows), its superset ImageNet-21k with 21k classes and 14M images (Deng et al., 2009), and JFT (Sun et al., 2017) with $1 8 \mathrm { k }$ classes and 303M high-resolution images. We de-duplicate the pre-training datasets w.r.t. the test sets of the downstream tasks following Kolesnikov et al. (2020). We transfer the models trained on these dataset to several benchmark tasks: ImageNet on the original validation labels and the cleaned-up ReaL labels (Beyer et al., 2020), CIFAR-10/100 (Krizhevsky, 2009), Oxford-IIIT Pets (Parkhi et al., 2012), and Oxford Flowers-102 (Nilsback & Zisserman, 2008). For these datasets, pre-processing follows Kolesnikov et al. (2020).
|
| 75 |
+
|
| 76 |
+
Table 1: Details of Vision Transformer model variants.
|
| 77 |
+
|
| 78 |
+
<table><tr><td>Model</td><td>Layers</td><td>Hidden size D</td><td>MLP size</td><td>Heads</td><td>Params</td></tr><tr><td>ViT-Base</td><td>12</td><td>768</td><td>3072</td><td>12</td><td>86M</td></tr><tr><td>ViT-Large</td><td>24</td><td>1024</td><td>4096</td><td>16</td><td>307M</td></tr><tr><td>ViT-Huge</td><td>32</td><td>1280</td><td>5120</td><td>16</td><td>632M</td></tr></table>
|
| 79 |
+
|
| 80 |
+
We also evaluate on the 19-task VTAB classification suite (Zhai et al., 2019b). VTAB evaluates low-data transfer to diverse tasks, using 1 000 training examples per task. The tasks are divided into three groups: Natural – tasks like the above, Pets, CIFAR, etc. Specialized – medical and satellite imagery, and Structured – tasks that require geometric understanding like localization.
|
| 81 |
+
|
| 82 |
+
Model Variants. We base ViT configurations on those used for BERT (Devlin et al., 2019), as summarized in Table 1. The “Base” and “Large” models are directly adopted from BERT and we add the larger “Huge” model. In what follows we use brief notation to indicate the model size and the input patch size: for instance, ViT-L/16 means the “Large” variant with $1 6 \times 1 6$ input patch size. Note that the Transformer’s sequence length is inversely proportional to the square of the patch size, thus models with smaller patch size are computationally more expensive.
|
| 83 |
+
|
| 84 |
+
For the baseline CNNs, we use ResNet (He et al., 2016), but replace the Batch Normalization layers (Ioffe & Szegedy, 2015) with Group Normalization (Wu & He, 2018), and used standardized convolutions (Qiao et al., 2019). These modifications improve transfer (Kolesnikov et al., 2020), and we denote the modified model “ResNet (BiT)”. For the hybrids, we feed the intermediate feature maps into ViT with patch size of one “pixel”. To experiment with different sequence lengths, we either (i) take the output of stage 4 of a regular ResNet50 or (ii) remove stage 4, place the same number of layers in stage 3 (keeping the total number of layers), and take the output of this extended stage 3. Option (ii) results in a $4 \mathbf { x }$ longer sequence length, and a more expensive ViT model.
|
| 85 |
+
|
| 86 |
+
Training & Fine-tuning. We train all models, including ResNets, using Adam (Kingma & Ba, 2015) with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , a batch size of 4096 and apply a high weight decay of 0.1, which we found to be useful for transfer of all models (Appendix D.1 shows that, in contrast to common practices, Adam works slightly better than SGD for ResNets in our setting). We use a linear learning rate warmup and decay, see Appendix B.1 for details. For fine-tuning we use SGD with momentum, batch size 512, for all models, see Appendix B.1.1. For ImageNet results in Table 2, we fine-tuned at higher resolution: 512 for ViT-L/16 and 518 for ViT-H/14, and also used Polyak & Juditsky (1992) averaging with a factor of 0.9999 (Ramachandran et al., 2019; Wang et al., 2020b).
|
| 87 |
+
|
| 88 |
+
Metrics. We report results on downstream datasets either through few-shot or fine-tuning accuracy. Fine-tuning accuracies capture the performance of each model after fine-tuning it on the respective dataset. Few-shot accuracies are obtained by solving a regularized least-squares regression problem that maps the (frozen) representation of a subset of training images to $\{ - 1 , 1 \} ^ { K }$ target vectors. This formulation allows us to recover the exact solution in closed form. Though we mainly focus on fine-tuning performance, we sometimes use linear few-shot accuracies for fast on-the-fly evaluation where fine-tuning would be too costly.
|
| 89 |
+
|
| 90 |
+
# 4.2 COMPARISON TO STATE OF THE ART
|
| 91 |
+
|
| 92 |
+
We first compare our largest models – ViT-H/14 and ViT-L/16 – to state-of-the-art CNNs from the literature. The first comparison point is Big Transfer (BiT) (Kolesnikov et al., 2020), which performs supervised transfer learning with large ResNets. The second is Noisy Student (Xie et al., 2020), which is a large EfficientNet trained using semi-supervised learning on ImageNet and JFT300M with the labels removed. Currently, Noisy Student is the state of the art on ImageNet and BiT-L on the other datasets reported here. All models were trained on TPUv3 hardware, and we report the number of TPUv3-core-days taken to pre-train each of them, that is, the number of TPU v3 cores (2 per chip) used for training multiplied by the training time in days.
|
| 93 |
+
|
| 94 |
+
Table 2 shows the results. The smaller ViT-L/16 model pre-trained on JFT-300M outperforms BiT-L (which is pre-trained on the same dataset) on all tasks, while requiring substantially less computational resources to train. The larger model, ViT-H/14, further improves the performance, especially on the more challenging datasets – ImageNet, CIFAR-100, and the VTAB suite. Interestingly, this
|
| 95 |
+
|
| 96 |
+
<table><tr><td></td><td>Ours-JFT (ViT-H/14)</td><td>Ours-JFT (ViT-L/16)</td><td>Ours-I21k (ViT-L/16)</td><td>BiT-L (ResNet152x4)</td><td>Noisy Student (EfficientNet-L2)</td></tr><tr><td>ImageNet</td><td>88.55 ± 0.04</td><td>87.76±0.03</td><td>85.30±0.02</td><td>87.54±0.02</td><td>88.4/88.5*</td></tr><tr><td>ImageNet ReaL</td><td>90.72± 0.05</td><td>90.54±0.03</td><td>88.62 ±0.05</td><td>90.54</td><td>90.55</td></tr><tr><td>CIFAR-10</td><td>99.50 ±0.06</td><td>99.42 ± 0.03</td><td>99.15±0.03</td><td>99.37±0.06</td><td>1</td></tr><tr><td>CIFAR-100</td><td>94.55 ± 0.04</td><td>93.90± 0.05</td><td>93.25± 0.05</td><td>93.51± 0.08</td><td>1</td></tr><tr><td>Oxford-IIITPets</td><td>97.56 ±0.03</td><td>97.32 ± 0.11</td><td>94.67 ± 0.15</td><td>96.62± 0.23</td><td></td></tr><tr><td>Oxford Flowers-102</td><td>99.68 ±0.02</td><td>99.74± 0.00</td><td>99.61±0.02</td><td>99.63±0.03</td><td></td></tr><tr><td>VTAB (19 tasks)</td><td>77.63 ±0.23</td><td>76.28± 0.46</td><td>72.72±0.21</td><td>76.29 ± 1.70</td><td>1</td></tr><tr><td>TPUv3-core-days</td><td>2.5k</td><td>0.68k</td><td>0.23k</td><td>9.9k</td><td>12.3k</td></tr></table>
|
| 97 |
+
|
| 98 |
+
Table 2: Comparison with state of the art on popular image classification benchmarks. We report mean and standard deviation of the accuracies, averaged over three fine-tuning runs. Vision Transformer models pre-trained on the JFT-300M dataset outperform ResNet-based baselines on all datasets, while taking substantially less computational resources to pre-train. ViT pre-trained on the smaller public ImageNet-21k dataset performs well too. ∗Slightly improved $8 8 . 5 \%$ result reported in Touvron et al. (2020).
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 2: Breakdown of VTAB performance in Natural, Specialized, and Structured task groups.
|
| 102 |
+
|
| 103 |
+
model still took substantially less compute to pre-train than prior state of the art. However, we note that pre-training efficiency may be affected not only by the architecture choice, but also other parameters, such as training schedule, optimizer, weight decay, etc. We provide a controlled study of performance vs. compute for different architectures in Section 4.4. Finally, the ViT-L/16 model pre-trained on the public ImageNet-21k dataset performs well on most datasets too, while taking fewer resources to pre-train: it could be trained using a standard cloud TPUv3 with 8 cores in approximately 30 days.
|
| 104 |
+
|
| 105 |
+
Figure 2 decomposes the VTAB tasks into their respective groups, and compares to previous SOTA methods on this benchmark: BiT, VIVI – a ResNet co-trained on ImageNet and Youtube (Tschannen et al., 2020), and S4L – supervised plus semi-supervised learning on ImageNet (Zhai et al., 2019a). ViT-H/14 outperforms BiT- $\mathrm { R } 1 5 2 \mathrm { x } 4$ , and other methods, on the Natural and Structured tasks. On the Specialized the performance of the top two models is similar.
|
| 106 |
+
|
| 107 |
+
# 4.3 PRE-TRAINING DATA REQUIREMENTS
|
| 108 |
+
|
| 109 |
+
The Vision Transformer performs well when pre-trained on a large JFT-300M dataset. With fewer inductive biases for vision than ResNets, how crucial is the dataset size? We perform two series of experiments.
|
| 110 |
+
|
| 111 |
+
First, we pre-train ViT models on datasets of increasing size: ImageNet, ImageNet-21k, and JFT300M. To boost the performance on the smaller datasets, we optimize three basic regularization parameters – weight decay, dropout, and label smoothing. Figure 3 shows the results after finetuning to ImageNet (results on other datasets are shown in Table 5)2. When pre-trained on the smallest dataset, ImageNet, ViT-Large models underperform compared to ViT-Base models, despite (moderate) regularization. With ImageNet-21k pre-training, their performances are similar. Only with JFT-300M, do we see the full benefit of larger models. Figure 3 also shows the performance region spanned by BiT models of different sizes. The BiT CNNs outperform ViT on ImageNet, but with the larger datasets, ViT overtakes.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Transfer to ImageNet. While large ViT models perform worse than BiT ResNets (shaded area) when pre-trained on small datasets, they shine when pre-trained on larger datasets. Similarly, larger ViT variants overtake smaller ones as the dataset grows.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 4: Linear few-shot evaluation on ImageNet versus pre-training size. ResNets perform better with smaller pre-training datasets but plateau sooner than ViT, which performs better with larger pre-training. ViT-b is ViT-B with all hidden dimensions halved.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 5: Performance versus cost for different architectures: Vision Transformers, ResNets, and hybrids. Vision Transformers generally outperform ResNets with the same computational budget. Hybrids improve upon pure Transformers for smaller model sizes, but the gap vanishes for larger models.
|
| 121 |
+
|
| 122 |
+
Second, we train our models on random subsets of 9M, 30M, and 90M as well as the full JFT300M dataset. We do not perform additional regularization on the smaller subsets and use the same hyper-parameters for all settings. This way, we assess the intrinsic model properties, and not the effect of regularization. We do, however, use early-stopping, and report the best validation accuracy achieved during training. To save compute, we report few-shot linear accuracy instead of full finetuning accuracy. Figure 4 contains the results. Vision Transformers overfit more than ResNets with comparable computational cost on smaller datasets. For example, ViT-B/32 is slightly faster than ResNet50; it performs much worse on the 9M subset, but better on $9 0 \mathbf { M } +$ subsets. The same is true for ResNet152x2 and ViT-L/16. This result reinforces the intuition that the convolutional inductive bias is useful for smaller datasets, but for larger ones, learning the relevant patterns directly from data is sufficient, even beneficial.
|
| 123 |
+
|
| 124 |
+
Overall, the few-shot results on ImageNet (Figure 4), as well as the low-data results on VTAB (Table 2) seem promising for very low-data transfer. Further analysis of few-shot properties of ViT is an exciting direction of future work.
|
| 125 |
+
|
| 126 |
+
# 4.4 SCALING STUDY
|
| 127 |
+
|
| 128 |
+
We perform a controlled scaling study of different models by evaluating transfer performance from JFT-300M. In this setting data size does not bottleneck the models’ performances, and we assess performance versus pre-training cost of each model. The model set includes: 7 ResNets, R50x1, R50x2 R101x1, $\mathbf { R } 1 5 2 \mathbf { x } 1$ , $\mathbf { R } 1 5 2 \mathbf { x } 2$ , pre-trained for 7 epochs, plus $\mathbf { R } 1 5 2 \mathbf { x } 2$ and ${ \mathrm { R } } 2 0 0 { \mathrm { x } } 3 $ pre-trained for 14 epochs; 6 Vision Transformers, ViT-B/32, B/16, L/32, L/16, pre-trained for 7 epochs, plus L/16 and H/14 pre-trained for 14 epochs; and 5 hybrids, R50+ViT-B/32, B/16, L/32, L/16 pretrained for 7 epochs, plus ${ \mathrm { R 5 0 + V i T - L } } / { 1 6 }$ pre-trained for 14 epochs (for hybrids, the number at the end of the model name stands not for the patch size, but for the total dowsampling ratio in the ResNet backbone).
|
| 129 |
+
|
| 130 |
+
Figure 5 contains the transfer performance versus total pre-training compute (see Appendix D.4 for details on computational costs). Detailed results per model are provided in Table 6 in the Appendix. A few patterns can be observed. First, Vision Transformers dominate ResNets on the performance/compute trade-off. ViT uses approximately $2 - 4 \times$ less compute to attain the same performance (average over 5 datasets). Second, hybrids slightly outperform ViT at small computational budgets, but the difference vanishes for larger models. This result is somewhat surprising, since one might expect convolutional local feature processing to assist ViT at any size. Third, Vision Transformers appear not to saturate within the range tried, motivating future scaling efforts.
|
| 131 |
+
|
| 132 |
+
# 4.5 INSPECTING VISION TRANSFORMER
|
| 133 |
+
|
| 134 |
+
To begin to understand how the Vision Transformer processes image data, we analyze its internal representations. The first layer of the Vision Transformer linearly projects the flattened patches into a lower-dimensional space (Eq. 1). Figure 7 (left) shows the top principal components of the the learned embedding filters. The components resemble plausible basis functions for a low-dimensional representation of the fine structure within each patch.
|
| 135 |
+
|
| 136 |
+
After the projection, a learned position embedding is added to the patch representations. Figure 7 (center) shows that the model learns to encode distance within the image in the similarity of position embeddings, i.e. closer patches tend to have more similar position embeddings. Further, the row-column structure appears; patches in the same row/column have similar embeddings. Finally, a sinusoidal structure is sometimes apparent for larger grids (Appendix D). That the position embeddings learn to represent 2D image topology explains why hand-crafted 2D-aware embedding variants do not yield improvements (Appendix D.3).
|
| 137 |
+
|
| 138 |
+
Self-attention allows ViT to integrate information across the entire image even in the lowest layers. We investigate to what degree the network makes use of this capability. Specifically, we compute the average distance in image space across which information is integrated, based on the attention weights (Figure 7, right). This “attention distance” is analogous to receptive field size in CNNs.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 6: Representative examples of attention from the output token to the input space. See Appendix D.6 for details.
|
| 142 |
+
|
| 143 |
+
We find that some heads attend to most of the image already in the lowest layers, showing that the ability to integrate information globally is indeed used by the model. Other attention heads have consistently small attention distances in the low layers. This highly localized attention is less pronounced in hybrid models that apply a ResNet before the Transformer (Figure 7, right), suggesting that it may serve a similar function as early convolutional layers in CNNs. Further, the attention distance increases with network depth. Globally, we find that the model attends to image regions that are semantically relevant for classification (Figure 6).
|
| 144 |
+
|
| 145 |
+
# 4.6 SELF-SUPERVISION
|
| 146 |
+
|
| 147 |
+
Transformers show impressive performance on NLP tasks. However, much of their success stems not only from their excellent scalability but also from large scale self-supervised pre-training (Devlin et al., 2019; Radford et al., 2018). We also perform a preliminary exploration on masked patch prediction for self-supervision, mimicking the masked language modeling task used in BERT. With self-supervised pre-training, our smaller ViT-B/16 model achieves $7 9 . 9 \%$ accuracy on ImageNet, a significant improvement of $2 \%$ to training from scratch, but still $4 \%$ behind supervised pre-training. Appendix B.1.2 contains further details. We leave exploration of contrastive pre-training (Chen et al., 2020b; He et al., 2020; Bachman et al., 2019; Henaff et al., 2020) to future work. ´
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 7: Left: Filters of the initial linear embedding of RGB values of ViT-L/32. Center: Similarity of position embeddings of ViT-L/32. Tiles show the cosine similarity between the position embedding of the patch with the indicated row and column and the position embeddings of all other patches. Right: Size of attended area by head and network depth. Each dot shows the mean attention distance across images for one of 16 heads at one layer. See Appendix D.6 for details.
|
| 151 |
+
|
| 152 |
+
# 5 CONCLUSION
|
| 153 |
+
|
| 154 |
+
We have explored the direct application of Transformers to image recognition. Unlike prior works using self-attention in computer vision, we do not introduce image-specific inductive biases into the architecture apart from the initial patch extraction step. Instead, we interpret an image as a sequence of patches and process it by a standard Transformer encoder as used in NLP. This simple, yet scalable, strategy works surprisingly well when coupled with pre-training on large datasets. Thus, Vision Transformer matches or exceeds the state of the art on many image classification datasets, whilst being relatively cheap to pre-train.
|
| 155 |
+
|
| 156 |
+
While these initial results are encouraging, many challenges remain. One is to apply ViT to other computer vision tasks, such as detection and segmentation. Our results, coupled with those in Carion et al. (2020), indicate the promise of this approach. Another challenge is to continue exploring selfsupervised pre-training methods. Our initial experiments show improvement from self-supervised pre-training, but there is still large gap between self-supervised and large-scale supervised pretraining. Finally, further scaling of ViT would likely lead to improved performance.
|
| 157 |
+
|
| 158 |
+
# ACKNOWLEDGEMENTS
|
| 159 |
+
|
| 160 |
+
The work was performed in Berlin, Zurich, and Amsterdam. We thank many colleagues at Google ¨ for their help, in particular Andreas Steiner for crucial help with the infrastructure and the opensource release of the code; Joan Puigcerver and Maxim Neumann for help with the large-scale training infrastructure; Dmitry Lepikhin, Aravindh Mahendran, Daniel Keysers, Mario Luciˇ c, Noam ´ Shazeer, and Colin Raffel for useful discussions.
|
| 161 |
+
|
| 162 |
+
# REFERENCES
|
| 163 |
+
|
| 164 |
+
Samira Abnar and Willem Zuidema. Quantifying attention flow in transformers. In ACL, 2020.
|
| 165 |
+
|
| 166 |
+
Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In NeurIPS, 2019.
|
| 167 |
+
|
| 168 |
+
Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In ICLR, 2019.
|
| 169 |
+
|
| 170 |
+
I. Bello, B. Zoph, Q. Le, A. Vaswani, and J. Shlens. Attention augmented convolutional networks. In ICCV, 2019.
|
| 171 |
+
|
| 172 |
+
Lucas Beyer, Olivier J. Henaff, Alexander Kolesnikov, Xiaohua Zhai, and A ´ aron van den Oord. Are ¨ we done with imagenet? arXiv, 2020.
|
| 173 |
+
|
| 174 |
+
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, 2020.
|
| 175 |
+
|
| 176 |
+
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
|
| 177 |
+
|
| 178 |
+
Mark Chen, Alec Radford, Rewon Child, Jeff Wu, and Heewoo Jun. Generative pretraining from pixels. In ICML, 2020a.
|
| 179 |
+
|
| 180 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020b.
|
| 181 |
+
|
| 182 |
+
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 ECCV, 2020c.
|
| 183 |
+
|
| 184 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv, 2019.
|
| 185 |
+
|
| 186 |
+
Jean-Baptiste Cordonnier, Andreas Loukas, and Martin Jaggi. On the relationship between selfattention and convolutional layers. In ICLR, 2020.
|
| 187 |
+
|
| 188 |
+
J. Deng, W. Dong, R. Socher, L. Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 189 |
+
|
| 190 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
|
| 191 |
+
|
| 192 |
+
Josip Djolonga, Jessica Yung, Michael Tschannen, Rob Romijnders, Lucas Beyer, Alexander Kolesnikov, Joan Puigcerver, Matthias Minderer, Alexander D’Amour, Dan Moldovan, Sylvan Gelly, Neil Houlsby, Xiaohua Zhai, and Mario Lucic. On robustness and transferability of convolutional neural networks. arXiv, 2020.
|
| 193 |
+
|
| 194 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 195 |
+
|
| 196 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
|
| 197 |
+
|
| 198 |
+
Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv, 2019.
|
| 199 |
+
|
| 200 |
+
Han Hu, Jiayuan Gu, Zheng Zhang, Jifeng Dai, and Yichen Wei. Relation networks for object detection. In CVPR, 2018.
|
| 201 |
+
|
| 202 |
+
Han Hu, Zheng Zhang, Zhenda Xie, and Stephen Lin. Local relation networks for image recognition. In ICCV, 2019.
|
| 203 |
+
|
| 204 |
+
Zilong Huang, Xinggang Wang, Yunchao Wei, Lichao Huang, Humphrey Shi, Wenyu Liu, and Thomas S. Huang. Ccnet: Criss-cross attention for semantic segmentation. In ICCV, 2020.
|
| 205 |
+
|
| 206 |
+
Olivier J. Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, S. M. Ali Eslami,´ and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. In ICML, 2020.
|
| 207 |
+
|
| 208 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. 2015.
|
| 209 |
+
|
| 210 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 211 |
+
|
| 212 |
+
Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (BiT): General visual representation learning. In ECCV, 2020.
|
| 213 |
+
|
| 214 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 215 |
+
|
| 216 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
|
| 217 |
+
|
| 218 |
+
Y. LeCun, B. Boser, J. Denker, D. Henderson, R. Howard, W. Hubbard, and L. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1:541–551, 1989.
|
| 219 |
+
|
| 220 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv, 2020.
|
| 221 |
+
|
| 222 |
+
Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. VisualBERT: A Simple and Performant Baseline for Vision and Language. In Arxiv, 2019.
|
| 223 |
+
|
| 224 |
+
Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-centric learning with slot attention. arXiv, 2020.
|
| 225 |
+
|
| 226 |
+
Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. ViLBERT: Pretraining Task-Agnostic Visiolinguistic Representations for Vision-and-Language Tasks. In NeurIPS. 2019.
|
| 227 |
+
|
| 228 |
+
Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. In ECCV, 2018.
|
| 229 |
+
|
| 230 |
+
M. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In ICVGIP, 2008.
|
| 231 |
+
|
| 232 |
+
Omkar M. Parkhi, Andrea Vedaldi, Andrew Zisserman, and C. V. Jawahar. Cats and dogs. In CVPR, 2012.
|
| 233 |
+
|
| 234 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In ICML, 2018.
|
| 235 |
+
|
| 236 |
+
B. T. Polyak and A. B. Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992. doi: 10.1137/0330046. URL https://doi.org/10.1137/0330046.
|
| 237 |
+
|
| 238 |
+
Siyuan Qiao, Huiyu Wang, Chenxi Liu, Wei Shen, and Alan Yuille. Weight standardization. arXiv preprint arXiv:1903.10520, 2019.
|
| 239 |
+
|
| 240 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding with unsupervised learning. Technical Report, 2018.
|
| 241 |
+
|
| 242 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. Technical Report, 2019.
|
| 243 |
+
|
| 244 |
+
Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jon Shlens. Stand-alone self-attention in vision models. In NeurIPS, 2019.
|
| 245 |
+
|
| 246 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In ICCV, 2017.
|
| 247 |
+
|
| 248 |
+
Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. Videobert: A joint model for video and language representation learning. In ICCV, 2019.
|
| 249 |
+
|
| 250 |
+
Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Herve Jegou. Fixing the train-test resolution discrepancy. In NeurIPS. 2019.
|
| 251 |
+
|
| 252 |
+
Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Herve Jegou. Fixing the train-test resolution discrepancy: Fixefficientnet. arXiv preprint arXiv:2003.08237, 2020.
|
| 253 |
+
|
| 254 |
+
Michael Tschannen, Josip Djolonga, Marvin Ritter, Aravindh Mahendran, Neil Houlsby, Sylvain Gelly, and Mario Lucic. Self-supervised learning of video-induced visual invariances. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 255 |
+
|
| 256 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
|
| 257 |
+
|
| 258 |
+
Huiyu Wang, Yukun Zhu, Bradley Green, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Axial-deeplab: Stand-alone axial-attention for panoptic segmentation. In ECCV, 2020a.
|
| 259 |
+
|
| 260 |
+
Huiyu Wang, Yukun Zhu, Bradley Green, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Axial-deeplab: Stand-alone axial-attention for panoptic segmentation. arXiv preprint arXiv:2003.07853, 2020b.
|
| 261 |
+
|
| 262 |
+
Qiang Wang, Bei Li, Tong Xiao, Jingbo Zhu, Changliang Li, Derek F. Wong, and Lidia S. Chao. Learning deep transformer models for machine translation. In ACL, 2019.
|
| 263 |
+
|
| 264 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, 2018.
|
| 265 |
+
|
| 266 |
+
Dirk Weissenborn, Oscar Tackstr ¨ om, and Jakob Uszkoreit. Scaling autoregressive video models. In ¨ ICLR, 2019.
|
| 267 |
+
|
| 268 |
+
Bichen Wu, Chenfeng Xu, Xiaoliang Dai, Alvin Wan, Peizhao Zhang, Masayoshi Tomizuka, Kurt Keutzer, and Peter Vajda. Visual transformers: Token-based image representation and processing for computer vision. arxiv, 2020.
|
| 269 |
+
|
| 270 |
+
Yuxin Wu and Kaiming He. Group normalization. In ECCV, 2018.
|
| 271 |
+
|
| 272 |
+
Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V. Le. Self-training with noisy student improves imagenet classification. In CVPR, 2020.
|
| 273 |
+
|
| 274 |
+
Xiaohua Zhai, Avital Oliver, Alexander Kolesnikov, and Lucas Beyer. $\mathrm { S ^ { 4 } L }$ : Self-Supervised SemiSupervised Learning. In ICCV, 2019a.
|
| 275 |
+
|
| 276 |
+
Xiaohua Zhai, Joan Puigcerver, Alexander Kolesnikov, Pierre Ruyssen, Carlos Riquelme, Mario Lucic, Josip Djolonga, Andre Susano Pinto, Maxim Neumann, Alexey Dosovitskiy, et al. A large-scale study of representation learning with the visual task adaptation benchmark. arXiv preprint arXiv:1910.04867, 2019b.
|
| 277 |
+
|
| 278 |
+
Hengshuang Zhao, Jiaya Jia, and Vladlen Koltun. Exploring self-attention for image recognition. In CVPR, 2020.
|
| 279 |
+
|
| 280 |
+
Table 3: Hyperparameters for training. All models are trained with a batch size of 4096 and learning rate warmup of $1 0 \mathrm { k }$ steps. For ImageNet we found it beneficial to additionally apply gradient clipping at global norm 1. Training resolution is 224.
|
| 281 |
+
|
| 282 |
+
<table><tr><td>Models</td><td>Dataset</td><td>Epochs</td><td>Base LR</td><td>LR decay</td><td>Weight decay</td><td>Dropout</td></tr><tr><td>ViT-B/{16,32}</td><td>JFT-300M</td><td>7</td><td>8.10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>ViT-L/32</td><td>JFT-300M</td><td>7</td><td>6.10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>ViT-L/16</td><td>JFT-300M</td><td>7/14</td><td>4·10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>ViT-H/14</td><td>JFT-300M</td><td>14</td><td>3.10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>R50x{1,2}</td><td>JFT-300M</td><td>7</td><td>10-3</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>R101x1</td><td>JFT-300M</td><td>7</td><td>8.10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>R152x{1,2}</td><td>JFT-300M</td><td>7</td><td>6·10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>R50+ViT-B/{16,32}</td><td>JFT-300M</td><td>7</td><td>8.10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>R50+ViT-L/32</td><td>JFT-300M</td><td>7</td><td>2.10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>R50+ViT-L/16</td><td>JFT-300M</td><td>7/14</td><td>4·10-4</td><td>linear</td><td>0.1</td><td>0.0</td></tr><tr><td>ViT-B/{16,32}</td><td>ImageNet-21k</td><td>90</td><td>10-3</td><td>linear</td><td>0.03</td><td>0.1</td></tr><tr><td>ViT-L/{16,32}</td><td>ImageNet-21k</td><td>30/90</td><td>10-3</td><td>linear</td><td>0.03</td><td>0.1</td></tr><tr><td>ViT-*</td><td>ImageNet</td><td>300</td><td>3.10-3</td><td>cosine</td><td>0.3</td><td>0.1</td></tr></table>
|
| 283 |
+
|
| 284 |
+
# APPENDIX
|
| 285 |
+
|
| 286 |
+
# A MULTIHEAD SELF-ATTENTION
|
| 287 |
+
|
| 288 |
+
Standard qkv self-attention (SA, Vaswani et al. (2017)) is a popular building block for neural architectures. For each element in an input sequence $\mathbf { z } \in \mathbb { R } ^ { N \times \dot { D } }$ , we compute a weighted sum over all values $\mathbf { v }$ in the sequence. The attention weights $A _ { i j }$ are based on the pairwise similarity between two elements of the sequence and their respective query $\mathbf { q } ^ { i }$ and key $\mathbf { k } ^ { j }$ representations.
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\begin{array} { r l } { [ \mathbf { q } , \mathbf { k } , \mathbf { v } ] = \mathbf { z } \mathbf { U } _ { q k v } \qquad } & { \mathbf { U } _ { q k v } \in \mathbb { R } ^ { D \times 3 D _ { h } } , } \\ { A = \mathrm { s o f t m a x } \left( \mathbf { q } \mathbf { k } ^ { \top } / \sqrt { D _ { h } } \right) \qquad } & { A \in \mathbb { R } ^ { N \times N } , } \\ { \mathrm { S A } ( \mathbf { z } ) = A \mathbf { v } . } \end{array}
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
Multihead self-attention (MSA) is an extension of SA in which we run $k$ self-attention operations, called “heads”, in parallel, and project their concatenated outputs. To keep compute and number of parameters constant when changing $k$ , $D _ { h }$ (Eq. 5) is typically set to $D / k$ .
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array} { r } { \mathrm { M S A } ( \mathbf { z } ) = [ \mathrm { S A } _ { 1 } ( z ) ; \mathrm { S A } _ { 2 } ( z ) ; \cdots \ ; \mathrm { S A } _ { k } ( z ) ] \mathbf { U } _ { m s a } \qquad \quad \mathbf { U } _ { m s a } \in \mathbb { R } ^ { k \cdot D _ { h } \times D } } \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
# B EXPERIMENT DETAILS
|
| 301 |
+
|
| 302 |
+
# B.1 TRAINING
|
| 303 |
+
|
| 304 |
+
Table 3 summarizes our training setups for our different models. We found strong regularization to be key when training models from scratch on ImageNet. Dropout, when used, is applied after every dense layer except for the the qkv-projections and directly after adding positional- to patch embeddings. Hybrid models are trained with the exact setup as their ViT counterparts. Finally, all training is done on resolution 224.
|
| 305 |
+
|
| 306 |
+
# B.1.1 FINE-TUNING
|
| 307 |
+
|
| 308 |
+
We fine-tune all ViT models using SGD with a momentum of 0.9. We run a small grid search over learning rates, see learning rate ranges in Table 4. To do so, we use small sub-splits from the training set ( $10 \%$ for Pets and Flowers, $2 \%$ for CIFAR, $1 \%$ ImageNet) as development set and train on the remaining data. For final results we train on the entire training set and evaluate on the respective test data. For fine-tuning ResNets and hybrid models we use the exact same setup, with the only exception of ImageNet where we add another value 0.06 to the learning rate sweep. Additionally,
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Dataset</td><td>Steps</td><td>Base LR</td></tr><tr><td>ImageNet</td><td>20000</td><td>{0.003,0.01,0.03, 0.06}</td></tr><tr><td>CIFAR100</td><td>10000</td><td>{0.001,0.003,0.01,0.03}</td></tr><tr><td>CIFAR10</td><td>10000</td><td>{0.001,0.003,0.01, 0.03}</td></tr><tr><td>Oxford-IIITPets</td><td>500</td><td>{0.001,0.003,0.01,0.03}</td></tr><tr><td>Oxford Flowers-102</td><td>500</td><td>{0.001, 0.003,0.01, 0.03}</td></tr><tr><td>VTAB (19 tasks)</td><td>2500</td><td>0.01</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 4: Hyperparameters for fine-tuning. All models are fine-tuned with cosine learning rate decay, a batch size of 512, no weight decay, and grad clipping at global norm 1. If not mentioned otherwise, fine-tuning resolution is 384.
|
| 313 |
+
|
| 314 |
+
for ResNets we also run the setup of Kolesnikov et al. (2020) and select the best results across this run and our sweep. Finally, if not mentioned otherwise, all fine-tuning experiments run at 384 resolution (running fine-tuning at different resolution than training is common practice (Kolesnikov et al., 2020)).
|
| 315 |
+
|
| 316 |
+
When transferring ViT models to another dataset, we remove the whole head (two linear layers) and replace it by a single, zero-initialized linear layer outputting the number of classes required by the target dataset. We found this to be a little more robust than simply re-initializing the very last layer.
|
| 317 |
+
|
| 318 |
+
For VTAB we follow the protocol in Kolesnikov et al. (2020), and use the same hyperparameter setting for all tasks. We use a learning rate of 0.01 and train for 2500 steps (Tab. 4). We chose this setting by running a small sweep over two learning rates and two schedules, and selecting the setting with the highest VTAB score on the 200-example validation sets. We follow the pre-processing used in Kolesnikov et al. (2020), except that we do not use task-specific input resolutions. Instead we find that Vision Transformer benefits most from a high resolution $( 3 8 4 \times 3 8 4 )$ for all tasks.
|
| 319 |
+
|
| 320 |
+
# B.1.2 SELF-SUPERVISION
|
| 321 |
+
|
| 322 |
+
We employ the masked patch prediction objective for preliminary self-supervision experiments. To do so we corrupt $50 \%$ of patch embeddings by either replacing their embeddings with a learnable [mask] embedding $( 8 0 \% )$ , a random other patch embedding $( 1 0 \% )$ or just keeping them as is $( 1 0 \% )$ . This setup is very similar to the one used for language by Devlin et al. (2019). Finally, we predict the 3-bit, mean color (i.e., 512 colors in total) of every corrupted patch using their respective patch representations.
|
| 323 |
+
|
| 324 |
+
We trained our self-supervised model for 1M steps (ca. 14 epochs) with batch size 4096 on JFT. We use Adam, with a base learning rate of $2 \cdot 1 0 ^ { - 4 }$ , warmup of $1 0 \mathrm { k }$ steps and cosine learning rate decay. As prediction targets for pretraining we tried the following settings: 1) predicting only the mean, 3bit color (i.e., 1 prediction of 512 colors), 2) predicting a $4 \times 4$ downsized version of the $1 6 \times 1 6$ patch with 3bit colors in parallel (i.e., 16 predictions of 512 colors), 3) regression on the full patch using L2 (i.e., 256 regressions on the 3 RGB channels). Surprisingly, we found that all worked quite well, though L2 was slightly worse. We report final results only for option 1) because it has shown best few-shot performance. We also experimented with $15 \%$ corruption rate as used by Devlin et al. (2019) but results were also slightly worse on our few-shot metrics.
|
| 325 |
+
|
| 326 |
+
Lastly, we would like to remark that our instantiation of masked patch prediction doesn’t require such an enormous amount of pretraining nor a large dataset such as JFT in order to lead to similar performance gains on ImageNet classification. That is, we observed diminishing returns on downstream performance after $1 0 0 \mathrm { k }$ pretraining steps, and see similar gains when pretraining on ImageNet.
|
| 327 |
+
|
| 328 |
+
# C ADDITIONAL RESULTS
|
| 329 |
+
|
| 330 |
+
We report detailed results corresponding to the figures presented in the paper. Table 5 corresponds to Figure 3 from the paper and shows transfer performance of different ViT models pre-trained on datasets of increasing size: ImageNet, ImageNet-21k, and JFT-300M. Table 6 corresponds to
|
| 331 |
+
|
| 332 |
+
Table 5: Top1 accuracy (in $\%$ ) of Vision Transformer on various datasets when pre-trained on ImageNet, ImageNet-21k or JFT300M. These values correspond to Figure 3 in the main text. Models are fine-tuned at 384 resolution. Note that the ImageNet results are computed without additional techniques (Polyak averaging and 512 resolution images) used to achieve results in Table 2.
|
| 333 |
+
|
| 334 |
+
<table><tr><td colspan="2"></td><td>ViT-B/16</td><td>ViT-B/32</td><td>ViT-L/16</td><td>ViT-L/32</td><td>ViT-H/14</td></tr><tr><td rowspan="6">ImageNet</td><td>CIFAR-10</td><td>98.13</td><td>97.77</td><td>97.86</td><td>97.94</td><td></td></tr><tr><td>CIFAR-100</td><td>87.13</td><td>86.31</td><td>86.35</td><td>87.07</td><td></td></tr><tr><td>ImageNet</td><td>77.91</td><td>73.38</td><td>76.53</td><td>71.16</td><td></td></tr><tr><td>ImageNet ReaL</td><td>83.57</td><td>79.56</td><td>82.19</td><td>77.83</td><td></td></tr><tr><td>Oxford Flowers-102</td><td>89.49</td><td>85.43</td><td>89.66</td><td>86.36</td><td></td></tr><tr><td>Oxford-IIIT-Pets</td><td>93.81</td><td>92.04</td><td>93.64</td><td>91.35</td><td>■</td></tr><tr><td rowspan="6">ImageNet-21k</td><td>CIFAR-10</td><td>98.95</td><td>98.79</td><td>99.16</td><td>99.13</td><td>99.27</td></tr><tr><td>CIFAR-100</td><td>91.67</td><td>91.97</td><td>93.44</td><td>93.04</td><td>93.82</td></tr><tr><td>ImageNet</td><td>83.97</td><td>81.28</td><td>85.15</td><td>80.99</td><td>85.13</td></tr><tr><td>ImageNet ReaL</td><td>88.35</td><td>86.63</td><td>88.40</td><td>85.65</td><td>88.70</td></tr><tr><td>Oxford Flowers-102 Oxford-IIIT-Pets</td><td>99.38</td><td>99.11</td><td>99.61</td><td>99.19</td><td>99.51</td></tr><tr><td></td><td>94.43</td><td>93.02</td><td>94.73</td><td>93.09</td><td>94.82</td></tr><tr><td rowspan="6">JFT-300M</td><td>CIFAR-10</td><td>99.00</td><td>98.61</td><td>99.38</td><td>99.19</td><td>99.50</td></tr><tr><td>CIFAR-100</td><td>91.87</td><td>90.49</td><td>94.04</td><td>92.52</td><td>94.55</td></tr><tr><td>ImageNet</td><td>84.15</td><td>80.73</td><td>87.12</td><td>84.37</td><td>88.04</td></tr><tr><td>ImageNet ReaL</td><td>88.85</td><td>86.27</td><td>89.99</td><td>88.28</td><td>90.33</td></tr><tr><td>Oxford Flowers-102</td><td>99.56</td><td>99.27</td><td>99.56</td><td>99.45</td><td>99.68</td></tr><tr><td>Oxford-IIIT-Pets</td><td>95.80</td><td>93.40</td><td>97.11</td><td>95.83</td><td>97.56</td></tr></table>
|
| 335 |
+
|
| 336 |
+
<table><tr><td>Model</td><td>Epochs</td><td>ImageNet</td><td>ImageNet ReaL</td><td>CIFAR-10</td><td>CIFAR-100</td><td>Pets</td><td>Flowers</td><td>exaFLOPs</td></tr><tr><td>ViT-B/32</td><td>7</td><td>80.73</td><td>86.27</td><td>98.61</td><td>90.49</td><td>93.40</td><td>99.27</td><td>164</td></tr><tr><td>ViT-B/16</td><td>7</td><td>84.15</td><td>88.85</td><td>99.00</td><td>91.87</td><td>95.80</td><td>99.56</td><td>743</td></tr><tr><td>ViT-L/32</td><td>7</td><td>84.37</td><td>88.28</td><td>99.19</td><td>92.52</td><td>95.83</td><td>99.45</td><td>574</td></tr><tr><td>ViT-L/16</td><td>7</td><td>86.30</td><td>89.43</td><td>99.38</td><td>93.46</td><td>96.81</td><td>99.66</td><td>2586</td></tr><tr><td>ViT-L/16</td><td>14</td><td>87.12</td><td>89.99</td><td>99.38</td><td>94.04</td><td>97.11</td><td>99.56</td><td>5172</td></tr><tr><td>ViT-H/14</td><td>14</td><td>88.08</td><td>90.36</td><td>99.50</td><td>94.71</td><td>97.11</td><td>99.71</td><td>12826</td></tr><tr><td>ResNet50x1</td><td>7</td><td>77.54</td><td>84.56</td><td>97.67</td><td>86.07</td><td>91.11</td><td>94.26</td><td>150</td></tr><tr><td>ResNet50x2</td><td>7</td><td>82.12</td><td>87.94</td><td>98.29</td><td>89.20</td><td>93.43</td><td>97.02</td><td>592</td></tr><tr><td>ResNet101x1</td><td>7</td><td>80.67</td><td>87.07</td><td>98.48</td><td>89.17</td><td>94.08</td><td>95.95</td><td>285</td></tr><tr><td>ResNet152x1</td><td>7</td><td>81.88</td><td>87.96</td><td>98.82</td><td>90.22</td><td>94.17</td><td>96.94</td><td>427</td></tr><tr><td>ResNet152x2</td><td>7</td><td>84.97</td><td>89.69</td><td>99.06</td><td>92.05</td><td>95.37</td><td>98.62</td><td>1681</td></tr><tr><td>ResNet152x2</td><td>14</td><td>85.56</td><td>89.89</td><td>99.24</td><td>91.92</td><td>95.75</td><td>98.75</td><td>3362</td></tr><tr><td>ResNet200x3</td><td>14</td><td>87.22</td><td>90.15</td><td>99.34</td><td>93.53</td><td>96.32</td><td>99.04</td><td>10212</td></tr><tr><td>R50x1+ViT-B/32</td><td>7</td><td>84.90</td><td>89.15</td><td>99.01</td><td>92.24</td><td>95.75</td><td>99.46</td><td>315</td></tr><tr><td>R50x1+ViT-B/16</td><td>7</td><td>85.58</td><td>89.65</td><td>99.14</td><td>92.63</td><td>96.65</td><td>99.40</td><td>855</td></tr><tr><td>R50x1+ViT-L/32</td><td>7</td><td>85.68</td><td>89.04</td><td>99.24</td><td>92.93</td><td>96.97</td><td>99.43</td><td>725</td></tr><tr><td>R50x1+ViT-L/16</td><td>7</td><td>86.60</td><td>89.72</td><td>99.18</td><td>93.64</td><td>97.03</td><td>99.40</td><td>2704</td></tr><tr><td>R50x1+ViT-L/16</td><td>14</td><td>87.12</td><td>89.76</td><td>99.31</td><td>93.89</td><td>97.36</td><td>99.11</td><td>5165</td></tr></table>
|
| 337 |
+
|
| 338 |
+
Table 6: Detailed results of model scaling experiments. These correspond to Figure 5 in the main paper.
|
| 339 |
+
|
| 340 |
+
Figure 5 from the paper and shows the transfer performance of ViT, ResNet, and hybrid models of varying size, as well as the estimated computational cost of their pre-training.
|
| 341 |
+
|
| 342 |
+
# D ADDITIONAL ANALYSES
|
| 343 |
+
|
| 344 |
+
# D.1 SGD VS. ADAM FOR RESNETS
|
| 345 |
+
|
| 346 |
+
ResNets are typically trained with SGD and our use of Adam as optimizer is quite unconventional. Here we show the experiments that motivated this choice. Namely, we compare the fine-tuning performance of two ResNets – 50x1 and $1 5 2 \mathrm { x } 2 $ – pre-trained on JFT with SGD and Adam. For SGD, we use the hyperparameters recommended by Kolesnikov et al. (2020). Results are presented in Table 7. Adam pre-training outperforms SGD pre-training on most datasets and on average. This justifies the choice of Adam as the optimizer used to pre-train ResNets on JFT. Note that the absolute numbers are lower than those reported by Kolesnikov et al. (2020), since we pre-train only for 7 epochs, not 30.
|
| 347 |
+
|
| 348 |
+
Table 7: Fine-tuning ResNet models pre-trained with Adam and SGD.
|
| 349 |
+
|
| 350 |
+
<table><tr><td></td><td colspan="2">ResNet50</td><td colspan="2">ResNet152x2</td></tr><tr><td>Dataset</td><td>Adam</td><td>SGD</td><td>Adam</td><td>SGD</td></tr><tr><td>ImageNet</td><td>77.54</td><td>78.24</td><td>84.97</td><td>84.37</td></tr><tr><td>CIFAR10</td><td>97.67</td><td>97.46</td><td>99.06</td><td>99.07</td></tr><tr><td>CIFAR100</td><td>86.07</td><td>85.17</td><td>92.05</td><td>91.06</td></tr><tr><td>Oxford-IIITPets</td><td>91.11</td><td>91.00</td><td>95.37</td><td>94.79</td></tr><tr><td>Oxford Flowers-102</td><td>94.26</td><td>92.06</td><td>98.62</td><td>99.32</td></tr><tr><td>Average</td><td>89.33</td><td>88.79</td><td>94.01</td><td>93.72</td></tr></table>
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 8: Scaling different model dimensions of the Vision Transformer.
|
| 354 |
+
|
| 355 |
+
# D.2 TRANSFORMER SHAPE
|
| 356 |
+
|
| 357 |
+
We ran ablations on scaling different dimensions of the Transformer architecture to find out which are best suited for scaling to very large models. Figure 8 shows 5-shot performance on ImageNet for different configurations. All configurations are based on a ViT model with 8 layers, $D = 1 0 2 4$ , $D _ { M L P } = 2 0 4 8$ and a patch size of 32, the intersection of all lines. We can see that scaling the depth results in the biggest improvements which are clearly visible up until 64 layers. However, diminishing returns are already visible after 16 layers. Interestingly, scaling the width of the network seems to result in the smallest changes. Decreasing the patch size and thus increasing the effective sequence length shows surprisingly robust improvements without introducing parameters. These findings suggest that compute might be a better predictor of performance than the number of parameters, and that scaling should emphasize depth over width if any. Overall, we find that scaling all dimensions proportionally results in robust improvements.
|
| 358 |
+
|
| 359 |
+
# D.3 POSITIONAL EMBEDDING
|
| 360 |
+
|
| 361 |
+
We ran ablations on different ways of encoding spatial information using positional embedding. We tried the following cases:
|
| 362 |
+
|
| 363 |
+
• Providing no positional information: Considering the inputs as a bag of patches. • 1-dimensional positional embedding: Considering the inputs as a sequence of patches in the raster order (default across all other experiments in this paper). • 2-dimensional positional embedding: Considering the inputs as a grid of patches in two dimensions. In this case, two sets of embeddings are learned, each for one of the axes, $X$ -embedding, and $Y$ -embedding, each with size $D / 2$ . Then, based on the coordinate on the path in the input, we concatenate the $X$ and $Y$ embedding to get the final positional embedding for that patch.
|
| 364 |
+
|
| 365 |
+
Table 8: Results of the ablation study on positional embeddings with ViT-B/16 model evaluated on ImageNet 5-shot linear.
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Pos. Emb.</td><td>Default/Stem</td><td>Every Layer</td><td>Every Layer-Shared</td></tr><tr><td>No Pos. Emb.</td><td>0.61382</td><td>N/A</td><td>N/A</td></tr><tr><td>1-D Pos. Emb.</td><td>0.64206</td><td>0.63964</td><td>0.64292</td></tr><tr><td>2-D Pos. Emb.</td><td>0.64001</td><td>0.64046</td><td>0.64022</td></tr><tr><td>Rel. Pos.Emb.</td><td>0.64032</td><td>N/A</td><td>N/A</td></tr></table>
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 9: Position embeddings of models trained with different hyperparameters.
|
| 371 |
+
|
| 372 |
+
• Relative positional embeddings: Considering the relative distance between patches to encode the spatial information as instead of their absolute position. To do so, we use 1- dimensional Relative Attention, in which we define the relative distance all possible pairs of patches. Thus, for every given pair (one as query, and the other as key/value in the attention mechanism), we have an offset $p _ { q } - p _ { k }$ , where each offset is associated with an embedding. Then, we simply run extra attention, where we use the original query (the content of query), but use relative positional embeddings as keys. We then use the logits from the relative attention as a bias term and add it to the logits of the main attention (content-based attention) before applying the softmax.
|
| 373 |
+
|
| 374 |
+
In addition to different ways of encoding spatial information, we also tried different ways of incorporating this information in our model. For the 1-dimensional and 2-dimensional positional embeddings, we tried three different cases: (1) add positional embeddings to the inputs right after the stem of them model and before feeding the inputs to the Transformer encoder (default across all other experiments in this paper); (2) learn and add positional embeddings to the inputs at the beginning of each layer; (3) add a learned positional embeddings to the inputs at the beginning of each layer (shared between layers).
|
| 375 |
+
|
| 376 |
+
Table 8 summarizes the results from this ablation study on a ViT-B/16 model. As we can see, while there is a large gap between the performances of the model with no positional embedding and models with positional embedding, there is little to no difference between different ways of encoding positional information. We speculate that since our Transformer encoder operates on patch-level inputs, as opposed to pixel-level, the differences in how to encode spatial information is less important. More precisely, in patch-level inputs, the spatial dimensions are much smaller than the original pixel-level inputs, e.g., $1 4 \times 1 4$ as opposed to $2 2 4 \times 2 2 4$ , and learning to represent the spatial relations in this resolution is equally easy for these different positional encoding strategies. Even so, the specific pattern of position embedding similarity learned by the network depends on the training hyperparameters (Figure 9).
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 10: Size of attended area by head and network depth. Attention distance was computed for 128 example images by averaging the distance between the query pixel and all other pixels, weighted by the attention weight. Each dot shows the mean attention distance across images for one of 16 heads at one layer. Image width is 224 pixels.
|
| 380 |
+
|
| 381 |
+
# D.4 EMPIRICAL COMPUTATIONAL COSTS
|
| 382 |
+
|
| 383 |
+
We are also interested in real-world speed of the architectures on our hardware, which is not always well predicted by theoretical FLOPs due to details like lane widths and cache sizes. For this purpose, we perform timing of inference speed for the main models of interest, on a TPUv3 accelerator; the difference between inference and backprop speed is a constant model-independent factor.
|
| 384 |
+
|
| 385 |
+
Figure 11 (left) shows how many images one core can handle per second, across various input sizes. Every single point refers to the peak performance measured across a wide range of batch-sizes. As can be seen, the theoretical bi-quadratic scaling of ViT with image size only barely starts happening for the largest models at the largest resolutions.
|
| 386 |
+
|
| 387 |
+
Another quantity of interest is the largest batch-size each model can fit onto a core, larger being better for scaling to large datasets. Figure 11 (right) shows this quantity for the same set of models. This shows that large ViT models have a clear advantage in terms of memory-efficiency over ResNet models.
|
| 388 |
+
|
| 389 |
+
# D.5 AXIAL ATTENTION
|
| 390 |
+
|
| 391 |
+
Axial Attention (Huang et al., 2020; Ho et al., 2019) is a simple, yet effective technique to run selfattention on large inputs that are organized as multidimensional tensors. The general idea of axial attention is to perform multiple attention operations, each along a single axis of the input tensor, instead of applying 1-dimensional attention to the flattened version of the input. In axial attention, each attention mixes information along a particular axis, while keeping information along the other axes independent. Along this line, Wang et al. (2020b) proposed the AxialResNet model in which all the convolutions with kernel size $3 \times 3$ in a ResNet50 are replaced by axial self-attention, i.e. a row and column attention, augmented by relative positional encoding. We have implemented AxialResNet as a baseline model.3.
|
| 392 |
+
|
| 393 |
+
Moreover, we have modified ViT to process inputs in the 2-dimensional shape, instead of a 1- dimensional sequence of patches, and incorporate Axial Transformer blocks, in which instead of a self-attention followed by an MLP, we have a a row-self-attention plus an MLP followed by a column-self-attention plus an MLP.
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 11: Left: Real wall-clock timings of various architectures across input sizes. ViT models have speed comparable to similar ResNets. Right: Largest per-core batch-size fitting on device with various architectures across input sizes. ViT models are clearly more memory-efficient.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 12: Performance of Axial-Attention based models, in terms of top-1 accuracy on ImageNet 5-shot linear, versus their speed in terms of number of FLOPs (left) and inference time (left).
|
| 400 |
+
|
| 401 |
+
Figure 12, present the performance of Axial ResNet, Axial-ViT-B/32 and Axial-ViT-B/16 on ImageNet 5shot linear, when pretrained on JFT dataset, verses the pretraining compute, both in terms of number of FLOPs and inference time (example per seconds). As we can see, both Axial-ViT-B/32 and Axial-ViT-B/16 do better than their ViT-B counterpart in terms of performance, but it comes at the cost of more compute. This is because in Axial-ViT models, each Transformer block with global self-attention is replaced by two Axial Transformer blocks, one with row and one with column selfattention and although the sequence length that self-attention operates on is smaller in axial case, there is a extra MLP per Axial-ViT block. For the AxialResNet, although it looks reasonable in terms of accuracy/compute trade-off (Figure 12, left), the naive implementation is extremely slow on TPUs (Figure 12, right).
|
| 402 |
+
|
| 403 |
+
# D.6 ATTENTION DISTANCE
|
| 404 |
+
|
| 405 |
+
To understand how ViT uses self-attention to integrate information across the image, we analyzed the average distance spanned by attention weights at different layers (Figure 10). This “attention distance” is analogous to receptive field size in CNNs. Average attention distance is highly variable
|
| 406 |
+
|
| 407 |
+
across heads in lower layers, with some heads attending to much of the image, while others attend to small regions at or near the query location. As depth increases, attention distance increases for all heads. In the second half of the network, most heads attend widely across tokens.
|
| 408 |
+
|
| 409 |
+
# D.7 ATTENTION MAPS
|
| 410 |
+
|
| 411 |
+
To compute maps of the attention from the output token to the input space (Figures 6 and 13), we used Attention Rollout (Abnar & Zuidema, 2020). Briefly, we averaged attention weights of ViT$\mathrm { L } / 1 6$ across all heads and then recursively multiplied the weight matrices of all layers. This accounts for the mixing of attention across tokens through all layers.
|
| 412 |
+
|
| 413 |
+
# D.8 VTAB BREAKDOWN
|
| 414 |
+
|
| 415 |
+
Table 9 shows the scores attained on each of the VTAB-1k tasks.
|
| 416 |
+
|
| 417 |
+
Table 9: Breakdown of VTAB-1k performance across tasks.
|
| 418 |
+
|
| 419 |
+
<table><tr><td></td><td>0oreeeaer</td><td>CIIPIP0 :</td><td>DEI ·</td><td>irmsiI</td><td>s1ed</td><td>660uns</td><td>NHAS</td><td>eeaaem</td><td>ButoS</td><td></td><td>55sr515</td><td>Grrrogar</td><td>Cerrrelrr CTr-st</td><td>q NTa</td><td>pop-dP</td><td>uo-Idsp·</td><td>JTI-ITTTT</td><td>SIIH-SRAR</td><td>SSH-PRPPEE</td><td>7aam</td></tr><tr><td>ViT-H/14 (JFT)</td><td>95.3</td><td>85.5</td><td>75.2</td><td>99.7</td><td>97.2</td><td>65.0</td><td>88.9</td><td>83.3</td><td>96.7</td><td>91.4</td><td>76.6</td><td>91.7</td><td>63.8</td><td>53.1</td><td>79.4</td><td>63.3</td><td>84.5</td><td>33.2</td><td>51.2</td><td>77.6</td></tr><tr><td>ViT-L/16 (JFT)</td><td>95.4</td><td>81.9</td><td>74.3</td><td>99.7</td><td>96.7</td><td>63.5</td><td>87.4</td><td>83.6</td><td>96.5</td><td>89.7</td><td>77.1</td><td>86.4</td><td>63.1</td><td>49.7</td><td>74.5</td><td>60.5</td><td>82.2</td><td>36.2</td><td>51.1</td><td>76.3</td></tr><tr><td>ViT-L/16 (I21k)</td><td>90.8</td><td>84.1</td><td>74.1</td><td>99.3</td><td>92.7</td><td>61.0</td><td>80.9</td><td>82.5</td><td>95.6</td><td>85.2</td><td>75.3</td><td>70.3</td><td>56.1</td><td>41.9</td><td>74.7</td><td>64.9</td><td>79.9</td><td>30.5</td><td>41.7</td><td>72.7</td></tr></table>
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 13: Further example attention maps as in Figure 6 (random selection).
|
md/train/dBE8OI8_ZOa/dBE8OI8_ZOa.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dataset Distillation with Infinitely Wide Convolutional Networks
|
| 2 |
+
|
| 3 |
+
# Timothy Nguyen† ∗
|
| 4 |
+
|
| 5 |
+
Roman Novak♠
|
| 6 |
+
|
| 7 |
+
Lechao Xiao♠
|
| 8 |
+
|
| 9 |
+
DeepMind† Google Research, Brain Team♠ timothycnguyen@deepmind.com {romann, xlc, jaehlee}@google.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
The effectiveness of machine learning algorithms arises from being able to extract useful features from large amounts of data. As model and dataset sizes increase, dataset distillation methods that compress large datasets into significantly smaller yet highly performant ones will become valuable in terms of training efficiency and useful feature extraction. To that end, we apply a novel distributed kernel-based meta-learning framework to achieve state-of-the-art results for dataset distillation using infinitely wide convolutional neural networks. For instance, using only 10 datapoints $0 . 0 2 \%$ of original dataset), we obtain over $65 \%$ test accuracy on CIFAR10 image classification task, a dramatic improvement over the previous best test accuracy of $40 \%$ . Our state-of-the-art results extend across many other settings for MNIST, Fashion-MNIST, CIFAR-10, CIFAR-100, and SVHN. Furthermore, we perform some preliminary analyses of our distilled datasets to shed light on how they differ from naturally occurring data.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Deep learning has become extraordinarily successful in a wide variety of settings through the availability of large datasets [Krizhevsky et al., 2012, Devlin et al., 2018, Brown et al., 2020, Dosovitskiy et al., 2020]. Such large datasets enable a neural network to learn useful representations of the data that are adapted to solving tasks of interest. Unfortunately, it can be prohibitively costly to acquire such large datasets and train a neural network for the requisite amount of time.
|
| 18 |
+
|
| 19 |
+
One way to mitigate this problem is by constructing smaller datasets that are nevertheless informative. Some direct approaches to this include choosing a representative subset of the dataset (i.e. a coreset) or else performing a low-dimensional projection that reduces the number of features. However, such methods typically introduce a tradeoff between performance and dataset size, since what they produce is a coarse approximation of the full dataset. By contrast, the approach of dataset distillation is to synthesize datasets that are more informative than their natural counterparts when equalizing for dataset size [Wang et al., 2018, Bohdal et al., 2020, Nguyen et al., 2021, Zhao and Bilen, 2021]. Such resulting datasets will not arise from the distribution of natural images but will nevertheless capture features useful to a neural network, a capability which remains mysterious and is far from being well-understood [Ilyas et al., 2019, Huh et al., 2016, Hermann and Lampinen, 2020].
|
| 20 |
+
|
| 21 |
+
The applications of such smaller, distilled datasets are diverse. For nonparametric methods that scale poorly with the training dataset (e.g. nearest-neighbors or kernel-ridge regression), having a reduced dataset decreases the associated memory and inference costs. For the training of neural networks, such distilled datasets have found several applications in the literature, including increasing the effectiveness of replay methods in continual learning [Borsos et al., 2020] and helping to accelerate neural architecture search [Zhao et al., 2021, Zhao and Bilen, 2021].
|
| 22 |
+
|
| 23 |
+
In this paper, we perform a large-scale extension of the methods of Nguyen et al. [2021] to obtain new state-of-the-art (SOTA) dataset distillation results. Specifically, we apply the algorithms KIP (Kernel Inducing Points) and LS (Label Solve), first developed in Nguyen et al. [2021], to infinitely wide convolutional networks by implementing a novel, distributed meta-learning framework that draws upon hundreds of accelerators per training. The need for such resources is necessitated by the computational costs of using infinitely wide neural networks built out of components occurring in modern image classification models: convolutional and pooling layers (see $\ S$ for details). The consequence is that we obtain distilled datasets that are effective for both kernel ridge-regression and neural network training.
|
| 24 |
+
|
| 25 |
+
Additionally, we initiate a preliminary study of the images and labels which KIP learns. We provide a visual and quantitative analysis of the data learned and find some surprising results concerning their interpretability and their dimensional and spectral properties. Given the efficacy of KIP and LS learned data, we believe a better understanding of them would aid in the understanding of feature learning in neural networks.
|
| 26 |
+
|
| 27 |
+
To summarize, our contributions are as follows:
|
| 28 |
+
|
| 29 |
+
1. We achieve SOTA dataset distillation results on a wide variety of datasets (MNIST, FashionMNIST, SVHN, CIFAR-10, CIFAR-100) for both kernel ridge-regression and neural network training. In several instances, our results achieve an impressively wide margin over prior art, including over $2 5 \%$ and $37 \%$ absolute gain in accuracy on CIFAR-10 and SVHN image classification, respectively, when using only 10 images (Tables 1, 2, A11).
|
| 30 |
+
2. We develop a novel, distributed meta-learning framework specifically tailored to the computational burdens of sophisticated neural kernels (§2.1).
|
| 31 |
+
3. We highlight and analyze some of the peculiar features of the distilled datasets we obtain, illustrating how they differ from natural data (§4).
|
| 32 |
+
4. We open source the distilled datasets, which used thousands of GPU hours, for the research community to further investigate at https://github.com/google-research/ google-research/tree/master/kip.
|
| 33 |
+
|
| 34 |
+
# 2 Setup
|
| 35 |
+
|
| 36 |
+
Background on infinitely wide convolutional networks. Recent literature has established that Bayesian and gradient-descent trained neural networks converge to Gaussian Processes (GP) as the number of hidden units in intermediary layers approaches infinity (see $\ S 5$ ). These results hold for many different architectures, including convolutional networks, which converge to a particular GP in the limit of infinite channels [Novak et al., 2019, Garriga-Alonso et al., 2019, Arora et al., 2019]. Bayesian networks are described by the Neural Network Gaussian Process (NNGP) kernel, while gradient descent networks are described by the Neural Tangent Kernel (NTK). Since we are interested in synthesizing datasets that can be used with both kernel methods and common gradient-descent trained neural networks, we focus on NTK in this work.
|
| 37 |
+
|
| 38 |
+
Infinitely wide networks have been shown to achieve SOTA (among non-parametric kernels) results on image classification tasks [Novak et al., 2019, Arora et al., 2019, Li et al., 2019, Shankar et al., 2020, Bietti, 2021] and even rival finite-width networks in certain settings [Arora et al., 2020, Lee et al., 2020]. This makes such kernels especially suitable for our task. As convolutional models, they encode useful inductive biases of locality and translation invariance [Novak et al., 2019], which enable good generalization. Moreover, flexible and efficient computation of these kernels are possible due to the Neural Tangent library [Novak et al., 2020].
|
| 39 |
+
|
| 40 |
+
Specific models considered. The central neural network (and corresponding infinite-width model) we consider is a simple 4-layer convolutional network with average pooling layers that we refer to as ConvNet throughout the text. This architecture is a slightly modified version of the default model used by Zhao and Bilen [2021], Zhao et al. [2021] and was chosen for ease of baselining (see $\ S \mathrm { A }$ for details). In several other settings we also consider convolutional networks without pooling layers ConvVec,2 and networks with no convolutions and only fully-connected layers FC. Depth of architecture (as measured by number of hidden layers) is indicated by an integer suffix.
|
| 41 |
+
|
| 42 |
+
Background on algorithms. We review the Kernel Inducing Points (KIP) and Label Solve (LS) algorithms introduced by Nguyen et al. [2021]. Given a kernel $K$ , the kernel ridge-regression (KRR) loss function trained on a support dataset $( X _ { s } , y _ { s } )$ and evaluated on a target dataset $( X _ { t } , y _ { t } )$ is
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
L ( X _ { s } , y _ { s } ) = \frac { 1 } { 2 } \left\| y _ { t } - K _ { X _ { t } X _ { s } } ( K _ { X _ { s } X _ { s } } + \lambda I ) ^ { - 1 } y _ { s } \right\| _ { 2 } ^ { 2 } ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where if $U$ and $V$ are sets, $K _ { U V }$ is the matrix of kernel elements $( K ( u , v ) ) _ { u \in U , v \in V }$ . Here $\lambda > 0$ is a fixed regularization parameter. The KIP algorithm consists of minimizing (1) with respect to the support set (either just the $X _ { s }$ or along with the labels $y _ { s }$ ). Here, we sample $( X _ { t } , y _ { t } )$ from a target dataset $\mathcal { D }$ at every (meta)step, and update the support set using gradient-based methods. Additional variations include augmenting the $X _ { t }$ or sampling a different kernel $K$ (from a fixed family of kernels) at each step.
|
| 49 |
+
|
| 50 |
+
The Label Solve algorithm consists of solving for the least-norm minimizer of (1) with respect to $y _ { s }$ This yields the labels
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
y _ { s } ^ { * } = \Big ( K _ { X _ { t } X _ { s } } ( K _ { X _ { s } X _ { s } } + \lambda I ) ^ { - 1 } \Big ) ^ { + } y _ { t } ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $A ^ { + }$ denotes the pseudo-inverse of the matrix $A$ . Note that here $( X _ { t } , y _ { t } ) = \mathcal { D }$ , i.e. the labels are solved using the whole target set.
|
| 57 |
+
|
| 58 |
+
In our applications of KIP and Label Solve, the target dataset $\mathcal { D }$ is always significantly larger than the support set $( X _ { s } , y _ { s } )$ . Hence, the learned support set or solved labels can be regarded as distilled versions of their respective targets. We also initialize our support images to be a subset of natural images, though they could also be initialized randomly.
|
| 59 |
+
|
| 60 |
+
Based on the infinite-width correspondence outlined above and in $\ S 5$ , dataset distillation using KIP or LS that is optimized for KRR should extend to the corresponding finite-width neural network training. Our experimental results in $\ S 3$ validate this expectation across many settings.
|
| 61 |
+
|
| 62 |
+
# 2.1 Client-Server Distributed Workflow
|
| 63 |
+
|
| 64 |
+
We invoke a client-server model of distributed computation3, in which a server distributes independent workloads to a large pool of client workers that share a queue for receiving and sending work. Our distributed implementation of the KIP algorithm has two distinct stages:
|
| 65 |
+
|
| 66 |
+
Forward pass: In this step, we compute the support-support and target-support matrices $K ( X _ { s } , X _ { s } )$ and $K ( X _ { t } , X _ { s } )$ . To do so, we partition $X _ { s } \times X _ { s }$ and $X _ { t } \times X _ { s }$ into pairs of images $( x , x ^ { \prime } )$ , each with batch size $B$ . We send such pairs to workers compute the respective matrix block $K ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } )$ . The server aggregates all these blocks to obtain the $K ( \bar { X } _ { s } , X _ { s } )$ and $K ( X _ { t } , X _ { s } )$ matrices.
|
| 67 |
+
|
| 68 |
+
Backward pass: In this step, we need to compute the gradient of the loss $L$ (1) with respect to the support set $X _ { s }$ . We need only consider $\partial L / \partial { \bar { X } } _ { s }$ since $\partial L / \partial y _ { s }$ is cheap to compute. By the chain rule, we can write
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\frac { \partial L } { \partial X _ { s } } = \frac { \partial L } { \partial ( K ( X _ { s } , X _ { s } ) ) } \frac { \partial K ( X _ { s } , X _ { s } ) } { \partial X _ { s } } + \frac { \partial L } { \partial ( K ( X _ { t } , X _ { s } ) ) } \frac { \partial K ( X _ { t } , X _ { s } ) } { \partial X _ { s } } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
The derivatives of $L$ with respect to the kernel matrices are inexpensive, since $L$ depends in a simple way on them (matrix multiplication and inversion). What is expensive to compute is the derivative of the kernel matrices with respect to the inputs. Each kernel element is an independent function of the inputs and a naive computation of the derivative of a block would require forwardmode differentiation, infeasible due to the size of the input images and the cost to compute the individual kernel elements. Thus our main novelty is to divide up the gradient computation into backward differentiation sub-computations, specifically by using the built-in function ${ \mathrm { j a x . v j p } }$ in JAX [Bradbury et al., 2018]. Denoting $K = K \bar { ( } X _ { s } , X _ { s } )$ or $K ( X _ { t } , X _ { s } )$ for short-hand, we divide the matrix $\partial L / \partial K$ , computed on the server, into $B \times B$ blocks corresponding to $\partial L / \partial K ( x , x ^ { ' } )$ , where $x$ and $x ^ { \prime }$ each have batch size $B$ . We send each such block, along with the corresponding block of image data $( x , x ^ { \prime } )$ , to a worker. The worker then treats the $\partial L / \partial K ( x , x ^ { \prime } )$ it receives as the cotangent vector argument of ${ \mathrm { j a x . v j p } }$ that, via contraction, converts the derivative of $K ( x , x ^ { \prime } )$ with respect to $x$ into a scalar. The server aggregates all these partial gradient computations performed by the workers, over all possible $B \times B$ blocks, to compute the total gradient $\partial L / \partial X _ { s }$ used to update $X _ { s }$ .
|
| 75 |
+
|
| 76 |
+
Table 1: Comparison with other methods. The left group consists of neural network based methods. The right group consists of kernel ridge-regression. All settings for KIP involve the use of label-learning. Grayscale datasets use standard channel-wise preprocessing while RGB datasets use regularized ZCA preprocessing.
|
| 77 |
+
|
| 78 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Imgs/ Class</td><td rowspan="2">DC1</td><td rowspan="2">DSA1</td><td rowspan="2">KIP FC1 aug</td><td rowspan="2">LS ConvNet2,3</td><td colspan="2"> KIP ConvNet2</td></tr><tr><td>no aug</td><td>aug</td></tr><tr><td rowspan="3">MNIST</td><td>1</td><td>91.7±0.5</td><td>88.7±0.6</td><td>85.5±0.1</td><td>73.4</td><td>97.3±0.1</td><td>96.5±0.1</td></tr><tr><td>10</td><td>97.4±0.2</td><td>97.8±0.1</td><td>97.2±0.2</td><td>96.4</td><td>99.1±0.1</td><td>99.1±0.1</td></tr><tr><td>50</td><td>98.8±0.1</td><td>99.2±0.1</td><td>98.4±0.1</td><td>98.3</td><td>99.4±0.1</td><td>99.5±0.1</td></tr><tr><td rowspan="3">Fashion- MNIST</td><td>1</td><td>70.5±0.6</td><td>70.6±0.6</td><td></td><td>65.3</td><td>82.9±0.2</td><td>76.7±0.2</td></tr><tr><td>10</td><td>82.3±0.4</td><td>84.6±0.3</td><td></td><td>80.8</td><td>91.0±0.1</td><td>88.8±0.1</td></tr><tr><td>50</td><td>83.6±0.4</td><td>88.7±0.2</td><td></td><td>86.9</td><td>92.4±0.1</td><td>91.0±0.1</td></tr><tr><td rowspan="3">SVHN</td><td>1</td><td>31.2±1.4</td><td>27.5±1.4</td><td></td><td>23.9</td><td>62.4±0.2</td><td>64.3±0.4</td></tr><tr><td>10</td><td>76.1±0.6</td><td>79.2±0.5</td><td></td><td>52.8</td><td>79.3±0.1</td><td>81.1±0.5</td></tr><tr><td>50</td><td>82.3±0.3</td><td>84.4±0.4</td><td>■</td><td>76.8</td><td>82.0±0.1</td><td>84.3±0.1</td></tr><tr><td rowspan="3">CIFAR-10</td><td>1</td><td>28.3±0.5</td><td>28.8±0.7</td><td>40.5±0.4</td><td>26.1</td><td>64.7±0.2</td><td>63.4±0.1</td></tr><tr><td>10</td><td>44.9±0.5</td><td>52.1±0.5</td><td>53.1±0.5</td><td>53.6</td><td>75.6±0.2</td><td>75.5±0.1</td></tr><tr><td>50</td><td>53.9±0.5</td><td>60.6±0.5</td><td>58.6±0.4</td><td>65.9</td><td>78.2±0.2</td><td>80.6±0.1</td></tr><tr><td rowspan="2">CIFAR-100</td><td>1</td><td>12.8±0.3</td><td>13.9±0.3</td><td>-</td><td>23.8</td><td>34.9±0.1</td><td>33.3±0.3</td></tr><tr><td>10</td><td>25.2±0.3</td><td>32.3±0.3</td><td>=</td><td>39.2</td><td>47.9±0.2</td><td>49.5±0.3</td></tr></table>
|
| 79 |
+
|
| 80 |
+
1 DC [Zhao et al., 2021], DSA [Zhao and Bilen, 2021], KIP FC [Nguyen et al., 2021]. 2 Ours. 3 LD [Bohdal et al., 2020] is another baseline which distills only labels using the AlexNet architecture. Our LS achieves higher test accuracy than theirs in every dataset category.
|
| 81 |
+
|
| 82 |
+
# 3 Experimental Results
|
| 83 |
+
|
| 84 |
+
# 3.1 Kernel Distillation Results
|
| 85 |
+
|
| 86 |
+
We apply the KIP and LS algorithms using the ConvNet architecture on the datasets MNIST [LeCun et al., 2010], Fashion MNIST [Xiao et al., 2017], SVHN [Netzer et al., 2011], CIFAR-10 [Krizhevsky, 2009], and CIFAR-100. Here, the goal is to condense the train dataset down to a learned dataset of size 1, 10, or 50 images per class. We consider a variety of hyperparameter settings (image preprocessing method, whether to augment target data, and whether to train the support labels for KIP), the full details of which are described in $\ S \mathrm { A }$ . For space reasons, we show a subset of our results in Table 1, with results corresponding to the remaining set of hyperparameters left to Tables A3-A10. We highlight here that a crucial ingredient for our strong results in the RGB dataset setting is the use of regularized ZCA preprocessing. Note the variable effect that our augmentations have on performance (see the last two columns of Table 1): they typically only provides a benefit for a sufficiently large support set. This result is consistent with Zhao et al. [2021], Zhao and Bilen [2021], in which gains from augmentations are also generally obtained from larger support sets. We tried varying the fraction (0.25 and 0.5) of each target batch that is augmented at each training step and found that while 10 images still did best without augmentations, 100 and 500 images typically did slightly better with some partial augmentations (versus none or full). For instance, for 500 images on CIFAR-10, we obtained $8 1 . 1 \%$ test accuracy using augmentation rate 0.5. Thus, our observation is that given that larger support sets can distill larger target datasets, as the former increases in size, the latter can be augmented more aggressively for obtaining optimal generalization performance.
|
| 87 |
+
|
| 88 |
+

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

|
| 120 |
+
|
| 121 |
+

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

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

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

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

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

|
| 158 |
+
Figure 8: Spectral contribution to test accuracy shifts to the tail. By setting the ridge-parameter to zero in kernel-ridge regression and composing $K _ { X _ { s } X _ { s } } ^ { - 1 }$ with the spectral projection onto various eigenspaces, we can explore how different spectral bands affect test accuracy of kernel ridgeregression. We plot the relative change in test accuracy using contiguous bands of $20 \%$ of the eigenvalues. Settings: CIFAR-10, 500 images. Further details in $\ S$ .
|
| 159 |
+
|
| 160 |
+
Our use of kernels stems from the correspondence between infinitely-wide neural networks and kernel methods [Neal, 1994, Lee et al., 2018, Matthews et al., 2018, Jacot et al., 2018, Novak et al., 2019, Garriga-Alonso et al., 2019, Arora et al., 2019, Yang, 2019a,b, Hron et al., 2020] and the extended correspondence with the finite width corrections [Dyer and Gur-Ari, 2020, Huang and Yau, 2020, Yaida, 2020]. These correspondences underlie the transferability of our KRR results to neural networks , and have been utilized in understanding trainability [Xiao et al., 2020], generalizations [Adlam and Pennington, 2020], training dynamics [Lewkowycz et al., 2020, Lewkowycz and Gur-Ari, 2020], uncertainty [Adlam et al., 2021], and demonstrated their effectiveness for smaller datasets [Arora et al., 2020] and neural architecture search [Park et al., 2020, Chen et al., 2021].
|
| 161 |
+
|
| 162 |
+
# 6 Conclusion
|
| 163 |
+
|
| 164 |
+
We performed an extensive study of dataset distillation using the KIP and LS algorithms applied to convolutional architectures, obtaining SOTA results on a variety of image classification datasets. In some cases, our learned datasets were more effective than a natural dataset two orders of magnitude larger in size. There are many interesting followup directions and questions from our work:
|
| 165 |
+
|
| 166 |
+
First, integrating efficient kernel-approximation methods into our algorithms, such as those of Zandieh et al. [2021], will reduce computational burden and enable scaling up to larger datasets. In this direction, the understanding of how various resources (e.g. data, parameter count, compute) scale when optimizing for neural network performance has received significant attention as machine learning models continue to stretch computational limits [Hestness et al., 2017, Rosenfeld et al., 2020, Kaplan et al., 2020, Bahri et al., 2021]. Developing our understanding of how to harness smaller, yet more useful representations data would aid in such endeavors. In particular, it would be especially interesting to explore how well datasets can be compressed as they scale up in size.
|
| 167 |
+
|
| 168 |
+
Second, LS and KIP with label learning shows that optimizing labels is a very powerful tool for dataset distillation. The labels we obtain are quite far away from standard, interpretable labels and we feel their effectiveness suggests that understanding of how to optimally label data warrants further study.
|
| 169 |
+
|
| 170 |
+
Finally, the novel features obtained by our learned datasets, and those of dataset distillation methods in general, may reveal insights into interpretability and the nature of sample-efficient representations. For instance, observe the bee and bicycle images in Figure 5: the bee class distills into what appears to be spurious visual features (e.g. pollen), while the bicycle class distills to the essential contours of a typical bicycle. Additional analyses and explorations of this type could offer insights into the perennial question of how neural networks learn and generalize.
|
| 171 |
+
|
| 172 |
+
Acknowledgments We would like to acknowledge special thanks to Samuel S. Schoenholz, who proposed and helped develop the overall strategy for our distributed KIP learning methodology. We are also grateful to Ekin Dogus Cubuk and Manuel Kroiss for helpful discussions.
|
| 173 |
+
|
| 174 |
+
# References
|
| 175 |
+
|
| 176 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 177 |
+
|
| 178 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 179 |
+
|
| 180 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 181 |
+
|
| 182 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 183 |
+
|
| 184 |
+
Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros. Dataset distillation. arXiv preprint arXiv:1811.10959, 2018.
|
| 185 |
+
|
| 186 |
+
Ondrej Bohdal, Yongxin Yang, and Timothy Hospedales. Flexible dataset distillation: Learn labels instead of images. arXiv preprint arXiv:2006.08572, 2020.
|
| 187 |
+
|
| 188 |
+
Timothy Nguyen, Zhourong Chen, and Jaehoon Lee. Dataset meta-learning from kernel ridge-regression. In International Conference on Learning Representations, 2021.
|
| 189 |
+
|
| 190 |
+
Bo Zhao and Hakan Bilen. Dataset condensation with differentiable siamese augmentation. In International Conference on Machine Learning, 2021.
|
| 191 |
+
|
| 192 |
+
Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features, 2019.
|
| 193 |
+
|
| 194 |
+
Minyoung Huh, Pulkit Agrawal, and Alexei A Efros. What makes imagenet good for transfer learning? arXiv preprint arXiv:1608.08614, 2016.
|
| 195 |
+
|
| 196 |
+
Katherine L Hermann and Andrew K Lampinen. What shapes feature representations? exploring datasets, architectures, and training. arXiv preprint arXiv:2006.12433, 2020.
|
| 197 |
+
|
| 198 |
+
Zalán Borsos, Mojmír Mutny, and Andreas Krause. Coresets via bilevel optimization for continual learning and \` streaming. arXiv preprint arXiv:2006.03875, 2020.
|
| 199 |
+
|
| 200 |
+
Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. In International Conference on Learning Representations, 2021.
|
| 201 |
+
|
| 202 |
+
Roman Novak, Lechao Xiao, Jaehoon Lee, Yasaman Bahri, Greg Yang, Jiri Hron, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019.
|
| 203 |
+
|
| 204 |
+
Adrià Garriga-Alonso, Laurence Aitchison, and Carl Edward Rasmussen. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019.
|
| 205 |
+
|
| 206 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Russ R Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, pages 8141–8150. Curran Associates, Inc., 2019.
|
| 207 |
+
|
| 208 |
+
Zhiyuan Li, Ruosong Wang, Dingli Yu, Simon S Du, Wei Hu, Ruslan Salakhutdinov, and Sanjeev Arora. Enhanced convolutional neural tangent kernels. arXiv preprint arXiv:1911.00809, 2019.
|
| 209 |
+
|
| 210 |
+
Vaishaal Shankar, Alex Chengyu Fang, Wenshuo Guo, Sara Fridovich-Keil, Ludwig Schmidt, Jonathan RaganKelley, and Benjamin Recht. Neural kernels without tangents. In International Conference on Machine Learning, 2020.
|
| 211 |
+
|
| 212 |
+
Alberto Bietti. Approximation and learning with deep convolutional models: a kernel perspective. arXiv preprint arXiv:2102.10032, 2021.
|
| 213 |
+
|
| 214 |
+
Sanjeev Arora, Simon S. Du, Zhiyuan Li, Ruslan Salakhutdinov, Ruosong Wang, and Dingli Yu. Harnessing the power of infinitely wide deep nets on small-data tasks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=rkl8sJBYvH.
|
| 215 |
+
Jaehoon Lee, Samuel S Schoenholz, Jeffrey Pennington, Ben Adlam, Lechao Xiao, Roman Novak, and Jascha Sohl-Dickstein. Finite versus infinite neural networks: an empirical study. In Advances in Neural Information Processing Systems, 2020.
|
| 216 |
+
Roman Novak, Lechao Xiao, Jiri Hron, Jaehoon Lee, Alexander A. Alemi, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. In International Conference on Learning Representations, 2020. URL https://github.com/google/neural-tangents.
|
| 217 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: composable transformations of Python $^ +$ NumPy programs, 2018. URL http://github.com/google/jax.
|
| 218 |
+
Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010.
|
| 219 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
|
| 220 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 221 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 222 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, 2018.
|
| 223 |
+
Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in Neural Information Processing Systems, 2019.
|
| 224 |
+
Jiaoyang Huang and Horng-Tzer Yau. Dynamics of deep neural networks and neural tangent hierarchy. In International Conference on Machine Learning, 2020.
|
| 225 |
+
Ethan Dyer and Guy Gur-Ari. Asymptotics of wide networks from feynman diagrams. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\equiv$ S1gFvANKDS.
|
| 226 |
+
Anders Andreassen and Ethan Dyer. Asymptotics of wide convolutional neural networks. arxiv preprint arXiv:2008.08675, 2020.
|
| 227 |
+
Sho Yaida. Non-Gaussian processes and neural networks at finite widths. In Mathematical and Scientific Machine Learning Conference, 2020.
|
| 228 |
+
R. Bennett. The intrinsic dimensionality of signal collections. IEEE Transactions on Information Theory, 15(5): 517–525, 1969. doi: 10.1109/TIT.1969.1054365.
|
| 229 |
+
Francesco Camastra and Antonino Staiano. Intrinsic dimension estimation: Advances and open problems. Information Sciences, 328:26–41, 2016. ISSN 0020-0255. doi: https://doi.org/10.1016/j.ins.2015.08.029. URL https://www.sciencedirect.com/science/article/pii/S0020025515006179.
|
| 230 |
+
Elena Facco, Maria d’Errico, Alex Rodriguez, and Alessandro Laio. Estimating the intrinsic dimension of datasets by a minimal neighborhood information. Scientific reports, 7(1):1–8, 2017.
|
| 231 |
+
A. Ansuini, A. Laio, J. Macke, and D. Zoccolan. Intrinsic dimension of data representations in deep neural networks. In NeurIPS, 2019.
|
| 232 |
+
Ilia Sucholutsky and Matthias Schonlau. Soft-label dataset distillation and text dataset distillation. arXiv preprint arXiv:1910.02551, 2019.
|
| 233 |
+
Radford M. Neal. Priors for infinite networks (tech. rep. no. crg-tr-94-1). University of Toronto, 1994.
|
| 234 |
+
Jaehoon Lee, Yasaman Bahri, Roman Novak, Sam Schoenholz, Jeffrey Pennington, and Jascha Sohl-dickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018.
|
| 235 |
+
Alexander G. de G. Matthews, Jiri Hron, Mark Rowland, Richard E. Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. In International Conference on Learning Representations, 2018.
|
| 236 |
+
|
| 237 |
+
Greg Yang. Scaling limits of wide neural networks with weight sharing: Gaussian process behavior, gradient independence, and neural tangent kernel derivation. arXiv preprint arXiv:1902.04760, 2019a.
|
| 238 |
+
|
| 239 |
+
Greg Yang. Wide feedforward or recurrent neural networks of any architecture are gaussian processes. In Advances in Neural Information Processing Systems, 2019b.
|
| 240 |
+
|
| 241 |
+
Jiri Hron, Yasaman Bahri, Jascha Sohl-Dickstein, and Roman Novak. Infinite attention: NNGP and NTK for deep attention networks. In International Conference on Machine Learning, 2020.
|
| 242 |
+
|
| 243 |
+
Lechao Xiao, Jeffrey Pennington, and Samuel S Schoenholz. Disentangling trainability and generalization in deep learning. In International Conference on Machine Learning, 2020.
|
| 244 |
+
|
| 245 |
+
Ben Adlam and Jeffrey Pennington. The neural tangent kernel in high dimensions: Triple descent and a multi-scale theory of generalization. In International Conference on Machine Learning, pages 74–84. PMLR, 2020.
|
| 246 |
+
|
| 247 |
+
Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. arXiv preprint arXiv:2003.02218, 2020.
|
| 248 |
+
|
| 249 |
+
Aitor Lewkowycz and Guy Gur-Ari. On the training dynamics of deep networks with l_2 regularization. In Advances in Neural Information Processing Systems, volume 33, pages 4790–4799, 2020.
|
| 250 |
+
|
| 251 |
+
Ben Adlam, Jaehoon Lee, Lechao Xiao, Jeffrey Pennington, and Jasper Snoek. Exploring the uncertainty properties of neural networks’ implicit priors in the infinite-width limit. In International Conference on Learning Representations, 2021.
|
| 252 |
+
|
| 253 |
+
Daniel S Park, Jaehoon Lee, Daiyi Peng, Yuan Cao, and Jascha Sohl-Dickstein. Towards nngp-guided neural architecture search. arXiv preprint arXiv:2011.06006, 2020.
|
| 254 |
+
|
| 255 |
+
Wuyang Chen, Xinyu Gong, and Zhangyang Wang. Neural architecture search on imagenet in four $\{ { \mathrm { g p u } } \}$ hours: A theoretically inspired perspective. In International Conference on Learning Representations, 2021.
|
| 256 |
+
|
| 257 |
+
Amir Zandieh, Insu Han, Haim Avron, Neta Shoham, Chaewon Kim, and Jinwoo Shin. Scaling neural tangent kernels via sketching and random features. In Advances in Neural Information Processing Systems, 2021.
|
| 258 |
+
|
| 259 |
+
Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory F. Diamos, Heewoo Jun, Hassan Kianinejad, Md. Mostofa Ali Patwary, Yang Yang, and Yanqi Zhou. Deep learning scaling is predictable, empirically. CoRR, abs/1712.00409, 2017. URL http://arxiv.org/abs/1712.00409.
|
| 260 |
+
|
| 261 |
+
Jonathan S. Rosenfeld, Amir Rosenfeld, Yonatan Belinkov, and Nir Shavit. A constructive prediction of the generalization error across scales. In International Conference on Learning Representations, 2020.
|
| 262 |
+
|
| 263 |
+
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models, 2020.
|
| 264 |
+
|
| 265 |
+
Yasaman Bahri, Ethan Dyer, Jared Kaplan, Jaehoon Lee, and Utkarsh Sharma. Explaining neural scaling laws. arXiv preprint arXiv:2102.06701, 2021.
|
| 266 |
+
|
| 267 |
+
Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 268 |
+
|
| 269 |
+
Jascha Sohl-Dickstein, Roman Novak, Samuel S Schoenholz, and Jaehoon Lee. On the infinite width limit of neural networks with a standard parameterization. arXiv preprint arXiv:2001.07301, 2020.
|
md/train/m1CD7tPubNy/m1CD7tPubNy.md
ADDED
|
@@ -0,0 +1,692 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MIND THE PAD – CNNS CAN DEVELOP BLIND SPOTS
|
| 2 |
+
|
| 3 |
+
Bilal Alsallakh Facebook AI
|
| 4 |
+
|
| 5 |
+
Narine Kokhlikyan Facebook AI
|
| 6 |
+
|
| 7 |
+
Vivek Miglani Facebook AI
|
| 8 |
+
|
| 9 |
+
Jun Yuan NYU
|
| 10 |
+
|
| 11 |
+
Orion Reblitz-Richardson Facebook AI
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We show how feature maps in convolutional networks are susceptible to spatial bias. Due to a combination of architectural choices, the activation at certain locations is systematically elevated or weakened. The major source of this bias is the padding mechanism. Depending on several aspects of convolution arithmetic, this mechanism can apply the padding unevenly, leading to asymmetries in the learned weights. We demonstrate how such bias can be detrimental to certain tasks such as small object detection: the activation is suppressed if the stimulus lies in the impacted area, leading to blind spots and misdetection. We propose solutions to mitigate spatial bias and demonstrate how they can improve model accuracy.
|
| 16 |
+
|
| 17 |
+
# 1 MOTIVATION
|
| 18 |
+
|
| 19 |
+
Convolutional neural networks (CNNs) serve as feature extractors for a wide variety of machinelearning tasks. Little attention has been paid to the spatial distribution of activation in the feature maps a CNN computes. Our interest in analyzing this distribution is triggered by mysterious failure cases of a traffic light detector: The detector successfully detects a small but visible traffic light in a road scene. However, it fails completely in detecting the same traffic light in the next frame captured by the ego-vehicle. The major difference between both frames is a limited shift along the vertical dimension as the vehicle moves forward. Therefore, the drastic difference in object detection is surprising given that CNNs are often assumed to have a high degree of translation invariance [8; 17].
|
| 20 |
+
|
| 21 |
+
The spatial distribution of activation in feature maps varies with the input. Nevertheless, by closely examining this distribution for a large number of samples, we found consistent patterns among them, often in the form of artifacts that do not resemble any input features. This work aims to analyze the root cause of such artifacts and their impact on CNNs. We show that these artifacts are responsible for the mysterious failure cases mentioned earlier, as they can induce ‘blind spots’ for the object detection head. Our contributions are:
|
| 22 |
+
|
| 23 |
+
• Demonstrating how the padding mechanism can induce spatial bias in CNNs (Section 2).
|
| 24 |
+
• Demonstrating how spatial bias can impair downstream tasks (Section 3).
|
| 25 |
+
• Identifying uneven application of 0-padding as a resolvable source of bias (Section 5).
|
| 26 |
+
Relating the padding mechanism with the foveation behavior of CNNs (Section 6).
|
| 27 |
+
• Providing recommendations to mitigate spatial bias and demonstrating how this can prevent blind spots and boost model accuracy.
|
| 28 |
+
|
| 29 |
+
# 2 THE EMERGENCE OF SPATIAL BIAS IN CNNS
|
| 30 |
+
|
| 31 |
+
Our aim is to determine to which extent activation magnitude in CNN feature maps is influenced by location. We demonstrate our analysis on a publicly-available traffic-light detection model $\pmb { \mathbb { B } } \pmb { \ 6 } \|$ . This model implements the SSD architecture $\left[ \left[ 2 6 \right] \right]$ in TensorFlow $\mathbb { I I }$ , using MobileNet-v1 $\mathbb { \lVert \lambda \rVert }$ as a feature extractor. The model is trained on the BSTLD dataset $\pmb { \Vert 4 \Vert }$ which annotates traffic lights in road scenes. Figure $\bigstar$ shows two example scenes from the dataset. For each scene, we show two feature maps computed by two filters in the $1 1 ^ { \mathrm { t h } }$ convolutional layer. This layer contains 512 filters whose feature maps are used directly by the first box predictor in the SSD to detect small objects.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Averaging feature maps per input (column marginal) and per filter (row marginal) in the last convolutional layer of a traffic light detector. Color indicates activation strength (the brighter, the higher), revealing line artifacts in the maps. These artifacts are the manifestation of spatial bias.
|
| 35 |
+
|
| 36 |
+
The bottom row in Figure $\bigstar$ shows the average response of each of the two aforementioned filters, computed over the test set in BSTLD. The first filter seems to respond mainly to features in the top half of the input, while the second filter responds mainly to street areas. There are visible lines in the two average maps that do not seem to resemble any scene features and are consistently present in the individual feature maps. We analyzed the prevalence of these line artifacts in the feature maps of all 512 filters. The right column in Figure $\bigstar$ shows the average of these maps per scene, as well as over the entire test set (see supplemental for all 512 maps). The artifacts are largely visible in the average maps, with variations per scene depending on which individual maps are dominant.
|
| 37 |
+
|
| 38 |
+
A useful way to make the artifacts stand out is to neutralize scene features by computing the feature maps for a zero-valued input. Figure $2$ depicts the resulting average map for each convolutional layer after applying ReLU units. The first average map is constant as we expect with a 0-valued input. The second map is also constant except for a 1-pixel boundary where the value is lower at the left border and higher at the other three borders. We magnify the corners to make these deviations visible. The border deviations increase in thickness and in variance at subsequent layers, creating multiple line artifacts at each border. These artifacts become quite pronounced at ReLU 8 where they start to propagate inwards, resembling the ones in Figure 1.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: Activation maps for a 0 input, averaged over each layer’s filters (title format: $\mathrm { H } { \times } \mathrm { W } { \times } \mathrm { C } )$
|
| 42 |
+
|
| 43 |
+
It is evident that the 1-pixel border variations in the second map are caused by the padding mechanism in use. This mechanism pads the output of the previous layer with a 1-pixel 0-valued border in order to maintain the size of the feature map after applying $3 { \tt X } 3$ convolutional. The maps in the first layer are not impacted because the input we feed is zero valued. Subsequent layers, however, are increasingly impacted by the padding, as preceding bias terms do not warrant 0-valued input.
|
| 44 |
+
|
| 45 |
+
It is noticeable in Figure 2 that the artifacts caused by the padding differ across the four borders. To investigate this asymmetry, we analyze the convolutional kernels (often called filters) that produce the feature maps. Figure 3 depicts a per-layer mean of these $3 { \tt X } 3$ kernels. These mean kernels exhibit different degrees of asymmetry in the spatial distribution of their weights. For example, the kernels in L1 assign (on average) a negative weight at the left border, and a positive weight at the bottom. This directly impacts the padding-induced variation at each border. Such asymmetries are related to uneven application of padding as we explain in Section 5.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 3: Mean kernel per convolutional layer. All kernels are $3 \times 3$ , the titles show their counts.
|
| 49 |
+
|
| 50 |
+
# 3 IMPLICATIONS OF SPATIAL BIAS
|
| 51 |
+
|
| 52 |
+
We demonstrate how feature-map artifacts can cause blind spots for the SSD model. Similar issues arise in several small-object detectors, e.g., for faces and masks, as well as in pixel-oriented tasks such as semantic segmentation and image inpainting (see supplemental for examples).
|
| 53 |
+
|
| 54 |
+
Figure $\sharp$ illustrates how the SSD predicts small objects based on the feature maps of the 11-th convolutional layer. The SSD uses the pixel positions in these maps as anchors of object proposals. Each proposal is scored by the SSD to represent a target category, with ”background“ being an implicit category that is crucial to exclude irrelevant parts of the input. In addition to these scores, the SSD computes a bounding box to localize the predicted object at each anchor. We examine object proposals computed at 1:2 aspect ratio, as they resemble the shape of most traffic lights in the dataset. We visualize the resulting score maps both for the background category and for traffic lights, when feeding a 0-valued input to the SSD. We also visualize the bounding boxes of these proposals in the image space. The SSD predicts the image content to be of background category at all anchor locations, as evident from the value range in both score maps. Such predictions are expected with an input that contains no traffic lights. However, the line artifacts in the feature maps have a strong impact on the score maps. These artifacts elevate the likelihood of anchors closer to the top to be classified as background (see the yellow band in the background score map). Conversely, these anchors have significantly lower scores for the traffic light category, compared with other anchors in the feature map. Such difference in the impact on the target categories is due to the different weights the SSD assigns to the feature maps for each target. As a result, the artifacts lead to potential blind spots in which the scores for certain categories are artificially muted.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 4: The formation of blind spots in SSD, illustrated via its box predictor internals with a zero-valued input. The predictor uses spatial anchors to detect and localize the target object at $4 5 \times 8 0$ possible locations based on 512 feature maps. Certain anchors are predisposed to predict background due to feature-map artifacts, as evident in the logit maps. Traffic lights at the corresponding location cannot be detected as demonstrated with a real scene (middle one in the bottom).
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 5: (a) A map showing via color the detection score the SSD computes for a traffic light when present at various locations. The detection is muted when the stimulus lies in the area impacted by the artifacts. (b) The same map after changing the padding method to SYMMETRIC. The detection scores are rather constant except for periodic variations due to the SSD’s reliance on anchors.
|
| 61 |
+
|
| 62 |
+
To validate whether or not the blind spots hinder object detection, we examine road scenes that contain highly-visible traffic light instances in the impacted area. Figure 4-bottom shows an example of such a scene. The SSD computes a low detection score of $7 \%$ when the traffic light lies in the blind spot (see middle image), far below the detection false-positive cutoff. Shifting the scene image upwards or downwards makes the instance detectable with a high score as long as it lies outside the blind spot. This explains the failure cases mentioned in Section $\mathbf { \overline { { \mathbb { D } } } }$ To further validate this effect, we run the SSD on baseline images that each contains one traffic light instance at a specific location in the input. We store the detection score for each instance. Figure 5a depicts the computed scores in a 2D map. It is evident that the model fails to detect the traffic light instance exactly when it is located within the “blind spot” band. The artifacts further disrupt the localization of the objects as evident in the top-right plot in Figure 4 which shows per-anchor object proposals computed for a 0 input.
|
| 63 |
+
|
| 64 |
+
# 4 REMINDER: WHY IS PADDING NEEDED IN CNNS?
|
| 65 |
+
|
| 66 |
+
# Padding is applied at most convolutional layers in CNNs to serve two fundamental purposes:
|
| 67 |
+
|
| 68 |
+
Maintaining feature map size A padding that satisfies this property is often described as SAME or HALF padding. FULL padding expands the maps by kernel size - 1 along each dimension. VALID padding performs no padding, eroding the maps by the same amount. SAME padding is important to (1) design deep networks that can handle arbitrary input size (a challenge in the presence of gradual erosion), (2) maintain the aspect ratio of non-square input, and (3) concatenate feature maps from different layers as in Inception [39] and ResNet $\mathbf { \bar { \rho } }$ models.
|
| 69 |
+
|
| 70 |
+
Reducing information bias against the boundary Consider a $3 \times 3$ kernel applied to a 2D input. An input location at least 2 pixels away from the boundary contributes to nine local convolution operations when computing the feature map. On the other hand, the corner is involved only one time under VALID padding, four times under a 1-pixel SAME 0-padding, and nine times under a 2-pixel FULL 0-padding. With SAME 0-padding, the cumulative contribution differences among the input pixels grow exponentially over the CNN layers. We refer to such uneven treatment of input pixels as the foveation behavior of the padding mechanism and elaborate on this in Section 6.
|
| 71 |
+
|
| 72 |
+
We next explore solutions to the issues that cause padding to induce spatial bias.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 6: (a) Illustrating the problem of uneven padding when down-sampling at a stride of 2. The padding along x-axis is consumed only at the left side. (b) Mean $3 \times 3$ filters in three ResNet models, trained on ImageNet with two input sizes. Color encodes average weight (green is positive). A size that induces uneven padding (top row) can lead to asymmetries, esp. around down-sampling layers. These asymmetries are mitigated when the input size induces no uneven padding (bottom row).
|
| 76 |
+
|
| 77 |
+
# 5 ELIMINATING UNEVEN APPLICATION OF PADDING
|
| 78 |
+
|
| 79 |
+
While useful to reduce bias against the boundary, applying padding at down-sampling layers can lead to asymmetry in CNN internals. Figure $6 \mathrm { a }$ illustrates the source of this asymmetry when strided convolution is used for downsampling: At one side of the feature map, the padding is consumed by the kernel while at the other side it is not. To warrant even application of padding throughout the CNN, the following must hold at all $d$ down-sampling layers, where $( h _ { i } , w _ { i } )$ is the output shape at the i-th layer with $\overline { { k } } _ { i } ^ { h } \times k _ { i } ^ { w }$ as kernel size, $( s _ { i } ^ { h } , s _ { i } ^ { w } )$ as strides, and $\mathbf { \Sigma } = ( p _ { i } ^ { h } , p _ { i } ^ { w } )$ as padding amount (refer to appendix $\boxed { \mathrm { A } }$ for a proof):
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\forall i \in \{ 1 , \ldots , d \} : h _ { i - 1 } = s _ { i } ^ { h } \cdot ( h _ { i } - 1 ) + k _ { i } ^ { h } - 2 \cdot p _ { i } ^ { h } \quad \wedge \quad w _ { i - 1 } = s _ { i } ^ { w } \cdot ( w _ { i } - 1 ) + k _ { i } ^ { w } - 2 \cdot p _ { i } ^ { w } \quad .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
The values $h _ { 0 }$ and $w _ { 0 }$ represent the CNN input dimensions. The above constraints are not always satisfied during training or inference with arbitrary input dimensions. For example, ImageNet classifiers based on ResNet $\pmb { \mathbb { I } } \pmb { \mathcal { 2 } } \Vert$ and MobileNet $\pmb { \mathbb { I } } \pmb { \overbrace { 3 } } \|$ contain five down-sampling layers $\mathit { a } = 5$ ) that apply 1-pixel 0-padding before performing 2-strided convolution. To avoid uneven application of padding, the input to these CNNs must satisfy the following, as explained in appendix A:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
h _ { 0 } = a _ { 1 } \times 2 ^ { d } + 1 = 3 2 \cdot a _ { 1 } + 1 \quad \mathrm { a n d } \quad w _ { 0 } = a _ { 2 } \times 2 ^ { d } + 1 = 3 2 \cdot a _ { 2 } + 1 \quad \mathrm { w h e r e } \quad a _ { 1 } , a _ { 2 } \in \mathbb { N } ^ { + }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
The traditional $\bigstar$ and prevalent input size for training ImageNet models is $2 2 4 \times 2 2 4$ . This size violates Eq. 2, leading to uneven padding at every down-sampling layer in ResNet and MobileNet models where 0-padding is effectively applied only at the left and top sides of layer input. This over-represents zeros at the top and left sides of $3 \times 3$ feature-map patches the filters are convolved with during training. The top row of Figure $6 { \mathsf { b } }$ shows per-layer mean filters in three ResNet models in PyTorch $\mathbb { \lVert 3 3 \rVert }$ , pre-trained on ImageNet with $2 2 4 \times 2 2 4$ images. In all of these models, a few of the mean filters, adjacent to down-sampling layers, exhibit stark asymmetry about their centers.
|
| 92 |
+
|
| 93 |
+
We increase the image size to $2 2 5 \times 2 2 5$ without introducing additional image information2. This size satisfies Eq. 2, warranting even application of padding at every downsampling layer in the above models. Retraining the models with this size strongly reduces this asymmetry as evident in the bottom row of Figure $\bar { 6 } 6$ . This, in turn, visibly boosts the accuracy in all models we experimented with as we report in Table 1. The accuracy did not improve further when we retrained two of the models, ResNet-18 and ResNet-34, on $2 2 6 \times 2 2 6$ images. This provides evidence that the boost is due to eliminating uneven padding and not merely due to increasing the input size.
|
| 94 |
+
|
| 95 |
+
Replacing 0-padding with a padding method that reuses feature map values can alleviate the asymmetry in the learned filters in the presence of unevenly applied padding. Another possibility is to use a rigid downsampling kernel, such as max-pooling, instead of a learned one. Appendix $\boxed { \dot { \mathbf { C } } }$ demonstrates both possibilities. Finally, antialiasing before downsampling $\mathbb { \lVert \boldsymbol { 4 3 } \rVert }$ can strongly reduce the asymmetry as we elaborate in Section 8 and in Appendix E.
|
| 96 |
+
|
| 97 |
+
Table 1: Top-1 (and top-5) accuracy of five ImageNet classifiers trained with different input sizes.
|
| 98 |
+
|
| 99 |
+
<table><tr><td>Input Size ²</td><td>MobileNet</td><td>ResNet-18</td><td>ResNet-34</td><td>ResNet-50</td><td>ResNet-101</td></tr><tr><td>224×224</td><td>68.19 (88.44)</td><td>69.93 (89.22)</td><td>73.30 (91.42)</td><td>75.65 (92.47)</td><td>77.37 (93.56)</td></tr><tr><td>225×225</td><td>68.80 (88.78)</td><td>70.27 (89.52)</td><td>73.72 (91.58)</td><td>76.01 (92.90)</td><td>77.67 (93.81)</td></tr></table>
|
| 100 |
+
|
| 101 |
+
Even when no padding is applied $( p _ { i } ^ { h } = 0$ or $p _ { i } ^ { w } = 0 ,$ ), an input size that does no satisfy Eq. 1 can lead to uneven erosion of feature maps, in turn, reducing the contribution of pixels from the impacted sides $( { \mathrm { F i g ~ } } 7 { \mathrm { \rho } }$ . Satisfying $\mathrm { E q } \ 1$ imposes a restriction on input size, e.g., to values in increments of $2 ^ { d } = 3 2$ with the above models ${ \mathrm { 1 9 3 \times 1 9 3 } }$ , $2 2 5 \times 2 2 5$ , $2 5 7 \times 2 5 7$ , ...). Depending on the application domain, this can be guaranteed either by resizing an input to the closest increment, or by padding it accordingly with suited values.
|
| 102 |
+
|
| 103 |
+
# 6 PADDING MECHANISM AND FOVEATION
|
| 104 |
+
|
| 105 |
+
By foveation we mean the unequal involvement of input pixels in convolutional operations throughout the CNN. Padding plays a fundamental role in the foveation behavior of CNNs. We visualize this behavior by means of a foveation map that counts for each input pixel the number of convolutional paths through which it can propagate information to the CNN output. We obtain these counts by computing the effective receptive field $\pmb { \pmb { 2 8 } }$ for the sum of the final convolutional layer after assigning all weights in the network to 1 (code in supplemental). Neutralizing the weights is essential to obtain per-pixel counts of input-output paths that reflect the foveation behavior.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 7: Foveation behavior of different padding methods applied to VGG-19 [37], and illustrated in a $5 1 2 \times 5 1 2$ input space (unless otherwise stated). Color represents the number of paths to the output for each input pixel. (a) The difference between VALID, FULL, and SAME 0-padding. (b) SAME alternatives to 0-padding. (c) Dilation amplifies foveation of SAME 0-padding. (d) Strides can lead to checkerboard patterns. (e) Foveation effects are more extensive in smaller inputs (relative to input size) and are sensitive to uneven padding.
|
| 109 |
+
|
| 110 |
+
Figure $7 \mathrm { a }$ shows the extensive foveation effect when no padding is applied. The diminishing contribution of vast areas of the input explains the drastic drop in accuracy recently observed under VALID padding $\mathbb { \lVert \boldsymbol { 1 6 } \rVert }$ . In contrast, FULL 0-padding does not incur foveation, however, at the cost of increasing the output size after each layer, making it impractical as explained in Section $\mathbb { H }$ SAME 0-padding incurs moderate foveation at the periphery, whose absolute extent depends on the number of convolutional layers and their filter sizes. Its relative extent depends on the input size: the larger the input, the larger the ratio of the constant area in yellow (refer to appendix B for a detailed example).
|
| 111 |
+
|
| 112 |
+
Figure 7b shows the foveation behavior of alternatives to SAME 0-padding that have roots in wavelet analysis [19] and image processing $ { \mathbb { E } } { \ b { \mathbb { Z } } } ] $ . Mirror padding mirrors pixels at the boundary to fill the padding area. When the border is included (SYMMETRIC mode in TensorFlow) all input pixels have an equal number of input-output paths 3, resulting in a uniform foveation map. When the border is not included (REFLECT mode both in PyTorch and in TensorFlow), the map exhibits bias against the border and towards a contour in its proximity. This bias is amplified over multiple layers. Replication padding exhibits the opposite bias when the padding area is wider than 1 pixel. This is because it replicates the outer 1-pixel border multiple times to fill this area 3. The method is equivalent to SYMMETRIC if the padding area is 1-pixel wide. Circular padding wraps opposing borders, enabling the kernels to seamlessly operate on the boundary and resulting in a uniform map. Partial Convolution $\lVert 2 2 \rVert$ has been proposed as a padding method that treats pixels outside the original image as missing values and rescales the computed convolutions accordingly $\mathbb { \left[ \left. 2 3 \right] \right. }$ . Its foveation behavior resembles reflective padding 3. Distribution padding $\pmb { \mathbb { B } } 0 \|$ resizes the input to fill the padding area around the original feature map, aiming at preserving the distribution of the map. Its foveation map is largely uniform, except for the corners and edges.
|
| 113 |
+
|
| 114 |
+
Impact of input size Besides influencing the relative extent of foveation effects, the input size also determines the presence of uneven padding (or uneven feature-map erosion), as we discussed in Section 5. Figure $\textcircled { 7 } \textcircled { \times }$ shows the foveation map for VGG-19 with a $1 2 7 \times 1 2 7$ input. This input violates Eq. 1 at every downsampling layer (appendix $\mathbf { A } )$ , leading to successive feature map erosion at the bottom and right sides which is reflected in the foveation map (see appendix B for a detailed example). The bottom-right part of the input is hence less involved in the CNN computations.
|
| 115 |
+
|
| 116 |
+
Impact of dilation We assign a dilation factor of 2 to all VGG-19 convolutional layers. While this exponentially increases the receptive field of the neurons at deeper layers $\pm 2 \|$ , dilation doubles the extent of the non-uniform peripheral areas that emerge with SAME 0-padding as evident in Figure $\textcircled { 7 } \textcircled { < }$ SYMMETRIC and circular padding maintain uniform foveation maps regardless of dilation 3. In contrast, dilation increases the complexity of these maps for REFLECT and replication padding.
|
| 117 |
+
|
| 118 |
+
Impact of strides Whether learned on based on pooling, downsampling layers can amplify the impact of succeeding convolutional layers on foveation behaviour. Furthermore, these layers can cause input pixels to vary in the count of their input-output paths. This can happen when the kernel size is not divisible by the stride, leading to a checkerboard pattern in the foveation maps. This manifests in ResNet models as we illustrate in appendix B. In VGG-19, all max-pooling layers use a stride of 2 and kernel size of 2. Changing the kernel size to 3 leads to a checkerboard pattern as evident in Figure 7d. Such effects were shown to impact pixel-oriented tasks $\mathbb { B } 2 \mathbb { I }$ .
|
| 119 |
+
|
| 120 |
+
The padding technique and its foveation behaviour have direct impact on feature-map artifacts (Section $\bar { 7 } )$ , and on the ability of CNNs to encode spatial information (Section $^ { 8 ) }$ . Understanding the foveation behavior is key to determine how suited a padding method is for a given task. For example, small object detection is known to be challenging close to the boundary $\left[ \left[ 2 6 \right] \right]$ , in part due to the foveation behavior of SAME 0-padding. In Figure $\bar { 5 } 6$ , we change the padding method in the SSD to SYMMETRIC. The stimulus is noticeably more detectable at the boundary, compared with 0-padding $^ 4 \cdot$ In contrast, ImageNet classification is less sensitive to foveation effects because the target objects are mostly located away from the periphery. Nevertheless, the padding method was shown to impact classification accuracy $\mathbb { \left[ \left. 2 3 \right] \right. }$ because it still affects feature map artifacts.
|
| 121 |
+
|
| 122 |
+
# 7 PADDING METHODS AND FEATURE MAP ARTIFACTS
|
| 123 |
+
|
| 124 |
+
It is also noticeable that the score map in Figure $5 \mathsf { b }$ is more uniform than in Figure $\textcircled { 5 } \textcircled { \times }$ . In particular, under SYMMETRIC padding the model is able to detect traffic lights placed in the blind spots of the original 0-padded model. To verify whether the line artifacts in Figure $\bigstar$ are mitigated, we inspect the mean feature maps of the adapted model. With a constant input, SYMMETRIC padding warrants constant maps throughout the CNN because it reuses the border to fill the padding area. Instead, we average these maps over 30 samples generated uniformly at random. Figure 8 depicts the mean maps which are largely uniform, unlike the case with 0-padding.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 8: The same feature maps in Figure 2, generated under mirror padding and averaged over 30 randomly-generated input samples. The line artifacts induced by 0-padding are largely mitigated.
|
| 128 |
+
|
| 129 |
+
To further analyze the impact of SYMMETRIC padding, we retrain the adapted model following the original training protocol. This significantly improves the average precision (AP) as reported in Table $2$ under different overlap thresholds (matching IoU), confirming that small object detection is particularly sensitive to feature-map artifacts.
|
| 130 |
+
|
| 131 |
+
Table 2: Performance of the SSD traffic light detector, trained under two different padding schemes.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Average Precision (AP)</td><td>AP@.20I0U</td><td>AP@ .50I0U</td><td>AP@.75I0U</td><td>AP@.90I0U</td></tr><tr><td>Zero Padding</td><td>80.24%</td><td>49.58%</td><td>3.7%</td><td>0.007%</td></tr><tr><td>Mirror Padding</td><td>83.20%</td><td>57%</td><td>8.44%</td><td>0.02%</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Of the padding methods listed in Section $6 ,$ mirror padding in both SYMMETRIC and REFLECT modes, PartialConv, and circular padding are generally effective at reducing feature map artifacts that emerge under zero padding, in particular salient line patterns. In contrast, distribution padding can induce significant artifacts. Refer to appendix D for comparative examples of artifacts under the aforementioned padding schemes.
|
| 136 |
+
|
| 137 |
+
Artifact magnitude and propagation While feature-map artifacts are induced by the padding mechanism at the boundary, their magnitude and inward propagation in the maps are impacted by several architectural aspects of CNNs. In particular, certain normalization schemes such as batchnorm [15] tend to limit the range of variation within a feature map and to relatively harmonize this range across different maps. This, in turn, impacts how possible artifacts in these maps accumulate when they are processed by the next convolutional layer. Similarly, artifacts that manifest after applying ReLU units are of a positive sign. These factors were instrumental in the formation of potential blind spots described in Section 3. We hence recommend to involve non-convolutional layers when inspecting the feature maps. Besides having possible impact on artifact magnitude, several aspects of convolution arithmetic, such as filter size and dilation factors, can also impact the spatial propagation of these artifacts.
|
| 138 |
+
|
| 139 |
+
# 8 RELATED FINDINGS AND TAKEAWAYS
|
| 140 |
+
|
| 141 |
+
Handling the boundary is an inherent challenge when dealing with spatial data [9]. Mean padding is known to cause visual artifacts in traditional image processing, with alternative methods proposed to mitigate them $\mathbb { \lVert 2 4 \rVert }$ . CNNs have been often assumed to deal with such effects implicitly. Innamorati et al $\dot { [ \lVert { 4 } \rVert }$ propose learning separate sets of filters dedicated to the boundaries to avoid impacting the weights learned by regular filters. A grouped padding strategy, proposed to support $2 \times 2$ filters $\mathbf { \bar { \textmu } }$ , offers avenues to mitigate uneven padding and corresponding skewness in foveation maps without restrictions on input size (see our note in appendix $\mathbf { B }$ for explanation). Finally, insights from signal and image processing [10; 11] could inspire further CNN padding schemes.
|
| 142 |
+
|
| 143 |
+
Zero padding has been recently linked to CNNs’ ability to encode position information [7; 16; 18; 29]. In contrast, circular padding was shown to limit this ability $\mathbb { \left[ \bigcirc \right] }$ and to boost shift invariance $\begin{array} { r l } { { \bigl \| \overline { { 3 5 } } \bigr \| } } & { { } } \end{array}$ . The input sizes in those studies do induce uneven padding. This can be, in part, the underlying mechanism behind the aforementioned ability. Whether or not this ability is desirable depends on the task, with several methods proposed to explicitly encode spatial information [5; 6; 20; 25; 29; 31].
|
| 144 |
+
|
| 145 |
+
Downsampling using max-pooling or strided convolution has been shown to impact shift invariance in CNNs by incurring aliasing effects [3; 38; 43]. These effects can manifest in the same symptoms we reported in Section $^ { 1 , }$ albeit for a different reason. Zhang [43] demonstrated how blurring the feature maps before subsampling mitigates aliasing effects and improves ImageNet classification accuracy of various popular CNNs. We analyzed the mean filters in antialiased MobileNet and ResNet models pre-trained on ImageNet under 0-padding, with $2 2 4 \times 2 2 4$ as input size (refer to Appendix $\mathrm { E } )$ . We found that antialiasing can also mitigate the asymmetry of mean filters that exhibited high asymmetry in the baseline models, especially at deeper layers. This is remarkable given that these models are trained on $2 2 4 \times 2 2 4$ images, which incurs one-sided zero padding at every downsampling layer. This could, in part, be attributed to the ability of the BlurPool operator used in antialiased CNN to smoothen the acuity of zero-padded borders, in turn, reducing the value imbalance incurred by one-sided padding. Further analysis is needed to examine the interaction between padding and aliasing effects in CNNs and to establish possible synergy between antialiasing and eliminating uneven application of padding.
|
| 146 |
+
|
| 147 |
+
Luo et al $\pmb { \Vert 2 8 \Vert }$ drew connections between effective receptive fields and foveated vision. Our analysis links foveation behavior with the padding scheme and suggests that it might occur implicitly in CNNs when using VALID or SAME 0-padding, without the need for explicit mechanisms [2; 21]. Furthermore, it explains the drastic accuracy drop noted by $\boxed { 1 0 }$ under VALID padding, which is amplified by feature map erosion.
|
| 148 |
+
|
| 149 |
+
Choosing a padding method SAME 0-padding is by far the most widely-used method. Compared with other methods, it can enable as much as $5 0 \%$ faster training and inference. Problem-specific constraints can dictate different choices [34; 35; 40]. In the lack of a universally superior padding method, we recommend considering multiple ones while paying attention to the nature of the data and the task, as well as to the following aspects:
|
| 150 |
+
|
| 151 |
+
• Feature-map statistics: 0-padding can alter the value distribution within the feature maps and can shift their mean value in the presence of ReLU units. The alternatives presented in Section 6 tend to preserve this distribution, thanks to reusing existing values in the maps. Foveation behavior: 0-padding might not be suited for tasks that require high precision at the periphery, unlike circular and SYMMETRIC mirror padding. Interference with image semantics (esp. with a padding amount $> 1$ pixel): For example, circular padding could introduce border discontinuities unless the input is panoramic $| \widehat { \mathsf { B } } \widehat { \mathsf { S } } \|$ . • Potential to induce feature map artifacts: All alternatives to 0-padding induce relatively fewer artifacts, except for Distribution padding $\textcircled { \lVert { 3 0 } \rVert }$ (see appendix ${ \bf D } )$
|
| 152 |
+
|
| 153 |
+
We also recommend eliminating uneven padding at downsampling layers both at training and at inference time, as we illustrated in Section $\boxed { 5 }$ This is especially important when zero padding is applied and the downsampling is learned. The scripts used to generate the visualizations in this paper are available in the supplemental as well as at http://mind-the-pad.github.io.
|
| 154 |
+
|
| 155 |
+
Summary We demonstrated how the padding mechanism can induce spatial bias in CNNs, in the form of skewed kernels and feature-map artifacts. These artifacts can be highly pronounced with the widely-used 0-padding when applied unevenly at the four sides of the feature maps. We demonstrated how such uneven padding can inherently take place in state-of-the-art CNNs, and how the artifacts it causes can be detrimental to certain tasks such as small object detection. We provided visualization methods to expose these artifacts and to analyze the implication of various padding schemes on boundary pixels. We further proposed solutions to eliminate uneven padding and to mitigate spatial bias in CNNs. Further work is needed to closely examine the implications of spatial bias and foveation in various applications (see supplementary for examples), as well as padding impact on recurrent models and 1-D CNNs.
|
| 156 |
+
|
| 157 |
+
# ACKNOWLEDGEMENT
|
| 158 |
+
|
| 159 |
+
We are thankful to Ross Girshick for providing useful recommendations and experiment ideas, and to Shubham Muttepawar for implementing an interactive tool out of our analysis scripts, guided by our front-end specialist Edward Wang and our AI user-experience designer Sara Zhang.
|
| 160 |
+
|
| 161 |
+
REFERENCES
|
| 162 |
+
[1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, et al. TensorFlow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 163 |
+
[2] E. Akbas and M. P. Eckstein. Object detection through search with a foveated visual system. PLoS computational biology, 13(10):e1005743, 2017.
|
| 164 |
+
[3] A. Azulay and Y. Weiss. Why do deep convolutional networks generalize so poorly to small image transformations? Journal of Machine Learning Research (JMLR), 20(184):1–25, 2019.
|
| 165 |
+
[4] K. Behrendt, L. Novak, and R. Botros. A deep learning approach to traffic lights: Detection, tracking, and classification. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 1370–1377. IEEE, 2017.
|
| 166 |
+
[5] C.-A. Brust, S. Sickert, M. Simon, E. Rodner, and J. Denzler. Convolutional patch networks with spatial prior for road detection and urban scene understanding. In International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (VISAPP), 2015.
|
| 167 |
+
[6] G. F. Elsayed, P. Ramachandran, J. Shlens, and S. Kornblith. Revisiting spatial invariance with low-rank local connectivity. In International Conference on Machine Learning (ICML), 2020.
|
| 168 |
+
[7] J. Geiping, H. Bauermeister, H. Droge, and M. Moeller. Inverting gradients–how easy is it to ¨ break privacy in federated learning? arXiv preprint arXiv:2003.14053, 2020.
|
| 169 |
+
[8] R. Gens and P. M. Domingos. Deep symmetry networks. In Advances in neural information processing systems (NeurIPS), pp. 2537–2545, 2014.
|
| 170 |
+
[9] D. Griffith and C. Amrhein. An evaluation of correction techniques for boundary effects in spatial statistical analysis: traditional methods. Geographical Analysis, 15(4):352–360, 1983.
|
| 171 |
+
[10] V. Gupta and N. Ramani. A note on convolution and padding for two-dimensional data. Geophysical Prospecting, 26(1):214–217, 1978.
|
| 172 |
+
[11] L. Hamey. A functional approach to border handling in image processing. In International Conference on Digital Image Computing: Techniques and Applications, pp. 1–8, 2015.
|
| 173 |
+
[12] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In IEEE conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 174 |
+
[13] A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. MobileNets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 175 |
+
[14] C. Innamorati, T. Ritschel, T. Weyrich, and N. J. Mitra. Learning on the edge: Investigating boundary filters in CNNs. International Journal of Computer Vision (IJCV), pp. 1–10, 2019.
|
| 176 |
+
[15] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning (ICML), pp. 448– 456, 2015.
|
| 177 |
+
[16] M. A. Islam, S. Jia, and N. D. Bruce. How much position information do convolutional neural networks encode? In International Conference on Learning Representations (ICLR), 2020.
|
| 178 |
+
[17] M. Jaderberg, K. Simonyan, A. Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems (NeurIPS), pp. 2017–2025, 2015.
|
| 179 |
+
[18] O. S. Kayhan and J. C. van Gemert. On translation invariance in CNNs: Convolutional layers can exploit absolute spatial location. In IEEE conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 180 |
+
[19] T. L. Kijewski-Correa. Full-scale measurements and system identification: A time-frequency perspective. PhD thesis, University of Notre Dame., 2003.
|
| 181 |
+
[20] I. Kim, W. Baek, and S. Kim. Spatially attentive output layer for image classification. In IEEE conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 182 |
+
[21] H. Larochelle and G. E. Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In Advances in neural information processing systems (NeurIPS), pp. 1243–1251, 2010.
|
| 183 |
+
[22] G. Liu, F. A. Reda, K. J. Shih, T.-C. Wang, A. Tao, and B. Catanzaro. Image inpainting for irregular holes using partial convolutions. In European Conference on Computer Vision, 2018.
|
| 184 |
+
[23] G. Liu, K. J. Shih, T.-C. Wang, F. A. Reda, K. Sapra, Z. Yu, A. Tao, and B. Catanzaro. Partial convolution based padding. In arXiv preprint arXiv:1811.11718, 2018.
|
| 185 |
+
[24] R. Liu and J. Jia. Reducing boundary artifacts in image deconvolution. In IEEE International Conference on Image Processing (ICIP), pp. 505–508, 2008.
|
| 186 |
+
[25] R. Liu, J. Lehman, P. Molino, F. P. Such, E. Frank, A. Sergeev, and J. Yosinski. An intriguing failing of convolutional neural networks and the CoordConv solution. In Advances in Neural Information Processing Systems (NeurIPS), pp. 9605–9616, 2018.
|
| 187 |
+
[26] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg. SSD: Single shot multibox detector. In European Conference on Computer Vision, pp. 21–37, 2016.
|
| 188 |
+
[27] S. Lou, X. Jiang, and P. J. Scott. Fast algorithm for morphological filters. Journal of Physics: Conference Series, 311(1):012001, 2011.
|
| 189 |
+
[28] W. Luo, Y. Li, R. Urtasun, and R. Zemel. Understanding the effective receptive field in deep convolutional neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pp. 4898–4906, 2016.
|
| 190 |
+
[29] R. Murase, M. Suganuma, and T. Okatani. How can cnns use image position for segmentation? arXiv preprint arXiv:2005.03463, 2020.
|
| 191 |
+
[30] A.-D. Nguyen, S. Choi, W. Kim, S. Ahn, J. Kim, and S. Lee. Distribution padding in convolutional neural networks. In IEEE International Conference on Image Processing (ICIP), pp. 4275–4279, 2019.
|
| 192 |
+
[31] D. Novotny, S. Albanie, D. Larlus, and A. Vedaldi. Semi-convolutional operators for instance segmentation. In European Conference on Computer Vision (ECCV), pp. 86–102, 2018.
|
| 193 |
+
[32] A. Odena, V. Dumoulin, and C. Olah. Deconvolution and checkerboard artifacts. Distill, 1 (10):e3, 2016.
|
| 194 |
+
[33] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, et al. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems (NeurIPS), pp. 8024–8035, 2019.
|
| 195 |
+
[34] P. O. Pinheiro, T.-Y. Lin, R. Collobert, and P. Dollar. Learning to refine object segments. In ´ European Conference on Computer Vision (ECCV), pp. 75–91, 2016.
|
| 196 |
+
[35] S. Schubert, P. Neubert, J. Poschmann, and P. Pretzel. Circular convolutional neural networks ¨ for panoramic images and laser data. In IEEE Intelligent Vehicles Symposium (IV), pp. 653– 660, 2019.
|
| 197 |
+
[36] E. Shalnov. BSTLD-demo: A sample project to train and evaluate model on BSTLD. https: //github.com/e-sha/BSTLD_demo, 2019.
|
| 198 |
+
[37] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
|
| 199 |
+
[38] G. Sundaramoorthi and T. E. Wang. Translation insensitive CNNs. arXiv preprint arXiv:1911.11238, 2019.
|
| 200 |
+
[39] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In IEEE conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–9, 2015.
|
| 201 |
+
[40] S. Vashishth, S. Sanyal, V. Nitin, N. Agrawal, and P. Talukdar. InteractE: Improving convolution-based knowledge graph embeddings by increasing feature interactions. In AAAI conference on Artifical Intelligence, 2020.
|
| 202 |
+
[41] S. Wu, G. Wang, P. Tang, F. Chen, and L. Shi. Convolution with even-sized kernels and symmetric padding. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1192–1203, 2019.
|
| 203 |
+
[42] F. Yu and V. Koltun. Multi-scale context aggregation by dilated convolutions. In International Conference on Learning Representations (ICLR), 2016.
|
| 204 |
+
[43] R. Zhang. Making convolutional networks shift-invariant again. In International Conference on Machine Learning (ICML), 2019.
|
| 205 |
+
|
| 206 |
+
# A ELIMINATING UNEVEN APPLICATION OF PADDING
|
| 207 |
+
|
| 208 |
+
Consider a CNN with $d$ downsampling layers, $L _ { 1 } , L _ { 2 } , . . . , L _ { d }$ . To simplify the analysis and without loss of generality we assume that the kernels in these layers are of square shape and that all other layers maintain their input size. We denote by $s _ { i }$ and $k _ { i }$ the stride and kernel size of layer $L _ { i }$ . We denote by $h _ { i }$ and $w _ { i }$ the dimensions of the feature maps computed by $L _ { i }$ . We denote by $h _ { 0 }$ and $w _ { 0 }$ the size of the CNN input. We examine the conditions to warrant no uneven application of padding along the height dimension. Parallel conditions apply to the width dimension.
|
| 209 |
+
|
| 210 |
+
We denote by $\bar { h } _ { i }$ the height of the padded input to $L _ { i }$ . The effective portion $\hat { h } _ { i } \leq \bar { h } _ { i }$ of this amount processed by the convolutional filters in $L _ { i }$ is equal to:
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\hat { h } _ { i } = s _ { i } \cdot \left( h _ { i } - 1 \right) + k _ { i }
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
Our goal is to warrant that $\hat { h } _ { i } = \bar { h } _ { i }$ to prevent information loss and to avoid uneven padding along the vertical dimension when the unconsumed part $\bar { h } _ { i } - \hat { h } _ { i } < s _ { i }$ is an odd number.
|
| 217 |
+
|
| 218 |
+
Since the non-downsampling layers maintain their input size, we can formulate the height of the padded input as follows:
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\bar { h } _ { i } = h _ { i - 1 } + 2 \cdot p _ { i }
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
where $p _ { i }$ is the amount of padding applied at the top and at the bottom of the input in $L _ { i }$ . Accordingly, we can warrant no uneven padding if the following holds:
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\forall i \in [ 1 . . d ] : \quad h _ { i - 1 } = s _ { i } \cdot ( h _ { i } - 1 ) + k _ { i } - 2 \cdot p _ { i }
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
Example 1: ResNet-18 This network contains five downsampling layers ( $\mathrm { : } d = 5$ ) all of which use a stride of 2. Despite performing downsampling, all of these layers apply a padding amount entailed by SAME padding to avoid information bias against the boundary. In four of these layers having $3 \times 3$ kernels $k _ { i } = 3 ,$ ), the amount used is $p _ { i } = 1$ . For the first layer having $7 \times 7$ kernels, this amount is equal to 3. In both cases, the term $k _ { i } - 2 \cdot p _ { i }$ in Eq. $3$ is equal to 1. To warrant no uneven padding along the vertical dimension, the heights of the feature maps at downsampling layers should hence satisfy:
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
\forall i \in [ 1 . . d ] : \quad h _ { i - 1 } = 2 \cdot ( h _ { i } - 1 ) + 1 = 2 \cdot h _ { i } - 1
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
Accordingly, the input height should satisfy:
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
h _ { 0 } = 2 ^ { d } \cdot h _ { d } - ( 2 ^ { d } - 1 ) = 2 ^ { d } \cdot ( h _ { d } - 1 ) + 1
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
where $h _ { d }$ is the height of the final feature map, and can be any natural number larger than 1 to avoid a degenerate case of a $1 \times 1$ input. The same holds for the input width:
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
w _ { 0 } = 2 ^ { d } \cdot ( w _ { d } - 1 ) + 1
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
A $2 2 5 \times 2 2 5$ input satisfies these constraints since $2 2 5 = 2 ^ { 5 } \cdot 7 + 1$ , yielding even padding in all five downsampling layers and output feature maps of size $8 \times 8$ .
|
| 249 |
+
|
| 250 |
+
Example 2: VGG-16 This network contains five max-pooling layers $( d = 5$ ) all of which use a stride of 2 and a kernel size of 2 and apply no padding. To warrant no uneven padding along the vertical dimension, the heights of the feature maps at all of these layers should hence satisfy:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\forall i \in [ 1 . . d ] : \quad h _ { i - 1 } = 2 \cdot ( h _ { i } - 1 ) + 2 = 2 \cdot h _ { i }
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
Accordingly, the input dimensions should satisfy:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
h _ { 0 } = 2 ^ { d } \cdot h _ { d } \quad \mathrm { a n d } \quad w _ { 0 } = 2 ^ { d } \cdot w _ { d }
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
A $2 2 4 \times 2 2 4$ input satisfies these constraints since $2 2 4 = 2 ^ { 5 } \cdot 7$ , causing no feature-map erosion at any downsampling layer and resulting in output feature maps of size $7 \times 7$ .
|
| 263 |
+
|
| 264 |
+
# B THE EXTENT OF FOVEATION UNDER SAME 0-PADDING
|
| 265 |
+
|
| 266 |
+
We illustrate how the absolute extent of foveation under SAME 0-padding depends on the number of convolutional layers, and how its relative extent depends on the input size.
|
| 267 |
+
|
| 268 |
+
In the following maps, color represents the number of paths to the CNN output for each input pixel. Note: The checkerboard pattern is caused by downsampling layers in ResNet that use $3 \times 3$ kernels and a stride of 2.
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 9: The foveation maps of two ResNet architectures under 0 padding, illustrated with a $2 2 5 \times 2 2 5$ input. Compared with ResNet-50, ResNet-101 has twice the number of convolutional layers with non-unitary filter sizes. Accordingly, the extent of the foveation effect is doubled.
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 10: The foveation maps of ResNet-50 under 0 padding, illustrated with inputs of different size. The smaller the input, the larger the relative extent of foveation.
|
| 275 |
+
|
| 276 |
+
In the next figure, we illustrate how uneven application of padding impacts the foveation maps. Note: It is possible to rectify the skewness in the 2nd foveation map by alternating the side where one-sided padding is applied between successive downsampling layers. This, however, does not mitigate the skewness in the learned filters (see next Section).
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 11: The foveation maps of ResNet-50 under 0 padding, illustrated with two input sizes. With a $2 5 7 \times 2 5 7$ input, the padding is evenly applied at all downsampling layers, leading to a symmetric foveation map. With a $2 5 6 \times 2 5 6$ input, the padding is applied only to the left and top sides of feature maps at all downsampling layers, which limits the number of convolutional input-output paths for pixels in the bottom and right sides as evident in the skewed foveation map.
|
| 280 |
+
|
| 281 |
+
# C THE IMPACT OF THE PADDING METHOD ON LEARNED WEIGHTS
|
| 282 |
+
|
| 283 |
+
In the presence of uneven application of padding, 0-padding causes skewness in the learned weights because the filters are exposed more frequently to feature-map patches with zeros at their top and left sides. Redundancy methods such as circular or mirror padding mitigate such skewness because they fill the padding areas with values taken from the feature maps. PartialConv also mitigates such skewness because it assumes the pixels in the padding area are missing, and rescales the partial convolutional sum to account for them. Below we show the effectiveness of these alternatives in mitigating the skewness in three ResNet architectures.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
(b) Mean filters of ResNet-50 trained on $2 2 4 \times 2 2 4$ images under two padding methods, reaching $7 6 . 1 5 \%$ top-1 accuracy under 0-padding and $7 6 . 6 1 \%$ top-1 accuracy under PartialConv.
|
| 289 |
+
|
| 290 |
+
(a) Mean filters of ResNet-18 trained on $2 2 4 \times 2 2 4$ images under two padding methods, reaching $6 9 . 9 3 \%$ top-1 accuracy under 0-padding and $7 0 . 2 8 \%$ top-1 accuracy under circular padding.
|
| 291 |
+
|
| 292 |
+
Figure 12: Mean filters of two ResNet models trained on ImageNet with $2 2 4 \times 2 2 4$ images. The input size causes uneven application of padding, leading to frequent asymmetries in the mean filters under 0 padding. We illustrate how two alternatives, circular padding and PartialConv $\pmb { \left. \pmb { \left. \bar { 2 3 } \right. } \right. }$ , enable learning highly-symmetric mean filters despite the uneven application of padding.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 13: Mean filters of ResNet-101 trained on ImageNet with $2 2 4 \times 2 2 4$ images under both 0- padding and PartialConv $\mathbb { \lVert 2 3 \rVert }$ . The input size causes uneven application of padding, leading to frequent asymmetries in the mean filters under 0 padding. In contrast, PartialConv produces highly symmetric mean filters, thanks for its treatment of pixels outside the feature map as missing values.
|
| 296 |
+
|
| 297 |
+
What if no padding is applied during downsampling? VGG models perform downsampling using $2 \times 2$ pooling layers that do not apply any padding. Accordingly, the mean filters do not exhibit significant skewness, even if the input size does not satisfy Eq 4:
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 14: Mean filters of VGG-16 trained on ImageNet under different conditions. Most mean filters exhibit high symmetry when trained with $2 2 5 \times 2 2 5$ images where the size violates Eq. 4.
|
| 301 |
+
|
| 302 |
+
# D THE IMPACT OF PADDING METHODS ON FEATURE-MAP ARTIFACTS
|
| 303 |
+
|
| 304 |
+
We show per-layer mean feature maps in ResNet-18 under different padding methods. The mean maps are averaged over 20 input samples generated at random.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 15: Feature map artifacts under zero padding. Line artifacts accumulate to become significant and asymmetric at deeper layers.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 16: Circular padding largely preserves the randomness and mitigates line artifacts.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 17: SYMMETRIC mirror padding also preserves the randomness and mitigates line artifacts.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 18: REFLECT mirror padding also preserves the randomness and mitigates line artifacts.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
|
| 320 |
+
Figure 19: PartialConv $\mathbb { \left[ \left. 2 3 \right] \right. }$ highly preserves the symmetry of the feature maps. The scaling factors it uses can break the randomness at the boundary.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 20: Feature map artifacts of a VGG-19 model under Distribution Padding (interpolation mode) $\textcircled { \lvert 3 0 \rvert }$ . Due to multiple resize operations used to fill the padding area, the artifacts grow from the boundary inwards. We use a saturated constant input to make the effect visible.
|
| 324 |
+
|
| 325 |
+
# E THE IMPACT OF ANTIALIASING ON THE LEARNED WEIGHTS
|
| 326 |
+
|
| 327 |
+
We demonstrate how antialiasing [43] significantly reduces the asymmetry of mean filters around downsampling layers, even in the presence of unevenly-applied zero padding.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 21: Mean filters of four models trained on ImageNet with $2 2 4 \times 2 2 4$ images under 0-padding both without and with antialiasing.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 22: Mean filters of two models trained on ImageNet with $2 2 4 \times 2 2 4$ images under 0-padding both without and with antialiasing.
|
| 334 |
+
|
| 335 |
+
# F FOVEATION ANALYSIS OF PADDING ALGORITHMS
|
| 336 |
+
|
| 337 |
+
Refer to http://mind-the-pad.github.io for an interactive and animated visual illustration of padding algorithms and their foveation behavior. This appendix serves as a print version.
|
| 338 |
+
|
| 339 |
+
Among the SAME padding algorithms we discussed in the manuscript, two algorithms warrant that each input pixel is involved in an equal number of convolutional operations, leading to uniform foveation maps: circular padding and SYMMETRIC mirror padding. In contrast, this number varies under zero padding, REFLECT mirror padding, replication padding, and partial convolution.
|
| 340 |
+
|
| 341 |
+
We illustrate in detail how each padding algorithm treats the input pixels. For this purpose we illustrate step by step how each pixel is processed by the convolutional kernel. We choose a set of pixels that are sufficient to expose the behavior of the respective algorithm. This set spans an area within two or three pixels from the boundary that encompasses all relevant cases for the analysis and is situated at the top-left corner. The behavior at the other corners is analogous.
|
| 342 |
+
|
| 343 |
+
All illustrations use a stride of 1. Except for VALID, all configurations warrant SAME padding.
|
| 344 |
+
|
| 345 |
+
• VALID Padding: This algorithm is illustrated on a $3 \times 3$ kernel without dilation. A larger kernel size or dilation factor will increase the foveation effect. Zero Padding: This algorithm is illustrated on a $3 \times 3$ kernel without dilation. A larger kernel size or dilation factor will increase the foveation effect. Circular Padding: This algorithm is illustrated on a $3 \times 3$ kernel without dilation. It is straightforward to prove that the algorithm warrants equal treatment of the pixels irrespective of the kernel size or dilation factor. This is because it effectively applies circular convolution: Once the kernel hits one side, it can seamlessly operate on the pixels of the other side. Circular convolution hence renders the feature map as infinite to the kernel, warranting that edge pixels are treated in the same manner as interior pixels.
|
| 346 |
+
. Mirror Padding (SYMMETRIC): This algorithm warrants that each pixel is involved in the same number of convolutional operations. It is important to notice that, unlike under circular convolution, these operations do not utilize the kernel pixels uniformly as we demonstrate in detail. We illustrate the algorithm behavior under the following settings: – $3 \times 3$ kernel and dilation factor of 1.
|
| 347 |
+
– $5 \times 5$ kernel and dilation factor of 1.
|
| 348 |
+
– $3 \times 3$ kernel and dilation factor of 2.
|
| 349 |
+
– $2 \times 2$ kernel and dilation factor of 1, along with a grouped padding strategy to compensate for uneven padding $\pm \amalg$ .
|
| 350 |
+
– $4 \times 4$ kernel size and dilation factor of 1, along with a grouped padding strategy.
|
| 351 |
+
|
| 352 |
+
• Mirror Padding (REFLECT): This algorithm is illustrated on a $3 \times 3$ kernel without dilation.
|
| 353 |
+
|
| 354 |
+
Replication Padding: This algorithm is illustrated on a $5 \times 5$ kernel without dilation. We choose this kernel size since a $3 \times 3$ kernel under SAME padding would render the algorithm equivalent to SYMMETRIC mirror padding.
|
| 355 |
+
• Partial Convolution: This algorithm is illustrated on a $3 \times 3$ kernel without dilation. Its foveation behavior is analogous to REFLECT mirror padding.
|
| 356 |
+
|
| 357 |
+
# VALID Padding Illustrated on a 3x3 kernel
|
| 358 |
+
|
| 359 |
+
# Input
|
| 360 |
+
|
| 361 |
+
# # of conv ops each pixel is involved in
|
| 362 |
+
|
| 363 |
+
<table><tr><td>a</td><td>b</td><td>C</td><td></td><td></td></tr><tr><td>d</td><td>e</td><td>f</td><td></td><td></td></tr><tr><td>g</td><td>h</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 364 |
+
|
| 365 |
+
<table><tr><td>1</td><td>2</td><td>3</td><td>3</td><td>3</td></tr><tr><td>2</td><td>4</td><td>6</td><td>6</td><td>6</td></tr><tr><td>3</td><td>6</td><td>9</td><td>9</td><td>9</td></tr><tr><td>3</td><td>6</td><td>9</td><td>9</td><td>9</td></tr><tr><td>3</td><td>6</td><td>9</td><td>9</td><td>9</td></tr></table>
|
| 366 |
+
|
| 367 |
+
# Which kernel cells these ops utilize?
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Detailed Illustration of how the counts are derived
|
| 373 |
+
|
| 374 |
+
Convolutions involving (d): rotated version of (b)
|
| 375 |
+
|
| 376 |
+
Convolutions involving (e)
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Convolutions involving (f)
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
|
| 383 |
+
Convolutions involving (g): Rotated version of (c)
|
| 384 |
+
|
| 385 |
+
Convolutions involving (h): Rotated version of (f)
|
| 386 |
+
|
| 387 |
+
Convolutions involving (i): Regular uniform treatment
|
| 388 |
+
|
| 389 |
+
# Zero Padding
|
| 390 |
+
|
| 391 |
+
# Illustrated on 3x3 kernel and 1-pixel padding
|
| 392 |
+
|
| 393 |
+
# Original Input
|
| 394 |
+
|
| 395 |
+
Padded Input
|
| 396 |
+
|
| 397 |
+
<table><tr><td>0</td><td>0</td><td>0</td><td>• ·</td><td></td><td></td></tr><tr><td>0</td><td>a</td><td>b</td><td></td><td></td><td></td></tr><tr><td>0</td><td>C</td><td>d</td><td></td><td></td><td></td></tr><tr><td>0</td><td>·</td><td></td><td></td><td></td><td></td></tr><tr><td>• =</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 398 |
+
|
| 399 |
+
# of conv ops each pixel is involved in
|
| 400 |
+
|
| 401 |
+
<table><tr><td>46</td><td></td><td></td><td>66</td><td>6</td></tr><tr><td>69</td><td></td><td>99</td><td></td><td>9</td></tr><tr><td>69</td><td></td><td>9</td><td></td><td>9</td></tr><tr><td>6999</td><td></td><td></td><td></td><td>9</td></tr><tr><td>6999</td><td></td><td></td><td></td><td>9</td></tr></table>
|
| 402 |
+
|
| 403 |
+
<table><tr><td>a</td><td>b</td><td>··</td><td></td><td></td></tr><tr><td>C</td><td>d</td><td></td><td></td><td></td></tr><tr><td>·</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 404 |
+
|
| 405 |
+
# Which kernel cells these ops utilize?
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
|
| 409 |
+
# Detailed Illustration of how the counts are derived
|
| 410 |
+
|
| 411 |
+
Convolutions involving (a)
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
|
| 415 |
+
Convolutions involving (b)
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
|
| 419 |
+
Other border cases are translation or rotation of (a) or (b)
|
| 420 |
+
|
| 421 |
+
# Circular Padding
|
| 422 |
+
|
| 423 |
+
Illustrated on 3x3 kernel and 1-pixel padding
|
| 424 |
+
|
| 425 |
+

|
| 426 |
+
|
| 427 |
+
# Which kernel cells these ops utilize?
|
| 428 |
+
|
| 429 |
+
a 1 1 1 b 1 1 1
|
| 430 |
+
1 1 1 1 1 1
|
| 431 |
+
1 1 1 1 1 1
|
| 432 |
+
sum = 9 sum = 9
|
| 433 |
+
uniform uniform
|
| 434 |
+
|
| 435 |
+
# Detailed Illustration of how the counts are derived
|
| 436 |
+
|
| 437 |
+
Convolutions involving (a)
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
|
| 441 |
+
Other border cases are translation or rotation of (a) or (b)
|
| 442 |
+
|
| 443 |
+
# Mirror Padding (SYMMETRIC)
|
| 444 |
+
|
| 445 |
+
Illustrated on 3x3 kernel and 1-pixel padding
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
|
| 449 |
+
# Which kernel cells these ops utilize?
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
|
| 453 |
+
# Detailed Illustration of how the counts are derived
|
| 454 |
+
|
| 455 |
+
Convolutions involving (a)
|
| 456 |
+
|
| 457 |
+

|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
Convolutions involving (b)
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
|
| 464 |
+
Convolutions involving (e)
|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
|
| 468 |
+
Convolutions involving (f)
|
| 469 |
+
|
| 470 |
+

|
| 471 |
+
|
| 472 |
+
Convolutions involving (g): Rotated version of (c)
|
| 473 |
+
|
| 474 |
+
Convolutions involving (h): Rotated version of (f)
|
| 475 |
+
|
| 476 |
+
Convolutions involving (i): Regular uniform treatment
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
|
| 480 |
+
# Mirror Padding (SYMMETRIC)
|
| 481 |
+
|
| 482 |
+
Illustrated on 5x5 kernel and 2-pixel padding
|
| 483 |
+
|
| 484 |
+
# Which kernel cells these ops utilize?
|
| 485 |
+
|
| 486 |
+

|
| 487 |
+
|
| 488 |
+
# Detailed Illustration of how the counts are derived
|
| 489 |
+
|
| 490 |
+
Convolutions involving (a)
|
| 491 |
+
|
| 492 |
+

|
| 493 |
+
Convolutions involving (b)
|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
Convolutions involving (c)
|
| 497 |
+
|
| 498 |
+

|
| 499 |
+
|
| 500 |
+
Convolutions involving (e)
|
| 501 |
+
|
| 502 |
+

|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
Convolutions involving (f)
|
| 506 |
+
|
| 507 |
+
Convolutions involving (g): Rotated version of (c)
|
| 508 |
+
|
| 509 |
+
Convolutions involving (h): Rotated version of (f)
|
| 510 |
+
|
| 511 |
+
Convolutions involving (i): Regular uniform treatment
|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
|
| 515 |
+
# Mirror Padding (SYMMETRIC)
|
| 516 |
+
|
| 517 |
+
Illustrated on $\mathbf { 3 \times 3 }$ kernel and 1-pixel padding with dilation factor of 2
|
| 518 |
+
|
| 519 |
+
# Which kernel cells these ops utilize?
|
| 520 |
+
|
| 521 |
+

|
| 522 |
+
|
| 523 |
+
# Detailed Illustration of how the counts are derived
|
| 524 |
+
|
| 525 |
+
Convolutions involving (a)
|
| 526 |
+
|
| 527 |
+

|
| 528 |
+
Convolutions involving (b)
|
| 529 |
+
|
| 530 |
+

|
| 531 |
+
Convolutions involving (c)
|
| 532 |
+
|
| 533 |
+

|
| 534 |
+
|
| 535 |
+
Convolutions involving (e)
|
| 536 |
+
|
| 537 |
+

|
| 538 |
+
|
| 539 |
+

|
| 540 |
+
Convolutions involving (f)
|
| 541 |
+
|
| 542 |
+
Convolutions involving (g): Rotated version of (c)
|
| 543 |
+
|
| 544 |
+
Convolutions involving (h): Rotated version of (f)
|
| 545 |
+
|
| 546 |
+
Convolutions involving (i): Regular uniform treatment
|
| 547 |
+
|
| 548 |
+
# Mirror Padding (SYMMETRIC) with Grouping
|
| 549 |
+
|
| 550 |
+
Illustrated on $\pmb { 2 \times 2 }$ kernel and 1-pixel padding A grouped padding strategy is applied to balance uneven padding (Wu et al 2019)
|
| 551 |
+
|
| 552 |
+

|
| 553 |
+
|
| 554 |
+
Number of conv ops each pixel is involved in
|
| 555 |
+
|
| 556 |
+

|
| 557 |
+
|
| 558 |
+
Which kernel cells these ops utilize?
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
|
| 562 |
+

|
| 563 |
+
Detailed Illustration of how the counts are derived
|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
Convolutions involving (b)
|
| 567 |
+
|
| 568 |
+
# Mirror Padding (SYMMETRIC) with Grouping Illustrated on 4x4 kernel and 1-pixel padding
|
| 569 |
+
|
| 570 |
+
<table><tr><td colspan="5">Original Input</td><td colspan="5"></td><td colspan="5"></td><td colspan="5">Padded at top-leftPadded at bottom-Padded at top-rightPadded at bottom left corner</td><td colspan="5"></td><td colspan="5"></td></tr><tr><td></td><td></td><td></td><td></td><td>e</td><td>d</td><td></td><td>d</td><td>e f</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>d</td><td>d</td><td>e</td><td>f</td><td></td><td></td><td></td><td>right corner</td><td></td><td></td><td></td></tr><tr><td>a</td><td>b</td><td></td><td>C</td><td>b</td><td></td><td>a</td><td></td><td></td><td></td><td></td><td>b</td><td>a</td><td>a</td><td></td><td></td><td></td><td></td><td></td><td></td><td>b</td><td></td><td></td><td></td><td>a</td><td></td><td></td><td>C</td><td></td></tr><tr><td>d</td><td>e</td><td></td><td></td><td>e</td><td>d</td><td></td><td>b e</td><td>C f</td><td></td><td></td><td></td><td></td><td>b</td><td>C f</td><td></td><td></td><td>a d</td><td>a d</td><td>e</td><td>C f</td><td></td><td></td><td>a</td><td>a</td><td>b</td><td></td><td></td></tr><tr><td></td><td>h</td><td></td><td></td><td>h</td><td>g</td><td>d g</td><td>h</td><td>i</td><td></td><td>e h</td><td>d g</td><td>d g</td><td>e h</td><td>i</td><td></td><td></td><td></td><td>g</td><td>h</td><td></td><td></td><td></td><td>d</td><td>e</td><td></td><td></td><td></td></tr><tr><td>g</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>g</td><td></td><td></td><td></td><td></td><td></td><td></td><td>g</td><td>h</td><td></td><td></td></tr></table>
|
| 571 |
+
|
| 572 |
+
Number of conv ops each pixel is involved in
|
| 573 |
+
|
| 574 |
+
<table><tr><td></td><td colspan="5">Padded at top-left</td><td colspan="5">Padded at bottom-left</td><td></td><td colspan="5">Padded at top-right</td><td colspan="5">Padded at bottom-right</td><td colspan="5"></td><td>Average (grouped padding strategy)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>25</td><td></td><td>25</td><td>20</td><td>20</td><td>20</td><td></td><td>15</td><td>15</td><td>12</td><td>12</td><td>12</td><td></td><td></td><td>15</td><td>15</td><td>20</td><td>20</td><td>20</td><td></td><td></td><td>9</td><td>9</td><td></td><td>12</td><td>12</td><td>12</td><td></td><td></td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td></tr><tr><td>25</td><td>25</td><td></td><td>20</td><td>20</td><td>20</td><td></td><td>15</td><td>15</td><td>12</td><td>12</td><td>12</td><td></td><td>15</td><td></td><td>15</td><td>20</td><td>20</td><td>20</td><td></td><td>9</td><td></td><td>9</td><td>12</td><td></td><td>12</td><td>12</td><td></td><td></td><td></td><td></td><td>16</td><td>16</td><td></td><td></td><td>16</td><td></td><td>16</td><td>16</td><td></td></tr><tr><td>20</td><td>20</td><td></td><td>16</td><td>16</td><td>16</td><td></td><td>20</td><td>20</td><td>16</td><td>16</td><td>16</td><td></td><td>12</td><td></td><td>12</td><td>16</td><td>16</td><td>16</td><td></td><td>12</td><td></td><td>12</td><td>16</td><td></td><td>16</td><td>16</td><td></td><td></td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td></tr><tr><td>20</td><td>20</td><td></td><td>16</td><td>16</td><td>16</td><td>20</td><td></td><td>20</td><td>16</td><td>16</td><td>16</td><td></td><td>12</td><td></td><td>12</td><td>16</td><td>16</td><td>16</td><td></td><td>12</td><td></td><td>12</td><td>16</td><td></td><td>16</td><td>16</td><td></td><td></td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td></td><td>16</td><td>16</td><td></td><td></td></tr><tr><td>20</td><td>20</td><td></td><td>16</td><td>16 16</td><td></td><td>20</td><td></td><td>20</td><td>16</td><td>16</td><td></td><td></td><td>12</td><td></td><td>12</td><td>16</td><td>16</td><td>16</td><td></td><td>12</td><td></td><td>12</td><td>16</td><td></td><td>16</td><td>16</td><td></td><td></td><td></td><td>16</td><td>16</td><td></td><td>16</td><td></td><td></td><td>16</td><td>16</td><td></td><td></td></tr></table>
|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
Which kernel cells these ops utilize?
|
| 578 |
+
|
| 579 |
+
# Replication Padding
|
| 580 |
+
|
| 581 |
+

|
| 582 |
+
|
| 583 |
+
Illustrated on 5x5 kernel and 2-pixel padding
|
| 584 |
+
|
| 585 |
+
# Which kernel cells these ops utilize?
|
| 586 |
+
|
| 587 |
+

|
| 588 |
+
|
| 589 |
+
# Detailed Illustration of how the counts are derived
|
| 590 |
+
|
| 591 |
+
Convolutions involving (a)
|
| 592 |
+
|
| 593 |
+

|
| 594 |
+
|
| 595 |
+
Convolutions involving (b)
|
| 596 |
+
|
| 597 |
+

|
| 598 |
+
Convolutions involving (c)
|
| 599 |
+
|
| 600 |
+

|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
Convolutions involving (e)
|
| 604 |
+
|
| 605 |
+

|
| 606 |
+
Convolutions involving (f)
|
| 607 |
+
|
| 608 |
+
Convolutions involving (g): Rotated version of (c)
|
| 609 |
+
|
| 610 |
+
Convolutions involving (h): Rotated version of (f)
|
| 611 |
+
|
| 612 |
+
Convolutions involving (i): Regular uniform treatment
|
| 613 |
+
|
| 614 |
+
# Mirror Padding (REFLECT)
|
| 615 |
+
|
| 616 |
+
Illustrated on 3x3 kernel and 1-pixel padding
|
| 617 |
+
|
| 618 |
+
# of conv ops each pixel is involved in
|
| 619 |
+
|
| 620 |
+
Original Input
|
| 621 |
+
|
| 622 |
+
<table><tr><td>a</td><td>b</td><td>C</td><td></td><td></td></tr><tr><td>d</td><td>e</td><td>f</td><td></td><td></td></tr><tr><td>g</td><td>h</td><td></td><td></td><td></td></tr><tr><td> • · </td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 623 |
+
|
| 624 |
+
<table><tr><td>e</td><td>d</td><td>e</td><td>f</td><td>. • </td><td>. • </td></tr><tr><td>b</td><td>a</td><td>b</td><td>C</td><td></td><td>= =</td></tr><tr><td>e</td><td>d</td><td>e</td><td>f</td><td></td><td></td></tr><tr><td>h</td><td>g</td><td>h</td><td></td><td></td><td></td></tr><tr><td></td><td>= =</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 625 |
+
|
| 626 |
+
<table><tr><td>4</td><td>8</td><td>6</td><td>6</td><td>6</td></tr><tr><td>8</td><td>16</td><td>12</td><td>12</td><td>12</td></tr><tr><td>6</td><td>12</td><td>9</td><td>9</td><td>9</td></tr><tr><td>6</td><td>12</td><td>9</td><td>9</td><td>9</td></tr><tr><td>6</td><td>12</td><td>9</td><td>9</td><td>9</td></tr></table>
|
| 627 |
+
|
| 628 |
+
# Which kernel cells these ops utilize?
|
| 629 |
+
|
| 630 |
+

|
| 631 |
+
|
| 632 |
+
# Detailed Illustration of how the counts are derived
|
| 633 |
+
|
| 634 |
+
Convolutions involving (a)
|
| 635 |
+
|
| 636 |
+

|
| 637 |
+
|
| 638 |
+
Convolutions involving (b)
|
| 639 |
+
|
| 640 |
+

|
| 641 |
+
|
| 642 |
+
Convolutions involving (c)
|
| 643 |
+
|
| 644 |
+

|
| 645 |
+
|
| 646 |
+
Convolutions involving (e)
|
| 647 |
+
|
| 648 |
+

|
| 649 |
+
|
| 650 |
+
Convolutions involving (f)
|
| 651 |
+
|
| 652 |
+

|
| 653 |
+
|
| 654 |
+
Convolutions involving (g): Rotated version of (c)
|
| 655 |
+
|
| 656 |
+
Convolutions involving (h): Rotated version of (f)
|
| 657 |
+
|
| 658 |
+
Convolutions involving (i): Regular uniform treatment
|
| 659 |
+
|
| 660 |
+
# Partial Convolution Illustrated on a 3x3 kernel
|
| 661 |
+
|
| 662 |
+
# Input
|
| 663 |
+
|
| 664 |
+
# Weighted # of conv ops each pixel is involved in
|
| 665 |
+
|
| 666 |
+
<table><tr><td>a</td><td>b</td><td>C</td><td></td><td></td></tr><tr><td>d</td><td>e</td><td>f</td><td></td><td></td></tr><tr><td>g</td><td>h</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 667 |
+
|
| 668 |
+
<table><tr><td>6.25</td><td>8.75</td><td>7.5</td><td>7.5</td><td>7.5</td></tr><tr><td>8.75 12.25</td><td></td><td></td><td>10.5 10.510.5</td><td></td></tr><tr><td>7.5</td><td>10.5</td><td>9</td><td>9</td><td>9</td></tr><tr><td>7.5</td><td>10.5</td><td>9</td><td>9</td><td>9</td></tr><tr><td>7.5</td><td>10.5</td><td>9</td><td>9</td><td>9</td></tr></table>
|
| 669 |
+
|
| 670 |
+
# Which kernel cells these ops utilize?
|
| 671 |
+
|
| 672 |
+

|
| 673 |
+
Detailed Illustration of how the counts are derived
|
| 674 |
+
|
| 675 |
+
Convolutions involving (a)
|
| 676 |
+
|
| 677 |
+

|
| 678 |
+
Convolutions involving (b)
|
| 679 |
+
|
| 680 |
+

|
| 681 |
+
Convolutions involving (c)
|
| 682 |
+
|
| 683 |
+

|
| 684 |
+
|
| 685 |
+

|
| 686 |
+
Convolutions involving (e)
|
| 687 |
+
|
| 688 |
+
Convolutions involving (g): Rotated version of (c)
|
| 689 |
+
|
| 690 |
+
Convolutions involving (h): Rotated version of (f)
|
| 691 |
+
|
| 692 |
+
Convolutions involving (i): Regular uniform treatment
|
md/train/r1eBeyHFDH/r1eBeyHFDH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/r1efr3C9Ym/r1efr3C9Ym.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INTERPOLATION-PREDICTION NETWORKS FORIRREGULARLY SAMPLED TIME SERIES
|
| 2 |
+
|
| 3 |
+
Satya Narayan Shukla College of Information and Computer Sciences University of Massachusetts Amherst snshukla@cs.umass.edu
|
| 4 |
+
|
| 5 |
+
Benjamin M. Marlin
|
| 6 |
+
College of Information and Computer Sciences
|
| 7 |
+
University of Massachusetts Amherst
|
| 8 |
+
marlin@cs.umass.edu
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
In this paper, we present a new deep learning architecture for addressing the problem of supervised learning with sparse and irregularly sampled multivariate time series. The architecture is based on the use of a semi-parametric interpolation network followed by the application of a prediction network. The interpolation network allows for information to be shared across multiple dimensions of a multivariate time series during the interpolation stage, while any standard deep learning model can be used for the prediction network. This work is motivated by the analysis of physiological time series data in electronic health records, which are sparse, irregularly sampled, and multivariate. We investigate the performance of this architecture on both classification and regression tasks, showing that our approach outperforms a range of baseline and recently proposed models.1
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Over the last several years, there has been significant progress in developing specialized models and architectures that can accommodate sparse and irregularly sampled time series as input (Marlin et al., 2012; Li & Marlin, 2015; 2016; Lipton et al., 2016; Futoma et al., 2017; Che et al., 2018a). An irregularly sampled time series is a sequence of samples with irregular intervals between their observation times. Irregularly sampled data are considered to be sparse when the intervals between successive observations are often large. Of particular interest in the supervised learning setting are methods that perform end-to-end learning directly using multivariate sparse and irregularly sampled time series as input without the need for a separate interpolation or imputation step.
|
| 17 |
+
|
| 18 |
+
In this work, we present a new model architecture for supervised learning with multivariate sparse and irregularly sampled data: Interpolation-Prediction Networks. The architecture is based on the use of several semi-parametric interpolation layers organized into an interpolation network, followed by the application of a prediction network that can leverage any standard deep learning model. In this work, we use GRU networks (Chung et al., 2014) as the prediction network.
|
| 19 |
+
|
| 20 |
+
The interpolation network allows for information contained in each input time series to contribute to the interpolation of all other time series in the model. The parameters of the interpolation and prediction networks are learned end-to-end via a composite objective function consisting of supervised and unsupervised components. The interpolation network serves the same purpose as the multivariate Gaussian process used in the work of Futoma et al. (2017), but remove the restrictions associated with the need for a positive definite covariance matrix.
|
| 21 |
+
|
| 22 |
+
Our approach also allows us to compute an explicit multi-timescale representation of the input time series, which we use to isolate information about transients (short duration events) from broader trends. Similar to the work of Lipton et al. (2016) and Che et al. (2018a), our architecture also explicitly leverages a separate information channel related to patterns of observation times. However, our representation uses a semi-parametric intensity function representation of this information that is more closely related to the work of Lasko (2014) on modeling medical event point processes.
|
| 23 |
+
|
| 24 |
+
Our architecture thus produces three output time series for each input time series: a smooth interpolation modeling broad trends in the input, a short time-scale interpolation modeling transients, and an intensity function modeling local observation frequencies.
|
| 25 |
+
|
| 26 |
+
This work is motivated by problems in the analysis of electronic health records (EHRs) (Marlin et al., 2012; Lipton et al., 2016; Futoma et al., 2017; Che et al., 2018a). It remains rare for hospital systems to capture dense physiological data streams. Instead, it is common for the physiological time series data in electronic health records to be both sparse and irregularly sampled. The additional issue of the lack of alignment in the observation times across physiological variables is also very common.
|
| 27 |
+
|
| 28 |
+
We evaluate the proposed architecture on two datasets for both classification and regression tasks. Our approach outperforms a variety of simple baseline models as well as the basic and advanced GRU models introduced by Che et al. (2018a) across several metrics. We also compare our model with to the Gaussian process adapter (Li & Marlin, 2016) and multi-task Gaussian process RNN classifier (Futoma et al., 2017). Further, we perform full ablation testing of the information channels our architecture can produce to assess their impact on classification and regression performance.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
The problem of interest in this work is learning supervised machine learning models from sparse and irregularly sampled multivariate time series. As described in the introduction, a sparse and irregularly sampled time series is a sequence of samples with large and irregular intervals between their observation times.
|
| 33 |
+
|
| 34 |
+
Such data commonly occur in electronic health records, where they can represent a significant problem for both supervised and unsupervised learning methods (Yadav et al., 2018). Sparse and irregularly sampled time series data also occur in a range of other areas with similarly complex observation processes including climate science (Schulz & Stattegger, 1997), ecology (Clark & Bjørnstad, 2004), biology (Ruf, 1999), and astronomy (Scargle, 1982).
|
| 35 |
+
|
| 36 |
+
A closely related (but distinct) problem is performing supervised learning in the presence of missing data (Batista & Monard, 2003). The primary difference is that the missing data problem is generally defined with respect to a fixed-dimensional feature space (Little & Rubin, 2014). In the irregularly sampled time series problem, observations typically occur in continuous time and there may be no notion of a “normal” or “expected” sampling frequency for some domains.
|
| 37 |
+
|
| 38 |
+
Methods for dealing with missing data in supervised learning include the pre-application of imputation methods (Sterne et al., 2009), and learning joint models of features and labels (Williams et al., 2005). Joint models can either be learned generatively to optimize the joint likelihood of features and labels, or discriminately to optimize the conditional likelihood of the labels. The problem of irregular sampling can be converted to a missing data problem by discretizing the time axis into non-overlapping intervals. Intervals with no observations are then said to contain missing values.
|
| 39 |
+
|
| 40 |
+
This is the approach taken to deal with irregular sampling by Marlin et al. (2012) as well as Lipton et al. (2016). This approach forces a choice of discretization interval length. When the intervals are long, there will be less missing data, but there can also be multiple observations in the same interval, which must be accounted for using ad-hoc methods. When the intervals are shorter, most intervals will contain at most one value, but many intervals may be empty. Learning is generally harder as the amount of missing data increases, so choosing a discretization interval length must be dealt with as a hyper-parameter of such a method.
|
| 41 |
+
|
| 42 |
+
One important feature of missing data problems is the potential for the sequence of observation times to itself be informative (Little & Rubin, 2014). Since the set of missing data indicators is always observed, this information is typically easy to condition on. This technique has been used successfully to improve models in the domain of recommender systems (Salakhutdinov et al., 2007). It was also used by Lipton et al. (2016) to improve performance of their GRU model.
|
| 43 |
+
|
| 44 |
+
The alternative to pre-discretizing irregularly sampled time series to convert the problem of irregular sampling into the problem of missing data is to construct models with the ability to directly use an irregularly sampled time series as input. The machine learning and statistics literature include several models with this ability. In the probabilistic setting, Gaussian process models have the ability to represent continuous time data via the use of mean and covariance functions (Rasmussen, 2006). These models have non-probabilistic analogues that are similarly defined in terms of kernels.
|
| 45 |
+
|
| 46 |
+
For example, Lu et al. (2008) present a kernel-based method that can be used to produce a similarity function between two irregularly sampled time series. Li & Marlin (2015) subsequently provided a generalization of this approach to the case of kernels between Gaussian process models. Li & Marlin (2016) showed how the re-parameterization trick (Kingma et al., 2015) could be used to extend these ideas to enable end-to-end training of a deep neural network model (feed-forward, convolutional, or recurrent) stacked on top of a Gaussian process layer. While the basic model of Li & Marlin (2016) was only applied to univariate time series, in follow-up work the model was extended to multivariate time series using a multi-output Gaussian process regression model (Futoma et al., 2017). However, modeling multivariate time series within this framework is quite challenging due to the constraints on the covariance function used in the GP layer. Futoma et al. (2017) deal with this problem using a sum of separable kernel functions (Bonilla et al., 2008), which limit the expressiveness of the model.
|
| 47 |
+
|
| 48 |
+
An important property of the above models is that they allow for incorporating all of the information from all available time points into a global interpolation model. Variants differ in terms of whether they only leverage the posterior mean when the final supervised problem is solved, or whether the whole posterior is used. A separate line of work has looked at the use of more local interpolation methods while still operating directly over continuous time inputs.
|
| 49 |
+
|
| 50 |
+
For example, Che et al. (2018a) presented several methods based on gated recurrent unit (GRU) networks (Chung et al., 2014) combined with simple imputation methods including mean imputation and forward filling with past values. Che et al. (2018a) additionally considered an approach that takes as input a sequence consisting of both the observed values and the timestamps at which those values were observed. The previously observed input value is decayed over time toward the overall mean. In another variant the hidden states are similarly decayed toward zero. Yoon et al. (2017) presented another similar approach based on multi-directional RNN which operate across streams in addition to within streams. However, these models are limited to using global information about the structure of the time series via its empirical mean value, and current or past information about observed values. The global structure of the time series is not directly taken into account.
|
| 51 |
+
|
| 52 |
+
Che et al. (2018b) focus on a similar problem of modeling multi-rate multivariate time series data. This is similar to the problem of interest in that the observations across time series can be unaligned. The difference is that the observations in each time series are uniformly spaced, which is a simpler case. In the case of missing data, they use forward or linear interpolation, which again does not capture the global structure of time series. Similarly, Binkowski et al. (2018) presented an autoregressive framework for regression tasks with irregularly sampled time series data. It is not clear how it can be extended for classification.
|
| 53 |
+
|
| 54 |
+
The model proposed in this work is similar to that of Li & Marlin (2016) and Futoma et al. (2017) in the sense that it consists of global interpolation layers. The primary difference is that these prior approaches used Gaussian process representations within the interpolation layers. The resulting computations can be expensive and, as noted, the design of covariance functions in the multivariate case can be challenging. By contrast, our proposed model uses semi-parametric, deterministic, feed-forward interpolation layers. These layers do not encode uncertainty, but they do allow for very flexible interpolation both within and across layers.
|
| 55 |
+
|
| 56 |
+
Also similar to Li & Marlin (2016) and Futoma et al. (2017), the interpolation layers in our architecture produce regularly sampled interpolants that can serve as inputs for arbitrary, unmodified, deep classification and regression networks. This is in contrast to the approach of Che et al. (2018a), where a recurrent network architecture was directly modified, reducing the modularity of the approach. Finally, similar to Lipton et al. (2016), our model includes information about the times at which observations occur. However, instead of pre-discretizing the inputs and viewing this information in terms of a binary observation mask or set of missing data indicators, we directly model the sequence of observation events as a point process in continuous time using a semi-parametric intensity function (Lasko, 2014).
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 1: Architecture of the proposed model
|
| 60 |
+
|
| 61 |
+
# 3 MODEL FRAMEWORK
|
| 62 |
+
|
| 63 |
+
In this section, we present the proposed modeling framework. We begin by presenting notation, followed by the model architecture and learning criteria.
|
| 64 |
+
|
| 65 |
+
# 3.1 NOTATION
|
| 66 |
+
|
| 67 |
+
We let $\mathcal { D } = \{ ( \mathbf { s } _ { n } , y _ { n } ) | n = 1 , . . . , N \}$ represent a data set containing $N$ data cases. An individual data case consists of a single target value $y _ { n }$ (discrete for classification and real-valued in the case of regression), as well as a $D$ -dimensional, sparse and irregularly sampled multivariate time series ${ \bf s } _ { n }$ . Different dimensions $d$ of the multivariate time series can have observations at different times, as well as different total numbers of observations $L _ { d n }$ . Thus, we represent time series $d$ for data case $n$ as a tuple $\mathbf { s } _ { d n } = ( \mathbf { t } _ { d n } , \mathbf { x } _ { d n } )$ where $\mathbf t _ { d n } = [ t _ { 1 d n } , . . . , t _ { L _ { d n } d n } ]$ is the list of time points at which observations are defined and $\mathbf { x } _ { d n } = [ x _ { 1 d n } , . . . , x _ { L _ { d n } d n } ]$ is the corresponding list of observed values.
|
| 68 |
+
|
| 69 |
+
# 3.2 MODEL ARCHITECTURE
|
| 70 |
+
|
| 71 |
+
The overall model architecture consists of two main components: an interpolation network and a prediction network. The interpolation network interpolates the multivariate, sparse, and irregularly sampled input time series against a set of reference time points $\mathbf { r } = [ r _ { 1 } , . . . , r _ { T } ]$ . We assume that all of the time series are defined within a common time interval (for example, the first 24 or 48 hours after admission for MIMIC-III dataset). The $T$ reference time points $r _ { t }$ are chosen to be evenly spaced within that interval. In this work, we propose a two-layer interpolation network with each layer performing a different type of interpolation.
|
| 72 |
+
|
| 73 |
+
The second component, the prediction network, takes the output of the interpolation network as its input and produces a prediction ${ \hat { y } } _ { n }$ for the target variable. The prediction network can consist of any standard supervised neural network architecture (fully-connected feedforward, convolutional, recurrent, etc). Thus, the architecture is fully modular with respect to the use of different prediction networks. In order to train the interpolation network, the architecture also includes an auto-encoding component to provide an unsupervised learning signal in addition to the supervised learning signal from the prediction network. Figure 1 shows the architecture of the proposed model. We describe the components of the model in detail below.
|
| 74 |
+
|
| 75 |
+
# 3.2.1 INTERPOLATION NETWORK
|
| 76 |
+
|
| 77 |
+
We begin by describing the interpolation network. The goal of the interpolation network is to provide a collection of interpolants of each of the $D$ dimensions of an input multivariate time series defined at the $T$ reference time points $\mathbf { r } = [ r _ { 1 } , . . . , r _ { T } ]$ . In this work, we use a total of $C = 3$ outputs for each of the $D$ input time series. The three outputs (discussed in detail below) capture smooth trends, transients, and observation intensity information. We define $f _ { \boldsymbol { \theta } } ( { \bf r } , { \bf s } _ { n } )$ to be the function computing the output $\hat { \mathbf { s } } _ { n }$ of the interpolation network. The output $\hat { \mathbf { s } } _ { n }$ is a fixed-sized array with dimensions $( D C ) \times T$ for all inputs ${ \bf s } _ { n }$ .
|
| 78 |
+
|
| 79 |
+
The first layer in the interpolation network separately performs three semi-parametric univariate transformations for each of the $D$ time series. Each transformation is based on a radial basis function (RBF) network to accommodate continuous time observations. The transformations are a low-pass (or smooth) interpolation $\pmb { \sigma } _ { d }$ , a high-pass (or non-smooth) interpolation $\gamma _ { d }$ and an intensity function $\lambda _ { d }$ . These transformations are computed at reference time point $r _ { k }$ for each data case and each input time series $d$ as shown in Equations 1, 2, 3 and 4.2 The smooth interpolation $\sigma _ { d }$ uses a squared exponential kernel with parameter $\alpha _ { d }$ , while the non-smooth interpolation $\gamma _ { d }$ uses a squared exponential kernel with parameter $\kappa \alpha _ { d }$ for $\kappa > 1$ .
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { l } { \displaystyle { Z ( r , \mathbf { t } , \alpha ) = \sum _ { t \in \mathbf { t } } w ( r , t , \alpha ) , \quad w ( r , t , \alpha ) = \exp ( - \alpha ( r - t ) ^ { 2 } ) } } \\ { \displaystyle { \ } \lambda _ { k d } = h _ { \theta } ^ { \lambda } ( r _ { k } , \mathbf { t } _ { d } , \mathbf { x } _ { d } ) = Z ( r _ { k } , \mathbf { t } _ { d } , \alpha _ { d } ) } \\ { \displaystyle { \ \sigma _ { k d } = h _ { \theta } ^ { \sigma } ( r _ { k } , \mathbf { t } _ { d } , \mathbf { x } _ { d } ) = \frac { 1 } { Z ( r _ { k } , \mathbf { t } _ { d } , \alpha _ { d } ) } \sum _ { j = 1 } ^ { L _ { d n } } w ( r _ { k } , t _ { j d } , \alpha _ { d } ) x _ { j d } } } \\ { \displaystyle { \ } \gamma _ { k d } = h _ { \theta } ^ { \gamma } ( r _ { k } , \mathbf { t } _ { d } , \mathbf { x } _ { d } ) = \frac { 1 } { Z ( r _ { k } , \mathbf { t } _ { d } , \kappa \alpha _ { d } ) } \sum _ { j = 1 } ^ { L _ { d n } } w ( r _ { k } , t _ { j d } , \kappa \alpha _ { d } ) x _ { j d } } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
The second interpolation layer merges information across all $D$ time series at each reference time point by taking into account learnable correlations $\rho _ { d d ^ { \prime } }$ across all time series. This results in a crossdimension interpolation $x d$ for each input dimension $d$ . We further define a transient component $\tau _ { d }$ for each input dimension $d$ as the difference between the high-pass (or non-smooth) interpolation $\gamma _ { d }$ from the first layer and the smooth cross-dimension interpolation $x d$ , as shown in Equation 5.
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\chi _ { k d } = h _ { \theta } ^ { \chi } ( r _ { k } , \mathbf { s } ) = \frac { \sum _ { d ^ { \prime } } \rho _ { d d ^ { \prime } } \lambda _ { k d ^ { \prime } } \sigma _ { k d ^ { \prime } } } { \sum _ { d ^ { \prime } } \lambda _ { k d ^ { \prime } } } , \qquad \quad \tau _ { k d } = h _ { \theta } ^ { \tau } ( r _ { k } , \mathbf { s } ) = \gamma _ { k d } - \chi _ { k d } .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
In the experiments presented in the next section, we use a total of three interpolation network outputs per dimension $d$ as the input to the prediction network. We use the smooth, cross-channel interpolants $x d$ to capture smooth trends, the transient components $\tau _ { d }$ to capture transients, and the intensity functions $\lambda _ { d }$ to capture information about where observations occur in time.
|
| 92 |
+
|
| 93 |
+
# 3.2.2 PREDICTION NETWORK
|
| 94 |
+
|
| 95 |
+
Following the application of the interpolation network, all $D$ dimensions of the input multivariate time series have been re-represented in terms of $C$ outputs defined on the regularly spaced set of reference time points $r _ { 1 } , . . . , r _ { T }$ (in our experiments, we use $C = 3$ as described above). Again, we refer to the complete set of interpolation network outputs as $\hat { \mathbf { s } } _ { n } ~ = ~ f _ { \theta } ( \mathbf { r } , \mathbf { s } _ { n } )$ , which can be represented as a matrix of size $( D C ) \times T$ .
|
| 96 |
+
|
| 97 |
+
The prediction network must take $\hat { \mathbf { s } } _ { n }$ as input and output a prediction $\hat { y } _ { n } = g _ { \phi } ( \hat { \mathbf { s } } _ { n } ) = g _ { \phi } ( f _ { \theta } ( \mathbf { r } , \mathbf { s } _ { n } ) )$ of the target value $y _ { n }$ for data case $n$ . There are many possible choices for this component of the model. For example, the matrix $\hat { \mathbf { s } } _ { n }$ can be converted into a single long vector and provided as input to a standard multi-layer feedforward network. A temporal convolutional model or a recurrent model like a GRU or LSTM can instead be applied to time slices of the matrix $\hat { \mathbf { s } } _ { n }$ . In this work, we conduct experiments leveraging a GRU network as the prediction network.
|
| 98 |
+
|
| 99 |
+
# 3.2.3 LEARNING
|
| 100 |
+
|
| 101 |
+
To learn the model parameters, we use a composite objective function consisting of a supervised component and an unsupervised component. This is due to the fact that the supervised component alone is insufficient to learn reasonable parameters for the interpolation network parameters given the amount of available training data. The unsupervised component used corresponds to an autoencoder-like loss function. However, the semi-parametric RBF interpolation layers have the ability to exactly fit the input points by setting the RBF kernel parameters to very large values.
|
| 102 |
+
|
| 103 |
+
To avoid this solution and force the interpolation layers to learn to properly interpolate the input data, it is necessary to hold out some observed data points $x _ { j d n }$ during learning and then to compute the reconstruction loss only for these data points. This is a well-known problem with high-capacity autoencoders, and past work has used similar strategies to avoid the problem of trivially memorizing the input data without learning useful structure.
|
| 104 |
+
|
| 105 |
+
To implement the autoencoder component of the loss, we introduce a set of masking variables $m _ { j d n }$ for each data point $\left( t _ { j d n } , x _ { j d n } \right)$ . If $m _ { j d n } = 1$ , then we remove the data point $\left( t _ { j d n } , x _ { j d n } \right)$ as an input to the interpolation network, and include the predicted value of this time point when assessing the autoencoder loss. We use the shorthand notation $\mathbf { m } _ { n } \odot \mathbf { s } _ { n }$ to represent the subset of values of ${ \bf s } _ { n }$ that are masked out, and $\left( 1 - \mathbf { m } _ { n } \right) \odot \mathbf { s } _ { n }$ to represent the subset of values of ${ \bf s } _ { n }$ that are not masked out. The value $\hat { x } _ { j d n }$ that we predict for a masked input at time point $t _ { j d n }$ is the value of the smooth cross-channel interpolant at that time point, calculated based on the un-masked input values: $\hat { x } _ { j d n } = h _ { \theta } ^ { \chi } ( t _ { j d n } , ( 1 - \mathbf { m } _ { n } ) ^ { \top } \odot \mathbf { s } _ { n } )$ .
|
| 106 |
+
|
| 107 |
+
We can now define the learning objective for the proposed framework. We let $\ell _ { P }$ be the loss for the prediction network (we use cross-entropy loss for classification and squared error for regression). We let $\ell _ { I }$ be the interpolation network autoencoder loss (we use standard squared error). We also include $\ell _ { 2 }$ regularizers for both the interpolation and prediction networks parameters. $\delta _ { I } , \delta _ { P }$ , and $\delta _ { R }$ are hyper-parameters that control the trade-off between the components of the objective function.
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r l r } { { \theta _ { * } , \phi _ { * } = \arg \operatorname* { m i n } _ { \theta , \phi } \sum _ { n = 1 } ^ { N } \ell _ { P } \big ( y _ { n } , g _ { \phi } \big ( f _ { \theta } ( \mathbf { s } _ { n } ) \big ) + \delta _ { I } \| \theta \| _ { 2 } ^ { 2 } + \delta _ { P } \| \phi \| _ { 2 } ^ { 2 } } } \\ & { } & { + \delta _ { R } \sum _ { n = 1 } ^ { N } \sum _ { d = 1 } ^ { D } \sum _ { j = 1 } ^ { L _ { d n } } m _ { j d n } \ell _ { I } \big ( x _ { j d n } , h _ { \theta } ^ { \chi } \big ( t _ { j d n } , \big ( 1 - \mathbf { m } _ { n } \big ) \odot \mathbf { s } _ { n } \big ) \big ) } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
# 4 EXPERIMENTS AND RESULTS
|
| 114 |
+
|
| 115 |
+
In this section, we present experiments based on both classification and regression tasks with sparse and irregularly sampled multivariate time series. In both cases, the input to the prediction network is a sparse and irregularly sampled time series, and the output is a single scalar representing either the predicted class or the regression target variable. We test the model framework on two publicly available real-world datasets: MIMIC-III 3 − a multivariate time series dataset consisting of sparse and irregularly sampled physiological signals collected at Beth Israel Deaconess Medical Center from 2001 to 2012 (Johnson et al., 2016), and UWaveGesture 4 − a univariate time series data set consisting of simple gesture patterns divided into eight categories (Liu et al., 2009). Details of each dataset can be found in the Appendix A.1. We use the MIMIC-III mortality and length of stay prediction tasks as example classification and regression tasks with multivariate time series. We use the UWave gesture classification task for assessing training time and performance relative to univariate baseline models.
|
| 116 |
+
|
| 117 |
+
# 4.1 BASELINE MODELS
|
| 118 |
+
|
| 119 |
+
We compare our proposed model to a number of baseline approaches including off-the-shelf classification and regression models learned using basic features, as well as more recent approaches based on customized neural network models.
|
| 120 |
+
|
| 121 |
+
# 4.1.1 NON-NEURAL NETWORK BASELINES
|
| 122 |
+
|
| 123 |
+
For non-neural network baselines, we evaluate Logistic Regression (Hosmer Jr et al., 2013), Support Vector Machines (SVM) (Cortes & Vapnik, 1995), Random Forests (RF) (Breiman, 2001) and AdaBoost (Freund & Schapire, 1997) for the classification task.
|
| 124 |
+
|
| 125 |
+
For the length of stay prediction task, we apply Linear Regression (Hastie et al., 2001), Support Vector Regression (SVR), AdaBoost Regression (Drucker, 1997) and Random Forest Regression.
|
| 126 |
+
|
| 127 |
+
Standard instances of all of these models require fixed-size feature representations. We use temporal discretization with forward filling to create fixed-size representation in case of missing data and use this representation as feature set for non-neural network baselines.
|
| 128 |
+
|
| 129 |
+
# 4.1.2 NEURAL NETWORK MODELS
|
| 130 |
+
|
| 131 |
+
We compare to several existing deep learning baselines built on GRUs using simple interpolation or imputation approaches. In addition, we compare to current state-of-the-art models for mortality prediction including the work of Che et al. (2018a). Their work proposed to handle irregularly sampled and missing data using recurrent neural networks (RNNs) by introducing temporal decays in the input and/or hidden layers. We also evaluate the scalable end-to-end Gaussian process adapter (Li & Marlin, 2016) as well as multi-task Gaussian process RNN classifier (Futoma et al., 2017) for irregularly sampled univariate and multivariate time series classification respectively. This work is discussed in detail in Section 2. The complete set of models that we compare to is as follows:
|
| 132 |
+
|
| 133 |
+
• GP-GRU: End-to-end Gaussian process with GRU as classifier. GRU-M: Missing observations replaced with the global mean of the variable across the training examples. GRU-F: Missing values set to last observed measurement within that time series (referred to as forward filling). GRU-S: Missing values replaced with the global mean. Input is concatenated with masking variable and time interval indicating how long the particular variable is missing. GRU-D: In order to capture richer information, decay is introduced in the input as well as hidden layer of a GRU. Instead of replacing missing values with the last measurement, missing values are decayed over time towards the empirical mean.
|
| 134 |
+
• GRU-HD: A variation of GRU-D where decay in only introduced in the hidden layer.
|
| 135 |
+
|
| 136 |
+
# 4.2 RESULTS
|
| 137 |
+
|
| 138 |
+
In this section, we present the results of the classification and regression experiments, as well as the results of ablation testing of the internal structure of the interpolation network for the proposed model. We use the UWaveGesture dataset to assess the training time and classification performance relative to the baseline models. We use the standard train and test sets (details are given in appendix A.1). We report the training time taken for convergence along with accuracy on test set.
|
| 139 |
+
|
| 140 |
+
For MIMIC-III, we create our own dataset (appendix A.1) and report the results of a 5-fold cross validation experiment in terms of the average area under the ROC curve (AUC score), average area under the precision-recall curve (AUPRC score), and average cross-entropy loss for the classification task. For the regression task, we use average median absolute error and average fraction of explained variation (EV) as metrics. We also report the standard deviation over cross validation folds for all metrics.
|
| 141 |
+
|
| 142 |
+
Training and implementation details can be found in appendix A.2. Figure 2 shows the classification performance on the UWaveGesture dataset. The proposed model and the Gaussian process adapter (Li & Marlin, 2016) significantly outperform the rest of the baselines. However, the proposed model achieves similar performance to the Gaussian process adapter, but with a $5 0 \mathrm { x }$ speed up (note the log scale on the training time axis). On the other hand, the training time of the proposed model is approximately the same order as other GRU-based models, but it achieves much better accuracy.
|
| 143 |
+
|
| 144 |
+
Table 1 compares the predictive performance of the mortality and length of stay prediction task on MIMIC-III. We note that in highly skewed datasets as is the case of MIMIC-III, AUPRC (Davis & Goadrich, 2006) can give better insights about the classification performance as compared to AUC score. The proposed model consistently achieves the best average score over all the metrics. We note that a paired t-test indicates that the proposed model results in statistically significant improvements over all baseline models $\mathit { p } < 0 . 0 1 )$ with respect to all the metrics except median absolute error. The version of the proposed model used in this experiment includes all three interpolation network outputs (smooth interpolation, transients, and intensity function).
|
| 145 |
+
|
| 146 |
+
An ablation study shows that the results on the regression task can be further improved by using only two outputs (transients, and intensity function), achieving statistically significant improvements over all the baselines. Results for the ablation study are given in Appendix A.3. Finally, we compare the proposed model with multiple baselines on a previous MIMIC-III benchmark dataset (Harutyunyan et al., 2017), which uses a reduced number of cohorts as compared to the one used in our experiments. Appendix A.4 shows the results on this benchmark dataset, where our proposed approach again outperforms prior approaches.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 2: Classification performance on the UWaveGesture dataset. Models with almost same performance are shown with the same dot e.g. (GRU-M, GRU-F ) and (GRU-D, GRU-HD).
|
| 150 |
+
|
| 151 |
+
Table 1: Performance on Mortality (classification) and Length of stay prediction (regression) tasks on MIMIC-III. Loss: Cross-Entropy Loss, MedAE: Median Absolute Error (in days), EV: Explained variance
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Model</td><td colspan="3">Classification</td><td colspan="2">Regression</td></tr><tr><td></td><td>AUC</td><td>AUPRC</td><td>Loss</td><td>MedAE</td><td>EV score</td></tr><tr><td>Log/LinReg</td><td>0.772 ± 0.013</td><td>0.303 ±0.018</td><td>0.240±0.003</td><td>3.528 ± 0.072</td><td>0.043 ± 0.012</td></tr><tr><td>SVM</td><td>0.671 ± 0.005</td><td>0.300 ± 0.011</td><td>0.260±0.002</td><td>3.523 ± 0.071</td><td>0.042 ± 0.011</td></tr><tr><td>AdaBoost</td><td>0.829 ±0.007</td><td>0.345 ± 0.007</td><td>0.663 ±0.000</td><td>4.517 ± 0.234</td><td>0.100 ±0.012</td></tr><tr><td>RF</td><td>0.826 ±0.008</td><td>0.356 ± 0.010</td><td>0.315 ± 0.025</td><td>3.113 ± 0.125</td><td>0.117 ±0.035</td></tr><tr><td>GRU-M</td><td>0.831± 0.007</td><td>0.376 ± 0.022</td><td>0.220±0.004</td><td>3.140 ± 0.196</td><td>0.131 ± 0.044</td></tr><tr><td>GRU-F</td><td>0.821 ± 0.007</td><td>0.360 ± 0.013</td><td>0.224±0.003</td><td>3.064±0.247</td><td>0.126 ± 0.025</td></tr><tr><td>GRU-S</td><td>0.843±0.007</td><td>0.376 ± 0.014</td><td>0.218 ± 0.005</td><td>2.900±0.129</td><td>0.161 ± 0.025</td></tr><tr><td>GRU-D</td><td>0.835 ± 0.013</td><td>0.359 ± 0.025</td><td>0.225 ±0.009</td><td>2.891±0.103</td><td>0.146 ± 0.051</td></tr><tr><td>GRU-HD</td><td>0.845 ± 0.006</td><td>0.390 ± 0.010</td><td>0.215 ±0.004</td><td>2.893±0.155</td><td>0.158 ± 0.037</td></tr><tr><td>GP-GRU</td><td>0.847 ± 0.007</td><td>0.377 ± 0.017</td><td>0.215 ± 0.004</td><td>2.847 ± 0.079</td><td>0.217 ±0.020</td></tr><tr><td>Proposed</td><td>0.853 ±0.007</td><td>0.418 ± 0.022</td><td>0.210±0.004</td><td>2.862±0.166</td><td>0.245 ± 0.019</td></tr></table>
|
| 154 |
+
|
| 155 |
+
# 5 DISCUSSION AND CONCLUSIONS
|
| 156 |
+
|
| 157 |
+
In this paper, we have presented a new framework for dealing with the problem of supervised learning in the presence of sparse and irregularly sampled time series. The proposed framework is fully modular. It uses an interpolation network to accommodate the complexity that results from using sparse and irregularly sampled data as supervised learning inputs, followed by the application of a prediction network that operates over the regularly spaced and fully observed, multi-channel output provided by the interpolation network. The proposed approach also addresses some difficulties with prior approaches including the complexity of the Gaussian process interpolation layers used in (Li & Marlin, 2016; Futoma et al., 2017), and the lack of modularity in the approach of Che et al. (2018a). Our framework also introduces novel elements including the use of semi-parametric, feed-forward interpolation layers, and the decomposition of an irregularly sampled input time series into multiple distinct information channels. Our results show statistically significant improvements for both classification and regression tasks over a range of baseline and state-of-the-art methods.
|
| 158 |
+
|
| 159 |
+
# ACKNOWLEDGEMENTS
|
| 160 |
+
|
| 161 |
+
This work was supported by the National Science Foundation under Grant No. IIS-1350522.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Gustavo EAPA Batista and Maria Carolina Monard. An analysis of four missing data treatment methods for supervised learning. Applied artificial intelligence, 17(5-6):519–533, 2003.
|
| 166 |
+
|
| 167 |
+
Mikolaj Binkowski, Gautier Marti, and Philippe Donnat. Autoregressive convolutional neural networks for asynchronous time series. 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. 580–589, Stockholmsmassan, Stockholm Sweden, 10–15 Jul 2018. ¨ PMLR. URL http://proceedings.mlr.press/v80/binkowski18a.html.
|
| 168 |
+
|
| 169 |
+
Edwin V Bonilla, Kian M Chai, and Christopher Williams. Multi-task gaussian process prediction. In Advances in neural information processing systems, pp. 153–160, 2008.
|
| 170 |
+
|
| 171 |
+
Leo Breiman. Random forests. Mach. Learn., 45(1):5–32, October 2001. ISSN 0885-6125. doi: 10.1023/A:1010933404324. URL https://doi.org/10.1023/A:1010933404324.
|
| 172 |
+
|
| 173 |
+
Zhengping Che, Sanjay Purushotham, Kyunghyun Cho, David Sontag, and Yan Liu. Recurrent neural networks for multivariate time series with missing values. Scientific Reports, 8(1):6085, 2018a. URL https://doi.org/10.1038/s41598-018-24271-9.
|
| 174 |
+
|
| 175 |
+
Zhengping Che, Sanjay Purushotham, Guangyu Li, Bo Jiang, and Yan Liu. Hierarchical deep generative models for multi-rate multivariate time series. 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. 784–793, Stockholmsmassan, Stockholm Sweden, 10–15 ¨ Jul 2018b. PMLR. URL http://proceedings.mlr.press/v80/che18a.html.
|
| 176 |
+
|
| 177 |
+
Junyoung Chung, C¸ aglar G ˘ ulc¸ehre, Kyunghyun Cho, and Yoshua Bengio. Empirical evaluation ¨ of gated recurrent neural networks on sequence modeling. arXiv e-prints, abs/1412.3555, 2014. URL https://arxiv.org/abs/1412.3555. Presented at the Deep Learning workshop at NIPS2014.
|
| 178 |
+
|
| 179 |
+
J.S. Clark and O.N. Bjørnstad. Population time series: process variability, observation errors, missing values, lags, and hidden states. Ecology, 85(11):3140–3150, 2004.
|
| 180 |
+
|
| 181 |
+
Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine Learning, 20(3):273– 297, Sep 1995. ISSN 1573-0565. doi: 10.1007/BF00994018. URL https://doi.org/10. 1007/BF00994018.
|
| 182 |
+
|
| 183 |
+
Jesse Davis and Mark Goadrich. The relationship between precision-recall and roc curves. In Proceedings of the 23rd International Conference on Machine Learning, ICML ’06, pp. 233– 240, New York, NY, USA, 2006. ACM. ISBN 1-59593-383-2. doi: 10.1145/1143844.1143874. URL http://doi.acm.org/10.1145/1143844.1143874.
|
| 184 |
+
|
| 185 |
+
Harris Drucker. Improving regressors using boosting techniques. In Proceedings of the Fourteenth International Conference on Machine Learning, ICML ’97, pp. 107–115, San Francisco, CA, USA, 1997. Morgan Kaufmann Publishers Inc. ISBN 1-55860-486-3. URL http://dl.acm. org/citation.cfm?id=645526.657132.
|
| 186 |
+
|
| 187 |
+
Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. J. Comput. Syst. Sci., 55(1):119–139, August 1997. ISSN 0022-0000. doi: 10.1006/jcss.1997.1504. URL http://dx.doi.org/10.1006/jcss.1997.1504.
|
| 188 |
+
|
| 189 |
+
Joseph Futoma, Sanjay Hariharan, and Katherine A. Heller. Learning to detect sepsis with a multitask gaussian process RNN classifier. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 1174–1182, 2017. URL http://proceedings.mlr.press/v70/futoma17a.html.
|
| 190 |
+
|
| 191 |
+
Hrayr Harutyunyan, Hrant Khachatrian, David Kale, and Aram Galstyan. Multitask learning and benchmarking with clinical time series data. 03 2017.
|
| 192 |
+
|
| 193 |
+
Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer Series in Statistics. Springer New York Inc., New York, NY, USA, 2001.
|
| 194 |
+
|
| 195 |
+
David W Hosmer Jr, Stanley Lemeshow, and Rodney X Sturdivant. Applied logistic regression, volume 398. John Wiley & Sons, 2013.
|
| 196 |
+
|
| 197 |
+
Alistair EW Johnson, Tom J Pollard, Lu Shen, H Lehman Li-wei, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. Mimic-iii, a freely accessible critical care database. Scientific data, 3:160035, 2016.
|
| 198 |
+
|
| 199 |
+
Diederik P Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. arXiv preprint arXiv:1506.02557, 2015.
|
| 200 |
+
|
| 201 |
+
Thomas A Lasko. Efficient inference of gaussian-process-modulated renewal processes with application to medical event data. In Uncertainty in artificial intelligence: proceedings of the... conference. Conference on Uncertainty in Artificial Intelligence, volume 2014, pp. 469. NIH Public Access, 2014.
|
| 202 |
+
|
| 203 |
+
Steven Cheng-Xian Li and Benjamin M Marlin. A scalable end-to-end gaussian process adapter for irregularly sampled time series classification. In Advances In Neural Information Processing Systems, pp. 1804–1812, 2016.
|
| 204 |
+
|
| 205 |
+
Steven Cheng-Xian Li and Benjmain M. Marlin. Classification of sparse and irregularly sampled time series with mixtures of expected Gaussian kernels and random features. In 31st Conference on Uncertainty in Artificial Intelligence, 2015.
|
| 206 |
+
|
| 207 |
+
Zachary C Lipton, David Kale, and Randall Wetzel. Directly modeling missing data in sequences with rnns: Improved classification of clinical time series. In Machine Learning for Healthcare Conference, pp. 253–270, 2016.
|
| 208 |
+
|
| 209 |
+
Roderick JA Little and Donald B Rubin. Statistical analysis with missing data, volume 333. John Wiley & Sons, 2014.
|
| 210 |
+
|
| 211 |
+
Jiayang Liu, Zhen Wang, Lin Zhong, Jehan Wickramasuriya, and Venu Vasudevan. uwave: Accelerometer-based personalized gesture recognition and its applications. In Proceedings of the 2009 IEEE International Conference on Pervasive Computing and Communications, PERCOM ’09, pp. 1–9, Washington, DC, USA, 2009. IEEE Computer Society. ISBN temp-isbn. doi: 10.1109/PERCOM.2009.4912759. URL https://doi.org/10.1109/PERCOM.2009. 4912759.
|
| 212 |
+
|
| 213 |
+
Zhengdong Lu, Todd K. Leen, Yonghong Huang, and Deniz Erdogmus. A reproducing kernel hilbert space framework for pairwise time series distances. In Proceedings of the 25th International Conference on Machine Learning, ICML ’08, pp. 624–631, New York, NY, USA, 2008. ACM. ISBN 978-1-60558-205-4. doi: 10.1145/1390156.1390235. URL http://doi.acm.org/ 10.1145/1390156.1390235.
|
| 214 |
+
|
| 215 |
+
Benjamin M. Marlin, David C. Kale, Robinder G. Khemani, and Randall C. Wetzel. Unsupervised pattern discovery in electronic health care data using probabilistic clustering models. In Proceedings of the 2nd ACM SIGHIT International Health Informatics Symposium, pp. 389–398, 2012.
|
| 216 |
+
|
| 217 |
+
Carl Edward Rasmussen. Gaussian processes for machine learning. 2006.
|
| 218 |
+
|
| 219 |
+
T. Ruf. The lomb-scargle periodogram in biological rhythm research: analysis of incomplete and unequally spaced time-series. Biological Rhythm Research, 30(2):178–201, 1999.
|
| 220 |
+
|
| 221 |
+
Ruslan Salakhutdinov, Andriy Mnih, and Geoffrey Hinton. Restricted boltzmann machines for collaborative filtering. In Proceedings of the 24th international conference on Machine learning, pp. 791–798. ACM, 2007.
|
| 222 |
+
|
| 223 |
+
Jeffrey D Scargle. Studies in astronomical time series analysis. ii-statistical aspects of spectral analysis of unevenly spaced data. The Astrophysical Journal, 263:835–853, 1982.
|
| 224 |
+
|
| 225 |
+
M. Schulz and K. Stattegger. Spectrum: Spectral analysis of unevenly spaced paleoclimatic time series. Computers & Geosciences, 23(9):929–945, 1997.
|
| 226 |
+
|
| 227 |
+
Jonathan AC Sterne, Ian R White, John B Carlin, Michael Spratt, Patrick Royston, Michael G Kenward, Angela M Wood, and James R Carpenter. Multiple imputation for missing data in epidemiological and clinical research: potential and pitfalls. Bmj, 338:b2393, 2009.
|
| 228 |
+
|
| 229 |
+
David Williams, Xuejun Liao, Ya Xue, and Lawrence Carin. Incomplete-data classification using logistic regression. In Proceedings of the 22nd International Conference on Machine learning, pp. 972–979. ACM, 2005.
|
| 230 |
+
|
| 231 |
+
Pranjul Yadav, Michael Steinbach, Vipin Kumar, and Gyorgy Simon. Mining electronic health records (ehrs): A survey. ACM Computing Surveys (CSUR), 50(6):85, 2018.
|
| 232 |
+
|
| 233 |
+
Jinsung Yoon, William R. Zame, and Mihaela van der Schaar. Multi-directional recurrent neural networks : A novel method for estimating missing data. 2017.
|
| 234 |
+
|
| 235 |
+
# A APPENDIX
|
| 236 |
+
|
| 237 |
+
# A.1 DATASET DESCRIPTIONS
|
| 238 |
+
|
| 239 |
+
# A.1.1 MIMIC-III DATASET
|
| 240 |
+
|
| 241 |
+
We evaluate our model framework on the publicly available MIMIC-III dataset (Johnson et al., 2016). MIMIC-III is a de-identified dataset collected at Beth Israel Deaconess Medical Center from 2001 to 2012. It consists of approximately 58,000 hospital admission records. This data set contains sparse and irregularly sampled physiological signals, medications, diagnostic codes, inhospital mortality, length of stay and more. We focus on predicting in-hospital mortality and length of stay using the first 48 hours of data. We extracted 12 standard physiological variables from each of the 53,211 records obtained after removing hospital admission records with length of stay less than 48 hours. Table 2 shows the features, sampling rates (per hour) and their missingness information computed using the union of all time stamps that exist in any dimension of the input time series.
|
| 242 |
+
|
| 243 |
+
Table 2: Features extracted from MIMIC III for our experiments
|
| 244 |
+
|
| 245 |
+
<table><tr><td>feature</td><td>#Missing</td><td> Sampling Rate</td></tr><tr><td>SpO2</td><td>31.35%</td><td>0.80</td></tr><tr><td>HR</td><td>23.23%</td><td>0.90</td></tr><tr><td>RR</td><td>59.48%</td><td>0.48</td></tr><tr><td>SBP</td><td>49.76%</td><td>0.59</td></tr><tr><td>DBP</td><td>48.73%</td><td>0.60</td></tr><tr><td>Temp</td><td>83.80%</td><td>0.19</td></tr></table>
|
| 246 |
+
|
| 247 |
+
<table><tr><td>feature</td><td>#Missing</td><td> Sampling Rate</td></tr><tr><td>TGCS</td><td>87.94%</td><td>0.14</td></tr><tr><td>CRR</td><td>95.08%</td><td>0.06</td></tr><tr><td>UO</td><td>82.47%</td><td>0.20</td></tr><tr><td>FiO2</td><td>94.82%</td><td>0.06</td></tr><tr><td>Glucose</td><td>91.47%</td><td>0.10</td></tr><tr><td>pH</td><td>96.25%</td><td>0.04</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Prediction Tasks
|
| 250 |
+
|
| 251 |
+
In our experiments, each admission record corresponds to one data case $( \mathbf { s } _ { \mathbf { n } } , y _ { n } )$ . Each data case $n$ consists of a sparse and irregularly sampled time series ${ \bf s } _ { n }$ with $D \ = \ 1 2$ dimensions. Each dimension $d$ of ${ \bf s } _ { n }$ corresponds to one of the 12 vital sign time series mentioned above. In the case of classification, $y _ { n }$ is a binary indicator where $y _ { n } = 1$ indicates that the patient died at any point within the hospital stay following the first 48 hours and $y _ { n } ~ = ~ 0$ indicates that the patient was discharged at any point after the first 48 hours. There are 4310 $( 8 . 1 \% )$ patients with a $y _ { n } = 1$ mortality label. The complete data set is $\mathcal { D } = \{ ( \mathbf { s _ { n } } , y _ { n } ) | n = 1 , . . . , N \}$ , and there are $N = 5 3 , 2 1 1$ data cases. The goal in the classification task is to learn a classification function $g$ of the form $\hat { y } _ { n } \gets g ( \mathbf { s } _ { n } )$ where ${ \hat { y } } _ { n }$ is a discrete value.
|
| 252 |
+
|
| 253 |
+
In the case of regression, $y _ { n }$ is a real-valued regression target corresponding to the length of stay. Since the data set includes some very long stay durations, we let $y _ { n }$ represent the log of the length of stay in days for all models. We convert back from the log number of days to the number of days when reporting results. The complete data set is again $\mathcal { D } = \{ ( \mathbf { s _ { n } } , y _ { n } ) | n = 1 , . . . , N \}$ with $N = 5 3$ , 211 data cases (we again require 48 hours worth of data). The goal in the regression task is to learn a regression function $g$ of the form ${ \hat { y } } _ { n } \gets g ( \mathbf { s } _ { n } )$ where ${ \hat { y } } _ { n }$ is a continuous value.
|
| 254 |
+
|
| 255 |
+
# A.1.2 UWAVE DATASET
|
| 256 |
+
|
| 257 |
+
UWave dataset is an univariate time series data consisting of simple gesture patterns divided into eight categories. The dataset has been split into 3582 train and 896 test instances. Out of the training data, $30 \%$ is used for validation. Each time series contains 945 observations. We follow the same data preparation method as in Li & Marlin (2016) where we randomly sample $10 \%$ of the observations points from each time series to create a sparse and irregularly sampled data.
|
| 258 |
+
|
| 259 |
+
# A.2 IMPLEMENTATION DETAILS
|
| 260 |
+
|
| 261 |
+
# A.2.1 PROPOSED MODEL
|
| 262 |
+
|
| 263 |
+
The model is learned using the Adam optimization method in TensorFlow with gradients provided via automatic differentiation. However, the actual multivariate time series representation used during learning is based on the union of all time stamps that exist in any dimension of the input time series. Undefined observations are represented as zeros and a separate missing data mask is used to keep track of which time series have observations at each time point. Equations 1 to 5 are modified such that data that are not available are not taken into account at all. This implementation is exactly equivalent to the computations described, but supports parallel computation across all dimensions of the time series for a given data case.
|
| 264 |
+
|
| 265 |
+
Finally, we note that the learning problem can be solved using a doubly stochastic gradient based on the use of mini batches combined with re-sampling the artificial missing data masks used in the interpolation loss. In practice, we randomly select $2 0 \%$ of the observed data points to hold out from every input time series.
|
| 266 |
+
|
| 267 |
+
For the time series missing entirely, our interpolation network assigns the starting point (time $\scriptstyle { \mathrm { t } } = 0$ ) value of the time series to the global mean before applying the two-layer interpolation network. In such cases, the first interpolation layer just outputs the global mean for that channel, but the second interpolation layer performs a more meaningful interpolation using the learned correlations from other channels.
|
| 268 |
+
|
| 269 |
+
# A.2.2 BASELINES
|
| 270 |
+
|
| 271 |
+
The Logistic Regression model is trained with cross entropy loss with regularization strength set to 1. The support vector classifier is used with a RBF kernel and trained to minimize the soft margin loss. We use the cross entropy loss on the validation set to select the optimal number of estimators in case of Adaboost and Random Forest. Similar to the classification setting, the optimal number of estimators for regression task in Adaboost and Random Forest is chosen on the basis of squared error on validation set.
|
| 272 |
+
|
| 273 |
+
# MIMIC-III DATASET
|
| 274 |
+
|
| 275 |
+
We evaluate all models using a five-fold cross-validation estimate of generalization performance. In the classification setting, all the deep learning baselines are trained to minimize the cross entropy loss while the proposed model uses a composite loss consisting of cross-entropy loss and interpolation loss (with $\delta _ { R } = 1 \mathrm { \Delta }$ ) as described in section 3.2.3. In the case of the regression task, all baseline models are trained to minimize squared error and the proposed model is again trained with a composite loss consisting of squared error and interpolation loss.
|
| 276 |
+
|
| 277 |
+
We follow the multi-task Gaussian process implementation given by Futoma et al. (2017) and treat the number of hidden units and hidden layers as hyper-parameters. For all of the GRU-based models, we use the already specified parameters (Che et al., 2018a). The models are learned using the Adam optimization. Early stopping is used on a validation set sub-sampled from the training folds. In the classification case, the final outputs of the GRU hidden units are used in a logistic layer that predicts the class. In the regression case, the final outputs of the GRU hidden units are used as input for a dense hidden layer with 50 units, followed by a linear output layer.
|
| 278 |
+
|
| 279 |
+
# UWAVE DATASET
|
| 280 |
+
|
| 281 |
+
We independently tune the hyper-parameters of each baseline method. For GRU-based methods, hidden units are searched over the range $\{ 2 ^ { 5 } , 2 ^ { 6 } , \cdots , 2 ^ { 1 1 } \}$ . Learning is done in same way as described above. We evaluate all the baseline models on the test set and compare the training time and accuracy. For the Gaussian process model, we use the squared exponential covariance function. We use the same number of inducing points for both the Gaussian process and the proposed model. The Gaussian process model is jointly trained with the GRU using stochastic gradient descent with Nesterov momentum. We apply early stopping based on the validation set.
|
| 282 |
+
|
| 283 |
+
# A.3 ADDITIONAL EXPERIMENTS
|
| 284 |
+
|
| 285 |
+
In this section, we address the question of the relative information content of the different outputs produced by the interpolation network used in the proposed model for MIMIC-III dataset. Recall that for each of the $D = 1 2$ vital sign time series, the interpolation network produces three outputs: a smooth interpolation output (SI), a non-smooth or transient output (T), and an intensity function (I). The above results use all three of these outputs.
|
| 286 |
+
|
| 287 |
+
To assess the impact of each of the interpolation network outputs, we conduct a set of ablation experiments where we consider using all sub-sets of outputs for both the classification task and for the regression task.
|
| 288 |
+
|
| 289 |
+
Table 3 shows the results from five-fold cross validation mortality and length of stay prediction experiments. When using each output individually, smooth interpolation (SI) provides the best performance in terms of classification. Interestingly, the intensity output is the best single information source for the regression task and provides at least slightly better mean performance than any of the baseline methods shown in Table 1. Also interesting is the fact that the transients output performs significantly worse when used alone than either the smooth interpolation or the intensity outputs in the classification task.
|
| 290 |
+
|
| 291 |
+
Table 3: Performance of all subsets of the interpolation network outputs on Mortality (classification) and Length of stay prediction (regression) tasks. SI: Smooth Interpolation, I: Intensity, T: Transients, Loss: Cross-Entropy Loss, MedAE: Median Absolute Error, EV: Explained variance
|
| 292 |
+
|
| 293 |
+
<table><tr><td>Model</td><td colspan="3">Classification</td><td colspan="2">Regression</td></tr><tr><td></td><td>AUC</td><td>AUPRC</td><td>Loss</td><td>MedAE</td><td>EV score</td></tr><tr><td>SI, T,I</td><td>0.853 ± 0.007</td><td>0.418 ± 0.022</td><td>0.210 ± 0.004</td><td>2.862 ±0.166</td><td>0.245 ± 0.019</td></tr><tr><td>SI,I</td><td>0.852 ± 0.005</td><td>0.408 ± 0.017</td><td>0.210± 0.004</td><td>2.745 ±0.062</td><td>0.224±0.010</td></tr><tr><td>SI,T</td><td>0.820 ±0.008</td><td>0.355 ± 0.024</td><td>0.226 ±0.005</td><td>2.911 ± 0.073</td><td>0.182 ± 0.009</td></tr><tr><td>SI</td><td>0.816 ±0.009</td><td>0.354±0.018</td><td>0.226 ±0.005</td><td>3.035 ± 0.063</td><td>0.183 ± 0.016</td></tr><tr><td>I</td><td>0.786 ± 0.010</td><td>0.250 ±0.012</td><td>0.241±0.003</td><td>2.697± 0.072</td><td>0.251±0.009</td></tr><tr><td>I,T</td><td>0.755 ± 0.012</td><td>0.236 ± 0.014</td><td>0.272 ±0.010</td><td>2.738 ±0.101</td><td>0.290 ±0.010</td></tr><tr><td>T</td><td>0.705 ± 0.009</td><td>0.192 ±0.008</td><td>0.281±0.004</td><td>2.995±0.130</td><td>0.207±0.024</td></tr></table>
|
| 294 |
+
|
| 295 |
+
When considering combinations of interpolation network components, we can see that the best performance is obtained when all three outputs are used simultaneously in classification tasks. For the regression task, the intensity output provides better performance in terms of median absolute error while a combination of intensity and transients output provide better explained variance score. However, the use of the transients output contributes almost no improvement in the case of the AUC and cross entropy loss for classification relative to using only smooth interpolation and intensity. Interestingly, in the classification case, there is a significant boost in performance by combining smooth interpolation and intensity relative to using either output on its own. In the regression setting, smooth interpolation appears to carry little information.
|
| 296 |
+
|
| 297 |
+
# A.4 BENCHMARK MIMIC-III DATASET
|
| 298 |
+
|
| 299 |
+
In this section, we compare the performance of the proposed model on a previous MIMIC-III benchmark dataset (Harutyunyan et al., 2017). This dataset only consists of patients with age $> 1 8$ . Again, we focus on predicting in-hospital mortality using the first 48 hours of data. This yields training and test sets of size 17,903 and 3,236 records respectively.
|
| 300 |
+
|
| 301 |
+
We compare the proposed model to multiple baselines from Harutyunyan et al. (2017). In all the baselines, the sparse and irregularly sampled time-series data has been discretized into 1-hour intervals. If there are multiple observations in an interval, the mean or last observation is assigned to that interval, depending on the baseline method. Similarly, if an interval contains no observations, the mean or forward filling approach is used to assign a value depending on the baseline method. We compare with a logistic regression model and a standard LSTM network. In the multitask setting, multiple tasks are predicted jointly. Unlike the standard LSTM network where the output/hiddenstate from the last time step is used for prediction, we provide supervision to the model at each time step. In this experiment, we use an LSTM as the prediction network in the proposed model to match the baselines.
|
| 302 |
+
|
| 303 |
+
Table 4: Classification performance for in-hospital mortality prediction task on benchmark dataset
|
| 304 |
+
|
| 305 |
+
<table><tr><td>Model</td><td>AUC score</td><td>AUPRC score</td></tr><tr><td>Logistic Regression</td><td>0.8485</td><td>0.4744</td></tr><tr><td>LSTM</td><td>0.8547</td><td>0.4848</td></tr><tr><td>LSTM+ Deep Supervision</td><td>0.8558</td><td>0.4928</td></tr><tr><td>MultitaskLSTM</td><td>0.8607</td><td>0.4933</td></tr><tr><td>Interpolation Network +LSTM</td><td>0.8610</td><td>0.5370</td></tr></table>
|
md/train/rJfHoM-C-/rJfHoM-C-.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEW-SHOT LEARNING WITH SIMPLEX
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep learning has made remarkable achievement in many fields. However, learning the parameters of neural networks usually demands a large amount of labeled data. The algorithms of deep learning, therefore, encounter difficulties when applied to supervised learning where only little data are available. This specific task is called few-shot learning. To address it, we propose a novel algorithm for fewshot learning using discrete geometry, in the sense that the samples in a class are modeled as a reduced simplex. The volume of the simplex is used for the measurement of class scatter. During testing, combined with the test sample and the points in the class, a new simplex is formed. Then the similarity between the test sample and the class can be quantized with the ratio of volumes of the new simplex to the original class simplex. Moreover, we present an approach to constructing simplices using local regions of feature maps yielded by convolutional neural networks. Experiments on Omniglot and miniImageNet verify the effectiveness of our simplex algorithm on few-shot learning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has exhibited outstanding ability in various disciplines including computer vision, natural language processing and speech recognition (LeCun et al., 2015). For instance, AlexNet has made a breakthrough on recognizing millions of imagery objects by means of deep Convolutional Neural Network (CNN) (Krizhevsky et al., 2012). In the past five years, the algorithmic capability of comprehending visual concepts has been significantly improved by elaborately well-designed deep learning architectures (He et al., 2015a; Szegedy et al., 2014). However, training deep neural networks such as the widely employed CNNs of AlexNet (Krizhevsky et al., 2012), Inception (Szegedy et al., 2015), VGG (Simonyan & Zisserman, 2014), and ResNet (He et al., 2015b), needs the supervision of many class labels which are handcrafted. For example, the number of samples of each class in the ImageNet of object recognition benchmark (Russakovsky et al., 2015) is more than one thousand. In fact, the number of labelled samples used for learning parameters of CNNs is far more than that because data augmentation is usually applied. This kind of learning obviously deviates from the manner of human cognition. A child can recognize a new object that she/he has never seen only by several examples, from simple shapes like rectangles to highly semantic animals like tigers. However, deep learning algorithms encounter difficulty in such scenarios where only very sparse data are available for learning to recognize a new category, thus raising the research topic of one-shot learning or few-shot learning (Fei-Fei et al., 2003; Tenenbaum et al., 2011).
|
| 12 |
+
|
| 13 |
+
The seminal work Fei-Fei et al. (2006) models few-shot learning with the Bayesian framework. Empirical knowledge of available categories is learned and parameterized as a probability density function. The unseen class with a handful of examples is modeled as the posterior by updating the prior. Bayesian theory provides a simple and elegant idea for solving learning problems with little data. If decomposed into parts or programs, an object can be described by the joint distribution of Bayesian criterion. In this manner, human-level performance on one-shot learning has been derived for discovering simple visual concepts such as ancient handwritten characters (Lake et al., 2015).
|
| 14 |
+
|
| 15 |
+
With the prevalence of deep learning, the recent work for few-shot learning focuses on the application of deep neural networks that have more capacity to accommodate the complexity of object representations. Siamese neural network facilitates the performance of few-shot recognition by means of twin networks of sharing parameters, optimizing the distances of representative features in intraclasses (Koch et al., 2015). The counterpart of learning data structures by distance is also formulated by triplet loss in Lin et al. (2017). Researchers in Lin et al. (2017) assert that the distance metrics can learn the intrinsic manifold structures of training data such that the network is more general and robust when employed for untrained objects. A very recent work pertaining to distance-based optimization, named Prototypical Networks (Snell et al., 2017), significantly improves the capability of few-shot recognition. Prototypical Networks attempt to minimize the distance of the test sample to the center of each class and are learned in the end-to-end manner.
|
| 16 |
+
|
| 17 |
+
Memory-augmented architectures are also proposed to help assimilate new classes with more accurate inference (Santoro et al., 2016). Matching network embeds metric learning in neural network in the light of attention mechanism which is embodied by softmax (Vinyals et al., 2016). In a very recent work, the large-scale memory without the need of resetting during training is formulated as an embedded module for arbitrary neural networks to remember the information of rare events (Kaiser et al., 2017). In order to obtain rapid learning with limited samples, meta learning is exploited both in memory network and matching network. This “learning to learn” technique is extended to deal with few-shot learning from the point of view of optimization (Ravi & Larochelle, 2017). To be specific, a LSTM-based meta learner learns to mimic the exact optimization algorithm and then harnesses the acquired capability to train the learner applied for the few-shot cases. The latest meta learning algorithms also deal with few-shot learning from different angles, e.g. the fast adaptation of neural networks (Finn et al., 2017), and temporal convolution (Mishra et al., 2017).
|
| 18 |
+
|
| 19 |
+
In addition to the application of memory module or attention model in LSTM, there is another type of algorithms digging the effective way of transferring the discriminative power of pre-trained models to few-shot circumstances. Resorting to the correlation between the activations in the last feature layers and the associated parameters for softmax, a transformation is learned to derive the parameters for predicting new classes from corresponding activations (Qiao et al., 2017).
|
| 20 |
+
|
| 21 |
+
The algorithms based on deep learning can learn more expressive representations for objects, essentially boosting the quality of feature extraction. However, the softmax classifier discriminates all categories by class boundaries, bypassing the steps that carefully characterize the structure of each class. Thus the algorithmic performance will deteriorate grossly if the distribution of new class cannot be accurately modeled by trained networks. Besides softmax, another commonly applied method, $k$ nearest neighbors (KNN), is a point-to-point measurement and is incapable of conveying global structural information.
|
| 22 |
+
|
| 23 |
+
To address this issue, we propose a geometric method for few-shot learning. Our perspective is that accurate geometric characterization for each class is essential when only a handful of samples are available, because such sparse data are usually insufficient to fit well-converged parameterized classifier. To this end, we harness convex polytope to fit a class, in the sense that we construct a convex polytope by selecting the samples in the class as the vertices of the polytope. The volume of the polytope is taken as the measurement of class scatter. Thus the polytopal volume may be improved after including the query sample in the test set during the testing trial. The normalized volume with respect to the original counterpart is applied to compute the distance from the test sample to the test set. To highlight the structural details of object parts, we present the construction of polytope based on convolutional feature maps as well.
|
| 24 |
+
|
| 25 |
+
To the best of our understanding, however, there is no exact formula to calculating the volume of general convex polytope. To make our algorithm feasible, therefore, we use the simplest convex polytope — simplex instead. The volume of a simplex can be expressed by the Cayley-Menger determinant (Cayley, 2009), thus casting the problem of few-shot recognition as a simple calculation of linear algebra. Experiments on Omniglot and miniImageNet datasets verify the effectiveness of our simple algorithm.
|
| 26 |
+
|
| 27 |
+
# 2 MODELING CLASS WITH SIMPLEX
|
| 28 |
+
|
| 29 |
+
It is known that by proper embedding, the feature representations of images or documents in the same class spatially cluster together. Each feature vector with a length of $d$ , in its nature, corresponds to a point in $d$ -dimensional space. We model each class as a polytope, with feature representation of each data point in this class as its vertex.
|
| 30 |
+
|
| 31 |
+
Our approach is based on the idea that feature vectors of the test sample will be close to the polytope of its own class, formed by feature vectors of the corresponding examples, and distant from the others. Hence, we can perform the classification by finding the ’nearest’ class polytope to which the test point belongs, using carefully designed distance metrics associated with the content of polytope.
|
| 32 |
+
|
| 33 |
+
As we point out in the introduction, there is no exact solution to computing the volume of a polytope. Therefore, we resort to the simplex to accomplish our idea. The simplex is the simplest counterpart of convex polytope and its volume admits a closed form expression. So we focus our attention on simplex to develop our algorithm.
|
| 34 |
+
|
| 35 |
+
# 2.1 SIMPLEX
|
| 36 |
+
|
| 37 |
+
A simplex is the conceptual extension of a triangle in high-dimensional spaces. To be formal, let $\hat { \mathcal { Y } } = \{ y _ { 0 } , y _ { 1 } , \dotsc , y _ { n } \}$ denote a set of points in $\mathbb { R } ^ { d }$ . A simplex is the convex polytope with the condition of $n = d$ , implying that there needs exact $d + 1$ points to constitute a simplex in the $d$ -dimensional space. For convenience, we call such a simplex the $d$ -simplex. For instance, a line is a 1-simplex, a triangle is a 2-simplex, and a tetrahedron is a 3-simplex. Moreover, a line has the length, a triangle has the area, and a tetrahedron has the volume. In convention, we use the contents to represent the length, the area, and the volume (Weisstein, 2002).
|
| 38 |
+
|
| 39 |
+
A particularly intriguing property of the simplex is that its content can be written in a closed form by virtue of the Cayley-Menger determinant (Cayley, 2009). To show this, let $A = [ y _ { 1 } - y _ { 0 } , \dotsc , y _ { n } - y _ { 0 } ]$ and the Cayley-Menger matrix
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
{ \hat { P } } = \left[ { \begin{array} { c c } { 0 } & { e ^ { T } } \\ { e } & { P } \end{array} } \right] ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $e$ denotes the all-one column vector of length $n + 1$ , $T$ presents the transpose of a matrix or a vector, and the entry $P _ { i j }$ of the distance matrix $P$ is of form $P _ { i j } = \| y _ { i } - y _ { j } \| ^ { 2 }$ . The content of simplex $\hat { \mathcal { V } }$ has two expressions that coincide with each other, showing that
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
C ^ { 2 } ( \hat { \mathcal { V } } ) = \frac { 1 } { ( n ! ) ^ { 2 } } \operatorname* { d e t } ( A ^ { T } A ) = \frac { - 1 } { ( - 2 ) ^ { n } ( n ! ) ^ { 2 } } \operatorname* { d e t } ( \hat { P } ) ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\operatorname* { d e t } ( A ^ { T } A )$ is the Gram determinant and $\operatorname* { d e t } ( \hat { P } )$ is the Cayley-Menger determinant. Our analysis is based on the application of formula (2).
|
| 52 |
+
|
| 53 |
+
# 2.2 DISTANCE MEASUREMENT WITH SIMPLEX
|
| 54 |
+
|
| 55 |
+
Let $\mathcal { V } = \{ y _ { 1 } , \ldots , y _ { n } \}$ be the feature set of an arbitrary class. These features can be derived from outputs of deep neural networks, e.g., CNN. It is clear that $\hat { Y } = \{ { \mathcal { Y } } \cup y _ { 0 } \}$ . Let $t$ denote a test sample. It is clear the content $C ( \mathcal { V } )$ of the corresponding simplex1 will be large if data points in $\mathcal { V }$ are sparse and small if compact. Therefore, $C ( \boldsymbol { y } )$ is a plausible measurement for the class scatter.
|
| 56 |
+
|
| 57 |
+
An exact $d$ -simplex will be formed during testing process if the test sample is merged into $\mathcal { V }$ . Then the associated content will be improved from $C ( \boldsymbol { y } )$ to $C ( \mathcal { y } \cup t )$ . The incremental content will be marginal if the feature point of the test sample is close to the class simplex, meaning the high correlation of the spatial proximity. Then the dissimilarity measurement of one test sample to one class can be written as
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\left( \ell ( t , \mathcal { Y } ) \right) ^ { \frac { 1 } { 2 } } = \frac { C ( \mathcal { Y } \cup t ) } { C ( \mathcal { Y } ) } .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Here the numerator $C ( \mathcal { V } )$ serves to eliminating the quantitative influence of the class scatter. The normalization is indispensable because for a large $C ( \boldsymbol { y } )$ , the incremental content $C ( \mathcal { Y } \cup t ) - C ( \mathcal { Y } )$ will be prone to be relatively large even if the test sample is close to the simplex.
|
| 64 |
+
|
| 65 |
+
To make it clear, we explicitly write $\ell ( t , \mathcal { Y } )$ . Let the Cayley-Menger matrix pertaining to simplex $\mathcal { V }$ be
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
{ \hat { Q } } = \left[ { \begin{array} { c c } { 0 } & { e ^ { T } } \\ { e } & { Q } \end{array} } \right] ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Visualization of simplices formed during a test episode in a $\mathbf { k }$ -way n-shot classification task, where $k { = } 5$ and $\scriptstyle n = 3$ . The points with the same color correspond to the same category and cluster together. Within each class, $k$ vertices form a $( k - 1 )$ -simplex (a triangle in the 2-dimensional plane). With the same embedding function, the test sample point $t$ is also mapped to this space. Combined with one class, a new simplex (tetrahedron in the 3-dimensional space) is obtained, located in the space of one dimension higher than the original one. It is not surprising that the test sample point $t$ is close to its own class while distant from the others, representing a certain degree of intra-class similarities and inter-class diversities.
|
| 73 |
+
|
| 74 |
+
where $Q _ { i j } = \| y _ { i } - y _ { j } \| ^ { 2 }$ and $i , j = 1 , \ldots , n$ . Then the content of the simplex formed by $\mathcal { V }$ can be written as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
C ^ { 2 } ( \mathcal { Y } ) = \frac { - 1 } { ( - 2 ) ^ { n - 1 } ( ( n - 1 ) ! ) ^ { 2 } } \operatorname* { d e t } ( \hat { Q } ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Substituting (2) and (5) into (3), we derive
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\ell ( t , \mathcal { Y } ) = - \frac { 1 } { 2 n ^ { 2 } } \frac { \operatorname* { d e t } ( \hat { P } ) } { \operatorname* { d e t } ( \hat { Q } ) } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $y _ { 0 } = t$ is implicitly assumed for $\hat { P }$ . It is straightforward to know that the smaller $\ell ( t , \mathcal { { y } } )$ is, the closer the test point to the class simplex.
|
| 87 |
+
|
| 88 |
+
To help intuitively understand our algorithm, a visual schematic example is shown in Figure 1, where the complete procedure is figuratively demonstrated.
|
| 89 |
+
|
| 90 |
+
# 2.3 ISOMETRIC EMBEDDING OF SIMPLEX
|
| 91 |
+
|
| 92 |
+
It is obvious that $\mathcal { V }$ cannot form a $d$ -simplex due to the number $| \mathcal { V } |$ of data points in $\mathcal { V }$ satisfies $| { \mathcal { y } } | = d$ , violating the definition of the $d$ -simplex. However, our model for the few-shot learning can proceed without any modification. To make this clear, we need to introduce the isometric embedding of the simplex.
|
| 93 |
+
|
| 94 |
+
The points on a geometric entity $\mathbb { R } ^ { d _ { e } }$ (manifolds or polytopes) can be expressed with coordinates when the entity is placed in an ambient space $\mathbb { R } ^ { d _ { a } }$ . Usually, the intrinsic dimension $d _ { e }$ is much less than the ambient dimension $d _ { a }$ , especially when $d _ { a }$ is large. Formally, there exists a function
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r } { f : \mathcal { R } ^ { d _ { e } } \to \mathbb { R } ^ { d _ { a } } } \\ { \tau \to f ( \tau ) } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 2: Isometric embedding preserves the geometric properties of a simplex.
|
| 102 |
+
|
| 103 |
+
For the question that we are interested in, $\mathcal { R } ^ { d _ { e } }$ is a simplex. Both $\mathcal { R } ^ { d _ { e } }$ and $\mathbb { R } ^ { d _ { a } }$ are Euclidean. The isometric embedding means $\lVert \boldsymbol { \tau } _ { i } - \boldsymbol { \tau } _ { j } \rVert = \lVert \boldsymbol { f } ( \boldsymbol { \tau } _ { i } ) - \dot { \boldsymbol { f } } ( \boldsymbol { \tau } _ { j } ) \rVert$ for an arbitrary pair of vertices. For a simplex $s$ in $\mathcal { R } ^ { d _ { e } }$ , therefore, the contents of $C ( S )$ and $C ( f ( S ) )$ satisfy the identity $C ( S ) =$ $C ( f ( S ) )$ under isometric embedding. That is to say, we can correlate the dimension of the simplex with the number of vertices under isometric embedding in the case where the number of vertices is insufficient to construct a $d _ { a }$ -simplex. This reduced simplex in the $\mathbb { R } ^ { d _ { a } }$ is obvious a low-dimensional one.
|
| 104 |
+
|
| 105 |
+
Two visual instances are illustrated in Figure 2, where a segment line of fixed length is a 1-simplex. It can be embedded in the 1-dimensional, 2-dimensional and 3-dimensional spaces, respectively. Certainly, we can apply the coordinates of different dimensions for these two endpoints. However, its length is constant in different ambient spaces due to the isometric embedding. When a simplex is mapped into a higher dimensional space by an isometric embedding, the coordinates of its vertices vary, whereas its geometric properties pertaining to distance remain unchanged. Therefore we can employ formula (6) to perform our algorithm.
|
| 106 |
+
|
| 107 |
+
For few-shot classification tasks, such reduced simplices are ubiquitous because feature representations of data points embedded by variously parameterized functions are always of high dimension while the number of available examples for a class is quite few. For example, images classification tasks generally require deep convolutional networks (such as VGGs or Inception) as the embedding function. The VGG16 network produces a long vector of 4096 dimensions after the final fully-connected layer. For a five-shot learning, however, there are only five examples in each class. Hence, the reduced simplices we actually exploit are of dimension four for the computation of $C ( \boldsymbol { y } )$ and dimension five for that of $C ( \mathcal { Y } \cup t )$ .
|
| 108 |
+
|
| 109 |
+
The above geometric analysis is reminiscent of the theoretic assumption in manifold learning (Tenenbaum et al., 2000; Roweis & Saul, 2000), especially the Isomap algorithm (Tenenbaum et al., 2000). Interested readers may refer to these two seminal papers in manifold learning for further understanding.
|
| 110 |
+
|
| 111 |
+
# 2.4 METRIC ANALYSIS
|
| 112 |
+
|
| 113 |
+
It is known that matching network is the extension of metric learning via attention model. Here we analyze the metric characteristic of our algorithm. This angle of analysis may be useful for digging deep insights of few-shot learning. To this end, we need to reveal the details of formula (6), which is described in Theorem 1.
|
| 114 |
+
|
| 115 |
+
Theorem 1. The geometric dissimilarity measurement $\ell ( t , \mathcal { { y } } )$ from point $t$ to $\mathcal { V }$ can be expanded as the following form
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\ell ( t , \mathcal { Y } ) = - \frac { 1 } { 2 n ^ { 2 } } \frac { e ^ { T } P ^ { - 1 } e } { e ^ { T } Q ^ { - 1 } e } p ^ { T } Q ^ { - 1 } p ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $p _ { i } = \| y _ { i } - t \| ^ { 2 }$ and
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
P = \left[ \begin{array} { c c } { { 0 } } & { { p ^ { T } } } \\ { { p } } & { { Q } } \end{array} \right] .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Proof. For matrices $S _ { 1 1 } , S _ { 1 2 } , S _ { 2 1 }$ , and $S _ { 2 2 }$ , the Schur’s determinant identity is the form
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\operatorname* { d e t } { \left[ \begin{array} { l l } { S _ { 1 1 } } & { S _ { 1 2 } } \\ { S _ { 2 1 } } & { S _ { 2 2 } } \end{array} \right] } = \operatorname* { d e t } ( S _ { 2 2 } ) \operatorname* { d e t } ( S _ { 1 1 } - S _ { 1 2 } ( S _ { 2 2 } ) ^ { - 1 } S _ { 2 1 } ) .
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
Applying the Schur’s determinant identity twice, we can obtain the expanded form of $\operatorname* { d e t } ( \hat { P } )$
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\operatorname* { d e t } ( \hat { P } ) = - e ^ { T } P ^ { - 1 } e \operatorname* { d e t } ( P ) = e ^ { T } P ^ { - 1 } e p ^ { T } Q ^ { - 1 } p \operatorname* { d e t } ( Q ) .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
By the same way, we can also obtain the analogous form of $\operatorname* { d e t } ( { \hat { Q } } )$
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\mathrm { d e t } ( \hat { Q } ) = - e ^ { T } Q ^ { - 1 } e \mathrm { d e t } ( Q ) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Substituting equations (10) and (11) into equation (6), we achieve the expansion of the measurement $\ell ( t , \mathcal { { y } } )$ in (7). This concludes the proof of Theorem 1. □
|
| 146 |
+
|
| 147 |
+
It is readily to know that both $Q$ and $P$ are not positive definite matrices. Hence $Q ^ { - 1 }$ and $P ^ { - 1 }$ cannot be viewed as metric matrices in (7) because there are negative eigenvalues. However, there still exists the explicit algebraic meaning. The first factor $w _ { 1 } = { \check { e } } ^ { T } P ^ { - 1 } e \left/ { \check { e } } ^ { T } Q ^ { - 1 } e \right.$ is an incremental ratio with respect to the class and the second factor $w _ { 2 } = p ^ { T } Q ^ { - 1 } p$ is equivalent to the summation of a kind of scale-normalized distance transformation.
|
| 148 |
+
|
| 149 |
+
# 3 FEATURE REPRESENTATION BY LOCAL REGIONS
|
| 150 |
+
|
| 151 |
+
Motivated by the success of applying the decomposed parts in (Lake et al., 2015), we present an approach to constructing a simplex using the spatial feature maps of CNNs. Moreover, the convolutional feature maps have been effectively employed for visual relational reasoning in (Santoro et al., 2017).
|
| 152 |
+
|
| 153 |
+
While applying deep convolutional networks in classification tasks, the tensor (feature maps) will be flatten to be a 1-D feature vector in the last convolution layer and then it is fed into the fully connected layers. This process makes the feature maps lose adjacency information of spatial structures in the 2-D image.
|
| 154 |
+
|
| 155 |
+
Although flattening seems inevitable in conventional classification pipeline, for few-shot tasks, it is necessary to collect information more effectively from multiple local regions for making an accurate classification decision. In order to play down the negative effect of flattening operation, besides the flattened feature vectors, we take fully advantage of feature maps by applying various scales of attention windows for the last convolution layer. Within each local region, a $3 \times 3$ region on $5 \times 5$ feature maps for instance, we perform the same flattening operation, generating a feature vector containing local information. Using this strategy, we are able to generate more feature vectors for simplex construction with few samples. Figure 3 clearly displays the operation of sampling feature vectors on feature maps with local regions.
|
| 156 |
+
|
| 157 |
+
To further carry out this idea of preserving the adjacency information, we tag the $l ^ { 2 }$ $d$ -dimensional cells with their corresponding coordinates indicating their relative spatial locations. With the extra 2 dimensions, we are able to restrain these cells on an underlying manifold, retaining their relative positions as in the original image. With such a simple manipulation, our model shows an appreciable improvement in performance.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Illustration of sampling feature vectors from feature maps in the last convolution layer. The feature maps corresponding to the different local regions are flattened to be 1-D feature vectors as the vertices of the simplex for the associated class.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 4: The architecture of the 4-block CNN used in our experiments.
|
| 164 |
+
|
| 165 |
+
# 4 EXPERIMENTS
|
| 166 |
+
|
| 167 |
+
In regard to the experiment setup, the number of examples in each class should be constrained so as to fit the“few-shot” scenario. A typical experiment setting is the $N$ -way $k$ -shot task (Vinyals et al., 2016): for each of the $N$ new categories, $k$ examples are provided. Given a set of unlabeled test samples, the model needs to classify them into these $N$ categories. Since the number of available examples is limited (e.g. 1 or 5), training deep convolutional networks either from the scratch or with fine-tuning on new class data will generally lead to over-fitting. We performed our model on two different datasets: miniImageNet (Vinyals et al., 2016) and Omniglot (Lake et al., 2015).
|
| 168 |
+
|
| 169 |
+
The algorithms to be compared fall into two categories: conventional methods and deep learning methods. For deep learning methods, we compare our simplex algorithm with three state-of-the-art ones: matching networks (Vinyals et al., 2016), Meta-Learner LSTM (Ravi & Larochelle, 2017), and prototypical networks (Snell et al., 2017). Essentially, our algorithm is to measure the distance between a data point and a data set. For conventional methods, therefore, we take the Mahalanobis distance (Mahalanobis, 1936) and Minimum Incremental Coding Length (MICL) (Wright et al., 2008) for comparison. The MICL algorithm can be used to measure the structural similarity by coding theory of multivariate Gaussian data.
|
| 170 |
+
|
| 171 |
+
A simple four-block CNN is employed to learn the representations of data both for miniImageNet and Omniglot. The architecture follows the learner network proposed by Ravi & Larochelle (2017), which contains four $3 \times 3$ convolutional layers with 64 filters. Each is followed by batch normalization, ReLU activation and $2 \times 2$ max-pooling. Following all the above layers is one fully connected layer, and lastly a softmax layer with the number equal to the number of classes being trained upon. The output is optimized with a cross-entropy loss function by the Adam optimizer with a learning rate of 0.001. The architecture is shown in Figure 4. The traditional algorithms compared are all performed on features extracted by this four-layer CNN.
|
| 172 |
+
|
| 173 |
+
Table 1: Few-shot validation of different local regions on miniImageNet $9 5 \%$ confidence interval).
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Size of local regions</td><td>5-way 1-shot Acc.</td><td>5-way5-shot Acc.</td></tr><tr><td>1×1</td><td>40.88%± 0.44%</td><td></td></tr><tr><td>2×2</td><td>42.66%± 0.48%</td><td>58.21% ± 0.47%</td></tr><tr><td>3×3</td><td>42.34%±0.42%</td><td>58.98%±0.40%</td></tr><tr><td>4×4</td><td>40.76%± 0.43%</td><td>58.02% ± 0.44%</td></tr><tr><td>5×5</td><td>32.85% ± 0.70%</td><td>58.63% ±0.68%</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Table 2: Few-shot accuracy on miniImageNet on $9 5 \%$ confidence interval. \*Reported by Ravi & Larochelle (2017)
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Model</td><td>Fine Tune</td><td>5-way 1-shot Acc.</td><td>5-way 5-shot Acc.</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Baseline KNN</td><td>N</td><td>32.69% ± 0.75%</td><td>40.32% ± 0.68%</td></tr><tr><td>Mahalanobis Distance MICL (Wright et al., 2008)</td><td>N</td><td>32.39% ± 0.70% 42.59%±0.46%</td><td>60.09%± 0.39% 61.06% ± 0.36%</td></tr><tr><td></td><td>N</td><td></td><td></td></tr><tr><td>Matching networks*</td><td>N</td><td>43.40% ± 0.78%</td><td>51.09% ± 0.71%</td></tr><tr><td>Matching networks FCE*</td><td>N</td><td>43.56% ± 0.84%</td><td>55.31% ± 0.73%</td></tr><tr><td>Meta-Learner LSTM*</td><td>N</td><td>43.44% ± 0.77%</td><td>60.60% ± 0.71%</td></tr><tr><td>Prototypical networks (Snell et al.,2017)</td><td>N</td><td>49.42% ± 0.78%</td><td>68.20% ±0.66%</td></tr><tr><td>Simplex (ours)</td><td>N</td><td>46.93% ± 0.43%</td><td>62.00%± 0.26%</td></tr></table>
|
| 180 |
+
|
| 181 |
+
# 4.1 MINIIMAGENET
|
| 182 |
+
|
| 183 |
+
ImageNet is a large-scale image database designed for multiple computer vision tasks. Since it would be extremely time-consuming to test the few-shot performance on the full ImageNet, we turn to miniImageNet instead (Vinyals et al., 2016), the subset of ImageNet with 100 categories selected. For each category, 600 images with size $8 4 \times 8 4$ are provided. Following the same split as Ravi & Larochelle (2017), miniImageNet is divided into a 64-class training set, a 16-class validation set and a 20-class test set. We train the embedding network on the 64-class training set and validate the result based on the 16-class validation set. The 20-class test set is only for the few-shot experiments.
|
| 184 |
+
|
| 185 |
+
For each image fed into the 4-block CNN, the last feature map $( 6 4 @ 5 \times 5 )$ is retrieved for simplex modeling. In order to choose a proper local region for conducting the few-shot experiments, we first test the $N$ -way $k \mathrm { . }$ -shot accuracy of different sizes of regions on the validation set. The size of the local regions varies from $2 \times 2$ to $5 \times 5$ . 2 The result is shown in Table 1. On the validation set, the models with $2 \times 2$ and $3 \times 3$ regions perform the best on the 1-shot and 5-shot tasks, respectively. We take them to compare with other models on the test set.
|
| 186 |
+
|
| 187 |
+
Following the same splits proposed by Ravi & Larochelle (2017), we compare the performance of our model on miniImageNet directly with other models. We also conduct the $K$ -nearest neighbor on the feature vectors generated from the 4-block model as a comparison (Baseline KNN). The results are shown in Table 2. Using the same pre-trained 4-block CNN, our model performs much better than the baseline KNN, meanwhile outperforms the matching networks and Meta-learner LSTM. However, the prototypical networks are better than our simplex algorithm.
|
| 188 |
+
|
| 189 |
+
# 4.2 OMNIGLOT
|
| 190 |
+
|
| 191 |
+
Omniglot dataset for one-shot learning (Lake et al., 2015) contains characters from 50 alphabets ranging from Korean to ancient Greek. Each character is provided with 20 examples handwritten by
|
| 192 |
+
|
| 193 |
+
Table 3: Few-shot accuracy on Omniglot.
|
| 194 |
+
|
| 195 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2"> 5-way</td><td colspan="2">20-way</td></tr><tr><td>1-shot</td><td> 5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>Baseline KNN</td><td>94.1%</td><td>98.7%</td><td>85.1%</td><td>95.8%</td></tr><tr><td>Mahalanobis distance</td><td>94.5%</td><td>99.1%</td><td>85.8%</td><td>96.9%</td></tr><tr><td>MICL (Wright et al., 2008)</td><td>95.4%</td><td>99.1%</td><td>87.3%</td><td>96.9%</td></tr><tr><td>Siamese networks (Koch et al., 2015)</td><td>97.3%</td><td>98.4%</td><td></td><td>97.0%</td></tr><tr><td>Matching networks (Vinyals et al., 2016)</td><td>98.1%</td><td>98.9%</td><td>88.2% 93.8%</td><td>98.5%</td></tr><tr><td>Prototypical networks (Snell et al., 2017)</td><td>97.4%</td><td>99.3%</td><td>96.0%</td><td>98.9%</td></tr><tr><td>Simplex (ours)</td><td>94.6%</td><td>99.1%</td><td>85.7%</td><td>97.0%</td></tr></table>
|
| 196 |
+
|
| 197 |
+
20 online contributors. Omniglot fits the few-shot scenario well: comparing with the large number of categories (1623), the examples (20) are relatively limited, making it difficult to be trained upon with conventional parametric networks.
|
| 198 |
+
|
| 199 |
+
Following the training setting in Vinyals et al. (2016), we split Omniglot into two parts: 1200 characters for training and the rest for validation and few-shot testing. The embedding 4-layer CNN is almost the same as used for training miniImageNet, except that the output feature map is changed to $6 4 @ 1 \times 1$ due to the decrease in image size. We compare the $N$ -way $k$ -shot performance of our model with others. The results are shown in Table 3. Our models are overall comparable to the other state-of-the-art works.
|
| 200 |
+
|
| 201 |
+
# 4.3 ROBUSTNESS OF SIMPLEX METHOD
|
| 202 |
+
|
| 203 |
+
Besides, we conduct more experiments on MICL and our model for a further comparison on robustness. MICL has a distortion parameter $\epsilon ^ { 2 }$ in the coding length, i.e. (Wright et al., 2008)
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
L _ { \epsilon } ( \chi ) = \frac { n + d } { 2 } \log _ { 2 } \operatorname * { d e t } \Big ( I + \frac { d } { \epsilon ^ { 2 } } \Sigma ( \chi ) \Big ) + \frac { d } { 2 } \log _ { 2 } \big ( 1 + \frac { \mu ^ { T } \mu } { \epsilon ^ { 2 } } \big ) ,
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
where $\Sigma ( \mathcal { X } )$ is the corresponding covariance matrix and $\mu$ is the center of $\mathcal { X }$ . Through adjusting the parameter, the optimal performance of the model can be obtained on the validation set. We follow the same way as MICL and set up the free parameter in our simplex model. To be specific, let $\lambda _ { 1 } , \ldots , \lambda _ { n }$ denote the eigenvalues of $\hat { Q }$ . It is easy to write $\begin{array} { r } { \operatorname* { d e t } ( \hat { Q } ) = \prod _ { i = 1 } ^ { n } \lambda _ { i } } \end{array}$ . To include the free parameter, we employ the following expression instead
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\operatorname * { d e t } { \Bigl ( } I + { \frac { d } { \epsilon ^ { 2 } } } { \hat { Q } } { \Bigr ) } = \prod _ { i = 1 } ^ { n } { \Bigl ( } 1 + { \frac { d } { \epsilon ^ { 2 } } } \lambda _ { i } { \Bigr ) } .
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
The same computation is also performed for $\operatorname* { d e t } ( \hat { P } )$ .
|
| 216 |
+
|
| 217 |
+
The experiment is conducted on the different values of distortion $\epsilon ^ { 2 }$ . According to the results in Figure 5, it is clear that our model is far more robust than MICL. Although for some value of $\epsilon ^ { 2 }$ , the accuracy of MICL is close to our model, the overall performance of MICL is instable with respect to $\epsilon ^ { 2 }$ . On the contrary, the performance of our model almost keeps invariant in a wide spectrum of $\epsilon ^ { 2 }$ .
|
| 218 |
+
|
| 219 |
+
# 4.4 ANALYSIS AND DISCUSS
|
| 220 |
+
|
| 221 |
+
It is worth noting that our simplex metric can also be combined with very recently published works including prototypical networks (Snell et al., 2017) and meta-learning methods, such as (Finn et al., 2017) and (Mishra et al., 2017). For example, the distance measure in prototypical networks can be replaced with our simplex metric and the associated networks can be learned in the end-to-end manner by the supervision of simplex volumes. For few-shot cases, the number of examples in each class is quite limited. So the computational complexity can be well managed. Besides, the meta learning methods are to learn models between tasks instead of data points. Therefore, they are applicable to improve performance based on the simplex metric. We leave these for further explorations.
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 5: Comparison of robustness between our simplex algorithm and MICL with respect to free parameters $\epsilon ^ { 2 }$ .
|
| 225 |
+
|
| 226 |
+
On the other hand, MICL (Wright et al., 2008) and our algorithm directly exploit the features of new classes yielded by CNNs that are not retrained, fine-tuned, or performed any relevant refinement of model parameters on new classes. Even so, these two approaches achieve better performance on 5-shot recognition than matching network (Vinyals et al., 2016) and one of meta-learning algorithms (Ravi & Larochelle, 2017) that apply more information of new classes and high-level learning techniques. Both MICL and our simplex algorithm harness the geometric characterization of class structures 3. Therefore, our work might inspire the interest of exploring geometry to solve few-shot learning problems, which is paid little attention in the field.
|
| 227 |
+
|
| 228 |
+
# 5 CONCLUSION
|
| 229 |
+
|
| 230 |
+
In this paper, we designed a novel method to deal with few-shot learning problems. Our idea was from the point of view of high dimensional convex geometry and transformed the learning problem to the study of volumes of simplices. The relation between a test sample and a class was investigated via the volumes of different polytopes. By harnessing the power of simplex, we gave a rigorous mathematical formulation for our approach. We also conduced extensive simulations to validate our method. The results on various datasets showed the accuracy and robustness of the geometry-based method, compared to the state-of-the-art results in the literature.
|
| 231 |
+
|
| 232 |
+
# REFERENCES
|
| 233 |
+
|
| 234 |
+
Arthur Cayley. On a theorem in the geometry of position, volume 1 of Cambridge Library Collection - Mathematics, pp. 14. Cambridge University Press, 2009. doi: 10.1017/CBO9780511703676. 002.
|
| 235 |
+
|
| 236 |
+
Li Fei-Fei, Rob Fergus, and Pietro Perona. A Bayesian approach to unsupervised one-shot learning of object categories. In ICCV, 2003.
|
| 237 |
+
|
| 238 |
+
Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28:594–611, 2006.
|
| 239 |
+
|
| 240 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. CoRR, abs/1703.03400, 2017. URL http://arxiv.org/abs/1703. 03400.
|
| 241 |
+
|
| 242 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. CoRR, abs/1502.01852, 2015a. URL http://arxiv.org/abs/1502.01852.
|
| 243 |
+
|
| 244 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015b. URL http://arxiv.org/abs/1512.03385.
|
| 245 |
+
|
| 246 |
+
Lukasz Kaiser, Ofir Nachum, Aurko Roy, and Samy Bengio. Learning to remember rare events. CoRR, abs/1703.03129, 2017. URL http://arxiv.org/abs/1703.03129.
|
| 247 |
+
|
| 248 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. 2015.
|
| 249 |
+
|
| 250 |
+
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. URL http://papers.nips.cc/paper/ 4824-imagenet-classification-with-deep-convolutional-neural-networks. pdf.
|
| 251 |
+
|
| 252 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. ISSN 0036-8075. doi: 10.1126/science.aab3050. URL http://science.sciencemag.org/content/ 350/6266/1332.
|
| 253 |
+
|
| 254 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 05 2015. URL http://dx.doi.org/10.1038/nature14539.
|
| 255 |
+
|
| 256 |
+
Xingyu Lin, Hao Wang, Zhihao Li, Yimeng Zhang, Alan L. Yuille, and Tai Sing Lee. Transfer of view-manifold learning to similarity perception of novel objects. CoRR, abs/1704.00033, 2017. URL http://arxiv.org/abs/1704.00033.
|
| 257 |
+
|
| 258 |
+
Prasanta Chandra Mahalanobis. On the generalised distance in statistics. Proceedings of the National Institute of Sciences of India, 1936, pp. 49–55, 1936.
|
| 259 |
+
|
| 260 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. CoRR, abs/1707.03141, 2017. URL http://arxiv.org/abs/1707.03141.
|
| 261 |
+
|
| 262 |
+
Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L. Yuille. Few-shot image recognition by predicting parameters from activations. CoRR, abs/1706.03466, 2017. URL http://arxiv.org/abs/ 1706.03466.
|
| 263 |
+
|
| 264 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. International Conference on Learning Representations, 2017.
|
| 265 |
+
|
| 266 |
+
Sam T. Roweis and Lawrence K. Saul. Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500):2323–2326, 2000. ISSN 0036-8075. doi: 10.1126/science.290.5500. 2323. URL http://science.sciencemag.org/content/290/5500/2323.
|
| 267 |
+
|
| 268 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li FeiFei. ImageNet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
|
| 269 |
+
|
| 270 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Oneshot learning with memory-augmented neural networks. CoRR, abs/1605.06065, 2016. URL http://arxiv.org/abs/1605.06065.
|
| 271 |
+
|
| 272 |
+
Adam Santoro, David Raposo, David G.T. Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In arXiv:1706.01427, 2017.
|
| 273 |
+
|
| 274 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. URL http://arxiv.org/abs/1409.1556.
|
| 275 |
+
|
| 276 |
+
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.
|
| 277 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. CoRR, abs/1409.4842, 2014. URL http://arxiv.org/abs/1409.4842.
|
| 278 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. CoRR, abs/1512.00567, 2015. URL http://arxiv.org/abs/1512.00567.
|
| 279 |
+
Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500):2319–2323, 2000.
|
| 280 |
+
Joshua B Tenenbaum, Charles Kemp, Thomas L Griffiths, and Noah D Goodman. How to grow a mind: Statistics, structure, and abstraction. Science, 331 6022:1279–85, 2011.
|
| 281 |
+
Oriol Vinyals, Charles Blundell, Timothy P. Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. CoRR, abs/1606.04080, 2016. URL http://arxiv. org/abs/1606.04080.
|
| 282 |
+
Eric W. Weisstein. CRC concise encyclopedia of mathematics, second edition. CRC Press, 2002.
|
| 283 |
+
John Wright, Yangyu Tao, Zhouchen Lin, Yi Ma, and Heung-Yeung Shum. Classification via minimum incremental coding length (MICL). In Advances in Neural Information Processing Systems, pp. 1633–1640, 2008.
|
md/train/rJiNwv9gg/rJiNwv9gg.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LOSSY IMAGE COMPRESSION WITH COMPRESSIVE AUTOENCODERS
|
| 2 |
+
|
| 3 |
+
Lucas Theis, Wenzhe Shi, Andrew Cunningham& Ferenc Huszar´ Twitter
|
| 4 |
+
London, UK
|
| 5 |
+
{ltheis,wshi,acunningham,fhuszar}@twitter.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
We propose a new approach to the problem of optimizing autoencoders for lossy image compression. New media formats, changing hardware technology, as well as diverse requirements and content types create a need for compression algorithms which are more flexible than existing codecs. Autoencoders have the potential to address this need, but are difficult to optimize directly due to the inherent non-differentiabilty of the compression loss. We here show that minimal changes to the loss are sufficient to train deep autoencoders competitive with JPEG 2000 and outperforming recently proposed approaches based on RNNs. Our network is furthermore computationally efficient thanks to a sub-pixel architecture, which makes it suitable for high-resolution images. This is in contrast to previous work on autoencoders for compression using coarser approximations, shallower architectures, computationally expensive methods, or focusing on small images.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Advances in training of neural networks have helped to improve performance in a number of domains, but neural networks have yet to surpass existing codecs in lossy image compression. Promising first results have recently been achieved using autoencoders (Balle et al., 2016; Toderici et al., ´ 2016b) – in particular on small images (Toderici et al., 2016a; Gregor et al., 2016; van den Oord et al., 2016b) – and neural networks are already achieving state-of-the-art results in lossless image compression (Theis & Bethge, 2015; van den Oord et al., 2016a).
|
| 14 |
+
|
| 15 |
+
Autoencoders have the potential to address an increasing need for flexible lossy compression algorithms. Depending on the situation, encoders and decoders of different computational complexity are required. When sending data from a server to a mobile device, it may be desirable to pair a powerful encoder with a less complex decoder, but the requirements are reversed when sending data in the other direction. The amount of computational power and bandwidth available also changes over time as new technologies become available. For the purpose of archiving, encoding and decoding times matter less than for streaming applications. Finally, existing compression algorithms may be far from optimal for new media formats such as lightfield images, 360 video or VR content. While the development of a new codec can take years, a more general compression framework based on neural networks may be able to adapt much quicker to these changing tasks and environments.
|
| 16 |
+
|
| 17 |
+
Unfortunately, lossy compression is an inherently non-differentiable problem. In particular, quantization is an integral part of the compression pipeline but is not differentiable. This makes it difficult to train neural networks for this task. Existing transformations have typically been manually chosen (e.g., the DCT transformation used in JPEG) or have been optimized for a task different from lossy compression (e.g. Testa & Rossi, 2016, used denoising autoencoders for compression). In contrast to most previous work, but in line with Balle et al. (2016), we here aim at directly optimizing the ´ rate-distortion tradeoff produced by an autoencoder. We propose a simple but effective approach for dealing with the non-differentiability of rounding-based quantization, and for approximating the non-differentiable cost of coding the generated coefficients.
|
| 18 |
+
|
| 19 |
+
Using this approach, we achieve performance similar to or better than JPEG 2000 when evaluated for perceptual quality. Unlike JPEG 2000, however, our framework can be optimized for specific content (e.g., thumbnails or non-natural images), arbitrary metrics, and is readily generalizable to other forms of media. Notably, we achieve this performance using efficient neural network architectures which would allow near real-time decoding of large images even on low-powered consumer devices.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Effects of rounding and differentiable alternatives when used as replacements in JPEG compression. A: A crop of an image before compression (GoToVan, 2014). B: Blocking artefacts in JPEG are caused by rounding of DCT coefficients to the nearest integer. Since rounding is used at test time, a good approximation should produce similar artefacts. C: Stochastic rounding to the nearest integer similar to the binarization of Toderici et al. (2016a). D: Uniform additive noise (Balle´ et al., 2016).
|
| 23 |
+
|
| 24 |
+
# 2 COMPRESSIVE AUTOENCODERS
|
| 25 |
+
|
| 26 |
+
We define a compressive autoencoder (CAE) to have three components: an encoder $f$ , a decoder $g$ , and a probabilistic model $Q$ ,
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
f : \mathbb { R } ^ { N } \mathbb { R } ^ { M } , \quad g : \mathbb { R } ^ { M } \mathbb { R } ^ { N } , \quad Q : \mathbb { Z } ^ { M } [ 0 , 1 ] .
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
The discrete probability distribution defined by $Q$ is used to assign a number of bits to representations based on their frequencies, that is, for entropy coding. All three components may have parameters and our goal is to optimize the tradeoff between using a small number of bits and having small distortion,
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\underbrace { - \log _ { 2 } Q \left( \left[ f ( \mathbf { x } ) \right] \right) } _ { \mathrm { N u m b e r ~ o f ~ b i t s } } + \beta \cdot \underbrace { d \left( \mathbf { x } , g ( \left[ f ( \mathbf { x } ) \right] ) \right) } _ { \mathrm { D i s t o r t i o n } } .
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
Here, $\beta$ controls the tradeoff, square brackets indicate quantization through rounding to the nearest integer, and $d$ measures the distortion introduced by coding and decoding. The quantized output of the encoder is the code used to represent an image and is stored losslessly. The main source of information loss is the quantization (Appendix A.3). Additional information may be discarded by the encoder, and the decoder may not perfectly decode the available information, increasing distortion.
|
| 39 |
+
|
| 40 |
+
Unfortunately we cannot optimize Equation 2 directly using gradient-based techniques, as $Q$ and $[ \cdot ]$ are non-differentiable. The following two sections propose a solution to deal with this problem.
|
| 41 |
+
|
| 42 |
+
# 2.1 QUANTIZATION AND DIFFERENTIABLE ALTERNATIVES
|
| 43 |
+
|
| 44 |
+
The derivative of the rounding function is zero everywhere except at integers, where it is undefined. We propose to replace its derivative in the backward pass of backpropagation (Rumelhart et al., 1986) with the derivative of a smooth approximation, $r$ , that is, effectively defining the derivative to be
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
{ \frac { d } { d y } } \left[ y \right] : = { \frac { d } { d y } } r ( y ) .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Importantly, we do not fully replace the rounding function with a smooth approximation but only its derivative, which means that quantization is still performed as usual in the forward pass. If we replaced rounding with a smooth approximation completely, the decoder might learn to invert the smooth approximation, thereby removing the information bottle neck that forces the network to compress information.
|
| 51 |
+
|
| 52 |
+
Empirically, we found the identity, $r ( y ) = y$ , to work as well as more sophisticated choices. This makes this operation easy to implement, as we simply have to pass gradients without modification from the decoder to the encoder.
|
| 53 |
+
|
| 54 |
+
Note that the gradient with respect to the decoder’s parameters can be computed without resorting to approximations, assuming $d$ is differentiable. In contrast to related approaches, our approach has the advantage that it does not change the gradients of the decoder, since the forward pass is kept the same.
|
| 55 |
+
|
| 56 |
+
In the following, we discuss alternative approaches proposed by other authors. Motivated by theoretical links to dithering, Balle et al. (2016) proposed to replace quantization by additive uniform ´ noise,
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
[ f ( \mathbf { x } ) ] \approx f ( \mathbf { x } ) + \mathbf { u } .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Toderici et al. (2016a), on the other hand, used a stochastic form of binarization (Williams, 1992). Generalizing this idea to integers, we define the following stochastic rounding operation:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\{ y \} \approx \lfloor y \rfloor + \varepsilon , \quad \varepsilon \in \{ 0 , 1 \} , \quad P ( \varepsilon = 1 ) = y - \lfloor y \rfloor ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\lfloor \cdot \rfloor$ is the floor operator. In the backward pass, the derivative is replaced with the derivative of the expectation,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
{ \frac { d } { d y } } \left\{ y \right\} : = { \frac { d } { d y } } \mathbb { E } \left[ \left\{ y \right\} \right] = { \frac { d } { d y } } y = 1 .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Figure 1 shows the effect of using these two alternatives as part of JPEG, whose encoder and decoder are based on a block-wise DCT transformation (Pennebaker & Mitchell, 1993). Note that the output is visibly different from the output produced with regular quantization by rounding and that the error signal sent to the autoencoder depends on these images. Whereas in Fig. 1B the error signal received by the decoder would be to remove blocking artefacts, the signal in Fig. 1D will be to remove high-frequency noise. We expect this difference to be less of a problem with simple metrics such as mean-squared error and to have a bigger impact when using more perceptually meaningful measures of distortion.
|
| 75 |
+
|
| 76 |
+
An alternative would be to use the latter approximations only for the gradient of the encoder but not for the gradients of the decoder. While this is possible, it comes at the cost of increased computational and implementational complexity, since we would have to perform the forward and backward pass through the decoder twice: once using rounding, once using the approximation. With our approach the gradient of the decoder is correct even for a single forward and backward pass.
|
| 77 |
+
|
| 78 |
+
# 2.2 ENTROPY RATE ESTIMATION
|
| 79 |
+
|
| 80 |
+
Since $Q$ is a discrete function, we cannot differentiate it with respect to its argument, which prevents us from computing a gradient for the encoder. To solve this problem, we use a continuous, differentiable approximation. We upper-bound the non-differentiable number of bits by first expressing the model’s distribution $Q$ in terms of a probability density $q$ ,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
Q ( \mathbf { z } ) = \int _ { [ - . 5 , . 5 [ ^ { M } } q ( \mathbf { z } + \mathbf { u } ) d \mathbf { u } .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
An upper bound is given by:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
- \log _ { 2 } Q ( \mathbf { z } ) = - \log _ { 2 } \int _ { [ - . 5 , . 5 [ ^ { M } } q ( \mathbf { z } + \mathbf { u } ) d \mathbf { u } \leq \int _ { [ - . 5 , . 5 [ ^ { M } } - \log _ { 2 } q ( \mathbf { z } + \mathbf { u } ) d \mathbf { u } ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where the second step follows from Jensen’s inequality (see also Theis et al., 2016). An unbiased estimate of the upper bound is obtained by sampling $\mathbf { u }$ from the unit cube $[ - . 5 , . 5 [ ^ { M }$ . If we use a differentiable density, this estimate will be differentiable in $\mathbf { z }$ and therefore can be used to train the encoder.
|
| 93 |
+
|
| 94 |
+
In practice we often want fine-gained control over the number of bits used. One way to achieve this is to train an autoencoder for different rate-distortion tradeoffs. But this would require us to train and store a potentially large number of models. To reduce these costs, we finetune a pre-trained autoencoder for different rates by introducing scale parameters1 $\pmb { \lambda } \in \mathbb { R } ^ { M }$ ,
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
- \log _ { 2 } q \left( \left[ f ( \mathbf { x } ) \circ \lambda \right] + \mathbf { u } \right) + \beta \cdot d \left( \mathbf { x } , g ( \left[ f ( \mathbf { x } ) \circ \lambda \right] / \lambda ) \right) .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Here, $\circ$ indicates point-wise multiplication and division is also performed point-wise. To reduce the number of trainable scales, they may furthermore be shared across dimensions. Where $f$ and $g$ are convolutional, for example, we share scale parameters across spatial dimensions but not across channels.
|
| 101 |
+
|
| 102 |
+
An example of learned scale parameters is shown in Figure 3A. For more fine-grained control over bit rates, the optimized scales can be interpolated.
|
| 103 |
+
|
| 104 |
+
# 2.4 RELATED WORK
|
| 105 |
+
|
| 106 |
+
Perhaps most closely related to our work is the work of Balle et al. (2016). The main differences ´ lie in the way we deal with quantization (see Section 2.1) and entropy rate estimation. The transformations used by Balle et al. (2016) consist of a single linear layer combined with a form of contrast ´ gain control, while our framework relies on more standard deep convolutional neural networks.
|
| 107 |
+
|
| 108 |
+
Toderici et al. (2016a) proposed to use recurrent neural networks (RNNs) for compression. Instead of entropy coding as in our work, the network tries to minimize the distortion for a given number of bits. The image is encoded in an iterative manner, and decoding is performed in each step to be able to take into account residuals at the next iteration. An advantage of this design is that it allows for progressive coding of images. A disadvantage is that compression is much more time consuming than in our approach, as we use efficient convolutional neural networks and do not necessarily require decoding at the encoding stage.
|
| 109 |
+
|
| 110 |
+
Gregor et al. (2016) explored using variational autoencoders with recurrent encoders and decoders for compression of small images. This type of autoencoder is trained to maximize the lower bound of a log-likelihood, or equivalently to minimize
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
- \mathbb { E } _ { p ( \mathbf { y } \mid \mathbf { x } ) } \left[ \log \frac { q ( \mathbf { y } ) q ( \mathbf { x } \mid \mathbf { y } ) } { p ( \mathbf { y } \mid \mathbf { x } ) } \right] ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $p ( \mathbf { y } \mid \mathbf { x } )$ plays the role of the encoder, and $q ( \mathbf { x } \mid \mathbf { y } )$ plays the role of the decoder. While Gregor et al. (2016) used a Gaussian distribution for the encoder, we can link their approach to the work of Balle et al. (2016) by assuming it to be uniform, ´ $p ( \mathbf { y } \mid \mathbf { x } ) = f ( \mathbf { x } ) + \mathbf { u }$ . If we also assume a Gaussian likelihood with fixed variance, $q ( \mathbf { x } \mid \mathbf { y } ) = \mathcal { N } ( \mathbf { x } \mid g ( \mathbf { y } ) , \sigma ^ { 2 } \mathbf { I } )$ , the objective function can be written
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbb { E } _ { \mathbf { u } } \left[ - \log q ( f ( \mathbf { x } ) + \mathbf { u } ) + \frac { 1 } { 2 \sigma ^ { 2 } } | | \mathbf { x } - g ( f ( \mathbf { x } ) + \mathbf { u } ) | | ^ { 2 } \right] + C .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Here, $C$ is a constant which encompasses the negative entropy of the encoder and the normalization constant of the Gaussian likelihood. Note that this equation is identical to a rate-distortion trade-off with $\beta = \sigma ^ { - 2 } / 2$ and quantization replaced by additive uniform noise. However, not all distortions have an equivalent formulation as a variational autoencoder (Kingma & Welling, 2014). This only works if $\bar { e } ^ { - d ( \mathbf { x } , \mathbf { y } ) }$ is normalizable in $\mathbf { x }$ and the normalization constant does not depend on y, or otherwise $C$ will not be constant. An direct empirical comparison of our approach with variational autoencoders is provided in Appendix A.5.
|
| 123 |
+
|
| 124 |
+
Ollivier (2015) discusses variational autoencoders for lossless compression as well as connections to denoising autoencoders.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 2: Illustration of the compressive autoencoder architecture used in this paper. Inspired by the work of Shi et al. (2016), most convolutions are performed in a downsampled space to speed up computation, and upsampling is performed using sub-pixel convolutions (convolutions followed by reshaping/reshuffling of the coefficients). To reduce clutter, only two residual blocks of the encoder and the decoder are shown. Convolutions followed by leaky rectifications are indicated by solid arrows, while transparent arrows indicate absence of additional nonlinearities. As a model for the distributions of quantized coefficients we use Gaussian scale mixtures. The notation $C \times K \times K$ refers to $K \times K$ convolutions with $C$ filters. The number following the slash indicates stride in the case of convolutions, and upsampling factors in the case of sub-pixel convolutions.
|
| 128 |
+
|
| 129 |
+
# 3 EXPERIMENTS
|
| 130 |
+
|
| 131 |
+
# 3.1 ENCODER, DECODER, AND ENTROPY MODEL
|
| 132 |
+
|
| 133 |
+
We use common convolutional neural networks (LeCun et al., 1998) for the encoder and the decoder of the compressive autoencoder. Our architecture was inspired by the work of Shi et al. (2016), who demonstrated that super-resolution can be achieved much more efficiently by operating in the lowresolution space, that is, by convolving images and then upsampling instead of upsampling first and then convolving an image.
|
| 134 |
+
|
| 135 |
+
The first two layers of the encoder perform preprocessing, namely mirror padding and a fixed pixelwise normalization. The mirror-padding was chosen such that the output of the encoder has the same spatial extent as an 8 times downsampled image. The normalization centers the distribution of each channel’s values and ensures it has approximately unit variance. Afterwards, the image is convolved and spatially downsampled while at the same time increasing the number of channels to 128. This is followed by three residual blocks (He et al., 2015), where each block consists of an additional two convolutional layers with 128 filters each. A final convolutional layer is applied and the coefficients downsampled again before quantization through rounding to the nearest integer.
|
| 136 |
+
|
| 137 |
+
The decoder mirrors the architecture of the encoder (Figure 9). Instead of mirror-padding and valid convolutions, we use zero-padded convolutions. Upsampling is achieved through convolution followed by a reorganization of the coefficients. This reorganization turns a tensor with many channels into a tensor of the same dimensionality but with fewer channels and larger spatial extent (for details, see Shi et al., 2016). A convolution and reorganization of coefficients together form a sub-pixel convolution layer. Following three residual blocks, two sub-pixel convolution layers upsample the image to the resolution of the input. Finally, after denormalization, the pixel values are clipped to the range of 0 to 255. Similar to how we deal with gradients of the rounding function, we redefine the gradient of the clipping function to be 1 outside the clipped range. This ensures that the training signal is non-zero even when the decoded pixels are outside this range (Appendix A.1).
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: A: Scale parameters obtained by finetuning a compressive autoencoder (blue). More finegrained control over bit rates can be achieved by interpolating scales (gray). Each dot corresponds to the scale parameter of one coefficient for a particular rate-distortion trade-off. The coefficients are ordered due to the incremental training procedure. B: Comparison of incremental training versus non-incremental training. The learning rate was decreased after 116,000 iterations (bottom two lines). Non-incremental training is initially less stable and shows worse performance at later iterations. Using a small learning rate from the beginning stabilizes non-incremental training but is considerably slower (top line).
|
| 141 |
+
|
| 142 |
+
To model the distribution of coefficients and estimate the bit rate, we use independent Gaussian scale mixtures (GSMs),
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\log _ { 2 } q ( { \bf z } + { \bf u } ) = \sum _ { i , j , k } \log _ { 2 } \sum _ { s } \pi _ { k s } \mathcal { N } ( z _ { k i j } + u _ { k i j } ; 0 , \sigma _ { k s } ^ { 2 } ) ,
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $i$ and $j$ iterate over spatial positions, and $k$ iterates over channels of the coefficients for a single image $\mathbf { z }$ . GSMs are well established as useful building blocks for modelling filter responses of natural images (e.g., Portilla et al., 2003). We used 6 scales in each GSM. Rather than using the more common parametrization above, we parametrized the GSM so that it can be easily used with gradient based methods, optimizing log-weights and log-precisions rather than weights and variances. We note that the leptokurtic nature of GSMs (Andrews & Mallows, 1974) means that the rate term encourages sparsity of coefficients.
|
| 149 |
+
|
| 150 |
+
All networks were implemented in Python using Theano (2016) and Lasagne (Dieleman et al., 2015). For entropy encoding of the quantized coefficients, we first created Laplace-smoothed histogram estimates of the coefficient distributions across a training set. The estimated probabilities were then used with a publicly available BSD licensed implementation of a range coder2.
|
| 151 |
+
|
| 152 |
+
# 3.2 INCREMENTAL TRAINING
|
| 153 |
+
|
| 154 |
+
All models were trained using Adam (Kingma & Ba, 2015) applied to batches of 32 images $1 2 8 \times 1 2 8$ pixels in size. We found it beneficial to optimize coefficients in an incremental manner (Figure 3B). This is done by introducing an additional binary mask $\mathbf { m }$ ,
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
- \log _ { 2 } q \left( [ f ( \mathbf { x } ) ] \circ \mathbf { m } + \mathbf { u } \right) + \beta \cdot d \left( \mathbf { x } , g ( [ f ( \mathbf { x } ) ] \circ \mathbf { m } ) \right) .
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
Initially, all but 2 entries of the mask are set to zero. Networks are trained until performance improvements reach below a threshold, and then another coefficient is enabled by setting an entry of the binary mask to 1. After all coefficients have been enabled, the learning rate is reduced from an initial value of $1 0 ^ { - 4 }$ to $1 0 ^ { - 5 }$ . Training was performed for up to $1 0 ^ { 6 }$ updates but usually reached good performance much earlier.
|
| 161 |
+
|
| 162 |
+
After a model has been trained for a fixed rate-distortion trade-off $( \beta )$ , we introduce and fine-tune scale parameters (Equation 9) for other values of $\beta$ while keeping all other parameters fixed. Here we used an initial learning rate of $1 0 ^ { - 3 }$ and continuously decreased it by a factor of $\tau ^ { \kappa } / ( \tau + t ) ^ { \kappa }$ , where $t$ is the current number of updates performed, $\kappa = . 8$ , and $\tau = 1 0 0 0$ . Scales were optimized for 10,000 iterations. For even more fine-grained control over the bit rates, we interpolated between scales optimized for nearby rate-distortion tradeoffs.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 4: Comparison of different compression algorithms with respect to PSNR, SSIM, and MSSSIM on the Kodak PhotoCD image dataset. We note that the blue line refers to the results of Toderici et al. (2016b) achieved without entropy encoding.
|
| 166 |
+
|
| 167 |
+
# 3.3 NATURAL IMAGES
|
| 168 |
+
|
| 169 |
+
We trained compressive autoencoders on 434 high quality images licensed under creative commons and obtained from flickr.com. The images were downsampled to below $1 5 3 6 \times 1 5 3 6$ pixels and stored as lossless PNGs to avoid compression artefacts. From these images, we extracted $1 2 8 \times$ 128 crops to train the network. Mean squared error was used as a measure of distortion during training. Hyperparameters affecting network architecture and training were evaluated on a small set of held-out Flickr images. For testing, we use the commonly used Kodak PhotoCD dataset of 24 uncompressed $7 6 8 \times 5 1 2$ pixel images3.
|
| 170 |
+
|
| 171 |
+
We compared our method to JPEG (Wallace, 1991), JPEG 2000 (Skodras et al., 2001), and the RNNbased method of (Toderici et al., 2016b)4. Bits for header information were not counted towards the bit rate of JPEG and JPEG 2000. Among the different variants of JPEG, we found that optimized JPEG with 4:2:0 chroma sub-sampling generally worked best (Appendix A.2).
|
| 172 |
+
|
| 173 |
+
While fine-tuning a single compressive autoencoder for a wide range of bit rates worked well, optimizing all parameters of a network for a particular rate distortion trade-off still worked better. We here chose the compromise of combining autoencoders trained for low, medium or high bit rates (see Appendix A.4 for details).
|
| 174 |
+
|
| 175 |
+
For each image and bit rate, we choose the autoencoder producing the smallest distortion. This increases the time needed to compress an image, since an image has to be encoded and decoded multiple times. However, decoding an image is still as fast, since it only requires choosing and running one decoder network. A more efficient but potentially less performant solution would be to always choose the same autoencoder for a given rate-distortion tradeoff. We added 1 byte to the coding cost to encode which autoencoder of an ensemble is used.
|
| 176 |
+
|
| 177 |
+
Rate-distortion curves averaged over all test images are shown in Figure 4. We evaluated the different methods in terms of PSNR, SSIM (Wang et al., 2004a), and multiscale SSIM (MS-SSIM; Wang et al., 2004b). We used the implementation of van der Walt et al. (2014) for SSIM and the implementation of Toderici et al. (2016b) for MS-SSIM. We find that in terms of PSNR, our method performs similar to JPEG 2000 although slightly worse at low and medium bit rates and slightly better at high bit rates. In terms of SSIM, our method outperforms all other tested methods. MS-SSIM produces very similar scores for all methods, except at very low bit rates. However, we also find these results to be highly image dependent. Results for individual images are provided as supplementary material5.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 5: Closeups of images produced by different compression algorithms at relatively low bit rates. The second row shows an example where our method performs well, producing sharper lines than and fewer artefacts than other methods. The fourth row shows an example where our method struggles, producing noticeable artefacts in the hair and discolouring the skin. At higher bit rates, these problems disappear and CAE reconstructions appear sharper than those of JPEG 2000 (fifth row). Complete images are provided in Appendix A.6.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 6: Results of a mean opinion score test.
|
| 184 |
+
|
| 185 |
+
In Figure 5 we show crops of images compressed to low bit rates. In line with quantitative results, we find that JPEG 2000 reconstructions appear visually more similar to CAE reconstructions than those of other methods. However, artefacts produced by JPEG 2000 seem more noisy than CAE’s, which are smoother and sometimes appear Gabor-filter-like. ´
|
| 186 |
+
|
| 187 |
+
To quantify the subjective quality of compressed images, we ran a mean opinion score (MOS) test. While MOS tests have their limitations, they are a widely used standard for evaluating perceptual quality (Streijl et al., 2014). Our MOS test set included the 24 full-resolution uncompressed originals from the Kodak dataset, as well as the same images compressed using each of four algorithms at or near three different bit rates: 0.25, 0.372 and 0.5 bits per pixel. Only the low-bit-rate CAE was included in this test.
|
| 188 |
+
|
| 189 |
+
For each image, we chose the CAE setting which produced the highest bit rate but did not exceed the target bit rate. The average bit rates of CAE compressed images were 0.24479, 0.36446, and 0.48596, respectively. We then chose the smallest quality factor for JPEG and JPEG 2000 for which the bit rate exceeded that of the CAE. The average bit rates for JPEG were 0.25221, 0.37339 and 0.49534, for JPEG 2000 0.24631, 0.36748 and 0.49373. For some images the bit rate of the CAE at the lowest setting was still higher than the target bit rate. These images were excluded from the final results, leaving 15, 21, and 23 images, respectively.
|
| 190 |
+
|
| 191 |
+
The perceptual quality of the resulting 273 images was rated by $n = 2 4$ non-expert evaluators. One evaluator did not finish the experiment, so her data was discarded. The images were presented to each individual in a random order. The evaluators gave a discrete opinion score for each image from a scale between 1 (bad) to 5 (excellent). Before the rating began, subjects were presented an uncompressed calibration image of the same dimensions as the test images (but not from the Kodak dataset). They were then shown four versions of the calibration image using the worst quality setting of all four compression methods, and given the instruction “These are examples of compressed images. These are some of the worst quality examples.”
|
| 192 |
+
|
| 193 |
+
Figure 6 shows average MOS results for each algorithm at each bit rate. $9 5 \%$ confidence intervals were computed via bootstrapping. We found that CAE and JPEG 2000 achieved higher MOS than JPEG or the method of Toderici et al. (2016b) at all bit rates we tested. We also found that CAE significantly outperformed JPEG 2000 at 0.375 bpp $( p < 0 . 0 5 )$ and 0.5 bpp $\begin{array} { r } { p < 0 . 0 0 1 , } \end{array}$ ).
|
| 194 |
+
|
| 195 |
+
# 4 DISCUSSION
|
| 196 |
+
|
| 197 |
+
We have introduced a simple but effective way of dealing with non-differentiability in training autoencoders for lossy compression. Together with an incremental training strategy, this enabled us to achieve better performance than JPEG 2000 in terms of SSIM and MOS scores. Notably, this performance was achieved using an efficient convolutional architecture, combined with simple roundingbased quantization and a simple entropy coding scheme. Existing codecs often benefit from hardware support, allowing them to run at low energy costs. However, hardware chips optimized for convolutional neural networks are likely to be widely available soon, given that these networks are now key to good performance in so many applications.
|
| 198 |
+
|
| 199 |
+
While other trained algorithms have been shown to provide similar results as JPEG 2000 (e.g. van den Oord & Schrauwen, 2014), to our knowledge this is the first time that an end-to-end trained architecture has been demonstrated to achieve this level of performance on high-resolution images. An end-to-end trained autoencoder has the advantage that it can be optimized for arbitrary metrics. Unfortunately, research on perceptually relevant metrics suitable for optimization is still in its infancy (e.g., Dosovitskiy & Brox, 2016; Balle et al., 2016). While perceptual metrics exist which ´ correlate well with human perception for certain types of distortions (e.g., Wang et al., 2004a; Laparra et al., 2016), developing a perceptual metric which can be optimized is a more challenging task, since this requires the metric to behave well for a much larger variety of distortions and image pairs.
|
| 200 |
+
|
| 201 |
+
In future work, we would like to explore the optimization of compressive autoencoders for different metrics. A promising direction was presented by Bruna et al. (2016), who achieved interesting superresolution results using metrics based on neural networks trained for image classification. Gatys et al. (2016) used similar representations to achieve a breakthrough in perceptually meaningful style transfer. An alternative to perceptual metrics may be to use generative adversarial networks (GANs; Goodfellow et al., 2014). Building on the work of Bruna et al. (2016) and Dosovitskiy & Brox (2016), Ledig et al. (2016) recently demonstrated impressive super-resolution results by combining GANs with feature-based metrics.
|
| 202 |
+
|
| 203 |
+
# ACKNOWLEDGMENTS
|
| 204 |
+
|
| 205 |
+
We would like to thank Zehan Wang, Aly Tejani, Clement Farabet, and Luke Alonso for helpful ´ feedback on the manuscript.
|
| 206 |
+
|
| 207 |
+
# REFERENCES
|
| 208 |
+
|
| 209 |
+
D. F. Andrews and C. L. Mallows. Scale mixtures of normal distributions. Journal of the Royal Statistical Society, Series B, 36(1):99–102, 1974.
|
| 210 |
+
J. Balle, V. Laparra, and E. P. Simoncelli. End-to-end optimization of nonlinear transform codes for ´ perceptual quality. In Picture Coding Symposium, 2016.
|
| 211 |
+
J. Bruna, P. Sprechmann, and Y. LeCun. Super-resolution with deep convolutional sufficient statistics. In The International Conference on Learning Representations, 2016.
|
| 212 |
+
S. Dieleman, J. Schluter, C. Raffel, E. Olson, S. K. Sonderby, D. Nouri, D. Maturana, M. Thoma, E. Battenberg, J. Kelly, J. De Fauw, M. Heilman, D. Moitinho de Almeida, B. McFee, H. Weideman, G. Takacs, P. de Rivaz, J. Crall, G. Sanders, K. Rasul, C. Liu, G. French, and J. Degrave. Lasagne: First release, 2015. URL http://dx.doi.org/10.5281/zenodo.27878.
|
| 213 |
+
A. Dosovitskiy and T. Brox. Generating images with perceptual similarity metrics based on deep networks, 2016. arXiv:1602.02644.
|
| 214 |
+
L. A. Gatys, A. S. Ecker, and M. Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 215 |
+
I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, , and Y. Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems 27, 2014.
|
| 216 |
+
GoToVan. Canada day parade, 2014. URL https://www.flickr.com/photos/gotovan/ 14579921203.
|
| 217 |
+
K. Gregor, I. Danihelka, A. Graves, and D. Wierstra. Towards conceptual compression, 2016. arXiv:1601.06759.
|
| 218 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition, 2015. arXiv:1512.03385.
|
| 219 |
+
D. Kingma and M. Welling. Auto-encoding variational bayes. In International Conference on Learning Representations, 2014.
|
| 220 |
+
D. P. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. In The International Conference on Learning Representations, 2015.
|
| 221 |
+
V. Laparra, J. Balle, and E. P. Simoncelli. Perceptual image quality assessment using a normalized ´ Laplacian pyramid. In SPIE, Conf. on Human Vision and Electronic Imaging, XXI, 2016.
|
| 222 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. 86(11), 1998.
|
| 223 |
+
C. Ledig, L. Theis, F. Huszar, J. Caballero, A. Aitken, A. Tejani, J. Totz, Z. Wang, and W. Shi. Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network, 2016. arXiv:1609.04802.
|
| 224 |
+
Y. Ollivier. Auto-encoders: reconstruction versus compression, 2015. 1403.7752.
|
| 225 |
+
W. B. Pennebaker and J. L. Mitchell. JPEG still image data compression standard. Springer, 3rd edition, 1993.
|
| 226 |
+
J. Portilla, V. Strela, M. J. Wainwright, and E. P. Simoncelli. Image denoising using scale mixtures of gaussians in the wavelet domain. IEE Trans. Image Process., 12(11):1338–1351, 2003.
|
| 227 |
+
D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Learning representations by back-propagating errors. Nature, 323(6088):533–536, 1986.
|
| 228 |
+
W. Shi, J. Caballero, F. Huszar, J. Totz, A. Aitken, R. Bishop, D. Rueckert, and Z. Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In IEEE Conf. on Computer Vision and Pattern Recognition, 2016.
|
| 229 |
+
A. Skodras, C. Christopoulos, and T. Ebrahimi. The JPEG 2000 still image compression standard. Signal Processing Magazine, 18(5):36–58, 2001.
|
| 230 |
+
R. C. Streijl, S. Winkler, and D. S. Hands. Mean opinion score (MOS) revisited: methods and applications, limitations and alternatives. Multimedia Systems, pp. 1–15, 2014.
|
| 231 |
+
D. Del Testa and M. Rossi. Lightweight Lossy Compression of Biometric Patterns via Denoising Autoencoders. IEEE Signal Processing Letters, 22(12), 2016.
|
| 232 |
+
Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions, 2016. arXiv:1605.02688.
|
| 233 |
+
L. Theis and M. Bethge. Generative Image Modeling Using Spatial LSTMs. In Advances in Neural Information Processing Systems 28, 2015.
|
| 234 |
+
L. Theis, A. van den Oord, and M. Bethge. A note on the evaluation of generative models. In The International Conference on Learning Representations, 2016.
|
| 235 |
+
G. Toderici, S. M. O’Malley, S. J. Hwang, D. Vincent, D. Minnen, S. Baluja, M. Covell, and R. Sukthankar. Variable rate image compression with recurrent neural networks. In The International Conference on Learning Representations, 2016a.
|
| 236 |
+
G. Toderici, D. Vincent, N. Johnston, S. J. Hwang, D. Minnen, J. Shor, and M. Covell. Full resolution image compression with recurrent neural networks, 2016b. arXiv:1608.05148v1.
|
| 237 |
+
A. van den Oord and B. Schrauwen. The student-t mixture as a natural image patch prior with application to image compression. Journal of Machine Learning Research, 15(1):2061–2086, 2014.
|
| 238 |
+
A. van den Oord, N. Kalchbrenner, and K. Kavukcuoglu. Pixel recurrent neural networks. In Proceedings of the 33rd International Conference on Machine Learning, 2016a.
|
| 239 |
+
A. van den Oord, N. Kalchbrenner, O. Vinyals, L. Espeholt, A. Graves, and K. Kavukcuoglu. Conditional Image Generation with PixelCNN Decoders, 2016b. arXiv:1606.05328v2.
|
| 240 |
+
S. van der Walt, J. L. Schonberger, J. Nunez-Iglesias, F. Boulogne, J. D. Warner, N. Yager, E. Gouil- ¨ lart, and T. Yu. scikit-image: image processing in Python. PeerJ, 2, 2014.
|
| 241 |
+
G. K. Wallace. The JPEG still picture compression standard. Communications of the ACM, 34(4): 30–44, 1991.
|
| 242 |
+
Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600–612, 2004a.
|
| 243 |
+
Z. Wang, E. P. Simoncelli, and A. C. Bovik. Multiscale structural similarity for image quality assessment. In Conference Record of the Thirty-Seventh Asilomar Conference on Signals, Systems and Computers, volume 2, pp. 1398–1402, 2004b.
|
| 244 |
+
R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229–256, 1992.
|
| 245 |
+
|
| 246 |
+
# A APPENDIX
|
| 247 |
+
|
| 248 |
+
# A.1 GRADIENT OF CLIPPING
|
| 249 |
+
|
| 250 |
+
We redefine the gradient of the clipping operation to be constant,
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
{ \frac { d } { d { \hat { x } } } } \mathrm { c l i p } _ { 0 , 2 5 5 } ( { \hat { x } } ) : = 1 .
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
Consider how this affects the gradients of a squared loss,
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\frac { d } { d \hat { x } } ( \mathrm { c l i p } _ { 0 , 2 5 5 } ( \hat { x } ) - x ) ^ { 2 } = 2 ( \mathrm { c l i p } _ { 0 , 2 5 5 } ( \hat { x } ) - x ) \frac { d } { d \hat { x } } \mathrm { c l i p } _ { 0 , 2 5 5 } ( \hat { x } ) .
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
Assume that $\hat { x }$ is larger than 255. Without redefinition of the derivative, the error signal will be 0 and not helpful. Without any clipping, the error signal will depend on the value of $\hat { x }$ , even though any value above 255 will have the same effect on the loss at test time. On the other hand, using clipping but a different signal in the backward pass is intuitive, as it yields an error signal which is proportional to the error that would also be incurred at test time.
|
| 263 |
+
|
| 264 |
+
# A.2 DIFFERENT MODES OF JPEG
|
| 265 |
+
|
| 266 |
+
We compared optimized and non-optimized JPEG with (4:2:0) and without (4:4:4) chroma subsampling. Optimized JPEG computes a Huffman table specific to a given image, while unoptimized JPEG uses a predefined Huffman table. We did not count bits allocated to the header of the file format, but for optimized JPEG we counted the bits required to store the Huffman table. We found that on average, chroma-subsampled and optimized JPEG performed better on the Kodak dataset (Figure 7).
|
| 267 |
+
|
| 268 |
+
# A.3 COMPRESSION VS DIMENSIONALITY REDUCTION
|
| 269 |
+
|
| 270 |
+
Since a single real number can carry as much information as a high-dimensional entity, dimensionality reduction alone does not amount to compression. However, if we constrain the architecture of the encoder, it may be forced to discard certain information. To better understand how much information is lost due to dimensionality reduction and how much information is lost due to quantization, Figure 8 shows reconstructions produced by a compressive autoencoder with and without quantization. The effect of dimensionality reduction is minimal compared to the effect of quantization.
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 7: A comparison of different JPEG modes on the Kodak PhotoCD image dataset. Optimized Huffman tables perform better than default Huffman tables.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 8: To disentangle the effects of quantization and dimensionality reduction, we reconstructed images with quantization disabled. A: The original uncompressed image. B: A reconstruction generated by a compressive autoencoder, but with the rounding operation removed. The dimensionality of the encoder’s output is $3 \times$ smaller than the input. C: A reconstruction generated by the same compressive autoencoder. While the effects of dimensionality reduction are almost imperceptible, quantization introduces visible artefacts.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 9: Comparison of CAEs optimized for low, medium, or high bit rates.
|
| 280 |
+
|
| 281 |
+
To bring the parameter controlling the rate-distortion trade-off into a more intuitive range, we rescaled the distortion term and expressed the objective as follows:
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
- { \frac { \alpha } { N } } \ln q \left( \left[ f ( \mathbf { x } ) \circ \lambda \right] + \mathbf { u } \right) + { \frac { 1 - \alpha } { 1 0 0 0 \cdot M } } \cdot | | \mathbf { x } - g ( \left[ f ( \mathbf { x } ) \circ \lambda \right] / \lambda ) | | ^ { 2 } .
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
Here, $N$ is the number of coefficients produced by the encoder and $M$ is the dimensionality of $\mathbf { x }$ (i.e., 3 times the number of pixels).
|
| 288 |
+
|
| 289 |
+
The high-bit-rate CAE was trained with $\alpha = 0 . 0 1$ and 96 output channels, the medium-bit-rate CAE was trained with $\alpha = 0 . 0 5$ and 96 output channels, and the low-bit-rate CAE was trained with $\alpha = 0 . 2$ and 64 output channels.
|
| 290 |
+
|
| 291 |
+
# A.5 COMPARISON WITH VAE
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 10: An alternative to our approach is to replace the rounding function with additive uniform noise during training (Balle et al., 2016). Using mean-squared error for measuring distortion, ´ optimizing rate-distortion this way is equivalent to training a variational autoencoder (Kingma & Welling, 2014) with a Gaussian likelihood and uniform encoder (Section 2.4). Using the same training proecedure autoencoder architecture for both approaches (here trained for high bit-rates), we find that additive noise performs worse than redefining derivatives as in our approach. Rounding-based quantization is used at test time in both approaches.
|
| 295 |
+
|
| 296 |
+
# A.6 COMPLETE IMAGES
|
| 297 |
+
|
| 298 |
+
Below we show complete images corresponding to the crops in Figure 5. For each image, we show the original image (top left), reconstructions using CAE (top right), reconstructions using JPEG 2000 (bottom left) and reconstructions using the method of (Toderici et al., 2016b) (bottom right). The images are best viewed on a monitor screen.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
|
| 308 |
+

|
md/train/rklB76EKPr/rklB76EKPr.md
ADDED
|
@@ -0,0 +1,741 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAN GRADIENT CLIPPING MITIGATE LABEL NOISE?
|
| 2 |
+
|
| 3 |
+
Aditya Krishna Menon, Ankit Singh Rawat, Sashank J. Reddi, Sanjiv Kumar
|
| 4 |
+
Google Research
|
| 5 |
+
New York, NY USA
|
| 6 |
+
{adityakmenon,ankitsrawat,sashank,sanjivk}@google.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Gradient clipping is a widely-used technique in the training of deep networks, and is generally motivated from an optimisation lens: informally, clipping controls the dynamics of iterates, thus enhancing the rate of convergence to a local minimum. This intuition has been made precise in a line of recent works, which show that suitable clipping can yield significantly faster convergence than vanilla gradient descent. In this paper, we propose a new lens for studying gradient clipping, namely, robustness: informally, one expects clipping to mitigate the effects of noise, since one does not overly trust any single sample. Surprisingly, we prove that for the common problem of label noise in classification, standard gradient clipping does not in general provide robustness. On the other hand, we show that a simple variant of gradient clipping is robust, and is equivalent to suitably modifying the underlying loss function. As a special case, this yields a simple, noise-robust modification of the standard cross-entropy loss which performs well empirically.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION: TWO FACES OF GRADIENT CLIPPING
|
| 13 |
+
|
| 14 |
+
Gradient clipping is a widely-used technique in the training of deep networks (Mikolov, 2012; Pascanu et al., 2012; 2013; Mnih et al., 2015; Gehring et al., 2017; Merity et al., 2018; Peters et al., 2018), and in its simplest form, involves capping the global parameter gradient norm at a specified threshold. Constraining the gradient norm is paramount in training models such as recurrent neural networks, which may otherwise suffer from an “exploding gradient” problem (Bengio et al., 1994). Clipping has seen broader value in other neural models, and is abstractly understood as being valuable from an optimisation lens: intuitively, by ensuring that the gradient norm is not too large, the dynamics of iterates are more well-behaved (Hazan et al., 2015; Levy, 2016; Zhang et al., 2019). A distinct line of work has also explored the value of gradient clipping from a privacy lens (Abadi et al., 2016; Pichapati et al., 2019): intuitively, it prevents any single instance from overly influencing parameter updates, which is a core requirement in ensuring differential privacy (Dwork et al., 2006).
|
| 15 |
+
|
| 16 |
+
In this paper, we propose a new lens with which to study gradient clipping, namely, robustness: intuitively, clipping the gradient prevents over-confident descent steps, which is plausibly beneficial in the presence of noise. Given this intuition, our interest is whether gradient clipping can mitigate the problem of label noise in classification, which has received significant recent interest (Scott et al., 2013; Natarajan et al., 2013; Menon et al., 2015; Liu & Tao, 2016; Patrini et al., 2017; Ghosh et al., 2017; Han et al., 2018; Zhang & Sabuncu, 2018; Song et al., 2019; Thulasidasan et al., 2019; Charoenphakdee et al., 2019). We study this question, and provide three main contributions:
|
| 17 |
+
|
| 18 |
+
(a) we show that gradient clipping alone does not endow label noise robustness to even simple models. Specifically, we show that under stochastic gradient descent with linear models, gradient clipping is related to optimising a “Huberised” loss (Lemma 1, 2). While such Huberised losses preserve classification calibration (Lemma 3), they are not robust to label noise (Proposition 4).
|
| 19 |
+
(b) we propose composite loss-based gradient clipping, a variant that does have label noise robustness. Specifically, for losses comprising a base loss composed with a link function, (e.g., softmax crossentropy), we only clip the contribution of the base loss. The resulting partially Huberised loss preserves classification calibration (Lemma 6), while being robust to label noise (Proposition 7).
|
| 20 |
+
(c) we empirically verify that on both synthetic and real-world datasets, partially Huberised versions of standard losses (e.g., softmax cross-entropy) perform well in the presence of label noise (§5).
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Illustration of the Huberised and partially Huberised logistic loss (left panel). Recall that the logistic loss comprises the log-loss (or cross-entropy) composed with a sigmoid link. The Huberised loss arises from loss-based gradient clipping, and linearises the entire logistic loss beyond a threshold. The partially Huberised loss arises from composite loss-based gradient clipping, and linearises only the base loss (i.e., log-loss) beyond a threshold (right panel). Once combined with the sigmoid link, the overall partially Huberised loss asymptotically saturates. Our analysis in $\ S$ , $\ S 4$ establishes that Huberised losses are not robust to label noise, but partially Huberised losses are (Proposition 4, 7).
|
| 24 |
+
|
| 25 |
+
To illustrate the difference between standard and composite loss-based gradient clipping in (a) and (b), consider the pervasive softmax cross-entropy loss, viz. the logistic loss for binary classification. In (a), we relate gradient clipping to loss “Huberisation”, which linearises the logistic loss when it exceeds a fixed threshold. In (b), we introduce composite loss-based gradient clipping, which is equivalent to a “partial loss Huberisation” that linearises only the cross-entropy loss but leaves the sigmoid link untouched. Figure 1 illustrates the Huberised and partially Huberised logistic loss.
|
| 26 |
+
|
| 27 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 28 |
+
|
| 29 |
+
We provide background on gradient clipping, loss functions for classification, and label noise.
|
| 30 |
+
|
| 31 |
+
Gradient clipping. Consider a supervised learning task over instances $\mathcal { X }$ and labels $\mathcal { Y }$ , where we have a family of models indexed by $\theta \in \Theta$ , and the quality of a particular model is measured by a loss function $\ell _ { \theta } \colon \mathcal { X } \times \mathcal { Y } \mathbb { R }$ ∈. The gradient for a mini-batch $\{ ( x _ { n } , y _ { n } ) \} _ { n = 1 } ^ { N }$ is
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
g ( \theta ) \doteq \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \nabla \ell _ { \theta } ( x _ { n } , y _ { n } ) .
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
One may instead compute the clipped gradient, which for user-specified threshold $\tau > 0$ is
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \bar { g } _ { \tau } ( \theta ) \doteq \mathrm { c } \mathrm { { l i p } } _ { \tau } ( g ( \theta ) ) \qquad \mathrm { c l i p } _ { \tau } ( w ) \doteq \left\{ \begin{array} { l l } { \tau \cdot \frac { w } { | | w | | _ { 2 } } } & { \mathrm { ~ i f ~ } | | w | | _ { 2 } \ge \tau } \\ { w } & { \mathrm { ~ e l s e } . } \end{array} \right. } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Employing $\bar { g } _ { \tau } ( \theta )$ for optimisation corresponds to clipped gradient descent. This is closely related to normalised gradient descent (NGD) (Hazan et al., 2015), wherein one employs $\begin{array} { r } { \tilde { g } ( \theta ) \doteq \frac { g ( \theta ) } { | | g ( \theta ) | | _ { 2 } } } \end{array}$ . Hazan et al. (2015) showed that NGD can lead to convergence for a wider class of functions than standard gradient descent. Levy (2016) showed that NGD can escape saddle points for non-convex problems. Zhang et al. (2019) showed that gradient clipping can lead to accelerated convergence over gradient descent. Gradient clipping has also been explored for privacy (Abadi et al., 2016; Pichapati et al., 2019), motivated by it preventing any single instance from dominating parameter updates.
|
| 44 |
+
|
| 45 |
+
Loss functions. In binary classification, one observes samples from a distribution $D$ over ${ \mathcal { X } } \times \{ \pm 1 \}$ , and seeks a predictor $f \colon { \mathcal { X } } \mathbb { R }$ with low risk $R ( f ) \doteq \mathbb { E } \ell ( y , f ( x ) )$ according to a loss which, in an overload of notation, we denote $\ell \colon \{ \pm 1 \} \times \mathbb { R } \to \mathbb { R } _ { + }$ . For the zero-one loss $\bar { \ell _ { 0 1 } } ( y , f ) = \mathbb { I } y \cdot f < 0 ]$ , $R ( f )$ is known as the misclassification risk. Rather than directly using $\ell _ { 0 1 }$ J K, for computational convenience one often employs a margin loss $\ell ( y , f ) = \phi ( y \cdot f )$ , for convex $\phi \colon \mathbb { R } \to \mathbb { R } _ { + }$ .
|
| 46 |
+
|
| 47 |
+
We say that $\phi$ is classification calibrated (Zhang, 2004; Bartlett et al., 2006) if driving the excess risk over the Bayes-optimal predictor for $\phi$ to zero also drives the excess risk for $\ell _ { 0 1 }$ to zero; that is, minimising the $\phi$ -risk is statistically consistent for classification. A canonical example is the hinge loss $\phi ( z ) = [ 1 - z ] _ { + }$ . We call $\phi$ admissible if it is “well-behaved” in the sense of being bounded from below, strictly convex, continuously differentiable, non-increasing, and classification calibrated.
|
| 48 |
+
|
| 49 |
+
We say that $\phi$ is proper composite (Reid & Williamson, 2010; Nock & Nielsen, 2009) (or for brevity composite) if its minimising scores can be interpreted as probabilities. “Composite” here refers to such losses comprising a base loss $\varphi$ composed with an invertible link function $F \colon \mathbb { R } [ 0 , 1 ]$ . While $\phi$ accepts as input real-valued scores (e.g., the final layer logits of a neural network), these are internally converted to probabilities via $F$ . A canonical example is the logistic loss $\phi ( z ) = - \log F ( z )$ with $F \colon z \mapsto \sigma ( z )$ for sigmoid $\sigma ( z ) \doteq ( 1 + e ^ { - z } ) ^ { - 1 }$ . The multiclass analogue is the softmax cross-entropy loss, wherein the sigmoid becomes a softmax. See Appendix B for a more technical discussion.
|
| 50 |
+
|
| 51 |
+
Learning under label noise. In classification under label noise, one has samples from distribution $\bar { D }$ where $\operatorname { \mathbb { P } } _ { \bar { D } } ( y \mid x )$ is a noisy version of $\mathbb { P } _ { D } ( y \mid x )$ , e.g., all labels are corrupted with a fixed constant probability. The goal remains to ensure low risk with respect to the clean $D$ . This problem has a long history in statistics (Ekholm & Palmgren, 1982; Copas, 1988), and has emerged as a topic of recent interest in machine learning. There has been particular interest in the problem of learning under symmetric label noise, wherein all instances have a constant probability of their labels being flipped uniformly to any of the other classes. Scott et al. (2013); Katz-Samuels et al. (2019) proposed a framework for analysing the more general setting of class-conditional label noise. Takenouchi & Eguchi (2004); Natarajan et al. (2013); Cid-Sueiro et al. (2014); Patrini et al. (2017); Natarajan et al. (2018); van Rooyen & Williamson (2018) studied loss-correction for obtaining unbiased risk estimators. Recent works have explored ideas ranging from to model (dis)agreement (Malach & Shalev-Shwartz, 2017; Han et al., 2018; Song et al., 2019) to abstention (Thulasidasan et al., 2019).
|
| 52 |
+
|
| 53 |
+
# 3 GRADIENT CLIPPING AND HUBERISED LOSSES
|
| 54 |
+
|
| 55 |
+
We first show that gradient clipping in general does not endow robustness to label noise, even in simple settings. Specifically, we establish that stochastic gradient clipping with linear models is equivalent to modifying the underlying loss (Lemma 1). This modified loss is closely related to a Huberised loss (Lemma 2), which is equivalent to loss-based gradient clipping $L$ -gradient clipping). Unfortunately, Huberised losses, and thus L-gradient clipping, are not robust to label noise (Proposition 4).
|
| 56 |
+
|
| 57 |
+
# 3.1 FROM GRADIENT TO L-GRADIENT CLIPPING
|
| 58 |
+
|
| 59 |
+
Consider a binary classification problem, with $\mathcal { Y } = \{ \pm 1 \}$ . Suppose we use a scoring model $s _ { \theta } ( x )$ for $\theta \in \Theta$ with margin $m _ { \theta } ( x , y ) \stackrel { . } { = } y \cdot s _ { \theta } ( x )$ , and margin loss $\bar { \ell } _ { \theta } ( x , y ) \doteq \phi ( m _ { \theta } ( x , \bar { y } ) )$ for admissible $\phi \colon \mathbb { R } \to \mathbb { R } _ { + }$ . Then,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\nabla _ { \boldsymbol { \theta } } \ell _ { \boldsymbol { \theta } } ( x , y ) = \nabla _ { \boldsymbol { \theta } } m _ { \boldsymbol { \theta } } ( x , y ) \cdot \boldsymbol { \phi } ^ { \prime } ( m _ { \boldsymbol { \theta } } ( x , y ) ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Now suppose we perform stochastic gradient descent (i.e., we use $N = 1$ in (1)) and use a linear scorer $\dot { s _ { \theta } ( x ) } = \dot { \theta ^ { \mathrm { T } } { x } }$ . Here, gradient clipping of (3) is equivalent to modifying the loss as follows.
|
| 66 |
+
|
| 67 |
+
Lemma 1. Pick any admissible margin loss $\phi$ , and $\tau > 0$ . Then, for loss $\ell _ { \theta } ( x , y ) \doteq \phi ( m _ { \theta } ( x , y ) )$ with linear scorer, the clipped loss gradient (2) is equivalent to the gradient of a modified loss $\ell$ :
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } & { \mathrm { c l i p } _ { \tau } ( \nabla \ell _ { \theta } ( x , y ) ) = \nabla \bar { \ell } _ { \theta } ( x , y ) , } \\ & { \mathrm { w i t h } \ \bar { \ell } _ { \theta } ( x , y ) \doteq \left\{ \begin{array} { l l } { - \frac { \tau } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } \cdot m _ { \theta } ( x , y ) } & { \ i f \left| \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) \right| \ge \frac { \tau } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } } \\ { \phi ( m _ { \theta } ( x , y ) ) } & { \ e l s e . } \end{array} \right. } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The loss $\bar { \ell }$ in (4) is intuitive: if the derivative of the original loss $\phi$ exceeds a certain effective clipping threshold, we replace $\phi$ with a linear loss function. This effective threshold $\tau \cdot ( \lVert \ddot { \nabla } m _ { \theta } ( x , y ) \bar { \rVert _ { 2 } } ) ^ { - \bar { 1 } }$ takes into account the instance-dependent margin gradient, viz. $\| x \| _ { 2 }$ for linear $s _ { \theta } ( x )$ .
|
| 74 |
+
|
| 75 |
+
We will comment in $\ S 4 . 4$ as to the properties of gradient clipping in more general scenarios. For the moment, we note that Lemma 1 is closely related to the “Huber loss” (Huber, 1964),
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\ell _ { \mathrm { h u b e r } } ( x , y ; \theta ) = { \left\{ \begin{array} { l l } { \tau \cdot | s _ { \theta } ( x ) - y | } & { { \mathrm { ~ i f ~ } } | s _ { \theta } ( x ) - y | \geq \tau } \\ { { \frac { 1 } { 2 } } \cdot ( s _ { \theta } ( x ) - y ) ^ { 2 } } & { { \mathrm { ~ e l s e . } } } \end{array} \right. }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
This replaces the extremes of the square loss with the absolute loss. Both the absolute and Huber losses are widely employed in robust regression (Huber, 1981, Chapter 3), (Hampel et al., 1986, pg. 100). Note that (4) slightly differs from (5) as the effective clipping threshold is instance-dependent. One may nonetheless arrive at Huber-style losses via a variant of gradient clipping; this connection will prove useful for our subsequent analysis. Per (3), gradient clipping involves using
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r } { \mathsf { c l i p } _ { \tau } \left( \nabla \ell _ { \theta } ( x , y ) \right) = \mathsf { c l i p } _ { \tau } \left( \nabla m _ { \theta } ( x , y ) \cdot \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) \right) , } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
wherein the clipping considers the margin gradient. Consider now the following loss-based gradient clipping ( $L$ -gradient clipping), wherein we clip only the contribution arising from the loss:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \mathrm { 1 - c l i p } _ { \tau } \left( \nabla \ell _ { \theta } ( x , y ) \right) \doteq \nabla m _ { \theta } ( x , y ) \cdot \mathrm { c l i p } _ { \tau } \left( \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) \right) . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Compared to (6), we effectively treat the margin gradient norm $\| \nabla m _ { \theta } ( x , y ) \| _ { 2 }$ as constant across instances, and focus on bounding the loss derivative. The latter may be a significant component in the gradient norm; e.g., for linear models, $\| \nabla m _ { \theta } ( x , y ) \| _ { 2 } = \| x \| _ { 2 }$ is often bounded. Observe further that for linear models with $\| x \| _ { 2 } \equiv R$ across instances, (7) is a rescaled version of the clipped gradient:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\operatorname { c l i p } _ { \tau } \left( \nabla \ell _ { \theta } ( x , y ) \right) = \tau \cdot \frac { y \cdot x \cdot \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) } { \tau \vee ( R \cdot | \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) | ) } = \nabla m _ { \theta } ( x , y ) \cdot \operatorname { c l i p } _ { \tau / R } \left( \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) \right) .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Interestingly, L-gradient clipping equivalently uses the following “Huberised” version of the loss.
|
| 100 |
+
|
| 101 |
+
Lemma 2. Pick any admissible margin loss $\phi : \mathbb { R } \to \mathbb { R } _ { + }$ with Fenchel conjugate $\phi ^ { * } ,$ and $\tau > 0$ Then, the clipped gradient in (7) is equivalent to employing a Huberised loss function $\bar { \phi } _ { \tau }$ such that
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r } \begin{array} { r l } & { \mathrm { c l } \mathrm { i } \mathsf { p } _ { \tau } \left( \phi ^ { \prime } ( z ) \right) = \bar { \phi } _ { \tau } ^ { \prime } ( z ) \mathrm { w i t h } \bar { \phi } _ { \tau } ( z ) \doteq \left\{ \begin{array} { l l } { - \tau \cdot z - \phi ^ { * } ( - \tau ) } & { i f \phi ^ { \prime } ( z ) \le - \tau } \\ { \phi ( z ) } & { e l s e . } \end{array} \right. } \end{array} \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Evidently, $\bar { \phi } _ { \tau }$ linearises $\phi$ once its derivative is sufficiently large, akin to the Huber loss in (5). One may verify that for $\phi ( z ) = ( 1 - z ) ^ { 2 }$ , one arrives exactly at (5).
|
| 108 |
+
|
| 109 |
+
Example 3.1: For the logistic loss $\phi ( z ) = \log ( 1 + e ^ { - z } )$ , the Huberised loss for $\tau \in ( 0 , 1 )$ is
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r } { \bar { \phi } _ { \tau } ( z ) = \left\{ { \stackrel { - \tau \cdot z - \log ( 1 - \tau ) - \tau \cdot \sigma ^ { - 1 } ( \tau ) } { \log ( 1 + e ^ { - z } ) } } \right. \stackrel { \mathrm { ~ i f ~ } z \leq - \sigma ^ { - 1 } ( \tau ) } { \mathrm { ~ e l s e } } } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Per Figure 1a, this linearises $\phi$ beyond a fixed threshold. See Appendix C for further illustrations.
|
| 116 |
+
|
| 117 |
+
The use of Huberised losses in classification is not new (Zhang et al., 2002; Zhang & Johnson, 2003;
|
| 118 |
+
Rosset & Zhu, 2007). However, we now provide a novel study of their label noise robustness.
|
| 119 |
+
|
| 120 |
+
# 3.2 CONSISTENCY AND LABEL-NOISE ROBUSTNESS OF HUBERISED LOSSES
|
| 121 |
+
|
| 122 |
+
Before studying the effect of label noise on Huberised losses, it is apposite to consider whether they are suitable for use even in the absence of noise. One way to formalise this is to ask whether the losses maintain classification calibration, in the sense of $\ S 2$ . This is a minimal requirement on a loss to be useful for classification (Zhang, 2004; Bartlett et al., 2006). One may further ask whether the losses preserve class-probabilities, i.e., are proper composite in the sense of $\ S$ . It is desirable to preserve this key trait of losses such as the logistic loss. The following clarifies both points.
|
| 123 |
+
|
| 124 |
+
Lemma 3. Pick any admissible margin loss $\phi$ and $\tau > 0$ . Then, the Huberised loss $\bar { \phi } _ { \tau }$ in (8) is classification calibrated. If $\phi$ is proper composite and $\tau \geq - \phi ^ { \prime } ( 0 )$ , then $\bar { \phi } _ { \tau }$ is also proper composite.
|
| 125 |
+
|
| 126 |
+
L-gradient clipping is thus benign for classification, generalising Rosset & Zhu (2007, Section 3.4), which was for the square-hinge loss. Interestingly, for composite $\phi$ and small $\tau$ , the proof reveals that $\bar { \phi } _ { \tau }$ has a non-invertible link function. Intuitively, such $\bar { \phi } _ { \tau }$ are effectively linear, and linear losses are unsuited for estimating probabilities (van Rooyen et al., 2015; Charoenphakdee et al., 2019).
|
| 127 |
+
|
| 128 |
+
We now turn to our central object of inquiry: does gradient clipping endow robustness to label noise? To study this, we consider L-gradient clipping, which as noted above is a special case of gradient clipping under linear models with constant $\| \nabla m _ { \theta } ( x , y ) \| _ { 2 }$ . Since L-gradient clipping is in turn equivalent to using a Huberised loss, we may study the robustness properties of this loss.
|
| 129 |
+
|
| 130 |
+
Surprisingly, when our loss is convex (e.g., softmax cross-entropy), Huberised losses are not robust to even very simple forms of label noise. Essentially, since these losses are still convex, they can still be affected by errant outlier observations. Formally, using a result of Long & Servedio (2010) (see Appendix E.1), we arrive at the following.
|
| 131 |
+
|
| 132 |
+
Proposition 4. Pick any admissible margin loss $\phi$ and $\tau > 0$ . Then, ∃ a separable distribution for which the optimal linear classifier under $\phi _ { \tau }$ is equivalent to random guessing under symmetric noise.
|
| 133 |
+
|
| 134 |
+
To situate Proposition 4 in a broader context, we note that for regression problems, it is well known that the Huber loss is susceptible to “high leverage” outliers (Hampel et al., 1986, pg. 313), (Rousseeuw & Leroy, 1987, pg. 13), (Maronna et al., 2019, pg. 104), i.e., extremal instances which dominate the optimal solution. Proposition 4 complements these for the case of label noise in classification.
|
| 135 |
+
|
| 136 |
+
Given that gradient clipping does not endow label noise robustness, how else might we proceed? In a regression context, the outlier vulnerability of the Huber loss can be addressed by using a trimmed average of the loss (Rousseeuw & Leroy, 1987; Bhatia et al., 2015; Yang et al., 2018). Such ideas have been successfully explored for label noise problems (Shen & Sanghavi, 2019). We will however demonstrate that a simple variant of clipping yields a loss that does possess label noise robustness.
|
| 137 |
+
|
| 138 |
+
# 4 COMPOSITE LOSS-BASED GRADIENT CLIPPING
|
| 139 |
+
|
| 140 |
+
We now show that noise robustness can be achieved with $C L$ -gradient clipping, a variant wherein for composite losses (e.g., softmax cross-entropy), we perform partial Huberisation of the base loss only.
|
| 141 |
+
|
| 142 |
+
# 4.1 FROM HUBERISATION TO PARTIAL HUBERISATION
|
| 143 |
+
|
| 144 |
+
Consider a composite margin loss $\ell _ { \theta } ( x , y ) \doteq \phi ( m _ { \theta } ( x , y ) )$ , where $\phi = \varphi \circ F$ for some base loss $\varphi$ and invertible link $F \colon \bar { \mathbb { R } } \stackrel { \cdot } { } [ 0 , 1 ]$ ; e.g., the logistic loss has $\varphi ( u ) = - \log u$ and $F ( z ) = \sigma ( z )$ . We can interpret $p _ { \theta } ( x , y ) \doteq F ( m _ { \theta } ( x , y ) )$ as a probability estimate; e.g., $p _ { \theta } ( x , 1 ) = \sigma ( \dot { m _ { \theta } } ( x , 1 ) )$ is the probability of $x$ being positive. Now, rewriting $\ell _ { \theta } ( x , y ) = \varphi ( p _ { \theta } ( x , y ) )$ , we may express (3) as:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\nabla \ell _ { \theta } ( x , y ) = \nabla p _ { \theta } ( x , y ) \cdot \boldsymbol { \varphi } ^ { \prime } ( p _ { \theta } ( x , y ) ) .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
L-gradient clipping in (7) was defined as only clipping $\phi ^ { \prime } = ( \varphi \circ F ) ^ { \prime }$ above, which ensures that the resulting Huberised loss is Lipschitz. Typically, however, $F$ is already Lipschitz; e.g., this is the case for the commonly used sigmoid or softmax link. This suggests the following composite loss-based gradient clipping ( $C L$ -gradient clipping), wherein we only clip the derivative for the base loss $\varphi$ :
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\operatorname { c l - c l i p } _ { \tau } \left( \nabla \ell _ { \theta } ( x , y ) \right) \doteq \nabla p _ { \theta } ( x , y ) \boldsymbol { \cdot } \operatorname { c l i p } _ { \tau } \left( \varphi ^ { \prime } ( p _ { \theta } ( x , y ) ) \right) .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
As before, CL-gradient clipping corresponds to optimising a new, “partially Huberised” loss.
|
| 157 |
+
|
| 158 |
+
Lemma 5. Pick any admissible, composite margin loss $\phi = \varphi \circ F$ , and $\tau > 0$ . Then, the clipped gradient in (9) is equivalent to employing $a$ partially Huberised loss $\tilde { \phi } _ { \tau } = \tilde { \varphi } _ { \tau } \circ F$ , where
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\tilde { \varphi } _ { \tau } ( u ) \doteq \left\{ \begin{array} { l l } { - \tau \cdot u - \varphi ^ { * } ( - \tau ) } & { i f \varphi ^ { \prime } ( u ) \le - \tau } \\ { \varphi ( u ) } & { e l s e . } \end{array} \right.
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
Compared to the Huberised loss (7), the partially Huberised loss only linearises the base loss $\varphi$ , while retaining the link $F$ . Consequently, the composite loss $\tilde { \phi } _ { \tau }$ behaves like the link beyond a certain threshold, and will thus be bounded: indeed, $\tilde { \phi } _ { \tau } ( z ) = - \tau \cdot F ( z ) - \varphi ^ { \ast } ( - \tau )$ if $\varphi ^ { \prime } ( F ( z ) ) \leq - \tau$ .
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\tilde { \phi } _ { \tau } ( z ) = \left\{ \begin{array} { l l } { - \tau \cdot \sigma ( z ) + \log \tau + 1 } & { \mathrm { ~ i f ~ } z \leq \sigma ^ { - 1 } \left( \frac { 1 } { \tau } \right) } \\ { \log ( 1 + e ^ { - z } ) } & { \mathrm { ~ e l s e . } } \end{array} \right.
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
Note that partial Huberisation readily generalises to a multi-class setting. Indeed, suppose we have softmax probability estimates $p _ { \theta } ( x , \bar { y } ) \overset { \cdot } { \propto } \exp ( m _ { \theta } ( x , y ) )$ . Then, whereas the softmax cross-entropy employs $\ell _ { \theta } ( x , y ) = - \log p _ { \theta } ( x , y )$ , our partially Huberised softmax cross-entropy for $\tau > 1$ is
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\tilde { \ell } _ { \theta } ( x , y ) = \left\{ \begin{array} { l l } { - \tau \cdot p _ { \theta } ( x , y ) + \log \tau + 1 } & { \mathrm { i f ~ } p _ { \theta } ( x , y ) \leq \frac { 1 } { \tau } } \\ { - \log p _ { \theta } ( x , y ) } & { \mathrm { e l s e } . } \end{array} \right.
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
Following $\ S 3 . 2$ , we establish that CL-gradient clipping is always benign from a classification perspective, and provided $\tau$ is sufficiently large, from a probability estimation perspective as well. As before, we do this by exploiting the equivalence of CL-gradient clipping to a partially Huberised loss.
|
| 177 |
+
|
| 178 |
+
Lemma 6. Pick any admissible composite margin loss $\phi = \varphi \circ F$ and $\tau > 0$ . Then, the loss $\tilde { \phi } _ { \tau }$ in (10) is classification calibrated. If further $\tau \geq - \varphi ^ { \prime } ( 1 / 2 )$ , then $\tilde { \varphi } _ { \tau }$ is also proper composite.
|
| 179 |
+
|
| 180 |
+
We now show that partially Huberised losses have an important advantage over Huberised losses: under symmetric label noise, the optimal solution on the clean distribution cannot be too far away from the optimal solution on the noisy distribution. This implies that label noise (such as that considered in Proposition 4) cannot have an excessively deleterious influence on the loss.
|
| 181 |
+
|
| 182 |
+
Proposition 7. Pick any proper loss $\varphi$ and $\tau > 0$ . Let $f ^ { * }$ be the risk minimiser of $\tilde { \varphi } _ { \tau }$ on the clean distribution. For any non-trivial level of symmetric label noise, let ${ \overline { { \operatorname { r e g } } } } _ { \tau } ( f ^ { * } )$ denote the excess risk of $f ^ { * }$ with respect to $\tilde { \varphi } _ { \tau }$ on the noisy distribution. Then, there exists $C > 0$ such that $\overline { { \mathrm { r e g } } } _ { \tau } ( f ^ { * } ) \leq C$ .
|
| 183 |
+
|
| 184 |
+
Note that by van Rooyen et al. (2015, Proposition 4), it is impossible for the above bound to hold with $C = 0$ without using a linear loss. Nonetheless, by virtue of partially Huberised losses being partially linear, we are able to bound the degradation under label corruption. The saturating behaviour of the partially Huberised loss also implies robustness to outliers in feature space; see Appendix D.
|
| 185 |
+
|
| 186 |
+
# 4.3 RELATION TO EXISTING WORK
|
| 187 |
+
|
| 188 |
+
The partially Huberised log loss in (10), (11) can be related to a family of losses studied in several works (Ding & Vishwanathan, 2010; Hung et al., 2018; Zhang & Sabuncu, 2018; Sypherd et al., 2019; Amid et al., 2019b;a): for $\alpha \in ( 0 , 1 ]$ , define the generalised cross-entropy $\varphi _ { \alpha } \colon [ 0 , 1 ] \to \bar { \mathbb { R } } _ { + }$ by $\varphi _ { \alpha } ( u ) \doteq ( 1 - u ^ { \alpha } ) / \alpha$ . See Appendix C.3 for an illustration of $\varphi _ { \alpha }$ . There are two similarities between (11) and $\varphi _ { \alpha }$ . First, both proposals interpolate between the log and linear losses: when $\alpha 0 ^ { + }$ , $\varphi _ { \alpha }$ approaches the log loss, and when $\alpha = 1$ , $\varphi _ { \alpha }$ equals the linear loss. Second, both proposals modify the base loss, allowing the link $F$ to be chosen independently. In particular, one may use the heavy-tailed $F$ of Ding & Vishwanathan (2010); Amid et al. (2019b) in conjunction with our partially Huberised loss.
|
| 189 |
+
|
| 190 |
+
One difference between (11) and $\varphi _ { \alpha }$ is that the partially Huberised loss is exactly linear for a suitable region; consequently, it is guaranteed to be Lipschitz, unlike $\varphi _ { \alpha }$ . This can be understood in terms of the loss gradients: for a class-probability estimate $p _ { \theta } ( x , y )$ , let $\ell _ { \theta } ( x , y ) \doteq \varphi ( p _ { \theta } ( x , y ) )$ . For the generalised cross-entropy, $\nabla \ell _ { \theta } ( x , \bar { y } ) = - p _ { \theta } ( x , y ) ^ { \alpha - 1 } \cdot \nabla p _ { \theta } ( x , y )$ , while for the partially Huberised loss, $\nabla \ell _ { \theta } ( x , y ) = - ( p _ { \theta } ( x , y ) \vee \tau ) ^ { - 1 } \cdot \nabla p _ { \theta } ( x , y )$ . Both gradients thus take into account whether a sample is “informative”, in the sense of being poorly-predicted $( p _ { \theta } ( x , y ) \sim 0 )$ . Further, to guard against such samples being the result of label noise, both ensure this influence is not overwhelming, but in different ways: the generalised cross-entropy softens the influence, while still allowing it to be unbounded as $p _ { \theta } ( x , y ) 0$ . On the other hand, the partially Huberised loss enforces a hard cap of $\tau ^ { - 1 }$ on the influence. This is to be contrast with a truncated loss also considered in Zhang & Sabuncu (2018), which enforces a hard cap on the loss, thus completely discarding poorly-predicted instances.
|
| 191 |
+
|
| 192 |
+
As shown in Figure 1a, the partially Huberised loss in (10) exhibits saturating behaviour at the extremes. This by itself is hardly new in the context of robust statistics. For example, Tukey’s “biweight” loss replaces the Huber loss’ linear behaviour with hard saturation (Gross & Tukey, 1973), and is a member of the broader family of redescending M-estimators (Andrews et al., 1972; Shevlyakov et al., 2008). In a similar spirit, Masnadi-Shirazi & Vasconcelos (2009) proposed the bounded Savage loss $\varphi ( v ) = ( \sigma ( 2 v ) - \bar { 1 } ) ^ { 2 }$ , while Yang et al. (2010); Menon & Williamson (2018) theoretically studied loss clipping. Robust versions of logistic regression derived by variants of the Huber loss have been explored, e.g., Pregibon (1982, Section 4.1), Copas (1988, Section 3.1), (Feng et al., 2014).
|
| 193 |
+
|
| 194 |
+
The distinction of the above proposals to our work is two-fold. First, we explicitly consider the classification setting, wherein we show consistency and robustness to label noise for the partially Huberised loss. Second, our proposal explicitly highlights the connection to gradient clipping.
|
| 195 |
+
|
| 196 |
+
Finally, while our focus has been on label noise, there are other notions of “robustness”. Indeed, several works have proposed means of making gradient descent robust to heavy-tailed distributions
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Clipping type</td><td> Clipped gradient form</td><td>Equivalent loss</td><td>Reference</td><td>Label noise robust?</td></tr><tr><td>Gradient</td><td>clip-(Vm(0)·'(m(0)))</td><td>Equation 4</td><td>Equation 6</td><td>× (Proposition 4)</td></tr><tr><td>L-Gradient</td><td>Vm(θ)·clip, ('(m(0)))</td><td>Huberised</td><td></td><td>Equation 7× (Proposition 4)</td></tr><tr><td>CL-Gradient</td><td>Vp(0)·clip,('(p(0)))</td><td>Partially HuberisedEquation 9√ (Proposition 7)</td><td></td><td></td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 1: Summary of types of gradient clipping considered in this paper. We consider binary classification problems involving a labelled example $( x , y )$ , parametrised scoring function $s _ { \theta } ( x )$ with margin $m ( \theta ) \doteq$ $y \cdot s _ { \theta } ( x )$ , and differentiable composite margin loss $\phi ( z )$ . This loss internally converts scores to probabilities $p ( \theta ) \doteq F ( m ( \theta ) )$ for link function $F ( \cdot )$ , which is evaluated with some base loss $\varphi$ ; i.e., $\phi = \varphi \circ F$ . Gradient clipping applies to the full loss, i.e., $\phi ( m ( \theta ) )$ . L-gradient clipping applies only to the composite loss, leaving the score untouched; this is equivalent to using a Huberised loss. CL-gradient clipping applies only to the base loss, leaving the link untouched; this is equivalent to using a partially Huberised loss. Only the latter has robustness guarantee under symmetric label noise.
|
| 201 |
+
|
| 202 |
+
or outliers (Brownlees et al., 2015; Hsu & Sabato, 2016; Lugosi & Mendelson, 2016; Lecué et al., 2018; Prasad et al., 2018; Holland & Ikeda, 2019), typically by passing the gradient through a robust operator (Tukey, 1960; Hampel et al., 1986; Rousseeuw & Leroy, 1987; Lerasle & Oliveira, 2011; Catoni, 2012; Minsker, 2015). By contrast, we analyse the (simpler) gradient clipping approach, showing that while it is inadequate to cope with label noise, a simple modification rectifies this. Since our proposal only modifies the underlying loss, it may be combined with any of these methods.
|
| 203 |
+
|
| 204 |
+
# 4.4 DISCUSSION AND IMPLICATIONS
|
| 205 |
+
|
| 206 |
+
Table 1 summarises our results, highlighting the perspective of gradient clipping as equivalently modifying the loss. Before proceeding, we make some qualifying comments. First, our analysis has assumed symmetric label noise. Often, one encounters asymmetric or instance-dependent noise (Menon et al., 2018). While corresponding guarantees for the linear loss may be ported over to the partially Huberised loss, they require stronger distributional assumptions (Ghosh et al., 2015).
|
| 207 |
+
|
| 208 |
+
Second, Proposition 4 exhibits a specific distribution which defeats the Huberised loss under linear models. In practice, distributions may be more benign (Patrini et al., 2016), and models are often nonlinear, meaning that Huberised losses (and thus gradient clipping) are thus unlikely to succumb as extremely to label noise as Proposition 4 suggests. The aim of $\ S 4$ is however to establish that a simple modification of clipping avoids worst-case degradation, without adding significant complexity.
|
| 209 |
+
|
| 210 |
+
Third, for minibatch size $N > 1$ , the effect of clipping is not a simple loss modification, since the loss gradients for each sample will be modified by the entire minibatch loss gradient norm $\| g ( \theta ) \| _ { 2 }$ . Since this minibatch is randomly drawn, one cannot mimic gradient clipping by a simple modification of the loss function. However, the results for $N = 1$ suffice to establish that gradient clipping cannot $i n$ general endow robustness. One may use our partially Huberised loss in conjunction with minibatch gradient clipping, to potentially obtain both robustness and optimisation benefits.
|
| 211 |
+
|
| 212 |
+
Finally, partially Huberised losses such as (12) require setting a hyperparameter $\tau$ (e.g., by crossvalidation), similar to $\alpha$ in the generalised cross-entropy per $\ S$ . Intuitively, the optimal $\tau$ trades off the noise-robustness of the linear loss, and the gradient informativeness of the base loss (per the discussion in §4.3). Setting $\tau$ to be large tacitly assumes that one’s samples are largely noise-free.
|
| 213 |
+
|
| 214 |
+
# 5 EXPERIMENTAL ILLUSTRATION
|
| 215 |
+
|
| 216 |
+
We now present experiments illustrating that: (a) we may exhibit label noise scenarios that defeat a Huberised but not partially Huberised loss, confirming Propositions 4, 7, and (b) partially Huberised versions of existing losses perform well on real-world datasets subject to label noise.
|
| 217 |
+
|
| 218 |
+
Synthetic datasets. Our first experiments involve two synthetic datasets, which control for confounding factors. We begin with a setting from Long & Servedio (2010), comprising a 2D linearly separable distribution. (See Appendix E.1 for an illustration.) We draw $N = 1$ , 000 random samples from this distribution, and flip each label with $\rho = 4 5 \%$ probability. We train a linear classifier to minimise one of several losses, and evaluate the classifier’s accuracy on 500 clean test samples.
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 2: Results on synthetic data. In (b), the solid (dashed) curve denotes empirical risk without (with) outliers.
|
| 222 |
+
|
| 223 |
+
Table 2: Test set accuracy where the training labels are corrupted with probability $\rho$ . We report the mean and standard error over 3 trials. The highlighted cells are the best performing loss at a given $\rho$ . “PHuber” here refers to our partial Huberisation from $\ S$ , which is equivalent to a variant of gradient clipping.
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Dataset</td><td>Loss function</td><td>p=0.0</td><td>p=0.2</td><td>p=0.4</td><td>p=0.6</td></tr><tr><td rowspan="6">MNIST</td><td>CE</td><td>98.7 ± 0.0</td><td>97.7 ± 0.2</td><td>96.4 ± 0.3</td><td>91.1 ± 0.6</td></tr><tr><td>CE +clipping</td><td>98.6 ± 0.1</td><td>97.5 ± 0.1</td><td>96.8 ± 0.1</td><td>88.9 ± 0.8</td></tr><tr><td>Linear</td><td>98.3 ± 0.0</td><td>88.2 ± 0.1</td><td>78.8 ± 0.0</td><td>9.6 ± 0.1</td></tr><tr><td>GCE</td><td>98.8 ± 0.1</td><td>98.6 ± 0.1</td><td>98.2 ± 0.0</td><td>97.6 ± 0.1</td></tr><tr><td>PHuber-CE τ =10</td><td>98.5 ± 0.0</td><td>98.7 ± 0.0</td><td>98.5 ± 0.1</td><td>97.6 ± 0.0</td></tr><tr><td>PHuber-GCE τ = 10</td><td>98.6 ± 0.1</td><td>98.5 ± 0.1</td><td>98.4 ± 0.1</td><td>97.8 ± 0.0</td></tr><tr><td rowspan="6">CIFAR-10</td><td>CE</td><td>92.4 ± 0.1</td><td>72.4 ± 0.2</td><td>61.4 ± 0.8</td><td>40.6 ± 0.3</td></tr><tr><td>CE + clipping</td><td>88.3 ± 0.3</td><td>68.7 ± 0.2</td><td>56.7 ± 0.6</td><td>44.2 ± 2.1</td></tr><tr><td>Linear</td><td>91.3 ± 0.1</td><td>88.2 ± 0.1</td><td>83.8 ± 0.2</td><td>69.3 ± 0.2</td></tr><tr><td>GCE</td><td>91.7 ± 0.0</td><td>88.4± 0.2</td><td>80.8 ± 0.3</td><td>60.0 ± 0.3</td></tr><tr><td>PHuber-CEτ= 2</td><td>91.6 ± 0.1</td><td>88.6 ± 0.0</td><td>83.6 ± 0.1</td><td>72.2 ± 0.0</td></tr><tr><td>PHuber-GCE τ = 10</td><td>92.0 ± 0.1</td><td>88.5 ± 0.1</td><td>80.8 ± 0.1</td><td>62.6 ± 0.2</td></tr><tr><td rowspan="6">CIFAR-100</td><td>CE</td><td>66.6 ± 1.4</td><td>49.7 ± 0.3</td><td>29.9 ± 0.9</td><td>11.4 ± 0.2</td></tr><tr><td>CE + clipping</td><td>28.8 ± 0.1</td><td>20.6 ± 0.4</td><td>14.7 ± 0.6</td><td>9.0 ± 0.4</td></tr><tr><td>Linear</td><td>12.1 ± 1.6</td><td>6.6 ± 1.2</td><td>5.7 ± 0.9</td><td>3.6 ± 0.1</td></tr><tr><td>GCE</td><td>70.1 ± 0.1</td><td>63.9 ± 0.1</td><td>52.0 ± 0.2</td><td>29.9 ± 0.5</td></tr><tr><td>PHuber-CE τ=10</td><td>66.2 ± 1.5</td><td>56.2 ± 2.2</td><td>44.4 ± 0.7</td><td>18.5 ± 0.4</td></tr><tr><td>PHuber-GCE τ = 10</td><td>69.8 ± 0.2</td><td>64.4 ± 0.4</td><td>52.4 ± 0.2</td><td>31.5 ± 0.8</td></tr></table>
|
| 226 |
+
|
| 227 |
+
We compare the logistic loss with its Huberised and partially Huberised versions, using $\tau = 1$ and $\tau = 2$ respectively. Figure 2a presents the results over 500 independent trials. The logistic loss and its Huberised counterpart suffer significantly under noise, while the partially Huberised loss often achieves perfect near-discrimination. This confirms that in the worst case, L-gradient clipping may succumb to noise, while CL-gradient clipping performs well in the same scenario.
|
| 228 |
+
|
| 229 |
+
We next consider a 1D setting based on Ding (2013, Section 3.2.3), comprising 10, 000 linearly separable “inliers” and 50 “outliers”. Assuming the use of a linear model parameterised by scalar $\theta \in \mathbb { R }$ , we plot the empirical risk of the samples with and without the outlier observations as $\theta$ is varied. Figure 2b shows that the logistic loss and its Huberised variant are strongly affected by the outliers: their optimal solution goes from $\theta ^ { * } = + \infty$ to $\theta ^ { * } = 0$ . However, the partially Huberised loss is largely immune to the outliers. Appendix E contains additional details on this experiment.
|
| 230 |
+
|
| 231 |
+
Real-world datasets. We now demonstrate that partially Huberised losses perform well with deep neural networks trained on MNIST, CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009). For MNIST, we train a LeNet (Lecun et al., 1998) using Adam with batch size $N = 3 2$ , and weight decay of $1 0 ^ { - 3 }$ . For CIFAR-10 and CIFAR-100, we train a ResNet-50 (He et al., 2016) using SGD with momentum 0.1, weight decay of $5 \times 1 0 ^ { - 3 }$ , batch normalisation, and $N = 6 4 , 1 2 8$ respectively.
|
| 232 |
+
|
| 233 |
+
For each dataset, we corrupt the training labels with symmetric noise at flip probability $\rho \in$ $\{ 0 . 0 , 0 . 2 , 0 . 4 , 0 . 6 \}$ . We compare the test set accuracy of various losses combined with a softmax link. Our baseline is the cross-entropy loss (CE). As representative noise-robust losses, we consider the linear or unhinged loss (van Rooyen et al., 2015; Ghosh et al., 2017), and the generalised cross-entropy (GCE) with $\alpha = 0 . 7$ , following Zhang & Sabuncu (2018). We additionally assess global gradient clipping (with $\tau = 0 . 1$ ) of the CE, which per $\ S 3$ is akin to a Huberised loss.
|
| 234 |
+
|
| 235 |
+
We apply our partial Huberisation of (10) to the CE (12) (“PHuber-CE”), and the GCE (“PHuberGCE”). The latter highlights that partial Huberisation is not tied to the cross-entropy, and is applicable even on top of existing noise-robust losses. Recall that partial Huberisation offers a choice of tuning parameter $\tau$ , similar to the $\alpha$ parameter in GCE, and noise-rate estimates in loss-correction techniques more generally. For each dataset, we pick $\tau \in \{ 2 , 1 0 \}$ (equivalently corresponding to probability thresholds 0.5 and 0.1 respectively) so as to maximise accuracy on a validation set of noisy samples with the maximal noise rate $\rho = 0 . 6$ ; the chosen value of $\tau$ was then used for each noise level. Tuning $\tau$ separately for each setting of the noise rate $\rho$ can be expected to help performance, at the expense of increased computational cost. Recall also that as $\tau 1$ , partial Huberisation mimics using the base loss, while as $\tau \to + \infty$ , partial Huberisation mimics using the linear loss; our hypothesis is that an intermediate $\tau$ can attain a suitable balance between noise robustness, and gradient informativeness.
|
| 236 |
+
|
| 237 |
+
Table 2 shows that in the noise-free case $\begin{array} { r } { { \bf \Pi } _ { \rho } = 0 . 0 } \end{array}$ ), all methods perform comparably. However, when injecting noise, accuracy for the CE degrades dramatically. Further, gradient clipping sometimes offers improvements under high noise; however, the performance is far inferior to other losses, which is in keeping with their robustness guarantees. Indeed, the linear loss, which is provably robust to symmetric noise, generally performs well even when $\rho = 0 . 6$ . However, optimisation under this loss is more challenging, since the gradient does not account for instances’ importance (per $\ S 4 . 3 \ r ,$ ). This is particularly reflected on the CIFAR-100 dataset, where this loss suffers to learn even under no noise. The GCE and partially Huberised losses do not suffer from this issue, even at high noise levels.
|
| 238 |
+
|
| 239 |
+
Generally, the partially Huberised losses are competitive with or improve upon the counterpart losses they build upon. In particular, the partially Huberised CE performs much better than the CE under high noise, while the partially Huberised GCE slightly bumps up the GCE numbers on CIFAR-100. This indicates that partially Huberised may be useful in combining with generic base losses to cope with noise. We reiterate here that our partially Huberised loss may be used in conjunction with other ideas, e.g., pruning (Zhang & Sabuncu, 2018), consensus (Malach & Shalev-Shwartz, 2017; Han et al., 2018), or abstention (Thulasidasan et al., 2019). We leave such exploration for future work.
|
| 240 |
+
|
| 241 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 242 |
+
|
| 243 |
+
We established that gradient clipping by itself does not suffice to endow even simple models with label noise robustness; however, a simple variant resolves this issue. Experiments confirm that our composite loss-based gradient clipping performs well on datasets corrupted with label noise. One interesting direction for future work is to analyse the behaviour of gradient-clipping inspired losses for the more general problem of distributionally robust learning (Shafieezadeh-Abadeh et al., 2015; Namkoong & Duchi, 2016; 2017; Hu et al., 2018; Sinha et al., 2018; Duchi & Namkoong, 2019).
|
| 244 |
+
|
| 245 |
+
# REFERENCES
|
| 246 |
+
|
| 247 |
+
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 SIGSAC Conference on Computer and Communications Security, CCS ’16, pp. 308–318, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4139-4.
|
| 248 |
+
|
| 249 |
+
Ehsan Amid, Manfred K. Warmuth, Rohan Anil, and Tomer Koren. Robust bi-tempered logistic loss based on Bregman divergences. CoRR, abs/1906.03361, 2019a.
|
| 250 |
+
|
| 251 |
+
Ehsan Amid, Manfred K. Warmuth, and Sriram Srinivasan. Two-temperature logistic regression based on the Tsallis divergence. In The 22nd International Conference on Artificial Intelligence and Statistics, AISTATS 2019, 16-18 April 2019, Naha, Okinawa, Japan, pp. 2388–2396, 2019b.
|
| 252 |
+
|
| 253 |
+
D. F. Andrews, P. J. Bickel, F. R. Hampel, P. J. Huber, W. H. Rogers, and J. W. Tukey. Robust Estimates of Location. Princeton University Press, Princeton NJ, 1972.
|
| 254 |
+
|
| 255 |
+
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.
|
| 256 |
+
|
| 257 |
+
Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. Trans. Neur. Netw., 5(2):157–166, March 1994. ISSN 1045-9227.
|
| 258 |
+
|
| 259 |
+
Kush Bhatia, Prateek Jain, and Purushottam Kar. Robust regression via hard thresholding. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS’15, pp. 721–729, Cambridge, MA, USA, 2015. MIT Press.
|
| 260 |
+
|
| 261 |
+
Christian Brownlees, Emilien Joly, and Gábor Lugosi. Empirical risk minimization for heavy-tailed losses. Ann. Statist., 43(6):2507–2536, 12 2015.
|
| 262 |
+
|
| 263 |
+
Andreas Buja, Werner Stuetzle, and Yi Shen. Loss functions for binary class probability estimation and classification: Structure and applications. Technical report, UPenn, 2005.
|
| 264 |
+
|
| 265 |
+
Olivier Catoni. Challenging the empirical mean and empirical variance: A deviation study. Ann. Inst. H. Poincaré Probab. Statist., 48(4):1148–1185, 11 2012.
|
| 266 |
+
|
| 267 |
+
Nontawat Charoenphakdee, Jongyeong Lee, and Masashi Sugiyama. On symmetric losses for learning from corrupted labels. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 961–970, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 268 |
+
|
| 269 |
+
Jesús Cid-Sueiro, Darío García-García, and Raúl Santos-Rodríguez. Consistency of losses for learning from weak labels. In Toon Calders, Floriana Esposito, Eyke Hüllermeier, and Rosa Meo (eds.), Machine Learning and Knowledge Discovery in Databases, pp. 197–210, Berlin, Heidelberg, 2014. Springer Berlin Heidelberg.
|
| 270 |
+
|
| 271 |
+
J. B. Copas. Binary regression models for contaminated data. Journal of the Royal Statistical Society. Series B (Methodological), 50(2):225–265, 1988. ISSN 00359246.
|
| 272 |
+
|
| 273 |
+
Nan Ding. Statistical machine learning in the $t$ -exponential family of distributions. PhD thesis, Purdue University, 2013.
|
| 274 |
+
|
| 275 |
+
Nan Ding and S.V.N. Vishwanathan. $t$ -logistic regression. In J. D. Lafferty, C. K. I. Williams, J. Shawe-Taylor, R. S. Zemel, and A. Culotta (eds.), Advances in Neural Information Processing Systems 23, pp. 514–522. Curran Associates, Inc., 2010.
|
| 276 |
+
|
| 277 |
+
John Duchi and Hongseok Namkoong. Variance-based regularization with convex objectives. Journal of Machine Learning Research, 20(68):1–55, 2019.
|
| 278 |
+
|
| 279 |
+
Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Proceedings of the Third Conference on Theory of Cryptography, TCC’06, pp. 265–284, Berlin, Heidelberg, 2006. Springer-Verlag. ISBN 3-540-32731-2, 978-3-540-32731- 8.
|
| 280 |
+
|
| 281 |
+
Anders Ekholm and Juni Palmgren. A model for a binary response with misclassifications. In Robert Gilchrist (ed.), GLIM 82: Proceedings of the International Conference on Generalised Linear Models, pp. 128–143, New York, NY, 1982. Springer New York. ISBN 978-1-4612-5771-4.
|
| 282 |
+
|
| 283 |
+
Jiashi Feng, Huan Xu, Shie Mannor, and Shuicheng Yan. Robust logistic regression and classification. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 253–261. Curran Associates, Inc., 2014.
|
| 284 |
+
|
| 285 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 1243–1252. JMLR.org, 2017.
|
| 286 |
+
|
| 287 |
+
Aritra Ghosh, Naresh Manwani, and P. S. Sastry. Making risk minimization tolerant to label noise. Neurocomputing, 160:93–107, July 2015.
|
| 288 |
+
|
| 289 |
+
Aritra Ghosh, Himanshu Kumar, and P. S. Sastry. Robust loss functions under label noise for deep neural networks. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, AAAI’17, pp. 1919–1925. AAAI Press, 2017.
|
| 290 |
+
|
| 291 |
+
Tilmann Gneiting and Adrian E. Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477):359–378, 2007.
|
| 292 |
+
|
| 293 |
+
I. M. Gross and John W. Tukey. The estimators of the Princeton robustness study. Technical report, series 2 38, Princeton, 1973.
|
| 294 |
+
|
| 295 |
+
F.R. Hampel, E.M. Ronchetti, P.J. Rousseeuw, and W.A. Stahel. Robust Statistics: the Approach Based on Influence Functions. Wiley New York, 1986.
|
| 296 |
+
|
| 297 |
+
Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor W. Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18, pp. 8536–8546, USA, 2018. Curran Associates Inc.
|
| 298 |
+
|
| 299 |
+
Elad Hazan, Kfir Y. Levy, and Shai Shalev-Shwartz. Beyond convexity: Stochastic quasi-convex optimization. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS’15, pp. 1594–1602, Cambridge, MA, USA, 2015. MIT Press.
|
| 300 |
+
|
| 301 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, June 2016.
|
| 302 |
+
|
| 303 |
+
Matthew Holland and Kazushi Ikeda. Better generalization with less data using robust gradient descent. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2761–2770, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 304 |
+
|
| 305 |
+
Daniel Hsu and Sivan Sabato. Loss minimization and parameter estimation with heavy tails. Journal of Machine Learning Research, 17(18):1–40, 2016.
|
| 306 |
+
|
| 307 |
+
Weihua Hu, Gang Niu, Issei Sato, and Masashi Sugiyama. Does distributionally robust supervised learning give robust classifiers? 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. 2029–2037, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
|
| 308 |
+
|
| 309 |
+
Peter J. Huber. Robust estimation of a location parameter. Ann. Math. Statist., 35(1):73–101, 03 1964.
|
| 310 |
+
|
| 311 |
+
Peter J. Huber. Robust Statistics. John Wiley & Sons, 1981.
|
| 312 |
+
|
| 313 |
+
Hung Hung, Zhi-Yu Jou, and Su-Yun Huang. Robust mislabel logistic regression without modeling mislabel probabilities. Biometrics, 74(1):145–154, 2018.
|
| 314 |
+
|
| 315 |
+
Julian Katz-Samuels, Gilles Blanchard, and Clayton Scott. Decontamination of mutual contamination models. Journal of Machine Learning Research, 20(41):1–57, 2019.
|
| 316 |
+
|
| 317 |
+
A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Master’s thesis, Department of Computer Science, University of Toronto, 2009.
|
| 318 |
+
|
| 319 |
+
Guillaume Lecué, Matthieu Lerasle, and Timothée Mathieu. Robust classification via MOM minimization. arXiv e-prints, art. arXiv:1808.03106, Aug 2018.
|
| 320 |
+
|
| 321 |
+
Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, Nov 1998.
|
| 322 |
+
|
| 323 |
+
M. Lerasle and R. I. Oliveira. Robust empirical mean Estimators. arXiv e-prints, art. arXiv:1112.3914, Dec 2011.
|
| 324 |
+
|
| 325 |
+
Kfir Y. Levy. The power of normalization: Faster evasion of saddle points. CoRR, abs/1611.04831, 2016.
|
| 326 |
+
|
| 327 |
+
Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(3):447–461, 2016.
|
| 328 |
+
|
| 329 |
+
Philip M. Long and Rocco A. Servedio. Random classification noise defeats all convex potential boosters. Machine Learning, 78(3):287–304, 2010. ISSN 0885-6125.
|
| 330 |
+
|
| 331 |
+
Gabor Lugosi and Shahar Mendelson. Risk minimization by median-of-means tournaments. arXiv e-prints, art. arXiv:1608.00757, Aug 2016.
|
| 332 |
+
|
| 333 |
+
Eran Malach and Shai Shalev-Shwartz. Decoupling "when to update" from "how to update". In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, pp. 961–971, USA, 2017. Curran Associates Inc. ISBN 978-1-5108-6096-4.
|
| 334 |
+
|
| 335 |
+
R. A. Maronna, D. Martin, and V. J. Yohai. Robust Statistics: Theory and Methods. John Wiley & Sons, New York, 2nd edition, 2019.
|
| 336 |
+
|
| 337 |
+
Hamed Masnadi-Shirazi and Nuno Vasconcelos. On the design of loss functions for classification: theory, robustness to outliers, and SavageBoost. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 1049–1056. Curran Associates, Inc., 2009.
|
| 338 |
+
|
| 339 |
+
Aditya Krishna Menon and Robert C. Williamson. A loss framework for calibrated anomaly detection. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 1487–1497. Curran Associates, Inc., 2018.
|
| 340 |
+
|
| 341 |
+
Aditya Krishna Menon, Brendan van Rooyen, Cheng Soon Ong, and Bob Williamson. Learning from corrupted binary labels via class-probability estimation. In International Conference on Machine Learning (ICML), pp. 125–134, 2015.
|
| 342 |
+
|
| 343 |
+
Aditya Krishna Menon, Brendan van Rooyen, and Nagarajan Natarajan. Learning from binary labels with instance-dependent noise. Machine Learning, 107(8-10):1561–1595, 2018.
|
| 344 |
+
|
| 345 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. In International Conference on Learning Representations, 2018.
|
| 346 |
+
|
| 347 |
+
Tomáš Mikolov. Statistical Language Models Based on Neural Networks. PhD thesis, Brno University of Technology, 2012.
|
| 348 |
+
|
| 349 |
+
Stanislav Minsker. Geometric median and robust estimation in banach spaces. Bernoulli, 21(4): 2308–2335, 11 2015.
|
| 350 |
+
|
| 351 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 02 2015.
|
| 352 |
+
|
| 353 |
+
H. Namkoong and J. Duchi. Variance regularization with convex objectives. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 354 |
+
|
| 355 |
+
Hongseok Namkoong and John C Duchi. Stochastic gradient methods for distributionally robust optimization with f-divergences. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 2208–2216. Curran Associates, Inc., 2016.
|
| 356 |
+
|
| 357 |
+
Nagarajan Natarajan, Inderjit S Dhillon, Pradeep D Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in Neural Information Processing Systems (NIPS), pp. 1196–1204, 2013.
|
| 358 |
+
|
| 359 |
+
Nagarajan Natarajan, Inderjit S. Dhillon, Pradeep Ravikumar, and Ambuj Tewari. Cost-sensitive learning with noisy labels. Journal of Machine Learning Research, 18(155):1–33, 2018.
|
| 360 |
+
|
| 361 |
+
Richard Nock and Frank Nielsen. On the efficient minimization of classification calibrated surrogates. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 1201–1208. Curran Associates, Inc., 2009.
|
| 362 |
+
|
| 363 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. Understanding the exploding gradient problem. CoRR, abs/1211.5063, 2012.
|
| 364 |
+
|
| 365 |
+
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. JMLR.org, 2013.
|
| 366 |
+
|
| 367 |
+
Giorgio Patrini, Frank Nielsen, Richard Nock, and Marcello Carioni. Loss factorization, weakly supervised learning and label noise robustness. In International Conference on Machine Learning (ICML), pp. 708–717, 2016.
|
| 368 |
+
|
| 369 |
+
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 Computer Vision and Pattern Recognition (CVPR), pp. 2233–2241, 2017.
|
| 370 |
+
|
| 371 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2227–2237, New Orleans, Louisiana, June 2018. Association for Computational Linguistics.
|
| 372 |
+
|
| 373 |
+
Venkatadheeraj Pichapati, Ananda Theertha Suresh, Felix X. Yu, Sashank J. Reddi, and Sanjiv Kumar. AdaCliP: Adaptive Clipping for Private SGD. arXiv e-prints, art. arXiv:1908.07643, Aug 2019.
|
| 374 |
+
|
| 375 |
+
Adarsh Prasad, Arun Sai Suggala, Sivaraman Balakrishnan, and Pradeep Ravikumar. Robust Estimation via Robust Gradient Estimation. arXiv e-prints, art. arXiv:1802.06485, Feb 2018.
|
| 376 |
+
|
| 377 |
+
Daryl Pregibon. Resistant fits for some commonly used logistic models with medical applications. Biometrics, 38(2):485–498, 1982. ISSN 0006341X, 15410420.
|
| 378 |
+
|
| 379 |
+
Mark D. Reid and Robert C. Williamson. Composite binary losses. Journal of Machine Learning Research, 11:2387–2422, 2010.
|
| 380 |
+
|
| 381 |
+
Saharon Rosset and Ji Zhu. Piecewise linear regularized solution paths. Ann. Statist., 35(3):1012– 1030, 07 2007.
|
| 382 |
+
|
| 383 |
+
Peter J. Rousseeuw and Annik M. Leroy. Robust Regression and Outlier Detection. John Wiley and Sons, 1987.
|
| 384 |
+
|
| 385 |
+
Leonard J. Savage. Elicitation of personal probabilities and expectations. Journal of the American Statistical Association, 66(336):783–801, 1971. ISSN 01621459.
|
| 386 |
+
|
| 387 |
+
Mark J. Schervish. A general method for comparing probability assessors. Ann. Statist., 17(4): 1856–1879, 12 1989.
|
| 388 |
+
|
| 389 |
+
Clayton Scott, Gilles Blanchard, and Gregory Handy. Classification with asymmetric label noise: consistency and maximal denoising. In Conference on Learning Theory (COLT), pp. 489–511, 2013.
|
| 390 |
+
|
| 391 |
+
Soroosh Shafieezadeh-Abadeh, Peyman Mohajerin Esfahani, and Daniel Kuhn. Distributionally robust logistic regression. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS’15, pp. 1576–1584, Cambridge, MA, USA, 2015. MIT Press.
|
| 392 |
+
|
| 393 |
+
Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 5739–5748, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 394 |
+
|
| 395 |
+
Georgy Shevlyakov, Stephan Morgenthaler, and Alexander Shurygin. Redescending m-estimators. Journal Of Statistical Planning And Inference, 138:2906–2917, 2008.
|
| 396 |
+
|
| 397 |
+
Aman Sinha, Hongseok Namkoong, and John C. Duchi. Certifying some distributional robustness with principled adversarial training. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, 2018.
|
| 398 |
+
|
| 399 |
+
Hwanjun Song, Minseok Kim, and Jae-Gil Lee. SELFIE: Refurbishing unclean samples for robust deep learning. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 5907–5915, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 400 |
+
|
| 401 |
+
T. Sypherd, M. Diaz, L. Sankar, and P. Kairouz. A tunable loss function for binary classification. In 2019 IEEE International Symposium on Information Theory (ISIT), pp. 2479–2483, July 2019.
|
| 402 |
+
|
| 403 |
+
Takashi Takenouchi and Shinto Eguchi. Robustifying AdaBoost by adding the naive error rate. Neural Computation, 16(4):767–787, 2004.
|
| 404 |
+
|
| 405 |
+
Sunil Thulasidasan, Tanmoy Bhattacharya, Jeff Bilmes, Gopinath Chennupati, and Jamal Mohd-Yusof. Combating label noise in deep learning using abstention. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 6234–6243, Long Beach, California, USA, 09–15 Jun 2019. PMLR.
|
| 406 |
+
|
| 407 |
+
J. W. Tukey. A survey of sampling from contaminated distributions. Contributions to probability and statistics, 2:448–485, 1960.
|
| 408 |
+
|
| 409 |
+
Brendan van Rooyen and Robert C. Williamson. A theory of learning with corrupted labels. Journal of Machine Learning Research, 18(228):1–50, 2018.
|
| 410 |
+
|
| 411 |
+
Brendan van Rooyen, Aditya Krishna Menon, and Robert C. Williamson. Learning with symmetric label noise: the importance of being unhinged. In Advances in Neural Information Processing Systems (NIPS), pp. 10–18, 2015.
|
| 412 |
+
|
| 413 |
+
Robert C. Williamson, Elodie Vernet, and Mark D. Reid. Composite multiclass losses. Journal of Machine Learning Research, 17(222):1–52, 2016.
|
| 414 |
+
|
| 415 |
+
Eunho Yang, Aurélie C. Lozano, and Aleksandr Aravkin. A general family of trimmed estimators for robust high-dimensional data analysis. Electron. J. Statist., 12(2):3519–3553, 2018.
|
| 416 |
+
|
| 417 |
+
Min Yang, Linli Xu, Martha White, Dale Schuurmans, and Yao liang Yu. Relaxed clipping: A global training method for robust regression and classification. In J. D. Lafferty, C. K. I. Williams, J. Shawe-Taylor, R. S. Zemel, and A. Culotta (eds.), Advances in Neural Information Processing Systems 23, pp. 2532–2540. Curran Associates, Inc., 2010.
|
| 418 |
+
|
| 419 |
+
Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jadbabaie. Analysis of gradient clipping and adaptive scaling with a relaxed smoothness condition. arXiv e-prints, art. arXiv:1905.11881, May 2019.
|
| 420 |
+
|
| 421 |
+
Tong Zhang. Statistical behavior and consistency of classification methods based on convex risk minimization. Annals of Statistics, 32(1):56–85, 2004.
|
| 422 |
+
|
| 423 |
+
Tong Zhang and David Johnson. A robust risk minimization based named entity recognition system. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003 - Volume 4, CONLL ’03, pp. 204–207, Stroudsburg, PA, USA, 2003. Association for Computational Linguistics.
|
| 424 |
+
|
| 425 |
+
Tong Zhang, Fred Damerau, and David Johnson. Text chunking based on a generalization of winnow. J. Mach. Learn. Res., 2:615–637, March 2002. ISSN 1532-4435.
|
| 426 |
+
|
| 427 |
+
Zhilu Zhang and Mert R. Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18, pp. 8792–8802, USA, 2018. Curran Associates Inc.
|
| 428 |
+
|
| 429 |
+
# A PROOFS OF RESULTS
|
| 430 |
+
|
| 431 |
+
Proof of Lemma 1. Following Equation 3,
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\nabla \ell _ { \theta } ( x , y ) = \nabla m _ { \theta } ( x , y ) \cdot \boldsymbol { \phi } ^ { \prime } ( m _ { \theta } ( x , y ) ) .
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
Similarly, for the linear loss function $\ell _ { \mathrm { l i n } } ( x , y ; \theta ) \doteq - m _ { \theta } ( x , y )$ , we have
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\nabla \ell _ { \mathrm { l i n } } ( x , y ; \theta ) = - \nabla m _ { \theta } ( x , y ) .
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
To compute the normalised gradient, we need
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\| \nabla \ell _ { \theta } ( x , y ) \| _ { 2 } = \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } \cdot | \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) | .
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
Thus,
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r l } { { \frac { \nabla \ell _ { \theta } ( x , y ) } { \| \nabla \ell _ { \theta } ( x , y ) \| _ { 2 } } = \frac { 1 } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } \cdot \nabla m _ { \theta } ( x , y ) \cdot \frac { \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) } { | \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) | } } } \\ & { = \frac { 1 } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } \cdot \nabla m _ { \theta } ( x , y ) \cdot \mathrm { s i g n } ( \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) ) } \\ & { = \frac { 1 } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } \cdot \nabla \ell _ { \mathrm { l i n } } ( x , y ; \theta ) , } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
since $\phi ^ { \prime } ( z ) < 0$ by assumption that $\phi$ is admissible, and thus decreasing. Consequently, if $N = 1$
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { r } { \bar { g } ( \theta ) = \mathrm { c l i p } _ { \tau } ( \nabla \ell _ { \theta } ( x , y ) ) = \left\{ \frac { \tau } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } \cdot \nabla \ell _ { \mathrm { l i n } } ( x , y ; \theta ) \right. \quad \mathrm { i f } | \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) | \geq \frac { \tau } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } } \\ { \left. \qquad \quad \forall \ell _ { \theta } ( x , y ) \qquad \right. \mathrm { e l s e } . } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
Assuming a linear scorer $s ( x ; \theta ) = \theta ^ { \mathrm { T } } x$ , the score gradient $\nabla s ( x ; \theta ) = x$ , which is independent of $\theta$ . The clipped gradient thus corresponds to the gradient under a “Huberised” loss function
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { r } { \bar { \ell } _ { \theta } ( x , y ) = \left\{ \frac { \tau } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } \cdot \ell _ { \mathrm { l i n } } ( x , y ; \theta ) \right. \quad \mathrm { i f } | \phi ^ { \prime } ( m _ { \theta } ( x , y ) ) | \geq \frac { \tau } { \| \nabla m _ { \theta } ( x , y ) \| _ { 2 } } } \\ { \ell _ { \theta } ( x , y ) \qquad \mathrm { e l s e } . \qquad } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
Proof of Lemma 2. Since $\phi$ is strictly convex and decreasing, it must be strictly decreasing. We have
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\begin{array} { r l } & { \mathrm { c l } \mathrm { i } \mathrm { p } _ { \tau } \left( \phi ^ { \prime } ( z ) \right) = \Bigg \{ \tau \cdot \frac { \phi ^ { \prime } ( z ) } { | \phi ^ { \prime } ( z ) | } \quad \mathrm { i f } | \phi ^ { \prime } ( z ) | \geq \tau } \\ & { \qquad \phi | \mathrm { s e } } \\ & { \qquad = \left\{ \tau \cdot \mathrm { s i g n } ( \phi ^ { \prime } ( z ) ) \quad \mathrm { i f } | \phi ^ { \prime } ( z ) | \geq \tau \right. } \\ & { \qquad \left. \phi ^ { \prime } ( z ) \qquad \mathrm { e l s e } \right. } \\ & { \qquad = \left\{ \begin{array} { l l } { - \tau } & { \mathrm { i f } \ \phi ^ { \prime } ( z ) \leq - \tau } \\ { \phi ^ { \prime } ( z ) } & { \mathrm { e l s e } } \end{array} \right. } \\ & { \qquad = \left\{ \begin{array} { l l } { - \tau } & { \mathrm { i f } \ z \leq ( \phi ^ { \prime } ) ^ { - 1 } ( - \tau ) } \\ { \phi ^ { \prime } ( z ) } & { \mathrm { e l s e } , } \end{array} \right. } \end{array}
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
where $( \phi ^ { \prime } ) ^ { - 1 }$ exists since $\phi ^ { \prime }$ is strictly inceasing by definition of strict convexity.
|
| 474 |
+
|
| 475 |
+
Now, by definition, the Huberised loss is
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\bar { \phi } _ { \tau } ( z ) = \left\{ \begin{array} { l l } { - \tau \cdot z - \phi ^ { * } ( - \tau ) } & { \mathrm { ~ i f ~ } \phi ^ { \prime } ( z ) \leq - \tau } \\ { \phi ( z ) } & { \mathrm { ~ e l s e , } } \end{array} \right.
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
and so
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\bar { \phi } _ { \tau } ^ { \prime } ( z ) = \left\{ \begin{array} { l l } { { - \tau } } & { { \mathrm { i f } \phi ^ { \prime } ( z ) \leq - \tau } } \\ { { \phi ^ { \prime } ( z ) } } & { { \mathrm { e l s e } , } } \end{array} \right.
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
which exactly equals $\mathsf { c l i p } _ { \tau } \left( \phi ^ { \prime } ( z ) \right)$ . We remark here that $\bar { \phi } _ { \tau }$ is continuous, since for any convex conjugate,
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\phi ^ { \ast } ( - u ) = - u \cdot ( \phi ^ { \prime } ) ^ { - 1 } ( - u ) - \phi ( ( \phi ^ { \prime } ) ^ { - 1 } ( - u ) ) .
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
Plugging in $u = \tau$ , at the intersection point $z _ { 0 } \doteq ( \phi ) ^ { \prime - 1 } ( - \tau )$ of the two pieces of the function,
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\bar { \phi } _ { \tau } ( z _ { 0 } ) = - \tau \cdot ( \phi ^ { \prime } ) ^ { - 1 } ( - \tau ) - \phi ^ { * } ( - \tau ) = \phi ( ( \phi ^ { \prime } ) ^ { - 1 } ( - \tau ) ) = \phi ( z _ { 0 } ) .
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
Proof of Lemma 3. For admissible $\phi$ , the Huberised loss $\bar { \phi } _ { \tau }$ of (8) is trivially convex, differentiable everywhere, and decreasing. In particular, we must have $\bar { \phi } _ { \tau } ^ { \prime } ( 0 ) < 0$ , and so $\dot { \phi } _ { \tau }$ must be classification calibrated by Bartlett et al. (2006, Theorem 2). As an illustration, Figure 3 shows the minimiser of the conditional risk,
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
z ^ { * } ( \eta ) \doteq \underset { z \in \mathbb { R } } { \mathrm { a r g m i n } } \left[ \eta \cdot \tilde { \phi } _ { \tau } ( z ) + ( 1 - \eta ) \cdot \tilde { \phi } _ { \tau } ( - z ) \right] .
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
Note that this quantity must be non-negative if and only if $\eta > ^ { 1 / 2 }$ for a loss to be classification calibrated. This is easily verified to be true for the Huberised logistic loss, regardless of $\tau$ .
|
| 506 |
+
|
| 507 |
+

|
| 508 |
+
Figure 3: Risk minimiser for the Huberised logistic loss.
|
| 509 |
+
|
| 510 |
+
Now suppose that $\phi$ is a proper composite loss. To show that $\bar { \phi } _ { \tau }$ is proper composite, it suffices by Williamson et al. (2016, Corollary 12) to show that $\displaystyle \frac { \bar { \phi } _ { \tau } ^ { \prime } ( z ) } { \bar { \phi } _ { \tau } ^ { \prime } ( - z ) }$ is strictly monotone and continuous. Continuity is immediate; for monotonicity, observe that by definition,
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\bar { \phi } _ { \tau } ^ { \prime } ( z ) = \left\{ { \begin{array} { l l } { - \tau } & { \mathrm { ~ i f ~ } z \leq ( \phi ^ { \prime } ) ^ { - 1 } ( - \tau ) } \\ { \phi ^ { \prime } ( z ) } & { \mathrm { ~ e l s e . } } \end{array} } \right.
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
For brevity, let $z _ { 0 } \doteq ( \phi ^ { \prime } ) ^ { - 1 } ( - \tau )$ , where we take $z _ { 0 } = - \infty$ if $- \tau \not \in \mathrm { r a n } ( \phi ^ { \prime } )$ . Then,
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\bar { \phi } _ { \tau } ^ { \prime } ( z ) = \left\{ \begin{array} { l l } { { \phi ^ { \prime } ( z _ { 0 } ) } } & { { \mathrm { ~ i f ~ } z \leq z _ { 0 } \hfill } } \\ { { \phi ^ { \prime } ( z ) } } & { { \mathrm { ~ e l s e . ~ } } } \end{array} \right.
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
\bar { \phi } _ { \tau } ^ { \prime } ( - z ) = \left\{ \begin{array} { l l } { { \phi ^ { \prime } ( z _ { 0 } ) } } & { { \mathrm { ~ i f ~ } z \geq - z _ { 0 } \hfill } } \\ { { \phi ^ { \prime } ( - z ) } } & { { \mathrm { ~ e l s e . ~ } } } \end{array} \right.
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
Thus, the quantity of interest is
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\frac { \bar { \phi } _ { \tau } ^ { \prime } ( z ) } { \bar { \phi } _ { \tau } ^ { \prime } ( - z ) } = \left\{ \begin{array} { l l } { \frac { \phi ^ { \prime } ( z _ { 0 } ) } { \phi ^ { \prime } ( - z ) } } & { \mathrm { ~ i f ~ } z \leq z _ { 0 } } \\ { \frac { \phi ^ { \prime } ( z ) } { \phi ^ { \prime } ( - z ) } } & { \mathrm { ~ i f ~ } z _ { 0 } \leq z \leq - z _ { 0 } } \\ { 1 } & { \mathrm { ~ i f ~ } - z _ { 0 } \leq z \leq z _ { 0 } } \\ { \frac { \phi ^ { \prime } ( z ) } { \phi ^ { \prime } ( z _ { 0 } ) } } & { \mathrm { ~ i f ~ } z \geq - z _ { 0 } . } \end{array} \right.
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
Since $\phi$ is strictly convex, $\phi ^ { \prime }$ is strictly decreasing and thus invertible. Thus, the ratio $\displaystyle \frac { \bar { \phi } _ { \tau } ^ { \prime } ( z ) } { \bar { \phi } _ { \tau } ^ { \prime } ( - z ) }$ is invertible, provided $z _ { \mathrm { 0 } } ~ \le ~ 0$ , i.e., $\tau \geq - \phi ^ { \prime } ( 0 )$ . Consequently, $\bar { \phi } _ { \tau }$ is proper composite when $\tau \geq - \phi ^ { \prime } ( 0 )$ . To intuit the need for the restriction on $\tau$ , observe that by (Reid $\&$ Williamson, 2010, Corollary 12) the tentative link function for the loss is
|
| 533 |
+
|
| 534 |
+
$$
|
| 535 |
+
\begin{array} { r l } & { \bar { F } ( z ) \doteq \cfrac { 1 } { 1 - \frac { \bar { \phi } ^ { \prime } ( z ) } { \bar { \phi } ^ { \prime } ( { \bf { \bar { \phi } } } z ) } } } \\ & { \quad = \left\{ \begin{array} { l l } { \frac { \phi ^ { \prime } ( - z ) } { \bar { F } ^ { \prime } ( z _ { 0 } ) + \phi ^ { \prime } ( - z ) } } & { \mathrm { ~ i f ~ } z \le z _ { 0 } } \\ { \frac { 1 } { 2 } } & { \mathrm { ~ i f ~ } z _ { 0 } \le z \le { z } _ { 0 } } \\ { \frac { \phi ^ { \prime } ( z _ { 0 } ) } { \bar { \phi } ^ { \prime } ( z _ { 0 } ) + \phi ^ { \prime } ( z ) } } & { \mathrm { ~ i f ~ } z \ge - z _ { 0 } . } \end{array} \right. } \end{array}
|
| 536 |
+
$$
|
| 537 |
+
|
| 538 |
+
When $\tau < - \phi ^ { \prime } ( 0 )$ , the above is seen to be non-invertible. See also Appendix C for an illustration of this link function for the logistic loss. □
|
| 539 |
+
|
| 540 |
+
Proof of Proposition 4. In order to apply Long & Servedio (2010, Theorem 2), we simply need to check that the loss $\bar { \phi } _ { \tau }$ is a convex potential in the sense of Long & Servedio (2010, Definition 1). This requires that $\bar { \phi } _ { \tau }$ is convex, non-increasing, continuously differentiable, and asymptotes to zero (or equally, is bounded from below). Each of these is satisfied by assumption of $\phi$ being admissible.
|
| 541 |
+
|
| 542 |
+
Proof of Lemma 5. By Lemma 2, we may write $\mathsf { c l i p } _ { \tau } \left( \varphi ^ { \prime } ( u ) \right)$ as the derivative of a partially Huberised base loss $\tilde { \varphi } _ { \tau }$ given by
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\tilde { \varphi } _ { \tau } ( u ) \doteq \left\{ \begin{array} { l l } { - \tau \cdot u - \varphi ^ { * } ( - \tau ) } & { { \mathrm { ~ i f ~ } } \varphi ^ { \prime } ( u ) \leq - \tau } \\ { \varphi ( u ) } & { { \mathrm { ~ e l s e } } } \end{array} \right.
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
This induces a composite margin loss $\tilde { \phi } _ { \tau } \doteq \tilde { \varphi } _ { \tau } \circ F$ . Now let $p _ { \theta } ( x , y ) = F ( m _ { \theta } ( x , y ) )$ , and define $\tilde { \ell } _ { \tau } ( x , y ; \theta ) \doteq \tilde { \phi } _ { \tau } ( m _ { \theta } ( x , y ) )$ . The gradient under this loss is
|
| 549 |
+
|
| 550 |
+
$$
|
| 551 |
+
\begin{array} { r l } & { \nabla _ { \theta } \tilde { \ell } _ { \tau } ( x , y ; \theta ) = \nabla _ { \theta } \tilde { \phi } _ { \tau } ( m _ { \theta } ( x , y ) ) } \\ & { \qquad = \nabla _ { \theta } \tilde { \varphi } _ { \tau } ( p _ { \theta } ( x , y ) ) } \\ & { \qquad = \nabla _ { \theta } p _ { \theta } ( x , y ) \cdot \tilde { \varphi } _ { \tau } ^ { \prime } ( p _ { \theta } ( x , y ) ) } \\ & { \qquad = \nabla _ { \theta } p _ { \theta } ( x , y ) \cdot \mathrm { c l i p } _ { \tau } \left( \varphi ^ { \prime } ( p _ { \theta } ( x , y ) ) \right) } \\ & { \qquad = \mathrm { c 1 - c 1 i p } _ { \tau } ( \nabla \ell _ { \theta } ( x , y ) ) . } \end{array}
|
| 552 |
+
$$
|
| 553 |
+
|
| 554 |
+
Thus, CL-gradient clipping is equivalent to using the loss ${ \tilde { \ell } } _ { \tau }$ .
|
| 555 |
+
|
| 556 |
+
Proof of Lemma $\cdot$ . We proceed in a similar manner to Lemma 3: to show that the loss is proper, we must establish that $\displaystyle \frac { \tilde { \phi } _ { \tau } ^ { \prime } ( z ) } { \tilde { \phi } _ { \tau } ^ { \prime } ( - z ) }$ is invertible. By Reid & Williamson (2010, Corollary 14), for the margin loss $\phi$ to be proper composite with link $F$ , it must be true that $F$ satisfies the symmetry condition $F ( - z ) = 1 - F ( z )$ . We thus have
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
\begin{array} { r l } & { \quad \tilde { \phi } _ { \tau } ^ { \prime } ( z ) = F ^ { \prime } ( z ) \cdot \tilde { \varphi } _ { \tau } ^ { \prime } ( F ( z ) ) } \\ & { \quad \tilde { \phi } _ { \tau } ^ { \prime } ( - z ) = F ^ { \prime } ( - z ) \cdot \tilde { \varphi } _ { \tau } ^ { \prime } ( F ( - z ) ) } \\ & { \quad \quad \quad = - F ^ { \prime } ( z ) \cdot \varphi ^ { \prime } ( 1 - F ( z ) ) . } \end{array}
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
Consequently,
|
| 563 |
+
|
| 564 |
+
$$
|
| 565 |
+
\frac { \tilde { \phi } _ { \tau } ^ { \prime } ( z ) } { \tilde { \phi } _ { \tau } ^ { \prime } ( - z ) } = - \frac { \tilde { \varphi } _ { \tau } ^ { \prime } ( F ( z ) ) } { \tilde { \varphi } _ { \tau } ^ { \prime } ( 1 - F ( z ) ) } .
|
| 566 |
+
$$
|
| 567 |
+
|
| 568 |
+
Since $F$ is invertible by assumption, the above is invertible if and only if $\frac { \tilde { \varphi } _ { \tau } ^ { \prime } ( u ) } { \tilde { \varphi } _ { \tau } ^ { \prime } ( 1 - u ) }$ is invertible. Observe that
|
| 569 |
+
|
| 570 |
+
$$
|
| 571 |
+
\tilde { \varphi } _ { \tau } ^ { \prime } ( u ) = \left\{ { \begin{array} { l l } { - \tau } & { \mathrm { ~ i f ~ } u \leq ( \varphi ^ { \prime } ) ^ { - 1 } ( - \tau ) } \\ { \varphi ^ { \prime } ( u ) } & { \mathrm { ~ e l s e . ~ } } \end{array} } \right.
|
| 572 |
+
$$
|
| 573 |
+
|
| 574 |
+
Let $u _ { 0 } \doteq ( \varphi ^ { \prime } ) ^ { - 1 } ( - \tau )$ for brevity. Then,
|
| 575 |
+
|
| 576 |
+
$$
|
| 577 |
+
\frac { \tilde { \varphi } _ { \tau } ^ { \prime } ( u ) } { \tilde { \varphi } _ { \tau } ^ { \prime } ( 1 - u ) } = \left\{ \begin{array} { l l } { - \frac { \tau } { \varphi ^ { \prime } ( 1 - u ) } } & { \mathrm { ~ i f ~ } u \leq u _ { 0 } \wedge ( 1 - u _ { 0 } ) } \\ { \frac { \varphi ^ { \prime } ( u ) } { \varphi ^ { \prime } ( 1 - u ) } } & { \mathrm { ~ i f ~ } u _ { 0 } \leq u \leq 1 - u _ { 0 } } \\ { 1 } & { \mathrm { ~ i f ~ } 1 - u _ { 0 } \leq u \leq u _ { 0 } } \\ { - \frac { \varphi ^ { \prime } ( u ) } { \tau } } & { \mathrm { ~ i f ~ } u \geq u _ { 0 } \vee ( 1 - u _ { 0 } ) } \end{array} \right.
|
| 578 |
+
$$
|
| 579 |
+
|
| 580 |
+
This quantity is invertible provided $u _ { 0 } \leq \frac { 1 } { 2 }$ , i.e., $\tau \geq - \varphi ^ { \prime } ( 1 / 2 )$ . A subtlety, however, is that the above does not necessarily span the entire range of $[ 0 , + \infty ]$ ; consequently, $\tilde { \varphi } _ { \tau }$ itself is proper composite, with a link function of its own.
|
| 581 |
+
|
| 582 |
+
Even when $\tau$ is small, one may verify that the loss $\tilde { \phi } _ { \tau }$ is nonetheless classification calibrated: this is because for any $\eta \in [ 0 , 1 ]$ , the minimiser $z ^ { * } ( \eta )$ of the conditional risk
|
| 583 |
+
|
| 584 |
+
must satisfy the stationarity condition
|
| 585 |
+
|
| 586 |
+
$$
|
| 587 |
+
- \frac { \tilde { \phi } _ { \tau } ^ { \prime } ( z ^ { * } ) } { \tilde { \phi } _ { \tau } ^ { \prime } ( - z ^ { * } ) } = \frac { \eta } { 1 - \eta } .
|
| 588 |
+
$$
|
| 589 |
+
|
| 590 |
+
We thus need to find a suitable $z ^ { * }$ such that the left hand side equates to a given constant. Now, for any $C \neq 1$ there is a unique $u$ such that $\begin{array} { r } { \frac { \tilde { \varphi } _ { \tau } ^ { \prime } ( u ) } { \tilde { \varphi } _ { \tau } ^ { \prime } ( 1 - u ) } = C } \end{array}$ . Thus, provided $\eta \neq \frac { 1 } { 2 }$ , there is a unique $z ^ { * } = F ^ { - 1 } ( u ^ { * } )$ such that $\begin{array} { r } { \frac { \tilde { \phi } _ { \tau } ^ { \prime } ( F ( z ^ { * } ) ) } { \tilde { \phi } _ { \tau } ^ { \prime } ( 1 - F ( z ^ { * } ) ) } = C } \end{array}$ . One may verify that this $z ^ { * } > 0 \iff \eta > { \frac { 1 } { 2 } }$ ; for example, see Figure 4, which visualises the risk minimiser for various values of $\tau$ . Thus, the sign of the minimising score conveys whether or not the positive class-probability is dominant; thus, the loss is classification calibrated.
|
| 591 |
+
|
| 592 |
+

|
| 593 |
+
Figure 4: Risk minimiser for the partially Huberised logistic loss.
|
| 594 |
+
|
| 595 |
+
Proof of Proposition 7. Let $R _ { \tau } ( f )$ denote the risk on the clean distribution of a predictor $f$ with respect to the partially Huberised loss $\tilde { \varphi } _ { \tau }$ with parameter $\tau$ . Similarly, let $\bar { R } _ { \tau } ( f )$ denote the risk on the noisy distribution. Following Ghosh et al. (2015); van Rooyen et al. (2015), we have
|
| 596 |
+
|
| 597 |
+
$$
|
| 598 |
+
\bar { R } _ { \tau } ( f ) = ( 1 - 2 \cdot \rho ) \cdot R _ { \tau } ( f ) + \alpha \cdot \mathbb { E } \left[ \tilde { \varphi } _ { \tau } ( f ( x ) ) + \tilde { \varphi } _ { \tau } ( 1 - f ( x ) ) \right] .
|
| 599 |
+
$$
|
| 600 |
+
|
| 601 |
+
That is, the risk on the noisy distribution equals a scaled version of the risk on the clean distribution, plus an additional term. This term is a constant independent of $f$ if and only if $\tilde { \varphi } _ { \tau }$ satisfies the symmetry condition of Ghosh et al. (2015) , namely, $\tilde { \varphi } _ { \tau } ( u ) + \tilde { \varphi } _ { \tau } ( 1 - u ) = C$ for some constant $C$ .
|
| 602 |
+
|
| 603 |
+
Even when the symmetry condition does not hold, one may nonetheless aim to bound this additional term as follows. For simplicity, we restrict attention here to $\varphi$ being the log or cross-entropy loss $\varphi ( u ) = - \log u$ . By definition, for any $f \in ( 0 , 1 )$ ,
|
| 604 |
+
|
| 605 |
+
$$
|
| 606 |
+
\begin{array} { r l } { \tilde { \varphi } _ { \tau } ( f ) + \tilde { \varphi } _ { \tau } ( 1 - f ) = } & { \left\{ \begin{array} { l l } { - \tau \cdot f + \log \tau + 1 - \log ( 1 - f ) } & { \mathrm { ~ i f ~ } p \leq \frac { 1 } { \tau } \wedge \big ( 1 - \frac { 1 } { \tau } \big ) } \\ { - \tau \cdot f - \tau \cdot ( 1 - f ) + 2 \cdot \log \tau + 2 } & { \mathrm { ~ i f ~ } 1 - \frac { 1 } { \tau } \leq p \leq \frac { 1 } { \tau } } \\ { - \log f - \log ( 1 - f ) } & { \mathrm { ~ i f ~ } \frac { 1 } { \tau } \leq p \leq \big ( 1 - \frac { 1 } { \tau } \big ) } \\ { - \log f - \tau \cdot ( 1 - f ) + \log \tau + 1 } & { \mathrm { ~ i f ~ } p \geq \frac { 1 } { \tau } \vee \big ( 1 - \frac { 1 } { \tau } \big ) } \end{array} \right. } \\ & { = \left\{ \begin{array} { l l } { - \tau \cdot f + \log \tau + 1 - \log ( 1 - f ) } & { \mathrm { ~ i f ~ } p \leq \frac { 1 } { \tau } \wedge \big ( 1 - \frac { 1 } { \tau } \big ) } \\ { - \tau + 2 \cdot \log \tau + 2 } & { \mathrm { ~ i f ~ } 1 - \frac { 1 } { \tau } \leq p \leq \frac { 1 } { \tau } } \\ { - \log f - \log ( 1 - f ) } & { \mathrm { ~ i f ~ } \frac { 1 } { \tau } \leq p \leq \big ( 1 - \frac { 1 } { \tau } \big ) } \\ { - \log f - \tau \cdot ( 1 - f ) + \log \tau + 1 } & { \mathrm { ~ i f ~ } p \geq \frac { 1 } { \tau } \vee \big ( 1 - \frac { 1 } { \tau } \big ) . } \end{array} \right. } \end{array}
|
| 607 |
+
$$
|
| 608 |
+
|
| 609 |
+
Evidently, all piecewise functions involved are bounded on the respective intervals. For example,
|
| 610 |
+
|
| 611 |
+
$$
|
| 612 |
+
\begin{array} { r } { \tilde { \varphi } _ { \tau } ( f ) + \tilde { \varphi } _ { \tau } ( 1 - f ) \leq \left\{ \begin{array} { l l } { \log \tau + 1 - \log \left[ \frac { 1 } { \tau } \vee \left( 1 - \frac { 1 } { \tau } \right) \right] } & { \mathrm { ~ i f ~ } p \leq \frac { 1 } { \tau } \wedge \left( 1 - \frac { 1 } { \tau } \right) } \\ { - \tau + 2 \cdot \log \tau + 2 } & { \mathrm { ~ i f ~ } 1 - \frac { 1 } { \tau } \leq p \leq \frac { 1 } { \tau } } \\ { - 2 \cdot \log \frac { 1 } { \tau } } & { \mathrm { ~ i f ~ } \frac { 1 } { \tau } \leq p \leq \left( 1 - \frac { 1 } { \tau } \right) } \\ { - \log \left[ \frac { 1 } { \tau } \vee \left( 1 - \frac { 1 } { \tau } \right) \right] + \log \tau + 1 } & { \mathrm { ~ i f ~ } p \geq \frac { 1 } { \tau } \vee \left( 1 - \frac { 1 } { \tau } \right) . } \end{array} \right. } \end{array}
|
| 613 |
+
$$
|
| 614 |
+
|
| 615 |
+
By taking the maximum of each of the quantities on the right hand side – which are constants depending on $\tau - \mathrm { w e }$ may thus find constants $C _ { 1 } , C _ { 2 }$ such that
|
| 616 |
+
|
| 617 |
+
$$
|
| 618 |
+
\bar { R } _ { \tau } ( f ) \leq ( 1 - 2 \cdot \rho ) \cdot R _ { \tau } ( f ) + C _ { 1 }
|
| 619 |
+
$$
|
| 620 |
+
|
| 621 |
+
$$
|
| 622 |
+
\bar { R } _ { \tau } ( f ) \geq ( 1 - 2 \cdot \rho ) \cdot R _ { \tau } ( f ) + C _ { 2 } .
|
| 623 |
+
$$
|
| 624 |
+
|
| 625 |
+
Now let $f ^ { * }$ denote the minimiser of the clean risk $R _ { \tau } ( f )$ , and $\bar { f } ^ { * }$ the minimiser of the noisy risk $\bar { R } _ { \tau } ( f )$ . Then, using each of the above inequalities,
|
| 626 |
+
|
| 627 |
+
$$
|
| 628 |
+
\bar { R } _ { \tau } ( f ^ { * } ) - \bar { R } _ { \tau } ( \bar { f } ^ { * } ) \leq ( 1 - 2 \cdot \rho ) \cdot ( R _ { \tau } ( f ^ { * } ) - R _ { \tau } ( \bar { f } ^ { * } ) ) + C _ { 1 } - C _ { 2 } \leq ( C _ { 1 } - C _ { 2 } ) ,
|
| 629 |
+
$$
|
| 630 |
+
|
| 631 |
+
where the last inequality is because $R _ { \tau } ( f ^ { * } ) \leq R _ { \tau } ( \bar { f } ^ { * } )$ by definition of $f ^ { * }$ . The claim follows.
|
| 632 |
+
|
| 633 |
+
# B PROPER AND PROPER COMPOSITE LOSSES
|
| 634 |
+
|
| 635 |
+
Beyond requiring classification-calibration, it is often desirable to use classifier outputs as valid probabilities. Proper losses (Savage, 1971; Schervish, 1989; Buja et al., 2005) $\varphi \colon \{ \pm 1 \} \dot { \times } [ 0 , 1 ] \to \bar { \mathbb { R } } _ { + }$ are the core losses of such class-probability estimation tasks, for which
|
| 636 |
+
|
| 637 |
+
$$
|
| 638 |
+
\begin{array} { r } { ( \forall p \in [ 0 , 1 ] ) \underset { u \in [ 0 , 1 ] } { \operatorname { a r g m i n } } \underset { y \sim \mathrm { B e r n } ( p ) } { \mathbb { E } } \left[ \varphi ( y , u ) \right] = p . } \end{array}
|
| 639 |
+
$$
|
| 640 |
+
|
| 641 |
+
Equation 13 stipulates that when using $\varphi$ to distinguish positive and negative labels, it is optimal to predict the positive class-probability.
|
| 642 |
+
|
| 643 |
+
Typically, it is more useful to work with losses that accept real-valued scores, e.g. as output by the pre-activation of the final layer of a neural network. To this end, proper composite losses (Reid & Williamson, 2010; Nock & Nielsen, 2009) are those $\ell \colon \{ \pm 1 \} \times \mathbb { R } \to \mathbb { R } _ { + }$ are such that $\ell \circ F ^ { - 1 }$ is proper, for invertible link function $F \colon \bar { \mathbb { R } } [ 0 , 1 ]$ . Proper composite losses are inherently classificationcalibrated (Reid & Williamson, 2010, Theorem 16). Canonical examples are the logistic loss $\ell ( y , v ) =$ $\log ( 1 + e ^ { - y v } )$ with $F \colon v \mapsto \sigma ( v )$ , and exponential loss $\ell ( y , v ) = e ^ { \bar { - } y v }$ with F $: v \mapsto \sigma ( 2 \cdot v )$ . When $\ell$ is differentiable, we have (Reid & Williamson, 2010, Corollary 12)
|
| 644 |
+
|
| 645 |
+
$$
|
| 646 |
+
( \forall v \in \mathbb { R } ) F ( v ) = \left( 1 - { \frac { \ell ^ { \prime } ( + 1 , v ) } { \ell ^ { \prime } ( - 1 , v ) } } \right) ^ { - 1 } .
|
| 647 |
+
$$
|
| 648 |
+
|
| 649 |
+
Given a proper loss $\varphi$ and “symmetric” link $F$ with $F ( - v ) = 1 - F ( v )$ , the loss $\ell ( y , v ) = \varphi ( y , F ( v ) )$ defines a margin loss (Reid $\&$ Williamson, 2010, Corollary 14).
|
| 650 |
+
|
| 651 |
+
Proper composite losses may also be extended to multiclass settings in the natural way (Gneiting & Raftery, 2007; Williamson et al., 2016): one now defines a proper loss $\varphi \colon [ K ] \times \Delta _ { K } \mathbb { R } _ { + }$ , where $K$ is the number of classes and $\Delta _ { K }$ denotes the $K$ -simplex. A proper composite loss may be defined using a link $F \colon \mathbb { R } ^ { K } \to \Delta _ { K }$ , such as the softmax operator $\begin{array} { r } { F _ { k } ( { \bf v } ) = \frac { \exp ( { \bf v } _ { k } ) } { \sum _ { k ^ { \prime } } \exp ( { \bf v } _ { k ^ { \prime } } ) } } \end{array}$ . Combined with the log-loss $\varphi ( y , p ) = - \log p _ { y }$ , this yields the standard softmax cross-entropy loss.
|
| 652 |
+
|
| 653 |
+
# C ILLUSTRATION OF LOSSES
|
| 654 |
+
|
| 655 |
+
We illustrate the Huberised, partially Huberised, and generalised cross-entropy losses as their underlying tuning parameters are varied. Additionally, we illustrate the link functions that are implicit in each of the losses, which illustrates that they may be non-invertible if $\tau$ is too large.
|
| 656 |
+
|
| 657 |
+
# C.1 HUBERISED LOSS
|
| 658 |
+
|
| 659 |
+
Figure 5 illustrates the Huberised version of the logistic loss, and its derivative. Following the proof of Lemma 3, for $\tau \in ( 0 , 1 )$ and $z _ { 0 } = - \sigma ^ { - 1 } ( \tau )$ , the Huberised loss $\bar { \phi } _ { \tau }$ has an implicit link function (see Figure 6)
|
| 660 |
+
|
| 661 |
+
$$
|
| 662 |
+
\begin{array} { r } { ( \forall z \in \mathbb { R } ) \bar { F } _ { \tau } ( z ) = \left\{ \begin{array} { l l } { \frac { \sigma ( z ) } { \sigma ( z _ { 0 } ) + \sigma ( z ) } } & { \mathrm { ~ i f ~ } z \leq z _ { 0 } } \\ { \sigma ( z ) } & { \mathrm { ~ i f ~ } z _ { 0 } \leq z \leq - z _ { 0 } } \\ { \frac { 1 } { 2 } } & { \mathrm { ~ i f ~ } - z _ { 0 } \leq z \leq z _ { 0 } } \\ { \frac { \sigma ( z _ { 0 } ) } { \sigma ( z _ { 0 } ) + \sigma ( z ) } } & { \mathrm { ~ i f ~ } z \geq - z _ { 0 } . } \end{array} \right. } \end{array}
|
| 663 |
+
$$
|
| 664 |
+
|
| 665 |
+
Compared to the standard sigmoid, the Huberised link saturates more slowly as $\tau$ is decreased. Note that when $\tau \leq \frac { 1 } { 2 }$ , the link function is not invertible everywhere: this results in the loss not being proper composite per our definition.
|
| 666 |
+
|
| 667 |
+
# C.2 PARTIALLY HUBERISED LOSS
|
| 668 |
+
|
| 669 |
+
Figure 7 illustrates the partially Huberised version of the logistic loss, as well as the base log-loss. Following the proof of Lemma 6, the partially Huberised loss $\tilde { \phi } _ { \tau }$ has implicit link function
|
| 670 |
+
|
| 671 |
+
$$
|
| 672 |
+
\tilde { F } _ { \tau } ( v ) = \left\{ \begin{array} { l l } { \frac { 1 } { 1 + \tau \cdot \sigma ( - v ) } } & { \mathrm { ~ i f ~ } \sigma ( v ) \leq \frac { 1 } { \tau } \wedge \big ( 1 - \frac { 1 } { \tau } \big ) } \\ { \sigma ( v ) } & { \mathrm { ~ i f ~ } \frac { 1 } { \tau } \leq \sigma ( v ) \leq \big ( 1 - \frac { 1 } { \tau } \big ) } \\ { \frac { 1 } { 2 } } & { \mathrm { ~ i f ~ } \big ( 1 - \frac { 1 } { \tau } \big ) \leq \sigma ( v ) \leq \frac { 1 } { \tau } } \\ { \frac { \tau \cdot \sigma ( v ) } { 1 + \tau \cdot \sigma ( v ) } } & { \mathrm { ~ i f ~ } \sigma ( v ) \geq \big ( 1 - \frac { 1 } { \tau } \big ) \vee \frac { 1 } { \tau } . } \end{array} \right.
|
| 673 |
+
$$
|
| 674 |
+
|
| 675 |
+
Figure 9 illustrates the link function. The logistic loss has $\varphi ( u ) = - \log u$ , and so $\varphi ^ { \prime } ( 1 / 2 ) = - 2$ . For $\tau = 1$ , the link function will be non-invertible everywhere, which is expected since the loss here is the linear loss, which is not suitable for class-probability estimation. For $\tau \in ( 1 , 2 )$ , the link function will be invertible for $p \notin \left[ \left( 1 - \frac { 1 } { \tau } \right) , \frac { 1 } { \tau } \right]$ . Intuitively, the case $\tau \in ( 1 , 2 )$ corresponds to the linear regions of the losses on positive and negative instances crossing over. For $\tau \geq 2$ , the link function will always be invertible.
|
| 676 |
+
|
| 677 |
+
It may be observed that partial Huberisation causes the link function to saturate at values $[ 1 / ( 1 +$ $\tau ) , \tau / ( 1 + \tau ) ]$ : this does not affect classification calibration, but does imply that rescaling is necessary in order to intepret the output probabilities.
|
| 678 |
+
|
| 679 |
+
# C.3 ILLUSTRATION OF GENERALISED CROSS-ENTROPY
|
| 680 |
+
|
| 681 |
+
Figure 8 illustrates the base $\varphi _ { \alpha }$ loss, and its composition with a sigmoid link function.
|
| 682 |
+
|
| 683 |
+

|
| 684 |
+
Figure 5: Illustration of Huberised logistic loss. The effect of Huberisation is to linearise the loss beyond a certain point, or equally, to cap the derivative when its magnitude exceeds a certain threshold.
|
| 685 |
+
|
| 686 |
+

|
| 687 |
+
Figure 6: Illustration of link function for the Huberised logistic loss. The effect of Huberisation is to make the link function saturate slower. Note that when $\tau \leq \frac { 1 } { 2 }$ , the link function is not invertible everywhere.
|
| 688 |
+
|
| 689 |
+

|
| 690 |
+
Figure 7: Illustration of partial Huberisation, in terms of the underlying proper loss and its composite form.
|
| 691 |
+
|
| 692 |
+

|
| 693 |
+
Figure 8: Illustration of generalised cross-entropy loss for various choices of $\alpha \in [ 0 , 1 )$ .
|
| 694 |
+
|
| 695 |
+

|
| 696 |
+
Figure 9: Illustration of link function for partially Huberised logistic loss. The effect of partial Huberisation is to make the link function saturate slower. When $\tau < 2$ , the link function is not invertible everywhere.
|
| 697 |
+
|
| 698 |
+
# D ROBUSTNESS TO INSTANCE OUTLIERS
|
| 699 |
+
|
| 700 |
+
Following Ding (2013, Section 3.2.2), we consider robustness to an arbitrary corruption under a linear scoring model. For margin loss $\ell ( x , y ; \theta ) \doteq \phi ( y \cdot \theta ^ { \mathrm { T } } x )$ with empirical risk minimiser ${ \hat { \theta } } _ { N }$ on a sample $\{ ( x _ { n } , y _ { n } ) \} _ { n = 1 } ^ { N }$ · , suppose that the sample is corrupted with an outlier $( x ^ { \prime } , y ^ { \prime } )$ N . One would like to ensure that $\hat { \theta } _ { N }$ is not swayed by making $\| { \boldsymbol { x } } ^ { \prime } \| _ { 2 }$ arbitrarily large: that is,
|
| 701 |
+
|
| 702 |
+
$$
|
| 703 |
+
\operatorname* { l i m } _ { \| x ^ { \prime } \| _ { 2 } + \infty } \frac { 1 } { N + 1 } \sum _ { n = 1 } ^ { N } \nabla \ell ( x _ { n } , y _ { n } ; \hat { \theta } _ { N } ) + \nabla \ell ( x ^ { \prime } , y ^ { \prime } ; \hat { \theta } _ { N } ) = 0 ,
|
| 704 |
+
$$
|
| 705 |
+
|
| 706 |
+
or equivalently, $\begin{array} { r } { \operatorname* { l i m } _ { \| x ^ { \prime } \| _ { 2 } \to + \infty } \nabla \ell ( x ^ { \prime } , y ^ { \prime } ; \hat { \theta } _ { N } ) = 0 } \end{array}$ . Fortunately, the saturating behaviour of the partially Huberised loss affords this, as we now show.
|
| 707 |
+
|
| 708 |
+
Proposition 8. Pick any convex, differentiable, proper composite margin loss $\phi$ , whose link $F$ satisfies $\begin{array} { r } { \operatorname* { l i m } _ { z \to - \infty } z \cdot F ^ { \prime } ( z ) = 0 , } \end{array}$ . For any $\tau > 0$ , let $\tilde { \ell } _ { \tau } ( x , y ; \boldsymbol { \theta } ) \doteq \tilde { \phi } _ { \tau } ( \boldsymbol { y } \cdot \boldsymbol { \theta } ^ { \mathrm { T } } \boldsymbol { x } )$ be the $\tau$ -partially Huberised loss under a linear model. Then, for any $( x , y )$ and $\theta$ such that $\| \theta \| _ { 2 } < + \infty$ and $\bar { \theta } ^ { \mathrm { T } } x \neq \bar { 0 }$ ,
|
| 709 |
+
|
| 710 |
+
$$
|
| 711 |
+
\operatorname* { l i m } _ { \| x \| _ { 2 } \to + \infty } \| \nabla \tilde { \ell } _ { \tau } ( x , y ; \theta ) \| _ { 2 } = 0 .
|
| 712 |
+
$$
|
| 713 |
+
|
| 714 |
+
Proof of Proposition 8. By definition,
|
| 715 |
+
|
| 716 |
+
$$
|
| 717 |
+
\begin{array} { r } { \nabla \tilde { \ell } _ { \tau } ( x , y ; \boldsymbol { \theta } ) = \boldsymbol { y } \cdot \boldsymbol { x } \cdot \boldsymbol { \phi } ^ { \prime } ( \boldsymbol { y } \cdot \boldsymbol { \theta } ^ { \mathrm { T } } \boldsymbol { x } ) . } \end{array}
|
| 718 |
+
$$
|
| 719 |
+
|
| 720 |
+
Thus,
|
| 721 |
+
|
| 722 |
+
$$
|
| 723 |
+
\begin{array} { r l } & { \| \nabla \tilde { \ell } _ { \tau } ( x , y ; \theta ) \| _ { 2 } = \| x \| _ { 2 } \cdot | \phi ^ { \prime } ( y \cdot \theta ^ { \mathrm { T } } x ) | } \\ & { \qquad = ( y \cdot \theta ^ { \mathrm { T } } x ) \cdot | \phi ^ { \prime } ( y \cdot \theta ^ { \mathrm { T } } x ) | \cdot \frac { 1 } { y \cdot \| \theta \| _ { 2 } \cdot \cos \psi _ { x , \theta } } , } \end{array}
|
| 724 |
+
$$
|
| 725 |
+
|
| 726 |
+
where $\psi _ { x , \theta }$ denotes the angle between $x$ and $\theta$ . If $\theta ^ { \mathrm { T } } x \neq 0$ , then $\cos \psi _ { x , \theta } \neq 0$ , and so the third term is finite. Thus, $\begin{array} { r } { \| \nabla \tilde { \ell } _ { \tau } ( x , y ; \theta ) \| _ { 2 } \to \operatorname* { l i m } _ { z \to \pm \infty } | z | \cdot \tilde { \phi } _ { \tau } ^ { \prime } ( z ) . } \end{array}$ , depending on the sign of $y \cdot \theta ^ { \mathrm { T } } x$ . By definition of $\tilde { \phi } _ { \tau }$ , the derivative of the loss asymptotes to either $F ^ { \prime } ( v )$ , or $\phi ^ { \prime } ( v )$ . Now, $\begin{array} { r } { \operatorname* { l i m } _ { z - \infty } z \cdot F ^ { \prime } ( v ) = 0 } \end{array}$ by assumption, and $\begin{array} { r } { \operatorname* { l i m } _ { z + \infty } z \cdot \phi ^ { \prime } ( v ) = 0 } \end{array}$ since $\phi$ is convex, the claim is shown. □
|
| 727 |
+
|
| 728 |
+
# E ADDITIONAL SYNTHETIC EXPERIMENTS
|
| 729 |
+
|
| 730 |
+
We provide some more details regarding the synthetic data used in the body.
|
| 731 |
+
|
| 732 |
+
# E.1 DETAILS OF LONG & SERVEDIO (2010) DATASET
|
| 733 |
+
|
| 734 |
+
The problem considered in Long & Servedio (2010) (see Figure 10) comprises a distribution concentrated on six atoms $\{ \pm ( 1 , 0 ) , \pm ( \gamma , 5 \gamma ) , \pm ( \gamma , - \gamma ) \} \subset \mathbb { R } ^ { 2 }$ for some $\gamma > 0$ ; we chose $\begin{array} { r } { \gamma = \frac { 1 } { 2 4 } } \end{array}$ . An instance $( x _ { 1 } , x _ { 2 } )$ is labelled as $y \ = \ [ [ x _ { 1 } \ \geq \ 0 ] ]$ . The instances are weighted so that the first four atoms have probability mass $\frac { 1 } { 8 }$ J K, and the last two atoms mass $\textstyle { \frac { 1 } { 4 } }$ . We modify this distribution slightly by treating the atoms as means of isotropic Gaussians, and treating the marginal distribution over instances to be a mixture of these Gaussians with mixing weights given by the corresponding probability masses of the atoms.
|
| 735 |
+
|
| 736 |
+
# E.2 DETAILS OF OUTLIER DATASET
|
| 737 |
+
|
| 738 |
+
For the experiment involving outliers in feature space, the data comprises points on the line. Positively labelled samples are drawn from a unit variance Gaussian centered at $( 1 , 1 )$ , with positively labeled outliers drawn from $( - 2 0 0 , 1 )$ . Negatively labelled samples comprise the negation of all points. We learn an unregularised linear classifier from this data, which corresponds to a single scalar $\theta$ .
|
| 739 |
+
|
| 740 |
+

|
| 741 |
+
Figure 10: Distribution proposed in Long & Servedio (2010), which defeats any member of a broad family of convex losses. The data comprises six points, with the blue points labelled positive, and the red points labelled negative. The two “fat” points have twice as much probability mass as their “thin” counterparts. While the dataset is trivially linearly separable, minimising a broad range of convex losses with a linear model under any non-zero amount of symmetric label noise results in a predictor that is tantamount to random guessing.
|
md/train/rkxY-sl0W/rkxY-sl0W.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TREE-TO-TREE NEURAL NETWORKS FOR PROGRAM TRANSLATION
|
| 2 |
+
|
| 3 |
+
Xinyun Chen Chang Liu Dawn Song University of California, Berkeley
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Program translation is an important tool to migrate legacy code in one language into an ecosystem built in a different language. In this work, we are the first to consider employing deep neural networks toward tackling this problem. We observe that program translation is a modular procedure, in which a sub-tree of the source tree is translated into the corresponding target sub-tree at each step. To capture this intuition, we design a tree-to-tree neural network as an encoderdecoder architecture to translate a source tree into a target one. Meanwhile, we develop an attention mechanism for the tree-to-tree model, so that when the decoder expands one non-terminal in the target tree, the attention mechanism locates the corresponding sub-tree in the source tree to guide the expansion of the decoder. We evaluate the program translation capability of our tree-to-tree model against several state-of-the-art approaches. Compared against other neural translation models, we observe that our approach is consistently better than the baselines with a margin of up to 15 points. Further, our approach can improve the previous state-of-the-art program translation approaches by a margin of 20 points on the translation of real-world projects.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Programs are the main tool for building computer applications, the IT industry, and the digital world. Various programming languages have been invented to facilitate programmers to develop programs for different applications. At the same time, the variety of different programming languages also introduces a burden when programmers want to combine programs written in different languages together. Therefore, there is a tremendous need to enable program translation between different programming languages.
|
| 12 |
+
|
| 13 |
+
Nowadays, to translate programs between different programming languages, typically programmers would manually investigate the correspondence between the grammars of the two languages, then develop a rule-based translator. However, this process can be inefficient and error-prone. In this work, we make the first attempt to examine whether we can leverage deep neural networks to build a program translator automatically.
|
| 14 |
+
|
| 15 |
+
Intuitively, the program translation problem in its format is similar to a natural language translation problem. Some previous work propose to adapt phrase-based statistical machine translation approaches (SMT) for code migration (Nguyen et al., 2013; Karaivanov et al., 2014; Nguyen et al., 2015). Recently, neural network approaches, such as sequence-to-sequence-based models (Bahdanau et al., 2015; Cho et al., 2015; Eriguchi et al., 2016; He et al., 2016; Vaswani et al., 2017), have achieved the state-of-the-art performance on machine translation. In this work, we study neural machine translation methods to handle the program translation problem. However, a big challenge making a sequence-to-sequence-based model ineffective is that, unlike natural languages, programming languages have rigorous grammars and are not tolerant to typos and grammatical mistakes. It has been demonstrated that it is very hard for an RNN-based sequence generator to generate syntactically correct programs when the lengths grow large (Karpathy et al., 2015).
|
| 16 |
+
|
| 17 |
+
In this work, we observe that the main issue of an RNN that makes it hard to produce syntactically correct programs is that it entangles two sub-tasks together: (1) learning the grammar; and (2) aligning the sequence with the grammar. When these two tasks can be handled separately, the performance can typically boost. For example, Dong & Lapata (2016) employs a tree-based decoder to separate the two tasks. In particular, the decoder in (Dong & Lapata, 2016) leverages the tree structural information to (1) generate the nodes at the same depth of the parse tree using an LSTM decoder; and (2) expand a non-terminal and generate its children in the parse tree. Such an approach has been demonstrated to achieve the state-of-the-art results on several semantic parsing tasks.
|
| 18 |
+
|
| 19 |
+
Inspired by this observation, we hypothesize that the structural information in both input and output parse trees can be leveraged to enable such a separation. Inspired by this intuition, we propose tree-to-tree neural networks to combine both a tree encoder and a tree decoder. In particular, we observe that in the program translation problem, both input and output programs have their parse trees. In addition, a cross-language compiler typically follows a modular procedure to translate the individual sub-components in the source tree into their corresponding target ones, and then compose them to form the final target tree. Therefore, we design the workflow of a tree-to-tree neural network to align with this procedure: when the decoder expands a non-terminal, it locates the corresponding sub-tree in the source tree using an attention mechanism, and uses the information of the sub-tree to guide the non-terminal expansion. In particular, a tree encoder is helpful in this scenario, since it can aggregate all information of a sub-tree to the embedding of its root, so that the embedding can be used to guide the non-terminal expansion of the target tree.
|
| 20 |
+
|
| 21 |
+
We follow the above intuition to design the tree-to-tree translation model. Existing works (Socher et al., 2011b; Kusner et al., 2017) have proposed tree-based autoencoder architectures. However, in these models, the decoder can only access to a single hidden vector representing the source tree, thus they are not performant in the translation task. In contrast, we employ an attention mechanism for the decoder to access the source tree, so that our approach can significantly improve the translation performance (i.e., from $0 \%$ to $> 9 0 \%$ ). To the best of our knowledge, this is the first tree-to-tree neural network architecture proposed for translation tasks in the literature.
|
| 22 |
+
|
| 23 |
+
To test our hypothesis, we develop two novel program translation tasks, and employ a Java to C# benchmark used by existing program translation works (Nguyen et al., 2015; 2013). First, we compare our approach against several neural network approaches on our proposed two tasks. Experimental results demonstrate that our tree-to-tree model outperforms other state-of-the-art neural networks on the program translation tasks, and yields a margin of up to $5 \%$ on the token accuracy and up to $1 5 \%$ on the program accuracy. Further, we compare our approach with previous program translation approaches on the Java to $\mathbf { C } \#$ benchmark, and the results show that our tree-to-tree model outperforms previous state-of-the-art by a large margin of $2 0 \%$ on program accuracy. These results demonstrate that our tree-to-tree model is promising toward tackling the program translation problem. Meanwhile, we believe that our proposed tree-to-tree neural network could also be adapted to other tree-to-tree tasks, and we consider it as future work.
|
| 24 |
+
|
| 25 |
+
# 2 PROGRAM TRANSLATION PROBLEM
|
| 26 |
+
|
| 27 |
+
In this work, we consider the problem of translating a program in one language into another. One approach is to model the problem as a machine translation problem between two languages, and thus numerous neural machine translation approaches can be applied.
|
| 28 |
+
|
| 29 |
+
For the program translation problem, however, a unique property is that each input program unambiguously corresponds to a unique parse tree. Thus, rather than modeling the input program as a sequence of tokens, we can consider the problem as translating a source tree into a target tree. Note that most modern programming languages are accompanied with a well-developed parser, so we can assume that the parse trees of both the source and the target programs can be easily obtained.
|
| 30 |
+
|
| 31 |
+
The main challenge of the problem in our consideration is that the cross-compiler for translating programs from one language into another typically does not exist. Therefore, even if we assume the existence of parsers for both the source and the target languages, the translation problem itself is still non-trivial. We formally define the problem as follows.
|
| 32 |
+
|
| 33 |
+
Definition 1 (Program translation). Given two programming languages $\mathcal { L } _ { s }$ and $\mathcal { L } _ { t }$ , each being a set of instances $( p _ { k } , T _ { k } )$ , where $p _ { k }$ is a program, and $T _ { k }$ is its corresponding parse tree. We assume that there exists a translation oracle $\pi$ , which maps instances in $\mathcal { L } _ { s }$ to instances in $\mathcal { L } _ { t }$ . Given a dataset of instance pairs $( i _ { s } , i _ { t } )$ such that $i _ { s } \in \mathcal { L } _ { s } , i _ { t } \in \mathcal { L } _ { t }$ and $\pi ( i _ { s } ) = i _ { t }$ , our problem is to learn a function $F$ that maps each $i _ { s } \in \mathcal { L } _ { s }$ into $i _ { t } = \pi ( i _ { s } )$ .
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Translating a CoffeeScript program into JavaScript. The sub-component in the CoffeeScript program and its corresponding translation in JavaScript are highlighted.
|
| 37 |
+
|
| 38 |
+
Note that this problem definition does not restrict on whether $F$ knows only the program $p _ { k }$ or only the parse tree $T _ { k }$ . Thus it can leverage both information to finish the translation task. Also, in the target language, since a program and its parse tree uniquely matches each other, $F$ only needs to predict one of them to be correct.
|
| 39 |
+
|
| 40 |
+
In this definition, $\mathcal { L } _ { s }$ and $\mathcal { L } _ { t }$ are the source and target languages respectively, and we use the oracle $\pi$ to model the goal of the translation. Notice that different tasks can be modeled with different choices of $\pi$ . For example, besides program translation between two languages, we can also model the compiler optimization by setting $\mathcal { L } _ { s } = \mathcal { L } _ { t }$ and choosing $\pi$ that maps an un-optimized program into an optimized one.
|
| 41 |
+
|
| 42 |
+
In this work, we focus on the problem setting that we have a set of paired source and target programs to learn the translator. Note that all existing program translation works (Karaivanov et al., 2014; Nguyen et al., 2015; 2013) also study the problem under such an assumption. When such an alignment is lacking, the program translation problem is more challenging. Several techniques for NMT have been proposed to handle this issue, such as dual learning (He et al., 2016), which have the potential to be extended for the program translation task. We leave these more challenging problem setups as future work.
|
| 43 |
+
|
| 44 |
+
# 3 TREE-TO-TREE NEURAL NETWORK
|
| 45 |
+
|
| 46 |
+
In this section, we present our design of the tree-to-tree neural network. We first motivate the design, and then present the details.
|
| 47 |
+
|
| 48 |
+
# 3.1 PROGRAM TRANSLATION AS A TREE-TO-TREE TRANSLATION PROBLEM
|
| 49 |
+
|
| 50 |
+
Figure 1 presents an example of translation from CoffeeScript to JavaScript. We observe several interesting properties of the program translation problem. First, the translation can be modular. The figure highlights a sub-component in the source tree corresponding to ${ \bf x } = 1$ and its translation in the target tree corresponding to $\mathbf { x } { = } 1 ;$ . This correspondence is independent of other parts of the program. Consider when the program grows longer and this statement may repetitively occur multiple times, it may be hard for a sequence-to-sequence model to capture the correspondence based on only token sequences without structural information.
|
| 51 |
+
|
| 52 |
+
Second, such a correspondence makes it a natural solution to locate the referenced sub-tree in the source tree when expanding a non-terminal in the target tree into a sub-tree. Inspired by this intuition, we design the tree-to-tree neural network with attention, so that when decoding a non-terminal into a (sub-)tree, the model can employ an attention mechanism to locate the referenced source sub-tree. The soft-attention mechanism makes the model differentiable, so that it can be trained end-to-end.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Tree-to-tree workflow: The arrows indicate the computation flow of the encoder-decoder architecture. Blue solid arrows indicate the flow from/to the left child, while orange dashed arrows are for the right child. The black dotted arrow from the source tree root to the target tree root indicates that the LSTM state is copied. The green box denotes the expanding node, and the grey one denotes the node to be expanded in a queue. The sub-tree of the source tree corresponding to the expanding node is highlighted in yellow. The right corner lists the formulas to predict the token for the expanding node.
|
| 56 |
+
|
| 57 |
+
Third, although the corresponding sub-trees are analogues to each other, they differ in two aspects. On the one hand, the non-terminal nodes are different. For example, the non-terminal IdentifierLiteral in CoffeeScript is called Identifier in JavaScript. Some nonterminals, such as Value, may not even have a correspondence. On the other hand, the topology structures of the corresponding sub-trees can be different. For example, the Assign node in the source tree has two children, while its correspondence in the target tree has three: an additional $=$ is inserted in the middle. These differences can pose a challenge to build a program translation model.
|
| 58 |
+
|
| 59 |
+
# 3.2 TREE-TO-TREE NEURAL NETWORK
|
| 60 |
+
|
| 61 |
+
A tree-to-tree neural network follows an encoder-decoder framework to encode the source tree into an embedding, and decode the embedding into the target tree. To capture the intuition of the modular translation process, the decoder employs an (soft) attention mechanism to locate the corresponding source sub-tree when expanding the non-terminal. We illustrate the workflow of a tree-to-tree model in Figure 2. In the following, we present each component of the model.
|
| 62 |
+
|
| 63 |
+
Converting a tree into a binary one. Note that the input and output trees may contain multiple branches. Although we can design tree-encoders and tree-decoders to handle trees with arbitrary number of branches, we observe that encoder and decoder for binary trees can be more effective. Thus, the first step is to convert both the source tree and the target tree into a binary tree. To this end, we employ the Left-Child Right-Sibling representation for this conversion.
|
| 64 |
+
|
| 65 |
+
Binary tree encoder. The encoder employs a Tree-LSTM (Tai et al. (2015)) to compute embeddings for both the entire tree and each sub-tree. In particular, consider a node $N$ that is attached with a token $t _ { s }$ in its one-hot encoding representation, and it has two children $N _ { L }$ and $N _ { R }$ , which are its left child and right child respectively. The encoder recursively computes the embedding for $N$ from the bottom up.
|
| 66 |
+
|
| 67 |
+
Assume that the left child and the right child maintain the LSTM state $( h _ { L } , c _ { L } )$ and $\left( h _ { R } , c _ { R } \right)$ respectively. Then the LSTM state $( h , c )$ of $N$ is computed as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
( h , c ) = \mathrm { L S T M } ( ( [ h _ { L } ; h _ { R } ] , [ c _ { L } ; c _ { R } ] ) , x )
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $[ a ; b ]$ indicates the concatenation of two vectors $a$ and $b$ . Note that a node may lack one or both of its children. In this case, the encoder sets the LSTM state of the missing child to be zero.
|
| 74 |
+
|
| 75 |
+
Binary tree decoder. The decoder generates the target tree starting from a single root node. The decoder first copies the LSTM state $( h , c )$ of the root of the source tree, and attaches it to the root node of the target tree. Then the decoder maintains a queue of all nodes to be expanded, and recursively expands each of them. In each iteration, the decoder pops one node from the queue, and expands it. In the following, we call the node being expanded the expanding node.
|
| 76 |
+
|
| 77 |
+
First, the decoder will predict the token of expanding node. To this end, the decoder computes the embedding $e _ { t }$ of the expanding node $N$ , and then feeds it into a softmax regression network for prediction:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathrm { t } _ { \mathrm { t } } = \mathbf { a r g m a x \ s o f t m a x } ( W e _ { t } )
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Here, $W$ is a trainable matrix of size $V _ { t } \times d$ , where $V _ { t }$ is the vocabulary size of the outputs and $d$ is the embedding dimension. Note that $e _ { t }$ is computed using the attention mechanism, which we will explain later.
|
| 84 |
+
|
| 85 |
+
Each token $t _ { t }$ is a non-terminal, a terminal, or a special $\langle { \mathrm { E O S } } \rangle$ token. If $t _ { t } = \langle \mathrm { E O S } \rangle$ , then the decoder finishes expanding this node. Otherwise, the decoder generates one new node as the left child and another new node as the right child of the expanding one. Assume that $( h ^ { \prime } , c ^ { \prime } )$ , $( h ^ { \prime \prime } , c ^ { \prime \prime } )$ are the LSTM states of its left child and right child respectively, then they are computed as:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
( h ^ { \prime } , c ^ { \prime } ) = \mathrm { L S T M } _ { L } ( ( h , c ) , B t _ { t } )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
( h ^ { \prime \prime } , c ^ { \prime \prime } ) = \mathrm { L S T M } _ { R } ( ( h , c ) , B t _ { t } )
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
Here, $B$ is a trainable word embedding matrix of size $d \times V _ { t }$ . Note that the generation of the left child and right child use two different sets of parameters for $\mathrm { L S T M } _ { L }$ and $\mathrm { L S T M } _ { R }$ respectively. These new children are pushed into the queue of all nodes to be expanded.
|
| 96 |
+
|
| 97 |
+
The target tree generation process terminates when the queue is empty.
|
| 98 |
+
|
| 99 |
+
Attention mechanism to locate the source sub-tree. Now we consider how to compute $e _ { t }$ . One straightforward approach is to compute $e _ { t }$ as $h$ , which is the hidden state attached to the expanding node. However, in doing so, the embedding will soon forget the information about the source tree when generating deep nodes in the target tree, and thus the model yields a very poor performance.
|
| 100 |
+
|
| 101 |
+
To make better use of the information of the source tree, our tree-to-tree model employs an attention mechanism to locate the source sub-tree corresponding to the sub-tree rooted at the expanding node. Specifically, we compute the following probability:
|
| 102 |
+
|
| 103 |
+
$P ( N _ { s }$ is the source sub-tree corresponding to $N _ { t } | N _ { t } )$ where $N _ { t }$ is the expanding node. We denote this probability as $P ( N _ { s } | N _ { t } )$ , and we compute it as
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
P ( N _ { s } | N _ { t } ) \propto \exp ( h _ { s } ^ { T } W _ { 0 } h _ { t } )
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $W _ { 0 }$ is a trainable matrix of size $d \times d$ . To leverage the information from the source tree, the decoder can sample a source node $N _ { s }$ following $P ( N _ { s } | \bar { N } _ { t } )$ or simply predict the most-likely source node $N _ { s } = \mathop { \bf a r g m a x } _ { N _ { s } } P ( N _ { s } | N _ { t } )$ , and then get its hidden $h _ { s }$ as $e _ { s }$ . This embedding can then be combined with $h$ , the hidden state of the expanding node, to compute $e _ { t }$ as follows:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
e _ { t } = \mathbf { t a n h } ( W _ { 1 } [ h ; e _ { s } ] )
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $W _ { 1 }$ is a trainable matrix of size $d \times 2 d$ , and $[ h ; e _ { s } ]$ denotes the concatenation of $h$ and $e _ { s }$ .
|
| 116 |
+
|
| 117 |
+
However, this approach suffers a big issue that the entire network is no longer end-to-end differentiable unless explicit supervision is given to train $P ( N _ { s } | N _ { t } )$ . Unfortunately, this supervision is unavailable. We may rely on reinforcement learning algorithms to mitigate this issue, but doing so is expensive and may not be effective.
|
| 118 |
+
|
| 119 |
+
We solve this problem by changing the above hard-attention scheme to a soft-attention mechanism. Note that in Equation (6), we only need a continuous embedding vector $e _ { s }$ rather than the discrete choice of $N _ { s }$ . Therefore, we can approximate $e _ { s }$ as the expectation of the hidden state value across all $N _ { s }$ conditioning on $N _ { t }$ . In fact, we have
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
e _ { s } = \mathrm { E } [ h _ { N _ { s } } | N _ { t } ] = \sum _ { N _ { s } } { h _ { N _ { s } } \cdot P ( N _ { s } | N _ { t } ) }
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Note that this final formula (7) coincides with the standard attention formalism. Combining all equations from (1) to (7), the entire tree-to-tree neural network is fully differentiable and can be trained end-to-end.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: An example of the translation for the synthetic task.
|
| 129 |
+
|
| 130 |
+
Parent attention feeding. In the above approach, the attention vectors $e _ { t }$ are computed independently to each other, since once $e _ { t }$ is used for predicting the token $t _ { t }$ , $e _ { t }$ is no longer used for further predictions. However, intuitively, the attention decisions for the prediction of each node should be related to each other. For example, for a non-terminal node $N _ { t }$ in the target tree, suppose that it is related to $N _ { s }$ in the source tree, then it is very likely that the attention weights of its children should focus on the descendants of $N _ { s }$ . Therefore, when predicting the attention vector of a node, the model should leverage the attention information of its parent as well.
|
| 131 |
+
|
| 132 |
+
Following this intuition, we propose a parent attention feeding mechanism, so that the attention vector of the expanding node is taken into account when predicting the attention vectors of its children. Formally, besides the embedding of the token $t _ { t }$ , we modify the inputs to $\mathrm { L S T M } _ { L }$ and $\mathrm { L S T M } _ { R }$ of the decoder in Equations (3) and (4) as below:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { r } { ( h ^ { \prime } , c ^ { \prime } ) = \mathrm { L S T M } _ { L } ( ( h , c ) , [ B t _ { t } ; e _ { t } ] ) } \\ { ( h ^ { \prime \prime } , c ^ { \prime \prime } ) = \mathrm { L S T M } _ { R } ( ( h , c ) , [ B t _ { t } ; e _ { t } ] ) } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Notice that these formulas in their formats coincide with the input-feeding method for sequential neural networks (Luong et al., 2015), but their meanings are different. For sequential models, the input attention vector belongs to the previous token, while here it belongs to the parent node.
|
| 139 |
+
|
| 140 |
+
# 4 EVALUATION
|
| 141 |
+
|
| 142 |
+
In this section, we evaluate our tree-to-tree neural network with several baseline approaches on the program translation task. To do so, we first describe three benchmark datasets in Section 4.1 for evaluating different aspects. Then we evaluate our tree-to-tree model with several baseline approaches, including the state-of-the-art neural network approaches and program translation approaches. In the following, we start with presenting the details of the benchmark datasets and models, and then present the results.
|
| 143 |
+
|
| 144 |
+
# 4.1 DATASETS
|
| 145 |
+
|
| 146 |
+
To evaluate different approaches for the program translation problem, we employ three tasks: (1) a synthetic translation task from an imperative language to a functional language; (2) translation between CoffeeScript and JavaScript, which are both full-fledged languages; and (3) translation of real-world projects from Java to $\mathbf { C } \#$ , which has been used as a benchmark in the literature.
|
| 147 |
+
|
| 148 |
+
For the synthetic task, we design an imperative source language and a functional target language. Such a design makes the source and target languages use different programming paradigms, so that the translation can be challenging. Figure 3 illustrates an example of the translation, which demonstrates that a for-loop is translated into a recursive function. We manually implement a translator, which is used to acquire the ground truth. The formal grammars of the two languages and the implementation of the translator can be found in Appendix D.1 and Appendix E respectively .
|
| 149 |
+
|
| 150 |
+
For the CoffeeScript-JavaScript task, the programming paradigms of the two languages are identical. CoffeeScript employs a Python-style succinct syntax, while JavaScript employs a C-style verbose syntax. To control the program lengths of the training and test data, we develop a pCFG-based program generator and a subset of the core CoffeeScript grammar. We also limit the set of variables and literals to restrict the vocabulary size. We rely on the CoffeeScript compiler to generate the corresponding ground truth JavaScript programs. The grammar used to generate the programs in our experiments can be found in Appendix D.2 . In doing so, we can get a set of CoffeeScript-JavaScript pairs, and thus we can build a CoffeeScript-to-JavaScript dataset, and a JavaScript-to-CoffeeScript dataset by exchanging the source and the target.
|
| 151 |
+
|
| 152 |
+
Table 1: Statistics of the Java to C# dataset.
|
| 153 |
+
|
| 154 |
+
<table><tr><td rowspan=1 colspan=1>Project</td><td rowspan=1 colspan=1>#of matched methods</td></tr><tr><td rowspan=1 colspan=1>Lucene (luc)POI (poi)Itext (ite)JGit (jgi)JTS (jts)Antlr (ant)</td><td rowspan=1 colspan=1>5,5163,1533,0792,7802.003465</td></tr><tr><td rowspan=1 colspan=1>Total</td><td rowspan=1 colspan=1>16,996</td></tr></table>
|
| 155 |
+
|
| 156 |
+
For both of the above tasks, we randomly generate 100,000 pairs of source and target programs for training, 10,000 pairs as the development set, and 10,000 pairs for testing. More statistics of the above datasets can be found in Appendix B .
|
| 157 |
+
|
| 158 |
+
To build the Java to C# dataset, we employ the same approach as in (Nguyen et al., 2015) to crawl several open-source projects, which have both a Java and a C# implementation. Same as in (Nguyen et al., 2015), we pair the methods in Java and C# based on their file names and method names. The statistics of the dataset is summarized in Table 1. Due to the change of the versions of these projects, the concrete dataset in our evaluation may differ from (Nguyen et al., 2015). We apply ten-fold validation for matched method pairs in each project, as in (Nguyen et al., 2015).
|
| 159 |
+
|
| 160 |
+
# 4.2 METRICS
|
| 161 |
+
|
| 162 |
+
In our evaluation, we measure the following two metrics:
|
| 163 |
+
|
| 164 |
+
• Token accuracy. Given a set of source programs, we run the evaluated model to translate them into target programs, and calculate the percentage of the tokens that can match the ground truth. Program accuracy. Given a set of source programs, we run the evaluated model to translate them into target programs, and calculate the percentage of the predicted programs that can entirely match the ground truth.
|
| 165 |
+
|
| 166 |
+
Note that the program accuracy is an underestimation of the true accuracy based on semantic equivalence, and this metric has been used in (Nguyen et al., 2015). This metric is more meaningful than other previously proposed metrics, such as syntax-correctness and dependency-graph-accuracy, which are not directly comparable to semantic equivalence. In addition, token accuracy can provide more insight into the performance of different models.
|
| 167 |
+
|
| 168 |
+
# 4.3 MODEL DETAILS
|
| 169 |
+
|
| 170 |
+
We evaluate our tree-to-tree model against a sequence-to-sequence model (Bahdanau et al., 2015; Vinyals et al., 2015), a sequence-to-tree model (Dong & Lapata, 2016), and a tree-to-sequence model (Eriguchi et al., 2016). Note that for a sequence-to-sequence model, there can be four variants to handle different input-output formats. For example, given a program, we can simply tokenize it into a sequence of tokens. We call this format as raw program, denoted as P. We can also use the parser to parse the program into a parse tree, and then serialize the parse tree as a sequence of tokens. Our serialization of a tree follows its depth-first traversal order, which is the same as (Vinyals et al., 2015). We call this format as parse tree, denoted as T. For both input and output formats, we can choose either P or T. Similarly, for a sequence-to-tree model, we have two variants based on its input format being either P or T, and for a tree-to-sequence model, we have two variants based on its output format being either P or T. Note that the sequence-to-tree model generates a tree as output, and thus requires its output format to be T (unserialized). For the same reason, the tree-to-sequence model requires its input format to be T (unserialized), and our tree-to-tree only has one form. Therefore, we have 9 different models in our evaluation.
|
| 171 |
+
|
| 172 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=3>Tree2tree</td><td rowspan=1 colspan=4>Seq2seq</td><td rowspan=1 colspan=2>Seq2tree</td><td rowspan=1 colspan=2>Tree2seq</td></tr><tr><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>T→T(-PF)</td><td rowspan=1 colspan=1>T→T(-Attn)</td><td rowspan=1 colspan=1>P-→P</td><td rowspan=1 colspan=1>P→T</td><td rowspan=1 colspan=1>T→P</td><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>P→T</td><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>T→P</td><td rowspan=1 colspan=1>T→T</td></tr><tr><td rowspan=1 colspan=12>Tokenaccuracy</td></tr><tr><td rowspan=1 colspan=1>SYN-S</td><td rowspan=1 colspan=1>99.99%</td><td rowspan=1 colspan=1>99.95%</td><td rowspan=1 colspan=1>55.60%</td><td rowspan=1 colspan=1>99.75%</td><td rowspan=1 colspan=1>99.59%</td><td rowspan=1 colspan=1>99.90%</td><td rowspan=1 colspan=1>99.73%</td><td rowspan=1 colspan=1>99.70%</td><td rowspan=1 colspan=1>99.51%</td><td rowspan=1 colspan=1>99.88%</td><td rowspan=1 colspan=1>99.82%</td></tr><tr><td rowspan=1 colspan=1>SYN-L</td><td rowspan=1 colspan=1>99.60%</td><td rowspan=1 colspan=1>96.68%</td><td rowspan=1 colspan=1>34.48%</td><td rowspan=1 colspan=1>68.31%</td><td rowspan=1 colspan=1>45.28%</td><td rowspan=1 colspan=1>67.37%</td><td rowspan=1 colspan=1>35.01%</td><td rowspan=1 colspan=1>96.95%</td><td rowspan=1 colspan=1>97.41%</td><td rowspan=1 colspan=1>97.08%</td><td rowspan=1 colspan=1>95.88%</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><tr><td rowspan=1 colspan=1>SYN-S</td><td rowspan=1 colspan=1>99.76%</td><td rowspan=1 colspan=1>98.61%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>97.92%</td><td rowspan=1 colspan=1>97.35%</td><td rowspan=1 colspan=1>98.38%</td><td rowspan=1 colspan=1>98.18%</td><td rowspan=1 colspan=1>96.14%</td><td rowspan=1 colspan=1>98.01%</td><td rowspan=1 colspan=1>98.51%</td><td rowspan=1 colspan=1>98.36%</td></tr><tr><td rowspan=1 colspan=1>SYN-L</td><td rowspan=1 colspan=1>97.50%</td><td rowspan=1 colspan=1>57.42%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>12.19%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>9.19%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>67.34%</td><td rowspan=1 colspan=1>68.11%</td><td rowspan=1 colspan=1>91.35%</td><td rowspan=1 colspan=1>87.84%</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 2: Token accuracy and program accuracy of different approaches for the synthetic task.
|
| 175 |
+
Table 3: Program accuracy of different approaches for translation between CoffeeScript and JavaScript. The token accuracy can be found in Appendix C .
|
| 176 |
+
|
| 177 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=3>Tree2tree</td><td rowspan=1 colspan=4>Seq2seq</td><td rowspan=1 colspan=2>Seq2tree</td><td rowspan=1 colspan=2>Tree2seq</td></tr><tr><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>T→T(-PF)</td><td rowspan=1 colspan=1>T→T(-Attn)</td><td rowspan=1 colspan=1>P→P</td><td rowspan=1 colspan=1>P→T</td><td rowspan=1 colspan=1>T→P</td><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>P→T</td><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>T→P</td><td rowspan=1 colspan=1>T→T</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=4>CoffeeScript to JavaScript translation</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>CJ-AS</td><td rowspan=1 colspan=1>99.57%</td><td rowspan=1 colspan=1>98.80%</td><td rowspan=1 colspan=1>0.09%</td><td rowspan=1 colspan=1>90.51%</td><td rowspan=1 colspan=1>79.82%</td><td rowspan=1 colspan=1>92.73%</td><td rowspan=1 colspan=1>89.13%</td><td rowspan=1 colspan=1>86.52%</td><td rowspan=1 colspan=1>88.50%</td><td rowspan=1 colspan=1>96.96%</td><td rowspan=1 colspan=1>92.18%</td></tr><tr><td rowspan=1 colspan=1>CJ-BS</td><td rowspan=1 colspan=1>99.75%</td><td rowspan=1 colspan=1>99.67%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>97.44%</td><td rowspan=1 colspan=1>16.26%</td><td rowspan=1 colspan=1>98.05%</td><td rowspan=1 colspan=1>93.89%</td><td rowspan=1 colspan=1>91.97%</td><td rowspan=1 colspan=1>88.22%</td><td rowspan=1 colspan=1>96.83%</td><td rowspan=1 colspan=1>78.77%</td></tr><tr><td rowspan=1 colspan=1>CJ-AL</td><td rowspan=1 colspan=1>97.15%</td><td rowspan=1 colspan=1>71.52%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>21.04%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>80.82%</td><td rowspan=1 colspan=1>78.60%</td><td rowspan=1 colspan=1>82.55%</td><td rowspan=1 colspan=1>46.94%</td></tr><tr><td rowspan=1 colspan=1>CJ-BL</td><td rowspan=1 colspan=1>95.60%</td><td rowspan=1 colspan=1>78.61%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>19.26%</td><td rowspan=1 colspan=1>9.98%</td><td rowspan=1 colspan=1>25.35%</td><td rowspan=1 colspan=1>42.08%</td><td rowspan=1 colspan=1>76.12%</td><td rowspan=1 colspan=1>76.21%</td><td rowspan=1 colspan=1>83.61%</td><td rowspan=1 colspan=1>26.83%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td rowspan=1 colspan=2>ipttoCoffeeScripttr</td><td rowspan=1 colspan=1>nslation</td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>JC-AS</td><td rowspan=1 colspan=1>87.75%</td><td rowspan=1 colspan=1>85.11%</td><td rowspan=1 colspan=1>0.09%</td><td rowspan=1 colspan=1>83.07%</td><td rowspan=1 colspan=1>86.13%</td><td rowspan=1 colspan=1>73.88%</td><td rowspan=1 colspan=1>86.31%</td><td rowspan=1 colspan=1>86.86%</td><td rowspan=1 colspan=1>86.99%</td><td rowspan=1 colspan=1>71.61%</td><td rowspan=1 colspan=1>86.53%</td></tr><tr><td rowspan=1 colspan=1>JC-BS</td><td rowspan=1 colspan=1>86.37%</td><td rowspan=1 colspan=1>80.35%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>80.49%</td><td rowspan=1 colspan=1>85.94%</td><td rowspan=1 colspan=1>69.77%</td><td rowspan=1 colspan=1>85.28%</td><td rowspan=1 colspan=1>85.06%</td><td rowspan=1 colspan=1>84.25%</td><td rowspan=1 colspan=1>66.82%</td><td rowspan=1 colspan=1>85.31%</td></tr><tr><td rowspan=1 colspan=1>JC-AL</td><td rowspan=1 colspan=1>78.59%</td><td rowspan=1 colspan=1>54.93%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>77.10%</td><td rowspan=1 colspan=1>77.30%</td><td rowspan=1 colspan=1>65.52%</td><td rowspan=1 colspan=1>75.70%</td><td rowspan=1 colspan=1>77.11%</td><td rowspan=1 colspan=1>77.59%</td><td rowspan=1 colspan=1>60.75%</td><td rowspan=1 colspan=1>75.75%</td></tr><tr><td rowspan=1 colspan=1>JC-BL</td><td rowspan=1 colspan=1>75.62%</td><td rowspan=1 colspan=1>44.40%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>73.14%</td><td rowspan=1 colspan=1>73.96%</td><td rowspan=1 colspan=1>61.92%</td><td rowspan=1 colspan=1>74.51%</td><td rowspan=1 colspan=1>74.34%</td><td rowspan=1 colspan=1>71.56%</td><td rowspan=1 colspan=1>57.09%</td><td rowspan=1 colspan=1>73.86%</td></tr></table>
|
| 178 |
+
|
| 179 |
+
The hyper-parameters used in different models can be found in Appendix A . The baseline models have employed their own input-feeding or parent-feeding method that is analogous to our parent attention feeding mechanism.
|
| 180 |
+
|
| 181 |
+
# 4.4 RESULTS ON THE SYNTHETIC TASK
|
| 182 |
+
|
| 183 |
+
We create two datasets for the synthetic task: one with average length 20 (SYN-S) and the other with average length 50 (SYN-L). Here, the length of a program indicates the number of tokens in the source program.
|
| 184 |
+
|
| 185 |
+
The results are presented in Table 2. We can observe that our tree2tree model outperforms all baseline models on both datasets and with both metrics. Especially, on the dataset with longer programs, the program accuracy significantly outperforms all seq2seq models by a large margin, i.e., $> 8 5 \%$ . Its margin over a seq2tree model can also reach around 30 points. These results demonstrate that tree2tree model is more capable of learning the program translation relationship.
|
| 186 |
+
|
| 187 |
+
Notice that increasing the length of the programs indeed makes the problem harder: the program accuracy drops for all models. However, we observe that the decrease of our tree2tree model on the program accuracy is only around 2 points, which is much smaller than the decrease of other models. This shows that the tree2tree model is significantly better than other baselines at handling longer inputs.
|
| 188 |
+
|
| 189 |
+
In addition, we perform ablation study to compare the full tree2tree model with (1) tree2tree without parent attention feeding $\mathrm { T } { \to } \mathrm { T }$ (-PF)) and (2) tree2tree without attention $\mathrm { T } { } \mathrm { T }$ (-Attn)). We observe that the full tree2tree model significantly outperforms the other alternatives. In particular, on SYNL, the full tree2tree’s program accuracy is 40 points higher than the tree2tree model without parent attention feeding.
|
| 190 |
+
|
| 191 |
+
More importantly, we observe that the program accuracy of tree2tree model without the attention mechanism is always $0 \%$ . Note that such a model is similar to a tree-to-tree autoencoder architecture.
|
| 192 |
+
|
| 193 |
+
Table 4: Program accuracy on the Java to $\mathbf { C } \#$ translation. In the parentheses, we put the program accuracy that can be achieved by increasing the training set.
|
| 194 |
+
|
| 195 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>Tree2tree</td><td rowspan=1 colspan=1>J2C#</td><td rowspan=1 colspan=1>1pSMT</td><td rowspan=1 colspan=1>mppSMT</td></tr><tr><td rowspan=1 colspan=3>Reported in (Nguyen et al., 2015)</td></tr><tr><td rowspan=1 colspan=1>Lucene</td><td rowspan=1 colspan=1>72.8%</td><td rowspan=1 colspan=1>21.5%</td><td rowspan=1 colspan=1>21.6%</td><td rowspan=1 colspan=1>40.0%</td></tr><tr><td rowspan=1 colspan=1>POI</td><td rowspan=1 colspan=1>72.2%</td><td rowspan=1 colspan=1>18.9%</td><td rowspan=1 colspan=1>34.6%</td><td rowspan=1 colspan=1>48.2%</td></tr><tr><td rowspan=1 colspan=1>Itext</td><td rowspan=1 colspan=1>67.5%</td><td rowspan=1 colspan=1>25.1%</td><td rowspan=1 colspan=1>24.4%</td><td rowspan=1 colspan=1>40.6%</td></tr><tr><td rowspan=1 colspan=1>JGit</td><td rowspan=1 colspan=1>68.7%</td><td rowspan=1 colspan=1>10.7%</td><td rowspan=1 colspan=1>23.0%</td><td rowspan=1 colspan=1>48.5%</td></tr><tr><td rowspan=1 colspan=1>JTS</td><td rowspan=1 colspan=1>68.2 %</td><td rowspan=1 colspan=1>11.7%</td><td rowspan=1 colspan=1>18.5%</td><td rowspan=1 colspan=1>26.3%</td></tr><tr><td rowspan=1 colspan=1>Antlr</td><td rowspan=1 colspan=1>31.9% (58.3%)</td><td rowspan=1 colspan=1>10.0%</td><td rowspan=1 colspan=1>11.5%</td><td rowspan=1 colspan=1>49.1%</td></tr></table>
|
| 196 |
+
|
| 197 |
+
This result shows that our novel architecture can significantly outperform previous tree-to-tree-like architectures on the program translation task.
|
| 198 |
+
|
| 199 |
+
# 4.5 RESULTS ON THE COFFEESCRIPT-JAVASCRIPT TASK
|
| 200 |
+
|
| 201 |
+
We now move on to the CoffeeScript-JavaScript task. We create several datasets named as XY-ZW: $\mathrm { X }$ and $\mathrm { Y }$ (C or J) indicate the source and target language respectively; Z (A or B) indicates the vocabulary; and W (S or L) indicates the program length. In particular, vocabulary A uses only $\{ \mathbf { x } , \mathbf { y } \}$ as variable names and $\{ 0 , 1 \}$ as literals; vocabulary B uses all alphabetical characters as variable names, and all single digits as literals. S indicates that the CoffeeScript programs contain 10 tokens on average; and L for 20.
|
| 202 |
+
|
| 203 |
+
The program accuracy results are presented in Table 3, and the token accuracy results can be found in Appendix A . Most of the observations from our synthetic task remain: our tree2tree model outperforms all baseline models; all models perform worse on longer inputs; both the attention and the parent attention feeding mechanisms boost the performance of our tree2tree model significantly.
|
| 204 |
+
|
| 205 |
+
In addition, we observe that for the translation from JavaScript to CoffeeScript, the improvements of the tree2tree model over the baselines are much smaller than for CoffeeScript to JavaScript translation. We attribute this to the fact that the target programs are much shorter. For example, for a CoffeeScript program with 20 tokens, its corresponding JavaScript program may contain more than 300 tokens. Thus, the model needs to predict much less tokens for a CoffeeScript program than a JavaScript program, so that even seq2seq models can achieve a reasonably good accuracy. However, still, we can observe that our tree2tree model outperforms all baselines.
|
| 206 |
+
|
| 207 |
+
# 4.6 RESULTS ON REAL-WORLD PROJECTS
|
| 208 |
+
|
| 209 |
+
We now compare our approach with three state-of-the-art program translation approaches, i.e., J2C# (jav), 1pSMT (Nguyen et al., 2013), and mppSMT (Nguyen et al., 2015), on the real-world benchmark from Java to C#. Here, J2C# is a rule-based system, 1pSMT directly applies the phrasebased SMT on sequential programs, and mppSMT is a multi-phase phrase-based SMT approach that leverages both the raw programs and their parse trees. Our approach handles the out-of-vocabulary problem by canonicalizing all variable names, literals and string constants. For example, the first variable in a program (and its subsequent references) is renamed as $\tt v 1$ , the second as $\tt v 2$ , etc. In this way, the dataset contains only a small set of variable names.
|
| 210 |
+
|
| 211 |
+
The results are summarized in Table 4. For previous approaches, we report the results from (Nguyen et al., 2015). We can observe that our tree2tree approach can significantly outperform the previous state-of-the-art on all projects except Antlr. The improvements range from $2 0 . { \bar { 2 } } \%$ to $4 1 . 9 \%$ .
|
| 212 |
+
|
| 213 |
+
On Antlr, the tree2tree model performs worse. We attribute this to the fact that Antlr contains too few data samples for training. We test our hypothesis by constructing another training and validation set from all other 5 projects, and test the model on the entire Antlr. We observe that the model can achieve a test accuracy of $5 8 . 3 \%$ , which is 9 points higher than the state-of-the-art. Therefore, we conclude that our approach can significantly outperform previous program translation approaches when there are sufficient training data.
|
| 214 |
+
|
| 215 |
+
# 5 RELATED WORK
|
| 216 |
+
|
| 217 |
+
Statistical approaches for program translation. Some recent work have applied statistical machine translation techniques to program translation (Allamanis et al., 2017; Karaivanov et al., 2014; Nguyen et al., 2015; 2013; 2016). For example, several works propose to adapt phrase-based statistical machine translation models and leverage grammatical structures of programming languages for code migration (Karaivanov et al., 2014; Nguyen et al., 2015; 2013). Nguyen et al. (2016) proposes to use Word2Vec representation for APIs in libraries used in different programming languages, then learns a transformation matrix for API mapping. On the contrary, our work is the first to employ deep learning techniques for program translation.
|
| 218 |
+
|
| 219 |
+
Neural networks with tree structures. In recent years, various neural networks with tree structures have been proposed to employ the structured information of the data (Dong & Lapata, 2016; Rabinovich et al., 2017; Parisotto et al., 2017; Yin & Neubig, 2017; Alvarez-Melis & Jaakkola, 2017; Tai et al., 2015; Zhu et al., 2015; Socher et al., 2011a; Eriguchi et al., 2016; Zhang et al., 2016; Socher et al., 2011b; Kusner et al., 2017). In these work, different tree-structured encoders are proposed for embedding the input data, and different tree-structured decoders are proposed for predicting the output trees. In particular, in (Socher et al., 2011b; Kusner et al., 2017), they propose tree-structured autoencoders to learn vector representations of trees, and show better performance on tree reconstruction and other tasks such as sentiment analysis. In this work, we are the first to design the tree-to-tree neural network for translation tasks.
|
| 220 |
+
|
| 221 |
+
Neural networks for parsing. Other work study using neural networks to generate parse trees from input-output examples (Dong & Lapata, 2016; Vinyals et al., 2015; Aharoni & Goldberg, 2017; Rabinovich et al., 2017; Yin & Neubig, 2017; Alvarez-Melis & Jaakkola, 2017; Dyer et al., 2016; Chen et al., 2018; 2016). Dong & Lapata (2016) proposes a seq2tree model that allows the decoder RNN to generate the output tree recursively in a top-down fashion. This approach achieves the stateof-the-art results on several semantic parsing tasks. Some other work incorporate the knowledge of the grammar into the architecture design (Yin & Neubig, 2017; Rabinovich et al., 2017) to achieve better performance on specific tasks. However, these approaches are hard to generalize to other tasks. Again, none of them is designed for program translation or proposes a tree-to-tree architecture.
|
| 222 |
+
|
| 223 |
+
Neural networks for code generation. A recent line of research study using neural networks for code generation (Balog et al., 2017; Devlin et al., 2017; Parisotto et al., 2017; Ling et al., 2016; Rabinovich et al., 2017; Yin & Neubig, 2017). In (Ling et al., 2016; Rabinovich et al., 2017; Yin & Neubig, 2017), they study generating code in a DSL from inputs in natural language or in another DSL. However, their designs require additional manual efforts to adapt to new DSLs in consideration. In our work, we consider the tree-to-tree model as a generic approach that can be applied to any grammar.
|
| 224 |
+
|
| 225 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 226 |
+
|
| 227 |
+
In this work, we are the first to consider neural network approaches for the program translation problem, and are the first to propose a tree-to-tree neural network that combines both a tree-RNN encoder and a tree-RNN decoder for translation tasks. Extensive evaluation demonstrates that our tree-to-tree neural network outperforms several state-of-the-art models, including neural networks for machine translation and statistical machine translation-based program translation approaches. This renders our tree-to-tree model as a promising tool toward tackling the program translation problem. In addition, we believe that our proposed tree-to-tree neural network has potential to generalize to other tree-to-tree tasks, and we consider it as future work.
|
| 228 |
+
|
| 229 |
+
At the same time, we observe many challenges on program translation that existing techniques are not capable of handling. For example, the models are hard to generalize to programs longer than the training ones; it is unclear how to handle an infinite vocabulary set that may be employed in real-world applications; further, the training requires a dataset of aligned input-output pairs, which may be lacking in practice. We consider all these problems as important future work in the research agenda toward solving the program translation problem.
|
| 230 |
+
|
| 231 |
+
# ACKNOWLEDGEMENT
|
| 232 |
+
|
| 233 |
+
We thank anonymous reviewers for their valuable feedbacks. This material is in part based upon work supported by the National Science Foundation under Grant No. TWC-1409915, Berkeley DeepDrive, and DARPA STAC under Grant No. FA8750-15-2-0104. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
|
| 234 |
+
|
| 235 |
+
# REFERENCES
|
| 236 |
+
|
| 237 |
+
Antlr. https://github.com/antlr/.
|
| 238 |
+
|
| 239 |
+
Itext. http://sourceforge.net/projects/itext/.
|
| 240 |
+
|
| 241 |
+
Java2csharp. http://sourceforge.net/projects/j2cstranslator/.
|
| 242 |
+
|
| 243 |
+
Jgit. https://github.com/eclipse/jgit/.
|
| 244 |
+
|
| 245 |
+
Jts. http://sourceforge.net/projects/jts-topo-suite/.
|
| 246 |
+
|
| 247 |
+
Lucene. http://lucene.apache.org/.
|
| 248 |
+
|
| 249 |
+
Poi. http://poi.apache.org/.
|
| 250 |
+
|
| 251 |
+
Roee Aharoni and Yoav Goldberg. Towards string-to-tree neural machine translation. In ACL, 2017.
|
| 252 |
+
|
| 253 |
+
Miltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. arXiv preprint arXiv:1709.06182, 2017.
|
| 254 |
+
|
| 255 |
+
David Alvarez-Melis and Tommi S Jaakkola. Tree-structured decoding with doubly-recurrent neural networks. In ICLR, 2017.
|
| 256 |
+
|
| 257 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 258 |
+
|
| 259 |
+
Matej Balog, Alexander L Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tarlow. Deepcoder: Learning to write programs. In ICLR, 2017.
|
| 260 |
+
|
| 261 |
+
Xinyun Chen, Chang Liu, Eui Chul Shin, Dawn Song, and Mingcheng Chen. Latent attention for ifthen program synthesis. In Advances in Neural Information Processing Systems, pp. 4574–4582, 2016.
|
| 262 |
+
|
| 263 |
+
Xinyun Chen, Chang Liu, and Dawn Song. Towards synthesizing complex programs from inputoutput examples. In ICLR, 2018.
|
| 264 |
+
|
| 265 |
+
Sebastien Jean Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. On using very large target ´ vocabulary for neural machine translation. In ACL, 2015.
|
| 266 |
+
|
| 267 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy I/O. arXiv preprint arXiv:1703.07469, 2017.
|
| 268 |
+
|
| 269 |
+
Li Dong and Mirella Lapata. Language to logical form with neural attention. In ACL, 2016.
|
| 270 |
+
|
| 271 |
+
Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A Smith. Recurrent neural network grammars. In NAACL, 2016.
|
| 272 |
+
|
| 273 |
+
Akiko Eriguchi, Kazuma Hashimoto, and Yoshimasa Tsuruoka. Tree-to-sequence attentional neural machine translation. In ACL, 2016.
|
| 274 |
+
|
| 275 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Advances in Neural Information Processing Systems, pp. 820–828, 2016.
|
| 276 |
+
|
| 277 |
+
Svetoslav Karaivanov, Veselin Raychev, and Martin Vechev. Phrase-based statistical translation of programming languages. In Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software, pp. 173–184. ACM, 2014.
|
| 278 |
+
|
| 279 |
+
Andrej Karpathy, Justin Johnson, and Li Fei-Fei. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015.
|
| 280 |
+
|
| 281 |
+
Matt J Kusner, Brooks Paige, and Jose Miguel Hern ´ andez-Lobato. Grammar variational autoen- ´ coder. arXiv preprint arXiv:1703.01925, 2017.
|
| 282 |
+
|
| 283 |
+
Wang Ling, Edward Grefenstette, Karl Moritz Hermann, Toma´s Ko ˇ cisk ˇ y, Andrew Senior, Fumin \` Wang, and Phil Blunsom. Latent predictor networks for code generation. In ACL, 2016.
|
| 284 |
+
|
| 285 |
+
Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1412–1421, 2015.
|
| 286 |
+
|
| 287 |
+
Anh Tuan Nguyen, Tung Thanh Nguyen, and Tien N Nguyen. Lexical statistical machine translation for language migration. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pp. 651–654. ACM, 2013.
|
| 288 |
+
|
| 289 |
+
Anh Tuan Nguyen, Tung Thanh Nguyen, and Tien N Nguyen. Divide-and-conquer approach for multi-phase statistical migration for source code (t). In Automated Software Engineering (ASE), 2015 30th IEEE/ACM International Conference on, pp. 585–596. IEEE, 2015.
|
| 290 |
+
|
| 291 |
+
Trong Duc Nguyen, Anh Tuan Nguyen, and Tien N Nguyen. Mapping api elements for code migration with vector representations. In Software Engineering Companion (ICSE-C), IEEE/ACM International Conference on, pp. 756–758. IEEE, 2016.
|
| 292 |
+
|
| 293 |
+
Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. In ICLR, 2017.
|
| 294 |
+
|
| 295 |
+
Maxim Rabinovich, Mitchell Stern, and Dan Klein. Abstract syntax networks for code generation and semantic parsing. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1139–1149, 2017.
|
| 296 |
+
|
| 297 |
+
Richard Socher, Cliff C Lin, Chris Manning, and Andrew Y Ng. Parsing natural scenes and natural language with recursive neural networks. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 129–136, 2011a.
|
| 298 |
+
|
| 299 |
+
Richard Socher, Jeffrey Pennington, Eric H Huang, Andrew Y Ng, and Christopher D Manning. Semi-supervised recursive autoencoders for predicting sentiment distributions. In Proceedings of the conference on empirical methods in natural language processing, pp. 151–161. Association for Computational Linguistics, 2011b.
|
| 300 |
+
|
| 301 |
+
Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. In Proceedings of the Annual Meeting of the Association for Computational Linguistics, 2015.
|
| 302 |
+
|
| 303 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 304 |
+
|
| 305 |
+
Oriol Vinyals, Łukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In NIPS, 2015.
|
| 306 |
+
|
| 307 |
+
Pengcheng Yin and Graham Neubig. A syntactic neural model for general-purpose code generation. In ACL, 2017.
|
| 308 |
+
|
| 309 |
+
Xingxing Zhang, Liang Lu, and Mirella Lapata. Top-down tree long short-term memory networks. In Proceedings of NAACL-HLT, pp. 310–320, 2016.
|
| 310 |
+
|
| 311 |
+
Xiaodan Zhu, Parinaz Sobihani, and Hongyu Guo. Long short-term memory over recursive structures. In International Conference on Machine Learning, pp. 1604–1612, 2015.
|
| 312 |
+
|
| 313 |
+
Table 5: Hyper-parameters chosen for each neural network model.
|
| 314 |
+
|
| 315 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Seq2seq</td><td rowspan=1 colspan=1>Seq2tree</td><td rowspan=1 colspan=1>Tree2seq</td><td rowspan=1 colspan=1>Tree2tree</td></tr><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Number of RNN layers</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>EncoderRNNcell</td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>Tree LSTM</td><td rowspan=1 colspan=1>TreeLSTM</td></tr><tr><td rowspan=1 colspan=1>DecoderRNN cell</td><td rowspan=1 colspan=4>LSTM</td></tr><tr><td rowspan=1 colspan=1>Initial learning rate</td><td rowspan=1 colspan=4>0.005</td></tr><tr><td rowspan=1 colspan=1>Learning rate decay schedule</td><td rowspan=1 colspan=4>Decay the learning rate by a factor of O.8× when thevalidation loss does not decrease for 5OO mini-batches</td></tr><tr><td rowspan=1 colspan=1>Hidden state size</td><td rowspan=1 colspan=4>256</td></tr><tr><td rowspan=1 colspan=1>Embedding size</td><td rowspan=1 colspan=4>256</td></tr><tr><td rowspan=1 colspan=1>Dropout rate</td><td rowspan=1 colspan=4>0.5</td></tr><tr><td rowspan=1 colspan=1>Gradient clip threshold</td><td rowspan=1 colspan=4>5.0</td></tr><tr><td rowspan=1 colspan=1>Weights initialization</td><td rowspan=1 colspan=3>Uniformly random from [-0.1, 0.1]</td><td rowspan=1 colspan=1></td></tr></table>
|
| 316 |
+
|
| 317 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>CJ-(A/B)S</td><td rowspan=1 colspan=1>CJ-(A/B)L</td><td rowspan=1 colspan=1>SYN-S</td><td rowspan=1 colspan=1>SYN-L</td></tr><tr><td rowspan=1 colspan=1>Average input length (P)</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>50</td></tr><tr><td rowspan=1 colspan=1>Minimal output length (P)</td><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>46</td></tr><tr><td rowspan=1 colspan=1>Maximal output length (P)</td><td rowspan=1 colspan=1>151</td><td rowspan=1 colspan=1>311</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>96</td></tr><tr><td rowspan=1 colspan=1>Average output length (P)</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>69</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>71</td></tr><tr><td rowspan=1 colspan=1>Minimal input length (T)</td><td rowspan=1 colspan=1>34</td><td rowspan=1 colspan=1>69</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Maximal input length (T)</td><td rowspan=1 colspan=1>61</td><td rowspan=1 colspan=1>111</td><td rowspan=1 colspan=1>56</td><td rowspan=1 colspan=1>134</td></tr><tr><td rowspan=1 colspan=1>Average input length (T)</td><td rowspan=1 colspan=1>48</td><td rowspan=1 colspan=1>85</td><td rowspan=1 colspan=1>49</td><td rowspan=1 colspan=1>111</td></tr><tr><td rowspan=1 colspan=1>Minimal output length (T)</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>73</td><td rowspan=1 colspan=1>41</td><td rowspan=1 colspan=1>90</td></tr><tr><td rowspan=1 colspan=1> Maximal output length (T)</td><td rowspan=1 colspan=1>251</td><td rowspan=1 colspan=1>531</td><td rowspan=1 colspan=1>82</td><td rowspan=1 colspan=1>177</td></tr><tr><td rowspan=1 colspan=1>Average output length (T)</td><td rowspan=1 colspan=1>71</td><td rowspan=1 colspan=1>129</td><td rowspan=1 colspan=1>55</td><td rowspan=1 colspan=1>133</td></tr></table>
|
| 318 |
+
|
| 319 |
+
Table 6: Statistics of the datasets used for the synthetic task and the CoffeeScript-JavaScript task.
|
| 320 |
+
|
| 321 |
+
# A HYPER-PARAMETERS OF NEURAL NETWORK MODELS
|
| 322 |
+
|
| 323 |
+
We present the hyper-parameters of different neural networks in Table 5. These hyper-parameters are chosen to achieve the best validation accuracy through a grid search.
|
| 324 |
+
|
| 325 |
+
# B MORE STATISTICS OF OUR PROPOSED DATASETS
|
| 326 |
+
|
| 327 |
+
We present more detailed statistics of the datasets for the synthetic task and the CoffeeScriptJavaScript task in Table 6.
|
| 328 |
+
|
| 329 |
+
# C MORE RESULTS ON COFFEESCRIPT-JAVASCRIPT TASK
|
| 330 |
+
|
| 331 |
+
Table 7 shows the token accuracy of different approaches for the translation between CoffeeScript and JavaScript.
|
| 332 |
+
|
| 333 |
+
# D GRAMMARS FOR GENERATING THE PROGRAMS IN THE EVALUATION
|
| 334 |
+
|
| 335 |
+
# D.1 GRAMMARS FOR THE SYNTHETIC TASK
|
| 336 |
+
|
| 337 |
+
The grammar specifications of the source language (FOR language) and the target language (LAMBDA language) used in the synthetic task are provided in Figure 4 and Figure 5 respectively.
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=3>Tree2tree</td><td rowspan=1 colspan=4>Seq2seq</td><td rowspan=1 colspan=2>Seq2tree</td><td rowspan=1 colspan=2>Tree2seq</td></tr><tr><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>T→T(-PF)</td><td rowspan=1 colspan=1>T→T(-Attn)</td><td rowspan=1 colspan=1>P→P</td><td rowspan=1 colspan=1>P→T</td><td rowspan=1 colspan=1>T→P</td><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>P→T</td><td rowspan=1 colspan=1>T→T</td><td rowspan=1 colspan=1>T→P</td><td rowspan=1 colspan=1>T→T</td></tr><tr><td rowspan=1 colspan=4></td><td rowspan=1 colspan=8>CoffeeScript to JavaScript translation</td></tr><tr><td rowspan=1 colspan=1>CJ-AS</td><td rowspan=1 colspan=1>99.97%</td><td rowspan=1 colspan=1>99.97%</td><td rowspan=1 colspan=1>56.21%</td><td rowspan=1 colspan=1>93.51%</td><td rowspan=1 colspan=1>92.30%</td><td rowspan=1 colspan=1>95.46%</td><td rowspan=1 colspan=1>95.05%</td><td rowspan=1 colspan=1>93.29%</td><td rowspan=1 colspan=1>95.94%</td><td rowspan=1 colspan=1>98.96%</td><td rowspan=1 colspan=1>98.09%</td></tr><tr><td rowspan=1 colspan=1>CJ-BS</td><td rowspan=1 colspan=1>99.98%</td><td rowspan=1 colspan=1>99.98%</td><td rowspan=1 colspan=1>47.54%</td><td rowspan=1 colspan=1>99.08%</td><td rowspan=1 colspan=1>87.51%</td><td rowspan=1 colspan=1>99.11%</td><td rowspan=1 colspan=1>96.14%</td><td rowspan=1 colspan=1>98.31%</td><td rowspan=1 colspan=1>98.09%</td><td rowspan=1 colspan=1>99.27%</td><td rowspan=1 colspan=1>98.10%</td></tr><tr><td rowspan=1 colspan=1>CJ-AL</td><td rowspan=1 colspan=1>99.37%</td><td rowspan=1 colspan=1>98.16%</td><td rowspan=1 colspan=1>32.99%</td><td rowspan=1 colspan=1>85.84%</td><td rowspan=1 colspan=1>25.65%</td><td rowspan=1 colspan=1>19.13%</td><td rowspan=1 colspan=1>36.18%</td><td rowspan=1 colspan=1>95.64%</td><td rowspan=1 colspan=1>94.74%</td><td rowspan=1 colspan=1>94.18%</td><td rowspan=1 colspan=1>84.71%</td></tr><tr><td rowspan=1 colspan=1>CJ-BL</td><td rowspan=1 colspan=1>99.36%</td><td rowspan=1 colspan=1>99.27%</td><td rowspan=1 colspan=1>31.80%</td><td rowspan=1 colspan=1>80.22%</td><td rowspan=1 colspan=1>63.49%</td><td rowspan=1 colspan=1>87.27%</td><td rowspan=1 colspan=1>79.85%</td><td rowspan=1 colspan=1>94.09%</td><td rowspan=1 colspan=1>94.64%</td><td rowspan=1 colspan=1>93.85%</td><td rowspan=1 colspan=1>78.07%</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3></td><td rowspan=1 colspan=1>JavaScr</td><td rowspan=1 colspan=1>pttoCoff</td><td rowspan=1 colspan=1>eScripttra</td><td rowspan=1 colspan=1>nslation</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>JC-AS</td><td rowspan=1 colspan=1>99.14%</td><td rowspan=1 colspan=1>98.81%</td><td rowspan=1 colspan=1>65.42%</td><td rowspan=1 colspan=1>88.44%</td><td rowspan=1 colspan=1>96.27%</td><td rowspan=1 colspan=1>88.46%</td><td rowspan=1 colspan=1>98.34%</td><td rowspan=1 colspan=1>98.20%</td><td rowspan=1 colspan=1>99.06%</td><td rowspan=1 colspan=1>86.93%</td><td rowspan=1 colspan=1>98.36%</td></tr><tr><td rowspan=1 colspan=1>JC-BS</td><td rowspan=1 colspan=1>98.84%</td><td rowspan=1 colspan=1>98.18%</td><td rowspan=1 colspan=1>55.22%</td><td rowspan=1 colspan=1>86.85%</td><td rowspan=1 colspan=1>97.92%</td><td rowspan=1 colspan=1>85.98%</td><td rowspan=1 colspan=1>98.09%</td><td rowspan=1 colspan=1>96.93%</td><td rowspan=1 colspan=1>98.84%</td><td rowspan=1 colspan=1>84.81%</td><td rowspan=1 colspan=1>97.94%</td></tr><tr><td rowspan=1 colspan=1>JC-AL</td><td rowspan=1 colspan=1>96.95%</td><td rowspan=1 colspan=1>92.65%</td><td rowspan=1 colspan=1>42.23%</td><td rowspan=1 colspan=1>88.09%</td><td rowspan=1 colspan=1>95.94%</td><td rowspan=1 colspan=1>87.19%</td><td rowspan=1 colspan=1>95.04%</td><td rowspan=1 colspan=1>93.51%</td><td rowspan=1 colspan=1>96.59%</td><td rowspan=1 colspan=1>84.57%</td><td rowspan=1 colspan=1>94.63%</td></tr><tr><td rowspan=1 colspan=1>JC-BL</td><td rowspan=1 colspan=1>96.48%</td><td rowspan=1 colspan=1>92.49%</td><td rowspan=1 colspan=1>39.89%</td><td rowspan=1 colspan=1>87.31%</td><td rowspan=1 colspan=1>94.12%</td><td rowspan=1 colspan=1>85.70%</td><td rowspan=1 colspan=1>96.24%</td><td rowspan=1 colspan=1>94.79%</td><td rowspan=1 colspan=1>96.33%</td><td rowspan=1 colspan=1>83.03%</td><td rowspan=1 colspan=1>94.68%</td></tr></table>
|
| 340 |
+
|
| 341 |
+
Table 7: Token accuracy of different approaches for translation between CoffeeScript and JavaScript.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 4: Grammar for the source language FOR in the synthetic task.
|
| 345 |
+
|
| 346 |
+
D.2 GRAMMAR FOR THE COFFEESCRIPT-JAVASCRIPT TASK
|
| 347 |
+
|
| 348 |
+
The grammar used to generate the CoffeeScript-JavaScript dataset, which is a subset of the core CoffeeScript grammar, is provided in Figure 6.
|
| 349 |
+
|
| 350 |
+
E PYTHON IMPLEMENTATION OF THE TRANSLATOR FOR THE SYNTHETIC TASK
|
| 351 |
+
|
| 352 |
+
The python source code to implement the translator from a FOR program to a LAMBDA program in the synthetic task is provided in Figure 7.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 5: Grammar for the target language LAMBDA in the synthetic task.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 6: A subset of the CoffeeScript grammar used to generate the CoffeeScript-JavaScript dataset. Here, ${ < } \mathrm { b r } >$ denotes the newline character.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 7: The Python code to translate a FOR program into a LAMBDA program.
|
md/train/uDeDDoFOEpj/uDeDDoFOEpj.md
ADDED
|
Binary file (60.7 kB). View file
|
|
|
md/train/zI38PZQHWKj/zI38PZQHWKj.md
ADDED
|
@@ -0,0 +1,691 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEATURE-ROBUST OPTIMAL TRANSPORT FOR HIGH-DIMENSIONAL DATA
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Optimal transport is a machine learning problem with applications including distribution comparison, feature selection, and generative adversarial networks. In this paper, we propose feature-robust optimal transport (FROT) for highdimensional data, which solves high-dimensional OT problems using feature selection to avoid the curse of dimensionality. Specifically, we find a transport plan with discriminative features. To this end, we formulate the FROT problem as a min–max optimization problem. We then propose a convex formulation of the FROT problem and solve it using a Frank–Wolfe-based optimization algorithm, whereby the subproblem can be efficiently solved using the Sinkhorn algorithm. Since FROT finds the transport plan from selected features, it is robust to noise features. To show the effectiveness of FROT, we propose using the FROT algorithm for the layer selection problem in deep neural networks for semantic correspondence. By conducting synthetic and benchmark experiments, we demonstrate that the proposed method can find a strong correspondence by determining important layers. We show that the FROT algorithm achieves state-of-the-art performance in real-world semantic correspondence datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Optimal transport (OT) is a machine learning problem with several applications in the computer vision and natural language processing communities. The applications include Wasserstein distance estimation (Peyre et al., 2019), domain adaptation (Yan et al., 2018), multitask learning (Janati et al., ´ 2019), barycenter estimation (Cuturi & Doucet, 2014), semantic correspondence (Liu et al., 2020), feature matching (Sarlin et al., 2019), and photo album summarization (Liu et al., 2019). The OT problem is extensively studied in the computer vision community as the earth mover’s distance (EMD) (Rubner et al., 2000). However, the computational cost of EMD is cubic and highly expensive. Recently, the entropic regularized EMD problem was proposed; this problem can be solved using the Sinkhorn algorithm with a quadratic cost (Cuturi, 2013). Owing to the development of the Sinkhorn algorithm, researchers have replaced the EMD computation with its regularized counterparts. However, the optimal transport problem for high-dimensional data has remained unsolved for many years.
|
| 12 |
+
|
| 13 |
+
Recently, a robust variant of the OT was proposed for high-dimensional OT problems and used for divergence estimation (Paty & Cuturi, 2019; 2020). In the robust OT framework, the transport plan is computed with the discriminative subspace of the two data matrices $\pmb { X } \in \mathbb { R } ^ { d \times n }$ and $\pmb { Y } \in \mathbb { R } ^ { \pmb { d } \times m }$ . The subspace can be obtained using dimensionality reduction. An advantage of the subspace robust approach is that it does not require prior information about the subspace. However, given prior information such as feature groups, we can consider a computationally efficient formulation. The computation of the subspace can be expensive if the dimensionality of data is high, for example, $1 0 ^ { 4 }$ .
|
| 14 |
+
|
| 15 |
+
One of the most common prior information items is a feature group. The use of group features is popular in feature selection problems in the biomedical domain and has been extensively studied in Group Lasso (Yuan & Lin, 2006). The key idea of Group Lasso is to prespecify the group variables and select the set of group variables using the group norm (also known as the sum of $\ell _ { 2 }$ norms). For example, if we use a pretrained neural network as a feature extractor and compute OT using the features, then we require careful selection of important layers to compute OT. Specifically, each layer output is regarded as a grouped input. Therefore, using a feature group as prior information is a natural setup and is important for considering OT for deep neural networks (DNNs).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: transport plans between two synthetic distributions with 10-dimensional vectors ${ \widetilde { \pmb x } } =$ $( \pmb { x } ^ { \top } , \pmb { z } _ { x } ^ { \top } )$ , $\widetilde { \pmb y } = \overline { ( \pmb y ^ { \top } , \pmb z _ { y } ^ { \top } ) }$ , where two-dimensional vectors $\pmb { x } \sim N ( \pmb { \mu } _ { x } , \pmb { \Sigma } _ { x } )$ and $\pmb { y } \sim N ( \pmb { \mu } _ { y } , \pmb { \Sigma } _ { y } )$ are true features; and $\dot { z } _ { x } \sim N ( \mathbf { 0 } _ { 8 } , I _ { 8 } )$ and $z _ { y } \sim N ( \mathbf { 0 } _ { 8 } , I _ { 8 } )$ are noisy features. (a) OT between distribution $_ { \textbf { \em x } }$ and $\textbf { { y } }$ is a reference. (b) OT between distribution $\widetilde { \pmb x }$ and $\widetilde { \pmb { y } }$ . (c) FROT transport plan between distribution $\widetilde { \pmb x }$ and $\widetilde { \pmb { y } }$ e ewhere true features and noisy features are grouped, respectively.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a high-dimensional optimal transport method by utilizing prior information in the form of grouped features. Specifically, we propose a feature-robust optimal transport (FROT) problem, for which we select distinct group feature sets to estimate a transport plan instead of determining its distinct subsets, as proposed in (Paty & Cuturi, 2019; 2020). To this end, we formulate the FROT problem as a min–max optimization problem and transform it into a convex optimization problem, which can be accurately solved using the Frank–Wolfe algorithm (Frank & Wolfe, 1956; Jaggi, 2013). The FROT’s subproblem can be efficiently solved using the Sinkhorn algorithm (Cuturi, 2013). An advantage of FROT is that it can yield a transport plan from high-dimensional data using feature selection, using which the significance of the features is obtained without any additional cost. Therefore, the FROT formulation is highly suited for high-dimensional OT problems. Through synthetic experiments, we initially demonstrate that the proposed FROT is robust to noise dimensions (See Figure 1). Furthermore, we apply FROT to a semantic correspondence problem (Liu et al., 2020) and show that the proposed algorithm achieves SOTA performance.
|
| 21 |
+
|
| 22 |
+
# Contribution:
|
| 23 |
+
|
| 24 |
+
• We propose a feature robust optimal transport (FROT) problem and derive a simple and efficient Frank–Wolfe based algorithm. Furthermore, we propose a feature-robust Wasserstein distance (FRWD). We apply FROT to a high-dimensional feature selection problem and show that FROT is consistent with the Wasserstein distance-based feature selection algorithm with less computational cost than the original algorithm.
|
| 25 |
+
• We used FROT for the layer selection problem in a semantic correspondence problem and showed that the proposed algorithm outperforms existing baseline algorithms.
|
| 26 |
+
|
| 27 |
+
# 2 BACKGROUND
|
| 28 |
+
|
| 29 |
+
In this section, we briefly introduce the OT problem.
|
| 30 |
+
|
| 31 |
+
Optimal transport (OT): The following are given: independent and identically distributed (i.i.d.) samples $\pmb { X } \ = \ \mathsf { \bar { \{ x } } _ { i } \mathsf { J } _ { i = 1 } ^ { n } \ \in \ \mathbb { R } ^ { d \times n }$ from a $d$ -dimensional distribution $p$ , and i.i.d. samples ${ \bf Y _ { \alpha } } =$ $\{ y _ { j } \} _ { j = 1 } ^ { m } \in \mathbb { R } ^ { d \times m }$ from the $d$ -dimensional distribution $q$ . In the Kantorovich relaxation of OT, admissible couplings are defined by the set of the transport plan:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\begin{array} { r } { U ( \mu , \nu ) = \{ \Pi \in \mathbb { R } _ { + } ^ { n \times m } : \Pi \mathbf { 1 } _ { m } = \pmb { a } , \Pi ^ { \top } \mathbf { 1 } _ { n } = b \} , } \end{array}
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\mathbf { I I } \in \mathbb { R } _ { + } ^ { n \times m }$ is called the transport plan, ${ \bf 1 } _ { n }$ is the $n$ -dimensional vector whose elements are ones, and $\mathbf { \pmb { a } } = ( a _ { 1 } , a _ { 2 } , \ldots , a _ { n } ) ^ { \top } \in \mathbb { R } _ { + } ^ { n }$ and $\pmb { b } = ( b _ { 1 } , b _ { 2 } , \ldots , b _ { m } ) ^ { \top } \in \mathbb { R } _ { + } ^ { m }$ are the weights. The OT problem between two discrete measures $\textstyle \mu = \sum _ { i = 1 } ^ { n } a _ { i } \delta _ { \pmb { x } _ { i } }$ and $\textstyle \nu = \sum _ { j = 1 } ^ { m } b _ { j } \delta _ { { \pmb y } _ { j } }$ determines the
|
| 38 |
+
|
| 39 |
+
optimal transport plan of the following problem:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { m i n } _ { \substack { \mathbf { \pi } \pi \in U ( \mu , \nu ) } } \quad \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } c ( { \pmb x } _ { i } , { \pmb y } _ { j } ) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $c ( { \pmb x } , { \pmb y } )$ is a cost function. For example, the squared Euclidean distance is used, that is, $c ( { \pmb x } , { \pmb y } ) = \| { \pmb x } - { \pmb y } \| _ { 2 } ^ { 2 }$ . To solve the OT problem, Eq. (1) (also known as the earth mover’s distance) using linear programming requires ${ \mathrm { \dot { ~ } } } O ( n ^ { 3 } ) , ( n { \mathrm { \dot { = } } } m )$ computation, which is computationally expensive. To address this, an entropic-regularized optimal transport is used (Cuturi, 2013).
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\operatorname* { m i n } _ \substack \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \left. \mathbf { \Pi } \mathbf { \Pi } \right. \left. \mathbf { \Pi } \mathbf { \Pi } \right. \left. \mathbf { \Pi } \mathbf { \Pi } \right. \left. \mathbf { \Pi } \mathbf { \Pi } \right. \left. \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } c ( \pmb { x } _ { i } , \pmb { y } _ { j } ) + \epsilon H ( \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } ) , \right.
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\epsilon \geq 0$ is the regularization parameter, and $\begin{array} { r } { H ( \pmb { \Pi } ) = \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } ( \log ( \pi _ { i j } ) - 1 ) } \end{array}$ is the entropic regularization. If , then the regularized OT problem reduces to the EMD problem. Owing to entropic regularization, the entropic regularized OT problem can be accurately solved using Sinkhorn iteration (Cuturi, 2013) with a $O ( \bar { n 2 } n )$ computational cost (See Algorithm 1).
|
| 52 |
+
|
| 53 |
+
Wasserstein distance: If the cost function is defined as $c ( \pmb { x } , \pmb { y } ) = d ( \pmb { x } , \pmb { y } )$ with $d ( { \pmb x } , { \pmb y } )$ as a distance function and $p \geq 1$ , then we define the $p$ -Wasserstein distance of two discrete measures $\textstyle \mu = \sum _ { i = 1 } ^ { n } a _ { i } \delta _ { \pmb { x } _ { i } }$ and $\begin{array} { r } { \nu = \sum _ { j = 1 } ^ { m } b _ { j } \delta _ { { \bf y } _ { j } } } \end{array}$ as
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
W _ { p } ( \mu , \nu ) = \left( \operatorname* { m i n } _ { \substack { \Pi \in U ( \mu , \nu ) } } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } d ( x _ { i } , y _ { j } ) ^ { p } \right) ^ { 1 / p } .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Recently, a robust variant of the Wasserstein distance, called the subspace robust Wasserstein distance (SRW), was proposed (Paty & Cuturi, 2019). The SRW computes the OT problem in the discriminative subspace. This can be determined by solving dimensionality-reduction problems. Owing to the robustness, it can compute the Wasserstein from noisy data. The SRW is given as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathrm { S R W } ( \mu , \nu ) = \left( \operatorname* { m i n } _ { \substack { \pi \in U ( \mu , \nu ) } } \ \operatorname* { m a x } _ { U \in \mathbb { R } ^ { d \times k } , U ^ { \top } U = I _ { k } } \ \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \Vert U ^ { \top } x _ { i } - U ^ { \top } y _ { j } \Vert _ { 2 } ^ { 2 } \right) ^ { \frac { 1 } { 2 } } ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $U$ is the projection matrix with $k \leq d$ , and $\ b { I _ { k } } \in \mathbb { R } ^ { k \times k }$ is the identity matrix. The SRW or its relaxed problem can be efficiently estimated using either eigenvalue decomposition or the Frank–Wolfe algorithm.
|
| 66 |
+
|
| 67 |
+
# 3 PROPOSED METHOD
|
| 68 |
+
|
| 69 |
+
This paper proposes FROT. We assume that the vectors are grouped as $\pmb { x } = ( \pmb { x } ^ { ( 1 ) } ^ { \top } , \dots , \pmb { x } ^ { ( L ) } ^ { \top } ) ^ { \top }$ and $\pmb { y } = ( \pmb { y } ^ { ( 1 ) } , \dots , \pmb { y } ^ { ( L ) } ) ^ { \top } ) ^ { \top }$ . Here, $\pmb { x } ^ { ( \ell ) } \in \mathbb { R } ^ { d _ { \ell } }$ and $\pmb { y } ^ { ( \ell ) } \in \mathbb { R } ^ { d _ { \ell } }$ are the $d _ { \ell }$ dimensional vectors, where $\textstyle \sum _ { \ell = 1 } ^ { L } d _ { \ell } = d$ . This setting is useful if we know the explicit group structure for the feature vectors a priori. In an application in $L$ -layer neural networks, we consider $\pmb { x } ^ { ( \ell ) }$ and $\pmb { y } ^ { ( \ell ) }$ as outputs of the \`th layer of the network. If we do not have a priori information, we can consider each feature independently (i.e., $d _ { 1 } = d _ { 2 } = \dots = d _ { L } = 1$ and $L = d$ ). All proofs in this section are provided in the Appendix.
|
| 70 |
+
|
| 71 |
+
# 3.1 FEATURE-ROBUST OPTIMAL TRANSPORT (FROT)
|
| 72 |
+
|
| 73 |
+
The FROT formulation is given by
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\operatorname* { m i n } _ { \substack { \mathbf { \Phi } \mathbf { \pi } \mathbf { \Theta } \mathbf { { I } } \in U ( \mu , \nu ) } } \operatorname* { m a x } _ { \substack { \alpha \in \Sigma ^ { L } } } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } c ( { \pmb x } _ { i } ^ { ( \ell ) } , { \pmb y } _ { j } ^ { ( \ell ) } ) ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\Sigma ^ { L } = \{ \pmb { \alpha } \in \mathbb { R } _ { + } ^ { L } : \pmb { \alpha } ^ { \top } \mathbf { 1 } _ { L } = 1 \}$ is the probability simplex. The underlying concept of FROT is to estimate the transport plan $\mathbf { I I }$ using distinct groups with large distances between $\{ \pmb { x } _ { i } ^ { ( \ell ) } \} _ { i = 1 } ^ { n }$ and $\{ \pmb { y } _ { j } ^ { ( \ell ) } \} _ { j = 1 } ^ { m }$ . We note that determining the transport plan in nondistinct groups is difficult because the es in $\{ \pmb { x } _ { i } ^ { ( \ell ) } \} _ { i = 1 } ^ { n }$ and $\{ \pmb { y } _ { j } ^ { ( \ell ) } \} _ { j = 1 } ^ { m }$ overlap. By contrast, in distinct groups, $\{ \pmb { x } _ { i } ^ { ( \ell ) } \} _ { i = 1 } ^ { n }$ and {y(\`)j }mj=1 intrinsically similar idea to the subspace robust Wasserstein distance (Paty & Cuturi, 2019), which estimates the transport plan in the discriminative subspace, while our approach selects important groups. Therefore, FROT can be regarded as a feature selection variant of the vanilla OT problem in Eq. (1), whereas the subspace robust version uses dimensionality-reduction counterparts.
|
| 80 |
+
|
| 81 |
+
# Algorithm 1 Sinkhorn algorithm.
|
| 82 |
+
|
| 83 |
+
# Algorithm 2 FROT with the Frank–Wolfe.
|
| 84 |
+
|
| 85 |
+
1: Input: a, b, C, , tmax
|
| 86 |
+
2: Initialize $K \ = \ e ^ { - C / \epsilon } , u \ = \ 1 _ { n } , v =$
|
| 87 |
+
$\mathbf { 1 } _ { m } , t = 0$
|
| 88 |
+
3: while $t \leq t _ { m a x }$ and not converge do
|
| 89 |
+
4: $\pmb { u } = \pmb { a } / ( K \pmb { v } )$
|
| 90 |
+
5: $\pmb { v } = \pmb { b } / ( \pmb { K } ^ { \top } \pmb { u } )$
|
| 91 |
+
6: $t = t + 1$
|
| 92 |
+
7: end while
|
| 93 |
+
8: return $\Pi = \mathrm { d i a g } ( { \pmb u } ) { \pmb K } \mathrm { d i a g } ( { \pmb v } )$
|
| 94 |
+
|
| 95 |
+
{2: Initialize 1: Input: $\{ \pmb { x } _ { i } \} _ { i = 1 } ^ { n } , \{ \pmb { y } _ { j } \} _ { j = 1 } ^ { m } ,$ $\mathbf { I I }$ }i=1 { }, compute $\{ C _ { \ell } \} _ { \ell = 1 } ^ { L }$ $\eta$ , and . $\epsilon$ .
|
| 96 |
+
3: for $t = 0 \dots T$ do
|
| 97 |
+
4: Πb = argmin Π∈U(µ,ν)hΠ, MΠ(t) i + H(Π)
|
| 98 |
+
5: Π(t+1) = (1 − γ)Π(t) + γΠb
|
| 99 |
+
6: with γ = 22+t .
|
| 100 |
+
7: end for
|
| 101 |
+
8: return Π(T )
|
| 102 |
+
|
| 103 |
+
Using FROT, we can define a $p$ -feature robust Wasserstein distance ( $\dot { p }$ -FRWD).
|
| 104 |
+
|
| 105 |
+
Proposition 1 For the distance function $d ( { \pmb x } , { \pmb y } )$ ,
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathrm { F R W D } _ { p } ( \mu , \nu ) = \left( \operatorname* { m i n } _ { \substack { \mathbf { \pi } \mathbf { U } ( \mu , \nu ) \mathbf { \Lambda } \alpha \in \Sigma ^ { L } } } \ \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } d ( x _ { i } ^ { ( \ell ) } , y _ { j } ^ { ( \ell ) } ) ^ { p } \right) ^ { 1 / p } ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
is a distance for $p \geq 1$ .
|
| 112 |
+
|
| 113 |
+
Note that we can show that 2-FRWD is a special case of SRW with $d ( \pmb { x } , \pmb { y } ) = \| \pmb { x } - \pmb { y } \| _ { 2 }$ (See Appendix). The key difference between SRW and FRWD is that FRWD can use any distance, while SRW can only use $d ( \pmb { x } , \pmb { y } ) = \| \pmb { x } - \pmb { y } \| _ { 2 }$ .
|
| 114 |
+
|
| 115 |
+
# 3.2 FROT OPTIMIZATION
|
| 116 |
+
|
| 117 |
+
Here, we propose two FROT algorithms based on the Frank–Wolfe algorithm and linear programming.
|
| 118 |
+
|
| 119 |
+
Frank–Wolfe: We propose a continuous variant of the FROT algorithm using the Frank–Wolfe algorithm, which can be fully differentiable. To this end, we introduce entropic regularization for $_ \alpha$ and rewrite the FROT as a function of $\mathbf { I I }$ . Therefore, we solve the following problem for $_ { \pmb { \alpha } }$ :
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\operatorname* { m i n } _ { \substack { \mathbf { I } \in U ( \mu , \nu ) } } \operatorname* { m a x } _ { \alpha \in \Sigma ^ { L } } J _ { \eta } ( \mathbf { I I } , \alpha ) , \mathrm { w i t h } J _ { \eta } ( \mathbf { I I } , \alpha ) = \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } c ( { x _ { i } ^ { ( \ell ) } } , { y _ { j } ^ { ( \ell ) } } ) - \eta H ( \alpha ) ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $\eta \geq 0$ is the regularization parameter, and $\begin{array} { r } { H ( \pmb { \alpha } ) = \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } ( \log ( \alpha _ { \ell } ) - 1 ) } \end{array}$ is the entropic regularization for $_ { \pmb { \alpha } }$ . An advantage of entropic regularization is that the nonnegative constraint is naturally satisfied, and the entropic regularizer is a strong convex function.
|
| 126 |
+
|
| 127 |
+
Lemma 2 The optimal solution of the optimization problem
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\alpha ^ { * } = \underset { \alpha \in \Sigma ^ { L } } { \mathrm { a r g m a x } } \quad J _ { \eta } ( \Pi , \alpha ) , \mathrm { w i t h } J _ { \eta } ( \Pi , \alpha ) = \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \phi _ { \ell } - \eta H ( \alpha )
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
with a fixed admissible transport plan $\mathbf { \Pi } \mathbf { I } \in U ( \mu , \nu )$ , is given by
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\alpha _ { \ell } ^ { * } = \frac { \exp \left( \frac { 1 } { \eta } \phi _ { \ell } \right) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \phi _ { \ell ^ { \prime } } \right) } \mathrm { w i t h ~ } J _ { \eta } ( \mathbf { I I } , \alpha ^ { * } ) = \eta \log \left( \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \phi _ { \ell } \right) \right) + \eta .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Using Lemma 2 (or Lemma 4 in Nesterov (2005)) together with the setting $\textstyle \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } c ( \pmb { x } _ { i } ^ { ( \ell ) } , \pmb { y } _ { i } ^ { ( \ell ) } ) = \langle \pmb { \Pi } , \pmb { C } _ { \ell } \rangle$ , $[ \boldsymbol { C } _ { \ell } ] _ { i j } = c ( \mathbf { x } _ { i } ^ { ( \ell ) } , \mathbf { y } _ { i } ^ { ( \ell ) } )$ \` , the global problem is equivalent to $\begin{array} { r l } { \phi _ { \ell } } & { { } = } \end{array}$
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\operatorname* { m i n } _ { \substack { \mathbf { \pi } \pi \in U ( \mu , \nu ) } } G _ { \eta } ( \mathbf { \boldsymbol { \Pi } } ) , \mathrm { ~ w i t h ~ } G _ { \eta } ( \mathbf { \boldsymbol { \Pi } } ) = \eta \log \left( \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \mathbf { \boldsymbol { \Pi } } , C _ { \ell } \rangle \right) \right) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Note that this is known as a smoothed max-operator (Nesterov, 2005; Blondel et al., 2018). Specifically, regularization parameter $\eta$ controls the “smoothness” of the maximum.
|
| 146 |
+
|
| 147 |
+
Proposition 3 $G _ { \eta } ( \mathbf { I I } )$ is a convex function relative to Π.
|
| 148 |
+
|
| 149 |
+
The derived optimization problem of FROT is convex. Therefore, we can determine globally optimal solutions. Note that the SRW optimization problem is not jointly convex (Paty & Cuturi, 2019) for the projection matrix and the transport plan. In this study, we employ the Frank–Wolfe algorithm (Frank & Wolfe, 1956; Jaggi, 2013), using which we approximate $G _ { \eta } ( \mathbf { I I } )$ with linear functions at $\Pi ^ { ( t ) }$ and move $\mathbf { I I }$ toward the optimal solution in the convex set (See Algorithm 2).
|
| 150 |
+
|
| 151 |
+
The derivative of the loss function $G _ { \eta } ( \mathbf { I I } )$ at $\pi ^ { ( t ) }$ is given by
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\frac { \partial G _ { \eta } ( \mathbf { I I } ) } { \partial \Pi } \Bigg \vert _ { \Pi = \Pi ^ { ( t ) } } = \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } ^ { ( t ) } C _ { \ell } = M _ { \Pi ^ { ( t ) } } \mathrm { ~ w i t h ~ } \alpha _ { \ell } ^ { ( t ) } = \frac { \exp \left( \frac { 1 } { \eta } \langle \Pi ^ { ( t ) } , C _ { \ell } \rangle \right) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \Pi ^ { ( t ) } , C _ { \ell ^ { \prime } } \rangle \right) } .
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Then, we update the transport plan by solving the EMD problem:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\Pi ^ { ( t + 1 ) } = ( 1 - \gamma ) \Pi ^ { ( t ) } + \gamma \widehat { \Pi } \mathrm { w i t h } \widehat { \Pi } = \underset { \Pi \in U ( \mu , \nu ) } { \operatorname { a r g m i n } } \langle \Pi , M _ { \Pi ^ { ( t ) } } \rangle ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
where $\gamma = 2 / ( 2 + k )$ . Note that $M _ { \Pi ^ { ( t ) } }$ is given by the weighted sum of the cost matrices. Thus, we can utilize multiple features to estimate the transport plan $\mathbf { I I }$ for the relaxed problem in Eq. (5).
|
| 164 |
+
|
| 165 |
+
Using the Frank–Wolfe algorithm, we can obtain the optimal solution. However, solving the EMD problem requires a cubic computational cost that can be expensive if $n$ and $m$ are large. To address this, we can solve the regularized OT problem, which requires $O ( n m )$ . We denote the Frank–Wolfe algorithm with EMD as FW-EMD and the Frank–Wolfe algorithm with Sinkhorn as FW-Sinkhorn.
|
| 166 |
+
|
| 167 |
+
Computational complexity: The proposed method depends on the Sinkhorn algorithm, which requires an $O ( n m )$ operation. The computation of the cost matrix in each subproblem needs an $O ( L n m )$ operation, where $L$ is the number of groups. Therefore, the entire complexity is $O ( T L n m )$ , where $T$ is the number of Frank–Wolfe iterations (in general, $T = 1 0$ is sufficient).
|
| 168 |
+
|
| 169 |
+
Proposition 4 For each $t \geq 1$ , the iteration $\pi ^ { ( t ) }$ of Algorithm 2 satisfies
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
G _ { \eta } ( \Pi ^ { ( t ) } ) - G _ { \eta } ( \Pi ^ { \ast } ) \leq \frac { 4 \sigma _ { m a x } ( \Phi ^ { \top } \Phi ) } { \eta ( t + 2 ) } ( 1 + \delta ) ,
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $\sigma _ { m a x } ( \Phi ^ { \top } \Phi )$ is the largest eigenvalue of the matrix $\Phi ^ { \top } \Phi$ and $\begin{array} { r l r l } { \Phi } & { { } } & { = } \end{array}$ $( \operatorname { v e c } ( C _ { 1 } ) , \operatorname { v e c } ( C _ { 2 } ) , \ldots , \operatorname { v e c } ( C _ { L } ) ) ^ { \top }$ ; and $\delta \quad \geq \quad 0$ is the accuracy to which internal linear subproblems are solved.
|
| 176 |
+
|
| 177 |
+
Based on Proposition 4, the number of iterations depends on $\eta , \epsilon$ , and the number of groups. If we set a small $\eta$ , convergence requires more time. In addition, if we use entropic regularization with a large $\epsilon$ , the $\delta$ in Proposition 4 can be large. Finally, if we use more groups, the largest eigenvalue of the matrix $\Phi ^ { \top } \Phi$ can be larger. Note that the constant term of the upper bound is large; however, the Frank–Wolfe algorithm converges quickly in practice.
|
| 178 |
+
|
| 179 |
+
Linear Programming: Becausethe FROT problem can also be w $\begin{array} { r } { \operatorname* { l i m } _ { \eta 0 ^ { + } } G _ { \eta } ( \mathbf { I I } ) = \operatorname* { m a x } _ { \ell \in \{ 1 , 2 , \ldots , L \} } \ \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } c ( { \boldsymbol x } _ { i } ^ { ( \ell ) } , { \boldsymbol y } _ { j } ^ { ( \ell ) } ) , } \end{array}$
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\operatorname* { m i n } _ { \substack { \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } ^ { \prime } \left( \mu , \nu \right) \ell \in \{ 1 , 2 , \dots , L \} } } \operatorname* { m a x } _ { \substack { i = 1 } } \sum _ { j = 1 } ^ { n } \pi _ { i j } c ( \mathbf { \boldsymbol { x } } _ { i } ^ { ( \ell ) } , \mathbf { \boldsymbol { y } } _ { j } ^ { ( \ell ) } ) .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
Because the objective is the max of linear functions, it is convex with respect to $\mathbf { I I }$ . We can solve the problem via linear programming:
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\operatorname* { m i n } _ { \mathbf { \pi } \in U ( \mu , \nu ) , t } \quad t , \quad \mathrm { s . t . } \quad \langle \mathbf { \Pi } \Pi , C _ { \ell } \rangle \leq t , \ell = 1 , 2 , \ldots , L .
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
This optimization can be easily solved using an off-the-shelf LP package. However, the computational cost of this LP problem is high in general (i.e., $O ( n ^ { 3 } ) , n = { \dot { m } }$ ).
|
| 192 |
+
|
| 193 |
+
# 3.3 APPLICATION: SEMANTIC CORRESPONDENCE
|
| 194 |
+
|
| 195 |
+
We applied our proposed FROT algorithm to semantic correspondence. The semantic correspondence is a problem that determines the matching of objects in two images. That is, given input image pairs $( A , B )$ , with common objects, we formulated the semantic correspondence problem to estimate the transport plan from the key points in $A$ to those in $B$ ; this framework was proposed in (Liu et al., 2020). In Figure 2, we show an overview of our proposed framework.
|
| 196 |
+
|
| 197 |
+
Cost matrix computation $C _ { \ell }$ : In our framework, we employed a pretrained convolutional neural network to extract dense feature maps for each convolutional layer. The dense feature map of the \`th layer output of the $s$ th image is given by
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { r } { \pmb { f } _ { s , q + ( r - 1 ) h _ { s } } ^ { ( \ell , s ) } \in \mathbb { R } ^ { d _ { \ell } } , q = 1 , 2 , \ldots , h _ { s } , r = 1 , 2 , \ldots , w _ { s } , \ell = 1 , 2 , \ldots , L , } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $w _ { s }$ and $h _ { s }$ are the width and height of the sth image, respectively, and $d _ { \ell }$ is the dimension of the \`th layer’s feature map. Note that because the dimension of the dense feature map is different for each layer, we sample feature maps to the size of the 1st layer’s feature map size (i.e., $h _ { s } \times w _ { s } )$ .
|
| 204 |
+
|
| 205 |
+
The $\ell$ th layer’s cost matrix for images $s$ and $s ^ { \prime }$ is given by
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
[ C _ { \ell } ] _ { i j } = \| f _ { i } ^ { ( \ell , s ) } - f _ { j } ^ { ( \ell , s ^ { \prime } ) } \| _ { 2 } ^ { 2 } , i = 1 , 2 , \ldots , w _ { s } h _ { s } , j = 1 , 2 , \ldots , w _ { s ^ { \prime } } h _ { s ^ { \prime } } .
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
A potential problem with FROT is that the estimation depends significantly on the magnitude of the cost of each layer (also known as a group). Hence, normalizing each cost matrix is important. Therefore, we normalized each feature vector by f (\`,s)i $\pmb { f } _ { i } ^ { ( \ell , s ) } ~ ~ \pmb { f } _ { i } ^ { ( \ell , s ) } / \| \pmb { f } _ { i } ^ { ( \ell , s ) } \| _ { 2 }$ . Consequently, the cost matrix is given by $\begin{array} { r l r } { [ { C _ { \ell } } ] _ { i j } } & { { } = } & { 2 \mathrm { ~ - ~ } } \end{array}$ $2 f _ { i } ^ { ( \ell , s ) } { } ^ { \top } f _ { j } ^ { ( \ell , s ^ { \prime } ) }$ >f (\`,s0). We can use distances such as the $L 1$ distance.
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 2: Semantic correspondence framework based on FROT.
|
| 215 |
+
|
| 216 |
+
# Computation of $^ { a }$ and $^ { b }$ with
|
| 217 |
+
|
| 218 |
+
staircase re-weighting: For semantic correspondence, setting $\pmb { a } \in \mathbb { R } ^ { h _ { s } w _ { s } }$ and $\pmb { b } \in \mathbb { R } ^ { h _ { s ^ { \prime } } w _ { s ^ { \prime } } }$ is important because semantic correspondence can be affected by background clutter. Therefore, we generated the class activation maps (Zhou et al., 2016) for the source and target images and used them as $\textbf { \em a }$ and $^ { b }$ , respectively. For CAM, we chose the class with the highest classification probability and normalized it to the range $[ 0 , 1 ]$ .
|
| 219 |
+
|
| 220 |
+
# 4 RELATED WORK
|
| 221 |
+
|
| 222 |
+
OT algorithms: The Wasserstein distance can be determined by solving the OT problem. An advantage of the Wasserstein distance is its robustness to noise; moreover, we can obtain the transport plan, which is useful for many machine learning applications. To reduce the computation cost for the Wasserstein distance, the sliced Wasserstein distance is useful (Kolouri et al., 2016). Recently, a tree variant of the Wasserstein distance was proposed (Evans & Matsen, 2012; Le et al., 2019; Sato et al., 2020); the sliced Wasserstein distance is a special case of this algorithm.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 3: (a) Objective scores for LP, FW-EMD, and FW-Sinkhorn. (b) MSE between transport plan of LP and FW-EMD and that with LP and FW-Sinkhorn with different $\eta$ . (c) MSE between transport plan of LP and FW-Sinkhorn with different $\epsilon$ .
|
| 226 |
+
|
| 227 |
+
The approach most closely related to FROT is a robust variant of the Wasserstein distance, called the subspace robust Wasserstein distance (SRW) (Paty & Cuturi, 2019). SRW computes the OT problem in a discriminative subspace; this is possible by solving dimensionality-reduction problems. Owing to the robustness, SRW can successfully compute the Wasserstein distance from noisy data. The max–sliced Wasserstein distance (Deshpande et al., 2019) and its generalized counterpart (Kolouri et al., 2019) can also be regarded as subspace-robust Wasserstein methods. Note that SRW (Paty & Cuturi, 2019) is a min–max based approach, while the max–sliced Wasserstein distances (Deshpande et al., 2019; Kolouri et al., 2019) are max–min approaches. The FROT is a feature selection variant of the Wasserstein distance, whereas the subspace approaches are used for dimensionality reduction.
|
| 228 |
+
|
| 229 |
+
As a parallel work, a general minimax optimal transport problem called the robust Kantorovich problem (RKP) was recently proposed (Dhouib et al., 2020). RKP involves using a cutting-set method for a general minmax optimal transport problem that includes the FROT problem as a special case. The approaches are technically similar; however, our problem and that of Dhouib et al. (2020) are intrinsically different. Specifically, we aim to solve a high-dimensional OT problem using feature selection and apply it to semantic correspondence problems, while the RKP approach focuses on providing a general framework and uses it for color transformation problems. As a technical difference, the cutting-set method may not converge to an optimal solution if we use the regularized OT (Dhouib et al., 2020). By contrast, because we use a Frank–Wolfe algorithm, our algorithm converges to a true objective function with regularized OT solvers. The multiobjective optimal transport (MOT) is an approach (Scetbon et al., 2020) parallel to ours. The key difference between FROT and MOT is that MOT tries to use the weighted sum of cost functions, while FROT considers the worst case. Moreover, as applications, we focus on the cost matrices computed from subsets of features, while MOT considers cost matrices with different distance functions.
|
| 230 |
+
|
| 231 |
+
# 5 EXPERIMENTS
|
| 232 |
+
|
| 233 |
+
# 5.1 SYNTHETIC DATA
|
| 234 |
+
|
| 235 |
+
We compare FROT with a standard OT using synthetic datasets. In these experiments, we initially generate two-dimensional vectors $\mathbf { \boldsymbol { x } } \sim N ( \mu _ { x } , \Sigma _ { x } )$ and $\pmb { y } \sim N ( \pmb { \mu } _ { y } , \pmb { \Sigma } _ { y } )$ . Here, we set $\mu _ { x } =$ $( - 5 , 0 ) ^ { \top }$ , $\mu _ { y } = ( 5 , 0 ) ^ { \top }$ , $\Sigma _ { x } = \Sigma _ { y } = ( ( 5 , 1 ) ^ { \top } , ( 4 , 1 ) ^ { \top } )$ . Then, we concatenate $z _ { x } \sim N ( 0 _ { 8 } , I _ { 8 } )$ and $z _ { y } \sim N ( 0 _ { 8 } , I _ { 8 } )$ to $_ { \textbf { \em x } }$ and $\textbf { { y } }$ , respectively, to give $\begin{array} { r } { \tilde { \pmb { x } } = ( \pmb { x } ^ { \top } , z _ { x } ^ { \top } ) } \end{array}$ , $\widetilde { \pmb y } = ( \pmb y ^ { \top } , z _ { y } ^ { \top } )$ .
|
| 236 |
+
|
| 237 |
+
For FROT, we set $\eta = 1 . 0$ and the number of iterations of the Frank–Wolfe algorithm as $T = 1 0$ . The regularization parameter is set to $\epsilon = 0 . 0 2$ for all methods. To show the proof-of-concept, we set the true features as a group and the remaining noise features as another group.
|
| 238 |
+
|
| 239 |
+
Fig. 1a shows the correspondence from $_ { \textbf { \em x } }$ and $\textbf { { y } }$ with the vanilla OT algorithm. Figs. 1b and 1c show the correspondence of FROT and OT with $\widetilde { \pmb x }$ and $\widetilde { \pmb { y } }$ , respectively. Although FROT can identify a suitable matching, the OT fails to obtain a significant correspondence. We observed that the $_ \alpha$ parameter corresponding to a true group is $\alpha _ { 1 } = 0 . 9 9 9 9$ . Moreover, we compared the objective scores of the FROT with LP, FW-EMD, and FW-Sinkhorn $\epsilon = 0 . 1$ ). Figure 3a shows the objective scores of FROTs with the different solvers, and both FW-EMD and FW-Sinkhorn can achieve almost the same objective score with a relatively small $\eta$ . Moreover, Figure 3b shows the mean squared error between the LP method and the FW counterparts. Similar to the objective score cases, it can yield a similar transport plan with a relatively small $\eta$ . Finally, we evaluated the FW-Sinkhorn by changing the regularization parameter $\eta$ . In this experiment, we set $\eta = 1$ and varied the $\epsilon$ values. The result shows that we can obtain an accurate transport plan with a relatively small $\epsilon$ .
|
| 240 |
+
|
| 241 |
+
Table 1: Per-class PCK $\dot { \alpha } _ { b b o x } = 0 . 1 \dot { } \mathrm { ~ , ~ }$ ) results using SPair-71k. All models use ResNet101. The numbers in the bracket of SRW are the input layer indicies.
|
| 242 |
+
|
| 243 |
+
<table><tr><td>Methods</td><td></td><td>aero 23.4</td><td>bike</td><td>bird</td><td>boat</td><td>bottle</td><td>bus</td><td>car</td><td>cat</td><td>chair</td><td>cow</td><td>dog</td><td>horse</td><td>moto</td><td>person</td><td>plant</td><td>sheep</td><td>train</td><td>tv</td><td>all</td></tr><tr><td>SPair-71k</td><td>CNNGeo (Rocco et al., 2017)</td><td></td><td>16.7</td><td>40.2</td><td>14.3</td><td>36.4</td><td>27.7</td><td>26.0</td><td>32.7</td><td>12.7</td><td>27.4</td><td>22.8</td><td>13.7</td><td>20.9</td><td>21.0</td><td>17.5</td><td>10.2</td><td>30.8</td><td>34.1</td><td>20.6</td></tr><tr><td>finetuned</td><td>A2Net (Hongsuck Seo et al.,2018)</td><td>22.6</td><td>18.5</td><td>42.0</td><td>16.4</td><td>37.9</td><td>30.8</td><td>26.5</td><td>35.6</td><td>13.3</td><td>29.6</td><td>24.3</td><td>16.0</td><td>21.6</td><td>22.8</td><td>20.5</td><td>13.5</td><td>31.4</td><td>36.5</td><td>22.3</td></tr><tr><td>models</td><td>WeakAlign (Rocco et al.,2018a)</td><td>22.2</td><td>17.6</td><td>41.9</td><td>15.1</td><td>38.1</td><td>27.4</td><td>27.2</td><td>31.8</td><td>12.8</td><td>26.8</td><td>22.6</td><td>14.2</td><td>20.0</td><td>22.2</td><td>17.9</td><td>10.4</td><td>32.2</td><td>35.1</td><td>20.9</td></tr><tr><td></td><td>NC-Net (Rocco et al.,2018b)</td><td>17.9</td><td>12.2</td><td>32.1</td><td>11.7</td><td>29.0</td><td>19.9</td><td>16.1</td><td>39.2</td><td>9.9</td><td>23.9</td><td>18.8</td><td>15.7</td><td>17.4</td><td>15.9</td><td>14.8</td><td>9.6</td><td>24.2</td><td>31.1</td><td>20.1</td></tr><tr><td>SPair-71k</td><td>HPF(Minetal.,2019a)</td><td>25.2</td><td>18.9</td><td>52.1</td><td>15.7</td><td>38.0</td><td>22.8</td><td>19.1</td><td>52.9</td><td>17.9</td><td>33.0</td><td>32.8</td><td>20.6</td><td>24.4</td><td>27.9</td><td>21.1</td><td>15.9</td><td>31.5</td><td>35.6</td><td>28.2</td></tr><tr><td>validation</td><td>OT-HPF(Liu et al.,2020)</td><td>32.6</td><td>18.9</td><td>62.5</td><td>20.7</td><td>42.0</td><td>26.1</td><td>20.4</td><td>61.4</td><td>19.7</td><td>41.3</td><td>41.7</td><td>29.8</td><td>29.6</td><td>31.8</td><td>25.0</td><td>23.5</td><td>44.7</td><td>37.0</td><td>33.9</td></tr><tr><td></td><td>FROT(n =0.2,ε=0.4)</td><td>35.1</td><td>20.3</td><td>59.8</td><td>21.1</td><td>42.9</td><td>27.7</td><td>21.2</td><td>63.5</td><td>18.8</td><td>39.7</td><td>37.9</td><td>29.2</td><td>28.8</td><td>29.9</td><td>28.2</td><td>24.3</td><td>52.1</td><td>39.5</td><td>34.7</td></tr><tr><td>OT</td><td></td><td>30.1</td><td>16.5</td><td>50.4</td><td>17.3</td><td>38.0</td><td>22.9</td><td>19.7</td><td>54.3</td><td>17.0</td><td>28.4</td><td>31.3</td><td>22.1</td><td>28.0</td><td>19.5</td><td>21.0</td><td>17.8</td><td>42.6</td><td>28.8</td><td>28.3</td></tr><tr><td></td><td>FROT (n = 0.3,T =3)</td><td>35.0</td><td>20.9</td><td>56.3</td><td>23.4</td><td>40.7</td><td>27.2</td><td>21.9</td><td>62.0</td><td>17.5</td><td>38.8</td><td>36.2</td><td>27.9</td><td>28.0</td><td>30.4</td><td>26.9</td><td>23.1</td><td>49.7</td><td>38.4</td><td>33.7</td></tr><tr><td>Without SPair-71k</td><td>FROT(n=( 0.3,T=10)</td><td>34.9</td><td>20.9</td><td>56.4</td><td>23.4</td><td>40.7</td><td>27.2</td><td>22.0</td><td>62.0</td><td>17.5</td><td>38.8</td><td>36.2</td><td>27.8</td><td>28.2</td><td>30.2</td><td>26.9</td><td>22.9</td><td>49.7</td><td>38.5</td><td>33.7</td></tr><tr><td>validation</td><td>FROT (n =0.5,T = 3)</td><td>34.1</td><td>18.8</td><td>56.9</td><td>19.9</td><td>40.0</td><td>25.6</td><td>19.2</td><td>61.9</td><td>17.4</td><td>38.7</td><td>36.5</td><td>25.6</td><td>26.9</td><td>27.2</td><td>26.3</td><td>22.1</td><td>50.3</td><td>38.6</td><td>32.8</td></tr><tr><td></td><td>FROT (n =0.5,T=10)</td><td>34.0</td><td>18.9</td><td>57.0</td><td>19.9</td><td>40.0</td><td>25.6</td><td>19.2</td><td>61.9</td><td>17.3</td><td>38.8</td><td>36.5</td><td>25.6</td><td>26.8</td><td>27.4</td><td>26.4</td><td>22.1</td><td>50.3</td><td>38.8</td><td>32.8</td></tr><tr><td></td><td>FROT (n = 0.7,T =3)</td><td>33.4</td><td>19.4</td><td>56.6</td><td>20.0</td><td>39.6</td><td>26.1</td><td>19.1</td><td>62.4</td><td>17.9</td><td>38.0</td><td>36.5</td><td>26.0</td><td>27.5</td><td>26.5</td><td>25.5</td><td>21.6</td><td>49.7</td><td>38.9</td><td>32.7</td></tr><tr><td>FROT(n=0.7,T=10)</td><td></td><td>33.3</td><td>19.5</td><td>56.6</td><td>19.9</td><td>39.5</td><td>26.0</td><td>19.1</td><td>62.4</td><td>17.9</td><td>38.0</td><td>36.5 26.0</td><td></td><td>27.4</td><td>26.5</td><td>25.6</td><td>21.6</td><td>49.6</td><td>38.9</td><td>32.7</td></tr><tr><td></td><td></td><td>29.4</td><td>14.0</td><td>43.7</td><td>15.6</td><td>33.8</td><td>21.0</td><td>17.6</td><td>48.0</td><td>12.9</td><td>23.3</td><td>26.5</td><td>19.8</td><td>25.5</td><td></td><td>16.7</td><td></td><td>37.1</td><td></td><td>24.5</td></tr><tr><td>SRW(layers={1.31-34)</td><td>SRW(layers={1,32-34)</td><td>29.7</td><td>14.3</td><td>44.3</td><td>15.7</td><td>34.2</td><td>21.3</td><td>17.8</td><td>48.5</td><td>13.1</td><td>23.6</td><td>27.1</td><td>20.0</td><td>25.8</td><td>17.6 18.1</td><td>16.9</td><td>15.2 15.2</td><td>37.3</td><td>20.5 21.0</td><td>24.8</td></tr><tr><td>SRW (layers={1,30-34})</td><td></td><td>29.8</td><td>14.7</td><td>45.6</td><td>15.9</td><td>34.8</td><td>21.5</td><td>18.0</td><td>49.3</td><td>13.3</td><td>24.0</td><td>27.7</td><td>20.6</td><td>25.7</td><td>18.7</td><td>17.2</td><td>15.3</td><td>37.7</td><td>21.5</td><td>25.2</td></tr><tr><td></td><td></td><td>32.3</td><td>15.7</td><td>43.1</td><td>18.4</td><td>30.7</td><td>22.5</td><td></td><td>44.5</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>15.3</td><td>37.4</td><td>18.0</td><td>24.3</td></tr><tr><td></td><td>FROT(layers={1,32-34)</td><td></td><td></td><td></td><td>20.5</td><td></td><td>25.0</td><td>20.6</td><td>48.1</td><td>10.3 11.4</td><td>23.1 25.9</td><td>23.9 26.9</td><td>19.5 22.4</td><td>23.6 25.2</td><td>22.0 25.0</td><td>14.7 16.5</td><td>17.1</td><td>40.5</td><td>21.2</td><td>26.6</td></tr><tr><td>FROT (layers =</td><td>{1,31-34})</td><td>35.3 36.7</td><td>16.5</td><td>45.3</td><td></td><td>33.0</td><td></td><td>21.6</td><td></td><td></td><td></td><td></td><td></td><td>26.4</td><td>27.3</td><td>19.5</td><td>18.1</td><td>43.4</td><td>24.9</td><td>28.8</td></tr><tr><td></td><td>FROT(layers= {1,30-34})</td><td></td><td>18.1</td><td>48.8</td><td>22.3</td><td>34.5</td><td>27.5</td><td>23.0</td><td>51.3</td><td>12.9</td><td>28.4</td><td>30.3</td><td>24.2</td></table>
|
| 244 |
+
|
| 245 |
+
# 5.2 SEMANTIC CORRESPONDENCE
|
| 246 |
+
|
| 247 |
+
We evaluated our FROT algorithm for semantic correspondence. In this study, we used the SPair71k (Min et al., 2019b). The SPair-71k dataset consists of 70, 958 image pairs with variations in viewpoint and scale. For evaluation, we employed a percentage of accurate key points (PCK), which counts the number of accurately predicted key points given a fixed threshold (Min et al., 2019b). All semantic correspondence experiments were run on a Linux server with NVIDIA P100.
|
| 248 |
+
|
| 249 |
+
For the optimal transport based frameworks, we employed ResNet101 (He et al., 2016) pretrained on ImageNet (Deng et al., 2009) for feature and activation map extraction. The ResNet101 consists of 34 convolutional layers and the entire number of features is $d = 3 2$ , 576. Note that we did not fine-tune the network. We compared the proposed method with several baselines (Min et al., 2019b) and the SRW1. Owing to the computational cost and the required memory size for SRW, we used the first and the last few convolutional layers of ResNet101 as the input of SRW. In our experiments, we empirically set $T = 3$ and $\epsilon = 0 . 1$ for FROT and SRW, respectively. For SRW, we set the number of latent dimension as $k = 5 0$ for all experiments. HPF (Min et al., 2019a) and OT-HPF (Liu et al., 2020) are state-of-the-art methods for semantic correspondence. HPF and OT-HPF required the validation dataset to select important layers, whereas SRW and FROT did not require the validation dataset. OT is a simple optimal transport-based method that does not select layers.
|
| 250 |
+
|
| 251 |
+
Table 1 lists the per-class PCK results obtained using the SPair-71k dataset. FROT $\eta = 0 . 3 )$ ) outperforms most existing baselines, including HPF and OT. Moreover, FROT ( $\eta = 0 . 3$ ) is consistent with OT-HPF (Liu et al., 2020), which requires the validation dataset to select important layers. In this experiment, setting $\eta < 1$ results in favorable performance (See Table 3 in the Appendix). The computational costs of FROT is 0.29, while SRWs are 8.73, 11.73, 15.76, respectively. Surprisingly, FROT outperformed SRWs. However, this is mainly due to the used input layers. Therefore, scaling up SRW would be an interesting future work.
|
| 252 |
+
|
| 253 |
+
We further evaluated FROT by tuning hyperparameters $\eta$ and $\epsilon$ using validation sets, where the maximum search ranges for $\eta$ and $\epsilon$ are set to 0.2 to 2.0 and 0.1 to 0.6 with intervals of 0.1, respectively. Figure 6 in Appendix shows the average PCK scores for $( \eta , \epsilon )$ pairs on the validation split of SPair71k. By using hyperparameter search, we selected $\eta = 0 . 2 , \epsilon = 0 . 4 ,$ ) as an optimal parameter. The FROT with optimal parameters outperforms the state-of-the-art method (Liu et al., 2020).
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 4: Feature selection results. We average over 50 runs of accuracy (on test set) of SVM trained with top $\mathbf { k }$ features selected by several methods.
|
| 257 |
+
|
| 258 |
+
# 5.3 FEATURE SELECTION EXPERIMENTS
|
| 259 |
+
|
| 260 |
+
Since FROT finds the transport plan and discriminative features between $\boldsymbol { X }$ and $\mathbf { Y }$ , we can use FROT as a feature-selection method. We considered $\pmb { X } \in \mathbb { R } ^ { d \times n }$ and $\pmb { Y } \in \mathbb { R } ^ { d \times m }$ as sets of samples from classes 1 and 2, respectively. The optimal important feature is given by
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\widehat { \alpha } _ { \ell } = \frac { \exp \left( \frac { 1 } { \eta } \langle \widehat { \mathbf { I } } , C _ { \ell } \rangle \right) } { \sum _ { \ell ^ { \prime } = 1 } ^ { d } \exp \left( \frac { 1 } { \eta } \langle \widehat { \mathbf { I } } , C _ { \ell ^ { \prime } } \rangle \right) } , \ \mathrm { w i t h } \ \widehat { \mathbf { I I } } = \underset { \mathbf { I } \in U ( \mu , \nu ) } { \arg \operatorname* { m i n } } \ \eta \log \left( \sum _ { \ell = 1 } ^ { d } \exp \left( \frac { 1 } { \eta } \langle \mathbf { I I } , C _ { \ell } \rangle \right) \right) ,
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where $[ C _ { \ell } ] _ { i j } = ( x _ { i } ^ { ( \ell ) } - y _ { j } ^ { ( \ell ) } ) ^ { 2 }$ y(\`)j )2. Finally, we selected the top K features by the ranking αb. Hence, α changes to a one-hot vector for a small $\eta$ and to $\begin{array} { r } { \alpha _ { k } \approx \frac { 1 } { L } } \end{array}$ for a large $\eta$ .
|
| 267 |
+
|
| 268 |
+
Here, we compared FROT with several baseline algorithms in terms of solving feature-selection problems. In this study, we employed a high-dimensional and a few sample datasets with two class classification tasks (see Table 2). All feature selection experiments were run on a Linux server with an Intel Xeon CPU E7-8890 v4 with $2 . 2 0 \mathrm { G H z }$ and 2 TB RAM.
|
| 269 |
+
|
| 270 |
+
In our experiments, we initially randomly split the data into two sets $7 5 \%$ for training and $2 5 \%$ for testing) and used the training set for feature selection and building a classifier. Note that we standardized each feature using the training set. Then, we used the remaining set for the test. The trial was repeated 50 times, and we considered the averaged classification accuracy for all trials. Considered as baseline methods, we computed the Wasserstein distance, maximum mean discrepancy (MMD) (Gretton et al., 2007), and linear correlation2 for each dimension and sorted them in descending order. Note that the Wasserstein distance is computed via sorting, which is computationally more efficient than the Sinkhorn algorithm when $d = 1$ . Then, we selected the top $K$ features as important features. For FROT, we computed the feature importance and selected the features that had significant importance scores. In our experiments, we set $\eta = 1 . 0$ and $T = 1 0$ . Then, we trained a two-class $\mathrm { S V M } ^ { 3 }$ with the selected features.
|
| 271 |
+
|
| 272 |
+
Fig. 4 shows the average classification accuracy relative to the number of selected features. From Figure 4, FROT is consistent with the Wasserstein distance-based feature selection and outperforms the linear correlation method and the MMD for two datasets. Table 2 shows the computational time(s) of the methods. FROT is about two orders of magnitude faster than the Wasserstein distance and is also faster than MMD. Note that although MMD is as fast as the proposed method, it cannot determine the correspondence between samples.
|
| 273 |
+
|
| 274 |
+
# 6 CONCLUSION
|
| 275 |
+
|
| 276 |
+
In this paper, we proposed FROT for high-dimensional data. This approach jointly solves feature selection and OT problems. An advantage of FROT is that it is a convex optimization problem and can determine an accurate globally optimal solution using the Frank–Wolfe algorithm. We used FROT for high-dimensional feature selection and semantic correspondence problems. Through extensive experiments, we demonstrated that the proposed algorithm is consistent with state-of-theart algorithms in both feature selection and semantic correspondence.
|
| 277 |
+
|
| 278 |
+
# REFERENCES
|
| 279 |
+
|
| 280 |
+
David Alvarez-Melis, Tommi Jaakkola, and Stefanie Jegelka. Structured optimal transport. In AISTATS, 2018.
|
| 281 |
+
|
| 282 |
+
David Alvarez-Melis, Youssef Mroueh, and Tommi S Jaakkola. Unsupervised hierarchy matching with optimal transport over hyperbolic spaces. AISTATS, 2020.
|
| 283 |
+
|
| 284 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks.´ In ICML, 2017.
|
| 285 |
+
|
| 286 |
+
Mathieu Blondel, Vivien Seguy, and Antoine Rolet. Smooth and sparse optimal transport. In AISTATS, 2018.
|
| 287 |
+
|
| 288 |
+
Charlotte Bunne, David Alvarez-Melis, Andreas Krause, and Stefanie Jegelka. Learning generative models across incomparable spaces. In ICML, 2019.
|
| 289 |
+
|
| 290 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NIPS, 2013.
|
| 291 |
+
|
| 292 |
+
Marco Cuturi and Arnaud Doucet. Fast computation of wasserstein barycenters. ICML, 2014.
|
| 293 |
+
|
| 294 |
+
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.
|
| 295 |
+
|
| 296 |
+
Ishan Deshpande, Yuan-Ting Hu, Ruoyu Sun, Ayis Pyrros, Nasir Siddiqui, Sanmi Koyejo, Zhizhen Zhao, David Forsyth, and Alexander G Schwing. Max-sliced Wasserstein distance and its use for GANs. In CVPR, 2019.
|
| 297 |
+
|
| 298 |
+
Sofien Dhouib, Ievgen Redko, Tanguy Kerdoncuff, Remi Emonet, and Marc Sebban. A swiss army ´ knife for minimax optimal transport. In ICML, 2020.
|
| 299 |
+
|
| 300 |
+
Steven N Evans and Frederick A Matsen. The phylogenetic kantorovich–rubinstein metric for environmental sequence samples. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(3):569–592, 2012.
|
| 301 |
+
|
| 302 |
+
Marguerite Frank and Philip Wolfe. An algorithm for quadratic programming. Naval research logistics quarterly, 3(1-2):95–110, 1956.
|
| 303 |
+
|
| 304 |
+
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.
|
| 305 |
+
|
| 306 |
+
Arthur. Gretton, Kenji. Fukumizu, C. Hui. Teo, Le. Song, Bernhard. Scholkopf, and Alex Smola. A ¨ kernel statistical test of independence. In NIPS, 2007.
|
| 307 |
+
|
| 308 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 309 |
+
|
| 310 |
+
Paul Hongsuck Seo, Jongmin Lee, Deunsol Jung, Bohyung Han, and Minsu Cho. Attentive semantic alignment with offset-aware correlation kernels. In ECCV, 2018.
|
| 311 |
+
|
| 312 |
+
Martin Jaggi. Revisiting frank-wolfe: Projection-free sparse convex optimization. In ICML, 2013.
|
| 313 |
+
|
| 314 |
+
Hicham Janati, Marco Cuturi, and Alexandre Gramfort. Wasserstein regularization for sparse multitask regression. In AISTATS, 2019.
|
| 315 |
+
|
| 316 |
+
Soheil Kolouri, Yang Zou, and Gustavo K Rohde. Sliced wasserstein kernels for probability distributions. In CVPR, 2016.
|
| 317 |
+
|
| 318 |
+
Soheil Kolouri, Kimia Nadjahi, Umut Simsekli, Roland Badeau, and Gustavo Rohde. Generalized sliced wasserstein distances. In NeurIPS, 2019.
|
| 319 |
+
|
| 320 |
+
Tam Le, Makoto Yamada, Kenji Fukumizu, and Marco Cuturi. Tree-sliced approximation of wasserstein distances. NeurIPS, 2019.
|
| 321 |
+
|
| 322 |
+
Yanbin Liu, Makoto Yamada, Yao-Hung Hubert Tsai, Tam Le, Ruslan Salakhutdinov, and Yi Yang. Lsmi-sinkhorn: Semi-supervised squared-loss mutual information estimation with optimal transport. arXiv preprint arXiv:1909.02373, 2019.
|
| 323 |
+
|
| 324 |
+
Yanbin Liu, Linchao Zhu, Makoto Yamada, and Yi Yang. Semantic correspondence as an optimal transport problem. In CVPR, 2020.
|
| 325 |
+
|
| 326 |
+
Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Hyperpixel flow: Semantic correspondence with multi-layer neural features. In ICCV, 2019a.
|
| 327 |
+
|
| 328 |
+
Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Spair-71k: A large-scale benchmark for semantic correspondence. arXiv preprint arXiv:1908.10543, 2019b.
|
| 329 |
+
|
| 330 |
+
Yu Nesterov. Smooth minimization of non-smooth functions. Mathematical programming, 103(1): 127–152, 2005.
|
| 331 |
+
|
| 332 |
+
Franc¸ois-Pierre Paty and Marco Cuturi. Subspace robust wasserstein distances. In ICML, 2019.
|
| 333 |
+
|
| 334 |
+
Franc¸ois-Pierre Paty and Marco Cuturi. Regularized optimal transport is ground cost adversarial. ICML, 2020.
|
| 335 |
+
|
| 336 |
+
Gabriel Peyre, Marco Cuturi, et al. Computational optimal transport. ´ Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 11(5-6):355–607, 2019.
|
| 337 |
+
|
| 338 |
+
Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Convolutional neural network architecture for geometric matching. In CVPR, 2017.
|
| 339 |
+
|
| 340 |
+
Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. End-to-end weakly-supervised semantic align- ´ ment. In CVPR, 2018a.
|
| 341 |
+
|
| 342 |
+
Ignacio Rocco, Mircea Cimpoi, Relja Arandjelovic, Akihiko Torii, Tomas Pajdla, and Josef Sivic. ´ Neighbourhood consensus networks. In NeurIPS, 2018b.
|
| 343 |
+
|
| 344 |
+
Yossi Rubner, Carlo Tomasi, and Leonidas J Guibas. The earth mover’s distance as a metric for image retrieval. International journal of computer vision, 40(2):99–121, 2000.
|
| 345 |
+
|
| 346 |
+
Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. SuperGlue: Learning feature matching with graph neural networks. arXiv preprint arXiv:1911.11763, 2019.
|
| 347 |
+
|
| 348 |
+
Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Fast unbalanced optimal transport on tree. In NeurIPS, 2020.
|
| 349 |
+
|
| 350 |
+
Meyer Scetbon, Laurent Meunier, Jamal Atif, and Marco Cuturi. Handling multiple costs in optimal transport: Strong duality and efficient computation. arXiv preprint arXiv:2006.07260, 2020.
|
| 351 |
+
|
| 352 |
+
Hongteng Xu, Dixin Luo, and Lawrence Carin. Scalable gromov-wasserstein learning for graph partitioning and matching. arXiv preprint arXiv:1905.07645, 2019a.
|
| 353 |
+
|
| 354 |
+
Hongteng Xu, Dixin Luo, Hongyuan Zha, and Lawrence Carin Duke. Gromov-wasserstein learning for graph matching and node embedding. In ICML, 2019b.
|
| 355 |
+
|
| 356 |
+
Yuguang Yan, Wen Li, Hanrui Wu, Huaqing Min, Mingkui Tan, and Qingyao Wu. Semi-supervised optimal transport for heterogeneous domain adaptation. In IJCAI, 2018.
|
| 357 |
+
|
| 358 |
+
Ming Yuan and Yi Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006.
|
| 359 |
+
|
| 360 |
+
Mikhail Yurochkin, Sebastian Claici, Edward Chien, Farzaneh Mirzazadeh, and Justin M Solomon. Hierarchical optimal transport for document representation. In NeurIPS, 2019.
|
| 361 |
+
|
| 362 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, 2016.
|
| 363 |
+
|
| 364 |
+
# APPENDIX
|
| 365 |
+
|
| 366 |
+
# RELATED WORK
|
| 367 |
+
|
| 368 |
+
In addition to accelerating the computation, structured optimal transport incorporates structural information directly into OT problems (Alvarez-Melis et al., 2018). Specifically, they formulate the submodular optimal transport problem and solve the problem using a saddle-point mirror prox algorithm. Recently, more complex structured information was introduced in the OT problem, including the hierarchical structure (Alvarez-Melis et al., 2020; Yurochkin et al., 2019). These approaches successfully incorporate structured information into OT problems with respect to data samples. By contrast, FROT incorporates the structured information into features.
|
| 369 |
+
|
| 370 |
+
OT applications: OT has received significant attention for use in several computer vision tasks. Applications include Wasserstein distance estimation (Peyre et al., 2019), domain adaptation (Yan ´ et al., 2018), multitask learning (Janati et al., 2019), barycenter estimation (Cuturi & Doucet, 2014), semantic correspondence (Liu et al., 2020), feature matching (Sarlin et al., 2019), photo album summarization (Liu et al., 2019), generative model (Arjovsky et al., 2017; Bunne et al., 2019), graph matching (Xu et al., 2019a;b), and the semantic correspondence (Liu et al., 2020).
|
| 371 |
+
|
| 372 |
+
# PROOF OF PROPOSITION 1
|
| 373 |
+
|
| 374 |
+
For the distance function $d ( { \pmb x } , { \pmb y } )$ , we prove that
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\mathrm { F R W D } _ { p } ( \mu , \nu ) = ( \operatorname* { m i n } _ { \substack { \Pi \in U ( \mu , \nu ) } } \operatorname* { m a x } _ { \alpha \in \Sigma ^ { L } } \ \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } d ( x _ { i } ^ { ( \ell ) } , y _ { j } ^ { ( \ell ) } ) ^ { p } ) ^ { 1 / p }
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
is a distance for $p \geq 1$ .
|
| 381 |
+
|
| 382 |
+
The symmetry can be read directly from the definition as we used distances that are symmetric. For the identity of indiscernibles, when $\mathrm { F R W D } _ { p } ( \mu , \nu ) \ : = \ : 0$ with the optimal $_ \alpha$ and $\mathbf { I I }$ , there exists $\begin{array} { r } { \sum _ { i j } \pi _ { i j } \alpha _ { \ell } d ( \pmb { x } _ { i } ^ { ( \ell ) } , \pmb { y } _ { j } ^ { ( \ell ) } ) ^ { p } = 0 } \end{array}$ $\ell$ such that $\alpha _ { \ell } \ > \ 0$ (as , this means that $_ { \pmb { \alpha } }$ is in the simplex set). As there is a max in the definition and $\begin{array} { r } { \forall \ell , \sum _ { i j } \pi _ { i j } d ( \pmb { x } _ { i } ^ { ( \ell ) } , \pmb { y } _ { j } ^ { ( \ell ) } ) ^ { p } = 0 } \end{array}$ and $\forall \ell , \mu ^ { ( \ell ) } = \nu ^ { ( \ell ) }$ Therefore, we have $\mu = \nu$ when $\mathrm { F R W D } _ { p } ( \mu , \nu ) = 0$ .
|
| 383 |
+
|
| 384 |
+
When $\mu = \nu$ , this means that $\mathbf { \Delta } \mathbf { x } _ { i } = \mathbf { \Delta } \mathbf { y } _ { i }$ , $a _ { i } = b _ { i } , \forall i$ , and $n = m$ , and we have $d ( { \pmb x } _ { i } , { \pmb y } _ { j } ) = 0$ for $i = j$ . Thus, for any $\alpha _ { \ell } \geq 0$ , the optimal transport plan is $\pi _ { i i } > 0$ for $d ( { \pmb x } _ { i } , { \pmb y } _ { j } ) = 0$ and $\pi _ { i j } = 0$ for $d ( { \pmb x } _ { i } , { \pmb y } _ { j } ) > 0$ . Therefore, when $\mu = \nu$ , we have $\mathrm { F R W D } _ { p } ( \mu , \nu ) = 0$ .
|
| 385 |
+
|
| 386 |
+
TRIANGLE INEQUALITY
|
| 387 |
+
|
| 388 |
+
Let $\textstyle \mu = \sum _ { i = 1 } ^ { n } a _ { i } \delta _ { { \pmb x } _ { i } }$ , $\begin{array} { r } { \nu = \sum _ { j = 1 } ^ { m } b _ { j } \delta _ { { \bf y } _ { j } } } \end{array}$ , $\begin{array} { r } { \gamma = \sum _ { k = 1 } ^ { u } c _ { k } \delta _ { z _ { k } } } \end{array}$ and ${ \pmb { \alpha } } \in \pmb { \Sigma } ^ { L }$ , we prove that
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\mathrm { F R W D } _ { p } ( \mu , \gamma ) \leq \mathrm { F R W D } _ { p } ( \mu , \nu ) + \mathrm { F R W D } _ { p } ( \nu , \gamma ) .
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
To simplify the notations in this proof, we define $\pmb { D } _ { \ell }$ as the distance ”matrix” such that $[ D _ { \ell } ] _ { i j } =$ $d ( \pmb { x } _ { i } ^ { ( \ell ) } , \pmb { y } _ { j } ^ { ( \ell ) } )$ is the ith-row and $j$ th-column element of the matrix $\pmb { D } _ { \ell }$ , $[ \pmb { { \cal D } } \ell ] _ { j k } = d ( \pmb { { y } } _ { j } ^ { ( \ell ) } , \pmb { { z } } _ { k } ^ { ( \ell ) } )$ , and $[ { \cal D } _ { \ell } ] _ { i k } = d ( { \pmb x } _ { i } ^ { ( \ell ) } , z _ { k } ^ { ( \ell ) } )$ z(\`)k ). Moreover, note that Dp\` is the ”matrix,” where each element is an element of $\pmb { D } _ { \ell }$ raised to the power $p$ .
|
| 395 |
+
|
| 396 |
+
Consider that $P \in U ( \mu , \nu )$ is the optimal transport plan of $\mathrm { F R W D } _ { p } ( \mu , \nu )$ , and $\pmb { Q } \in \pmb { U } ( \nu , \gamma )$ is the optimal transport plan of $\mathrm { F R W D } _ { p } ( \nu , \gamma )$ , where $\begin{array} { r } { \gamma = \sum _ { k = 1 } ^ { r } c _ { i } \delta _ { z _ { i } } } \end{array}$ is a discrete measure. Similar to the proof for the Wasserstein distance in (Peyre et al., 2019), let ´ $S = P \mathrm { d i a g } ( 1 / \widetilde { b } ) Q$ with $\widetilde { b }$ be a vector such that $\widetilde { b } _ { j } = b _ { j }$ if $b _ { j } > 0$ , and $b _ { j } = 1$ otherwise. We can show that $\pmb { S } \in \pmb { U } ( \mu , \gamma )$ .
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\begin{array} { r l } { \displaystyle \sum _ { \ell = \pmb { U } ( \mu , \gamma ) } \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \langle \pmb { R } , \pmb { D } _ { \ell } ^ { p } \rangle \bigg ) ^ { \frac { 1 } { p } } \leq \bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \langle \pmb { S } , \pmb { D } _ { \ell } ^ { p } \rangle \bigg ) ^ { \frac { 1 } { p } } = \bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i k } S _ { i k } [ \pmb { D } _ { \ell } ] _ { i k } ^ { p } \bigg ) ^ { \frac { 1 } { p } } } & { } \\ { \leq \bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i k } [ \pmb { D } _ { \ell } ] _ { i k } ^ { p } \displaystyle \sum _ { j } \frac { p _ { i j } q _ { j k } } { \widetilde { b } _ { j } } \bigg ) ^ { \frac { 1 } { p } } = \bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j k } [ \pmb { D } _ { \ell } ] _ { i k } ^ { p } \displaystyle \frac { p _ { i j } q _ { j k } } { \widetilde { b } _ { j } } \bigg ) ^ { \frac { 1 } { p } } } & { } \\ { \leq \bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j k } ( [ \pmb { D } _ { \ell } ] _ { i j } + [ \pmb { D } _ { \ell } ] _ { j k } ) ^ { p } \displaystyle \frac { p _ { i j } q _ { j k } } { \widetilde { b } _ { j } } \bigg ) ^ { \frac { 1 } { p } } } & { } \end{array}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
By letting $g _ { i j k \ell } = [ D _ { \ell } ] _ { i j } ( \alpha _ { \ell } p _ { i j } q _ { j k } / \widetilde { b } _ { j } ) ^ { 1 / p }$ and $h _ { i j k \ell } = [ D _ { \ell } ] _ { i j } ( \alpha _ { \ell } p _ { i j } q _ { j k } / \widetilde { b } _ { j } ) ^ { 1 / p }$ , the right-hand side of this inequality can be rewritten as
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l } { \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j k } ( [ D _ { \ell } ] _ { i j } + [ D _ { \ell } ] _ { j k } ) ^ { p } \frac { p _ { i j } q _ { j k } } { \widetilde b _ { j } } \right) ^ { \frac { 1 } { p } } = \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \sum _ { i j k } ( g _ { i j k \ell } + h _ { i j k \ell } ) ^ { p } \right) ^ { \frac { 1 } { p } } } & { } \\ { \le \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \sum _ { i j k } g _ { i j k \ell } ^ { p } \right) ^ { \frac { 1 } { p } } + \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \sum _ { i j k } h _ { i j k \ell } ^ { p } \right) ^ { \frac { 1 } { p } } } & { } \\ { \le \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j k } [ D _ { \ell } ] _ { i j } ^ { p } \frac { p _ { i j } q _ { j k } } { \widetilde b _ { j } } \right) ^ { \frac { 1 } { p } } + \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j k } [ D _ { \ell } ] _ { j k } ^ { p } \frac { p _ { i j } } { \widetilde b _ { j } } \right) ^ { \frac { 1 } { p } } } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
by the Minkovski inequality.
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { r l } { \displaystyle \left( \displaystyle \operatorname* { m i n } _ { k \in U ( \{ \mu , \gamma \} ) } \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \langle R , D _ { \ell } ^ { p } \rangle \right) ^ { \frac { 1 } { p } } \leq \Bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j } [ D _ { \ell } ] _ { i j } ^ { p } p _ { i j } \sum _ { k } \frac { q _ { j k } } { b _ { j } } \Bigg ) ^ { \frac { 1 } { p } } + \Bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i k } [ D _ { \ell } ] _ { j k } ^ { p } q _ { j k } \sum _ { j } \frac { p _ { i j } } { \widetilde { b } _ { j } } } & { } \\ { \leq \Bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j } [ D _ { \ell } ] _ { i j } ^ { p } p _ { i j } \Bigg ) ^ { \frac { 1 } { p } } + \Bigg ( \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i k } [ D _ { \ell } ] _ { j k } ^ { p } q _ { j k } \Bigg ) ^ { \frac { 1 } { p } } } & { } \\ { \leq \Bigg ( \displaystyle \operatorname* { m a x } _ { \ell \leq 1 } \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i j } [ D _ { \ell } ] _ { i j } ^ { p } p _ { i j } \Bigg ) ^ { \frac { 1 } { p } } + \Bigg ( \displaystyle \operatorname* { m a x } _ { \ell \leq 2 ^ { L } } \displaystyle \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \displaystyle \sum _ { i k } [ D _ { \ell } ] _ { j k } ^ { p } q _ { j k } \Bigg ) ^ { \frac { 1 } { p } } } & { } \\ { \leq \Bigg ( \displaystyle \operatorname* { R W D } _ { p } \{ \mu , \nu \} + \mathrm { F R W D } _ { p } \{ \nu , \gamma \} \Bigg ) } & { } \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
This inequality is valid for all $\alpha$ . Therefore, we have
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\mathrm { F R W D } _ { p } ( \mu , \nu ) \le \mathrm { F R W D } _ { p } ( \mu , \nu ) + \mathrm { F R W D } _ { p } ( \nu , \gamma )
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
# FROT WITH LINEAR PROGRAMMING
|
| 421 |
+
|
| 422 |
+
Linear Programming: The FROT is a convex piecewise-linear minimization because the objective is the max of linear functions. Thus, we can solve the FROT problem via linear programming:
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\operatorname* { m i n } _ { \mathbf { \pi } \in U ( \mu , \nu ) , t } \quad t , \quad \mathrm { s . t . } \quad \langle \mathbf { \Pi } \Pi , C _ { \ell } \rangle \leq t , \ell = 1 , 2 , \ldots , L .
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
This optimization can be easily solved using an off-the-shelf LP package. However, the computational cost of this LP problem is high in general (i.e., $O ( n ^ { 3 } ) , n = { \dot { m } }$ ).
|
| 429 |
+
|
| 430 |
+
The FROT problem can be written as
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\begin{array} { r l } { \underset { \mathbf { \Pi } } { \operatorname* { m i n } } } & { \underset { \ell \in \{ 1 , 2 , \ldots , L \} } { \operatorname* { m a x } } \langle \mathbf { \Pi } \mathbf { \Pi } , C _ { \ell } \rangle , } \\ { \mathrm { s . t . } } & { \mathbf { \Pi } \mathbf { H } \mathbf { 1 } _ { m } = \pmb { a } , \mathbf { \Pi } \mathbf { \Pi } ^ { \top } \mathbf { 1 } _ { n } = b , \mathbf { \Pi } \mathbf { \Pi } \geq 0 . } \end{array}
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
This problem can be transformed to an equivalent linear program by first forming an epigraph problem:
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
\begin{array} { r l } & { \underset { \boldsymbol { \Pi } , t } { \operatorname* { m i n } } \quad t , } \\ & { \mathrm { ~ s . t . ~ } \quad \underset { \ell \in \{ 1 , 2 , \ldots , L \} } { \operatorname* { m a x } } \langle \boldsymbol { \Pi } , C _ { \ell } \rangle \leq t } \\ & { \quad \quad \Pi \mathbf { 1 } _ { m } = \pmb { a } , \boldsymbol { \Pi } ^ { \top } \mathbf { 1 } _ { n } = b , \boldsymbol { \Pi } \geq 0 . } \end{array}
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
Thus, the linear programming for FROT is given as
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
\begin{array} { r l } { \underset { \mathbf { \Pi } \mathbf { \Pi } , t } { \operatorname* { m i n } } } & { t } \\ { \mathrm { s . t . } } & { \langle \mathbf { \Pi } \mathbf { \Pi } , C _ { \ell } \rangle \leq t , \ell = 1 , 2 , \ldots , L } \\ & { \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } _ { m } = \pmb { a } , \mathbf { \Pi } \mathbf { \Pi } ^ { \top } \mathbf { 1 } _ { n } = b , \mathbf { \Pi } \mathbf { \Pi } \geq 0 . } \end{array}
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
Next, we transform this linear programming problem into the canonical form. For matrix ${ \textbf { I } } =$ $( \pmb { \pi } _ { 1 } \pmb { \pi } _ { 2 } \dots \pmb { \pi } _ { n } ) ^ { \top } \in \mathbb { R } ^ { n \times m }$ and $\pi _ { i } \in \mathbb { R } ^ { n }$ , we can vectorize the matrix using the following linewise operator:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\begin{array} { r } { \mathrm { v e c } ( \mathbf { I I } ) = ( \pmb { \pi } _ { 1 } ^ { \top } \pmb { \pi } _ { 2 } ^ { \top } \dots \pmb { \pi } _ { n } ^ { \top } ) ^ { \top } \in \mathbb { R } ^ { n m } . } \end{array}
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
Using this vectorization operator, we can write $\langle \Pi , C _ { \ell } \rangle \leq t$ as
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
\left( \begin{array} { c c } { \mathrm { v e c } ( C _ { 1 } ) ^ { \top } } & { - 1 } \\ { \mathrm { v e c } ( C _ { 2 } ) ^ { \top } } & { - 1 } \\ { \vdots } & { \vdots } \\ { \mathrm { v e c } ( C _ { L } ) ^ { \top } } & { - 1 } \end{array} \right) \left( \begin{array} { c } { \mathrm { v e c } ( { \bf { I I } } ) } \\ { t } \end{array} \right) \leq { \bf { 0 } } _ { L } ,
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
where $\mathbf { 0 } _ { L } \in \mathbb { R } ^ { L }$ is a vector whose elements are zero.
|
| 461 |
+
|
| 462 |
+
For the constraints ${ \pmb { \Pi } } { \bf 1 } _ { m } = { \pmb a }$ and $\mathbf { I I } ^ { \top } \mathbf { 1 } _ { n } = \boldsymbol { b }$ , we can define vectors $\ b { q } _ { 1 } , \dots , \ b { q } _ { n } \in \mathbb { R } ^ { n m }$ and $r _ { 1 } , \hdots , r _ { m } \in \mathbb { R } ^ { n m }$ such that $\pmb q _ { i } ^ { \top } \mathrm { v e c } ( { \pmb \Pi } ) = { \pmb a } _ { i }$ and $r _ { j } ^ { \top } \mathrm { v e c } ( \mathbf { I I } ) = b _ { j }$ in this way:
|
| 463 |
+
|
| 464 |
+
$$
|
| 465 |
+
\begin{array} { r l r } & { } & { \pmb { q } _ { 1 } = ( \mathbf { 1 } _ { m } ^ { \top } , \mathbf { 0 } _ { m } ^ { \top } , \ldots , \mathbf { 0 } _ { m } ^ { \top } ) ^ { \top } , } \\ & { } & { \quad \pmb { q } _ { 2 } = ( \mathbf { 0 } _ { m } ^ { \top } , \mathbf { 1 } _ { m } ^ { \top } , \ldots , \mathbf { 0 } _ { m } ^ { \top } ) ^ { \top } , } \\ & { } & { \quad \vdots } \\ & { } & { \quad \quad \quad \quad \quad \quad \quad \mathbf { q } _ { n } = ( \mathbf { 0 } _ { m } ^ { \top } , \mathbf { 0 } _ { m } ^ { \top } , \ldots , \mathbf { 1 } _ { m } ^ { \top } ) ^ { \top } } \end{array}
|
| 466 |
+
$$
|
| 467 |
+
|
| 468 |
+
and
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
\begin{array} { r l } & { \quad r _ { 1 } = ( 1 , \mathbf { 0 } _ { m - 1 } ^ { \top } , 1 , \mathbf { 0 } _ { m - 1 } ^ { \top } , \ldots , 1 , \mathbf { 0 } _ { m - 1 } ^ { \top } ) ^ { \top } , } \\ & { \quad r _ { 2 } = ( 0 , 1 , \mathbf { 0 } _ { m - 1 } ^ { \top } , 1 , \mathbf { 0 } _ { m - 1 } ^ { \top } , \ldots , 1 , \mathbf { 0 } _ { m - 2 } ^ { \top } ) ^ { \top } , } \\ & { \quad \quad \vdots } \\ & { \quad r _ { m } = ( \mathbf { 0 } _ { m - 1 } ^ { \top } , 1 , \mathbf { 0 } _ { m - 1 } ^ { \top } , 1 , \ldots \mathbf { 0 } _ { m - 1 } ^ { \top } , 1 ) ^ { \top } } \end{array}
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
We can collect these vectors to obtain the vectorized constraints:
|
| 475 |
+
|
| 476 |
+
$$
|
| 477 |
+
\left( \begin{array} { c c } { q _ { 1 } ^ { \top } } & { 0 } \\ { q _ { 2 } ^ { \top } } & { 0 } \\ { \vdots } & { \vdots } \\ { q _ { n } ^ { \top } } & { 0 } \end{array} \right) \left( \begin{array} { c } { \mathrm { v e c } ( \mathbf { \Pi } ) } \\ { t } \end{array} \right) = a , \left( \begin{array} { c c } { r _ { 1 } ^ { \top } } & { 0 } \\ { r _ { 2 } ^ { \top } } & { 0 } \\ { \vdots } & { \vdots } \\ { r _ { m } ^ { \top } } & { 0 } \end{array} \right) \left( \begin{array} { c } { \mathrm { v e c } ( \mathbf { \Pi } \mathbf { I } ) } \\ { t } \end{array} \right) = b ,
|
| 478 |
+
$$
|
| 479 |
+
|
| 480 |
+
Thus, we can rewrite the linear programming as
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\begin{array} { r l } { \underset { u } { \operatorname* { m i n } } } & { e ^ { \top } u } \\ & { \mathrm { s . t . } \quad ( A ^ { \top } - \mathbf { 1 } _ { L } ) u \leq \mathbf { 0 } _ { L } , ( Q ^ { \top } \mathbf { 0 } _ { n } ) u = a , ( R ^ { \top } \mathbf { 0 } _ { m } ) u = b , u \geq 0 , } \end{array}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
where $\pmb { \mathscr { u } } = ( \mathrm { v e c } ( \mathbf { \Pi } \Pi ) ^ { \top } \mathbf { \Xi } t ) ^ { \top } \in \mathbb { R } ^ { n m + 1 }$ , $\boldsymbol { e } = ( \mathbf { 0 } _ { n m } ^ { \top } \mathbf { 1 } ) ^ { \top } \in \mathbb { R } ^ { n m + 1 }$ is the unit vector whose $n m + 1$ - th element is 1, $A = ( \operatorname { v e c } ( C _ { 1 } ) , \ldots , \operatorname { v e c } ( C _ { L } ) ) \ \in \ \mathbb { R } ^ { n m \times L }$ , $\pmb { Q } = ( \pmb { q } _ { 1 } , \dots , \pmb { q } _ { n } ) \in \mathbb { R } ^ { n m \times n }$ , and $\pmb { R } = ( \pmb { r } _ { 1 } , \dots , \pmb { r } _ { m } ) \in \mathbb { R } ^ { n m \times m }$ . $Q = \left( I _ { n } \ I _ { n } \ . . . \ I _ { n } \right)$
|
| 487 |
+
|
| 488 |
+
# PROOF OF LEMMA 2
|
| 489 |
+
|
| 490 |
+
We optimize the function with respect to $_ { \pmb { \alpha } }$ :
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\begin{array} { r l } { \underset { \boldsymbol { \alpha } } { \operatorname* { m a x } } } & { \boldsymbol { J } ( \boldsymbol { \alpha } ) } \\ { \mathrm { s . t . } } & { \boldsymbol { \alpha } ^ { \top } \mathbf { 1 } _ { K } = 1 , \alpha _ { 1 } , \ldots , \alpha _ { K } \ge 0 , } \end{array}
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
where
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
J ( \alpha ) = \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \phi _ { \ell } - \eta \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } ( \log \alpha _ { \ell } - 1 ) .
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
Because the entropic regularization is a strong convex function and its negative counterpart is a strong concave function, the maximization problem is a concave optimization problem.
|
| 503 |
+
|
| 504 |
+
We consider the following objective function with the Lagrange multiplier $\epsilon$ :
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
\widetilde { J } ( \alpha ) = \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \phi _ { \ell } - \eta \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } ( \log \alpha _ { \ell } - 1 ) + \epsilon ( \boldsymbol { \alpha } ^ { \top } \mathbf { 1 } _ { K } - 1 )
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
Note that owing to the entropic regularization, the nonnegative constraint is automatically satisfied.
|
| 511 |
+
|
| 512 |
+
Taking the derivative with respect to $\alpha _ { \ell }$ , we have
|
| 513 |
+
|
| 514 |
+
$$
|
| 515 |
+
\frac { \partial \widetilde { J } ( \alpha ) } { \partial \alpha _ { \ell } } = \phi _ { \ell } - \eta \left( \log \alpha _ { \ell } - 1 + \alpha _ { \ell } \frac { 1 } { \alpha _ { \ell } } \right) + \epsilon = 0 .
|
| 516 |
+
$$
|
| 517 |
+
|
| 518 |
+
Thus, the optimal $\alpha _ { \ell }$ has the form
|
| 519 |
+
|
| 520 |
+
$$
|
| 521 |
+
\alpha _ { \ell } = \exp \left( \frac { 1 } { \eta } \phi _ { \ell } \right) \exp \left( \frac { \epsilon } { \eta } \right) .
|
| 522 |
+
$$
|
| 523 |
+
|
| 524 |
+
$\alpha _ { \ell }$ satisfies the sum to one constraint.
|
| 525 |
+
|
| 526 |
+
$$
|
| 527 |
+
\exp \left( \frac { \epsilon } { \eta } \right) = \frac { 1 } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \phi _ { \ell ^ { \prime } } \right) }
|
| 528 |
+
$$
|
| 529 |
+
|
| 530 |
+
Hence, the optimal $\alpha _ { \ell }$ is given by
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\alpha _ { \ell } = \frac { \exp \left( \frac { 1 } { \eta } \phi _ { \ell } \right) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \phi _ { \ell ^ { \prime } } \right) } .
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
Substituting this into Eq.(8), we have
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
\begin{array} { l } { { \displaystyle { \cal I } ( \alpha ^ { * } ) = \sum _ { \ell = 1 } ^ { L } \frac { \exp \Big ( \frac 1 \eta \phi _ { \ell } \Big ) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \Big ( \frac 1 \eta \phi _ { \ell ^ { \prime } } \Big ) } \phi _ { \ell } - \eta \sum _ { \ell = 1 } ^ { L } \frac { \exp \Big ( \frac 1 \eta \phi _ { \ell } \Big ) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \Big ( \frac 1 \eta \phi _ { \ell ^ { \prime } } \Big ) } \left( \log \left( \frac { \exp \Big ( \frac 1 \eta \phi _ { \ell } \Big ) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \Big ( \frac 1 \eta \phi _ { \ell ^ { \prime } } \Big ) } \right) - 1 \right) } } \\ { { \displaystyle ~ = \eta \log \left( \sum _ { \ell = 1 } ^ { L } \exp \left( \frac 1 \eta \phi _ { \ell } \right) \right) + \eta } } \end{array}
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
Therefore, the final objective function is given by
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
J ( \alpha ^ { * } ) = \eta \log \left( \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \phi _ { \ell } \right) \right) + \eta
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
PROOF OF PROPOSITION 3
|
| 549 |
+
|
| 550 |
+
Proof: For $0 \leq \theta \leq 1$ and $\eta > 0$ , we have
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\begin{array} { r l } & { \displaystyle \sum _ { = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \theta \mathbf { T } _ { 1 } + ( 1 - \theta ) \mathbf { I } \mathbf { I } _ { 2 } , D _ { \ell } \rangle \right) = \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { \theta } { \eta } \langle \mathbf { { T } } _ { 1 } , D _ { \ell } \rangle + \frac { ( 1 - \theta ) } { \eta } \langle \mathbf { { T } } _ { 2 } , D _ { \ell } \rangle \right) } \\ & { \quad \quad \quad \quad = \displaystyle \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \mathbf { { T } } _ { 1 } , D _ { \ell } \rangle \right) ^ { \theta } \exp \left( \frac { 1 } { \eta } \langle \mathbf { { T } } _ { 2 } , D _ { \ell } \rangle \right) ^ { 1 - \theta } } \\ & { \quad \quad \quad \quad \leq \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \mathbf { I } _ { 1 } , D _ { \ell } \rangle \right) \right) ^ { \theta } \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \mathbf { T } _ { 2 } , D _ { \ell } \rangle \right) \right) ^ { 1 - \theta } } \end{array}
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
Here, we use Holder’s inequality with¨ $p = 1 / \theta$ , $q = 1 / ( 1 - \theta )$ , and $1 / p + 1 / q = 1$
|
| 557 |
+
|
| 558 |
+
Applying a logarithm on both sides of the equation and then premultiplying $\eta$ , we have
|
| 559 |
+
|
| 560 |
+
$$
|
| 561 |
+
\begin{array} { r l } & { \eta \log \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \theta \Pi _ { 1 } + ( 1 - \theta ) \Pi _ { 2 } , D _ { \ell } \rangle \right) \right) \leq \theta \eta \log \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \Pi _ { 1 } , D _ { \ell } \rangle \right) \right) } \\ & { \quad \quad \quad \quad \quad \quad + \left( 1 - \theta \right) \eta \log \left( \displaystyle \sum _ { \ell = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \Pi _ { 2 } , D _ { \ell } \rangle \right) \right) } \end{array}
|
| 562 |
+
$$
|
| 563 |
+
|
| 564 |
+
PROOF OF PROPOSITION 4
|
| 565 |
+
|
| 566 |
+
Theorem 5 (Jaggi, 2013) For each $t \geq 1$ , the iterates $\Pi ^ { ( t ) }$ of Algorithms 1, 2, 3, and 4 in (Jaggi, 2013) satisfy
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
f ( \mathbf { H } ^ { ( t ) } ) - f ( \mathbf { H } ^ { \ast } ) \leq \frac { 2 C _ { f } } { t + 2 } ( 1 + \delta ) ,
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
where $\Pi ^ { * } \in { \mathcal { D } }$ is an optimal solution to problem
|
| 573 |
+
|
| 574 |
+
$$
|
| 575 |
+
\Pi ^ { * } = \underset { \Pi \in \mathcal { D } } { \mathrm { a r g m i n } } \ f ( \Pi ) ,
|
| 576 |
+
$$
|
| 577 |
+
|
| 578 |
+
$C _ { f }$ is the curvature constant defined as
|
| 579 |
+
|
| 580 |
+
$$
|
| 581 |
+
\begin{array} { r } { C _ { f } : = \displaystyle \operatorname* { s u p } _ { \mathbf { H } , \widehat { \Pi } , \gamma } \frac { 2 } { \gamma ^ { 2 } } ( f ( \mathbf { H } ^ { \prime } ) - f ( \mathbf { H } ) - \langle \mathbf { H } ^ { \prime } - \mathbf { H } , \nabla f ( \mathbf { H } ) \rangle } \\ { \mathrm { s . t . } \pmb { \Pi } , \widehat { \Pi } \in \mathcal { D } , \gamma \in [ 0 , 1 ] , \Pi ^ { \prime } = \mathbf { H } + \gamma ( \widehat { \Pi } - \mathbf { H } ) , } \end{array}
|
| 582 |
+
$$
|
| 583 |
+
|
| 584 |
+
$\delta \geq 0$ is the accuracy with which internal linear subproblems are solved.
|
| 585 |
+
|
| 586 |
+
Lemma 6 (Jaggi, 2013) Let $f$ be a convex and differentiable function with its gradient $\nabla f$ being Lipschitz-continuous w.r.t. some norm $\| \cdot \|$ over the domain $\mathcal { D }$ with Lipschitz-constant $L > 0$ . Then,
|
| 587 |
+
|
| 588 |
+
$$
|
| 589 |
+
\begin{array} { r } { C _ { f } \le \dim _ { \| \cdot \| } ( \mathcal { D } ) ^ { 2 } L } \end{array}
|
| 590 |
+
$$
|
| 591 |
+
|
| 592 |
+
Definition 7 The softmax function is given by
|
| 593 |
+
|
| 594 |
+
$$
|
| 595 |
+
\sigma ( z ) = \frac { 1 } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp ( \lambda z _ { \ell ^ { \prime } } ) } \left( \begin{array} { c } { \exp ( \lambda z _ { 1 } ) } \\ { \exp ( \lambda z _ { 2 } ) } \\ { \vdots } \\ { \exp ( \lambda z _ { L } ) } \end{array} \right) ,
|
| 596 |
+
$$
|
| 597 |
+
|
| 598 |
+
where $\lambda > 0$ is referred to as the inverse temperature constant.
|
| 599 |
+
|
| 600 |
+
Lemma 8 (Gao & Pavel, 2017) The softmax function $\sigma ( \cdot )$ is $L$ -Lipschitz with respect to $\| \cdot \| _ { 2 }$ with $L = \lambda ,$ , that is for all $z , z ^ { \prime } \in \mathbb { R } ^ { n }$ ,
|
| 601 |
+
|
| 602 |
+
$$
|
| 603 |
+
\| \sigma ( z ) - \sigma ( z ^ { \prime } ) \| _ { 2 } \leq \lambda \| z - z ^ { \prime } \| _ { 2 } ,
|
| 604 |
+
$$
|
| 605 |
+
|
| 606 |
+
where $\lambda$ is the inverse temperature constant.
|
| 607 |
+
|
| 608 |
+
The derivative of $G _ { \eta } ( \mathbf { I I } )$ is given as
|
| 609 |
+
|
| 610 |
+
$$
|
| 611 |
+
\frac { \partial G _ { \eta } ( \mathbf { I I } ) } { \partial \mathbf { I I } } = \sum _ { \ell = 1 } ^ { L } \frac { \exp \left( \frac { 1 } { \eta } \langle \mathbf { I I } , C _ { \ell } \rangle \right) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \left( \frac { 1 } { \eta } \langle \mathbf { I I } , C _ { \ell ^ { \prime } } \rangle \right) } C _ { \ell } = M _ { \Pi } .
|
| 612 |
+
$$
|
| 613 |
+
|
| 614 |
+
Thus, we have
|
| 615 |
+
|
| 616 |
+
$$
|
| 617 |
+
\mathrm { v e c } ( M _ { \Pi } ) = \Phi p _ { \Pi } ,
|
| 618 |
+
$$
|
| 619 |
+
|
| 620 |
+
where
|
| 621 |
+
|
| 622 |
+
$$
|
| 623 |
+
\begin{array} { r l } & { \Phi = \left( \mathrm { v e c } ( C _ { 1 } ) , \mathrm { v e c } ( C _ { 2 } ) , \ldots , \mathrm { v e c } ( C _ { L } ) \right) \in \mathbb { R } ^ { n m \times L } , } \\ & { p _ { \Pi } = \left( \frac { \exp \Big ( \frac { 1 } { \eta } \langle \Pi , C _ { 1 } \rangle \Big ) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \Big ( \frac { 1 } { \eta } \langle \Pi , C _ { \ell ^ { \prime } } \rangle \Big ) } , \ldots , \frac { \exp \Big ( \frac { 1 } { \eta } \langle \Pi , C _ { L } \rangle \Big ) } { \sum _ { \ell ^ { \prime } = 1 } ^ { L } \exp \Big ( \frac { 1 } { \eta } \langle \Pi , C _ { \ell ^ { \prime } } \rangle \Big ) } \right) ^ { \top } \in \mathbb { R } ^ { L } . } \end{array}
|
| 624 |
+
$$
|
| 625 |
+
|
| 626 |
+
Here, $p _ { \Pi }$ is the softmax function $\sigma ( z )$ with $z _ { \ell } = \langle \Pi , C _ { \ell } \rangle$ .
|
| 627 |
+
|
| 628 |
+
We have
|
| 629 |
+
|
| 630 |
+
$$
|
| 631 |
+
\begin{array} { r l } { \| \nabla G _ { \eta } ( \mathbf { I I } ) - \nabla G _ { \eta } ( \mathbf { I I } ^ { \prime } ) \| _ { 2 } = \| \Phi p _ { \Pi } - \Phi p _ { \Pi ^ { \prime } } \| _ { 2 } } & { } \\ { \leq \| \Phi \| _ { \mathrm { o p } } \| p _ { \Pi } - p _ { \Pi ^ { \prime } } \| _ { 2 } , } & { } \\ { \leq \frac { 1 } { \eta } \| \Phi \| _ { \mathrm { o p } } \| \Phi ^ { \top } \mathrm { v e c } ( \mathbf { I I } ) - \Phi ^ { \top } \mathrm { v e c } ( \mathbf { I I } ^ { \prime } ) \| _ { 2 } ~ ( \mathrm { L e m m a ~ } 8 ~ \mathrm { w i t h } ~ \lambda = \frac { 1 } { \eta } ) } & { } \\ { \leq \frac { 1 } { \eta } \| \Phi \| _ { \mathrm { o p } } \| \Phi ^ { \top } \| _ { \mathrm { o p } } \| \mathrm { v e c } ( \mathbf { I I } ) - \mathrm { v e c } ( \mathbf { I I } ^ { \prime } ) \| _ { 2 } } & { } \end{array}
|
| 632 |
+
$$
|
| 633 |
+
|
| 634 |
+
where $\| \cdot \| _ { \mathrm { o p } }$ is the operator norm. We have $\| \Phi \| _ { \mathrm { o p } } ~ = ~ \| \Phi ^ { \top } \| _ { \mathrm { o p } } , ~ \| \Phi ^ { \top } \Phi \| _ { \mathrm { o p } } ~ = ~ \| \Phi \| _ { \mathrm { o p } } ^ { 2 }$ , and $\| \mathrm { v e c } ( \mathbf { H } ) - \mathrm { v e c } ( \mathbf { H } ^ { \prime } ) \| _ { 2 } \leq \sqrt { 2 }$ . Therefore, the Lipschitz constant for the gradient is $\begin{array} { r } { L = \frac 1 \eta \| \Phi \| _ { \mathrm { o p } } ^ { 2 } = } \end{array}$ $\frac { 1 } { \eta } \sigma _ { \mathrm { m a x } } ( \Phi ^ { \top } \Phi )$ , and the curvature constant is bounded above by $C _ { f } \leq 2 L$ , where $\sigma _ { m a x } ( \Phi ^ { \top } \Phi )$ is the largest eigenvalue of the matrix $\Phi ^ { \top } \Phi$ . By plugging $C _ { f }$ in Theorem 5, we have
|
| 635 |
+
|
| 636 |
+
$$
|
| 637 |
+
G _ { \eta } ( \Pi ^ { ( t ) } ) - G _ { \eta } ( \Pi ^ { \ast } ) \leq \frac { 4 \sigma _ { m a x } ( \Phi ^ { \top } \Phi ) } { \eta ( t + 2 ) } ( 1 + \delta ) .
|
| 638 |
+
$$
|
| 639 |
+
|
| 640 |
+
# MAX/MIN FORMULATION
|
| 641 |
+
|
| 642 |
+
We define the max–min formulation of the FROT as
|
| 643 |
+
|
| 644 |
+
$$
|
| 645 |
+
\operatorname* { m a x } _ { \alpha \in \Sigma ^ { L } } \quad \sum _ { \ell = 1 } ^ { L } \alpha _ { \ell } \operatorname* { m i n } _ { \Pi \in U ( a _ { \ell } , b _ { \ell } ) } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } c ( \pmb { x } _ { i } ^ { ( \ell ) } , \pmb { y } _ { j } ^ { ( \ell ) } ) ,
|
| 646 |
+
$$
|
| 647 |
+
|
| 648 |
+
where $\Sigma ^ { L } = \{ \pmb { \alpha } \in \mathbb { R } _ { + } ^ { L } : \pmb { \alpha } ^ { \top } \mathbf { 1 } _ { L } = 1 \}$ is the probability simplex, the set of probability vectors in $\mathbb { R } ^ { L }$ .
|
| 649 |
+
|
| 650 |
+
This problem can be solved by computing the group that maximizes the optimal transport distance $k ^ { * } = { \mathrm { { \bar { a r g m a x } } } _ { k } W _ { 1 } ( \mu ^ { ( \ell ) } , \nu ^ { ( \ell ) } ) }$ and then by considering $\alpha ^ { * } = \delta _ { k ^ { * } }$ as a one-hot vector.
|
| 651 |
+
|
| 652 |
+
The result of this formulation provides an intuitive idea (the same as for the robust Wasserstein method). Hence, we maximize the group (instead of the subspace) that provides the optimal result. However, the formulation requires solving the OT problem $L$ times. This approach may not be suitable if we have a large $L$ . Moreover, the argmax function is generally not differentiable.
|
| 653 |
+
|
| 654 |
+
Relation to the max-sliced Wasserstein distance: The max-sliced Wasserstein-2 distance can be defined as (Deshpande et al., 2019)
|
| 655 |
+
|
| 656 |
+
$$
|
| 657 |
+
\operatorname* { m a x } - W _ { 2 } ( \mu , \nu ) = \left( \operatorname* { m a x } _ { w \in \Omega } \ \operatorname* { m i n } _ { \substack { \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } \mathbf { \Theta } _ { i = 1 } } } \sum _ { j = 1 } ^ { n } \sum _ { \substack { 2 = 1 } } ^ { m } \pi _ { i j } ( w ^ { \top } \mathbf { x } _ { i } - w ^ { \top } \mathbf { y } _ { j } ) ^ { 2 } \right) ^ { \frac { 1 } { 2 } } ,
|
| 658 |
+
$$
|
| 659 |
+
|
| 660 |
+
where $\Omega \subset \mathbb { R } ^ { d }$ is the set of all possible directions on the unit sphere.
|
| 661 |
+
|
| 662 |
+
The max–sliced Wasserstein is a max–min approach. That is, for each $\pmb { w }$ , it requires solving the OT problem. The max–min approach is suited for simply measuring the divergence between two distributions. However, it is difficult to interpret features using the max–sliced Wasserstein, where it is the key motivation of FROT.
|
| 663 |
+
|
| 664 |
+
Relation to Subspace Robust Wasserstein (Paty $\pmb { \& }$ Cuturi, 2019): Here, we show that 2-FRWD with $\begin{array} { r l r } { d ( \mathbf { \bar { x } } , \pmb { y } ) } & { { } = } & { \| \pmb { x } \ - \ \pmb { y } \| _ { 2 } } \end{array}$ is a special case of SRW. Let us define $\begin{array} { r l } { U } & { { } = } \end{array}$ $( \sqrt { \alpha _ { 1 } } \pmb { e } _ { 1 } , \sqrt { \alpha _ { 2 } } \pmb { e } _ { 2 } , \ldots , \sqrt { \alpha _ { d } } \pmb { e } _ { d } ) ^ { \mathrm { ~ \tiny ~ | ~ } } \in \mathbb { R } ^ { d \times d }$ , where $\boldsymbol { e } _ { \ell } \doteq \mathbb { R } ^ { d }$ is the one-hot vector whose \`th element is 1 and $\pmb { \alpha } ^ { \top } \pmb { 1 } = 1 , { \alpha } _ { \ell } \geq 0$ . Then, the objective function of SRW can be written as
|
| 665 |
+
|
| 666 |
+
$$
|
| 667 |
+
\begin{array} { l } { { \displaystyle \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \| U ^ { \top } x _ { i } - U ^ { \top } y _ { j } \| _ { 2 } ^ { 2 } } = \displaystyle \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } ( x _ { i } - y _ { j } ) ^ { \top } U U ^ { \top } ( x _ { i } - y _ { j } ) } \\ { { \displaystyle \qquad = \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } ( x _ { i } - y _ { j } ) ^ { \top } \mathrm { d i a g } ( \alpha ) ( x _ { i } - y _ { j } ) } } \\ { { \displaystyle \qquad = \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \pi _ { i j } \sum _ { \ell = 1 } ^ { d } \alpha _ { \ell } ( x _ { i } ^ { ( \ell ) } - y _ { j } ^ { ( \ell ) } ) ^ { 2 } } . } \end{array}
|
| 668 |
+
$$
|
| 669 |
+
|
| 670 |
+
Therefore, SRW and 2-FRWD are equivalent if we set $U = ( \sqrt { \alpha _ { 1 } } e _ { 1 } , \sqrt { \alpha _ { 2 } } e _ { 2 } , . . . , \sqrt { \alpha _ { d } } e _ { d } ) ^ { \top }$ and $d ( \pmb { x } , \pmb { y } ) = \| \pmb { x } - \pmb { y } \| _ { 2 }$ .
|
| 671 |
+
|
| 672 |
+
Table 2: Computational time comparison (s) for feature selection from biological datasets.
|
| 673 |
+
|
| 674 |
+
<table><tr><td>Data</td><td>d</td><td>n</td><td>Wasserstein (Sort)</td><td>Linear</td><td>MMD</td><td>FROT</td></tr><tr><td>Colon</td><td>2000</td><td>62</td><td>12.57 (± 3.27)</td><td>0.00 (± 0.00)</td><td>1.36 (± 0.15)</td><td>0.41 (± 0.07)</td></tr><tr><td>Leukemia</td><td>7070</td><td>72</td><td>46.76 (± 19.47)</td><td>0.01 (± 0.00)</td><td>5.03 (± 0.79)</td><td>1.13 (± 0.14)</td></tr><tr><td>Prostate_GE</td><td>5966</td><td>102</td><td>51.99 (± 16.37)</td><td>0.02 (± 0.00)</td><td>6.01 (± 1.17)</td><td>1.04 (± 0.11)</td></tr><tr><td>GLI_85</td><td>22283</td><td>85</td><td>142.1 (± 21.65)</td><td>0.04 (± 0.00)</td><td>23.6(± 1.21)</td><td>3.44 (± 0.36)</td></tr></table>
|
| 675 |
+
|
| 676 |
+

|
| 677 |
+
Figure 5: One-to-one matching results of FROT $\eta = 0 . 3 ,$ ) and feature importance of FROT.
|
| 678 |
+
|
| 679 |
+
ADDITIONAL SEMANTIC CORRESPONDENCE EXPERIMENTS
|
| 680 |
+
|
| 681 |
+
Figure 5a shows an example of key points matched using the FROT algorithm. Fig.5b shows the corresponding feature importance. The lower the $\eta$ value, the smaller the number of layers used. The interesting finding here is that the selected important layer in this case is the third layer from the last. More qualitative results are presented in the Figure 7.
|
| 682 |
+
|
| 683 |
+

|
| 684 |
+
Figure 6: Average PCK scores on the validation split of SPair-71k with different pairs of hyperparameters.
|
| 685 |
+
|
| 686 |
+
Table 3: Per-class PCK $\dot { \alpha } _ { b b o x } = 0 . 1$ ) results using the SPair-71k. All models use ResNet101 as the backbone.
|
| 687 |
+
|
| 688 |
+
<table><tr><td colspan="2">Methods</td><td colspan="2">aero</td><td>bike</td><td>bird</td><td>boat</td><td>bottle</td><td>bus</td><td>car</td><td>cat</td><td>chair</td><td>cow</td><td>dog</td><td>horse</td><td>moto</td><td>person</td><td>plant</td><td></td><td>sheep</td><td>train</td><td></td><td>tv</td></tr><tr><td colspan="2">CNNGeo (Rocco et al., 2017) Authors’ A2Net (Hongsuck Seo et al., 2018)</td><td>21.3</td><td>15.1</td><td>34.6</td><td>12.8</td><td>31.2</td><td></td><td>26.3</td><td>24.0</td><td>30.6</td><td>11.6</td><td>24.3 20.4</td><td>12.2</td><td>19.7</td><td></td><td>15.6</td><td>14.3</td><td>9.6</td><td>28.5</td><td>28.8</td><td>all 18.1</td></tr><tr><td colspan="2">original</td><td></td><td>20.8 17.1</td><td>37.4</td><td>13.9</td><td>33.6</td><td></td><td>29.4</td><td>26.5</td><td>34.9</td><td>12.0</td><td>22.5 26.5</td><td></td><td>13.3</td><td>21.3</td><td>20.0</td><td>16.9</td><td>11.5</td><td>28.9 31.6</td><td></td><td>20.1</td></tr><tr><td colspan="2">models</td><td></td><td>23.4</td><td>17.0 41.6</td><td>14.6</td><td></td><td>37.6</td><td>28.1</td><td>26.6</td><td>32.6</td><td>12.6</td><td>27.9</td><td>23.0</td><td>13.6</td><td>21.3</td><td>22.2</td><td>17.9</td><td>10.9</td><td>31.5</td><td>34.8</td><td>21.1</td></tr><tr><td colspan="2">SPair-71k</td><td>WeakAlign (Rocco et al.,218a)</td><td>24.0 23.4</td><td>16.0</td><td>45.0</td><td>13.7 14.3</td><td>35.7</td><td>25.9</td><td>19.0</td><td>50.4</td><td>14.3</td><td>32.6</td><td>27.4</td><td>19.2</td><td>21.7</td><td>20.3</td><td>20.4</td><td>13.6</td><td>33.6</td><td>40.4</td><td>26.4</td></tr><tr><td></td><td>CNNGeo A2Net</td><td>22.6</td><td>16.7 18.5</td><td>40.2 42.0</td><td>16.4</td><td></td><td>36.4 37.9</td><td>27.7 30.8</td><td>26.0 26.5</td><td>32.7 35.6</td><td>12.7 13.3</td><td>27.4 29.6</td><td>22.8 24.3</td><td>13.7 16.0</td><td>20.9</td><td>21.0 22.8</td><td>17.5</td><td>10.2</td><td>30.8</td><td>34.1</td><td>20.6</td></tr><tr><td>finetuned models</td><td>WeakAlign</td><td>22.2</td><td>17.6</td><td>41.9</td><td>15.1</td><td></td><td>38.1</td><td>27.4</td><td>27.2</td><td>31.8</td><td>12.8</td><td>26.8</td><td>22.6</td><td>14.2</td><td>21.6 20.0</td><td>22.2</td><td>20.5 17.9</td><td>13.5 10.4</td><td>31.4 32.2</td><td>36.5 35.1</td><td>22.3 20.9</td></tr><tr><td>SPair-71k</td><td>NC-Net</td><td>17.9 25.2</td><td>12.2 18.9</td><td>32.1 52.1</td><td>11.7 15.7</td><td>38.0</td><td>29.0</td><td>19.9</td><td>16.1</td><td>39.2</td><td>9.9</td><td>23.9</td><td>18.8</td><td>15.7</td><td>17.4</td><td>15.9</td><td>14.8</td><td>9.6</td><td>24.2</td><td>31.1</td><td>20.1</td></tr><tr><td>validation</td><td>HPF OT-HPF</td><td>32.6 30.1</td><td>18.9</td><td>62.5</td><td>20.7</td><td>42.0</td><td></td><td>22.8 26.1</td><td>19.1 20.4</td><td>52.9 61.4</td><td>17.9 19.7</td><td>33.0 41.3</td><td>32.8 41.7</td><td>20.6 29.8</td><td>24.4 29.6</td><td>27.9</td><td>21.1 25.0</td><td>15.9</td><td>31.5 44.7</td><td>35.6</td><td>28.2</td></tr><tr><td rowspan="15">Without SPair-71k</td><td>OT</td><td></td><td></td><td></td><td>17.3</td><td></td><td></td><td></td><td></td><td></td><td></td><td>31.3</td><td>22.1</td><td>28.0</td><td>31.8</td><td>21.0</td><td>23.5</td><td></td><td></td><td>37.0 28.3</td><td>33.9</td></tr><tr><td>FROT (n = 0.2)</td><td>34.0</td><td>16.5</td><td>50.4</td><td></td><td>38.0</td><td>22.9</td><td>19.7</td><td>54.3 57.9</td><td>17.0 15.8</td><td>28.4 33.1</td><td>34.0</td><td>24.8</td><td></td><td>19.5 28.5</td><td></td><td>17.8 21.2</td><td>42.6</td><td>28.8</td><td></td></tr><tr><td>FROT (n =0.3)</td><td>35.0</td><td>17.2 20.9</td><td>55.6 56.3</td><td>19.7 23.4</td><td>39.6</td><td>24.3</td><td>19.9</td><td></td><td></td><td>38.8</td><td></td><td>26.1 28.0</td><td></td><td>23.1</td><td></td><td>43.4</td><td></td><td>33.6 30.8</td><td></td></tr><tr><td>FROT (n =0.4)</td><td>34.0</td><td>18.7</td><td>57.0</td><td>20.0</td><td>40.7 39.9</td><td>27.2 25.9</td><td>21.9 19.7</td><td>62.0 61.6</td><td>17.5 17.2</td><td>38.1</td><td>36.2 27.9 36.6</td><td>26.5 26.6</td><td>30.4</td><td>26.9</td><td></td><td>23.1 22.6</td><td>49.7 38.4</td><td>33.7 32.8</td><td></td></tr><tr><td>FROT (n =0.5)</td><td>34.1</td><td>18.8</td><td>56.9</td><td>19.9</td><td>40.0</td><td>25.6</td><td>19.2</td><td>61.9</td><td>17.4</td><td>38.7</td><td>36.5</td><td>25.6</td><td>26.9</td><td>27.4 27.2</td><td>26.8 26.3</td><td>22.1</td><td>49.8 50.3</td><td>38.4 38.6 32.8</td><td></td></tr><tr><td>FROT (n =0.6)</td><td>33.8 33.4</td><td>19.3 19.4</td><td>56.5 56.6</td><td>19.9 20.0</td><td>39.9 39.6</td><td>25.9</td><td>19.2</td><td>62.3</td><td>17.7</td><td>38.4</td><td>36.6</td><td>26.0</td><td>27.2 27.5</td><td>27.0</td><td>26.1 25.5</td><td>22.2</td><td>50.1</td><td>39.2</td><td>32.8</td></tr><tr><td>FROT(n =0.7)</td><td></td><td>33.2 19.0</td><td></td><td>19.8</td><td></td><td>26.1</td><td>19.1</td><td>62.4 62.3</td><td>17.9</td><td>38.0 37.5</td><td>36.5</td><td>26.0 25.8</td><td></td><td>26.5</td><td></td><td>21.6</td><td>49.7</td><td>38.9</td><td>32.7</td></tr><tr><td>validation FROT (n =0.8) FROT (n =0.9)</td><td></td><td>19.1</td><td>56.2 56.0</td><td>19.6</td><td>39.4 39.3</td><td>26.2 26.1</td><td>19.6 19.8</td><td>61.9</td><td>17.3 17.2</td><td></td><td>36.5 36.4</td><td></td><td>26.5 27.0</td><td>26.0</td><td>25.2 24.8</td><td>21.3</td><td>48.9</td><td>38.2</td><td>32.3</td></tr><tr><td></td><td>32.9 32.8</td><td>19.1</td><td>55.8</td><td>19.8</td><td>39.1</td><td>25.7</td><td>19.7</td><td>61.5</td><td>17.2</td><td>37.1 37.1</td><td>35.9</td><td>25.5 25.1</td><td></td><td>25.3</td><td></td><td>21.3</td><td>48.2</td><td>37.8</td><td>32.1</td></tr><tr><td>FROT (n =1.0) FROT (n = 2.0)</td><td>30.0</td><td>17.5</td><td>54.6</td><td>18.2</td><td>36.6</td><td>24.3</td><td>18.9</td><td>57.7</td><td>16.8</td><td>33.8</td><td>34.7</td><td>23.1</td><td>27.2 25.8</td><td>25.0 21.1</td><td>24.7 21.5</td><td>21.4 19.5</td><td>47.7 41.6</td><td>37.8</td><td>32.0</td></tr><tr><td>FROT (n =3.0) FROT (n = 4.0)</td><td></td><td>28.8 16.2 27.8 15.2</td><td>53.0 52.0</td><td>17.1 16.4</td><td>34.7 33.7</td><td>21.6</td><td>23.0</td><td>18.3 54.5</td><td>15.7</td><td>31.0 28.9</td><td>32.4</td><td>21.5</td><td>24.3</td><td>17.9</td><td>19.4</td><td>18.2</td><td>37.1</td><td>34.0 30.7</td><td>29.5</td></tr><tr><td>FROT(n =5.0) SRW(k=20,∈=0.1,T=10,laye34)</td><td></td><td>26.9 14.9 23.1</td><td>50.8</td><td>16.0</td><td></td><td>32.4</td><td>20.5</td><td>17.0 16.3</td><td>51.0 48.4</td><td>15.8 15.0</td><td>30.9 27.0 30.2</td><td>20.3 19.4</td><td>22.7</td><td>16.3</td><td>18.4</td><td>16.9</td><td></td><td>34.0 28.2</td><td>27.5 26.1</td></tr><tr><td>SRW(k =10,∈=0.1,T=10,layer=34)</td></table>
|
| 689 |
+
|
| 690 |
+

|
| 691 |
+
Figure 7: Qualitative examples sampled from SPair-71k. For each image, the red points represent the keypoints to be matched while the green points denote the prediction and the blue ones denote the ground truth.
|