Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- md/train/1flmvXGGJaa/1flmvXGGJaa.md +505 -0
- md/train/4YlE2huxEsl/4YlE2huxEsl.md +411 -0
- md/train/8qDwejCuCN/8qDwejCuCN.md +314 -0
- md/train/AFiH_CNnVhS/AFiH_CNnVhS.md +273 -0
- md/train/B186cP9gx/B186cP9gx.md +113 -0
- md/train/B1gd0nEFwS/B1gd0nEFwS.md +433 -0
- md/train/BJYwwY9ll/BJYwwY9ll.md +263 -0
- md/train/BJeWUs05KQ/BJeWUs05KQ.md +316 -0
- md/train/BJgr4kSFDS/BJgr4kSFDS.md +385 -0
- md/train/By5ugjyCb/By5ugjyCb.md +354 -0
- md/train/ByedzkrKvH/ByedzkrKvH.md +0 -0
- md/train/BygNqoR9tm/BygNqoR9tm.md +563 -0
- md/train/BylJUTEKvB/BylJUTEKvB.md +324 -0
- md/train/C0GmZH2RnVR/C0GmZH2RnVR.md +254 -0
- md/train/CBmJwzneppz/CBmJwzneppz.md +634 -0
- md/train/DfGu8WwT0d/DfGu8WwT0d.md +368 -0
- md/train/Ggx8fbKZ1-D/Ggx8fbKZ1-D.md +344 -0
- md/train/H1T2hmZAb/H1T2hmZAb.md +450 -0
- md/train/H1TWfmnNf/H1TWfmnNf.md +322 -0
- md/train/H1x-x309tm/H1x-x309tm.md +0 -0
- md/train/HKtsGW-lNbw/HKtsGW-lNbw.md +236 -0
- md/train/Hk4_qw5xe/Hk4_qw5xe.md +505 -0
- md/train/Hk4dFjR5K7/Hk4dFjR5K7.md +463 -0
- md/train/Hk9Xc_lR-/Hk9Xc_lR-.md +0 -0
- md/train/HkeGhoA5FX/HkeGhoA5FX.md +352 -0
- md/train/HkehD3VtvS/HkehD3VtvS.md +321 -0
- md/train/HkzZBi0cFQ/HkzZBi0cFQ.md +164 -0
- md/train/Hye4KeSYDr/Hye4KeSYDr.md +320 -0
- md/train/HygtHnR5tQ/HygtHnR5tQ.md +457 -0
- md/train/HyxnZh0ct7/HyxnZh0ct7.md +364 -0
- md/train/HyydRMZC-/HyydRMZC-.md +419 -0
- md/train/S1eYKlrYvr/S1eYKlrYvr.md +293 -0
- md/train/S1evHerYPr/S1evHerYPr.md +421 -0
- md/train/S1xNEhR9KX/S1xNEhR9KX.md +444 -0
- md/train/S1xq3oR5tQ/S1xq3oR5tQ.md +233 -0
- md/train/SJcKhk-Ab/SJcKhk-Ab.md +324 -0
- md/train/SJxIm0VtwH/SJxIm0VtwH.md +0 -0
- md/train/SkYibHlRb/SkYibHlRb.md +404 -0
- md/train/SkxgnnNFvH/SkxgnnNFvH.md +276 -0
- md/train/Syx4wnEtvH/Syx4wnEtvH.md +0 -0
- md/train/Tt1s9Oi1kCS/Tt1s9Oi1kCS.md +344 -0
- md/train/V1N4GEWki_E/V1N4GEWki_E.md +382 -0
- md/train/WH0taVJii5_/WH0taVJii5_.md +439 -0
- md/train/_WnwtieRHxM/_WnwtieRHxM.md +715 -0
- md/train/cR91FAodFMe/cR91FAodFMe.md +343 -0
- md/train/dUk5Foj5CLf/dUk5Foj5CLf.md +248 -0
- md/train/eVuMspr9cu5/eVuMspr9cu5.md +263 -0
- md/train/hJmtwocEqzc/hJmtwocEqzc.md +302 -0
- md/train/iorEu783qJ5/iorEu783qJ5.md +210 -0
- md/train/lmTWnm3coJJ/lmTWnm3coJJ.md +394 -0
md/train/1flmvXGGJaa/1flmvXGGJaa.md
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NAS-BENCH-301 AND THE CASE FOR SURROGATE BENCHMARKS FOR NEURAL ARCHITECTURE SEARCH
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The most significant barrier to the advancement of Neural Architecture Search (NAS) is its demand for large computational resources, which hinders scientifically sound empirical evaluations. As a remedy, several tabular NAS benchmarks were proposed to simulate runs of NAS methods in seconds. However, all existing tabular NAS benchmarks are limited to extremely small architectural spaces since they rely on exhaustive evaluations of the space. This leads to unrealistic results that do not transfer to larger search spaces. To overcome this fundamental limitation, we propose NAS-Bench-301, the first surrogate NAS benchmark, using a search space containing $1 0 ^ { 1 8 }$ architectures, many orders of magnitude larger than any previous tabular NAS benchmark. After motivating the benefits of a surrogate benchmark over a tabular one, we fit various regression models on our dataset, which consists of ${ \sim } 6 0 \mathrm { k }$ architecture evaluations, and build surrogates via deep ensembles to also model uncertainty. We benchmark a wide range of NAS algorithms using NAS-Bench-301 and obtain comparable results to the true benchmark at a fraction of the real cost. Finally, we show how NAS-Bench-301 can be used to generate new scientific insights.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural Architecture Search (NAS) promises to advance representation learning by automatically finding architectures that facilitate the learning of strong representations for a given dataset. NAS has already achieved state-of-the-art performance on many tasks (Real et al., 2019; Liu et al., 2019a; Saikia et al., 2019; Elsken et al., 2020) and to create resource-aware architectures (Tan et al., 2018; Elsken et al., 2019a; Cai et al., 2020). For a review, we refer to Elsken et al. (2019b).
|
| 12 |
+
|
| 13 |
+
Despite many advancements in terms of both efficiency and performance, empirical evaluations in NAS are still problematic. Different NAS papers often use different training pipelines, different search spaces and different hyperparameters, do not evaluate other methods under comparable settings, and cannot afford enough runs for testing significance. This practice impedes assertions about the statistical significance of the reported results, recently brought into focus by several authors (Yang et al., 2019; Lindauer & Hutter, 2019; Shu et al., 2020; Yu et al., 2020).
|
| 14 |
+
|
| 15 |
+
To circumvent these issues and enable scientifically sound evaluations in NAS, several tabular benchmarks (Ying et al., 2019; Zela et al., 2020b; Dong & Yang, 2020; Klyuchnikov et al., 2020) have been proposed recently (see also Appendix A.1 for more details). However, all these benchmarks rely on an exhaustive evaluation of all architectures in a search space, which limits them to unrealistically small search spaces (so far containing only between 6k and $4 2 3 \mathrm { k }$ architectures). This is a far shot from standard spaces used in the NAS literature, which contain more than $1 0 ^ { 1 8 }$ architectures (Zoph & Le, 2017; Liu et al., 2019b). This discrepancy can cause results gained on existing tabular NAS benchmarks to not generalize to realistic search spaces; e.g., promising anytime results of local search on existing tabular NAS benchmarks were shown to not transfer to realistic search spaces (White et al., 2020b). To address these problems, we make the following contributions:
|
| 16 |
+
|
| 17 |
+
1. We present NAS-Bench-301, a surrogate NAS benchmark that is first to cover a realistically-sized search space (namely the cell-based search space of DARTS (Liu et al., 2019b)), containing more than $1 0 ^ { 1 8 }$ possible architectures. This is made possible by estimating their performance via a surrogate model, removing the constraint to exhaustively evaluate the entire search space.
|
| 18 |
+
|
| 19 |
+
2. We empirically demonstrate that a surrogate fitted on a subset of architectures can in fact model the true performance of architectures better than a tabular benchmark (Section 2). 3. We analyze and release the NAS-Bench-301 training dataset consisting of ${ \sim } 6 0 \mathrm { k }$ fully trained and evaluated architectures, which will also be publicly available in the Open Graph Benchmark (Hu et al., 2020) (Section 3). 4. Using this dataset, we thoroughly evaluate a variety of regression models as surrogate candidates, showing that strong generalization performance is possible even in large spaces (Section 4). 5. We utilize NAS-Bench-301 as a benchmark for running various NAS optimizers and show that the resulting search trajectories closely resemble the ground truth trajectories. This enables sound simulations of thousands of GPU hours in a few seconds on a single CPU machine (Section 5). 6. We demonstrate that NAS-Bench-301 can help in generating new scientific insights by studying a previous hypothesis on the performance of local search in the DARTS search space (Section 6).
|
| 20 |
+
|
| 21 |
+
To foster reproducibility, we open-source all our code and data in a public repo: https:// anonymous.4open.science/r/3f99ef91-c472-4394-b666-5d464e099aca/
|
| 22 |
+
|
| 23 |
+
# 2 MOTIVATION – CAN WE DO BETTER THAN A TABULAR BENCHMARK?
|
| 24 |
+
|
| 25 |
+
We start by motivating the use of surrogate benchmarks by exposing an issue of tabular benchmarks that has largely gone unnoticed. Tabular benchmarks are built around a costly, exhaustive evaluation of all possible architectures in a search space, and when an architecture’s performance is queried, the tabular benchmark simply returns the respective table entry. The issue with this process is that the stochasticity of mini-batch training is also reflected in the performance of an architecture $i$ , hence making it a random variable $Y _ { i }$ . Therefore, the table only contains results of a few draws $y _ { i } \sim Y _ { i }$ (existing NAS benchmarks feature up to 3 runs per architecture). Given the variance in these evaluations, a tabular benchmark acts as a simple estimator that assumes independent random variables, and thus estimates the performance of an architecture based only on previous evaluations of the same architecture. From a machine learning perspective, knowing that similar architectures tend to yield similar performance, and that the variance of individual evaluations can be high (both shown to be the case by Ying et al. (2019)), it is natural to assume that better estimators may exist. In the remainder of this section, we empirically verify this hypothesis and show that surrogate benchmarks can provide better performance estimates than tabular benchmarks based on less data.
|
| 26 |
+
|
| 27 |
+
Setup We choose NAS-Bench-101 (Ying et al., 2019) as a tabular benchmark for our analysis and a Graph Isomorphism Network (GIN, $\mathrm { X u }$ et al. (2019a)) as our surrogate model.1 Each architecture $x _ { i }$ in NAS-Bench-101 contains 3 validation accuracies $y _ { i } ^ { 1 } , y _ { i } ^ { 2 } , y _ { i } ^ { 3 }$ from training $x _ { i }$ with 3 different seeds. We excluded all diverged models with less than $50 \%$ validation accuracy on any of the three evaluations in NAS-Bench-101. We split this dataset to train the GIN surrogate model on one of the seeds, e.g., $\mathcal { D } ^ { t r a i n } = \{ ( x _ { i } , y _ { i } ^ { 1 } ) \} _ { i }$ and evaluate on the other two, e.g., $\mathcal { D } ^ { t e s t } = \{ ( x _ { i } , \bar { y } _ { i } ^ { 2 3 } ) \} _ { i }$ , where $\bar { y } _ { i } ^ { 2 3 } = ( y _ { i } ^ { 2 } + y _ { i } ^ { 3 } ) / 2$ .
|
| 28 |
+
|
| 29 |
+
<table><tr><td>Model</td><td colspan="3">Mean Absolute Error (MAE)</td></tr><tr><td></td><td>1,[2,3]</td><td>2,[1,3]</td><td>3,[1,2]</td></tr><tr><td>Tab.</td><td>4.534e-3</td><td>4.546e-3</td><td>4.539e-3</td></tr><tr><td>Surr.</td><td>3.446e-3</td><td>3.455e-3</td><td>3.441e-3</td></tr></table>
|
| 30 |
+
|
| 31 |
+
Table 1: MAE between performance predicted by a tab./surr. benchmark fitted with one seed each, and the true performance of evaluations with the two other seeds. Test seeds in brackets.
|
| 32 |
+
|
| 33 |
+
We emphasize that training a surrogate to model a search space is not a typical inductive regression task but rather a transductive one. By definition of the search space, the set of possible architectures is known ahead of time (although it may be very large), hence a surrogate model does not have to generalize to out-ofdistribution data if the training data covers the space well.
|
| 34 |
+
|
| 35 |
+
Results We compute the mean absolute error MAE = Pi |yˆi−y¯23i | on $\mathcal { D } ^ { t r a i n } = \{ ( x _ { i } , y _ { i } ^ { 1 } ) \} _ { i }$ , where $\hat { y } _ { i }$ is predicted ofnd $n = | \mathcal { D } ^ { t e s t } |$ e model trained. Table 1 shows that the surrogate model yields a lower MAE than the tabular benchmark, i.e. MAE = Pi |y1i −y¯23i |n . We also report the mean squared error and Kendall tau correlation coefficient in Table 6 in the Appendix showing that the ranking between architectures is also predicted better by the surrogate.
|
| 36 |
+
|
| 37 |
+
We repeat the experiment in a cross-validation fashion w.r.t to the seeds and conclude: In contrast to a single tabular entry, the surrogate model learns to smooth out the noise.2
|
| 38 |
+
|
| 39 |
+
Next, we fit the GIN surrogate on subsets of $\mathcal { D } ^ { t r a i n }$ and plot how its performance scales with the amount of training data used in Figure 1. The surrogate model performs better than the tabular benchmark when the training set has more than $\sim 2 1 { , } 5 0 0$ architectures. Note that $\bar { \mathcal { D } } ^ { t e s t }$ remains the same as in the previous experiment, i.e., it includes all architectures in NAS-Bench-101. As a result, we conclude that: A surrogate model can yield strong predictive performance when only a subset of the search space is available as training data.
|
| 40 |
+
|
| 41 |
+
These empirical findings suggest that we can create reliable surrogate benchmarks for much larger and more realistic NAS spaces, which are infeasible to be exhaustively evaluated as done by tabular benchmarks. In the remainder of the paper, we focus on creating such a benchmark.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Number of architectures used for training the GIN surrogate model vs MAE on the NAS-Bench-101 dataset.
|
| 45 |
+
|
| 46 |
+
# 3 THE NAS-BENCH-301 DATASET
|
| 47 |
+
|
| 48 |
+
We now describe the NAS-Bench-301 dataset which consists of ${ \sim } 6 0 \mathrm { k }$ architectures and their performances on CIFAR-10 (Krizhevsky, 2009) sampled from the most popular NAS cell search space: the one from DARTS (Liu et al., 2019b). We use this dataset not only to fit surrogate models but also to gain new insights, such as which regions of the architecture space are being explored by different NAS methods, or what the characteristics of architectures are that work well.
|
| 49 |
+
|
| 50 |
+
# 3.1 DATA COLLECTION
|
| 51 |
+
|
| 52 |
+
<table><tr><td>NAS methods</td><td></td><td># eval</td></tr><tr><td></td><td>RS (Bergstra & Bengio,2012)</td><td>23746</td></tr><tr><td rowspan="2">Evolution</td><td>DE (Awad et al.,2020)</td><td>7275</td></tr><tr><td>RE (Real et al.,2019)</td><td>4639</td></tr><tr><td>BO</td><td>TPE (Bergstra et al., 2011) BANANAS (White et al.,2019) COMBO (Oh et al., 2019)</td><td>6741 2243 745</td></tr><tr><td>One-Shot</td><td>DARTS (Liu et al., 2019b) PC-DARTS (Xu et al.,2020) DrNAS (Chen et al.,2020)</td><td>2053 1588 947</td></tr></table>
|
| 53 |
+
|
| 54 |
+
Table 2: NAS methods used to cover the search space.
|
| 55 |
+
|
| 56 |
+
Since the DARTS search space (detailed description in Appendix C.1) is far too large to be exhaustively evaluated, care has to be taken when sampling the architectures which will be used to train the surrogate models. Sampling should yield a good overall coverage of the architecture space while also providing a special focus on the well-performing regions that optimizers tend to exploit.
|
| 57 |
+
|
| 58 |
+
Our principal methodology is inspired by Eggensperger et al. (2015), who collected unbiased data about hyperparameter spaces by random search, as well as biased and dense samples in high-performance regions by running hyperparameter optimizers. This is desirable for a surrogate benchmark since we are interested in evaluating NAS methods that exploit such good regions of the space. Table 2 lists the NAS methods we used to collect such samples and the respective number of samples. Additionally, we evaluated ${ \sim } 1 \mathrm { k }$ architectures in poorly-performing regions for better coverage and another ${ \sim } 1 0 \mathrm { k }$ for the analysis conducted on the dataset and surrogates. We refer to Appendices C.2 and C.3 for details on the data collection and the optimizers, respectively. We would like to point out that in hindsight adding training data of well-performing regions may be less important for a surrogate NAS benchmark than for a surrogate HPO benchmark, which we demonstrated in Appendix E.3. We argue that this is a result of HPO search spaces containing many configurations which yield disfunctional models, which is less common for architectures in many NAS search spaces, hence allowing random search to give us good coverage of the space.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: t-SNE visualization of the sampled architectures.
|
| 62 |
+
|
| 63 |
+
In Figure 2, we visualize the overall coverage of the search space as well as the similarity between sampled architectures using t-SNE (van der Maaten & Hinton, 2008). Besides showing a good overall coverage, some well-performing architectures in the search space form distinct clusters which are mostly located outside the main cloud of points. This clearly indicates that architectures with similar performance are close to each other in the architecture space. Additionally, we observe that different optimizers sample different types of architectures, see Figure 9 in the Appendix.
|
| 64 |
+
|
| 65 |
+
# 3.2 PERFORMANCE STATISTICS
|
| 66 |
+
|
| 67 |
+
Figure 3 shows the validation error on CIFAR-10 (Krizhevsky, 2009) of all sampled architectures in relation to the model parameters and training runtime. Generally, as expected, models with more parameters are more costly to train but achieve lower validation errors. We also find that different NAS methods yield quite different performance distributions (see Appendix C.4 for their individual performances). Validation and test errors are highly correlated with a Kendall tau rank correlation of $\tau = 0 . 8 5 2$ (Spearman rank corr. 0.969), minimizing the risk of overfitting on the validation error.
|
| 68 |
+
|
| 69 |
+
Furthermore, we find that cells of all depths can reach a good performance, but shallow topologies are slightly favored in our setting (see Figure 10 in the Appendix). Also, a small number of parameter-free operations (e.g., skip connections) can benefit the performance but featuring many of these significantly deteriorates performance. For the full analysis, see Appendix C.5.
|
| 70 |
+
|
| 71 |
+
Following standard practice in modern NAS papers (e.g., Liu et al. (2019b)), we employ various data augmentation techniques during training for more reliable estimates of an architecture’s performance. For a description of our full training pipeline, please see Appendix C.6.
|
| 72 |
+
|
| 73 |
+
# 3.3 NOISE IN ARCHITECTURE EVALUATIONS
|
| 74 |
+
|
| 75 |
+
As discussed in Section 2, the noise in architecture evaluations can be large enough for surrogate models to yield more realistic estimates of architecture performance than a tabular benchmark based on a single evaluation per architecture. To study the magnitude of this noise on NAS-Bench-301, we evaluated 500 architectures randomly sampled from our Differential Evolution (DE) (Awad et al., 2020) run with 5 different seeds each.3 We find a mean standard deviation of $1 . 6 \mathrm { { e } - 3 }$ for the final validation accuracy which is slightly less than the noise observed in NAS-Bench-101 (Ying et al., 2019); one possible reason for this could be a more robust training pipeline. Figure 12 in the Appendix shows that, while the noise tends to be lower for the best architectures, a correct ranking based on a single evaluation is still difficult. Finally, we compare the MAE when estimating the architecture performance from only one sample to the results from Table 1. Here, we also find a slightly lower MAE of $1 . 3 8 \mathrm { e } { - 3 }$ than for NAS-Bench-101.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 3: Number of parameters against val. error with model training time as colorbar.
|
| 79 |
+
|
| 80 |
+
# 4 FITTING SURROGATE MODELS ON THE NAS-BENCH-301 DATASET
|
| 81 |
+
|
| 82 |
+
We now focus on creating a surrogate model. To that end, we evaluated a wide range of regression models on the NAS-Bench-301 dataset. In principle, any such model can give rise to a surrogate NAS benchmark, but models that fit the true performance better yield surrogate NAS benchmarks whose characteristics are more similar to the ones of the true benchmark. Therefore, we naturally strive for the best-fitting model. We emphasize that in this work we do not attempt to introduce a new regression model but rather build on the shoulders of the architecture performance prediction community.
|
| 83 |
+
|
| 84 |
+
# 4.1 SURROGATE MODEL CANDIDATES
|
| 85 |
+
|
| 86 |
+
Deep Graph Convolutional Neural Networks are frequently used as NAS predictors (Friede et al., 2019; Wen et al., 2019; Ning et al., 2020). In particular, we choose the GIN since several works have found it to perform well on many benchmark datasets (Errica et al., 2020; Hu et al., 2020; Dwivedi et al., 2020). We use the publicly available implementation from the Open Graph Benchmark (Hu et al., 2020) and refer to Appendix D.2 for further details.
|
| 87 |
+
|
| 88 |
+
We compare the GIN to a variety of common regression models. We evaluate Random Forests (RF) and Support Vector Regression (SVR) using implementations from scikit-learn (Pedregosa et al., 2011). We also compare to the tree-based gradient boosting methods XGBoost (Chen & Guestrin, 2016). LGBoost (Ke et al., 2017) and NGBoost (Duan et al., 2020), recently used for predictorbased NAS (Luo et al., 2020). We comprehensively review architecture performance prediction in Appendix A.2.
|
| 89 |
+
|
| 90 |
+
# 4.2 EVALUATING THE DATA FIT
|
| 91 |
+
|
| 92 |
+
Similarly to Wen et al. (2019) and Baker et al. (2017), we assess the quality of the data fit via the coefficient of determination $( R ^ { 2 } )$ and the Kendall rank correlation coefficient $( \tau )$ . Since Kendall $\tau$ is sensitive to noisy evaluations that change the rank of an architecture, we follow the recent work by $\mathrm { Y u }$ et al. (2020) and use a sparse Kendall Tau (sKT), which ignores rank changes at $0 . 1 \%$ accuracy precision, by rounding the predicted validation accuracy prior to computing $\tau$ .
|
| 93 |
+
|
| 94 |
+
All hyperparameters of the surrogate models were tuned using BOHB (Falkner et al., 2018) as a black-box optimizer; details on their respective hyperparameter search spaces are given in Table 7 in the appendix. We use train/val/test splits $( 0 . 8 / 0 . 1 / 0 . 1 )$ stratified across the NAS methods used for the data collection. This means that the ratio of architectures from a particular optimizer is constant across the splits, e.g. the test set contains $50 \%$ of its architectures from RS since RS was used to obtain $50 \%$ of the total architectures we trained and evaluated. We provide additional details on the preprocessing of the architectures for the surrogate models in Appendix D.1. As Table 3 shows, the three best-performing models are LGBoost, XGBoost and GIN; we therefore focus our analysis on these in the following.
|
| 95 |
+
|
| 96 |
+
Table 3: Performance of different regression models fitted on the NB-301 dataset.
|
| 97 |
+
|
| 98 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Test</td></tr><tr><td>R²</td><td>sKT</td></tr><tr><td>LGBoost</td><td>0.892</td><td>0.816</td></tr><tr><td>XGBoost</td><td>0.832</td><td>0.817</td></tr><tr><td>GIN</td><td>0.832</td><td>0.778</td></tr><tr><td>NGBoost</td><td>0.810</td><td>0.759</td></tr><tr><td>μ-SVR</td><td>0.709</td><td>0.677</td></tr><tr><td>MLP(Path enc.)</td><td>0.704</td><td>0.697</td></tr><tr><td>RF</td><td>0.679</td><td>0.683</td></tr><tr><td>E-SVR</td><td>0.675</td><td></td></tr><tr><td></td><td></td><td>0.660</td></tr></table>
|
| 99 |
+
|
| 100 |
+
In addition to evaluating the data fit on our data splits, we investigate the impact of parameterfree operations and the cell topology in Appendices D.6 and D.7, respectively. We find that all of LGBoost, XGBoost and GIN accurately predict the drop in performance when increasingly replacing operations with parameter-free operations in a normal cell.
|
| 101 |
+
|
| 102 |
+
Table 4: Leave One-Optimizer-Out performance of the best surrogate models.
|
| 103 |
+
|
| 104 |
+
<table><tr><td></td><td>Model</td><td>NoRE</td><td>NoDE</td><td>No COMBO</td><td>No TPE</td><td>No BANANAS</td><td>No DARTS</td><td>No PC-DARTS</td><td>No DrNAS</td><td>No GDAS</td></tr><tr><td>R²</td><td>LGB</td><td>0.917</td><td>0.892</td><td>0.919</td><td>0.857</td><td>0.909</td><td>-0.093</td><td>0.826</td><td>0.699</td><td>0.429</td></tr><tr><td></td><td>XGB</td><td>0.907</td><td>0.888</td><td>0.876</td><td>0.842</td><td>0.911</td><td>-0.151</td><td>0.817</td><td>0.631</td><td>0.672</td></tr><tr><td></td><td>GIN</td><td>0.856</td><td>0.864</td><td>0.775</td><td>0.789</td><td>0.881</td><td>0.115</td><td>0.661</td><td>0.790</td><td>0.572</td></tr><tr><td></td><td>LGB</td><td>0.834</td><td>0.782</td><td>0.833</td><td>0.770</td><td>0.592</td><td>0.780</td><td>0.721</td><td>0.694</td><td>0.595</td></tr><tr><td>sKT</td><td>XGB</td><td>0.831</td><td>0.780</td><td>0.817</td><td>0.762</td><td>0.596</td><td>0.775</td><td>0.710</td><td>0.709</td><td>0.638</td></tr><tr><td></td><td>GIN</td><td>0.798</td><td>0.757</td><td>0.737</td><td>0.718</td><td>0.567</td><td>0.765</td><td>0.645</td><td>0.706</td><td>0.607</td></tr></table>
|
| 105 |
+
|
| 106 |
+
# 4.3 LEAVE ONE-OPTIMIZER-OUT ANALYSIS
|
| 107 |
+
|
| 108 |
+
Since the aim of NAS-Bench-301 is to allow efficient benchmarking of novel NAS algorithms, it is necessary to ensure that the surrogate model can deliver accurate performance estimation on data from trajectories by unseen NAS methods. Similarly to Eggensperger et al. (2015), we therefore perform a form of cross-validation on the optimizers we used for data collection, i.e. we leave out all data collected by one of the NAS methods entirely during training (using a stratified $0 . 9 / 0 . 1$ train/val split over the other NAS methods). Then, we predict the unseen results from the left-out NAS method to evaluate how well the models extrapolate to the region covered by the ’unseen’ method. We refer to this as the leave-one-optimizer-out (LOOO) setting.
|
| 109 |
+
|
| 110 |
+
Results The results in Table 4 show that the rank correlation between the predicted and observed validation accuracy remains high even when a well-performing optimizer such as RE is left out. Predicting BANANAS in the LOOO fashion yields a lower rank correlation, because it focuses on well-performing architectures that are harder to rank; however, the high $R ^ { 2 }$ shows that the fit is still good.
|
| 111 |
+
|
| 112 |
+
Conversely, leaving out DARTS causes a low $R ^ { 2 }$ but still high sKT; this is due to architectures with many skip connections in the DARTS data that are overpredicted (further discussed in Section 5.2). For full details, Figure 16 in the appendix provides scatter plots of the predicted vs. true performance for each NAS method.
|
| 113 |
+
|
| 114 |
+
# 4.4 NOISE MODELLING
|
| 115 |
+
|
| 116 |
+
Ensemble methods are commonly used to improve predictive performance (Dietterich, 2000). Moreover, ensembles of deep neural networks, so-called deep ensembles, have been proposed as a simple way to obtain predictive uncertainty (Lakshminarayanan et al., 2017). We therefore create an ensemble of 10 base learners for each of our three best performing models (GIN, XGB, LGB) using a 10-fold cross-validation for our train and validation split, as well as different initializations. We use the architectures with multiple evaluations (see Section 3.3) to mirror the analysis in the motivation in Section 2. We train using only one evaluation per architecture (i.e., seed 1) and take the mean accuracy of the remaining ones as groundtruth (i.e., seeds 2-5). We then compare against a tabular model with just one evaluation (seed 1).
|
| 117 |
+
|
| 118 |
+
Table 5 shows that the GIN and LGB surrogate models yield estimates closer to groundtruth than the table lookup based on one evaluation. This confirms our main finding from Section 2, but this time on a much larger search space. We also compare the predictive distribution of our ensembles to the groundtruth. To that end, we assume the noise in the architecture performance to be normally distributed and compute the Kullback–Leibler (KL) divergence between the groundtruth accuracy distribution and
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Model</td><td>MAE 1,[2,3,4,5]</td><td>Mean σ</td><td>KL div.</td></tr><tr><td>Tabular</td><td>1.38e-3</td><td>undef.</td><td>undef.</td></tr><tr><td>GIN</td><td>1.13e-3</td><td>0.6e-3</td><td>16.4</td></tr><tr><td>LGB</td><td>1.33e-3</td><td>0.3e-3</td><td>68.9</td></tr><tr><td>XGB</td><td>1.51e-3</td><td>0.3e-3</td><td>134.4</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 5: Metrics for the selected surrogate models on 500 architectures that were evaluated 5 times.
|
| 123 |
+
|
| 124 |
+
predicted distribution. We find the GIN ensemble to quite clearly provide the best estimate.
|
| 125 |
+
|
| 126 |
+
To allow evaluations of multi-objective NAS methods, and to allow using “simulated wallclock time” on the $\mathbf { X }$ axis of plots, we also predict the runtime of architecture evaluations. For this, we train an LGB model with the runtime as targets (see Appendix D.4 for details). Runtime prediction is less challenging than performance prediction, resulting in an excellent fit of our LGB runtime model on the test set (sKT: 0.936, $R ^ { 2 } \colon 0 . 9 8 7 $ ). Other metrics of architectures, such as the number of parameters and multiply-adds, do not require a surrogate model but can be queried exactly.
|
| 127 |
+
|
| 128 |
+
# 5 NAS-BENCH-301 AS A SURROGATE NAS BENCHMARK
|
| 129 |
+
|
| 130 |
+
Having assessed the ability of the surrogate models to model the search space, we now use NAS-Bench-301 to benchmark various NAS algorithms.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 4: Anytime performance of different optimizers on the real benchmark (left) and the surrogate benchmark (GIN (middle) and XGB (right)) when training ensembles on data collected from all optimizers. Trajectories on the surrogate benchmark are averaged over 5 optimizer runs.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 5: Anytime performance of blackbox optimizers, comparing performance achieved on the real benchmark and on surrogate benchmarks built with GIN and XGB in an LOOO fashion.
|
| 137 |
+
|
| 138 |
+
# 5.1 BLACKBOX OPTIMIZERS
|
| 139 |
+
|
| 140 |
+
We first compare the trajectories on the true benchmark and on the surrogate benchmark for blackbox optimizers when training the surrogate on all data. For the true benchmark, we show the trajectories contained in our dataset (based on a single run, since we could not afford repetitions due to the extreme compute requirements of 115 GPU days for a single run). For the evaluations on the surrogate, on the other hand, we can trivially afford to perform multiple runs. For the surrogate trajectories, we use an identical initialization for the optimizers (e.g., initial population for RE) but evaluations of the surrogate benchmark are done by sampling from the surrogate model’s predictive distribution for the architecture at hand, leading to different trajectories.
|
| 141 |
+
|
| 142 |
+
Results (all data) As Figure 4 shows, both the XGB and the GIN surrogate capture behaviors present on the true benchmark. For instance, the strong improvements of BANANAS and RE are also present on the surrogate benchmark at the correct time. In general, the ranking of the optimizers towards convergence is accurately reflected on the surrogate benchmark. Also, the initial random exploration of algorithms like TPE, RE and DE is captured as the large initial variation in performance indicates. Notably, the XGB surrogate ensemble exhibits a high variation in well-performing regions as well and seems to slightly underestimate the error of the best architectures. The GIN surrogate, on the other hand, shows less variance in these regions but slightly overpredicts for the best architectures.
|
| 143 |
+
|
| 144 |
+
Note, that due to the size of the search space, random search stagnates and cannot identify one of the best architectures even after tens of thousands of evaluations, with BANANAS finding better architectures orders of magnitude faster. This stands in contrast to previous NAS benchmarks. For instance, NAS-Bench-201 (Dong & Yang, 2020) only contains 6466 unique architectures in total, causing the median of random search runs to find the best architecture after only 3233 evaluations.
|
| 145 |
+
|
| 146 |
+
To simulate benchmarking of novel NAS methods, we expand on the leave-one-optimizer-out analysis (LOOO) from Section 4.3 and assess each optimizer with surrogate benchmarks based on data excluding that gathered by said optimizer. We again compare the trajectories obtained from 5 runs on the surrogate benchmark to the groundtruth.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 6: Anytime performance of one-shot optimizers, comparing performance achieved on the real benchmark and on surrogate benchmarks built with GIN and XGB in a LOOO fashion.
|
| 150 |
+
|
| 151 |
+
Results (LOOO) Figure 5 shows the trajectories in the leave-one-optimizer-out setting. The XGB and GIN surrogates again capture the general behavior of different optimizers well, illustrating that characteristics of new optimization algorithms can be captured with the surrogate benchmark. Leaving out DE appears to be a bigger problem for XGB than GIN, pointing to advantages of the smooth embedding learned by the GIN compared to gradient-boosting.
|
| 152 |
+
|
| 153 |
+
In an additional experiment, we found that surrogates built on only well-performing architectures $9 2 \%$ and above) yielded poor extrapolation to worse architectures, but that surrogate benchmarks based on them still yielded realistic trajectories. We attribute this to NAS optimizers’ focus on good architectures. For details, see Appendix E.2. We also investigate whether it is possible to create benchmarks only on random architectures in Appendix E.3, and find that we can indeed obtain realistic trajectories but lose some predictive performance in the well-performing regions. Nevertheless, such benchmarks have the advantage of not possibly favouring any NAS optimizer used for the generation of training data, and we thus recommend their release in addition to the benchmarks based on the full training data.
|
| 154 |
+
|
| 155 |
+
# 5.2 ONE-SHOT OPTIMIZERS
|
| 156 |
+
|
| 157 |
+
NAS-Bench-301 can also be used to monitor the behavior of one-shot NAS optimizers throughout their search phase, by querying the surrogate model with the currently most promising discrete architecture. This can be extremely useful in many scenarios since uncorrelated proxy and true objectives can lead to potential failure modes, e.g., to a case where the found architectures contain only skip connections in the normal cell (Zela et al., 2020a;b; Dong & Yang, 2020) (we study such a failure case in Appendix E.1 to ensure robustness of the surrogates in said case). We demonstrate this use case in a similar LOOO analysis as for the black-box optimizers, using evaluations of the discrete architectures from each search epoch of multiple runs of DARTS, PC-DARTS and GDAS as ground-truth. Figure 6 shows that the surrogate trajectories closely resemble the true trajectories.
|
| 158 |
+
|
| 159 |
+
# 6 USING NAS-BENCH-301 TO DRIVE NAS RESEARCH
|
| 160 |
+
|
| 161 |
+
We finally use our new benchmark to perform a case study that demonstrates how NAS-Bench301 can drive NAS research. Coming up with research hypotheses and drawing conclusions when prototyping or evaluating NAS algorithms on less realistic benchmarks is difficult, particularly when these evaluations require high computational budgets. NAS-Bench-301 alleviates this dilemma via its cheap and reliable estimates.
|
| 162 |
+
|
| 163 |
+
To showcase such a scenario, we evaluate Local Search4 (LS) on our surrogate benchmark and the actual DARTS benchmark. White et al. (2020b) concluded that LS does not perform well on such a large space by running it for 11.8 GPU days $\approx 1 0 ^ { 6 }$ seconds), and we are able to reproduce the same results via NAS-Bench-301 in a few seconds (see Fig 7). While White et al. (2020b) could not afford longer runs (nor repeats), on NAS-Bench-301 this is trivial. Doing so suggests that LS shows qualitatively different behavior when run for an order of magnitude longer, transitioning from being the worst method to being one of the best. We verified this suggestion by running LS for longer on the actual DARTS benchmark (also see Fig 7). This allows us to revise the initial conclusion of White et al. (2020b) to: LS is also state-of-the-art for the DARTS search space, but only when given enough time.
|
| 164 |
+
|
| 165 |
+
This case study shows how NAS-Bench-301 was already used to cheaply obtain hints on a research hypothesis that lead to correcting a previous finding that only held for short runtimes. We look forward to additional uses along such lines.
|
| 166 |
+
|
| 167 |
+
# 7 CONCLUSIONS & GUIDELINES FOR USING NAS-BENCH-301
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 7: Case study results for Local Search. GT is the ground truth, GIN and XGB are results on NAS-Bench-301.
|
| 171 |
+
|
| 172 |
+
We proposed NAS-Bench-301, the first surrogate NAS benchmark and first to cover a realistic search space which is orders of magnitude larger than all previous tabular NAS benchmarks. After motivating the benefits of a surrogate benchmark over a tabular one, we described the strategy used to collect the data which we used to fit our selected surrogate models and evaluated their predictive performance. Lastly, we demonstrated that our surrogate benchmark can accurately simulate real anytime performance trajectories of various NAS methods at a fraction of the true cost and can lead to new scientific findings. We hope that NAS-Bench-301 will allow the NAS practitioner to quickly prototype and benchmark NAS algorithms on the currently most used search space, without requiring large computational resources. We also argue that NAS-Bench-301 could also be used to monitor one-shot optimizers during their search phase, to detect failure cases early on. Finally, the ideas and methods discussed in our work trivially transfer to other search spaces or datasets, allowing for the design of many interesting surrogate benchmarks in the future.
|
| 173 |
+
|
| 174 |
+
Finally, we want to mention the risk that prior knowledge about the surrogate model in NAS-Bench-301 could lead to the design of algorithms that may overfit to the surrogate benchmark. To this end, we recommend the following best practices to ensure a safe and fair benchmarking of NAS methods on NAS-Bench-301 and future surrogate benchmarks:
|
| 175 |
+
|
| 176 |
+
• The surrogate model should be treated as a black-box function, hence only be used for performance prediction and not exploited to extract, e.g., gradient information.
|
| 177 |
+
• We discourage benchmarking methods that internally use the same model as the surrogate model picked in NAS-Bench-301 (e.g. GNN-based Bayesian optimization should not only be benchmarked using the GIN surrogate benchmark).
|
| 178 |
+
• We encourage running experiments on versions of NAS-Bench-301 (and other, future NAS surrogate benchmarks) that are based on (1) all available training architectures and (2) only architectures collected with uninformed methods, such as random search or space-filling designs. As shown in Appendix E.3, (1) yields better predictive models, but (2) avoids any potential bias (in the sense of making more accurate predictions for architectures explored by a particular type of NAS optimizer) and can still yield strong benchmarks.
|
| 179 |
+
• In order to ensure comparability of results in different published papers, we ask users to state the benchmark’s version number. We will continuously collect more training data and further improve the surrogate model predictions. So far, we release NB301-XGB-v1.0, NB301-GINv1.0, NB301-XGB-rand-v1.0, and NB301-GIN-rand-v1.0.
|
| 180 |
+
|
| 181 |
+
Due to the flexibility of surrogate NAS benchmarks to cover arbitrary search spaces, we expect NAS-Bench-301 to be the first of many such benchmarks. We collect best practices for the creation of new surrogate benchmarks in Appendix F. Having access to a variety of benchmarks is essential to the development and evaluation of new NAS methods. We therefore encourage the community to expand the scope of current NAS benchmarks to different search spaces, datasets, and problem domains utilizing surrogate benchmarks to cover large spaces.
|
| 182 |
+
|
| 183 |
+
Acknowledgements We thank the anonymous reviewers for suggesting very insightful experiments, in particular the experiments for NAS benchmarks based only on random architectures.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
N. Awad, N. Mallik, and F. Hutter. Differential evolution for neural architecture search (dehb). In International Conference on Machine Learning (ICLR) Neural Architecture Search (NAS) Workshop, 2020.
|
| 188 |
+
|
| 189 |
+
B. Baker, O. Gupta, R. Raskar, and N. Naik. Accelerating Neural Architecture Search using Performance Prediction. In NeurIPS Workshop on Meta-Learning, 2017.
|
| 190 |
+
|
| 191 |
+
R. Baptista and M. Poloczek. Bayesian optimization of combinatorial structures. In International Conference on Machine Learning (ICLR), pp. 462–471, 2018.
|
| 192 |
+
|
| 193 |
+
J. Bergstra and Y. Bengio. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13:281–305, 2012.
|
| 194 |
+
|
| 195 |
+
J. Bergstra, R. Bardenet, Y. Bengio, and B. Kegl. Algorithms for hyper-parameter optimization. In ´ J. Shawe-Taylor, R. Zemel, P. Bartlett, F. Pereira, and K. Weinberger (eds.), Proceedings of the 25th International Conference on Advances in Neural Information Processing Systems (NIPS’11), pp. 2546–2554, 2011.
|
| 196 |
+
|
| 197 |
+
H. Cai, C. Gan, T. Wang, Z. Zhang, and S. Han. Once-for-all: Train one network and specialize it for efficient deployment. In International Conference on Learning Representations (ICLR), 2020.
|
| 198 |
+
|
| 199 |
+
T. Chen and C. Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pp. 785–794, 2016.
|
| 200 |
+
|
| 201 |
+
X. Chen, R. Wang, M. Cheng, X. Tang, and C. Hsieh. Drnas: Dirichlet neural architecture search. arXiv preprint arXiv:2006.10355, 2020.
|
| 202 |
+
|
| 203 |
+
P. Chrabaszcz, I. Loshchilov, and F. Hutter. A downsampled variant of imagenet as an alternative to the cifar datasets. arXiv preprint arXiv:1707.08819, 2017.
|
| 204 |
+
|
| 205 |
+
B. Deng, J. Yan, and D. Lin. Peephole: Predicting network performance before training. arXiv preprint arXiv:1712.03351, 2017.
|
| 206 |
+
|
| 207 |
+
T. DeVries and G. W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 208 |
+
|
| 209 |
+
T. Dietterich. Ensemble Methods in Machine Learning, volume 1857 of Lecture Notes in Computer Science. Springer Berlin Heidelberg, 2000.
|
| 210 |
+
|
| 211 |
+
T. Domhan, J. T. Springenberg, and F. Hutter. Speeding up automatic hyperparameter optimization of deep neural networks by extrapolation of learning curves. In Q. Yang and M. Wooldridge (eds.), Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI’15), pp. 3460–3468, 2015.
|
| 212 |
+
|
| 213 |
+
X. Dong and Y. Yang. Searching for a robust neural architecture in four gpu hours. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1761–1770, 2019.
|
| 214 |
+
|
| 215 |
+
X. Dong and Y. Yang. Nas-bench-102: Extending the scope of reproducible neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
|
| 216 |
+
|
| 217 |
+
T. Duan, A. Avati, D. Ding, Khanh K. Thai, S. Basu, A. Ng, and A. Schuler. Ngboost: Natural gradient boosting for probabilistic prediction. In Proceedings of Machine Learning and Systems 2020, pp. 6138–6148, 2020.
|
| 218 |
+
|
| 219 |
+
V. P. Dwivedi, C. K. Joshi, T. Laurent, Y. Bengio, and X. Bresson. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020.
|
| 220 |
+
|
| 221 |
+
K. Eggensperger, F. Hutter, H.H. Hoos, and K. Leyton-Brown. Efficient benchmarking of hyperparameter optimizers via surrogates. In B. Bonet and S. Koenig (eds.), Proceedings of the Twentynineth National Conference on Artificial Intelligence (AAAI’15), pp. 1114–1120. AAAI Press, 2015.
|
| 222 |
+
|
| 223 |
+
T. Elsken, J. H. Metzen, and F. Hutter. Efficient multi-objective neural architecture search via lamarckian evolution. In International Conference on Learning Representations, 2019a.
|
| 224 |
+
T. Elsken, J. H. Metzen, and F. Hutter. Neural architecture search: A survey. Journal of Machine Learning Research, 20(55):1–21, 2019b.
|
| 225 |
+
T. Elsken, B. Staffler, J. Metzen, and F. Hutter. Meta-learning of neural architectures for fewshot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12365–12375, 2020.
|
| 226 |
+
F. Errica, M. Podda, D. Bacciu, and A. Micheli. A fair comparison of graph neural networks for graph classification. In International Conference on Learning Representations, 2020.
|
| 227 |
+
S Falkner, A Klein, and F. Hutter. BOHB: Robust and efficient hyperparameter optimization at scale. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1437–1446, 2018.
|
| 228 |
+
M. Fey and J. E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
|
| 229 |
+
D. Friede, J. Lukasik, H. Stuckenschmidt, and M. Keuper. A variational-sequential graph autoencoder for neural architecture performance prediction. ArXiv, abs/1912.05317, 2019.
|
| 230 |
+
D. Golovin and A. Krause. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. Journal of Artificial Intelligence Research, 42:427–486, 2011.
|
| 231 |
+
M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In Proceedings. 2005 IEEE International Joint Conference on Neural Networks, 2005., volume 2, pp. 729–734. IEEE, 2005.
|
| 232 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. In Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 233 |
+
W. Hu, M. Fey, M. Zitnik, Y. Dong, H. Ren, B. Liu, M. Catasta, and J. Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 234 |
+
J. Hwang, S. Lay, and A. Lippman. Nonparametric multivariate density estimation: a comparative study. IEEE Transactions on Signal Processing, 42(10):2795–2810, 1994.
|
| 235 |
+
R. Istrate, F. Scheidegger, G. Mariani, D. Nikolopoulos, C. Bekas, and A. C. I. Malossi. Tapas: Train-less accuracy predictor for architecture search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3927–3934, 2019.
|
| 236 |
+
G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T. Liu. Lightgbm: A highly efficient gradient boosting decision tree. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 3146–3154. Curran Associates, Inc., 2017.
|
| 237 |
+
T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 238 |
+
A. Klein, S. Falkner, J. T. Springenberg, and F. Hutter. Learning curve prediction with Bayesian neural networks. In Proceedings of the International Conference on Learning Representations (ICLR’17). CBLS, 2017.
|
| 239 |
+
N. Klyuchnikov, I. Trofimov, E. Artemova, M. Salnikov, M. Fedorov, and E. Burnaev. Nas-benchnlp: Neural architecture search benchmark for natural language processing. arXiv preprint arXiv:2006.07116, 2020.
|
| 240 |
+
A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 241 |
+
B. Lakshminarayanan, A. Pritzel, and C. Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in neural information processing systems, pp. 6402– 6413, 2017.
|
| 242 |
+
G. Larsson, M. Maire, and G. Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. In International Conference on Learning Representations (ICLR), 2017.
|
| 243 |
+
M. Lindauer and F. Hutter. Best practices for scientific research on neural architecture search. arXiv preprint arXiv:1909.02453, 2019.
|
| 244 |
+
M. Lindauer, K. Eggensperger, M. Feurer, A. Biedenkapp, J. Marben, P. Muller, and F. Hut- ¨ ter. Boah: A tool suite for multi-fidelity bayesian optimization & analysis of hyperparameters. arXiv:1908.06756 [cs.LG], 2019.
|
| 245 |
+
C. Liu, L. Chen, F. Schroff, H. Adam, W. Hua, A. Yuille, and L. Fei-Fei. Auto-deeplab: Hierarchical neural architecture search for semantic image segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 82–92, 2019a.
|
| 246 |
+
H. Liu, K. Simonyan, and Y. Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations, 2019b.
|
| 247 |
+
I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations (ICLR) 2017 Conference Track, April 2017.
|
| 248 |
+
R. Luo, X. Tan, R. Wang, T. Qin, E. Chen, and T. Liu. Neural architecture search with gbdt. arXiv preprint arXiv:2007.04785, 2020.
|
| 249 |
+
M. D. McKay, R. J. Beckman, and W. J. Conover. A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics, 42(1): 55–61, 2000.
|
| 250 |
+
X. Ning, Y. Zheng, T. Zhao, Y. Wang, and H. Yang. A generic graph-based neural architecture encoding scheme for predictor-based nas. arXiv preprint arXiv:2004.01899, 2020.
|
| 251 |
+
C. Oh, J. Tomczak, E. Gavves, and M. Welling. Combinatorial bayesian optimization using the graph cartesian product. In Advances in Neural Information Processing Systems, pp. 2910–2920, 2019.
|
| 252 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, et al. Scikit-learn: Machine learning in python. Journal of machine learning research, 12(Oct):2825–2830, 2011.
|
| 253 |
+
K. Price, R. M. Storn, and J. A. Lampinen. Differential evolution: a practical approach to global optimization. Springer Science & Business Media, 2006.
|
| 254 |
+
E. Real, A. Aggarwal, Y. Huang, and Q. V. Le. Regularized evolution for image classifier architecture search. In Proceedings of the aaai conference on artificial intelligence, volume 33, pp. 4780–4789, 2019.
|
| 255 |
+
T. Saikia, Y. Marrakchi, A. Zela, F. Hutter, and T. Brox. Autodispnet: Improving disparity estimation with automl. In IEEE International Conference on Computer Vision (ICCV), 2019.
|
| 256 |
+
H. Shi, R. Pi, H. Xu, Z. Li, J. T. Kwok, and T. Zhang. Multi-objective neural architecture search via predictive network performance optimization. arXiv preprint arXiv:1911.09336, 2019.
|
| 257 |
+
Y. Shu, W. Wang, and S. Cai. Understanding architectures learnt by cell-based neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
|
| 258 |
+
I. M. Sobol’. On the distribution of points in a cube and the approximate evaluation of integrals. Zhurnal Vychislitel’noi Matematiki i Matematicheskoi Fiziki, 7(4):784–802, 1967.
|
| 259 |
+
C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 260 |
+
M. Tan, B. Chen, R. Pang, V. Vasudevan, and Q. V. Le. Mnasnet: Platform-aware neural architecture search for mobile. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2815–2823, 2018.
|
| 261 |
+
Y. Tang, Y. Wang, Y. Xu, H. Chen, B. Shi, C. Xu, C. Xu, Q. Tian, and C. Xu. A semi-supervised assessor of neural architectures. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 262 |
+
L. van der Maaten and G. Hinton. Visualizing data using t-sne. Journal of Machine Learning Research (JMLR), 9(Nov):2579–2605, 2008.
|
| 263 |
+
W. Wen, H. Liu, H. Li, Y. Chen, G. Bender, and P. Kindermans. Neural predictor for neural architecture search. arXiv preprint arXiv:1912.00848, 2019.
|
| 264 |
+
C. White, W. Neiswanger, and Y. Savani. Bananas: Bayesian optimization with neural architectures for neural architecture search. arXiv preprint arXiv:1910.11858, 2019.
|
| 265 |
+
C. White, W. Neiswanger, S. Nolen, and Y. Savani. A study on encodings for neural architecture search. arXiv preprint arXiv:2007.04965, 2020a.
|
| 266 |
+
C. White, S. Nolen, and Y. Savani. Local search is state of the art for nas benchmarks. arXiv preprint arXiv:2005.02960, 2020b.
|
| 267 |
+
Z. Wu, S. Pan, F. Chen, G. Long, C. Zhang, and P. S. Yu. A comprehensive survey on graph neural networks. arXiv preprint arXiv:1901.00596, 2019.
|
| 268 |
+
K. Xu, W. Hu, J. Leskovec, and S. Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019a.
|
| 269 |
+
Y. Xu, Y. Wang, K. Han, H. Chen, Y. Tang, S. Jui, C. Xu, Q. Tian, and C. Xu. Rnas: Architecture ranking for powerful networks. arXiv preprint arXiv:1910.01523, 2019b.
|
| 270 |
+
Y. Xu, L. Xie, X. Zhang, X. Chen, G. Qi, Q. Tian, and H. Xiong. Pc-darts: Partial channel connections for memory-efficient architecture search. In International Conference on Learning Representations, 2020.
|
| 271 |
+
A. Yang, P. M. Esperanc¸a, and F. M. Carlucci. Nas evaluation is frustratingly hard. arXiv preprint arXiv:1912.12522, 2019.
|
| 272 |
+
C. Ying, A. Klein, E. Christiansen, E. Real, K. Murphy, and F. Hutter. NAS-bench-101: Towards reproducible neural architecture search. 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. 7105–7114, 2019.
|
| 273 |
+
K. Yu, R. Ranftl, and M. Salzmann. How to train your super-net: An analysis of training heuristics in weight-sharing nas. arXiv preprint arXiv:2003.04276, 2020.
|
| 274 |
+
A. Zela, T. Elsken, T. Saikia, Y. Marrakchi, T. Brox, and F. Hutter. Understanding and robustifying differentiable architecture search. In International Conference on Learning Representations, 2020a.
|
| 275 |
+
A. Zela, J. Siems, and F. Hutter. Nas-bench-1shot1: Benchmarking and dissecting one-shot neural architecture search. In International Conference on Learning Representations, 2020b.
|
| 276 |
+
H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz. mixup: Beyond empirical risk minimization. International Conference on Learning Representations, 2018.
|
| 277 |
+
J. Zhou, G. Cui, Z. Zhang, C. Yang, Z. Liu, L. Wang, C. Li, and M. Sun. Graph neural networks: A review of methods and applications. arXiv preprint arXiv:1812.08434, 2018.
|
| 278 |
+
B. Zoph and Q. V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR) 2017 Conference Track, 2017.
|
| 279 |
+
|
| 280 |
+
# A RELATED WORK
|
| 281 |
+
|
| 282 |
+
# A.1 EXISTING NAS BENCHMARKS
|
| 283 |
+
|
| 284 |
+
Benchmarks for NAS were introduced only recently with NAS-Bench-101 (Ying et al., 2019) as the first among them. NAS-Bench-101 is a tabular benchmark consisting of ${ \sim } 4 2 3 \mathrm { k }$ unique architectures in a cell structured search space evaluated on CIFAR-10 (Krizhevsky, 2009). To restrict the number of architectures in the search space, the number of nodes and edges was given an upper bound and only three operations are considered. One result of this limitation is that One-Shot NAS methods can only be applied to subspaces of NAS-Bench-101 as demonstrated in NAS-Bench-1Shot1 (Zela et al., 2020b).
|
| 285 |
+
|
| 286 |
+
NAS-Bench-201 (Dong & Yang, 2020), in contrast, uses a search space with a fixed number of nodes and edges, hence allowing for a straight-forward application of one-shot NAS methods. However, this limits the total number of unique architectures to as few as 6466. NAS-Bench-201 includes evaluations of all these architectures on three different datasets, namely CIFAR-10, CIFAR100 (Krizhevsky, 2009) and Downsampled Imagenet $1 6 \times 1 6$ (Chrabaszcz et al., 2017), allowing for transfer learning experiments.
|
| 287 |
+
|
| 288 |
+
NAS-Bench-NLP (Klyuchnikov et al., 2020) was recently proposed as a tabular benchmark for NAS in the Natural Language Processing domain. The search space resembles NAS-Bench-101 as it limits the number of edges and nodes to constrain the search space size resulting in $1 4 \mathrm { k }$ evaluated architectures.
|
| 289 |
+
|
| 290 |
+
# A.2 NEURAL NETWORK PERFORMANCE PREDICTION
|
| 291 |
+
|
| 292 |
+
In the past, several works have attempted to predict the performance of neural networks by extrapolating learning curves (Domhan et al., 2015; Klein et al., 2017; Baker et al., 2017). A more recent line of work in performance prediction focuses more on feature encoding of neural architectures. Peephole (Deng et al., 2017) and TAPAS (Istrate et al., 2019) both use an LSTM to aggregate information about the operations in chain-structured architectures. On the other hand, BANANAS (White et al., 2019) introduces a path-based encoding of cells that automatically resolves the computational equivalence of architectures.
|
| 293 |
+
|
| 294 |
+
Graph Neural Networks (GNNs) (Gori et al., 2005; Kipf & Welling, 2017; Zhou et al., 2018; Wu et al., 2019) with their capability of learning representations of graph-structured data appear to be a natural choice to learning embeddings of NN architectures. Shi et al. (2019) and Wen et al. (2019) trained a Graph Convolutional Network (GCN) on a subset of NAS-Bench-101 (Ying et al., 2019) showing its effectiveness in predicting the performance of unseen architectures. Moreover, Friede et al. (2019) propose a new variational-sequential graph autoencoder (VS-GAE) which utilizes a GNN encoder-decoder model in the space of architectures and generates valid graphs in the learned latent space.
|
| 295 |
+
|
| 296 |
+
Several recent works further adapt the GNN message passing to embed architecture bias via extra weights to simulate the operations such as in GATES (Ning et al., 2020) or integrate additional information on the operations (e.g. flop count) (Xu et al., 2019b). Tang et al. (2020) chose to operate GNNs on relation graphs based on architecture embeddings in a metric learning setting, allowing to pose NAS performance prediction as a semi-supervised setting.
|
| 297 |
+
|
| 298 |
+
# B TRAINING DETAILS FOR THE GIN IN THE MOTIVATION
|
| 299 |
+
|
| 300 |
+
We set the GIN to have a hidden dimension of 64 with 4 hidden layers resulting in around ${ \sim } 4 0 \mathrm { k }$ parameters. We trained for 30 epochs with a batch size of 128. We chose the MSE loss function and add a logarithmic transformation to emphasize the data fit on well-performing architectures.
|
| 301 |
+
|
| 302 |
+
Table 6: MSE and Kendall tau correlation between performance predicted by a tab./surr. benchmark fitted with one seed each, and the true performance of evaluations with the two other seeds (see Section 2). Test seeds in brackets.
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Model</td><td colspan="3">Mean Squared Error (MSE)</td><td colspan="3">Kendall tau</td></tr><tr><td></td><td>1,[2,3]</td><td>2,[1,3]</td><td>3,[1,2]</td><td>1,[2,3]</td><td>2,[1,3]</td><td>3,[1,2]</td></tr><tr><td>Tab.</td><td>5.44e-5</td><td>5.43e-5</td><td>5.34e-5</td><td>0.83</td><td>0.83</td><td>0.83</td></tr><tr><td>Surr.</td><td>3.02e-5</td><td>3.07e-5</td><td>3.02e-5</td><td>0.87</td><td>0.87</td><td>0.87</td></tr></table>
|
| 305 |
+
|
| 306 |
+
# C NAS-BENCH-301 DATASET
|
| 307 |
+
|
| 308 |
+
# C.1 SEARCH SPACE
|
| 309 |
+
|
| 310 |
+
We use the same architecture search space as in DARTS (Liu et al., 2019b). Specifically, the normal and reduction cell each consist of a DAG with 2 input nodes (receiving the output feature maps from the previous and previous-previous cell), 4 intermediate nodes (each adding element-wise feature maps from two previous nodes in the cell) and 1 output node (concatenating the outputs of all intermediate nodes). Input and intermediate nodes are connected by directed edges representing one of the following operations: Sep. conv $3 \times 3$ , Sep. conv $5 \times 5$ , Dil. conv $3 \times 3$ , Dil. conv $5 \times 5$ , Max pooling $3 \times 3$ , Avg. pooling $3 \times 3$ , Skip connection.
|
| 311 |
+
|
| 312 |
+
# C.2 DATA COLLECTION
|
| 313 |
+
|
| 314 |
+
To achieve good global coverage, we use random search to evaluate ${ \sim } 2 3 \mathrm { k }$ architectures. We note that space-filling designs such as quasi-random sequences, e.g. Sobol sequences (Sobol’, 1967), or Latin Hypercubes (McKay et al., 2000) and Adaptive Submodularity (Golovin & Krause, 2011) may also provide good initial coverage.
|
| 315 |
+
|
| 316 |
+
Random search is supplemented by data which we collect from running a variety of optimizers, representing Bayesian Optimization (BO), evolutionary algorithms and One-Shot Optimizers. We used Tree-of-Parzen-Estimators (TPE) (Bergstra et al., 2011) as implemented by Falkner et al. (2018) as a baseline BO method. Since several recent works have proposed to apply BO over combinatorial spaces (Oh et al., 2019; Baptista & Poloczek, 2018) we also used COMBO (Oh et al., 2019). We included BANANAS (White et al., 2019) as our third BO method, which uses a neural network with a path-based encoding as a surrogate model and hence scales better with the number of function evaluations. As two representatives of evolutionary approaches to NAS, we chose Regularized Evolution (RE) (Real et al., 2019) as it is still one of the state-of-the art methods in discrete NAS and Differential Evolution (Price et al., 2006) as implemented by Awad et al. (2020). Accounting for the surge in interest in One-Shot NAS, our collected data collection also entails evaluation of architectures from search trajectories of DARTS (Liu et al., 2019b), GDAS (Dong & Yang, 2019), DrNAS (Chen et al., 2020) and PC-DARTS (Xu et al., 2020). For details on the architecture training details, we refer to Section C.6.
|
| 317 |
+
|
| 318 |
+
For each architecture $a \in { \mathcal { A } }$ , the dataset contains the following metrics: train/validation/test accuracy, training time and number of model parameters.
|
| 319 |
+
|
| 320 |
+
# C.3 DETAILS ON EACH OPTIMIZER
|
| 321 |
+
|
| 322 |
+
In this section we provide the hyperparameters used for the evaluations of NAS optimizers for the collection of our dataset. Many of the optimizers require a specialized representation to function on an architecture space because most of them are general HPO optimizers. As recently shown by White et al. (2020a), this representation can be critical for the performance of a NAS optimizer. Whenever the representation used by the Optimizer did not act directly on the graph representation, such as in RE, we detail how we represented the architecture for the optimizer. All optimizers were set to optimize the validation error.
|
| 323 |
+
|
| 324 |
+
BANANAS. We initialized BANANAS with 100 random architectures and modified the optimization of the surrogate model neural network, by adding early stopping based on a $90 \% / 1 0 \%$ train/validation split and lowering the number of ensemble models to be trained from 5 to 3. These changes to bananas avoided a computational bottleneck in the training of the neural network.
|
| 325 |
+
|
| 326 |
+
COMBO. COMBO only attempts to maximize the acquisition function after the entire initial design (100 architectures) has completed. For workers which are done earlier, we sample a random architecture, hence increasing the initial design by the number of workers (30) we used for running the experiments. The search space considered in our work is larger than all search spaces evaluated in COMBO (Oh et al., 2019) and we regard not simply binary architectural choices, as we have to make choices about pairs of edges. Hence, we increased the number of initial samples for ascent acquisition function optimization from 20 to 30. Unfortunately, the optimization of the GP already became the bottleneck of the BO after around 600 function evaluations, leading to many workers waiting for new jobs to be assigned.
|
| 327 |
+
|
| 328 |
+
Representation: In contrast to the COMBO’s original experimental setting, the DARTS search requires choices based on pairs of parents of intermediate nodes where the number of choices increase with the index of the intermediate nodes. The COMBO representation therefore consists of the graph cartesian product of the combinatorial choice graphs, increasing in size with each intermediate node. In addition, there exist 8 choices over the number of parameters for the operation in a cell.
|
| 329 |
+
|
| 330 |
+
Differential Evolution. DE was started with a generation size of 100. As we used a parallelized implementation, the workers would have to wait for one generation plus its mutations to be completed for selection to start. We decided to keep the workers busy by training randomly sampled architectures in this case, as random architectures provide us good coverage of the space. However, different methods using asynchronous DE selection would also be possible. Note, that the DE implementation by Awad et al. (2020), performs boundary checks and resamples components of any individual that exceeds 1.0. We use the rand1 mutation operation which generally favors exploration over exploitation.
|
| 331 |
+
|
| 332 |
+
Representation: DE uses a vector representation for each individual in the population. Categorical choices are scaled to lie within the unit interval [0, 1] and are rounded to the nearest category when converting back to the discrete representation in the implementation by Awad et al. (2020). Similarly to COMBO, we represent the increasing number of parent pair choices for the intermediate nodes by interpreting the respective entries to have an increasing number of sub-intervals in [0, 1].
|
| 333 |
+
|
| 334 |
+
DARTS, GDAS, PC-DARTS and DrNAS. We collected the architectures found by all of the above one-shot optimizers with their default search hyperparameters. We performed multiple searches for each one-shot optimizer.
|
| 335 |
+
|
| 336 |
+
RE. To allow for a good initial coverage before mutations start, we decided to randomly sample 3000 architectures as initial population. RE then proceeds with a sample size of 100 to extract well performing architectures from the population and mutates them. During mutations RE first decides whether to mutate the normal or reduction cell and then proceeds to perform either a parent change, an operation change or no mutation.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 8: Empirical Cumulative Density Function (ECDF) plot comparing all optimizers in the dataset. Optimizers which cover good regions of the search space feature higher values in the low validation error region.
|
| 340 |
+
|
| 341 |
+
TPE. For TPE we use the default settings as also used by BOHB. We use the Kernel-DensityEstimator surrogate model and build two models where the good configs are chosen as the top $15 \%$ . The acquisition function’s expected improvement is optimized by sampling 64 points.
|
| 342 |
+
|
| 343 |
+
# C.4 OPTIMIZER PERFORMANCE
|
| 344 |
+
|
| 345 |
+
The trajectories from the different NAS optimizers yield quite different performance distributions. This can be seen in Figure 8 which shows the ECDF of the validation errors of the architectures evaluated by each optimizer. As the computational budgets allocated to each optimizer vary widely, this data does not allow for a fair comparison between the optimizers. However, it is worth mentioning that the evaluations of BANANAS feature the best distribution of architecture performances, followed by PC-DARTS, DrNAS, DE, GDAS, and RE. TPE only evaluated marginally better architectures than RS, while COMBO and DARTS evaluated the worst architectures.
|
| 346 |
+
|
| 347 |
+
We also perform a t-SNE analysis on the data collected by the different optimizers in Figure 9. We find that RE discovers well-performing architectures which form clusters distinct from the architectures found via RS. We observe that COMBO searched previously unexplored areas of the search space. BANANAS, which found some of the best architectures, explores clusters outside the main cluster. However, it heavily exploits regions at the cost of exploration. We argue that this is a result of the optimization of the acquisition function via random mutations based on the previously found iterates, rather than on new random architectures. DE is the only optimizer which finds well performing architectures in the center of the embedding space.
|
| 348 |
+
|
| 349 |
+
# C.5 CELL TOPOLOGY, OPERATIONS AND NOISE
|
| 350 |
+
|
| 351 |
+
In this section, we investigate the influence of the cell topology and the operations on the performance of the architectures in our setting. The discovered properties of the search space inform our choice of metrics for the evaluation of different surrogate models.
|
| 352 |
+
|
| 353 |
+
First, we study how the validation error depends on the depth of architectures. Figure 10 visualizes the performance distribution of normal and reduction cells of different depth5 by approximating empirical distributions with a kernel density estimation used in violin plots (Hwang et al., 1994). We observe that the performance distributions are similar for the normal and reduction cells with the same cell depth. Although cells of all depths can reach high performances, shallower cells seem slightly favored. Note that these observations are subject to changes in the hyperparameter setting, e.g. training for more epochs may render deeper cells more competitive. The best-found architecture features a normal and reduction cell of depth 4. Color-coding the cell depth in our t-SNE projection also confirms that the t-SNE analysis captures the cell depth well as a structural property (c.f. Figure 13). It also reinforces that the search space is well-covered.
|
| 354 |
+
|
| 355 |
+
We also show the distribution of normal and reduction cell depths of each optimizer in Figure 11 to get a sense for the diversity between the discovered architectures. We observe that DARTS and BANANAS generally find architectures with a shallow reduction cell and a deeper normal cell, while the reverse is true for RE. DE, TPE, COMBO and RS appear to find normal and reduction cells with similar cell depth.
|
| 356 |
+
|
| 357 |
+
Aside from the cell topology, we can also use our dataset to study the influence of operations to the architecture performance. The DARTS search space contains operation choices without parameters such as Skip-Connection, Max Pooling $3 \times 3$ and Avg Pooling $3 \times 3$ . We visualize the influence of these parameter-free operations on the validation error in the normal and reduction cell in Figure 18a, respectively Figure 14. While pooling operations in the normal cell seem to have a negative impact on performance, a small number of skip connections improves the overall performance. This is somewhat expected, since the normal cell is dimension preserving and skip connections help training by improving gradient flow like in ResNets (He et al., 2016). In the reduction cell, the number of parameter-free operations has less effect as shown in Figure 14. In contrast to the normal cell where 2-3 skipconnections lead to generally better performance, the reduction cell shows no similar trend. For both cells, however, featuring many parameter-free operations significantly deteriorates performance. We therefore expect that a good surrogate also models this case as a poorly performing region.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 12: Standard deviation of the val. accuracy for multiple architecture evaluations.
|
| 361 |
+
|
| 362 |
+
# C.6 TRAINING DETAILS
|
| 363 |
+
|
| 364 |
+
Each architecture was evaluated on CIFAR-10 (Krizhevsky, 2009) using the standard 40k, 10k, 10k split for train, validation and test set. The networks were trained using SGD with momentum 0.9, initial learning rate of 0.025 and a cosine annealing schedule (Loshchilov & Hutter, 2017), annealing towards 10−8.
|
| 365 |
+
|
| 366 |
+
We apply a variety of common data augmentation techniques which differs from previous NAS benchmarks where the training accuracy of many evaluated architectures reached $100 \%$ (Ying et al., 2019; Dong & Yang, 2020) indicating overfitting on the training set. We used CutOut (DeVries & Taylor, 2017) with cutout length 16 and MixUp (Zhang et al., 2018) with alpha 0.2. For regularization, we used an auxiliary tower (Szegedy et al., 2015) with a weight of 0.4 and DropPath (Larsson et al., 2017) with drop probability of 0.2. We trained each architecture for 100 epochs with a batch size of 96, using 32 initial channels and 8 cell layers. We chose these values to be close to the proxy model used by DARTS while also achieving good performance.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 9: Visualization of the exploration of different parts of the architectural t-SNE embedding space for all optimizers used for data collection. The architecture ranking by validation accuracy (lower is better) is global over the entire data collection of all optimizers.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 10: Distribution of the validation error for different cell depth.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 11: Comparison between the normal and reduction cell depth for the architectures found by each optimizer.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 13: t-SNE projection colored by the depth of the normal cell.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 14: Distribution of validation error in dependence of the number of parameter-free operations in the reduction cell. Violin plots are cut off at the respective observed minimum and maximum value.
|
| 382 |
+
|
| 383 |
+
# D SURROGATE MODEL ANALYSIS
|
| 384 |
+
|
| 385 |
+
# D.1 PREPROCESSING OF THE GRAPH TOPOLOGY
|
| 386 |
+
|
| 387 |
+
DGN preprocessing All DGN were implemented using PyTorch Geometric (Fey & Lenssen, 2019) which supports the aggregation of edge attributes. Hence, we can naturally represent the DARTS architecture cells, by assigning the embedded operations to the edges. The nodes are labeled as input, intermediate and output nodes. We represent the DARTS graph as shown in Figure 15, by connecting the output node of each cell type with the inputs of the other cell, allowing information from both cells to be aggregated per node during message passing. Note the self-loop on the output node of the normal cell, which we found necessary to get the best performance.
|
| 388 |
+
|
| 389 |
+
Preprocessing for other surrogate models Since we make use of the framework implemented by BOHB (Falkner et al., 2018) to easily parallelize the architecture search algorithms across many compute nodes, we also represent our search space using ConfigSpace 6 (Lindauer et al., 2019). More precisely, we encode each pair of incoming edges for a cell as one choice of a categorical parameter. For instance, for node 4 in the normal cell, we add a parameter inputs node normal 4 with the choices of edge pairs 0 1,0 2,0 3,1 2,1 3,2 3. The edge operations are then implemented as categorical parameters for each edge and are only active if the corresponding edge was chosen. For instance, in the example above, if the incoming edge 0 is sampled, the parameter associated with the edge from node 0 to node 4 becomes activate and one operation is sampled. We provide the configuration space with our code. For all non-DGN based surrogate models, we use the vector representation of a configuration given by ConfigSpace as input to the model. This vector representation contains one value between 0 and 1 for each parameter in the configuration space.
|
| 390 |
+
|
| 391 |
+
# D.2 DETAILS ON THE GIN
|
| 392 |
+
|
| 393 |
+
The GIN implementation on the Open Graph Benchmark (OGB) (Hu et al., 2020) uses virtual nodes (additional nodes which are connected to all nodes in the graph) to boost performance as well as generalization and consistently achieves good performance on their public leaderboards. Other GNNs from Errica et al. (2020), such as DGCNN and DiffPool, performed worse in our initial experiments and are therefore not considered.
|
| 394 |
+
|
| 395 |
+
Following recent work in Predictor-based NAS (Ning et al., 2020; Xu et al., 2019b), we use a per batch ranking loss because the ranking of an architecture is equally important to an accurate prediction of the validation accuracy in a NAS setting. We use the ranking loss formulation by GATES (Ning et al., 2020) which is a hinge pair-wise ranking loss with margin $\mathrm { { m } = 0 . 1 }$ .
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 15: Architecture with inputs in green, intermediate nodes in blue and outputs in red.
|
| 399 |
+
|
| 400 |
+
# D.3 DETAILS ON HPO
|
| 401 |
+
|
| 402 |
+
All detailed table for the hyperparameter ranges for the HPO and the best values found by BOHB are listed in Table 7.
|
| 403 |
+
|
| 404 |
+
# D.4 HPO FOR RUNTIME PREDICTION MODEL
|
| 405 |
+
|
| 406 |
+
Our runtime prediction model is an LGB model trained on the runtimes of architecture evaluations of DE. This is because we partially evaluated the architectures utilizing different CPUs. Hence, we only choose to train on the evaluations carried out by the same optimizer on the same hardware to keep a consistent estimate of the runtime. DE is a good choice in this case because it both explored and exploited the architecture space well. The HPO space used for the LGB runtime model is the same used for the LGB surrogate model.
|
| 407 |
+
|
| 408 |
+
# D.5 LEAVE ONE-OPTIMIZER-OUT ANALYSIS
|
| 409 |
+
|
| 410 |
+
A detailed scatter plot of the predicted performance against the true performance for each optimizer and surrogate model in an LOOO analysis is provided in Figure 16 and Figure 17.
|
| 411 |
+
|
| 412 |
+
# D.6 PARAMETER-FREE OPERATIONS
|
| 413 |
+
|
| 414 |
+
Several works have found that methods based on DARTS (Liu et al., 2019b) are prone to finding sub-optimal architectures that contain many, or even only, parameter-free operations (max. pooling, avg. pooling or skip connections) and perform poorly (Zela et al., 2020a). We therefore evaluated the surrogate models on such architectures by replacing a random selection of operations in a cell with one type of parameter-free operations to match a certain ratio of parameter-free operations in a cell. This analysis is carried out over the test set of the surrogate models and hence contains architectures collected by all optimizers. For a more robust analysis, we repeated this experiment 4 times for each ratio of operations to replace.
|
| 415 |
+
|
| 416 |
+
Results Figure 18 shows that both the GIN and the XGB model correctly predict that the accuracy drops with too many parameter-free operations, particularly for skip connections. The groundtruth of architectures with only parameter-free operations is displayed as scatter plot. Out of the two models,
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 16: Scatter plots of the predicted performance against the true performance of different surrogate models on the test set in a Leave-One-Optimizer-Out setting.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 17: (continued) Scatter plots of the predicted performance against the true performance of different surrogate models on the test set in a Leave-One-Optimizer-Out setting.
|
| 423 |
+
|
| 424 |
+
Table 7: Hyperparameters of the surrogate models and the default values found via HPO.
|
| 425 |
+
|
| 426 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Hyperparameter</td><td rowspan="2">Range</td><td rowspan="2">Log-transform</td><td rowspan="2">Default Value</td></tr><tr><td></td></tr><tr><td rowspan="11">GIN</td><td>Hidden dim.</td><td>[16,256]</td><td>true</td><td>24</td></tr><tr><td>Num.Layers</td><td>[2,10]</td><td>false</td><td>8</td></tr><tr><td>Dropout Prob.</td><td>[0,1]</td><td>false</td><td>0.035</td></tr><tr><td>Learning rate</td><td>[1e-3,1e-2]</td><td>true</td><td>0.0777</td></tr><tr><td>Learning rate min.</td><td>const.</td><td>=</td><td>0.0</td></tr><tr><td>Batch size</td><td>const.</td><td></td><td>51</td></tr><tr><td>Undirected graph</td><td>[true, false]</td><td></td><td>false</td></tr><tr><td>Pairwise ranking loss</td><td>[true, false]</td><td></td><td>true</td></tr><tr><td>Self-Loops</td><td>[true, false]</td><td></td><td>false</td></tr><tr><td>Loss log transform</td><td>[true, false]</td><td></td><td>true</td></tr><tr><td>Node degree one-hot</td><td>const.</td><td></td><td>true</td></tr><tr><td rowspan="8">BANANAS</td><td>Num. Layers</td><td>[1,10]</td><td>true</td><td>17</td></tr><tr><td>Layer width</td><td>[16,256]</td><td>true</td><td>31</td></tr><tr><td>Dropout Prob.</td><td>const.</td><td></td><td>0.0</td></tr><tr><td>Learning rate</td><td>[le-3,le-1]</td><td>true</td><td>0.0021</td></tr><tr><td>Learning rate min.</td><td>const.</td><td></td><td>0.0</td></tr><tr><td>Batch size</td><td>[16,128]</td><td></td><td>122</td></tr><tr><td>Loss log transform</td><td>[true, false]</td><td></td><td>true</td></tr><tr><td>Pairwise ranking loss</td><td>[true, false]</td><td></td><td>false</td></tr><tr><td rowspan="11">XGBoost</td><td>Early Stopping</td><td>const.</td><td></td><td>100</td></tr><tr><td>Rounds Booster</td><td></td><td></td><td></td></tr><tr><td></td><td>const.</td><td></td><td>gbtree 13</td></tr><tr><td>Max.depth Min. child weight</td><td>[1,15]</td><td>false</td><td>39</td></tr><tr><td>Col.sample bylevel</td><td>[1,100]</td><td>true</td><td></td></tr><tr><td></td><td>[0.0,1.0]</td><td>false</td><td>0.6909</td></tr><tr><td>Col.sample bytree lambda</td><td>[0.0, 1.0]</td><td>false</td><td>0.2545</td></tr><tr><td>alpha</td><td>[0.001,1000] [0.001,1000]</td><td>true</td><td>31.3933 0.2417</td></tr><tr><td>Learning rate</td><td>[0.001,0.1]</td><td>true true</td><td>0.00824</td></tr><tr><td>Early stop. rounds</td><td></td><td></td><td></td></tr><tr><td></td><td>const.</td><td></td><td>100</td></tr><tr><td rowspan="11">LGBoost Random</td><td>Max.depth</td><td>[1,25]</td><td>false</td><td>18</td></tr><tr><td>Num. leaves</td><td>[10,100]</td><td>false</td><td>40</td></tr><tr><td>Max.bin</td><td>[100,400]</td><td>false</td><td>336</td></tr><tr><td>Feature Fraction</td><td>[0.1, 1.0]]</td><td>false</td><td>0.1532</td></tr><tr><td>Min. child weight</td><td>[0.001,10]</td><td>true</td><td>0.5822</td></tr><tr><td>Lambda L1</td><td>[0.001,1000]</td><td>true</td><td>0.0115</td></tr><tr><td>Lambda L2</td><td>[0.001,1000]</td><td>true</td><td>134.5075</td></tr><tr><td>Boosting type Learning rate</td><td>const.</td><td>-</td><td>gbdt</td></tr><tr><td></td><td>[0.001, 0.1]</td><td>true</td><td>0.0218</td></tr><tr><td>Num.estimators</td><td>[16,128]</td><td>true</td><td>116</td></tr><tr><td>Min. samples split. Min. samples leaf</td><td>[2,20]</td><td>false</td><td>2</td></tr><tr><td>Forest</td><td>[1,20]</td><td>false</td><td>2</td></tr><tr><td rowspan="8">e-SVR</td><td>Max.features</td><td>[0.1, 1.0]</td><td>false</td><td>0.1706</td></tr><tr><td>Bootstrap</td><td>[true, false]</td><td></td><td>false</td></tr><tr><td>C</td><td>[1.0,20.0]</td><td>true</td><td>3.066</td></tr><tr><td>coef.0 degree</td><td>[-0.5,0.5] [1,128]</td><td>false</td><td>0.1627 1</td></tr><tr><td>epsilon</td><td>[0.01,0.99]</td><td>true true</td><td>0.0251</td></tr><tr><td>gamma</td><td>[scale,auto]</td><td>=</td><td>auto</td></tr><tr><td>kernel</td><td>[linear,rbf,poly,sigmoid]</td><td></td><td>sigmoid</td></tr><tr><td>shrinking</td><td>[true, false]</td><td></td><td>false</td></tr><tr><td rowspan="10">μ-SVR</td><td>tol</td><td></td><td></td><td>0.0021</td></tr><tr><td></td><td>[0.0001,0.01]</td><td>-</td><td></td></tr><tr><td>C</td><td>[1.0,20.0]</td><td>true</td><td>5.3131</td></tr><tr><td>coef. 0</td><td>[-0.5,0.5]</td><td>false</td><td>-0.3316</td></tr><tr><td>degree</td><td>[1,128]</td><td>true</td><td>128</td></tr><tr><td>gamma</td><td>[scale,auto]</td><td></td><td>scale</td></tr><tr><td>kernel</td><td>[linear,rbf,poly,sigmoid]</td><td></td><td>rbf</td></tr><tr><td>nu</td><td>[0.01, 1.0]</td><td>false</td><td>0.1839</td></tr><tr><td>shrinking</td><td>[true, false]</td><td></td><td></td></tr><tr><td>tol</td><td>[0.0001,0.01]</td><td>=</td><td>true 0.003</td></tr></table>
|
| 427 |
+
|
| 428 |
+
XGB captures the slight performance improvement of using a few skip connections better. LGB failed to capture this trend but performed very similarly to XGB for the high number of parameterfree operations.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 18: (Left) Distribution of validation error in dependence of the number of parameter-free operations in the normal cell on the NAS-Bench-301 dataset. (Middle and Right) Predictions of the GIN and XGB surrogate model. The collected groundtruth data is shown as scatter plot. Violin plots are cut off at the respective observed minimum and maximum value.
|
| 432 |
+
|
| 433 |
+
# D.7 CELL TOPOLOGY ANALYSIS
|
| 434 |
+
|
| 435 |
+
Furthermore, we analyze how accurate changes in the cell topology (rather than in the operations) are modeled by the surrogates. We collected groundtruth data by evaluating all Q4k=1 $\begin{array} { r } { \prod _ { k = 1 } ^ { 4 } \frac { ( k + 1 ) k } { 2 } = 1 8 0 } \end{array}$ different cell topologies (not accounting for isomorphisms) with fixed sets of operations. We assigned the same architecture to the normal and reduction cell, to focus on the effect of the cell topology. We sampled 10 operation sets uniformly at random, leading to 1800 architectures as groundtruth for this analysis.
|
| 436 |
+
|
| 437 |
+
We evaluated all architectures and group the results based on the cell depth. For each of the possible cell depths, we then computed the sparse Kendall $\tau$ rank correlation between the predicted and true validation accuracy.
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Figure 19: Comparison between GIN, XGB and LGB in the cell topology analysis.
|
| 441 |
+
|
| 442 |
+
Results Results of the cell topology analysis are shown in Figure 19. We observe that LGB slightly outperforms XGB, both of which perform better on deeper cells. The GIN performs best for the shallowest cells.
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
Figure 20: Ground truth (GT) and surrogate trajectories on a constrained search space where the surrogates are trained with all data, leaving out the trajectories under consideration (LOTO), and leaving out all DARTS architectures (LOOO).
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
Figure 22: Comparison between the observed true trajectory of BANANAS and RS with the surrogate benchmarks only trained on well performing regions of the space
|
| 449 |
+
|
| 450 |
+
# E BENCHMARK ANALYSIS
|
| 451 |
+
|
| 452 |
+
# E.1 ONE-SHOT TRAJECTORIES
|
| 453 |
+
|
| 454 |
+
To obtain groundtruth trajectories for DARTS, PC-DARTS and GDAS, we performed 5 runs for each optimizer with 50 search epochs and evaluated the architecture obtained by discretizing the one-shot model at each search epoch. For DARTS, in addition to the default search space, we collected trajectories on the constrained search spaces from Zela et al. (2020a) to cover a failure case where DARTS diverges and finds architectures that only contain skip connections in the normal cell. To show that our benchmark is able to predict this divergent behavior, we show surrogate trajectories when training on all data, when leaving out the trajectories under consideration from the training data, and when leaving out all DARTS data in Figure 20.
|
| 455 |
+
|
| 456 |
+
While the surrogates model the divergence in all cases, they still overpredict the architectures with only skip connections in the normal cell especially when leaving out all data from DARTS. The bad performance of these architectures is predicted more accurately when including data from other DARTS runs. This can be attributed to the fact that the surrogate models have not seen any, respectively very few data, in this region of the search space. Nevertheless, it is modeled as a badperforming region and we expect that this could be further improved on by including additional training data accordingly, since including all data in training shows that the models are capable to of capturing this behavior.
|
| 457 |
+
|
| 458 |
+
# E.2 ABLATION STUDY: FITTING SURROGATE MODELS ONLY ON WELL-PERFORMING REGIONS OF THE SEARCH SPACE
|
| 459 |
+
|
| 460 |
+
To assess whether poorly-performing architectures are important for the surrogate benchmark, we fitted a GIN ensemble and an XGB ensemble model only on architectures that achieved a validation accuracy above $92 \%$ . We then tested on all architectures that achieved a validation below $92 \%$ .
|
| 461 |
+
|
| 462 |
+
Indeed, we observe that the resulting surrogate model overpredicts accuracy in regions of the space with poor performance, resulting in a low $R ^ { 2 }$ of -0.142 and sparse Kendall tau of 0.293 for the GIN. The results for one member of the GIN ensemble are shown in Figure 21. The XGB model achieved similar results. Next, to study whether these weaker surrogate models can still be used to benchmark NAS optimizers, we also studied optimization trajectories of NAS optimizers on surrogate benchmarks based on these surrogate models. Figure 22 shows that these surrogate models indeed suffice to accurately predict the performance achieved by Random Search and BANANAS as a function of time.
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
Figure 21: Scatter plot of GIN predictions on architectures that achieved below $92 \%$ validation accuracy.
|
| 466 |
+
|
| 467 |
+
E.3 ABLATION STUDY: FITTING SURROGATE MODELS ONLY WITH RANDOM DATA
|
| 468 |
+
|
| 469 |
+
In this section, we would like to take the Leave-One-Optimizer-Out analysis from Section 5.1 one step further by leaving out all architectures that were collected from NAS optimizers other than random search. While the LOOO analysis removes some “bias” from the benchmark (“bias” referring to its precision in a subspace), there still is the possibility that different optimizers we used explore similar subspaces, and leaving out one of them still yields “bias” induced by architectures from a similar optimizer used for generating training data. For instance, the t-SNE analysis from Figure 9 suggests that some optimizers exploit very distinct regions (e.g., BANANAS and DE) while others exploit regions somewhat similar to others (e.g., RE and PC-DARTS). The exploration behavior, on the other hand, is quite similar across optimizers since most of them perform random sampling in the beginning. Thus, in the following, we investigate whether we can create a benchmark that has no prior information about solutions any optimizer might find.
|
| 470 |
+
|
| 471 |
+
To that end, we studied surrogate models based i) only on the 23746 architectures explored by random search and ii) only on 23 746 $( 4 7 . 3 \% )$ architectures of the original training set (sampled in a stratified manner, i.e., using $4 7 . 3 \%$ of the architectures from each of our sources of architectures).
|
| 472 |
+
|
| 473 |
+
First, we investigated the difference in the predictive performance of surrogates based on these two different types of architectures. Specifically, we fitted our GNN and XGB surrogate models on different subsets of the respective training sets and assess their predictions on unseen architectures from all optimziers as a test set. Figure 23 shows that including architectures from optimizer trajectories in the training set consistently yields significantly better generalization.
|
| 474 |
+
|
| 475 |
+
Next, we also studied the usefulness of surrogate benchmarks based on the 23 746 random architectures, compared to surrogate benchmarks based on the 23 746 architectures sampled in a stratified manner from the original set of architectures. Specifically, we used them to assess the best performance achieved by various NAS optimizers as a function of time. Comparing the trajectories in Figure 24 (based on purely random architectures for training) and Figure 25 (based on 23 746 architectures sampled in a stratified manner), we find that the surrogates fitted only on random architectures work just as well for this task as the surrogates that use architectures from NAS optimizers in their training set.
|
| 476 |
+
|
| 477 |
+
Given this positive result for surrogates based purely on random architectures, we conclude that it is indeed possible to create surrogate NAS benchmarks that are by design free of bias towards any particular NAS optimizer (other than random search). While the inclusion of architectures generated with NAS optimizers in the training set substantially improves performance predictions of individual architectures, realistic trajectories of incumbent performance as a function of time can also be obtained with surrogate benchmarks based solely on random architectures. We note that the “unbiased” benchmark could possibly be further improved by utilizing more sophisticated spacefilling sampling methods, such as the ones mentioned in Appendix C.2, or by deploying surrogate models that extrapolate well.
|
| 478 |
+
|
| 479 |
+
# F GUIDELINES FOR CREATING SURROGATE BENCHMARKS
|
| 480 |
+
|
| 481 |
+
In order to help with the design of realistic surrogate benchmarks in the future, we provide the following list of guidelines:
|
| 482 |
+
|
| 483 |
+
• Data Collection: The data collected for the NAS benchmark should provide (1) a good overall coverage, (2) explore strong regions of the space well, and (3) optimally also cover special areas in which poor generalization performance may otherwise be expected. We would like to stress that depending on the search space, a good overall coverage may already be sufficient to correctly assess the ranking of different optimizers, but as shown in Appendix E.3 additional architectures from strong regions of the space allow to increase the fidelity of the surrogate model. 1. A good overall coverage can be obtained by random search (as in our case), but one could also imagine using better space-filling designs or adaptive methods for covering the space even better. In order to add additional varied architectures, one could also think about fitting one or more surrogate models to the data collected thus far, finding the regions of maximal predicted uncertainty, evaluate architectures there and add them to the collected data, and iterate. This would constitute an active learning approach.
|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
Figure 23: Scatter plots of the predicted performance against the true performance of the GNN GIN/XGB surrogate models trained with different ratios of training data. ”RS” indicates that the training set only includes architectures from random search, ”mixed” indicates the training set includes architectures from all optimizers. Training set sizes are identical for the two cases. The test set contains architectures from all optimizers. For better display, we show 1000 randomly sampled architectures (blue) and 1000 architectures sampled from the top 1000 architectures (orange). For each case we also show the $R ^ { 2 }$ and Kendall- $\tau$ coefficients on the whole test set.
|
| 487 |
+
|
| 488 |
+

|
| 489 |
+
Figure 24: Anytime performance of different optimizers on the real benchmark (left) and the surrogate benchmark (GIN (middle) and XGB (right)) when training ensembles only on data collected by random search. Trajectories on the surrogate benchmark are averaged over 5 optimizer runs.
|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
Figure 25: Anytime performance of different optimizers on the real benchmark (left) and the surrogate benchmark (GIN (middle) and XGB (right)) when training ensembles on $4 7 . 3 \%$ of the data collected from all optimizers. Trajectories on the surrogate benchmark are averaged over 5 optimizer runs.
|
| 493 |
+
|
| 494 |
+
2. A convenient and efficient way to identify regions of strong architectures is to run NAS methods. In this case, the found regions should not only be based on the strong architectures one NAS method finds but rather on a set of strong and varied NAS methods (such as, in our case, one-shot methods and different types of discrete methods, such as Bayesian optimization and evolution). In order to add additional strong architectures, one could also think about fitting one or more several surrogate models to the data collected thus far, finding the predicted optima of these models, evaluate and add them to the collected data and iterate. This would constitute a special type of Bayesian optimization.
|
| 495 |
+
|
| 496 |
+
3. Special areas in which poor generalization performance may otherwise be expected may, as in our case, e.g., include architectures with many parameterless connections, and in particular, skip connections. Other types of failure modes the community learns about would also be useful to cover.
|
| 497 |
+
|
| 498 |
+
• Surrogate Models: As mentioned in the guidelines for using a surrogate benchmark (see Section 7), benchmarking an algorithm that internally uses the same model type as the surrogate model should be avoided. Therefore, to provide a benchmark for a diverse set of algorithms, we recommend providing different types of surrogate models with a surrogate benchmark. Also, in order to guard against a possible case of “bias” in a surrogate benchmark (in the sense of making more accurate predictions for architectures explored by a particular type of NAS optimizer), we recommend to provide two versions of a surrogate: one based on all available training architectures (including those found by NAS optimizers), and one based only on the data gathered for overall coverage (1. above).
|
| 499 |
+
|
| 500 |
+
• Verification: As a means to verify surrogate models, we stress the importance of leave-oneoptimizer-out experiments both for data fit and benchmarking, which simulate the benchmarking of ’unseen’ optimizers.
|
| 501 |
+
|
| 502 |
+
• Since most surrogate benchmarks will continue to grow for some time after their first release, to allow apples-to-apples comparisons, we strongly encourage to only release surrogate benchmarks with a version number.
|
| 503 |
+
• In order to allow the evaluation of multi-objective NAS methods, we encourage the logging of as many relevant metrics of the evaluated architectures other than accuracy as possible, including training time, number of parameters, and multiply-adds.
|
| 504 |
+
• Alongside a released surrogate benchmark, we strongly encourage to release the training data its surrogate(s) were constructed on, as well as the test data used to validate it.
|
| 505 |
+
• In order to facilitate checking hypotheses gained using the surrogate benchmarks in real experiments, the complete source code for training the architectures should be open-sourced alongside the repository, allowing to easily go back and forth between querying the model and gathering new data.
|
md/train/4YlE2huxEsl/4YlE2huxEsl.md
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Beltrami Flow and Neural Diffusion on Graphs
|
| 2 |
+
|
| 3 |
+
James Rowbottom∗ Twitter Inc.
|
| 4 |
+
|
| 5 |
+
Benjamin P. Chamberlain∗ Twitter Inc. bchamberlain@twitter.com
|
| 6 |
+
|
| 7 |
+
Davide Eynard Twitter Inc.
|
| 8 |
+
|
| 9 |
+
rancesco Di Giovann Twitter Inc.
|
| 10 |
+
|
| 11 |
+
Xiaowen Dong University of Oxford
|
| 12 |
+
|
| 13 |
+
Michael M. Bronstein Twitter Inc. and Imperial College London
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
We propose a novel class of graph neural networks based on the discretised Beltrami flow, a non-Euclidean diffusion PDE. In our model, node features are supplemented with positional encodings derived from the graph topology and jointly evolved by the Beltrami flow, producing simultaneously continuous feature learning and topology evolution. The resulting model generalises many popular graph neural networks and achieves state-of-the-art results on several benchmarks.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
The majority of graph neural networks (GNNs) are based on the message passing paradigm [30], wherein node features are learned by means of a non-linear propagation on the graph. Multiple recent works have pointed to the limitations of the message passing approach. These include; limited expressive power [80, 95, 9, 7], the related oversmoothing problem [60, 62] and the bottleneck phenomena [1, 93], which render such approaches inefficient, especially in deep GNNs. Multiple alternatives have been proposed, among which are higher-order methods [54, 7] and decoupling the propagation and input graphs by modifying the topology, often referred to as graph rewiring. Topological modifications can take different forms such as graph sampling [32], kNN [43], using the complete graph [86, 1], latent graph learning [89, 36], or multi-hop filters [92, 73]. However, there is no agreement in the literature on when and how to modify the graph, and a single principled framework for doing so.
|
| 22 |
+
|
| 23 |
+
A somewhat underappreciated fact is that GNNs are intimately related to diffusion equations [16], a connection that was exploited in the early work of Scarselli et al. [76]. Diffusion PDEs have been historically important in computer graphics [83, 11, 51, 64], computer vision [13, 18, 6], and image processing [65, 82, 90, 85, 26, 12], where they created an entire trend of variational and PDE-based approaches. In machine learning and data science, diffusion equations underpin such popular manifold learning methods as eigenmaps [5] and diffusion maps [20], as well as the family of PageRank algorithms [63, 14]. In deep learning, differential equations are used as models of neural networks [16, 19, 25, 94, 71, 98] and for physics-informed learning [72, 22, 75, 21, 81, 47].
|
| 24 |
+
|
| 25 |
+
Main contributions In this paper, we propose a novel class of GNNs based on the discretised non-Euclidean diffusion PDE in joint positional and feature space, inspired by the Beltrami flow [82] used two decades ago in the image processing literature for edge-preserving image denoising. We show that the discretisation of the spatial component of the Beltrami flow offers a principled view on positional encoding and graph rewiring, whereas the discretisation of the temporal component can replace GNN layers with more flexible adaptive numerical schemes. Based on this model, we introduce Beltrami Neural Diffusion (BLEND) that generalises a broad range of GNN architectures and shows state-of-the-art performance on many popular benchmarks. In a broader perspective, our approach explores new tools from PDEs and differential geometry that are less well known in the graph ML community.
|
| 26 |
+
|
| 27 |
+
# 2 Background
|
| 28 |
+
|
| 29 |
+
Beltrami flow Kimmel et al. [40, 82, 39] considered images as 2-manifolds (parametric surfaces) $( \Sigma , g )$ embedded in some larger ambient space as $\mathbf { z } ( \mathbf { u } ) \overset { } { = } ( \mathbf { u } , \alpha \mathbf { x } ( \mathbf { u } ) ) \ \subseteq \ \mathbb { R } ^ { { \hat { d } } + 2 }$ where $\alpha \geq 0$ is a scaling factor, $\mathbf { u } = ( u _ { 1 } , u _ { 2 } )$ are the 2D positional coordinates of the pixels, and $\mathbf { x }$ are the $d$ - dimensional colour or feature coordinates (with $d = 1$ or 3 for grayscale or RGB images, or $d = k ^ { 2 }$ when using $k \times k$ patches as features [12]). In these works, the image is evolved along the gradient flow of a functional $S [ \mathbf { z } , g ]$ called the Polyakov action $I 6 8 J$ , which roughly measures the smoothness of the embedding1. For images embedded in Euclidean space with the functional $S$ minimised with respect to both the embedding $\mathbf { z }$ and the metric $g$ , one obtains the following PDE:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\frac { \partial \mathbf { z } ( \mathbf { u } , t ) } { \partial t } = \Delta _ { \mathbf { G } } \mathbf { z } ( \mathbf { u } , t ) , \qquad \mathbf { z } ( \mathbf { u } , 0 ) = \mathbf { z } ( \mathbf { u } ) , \quad t \geq 0 ,
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
and boundary conditions as appropriate. Here $\Delta _ { \mathbf { G } }$ is the Laplace-Beltrami operator, the Laplacian operator induced on $\Sigma$ by the Euclidean space we embed the image into. Namely, the embedding of the manifold allows us to pull-back the Euclidean distance structure on the image: the distance between two nearby points $\mathbf { u }$ and $\mathbf { u } + \mathrm { d } \mathbf { u }$ is given by
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\mathrm { d } \ell ^ { 2 } = \mathrm { d } \mathbf { u } ^ { \top } \mathbf { G } ( \mathbf { u } ) \mathrm { d } \mathbf { u } = \mathrm { d } u _ { 1 } ^ { 2 } + \mathrm { d } u _ { 2 } ^ { 2 } + \alpha ^ { 2 } \sum _ { i = 1 } ^ { d } \mathrm { d } x _ { i } ^ { 2 } ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\mathbf { G } = \mathbf { I } + \alpha ^ { 2 } ( \nabla _ { \mathbf { u } } \mathbf { x } ( \mathbf { u } ) ) ^ { \top } \nabla _ { \mathbf { u } } \mathbf { x } ( \mathbf { u } )$ is a $2 \times 2$ matrix called the Riemannian metric. The fact that the distance is a combination of the positional component (distance between pixels in the plane, $\| \mathbf { u } - \mathbf { u } ^ { \prime } \| )$ and the colour component (distance between the colours of the pixels, $\| \mathbf { \bar { x } } ( \mathbf { u } ) - \mathbf { x } ( \mathbf { u } ^ { \bar { \prime } } ) \| )$ is crucial as it allows edge-preserving image diffusion.
|
| 42 |
+
|
| 43 |
+
When dealing with images, the evolution of the first two components of $( z _ { 1 } , z _ { 2 } ) = \mathbf { u }$ is a nuisance amounting to the reparametrisation of the manifold and can be ignored. For grayscale images (the case when $d = 1$ and ${ \bf z } = ( u _ { 1 } , u _ { 2 } , x ) )$ , this is done by projection along the dimension $z _ { 3 }$ , in which case the Beltrami flow takes the form of an inhomogeneous diffusion equation of $x$ ,
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\frac { \partial x ( \mathbf { u } , t ) } { \partial t } = \frac { 1 } { \sqrt { \operatorname* { d e t } \mathbf { G } ( \mathbf { u } , t ) } } \mathrm { d i v } \left( \frac { \nabla x ( \mathbf { u } , t ) } { \sqrt { \operatorname* { d e t } \mathbf { G } ( \mathbf { u } , t ) } } \right) \qquad t \geq 0 .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
The diffusivity
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
a = \frac { 1 } { \sqrt { \mathrm { d e t } \mathbf { G } } } = \frac { 1 } { \sqrt { 1 + \alpha ^ { 2 } \| \nabla x \| ^ { 2 } } }
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
determining the speed of diffusion at each point, can be interpreted as an edge indicator: diffusion is weak across edges where $\| \nabla x \| \gg 1$ . The result is an adaptive diffusion [65] popular in image processing due to its ability to denoise images while preserving their edges. For cases with $d > 1$ (multiple colour channels), equation (3) is applied to each channel separately; however, the metric $\mathbf { G }$ couples the channels, which results in their gradients becoming aligned [38].
|
| 56 |
+
|
| 57 |
+
Special cases In the limit case $\alpha = 0$ , equation (3) becomes the simple homogeneous isotropic diffusion ∂∂t x = div(∇x) = ∆x, where ∆ = $\begin{array} { r } { \Delta = \frac { \partial ^ { 2 } } { \partial u _ { 1 } ^ { 2 } } + \frac { \partial ^ { 2 } } { \partial u _ { 2 } ^ { 2 } } } \end{array}$ is the standard Euclidean Laplacian operator. The solution is given in closed form as the convolution of the initial image and a Gaussian kernel with time-dependent variance,
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: Two interpretations of the Beltrami flow: position-dependent bilateral kernel (top) and a Gaussian passed on the manifold (bottom).
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
x ( { \mathbf { u } } , t ) = x ( { \mathbf { u } } , 0 ) \star \frac { 1 } { ( 4 \pi t ) ^ { d / 2 } } e ^ { - \| { \mathbf { u } } \| ^ { 2 } / 4 t }
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
and can be considered a simple linear low-pass filtering. In the limit $t \to \infty$ , the image becomes constant and equal to the average colour.2
|
| 67 |
+
|
| 68 |
+
Another interpretation of the Beltrami flow is passing a Gaussian on the manifold (see Figure 1, bottom), which can locally be expressed as non-linear filtering with the bilateral kernel [85] dependent on the joint positional and colour distance (Figure 1, top),
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
x ( \mathbf { u } , t ) = \frac { 1 } { ( 4 \pi t ) ^ { d / 2 } } \int _ { \mathbb { R } ^ { 2 } } x ( \mathbf { v } , 0 ) e ^ { - \| \mathbf { u } - \mathbf { v } \| ^ { 2 } / 4 t } e ^ { - \alpha ^ { 2 } \| \mathbf { x } ( \mathbf { u } , \mathbf { 0 } ) - \mathbf { x } ( \mathbf { v } , \mathbf { 0 } ) \| ^ { 2 } / 4 t } \mathrm { d } \mathbf { v } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
For $\alpha = 0$ , the bilateral filter (6) reduces to a simple convolution with a time-dependent Gaussian.
|
| 75 |
+
|
| 76 |
+
# 3 Discrete Beltrami flow on graphs
|
| 77 |
+
|
| 78 |
+
We now develop the analogy of Beltrami flow for graphs. We consider a graph to be a discretisation of a continuous structure (manifold), and show that the evolution of the feature coordinates in time amounts to message passing layers in GNNs, whereas the evolution of the positional coordinates amounts to graph rewiring, which is used in some GNN architectures.
|
| 79 |
+
|
| 80 |
+
# 3.1 Graph Beltrami flow
|
| 81 |
+
|
| 82 |
+
Let ${ \mathcal { G } } = ( \gamma = \{ 1 , \ldots , n \} , \mathcal { E } )$ be an undirected graph, where $\nu$ and $\mathcal { E }$ denote node and edge sets, respectively. We further assume node-wise $d .$ -dimensional features $\mathbf { x } _ { i } \in \mathbb { R } ^ { d }$ for $i = 1 , \ldots , n$ . Denote by $\mathbf { z } _ { i } = ( \mathbf { u } _ { i } , \alpha \mathbf { x } _ { i } )$ the embedding of the graph in a joint space $\mathcal { C } \times \mathbb { R } ^ { d }$ , where $\mathcal { C }$ is a $d ^ { \prime }$ -dimensional space with a metric $d _ { \mathcal { C } }$ representing the node coordinates (for simplicity, we will assume $\mathcal { C } = \mathbb { R } ^ { d ^ { \prime } }$ unless otherwise stated). We refer to $\mathbf { u } _ { i } \mathbf { x } _ { i }$ and $\mathbf { z } _ { i }$ as the positional, feature and joint coordinates of node $i$ , respectively, and arrange them into the matrices U, $\mathbf { X }$ , and $\mathbf { Z }$ , of sizes $n \times d ^ { \prime } , n \times d$ , and $n \times ( d ^ { \prime } + d )$ .
|
| 83 |
+
|
| 84 |
+
For images, Beltrami flow amounts to evolving the embedding $\mathbf { z }$ along $\mathrm { d i v } ( a ( \mathbf { z } ) \nabla \mathbf { z } )$ , with $a$ a diffusivity map.3 Thus, we consider the graph Beltrami flow to be the discrete diffusion equation
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\frac { \partial \mathbf z _ { i } ( t ) } { \partial t } = \sum _ { j : ( i , j ) \in \mathcal E ^ { \prime } } a ( \mathbf z _ { i } ( t ) , \mathbf z _ { j } ( t ) ) ( \mathbf z _ { j } ( t ) - \mathbf z _ { i } ( t ) ) \qquad \mathbf z _ { i } ( 0 ) = \mathbf z _ { i } ; \quad i = 1 , \ldots , n ; \quad t \geq 0 .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
We motivate our definition as follows: $\mathbf { g } _ { i j } = \mathbf { z } _ { j } - \mathbf { z } _ { i }$ and $\begin{array} { r } { \mathbf { d } _ { i } = \sum _ { j : ( i , j ) \in \mathcal { E } } \mathbf { g } _ { i j } } \end{array}$ are the discrete analogies of the gradient $\nabla \mathbf { z }$ and divergence $\mathrm { d i v } ( \mathbf { g } )$ , both with respect to a graph $( \mathcal { V } , \mathcal { E } ^ { \prime } )$ that can be interpreted as the numerical stencil for the discretisation of the continuous Laplace-Beltrami operator in (3). Note that $\mathcal { E } ^ { \prime }$ can be different from the input $\mathcal { E }$ (referred to as ‘rewiring’). As discussed in Section 3.3, most GNNs use $\mathcal { E } ^ { \prime } = \mathcal { E }$ (input graph is used for diffusion, no rewiring). Alternatively, the positional coordinates of the nodes can be used to define a new graph topology either with $\mathcal { E } ( \bar { \mathbf { U } } ) = \{ ( i , j ) : d _ { \mathcal { C } } ( \mathbf { u } _ { i } , \mathbf { u } _ { j } ) < r \}$ , for some radius $r > 0$ , or using $k$ nearest neighbours. This new rewiring is precomputed using the input positional coordinates (i.e., $\mathcal { E } ^ { \prime } = \mathcal { E } ( \mathbf { U } ( 0 ) ) )$ or updated throughout the diffusion (i.e., $\mathcal { E } ^ { \prime } ( t \bar { ) } = \mathcal { E } ( \bar { \mathbf { U } } ( t \bar { ) } ) )$ . Therefore, (7) can be compactly rewritten as
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\frac { \partial { \bf z } _ { i } ( t ) } { \partial t } = \mathrm { d i v } \left( a ( { \bf z } ( t ) ) \nabla { \bf z } _ { i } ( t ) \right) .
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
The function $a$ is the diffusivity controlling the diffusion strength between nodes $i$ and $j$ and is assumed to be normalised: $\begin{array} { r } { \sum _ { j : ( i , j ) \in \mathcal { E } ^ { \prime } } a ( \mathbf { z } _ { i } , \mathbf { z } _ { j } ) \ : = \ : 1 } \end{array}$ . The dependence of the diffusivity on the
|
| 97 |
+
|
| 98 |
+
embedding $\mathbf { z }$ matches the smooth PDE analysed in e.g. [82, Section 4.2] and is consistent with the form of attention mechanism used in e.g. [88, 86]. In matrix-form, we can also rewrite (7) as
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r l } & { \left( \frac { \partial } { \partial t } \mathbf { U } ( t ) , \frac { \partial } { \partial t } \mathbf { X } ( t ) \right) = \left( \mathbf { A } ( \mathbf { U } ( t ) , \mathbf { X } ( t ) ) - \mathbf { I } \right) \left( \mathbf { U } ( t ) , \mathbf { X } ( t ) \right) } \\ & { \qquad \mathbf { U } ( 0 ) = \mathbf { U } ; \ \mathbf { X } ( 0 ) = \alpha \mathbf { X } ; \ t \geq 0 , } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where we emphasise the evolution of both the positional and feature components, coupled through the matrix-valued function A
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
a _ { i j } ( t ) = \left\{ \begin{array} { l l } { a ( ( \mathbf { u } _ { i } ( t ) , \mathbf { x } _ { i } ( t ) ) , ( \mathbf { u } _ { j } ( t ) , \mathbf { x } _ { j } ( t ) ) ) } & { ( i , j ) \in \mathcal { E } ( \mathbf { U } ( t ) ) } \\ { 0 } & { \mathrm { e l s e } . } \end{array} \right.
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
representing the diffusivity. The graph Beltrami flow produces an evolution of the joint positional and feature coordinates, ${ \bf Z } ( t ) = ( { \bf U } ( t ) , { \bf X } ( t ) )$ . In Section 3.3 we will show how the evolution of the feature coordinates $\mathbf X ( t )$ results in feature diffusion or message passing on the graph, the core of GNNs. As noted in Section 2, in the smooth case the Beltrami flow is obtained as gradient flow of an energy functional when minimised with respect to both the embedding and the metric on the surface (an image). When the embedding takes values in the Euclidean space, this leads to equations of the form (3) with no channel-mixing and an exact form of the diffusivity determined by the pull-back $\mathbf { G }$ of the Euclidean metric. To further motivate our approach, it is tempting to investigate whether a similar conclusion can be attained here. Although in the discrete case the operation of pull-back is not well-defined, we are able to derive that the gradient flow of a modified graph Dirichlet energy gives rise to an equation of the form (7). We note though that the gradient flow does not recover the exact form of the diffusivity implemented in this paper. This is not a limitation of the theory and should be expected: by requiring the gradient flow to avoid channel-mixing and imitate the image analogy in [82] and by inducing a discrete pull-back condition, we are imposing constraints on the problem. We leave the theoretical implications for future work and refer to the Supplementary Materials for a more thorough discussion, including definitions and proofs.
|
| 111 |
+
|
| 112 |
+
Theorem 1. Under structural assumptions on the diffusivity, graph Beltrami flow (7) is the gradient flow of the discrete Polyakov functional.
|
| 113 |
+
|
| 114 |
+
# 3.2 Numerical solvers
|
| 115 |
+
|
| 116 |
+
Explicit vs implicit schemes Equation (7) is solved numerically, which in the simplest case is done by replacing the continuous time derivative $\frac { \partial } { \partial t }$ with forward time difference:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\frac { \mathbf { z } _ { i } ^ { ( k + 1 ) } - \mathbf { z } _ { i } ^ { ( k ) } } { \tau } = \sum _ { j : ( i , j ) \in \mathcal { E } ( \mathbf { U } ^ { ( k ) } ) } a \left( \mathbf { z } _ { i } ^ { ( k ) } , \mathbf { z } _ { j } ^ { ( k ) } \right) ( \mathbf { z } _ { j } ^ { ( k ) } - \mathbf { z } _ { i } ^ { ( k ) } ) .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Here $k$ denotes the discrete time index (iteration) and $\tau$ is the time step (discretisation parameter). Rewriting (9) compactly in matrix-vector form with $\tau = 1$ leads to the explicit Euler scheme:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { r } { { \bf Z } ^ { ( k + 1 ) } = ( { \bf A } ^ { ( k ) } - { \bf I } ) { \bf Z } ^ { ( k ) } = { \bf Q } ^ { ( k ) } { \bf Z } ^ { ( k ) } , } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where a(k)ij $a _ { i j } ^ { ( k ) } = a ( \mathbf { z } _ { i } ^ { ( k ) } , \mathbf { z } _ { j } ^ { ( k ) } )$ and the matrix $\mathbf { Q } ^ { ( k ) }$ (diffusion operator) is given by
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
q _ { i j } ^ { ( k ) } = \left\{ \begin{array} { l l } { 1 - \tau \sum _ { l : ( i , l ) \in \mathcal { E } } a _ { i l } ^ { ( k ) } } & { i = j } \\ { \tau a _ { i j } ^ { ( k ) } } & { ( i , j ) \in \mathcal { E } ( \mathbf { U } ^ { ( k ) } ) } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
The solution to the diffusion equation is computed by applying scheme (10) multiple times in sequence, starting from some initial $\mathbf { Z } ^ { ( 0 ) }$ . It is ‘explicit’ because the update $\mathbf { Z } ^ { ( k + 1 ) }$ is done directly by the application of the diffusion operator $\mathbf { Q } ^ { ( k ) }$ on $\mathbf { Z } ^ { ( k ) }$ (as opposed to implicit schemes of the form $\dot { \mathbf { Z } } ^ { ( k ) } = \dot { \mathbf { Q } } ^ { ( k ) } \mathbf { Z } ^ { ( k + 1 ) }$ arising from backward time differences that require inversion of the diffusion operator [91]).
|
| 135 |
+
|
| 136 |
+
Multi-step and adaptive schemes Higher-order approximation of temporal derivatives amount to using intermediate fractional steps, which are then linearly combined. Runge-Kutta (RK) [74, 44], ubiquitously used in numerical analysis, is a classical family of explicit numerical schemes, including Euler as a particular case. The Dormand-Prince (DOPRI) [24] is an RK method based on fifth and fourth-order approximations, the difference between which is used as an error estimate guiding the time step size [78].
|
| 137 |
+
|
| 138 |
+
Adaptive spatial discretisation and rewiring Many numerical PDE solvers also employ adaptive spatial discretisation. The choice of the stencil (mesh) for spatial derivatives is done based on the character of the solution at these points; in the simulation of phenomena such as shock waves it is often desired to use denser sampling in the respective regions of the domain, which can change in time. A class of techniques for adaptive rewiring of the spatial derivatives are known as Moving Mesh (MM) methods [33]. Interpreting the graph $\mathcal { E } ^ { \prime }$ in (7) as the numerical stencil for the discretisation of the continuous Laplace-Beltrami operator in (3), we can regard rewiring as a form of MM.
|
| 139 |
+
|
| 140 |
+
# 3.3 Relation to graph neural networks
|
| 141 |
+
|
| 142 |
+
Equation (9) has the structure of many GNN architectures of the ‘attentional’ type [10], where the discrete time index $k$ corresponds to a (convolutional or attentional) layer of the GNN and multiple diffusion iterations amount to a deep GNN. In the diffusion formalism, the time parameter $t$ acts as a continuous analogy of the layers, in the spirit of neural differential equations [19]. Typical GNNs amount to explicit single-step (Euler) discretisation schemes, whereas our continuous interpretation can exploit more efficient numerical schemes.
|
| 143 |
+
|
| 144 |
+
GNNs as instances of graph Beltrami flow The graph Beltrami framework leads to a family of graph neural networks that generalise many popular architectures (see Table 1). For example, GAT [88] can be obtained as a particular setting of our framework where the input graph is fixed $\mathbf { \mathcal { E } ^ { \prime } } = \mathbf { \mathcal { E } }$ ) and only the feature coordinates $\mathbf { X }$ are evolved. Equation (10) in this case becomes
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\mathbf { x } _ { i } ^ { ( k + 1 ) } = \mathbf { x } _ { i } ^ { ( k ) } + \tau \sum _ { j : ( i , j ) \in \mathcal { E } } a \left( \mathbf { x } _ { i } ^ { ( k ) } , \mathbf { x } _ { j } ^ { ( k ) } \right) ( \mathbf { x } _ { j } ^ { ( k ) } - \mathbf { x } _ { i } ^ { ( k ) } )
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
and corresponds to the update formula of GAT with a residual connection and the assumption of no non-linearity between the layers. The role of the diffusivity is played by a learnable parametric attention function, which is generally time-dependent: $a ( \mathbf { z } _ { i } ^ { ( \bar { k } ) } , \bar { \mathbf { z } _ { j } ^ { ( k ) } } , k )$ . This results in separate attention parameters per layer $k$ , which can be learned independently. Our intentionally simplistic choice of a time-independent attention function amounts to parameter sharing across layers. We will show in Section 5.1 that this leads to a smaller model that is less likely to overfit.
|
| 151 |
+
|
| 152 |
+
Another popular architecture MoNet [57] uses linear diffusion of the features with weights dependent on the structure of the graph expressed as ‘pseudo-coordinates’, which can be cast as attention of the form $a ( \mathbf { u } _ { i } , \mathbf { u } _ { j } )$ . Transformers [87] can be interpreted as feature diffusion on a fixed complete graph with $\mathcal { E } ^ { \prime } = \mathcal { V } \times \mathcal { V }$ [10]. Positional encoding (used in Transformers as well as in several recent GNN architectures [9, 27]) amounts to attention dependent on both $\mathbf { X }$ and U, which allows the diffusion to adapt to the local structure of the graph; importantly, the positional coordinates U are precomputed. Similarly, DeepSets [97] and PointNet [70] architectures can be interpreted as GNNs applied on a graph with no edges ${ \mathcal { E } } ^ { \prime } = \emptyset$ ), where each node is treated independently of the others [10]. DIGL [43] performs graph rewiring as a pre-processing step using personalised page rank as positional coordinates, which are then fixed and not evolved. In the point cloud methods, DGCNN [89] and DGM [36], the graph is constructed based on the feature coordinates X and rewired adaptively (in our notation, $\bar { \mathcal { E } ^ { \prime } = \mathcal { E } ( \mathbf { X } ( t ) ) } )$ ).
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Method</td><td>Evolution</td><td>Diffusivity</td><td>Graph (V,ε')</td><td>Discretisation</td></tr><tr><td>ChebNet</td><td>Features X</td><td>Fixed aij</td><td>Fixed ε</td><td>Explicit fixed step</td></tr><tr><td>GAT</td><td>Features X</td><td>a(xi,Xj)</td><td>Fixedε</td><td>Explicit fixed step</td></tr><tr><td>MoNet</td><td>Features X</td><td>a(ui,uj)</td><td>Fixed ε</td><td>Explicit fixed step</td></tr><tr><td>Transformer</td><td>Features X</td><td>a(u,xi),(uj,Xj))</td><td>Fixedε=V×V</td><td>Explicit fixed step</td></tr><tr><td>DeepSet/PointNet</td><td>Features X</td><td>a(xi)</td><td>Fixedε=0</td><td>Explicit fixed step</td></tr><tr><td>DIGL*</td><td>Features X</td><td>a(xi,xj)</td><td>Fixed ε(U)</td><td>Explicit fixed step</td></tr><tr><td>DGCNN/DGM*</td><td>Features X</td><td>a(xi,xj)</td><td>Adaptive ε(X)</td><td>Explicit fixed step</td></tr><tr><td>Beltrami</td><td>Positions U +Features X</td><td>a((u,xi),(uj,xj))</td><td>Adaptive ε(U)</td><td>Explicit adaptive step / Implicit</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Table 1: GNN architectures interpreted as particular instances of our framework. ∗Attentional variant.
|
| 157 |
+
|
| 158 |
+
Graph rewiring Multiple authors have recently argued in favor of decoupling the input graph from the graph used for diffusion. Such rewiring can take the form of graph sampling [32] to address scalability issues, data denoising [43], removal of information bottlenecks [1], or larger multi-hop filters [73]. The graph construction can also be made differentiable and a task-specific rewiring can be learned [89, 36]. The statement of Klicpera et al. [43] that ‘diffusion improves graph learning’, leading to the eponymous paradigm (DIGL), can be understood as a form of diffusion on the graph connectivity independent of the features. Specifically, the authors used as node positional encoding the Personalised PageRank (PPR), which can be interpreted as the steady-state of a diffusion process
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\mathbf { U } _ { \mathrm { P P R } } = \sum _ { k \geq 0 } ( 1 - \beta ) \beta ^ { k } \underline { { \mathbf { A } } } _ { \mathrm { R W } } ^ { k } = ( 1 - \beta ) ( \mathbf { I } - \beta \underline { { \mathbf { A } } } _ { \mathrm { R W } } ) ^ { - 1 } , \quad 0 < \beta < 1 ,
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $\Delta _ { \mathrm { R W } }$ is the random walk graph Laplacian and $\beta \in ( 0 , 1 )$ is a parameter such that $1 - \beta$ represents the restart probability. The resulting positional encoding of dimension $d = n$ can be used to rewire the graph by $k \mathbf { N N }$ sampling, which corresponds to using $\mathcal { E } ^ { \prime } = \mathcal { E } ( \mathbf { U } _ { \mathrm { P P R } } )$ in our framework.
|
| 165 |
+
|
| 166 |
+
Numerical schemes All the aforementioned GNN architectures can be seen as an explicit discretisation of equation (7) with fixed step size. On the other hand, our continuous diffusion framework offers an additional advantage of employing more efficient numerical schemes with adaptive step size. Graph rewiring of the form $\mathcal { E } ^ { \prime } \overset { = } { = } \mathcal { \bar { E } } ( \mathbf { U } ( t ) )$ can be interpreted as adaptive spatial discretisation (moving mesh method).
|
| 167 |
+
|
| 168 |
+
# 3.4 Extensions
|
| 169 |
+
|
| 170 |
+
Non-Euclidean geometry There are multiple theoretical and empirical arguments [52, 17] in favor of using hyperbolic spaces to represent real-life ‘small-world’ graphs (in particular, scale-free networks can be obtained as $k \mathbf { N N }$ graphs in such spaces [8]). Our framework allows using a non-Euclidean metric $d _ { \mathcal { C } }$ for the positional coordinates U (Figure 2). In Section 5 we show that hyperbolic positional encodings allow for a significant reduction in model size with only a marginal degradation of performance.
|
| 171 |
+
|
| 172 |
+
Time-dependent diffusivity The diffusivity function $a$ which we assumed time-independent and which lead to parameter sharing across layers (i.e., updates of the form $\mathbf { \tilde { Z } } ^ { ( k + 1 ) } = \mathbf { Q } ( \mathbf { Z } ^ { ( k ) } , \pmb { \theta } ) \mathbf { Z } ^ { ( k ) } )$ can be made time-dependent of the form $\mathbf { Z } ^ { ( k + 1 ) } = \mathbf { Q } ( \mathbf { Z } ^ { ( k ) } , \pmb { \theta } ^ { ( k ) } ) \mathbf { Z } ^ { ( k ) }$ , where $\pmb { \theta }$ and $\pmb \theta ^ { ( k ) }$ denote shared and layer-dependent parameters, respectively.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 2: Graph Beltrami flow with hyperbolic positional coordinates.
|
| 176 |
+
|
| 177 |
+
Onsager diffusion As we noted, the Beltrami flow diffuses each channel separately. A more general variant of diffusion allowing for feature mixing is the Onsager diffusion [61] of the form $\begin{array} { r } { \dot { \frac { \partial } { \partial t } } \mathbf { Z } ( t ) = \mathbf { Q } ( \mathbf { Z } ( t ) ) \mathbf { Z } ( t ) \mathbf { W } ( t ) } \end{array}$ , where the matrix-valued function W acts across the channels. GCN [42] can be regarded a particular setting thereof, with update of the form .
|
| 178 |
+
|
| 179 |
+
MPNNs Finally, we note that the Beltrami flow amounts to linear aggregation with non-linear coefficients, or the ‘attentional’ flavor of GNNs [10]. The more general message passing flavor [30] is possible using a generic non-linear equation of the form $\begin{array} { r } { \frac { \partial } { \partial t } \mathbf { Z } ( t ) = \Psi ( \mathbf { Z } ( t ) ) } \end{array}$ .
|
| 180 |
+
|
| 181 |
+
# 4 BLEND: Beltrami Neural Diffusion
|
| 182 |
+
|
| 183 |
+
Beltrami Neural Diffusion (BLEND) is a novel class of graph neural network architectures derived from the graph Beltrami framework. We assume an input graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with $n$ nodes and $d$ -dimensional node-wise features represented as a matrix $\mathbf { X } _ { \mathrm { i n } }$ . We further assume a $d ^ { \prime }$ -dimensional positional encoding $\mathbf { U } _ { \mathrm { i n } }$ of the graph nodes. BLEND architectures implement a learnable joint diffusion process of $\mathbf { U }$ and $\mathbf { X }$ and runs it for time $T$ , to produce an output node embeddings $\mathbf { Y }$ ,
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\mathbf { Z } ( 0 ) = \left( \phi ( \mathbf { U } _ { \mathrm { i n } } ) , \psi ( \mathbf { X } _ { \mathrm { i n } } ) \right) \qquad \mathbf { Z } ( T ) = \mathbf { Z } ( 0 ) + \int _ { 0 } ^ { T } \frac { \partial \mathbf { Z } ( t ) } { \partial t } \mathrm { d } t \qquad \mathbf { Y } = \xi ( \mathbf { Z } ( T ) ) ,
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
where $\phi , \psi$ are learnable positional and feature encoders and $\xi$ is a learnable decoder (possibly changing the output dimensions). Here the $\alpha$ in Equations (2) and (8) is absorbed by $\psi$ and made learnable. $\frac { \partial \mathbf { Z } ( t ) } { \partial t }$ is given by the graph Beltrami flow equation (8), where the diffusivity function (attention) $a$ is also learnable. The choice of attention function depends on the geometry of the positional encoding and for Euclidean encodings we find the scaled dot product attention [86] performs well, in which case
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
a ( \mathbf { z } _ { i } , \mathbf { z } _ { j } ) = \mathrm { s o f t m a x } \left( \frac { ( \mathbf { W } _ { K } \mathbf { z } _ { i } ) ^ { \top } \mathbf { W } _ { Q } \mathbf { z } _ { j } } { d _ { k } } \right)
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
where $\mathbf { W } _ { K }$ and $\mathbf { W } _ { Q }$ are learned matrices, and $d _ { k }$ is a hyperparameter.
|
| 196 |
+
|
| 197 |
+
# 5 Experimental results
|
| 198 |
+
|
| 199 |
+
In this section, we compare the proposed Beltrami framework to popular GNN architectures on standard node classification benchmarks and provide a detailed study of the choice of the positional encoding space. Additional experiments and implementation details, including runtimes and hyperparameter tuning are given in the Supplementary Materials. The code is available at https://github.com/twitter-research/graph-neural-pde.
|
| 200 |
+
|
| 201 |
+
Datasets In our experiments, we use the following datasets: Cora [56], Citeseer [77], Pubmed [58], CoauthorCS [79], Amazon, Computer, and Photo [55], and OGB-arxiv [35]. Since many works using the first three datasets rely on the Planetoid splits [96], we included them Table 2, together with a more robust evaluation on 100 random splits with 20 random initialisations [79].
|
| 202 |
+
|
| 203 |
+
Baselines We compare to the following GNN architectures: GCN [42], GAT [88], MoNet [57] and GraphSAGE [32], and recent ODE-based GNN models: CGNN [94], GDE [67], GODE [98], and two versions of LanczosNet [49]. We use two variants of our method: using fixed input graph (BLEND) and using $k \mathbf { N N }$ graph in the positional coordinates (BLEND-knn).
|
| 204 |
+
|
| 205 |
+
# 5.1 Node Classification
|
| 206 |
+
|
| 207 |
+
In these experiments, we followed the methodology of [79] using 20 random weight initialisations for datasets with fixed Planetoid splits and 100 random splits otherwise. Where available, results from [79] are reported. Hyperparameters with the highest validation accuracy were chosen and results are reported on a test set that is used only once. Hyperparameter search used Ray Tune [50] with a thousand random trials using an asynchronous hyperband scheduler with a grace period and half life of ten epochs. The code to reproduce our results is included with the submission and will be released publicly fol
|
| 208 |
+
|
| 209 |
+
Table 2: Performance (test accuracy $\pm$ std) of different GNN models using Planetoid splits.
|
| 210 |
+
|
| 211 |
+
<table><tr><td>Method</td><td>CORA</td><td>CiteSeer</td><td>PubMed</td></tr><tr><td>GCN</td><td>81.9±0.8</td><td>69.5±0.9</td><td>79.0±0.5</td></tr><tr><td>GAT</td><td>82.8±0.5</td><td>71.0±0.6</td><td>77.0±1.3</td></tr><tr><td>MoNet</td><td>82.2±0.7</td><td>70.0±0.6</td><td>77.7±0.6</td></tr><tr><td>GS-maxpool</td><td>77.4±1.0</td><td>67.0±1.0</td><td>76.6±0.8</td></tr><tr><td>Lanczos</td><td>79.5±1.8</td><td>66.2±1.9</td><td>78.3±0.3</td></tr><tr><td>AdaLanczos</td><td>80.4±1.1</td><td>68.7±1.0</td><td>78.1±0.4</td></tr><tr><td>CGNN</td><td>81.7±0.7</td><td>68.1±1.2</td><td>80.2±0.3</td></tr><tr><td>GDE</td><td>83.8±0.5</td><td>72.5±0.5</td><td>79.9±0.3</td></tr><tr><td>GODE</td><td>83.3±0.3</td><td>72.4±0.6</td><td>80.1±0.3</td></tr><tr><td>BLEND</td><td>84.2±0.6</td><td>74.4±0.7</td><td>80.7± 0.7</td></tr><tr><td>BLEND-kNN</td><td>83.1±0.8</td><td>73.3±0.9</td><td>81.5±0.5</td></tr></table>
|
| 212 |
+
|
| 213 |
+
lowing the review process. Experiments ran on AWS p2.8xlarge machines, each with 8 Tesla V100-SXM2 GPUs.
|
| 214 |
+
|
| 215 |
+
Implementation details For all datasets excepting ogb-arxiv, adaptive explicit Dormand-Prince scheme was used as the numerical solver; for ogb-arxiv, we used the Runge-Kutta method. For the two smallest datasets (Cora and Citeseer) we performed direct backpropagation through each step of the numerical integrator. For the larger datasets, to reduce memory complexity, we use Pontryagin’s maximum principle to propagate gradients backwards in time [69]. For the larger datasets, kinetic energy and Jacobian regularisation [28, 37] was employed. The regularisation ensures the learned dynamics is well-conditioned and easily solvable by a numeric solver, which reduced training time. We use constant initialisation for the attention weights, ${ \mathbf W } _ { K } , { \mathbf W } _ { Q }$ , so training starts from a well-conditioned system that induces small regularisation penalty terms [28].
|
| 216 |
+
|
| 217 |
+
The space complexity of BLEND is dominated by evaluating attention (13) over edges and is $\mathcal { O } ( \vert \mathcal { E } ^ { \prime } \vert ( d + d ^ { \prime } ) )$ where $\mathcal { E } ^ { \prime }$ is the edge set following rewiring and $d$ is dimension of features and $d ^ { \prime }$ is the dimension of positional encoding. The runtime complexity is $\mathcal { O } ( | \mathcal { E } ^ { \prime } | ( d + d ^ { \prime } ) ) ( E _ { b } + E _ { f } )$ , split
|
| 218 |
+
|
| 219 |
+
<table><tr><td>Method</td><td>CORA</td><td>CiteSeer</td><td>PubMed</td><td>Coauthor CS</td><td>Computer</td><td>Photo</td><td>ogb-arxiv</td></tr><tr><td>GCN</td><td>81.5±1.3</td><td>71.9 ±1.9</td><td>77.8±2.9</td><td>91.1±0.5</td><td>82.6±2.4</td><td>91.2±1.2</td><td>71.74±0.29</td></tr><tr><td>GAT</td><td>81.8±1.3</td><td>71.4±1.9</td><td>78.7±2.3</td><td>90.5±0.6</td><td>78.0±19</td><td>85.7±20</td><td>73.01±0.19*</td></tr><tr><td>GAT-ppr</td><td>81.6±0.3</td><td>68.5±0.2</td><td>76.7±0.3</td><td>91.3±0.1</td><td>85.4±0.3</td><td>90.9±0.3</td><td>一</td></tr><tr><td>MoNet</td><td>81.3±1.3</td><td>71.2±2.0</td><td>78.6±2.3</td><td>90.8±0.6</td><td>83.5±2.2</td><td>91.2±2.3</td><td></td></tr><tr><td>GS-mean</td><td>79.2±7.7</td><td>71.6±1.9</td><td>77.4±2.2</td><td>91.3±2.8</td><td>82.4±1.8</td><td>91.4±1.3</td><td>71.49±0.27</td></tr><tr><td>GS-maxpool</td><td>76.6±1.9</td><td>67.5±2.3</td><td>76.1±2.3</td><td>85.0±1.1</td><td></td><td>90.4±1.3</td><td></td></tr><tr><td>CGNN</td><td>81.4±1.6</td><td>66.9±1.8</td><td>66.6±4.4</td><td>92.3±0.2</td><td>80.3±2.0</td><td>91.4±1.5</td><td>58.70±2.50</td></tr><tr><td>GDE</td><td>78.7±2.2</td><td>71.8±1.1</td><td>73.9±3.7</td><td>91.6±0.1</td><td>82.9±0.6</td><td>92.4±2.0</td><td>56.66±10.9</td></tr><tr><td>BLEND</td><td>84.8±0.9</td><td>75.9±1.3</td><td>79.5±1.4</td><td>92.9±0.2</td><td>86.9±0.6</td><td>92.9±0.6</td><td>72.56±0.1 +</td></tr><tr><td>BLEND-kNN</td><td>82.5±0.9</td><td>73.4±0.5</td><td>80.9±0.7</td><td>92.3±0.1</td><td>86.7±0.6</td><td>93.5±0.3</td><td></td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 3: Performance (test accuracy±std) of different GNN models using random splits. $^ { * } \mathrm { O G B }$ GAT reference has 1.5M parameters vs ours $7 0 \mathrm { K . \dagger }$ BLEND-kNN pre-processes the graph using the DIGL methodology [43] (Section 3.3), which constructs an n-dimensional representation of each node (an n-by-n matrix), then sparsifies into a kNN graph. The ogb-arxiv dataset has ${ > } 1 5 0 \mathrm { K }$ nodes and goes OOM. This is not a limitation of BLEND, but that of DIGL. Other forms of initial rewiring are possible, but we chose to compare with DIGL (arguably the most popular graph rewiring) and so this result is missing
|
| 222 |
+
|
| 223 |
+
between the forward and backward pass and can be dominated by either depending on the number of function evaluations $( E _ { b } , E _ { f } )$ .
|
| 224 |
+
|
| 225 |
+
Tables 2–3 summarise the results of our experiments. BLEND outperforms other GNNs in most of the experiments, showing state-of-the-art results on some datasets. Another important point to note is that compared GNNs use different sets of parameters per layer, whereas in BLEND, due to our choice of a time-independent attention, parameters are shared. This results in significantly fewer parameters: for comparison, the OGB versions of GCN, SAGE and GAT used in the ogb-arxiv experiment require 143K, 219K and 1.63M parameters respectively, compared to only 70K in BLEND.
|
| 226 |
+
|
| 227 |
+
# 5.2 Positional encoding
|
| 228 |
+
|
| 229 |
+
In the second experiment, we investigated the impact of the positional encodings and vary the dimensionality and underlying geometry, in order to showcase the flexibility of our framework.
|
| 230 |
+
|
| 231 |
+
Figure 3 shows that for all datasets BLEND is superior to a Euclidean model where positional encodings are not used, which corresponds to $Z \ = \ X$ (BLEND w/o positional in Figure 3) and a version of GAT where attention is over a concatenation of the same positional encodings used in BLEND and the features. The only exception is
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Figure 3: An ablation study showing BLEND with and without positional encodings as well as GAT, the most similar conventional GNN with positional encodings added
|
| 235 |
+
|
| 236 |
+
CoathorCS, where the performance without positional encodings is unchanged.
|
| 237 |
+
|
| 238 |
+
We experimented with three forms of positional encoding: DIGL PPR embeddings of dimension $n$ [43], DeepWalk embeddings [66] of dimensions 16–256, and hyperbolic embeddings in the Poincare ball [15, 59] of dimension 2–16. Positional encodings are calculated as a preprocessing step and input as the U coordinates to BLEND. We calculated DeepWalk node embeddings using PyTorch Geometric’s Node2Vec implementation with parameters $p = 1$ , $q = 1$ , context size 20, and 16 walks per node. We trained with walk length ranging between 40 and 120 and took the embeddings with the highest accuracy for the link prediction task. Shallow hyperbolic embeddings were generated using the HGCN [17] implementation with the default parameters provided by the authors.
|
| 239 |
+
|
| 240 |
+
Figure 4 (left) compares the performance of the best model using DIGL $n$ -dimensional positional encodings against the best performing $d$ -dimensional hyperbolic positional encodings with $d$ tuned over the range 2-16. The average performance with DIGL positional encodings is 85.48, compared to 85.28 for hyperbolic encodings. Only in one case the DIGL encodings outperform the best hyperbolic encodings. Figure 4 (right) show the change in performance with the dimension $d ^ { \prime }$ of the positional encoding using a fixed hyperparameter configuration. As expected, we observe monotonic increase in performance as function of $d ^ { \prime }$ . Importantly most of the performance is captured by either 16 dimensional hyperbolic or positional encodings, with a small additional margin gained for going up to $d ^ { \prime } = n$ , which is impractical for larger graphs.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 4: Left: performance comparison between Euclidean and hyperbolic positional embeddings. Right: results of positional embeddings ablation. Hyperbolic or Euclidean embeddings with $d ^ { \prime } = \bar { 1 } 6$ allow to obtain performances comparable to euclidean embeddings with $d ^ { \prime } = n > > 1 6$ .
|
| 244 |
+
|
| 245 |
+
# 5.3 Additional ablations
|
| 246 |
+
|
| 247 |
+
In addition to studying the affect of positional encodings , we performed ablation studies on the step size used in the integrator as well as different forms of attention.
|
| 248 |
+
|
| 249 |
+
In Figure 5 we studied the affect of changing the step size of the integrator using the explicit Euler method with a fixed terminal time set to be the optimal terminal time. The left hand side of the figure shows the performance using the adaptive stepsize Dopri5 for comparison. Dopri5 gives the most consistent performance and is best if three of the six datasets. Details of additional attention functions and their relative performance can be found in the Supplementary Material.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 5: step size against accurcy for explicit Euler compared to the adaptive dopri5.
|
| 253 |
+
|
| 254 |
+
# 6 Related work
|
| 255 |
+
|
| 256 |
+
Image processing, computer vision, and graphics. Following the Perona-Malik scheme [65], PDE-based approaches flourished in the 1990s with multiple versions of anisotropic [90] and nonEuclidean [82] diffusion used primarily for image denoising. The realisation of these ideas in the form of nonlinear filters [85, 12] was adopted in the industry. PDE-based methods were also used for low-level vision tasks including inpainting [6] and image segmentation [13, 18]. In computer graphics, fundamental solutions (‘heat kernels’) of diffusion equations were used as shape descriptors [83]. The closed-form expression of such solutions using the Laplace-Beltrami operator served as inspiration for some of the early approaches for GNNs [34, 23, 42, 45].
|
| 257 |
+
|
| 258 |
+
Neural differential equations The interpretation of neural networks as discretised differential equations (‘neural ODEs’) [19] was an influential recent result with multiple follow-up works [25, 28, 53, 46]. In deep learning on graphs, this mindset has been applied to GNN architectures [2, 67] and continuous message passing [94]. Continuous GNNs were also explored in [31] who, similarly to [76], addressed the solutions of fixed point equations. Ordinary Differential Equations
|
| 259 |
+
|
| 260 |
+
on Graph Networks (GODE)[98] approach the problem using the technique of invertible ResNets.
|
| 261 |
+
Finally, [75] used graph-based ODEs to generate physics simulations.
|
| 262 |
+
|
| 263 |
+
Physics-inspired learning Solving PDEs with deep learning has been explored by [72]. Neural networks appeared in [47] to accelerate PDE solvers with applications in the physical sciences. These have been applied to problems where the PDE can be described on a graph [48]. [4] consider the problem of predicting fluid flow and use a PDE inside a GNN. These approaches differ from ours in that they solve a given PDE, whereas we use the notion of discretising PDEs as a principle to understand and design GNNs.
|
| 264 |
+
|
| 265 |
+
Neural ODEs on graphs The most similar work to this is GRAND [16] of which BLEND can be considered a non-Euclidean extension. In addition there are several other works that apply the neural ODE framework to graphs. In GDE [67], GODE [98] and CGNN [94], the goal is to adapt neural ordinary differential equations to graphs. In contrast, we consider non-Euclidean partial differential equations and regard GNNs as particular instances of their discretisation (both spatial and temporal). We can naturally use spaces with any metric, in particular, extending recent works on hyperbolic graph embeddings. None of the previous techniques explore the link to differential geometry. More specifically, GDE, GODE, and CGNN consider Neural ODEs of the canonical form $\begin{array} { r } { \frac { \partial x } { \partial t } = f ( x , t , \theta ) } \end{array}$ where $f$ is a graph neural network (GODE), the message passing component of a GNN (CGNN), or restricting $f$ to be layers of bijective functions on graphs (GDE). Furthermore, in CGNN only ODEs with closed form solutions are considered. [75] on the other hand is quite distinct as they are not concerned with GNN design and instead use graph-based ODEs to generate physics simulations.
|
| 266 |
+
|
| 267 |
+
# 7 Conclusion
|
| 268 |
+
|
| 269 |
+
We developed a new class of graph neural networks based on the discretisation of a non-Euclidean diffusion PDE called Beltrami flow. We represent the graph structure and node features as a manifold in a joint continuous space, whose evolution by a parametric diffusion PDE (driven by the downstream learning task) gives rise to feature learning, positional encoding, and possibly also graph rewiring. Our experimental results show very good performance on popular benchmarks with a small fraction of parameters used by other GNN models. Perhaps most importantly, our framework establishes important links between GNNs, differential geometry, and PDEs – fields with a rich history and profound results that in our opinion are still insufficiently explored in the graph ML community.
|
| 270 |
+
|
| 271 |
+
Future directions While we show that our framework generalises many popular GNN architectures we seek to use the graph as a numerical representation of an underlying continuous space. This view of the graph as an approximation of a continuous latent structure is a common paradigm of manifold learning [84, 5, 20] and network geometry [8]. If adopted in graph ML, this mindset offers a rigorous mathematical framework for formalising and generalising some of the recent trends in the field, including the departure from the input graph as the basis for message passing [1], latent graph inference [41, 89, 29, 36] higher-order [7, 54] and directional [3] message passing (which can be expressed as anisotropic diffusion arising from additional structure of the underlying continuous space and different discretisation of the PDEs e.g. based on finite elements), and exploiting efficient numerical PDE solvers [19]. We leave these exciting directions for future research.
|
| 272 |
+
|
| 273 |
+
Societal impact GNNs have recently become increasingly utilized in industrial applications e.g. in recommender systems and social networks, and hence could potentially lead to a negative societal impact if used improperly. We would like to emphasize that our paper does not study such potential negative applications and the mathematical framework we develop could help to interpret and understand existing GNN models. We believe that better understanding of ML models is key to managing their potential societal implications and preventing their negative impact.
|
| 274 |
+
|
| 275 |
+
Limitations The assumption that the graph can be modelled as a discretisation of some continuous space makes our framework applicable only to cases where the edge and node features are continuous in nature. Applications e.g. to knowledge graphs with categorical attributes could only be addressed by first embedding such attributes in a continuous space. Finally, the structural result presented in Theorem 1 that link our model to the Polyakov action have not been implemented. This will be addressed in future works.
|
| 276 |
+
|
| 277 |
+
# 8 Acknowledgements
|
| 278 |
+
|
| 279 |
+
We thank Nils Hammerla and Gabriele Corso for feedback on early version of this manuscript. MB and JR are supported in part by ERC Consolidator grant no 724228 (LEMAN).
|
| 280 |
+
|
| 281 |
+
# References
|
| 282 |
+
|
| 283 |
+
[1] Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. In ICLR, 2021.
|
| 284 |
+
[2] Pedro H. C. Avelar, Anderson R. Tavares, Marco Gori, and Luis C. Lamb. Discrete and continuous deep residual learning over graphs. arXiv:1911.09554, 2019. [3] Dominique Beaini, Saro Passaro, Vincent Létourneau, William L Hamilton, Gabriele Corso, and Pietro Liò. Directional graph networks. arXiv:2010.02863, 2020. [4] Filipe de Avila Belbute-Peres, Thomas Economon, and Zico Kolter. Combining differentiable pde solvers and graph neural networks for fluid flow prediction. In ICML, 2020. [5] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural Computation, 15(6):1373–1396, 2003.
|
| 285 |
+
[6] Marcelo Bertalmio, Guillermo Sapiro, Vincent Caselles, and Coloma Ballester. Image inpainting. In PACMCGIT, 2000. [7] Cristian Bodnar, Fabrizio Frasca, Yu Guang Wang, Nina Otter, Guido Montúfar, Pietro Liò, and Michael Bronstein. Weisfeiler and lehman go topological: Message passing simplicial networks. arXiv:2103.03212, 2021.
|
| 286 |
+
[8] Marian Boguna, Ivan Bonamassa, Manlio De Domenico, Shlomo Havlin, Dmitri Krioukov, and M Ángeles Serrano. Network geometry. Nature Reviews Physics, pages 1–22, 2021.
|
| 287 |
+
[9] Giorgos Bouritsas, Fabrizio Frasca, Stefanos Zafeiriou, and Michael M Bronstein. Improving graph neural network expressivity via subgraph isomorphism counting. arXiv:2006.09252, 2020.
|
| 288 |
+
[10] Michael M Bronstein, Joan Bruna, Taco Cohen, and Petar Velickovi ˇ c. Geometric deep learning: ´ Grids, groups, graphs, geodesics, and gauges. arXiv:2104.13478, 2021.
|
| 289 |
+
[11] Michael M Bronstein and Iasonas Kokkinos. Scale-invariant heat kernel signatures for non-rigid shape recognition. In CVPR, 2010.
|
| 290 |
+
[12] Antoni Buades, Bartomeu Coll, and J-M Morel. A non-local algorithm for image denoising. In ICCV, 2005.
|
| 291 |
+
[13] Vicent Caselles, Ron Kimmel, and Guillermo Sapiro. Geodesic active contours. IJCV, 22(1):61–79, 1997.
|
| 292 |
+
[14] Soumen Chakrabarti. Dynamic personalized pagerank in entity-relation graphs. In WWW, 2007.
|
| 293 |
+
[15] Benjamin P. Chamberlain, James Clough, and Marc Peter Deisenroth. Neural embeddings of graphs in hyperbolic space. arXiv:1705.10359, 2017.
|
| 294 |
+
[16] Benjamin P. Chamberlain, James Rowbottom, Maria Gorinova, Michael M. Bronstein, Stefan Webb, and Emanuele Rossi. GRAND: graph neural diffusion. In ICML 2021, pages 1407–1418, 2021.
|
| 295 |
+
[17] Ines Chami, Rex Ying, Christopher Ré, and Jure Leskovec. Hyperbolic graph convolutional neural networks. In NeurIPS, 2019.
|
| 296 |
+
[18] Tony F Chan and Luminita A Vese. Active contours without edges. IEEE Trans. Image Processing, 10(2):266–277, 2001.
|
| 297 |
+
[19] Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. In NeurIPS, pages 6571–6583, 2018.
|
| 298 |
+
[20] Ronald R Coifman and Stéphane Lafon. Diffusion maps. Applied and computational harmonic analysis, 21(1):5–30, 2006.
|
| 299 |
+
[21] Miles Cranmer, Sam Greydanus, Stephan Hoyer, Peter Battaglia, David Spergel, and Shirley Ho. Lagrangian neural networks. 2020.
|
| 300 |
+
[22] Miles Cranmer, Rui Xu, Peter Battaglia, and Shirley Ho. Learning symbolic physics with graph networks. arXiv:1909.05862, 2019.
|
| 301 |
+
[23] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, 2016.
|
| 302 |
+
[24] John R Dormand and Peter J Prince. A family of embedded Runge-Kutta formulae. Journal of Computational and Applied Mathematics, 6(1):19–26, 1980.
|
| 303 |
+
[25] Emilien Dupont, Arnaud Doucet, and Yee Whye Teh. Augmented neural ODEs. In NeurIPS, pages 3134–3144, 2019.
|
| 304 |
+
[26] Frédo Durand and Julie Dorsey. Fast bilateral filtering for the display of high-dynamic-range images. In Proc Computer Graphics and Interactive Techniques, 2002.
|
| 305 |
+
[27] Vijay Prakash Dwivedi and Xavier Bresson. A generalization of transformer networks to graphs. arXiv:2012.09699, 2020.
|
| 306 |
+
[28] Chris Finlay, Jörn-Henrik Jacobsen, Levon Nurbekyan, and Adam M Oberman. How to train your neural ode: The world of Jacobian and kinetic regularization. In ICML, 2020.
|
| 307 |
+
[29] Luca Franceschi, Mathias Niepert, Massimiliano Pontil, and Xiao He. Learning discrete structures for graph neural networks. In ICML, 2019.
|
| 308 |
+
[30] Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In ICML, 2017.
|
| 309 |
+
[31] Fangda Gu, Heng Chang, Wenwu Zhu, Somayeh Sojoudi, and Laurent El Ghaoui. Implicit graph neural networks. In NeurIPS, 2020.
|
| 310 |
+
[32] William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, 2017.
|
| 311 |
+
[33] DF Hawken, JJ Gottlieb, and JS Hansen. Review of some adaptive node-movement techniques in finite-element and finite-difference solutions of partial differential equations. Journal of Computational Physics, 95(2):254–302, 1991.
|
| 312 |
+
[34] Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv:1506.05163, 2015.
|
| 313 |
+
[35] 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:2005.00687, 2020.
|
| 314 |
+
[36] Anees Kazi, Luca Cosmo, Nassir Navab, and Michael Bronstein. Differentiable graph module (DGN) graph convolutional networks. arXiv:2002.04999, 2020.
|
| 315 |
+
[37] Jacob Kelly, Jesse Bettencourt, Matthew James Johnson, and David Duvenaud. Learning differential equations that are easy to solve. In NeurIPS, 2020.
|
| 316 |
+
[38] Ron Kimmel. Numerical geometry of images: Theory, algorithms, and applications. Springer, 2012.
|
| 317 |
+
[39] Ron Kimmel, Ravi Malladi, and Nir Sochen. Images as embedded maps and minimal surfaces: movies, color, texture, and volumetric medical images. IJCV, 39(2):111–129, 2000.
|
| 318 |
+
[40] Ron Kimmel, Nir Sochen, and Ravi Malladi. From high energy physics to low level vision. pages 236–247. Springer, 1997.
|
| 319 |
+
[41] Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. In ICML, 2018.
|
| 320 |
+
[42] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 321 |
+
[43] Johannes Klicpera, Stefan Weißenberger, and Stephan Günnemann. Diffusion improves graph learning. In NeurIPS, volume 32, 2019.
|
| 322 |
+
[44] Wilhelm Kutta. Beitrag zur naherungsweisen integration totaler differentialgleichungen. Z. Math. Phys., 46:435–453, 1901.
|
| 323 |
+
[45] Ron Levie, Federico Monti, Xavier Bresson, and Michael M Bronstein. Cayleynets: Graph convolutional neural networks with complex rational spectral filters. IEEE Trans. Signal Processing, 2017.
|
| 324 |
+
[46] Xuechen Li, Ricky Tian Qi Chen, Ting-Kam Leonard Wong, and David Duvenaud. Scalable gradients for stochastic differential equations. In Artificial Intelligence and Statistics, 2020.
|
| 325 |
+
[47] Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. 2020.
|
| 326 |
+
[48] Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Multipole graph neural operator for parametric partial differential equations. In NeurIPS, 2020.
|
| 327 |
+
[49] Renjie Liao, Zhizhen Zhao, Raquel Urtasun, and Richard S Zemel. Lanczosnet: Multi-scale deep graph convo-lutional networks. In 7th International Conference on Learning Representations, ICLR 2019, 2019.
|
| 328 |
+
[50] Richard Liaw, Eric Liang, Robert Nishihara, Philipp Moritz, Joseph E. Gonzalez, and Ion Stoica. Tune: A research platform for distributed model selection and training. In arXiv: 1807.05118., 2018.
|
| 329 |
+
[51] Roee Litman and Alexander M Bronstein. Learning spectral descriptors for deformable shape correspondence. PAMI, 36(1):171–180, 2013.
|
| 330 |
+
[52] Qi Liu, Maximilian Nickel, and Douwe Kiela. Hyperbolic graph neural networks. arXiv preprint arXiv:1910.12892, 2019.
|
| 331 |
+
[53] Xuanqing Liu, Tesi Xiao, Si Si, Qin Cao, Sanjiv Kumar, and Cho-Jui Hsieh. Neural SDE: Stabilizing neural ODE networks with stochastic noise. (2), 2019.
|
| 332 |
+
[54] Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. In NeurIPS, pages 2153–2164, 2019.
|
| 333 |
+
[55] Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton Van Den Hengel. Image-based recommendations on styles and substitutes. In Proceedings Information Retrieval, 2015.
|
| 334 |
+
[56] Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127–163, 2000.
|
| 335 |
+
[57] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and Michael M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model CNNs. In CVPR, 2017.
|
| 336 |
+
[58] Galileo Namata, Ben London, Lise Getoor, Bert Huang, and UMD EDU. Query-driven active surveying for collective classification. In Proceedings Mining and Learning with Graphs, 2012.
|
| 337 |
+
[59] Maximillian Nickel and Douwe Kiela. Learning continuous hierarchies in the lorentz model of hyperbolic geometry. In International Conference on Machine Learning, pages 3779–3788. PMLR, 2018.
|
| 338 |
+
[60] Hoang NT and Takanori Maehara. Revisiting graph neural networks: All we have is low-pass filters. 2019.
|
| 339 |
+
[61] Lars Onsager. Reciprocal relations in irreversible processes. i. Physical Review, 37(4):405, 1931.
|
| 340 |
+
[62] Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In ICLR, 2020.
|
| 341 |
+
[63] Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The pagerank citation ranking: Bringing order to the web. Technical report, 1999.
|
| 342 |
+
[64] Giuseppe Patané. Laplacian spectral kernels and distances for geometry processing and shape analysis. Computer Graphics Forum, 35(2):599–624, 2016.
|
| 343 |
+
[65] Pietro Perona and Jitendra Malik. Scale-space and edge detection using anisotropic diffusion. PAMI, 12(7):629–639, 1990.
|
| 344 |
+
[66] 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, 2014.
|
| 345 |
+
[67] Michael Poli, Stefano Massaroli, Junyoung Park, Atsushi Yamashita, Hajime Asama, and Jinkyoo Park. Graph neural ordinary differential equations. pages 6571–6583, 2019.
|
| 346 |
+
[68] Alexander M Polyakov. Quantum geometry of bosonic strings. Physics Letters B, 103(3):207–210, 1981.
|
| 347 |
+
[69] Lev Semenovich Pontryagin. Mathematical theory of optimal processes. Routledge, 2018.
|
| 348 |
+
[70] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, 2017.
|
| 349 |
+
[71] Alejandro F. Queiruga, N. Benjamin Erichson, Dane Taylor, and Michael W. Mahoney. Continuous-in-depth neural networks. CoRR, 2020.
|
| 350 |
+
[72] Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (Part II): Data-driven discovery of nonlinear partial differential equations. CoRR, (Part II), 2017.
|
| 351 |
+
[73] Emanuele Rossi, Fabrizio Frasca, Ben Chamberlain, Davide Eynard, Michael Bronstein, and Federico Monti. SIGN: Scalable inception graph neural networks. arXiv:2004.11198, 2020.
|
| 352 |
+
[74] Carl Runge. Über die numerische auflösung von differentialgleichungen. Mathematische Annalen, 46(2):167–178, 1895.
|
| 353 |
+
[75] Alvaro Sanchez-Gonzalez, Victor Bapst, Kyle Cranmer, and Peter Battaglia. Hamiltonian graph networks with ODE integrators. 2019.
|
| 354 |
+
[76] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Trans. Neural Networks, 27(8):61–80, 2009.
|
| 355 |
+
[77] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI Magazine, 29(3):93–93, 2008.
|
| 356 |
+
[78] Lawrence F Shampine. Some practical Runge-Kutta formulas. Mathematics of Computation, 46(173):135–150, 1986.
|
| 357 |
+
[79] Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of graph neural network evaluation. arXiv:1811.05868, 2018.
|
| 358 |
+
[80] Nino Shervashidze, Pascal Schweitzer, Erik Jan Van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. JMLR, 12:2539–2561, 2011.
|
| 359 |
+
[81] Jonathan Shlomi, Peter Battaglia, and Jean-Roch Vlimant. Graph neural networks in particle physics. Machine Learning: Science and Technology, 2(2):021001, 2020.
|
| 360 |
+
[82] Nir Sochen, Ron Kimmel, and Ravi Malladi. A general framework for low level vision. IEEE Trans. Image Processing, 7(3):310–318, 1998.
|
| 361 |
+
[83] Jian Sun, Maks Ovsjanikov, and Leonidas Guibas. A concise and provably informative multiscale signature based on heat diffusion. Computer Graphics Forum, 28(5):1383–1392, 2009.
|
| 362 |
+
[84] Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. Dcience, 290(5500):2319–2323, 2000.
|
| 363 |
+
[85] Carlo Tomasi and Roberto Manduchi. Bilateral filtering for gray and color images. In ICCV, 1998.
|
| 364 |
+
[86] Ashish Vaswani, Noam Shazeer, Niki Parmar, Akob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, pages 5998–6008, 2017.
|
| 365 |
+
[87] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. 2017.
|
| 366 |
+
[88] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. In ICLR, 2018.
|
| 367 |
+
[89] Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph CNN for learning on point clouds. ACM Trans. Graphics, 38(5):1–12, 2019.
|
| 368 |
+
[90] Joachim Weickert. Anisotropic diffusion in image processing. Teubner Stuttgart, 1998.
|
| 369 |
+
[91] Joachim Weickert, Bart M. Ter Haar Romeny, and Max A. Viergever. Efficient and reliable schemes for nonlinear diffusion filtering. IEEE Trans. Image Processing, 7(3):398–410, 1998.
|
| 370 |
+
[92] Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In ICML. PMLR, 2019.
|
| 371 |
+
[93] Tailin Wu, Hongyu Ren, Pan Li, and Jure Leskovec. Graph information bottleneck. NeurIPS, 2020.
|
| 372 |
+
[94] Louis-pascal A C Xhonneux, Meng Qu, and Jian Tang. Continuous graph neural networks. In ICML, 2020.
|
| 373 |
+
[95] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 374 |
+
[96] Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. In International conference on machine learning, pages 40–48. PMLR, 2016.
|
| 375 |
+
[97] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In NeurIPS, 2017.
|
| 376 |
+
[98] Juntang Zhuang, Nicha Dvornek, Xiaoxiao Li, and James S. Duncan. Ordinary differential equations on graph networks. Technical Report 1, 2020.
|
| 377 |
+
|
| 378 |
+
# Checklist
|
| 379 |
+
|
| 380 |
+
1. For all authors...
|
| 381 |
+
|
| 382 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 383 |
+
(b) Did you describe the limitations of your work? [Yes] In limitations (S6) and an extensions (S3.4)
|
| 384 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] Section 6
|
| 385 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 386 |
+
|
| 387 |
+
2. If you are including theoretical results...
|
| 388 |
+
|
| 389 |
+
(a) Did you state the full set of assumptions of all theoretical results? Theorem 1 is dealt with in the supplementary material [Yes] Supplementary Material
|
| 390 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Supplementary Material
|
| 391 |
+
|
| 392 |
+
3. If you ran experiments...
|
| 393 |
+
|
| 394 |
+
(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 supplementary material
|
| 395 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] hyperparameters are included in Supplementary Material and splits are addressed in section 5
|
| 396 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Results in Section 5 include error bars
|
| 397 |
+
(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] AWS, details at the end of 5.1 and supplementary material
|
| 398 |
+
|
| 399 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 400 |
+
|
| 401 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] papers have been cited for the most relevant OS libraries
|
| 402 |
+
(b) Did you mention the license of the assets? [No]
|
| 403 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 404 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 405 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 406 |
+
|
| 407 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 408 |
+
|
| 409 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 410 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 411 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/8qDwejCuCN/8qDwejCuCN.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNSUPERVISED REPRESENTATION LEARNING FOR TIME SERIES WITH TEMPORAL NEIGHBORHOOD CODING
|
| 2 |
+
|
| 3 |
+
Sana Tonekaboni∗ University of Toronto & Vector Institute The Hospital for Sick Children stonekaboni@cs.toronto.edu
|
| 4 |
+
|
| 5 |
+
Danny Eytan The Hospital for Sick Children biliary.colic@gmail.com
|
| 6 |
+
|
| 7 |
+
Anna Goldengerg University of Toronto & Vector Institute The Hospital for Sick Children anna.goldenberg@utoronto.ca
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Time series are often complex and rich in information but sparsely labeled and therefore challenging to model. In this paper, we propose a self-supervised framework for learning generalizable representations for non-stationary time series. Our approach, called Temporal Neighborhood Coding (TNC), takes advantage of the local smoothness of a signal’s generative process to define neighborhoods in time with stationary properties. Using a debiased contrastive objective, our framework learns time series representations by ensuring that in the encoding space, the distribution of signals from within a neighborhood is distinguishable from the distribution of non-neighboring signals. Our motivation stems from the medical field, where the ability to model the dynamic nature of time series data is especially valuable for identifying, tracking, and predicting the underlying patients’ latent states in settings where labeling data is practically impossible. We compare our method to recently developed unsupervised representation learning approaches and demonstrate superior performance on clustering and classification tasks for multiple datasets.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Real-world time-series data is high dimensional, complex, and has unique properties that bring about many challenges for data modeling (Yang & Wu, 2006). In addition, these signals are often sparsely labeled, making it even more challenging for supervised learning tasks. Unsupervised representation learning can extract informative low-dimensional representations from raw time series by leveraging the data’s inherent structure, without the need for explicit supervision. These representations are more generalizable and robust, as they are less specialized for solving a single supervised task. Unsupervised representation learning is well studied in domains such as vision (Donahue & Simonyan, 2019; Denton et al., 2017; Radford et al., 2015) and natural language processing (Radford et al., 2017; Young et al., 2018; Mikolov et al., 2013), but has been underexplored in the literature for time series settings. Frameworks designed for time series need to be efficient and scalable because signals encountered in practice can be long, high dimensional, and high frequency. Moreover, it should account for and be able to model dynamic changes that occur within samples, i.e., non-stationarity of signals.
|
| 16 |
+
|
| 17 |
+
The ability to model the dynamic nature of time series data is especially valuable in medicine. Health care data is often organized as a time series, with multiple data types, collected from various sources at different sampling frequencies, and riddled with artifacts and missing values. Throughout their stay at the hospital or within the disease progression period, patients transition gradually between distinct clinical states, with periods of relative stability, improvement, or unexpected deterioration, requiring escalation of care that alters the patient’s trajectory. A particular challenge in medical time-series data is the lack of well-defined or available labels that are needed for identifying the underlying clinical state of an individual or for training models aimed at extracting low-dimensional representations of these states. For instance, in the context of critical-care, a patient’s stay in the critical care unit (CCU) is captured continuously via streaming physiological signals by the bedside monitor. Obtaining labels for the patient’s state for extended periods of these signals is practically impossible as the underlying physiological state can be unknown even to the clinicians. This further motivates the use of unsupervised representation learning in these contexts. Learning rich representations can be crucial in facilitating the tracking of disease progression, predicting the future trajectories of the patients, and tailoring treatments to these underlying states.
|
| 18 |
+
|
| 19 |
+
In this paper, we propose a self-supervised framework for learning representations for complex multivariate non-stationary time series. This approach, called Temporal Neighborhood Coding (TNC), is designed for temporal settings where the latent distribution of the signals changes over time, and it aims to capture the progression of the underlying temporal dynamics. TNC is efficient, easily scalable to high dimensions, and can be used in different time series settings. We assess the quality of the learned representations on multiple datasets and show that the representations are general and transferable to many downstream tasks such as classification and clustering. We further demonstrate that our method outperforms existing approaches for unsupervised representation learning, and it even performs closely to supervised techniques in classification tasks. The contributions of this work are three-fold:
|
| 20 |
+
|
| 21 |
+
1. We present a novel neighborhood-based unsupervised learning framework for non-stationary multivariate time series data.
|
| 22 |
+
2. We introduce the concept of a temporal neighborhood with stationary properties as the distribution of similar windows in time. The neighborhood boundaries are determined automatically using the properties of the signal and statistical testing.
|
| 23 |
+
3. We incorporate concepts from Positive Unlabeled Learning, specifically, sample weight adjustment, to account for potential bias introduced in sampling negative examples for the contrastive loss.
|
| 24 |
+
|
| 25 |
+
# 2 METHOD
|
| 26 |
+
|
| 27 |
+
We introduce a framework for learning representations that encode the underlying state of a multivariate, non-stationary time series. Our self-supervised approach, TNC, takes advantage of the local smoothness of the generative process of signals to learn generalizable representations for windows of time series. This is done by ensuring that in the representation space, the distribution of signals proximal in time is distinguishable from the distribution of signals far away, i.e., proximity in time is identifiable in the encoding space. We represent our multivariate time series signals as $\dot { X } \in { \cal R } ^ { D \times T }$ , where D is the number of features and T is the number of measurements over time. X[t− δ ,t+ δ ] represents a window of time series of length $\delta$ , centered around time $t$ , that includes measurements of all features taken in the interval $\begin{array} { r } { [ t - \frac { \delta } { 2 } , t + \frac { \delta } { 2 } ] } \end{array}$ . Throughout the paper, we refer to this window as $W _ { t }$ for notational simplicity. Our goal is to learn the underlying representation of $W _ { t }$ , and by sliding this window over time, we can obtain the trajectory of the underlying states of the signal.
|
| 28 |
+
|
| 29 |
+
We define the temporal neighborhood $( N _ { t } )$ of a window $W _ { t }$ as the set of all windows with centroids $t ^ { * }$ , sampled from a normal distribution $t ^ { * } \sim \mathcal { N } ( t , \eta \cdot \delta )$ . Where $\mathcal { N }$ is a Gaussian centered at $t , \delta$ is the size of the window, and $\eta$ is the parameter that defines the range of the neighborhood. Relying on the local smoothness of a signal’s generative process, the neighborhood distribution is characterized as a Gaussian to model the gradual transition in temporal data, and intuitively, it approximates the distribution of samples that are similar to $W _ { t }$ . The $\eta$ parameter determines the neighborhood range and depends on the signal characteristics and how gradual the time series’s statistical properties change over time. This can be set by domain experts based on prior knowledge of the signal behavior, or for more robust estimation, it can be determined by analyzing the stationarity properties of the signal for every $W _ { t }$ . Since the neighborhood represents similar samples, the range should identify the approximate time span within which the signal remains stationary, and the generative process does not change. For this purpose, we use the Augmented Dickey-Fuller (ADF) statistical test to determine this region for every window. Proper estimation of the neighborhood range is an integral part of the TNC framework. If $\eta$ is too small, many samples from within a neighborhood will overlap, and therefore the encoder would only learn to encode the overlapping information. On the other hand, if $\eta$ is too big, the neighborhood would span over multiple underlying states, and therefore the encoder would fail to distinguish the variation among these states. Using the ADF test, we can automatically adjust the neighborhood for every window based on the signal behavior. More details on this test and how it is used to estimate $\eta$ is described in section 2.
|
| 30 |
+
|
| 31 |
+
Now, assuming windows within a neighborhood possess similar properties, signals outside of this neighborhood, denoted as $\bar { N } _ { t }$ , are considered non-neighboring windows. Samples from $\bar { N } _ { t }$ are likely to be different from $W _ { t }$ , and can be considered as negative samples in a context of a contrastive learning framework. However, this assumption can suffer from the problem of sampling bias, common in most contrastive learning approaches (Chuang et al., 2020; Saunshi et al., 2019). This bias occurs because randomly drawing negative examples from the data distribution may result in negative samples that are actually similar to the reference. This can significantly impact the learning framework’s performance, but little work has been done on addressing this issue (Chuang et al., 2020). In our context, this can happen when there are windows from $\bar { N _ { t } }$ that are far away from $W _ { t }$ , but have the same underlying state. To alleviate this bias in the TNC framework, we consider samples from $\bar { N } _ { t }$ as unlabeled samples, as opposed to negative, and use ideas from Positive-Unlabeled (PU) learning to accurately measure the loss function. In reality, even though samples within a neighborhood are all similar, we cannot make the assumption that samples outside this region are necessarily different. For instance, in the presence of long term seasonalities, signals can exhibit similar properties at distant times. In a healthcare context, this can be like a stable patient that undergoes a critical condition, but returns back to a stable state afterwards.
|
| 32 |
+
|
| 33 |
+
In PU learning, a classifier is learned using labeled data drawn from the positive class $( P )$ and unlabeled data $( U )$ that is a mixture of positive and negative samples with a positive class prior $\pi$ (Du Plessis et al., 2014; Kiryo et al., 2017; Du Plessis & Sugiyama, 2014). Existing PU learning methods fall under two categories based on how they handle the unlabeled data: 1) methods that identify negative samples from the unlabeled cohort (Li & Liu, 2003); 2) methods that treat the unlabeled data as negative samples with smaller weights (Lee & Liu, 2003; Elkan & Noto, 2008). In the second category, unlabeled samples should be properly weighted in the loss term in order to train an unbiased classifier. Elkan & Noto (2008) introduces a simple and efficient way of approximating the expectation of a loss function by assigning individual weights $w$ to training examples from the unlabeled cohort. This means each sample from the neighborhood is treated as a positive example with unit weight, while each sample from $\bar { N }$ is treated as a combination of a positive example with weight $w$ and a negative example with complementary weight ${ 1 - w }$ . In the original paper (Elkan & Noto, 2008), the weight is defined as the probability for a sample from the unlabeled set to be a positive sample, i.e. $w = p ( y = 1 | x )$ for $x \in U$ . In the TNC framework, this weight represents the probability of having samples similar to $W _ { t }$ in $\bar { N }$ . By incorporating weight adjustment into the TNC loss (Equation 1), we account for possible positive samples that occur in the non-neighboring distribution. $w$ can be approximated using prior knowledge of the underlying state distribution or tuned as a hyperparameter. Appendix A.6 explains how the weight parameter is selected for our different experiment setups and also demonstrates the impact of weight adjustment on performance for downstream tasks.
|
| 34 |
+
|
| 35 |
+
After defining the neighborhood distribution, we train an objective function that encourages a distinction between the representation of samples of the same neighborhood from the outside samples. An ideal encoder preserves the neighborhood properties in the encoding space. Therefore representations $Z _ { l } = E n c ( \bar { W _ { l } } )$ of samples from a neighborhood $W _ { l } \in N _ { t }$ , can be distinguished from representation $Z _ { k } = E n c ( W _ { k } )$ of samples from outside the neighborhood $W _ { k } \in \bar { N } _ { t }$ . TNC is composed of two main components:
|
| 36 |
+
|
| 37 |
+
1. An Encoder $E n c ( W _ { t } )$ that maps $W _ { t } \in \mathbb { R } ^ { D \times \delta }$ to a representation $Z _ { t } \in \mathbb { R } ^ { M }$ , in a lower dimensional space $( M \ll D \times \delta )$ , where $D \times \delta$ is the total number of measurements in $W _ { t }$
|
| 38 |
+
|
| 39 |
+
2. A Discriminator $\mathcal { D } ( Z _ { t } , Z )$ that approximates the probability of $Z$ being the representation of a window in $N _ { t }$ . More specifically, it receives two samples from the encoding space and predicts the probability of those samples belonging to the same temporal neighborhood.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: Overview of the TNC framework components. For each sample window $W _ { t }$ (indicated with the dashed black box), we first define the neighborhood distribution. The encoder learns the distribution of windows sampled from $N _ { t }$ and $\bar { N } _ { t }$ , in the representation space. Then samples from Weightingthese distributions are fed into the discriminator alongside $Z _ { t }$ , to predict the probability of the Representationwindows being in the same neighborhood.
|
| 43 |
+
|
| 44 |
+
TNC is a general framework; therefore, it is agnostic to the nature of the time series and the architecture of the encoder. The encoder can be any parametric model that is well-suited to the signal properties (Oord et al., 2016; Bai et al., 2018; Fawaz et al., 2019). For the Discriminator $\mathcal { D } ( Z _ { t } , Z )$ we use a simple multi-headed binary classifier that outputs 1 if $Z$ and $Z _ { t }$ are representations of neighbors in time, and 0 otherwise. In the experiment section, we describe the architectural details of the models used for our experiments in more depth.
|
| 45 |
+
|
| 46 |
+
Figure 1 provides a summary overview of the TNC framework. We formalize the objective function of our unsupervised learning framework in Equation 1. In essence, we would like the probability likelihood estimation of the Discriminator to be accurate, i.e., close to 1 for the representation of neighboring samples and close to 0 for windows far apart. Samples from the non-neighboring region $( \bar { N } )$ are weight-adjusted using the $w$ parameters to account for positive samples in this distribution.
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { \boldsymbol { \Sigma } = - \mathbb { E } _ { W _ { t } \sim X } [ \mathbb { E } _ { W _ { t } \sim N _ { t } } [ \log \underbrace { \mathcal { D } ( Z _ { t } , Z _ { l } ) } _ { \mathrm { ~ } \forall \mathrm { ~ } W _ { t } \sim \bar { N } _ { t } } ] + \mathbb { E } _ { W _ { t } \sim \bar { N } _ { t } } [ ( 1 - w _ { t } ) \times \log \underbrace { ( 1 - \mathcal { D } ( Z _ { t } , Z _ { k } ) ) } _ { \mathcal { D } ( E n c ( W _ { t } ) , E n c ( W _ { k } ) ) } + w _ { t } \times \log \mathcal { D } ( Z _ { t } , Z _ { k } ) ] } \\ { \mathcal { D } ( E n c ( W _ { t } ) , E n c ( W _ { l } ) ) \quad \quad \quad \quad { \mathcal { D } } ( E n c ( W _ { t } ) , E n c ( W _ { k } ) ) } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
We train the encoder and the discriminator hand in hand by optimizing for this objective. Note that the Discriminator is only part of training and will not be used during inference. Similar to the encoder, it can be approximated using any parametric model. However, the more complex the Discriminator, the harder it becomes to interpret the latent space’s decision boundaries since it allows similarities to be mapped on complex nonlinear relationships.
|
| 53 |
+
|
| 54 |
+
Defining the neighborhood parameter using the ADF test: As mentioned earlier, the neighborhood range can be specified using the characteristics of the data. In non-stationary time series, the generative process of the signals changes over time. We define the temporal neighborhood around every window as the region where the signal is relatively stationary. Since a signal may remain in an underlying state for an unknown amount of time, each window’s neighborhood range may vary in size and must be adjusted to signal behavior. To that end, we use the Augmented Dickey-Fuller (ADF) statistical test to derive the neighborhood range $\eta$ . The ADF test belongs to a category of tests called "Unit Root Test", and is a method for testing the stationarity of a time series. For every $W _ { t }$ , we want to find the neighborhood range around that window that indicates a stationary region. To determine this, we start from $\eta = 1$ and gradually increase the neighborhood size $\eta$ , measuring the $p$ -value from the test at every step. Once $p$ -value is above a threshold (in our setting 0.01), it means that it fails to reject the null hypothesis and suggests that within this neighborhood region, the signal is no longer stationary. This way, we find the widest neighborhood within which the signal remains relatively stationary. Note that the window size $\delta$ is constant throughout the experiment, and during ADF testing, we only adjust the neighborhood’s width.
|
| 55 |
+
|
| 56 |
+
# 3 EXPERIMENTS
|
| 57 |
+
|
| 58 |
+
We evaluate our framework’s usability on multiple time series datasets with dynamic latent states that change over time. We compare classification performance and clusterability against two state-ofthe-art approaches for unsupervised representation learning for time series: 1. Contrastive Predictive Coding (CPC) (Oord et al., 2018) that uses predictive coding principles to train the encoder on a probabilistic contrastive loss. 2. Triplet-Loss (T-Loss), introduced in (Franceschi et al., 2019), which employs time-based negative sampling and a triplet loss to learn representations for time series windows. The triplet loss objective ensures similar time series have similar representations by minimizing the pairwise distance between positive samples (subseries) while maximizing it for negative ones. (See Appendix A.2 for more details on each baseline.)
|
| 59 |
+
|
| 60 |
+
For a fair comparison and to ensure that the difference in performance is not due to the differences in the models’ architecture, the same encoder network is used across all compared baselines. Our objective is to compare the performance of the learning frameworks, agnostic to the encoder’s choice. Therefore, we selected simple architectures to evaluate how each framework can use a simple encoder’s limited capacity to learn meaningful representations. We assess the generalizability of the representations by 1) evaluating clusterability in the encoding space and 2) using the representations for a downstream classification task. In addition to the baselines mentioned above, we also compare clusterability performance with unsupervised K-means and classification with a K-Nearest Neighbor classifier, using Dynamic Time Warping (DTW) to measure time series distance. All models are implemented using Pytorch 1.3.1 and trained on a machine with Quadro 400 GPU 1. Below we describe the datasets for our experiments in more detail.
|
| 61 |
+
|
| 62 |
+
# 3.1 SIMULATED DATA
|
| 63 |
+
|
| 64 |
+
The simulated dataset is designed to replicate very long, non-stationary, and high-frequency time series for which the underlying dynamics change over time. Our generated time series consists of 2000 measurements for 3 features, generated from 4 different underlying states. We use a Hidden Markov Model (HMM) to generate the random latent states over time, and in each state, the time series is generated from a different generative process, including Gaussian Processes (GPs) with different kernel functions and Nonlinear Auto-regressive Moving Average models with different sets of parameters $\overset { \cdot } { \alpha }$ and $\beta$ ). Besides, for it to further resemble realistic (e.g., clinical) time series, two features are always correlated. More details about this dataset are provided in the Appendix A.1. For this experimental setup, we use a two-directional, single-layer recurrent neural network encoder. We have selected this simple architecture because it handles time series with variable lengths, and it easily extends to higher-dimensional inputs. The encoder model encodes multi-dimensional signal windows of $\delta = 5 0$ into 10 dimensional representation vectors. The window size is selected such that it is long enough to contain information about the underlying state but not too long to span over multiple underlying states. A more detailed discussion on the window size choice is presented in Appendix A.4.
|
| 65 |
+
|
| 66 |
+
# 3.2 CLINICAL WAVEFORM DATA
|
| 67 |
+
|
| 68 |
+
For a real-world clinical experiment, we use the MIT-BIH Atrial Fibrillation dataset (Moody, 1983). This dataset includes 25 long-term Electrocardiogram (ECG) recordings (10 hours in duration) of human subjects with atrial fibrillation. It consists of two ECG signals; each sampled at $2 5 0 \mathrm { H z }$ . The signals are annotated over time for the following different rhythm types: 1) Atrial fibrillation, 2) Atrial flutter, 3) AV junctional rhythm, and 4) all other rhythms. Our goal in this experiment is to identify the underlying type of arrhythmia for each sample without any information about the labels. This dataset is particularly interesting and makes this experiment challenging due to the following special properties:
|
| 69 |
+
|
| 70 |
+
• The underlying heart rhythm changes over time in each sample. This is an opportunity to evaluate how different representation learning frameworks can handle alternating classes in non-stationary settings;
|
| 71 |
+
|
| 72 |
+
• The dataset is highly imbalanced, with atrial flutter and AV junctional rhythm being present in fewer than $0 . 1 \%$ of the measurements. Data imbalance poses many challenges for downstream classification, further motivating the use of unsupervised representation learning; The dataset has samples from a small number of individuals, but over an extended period (around 5 million data points). This realistic scenario, common in healthcare data, shows that our framework is still powerful in settings with a limited number of samples.
|
| 73 |
+
|
| 74 |
+
The simple RNN encoder architecture used for other experiment setups cannot model the highfrequency ECG measurements. Therefore, inspired by state-of-the-art architectures for ECG classification problems, the encoder Enc used in this experiment is a 2-channel, 1-dimensional strided convolutional neural network that runs directly on the ECG waveforms. We use six convolutional layers with a total down-sampling factor of 16. The window size is 2500 samples, meaning that each convolutional filter covers at least half a second of ECG recording, and the representations are summarized in a 64-dimensional vector.
|
| 75 |
+
|
| 76 |
+
# 3.3 HUMAN ACTIVITY RECOGNITION (HAR) DATA
|
| 77 |
+
|
| 78 |
+
Human Activity Recognition (HAR) is the problem of predicting the type of activity using temporal data from accelerometer and gyroscope measurements. We use the HAR dataset from the UCI Machine Learning Repository 2 that includes data collected from 30 individuals using a smartwatch. Each person performs six activities: 1) walking, 2) walking upstairs, 3) walking downstairs, 4) sitting, 5) standing, and 6) laying. The time-series measurements are pre-processed to extract 561 features. For our purpose, we concatenate the activity samples from every individual over time using the subject identifier to build the full-time series for each subject, which includes continuous activity change. Similar to the simulated data setting, we use a single-layer RNN encoder. The selected window size is 4, representing about 15 seconds of recording, and the representations are encoded in a 10-dimensional vector space.
|
| 79 |
+
|
| 80 |
+
# 4 RESULTS
|
| 81 |
+
|
| 82 |
+
In this section we present the results for clusterability of the latent representations and downstream classification performance for all datasets and across all baselines. Clusterability indicates how well each method recovers appropriate states, and classification assesses how informative our representations are for downstream tasks.
|
| 83 |
+
|
| 84 |
+
# 4.1 EVALUATION: CLUSTERABILITY
|
| 85 |
+
|
| 86 |
+
Many real-world time series data have underlying multi-category structure, naturally leading to representations with clustering properties. Encoding such general priors is a property of a good representation (Bengio et al., 2013). In this section, we assess the distribution of the representations in the encoding space. If information of the latent state is properly learned and encoded by the framework, the representations of signals from the same underlying state should cluster together. Figures 2a, 2b, and 2c show an example of this distribution for simulated data across compared approaches. Each plot is a 2-dimensional t-SNE visualization of the representations where each data point in the scatter plot is an encoding $Z \in R ^ { 1 0 }$ that represents a window of size $\delta = 5 0$ of a simulated time series. We can see that without any information about the hidden states, representations learned using TNC cluster windows from the same hidden state better than the alternative approaches. The results show that CPC and Triplet Loss have difficulty separating time series that are generated from non-linear auto-regressive moving average (NARMA) models with variable regression parameters.
|
| 87 |
+
|
| 88 |
+
To compare the representation clusters’ consistency for each baseline, we use two very common cluster validity indices, namely, the Silhouette score and the Davies-Bouldin index. We use K-means clustering in the representation space to measure these clusterability scores. The Silhouette score measures the similarity of each sample to its own cluster, compared to other clusters. The values can range from $- 1$ to $+ 1$ , and a greater score implies a better cohesion. The Davies-Bouldin Index measures intra-cluster similarity and inter-cluster differences. This is a positive index score, where smaller values indicate low within-cluster scatter and large separation between clusters. Therefore, a lower score represents better clusterability (more details on the cluster validity scores and how they are calculated can be found in Appendix A.5).
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: T-SNE visualization of signal representations for the simulated dataset across all baselines. Each data point in the plot presents a 10-dimensional representation of a window of time series of size $\delta = 5 0$ , and the color indicates the latent state of the signal window. See Appendix A.7 for similar plots from different datasets.
|
| 92 |
+
|
| 93 |
+
<table><tr><td></td><td colspan="2">Simulation</td><td colspan="2">ECG Waveform</td><td colspan="2">HAR</td></tr><tr><td>Method</td><td>Silhouette 个</td><td>DBI↓</td><td>Silhouette 个</td><td>DBI↓</td><td>Silhouette↑</td><td>DBI↓</td></tr><tr><td>TNC</td><td>0.71±0.01</td><td>0.36±0.01</td><td>0.44±0.02</td><td>0.74±0.04</td><td>0.61±0.02</td><td>0.52±0.04</td></tr><tr><td>CPC</td><td>0.51±0.03</td><td>0.84±0.06</td><td>0.26±0.02</td><td>1.44±0.04</td><td>0.58±0.02</td><td>0.57±0.05</td></tr><tr><td>T-Loss</td><td>0.61±0.08</td><td>0.64±0.12</td><td>0.25±0.01</td><td>1.30±0.03</td><td>0.17±0.01</td><td>1.76±0.20</td></tr><tr><td>K-means</td><td>0.01±0.019</td><td>7.23±0.14</td><td>0.19±0.11</td><td>3.65±0.48</td><td>0.12±0.40</td><td>2.66±0.05</td></tr></table>
|
| 94 |
+
|
| 95 |
+
Table 1: Clustering quality of representations in the encoding space for multiple datasets.
|
| 96 |
+
|
| 97 |
+
Table 1 summarizes the scores for all baselines and across all datasets, demonstrating that TNC is superior in learning representations that can distinguish the latent dynamics of time series. CPC performs closely to Triplet loss on waveform data but performs poorly on the simulated dataset, where signals are highly non-stationary, and transitions are less predictable. However, for the HAR dataset, CPC clusters the states very well because most activities are recorded in a specific order, empowering predictive coding. Triplet loss performs reasonably well in the simulated setting; however, it fails to distinguish states 0 and 2, where signals come from autoregressive models with different parameters and have a relatively similar generative process. Performing K-means on the original time series generally does not generate coherent clusters, as demonstrated by the scores. However, the performance is slightly better in time series like the ECG waveforms, where the signals are formed by consistent shapelets, and therefore the DTW measures similarity more accurately.
|
| 98 |
+
|
| 99 |
+
# 4.2 EVALUATION: CLASSIFICATION
|
| 100 |
+
|
| 101 |
+
We further evaluate the quality of the encodings using a classification task. We train a linear classifier to evaluate how well the representations can be used to classify hidden states. The performance of all baselines is compared to a supervised classifier, composed of an encoder and a classifier with identical architectures to that of the unsupervised models, and a K-nearest neighbor classifier that uses DTW metric. The performance is reported as the prediction accuracy and the area under the precision-recall curve (AUPRC) score since AUPRC is a more accurate reflection of model performance for imbalance classification settings like the waveform dataset.
|
| 102 |
+
|
| 103 |
+
Table 2 demonstrates the classification performance for all datasets. The performance of the classifiers that use TNC representations are closer to the end-to-end supervised model in comparison to CPC and Triplet Loss. This provides further evidence that our encodings capture informative parts of the time series and are generalizable to be used for downstream tasks. In datasets like the HAR, where an inherent ordering usually exists in the time series, CPC performs reasonably. However, in datasets with increased non-stationarity, the performance drops. Triplet Loss is also a powerful framework, but since it samples positive examples from overlapping windows of time series, it is vulnerable to map the overlaps into the encoding and, therefore, fail to learn more general representations. TNC, on the other hand, samples similar windows from a wider distribution, defined by the temporal neighborhood, where many of the neighboring signals do not necessarily overlap. The lower performance of the CPC and Triplet Loss methods can also be partly because none of these methods explicitly account for the potential sampling bias that happens when randomly selected negative examples are similar to the reference $W _ { t }$ .
|
| 104 |
+
|
| 105 |
+
<table><tr><td colspan="3">Simulation</td><td colspan="2">ECG Waveform</td><td colspan="2">HAR</td></tr><tr><td>Method</td><td>AUPRC</td><td>Accuracy</td><td>AUPRC</td><td>Accuracy</td><td>AUPRC</td><td>Accuracy</td></tr><tr><td>TNC</td><td>0.99±0.00</td><td>97.52±0.13</td><td>0.55±0.01</td><td>77.79±0.84</td><td>0.94±0.007</td><td>88.32±0.12</td></tr><tr><td>CPC</td><td>0.69±0.06</td><td>70.26±6.48</td><td>0.42±0.01</td><td>68.64±0.49</td><td>0.93±0.006</td><td>86.43±1.41</td></tr><tr><td>T-Loss</td><td>0.78±0.01</td><td>76.66±1.40</td><td>0.47±0.00</td><td>75.51±1.26</td><td>0.71±0.007</td><td>63.60±3.37</td></tr><tr><td>KNN</td><td>0.42±0.00</td><td>55.53±0.65</td><td>0.38±0.06</td><td>54.76±5.46</td><td>0.75±0.01</td><td>84.85±0.84</td></tr><tr><td>Supervised</td><td>0.99±0.00</td><td>98.56±0.13</td><td>0.67±0.01</td><td>94.81±0.28</td><td>0.98±0.00</td><td>92.03±2.48</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 2: Performance of all baselines in classifying the underlying hidden states of the time series, measured as the accuracy and AUPRC score.
|
| 108 |
+
|
| 109 |
+
# 4.3 EVALUATION: TRAJECTORY
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 3: Trajectory of a signal encoding from the simulated dataset. The top plot shows the original time series with shaded regions indicating the underlying state. The bottom plot shows the 10 dimensional encoding of the sliding windows $W _ { t }$ where $\delta = 5 0$ .
|
| 113 |
+
|
| 114 |
+
This section investigates the trajectories of our learned encodings over time to understand how the state transitions are captured and modeled in the representation space. This is an important property for non-stationary time series where underlying states change over time, and capturing those changes is critical in many application domains such as healthcare. Figure 3 shows a sample from the simulated dataset. The top panel shows the signal measurements over time, and the shaded regions indicate the underlying latent states. The bottom panel illustrates the 10-dimensional representation of a sliding window $W _ { t }$ estimated over time. From the bottom panel of Figure 3, we can see that the encoding pattern changes at state transitions and settle into a different pattern, corresponding to the new state. This change happens at every transition, and we can see the distinct patterns for all 4 underlying states in the representations. This analysis of the trajectory of change could be very informative for the users’ post-analysis; for instance, in clinical applications, it could help clinicians visualize the evolution of the patient state over time and plan treatment based on the state progression
|
| 115 |
+
|
| 116 |
+
# 5 RELATED WORK
|
| 117 |
+
|
| 118 |
+
While integral for many applications, unsupervised representation learning has been far less studied for time series (Längkvist et al., 2014), compared to other domains such as vision or natural language processing (Denton et al., 2017; Radford et al., 2015; Gutmann & Hyvärinen, 2012; Wang & Gupta, 2015). One of the earliest approaches to unsupervised end-to-end representation learning in time series is the use of auto-encoders (Choi et al., 2016a; Amiriparian et al., 2017; Malhotra et al., 2017) and seq-to-seq models (Lyu et al., 2018), with the objective to train an encoder jointly with a decoder that reconstructs the input signal from its learned representation. Using fully generative models like variational auto-encoders is also useful for imposing properties like disentanglement, which help with the interpretability of the representations (Dezfouli et al., 2019). However, in many cases, like for high-frequency physiological signals, the reconstruction of complex time series can be challenging; therefore, more novel approaches are designed to avoid this step. Contrastive Predictive Coding (Oord et al., 2018; Löwe et al., 2019) learns representations by predicting the future in latent space, eliminating the need to reconstruct the full input. The representations are such that the mutual information between the original signal and the concept vector is maximally preserve using a lower bound approximation and a contrastive loss. Very similarly, in Time Contrastive Learning (Hyvarinen & Morioka, 2016), a contrastive loss is used to predict the segment-ID of multivariate time-series as a way to extract representation. Franceschi et al. (2019) employs time-based negative sampling and a triplet loss to learn scalable representations for multivariate time series. Some other approaches use inherent similarities in temporal data to learn representations without supervision. For instance, in similarity-preserving representation learning (Lei et al., 2019), learned encodings are constrained to preserve the pairwise similarities that exist in the time domain, measured by DTW distance. Another group of approaches combines reconstruction loss with clustering objectives to cluster similar temporal patterns in the encoding space (Ma et al., 2019).
|
| 119 |
+
|
| 120 |
+
In healthcare, learning representation of rich temporal medical data is extremely important for understanding patients’ underlying health conditions. However, most of the existing approaches for learning representations are designed for specific downstream tasks and require labeling by experts (Choi et al., 2016b;c; Tonekaboni et al., 2020). Examples of similar works to representation learning in the field of clinical ML include computational phenotyping for discovering subgroups of patients with similar underlying disease mechanisms from temporal clinical data (Lasko et al., 2013; Suresh et al., 2018; Schulam et al., 2015), and disease progression modeling, for learning the hidden vector of comorbidities representing a disease over time (Wang et al., 2014; Alaa & van der Schaar, 2019).
|
| 121 |
+
|
| 122 |
+
# 6 CONCLUSION
|
| 123 |
+
|
| 124 |
+
This paper presents a novel unsupervised representation learning framework for complex multivariate time series, called Temporal Neighborhood Coding (TNC). This framework is designed to learn the underlying dynamics of non-stationary signals and to model the progression over time by defining a temporal neighborhood. The problem is motivated by the medical field, where patients transition between distinct clinical states over time, and obtaining labels to define these underlying states is challenging. We evaluate the performance of TNC on multiple datasets and show that our representations are generalizable and can easily be used for diverse tasks such as classification and clustering. We finally note that TNC is flexible to be used with arbitrary encoder architectures; therefore, the framework is applicable to many time series data domains. Moreover, in addition to tasks presented in this paper, general representations can be used for several other downstream tasks, such as anomaly detection, which is challenging in supervised learning settings for time series data in sparsely labeled contexts.
|
| 125 |
+
|
| 126 |
+
# ACKNOWLEDGMENTS
|
| 127 |
+
|
| 128 |
+
Resources used in preparing this research were provided, in part, by the Government of Canada through CIFAR, and companies sponsoring the Vector Institute. This research was undertaken, in part, thanks to funding from the Canadian Institute of Health Research (CIHR) and the Natural Sciences and Engineering Research Council of Canada (NSERC).
|
| 129 |
+
|
| 130 |
+
# REFERENCES
|
| 131 |
+
|
| 132 |
+
Ahmed Alaa and Mihaela van der Schaar. Attentive state-space modeling of disease progression. 2019.
|
| 133 |
+
|
| 134 |
+
Shahin Amiriparian, Michael Freitag, Nicholas Cummins, and Björn Schuller. Sequence to sequence autoencoders for unsupervised representation learning from audio. In Proc. of the DCASE 2017 Workshop, 2017.
|
| 135 |
+
|
| 136 |
+
Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.
|
| 137 |
+
|
| 138 |
+
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.
|
| 139 |
+
|
| 140 |
+
Edward Choi, Mohammad Taha Bahadori, Elizabeth Searles, Catherine Coffey, Michael Thompson, James Bost, Javier Tejedor-Sojo, and Jimeng Sun. Multi-layer representation learning for medical concepts. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1495–1504, 2016a.
|
| 141 |
+
|
| 142 |
+
Edward Choi, Andy Schuetz, Walter F Stewart, and Jimeng Sun. Medical concept representation learning from electronic health records and its application on heart failure prediction. arXiv preprint arXiv:1602.03686, 2016b.
|
| 143 |
+
|
| 144 |
+
Youngduck Choi, Chill Yi-I Chiu, and David Sontag. Learning low-dimensional representations of medical concepts. AMIA Summits on Translational Science Proceedings, 2016:41, 2016c.
|
| 145 |
+
|
| 146 |
+
Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning. arXiv preprint arXiv:2007.00224, 2020.
|
| 147 |
+
|
| 148 |
+
Emily L Denton et al. Unsupervised learning of disentangled representations from video. In Advances in Neural Information Processing Systems, pp. 4414–4423, 2017.
|
| 149 |
+
|
| 150 |
+
Amir Dezfouli, Hassan Ashtiani, Omar Ghattas, Richard Nock, Peter Dayan, and Cheng Soon Ong. Disentangled behavioural representations. In Advances in Neural Information Processing Systems, pp. 2251–2260, 2019.
|
| 151 |
+
|
| 152 |
+
Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning. In Advances in Neural Information Processing Systems, pp. 10541–10551, 2019.
|
| 153 |
+
|
| 154 |
+
Marthinus C Du Plessis, Gang Niu, and Masashi Sugiyama. Analysis of learning from positive and unlabeled data. In Advances in Neural Information Processing Systems, pp. 703–711, 2014.
|
| 155 |
+
|
| 156 |
+
Marthinus Christoffel Du Plessis and Masashi Sugiyama. Class prior estimation from positive and unlabeled data. IEICE TRANSACTIONS on Information and Systems, 97(5):1358–1362, 2014.
|
| 157 |
+
|
| 158 |
+
Charles Elkan and Keith Noto. Learning classifiers from only positive and unlabeled data. In Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 213–220, 2008.
|
| 159 |
+
|
| 160 |
+
Hassan Ismail Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and Pierre-Alain Muller. Deep learning for time series classification: a review. Data Mining and Knowledge Discovery, 33(4):917–963, 2019.
|
| 161 |
+
|
| 162 |
+
Jean-Yves Franceschi, Aymeric Dieuleveut, and Martin Jaggi. Unsupervised scalable representation learning for multivariate time series. In Advances in Neural Information Processing Systems, pp. 4652–4663, 2019.
|
| 163 |
+
|
| 164 |
+
Michael U Gutmann and Aapo Hyvärinen. Noise-contrastive estimation of unnormalized statistical models, with applications to natural image statistics. Journal of Machine Learning Research, 13 (Feb):307–361, 2012.
|
| 165 |
+
|
| 166 |
+
Aapo Hyvarinen and Hiroshi Morioka. Unsupervised feature extraction by time-contrastive learning and nonlinear ICA. In Advances in Neural Information Processing Systems, pp. 3765–3773, 2016.
|
| 167 |
+
|
| 168 |
+
Ryuichi Kiryo, Gang Niu, Marthinus C Du Plessis, and Masashi Sugiyama. Positive-unlabeled learning with non-negative risk estimator. In Advances in Neural Information Processing Systems, pp. 1675–1685, 2017.
|
| 169 |
+
|
| 170 |
+
Martin Längkvist, Lars Karlsson, and Amy Loutfi. A review of unsupervised feature learning and deep learning for time-series modeling. Pattern Recognition Letters, 42:11–24, 2014.
|
| 171 |
+
|
| 172 |
+
Thomas A Lasko, Joshua C Denny, and Mia A Levy. Computational phenotype discovery using unsupervised feature learning over noisy, sparse, and irregular clinical data. PloS one, 8(6), 2013.
|
| 173 |
+
|
| 174 |
+
Wee Sun Lee and Bing Liu. Learning with positive and unlabeled examples using weighted logistic regression. In International Conference on Machine Learning, volume 3, pp. 448–455, 2003.
|
| 175 |
+
|
| 176 |
+
Qi Lei, Jinfeng Yi, Roman Vaculin, Lingfei Wu, and Inderjit S Dhillon. Similarity preserving representation learning for time series clustering. In IJCAI, volume 19, pp. 2845–2851, 2019.
|
| 177 |
+
|
| 178 |
+
Xiaoli Li and Bing Liu. Learning to classify texts using positive and unlabeled data. In IJCAI, volume 3, pp. 587–592, 2003.
|
| 179 |
+
|
| 180 |
+
Sindy Löwe, Peter O’Connor, and Bastiaan Veeling. Putting an end to end-to-end: Gradient-isolated learning of representations. In Advances in Neural Information Processing Systems, pp. 3039–3051, 2019.
|
| 181 |
+
|
| 182 |
+
Xinrui Lyu, Matthias Hueser, Stephanie L Hyland, George Zerveas, and Gunnar Rätsch. Improving clinical predictions through unsupervised time series representation learning. arXiv preprint arXiv:1812.00490, 2018.
|
| 183 |
+
|
| 184 |
+
Qianli Ma, Jiawei Zheng, Sen Li, and Gary W Cottrell. Learning representations for time series clustering. In Advances in Neural Information Processing Systems, pp. 3776–3786, 2019.
|
| 185 |
+
|
| 186 |
+
Pankaj Malhotra, Vishnu TV, Lovekesh Vig, Puneet Agarwal, and Gautam Shroff. Timenet: Pre-trained deep recurrent neural network for time series classification. arXiv preprint arXiv:1706.08838, 2017.
|
| 187 |
+
|
| 188 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
|
| 189 |
+
|
| 190 |
+
George Moody. A new method for detecting atrial fibrillation using RR intervals. Computers in Cardiology, pp. 227–230, 1983.
|
| 191 |
+
|
| 192 |
+
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.
|
| 193 |
+
|
| 194 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 195 |
+
|
| 196 |
+
Slobodan Petrovic. A comparison between the silhouette index and the davies-bouldin index in labelling ids clusters. In Proceedings of the 11th Nordic Workshop of Secure IT Systems, pp. 53–64, 2006.
|
| 197 |
+
|
| 198 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 199 |
+
|
| 200 |
+
Alec Radford, Rafal Jozefowicz, and Ilya Sutskever. Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444, 2017.
|
| 201 |
+
|
| 202 |
+
Nikunj Saunshi, Orestis Plevrakis, Sanjeev Arora, Mikhail Khodak, and Hrishikesh Khandeparkar. A theoretical analysis of contrastive unsupervised representation learning. In International Conference on Machine Learning, pp. 5628–5637. PMLR, 2019.
|
| 203 |
+
|
| 204 |
+
Peter Schulam, Fredrick Wigley, and Suchi Saria. Clustering longitudinal clinical marker trajectories from electronic health data: Applications to phenotyping and endotype discovery. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015.
|
| 205 |
+
|
| 206 |
+
Harini Suresh, Jen J Gong, and John V Guttag. Learning tasks for multitask learning: Heterogenous patient populations in the icu. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 802–810, 2018.
|
| 207 |
+
|
| 208 |
+
Sana Tonekaboni, Shalmali Joshi, Kieran Campbell, David K Duvenaud, and Anna Goldenberg. What went wrong and when? instance-wise feature importance for time-series black-box models. Advances in Neural Information Processing Systems, 33, 2020.
|
| 209 |
+
|
| 210 |
+
Xiang Wang, David Sontag, and Fei Wang. Unsupervised learning of disease progression models. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 85–94, 2014.
|
| 211 |
+
|
| 212 |
+
Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2794–2802, 2015.
|
| 213 |
+
|
| 214 |
+
Qiang Yang and Xindong Wu. 10 challenging problems in data mining research. International Journal of Information Technology & Decision Making, 5(04):597–604, 2006.
|
| 215 |
+
|
| 216 |
+
Tom Young, Devamanyu Hazarika, Soujanya Poria, and Erik Cambria. Recent trends in deep learning based natural language processing. IEEE Computational Intelligence Magazine, 13(3):55–75, 2018.
|
| 217 |
+
|
| 218 |
+
A APPENDIX
|
| 219 |
+
|
| 220 |
+
# A.1 SIMULATED DATASET
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure A.1: A normalized time series sample from the simulated dataset. Each row represents a single feature, and the shaded regions indicate one of the 4 underllying simulated states.
|
| 224 |
+
|
| 225 |
+
The simulated time series consists of 3 features generated from different underlying hidden states. Figure A.1 shows a sample from this dataset. Each panel in the figure shows one of the features, and the shaded regions indicate the underlying state of the signal in that period. We use a Hidden Markov Model (HMM) to generate these random latent states over time. The transition probability is set equal to $\% 5$ for switching to an alternating state, and $\% 8 5$ for not changing state. In each state, the time series is generated from a different signal distribution. Table 3 describes the generative process of each signal feature in each state. Note that feature 1 and 2 are always correlated, mainly to mimic realistic clinical time series. As an example, physiological measurements like pulse rate and heart rate are always correlated.
|
| 226 |
+
|
| 227 |
+
Table 3: Signal distributions for each time series feature of the simulated dataset
|
| 228 |
+
|
| 229 |
+
<table><tr><td></td><td>State 1</td><td>State 2</td><td>State 3</td><td>State 4</td></tr><tr><td>Feature 1</td><td>GP (periodic)</td><td>NARMAα</td><td>GP (Squared Exp.)</td><td>NARMAβ</td></tr><tr><td>Feature 2</td><td>GP (periodic)</td><td>NARMAα</td><td>GP (Squared Exp.)</td><td>NARMAβ</td></tr><tr><td>Feature 3</td><td>GP (Squared Exp.)</td><td>NARMAβ</td><td>GP (periodic)</td><td>NARMAα</td></tr></table>
|
| 230 |
+
|
| 231 |
+
In the state 1, the correlated features are generated by a Gaussian Process (GP) with a periodic kernel. Feature 3, which is uncorrelated with the other two features, comes from another GP with a squared exponential kernel. In addition to GPs, we also have multiple Non-Linear Auto-Regressive Moving Average (NARMA) time series models. The linear function of $\mathrm { N A R M A } _ { \alpha }$ and $\mathrm { N A R M A } _ { \beta }$ are shown in Equation 2 and 3.
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\mathrm { N A R M A } _ { \alpha } : y ( k + 1 ) = 0 . 3 y ( k ) + 0 . 0 5 y ( k ) \sum _ { i = 0 } ^ { n - 1 } y ( k - i ) + 1 . 5 u ( k - ( n - 1 ) ) u ( k ) + 0 . 1 1
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
$$
|
| 238 |
+
\mathbf { N A R M A } _ { \beta } : y ( k + 1 ) = 0 . 1 y ( k ) + 0 . 2 5 y ( k ) \sum _ { i = 0 } ^ { n - 1 } y ( k - i ) + 2 . 5 u ( k - ( n - 1 ) ) u ( k ) - 0 . 0 0 5
|
| 239 |
+
$$
|
| 240 |
+
|
| 241 |
+
A white Gaussian noise with $\sigma = 0 . 3$ is added to all signals, and overall, the dataset consists of 500 instances of $T = 2 0 0 0$ measurements.
|
| 242 |
+
|
| 243 |
+
# A.2 BASELINE IMPLEMENTATION DETAILS
|
| 244 |
+
|
| 245 |
+
Implementation of all baselines are included in the code base for reproducibility purposes, and hyper-parameters for all baselines are tuned using cross-validation.
|
| 246 |
+
|
| 247 |
+
Contrastive Predictive Coding (CPC): The CPC baseline first processes the sequential signal windows using an encoder $Z _ { t } = E n c ( X _ { t } )$ , with a similar architecture to the encoders of other baselines. Next, an autoregressive model $g _ { a r }$ aggregates all the information in $Z _ { \le t }$ and summarizes it into a context latent representation $c _ { t } = g _ { a r } ( Z _ { \leq t } )$ . In our implementation, we have used a single layer, a one-directional recurrent neural network with GRU cell and hidden size equal to the encoding size as the auto-regressor. Like the original paper, the density ratio is estimated using a linear transformation, and the model is trained for 1 step ahead prediction.
|
| 248 |
+
|
| 249 |
+
Triplet-Loss (T-Loss): The triplet loss baseline is implemented using the original code made available by the authors on Github3.
|
| 250 |
+
|
| 251 |
+
KNN and K-means: These two baselines for classification and clustering are implemented using the tslearn library 4, that integrates distance metrics such as DTW. Note that evaluating DTW is computationally expensive, and the tslearn implementation is not optimized. Therefore, for the waveform data with windows of size 2500, we had to down-sampled the signal frequency by a factor of two.
|
| 252 |
+
|
| 253 |
+
# A.3 TNC IMPLEMENTATION EXTRA DETAILS
|
| 254 |
+
|
| 255 |
+
To define the neighborhood range in the TNC framework, as mentioned earlier, we use the AugmentedDickey Fuller (ADF) statistical test to determine this range $( \eta )$ as the region for which the signals remain stationary. More precisely, we gradually increase the range, from a single window size up to 3 times the window size (the upper limit we set), and repeatedly perform the ADF test. We use the $p$ -value from this statistical test to determine whether the Null hypothesis can be rejected, meaning that the signal is stationary. At the point where the $p$ -value is above our defined threshold (0.01), we can no longer assume that the signal is stationary, and this is where we set the $\eta$ parameter. Now, once the neighborhood is defined, we make sure the non-neighboring samples are taken from the distribution of windows with at least $4 \times \eta$ away from $W _ { t }$ , ensuring a low likelihood of belonging to the neighborhood. Note that for implementation of ADF, we use the stats model library 5. Unfortunately, this implementation is not optimized and does not support GPU computation, therefore evaluating the neighborhood range using ADF slows down TNC framework training. As a future direction, we are working on an optimized implementation of the ADF score for our framework.
|
| 256 |
+
|
| 257 |
+
# A.4 SELECTING THE WINDOW SIZE
|
| 258 |
+
|
| 259 |
+
The window size $\delta$ is an important factor in the performance of a representation learning framework, not only for TNC but also for similar baselines such as CPC and triplet loss. Overall, the window size should be selected such that it is long enough to contain information about the underlying state and not too long to span over multiple underlying states. In our settings, we have selected the window sizes based on our prior knowledge of the signals. For instance, in the case of an ECG signal, the selected window size is equivalent to 7 seconds of recording, which is small enough such that the ECG remains in a stable state and yet has enough information to determine that underlying state. Our understanding of the time series data can help us select an appropriate window size, but we can also experiment with different $\delta$ to learn this parameter. Table 4 shows classification performance results for the simulation setups, under different window sizes. We can clearly see the drop in performance for all baseline methods when the window size is too small or too large.
|
| 260 |
+
|
| 261 |
+
<table><tr><td></td><td colspan="2">δ=10</td><td colspan="2">8=50</td><td colspan="2">δ=100</td></tr><tr><td></td><td>AUPRC</td><td> Accuracy</td><td>AUPRC</td><td>Accuracy</td><td>AUPRC</td><td>Accuracy</td></tr><tr><td>TNC</td><td>0.74 ± 0.01</td><td>71.60 ± 0.59</td><td>0.99 ± 0.00</td><td>97.52 ± 0.13</td><td>0.84 ± 0.11</td><td>84.25 ± 9.08</td></tr><tr><td>CPC</td><td>0.49 ± 0.02</td><td>51.85 ± 1.81</td><td>0.69 ± 0.06</td><td>70.26 ± 6.48</td><td>0.49 ± 0.05</td><td>56.65 ± 0.81</td></tr><tr><td>T-Loss</td><td>0.48 ± 0.06</td><td>56.70 ± 1.07</td><td>0.78 ± 0.01</td><td>76.66 ± 1.14</td><td>0.73 ± 0.008</td><td>73.29 ± 1.58</td></tr></table>
|
| 262 |
+
|
| 263 |
+
Table 4: Downstream classification performance for different window size $\delta$ on the simulated dataset
|
| 264 |
+
|
| 265 |
+
# A.5 CLUSTERING METRICS
|
| 266 |
+
|
| 267 |
+
Most cluster validity measures assess certain structural properties of a clustering result. In our evaluation, we have used two measures, namely the Silhouette score and Davies-Bouldin index, to evaluate the representations’ clustering quality. Davies-Bouldin measures intra-cluster similarity (coherence) and inter-cluster differences (separation). Let $\mathcal { C } = \{ \mathcal { C } _ { 1 } , . . . , \mathcal { C } _ { k } \}$ be a clustering of a set $D$ of objects. The Davies-Bouldin score is evaluated as follows:
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
D B = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } m a x _ { j } \frac { s ( \mathcal { C } ) + s ( \mathcal { C } ) } { \delta \mathcal { C } _ { i } \mathcal { C } _ { j } }
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
Where $s ( \mathcal { C } )$ measures the scatter within a cluster, and $\delta$ is a cluster to cluster distance measure. On the other hand, the silhouette score measures how similar an object is to its cluster compared to other clusters. Both measures are commonly used for the evaluation of clustering algorithms. A comparison of 2 metrics has shown that the Silhouette index produces slightly more accurate results in some cases. However, the Davies-Bouldin index is generally much less complex to compute Petrovic (2006).
|
| 274 |
+
|
| 275 |
+
# A.6 SETTING THE WEIGHTS FOR PU LEARNING
|
| 276 |
+
|
| 277 |
+
As mentioned in the Experiment section, the weight parameter in the loss is the probability of sampling a positive window from the non-neighboring region. One way to set this parameter is using prior knowledge of the number and the distribution of underlying states. Another way is to learn it as a hyperparameter. Table 5 shows the TNC loss for different weight parameters. The loss column reports the value measured in Equation 1, and the accuracy shows how well the discriminator identifies the neighboring samples from non-neighboring ones for settings with different weight parameters. To also assess the impact of re-weighting the loss on downstream classification performance, we compared these performance measures for weighted and non-weighted settings. Table 6 demonstrates these results and confirms that weight adjusting the loss for non-neighboring samples improves the quality of learned representations.
|
| 278 |
+
|
| 279 |
+
Table 5: Training the TNC framework using different weight parameters. The loss is the measured value determined in Equation 1, and the Accuracy is the accuracy of the discriminator.
|
| 280 |
+
|
| 281 |
+
<table><tr><td></td><td colspan="2">Simulation</td><td colspan="2">ECG Waveform</td><td colspan="2">HAR</td></tr><tr><td>Weight</td><td>Loss</td><td>Accuracy</td><td>Loss</td><td>Accuracy</td><td>Loss</td><td>Accuracy</td></tr><tr><td>0.2</td><td>0.582±0.002</td><td>74.29±0.61</td><td>0.631±0.011</td><td>60.44±2.56</td><td>0.475±0.004</td><td>85.75±0.5</td></tr><tr><td>0.1</td><td>0.571±0.011</td><td>75.41±0.37</td><td>0.637±0.011</td><td>63.67±1.29</td><td>0.413±0.003</td><td>88.21±1.29</td></tr><tr><td>0.05</td><td>0.576±0.002</td><td>75.73±0.24</td><td>0.622±0.023</td><td>66.04±3.46</td><td>0.383±0.001</td><td>87.33±0.17</td></tr></table>
|
| 282 |
+
|
| 283 |
+
<table><tr><td>Weighting?</td><td>Simulation</td><td>ECG Waveform</td><td>HAR</td></tr><tr><td>True</td><td>97.52±0.13</td><td>77.79±0.84</td><td>88.32±0.12</td></tr><tr><td>False</td><td>97.17±0.44</td><td>75.26±1.48</td><td>75.25±13.6</td></tr></table>
|
| 284 |
+
|
| 285 |
+
Table 6: Downstream classification accuracy on simulated data with the TNC frameworks, using 2 different weighting strategies: 1)Trained with weight adjustment, 2)Trained with $w = 0$ .
|
| 286 |
+
|
| 287 |
+
# A.7 SUPPLEMENTARY FIGURE
|
| 288 |
+
|
| 289 |
+
# A.7.1 CLINICAL WAVEFORM DATA
|
| 290 |
+
|
| 291 |
+
In order to understand what TNC framework encodes from the high dimensional ECG signals, we visualize the trajectory of the representations of an individual sample over time. Figure A.3 demonstrates this example, where the top 2 rows are ECG signals from two recording leads and the bottom row demonstrates the representation vectors. We see that around second 40 the pattern in the representations change as a result of an artifact happening in one of the signals. With the help from our clinical expert, we also tried to interpret different patterns in the encoding space. For instance, between time 80 and 130, where features 0-10 become more activated, the heart rate (HR) has increased. Increase in HR can be seen as increased frequency in the ECG signals and is one of the indicators of arrhythmia that we believe TNC has captured. Figure A.2 shows the distribution of the latent encoding of ECG signals for different baselines, with colors indicating the arrhythmia class.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure A.2: T-SNE visualization of waveform signal representations for unsupervised representation learning baselines. Each point in the plot is a 64 dimensional representation of a window of time series, with the color indicating the latent state.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure A.3: Trajectory of a waveform signal encoding. The top two plots show the ECG recordings from 2 ECG leads. The bottom plot shows the 64 dimensional encoding of the sliding windows $W _ { t }$ where $\delta = 2 5 0 0$ .
|
| 298 |
+
|
| 299 |
+
# A.7.2 HAR DATA
|
| 300 |
+
|
| 301 |
+
Figure A.4 and A.5 are similar plots to the ones demonstrated in the previous section, but for the HAR dataset. As shown in Figure A.5, the underlying states of the signal are clearly captured by the TNC framework as different patterns in the latent representations.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure A.4: T-SNE visualization of HAR signal representations for all baselines. Each point in the plot is a 10 dimensional representation of a window of $\delta = 4$ , with colors indicating latent states.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure A.5: Trajectory of a HAR signal encoding. The top plot shows the original time series with shaded regions indicating the underlying state. The bottom plot shows the 10 dimensional encoding of the sliding windows $W _ { t }$ where $\delta = 4$ .
|
| 308 |
+
|
| 309 |
+
# A.7.3 SIMULATION DATA
|
| 310 |
+
|
| 311 |
+
In addition to the initial experiment, we also show the trajectory of the encoding for a smaller encoding size (3). In this setting, we have 4 underlying states in the signal, and only 3 dimensions for the encoding.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure A.6: Trajectory of a simulation signal encoding. The top plots shows the signals and the bottom plot shows the 3 dimensional encoding of the sliding windows $W _ { t }$ where $\delta = 5 0$ .
|
md/train/AFiH_CNnVhS/AFiH_CNnVhS.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# No Fear of Heterogeneity: Classifier Calibration for Federated Learning with Non-IID Data
|
| 2 |
+
|
| 3 |
+
Mi Luo1, Fei Chen2, Dapeng $\mathbf { H } \mathbf { u } ^ { 1 }$ , Yifan Zhang1, Jian Liang∗3, Jiashi Feng∗1
|
| 4 |
+
|
| 5 |
+
1National University of Singapore 2Huawei Noah’s Ark Lab
|
| 6 |
+
3Institute of Automation, Chinese Academy of Sciences (CAS)
|
| 7 |
+
|
| 8 |
+
{romyluo7, liangjian92, jshfeng}@gmail.com chen.f@huawei.com, {dapeng.hu, yifan.zhang}@u.nus.edu
|
| 9 |
+
|
| 10 |
+
# Abstract
|
| 11 |
+
|
| 12 |
+
A central challenge in training classification models in the real-world federated system is learning with non-IID data. To cope with this, most of the existing works involve enforcing regularization in local optimization or improving the model aggregation scheme at the server. Other works also share public datasets or synthesized samples to supplement the training of under-represented classes or introduce a certain level of personalization. Though effective, they lack a deep understanding of how the data heterogeneity affects each layer of a deep classification model. In this paper, we bridge this gap by performing an experimental analysis of the representations learned by different layers. Our observations are surprising: (1) there exists a greater bias in the classifier than other layers, and (2) the classification performance can be significantly improved by post-calibrating the classifier after federated training. Motivated by the above findings, we propose a novel and simple algorithm called Classifier Calibration with Virtual Representations (CCVR), which adjusts the classifier using virtual representations sampled from an approximated gaussian mixture model. Experimental results demonstrate that CCVR achieves state-of-the-art performance on popular federated learning benchmarks including CIFAR-10, CIFAR-100, and CINIC-10. We hope that our simple yet effective method can shed some light on the future research of federated learning with non-IID data.
|
| 13 |
+
|
| 14 |
+
# 1 Introduction
|
| 15 |
+
|
| 16 |
+
The rapid advances in deep learning have benefited a lot from large datasets like [1]. However, in the real world, data may be distributed on numerous mobile devices and the Internet of Things (IoT), requiring decentralized training of deep networks. Driven by such realistic needs, federated learning [2, 3, 4] has become an emerging research topic where the model training is pushed to a large number of edge clients and the raw data never leave local devices.
|
| 17 |
+
|
| 18 |
+
A notorious trap in federated learning is training with non-IID data. Due to diverse user behaviors, large heterogeneity may be present in different clients’ local data, which has been found to result in unstable and slow convergence [5] and cause suboptimal or even detrimental model performance [6, 7]. There have been a plethora of works exploring promising solutions to federated learning on non-IID data. They can be roughly divided into four categories: 1) client drift mitigation [5, 8, 9, 10], which modifies the local objectives of the clients, so that the local model is consistent with the global model to a certain degree; 2) aggregation scheme [11, 12, 13, 14, 15], which improves the model fusion mechanism at the server; 3) data sharing [6, 16, 17, 18], which introduces public datasets or synthesized data to help construct a more balanced data distribution on the client or on the server;
|
| 19 |
+
|
| 20 |
+
4) personalized federated learning [19, 20, 21, 22], which aims to train personalized models for individual clients rather than a shared global model.
|
| 21 |
+
|
| 22 |
+
However, as suggested by [7], existing algorithms are still unable to achieve good performance on image datasets with deep learning models, and could be no better than vanilla FedAvg [2]. To identify the reasons behind this, we perform a thorough experimental investigation on each layer of a deep neural network. Specifically, we measure the Centered Kernel Alignment (CKA) [23] similarity between the representations from the same layer of different clients’ local models. The observation is thought-provoking: comparing different layers learned on different clients, the classifier has the lowest feature2 similarity across different local models.
|
| 23 |
+
|
| 24 |
+
Motivated by the above discovery, we dig deeper to study the variation of the weight of the classifier in federated optimization, and confirm that the classifier tends to be biased to certain classes. After identifying this devil, we conduct several empirical trials to debias the classifier via regularizing the classifier during training or calibrating classifier weights after training. We surprisingly find that post-calibration strategy is particularly useful — with only a small fraction of IID data, the classification accuracy is significantly improved. However, this approach cannot be directly deployed in practice since it infringes the privacy rule in federated learning.
|
| 25 |
+
|
| 26 |
+
Based on the above findings and considerations, we propose a novel and privacy-preserving approach called Classifier Calibration with Virtual Representations (CCVR) which rectifies the decision boundaries (the classifier) of the deep network after federated training. CCVR generates virtual representations based on an approximated Gaussian Mixture Model (GMM) in the feature space with the learned feature extractor. Experimental results show that CCVR achieves significant accuracy improvements over several popular federated learning algorithms, setting the new state-of-the-art on common federated learning benchmarks like CIFAR-10, CIFAR-100 and CINIC-10.
|
| 27 |
+
|
| 28 |
+
To summarize, our contributions are threefold: (1) We present the first systematic study on the hidden representations of different layers of neural networks (NN) trained with FedAvg on non-IID data and provide a new perspective of understanding federated learning with heterogeneous data. (2) Our study reveals an intriguing fact that the primary reason for the performance degradation of NN trained on non-IID data is the classifier. (3) We propose CCVR (Classifier Calibration with Virtual Representations) — a simple and universal classifier calibration algorithm for federated learning. CCVR is built on top of the off-the-shelf feature extractor and requires no transmission of the representations of the original data, thus raising no additional privacy concern. Our empirical results show that CCVR brings considerable accuracy gains over vanilla federated learning approaches.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Federated learning [2, 3, 4] is a fast-growing research field and remains many open problems to solve. In this work, we focus on addressing the non-IID quagmire [6, 24]. Relevant works have pursued the following four directions.
|
| 33 |
+
|
| 34 |
+
Client Drift Mitigation. FedAvg [2] has been the de facto optimization method in the federated setting. However, when it is applied to the heterogeneous setting, one key issue arises: when the global model is optimized with different local objectives with local optimums far away from each other, the average of the resultant client updates (the server update) would move away from the true global optimum [9]. The cause of this inconsistency is called ‘client drift’. To alleviate it, FedAvg is compelled to use a small learning rate which may damage convergence, or reduce the number of local iterations which induces significant communication cost [25]. There have been a number of works trying to mitigate ‘client drift’ of FedAvg from various perspectives. FedProx [5] proposes to add a proximal term to the local objective which regularizes the euclidean distance between the local model and the global model. MOON [8] adopts the contrastive loss to maximize the agreement of the representation learned by the local model and that by the global model. SCAFFOLD [9] performs ‘client-variance reduction’ and corrects the drift in the local updates by introducing control variates. FedDyn [10] dynamically changes the local objectives at each communication round to ensure that the local optimum is asymptotically consistent with the stationary points of the global objective. FedIR [26] applies importance weight to the local objective, which alleviates the imbalance caused by non-identical class distributions among clients.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 1: CKA similarities of three different layers of different ‘client model-client model’ pairs.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 2: The means of the CKA similarities of different layers in different local models.
|
| 41 |
+
|
| 42 |
+
Aggregation Scheme. A fruitful avenue of explorations involves improvements at the model aggregation stage. These works are motivated by three emerging concerns. First, oscillation may occur when updating the global model using gradients collected from clients with a limited subset of labels. To alleviate it, [11] proposes FedAvgM which adopts momentum update on the server-side. Second, element-wise averaging of weights may have drastic negative effects on the performance of the averaged model. [12] shows that directly averaging local models that are learned from totally distinct data distributions cannot produce a global model that performs well on the global distribution. The authors further propose FedDF that leverages unlabeled data or artificial samples generated by GANs [27] to distill knowledge from the local models. [13] considers the setting where each client performs variable amounts of local works and proposes FedNova which normalizes the local updates before averaging. Third, a handful of works [14, 15] believe that the permutation invariance of neural network parameters may cause neuron mismatching when conducting coordinate-wise averaging of model weights. So they propose to match the parameters of local models while aggregating.
|
| 43 |
+
|
| 44 |
+
Data Sharing. The key motivation behind data sharing is that a client cannot acquire samples from other clients during local training, thus the learned local model under-represents certain patterns or samples from the absent classes. The common practices are to share a public dataset [6], synthesized data [16, 17] or a condensed version of the training samples [18] to supplement training on the clients or on the server. This line of works may violate the privacy rule of federated learning since they all consider sharing raw input data of the model, either real data or artificial data.
|
| 45 |
+
|
| 46 |
+
Personalized Federated Learning. Different from the above directions that aim to learn a single global model, another line of research focuses on learning personalized models. Several works aim to make the global model customized to suit the need of individual users, either by treating each client as a task in meta-learning [19, 28, 20, 29] or multi-task learning [30], or by learning both global parameters for all clients and local private parameters for individual clients [21, 31, 32]. There are also heuristic approaches that divide clients into different clusters based on their learning tasks (objectives) and perform aggregation only within the cluster [33, 34, 22, 35].
|
| 47 |
+
|
| 48 |
+
In this work, we consider training a single global classification model. To the best of our knowledge, we are the first to decouple the representation and classifier in federated learning — calibrating classifier after feature learning. Strictly speaking, our proposed CCVR algorithm does not fall into any aforementioned research direction but can be readily combined with most of the existing federated learning approaches to achieve better classification performance.
|
| 49 |
+
|
| 50 |
+
# 3 Heterogeneity in Federated Learning: The Devil Is in Classifier
|
| 51 |
+
|
| 52 |
+
# 3.1 Problem Setup
|
| 53 |
+
|
| 54 |
+
We aim to collaboratively train an image classification model in a federated learning system which consists of $K$ clients indexed by $[ K ]$ and a central server. Client $k$ has a local dataset $\mathcal { D } ^ { \bar { k } }$ , and we set $\textstyle { \mathcal { D } } = \bigcup _ { k \in [ K ] } { \mathcal { D } } ^ { k }$ as the whole dataset. Suppose there are $C$ classes in $\mathcal { D }$ indexed by $[ C ]$ . Denote by $( \pmb { x } , y ) \in \mathcal { X } \times [ C ]$ a sample in $\mathcal { D }$ , where $_ { \textbf { \em x } }$ is an image in the input space $\mathcal { X }$ and $y$ is its corresponding label. Let $\mathcal { D } _ { c } ^ { k } = \{ ( x , y ) \in \mathcal { D } ^ { k } : y = c \}$ be the set of samples with ground-truth label $c$ on client $k$ . We decompose the classification model into a deep feature extractor and a linear classifier. Given a sample $( { \pmb x } , y )$ , the feature extractor $f _ { \pmb \theta } : \mathcal { X } \mathcal { Z }$ , parameterized by $\pmb \theta$ , maps the input image $_ { \textbf { \em x } }$ into a feature vector $z = f _ { \pmb \theta } ( \pmb x ) \in \mathbb R ^ { d }$ in the feature space $\mathcal { Z }$ . Then the classifier $g _ { \varphi } : \mathcal { Z } \to \mathbb { R } ^ { C }$ , parameterized by $\varphi$ , produces a probability distribution $g _ { \varphi } ( z )$ as the prediction for $_ { \textbf { \em x } }$ . Denote by ${ \pmb w } = ( { \pmb \theta } , \varphi )$ the parameter of the classification model.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 3: Label distribution of CIFAR-10 across clients (the first graph) and the classifier weight norm distribution across clients in different rounds and data partitions (the three graphs on the right).
|
| 58 |
+
|
| 59 |
+
Federated learning proceeds through the communication between clients and the server in a roundby-round manner. In round $t$ of the process, the server sends the current model parameter $\pmb { w } ^ { ( t - 1 ) }$ to a set $U ^ { ( t ) }$ of selected clients. Then each client $k \in U ^ { ( t ) }$ locally updates the received parameter $\pmb { w } ^ { ( t - 1 ) }$ to wk ${ \pmb w } _ { k } ^ { ( t ) }$ with the following objective:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\operatorname* { m i n } _ { \pmb { w } _ { k } ^ { ( t ) } } \mathbb { E } _ { ( \pmb { x } , y ) \sim \mathcal { D } ^ { k } } [ \mathcal { L } ( \pmb { w } _ { k } ^ { ( t ) } ; \pmb { w } ^ { ( t - 1 ) } , \pmb { x } , y ) ] ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $\mathcal { L }$ is the loss function. Note that $\mathcal { L }$ is algorithm-dependent and could rely on the current global model parameter for a number of e $w ^ { ( t - 1 ) }$ as well. For instance, FedAvg [2] computes sing the cross-entropy loss, with initialization $\boldsymbol { w } _ { k } ^ { ( t ) }$ by running SG parameter set to $\mathcal { D } ^ { k }$ $w ^ { ( t - 1 ) }$ FedProx [5] uses the cross entropy loss with an $L _ { 2 }$ -regularization term to constrain the distance between $w _ { k } ^ { ( t ) }$ and $\pmb { w } ^ { ( t - 1 ) }$ ; MOON [8] introduces a contrastive loss term to address the feature drift issue. In the end of round $t$ , the selected clients send the optimized parameter back to the server and the server updates the parameter by aggregating heterogeneous parameters as follows,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\pmb { w } ^ { ( t ) } = \sum _ { k \in U ^ { ( t ) } } p _ { k } \pmb { w } _ { k } ^ { ( t ) } , \mathrm { ~ w h e r e ~ } p _ { k } = \frac { | \mathcal { D } ^ { k } | } { \sum _ { k ^ { \prime } \in U ^ { ( t ) } } | \mathcal { D } ^ { k ^ { \prime } } | } .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
# 3.2 A Closer Look at Classification Model: Classifier Bias
|
| 72 |
+
|
| 73 |
+
To vividly understand how non-IID data affect the classification model in federated learning, we perform an experimental study on heterogeneous local models. For the sake of simplicity, we choose CIFAR-10 with 10 clients which is a standard federated learning benchmark, and a convolutional neural network with 7 layers used in [8]. As for the non-IID experiments, we partition the data according to the Dirichlet distribution with the concentration parameter $\alpha$ set as 0.1. More details are covered in the Appendix. To be specific, for each layer in the model, we leverage the recently proposed Centered Kernel Alignment (CKA) [23] to measure the similarity of the output features between two local models, given the same input testing samples. CKA outputs a similarity score between 0 (not similar at all) and 1 (identical). We train the model with FedAvg for 100 communication rounds and each client optimizes for 10 local epochs at each round.
|
| 74 |
+
|
| 75 |
+
We first selectively show the pairwise CKA features similarity of three different layers across local models in Figure 1. Three compared layers here are the first layer, the middle layer (Layer 4), and the last layer (the classifier), respectively. Interestingly, we find that features outputted by the deeper layer show lower CKA similarity. It indicates that, for federated models trained on non-IID data, the deeper layers have heavier heterogeneity across different clients. By averaging the pairwise CKA features similarity in Figure 1, we can obtain a single value to approximately represent the similarity of the feature outputs by each layer across different clients. We illustrate the approximated layer-wise features similarity in Figure 2. The results show that the models trained with non-IID data have consistently lower feature similarity across clients for all layers, compared with those trained on IID data. The primary finding is that, for non-IID training, the classifier shows the lowest features similarities, among all the layers. The low CKA similarities of the classifiers imply that the local classifiers change greatly to fit the local data distribution.
|
| 76 |
+
|
| 77 |
+
Table 1: Accuracy $@ 1$ $( \% )$ on CIFAR-10 with different degrees of heterogeneity.
|
| 78 |
+
|
| 79 |
+
<table><tr><td>Method</td><td>α= 0.5</td><td>α= 0.1</td><td>α=0.05</td></tr><tr><td>FedAvg</td><td>68.62±0.77</td><td>58.55±0.98</td><td>52.33±0.43</td></tr><tr><td>FedAvg + clsnorm</td><td>69.65±0.35 (↑ 1.03)</td><td>58.94±0.08 (↑ 0.39)</td><td>51.74±4.02 (↓ 0.59)</td></tr><tr><td>FedAvg +clsprox</td><td>68.82±0.75 (↑ 0.20)</td><td>59.04±0.70 (↑ 0.49)</td><td>52.38±0.78( (↑0.05)</td></tr><tr><td>FedAvg + clsnorm + clsprox</td><td>68.75±0.75 (↑ 0.13)</td><td>58.80±0.30 (↑ 0.25)</td><td>52.39±0.24 (↑ 0.06)</td></tr><tr><td>FedAvg + calibration (whole data)</td><td>72.51±0.53 (↑ 3.89)</td><td>64.70±0.94 (↑ 6.15)</td><td>57.53±1.00 (↑ 5.20)</td></tr></table>
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 4: The effect of classifier calibration using different amounts of data.
|
| 83 |
+
|
| 84 |
+
To perform a deeper analysis on the classifier trained on non-IID data, inspired by [36], we illustrate the $L _ { 2 }$ norm of the local classifier weight vectors in Figure 3. We observe that the classifier weight norms would be biased to the class with more training samples at the initial training stage. At the end of the training, models trained on non-IID data suffer from a much heavier biased classifier than the models trained on IID data.
|
| 85 |
+
|
| 86 |
+
Based on the above observations about the classifier, we hypothesize that: because the classifier is the closest layer to the local label distribution, it can be easily biased to the heterogeneous local data, reflected by the low features similarity among different local classifiers and the biased weight norms. Furthermore, we believe that debiasing the classifier is promising to directly improve the classification performance.
|
| 87 |
+
|
| 88 |
+
# 3.3 Classifier Regularization and Calibration
|
| 89 |
+
|
| 90 |
+
To effectively debias the classifier, we consider the following regularization and calibration methods.
|
| 91 |
+
|
| 92 |
+
Classifier Weight $L 2$ -normalization. To eliminate the bias in classifier weight norms, we normalize the classifier weight vectors during the training and the inference stage. We abbreviate it to ‘clsnorm’. In particular, the classifier is a linear transformation with weight $\bar { \boldsymbol { \varphi } } = [ \varphi _ { 1 } , \ldots , \varphi _ { C } ]$ , followed by normalization and softmax. Given a feature $_ { z }$ , the output of the classifier is
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
g _ { \varphi } ( z ) _ { i } = \frac { e ^ { \varphi _ { i } ^ { T } z / | | \varphi _ { i } | | } } { \sum _ { i ^ { \prime } = 1 } ^ { C } e ^ { \varphi _ { i ^ { \prime } } ^ { T } z / | | \varphi _ { i ^ { \prime } } | | } } , \quad \forall i \in [ C ] .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Classifier Quadratic Regularization. Beyond restricting the weight norms of classifier, we also consider adding a proximal term similar to [5] only to restrict the classifier weights to be close to the received global classifier weight vectors from the server. We write it as ‘clsprox’ for short. The loss function in Eq. (1) can be specified as
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\mathcal { L } ( \boldsymbol { w } _ { k } ^ { ( t ) } ; \boldsymbol { w } ^ { ( t - 1 ) } , \boldsymbol { x } , \boldsymbol { y } ) = \ell ( g _ { \varphi _ { k } ^ { ( t ) } } ( f _ { \theta _ { k } ^ { ( t ) } } ( \boldsymbol { x } ) ) , \boldsymbol { y } ) + \frac { \mu } { 2 } | | \varphi _ { k } ^ { ( t ) } - \varphi ^ { ( t - 1 ) } | | ^ { 2 } ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $\ell$ is the cross-entropy loss and $\mu$ is the regularization factor.
|
| 105 |
+
|
| 106 |
+
Classifier Post-calibration with IID Samples. In addition to regularizing the classifier during federated training, we also consider a post-processing technique to adjust the learned classifier. After the federated training, we fix the feature extractor and calibrate the classifier by SGD optimization with a cross-entropy loss on IID samples. Note that this calibration strategy requires IID raw features collected from heterogeneous clients. Therefore, it can only serve as an experimental study use but cannot be applied to the real federated learning system.
|
| 107 |
+
|
| 108 |
+
We conduct experiments to compare the above three methods on CIFAR-10 with three different degrees of data heterogeneity and present the results in Table 1. We observe that regularizing the L2-norm of classifier weight (clsnorm) is effective for light data heterogeneity but would have less help or even lead to damages along with the increase of the heterogeneity. Regularizing the classifier parameters (clsprox) is consistently effective but with especially minor improvements. Surprisingly, we find that calibrating the classifier of the FedAvg model with all training samples brings significant performance improvement for all degrees of data heterogeneity.
|
| 109 |
+
|
| 110 |
+
To further understand the classifier calibration technique, we additionally perform calibrations with different numbers of data samples and different off-the-shelf federated models trained by FedAvg and FedProx. The results are shown in Figure 4 and we observe that data-based classifier calibration performs consistently well, even with $1 / 5 0$ training data samples for calibration use. These significant performance improvements after adjusting the classifier strongly verify our aforementioned hypothesis, i.e., the devil is in the classifier.
|
| 111 |
+
|
| 112 |
+
# 4 Classifier Calibration with Virtual Representations
|
| 113 |
+
|
| 114 |
+
Motivated by the above observations, we propose Classifier Calibration with Virtual Representations (CCVR) that runs on the server after federated training the global model. CCVR uses virtual features drawn from an estimated Gaussian Mixture Model (GMM), without accessing any real images. Suppose $f _ { \widehat { \pmb { \theta } } }$ and $g _ { \widehat { \varphi } }$ b bare the feature extractor and classifier of the global model, respectively, where $\widehat { \pmb { w } } = ( \widehat { \pmb { \theta } } , \widehat { \pmb { \varphi } } )$ b bis the parameter trained by a certain federated learning algorithm, e.g. FedAvg. We shall use $f _ { \widehat { \pmb { \theta } } }$ to extract features and estimate the correbsponding feature distribution, and re-train $g$ using generated virtual representations.
|
| 115 |
+
|
| 116 |
+
Feature Distribution Estimation. For semantics related tasks such as classification, the features learned by deep neural networks can be approximated with a mixture of Gaussian distribution. Theoretically, any continuous distribution can be approximated by using a finite number of mixture of gaussian distributions [37]. In our CCVR, we assume that features of each class in $\mathcal { D }$ follow a Gaussian distribution. The server estimates this distribu
|
| 117 |
+
|
| 118 |
+
# Algorithm 1: Virtual Representation Generation
|
| 119 |
+
|
| 120 |
+
Input: Feature extractor $f _ { \widehat { \pmb { \theta } } }$ of the global model, number $M _ { c }$ bof virtual features for class $c$ 1 # Server executes:
|
| 121 |
+
2 Send $f _ { \widehat { \pmb { \theta } } }$ to clients. 3 # Clients execute: 4 foreach client $k \in [ K ]$ do 5 foreach class $c \in [ C ]$ do 6 Produce ${ \ z } _ { c , k , j } = \bar { \ z } _ { \widehat { \theta } } ( \pmb { x } _ { c , k , j } )$ for $j$ -th sample in $\mathcal { D } _ { c } ^ { k }$ for $j \in [ N _ { c , k } ]$ . 7 Compute $\mu _ { c , k }$ and $\Sigma _ { c , k }$ using Eq. (2). 8 end 9 Send $\{ ( \pmb { \mu _ { c , k } } , \pmb { \Sigma _ { c , k } } ) : c \in [ C ] \}$ to server.
|
| 122 |
+
10 end
|
| 123 |
+
11 # Server executes:
|
| 124 |
+
12 foreach class $c \in [ C ]$ do
|
| 125 |
+
13 Compute $\pmb { \mu } _ { c }$ and $\Sigma _ { c }$ using Eq. (3) and (4).
|
| 126 |
+
14 Draw a set $G _ { c }$ of $M _ { c }$ features from $\mathcal { N } ( \mu _ { c } , \Sigma _ { c } )$ with ground truth label $c$ .
|
| 127 |
+
15 end
|
| 128 |
+
Output: Set of virtual representations $\cup _ { c \in [ C ] } G _ { c }$
|
| 129 |
+
|
| 130 |
+
tion by computing the mean $\pmb { \mu } _ { c }$ and the covariance $\Sigma _ { c }$ for each class $c$ of $\mathcal { D }$ using gathered local statistics from clients, without accessing true data samples or their features. In particular, the server first sends the feature extractor $f _ { \widehat { \pmb { \theta } } }$ of the trained global model to clients. Let $\dot { N } _ { c , k } = | \mathcal { D } _ { c } ^ { k } |$ be the number of samples of class $c$ θb on client $k$ , and set $\begin{array} { r } { N _ { c } = \sum _ { k = 1 } ^ { K } N _ { c , k } } \end{array}$ . Client $k$ produces features $\{ z _ { c , k , 1 } , \dots , z _ { c , k , N _ { c , k } } \}$ for class $c$ , where $\boldsymbol { z } _ { c , k , j } = f _ { \widehat { \theta } } ( \boldsymbol { x } _ { c , k , j } )$ is the feature of the $j$ -th sample in $\mathcal { D } _ { c } ^ { k }$ , and computes local mean $\mu _ { c , k }$ and covariance $\Sigma _ { c , k }$ of $\mathcal { D } _ { c } ^ { k }$ as:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\boldsymbol { \mu } _ { c , k } = \frac { 1 } { N _ { c , k } } \sum _ { j = 1 } ^ { N _ { c , k } } z _ { c , k , j } , \quad \boldsymbol { \Sigma } _ { c , k } = \frac { 1 } { N _ { c , k } - 1 } \sum _ { j = 1 } ^ { N _ { c , k } } \left( z _ { c , k , j } - \mu _ { c , k } \right) \left( z _ { c , k , j } - \mu _ { c , k } \right) ^ { T } ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Then client $k$ uploads $\{ ( \pmb { \mu _ { c , k } } , \pmb { \Sigma _ { c , k } } ) : c \in [ C ] \}$ to server. For the server to compute the global statistics of $\mathcal { D }$ , it is sufficient to represent the global mean $\pmb { \mu } _ { c }$ and covariance $\Sigma _ { c }$ using $\mu _ { c , k }$ ’s and $\Sigma _ { c , k }$ ’s for each class $c$ . The global mean can be straightforwardly written as
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\pmb { \mu } _ { c } = \frac { 1 } { N _ { c } } \sum _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { N _ { c , k } } z _ { c , k , j } = \sum _ { k = 1 } ^ { K } \frac { N _ { c , k } } { N _ { c } } \pmb { \mu } _ { c , k } .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
For the covariance, note that by definition we have
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
( N _ { c , k } - 1 ) \boldsymbol { \Sigma } _ { c , k } = \sum _ { j = 1 } ^ { N _ { c , k } } z _ { c , k , j } z _ { c , k , j } ^ { T } - N _ { c , k } \cdot \mu _ { c , k } \mu _ { c , k } ^ { T }
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
whenever $N _ { c , k } \ge 1$ . Then the global covariance can be written as
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\begin{array} { l } { \displaystyle \pmb { \Sigma } _ { c } = \frac { 1 } { N _ { c } - 1 } \sum _ { k = 1 } ^ { K } \sum _ { j = 1 } ^ { N _ { c , k } } z _ { c , k , j } z _ { c , k , j } ^ { T } - \frac { N _ { c } } { N _ { c } - 1 } \pmb { \mu } _ { c } \pmb { \mu } _ { c } ^ { T } } \\ { \displaystyle = \sum _ { k = 1 } ^ { K } \frac { N _ { c , k } - 1 } { N _ { c } - 1 } \pmb { \Sigma } _ { c , k } + \sum _ { k = 1 } ^ { K } \frac { N _ { c , k } } { N _ { c } - 1 } \pmb { \mu } _ { c , k } \pmb { \mu } _ { c , k } ^ { T } - \frac { N _ { c } } { N _ { c } - 1 } \pmb { \mu } _ { c } \pmb { \mu } _ { c } ^ { T } . } \end{array}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
Virtual Representations Generation. After obtaining $\pmb { \mu } _ { c }$ ’s and $\Sigma _ { c }$ ’s, the server generates a set $G _ { c }$ of virtual features with ground truth label $c$ from the Gaussian distribution $\mathcal { N } ( \mu _ { c } , \Sigma _ { c } )$ . The number $M _ { c } : = | G _ { c } |$ of virtual features for each class $c$ could be determined by the fraction $\frac { N _ { c } } { | \mathcal { D } | }$ to reflect the inter-class distribution. See Algorithm 1.
|
| 155 |
+
|
| 156 |
+
Classifier Re-Training. The last step of our CCVR method is classifier re-training using virtual representations. We take out the classifier $g$ from the global model, initialize its parameter as $\widehat { \varphi }$ , and re-train the parameter to $\widetilde { \varphi }$ for the objective
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\operatorname* { m i n } _ { \tilde { \varphi } } \mathbb { E } _ { ( z , y ) \sim \bigcup _ { c \in [ C ] } G _ { c } } [ \ell ( g _ { \tilde { \varphi } } ( z ) , y ) ] ,
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where $\ell$ is the cross-entropy loss. We then obtain the final classification model $g _ { \widetilde { \varphi } } \circ f _ { \widehat { \theta } }$ consisting of the pre-trained feature extractor and the calibrated classifier.
|
| 163 |
+
|
| 164 |
+
Privacy Protection. CCVR protects privacy at the basic level because each client only uploads their local Gaussian statistics rather than the raw representations. Note that CCVR is just a post-hoc method, so it can be easily combined with some privacy protection techniques [38] to further secure privacy. In the Appendix, we provide an empirical analysis on the privacy-preserving aspect.
|
| 165 |
+
|
| 166 |
+
# 5 Experiment
|
| 167 |
+
|
| 168 |
+
# 5.1 Experiment Setup
|
| 169 |
+
|
| 170 |
+
Federated Simulation. We consider image classification task and adopt three datasets from the popular FedML benchmark [39], i.e., CIFAR-10 [40], CIFAR-100 [40] and CINIC-10 [41]. Note that CINIC-10 is constructed from ImageNet [42] and CIFAR-10, whose samples are very similar but not drawn from identical distributions. Therefore, it naturally introduces distribution shifts which is suited to the heterogeneous nature of federated learning. To simulate federated learning scenario, we randomly split the training set of each dataset into $K$ batches, and assign one training batch to each client. Namely, each client owns its local training set. We hold out the testing set at the server for evaluation of the classification performance of the global model. For hyperparameter tuning, we first take out a $15 \%$ subset of training set for validation. After selecting the best hyperparameter, we return the validation set to the training set and retrain the model. We are interested in the NIID partitions of the three datasets, where class proportions and number of data points of each client are unbalanced. Following [14, 15], we sample $p _ { i } \sim D i r _ { K } ( \alpha )$ and assign a $p _ { i , k }$ proportion of the samples from class $i$ to client $k$ . We set $\alpha$ as 0.5 unless otherwise specified. For fair comparison, we apply the same data augmentation techniques for all methods.
|
| 171 |
+
|
| 172 |
+
Table 2: Accuracy $@ 1$ $( \% )$ on CIFAR-10 with different degrees of heterogeneity (α ∈ $\{ 0 . 5 , 0 . 1 , 0 . 0 5 \} _ { \ r }$ ), CIFAR-100 and CINIC-10.
|
| 173 |
+
|
| 174 |
+
<table><tr><td></td><td>Method</td><td>α=0.5</td><td>α=0.1</td><td>α=0.05</td><td>CIFAR-100</td><td>CINIC-10</td></tr><tr><td rowspan="4">No Calibration</td><td>FedAvg</td><td>68.62±0.77</td><td>58.55±0.98</td><td>52.33±0.43</td><td>66.25±0.54</td><td>60.20±2.04</td></tr><tr><td>FedProx</td><td>69.07±1.07</td><td>58.93±0.64</td><td>53.00±0.32</td><td>66.31±0.39</td><td>60.52±2.07</td></tr><tr><td>FedAvgM</td><td>69.00±1.68</td><td>59.22±1.14</td><td>51.98±0.91</td><td>66.43±0.23</td><td>60.46±0.73</td></tr><tr><td>MOON</td><td>70.48±0.36</td><td>57.36±0.85</td><td>49.91±0.38</td><td>67.02±0.31</td><td>65.67±2.10</td></tr><tr><td rowspan="4">CCVR (Ours.)</td><td>FedAvg</td><td></td><td></td><td>71.03±0.40(↑2.41) 62.68±0.54(个4.13) 54.95±0.61(↑ 2.62)</td><td>66.60±0.63(↑0.35)</td><td>69.99±0.54 (↑9.79)</td></tr><tr><td>FedProx</td><td>70.99±1.21(个 1.92) 62.60±0.43(↑ 3.67)</td><td></td><td>55.79±1.07 (↑ 2.79) 66.61±0.48 (↑0.30)</td><td></td><td>70.05±0.66 (↑ 9.53)</td></tr><tr><td>FedAvgM</td><td>71.49±0.88 (↑ 2.49)</td><td>62.64±1.07 (个 3.42)</td><td>54.57±0.58 (↑ 2.59)</td><td>66.71±0.16(↑0.28)</td><td>70.87±0.61 (↑ 10.41)</td></tr><tr><td>MOON</td><td>71.29±0.11 (↑ 0.81)</td><td>62.22±0.70(↑ 4.86)</td><td>55.60±0.63 (↑ 5.69)</td><td>67.17±0.37 (↑ 0.15)</td><td>69.42±0.65 (↑ 3.75)</td></tr><tr><td rowspan="4">Oracle</td><td>FedAvg</td><td>72.51±0.53 (↑ 3.89)</td><td>64.70±0.94(↑6.15)</td><td>57.53±1.00 (个5.20)</td><td>66.84±0.50(↑0.59)</td><td>73.47±0.30(个 13.27)</td></tr><tr><td>FedProx</td><td>72.26±1.22 (↑ 3.19)</td><td>64.63±0.93(↑ 5.70)</td><td>57.33±0.72 (↑4.33)</td><td>66.68±0.43 (↑0.37)</td><td>73.10±0.57 (↑ 12.58)</td></tr><tr><td>FedAvgM</td><td>73.30±0.19 (↑ 4.30)</td><td>64.24±1.32(↑ 5.02)</td><td>57.11±1.08 (↑ 5.13)</td><td>66.94±0.32 (↑ 0.51)</td><td>72.88±0.37 (↑ 12.42)</td></tr><tr><td>MOON</td><td>72.05±0.16 (↑ 1.57)</td><td>64.94±0.58 (个 7.58)</td><td>58.14±0.47 (个 8.23)</td><td>67.56±0.44 (↑ 0.54)</td><td>73.38±0.23 (↑ 7.71)</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Baselines and Implementation. We consider comparing the test accuracies of the representative federated learning algorithms FedAvg [2], FedProx [5], FedAvgM [11, 26] and the state-of-the-art method MOON [8] before and after applying our CCVR. For FedProx and MOON, we carefully tune the coefficient of local regularization term $\mu$ and report their best results. For FedAvgM, the server momentum is set to be 0.1. We use a simple 4-layer CNN network with a 2-layer MLP projection head described in [8] for CIFAR-10. For CIFAR-100 and CINIC-10, we adopt MobileNetV2 [43]. For CCVR, to make the virtual representations more Gaussian-like, we apply ReLU and Tukey’s transformation before classifier re-training. For Tukey’s transformation, the parameter is set to be 0.5. For each dataset, all methods are evaluated with the same model for fair comparison. The proposed CCVR algorithm only has one important hyperparameter, the number of feature samples $M _ { c }$ to generate. Unless otherwise stated, $M _ { c }$ is set to 100, 500 and 1000 for CIFAR-10, CIFAR100 and CINIC-10 respectively. All experiments run with PyTorch 1.7.1. More details about the implementation and datasets are summarized in the Appendix.
|
| 177 |
+
|
| 178 |
+
# 5.2 Can classifier calibration improve performance of federated learning?
|
| 179 |
+
|
| 180 |
+
In Table 2, we present the test accuracy on all datasets before and after applying our CCVR. We also report the results under an ideal setting where the whole data are available for classifier calibration (Oracle). These results indicate the upper bound of classifier calibration.
|
| 181 |
+
|
| 182 |
+
CCVR consistently improves all baseline methods. First, it can be observed that applying classifier calibration increases accuracies for all baseline methods, even with the accuracy gain up to $1 0 . 4 1 \%$ on CINIC-10. This is particularly inspiring because CCVR requires no modification to the original federated training process. One can easily get considerable accuracy profits by simply post-processing the trained global model. Comparing the accuracy gains of different methods after applying CCVR and whole data calibration, we find that the accuracies of FedAvg and MOON get the greatest increase. On CINIC-10, the oracle results of FedAvg even outstrip those of all other baselines, implying that FedAvg focuses more on learning high-quality features but ignores learning a fair classifier. It further confirms the necessity of classifier calibration.
|
| 183 |
+
|
| 184 |
+
# 5.3 In what situation does CCVR work best?
|
| 185 |
+
|
| 186 |
+
We observe that though there is improvement on CIFAR-100 by applying CCVR, it seems subtle compared with that of other two datasets. This is not surprising, since the final accuracy achieved by classifier calibration is not only dependent on the degree to which the classifier is debaised, but also closely correlated with the quality of pre-trained representations. In CIFAR-100, each class only has 500 training images, so the classification task itself is very difficult and the model may learn representations with low separability. It is shown that the accuracy obtained with CCVR on CIFAR-100 is very close to the upper bound, indicating that CCVR does a good job of correcting the classifier, even if it is provided with a poor feature extractor.
|
| 187 |
+
|
| 188 |
+
We also note that CCVR achieves huge improvements on CINIC-10. To further analyze the reason of this success and the characteristics of CCVR, we now show the t-SNE visualization [44] of the features learned by FedAvg on CINIC-10 dataset in Figure 5. From the first and second sub-graphs, we can observe that some classes dominate the classification results, while certain classes are rarely predicted correctly. For instance, the classifier makes wrong prediction for most of the samples belonging to the grey class. Another evidence showing there exists a great bias in the classifier is that, from the upper right corner of the ground truth sub-graph, we can see that the features colored green and those colored purple can be easily separated. However, due to biases in the classifier, nearly all purple features are wrongly classified as the green class. Observing the third sub-graph, we find that by applying CCVR, these misclassifications are alleviated. We also find that, with CCVR, mistakes are basically made when identifying easily-confused features that are close to the decision boundary rather than a majority of features that belong to certain classes. This suggests that the classifier weight has been adjusted to be more fair to each class. In summary, CCVR may be more effective when applied to the models with good representations but serious classifier biases.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 5: t-SNE visualization of the features learned by FedAvg on CINIC-10. The features are colored by the ground truth and the predictions of the classifier before and after applying CCVR. Best viewed in color.
|
| 192 |
+
|
| 193 |
+
# 5.4 How to forecast the performance of classifier calibration?
|
| 194 |
+
|
| 195 |
+
We resort to Sliced Wasserstein Distance [45], which is a popular metric to measure the distances between distributions, to quantify the separability of GMM. The experiments are conducted on CIFAR-10 with $\alpha = 0 . 1$ . We first compute the Wasserstein distances between any two mixtures, then we average all the distances to get a mean distance. The farther the distance, the better the separability of GMM. We visualize the relationship between the accuracy gains and the separability of GMM in Figure 6. It is observed that the mean Wasserstein distance of GMM is positively correlated with the accuracy upper bound of classifier calibration. It verifies our claim in Section 5.3: CCVR may be more effective when applied to the models with good (separable) representations. In practice, one can use the mean Wasserstein distance of GMM to evaluate the quality of the simulated representations, as well as to forecast the potential performance of classifier calibration.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 6: GMM’s separability.
|
| 199 |
+
|
| 200 |
+
# 5.5 How many virtual features to generate?
|
| 201 |
+
|
| 202 |
+
One important hyperparameter in our CCVR is the number of virtual features $M _ { c }$ for each class $c$ to generate. We study the effect of $M _ { c }$ by tuning it from $\{ 0 , 5 0 , 1 0 0 , 5 0 0 , 1 0 0 0 , 2 0 0 0 \}$ on three different partitions of CIFAR-10 $\alpha \in \{ 0 . 0 5 , 0 . 1 , 0 . 5 \} )$ ) when applying CCVR to FedAvg. The results are provided in Figure 7. In general, even sampling only a few features can significantly increase the classification accuracy. Additionally, it is observed that on the two more heterogeneous distributions (the left two sub-graphs), more samples produces higher accuracy. Although results on NIID-0.5 give a similar hint in general, an accuracy decline when using a medium number of virtual samples is observed. This suggests that $M _ { c }$ is more sensitive when faced with a more balanced dataset. This can be explained by the nature of CCVR: utilizing virtual feature distribution to mimic the original feature distribution. As a result, if the number of virtual samples is limited, the simulated distribution may deviates from the true feature distribution. The results on NIID-0.5 implies that this trap could be easier to trigger when CCVR dealing with a more balanced original distribution. To conclude, though CCVR can provide free lunch for federated classification, one should still be very careful when tuning $M _ { c }$ to achieve higher accuracy. Generally speaking, a larger value of $M _ { c }$ is better.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 7: Accuracy $@ 1$ $( \% )$ of CCVR on CIFAR-10 with different numbers of virtual samples.
|
| 206 |
+
|
| 207 |
+
# 5.6 Does different levels of heterogeneity affect CCVR’s performance?
|
| 208 |
+
|
| 209 |
+
We study the effect of heterogeneity on CIFAR-10 by generating various non-IID partitions from Dirichlet distribution with different concentration parameters $\alpha$ . Note that partition with smaller $\alpha$ is more imbalanced. It can be seen from Table 2 that CCVR steadily improves accuracy for all the methods on all partitions. Typically, the improvements is greater when dealing with more heterogeneous data, implying that the amount of bias existing in the classifier is positively linked with the imbalanceness of training data. Another interesting discovery is that vanilla MOON performs worse than FedAvg and FedProx when $\alpha$ equals to 0.1 or 0.05, but the oracle results after classifier calibration is higher than those of FedAvg and FedProx. It indicates that MOON’s regularization on the representation brings severe negative effects on the classifier. As a consequence, MOON learns good representations but poor classifier. In that case, applying CCVR observably improves the original results, making the performance of MOON on par with FedAvg and FedProx.
|
| 210 |
+
|
| 211 |
+
# 6 Limitations
|
| 212 |
+
|
| 213 |
+
In this work, we mainly focus on the characteristic of the classifier in federated learning, because it is found to change the most during local training. However, our experimental results show that in a highly heterogeneous setting, only calibrating the classifier still cannot achieve comparable accuracies to that obtained on IID data. This is because the performance of classifier calibration highly relies on the quality of learned representations. Thus, it’s more important to learn a good feature space. Our experiments reveal that there may exist a trade-off in the quality of representation and classifier in federated learning on non-IID data. Namely, the methods that gain the greatest benefits from classifier calibration typically learn high-quality representations but poor classifier. We believe this finding is intriguing for future research and there is still a long way to tackling the non-IID quagmire.
|
| 214 |
+
|
| 215 |
+
Moreover, we mainly focus on the image classification task in this work. Our experiments validate that the Gaussian assumption works well for visual model like CNN. However, this conclusion may not hold for language tasks or for other architectures like LSTM [46] and Transformer [47]. We believe the extensions of this work to other tasks and architectures are worth exploring.
|
| 216 |
+
|
| 217 |
+
# 7 Conclusion
|
| 218 |
+
|
| 219 |
+
In this work, we provide a new perspective to understand why the performance of a deep learningbased classification model degrades when trained with non-IID data in federated learning. We first anatomize the neural networks and study the similarity of different layers of the models on different clients through recent representation analysis techniques. We observe that the classifiers of different local models are less similar than any other layer, and there is a significant bias among the classifier. We then propose a novel method called Classifier Calibration with Virtual Representations (CCVR), which samples virtual features from an approximated Gaussian Mixture Model (GMM) for classifier calibration to avoid uploading raw features to the server. Experimental results on three image datasets show that CCVR steadily improves over several popular federated learning algorithms.
|
| 220 |
+
|
| 221 |
+
# Acknowledgement
|
| 222 |
+
|
| 223 |
+
We would like to thank the anonymous reviewers for their insightful comments and suggestions.
|
| 224 |
+
|
| 225 |
+
# References
|
| 226 |
+
|
| 227 |
+
[1] Deng, J., W. Dong, R. Socher, et al. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 228 |
+
[2] McMahan, B., E. Moore, D. Ramage, et al. Communication-Efficient Learning of Deep Networks from Decentralized Data. In AISTATS, pages 1273–1282. 2017.
|
| 229 |
+
[3] Kairouz, P., H. B. McMahan, B. Avent, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
|
| 230 |
+
[4] Li, T., A. K. Sahu, A. Talwalkar, et al. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020.
|
| 231 |
+
[5] Li, T., A. K. Sahu, M. Zaheer, et al. Federated optimization in heterogeneous networks. arXiv preprint arXiv:1812.06127, 2018.
|
| 232 |
+
[6] Zhao, Y., M. Li, L. Lai, et al. Federated learning with non-iid data. arXiv preprint arXiv:1806.00582, 2018.
|
| 233 |
+
[7] Li, Q., Y. Diao, Q. Chen, et al. Federated learning on non-iid data silos: An experimental study. arXiv preprint arXiv:2102.02079, 2021.
|
| 234 |
+
[8] Li, Q., B. He, D. Song. Model-contrastive federated learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2021.
|
| 235 |
+
[9] Karimireddy, S. P., S. Kale, M. Mohri, et al. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning, pages 5132–5143. PMLR, 2020.
|
| 236 |
+
[10] Acar, D. A. E., Y. Zhao, R. M. Navarro, et al. Federated learning based on dynamic regularization. In International Conference on Learning Representations. 2021.
|
| 237 |
+
[11] Hsu, T.-M. H., H. Qi, M. Brown. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019.
|
| 238 |
+
[12] Lin, T., L. Kong, S. U. Stich, et al. Ensemble distillation for robust model fusion in federated learning. arXiv preprint arXiv:2006.07242, 2020.
|
| 239 |
+
[13] Wang, J., Q. Liu, H. Liang, et al. Tackling the objective inconsistency problem in heterogeneous federated optimization. arXiv preprint arXiv:2007.07481, 2020.
|
| 240 |
+
[14] Yurochkin, M., M. Agarwal, S. Ghosh, et al. Bayesian nonparametric federated learning of neural networks. In International Conference on Machine Learning, pages 7252–7261. PMLR, 2019.
|
| 241 |
+
[15] Wang, H., M. Yurochkin, Y. Sun, et al. Federated learning with matched averaging. In International Conference on Learning Representations. 2020.
|
| 242 |
+
[16] Hao, W., M. El-Khamy, J. Lee, et al. Towards fair federated learning with zero-shot data augmentation. arXiv preprint arXiv:2104.13417, 2021.
|
| 243 |
+
[17] Jeong, E., S. Oh, H. Kim, et al. Communication-efficient on-device machine learning: Federated distillation and augmentation under non-iid private data. arXiv preprint arXiv:1811.11479, 2018.
|
| 244 |
+
[18] Goetz, J., A. Tewari. Federated learning via synthetic data. arXiv preprint arXiv:2008.04489, 2020.
|
| 245 |
+
[19] Fallah, A., A. Mokhtari, A. Ozdaglar. Personalized federated learning: A meta-learning approach. arXiv preprint arXiv:2002.07948, 2020.
|
| 246 |
+
[20] Jiang, Y., J. Konecnˇ y, K. Rush, et al. Improving federated learning personalization via model agnostic \` meta learning. arXiv preprint arXiv:1909.12488, 2019.
|
| 247 |
+
[21] Bui, D., K. Malik, J. Goetz, et al. Federated user representation learning. arXiv preprint arXiv:1909.12535, 2019.
|
| 248 |
+
[22] Sattler, F., K.-R. Müller, W. Samek. Clustered federated learning: Model-agnostic distributed multitask optimization under privacy constraints. IEEE Transactions on Neural Networks and Learning Systems, 2020.
|
| 249 |
+
[23] Kornblith, S., M. Norouzi, H. Lee, et al. Similarity of neural network representations revisited. In International Conference on Machine Learning, pages 3519–3529. PMLR, 2019.
|
| 250 |
+
[24] Hsieh, K., A. Phanishayee, O. Mutlu, et al. The non-iid data quagmire of decentralized machine learning. arXiv preprint arXiv:1910.00189, 2019.
|
| 251 |
+
[25] Li, X., K. Huang, W. Yang, et al. On the convergence of fedavg on non-iid data. arXiv preprint arXiv:1907.02189, 2019.
|
| 252 |
+
[26] Hsu, T.-M. H., H. Qi, M. Brown. Federated visual classification with real-world data distribution. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part X 16, pages 76–92. Springer, 2020.
|
| 253 |
+
[27] Goodfellow, I. J., J. Pouget-Abadie, M. Mirza, et al. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014.
|
| 254 |
+
[28] Chen, F., M. Luo, Z. Dong, et al. Federated meta-learning with fast convergence and efficient communication. arXiv preprint arXiv:1802.07876, 2018.
|
| 255 |
+
[29] Khodak, M., M.-F. F. Balcan, A. S. Talwalkar. Adaptive gradient-based meta-learning methods. In Advances in Neural Information Processing Systems, pages 5917–5928. 2019.
|
| 256 |
+
[30] Smith, V., C.-K. Chiang, M. Sanjabi, et al. Federated multi-task learning. In Advances in Neural Information Processing Systems, pages 4424–4434. 2017.
|
| 257 |
+
[31] Liang, P. P., T. Liu, L. Ziyin, et al. Think locally, act globally: Federated learning with local and global representations. arXiv preprint arXiv:2001.01523, 2020.
|
| 258 |
+
[32] Arivazhagan, M. G., V. Aggarwal, A. K. Singh, et al. Federated learning with personalization layers. arXiv preprint arXiv:1912.00818, 2019.
|
| 259 |
+
[33] Ghosh, A., J. Chung, D. Yin, et al. An efficient framework for clustered federated learning. arXiv preprint arXiv:2006.04088, 2020.
|
| 260 |
+
[34] Ghosh, A., J. Hong, D. Yin, et al. Robust federated learning in a heterogeneous environment. arXiv preprint arXiv:1906.06629, 2019.
|
| 261 |
+
[35] Xie, M., G. Long, T. Shen, et al. Multi-center federated learning. arXiv preprint arXiv:2005.01026, 2020.
|
| 262 |
+
[36] Kang, B., S. Xie, M. Rohrbach, et al. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations. 2020.
|
| 263 |
+
[37] Lindsay, B. G. Mixture models: theory, geometry and applications. In NSF-CBMS regional conference series in probability and statistics, pages i–163. JSTOR, 1995.
|
| 264 |
+
[38] Vepakomma, P., T. Swedish, R. Raskar, et al. No peek: A survey of private distributed deep learning. arXiv preprint arXiv:1812.03288, 2018.
|
| 265 |
+
[39] He, C., S. Li, J. So, et al. Fedml: A research library and benchmark for federated machine learning. arXiv preprint arXiv:2007.13518, 2020.
|
| 266 |
+
[40] Krizhevsky, A., G. Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 267 |
+
[41] Darlow, L. N., E. J. Crowley, A. Antoniou, et al. Cinic-10 is not imagenet or cifar-10. arXiv preprint arXiv:1810.03505, 2018.
|
| 268 |
+
[42] Russakovsky, O., J. Deng, H. Su, et al. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015.
|
| 269 |
+
[43] Sandler, M., A. Howard, M. Zhu, et al. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520. 2018.
|
| 270 |
+
[44] Van der Maaten, L., G. Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
|
| 271 |
+
[45] Kolouri, S., K. Nadjahi, U. Simsekli, et al. Generalized sliced wasserstein distances. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, R. Garnett, eds., Advances in Neural Information Processing Systems, vol. 32. Curran Associates, Inc., 2019.
|
| 272 |
+
[46] Hochreiter, S., J. Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735–1780, 1997.
|
| 273 |
+
[47] Vaswani, A., N. Shazeer, N. Parmar, et al. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 6000–6010. Curran Associates Inc., Red Hook, NY, USA, 2017.
|
md/train/B186cP9gx/B186cP9gx.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EIGENVALUES OF THE HESSIAN IN DEEP LEARNING: SINGULARITY AND BEYOND
|
| 2 |
+
|
| 3 |
+
Levent Sagun Mathematics Department New York University sagun@cims.nyu.edu
|
| 4 |
+
|
| 5 |
+
Leon Bottou´
|
| 6 |
+
Facebook AI Research New York
|
| 7 |
+
leon@bottou.org
|
| 8 |
+
|
| 9 |
+
Yann LeCun Computer Science Department New York University yann@cs.nyu.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We look at the eigenvalues of the Hessian of a loss function before and after training. The eigenvalue distribution is seen to be composed of two parts, the bulk which is concentrated around zero, and the edges which are scattered away from zero. We present empirical evidence for the bulk indicating how overparametrized the system is, and for the edges that depend on the input data.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Given a (piece-wise) differentiable loss function, and a gradient based algorithm to minimize it, the knowledge of the second order information about it can tell us quite a bit about how the landscape looks like, and how we could modify our algorithm to make it go faster and find better solutions. But, one of the biggest challenges in second order optimization methods is in accessing that second order information itself. In particular, in deep learning there have been many proposals to accelerate training using second order information. Ngiam et al. (2011) has an in depth review of some of the proposals for approximating the Hessian of the loss function. Nevertheless, given the computational complexity of the problems at hand, it is hard to acquire information on what the actual Hessian looks like. This work is part of a series of papers that explore the data-model-algorithm connection along with Sagun et al. (2014; 2015) and it builds on top of the intuition developed in LeCun et al. (2012). We also note that the singularity of the Fisher information matrix have been explored (see for instance Watanabe (2007)). In another recent work, Dauphin et al. (2014) investigate saddle points of the landscape, in particular, they locate saddle points that are near the training path. In this work, however, we strictly focus on the Hessian of the loss function at the exact point of the training. We train the main examples using gradient descent. We perform our calculations of the Hessian using the implementation for the exact Hessian vector product that has been introduced in Pearlmutter (1994). And we find two new observations: one where the eigenvalues are zero, and one where we have a large, positive, and discrete set of eigenvalues.
|
| 18 |
+
|
| 19 |
+
In this short note, we show how the data and the architecture depends on the eigenvalues of the Hessian of the loss function. In particular, we observe that the top discrete eigenvalues depend on the data, and the bulk of the eigenvalues depend on the architecture. Furthermore, as we keep growing the size of the network, we observe that the discrete part that depends on data remains the same, but the concentration around zero sharpens.
|
| 20 |
+
|
| 21 |
+
There are various conclusions and implications of this singularity. Recent research suggest new insights into convergence properties of gradient based algorithms in non-convex systems (Lee et al., 2016; Hardt et al., 2015). The results come together with their implications on neural networks. However, the proofs require the system at hand to be non-degenerate. An immediate conclusion of our observation is that the Hessian of the loss function is very singular. Therefore, a lot of the theory and methodology that assumes non-singular Hessian cannot be applied without an appropriate modification.
|
| 22 |
+
|
| 23 |
+
# 2 THE CASE OF THE FULLY-CONNECTED NETWORK
|
| 24 |
+
|
| 25 |
+
# 2.1 MNIST WITH INCREASING SIZES OF HIDDEN LAYERS
|
| 26 |
+
|
| 27 |
+
We calculate the exact Hessian of the loss function of a network with two hidden layers. The inputs are 1000 randomly selected examples of $2 8 * 2 8$ MNIST data, the network has one hidden layer with ReLU nonlinearity, the top layer has a softmax and a negative log likelihood loss function at the end. We train the system with gradient descent (i.e. with minibatch size equal to the number of examples). We plot the histogram of the eigenvalues of the Hessian for a varying number of hidden units after convergence. The Hessian at the end of the training turns out to be extremely singular, and increasing the number of units in hidden layers only add to the singularity of the Hessian (see figure 1). The effect of the training on the eigenvalue spectrum of the model with 10 hidden-units is visible when comparing figure 1 and figure 2 (left).
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: (left) Full Hessian matrix for a 784-2-10 system after convergence. (right) Eigenvalue profile for increasingly bigger networks. For $k$ hidden networks there are $( 7 8 4 + 1 ) * k + ( k + 1 ) *$ $k + ( k + 1 ) * 1 0$ eigenvalues.
|
| 31 |
+
|
| 32 |
+
# 2.2 VARYING THE DATA
|
| 33 |
+
|
| 34 |
+
To demonstrate how the eigenvalue distribution may depend on data itself, we keep the same architecture and change the inputs to random patterns. Initially, a random point in the weight space is selected, and we calculated the Hessian without any training (first two histograms of figure 2). After training the system until the norm of the gradient is close to zero. We again calculate the exact Hessian and plot the histogram of their eigenvalues which can be seen in the last one in figure 2.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: Comparing random input (last two) with the MNIST data (first). Initial eigenvalue profiles are very different, as well as the final profile when compared to figure 1.
|
| 38 |
+
|
| 39 |
+
# 3 A SIMPLER CASE
|
| 40 |
+
|
| 41 |
+
In this section, we will repeat the same experiment in two-dimensional data, in an attempt to understand better the connection between the data and the spectrum of the Hessian. A simple figure can be seen in figure 3. We create two Gaussian blobs, centered at $( 1 , 1 )$ and $( - 1 , - 1 )$ , and first we keep the standard deviation the same, and increase the network size.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 3: The input data for the simple case.
|
| 45 |
+
|
| 46 |
+
The network architecture is similar, this time with two hidden layers and a fully connected network with ReLU nonlinearities including a softmax at the top layer combined with a negative loglikelihood loss function. We train the system with gradient descent with constant step size. At the end of the training the norm of the gradient is at the order of $1 0 ^ { - 4 }$ .
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 4: Increasing the network size: Systems with 18, 74, 162, 282, and 434 parameters, respectively. And a network with MSE loss.
|
| 50 |
+
|
| 51 |
+
There are two eigenvalues that are isolated, and away from the bulk of the spectrum. Increasing the network only adds to the concentration of eigenvalues at and around zero (see figure 4). To give an insight into how the Hessian’s themselves look like, in figure 6 we plot the full Hessian matrices for three of the systems above after training.
|
| 52 |
+
|
| 53 |
+
Moreover, this property of the singular and discrete parts is not specific to the log loss. In figure 5, we plot the histogram for a system that is trained on the same data as in figure 3, and the same architecture. But the training is carried out with the mean square loss rather than the negative loglikelihood. Consistent with our previous observations, we still see the same discrete, data-dependent part, and the part that is at zero.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 5: Spectrum for the loss with the mean square loss.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 6: Hessian heatmaps for 18, 74 and 162 paramters systems after training. The plots are 90 degrees rotates counter-clock wise.
|
| 60 |
+
|
| 61 |
+
The training procedure itself acts like a process by which the eigenvalues concentrate at zero. To demonstrate this in further detail we calculated the full Hessian peridoically throughout the training. In figure 7 we plot the eigenvalue profile as the training progresses.
|
| 62 |
+
|
| 63 |
+
All of the training has been done with random initializations on the weight space with the same standard deviation. In other words, initial points are randomly chosen on the surface of a sphere with a fixed radius given the total number of parameters. This begs the question of the effect of the choice of the initial point. Therefore, now we fix the network size, and repeat the experiment with different random initializations over 5K times. In figure 8 we plot the fluctuations of the top eigenvalue.
|
| 64 |
+
|
| 65 |
+
The next question is how the spectrum responds to the increased complexity of data. The notion of complexity for a given dataset can be tricky to describe, here we use a loose notion of complexity to point out the fact that the more complex data is the less separable one. To this end, we keep the architecture the same, and increase the standard deviation of the two Gaussian blobs. They are still centered at the same two points, but it becomes harder to separate them as they merge together. Gradient descent still converges to a low-cost value, but the error is higher, and it can’t learn how to separate them perfectly as the blobs merge together. In figure 9, we observe that the top two eigenvalues grow significantly, and beyond its natural fluctuations due to the initialization. We also note that the norm of the weights are similar for all the cases, therefore the growth in the sizes of eigenvalues can not solely be accounted for the growth in weights.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 7: Eigenvalue profile during the training procedure.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 8: Top eigenvalue fluctuations over 5000 runs of the same system with same data and algorithm but different initial points.
|
| 72 |
+
|
| 73 |
+
# 4 CONCLUSION
|
| 74 |
+
|
| 75 |
+
We show that the Hessian of the loss functions in deep learning is degenerate. This has implications on the theoretical work which requires improvements in its premises. One such step has been taken in Panageas & Piliouras (2016) in relaxing the isolated singularity condition that was assumed in Lee et al. (2016). From a practical point of view this has multiple implications:
|
| 76 |
+
|
| 77 |
+
• The landscape may be flat beyond the notion of wide basins. • Training stops at a point that has a small gradient. The norm of the gradient is not zero, therefore it does not, technically speaking, converge to a critical point. • There are still negative eigenvalues even when they are small in magnitude.
|
| 78 |
+
|
| 79 |
+
This suggests that we may be able to look beyond the classical notions of basins when exploring the energy landscapes of loss functions. Next obvious question is to find low energy paths between solutions to show the kind of flatness in such landscapes. This will be explored in a subsequent work in the same series.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 9: Response of the top eigenvalues to the increasingly less-separable data. The numbers on top of the figures indicate the standard deviation of the Gaussian blobs. Their means are kept the same at $( 1 , 1 )$ and $( - 1 , - 1 )$ , respectively.
|
| 83 |
+
|
| 84 |
+
We also demonstrate the two phases of the spectrum, one that is concentrated around zero that depends on the size of the model, and the second part that is away from the bulk of the spectrum, that is isolated and depends on the data.
|
| 85 |
+
|
| 86 |
+
This kind of two-phased non-degeneracy can, in fact, be a desirable property. A degenerate Hessian implies locally flat regions. A degenerate Hessian at the scale that we observe in deep learning may imply flat regions across space, at the global scale.
|
| 87 |
+
|
| 88 |
+
• We can devise separate methods for the directions that correspond to the top eigenvalues. • We can take advantage of the directions that correspond to the zero or small eigenvalues by attempting to find paths of low energies in the weight space.
|
| 89 |
+
|
| 90 |
+
As a first step to the last item, initial experiments are promising: Let’s take a random point on the weight space and train two systems from that point: (1) with gradient descent, and (2) with stochastic gradient descent. At each step, take a straight line between the two points and interpolate the cost value. The resulting profile is completely flat even when the points keep diverging from one another. Next, take two random initial points on the weight space, so now they are orthogonal to each other. And train two systems with different shuffling of data for SGD. This time one would expect the line interpolation to give arbitrary values since the initial points are completely orthogonal, surprisingly, the line interpolation also decreases albeit not as flat as the previous one. Further considerations on connecting paths between solutions in the weight space of loss functions can be found in Freeman & Bruna (2016).
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 10: $z$ -axis is the distance between points. The left most and right most curves in each plot are actual training profiles, and the lines in between are interpolations only. (left figure) same initial point (right figure) random (hence orthogonal) initial points.
|
| 94 |
+
|
| 95 |
+
# ACKNOWLEDGMENTS
|
| 96 |
+
|
| 97 |
+
We would like to thank Afonso Bandeira, Yann Dauphin, Ruoyu Sun, Arthur Szlam and Soumith Chintala for valuable discussions. We also thank the reviewers for valuable feedback. Part of the research has been conducted when the first author was an intern at FAIR.
|
| 98 |
+
|
| 99 |
+
# REFERENCES
|
| 100 |
+
|
| 101 |
+
Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in Neural Information Processing Systems, pp. 2933–2941, 2014.
|
| 102 |
+
C Daniel Freeman and Joan Bruna. Topology and geometry of deep rectified network optimization landscapes. arXiv preprint arXiv:1611.01540, 2016.
|
| 103 |
+
Moritz Hardt, Benjamin Recht, and Yoram Singer. Train faster, generalize better: Stability of stochastic gradient descent. arXiv preprint arXiv:1509.01240, 2015.
|
| 104 |
+
Yann A LeCun, Leon Bottou, Genevieve B Orr, and Klaus-Robert M ´ uller. Efficient backprop. In ¨ Neural networks: Tricks of the trade, pp. 9–48. Springer, 2012.
|
| 105 |
+
Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent converges to minimizers. University of California, Berkeley, 1050:16, 2016.
|
| 106 |
+
Jiquan Ngiam, Adam Coates, Ahbik Lahiri, Bobby Prochnow, Quoc V Le, and Andrew Y Ng. On optimization methods for deep learning. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 265–272, 2011.
|
| 107 |
+
Ioannis Panageas and Georgios Piliouras. Gradient descent only converges to minimizers: Nonisolated critical points and invariant regions. arXiv preprint arXiv:1605.00405, 2016.
|
| 108 |
+
Barak A Pearlmutter. Fast exact multiplication by the hessian. Neural computation, 6(1):147–160, 1994.
|
| 109 |
+
Levent Sagun, V Ugur G ˘ uney, G ¨ erard Ben Arous, and Yann LeCun. Explorations on high dimen- ´ sional landscapes. ICLR 2015 Workshop Contribution, arXiv:1412.6615, 2014.
|
| 110 |
+
|
| 111 |
+
Levent Sagun, Thomas Trogdon, and Yann LeCun. Universality in halting time and its applications in optimization. arXiv preprint arXiv:1511.06444, 2015.
|
| 112 |
+
|
| 113 |
+
Sumio Watanabe. Almost all learning machines are singular. In Foundations of Computational Intelligence, 2007. FOCI 2007. IEEE Symposium on, pp. 383–388. IEEE, 2007.
|
md/train/B1gd0nEFwS/B1gd0nEFwS.md
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNIVERSAL SOURCE-FREE DOMAIN ADAPTATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
There is a strong incentive to develop versatile learning techniques that can transfer the knowledge of class-separability from a labeled source domain to an unlabeled target domain in the presence of a domain-shift. Existing domain adaptation (DA) approaches are not equipped for practical DA scenarios as a result of their reliance on the knowledge of source-target label-set relationship (e.g. Closed-set, Open-set or Partial DA). Furthermore, almost all the prior unsupervised DA works require coexistence of source and target samples even during deployment, making them unsuitable for incremental, real-time adaptation. Devoid of such highly impractical assumptions, we propose a novel two-stage learning process. Initially, in the procurement-stage, the objective is to equip the model for future sourcefree deployment, assuming no prior knowledge of the upcoming category-gap and domain-shift. To achieve this, we enhance the model’s ability to reject out-of-source distribution samples by leveraging the available source data, in a novel generative classifier framework. Subsequently, in the deployment-stage, the objective is to design a unified adaptation algorithm capable of operating across a wide range of category-gaps, with no access to the previously seen source samples. To achieve this, in contrast to the usage of complex adversarial training regimes, we define a simple yet effective source-free adaptation objective by utilizing a novel instancelevel weighing mechanism, named as Source Similarity Metric (SSM). A thorough evaluation shows the practical usability of the proposed learning framework with superior DA performance even over state-of-the-art source-dependent approaches.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning models have proven to be highly successful over a wide variety of tasks (Krizhevsky et al., 2012; Ren et al., 2015). However, a majority of these remain heavily dependent on access to a huge amount of labeled samples to achieve a reliable level of generalization. A recognition model trained on a certain distribution of labeled samples (source domain) often fails to generalize (Chen et al., 2017) when deployed in a new environment (target domain) in the presence a discrepancy in the input distribution (Shimodaira, 2000). Domain adaptation (DA) algorithms seek to minimize this discrepancy either by learning a domain invariant feature representation (Long et al., 2015; Kumar et al., 2018; Ganin et al., 2016; Tzeng et al., 2015), or by learning independent domain transformations (Long et al., 2016) to a common latent representation through adversarial distribution matching (Tzeng et al., 2017; Nath Kundu et al., 2018), in the absence of target label information.
|
| 12 |
+
|
| 13 |
+
Most of the existing approaches (Zhang et al., 2018c; Tzeng et al., 2017) assume a common label-set shared between the source and target domains (i.e. $\mathcal { C } _ { s } = \mathcal { C } _ { t }$ ), which is often regarded as Closed-Set $D A$ (see Fig. 1). Though this assumption helps to analyze various insights of DA algorithms, such an assumption rarely holds true in real-world scenarios. Recently researchers have independently explored two broad adaptation settings by partly relaxing the above assumption. In the first kind, Partial DA (Zhang et al., 2018b; Cao et al., 2018a;b), the target label space is considered as a subset of the source label space (i.e. $\mathcal { C } _ { t } \subset \mathcal { C } _ { s } .$ ). This setting is more suited for large-scale universal source datasets, which will almost always subsume the label-set of a wide range of target domains. However, the availability of such a universal source is highly questionable for a wide range of input domains and tasks. In the second kind, regarded as Open-set $D A$ (Baktashmotlagh et al., 2019; Ge et al., 2017), the target label space is considered as a superset of the source label space (i.e. $\mathcal { C } _ { t } \supset \mathcal { C } _ { s }$ ). The major challenge in this setting is attributed to detection of target samples from the unobserved categories in a fully-unsupervised scenario. Apart from the above two extremes, certain works define a partly mixed scenario by allowing “private” label-set for both source and target domains (i.e. $\mathcal { C } _ { s } \setminus \bar { \mathcal { C } } _ { t } \ne \bar { \varnothing }$ and $\mathcal { C } _ { t } \setminus \mathcal { C } _ { s } \ne \emptyset )$ ) but with extra supervision such as few-shot labeled data (Luo et al., 2017) or accessA to the knowledge of common categories (Panareda Busto & Gall, 2017).
|
| 14 |
+
|
| 15 |
+
Most of the prior approaches consider each scenario in isolation and propose independent solutions. Thus, they require access to the knowledge of label-set relationship (or category-gap) to carefully choose a DA algorithm, which would be suitable for the problem in hand. Furthermore, all the prior unsupervised DA works require coexistence of source and
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Various label-set relationships (category-gap).
|
| 19 |
+
|
| 20 |
+
target samples even during deployment, hence not source-free. This is highly impractical, as labeled source data may not be accessible after deployment due to several reasons such as, privacy concerns, restricted access to proprietary data, accidental loss of source data or other computational limitations in real-time deployment scenarios.
|
| 21 |
+
|
| 22 |
+
Acknowledging the aforementioned shortcomings, we propose one of the most convenient DA frameworks which is ingeniously equipped to address source-free DA for all kinds of label-set relationships, without any prior knowledge of the associated category-gap (i.e. universal- $D A$ ). We not only focus on identifying the key complications associated with the challenging problem setting, but also devise insightful ideas to tackle such complications by adopting learning techniques much different from the available DA literature. This leads us to realize a holistic solution which achieves superior DA performance even over prior source-dependent approaches.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
We briefly review the available domain adaptation methods under the three major divisions according to the assumption on label-set relationship. a) Closed-set DA. The cluster of previous works under this setting focuses on minimizing the domain gap at some intermediate feature level either by minimizing well-defined statistical distance functions (Wang & Schneider, 2014; Duan et al., 2012; Zhang et al., 2013; Saenko et al., 2010) or by formalizing it as an adversarial distribution matching problem (Tzeng et al., 2017; Kang et al., 2018; Long et al., 2018; Hu et al., 2018; Hoffman et al., 2018) inspired from the Generative Adversarial Nets (Goodfellow et al., 2014). Certain prior works (Sankaranarayanan et al., 2018; Zhu et al., 2017; Hoffman et al., 2018) use GAN framework to explicitly generate target-like images translated from the source image samples, which is also regarded as pixel-level adaptation (Bousmalis et al., 2017) in contrast to other feature level adaptation works (Nath Kundu et al., 2018; Tzeng et al., 2017; Long et al., 2015; 2016). b) Partial DA. Focusing on Partial $D A$ , Cao et al. (2018a) proposed to achieve adversarial class-level matching by utilizing multiple domain discriminators furnishing class-level and instance-level weighting for individual data samples. Zhang et al. (2018b) proposed to utilize importance weights for source samples depending on their similarity to the target domain data using an auxilliary discriminator. To effectively address the problem of negative-transfer (Wang et al., 2019), Cao et al. (2018b) employed a single discriminator to achieve both adversarial adaptation and class-level weighting of source samples. c) Open-set DA. Saito et al. (2018b) proposed a more general open-set adaptation setting without accessing the knowledge of source private labels set in contrast to the prior work (Panareda Busto & Gall, 2017). They extended the source classifier to accommodate an additional “unknown” class, which is trained adversarially against the other source classes. Universal DA. You et al. (2019) proposed Universal DA, which requires no prior knowledge of label-set relationship similar to the proposed setting, but considers access to both source and target samples during adaptation.
|
| 27 |
+
|
| 28 |
+
# 3 PROPOSED APPROACH
|
| 29 |
+
|
| 30 |
+
The problem setting for source-free domain adaptation is broadly divided into a two stage process.
|
| 31 |
+
|
| 32 |
+
a) Procurement stage. In this stage, we are given full access to the labeled samples of source domain, $\mathcal { D } _ { s } = \{ ( x _ { s } , y _ { s } ) : x _ { s } \sim p , y _ { s } \in$ $y _ { s } \in \mathcal { C } _ { s } \}$ , where $p$ is the distribution of source samples and $\mathcal { C } _ { s }$ denotes the label-set of the source domain. Here, the objective is to equip the model for the second stage, i.e. the Deployment stage, in the presence of a discrepancy in the distribution of input target samples. To achieve this we rely on an artificially generated negative dataset, $\mathcal { D } _ { n } = \{ ( x _ { n } ^ { - } , y _ { n } ) : \overset { \vartriangle } { x } _ { n } \sim \overset { \vartriangle } { p _ { n } }$ , $y _ { n } \in$ $\mathcal { C } _ { n } \}$ , where $p _ { n }$ is the distribution of negative source samples such that $\mathcal { C } _ { n } \cap \mathcal { C } _ { s } = \emptyset$ .
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: Latent space cluster arrangement during adaptation (see Section 3.1.1).
|
| 36 |
+
|
| 37 |
+
inter-class separability negative classesb) Deployment stage. After obtaining a trained model from the Procurement stage, the model will have its first encounter with the unlabeled target domain samples from the deployed environment. We denote the unlabeled target data by $\mathcal { D } _ { t } = \{ x _ { t } : x _ { t } \sim q \}$ , where $q$ is the distribution of target samples. Note that, access to the source dataset $\mathcal { D } _ { s }$ from the previous stage is fully restricted during adaptation in the Deployment stage. Suppose that, $\mathcal { C } _ { t }$ is the "unknown" label-set of the target domain. We define the common label space between the source and target domain as ${ \mathcal { C } } = { \mathcal { C } } _ { s } \cap { \mathcal { C } } _ { t }$ . The private label-set for the source and the target domains is represented as $\overline { { \mathcal { C } } } _ { s } = \mathcal { C } _ { s } \setminus \mathcal { C } _ { t }$ and $\overline { { \mathcal { C } } } _ { t } = \mathcal { C } _ { t } \setminus \bar { \mathcal { C } } _ { s }$ respectively.
|
| 38 |
+
|
| 39 |
+
# 3.1 LEARNING IN THE PROCUREMENT STAGE
|
| 40 |
+
|
| 41 |
+
3.1.1 Challenges. The available DA techniques heavily rely on the adversarial discriminative (Tzeng et al., 2017; Saito et al., 2018a) strategy. Thus, they require access to the source samples to reliably characterize the source domain distribution. Moreover, these approaches are not equipped to operate in a source-free setting. Though a generative model can be used as a memory-network (Sankaranarayanan et al., 2018; Bousmalis et al., 2017) to realize source-free adaptation, such a solution is not scalable for large-scale source datasets (e.g. ImageNet (Russakovsky et al., 2015)), as it introduces unnecessary extra parameters in addition to the associated training difficulties (Salimans et al., 2016). This calls for a fresh analysis of the requirements beyond the solutions found in literature.
|
| 42 |
+
|
| 43 |
+
In a general DA scenario, with access to source samples in the Deployment stage (specifically for Open-set or Partial DA), a widely adopted approach is to learn domain invariant features. In such approaches the placement of source category clusters is learned in the presence of unlabeled target samples which obliquely provides a supervision regarding the relationship between $\mathcal { C } _ { s }$ and $\mathcal { C } _ { t }$ . For instance, in case of Open-set DA, the source clusters may have to disperse to make space for the clusters from target private $\overline { { \mathcal { C } } } _ { t }$ (see Fig. 2a to 2b). Similarly, in partial DA, the source clusters may have to rearrange themselves to keep all the target shared clusters $\boldsymbol { \mathcal { C } } = \boldsymbol { \mathcal { C } } _ { t } ,$ separated from the source private $\overline { { \mathcal { C } } } _ { s } $ (see Fig. 2a to 2c). However in a complete source-free framework, we do not have the liberty to leverage such information as source and target samples never coexist together during training. Motivated by the adversarial discriminative DA technique (Tzeng et al., 2017), we hypothesize that, inculcating the ability to reject samples that are out of the source data distribution can facilitate future source-free domain alignment using this discriminatory knowledge. Therefore, in the Procurement stage the overarching objective is two-fold.
|
| 44 |
+
|
| 45 |
+
• Firstly, we must aim to learn a certain placement of source clusters best suited for all kinds of category-gap scenarios acknowledging the fact that, a source-free scenario does not allow us to modify the placement in the presence of target samples during adaptation (see Fig. 2d). • Secondly, the learned embedding must have the ability to reject out-of-distribution samples, which is an essential requirement for unsupervised adaptation in the presence of domain-shift.
|
| 46 |
+
|
| 47 |
+
3.1.2 Solution. In the presence of source data, we aim to restrain the model’s domain and category bias which is generally inculcated as a result of the over-confident supervised learning paradigms (see Fig. 4A). To achieve this goal, we adopt two regularization strategies viz. i) regularization via generative modeling and ii) utilization of a labeled simulated negative source dataset to generalize for the latent regions not covered by the given positive source samples (see Fig. 4C).
|
| 48 |
+
|
| 49 |
+
How to configure the negative source dataset? While configuring $\mathcal { D } _ { n }$ , the following key properties have to be met. Firstly, latent clusters formed by the negative categories must lie in-between the latent clusters of positive source categories to enable a higher degree of intra-class compactness with interclass separability (Fig. 4C). Secondly, the negative source samples must enrich the source domain
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 3: A) Simulated labeled negative samples using randomly created spline segments (in pink), p=20 B) Proposed architecture, C) Procurement stage yields compact source clusters on experimental data.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 4: Achieving intra-class compactness and inter-class separability using negative dataset $\mathcal { D } _ { n }$
|
| 56 |
+
|
| 57 |
+
A distribution without forming a new domain by themselves. This rules out the use of Mixup (Zhang et al., 2018a) or adversarial noise (Shu et al., 2018) as negative samples in this scenario. Thus, we propose the following two ways to synthesize the desired negative source dataset.
|
| 58 |
+
|
| 59 |
+
a) Image-composition as negative dataset $\mathcal { D } _ { n } ^ { ( a ) }$ . One of the key characteristics shared between the samples from source and unknown target domain is the semantics of the local part-related features specifically for image-based object recognition tasks. Relying on this assumption, we propose a systematic procedure to simulate the samples of $\mathcal { D } _ { n } ^ { ( a ) }$ by randomly compositing local regions between a pair of images drawn from the positive source dataset $\mathcal { D } _ { s }$ (see Fig. 3A and appendix, Algo. 2). Intuitively, composite samples $x _ { n }$ created on image pairs from different source categories are expected to lie in-between the two positive source clusters in the latent space, thereby introducing a combinatorial amount of new class labels i.e. $| \mathcal { C } _ { n } | = | \mathcal { C } _ { s } | _ { C _ { 2 } }$ .
|
| 60 |
+
|
| 61 |
+
b) Latent-simulated negative dataset $\mathcal { D } _ { n } ^ { ( b ) }$ . As an alternative approach, in the absence of domain knowledge (e.g. non-image datasets, or for tasks beyond image-recognition such as pose estimation), we propose to sample virtual negative instances, $u _ { n }$ from the latent space which are away from the high confidence regions (3-sigma) of positive source clusters (Fig. 4B). For each negative sample, we assign a negative class label (one of $| { \mathcal { C } } _ { n } | = | { \mathcal { C } } _ { s } | _ { C _ { 2 } ) }$ corresponding to the pair of most confident source classes predicted by the classifier. Thus, we obtain $\mathcal { D } _ { n } ^ { ( b ) } = \{ ( u _ { n } , y _ { n } ) : u _ { n } \sim p _ { n } ^ { u }$ , $y _ { n } \in { \mathcal { C } } _ { n } \}$ where $p _ { n } ^ { u }$ is the distribution of negative samples in the latent $u$ -space (more details in appendix Algo. 3).
|
| 62 |
+
|
| 63 |
+
Training procedure. The generative source classifier is divided into three stages; i) backbone-model $M$ , ii) feature extractor $F _ { s }$ , and iii) classifier $D$ (see Fig. 3B). Output of the backbone-model is denoted as $v = M ( x )$ , where $x$ is drawn from either $\mathcal { D } _ { s }$ or $\mathcal { D } _ { n }$ . Following this, the output of $F _ { s }$ and $D$ are represented as $u$ and $d$ respectively. $D$ outputs a $K$ -dimensional logit denoted as $d ^ { ( k ) }$ for $k = 1 , 2 . . . K$ ; $K = | \mathcal C _ { s } | + | \mathcal C _ { n } |$ . The individual class probabilities, $\hat { y } ^ { ( k ) }$ are obtained by applying softmax over the logits i.e. $\begin{array} { r } { \hat { y } ^ { ( k ) } = e x p ( d ^ { ( k ) } ) / \sum _ { k = 1 } ^ { K } e x p ( d ^ { ( k ) } ) = \sigma ^ { ( k ) } ( D \circ F _ { s } \circ M ( x ) ) . } \end{array}$ Additionally, we define priors of only positive source classes as $P ( u _ { s } | c _ { i } ) = \mathcal { N } ( u _ { s } | \mu _ { c _ { i } } , \Sigma _ { c _ { i } } )$ for $i = 1 , 2 . . . | \mathcal { C } _ { s } |$ at
|
| 64 |
+
|
| 65 |
+
# Algorithm 1 Training algorithm in the Procurement stage
|
| 66 |
+
|
| 67 |
+
1: input: $( x _ { s } , y _ { s } ) \in \mathcal { D } _ { s }$ , $( x _ { n } , y _ { n } ) \in \mathcal { D } _ { n }$ ; $\theta _ { F _ { s } }$ , $\theta _ { D }$ , $\theta _ { G }$ : Parameters of $F _ { s }$ , $D$ and $G$ respectively.
|
| 68 |
+
2: initialization: pretrain $\{ \theta _ { F _ { s } } , \theta _ { D } \}$ using cross-entropy loss on $( x _ { s } , y _ { s } )$ followed by initialization of the sample mean $\mu _ { c _ { i } }$ and covariance $\Sigma _ { c _ { i } }$ (at $u$ -space) of $F _ { s } \circ M ( x _ { s } )$ for $x _ { s }$ from class $c _ { i }$ ; $i = 1 , 2 , \dots | \mathcal { C } _ { s } |$
|
| 69 |
+
3: for iter < MaxIter do
|
| 70 |
+
4: $v _ { s } = M ( x _ { s } )$ ; $u _ { s } = F _ { s } ( v _ { s } )$ ; $\hat { v } _ { s } = G ( u _ { s } )$ ; $\boldsymbol { u } _ { r } \sim \mathcal { N } ( \mu _ { c _ { i } } , \Sigma _ { c _ { i } } )$ for $i = 1 , 2 , \dots | \mathcal { C } _ { s } |$ ; $\hat { u } _ { r } = F _ { s } \circ G ( u _ { r } )$
|
| 71 |
+
5: $\hat { y } _ { s } ^ { ( k _ { s } ) } = \sigma ^ { ( k _ { s } ) } ( D \circ F _ { s } \circ M ( x _ { s } ) )$ , and $\hat { y } _ { n } ^ { ( k _ { n } ) } = \sigma ^ { ( k _ { n } ) } ( D \circ F _ { s } \circ M ( x _ { n } ) )$ where $k _ { s }$ and $k _ { n }$ are the index of ground-truth label $y _ { s }$ and $y _ { n }$ respectively.
|
| 72 |
+
6: $\mathcal { L } _ { C E } = - \log \hat { y } _ { s } ^ { ( k _ { s } ) } - \alpha \log \hat { y } _ { n } ^ { ( k _ { n } ) }$ ; $\mathcal { L } _ { v } = | v _ { s } - \hat { v } _ { s } |$ ; $\mathcal { L } _ { u } = | u _ { r } - \hat { u } _ { r } |$
|
| 73 |
+
7: $\begin{array} { r } { \mathcal { L } _ { p } = - \log ( \exp ( P ( u _ { s } | c _ { k _ { s } } ) ) / \sum _ { i = 1 } ^ { | \mathcal { C } _ { s } | } \exp ( P ( u _ { s } | c _ { i } ) ) ) } \end{array}$ , where $P ( u _ { s } | c _ { i } ) = \mathcal { N } ( u _ { s } | \mu _ { c _ { i } } , \Sigma _ { c _ { i } } )$
|
| 74 |
+
8: Update $\theta _ { F _ { s } }$ , $\theta _ { D }$ , $\theta _ { G }$ by minimizing $\mathcal { L } _ { C E } , \mathcal { L } _ { v } , $ $\mathcal { L } _ { u }$ , and $\mathcal { L } _ { p }$ alternatively using separate optimizers.
|
| 75 |
+
9: if $( i t e r \ \% \ U p d a t e I t e r = = 0 )$ ) then
|
| 76 |
+
10: Recompute the sample mean $( \mu _ { c _ { i } } )$ and covariance $\left( \Sigma _ { c _ { i } } \right)$ of $F _ { s } \circ M ( x _ { s } )$ for $x _ { s }$ from class $c _ { i }$ ; $i = 1 , 2 . . . | \mathcal { C } _ { s } |$ (For $\mathcal { D } _ { n } ^ { ( b ) }$ : generate fresh latent-simulated negative samples using the updated priors)
|
| 77 |
+
|
| 78 |
+
the intermediate embedding $u _ { s } = F _ { s } \circ M ( x _ { s } )$ . Here, parameters of the normal distributions are computed during training as shown in line-10 of Algo. 1. A cross-entropy loss over these prior distributions is defined as ${ \mathcal { L } } _ { p }$ (line-7 in Algo. 1), to effectively enforce intra-class compactness with inter-class separability (progression from Fig. 4B to 4C). Motivated by generative variational auto-encoder (VAE) setup (Kingma & Welling, 2013), we introduce a feature decoder $G$ , which aims to minimize the cyclic reconstruction loss selectively for the samples from positive source categories $v _ { s }$ and randomly drawn samples $u _ { r }$ from the corresponding class priors (i.e. $\mathcal { L } _ { v }$ and $\mathcal { L } _ { u }$ , line-6 in Algo. 1). This along with a lower weightage $\alpha$ for the negative source categories (i.e. at the cross-entropy loss $\mathcal { L } _ { C E }$ , line-6 in Algo. 1) is incorporated to deliberately bias $F _ { s }$ towards the positive source samples, considering the level of unreliability of the generated negative dataset.
|
| 79 |
+
|
| 80 |
+
# 3.2 LEARNING IN THE DEPLOYMENT STAGE
|
| 81 |
+
|
| 82 |
+
3.2.1 Challenges. We hypothesize that, the large number of negative source categories along with the positive source classes i.e. $\mathcal { C } _ { s } \cup \mathcal { C } _ { n }$ can be interpreted as a universal source dataset, which can subsume label-set $\mathcal { C } _ { t }$ of a wide range of target domains. Moreover, we seek to realize a unified adaptation algorithm, which can work for a wide range of category-gaps. However, a forceful adaptation of target samples to positive source categories will cause target private samples to be classified as an instance of the source private or the common label-set, instead of being classified as "unknown", i.e. one of the negative categories in ${ \mathcal { C } } _ { n }$ .
|
| 83 |
+
|
| 84 |
+
3.2.2 Solution. In contrast to domain agnostic architectures (You et al., 2019; Cao et al., 2018a; Saito et al., 2018a), we resort to an architecture supporting domain specific features (Tzeng et al., 2017), as we must avoid disturbing the placement of source clusters obtained from the Procurement stage. This is an essential requirement to retain the task-dependent knowledge gathered from the source dataset. Thus, we introduce a domain specific feature extractor denoted as $F _ { t }$ , whose parameters are initialized from the fully trained $F _ { s }$ (see Fig. 3B). Further, we aim to exploit the learned generative classifier from the Procurement stage to complement for the purpose of separate ad-hoc networks (critic or discriminator) as utilized by the prior works (You et al., 2019; Cao et al., 2018b).
|
| 85 |
+
|
| 86 |
+
a) Source Similarity Metric (SSM). We define a weighting factor (SSM) for each target sample $x _ { t }$ , as $w ( x _ { t } )$ . A higher value of this metric indicates $x _ { t }$ ’s similarity towards the positive source categories, specifically inclined towards the common label space $\mathcal { C }$ . Similarly, a lower value of this metric indicates $x _ { t }$ ’s similarity towards the negative source categories ${ \mathcal { C } } _ { n }$ , showing its inclination towards the private target labels $\overline { { \mathcal { C } } } _ { t }$ . Let, $p _ { \bar { s } } , q _ { \bar { t } }$ be the distribution of source and target samples with labels in $\overline { { \mathcal { C } } } _ { s }$ and $\overline { { \mathcal { C } } } _ { t }$ respectively. We define, $p _ { c }$ and $q _ { c }$ to denote the distribution of samples from source and target domains belonging to the shared label-set $\mathcal { C }$ . Then, the SSM for the positive and negative source samples should lie on the two extremes, forming the following inequality:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { \mathbb { E } _ { x _ { n } \sim p _ { n } } w ( x _ { n } ) \approx \mathbb { E } _ { x _ { t } \sim q _ { \bar { t } } } w ( x _ { t } ) \ < \mathbb { E } _ { x _ { t } \sim q _ { c } } w ( x _ { t } ) < \mathbb { E } _ { x _ { s } \sim p _ { c } } w ( x _ { s } ) \approx \mathbb { E } _ { x _ { s } \sim p _ { \bar { s } } } w ( x _ { s } ) } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
To formalize the SSM criterion we rely on the class probabilities defined at the output of source model only for the positive class labels, i.e. $\hat { y } ^ { ( k ) }$ for $k = 1 , 2 . . . | \mathcal { C } _ { s } |$ . Note that, $\hat { y } ^ { ( k ) }$ is obtained by performing softmax over $\left| \mathcal { C } _ { s } \right| + \left| \mathcal { C } _ { n } \right|$ categories as discussed in the Procurement stage. Finally, the
|
| 93 |
+
|
| 94 |
+
SSM and its complement are defined as,
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
w ( x _ { t } ) = \operatorname* { m a x } _ { i = 1 , 2 \ldots | \mathcal { C } _ { s } | } \exp ( \hat { y } ^ { ( i ) } ) , \ a n d \ w ^ { \prime } ( x _ { t } ) = \operatorname* { m a x } _ { i = 1 , 2 \ldots | \mathcal { C } _ { s } | } \exp ( 1 - \hat { y } ^ { ( i ) } )
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
We hypothesize that, the above definition will satisfy Eq. 1, as a result of the generative learning strategy adopted in the Procurement stage. In Eq. 2 the exponent is used to further amplify separation between target samples from the shared $\mathcal { C }$ and those from the private $\overline { { \mathcal { C } } } _ { t }$ label-set (see Fig. 5A).
|
| 101 |
+
|
| 102 |
+
b) Source-free domain adaptation. To perform domain adaptation, the objective function aims to move the target samples with higher SSM value towards the clusters of positive source categories and vice-versa at the frozen source embedding, $u$ -space (from the Procurement stage). To achieve this, parameters of only $F _ { t }$ network are allowed to be trained in the Deployment stage. However, the decision of weighting the loss on target samples towards the positive or negative source clusters is computed using the source feature extractor $F _ { s }$ i.e. the SSM in Eq. 2. We define, the deployment model as $h = \bar { D } \circ F _ { t } \circ M ( x _ { t } )$ using the target feature extractor, with softmax predictions over $K$ categories obtained as $\hat { z } ^ { ( k ) } = \sigma ( h ^ { ( k ) } )$ . Thus, the primary loss function for adaptation is defined as,
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r } { \mathcal { L } _ { d 1 } = - w ( x _ { t } ) \log ( \sum _ { k = 1 } ^ { | \mathcal { C } _ { s } | } \hat { z } ^ { ( k ) } ) - w ^ { \prime } ( x _ { t } ) \log ( \sum _ { k = 1 + | \mathcal { C } _ { s } | } ^ { | \mathcal { C } _ { s } | + | \mathcal { C } _ { n } | } \hat { z } ^ { ( k ) } ) } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Additionally, in the absence of label information, there would be uncertainty in the predictions $\hat { z } ^ { ( k ) }$ as a result of distributed class probabilities. This leads to a higher entropy for such samples. Entropy minimization (Grandvalet & Bengio, 2005; Long et al., 2016) is adopted in such scenarios to move the target samples close to the highly confident regions (i.e. positive and negative cluster centers from the Procurement stage) of the classifier’s feature space. However, it has to be done separately for positive and negative source categories based on the SSM values of individual target samples to effectively distinguish the target-private set from the full target dataset. To achieve this, we define two different class probability vectors separately for the positive and negative source classes denoted as, $\begin{array} { r } { \tilde { z } _ { s } ^ { ( i ) } = \exp ( h ^ { ( i ) } ) / { \sum _ { j = 1 } ^ { | \mathcal { C } _ { s } | } } \exp ( h ^ { ( j ) } ) } \end{array}$ and $\tilde { z } _ { n } ^ { ( i ) } = \exp ( h ^ { ( i + | \mathcal { C } _ { s } | ) } ) / { \sum _ { j = 1 } ^ { | \mathcal { C } _ { n } | } \exp ( h ^ { ( j + | \mathcal { C } _ { s } | ) } ) }$ respectively (see Fig. 3B). Entropy of the target samples in the positive and negative regimes of the source classifier is obtained as $\begin{array} { r } { \bar { H } _ { s } ( x _ { t } ) = - \sum _ { i = 1 } ^ { | \mathcal { C } _ { s } | } \tilde { z } _ { s } ^ { ( i ) } \log \tilde { z } _ { s } ^ { ( i ) } } \end{array}$ and $\begin{array} { r } { H _ { n } ( x _ { t } ) { \bf \bar { \Psi } } = - \sum _ { i = 1 } ^ { \vert { \mathcal C } _ { n } \vert } \tilde { z } _ { n } ^ { ( i ) } \log \tilde { z } _ { n } ^ { ( i ) } } \end{array}$ respectively. Consequently, the entropy minimization loss is formalized as,
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r } { \mathcal { L } _ { d 2 } = w ( x _ { t } ) H _ { s } ( x _ { t } ) + w ^ { \prime } ( x _ { t } ) H _ { n } ( x _ { t } ) } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Thus, the final loss function for adapting the parameters of $F _ { t }$ is presented as $\mathcal { L } _ { d } = \mathcal { L } _ { d 1 } + \beta \mathcal { L } _ { d 2 }$ .
|
| 115 |
+
Here $\beta$ is a hyper-parameter controlling the importance of entropy minimization during adaptation.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
We perform a thorough evaluation of the proposed source-free, universal domain adaptation framework against prior state-of-the-art models across multiple datasets. We also provide a comprehensive ablation study to establish generalizability of the approach across a variety of label-set relationships and justification of the various model components.
|
| 120 |
+
|
| 121 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 122 |
+
|
| 123 |
+
Datasets. For all the following datasets, we resort to the experimental settings inline with the recent work by You et al. (2019) (UAN). Office-Home (Venkateswara et al., 2017) dataset consists of images from 4 different domains - Artistic $( \mathbf { A r } )$ , Clip-art (Cl), Product $( \mathbf { P r } )$ and Real-world $( \mathbf { R } \mathbf { w } )$ . Alphabetically, the first 10 classes are selected as $\mathcal { C }$ , the next 5 classes as $\overline { { \mathcal { C } } } _ { s }$ , and the rest 50 as $\overline { { \mathcal { C } } } _ { t }$ . VisDA2017 (Peng et al., 2018) dataset comprises of 12 categories with synthetic images as the source domain and natural images as the target domain, out of which, the first 6 are chosen as $\mathcal { C }$ , the next 3 as $\overline { { \mathcal { C } } } _ { s }$ and the rest as $\overrightarrow { \mathcal { C } } _ { t }$ . Office-31 (Saenko et al., 2010) dataset contains images from 3 distinct domains - Amazon (A), DSLR $\mathbf { \eta } ^ { ( \mathbf { D } ) }$ and Webcam $( \mathbf { W } )$ . We use the 10 classes shared by Office-31 and Caltech-256 (Gong et al., 2012) to construct the shared label-set $\mathcal { C }$ and alphabetically select the next 10 as $\overline { { \mathcal { C } } } _ { s }$ , with the remaining 11 classes contributing to $\overline { { \mathcal { C } } } _ { t }$ . To evaluate scalability, ImageNet-Caltech is also considered with 84 common classes inline with the setting in You et al. (2019).
|
| 124 |
+
|
| 125 |
+
Simulation of labeled negative samples. To simulate negative labeled samples for training in the Procurement stage, we first sample a pair of images, each from different categories of $\mathcal { C } _ { s }$ , to create unique negative classes in ${ \mathcal { C } } _ { n }$ . Note that, we impose no restriction on how the hypothetical classes are created (e.g. one can composite non-animal with animal). A random mask is defined which splits the images into two complementary regions using a quadratic spline passing through a central image region (see Appendix Algo. 2). Then, the negative image is created by merging alternate mask regions as shown in Fig. 3A. For the $\mathbf { I } { \xrightarrow { } } \mathbf { C }$ task of ImageNet-Caltech, the source domain (ImageNet), consisting of 1000 classes, results in a large number of possible negative classes (i.e. $| \mathcal { C } _ { n } | = | \bar { C } _ { s } | _ { C _ { 2 } } )$ . We address this by randomly selecting only 600 of these negative classes for ImageNet(I), and 200 negative classes for Caltech(C) in the task $\mathbf { C } { \xrightarrow { } } \mathbf { I } .$ In a similar fashion, we generate latent-simulated negative samples only for the selected negative classes in these datasets. Consequently, we compare two models with different Procurement stage training - (i) USFDA-a: using image-composition as negative dataset , and (ii) USFDA-b: using latent-simulated negative samples as the negative dataset. We use USFDA- $a$ for most of our ablation experiments unless mentioned explicitly.
|
| 126 |
+
|
| 127 |
+
Table 1: Average per-class accuracy $( \mathcal { T } _ { a v g } )$ for universal-DA tasks on Office-Home dataset (with $| C | / | \mathcal { C } _ { s } \cup \mathcal { C } _ { t } | = 0 . \bar { 1 } 5 )$ . Scores for the prior works are directly taken from UAN (You et al., 2019).
|
| 128 |
+
|
| 129 |
+
<table><tr><td rowspan="2">Method</td><td colspan="10">Office-Home Ar→Cl Ar-→Pr Ar-→RwCl→Ar Cl-→PrCl-→RwPr-→Ar Pr-→Cl Pr-→RwRw→Ar Rw-→Cl Rw-→Pr</td><td colspan="4"></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>Avg</td></tr><tr><td>ResNet (He etal.,2016)</td><td>59.37</td><td>76.58</td><td>87.48</td><td>69.86</td><td>71.11</td><td>81.66</td><td></td><td>73.72</td><td>56.30</td><td>86.07</td><td>78.68</td><td>59.22</td><td>78.59</td><td>73.22</td></tr><tr><td>IWAN (Zhang et al., 2018b)</td><td>52.55</td><td>81.40</td><td>86.51</td><td>70.58</td><td>70.99</td><td>85.29</td><td>74.88</td><td></td><td>57.33</td><td>85.07</td><td>77.48</td><td>59.65</td><td>78.91</td><td>73.39</td></tr><tr><td>PADA (Zhang et al., 2018b)</td><td>39.58</td><td>69.37</td><td>76.26</td><td>62.57</td><td>67.39</td><td>77.47</td><td>48.39</td><td></td><td>35.79</td><td>79.60</td><td>75.94</td><td>44.50</td><td>78.10</td><td>62.91</td></tr><tr><td>ATI (Busto et al., 2017)</td><td>52.90</td><td>80.37</td><td>85.91</td><td>71.08</td><td>72.41</td><td>84.39</td><td>74.28</td><td></td><td>57.84</td><td>85.61</td><td>76.06</td><td>60.17</td><td>78.42</td><td>73.29</td></tr><tr><td>OSBP (Saito et al.,2018b)</td><td>47.75</td><td>60.90</td><td>76.78</td><td>59.23</td><td>61.58</td><td>74.33</td><td>61.67</td><td></td><td>44.50</td><td>79.31</td><td>70.59</td><td>54.95</td><td>75.18</td><td>63.90</td></tr><tr><td>UAN (You et al., 2019)</td><td>63.00</td><td>82.83</td><td>87.85</td><td>76.88</td><td>78.70</td><td>85.36</td><td>78.22</td><td></td><td>58.59</td><td>86.80</td><td>83.37</td><td>63.17</td><td>79.43</td><td>77.02</td></tr><tr><td colspan="10">Source-free adaptation</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Ours USFDA-a</td><td>63.35</td><td>83.30</td><td>89.35</td><td>70.96</td><td>72.34</td><td>86.09</td><td>78.53</td><td>60.15</td><td></td><td>87.35</td><td>81.56</td><td>63.17</td><td>88.23</td><td>77.03</td></tr><tr><td>Ours USFDA-b</td><td>62.46</td><td>82.71</td><td>88.26</td><td>71.10</td><td>70.88</td><td>85.75</td><td>78.21</td><td>59.18</td><td></td><td>86.05</td><td>82.17</td><td>63.22</td><td>87.68</td><td>76.47</td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 4.2 EVALUATION METHODOLOGY
|
| 132 |
+
|
| 133 |
+
Average accuracy on Target dataset, $\mathcal { T } _ { a v g }$ . We resort to the evaluation protocol proposed in the VisDA2018 Open-Set Classification challenge. Accordingly, all the target private classes are grouped into a single "unknown" class and the metric reports the average of per-class accuracy over $| \mathcal { C } _ { s } | + 1$ classes. In the proposed framework a target sample is marked as "unknown", if it is classified $( a r g m a x _ { k } \hat { z } ^ { ( k ) } )$ into any of the negative $| { \mathcal { C } } _ { n } |$ classes out of total $\left| \mathcal { C } _ { s } \right| + \left| \mathcal { C } _ { n } \right|$ categories. In contrast, UAN (You et al., 2019) relies on a sensitive hyperparameter, as a threshold on the sample-level weighting, to mark a target sample as "unknown". Also note that, our method is completely source-free during the Deployment stage, while all other methods have access to the full source-data.
|
| 134 |
+
|
| 135 |
+
Accuracy on Target-Unknown data, $\mathcal { T } _ { u n k }$ . We evaluate the target unknown accuracy, $\mathcal { T } _ { u n k }$ , as the proportion of actual target private samples (i.e. $\{ ( x _ { t } , y _ { t } ) : y _ { t } \in \hat { \mathcal { C } } _ { t } \}$ ) being classified as "unknown" after adaptation. Note that, UAN (You et al., 2019) does not report $\mathcal { T } _ { u n k }$ which is a crucial metric to evaluate the vulnerability of the model after its deployment in the target environment. The $\tau _ { a v g }$ metric fails to capture this as a result of class-imbalance in the Open-set scenario (Saito et al., 2018b). Hence, to realize a common evaluation ground, we train the UAN implementation provided by the authors (You et al., 2019) and denote it as $\mathrm { U A N ^ { \ast } }$ in further sections of this paper. We observe that, the UAN(You et al., 2019) training algorithm is often unstable with a decreasing trend of $\mathcal { T } _ { u n k }$ and $\mathcal { T } _ { a v g }$ over increasing training iterations. We thus report the mean and standard deviation of the peak values of $\mathcal { T } _ { u n k }$ and $\mathcal { T } _ { a v g }$ achieved by $\mathrm { U A N ^ { * } }$ , over 5 separate runs on Office-31 dataset (see Table 7).
|
| 136 |
+
|
| 137 |
+
Implementation Details. We implement our network in PyTorch and use ResNet-50 (He et al., 2016) as the backbone-model $M$ , pre-trained on ImageNet (Russakovsky et al., 2015) inline with UAN (You et al., 2019). The complete architecture of other components with fully-connected layers is provided in the Supplementary. A sensitivity analysis of the major hyper-parameters used in the proposed framework is provided in Fig. 5B-C, and Appendix Fig. 8B. In all our ablations across the datasets, we fix the hyperparameters values as $\alpha = 0 . 2$ and $\beta = 0 . 1$ . We utilize Adam optimizer (Kingma & Ba, 2014) with a fixed learning rate of 0.0001 for training in both Procurement and Deployment stage (see Appendix for the code). For the implementation of $\mathrm { U A N ^ { \ast } }$ , we use the hyper-parameter value $w _ { 0 } = - 0 . 5$ , as specified by the authors for the task $\mathbf { A } { \to } \mathbf { D }$ in Office-31 dataset.
|
| 138 |
+
|
| 139 |
+
# 4.3 DISCUSSION
|
| 140 |
+
|
| 141 |
+
a) Comparison with prior arts. We compare our approach with UAN You et al. (2019), and other prior methods. The results are presented in Table 1 and Table 2. Clearly, our framework achieves stateof-the-art results even in a source-free setting on several tasks. Particularly in Table 2, we present the target-unknown accuracy $\mathcal { T } _ { u n k }$ on various dataset. It also holds the mean and standard-deviation for both the accuracy metrics computed over 5 random initializations in the Office-31 dataset (the last six rows). Our method is able to achieve much higher $\mathcal { T } _ { u n k }$ than $\mathrm { U A N ^ { * } }$ (You et al., 2019), highlighting our superiority as a result of the novel learning approach incorporated in both Procurement and Deployment stages. Note that, both USFDA-a and USFDA- $^ { b }$ yield similar performance across a wide range of standard benchmarks. We also perform a characteristic comparison of algorithm complexity in terms of the amount of learnable parameters and training time. In contrast to UAN, the proposed framework offers a much simpler adaptation algorithm devoid of utilization of ad-hoc networks like adversarial discriminator and additional finetuning of the ResNet-50 backbone. Parameter size and training time; a) Ours procurement (USFDA-a): [11.1M, 380s], b) Ours deployment: [3.5M, 44s], c) UAN (You et al., 2019): [26.7M, 450s] (in a consistent setting). The significant computational advantage in the Deployment stage makes USFDA highly suitable for real-time adaptation.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 5: Ablative analysis on the task $\mathbf { A } { \to } \mathbf { D }$ in Office-31 dataset. A) Histogram of SSM values of $x _ { t }$ separately for target-private and target-shared samples at the Procurement iteration 100 (top) and 500 (bottom). B) The sensitivity curve for $\beta$ shows marginally stable adaptation accuracy for a wide-range of values. C) A marginal increase in $\mathcal { T } _ { a v g }$ is observed with increase in $| { \mathcal { C } } _ { n } |$ .
|
| 145 |
+
|
| 146 |
+
b) Does SSM satisfy the expected inequality? Effectiveness of the proposed learning algorithm, in case of source-free deployment, relies on the formulation of SSM, which is expected to satisfy Eq. 1. Fig. 5A shows a histogram of the SSM separately for samples from target-shared (blue) and target-private (red) label space. The success of this metric is attributed to the generative nature of Procurement stage, which enables the source model to distinguish between the marginally more negative target-private samples as compared to the samples from the shared label space.
|
| 147 |
+
|
| 148 |
+
c) Sensitivity to hyper-parameters. As we tackle DA in a source-free setting simultaneously intending to generalize across varied category-gaps, a low sensitivity to hyperparameters would further enhance our practical usability. To this end, we fix certain hyperparameters for all our ablations (also in Fig. 6C) even across datasets (i.e. $\alpha = 0 . 2$ , $\beta = 0 . 1$ ). Thus, one can treat them as global-constants with $| { \mathcal { C } } _ { n } |$ being the only hyperparameter, as variations in one by fixing the others yield complementary effect on regularization in the Procurement stage. A thorough analysis reported in the appendix Fig. 8, clearly demonstrates the low-sensitivity of our model to these hyperparameters.
|
| 149 |
+
|
| 150 |
+
d) Generalization across category-gap. One of the key objectives of the proposed framework is to effectively operate in the absence of the knowledge of label-set relationships. To evaluate it in the most compelling manner, we propose a tabular form shown in Fig. 6A. We vary the number of private classes for target and source along $\mathbf { X }$ and y axis respectively, with a fixed $| \mathcal { C } _ { s } \cup \mathcal { C } _ { t } | = 3 1$ . We compare the $\mathcal { T } _ { a v g }$ metric at the corresponding table instances, shown in Fig. 6B-C. The results clearly highlight superiority of the proposed framework specifically for the more practical scenarios (close to the diagonal instances) as compared to the unrealistic Closed-set setting ( $| \overline { { \mathcal { C } } } _ { s } | = | \overline { { \mathcal { C } } } _ { t } | = 0 .$ ).
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 6: Comparison across varied label-set relationships for the task $\mathbf { A } { \to } \mathbf { D }$ in Office-31 dataset. A) Visual representation of label-set relationships and $\mathcal { T } _ { a v g }$ at the corresponding instances for $\mathbf { B }$ ) $\mathrm { U A N ^ { * } }$ (You et al., 2019) and C) ours source-free model. Effectively, the direction along $\mathbf { X }$ -axis (blue horizontal arrow) characterizes increasing Open-set complexity. The direction along y-axis (red vertical arrow) shows increasing complexity of Partial DA scenario. The pink diagonal arrow denotes the effect of decreasing shared label space.
|
| 154 |
+
|
| 155 |
+
e) DA in absence of shared categories. In universal adaptation, we seek to transfer the knowledge of "class-separability criterion" obtained from the source domain to the deployed target environment. More concretely, it is attributed to the segregation of data samples based on some expected characteristics, such as classification of objects according to their pose, color, or shape etc. To quantify this, we consider an extreme case where $\mathcal { C } _ { s } \cap \mathcal { C } _ { t } = \emptyset$ $\mathbf { A } { } \mathbf { D }$ in Office-31 with $| \mathcal { C } _ { s } | = 1 5$ , $| \mathcal { C } _ { t } | = 1 6 $ ). Allowing access to a single labeled target sample from each category in $\overline { { \mathcal { C } } } _ { t } = \mathcal { C } _ { t }$ , we aim to obtain a one-shot recognition accuracy (assignment of cluster index or class label using the one-shot samples as the cluster center at $F _ { t } \circ M ( x _ { t } ) ) ,$ ) to quantify the above metric. We obtain $6 4 . 7 2 \%$ accuracy for the proposed framework as compared to $1 3 . 4 3 \%$ for $\mathrm { U A N ^ { * } }$ (You et al., 2019). This strongly validates our superior knowledge transfer capability as a result of the generative classifier with labeled negative samples complementing for the target-private categories.
|
| 156 |
+
|
| 157 |
+
f) Dependency on the simulated negative dataset. Conceding that a combinatorial amount of negative labels can be created, we evaluate the scalability of the proposed approach, by varying the number of negative classes in the Procurement stage by selecting 0, 4, 8, 64, 150 and 190 negative classes as reported in the $\mathrm { X }$ -axis of Fig. 5C. For the case of 0 negative classes, denoted as $| \mathcal { C } _ { n } | ^ { * } = 0$ in Fig. 5C, we synthetically generate random negative features at the intermediate level $u$ , which are at least 3-sigma away from each of the positive source priors $P ( u _ { s } | c _ { i } )$ . We then make use of these feature samples along with positive image samples, to train a $\left( | \mathcal { C } _ { s } | + 1 \right)$ class Procurement model with a single negative class. The results are reported in Fig. 5C on the $\mathbf { A } { \to } \mathbf { D }$ task of Office-31 dataset with category relationship inline with the setting in Table 7. We observe an acceptable drop in accuracy with decrease in number of negative classes, hence validating scalability of the approach for large-scale classification datasets (such as ImageNet). Similarly, we also evaluated our framework by combining three or more images to form such negative classes. An increasing number of negative classes $( { \breve { c _ { s } } } | _ { C _ { 3 } } > { | \mathscr { C } _ { s } | } _ { C _ { 2 } } )$ attains under-fitting on positive source categories (similar to Fig. 5C, where accuracy reduces beyond a certain limit because of over regularization).
|
| 158 |
+
|
| 159 |
+
# 5 CONCLUSION
|
| 160 |
+
|
| 161 |
+
We have introduced a novel source-free, universal domain adaptation framework, acknowledging practical domain adaptation scenarios devoid of any assumption on the source-target label-set relationship. In the proposed two-stage framework, learning in the Procurement stage is found to be highly crucial, as it aims to exploit the knowledge of class-separability in the most general form with enhanced robustness to out-of-distribution samples. Besides this, success in the Deployment stage is attributed to the well-designed learning objectives effectively utilizing the source similarity criterion. This work can be served as a pilot study towards learning efficient inheritable models in future.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Mahsa Baktashmotlagh, Masoud Faraki, Tom Drummond, and Mathieu Salzmann. Learning factorized representations for open-set domain adaptation. In International Conference on Learning Representations, 2019. 1
|
| 166 |
+
|
| 167 |
+
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, 2017. 2, 3
|
| 168 |
+
|
| 169 |
+
Zhangjie Cao, Mingsheng Long, Jianmin Wang, and Michael I Jordan. Partial transfer learning with selective adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018a. 1, 2, 5
|
| 170 |
+
|
| 171 |
+
Zhangjie Cao, Lijia Ma, Mingsheng Long, and Jianmin Wang. Partial adversarial domain adaptation In Proceedings of the European Conference on Computer Vision, 2018b. 1, 2, 5
|
| 172 |
+
|
| 173 |
+
Yi-Hsin Chen, Wei-Yu Chen, Yu-Ting Chen, Bo-Cheng Tsai, Yu-Chiang Frank Wang, and Min Sun. No more discrimination: Cross city adaptation of road scene segmenters. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 1
|
| 174 |
+
|
| 175 |
+
Lixin Duan, Ivor W Tsang, and Dong Xu. Domain transfer multiple kernel learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(3):465–479, 2012. 2
|
| 176 |
+
|
| 177 |
+
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, 17(1):2096–2030, 2016. 1
|
| 178 |
+
|
| 179 |
+
ZongYuan Ge, Sergey Demyanov, Zetao Chen, and Rahil Garnavi. Generative openmax for multiclass open set classification. arXiv preprint arXiv:1707.07418, 2017. 1
|
| 180 |
+
|
| 181 |
+
Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2012. 6
|
| 182 |
+
|
| 183 |
+
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. 2
|
| 184 |
+
|
| 185 |
+
Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In Advances in neural information processing systems, 2005. 6
|
| 186 |
+
|
| 187 |
+
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, 2016. 7, 8
|
| 188 |
+
|
| 189 |
+
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. In International Conference on Learning Representations, 2018. 2
|
| 190 |
+
|
| 191 |
+
Lanqing Hu, Meina Kan, Shiguang Shan, and Xilin Chen. Duplex generative adversarial network for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018. 2
|
| 192 |
+
|
| 193 |
+
Guoliang Kang, Liang Zheng, Yan Yan, and Yi Yang. Deep adversarial attention alignment for unsupervised domain adaptation: the benefit of target expectation maximization. In Proceedings of the European Conference on Computer Vision, 2018. 2
|
| 194 |
+
|
| 195 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 7
|
| 196 |
+
|
| 197 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 5
|
| 198 |
+
|
| 199 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, 2012. 1
|
| 200 |
+
|
| 201 |
+
Abhishek Kumar, Prasanna Sattigeri, Kahini Wadhawan, Leonid Karlinsky, Rogerio Feris, Bill Freeman, and Gregory Wornell. Co-regularized alignment for unsupervised domain adaptation. In Advances in neural information processing systems, 2018. 1
|
| 202 |
+
|
| 203 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In International Conference on Machine Learning, 2015. 1, 2, 17
|
| 204 |
+
|
| 205 |
+
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. In Advances in neural information processing systems, 2016. 1, 2, 6
|
| 206 |
+
|
| 207 |
+
Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. In Advances in neural information processing systems, 2018. 2, 17
|
| 208 |
+
|
| 209 |
+
Zelun Luo, Yuliang Zou, Judy Hoffman, and Li F Fei-Fei. Label efficient learning of transferable representations acrosss domains and tasks. In Advances in neural information processing systems, 2017. 2
|
| 210 |
+
|
| 211 |
+
Jogendra Nath Kundu, Phani Krishna Uppala, Anuj Pahuja, and R Venkatesh Babu. Adadepth: Unsupervised content congruent adaptation for depth estimation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018. 1, 2
|
| 212 |
+
|
| 213 |
+
Pau Panareda Busto and Juergen Gall. Open set domain adaptation. In Proceedings of the IEEE International Conference on Computer Vision, 2017. 2
|
| 214 |
+
|
| 215 |
+
Xingchao Peng, Ben Usman, Neela Kaushik, Judy Hoffman, Dequan Wang, and Kate Saenko. Visda: The visual domain adaptation challenge. 2018. 6
|
| 216 |
+
|
| 217 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, 2015. 1
|
| 218 |
+
|
| 219 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. 3, 7
|
| 220 |
+
|
| 221 |
+
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In Proceedings of the European Conference on Computer Vision, 2010. 2, 6, 16, 20
|
| 222 |
+
|
| 223 |
+
Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018a. 3, 5
|
| 224 |
+
|
| 225 |
+
Kuniaki Saito, Shohei Yamamoto, Yoshitaka Ushiku, and Tatsuya Harada. Open set domain adaptation by backpropagation. In Proceedings of the European Conference on Computer Vision, 2018b. 2, 7, 8
|
| 226 |
+
|
| 227 |
+
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. 3
|
| 228 |
+
|
| 229 |
+
Swami Sankaranarayanan, Yogesh Balaji, Carlos D Castillo, and Rama Chellappa. Generate to adapt: Aligning domains using generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018. 2, 3
|
| 230 |
+
|
| 231 |
+
Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of statistical planning and inference, 90(2):227–244, 2000. 1
|
| 232 |
+
|
| 233 |
+
Rui Shu, Hung Bui, Hirokazu Narui, and Stefano Ermon. A DIRT-t approach to unsupervised domain adaptation. In International Conference on Learning Representations, 2018. 4
|
| 234 |
+
|
| 235 |
+
Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains and tasks. In Proceedings of the IEEE International Conference on Computer Vision, 2015. 1
|
| 236 |
+
|
| 237 |
+
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, 2017. 1, 2, 3, 5, 17
|
| 238 |
+
|
| 239 |
+
Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2017. 6
|
| 240 |
+
|
| 241 |
+
Xuezhi Wang and Jeff Schneider. Flexible transfer learning under support and model shift. In Advances in neural information processing systems, 2014. 2
|
| 242 |
+
|
| 243 |
+
Zirui Wang, Zihang Dai, Barnabás Póczos, and Jaime Carbonell. Characterizing and avoiding negative transfer. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2019. 2
|
| 244 |
+
|
| 245 |
+
Kaichao You, Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I. Jordan. Universal domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, June 2019. 2, 5, 6, 7, 8, 9, 16, 17, 18, 19, 20
|
| 246 |
+
|
| 247 |
+
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018a. 4
|
| 248 |
+
|
| 249 |
+
Jing Zhang, Zewei Ding, Wanqing Li, and Philip Ogunbona. Importance weighted adversarial nets for partial domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018b. 1, 2, 7, 8
|
| 250 |
+
|
| 251 |
+
Kun Zhang, Bernhard Schölkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under target and conditional shift. In International Conference on Machine Learning, 2013. 2
|
| 252 |
+
|
| 253 |
+
Weichen Zhang, Wanli Ouyang, Wen Li, and Dong Xu. Collaborative and adversarial network for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2018c. 1
|
| 254 |
+
|
| 255 |
+
Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. 16
|
| 256 |
+
|
| 257 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, 2017. 2
|
| 258 |
+
|
| 259 |
+
# A APPENDIX
|
| 260 |
+
|
| 261 |
+
This appendix is organized as follows, • Implementation details – Procurement Stage. – Deployment Stage.
|
| 262 |
+
|
| 263 |
+
• Ablation Studies and Additional Results
|
| 264 |
+
|
| 265 |
+
– Pretraining the backbone network on Places instead of ImageNet.
|
| 266 |
+
– Space and Time Complexity Analysis.
|
| 267 |
+
– Varying label-set relationship.
|
| 268 |
+
– Sensitivity analysis.
|
| 269 |
+
– Closed-set adaptation.
|
| 270 |
+
– Accuracy on source dataset post Procurement.
|
| 271 |
+
– Incremental one-shot classification.
|
| 272 |
+
– Feature Space Visualization.
|
| 273 |
+
|
| 274 |
+
• Miscellaneous
|
| 275 |
+
|
| 276 |
+
– Specification of Computing Resources. – References to code
|
| 277 |
+
|
| 278 |
+
# B IMPLEMENTATION DETAILS
|
| 279 |
+
|
| 280 |
+
In this section, we describe the architecture and the training process used for the Procurement and Deployment stages of our approach.
|
| 281 |
+
|
| 282 |
+
# B.1 PROCUREMENT STAGE
|
| 283 |
+
|
| 284 |
+
a) Design of classifier $D$ used in the Procurement stage. Keeping in mind the possibility of an additional domain shift after performing adaptation (e.g. encountering domain W after performing the adaptation $\mathbf { A } \mathbf { D }$ in Office-31 dataset), we design the classifier’s architecture in a manner which allows for dynamic modification in the number of negative classes post-procurement. We achieve this by maintaining two separate classifiers during Procurement - $D _ { s r c }$ , that operates on the positive source classes, and, $D _ { n e g }$ that operates on the negative source classes (see architecture in Table 5). The final classification score is obtained by computing softmax over the concatenation of logit vectors produced by $D _ { s r c }$ and $D _ { n e g }$ . Therefore, the model can be retrained on a different number of negative classes post deployment (using another negative class classifier $D _ { n e g . } ^ { \prime }$ ), thus preparing it for a subsequent adaptation step to another domain.
|
| 285 |
+
|
| 286 |
+
b) Negative dataset generation. We propose two methods to generate negative samples for the Procurement stage, and name the models trained subsequently as USFDA-a and USFDA-b. Here, we describe the two processes:
|
| 287 |
+
|
| 288 |
+
• Using image-composition for $\mathcal { D } _ { n } ^ { ( a ) }$ (USFDA-a). In the presence of domain knowledge (knowledge of the task at hand, i.e. object recognition using images), we generate the negative dataset $\mathcal { D } _ { n } ^ { ( a ) }$ by compositing images taken from different classes, as described in Algo. 2. We generate random masks using quadratic splines passing through a central image region (lines 3-9). Using these masks, we merge alternate regions of the images, both horizontally and vertically, resulting in 4 negative images for each pair of images (lines 10-13). To effectively cover the inter-class negative region, we randomly sample image pairs from $D _ { s }$ belonging to different classes, however we do not impose any constraint on how the classes are selected (for e.g. one can composite images from an animal and a non-animal class). We choose 5000 pairs for tasks on Office-31, Office-Home and VisDA datasets, and 12000 for ImageNet-Caltech. Since the input source distribution $( p )$ is fixed we first synthesize a negative dataset offline (instead of creating them on the fly) to ensure finiteness of the training set. The training algorithm for USFDA-a is given in Algo. 1.
|
| 289 |
+
|
| 290 |
+
# Algorithm 2 Image-composition algorithm
|
| 291 |
+
|
| 292 |
+
. horizontal splicing . vertical splicing
|
| 293 |
+
|
| 294 |
+
1: input: Image pair $( I _ { 1 } , I _ { 2 } ) \in \mathcal { D } _ { s }$ . (image shape $H _ { \mathrm { X } } W _ { \mathrm { X } } 3 = 2 2 4 \mathrm { x } 2 2 4 \mathrm { x } 3 )$
|
| 295 |
+
2: $k \gets 3 0$
|
| 296 |
+
3: $x _ { 1 }$ , $x _ { 2 }$ , $y _ { 1 }$ , $y _ { 2 } \gets \mathrm { r a n d } ( 0 , W )$ , rand $( 0 , W )$ , rand $( 0 , H )$ , rand $( 0 , H )$
|
| 297 |
+
4: $c _ { x }$ , $c _ { y } \gets$ rand $( W / 2 - k , W / 2 + k )$ , ran $\mathrm { { 1 } } ( H / 2 - k / 3 , H / 2 + k / 3 )$
|
| 298 |
+
5: $d _ { x }$ , $d _ { y } \gets \mathrm { r a n d } ( W / 2 - k / 3 , W / 2 + k / 3 )$ , rand $( H / 2 - k , H / 2 + k )$
|
| 299 |
+
6: $s _ { 1 } $ quadratic_interpolation $( [ ( 0 , y _ { 1 } )$ , $\left( c _ { x } , c _ { y } \right)$ , (223, y2)])
|
| 300 |
+
7: $s _ { 2 } $ quadratic_interpolation $\iota ( [ ( x _ { 1 } , 0 ) , ( d _ { x } , d _ { y } ) , ( x _ { 2 } , 2 2 3 ) ] )$
|
| 301 |
+
8: $m _ { 1 } \gets$ mask region below $s _ { 1 }$
|
| 302 |
+
9: $m _ { 2 } \gets$ mask region to the left of $s _ { 2 }$
|
| 303 |
+
10: $I _ { a } \gets m _ { 1 } * I _ { 1 } + \left( 1 - m _ { 1 } \right) * I _ { 2 }$
|
| 304 |
+
11: $I _ { b } \gets m _ { 2 } * I _ { 1 } + ( 1 - m _ { 2 } ) * I _ { 2 }$
|
| 305 |
+
12: $I _ { c } \gets m _ { 1 } * I _ { 2 } + ( 1 - m _ { 1 } ) * I _ { 1 }$
|
| 306 |
+
13: $I _ { d } m _ { 2 } * I _ { 2 } + ( 1 - m _ { 2 } ) * I _ { 1 }$
|
| 307 |
+
14: return ${ l _ { a } , I _ { b } , I _ { c } , I _ { d } }$
|
| 308 |
+
|
| 309 |
+
# Algorithm 3 Dataset generation using latent-simulated negative samples
|
| 310 |
+
|
| 311 |
+
1: input: class-wise source priors $\mathcal { N } ( \mu _ { c _ { j } } , \Sigma _ { c _ { j } } )$ , global source prior $\mathcal { N } ( \boldsymbol { \mu } , \boldsymbol { \Sigma } )$ , number of required
|
| 312 |
+
samples $n$ , source classifier $D _ { s r c }$ . $| |$ signifies an Append Operation
|
| 313 |
+
2: $\tilde { \mathcal { U } } \gets \{ \} ; \tilde { \mathcal { V } } \gets \{ \}$
|
| 314 |
+
3: while $| { \tilde { \mathcal { U } } } | \leq n$ do
|
| 315 |
+
4: Let $\lambda _ { c _ { j } }$ and $l _ { c _ { j } }$ be the maximum eigen value and the corresponding eigen vector
|
| 316 |
+
of $\Sigma _ { c _ { j } }$ , for each class $c _ { j }$
|
| 317 |
+
5: $\tilde { u } _ { r } \sim \mathcal N ( \mu , \Sigma )$
|
| 318 |
+
6: if $P ( \tilde { u } _ { r } | c _ { j } ) < P ( \mu _ { c _ { j } } + 3 * \sqrt { \lambda _ { c _ { j } } } * l _ { c _ { j } } \mid c _ { j } )$ for all class $c _ { j }$ then
|
| 319 |
+
7: $\hat { y } \sigma ( D _ { s r c } ( \tilde { u } _ { r } ) )$
|
| 320 |
+
8: $\tilde { y } _ { r } \gets$ assign the negative class based on the top-2 confident classes in $\hat { y }$
|
| 321 |
+
9: $\mathcal { \tilde { U } } \mathcal { \tilde { U } } \| \mathcal { \bar { u } } _ { r } ; \mathcal { \tilde { y } } \mathcal { \tilde { y } } \| \tilde { y } _ { r }$
|
| 322 |
+
10: else
|
| 323 |
+
11: reject $\tilde { u } _ { r }$
|
| 324 |
+
12: return U˜, Y˜
|
| 325 |
+
|
| 326 |
+
• Using latent-simulated negative samples for $\mathcal { D } _ { n } ^ { ( b ) }$ (USFDA-b): Here, we perform rejection sampling as given in Algorithm 3. Here, we obtain a sample from the global source prior $P ( u _ { s } ) = \mathcal { N } ( u _ { s } | \boldsymbol { \mu } , \Sigma )$ , where $\mu$ and $\Sigma$ are the mean and covariance computed at $u$ -space over all the positive source image samples.We reject the sample if it lies within the 3-sigma bound of any class (i.e. we keep the sample if it is far away from all source class-priors, $\mathcal { N } ( \mu _ { c _ { i } } , \Sigma _ { c _ { i } } ) )$ , as shown in lines 6 to 11 in Algo. 3. A sample selected in this fashion is expected to lie in an intermediate region between the source class priors. The two classes in the vicinity of the sample are then determined by obtaining the two most confident class predictions given by the classifier $D _ { s r c }$ (lines 7 and 8). Using this pair of classes, we assign a unique negative class label to the sample which corresponds to the intermediate region between the pair of classes. Note, to learn the arrangement of positive and negative clusters, the feature extractor $F _ { s }$ must be trained using negative samples. We do this by passing the sampled latent-simulated negative instance $( \tilde { u } _ { r } )$ through the decoder-encoder pair, (i.e. $D \circ F _ { s } \circ { \cal G } ( \tilde { u } _ { r } ) )$ , and enforcing the cross-entropy loss to classify them into the respective negative class. The training algorithm for USFDA- $^ { b }$ is given in Algo. 4.
|
| 327 |
+
|
| 328 |
+
c) Justification of ${ \mathcal { L } } _ { p }$ . The cross-entropy loss on the likelihoods (referred as ${ \mathcal { L } } _ { p }$ in the paper) not only enforces intra-class compactness but also ensures inter-class separability in the embedding space, $u$ . Since the negative samples are only an approximation of future target private classes expected to be encountered during deployment, we choose not to employ this loss for them. Such a training procedure, eventually results in a natural development of bias towards the confident positive source classes. This subsequently leads to the placement of source clusters in a manner which enables source-free adaptation (See Fig. 4).
|
| 329 |
+
|
| 330 |
+
# Algorithm 4 Training algorithm for $U S F D A { - } b$ in the Procurement stage
|
| 331 |
+
|
| 332 |
+
1: input: $( x _ { s } , y _ { s } ) \in \mathcal { D } _ { s }$ ; $\theta _ { F _ { s } }$ , $\theta _ { D }$ , $\theta _ { G }$ : Parameters of $F _ { s }$ , $D$ and $G$ respectively.
|
| 333 |
+
2: initialization: pretrain $\{ \theta _ { F _ { s } } , \theta _ { D } \}$ using cross-entropy loss on $( x _ { s } , y _ { s } )$ , then, compute the sample mean $\mu _ { c _ { i } }$
|
| 334 |
+
and covariance $\Sigma _ { c _ { i } }$ of $F _ { s } \circ M ( x _ { s } )$ for $x _ { s }$ from class $c _ { i }$ , for $i = 1 , 2 , \dots | \mathcal { C } _ { s } |$
|
| 335 |
+
3: for iter < MaxIter do
|
| 336 |
+
4: $v _ { s } = M ( x _ { s } )$ ; $u _ { s } = F _ { s } ( v _ { s } )$ $; ~ { \hat { v } } _ { s } = G ( u _ { s } ) ; ~ u _ { r } \sim \mathcal { N } ( \mu _ { c _ { i } } , \Sigma _ { c _ { i } } ) { \mathrm { ~ f o r ~ } } i = 1 , 2 , . . . | \mathcal { C } _ { s } | ; ~ { \hat { u } } _ { r } = F _ { s } \circ G ( u _ { r } )$
|
| 337 |
+
5: (˜ur, y˜r) = sample latent-simulated negative instances from D(b)n
|
| 338 |
+
6: $\hat { y } _ { s } ^ { ( k _ { s } ) } = \sigma ^ { ( k _ { s } ) } ( D \circ F _ { s } \circ M ( x _ { s } ) )$ , and $\hat { y } _ { n } ^ { ( k _ { n } ) } = \sigma ^ { ( k _ { n } ) } ( D \circ F _ { s } \circ G ( \tilde { u } _ { r } ) )$ where $k _ { s }$ and $k _ { n }$ are the index
|
| 339 |
+
of ground-truth label $y _ { s }$ and $y _ { n }$ respectively, and $\sigma$ is the softmax activation.
|
| 340 |
+
7: $\mathcal { L } _ { C E } = - \log \hat { y } _ { s } ^ { ( k _ { s } ) } - \alpha \log \hat { y } _ { n } ^ { ( k _ { n } ) }$ g ˆy(kn)n ; Lv = |vs − vˆs|; Lu = |ur − uˆr|
|
| 341 |
+
8: $\begin{array} { r } { \mathcal { L } _ { p } = - \log ( \exp ( P ( u _ { s } | c _ { k _ { s } } ) ) / \sum _ { i = 1 } ^ { | \mathcal { C } _ { s } | } \exp ( P ( u _ { s } | c _ { i } ) ) ) } \end{array}$ , where $P ( u _ { s } | c _ { i } ) = \mathcal { N } ( u _ { s } | \mu _ { c _ { i } } , \Sigma _ { c _ { i } } )$
|
| 342 |
+
9: Update $\boldsymbol { \cdot } _ { F _ { s } } , \boldsymbol { \theta } _ { D } , \boldsymbol { \theta } _ { G }$ by minimizing $\mathcal { L } _ { C E } , \mathcal { L } _ { v } , \mathcal { L }$ $\mathcal { L } _ { u }$ , and $\mathcal { L } _ { p }$ alternatively using separate optimizers.
|
| 343 |
+
10: if $( i t e r \ \% \ U p d a t e I t e r = = 0 )$ then
|
| 344 |
+
11: Recompute $\mu _ { c _ { i } }$ , $\Sigma _ { c _ { i } }$ for each source class $c _ { i }$ ; Generate $\mathcal { D } _ { n } ^ { ( b ) }$ using the updated priors.
|
| 345 |
+
|
| 346 |
+
d) Minibatch negative sampling strategy. We create an unbiased batch of training samples for a training iteration by sampling equal number of positive and negative samples from the dataset. For USFDA-a we sample 32 positive images $( b _ { + v e } = 3 2 ^ { \cdot }$ ) and 32 negative images per training iteration $( b _ { - v e } = 3 2 )$ ). Similarly, for USFDA- $^ { b }$ we sample 32 positive images and 32 latent-simulated negative samples. This gives an effective batch size of $b _ { + v e } + b _ { - v e } = 6 4$ .
|
| 347 |
+
|
| 348 |
+
e) Use of multiple optimizers for training. In the presence of multiple loss terms, we subvert a time-consuming loss-weighting scheme search by making use of multiple Adam optimizers during training. Essentially, we define a separate optimizer for each loss term, and optimize only one of the losses (chosen in a round robin fashion) in each iteration of training. We use a learning rate of 0.0001 during training. Intuitively, the higher order moment parameters in the Adam optimizer adaptively scale the gradients as required by the loss landscape.
|
| 349 |
+
|
| 350 |
+
f) Label-Set Relationships. For Office-31 dataset in the UDA setting, we use the 10 classes shared by Office-31 and Caltech-256 as the shared label-set $\mathcal { C }$ . These classes are: back_pack, calculator, keyboard, monitor, mouse, mug, bike, laptop_computer, headphones, projector. From the remaining classes, in alphabetical order, we choose the first 10 classes as source-private $( \overline { { \mathcal { C } } } _ { s } )$ classes, and the rest 11 as target-private $( \overline { { \mathcal { C } } } _ { t } )$ classes. For VisDA, alphabetically, the first 6 classes are considered $\mathcal { C }$ , the next 3 as $\overline { { \boldsymbol { \mathcal { C } } } } _ { s }$ and the last 3 comprise $\overline { { \mathcal { C } } } _ { t }$ . The Office-Home dataset has 65 categories, of which we use the first 10 classes as $\mathcal { C }$ , the next 5 for $\overline { { \mathcal { C } } } _ { s }$ , and the rest 50 classes as $\overline { { \boldsymbol { \mathcal { C } } } } _ { t }$ .
|
| 351 |
+
|
| 352 |
+
# B.2 DEPLOYMENT STAGE
|
| 353 |
+
|
| 354 |
+
The details of the architecture used during the Deployment stage are given in Table 7. Note that the Feature Decoder $G$ used during the Procurement stage, is not available during the Deployment stage, restricting complete access to the source data.
|
| 355 |
+
|
| 356 |
+
Training during the Deployment stage. The only trainable component is the Feature Extractor $F _ { t }$ , which is initialized from $F _ { s }$ at Deployment. Here, the SSM is calculated by passing the target images through the network trained on source data (source model), i.e for each image $x _ { t }$ , we calculate $\hat { y } =$ $s o f t m a x ( D \circ F _ { s } \circ M ( x _ { t } ) )$ . Note that the softmax is calculated over all $\left| \mathcal { C } _ { s } \right| + \left| \mathcal { C } _ { n } \right|$ classes. This is done by concatenating the outputs of $D _ { s r c }$ and $D _ { n e g }$ , and then calculating softmax. Then, the SSM is determined by the exponential confidence of a target sample, where confidence is the highest softmax value in the categories in $| { \mathcal { C } } _ { s } |$ .
|
| 357 |
+
|
| 358 |
+
# C ABLATION STUDIES AND ADDITIONAL RESULTS
|
| 359 |
+
|
| 360 |
+
# C.1 PRETRAINING THE BACKBONE NETWORK ON PLACES INSTEAD OF IMAGENET.
|
| 361 |
+
|
| 362 |
+
We find that widely adopted standard domain adaptation datasets such as Office-31 and VisDA often share a part or all of their label-set with ImageNet. Therefore, to validate our method’s applicability when initialized from a network pretrained on an unrelated dataset, we attempt to solve the adaptation task $\mathbf { A } { \to } \mathbf { D }$ in Office-31 dataset by pretraining the ResNet-50 backbone on Places dataset (Zhou et al., 2017). In Table 3 it can be observed that our method outperforms even source-dependent methods (e.g. UAN (You et al., 2019), which is also initialized a ResNet-50 backbone pretrained on Places dataset). In contrast to our method, the algorithm in UAN involves ResNet-50 finetuning. Therefore, we also compare against a variant of UAN with a frozen backbone network, by inserting an additional feature extractor that operates on the features extracted from ResNet-50 (similar to $F _ { s }$ in the proposed method). The architecture of the feature extractor used for this variant of UAN is outlined in Table 6. We observe that our method significantly outperforms this variant of UAN with lesser number of trainable parameters (see Table 3).
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 7: Comparison of target-unknown accuracy $\mathcal { T } _ { u n k }$ across varied label-set relationships for the task $\mathbf { A } { \to } \mathbf { D }$ in Office-31 dataset. A) Visual representation of label-set relationships and $\mathcal { T } _ { u n k }$ at the corresponding instances for B) $\mathrm { U A N ^ { \ast } }$ (You et al., 2019) and C) ours source-free model. Effectively, the direction along $\mathbf { X }$ -axis (blue horizontal arrow) characterizes increasing Open-set complexity. The direction along y-axis (red vertical arrow) shows increasing complexity of Partial DA scenario. And the pink diagonal arrow denotes the effect of decreasing shared label space.
|
| 368 |
+
|
| 369 |
+
# C.2 SPACE AND TIME COMPLEXITY ANALYSIS.
|
| 370 |
+
|
| 371 |
+
On account of keeping the weights of the backbone network frozen throughout the training process, and devoid of ad-hoc networks such as adversarial discriminator our method makes use of significantly lesser trainable parameters when compared to previous methods such as UAN (See Table 3). Devoid of adversarial training, the proposed method also has a significantly lesser total training time for adaptation: 44 sec versus 280 sec in UAN (for the $\mathbf { A } { \to } \mathbf { D }$ task of Office-31 and batch size of 32). Therefore, the proposed framework offers a much simpler adaptation pipeline, with a superior time and space complexity and at the same time achieves state-of-the-art domain adaptation performance across different datasets, even without accessing labeled source data at the time of adaptation (See Table 3). This corroborates the superiority of our method in real-time deployment scenarios.
|
| 372 |
+
|
| 373 |
+
# C.3 VARYING LABEL-SET RELATIONSHIP
|
| 374 |
+
|
| 375 |
+
In addition to the $\mathcal { T } _ { a v g }$ reported in Fig. 6 in the paper, we also compare the target-unknown accuracy $\mathcal { T } _ { u n k }$ for $\mathrm { U A N ^ { * } }$ and our pipeline. The results are presented in Figure 7. Refer the link to the code provided in the submission for details of the chosen class labels for each adaptation scenario shown in Figure 7. Clearly, our method achieves a statistically significant improvement on most of the label-set relationships over UAN. This demonstrates the capability of our algorithm to detect outlier classes more efficiently than UAN, which can be attributed to the ingeniously developed Procurement stage.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Office-31, D→A 1.0 A = 10 = 10 Figure 8: A. Sensitivity against $| { \mathcal { C } } _ { n } |$ 0.9, represented by $| { \mathcal { C } } _ { n } | / | ^ { | { \mathcal { C } } _ { s } | } C _ { 2 }$ for varying $| \overline { { \mathcal { C } } } _ { s } |$ or $| \overline { { \mathcal { C } } } _ { t } |$ (see fig. 0.9 0.8legend) by fixing the others (top cyan box), across varied datasets. B. Sensitivity against $\alpha$ and 0.8 batch-size ratio (fixed $b _ { + v e } + b _ { - v e } = 6 4 )$ .7. Note the scale of X and Y-axis.
|
| 379 |
+
|
| 380 |
+
0.6 Table 4: Accuracy $( \% )$ 0.5 on unsupervised closed-set DA (all use ResNet50). Ours is w/o hyperparmeter 0.5 tuning. Refer Section C.5.
|
| 381 |
+
|
| 382 |
+
<table><tr><td rowspan="2">Closed-set DA methods</td><td rowspan="2">source- free</td><td rowspan="2">Universal- DA</td><td colspan="7">Office-31</td><td>VisDA</td></tr><tr><td>D→A</td><td>A→D</td><td>A→W</td><td>W→D</td><td>W→A</td><td>D→W</td><td>Avg.</td><td>S→R</td></tr><tr><td>DAN (ICML'15)</td><td>X</td><td>X</td><td>63.6</td><td>78.6</td><td>80.5</td><td>99.6</td><td>62.8</td><td>97.1</td><td>80.4</td><td>61.1</td></tr><tr><td>ADDA (CVPR'17)</td><td>X</td><td>X</td><td>69.5</td><td>77.8</td><td>86.2</td><td>98.4</td><td>68.9</td><td>96.2</td><td>82.8</td><td>-</td></tr><tr><td>CDAN (NeurIPS'18)</td><td>X</td><td>X</td><td>70.1</td><td>89.8</td><td>93.1</td><td>100</td><td>68.0</td><td>98.2</td><td>86.5</td><td>66.8</td></tr><tr><td>UAN (CVPR'19)</td><td></td><td></td><td>68.4</td><td>85.3</td><td>81.2</td><td>99.1</td><td>69.7</td><td>98.1</td><td>83.6</td><td>1</td></tr><tr><td>Ours USFDA-a (source-free)</td><td>X</td><td>V</td><td>70.4</td><td>85.4</td><td>81.6</td><td>98.0</td><td>69.4</td><td>98.4</td><td>83.9</td><td>59.8</td></tr></table>
|
| 383 |
+
|
| 384 |
+
# C.4 SENSITIVITY ANALYSIS
|
| 385 |
+
|
| 386 |
+
In all our experiments (across datasets as in Tables 1 and 2 and across varied label-set relationships as in Fig. 6), we fix the hyperparameters as, $\alpha = 0 . 2$ , $\beta = 0 . 1$ , $| \mathcal { C } _ { n } | = | \mathcal { C } _ { s } | _ { C _ { 2 } }$ and $b _ { + v e } / b _ { - v e } = 1$ As mentioned in Section 4.3, one can treat these hyperparameters as global constants. In Fig. 8 we demonstrate the sensitivity of the model to these hyperparameters. Specifically, in Fig. 8A we show the sensitivity of the adaptation performance, to the choice of $| { \mathcal { C } } _ { n } |$ during the Procurement stage, across a spectrum of label-set relationships. In Fig. 8B we show the sensitivity of the model to $\alpha$ and the batch-size ratio $b _ { + v e } / b _ { - v e }$ . Sensitivity to $\beta$ is shown in Fig. 5. Clearly, the model achieves a reasonably low sensitivity to the hyperparameters, even in the challenging source-free scenario.
|
| 387 |
+
|
| 388 |
+
# C.5 CLOSED-SET ADAPTATION
|
| 389 |
+
|
| 390 |
+
We additionally evaluate our method in the unsupervised closed set adaptation scenario. In Table 4 we compare with the closed set domain adaptation methods DAN (Long et al., 2015), ADDA (Tzeng et al., 2017), CDAN (Long et al., 2018) and the universal domain adaptation method UAN (You et al., 2019). Note that, DAN, ADDA and CDAN rely on the assumption of a shared label space between the source and the target, and hence are not suited for a universal setting. Furthermore, all other methods require an explicit retraining on the source data during adaptation to perform well, even in the closed-set scenario. This clearly establishes the superiority of our method in the source-free setting.
|
| 391 |
+
|
| 392 |
+
# C.6 ACCURACY ON SOURCE DATASET POST PROCUREMENT
|
| 393 |
+
|
| 394 |
+
We observe in our experiments that the accuracy on the source samples does not drop as a result of the partially generative framework. For the experiments conducted in Fig. 5C, we observe similar classification accuracy on the source validation set, on increasing the number of negative classes from 0 to 190. This effect can be attributed to a carefully chosen $\alpha = 0 . 2$ , which is deliberately biased towards positive source samples to help maintain the discriminative power of the model even in the presence of class imbalance (i.e. $| \mathcal { C } _ { n } | \overset { \_ } { \gg } | \mathcal { C } _ { s } | )$ . This enhances the model’s generative ability without compromising on the discriminative capacity on the positive source samples.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 9: t-SNE plot showing placement of all the four clusters computed after adaptation for the task $\mathbf { A } { \to } \mathbf { D }$ in Office-31. It validates our hypothesis in both Procurement and Deployment stages as shown by the highlighted clusters and the corresponding inferences in the legend under "Category clusters".
|
| 398 |
+
|
| 399 |
+
# C.7 INCREMENTAL ONE-SHOT CLASSIFICATION
|
| 400 |
+
|
| 401 |
+
In universal adaptation, we seek to transfer the knowledge of "class separability" obtained from the source domain to the deployed target environment. More concretely, it is attributed to the segregation of data samples based on an expected characteristics, such as classification of objects according to their pose, color, or shape etc. To quantify this, we consider an extreme case where $\mathcal { C } _ { s } \cap \mathcal { C } _ { t } \overset { = } { = } \varnothing$ $( \mathbf { A } { } \mathbf { D }$ in Office-31 with $| { \mathcal { C } } _ { s } | = 1 5$ , $| \mathcal { C } _ { t } | = 1 6 $ ). Considering access to a single labeled target sample from each target category in $\overline { { \boldsymbol { { \mathcal { C } } } } } _ { t } = \boldsymbol { { \mathcal { C } } } _ { t }$ , which are denoted as $\boldsymbol { x } _ { t } ^ { c _ { j } }$ , where $j = 1 , 2 , . . , | \mathcal { C } _ { t } |$ we perform one-shot Nearest-Neighbour based classification by obtaining the predicted class label as $\begin{array} { r } { \hat { c } _ { t } = \mathrm { a r g m i n } _ { c _ { j } } | | F _ { t } \circ M ( x _ { t } ) - \mathbf { \bar { F } } _ { t } \circ M ( x _ { t } ^ { c _ { j } } ) | | _ { 2 } } \end{array}$ . Then, the classification accuracy for the entire target set is computed by comparing $\hat { c } _ { t }$ with the corresponding ground-truth category. We obtain $6 4 . 7 2 \%$ accuracy for the proposed framework as compared to $1 3 . 4 3 \%$ for $\mathrm { U A N ^ { * } }$ (You et al., 2019). A higher accuracy indicates that, the samples are inherently clustered in the intermediate feature level $M \circ F _ { t } ( x _ { t } )$ validating an efficient transfer of “class separability” in a fully unsupervised manner.
|
| 402 |
+
|
| 403 |
+
# C.8 FEATURE SPACE VISUALIZATION
|
| 404 |
+
|
| 405 |
+
We obtain a t-SNE plot at the intermediate feature level $u$ for both target and source samples (see Figure 9), where the embedding for the target samples is obtained as $u _ { t } = F _ { t } \circ M ( x _ { t } ) { \overline { { } } }$ and the same for the source samples is obtained as $u _ { s } = F _ { s } \circ M ( x _ { s } )$ . This is because we aim to learn domain-specific features in contrast to domain-agnostic features as a result of the restriction imposed by the source-free scenario ("cannot disturb placement of source clusters"). Firstly we obtain compact clusters for the source-categories as a result of the partially generative Procurement stage. Secondly, the target-private clusters are placed away from the source-shared and source-private as expected as a result of the carefully formalized SSM weighting scheme in the Deployment stage. This plot clearly validates our hypothesis.
|
| 406 |
+
|
| 407 |
+
# D MISCELLANEOUS
|
| 408 |
+
|
| 409 |
+
# D.1 SPECIFICATIONS OF COMPUTING RESOURCES
|
| 410 |
+
|
| 411 |
+
For both Procurement and Deployment stages, we make use of the machine with the specifications mentioned in Table 8. The architecture is developed and trained in Python 2.7 with PyTorch 1.0.0.
|
| 412 |
+
|
| 413 |
+
Table 5: Network architecture for Procurement stage. Hyperparameter $\alpha = 0 . 2$
|
| 414 |
+
|
| 415 |
+
<table><tr><td>Component</td><td>Trainable?</td><td>Operation</td><td>Notation</td><td>Features</td><td></td><td>Batch Norm? Non-Linearity</td></tr><tr><td>Resnet-50</td><td>X</td><td></td><td>M</td><td>2048</td><td></td><td></td></tr><tr><td>(Upto AvgPool layer) Feature Extractor</td><td>√</td><td></td><td>Fs</td><td>256</td><td></td><td></td></tr><tr><td></td><td></td><td>Input</td><td></td><td>2048</td><td>xx√</td><td></td></tr><tr><td></td><td></td><td>Fully connected</td><td></td><td>1024</td><td></td><td>ELU</td></tr><tr><td></td><td></td><td>Fully connected</td><td></td><td>1024</td><td></td><td>ELU</td></tr><tr><td></td><td></td><td>Fully connected</td><td></td><td>256</td><td>X</td><td>ELU</td></tr><tr><td></td><td></td><td>Fully connected</td><td></td><td>256</td><td>√</td><td>ELU</td></tr><tr><td>FeatureDecoder</td><td>√</td><td></td><td>G</td><td>2048</td><td></td><td></td></tr><tr><td></td><td></td><td>Input</td><td></td><td>256</td><td>X</td><td></td></tr><tr><td></td><td></td><td>Fully connected</td><td></td><td>1024</td><td>×</td><td>ELU</td></tr><tr><td></td><td></td><td></td><td></td><td>1024</td><td>√</td><td>ELU</td></tr><tr><td></td><td></td><td>Fully connected Fully connected</td><td></td><td>2048</td><td>X</td><td>ELU</td></tr><tr><td></td><td></td><td>Fully connected</td><td></td><td>2048</td><td>X</td><td>-</td></tr><tr><td>Classifier</td><td>√</td><td></td><td>D</td><td>|Cs|+|Cnl</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>256</td><td></td><td></td></tr><tr><td></td><td></td><td>Input</td><td></td><td></td><td>X ×</td><td></td></tr><tr><td></td><td></td><td>Fully connected</td><td>Dsrc</td><td>|Csl</td><td></td><td></td></tr><tr><td></td><td></td><td>Input Fully connected</td><td>Dneg</td><td>256 |Cn|</td><td>X ×</td><td></td></tr></table>
|
| 416 |
+
|
| 417 |
+
Table 6: Feature Extractor Architecture used for training UAN (You et al., 2019) under the "no ResNet-50 finetuning" case (Refer Table 3 and Section C.1)
|
| 418 |
+
|
| 419 |
+
<table><tr><td>Operation</td><td>Features</td><td>Non-Linearity</td></tr><tr><td>Input</td><td>2048</td><td></td></tr><tr><td>Fully connected</td><td>512</td><td>ReLU</td></tr><tr><td>Fully connected</td><td>256</td><td>ReLU</td></tr><tr><td>Fully connected</td><td>512</td><td>ReLU</td></tr><tr><td>Fully connected</td><td>2048</td><td>ReLU</td></tr></table>
|
| 420 |
+
|
| 421 |
+
Table 7: Network architecture for Deployment stage. Hyperparameter $\beta = 0 . 1$
|
| 422 |
+
|
| 423 |
+
<table><tr><td>Component</td><td>Trainable?</td><td>Operation</td><td>Notation</td><td>Features</td><td></td><td>Batch Norm? Non-Linearity</td></tr><tr><td>Resnet-50 (Upto AvgPool layer)</td><td>X</td><td></td><td>M</td><td>2048</td><td></td><td></td></tr><tr><td>Feature Extractor</td><td>√</td><td></td><td>Ft</td><td>256</td><td></td><td></td></tr><tr><td rowspan="5"></td><td></td><td>Input</td><td></td><td>2048</td><td></td><td></td></tr><tr><td></td><td>Fully connected</td><td></td><td>1024</td><td></td><td>ELU</td></tr><tr><td></td><td>Fully connected</td><td></td><td>1024</td><td>xx√</td><td>ELU</td></tr><tr><td></td><td>Fully connected</td><td></td><td>256</td><td>×</td><td>ELU</td></tr><tr><td></td><td>Fully connected</td><td></td><td>256</td><td>√</td><td>ELU</td></tr><tr><td>Classifier</td><td>X</td><td></td><td>D</td><td>|Cs|+|Cnl</td><td></td><td></td></tr><tr><td></td><td></td><td>Input</td><td></td><td>256</td><td>X</td><td></td></tr><tr><td></td><td></td><td>Fully connected</td><td>Dsrc</td><td>|Cs|</td><td>×</td><td></td></tr><tr><td></td><td></td><td>Input</td><td></td><td>256</td><td>X</td><td></td></tr><tr><td></td><td></td><td>Fully connected</td><td>Dneg</td><td>|Cnl</td><td>X</td><td></td></tr></table>
|
| 424 |
+
|
| 425 |
+
Table 8: Specifications of the machine used for both Procurement and Deployment stages
|
| 426 |
+
|
| 427 |
+
<table><tr><td>CPU</td><td>GPU</td><td>RAM</td><td>VRAM</td><td>CUDA</td></tr><tr><td>Intel i7-7700K</td><td colspan="4">NVIDIA GeForce GTX1080 Ti 32 GB 11GB V8.0.61</td></tr></table>
|
| 428 |
+
|
| 429 |
+
# D.2 REFERENCES TO CODE
|
| 430 |
+
|
| 431 |
+
Proposed Method. Our complete documented code (including data loaders, training pipeline etc.) used for running the experiments is available for reproducibility (refer to the private comment containing the link). Details of dataset splits can be found in Section B.1. For evaluating UAN (You et al., 2019), we execute the official implementation provided by the authors on github1.
|
| 432 |
+
|
| 433 |
+
Negative dataset creation. We have provided the complete dataset with augmentations and negative images for the task $\mathbf { A } { \xrightarrow { } } \mathbf { D }$ in Office-31 (Saenko et al., 2010), along with the negative dataset creation tool (refer to the code link).
|
md/train/BJYwwY9ll/BJYwwY9ll.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SNAPSHOT ENSEMBLES: TRAIN 1, GET M FOR FREE
|
| 2 |
+
|
| 3 |
+
Gao Huang∗, Yixuan Li∗, Geoff Pleiss
|
| 4 |
+
Cornell University
|
| 5 |
+
{gh349, yl2363}@cornell.edu, geoff@cs.cornell.edu
|
| 6 |
+
Zhuang Liu
|
| 7 |
+
Tsinghua University
|
| 8 |
+
liuzhuangthu@gmail.com
|
| 9 |
+
|
| 10 |
+
John E. Hopcroft, Kilian Q. Weinberger Cornell University jeh@cs.cornell.edu, kqw4@cornell.edu
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Ensembles of neural networks are known to be much more robust and accurate than individual networks. However, training multiple deep networks for model averaging is computationally expensive. In this paper, we propose a method to obtain the seemingly contradictory goal of ensembling multiple neural networks at no additional training cost. We achieve this goal by training a single neural network, converging to several local minima along its optimization path and saving the model parameters. To obtain repeated rapid convergence, we leverage recent work on cyclic learning rate schedules. The resulting technique, which we refer to as Snapshot Ensembling, is simple, yet surprisingly effective. We show in a series of experiments that our approach is compatible with diverse network architectures and learning tasks. It consistently yields lower error rates than state-of-the-art single models at no additional training cost, and compares favorably with traditional network ensembles. On CIFAR-10 and CIFAR-100 our DenseNet Snapshot Ensembles obtain error rates of $3 . 4 \%$ and $1 7 . 4 \%$ respectively.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Stochastic Gradient Descent (SGD) (Bottou, 2010) and its accelerated variants (Kingma & Ba, 2014; Duchi et al., 2011) have become the de-facto approaches for optimizing deep neural networks. The popularity of SGD can be attributed to its ability to avoid and even escape spurious saddle-points and local minima (Dauphin et al., 2014). Although avoiding these spurious solutions is generally considered positive, in this paper we argue that these local minima contain useful information that may in fact improve model performance.
|
| 19 |
+
|
| 20 |
+
Although deep networks typically never converge to a global minimum, there is a notion of “good” and “bad” local minima with respect to generalization. Keskar et al. (2016) argue that local minima with flat basins tend to generalize better. SGD tends to avoid sharper local minima because gradients are computed from small mini-batches and are therefore inexact (Keskar et al., 2016). If the learningrate is sufficiently large, the intrinsic random motion across gradient steps prevents the optimizer from reaching any of the sharp basins along its optimization path. However, if the learning rate is small, the model tends to converge into the closest local minimum. These two very different behaviors of SGD are typically exploited in different phases of optimization (He et al., 2016a). Initially the learning rate is kept high to move into the general vicinity of a flat local minimum. Once this search has reached a stage in which no further progress is made, the learning rate is dropped (once or twice), triggering a descent, and ultimately convergence, to the final local minimum.
|
| 21 |
+
|
| 22 |
+
It is well established (Kawaguchi, 2016) that the number of possible local minima grows exponentially with the number of parameters—of which modern neural networks can have millions. It is therefore not surprising that two identical architectures optimized with different initializations or minibatch orderings will converge to different solutions. Although different local minima often have very similar error rates, the corresponding neural networks tend to make different mistakes. This diversity can be exploited through ensembling, in which multiple neural networks are trained from different initializations and then combined with majority voting or averaging (Caruana et al., 2004). Ensembling often leads to drastic reductions in error rates. In fact, most high profile competitions, e.g. Imagenet (Deng et al., 2009) or Kaggle1, are won by ensembles of deep learning architectures.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: Left: Illustration of SGD optimization with a typical learning rate schedule. The model converges to a minimum at the end of training. Right: Illustration of Snapshot Ensembling. The model undergoes several learning rate annealing cycles, converging to and escaping from multiple local minima. We take a snapshot at each minimum for test-time ensembling.
|
| 26 |
+
|
| 27 |
+
Despite its obvious advantages, the use of ensembling for deep networks is not nearly as widespread as it is for other algorithms. One likely reason for this lack of adaptation may be the cost of learning multiple neural networks. Training deep networks can last for weeks, even on high performance hardware with GPU acceleration. As the training cost for ensembles increases linearly, ensembles can quickly becomes uneconomical for most researchers without access to industrial scale computational resources.
|
| 28 |
+
|
| 29 |
+
In this paper we focus on the seemingly-contradictory goal of learning an ensemble of multiple neural networks without incurring any additional training costs. We achieve this goal with a training method that is simple and straight-forward to implement. Our approach leverages the non-convex nature of neural networks and the ability of SGD to converge to and escape from local minima on demand. Instead of training $M$ neural networks independently from scratch, we let SGD converge $M$ times to local minima along its optimization path. Each time the model converges, we save the weights and add the corresponding network to our ensemble. We then restart the optimization with a large learning rate to escape the current local minimum. More specifically, we adopt the cycling procedure suggested by Loshchilov & Hutter (2016), in which the learning rate is abruptly raised and then quickly lowered to follow a cosine function. Because our final ensemble consists of snapshots of the optimization path, we refer to our approach as Snapshot Ensembling. Figure 1 presents a high-level overview of this method.
|
| 30 |
+
|
| 31 |
+
In contrast to traditional ensembles, the training time for the entire ensemble is identical to the time required to train a single traditional model. During testing time, one can evaluate and average the last (and therefore most accurate) $m$ out of $M$ models. Our approach is naturally compatible with other methods to improve the accuracy, such as data augmentation, stochastic depth (Huang et al., 2016b), or batch normalization (Ioffe & Szegedy, 2015). In fact, Snapshot Ensembles can even be ensembled, if for example parallel resources are available during training. In this case, an ensemble of $K$ Snapshot Ensembles yields $K \times M$ models at $K$ times the training cost.
|
| 32 |
+
|
| 33 |
+
We evaluate the efficacy of Snapshot Ensembles on three state-of-the-art deep learning architectures for object recognition: ResNet (He et al., 2016b), Wide-ResNet (Zagoruyko & Komodakis, 2016), and DenseNet (Huang et al., 2016a). We show across four different data sets that Snapshot Ensembles almost always reduce error without increasing training costs. For example, on CIFAR-10 and CIFAR-100, Snapshot Ensembles obtains error rates of $3 . 4 \bar { 4 } \%$ and $1 7 . 4 1 \%$ respectively.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
Neural network ensembles have been widely studied and applied in machine learning (Hansen & Salamon, 1990; Krogh et al., 1995). However, most of these prior studies focus on improving the generalization performance, while few of them address the cost of training ensembles.
|
| 38 |
+
|
| 39 |
+
As an alternative to traditional ensembles, so-called “implicit” ensembles have high efficiency during both training and testing (Srivastava et al., 2014; Wan et al., 2013; Huang et al., 2016b; Singh et al., 2016; Krueger et al., 2016). The Dropout (Srivastava et al., 2014) technique creates an ensemble out of a single model by “dropping” — or zeroing — random sets of hidden nodes during each mini-batch. At test time, no nodes are dropped, and each node is scaled by the probability of surviving during training. Srivastava et al. claim that Dropout reduces overfitting by preventing the co-adaptation of nodes. An alternative explanation is that this mechanism creates an exponential number of networks with shared weights during training, which are then implicitly ensembled at test time. DropConnect (Wan et al., 2013) uses a similar trick to create ensembles at test time by dropping connections (weights) during training instead of nodes. The recently proposed Stochastic Depth technique (Huang et al., 2016b) randomly drops layers during training to create an implicit ensemble of networks with varying depth at test time. Finally, Swapout (Singh et al., 2016) is a stochastic training method that generalizes Dropout and Stochastic Depth. From the perspective of model ensembling, Swapout creates diversified network structures for model averaging. Our proposed method similarly trains only a single model; however, the resulting ensemble is “explicit” in that the models do not share weights. Furthermore, our method can be used in conjunction with any of these implicit ensembling techniques.
|
| 40 |
+
|
| 41 |
+
Several recent publications focus on reducing the test time cost of ensembles, by transferring the “knowledge” of cumbersome ensembles into a single model (Bucilu et al., 2006; Hinton et al., 2015). Hinton et al. (2015) propose to use an ensemble of multiple networks as the target of a single (smaller) network. Our proposed method is complementary to these works as we aim to reduce the training cost of ensembles rather than the test-time cost.
|
| 42 |
+
|
| 43 |
+
Perhaps most similar to our work is that of Swann & Allinson (1998) and Xie et al. (2013), who explore creating ensembles from slices of the learning trajectory. Xie et al. introduce the horizontal and vertical ensembling method, which combines the output of networks within a range of training epochs. More recently, Jean et al. (2014) and Sennrich et al. (2016) show improvement by ensembling the intermediate stages of model training. Laine & Aila (2016) propose a temporal ensembling method for semi-supervised learning, which achieves consensus among models trained with different regularization and augmentation conditions for better generalization performance. Finally, Moghimi et al. (2016) show that boosting can be applied to convolutional neural networks to create strong ensembles. Our work differs from these prior works in that we force the model to visit multiple local minima, and we take snapshots only when the model reaches a minimum. We believe this key insight allows us to leverage more power from our ensembles.
|
| 44 |
+
|
| 45 |
+
Our work is inspired by the recent findings of Loshchilov & Hutter (2016) and Smith (2016), who show that cyclic learning rates can be effective for training convolutional neural networks. The authors show that each cycle produces models which are (almost) competitive to those learned with traditional learning rate schedules while requiring a fraction of training iterations. Although model performance temporarily suffers when the learning rate cycle is restarted, the performance eventually surpasses the previous cycle after annealing the learning rate. The authors suggest that cycling perturbs the parameters of a converged model, which allows the model to find a better local minimum. We build upon these recent findings by (1) showing that there is significant diversity in the local minima visited during each cycle and (2) exploiting this diversity using ensembles. We are not concerned with speeding up or improving the training of a single model; rather, our goal is to extract an ensemble of classifiers while following the optimization path of the final model.
|
| 46 |
+
|
| 47 |
+
# 3 SNAPSHOT ENSEMBLING
|
| 48 |
+
|
| 49 |
+
Snapshot Ensembling produces an ensemble of accurate and diverse models from a single training process. At the heart of Snapshot Ensembling is an optimization process which visits several local minima before converging to a final solution. We take model snapshots at these various minima, and average their predictions at test time.
|
| 50 |
+
|
| 51 |
+
Ensembles work best if the individual models (1) have low test error and (2) do not overlap in the set of examples they misclassify. Along most of the optimization path, the weight assignments of a neural network tend not to correspond to low test error. In fact, it is commonly observed that the validation error drops significantly only after the learning rate has been reduced, which is typically done after several hundred epochs. Our approach is inspired by the observation that training neural networks for fewer epochs and dropping the learning rate earlier has minor impact on the final test error (Loshchilov & Hutter, 2016). This seems to suggest that local minima along the optimization path become promising (in terms of generalization error) after only a few epochs.
|
| 52 |
+
|
| 53 |
+
Cyclic Cosine Annealing. To converge to multiple local minima, we follow a cyclic annealing schedule as proposed by Loshchilov & Hutter (2016). We lower the learning rate at a very fast pace, encouraging the model to converge towards its first local minimum after as few as 50 epochs. The optimization is then continued at a larger learning rate, which perturbs the model and dislodges it from the minimum. We repeat this process several times to obtain multiple convergences. Formally, the learning rate $\alpha$ has the form:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\alpha ( t ) = f \left( \mathrm { m o d } \left( t - 1 , \lceil T / M \rceil \right) \right) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $t$ is the iteration number, $T$ is the total number of training iterations, and $f$ is a monotonically decreasing function. In other words, we split the training process into $M$ cycles, each of which starts with a large learning rate, which is annealed to a smaller learning rate. The large learning rate $\alpha = f ( 0 )$ provides the model enough energy to escape from a critical point, while the small learning rate
|
| 60 |
+
|
| 61 |
+
$\alpha = f ( \lceil \bar { T } / M \rceil )$ drives the model to a well behaved local minimum. In our experiments, we set $f$ to be the shifted cosine function proposed by Loshchilov & Hutter (2016):
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 2: Training loss of 100-layer DenseNet on CIFAR10 using standard learning rate (blue) and $M = 6$ cosine annealing cycles (red). The intermediate models, denoted by the dotted lines, form an ensemble at the end of training.
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\alpha ( t ) = \frac { \alpha _ { 0 } } { 2 } \left( \cos \left( \frac { \pi \mathrm { m o d } ( t - 1 , \left\lceil T / M \right\rceil ) } { \left\lceil T / M \right\rceil } \right) + 1 \right) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\alpha _ { 0 }$ is the initial learning rate. Intuitively, this function anneals the learning rate from its initial value $\alpha _ { 0 }$ to $f ( \lceil T / M \rceil ) \approx 0$ over the course of a cycle. Following (Loshchilov & Hutter, 2016), we update the learning rate at each iteration rather than at every epoch. This improves the convergence of short cycles, even when a large initial learning rate is used.
|
| 71 |
+
|
| 72 |
+
Snapshot Ensembling. Figure 2 depicts the training process using cyclic and traditional learning rate schedules. At the end of each training cycle, it is apparent that the model reaches a local minimum with respect to the training loss. Thus, before raising the learning rate, we take a “snapshot” of the model weights (indicated as vertical dashed black lines). After training $M$ cycles, we have $M$ model snapshots, $f _ { 1 } \ldots f _ { M }$ , each of which will be used in the final ensemble. It is important to highlight that the total training time of the $M$ snapshots is the same as training a model with a standard schedule (indicated in blue). In some cases, the standard learning rate schedule achieves lower training loss than the cyclic schedule; however, as we will show in the next section, the benefits of ensembling outweigh this difference.
|
| 73 |
+
|
| 74 |
+
Ensembling at Test Time. The ensemble prediction at test time is the average of the last $m$ $( m ~ \leq ~ M )$ model’s softmax outputs. Let $\mathbf { x }$ be a test sample and let $h _ { i } \left( \mathbf { x } \right)$ be the softmax $i$ t of the ensemble is a simple. We always ensemble the last verage of the last models, as these $m$ models:dels tend $h _ { \mathrm { E n s e m b l e } } = \textstyle { \frac { 1 } { m } } \sum _ { 0 } ^ { m - 1 } h _ { M - i } ( { \bf x } )$ $m$
|
| 75 |
+
|
| 76 |
+
Table 1: Error rates $( \% )$ on CIFAR-10 and CIFAR-100 datasets. All methods in the same group are trained for the same number of iterations. Results of our method are colored in blue, and the best result for each network/dataset pair are bolded. ∗ indicates numbers which we take directly from Huang et al. (2016a).
|
| 77 |
+
|
| 78 |
+
<table><tr><td colspan="2">Method</td><td>C10</td><td>C100</td><td>SVHN</td><td>Tiny ImageNet</td></tr><tr><td rowspan="5">ResNet-110</td><td>Single model</td><td>5.52</td><td>28.02</td><td>1.96</td><td>46.50</td></tr><tr><td>NoCycle Snapshot Ensemble</td><td>5.49</td><td>26.97</td><td>1.78</td><td>43.69</td></tr><tr><td>SingleCycle Ensembles</td><td>6.66</td><td>24.54</td><td>1.74</td><td>42.60</td></tr><tr><td>Snapshot Ensemble (αo = 0.1)</td><td>5.73</td><td>25.55</td><td>1.63</td><td>40.54</td></tr><tr><td>Snapshot Ensemble (αo = 0.2)</td><td>5.32</td><td>24.19</td><td>1.66</td><td>39.40</td></tr><tr><td rowspan="6">Wide-ResNet-32</td><td>Single model</td><td>5.43</td><td>23.55</td><td>1.90</td><td>39.63</td></tr><tr><td>Dropout</td><td>4.68</td><td>22.82</td><td>1.81</td><td>36.58</td></tr><tr><td>NoCycle Snapshot Ensemble</td><td>5.18</td><td>22.81</td><td>1.81</td><td>38.64</td></tr><tr><td>SingleCycle Ensembles</td><td>5.95</td><td>21.38</td><td>1.65</td><td>35.53</td></tr><tr><td>Snapshot Ensemble (αo = 0.1)</td><td>4.41</td><td>21.26</td><td>1.64</td><td>35.45</td></tr><tr><td>Snapshot Ensemble(αo = 0.2)</td><td>4.73</td><td>21.56</td><td>1.51</td><td>32.90</td></tr><tr><td rowspan="6">DenseNet-40</td><td>Single model</td><td>5.24*</td><td>24.42*</td><td>1.77</td><td>39.09</td></tr><tr><td>Dropout</td><td>6.08</td><td>25.79</td><td>1.79*</td><td>39.68</td></tr><tr><td>NoCycle Snapshot Ensemble</td><td>5.20</td><td>24.63</td><td>1.80</td><td>38.51</td></tr><tr><td>SingleCycle Ensembles</td><td>5.43</td><td>22.51</td><td>1.87</td><td>38.00</td></tr><tr><td>Snapshot Ensemble (αo = 0.1)</td><td>4.99</td><td>23.34</td><td>1.64</td><td>37.25</td></tr><tr><td>Snapshot Ensemble (αo = 0.2)</td><td>4.84</td><td>21.93</td><td>1.73</td><td>36.61</td></tr><tr><td rowspan="6">DenseNet-100</td><td>Single model</td><td>3.74*</td><td>19.25*</td><td></td><td>=</td></tr><tr><td>Dropout</td><td>3.65</td><td>18.77</td><td>=</td><td></td></tr><tr><td>NoCycle Snapshot Ensemble</td><td>3.80</td><td>19.30</td><td></td><td></td></tr><tr><td>SingleCycle Ensembles</td><td>4.52</td><td>18.38</td><td></td><td></td></tr><tr><td>Snapshot Ensemble (αo = 0.1)</td><td>3.57</td><td>18.12</td><td></td><td></td></tr><tr><td>Snapshot Ensemble (αo = 0.2)</td><td>3.44</td><td>17.41</td><td></td><td></td></tr></table>
|
| 79 |
+
|
| 80 |
+
# 4 EXPERIMENTS
|
| 81 |
+
|
| 82 |
+
We demonstrate the effectiveness of Snapshot Ensembles on several benchmark datasets, comparing with competitive baselines. We run all experiments with Torch 7 (Collobert et al., 2011)2.
|
| 83 |
+
|
| 84 |
+
# 4.1 DATASETS
|
| 85 |
+
|
| 86 |
+
CIFAR. The two CIFAR datasets (Krizhevsky & Hinton, 2009) consist of colored natural images sized at $3 2 \times 3 2$ pixels. CIFAR-10 (C10) and CIFAR-100 (C100) images are drawn from 10 and 100 classes, respectively. For each dataset, there are 50,000 training images and 10,000 images reserved for testing. We use a standard data augmentation scheme (Lin et al., 2013; Romero et al., 2014; Lee et al., 2015; Springenberg et al., 2014; Srivastava et al., 2015; Huang et al., 2016b; Larsson et al., 2016), in which the images are zero-padded with 4 pixels on each side, randomly cropped to produce $3 2 \times 3 2$ images, and horizontally mirrored with probability 0.5.
|
| 87 |
+
|
| 88 |
+
SVHN. The Street View House Numbers (SVHN) dataset (Netzer et al., 2011) contains $3 2 \times 3 2$ colored digit images from Google Street View, with one class for each digit. There are 73,257 images in the training set and 26,032 images in the test set. Following common practice (Sermanet et al., 2012; Goodfellow et al., 2013; Huang et al., 2016a), we withhold 6,000 training images for validation, and train on the remaining images without data augmentation.
|
| 89 |
+
|
| 90 |
+
Tiny ImageNet. The Tiny ImageNet dataset3 consists of a subset of ImageNet images (Deng et al., 2009). There are 200 classes, each of which has 500 training images and 50 validation images. Each image is resized to $6 4 \times 6 4$ and augmented with random crops, horizontal mirroring, and RGB intensity scaling (Krizhevsky et al., 2012).
|
| 91 |
+
|
| 92 |
+
ImageNet. The ILSVRC 2012 classification dataset (Deng et al., 2009) consists of 1000 images classes, with a total of 1.2 million training images and 50,000 validation images. We adopt the same data augmentation scheme as in (He et al., 2016a; Huang et al., 2016a) and apply a $2 2 4 \times 2 2 4$ center crop to images at test time.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 3: DenseNet-100 Snapshot Ensemble performance on CIFAR-10 and CIFAR-100 with restart learning rate $\alpha _ { 0 } = 0 . 1$ (left two) and $\alpha _ { 0 } = 0 . 2$ (right two). Each ensemble is trained with $M = 6$ annealing cycles (50 epochs per each).
|
| 96 |
+
|
| 97 |
+
# 4.2 TRAINING SETTING
|
| 98 |
+
|
| 99 |
+
Architectures. We test several state-of-the-art architectures, including residual networks (ResNet) (He et al., 2016a), Wide ResNet (Zagoruyko & Komodakis, 2016) and DenseNet (Huang et al., 2016a). For ResNet, we use the original 110-layer network introduced by He et al. (2016a). Wide-ResNet is a 32-layer ResNet with 4 times as many convolutional features per layer as a standard ResNet. For DenseNet, our large model follows the same setup as (Huang et al., 2016a), with depth $L = 1 0 0$ and growth rate $k = 2 4$ . In addition, we also evaluate our method on a small DenseNet, with depth $L = 4 0$ and $k = 1 2$ . To adapt all these networks to Tiny ImageNet, we add a stride of 2 to the first layer of the models, which downsamples the images to $3 2 \times 3 2$ . For ImageNet, we test the 50-layer ResNet proposed in (He et al., 2016a). We use a mini batch size of 64.4
|
| 100 |
+
|
| 101 |
+
Baselines. Snapshot Ensembles incur the training cost of a single model; therefore, we compare with baselines that require the same amount of training. First, we compare against a Single Model trained with a standard learning rate schedule, dropping the learning rate from 0.1 to 0.01 halfway through training, and then to 0.001 when training is at $7 5 \%$ . Additionally, to compare against implicit ensembling methods, we test against a single model trained with Dropout. This baseline uses the same learning rate as above, and drops nodes during training with a probability of 0.2.
|
| 102 |
+
|
| 103 |
+
We then test the Snapshot Ensemble algorithm trained with the cyclic cosine learning rate as described in (2). We test models with the max learning rate $\alpha _ { 0 }$ set to 0.1 and 0.2. In both cases, we divide the training process into learning rate cycles. Model snapshots are taken after each learning rate cycle. Additionally, we train a Snapshot Ensemble with a non-cyclic learning rate schedule. This NoCycle Snapshot Ensemble, which uses the same schedule as the Single Model and Dropout baselines, is meant to highlight the impact of cyclic learning rates for our method. To accurately compare with the cyclic Snapshot Ensembles, we take the same number of snapshots equally spaced throughout the training process. Finally, we compare against SingleCycle Ensembles, a Snapshot Ensemble variant in which the network is re-initialized at the beginning of every cosine learning rate cycle, rather than using the parameters from the previous optimization cycle. This baseline essentially creates a traditional ensemble, yet each network only has $1 / M$ of the typical training time. This variant is meant to highlight the tradeoff between model diversity and model convergence. Though SingleCycle Ensembles should in theory explore more of the parameter space, the models do not benefit from the optimization of previous cycles.
|
| 104 |
+
|
| 105 |
+
Training Budget. On CIFAR datasets, the training budget is $B = 3 0 0$ epochs for DenseNet-40 and DenseNet-100, and $B = 2 0 0$ for ResNet and Wide ResNet models. Snapshot variants are trained with $M = 6$ cycles of $B / M = 5 0$ epochs for DenseNets, and $M = 5$ cycles of $B / M = 4 0$ epochs for ResNets/Wide ResNets. SVHN models are trained with a budget of $B = 4 0$ epochs (5 cycles of 8 epochs). For Tiny ImageNet, we use a training budget of $B = 1 5 0$ (6 cycles of 25 epochs). Finally, ImageNet is trained with a budget of $B = 9 0$ epochs, and we trained 2 Snapshot variants: one with $M = 2$ cycles and one with $M = 3$ .
|
| 106 |
+
|
| 107 |
+
# 4.3 SNAPSHOT ENSEMBLE RESULTS
|
| 108 |
+
|
| 109 |
+
Accuracy. The main results are summarized in Table 1. In most cases, Snapshot ensembles achieve lower error than any of the baseline methods. Most notably, Snapshot Ensembles yield an error rate of $1 7 . 4 1 \%$ on CIFAR100 using large DenseNets, far outperforming the record of ${ \mathrm { \bar { 1 9 . 2 5 \% } } }$ under the same training cost and architecture (Huang et al., 2016a). Our method has the most success on CIFAR-100 and Tiny ImageNet, which is likely due to the
|
| 110 |
+
|
| 111 |
+
Table 2: Top-1 error rates $( \% )$ on ImageNet validation set using ResNet-50 with varying number of cycles.
|
| 112 |
+
|
| 113 |
+
<table><tr><td>Method</td><td>Val. Error (%)</td></tr><tr><td>Single model</td><td>24.01</td></tr><tr><td>Snapshot Ensemble (M= 2)</td><td>23.33</td></tr><tr><td>Snapshot Ensemble (M= 3)</td><td>23.96</td></tr></table>
|
| 114 |
+
|
| 115 |
+
complexity of these datasets. The softmax outputs for these datasets are high dimensional due to the large number of classes, making it unlikely that any two models make the same predictions. Snapshot Ensembling is also capable of improving the competitive baselines for CIFAR-10 and SVHN as well, reducing error by $1 \%$ and $0 . 4 \%$ respectively with the Wide ResNet architecture.
|
| 116 |
+
|
| 117 |
+
The NoCycle Snapshot Ensemble generally has little effect on performance, and in some instances even increases the test error. This highlights the need for a cyclic learning rate for useful ensembling. The SingleCycle Ensemble has similarly mixed performance. In some cases, e.g., DenseNet-40 on CIFAR-100, the SingleCycle Ensemble is competitive with Snapshot Ensembles. However, as the model size increases to 100 layers, it does not perform as well. This is because it is difficult to train a large model from scratch in only a few epochs. These results demonstrate that Snapshot Ensembles tend to work best when utilizing information from previous cycles. Effectively, Snapshot Ensembles strike a balance between model diversity and optimization.
|
| 118 |
+
|
| 119 |
+
Table 2 shows Snapshot Ensemble results on ImageNet. The Snapshot Ensemble with $M \ = \ 2$ achieves $2 3 . 3 3 \%$ validation error, outperforming the single model baseline with $2 4 . 0 1 \%$ validation error. It appears that 2 cycles is the optimal choice for the ImageNet dataset. Provided with the limited total training budget $B = 9 0$ epochs, we hypothesize that allocating fewer than $B / 2 = 4 5$ epochs per training cycle is insufficient for the model to converge on such a large dataset.
|
| 120 |
+
|
| 121 |
+
Ensemble Size. In some applications, it may be beneficial to vary the size of the ensemble dynamically at test time depending on available resources. Figure 3 displays the performance of DenseNet-40 on the CIFAR-100 dataset as the effective ensemble size, $m$ , is varied. Each ensemble consists of snapshots from later cycles, as these snapshots have received the most training and therefore have likely converged to better minima. Although ensembling more models generally gives better performance, we observe significant drops in error when the second and third models are added to the ensemble. In most cases, an ensemble of two models outperforms the baseline model.
|
| 122 |
+
|
| 123 |
+
Restart Learning Rate. The effect of the restart learning rate can be observed in Figure 3. The left two plots show performance when using a restart learning rate of $\alpha _ { 0 } = 0 . 1$ at the beginning of each cycle, and the right two plots show $\alpha _ { 0 } = 0 . 2$ . In most cases, ensembles with the larger restart learning rate perform better, presumably because the strong perturbation in between cycles increases the diversity of local minima.
|
| 124 |
+
|
| 125 |
+
Table 3: Error rates of a DenseNet-40 Snapshot Ensemble on CIFAR-100, varying $M .$ —the number of models (cycles) used in the ensemble.
|
| 126 |
+
|
| 127 |
+
<table><tr><td colspan="2">M Test Error (%)</td></tr><tr><td>2</td><td>22.92</td></tr><tr><td>4</td><td>22.07</td></tr><tr><td>6</td><td>21.93</td></tr><tr><td>8</td><td>21.89</td></tr><tr><td>10</td><td>22.16</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Varying Number of Cycles. Given a fixed training budget, there is a trade-off between the number of learning rate cycles and their length. Therefore, we investigate how the number of cycles $M$ affects the ensemble performance, given a fixed training budget. We train a 40-layer DenseNet on the CIFAR-100 dataset with an initial learning rate of $\alpha _ { 0 } = 0 . 2$ . We fix the total training budget $B = 3 0 0$ epochs, and vary the value of $M \in \{ 2 , 4 , 6 , 8 , 1 0 \}$ . As shown in Table 3, our method is relatively robust with respect to different values of $M$ . At the extremes, $M = 2$ and $M = 1 0$ , we find a slight degradation in performance, as the cycles are either too few or too short. In practice, we find that setting $M$ to be $4 \sim 8$ works reasonably well.
|
| 130 |
+
|
| 131 |
+
Varying Training Budget. The left and middle panels of Figure 4 show the performance of Snapshot Ensembles and SingleCycle Ensembles as a function of training budget (where the number of cycles is fixed at $M = 6$ ). We train a 40-layer DenseNet on CIFAR-10 and CIFAR-100, with an initial learning rate of $\alpha _ { 0 } = 0 . 1$ , varying the total number of training epochs from 60 to 300. We observe that both Snapshot Ensembles and SingleCycle Ensembles become more accurate as training budget increases. However, we note that as training budget decreases, Snapshot Ensembles still yield competitive results, while the performance of the SingleCycle Ensembles degrades rapidly. These results highlight the improvements that Snapshot Ensembles obtain when the budget is low. If the budget is high, then the SingleCycle baseline approaches true ensembles and outperforms Snapshot ensembles eventually.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 4: Snapshot Ensembles under different training budgets on (Left) CIFAR-10 and (Middle) CIFAR-100. Right: Comparison of Snapshot Ensembles with true ensembles.
|
| 137 |
+
Figure 5: Interpolations in parameter space between the final model (sixth snapshot) and all intermediate snapshots. $\lambda = 0$ represents an intermediate snapshot model, while $\lambda = 1$ represents the final model. Left: A Snapshot Ensemble, with cosine annealing cycles $\mathrm { \Delta } \alpha _ { 0 } = 0 . 2$ every $B / M \stackrel { \textstyle - } { = } 5 0$ epochs). Right: A NoCycle Snapshot Ensemble, (two learning rate drops, snapshots every 50 epochs).
|
| 138 |
+
|
| 139 |
+
Comparison with True Ensembles. We compare Snapshot Ensembles with the traditional ensembling method. The right panel of Figure 4 shows the test error rates of DenseNet-40 on CIFAR-100. The true ensemble method averages models that are trained with 300 full epochs, each with different weight initializations. Given the same number of models at test time, the error rate of the true ensemble can be seen as a lower bound of our method. Our method achieves performance that is comparable with ensembling of 2 independent models, but with the training cost of one model.
|
| 140 |
+
|
| 141 |
+
# 4.4 DIVERSITY OF MODEL ENSEMBLES
|
| 142 |
+
|
| 143 |
+
Parameter Space. We hypothesize that the cyclic learning rate schedule creates snapshots which are not only accurate but also diverse with respect to model predictions. We qualitatively measure this diversity by visualizing the local minima that models converge to. To do so, we linearly interpolate snapshot models, as described by Goodfellow et al. (2014). Let $J \left( \theta \right)$ be the test error of a model using parameters $\theta$ . Given $\theta _ { 1 }$ and $\theta _ { 2 }$ — the parameters from models 1 and 2 respectively — we can compute the loss for a convex combination of model parameters: $J \left( \lambda \left( \theta _ { 1 } \right) + \left( 1 - \lambda \right) ( \bar { \theta _ { 2 } } ) \right)$ , where $\lambda$ is a mixing coefficient. Setting $\lambda$ to 1 results in a parameters that are entirely $\theta _ { 1 }$ while setting $\lambda$ to 0 gives the parameters $\theta _ { 2 }$ . By sweeping the values of $\lambda$ , we can examine a linear slice of the parameter space. Two models that converge to a similar minimum will have smooth parameter interpolations, whereas models that converge to different minima will likely have a non-convex interpolation, with a spike in error when $\lambda$ is between 0 and 1.
|
| 144 |
+
|
| 145 |
+
Figure 5 displays interpolations between the final model of DenseNet-40 (sixth snapshot) and all intermediate snapshots. The left two plots show Snapshot Ensemble models trained with a cyclic learning rate, while the right two plots show NoCycle Snapshot models. $\lambda = 0$ represents a model which is entirely snapshot parameters, while $\lambda = 1$ represents a model which is entirely the parameters of the final model. From this figure, it is clear that there are differences between cyclic and non-cyclic learning rate schedules. Firstly, all of the cyclic snapshots achieve roughly the same error as the final cyclical model, as the error is similar for $\lambda = 0$ and $\lambda = 1$ . Additionally, it appears that most snapshots do not lie in the same minimum as the final model. Thus the snapshots are likely to misclassify different samples. Conversely, the first three snapshots achieve much higher error than the final model. This can be observed by the sharp minima around $\lambda = 1$ , which suggests that mixing in any amount of the snapshot parameters will worsen performance. While the final two snapshots achieve low error, the figures suggests that they lie in the same minimum as the final model, and therefore likely add limited diversity to the ensemble.
|
| 146 |
+
|
| 147 |
+
Activation space. To further explore the diversity of models, we compute the pairwise correlation of softmax outputs for every pair of snapshots. Figure 6 displays the average correlation for both cyclic snapshots and non-cyclical snapshots. Firstly, there are large correlations between the last 3 snapshots of the non-cyclic training schedule (right). These snapshots are taken after dropping the learning rate, suggesting that each snapshot has converged to the same minimum. Though there is more diversity amongst the earlier snapshots, these snapshots have much higher error rates and are therefore not ideal for ensembling. Conversely, there is less correlation between all cyclic snapshots (left). Because all snapshots have similar accuracy (as can be seen in Figure 5), these differences in predictions can be exploited to create effective ensembles.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 6: Pairwise correlation of softmax outputs between any two snapshots for DenseNet-100. Left: A Snapshot Ensemble, with cosine annealing cycles (restart with $\alpha _ { 0 } ~ = ~ 0 . 2$ every 50 epochs). Right: A NoCycle Snapshot Ensemble, (two learning rate drops, snapshots every 50 epochs).
|
| 151 |
+
|
| 152 |
+
# 5 DISCUSSION
|
| 153 |
+
|
| 154 |
+
We introduce Snapshot Ensembling, a simple method to obtain ensembles of neural networks without any additional training cost. Our method exploits the ability of SGD to converge to and escape from local minima as the learning rate is lowered, which allows the model to visit several weight assignments that lead to increasingly accurate predictions over the course of training. We harness this power with the cyclical learning rate schedule proposed by Loshchilov & Hutter (2016), saving model snapshots at each point of convergence. We show in several experiments that all snapshots are accurate, yet produce different predictions from one another, and therefore are well suited for test-time ensembles. Ensembles of these snapshots significantly improve the state-of-the-art on CIFAR-10, CIFAR-100 and SVHN. Future work will explore combining Snapshot Ensembles with traditional ensembles. In particular, we will investigate how to balance growing an ensemble with new models (with random initializations) and refining existing models with further training cycles under a fixed training budget.
|
| 155 |
+
|
| 156 |
+
# ACKNOWLEDGEMENTS
|
| 157 |
+
|
| 158 |
+
We thank Ilya Loshchilov and Frank Hutter for their insightful comments on the cyclic cosineshaped learning rate. The authors are supported in part by the, III-1618134, III-1526012, IIS1149882 grants from the National Science Foundation, US Army Research Office W911NF-14- 1-0477, and the Bill and Melinda Gates Foundation.
|
| 159 |
+
|
| 160 |
+
# REFERENCES
|
| 161 |
+
|
| 162 |
+
Leon Bottou. Large-scale machine learning with stochastic gradient descent. In ´ COMPSTAT. 2010.
|
| 163 |
+
|
| 164 |
+
Cristian Bucilu, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In KDD, 2006.
|
| 165 |
+
|
| 166 |
+
Rich Caruana, Alexandru Niculescu-Mizil, Geoff Crew, and Alex Ksikes. Ensemble selection from libraries of models. In ICML, 2004.
|
| 167 |
+
|
| 168 |
+
Ronan Collobert, Koray Kavukcuoglu, and Clement Farabet. Torch7: A matlab-like environment ´ for machine learning. In BigLearn, NIPS Workshop, 2011.
|
| 169 |
+
|
| 170 |
+
Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In NIPS, 2014.
|
| 171 |
+
|
| 172 |
+
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.
|
| 173 |
+
|
| 174 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 175 |
+
|
| 176 |
+
Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In ICML, 2013.
|
| 177 |
+
|
| 178 |
+
Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014.
|
| 179 |
+
|
| 180 |
+
Lars Kai Hansen and Peter Salamon. Neural network ensembles. IEEE transactions on pattern analysis and machine intelligence, 12:993–1001, 1990.
|
| 181 |
+
|
| 182 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016a.
|
| 183 |
+
|
| 184 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016b.
|
| 185 |
+
|
| 186 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 187 |
+
|
| 188 |
+
Gao Huang, Zhuang Liu, and Kilian Q Weinberger. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016a.
|
| 189 |
+
|
| 190 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Weinberger. Deep networks with stochastic depth. In ECCV, 2016b.
|
| 191 |
+
|
| 192 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICCV, 2015.
|
| 193 |
+
|
| 194 |
+
Sbastien Jean, Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. On using very large target vocabulary for neural machine translation. arXiv preprint arXiv:1412.2007, 2014.
|
| 195 |
+
|
| 196 |
+
Kenji Kawaguchi. Deep learning without poor local minima. arXiv preprint arXiv:1605.07110, 2016.
|
| 197 |
+
|
| 198 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 199 |
+
|
| 200 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 201 |
+
|
| 202 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 203 |
+
|
| 204 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
|
| 205 |
+
|
| 206 |
+
Anders Krogh, Jesper Vedelsby, et al. Neural network ensembles, cross validation, and active learning. In NIPS, volume 7, 1995.
|
| 207 |
+
|
| 208 |
+
David Krueger, Tegan Maharaj, Janos Kram ´ ar, Mohammad Pezeshki, Nicolas Ballas, Nan Rose- ´ mary Ke, Anirudh Goyal, Yoshua Bengio, Hugo Larochelle, Aaron Courville, et al. Zoneout: Regularizing rnns by randomly preserving hidden activations. arXiv preprint arXiv:1606.01305, 2016.
|
| 209 |
+
|
| 210 |
+
Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
|
| 211 |
+
|
| 212 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. arXiv preprint arXiv:1605.07648, 2016.
|
| 213 |
+
|
| 214 |
+
Chen-Yu Lee, Saining Xie, Patrick Gallagher, Zhengyou Zhang, and Zhuowen Tu. Deeplysupervised nets. In AISTATS, 2015.
|
| 215 |
+
|
| 216 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 217 |
+
|
| 218 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 219 |
+
|
| 220 |
+
Mohammad Moghimi, Mohammad Saberian, Jian Yang, Li-Jia Li, Nuno Vasconcelos, and Serge Belongie. Boosted convolutional neural networks. 2016.
|
| 221 |
+
|
| 222 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning, 2011. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
|
| 223 |
+
|
| 224 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014.
|
| 225 |
+
|
| 226 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Edinburgh neural machine translation systems for wmt 16. arXiv preprint arXiv:1606.02891, 2016.
|
| 227 |
+
|
| 228 |
+
Pierre Sermanet, Soumith Chintala, and Yann LeCun. Convolutional neural networks applied to house numbers digit classification. In ICPR, 2012.
|
| 229 |
+
|
| 230 |
+
Saurabh Singh, Derek Hoiem, and David Forsyth. Swapout: Learning an ensemble of deep architectures. arXiv preprint arXiv:1605.06465, 2016.
|
| 231 |
+
|
| 232 |
+
Leslie N. Smith. No more pesky learning rate guessing games. CoRR, abs/1506.01186, 2016. URL http://arxiv.org/abs/1506.01186.
|
| 233 |
+
|
| 234 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 235 |
+
|
| 236 |
+
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.
|
| 237 |
+
|
| 238 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Highway networks. ¨ arXiv preprint arXiv:1505.00387, 2015.
|
| 239 |
+
|
| 240 |
+
A Swann and N Allinson. Fast committee learning: Preliminary results. Electronics Letters, 34(14): 1408–1410, 1998.
|
| 241 |
+
|
| 242 |
+
Li Wan, Matthew Zeiler, Sixin Zhang, Yann L Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In ICML, 2013.
|
| 243 |
+
|
| 244 |
+
Jingjing Xie, Bing Xu, and Zhang Chuang. Horizontal and vertical ensemble with deep representation for classification. arXiv preprint arXiv:1306.2759, 2013.
|
| 245 |
+
|
| 246 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 247 |
+
|
| 248 |
+
# SUPPLEMENTARY
|
| 249 |
+
|
| 250 |
+
# A. Single model and Snapshot Ensemble performance over time
|
| 251 |
+
|
| 252 |
+
In Figures 7-9, we compare the test error of Snapshot Ensembles with the error of individual model snapshots. The blue curve shows the test error of a single model snapshot using a cyclic cosine learning rate. The green curve shows the test error when ensembling model snapshots over time. (Note that, unlike Figure 3, we construct these ensembles beginning with the earliest snapshots.) As a reference, the red dashed line in each panel represents the test error of single model trained for 300 epochs using a standard learning rate schedule. Without Snapshot Ensembles, in about half of the cases, the test error of final model using a cyclic learning rate—the right most point in the blue curve—is no better than using a standard learning rate schedule.
|
| 253 |
+
|
| 254 |
+
One can observe that under almost all settings, complete Snapshot Ensembles—the right most points of the green curves—outperform the single model baselines. In many cases, ensembles of just 2 or 3 model snapshots are able to match the performance of the single model trained with a standard learning rate. Not surprisingly, the ensembles of model snapshots consistently outperform any of its members, yielding a smooth curve of test error over time.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure 7: Single model and Snapshot Ensemble performance over time (part 1).
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 8: Single model and Snapshot Ensemble performance over time (part 2).
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 9: Single model and Snapshot Ensemble performance over time (part 3).
|
md/train/BJeWUs05KQ/BJeWUs05KQ.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIRECTED-INFO GAIL: LEARNING HIERARCHICALPOLICIES FROM UNSEGMENTED DEMONSTRATIONSUSING DIRECTED INFORMATION
|
| 2 |
+
|
| 3 |
+
Mohit Sharma∗, Arjun Sharma∗, Nick Rhinehart, Kris M. Kitani
|
| 4 |
+
Robotics Institute
|
| 5 |
+
Carnegie Mellon University
|
| 6 |
+
Pittsburgh, PA 15213, USA
|
| 7 |
+
{mohits1,arjuns2,nrhineha,kkitani}@cs.cmu.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
The use of imitation learning to learn a single policy for a complex task that has multiple modes or hierarchical structure can be challenging. In fact, previous work has shown that when the modes are known, learning separate policies for each mode or sub-task can greatly improve the performance of imitation learning. In this work, we discover the interaction between sub-tasks from their resulting stateaction trajectory sequences using a directed graphical model. We propose a new algorithm based on the generative adversarial imitation learning framework which automatically learns sub-task policies from unsegmented demonstrations. Our approach maximizes the directed information flow in the graphical model between sub-task latent variables and their generated trajectories. We also show how our approach connects with the existing Options framework, which is commonly used to learn hierarchical policies.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Complex human activities can often be broken down into various simpler sub-activities or sub-tasks that can serve as the basic building blocks for completing a variety of complicated tasks. For instance, when driving a car, a driver may perform several simpler sub-tasks such as driving straight in a lane, changing lanes, executing a turn and braking, in different orders and for varying times depending on the source, destination, traffic conditions etc. Using imitation learning to learn a single monolithic policy to represent a structured activity can be challenging as it does not make explicit the sub-structure between the parts within the activity. In this work, we develop an imitation learning framework that can learn a policy for each of these sub-tasks given unsegmented activity demonstrations and also learn a macro-policy which dictates switching from one sub-task policy to another. Learning sub-task specific policies has the benefit of shared learning. Each such sub-task policy also needs to specialize over a restricted state space, thus making the learning problem easier.
|
| 16 |
+
|
| 17 |
+
Previous works in imitation learning (Li et al., 2017; Hausman et al., 2017) focus on learning each sub-task specific policy using segmented expert demonstrations by modeling the variability in each sub-task policy using a latent variable. This latent variable is inferred by enforcing high mutual information between the latent variable and expert demonstrations. This information theoretic perspective is equivalent to the graphical model shown in Figure 1 (Left), where the node $c$ represents the latent variable. However, since learning sub-task policies requires isolated demonstrations for each sub-task, this setup is difficult to scale to many real world scenarios where providing such segmented trajectories is cumbersome. Further, this setup does not learn a macro-policy to combine the learned sub-task policies in meaningful ways to achieve different tasks.
|
| 18 |
+
|
| 19 |
+
In our work, we aim to learn each sub-task policy directly from unsegmented activity demonstrations. For example, given a task consisting of three sub-tasks — A, B and C, we wish to learn a policy to complete sub-task A, learn when to transition from A to B, finish sub-task B and so on. To achieve this we use a causal graphical model, which can be represented as a Dynamic Bayesian Network as shown in Figure 1 (Right). The nodes $c _ { t }$ denote latent variables which indicate the currently active sub-task and the nodes $\tau _ { t }$ denote the state-action pair at time $t$ . We consider as given, a set of expert demonstrations, each of which is represented by $\tau = \{ \tau _ { 1 } , \cdot \cdot \cdot , \tau _ { T } \}$ and has a corresponding sequence of latent factors $\pmb { c } = \{ c _ { 1 } , \cdots , c _ { T - 1 } \}$ . The sub-activity at time $t$ dictates what state-action pair was generated at time $t$ . The previous sub-task and the current state together cause the selection of the next sub-task.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Left: Graphical model used in Info-GAIL Li et al. (2017). Right: Causal model in this work. The latent code causes the policy to produce a trajectory. The current trajectory, and latent code produce the next latent code
|
| 23 |
+
|
| 24 |
+
As we will discuss in Section 3, extending the use of mutual information to learn sub-task policies from unsegmented demonstrations is problematic, as it requires learning the macro-policy as a conditional probability distribution which depends on the unobserved future. This unobserved future is unknown during earlier points of interaction (Figure 1). To alleviate this, in our work we aim to force the policy to generate trajectories that maximize the directed information or causal information (Massey, 1990) flow from trajectories to latent factors of variation within the trajectories instead of mutual information. Using directed information requires us to learn a causally conditioned probability distribution (Kramer, 1998) which depends only on the observed past while allowing the unobserved future to be sequentially revealed. Further, since there exists feedback in our causal graphical model i.e., information flows from the latent variables to trajectories and vice versa, directed information also provides a better upper bound on this information flow between the latent variables and expert trajectories than does the conventional mutual information (Massey, 1990; Kramer, 1998).
|
| 25 |
+
|
| 26 |
+
We also draw connections with existing work on learning sub-task policies using imitation learning with the options framework (Sutton et al., 1998; Daniel et al., 2016). We show that our work, while derived using the information theoretic perspective of maximizing directed information, bears a close resemblance to applying the options framework in a generative adversarial imitation setting. Thus, our approach combines the benefits of learning hierarchical policies using the options framework with the robustness of generative adversarial imitation learning, helping overcome problems such as compounding errors that plague behaviour cloning.
|
| 27 |
+
|
| 28 |
+
In summary, the main contributions of our work include:
|
| 29 |
+
|
| 30 |
+
• We extend existing generative adversarial imitation learning frameworks to allow for learning
|
| 31 |
+
of sub-task specific policies by maximizing directed information in a causal graph of subactivity latent variables and observed trajectory variables.
|
| 32 |
+
• We draw connections between previous works on imitation learning with sub-task policies
|
| 33 |
+
using options and show that our proposed approach can also be seen as option learning in a
|
| 34 |
+
generative adversarial setting.
|
| 35 |
+
We show through experiments on both discrete and continuous state-action spaces, the
|
| 36 |
+
ability of our approach to segment expert demonstrations into meaningful sub-tasks and combine sub-task specific policies to perform the desired task.
|
| 37 |
+
|
| 38 |
+
# 2 RELATED WORK
|
| 39 |
+
|
| 40 |
+
# 2.1 IMITATION LEARNING
|
| 41 |
+
|
| 42 |
+
Imitation Learning (Pomerleau, 1989) aims at learning policies that can mimic expert behaviours from demonstrations. Modeling the problem as a Markov Decision Process (MDP), the goal in imitation learning is to learn a policy $\pi ( a | s )$ , which defines the conditional distribution over actions $a \in { \mathcal { A } }$ given the state $s \in { \mathcal { S } }$ , from state-action trajectories $\tau = ( s _ { 0 } , a _ { 0 } , \cdot \cdot \cdot , s _ { T } )$ of expert behaviour. Recently,
|
| 43 |
+
|
| 44 |
+
Ho & Ermon (2016) introduced an imitation learning framework called Generative Adversarial Imitation Learning (GAIL) that is able to learn policies for complex high-dimensional physics-based control tasks. They reduce the imitation learning problem into an adversarial learning framework, for which they utilize Generative Adversarial Networks (GAN) (Goodfellow et al., 2014). The generator network of the GAN represents the agent’s policy $\pi$ while the discriminator network serves as a local reward function and learns to differentiate between state-action pairs from the expert policy $\pi _ { \mathbb { E } }$ and from the agent’s policy $\pi$ . Mathematically, it is equivalent to optimizing the following,
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\displaystyle { \operatorname* { m i n } _ { \pi } } \operatorname* { m a x } _ { D } \mathbb { E } _ { \pi } [ \log D ( s , a ) ] + \mathbb { E } _ { \pi _ { E } } [ 1 - \log D ( s , a ) ] - \lambda H ( \pi )
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
InfoGAIL (Li et al., 2017) and Hausman et al. (2017) solve the problem of learning from policies generated by a mixture of experts. They introduce a latent variable $c$ into the policy function $\pi ( a | s , c )$ to separate different type of behaviours present in the demonstration. To incentivize the network to use the latent variable, they utilize an information-theoretic regularization enforcing that there should be high mutual information between $c$ and the state-action pairs in the generated trajectory, a concept that was first introduced in InfoGAN (Chen et al., 2016). They introduce a variational lower bound $L _ { 1 } ( \pi , Q )$ of the mutual information $I ( c ; \tau )$ to the loss function in GAIL.
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
L _ { 1 } ( \pi , Q ) = \mathbb { E } _ { c \sim p ( c ) , a \sim \pi ( \cdot | s , c ) } \log Q ( c | \tau ) + H ( c ) \leq I ( c ; \tau )
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
The modified objective can then be given as,
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\operatorname* { m i n } _ { \pi , q } \operatorname* { m a x } _ { D } \mathbb { E } _ { \pi } [ \log D ( s , a ) ] + \mathbb { E } _ { \pi _ { E } } [ 1 - \log D ( s , a ) ] - \lambda _ { 1 } L _ { 1 } ( \pi , q ) - \lambda _ { 2 } H ( \pi )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
InfoGAIL models variations between different trajectories as the latent codes correspond to trajectories coming from different demonstrators. In contrast, we aim to model intra-trajectory variations and latent codes in our work correspond to sub-tasks (variations) within a demonstration. In Section 3, we discuss why using a mutual information based loss is infeasible in our problem setting and describe our proposed approach.
|
| 63 |
+
|
| 64 |
+
# 2.2 OPTIONS
|
| 65 |
+
|
| 66 |
+
Consider an MDP with states $s \in S$ and actions $a \in { \mathcal { A } }$ . Under the options framework (Sutton et al., 1998), an option, indexed by $o \in \mathcal { O }$ consists of a sub-policy $\pi ( a | s , o )$ , a termination policy $\pi ( b | s , \bar { o } )$ and an option activation policy $\pi ( o | s )$ . After an option is initiated, actions are generated by the sub-policy until the option is terminated and a new option is selected.
|
| 67 |
+
|
| 68 |
+
Options framework has been studied widely in RL literature. A challenging problem related to the options framework is to automatically infer options without supervision. Option discovery approaches often aim to find bottleneck states, i.e., states that the agent has to pass through to reach the goal. Many different approaches such as multiple-instance learning (McGovern & Barto, 2001), graph based algorithms (Menache et al., 2002; S¸ ims¸ek et al., 2005) have been used to find such bottleneck states. Once the bottleneck states are discovered, the above approaches find options policies to reach each such state. In contrast, we propose a unified framework using a information-theoretic approach to automatically discover relevant option policies without the need to discover bottleneck states.
|
| 69 |
+
|
| 70 |
+
Daniel et al. (2016) formulate the options framework as a probabilistic graphical model where options are treated as latent variables which are then learned from expert data. The option policies $( \pi ( a | s , o ) )$ are analogous to sub-task policies in our work. These option policies are then learned by maximizing a lower bound using the Expectation-Maximization algorithm (Moon, 1996). We show how this lower bound is closely related to the objective derived in our work. We further show how this connection allows our method to be seen as a generative adversarial variant of their approach. Fox et al. (2017) propose to extend the EM based approach to multiple levels of option hierarchies. Further work on discovery of deep continuous options (Krishnan et al., 2017) allows the option policy to also select a continuous action in states where none of the options are applicable. Our proposed approach can also be extended to multi-level hierarchies (e.g. by learning VAEs introduced in section 3 with multiple sampling layers) or hybrid categorical-continuous macro-policies (e.g. using both categorical and continuous hidden units in the sampling layer in VAE).
|
| 71 |
+
|
| 72 |
+
Shiarlis et al. (2018) learn options by assuming knowledge of task sketches (Andreas et al., 2017) along with the demonstrations. The work proposes a behavior cloning based approach using connectionist temporal classification (Graves et al., 2006) to simultaneously maximize the joint likelihood of the sketch sequences and the sub-policies. Our proposed approach does not expect task sketches as input, making it more amenable to problems where labeling demonstrations with sketch labels is difficult.
|
| 73 |
+
|
| 74 |
+
Prior work in robot learning has also looked at learning motion primitives from unsegmented demonstrations. These primitives usually correspond to a particular skill and are analogous to options. Niekum & Barto (2011) used the Beta-Process Autoregressive Hidden Markov Model (BP-AR-HMM) to segment expert demonstrations and post-process these segments to learn motion primitives which provide the ability to use reinforcement learning for policy improvement. Alternately, Krishnan et al. (2018) use Dirichlet Process Gaussian Mixture Model (DP-GMM) to segment the expert demonstrations by finding transition states between linear dynamical segments. Similarly, Ranchod et al. (2015) use the BP-AR-HMM framework to initially segment the expert demonstrations and then use an inverse reinforcement learning step to infer the reward function for each segment. The use of appropriate priors allows these methods to discover options without a priori knowledge of the total number of skills. Kroemer et al. (2014) model the task of manipulation as an autoregressive Hidden Markov Model where the hidden phases of manipulation are learned from data using EM. However, unlike the above methods, in our proposed approach we also learn an appropriate policy over the extracted options. We show how this allows us to compose the individual option policies to induce novel behaviours which were not present in the expert demonstrations.
|
| 75 |
+
|
| 76 |
+
# 3 PROPOSED APPROACH
|
| 77 |
+
|
| 78 |
+
As mentioned in the previous section, while prior approaches can learn to disambiguate the multiple modalities in the demonstration of a sub-task and learn to imitate them, they cannot learn to imitate demonstrations of unsegmented long tasks that are formed by a combination of many small sub-tasks. To learn such sub-task policies from unsegmented deomonstrations we use the graphical model in Figure 1 (Right), i.e., consider a set of expert demonstrations, each of which is represented by $\tau = \{ \tau _ { 1 } , \cdot \cdot \cdot , \tau _ { T } \}$ where $\tau _ { t }$ is the state-action pair observed at time $t$ . Each such demonstration has a corresponding sequence of latent variables $\bar { \pmb { c } } = \{ c _ { 1 } , \cdots , c _ { T - 1 } \}$ which denote the sub-activity in the demonstration at any given time step.
|
| 79 |
+
|
| 80 |
+
As noted before, previous approaches (Li et al., 2017; Hausman et al., 2017) model the expert sub-task demonstrations using only a single latent variable. To enforce the model to use this latent variable, these approaches propose to maximize the mutual information between the demonstrated sequence of state-action pairs and the latent embedding of the nature of the sub-activity. This is achieved by adding a lower bound to the mutual information between the latent variables and expert demonstrations. This variational lower bound of the mutual information is then combined with the the adversarial loss for imitation learning proposed in Ho & Ermon (2016). Extending this to our setting, where we have a sequence of latent variables $^ c$ , yields the following lower bound on the mutual information,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
L ( \pi , q ) = \sum _ { t } \mathbb { E } _ { c ^ { 1 : t } \sim p ( c ^ { 1 : t } ) , a ^ { t - 1 } \sim \pi ( \cdot \vert s ^ { t - 1 } , c ^ { 1 : t - 1 } ) } \Big [ \log q ( c ^ { t } \vert c ^ { 1 : t - 1 } , \tau ) \Big ] + H ( c ) \le I ( \tau ; c )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Observe that the dependence of $q$ on the entire trajectory $\tau$ precludes the use of such a distribution at test time, where only the trajectory up to the current time is known. To overcome this limitation, in this work we propose to force the policy to generate trajectories that maximize the directed or causal information flow from trajectories to the sequence of latent sub-activity variables instead. As we show below, by using directed information instead of mutual information, we can replace the dependence on $\tau$ with a dependence on the trajectory generated up to current time $t$ .
|
| 87 |
+
|
| 88 |
+
The directed information flow from a sequence $\boldsymbol { X }$ to $\mathbf { Y }$ is given by,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
I ( \boldsymbol { X } \to \boldsymbol { Y } ) = H ( \boldsymbol { Y } ) - H ( \boldsymbol { Y } | | \boldsymbol { X } )
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $H ( Y \| X )$ is the causally-conditioned entropy. Replacing $\boldsymbol { X }$ and $\mathbf { Y }$ with sequences $\tau$ and $^ c$ ,
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { l } { { \displaystyle I ( \tau \to c ) = H ( c ) - H ( c \| \tau ) } } \\ { { \mathrm { ~ } = H ( c ) - \displaystyle \sum _ { t } H ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) } } \\ { { \mathrm { ~ } = H ( c ) + \displaystyle \sum _ { t } \displaystyle \sum _ { c ^ { 1 : t - 1 } , \tau ^ { 1 : t } } \left[ p ( c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \right. } } \\ { { \displaystyle \left. \sum _ { c ^ { t } } p ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \log p ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \right] } } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Here $\tau ^ { 1 : t } = ( s _ { 1 } , \cdots , a _ { t - 1 } , s _ { t } )$ . A variational lower bound, $L _ { 1 } ( \pi , q )$ of the directed information, $I ( \tau \to c )$ which uses an approximate posterior $q ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } )$ instead of the true posterior $p ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } )$ can then be derived to get (See Appendix A.1 for the complete derivation),
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
L _ { 1 } ( \pi , q ) = \sum _ { t } \mathbb { E } _ { c ^ { 1 : t } \sim p ( c ^ { 1 : t } ) , a ^ { t - 1 } \sim \pi ( \cdot | s ^ { t - 1 } , c ^ { 1 : t - 1 } ) } \left[ \log q ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \right] + H ( c ) \le I ( \tau \to c )
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Thus, by maximizing directed information instead of mutual information, we can learn a posterior distribution over the next latent factor $c$ given the latent factors discovered up to now and the trajectory followed up to now, thereby removing the dependence on the future trajectory. In practice, we do not consider the $H ( c )$ term. This gives us the following objective,
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\operatorname* { m i n } _ { \pi , q } \operatorname* { m a x } _ { D } \mathbb { E } _ { \pi } \left[ \log D ( s , a ) \right] + \mathbb { E } _ { \pi _ { E } } \left[ 1 - \log D ( s , a ) \right] - \lambda _ { 1 } L _ { 1 } ( \pi , q ) - \lambda _ { 2 } H ( \pi )
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
We call this approach Directed-Info GAIL. Notice that, to compute the loss in equation 3, we need to sample from the prior distribution $p ( c ^ { 1 : t } )$ . In order to estimate this distribution, we first pre-train a variational auto-encoder (VAE) (Kingma & Welling, 2013) on the expert trajectories, the details of which are described in the next sub-section.
|
| 113 |
+
|
| 114 |
+
# 3.1 VAE PRE-TRAINING
|
| 115 |
+
|
| 116 |
+
Figure 2 (left) shows the design of the VAE pictorially. The VAE consists of two multi-layer perceptrons that serve as the encoder and the decoder. The encoder uses the current state $s _ { t }$ and the previous latent variable $c _ { t - 1 }$ to produce the current latent variable $c _ { t }$ . We used the Gumbel-softmax trick (Jang et al., 2016) to obtain samples of latent variables from a categorical distribution. The decoder then takes $s _ { t }$ and $c _ { t }$ as input and outputs the action $a _ { t }$ . We use the following objective, which maximizes the lower bound of the probability of the trajectories $p ( \tau )$ , to train our VAE,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
L _ { \mathrm { V A E } } ( \pi , q ; \tau _ { i } ) = - \sum _ { t } \mathbb { E } _ { c ^ { t } \sim q } \Big [ \log \pi \big ( a ^ { t } | s ^ { t } , c ^ { 1 : t } \big ) \Big ] + \sum _ { t } D _ { \mathrm { K L } } \big ( q ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \| p ( c ^ { t } | c ^ { 1 : t - 1 } ) \big )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Figure 2 (right) gives an overview of the complete method. The VAE pre-training step allows us to get approximate samples from the distribution $\bar { \boldsymbol { p } } ( c ^ { 1 : t } )$ to optimize equation 4. This is done by using $q$ to obtain samples of latent variable sequence $^ c$ by using its output on the expert demonstrations. In practice, we fix the weights of the network $q$ to those obtained from the VAE pre-training step when optimizing the Directed-Info GAIL loss in equation 4.
|
| 123 |
+
|
| 124 |
+
# 3.2 CONNECTION WITH OPTIONS FRAMEWORK
|
| 125 |
+
|
| 126 |
+
In Daniel et al. (2016) the authors provide a probabilistic perspective of the options framework. Although, Daniel et al. (2016) consider separate termination and option latent variables ( $\mathit { b } ^ { t }$ and $o ^ { t }$ ), for the purpose of comparison, we collapse them into a single latent variable $c ^ { t }$ , similar to our framework with a distribution $p ( c ^ { t } | s ^ { t } , c ^ { t - 1 } )$ . The lower-bound derived in Daniel et al. (2016) which is maximized using Expectation-Maximization (EM) algorithm can then be written as (suppressing dependence on parameters),
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 2: Left: VAE pre-training step. The VAE encoder uses the current state $\left( { { s } _ { t } } \right)$ , and previous latent variable $\left( c _ { t - 1 } \right)$ to produce the current latent variable $\left( c _ { t } \right)$ . The decoder reconstructs the action $\left( \boldsymbol { a } _ { t } \right)$ using $s _ { t }$ and $c _ { t }$ . Right: An overview of the proposed approach. We use the VAE pre-training step to learn an approximate prior over the latent variables and use this to learn sub-task policies in the proposed Directed-Info GAIL step.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: Results on the Four Rooms environment. (a) and (b) show results for two different latent variables. The arrows in each cell indicate the direction (action) with highest probability in that state and using the given latent variable. (c) and (d) show expert and generated trajectories in this environment. Star $( ^ { * } )$ represents the start state. The expert trajectory is shown in red. The color of the generated trajectory represents the latent code used by the policy at each time step.
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
p ( \tau ) \geq \sum _ { t } \sum _ { c ^ { t - 1 : t } } p ( c ^ { t - 1 : t } | \tau ) \log p ( c ^ { t } | s ^ { t } , c ^ { t - 1 } ) ) + \sum _ { t } \sum _ { c ^ { t } } p ( c ^ { t } | \tau ) \log \pi ( a ^ { t } | s ^ { t } , c ^ { t } )
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Note that the first term in equation $6 i . e .$ ., the expectation over the distribution $\log p ( c ^ { t } | s ^ { t } , c ^ { t - 1 } )$ is the same as equation 3 of our proposed approach with a one-step Markov assumption and a conditional expectation with given expert trajectories instead of an expectation with generated trajectories. The second term in equation 6 i.e., the expectation over $\log { \bar { \pi } } ( a ^ { t } | s ^ { t } , c ^ { t } )$ is replaced by the GAIL loss in equation 4. Our proposed Directed-Info GAIL can be therefore be considered as the generative adversarial variant of imitation learning using the options framework. The VAE behaviour cloning pretraining step in equation 5 is exactly equivalent to equation 6, where we use approximate variational inference using VAEs instead of EM. Thus, our approach combines the benefits of both behavior cloning and generative adversarial imitation learning. Using GAIL enables learning of robust policies that do not suffer from the problem of compounding errors. At the same time, conditioning GAIL on latent codes learned from the behavior cloning step prevents the issue of mode collapse in GANs.
|
| 139 |
+
|
| 140 |
+
# 4 EXPERIMENTS
|
| 141 |
+
|
| 142 |
+
We present results on both discrete and continuous state-action environments. In both of these settings we show that (1) our method is able to segment out sub-tasks from given expert trajectories, (2) learn sub-task conditioned policies, and (3) learn to combine these sub-task policies in order to achieve the task objective.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Environment</td><td>GAIL (Ho & Ermon,2016)</td><td>VAE</td><td>Directed-Info GAIL</td></tr><tr><td>Pendulum-v0</td><td>-121.42 ± 94.13</td><td>-142.89 ± 95.57</td><td>-125.39 ± 103.75</td></tr><tr><td>InvertedPendulum-v2</td><td>1000.0 ± 15.23</td><td>218.8 ± 7.95</td><td>1000.0±14.97</td></tr><tr><td>Hopper-v2</td><td>3623.4 ± 51.0</td><td>499.1 ± 86.2</td><td>3662.1 ± 21.7</td></tr><tr><td>Walker2d-v2</td><td>4858.0 ± 301.7</td><td>1549.5 ± 793.7</td><td>5083.9 ± 356.3</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 1: A comparison of returns for continuous environments. The returns were computed using 300 episodes. Our approach gives comparable returns to using GAIL but also segments expert demonstrations into sub-tasks. The proposed Directed-Info GAIL approach improves over the policy learned from the VAE pre-training step.
|
| 147 |
+
|
| 148 |
+
# 4.1 DISCRETE ENVIRONMENT
|
| 149 |
+
|
| 150 |
+
For the discrete setting, we choose a grid world environment which consists of a $1 5 \times 1 1$ grid with four rooms connected via corridors as shown in Figure 3. The agent spawns at a random location in the grid and its goal is to reach an apple, which spawns in one of the four rooms randomly, using the shortest possible path. Through this experiment we aim to see whether our proposed approach is able to infer sub-tasks which correspond to meaningful navigation strategies and combine them to plan paths to different goal states.
|
| 151 |
+
|
| 152 |
+
Figure 3 shows sub-task policies learned by our approach in this task. The two plots on the left correspond to two of the four different values of the latent variable. The arrow at every state in the grid shows the agent action (direction) with the highest probability in that state for that latent variable. In the discussion that follows, we label the rooms from 1 to 4 starting from the room at the top left and moving in the clockwise direction. We observe that the sub-tasks extracted by our approach represent semantically meaningful navigation plans. Also, each latent variable is utilized for a different sub-task. For instance, the agent uses the latent code in Figure 3(a), to perform the sub-task of moving from room 1 to room 3 and from room 2 to room 4 and the code in Figure 3(b) to move in the opposite direction. Further, our approach learns to successfully combine these navigation strategies to achieve the given objectives. For example, Figure 3(c, d) show examples of how the macro-policy switches between various latent codes to achieve the desired goals of reaching the apples in rooms 1 and 2 respectively.
|
| 153 |
+
|
| 154 |
+
# 4.2 CONTINUOUS ENVIRONMENTS
|
| 155 |
+
|
| 156 |
+
To validate our proposed approach on continuous control tasks we experiment with 5 continuous state-action environments. The first environment involves learning to draw circles on a 2D plane and is called Circle-World. In this experiment, the agent must learn to draw a circle in both clockwise and counter-clockwise direction. The agent always starts at (0,0), completes a circle in clockwise direction and then retraces its path in the counter-clockwise direction. The trajectories differ in the radii of the circles. The state $\bar { s } \in \mathbb { R } ^ { 2 }$ is the $\mathbf { \Phi } ( \mathbf { x } , \mathbf { y } )$ co-ordinate and the actions $a \in \mathbb { R } ^ { 2 }$ is a unit vector representing the direction of motion. Notice that in Circle-World, the expert trajectories include two different actions (for clockwise and anti-clockwise direction) for every state $( x , y )$ in the trajectory, thus making the problem multi-modal in nature. This requires the agent to appropriately disambiguate between the two different phases of the trajectory.
|
| 157 |
+
|
| 158 |
+
Further, to show the scalability of our approach to higher dimensional continuous control tasks we also show experiments on Pendulum, Inverted Pendulum, Hopper and Walker environments, provided in OpenAI Gym (Brockman et al., 2016). Each task is progressively more challenging, with a larger state and action space. Our aim with these experiments is to see whether our approach can identify certain action primitives which helps the agent to complete the given task successfully. To verify the effectiveness of our proposed approach we do a comparative analysis of our results with both GAIL (Ho & Ermon, 2016) and the supervised behavior cloning approaching using a VAE. To generate expert trajectories we train an agent using Proximal Policy Optimization (Schulman et al., 2017). We used 25 expert trajectories for the Pendulum and Inverted Pendulum tasks and 50 expert trajectories for experiments with the Hopper and Walker environments.
|
| 159 |
+
|
| 160 |
+
Figures 4(a, b, c) show results on the Circle-World environment. As can be seen in Figure 4(a, b), when using two sub-task latent variables, our method learns to segment the demonstrations into two intuitive sub-tasks of drawing circles in clockwise and counterclockwise directions. Hence, our method is able to identify the underlying modes and thus find meaningful sub-task segmentations from unsegmented data. We also illustrate how the learned sub-task policies can be composed to perform new types of behavior that were unobserved in the expert data. In Figure 4(c) we show how the sub-task policies can be combined to draw the circles in inverted order of direction by swapping the learned macro-policy with a different desired policy. Thus, the sub-task policies can be utilized as a library of primitive actions which is a significant benefit over methods learning monolithic policies.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 4: Results for Directed-Info GAIL on continuous environments. (a) Our method learns to break down the Circle-World task into two different sub-activities, shown in green and blue. (b) Trajectory generated using our approach. Color denotes time step. (c) Trajectory generated in opposite direction. Color denotes time step. (d) Sub-activity latent variables as inferred by Directed-Info GAIL on Pendulum-v0. Different colors represent different context.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 5: (a) shows the plot of the sub-task latent variable vs time on the Hopper and Walker tasks. (b) shows discovered sub-tasks using Directed-Info GAIL on these environments.
|
| 167 |
+
|
| 168 |
+
We now discuss the results on the classical Pendulum environment. Figure 4(d) shows the sub-task latent variables assigned by our approach to the various states. As can be seen in the figure, the network is able to associate different latent variables to different sub-tasks. For instance, states that have a high velocity are assigned a particular latent variable (shown in blue). Similarly, states that lie close to position 0 and have low velocity (i.e. the desired target position) get assigned another latent variable (shown in green). The remaining states get classified as a separate sub-task.
|
| 169 |
+
|
| 170 |
+
Figure 5 shows the results on the higher dimensional continuous control, Hopper and Walker, environments. Figure 5(a) shows a plots for sub-task latent variable assignment obtained on these environments. Our proposed method identifies basic action primitives which are then chained together to effectively perform the two locomotion tasks. Figure 5(b) shows that our approach learns to assign separate latent variable values for different action primitives such as, jumping, mid-air and landing phases of these tasks, with the latent variable changing approximately periodically as the agent performs the periodic hopping/walking motion.
|
| 171 |
+
|
| 172 |
+
Finally, in Table 1 we also show the quantitative evaluation on the above continuous control environments. We report the mean and standard deviations of the returns over 300 episodes. As can be seen, our approach improves the performance over the VAE pre-training step, overcoming the issue of compounding errors. The performance of our approach is comparable to the state-of-the-art GAIL (Ho & Ermon, 2016). Our method moreover, has the added advantage of segmenting the demonstrations into sub-tasks and also providing composable sub-task policies.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 6: Segmentations obtained using our proposed Directed-Info GAIL method on FetchPickandPlace-v1.
|
| 176 |
+
|
| 177 |
+
Table 2: Mean returns over 100 episodes on FetchPickandPlace-v1 environment, calculated using the ‘dense’ reward setting.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Method</td><td>Returns</td></tr><tr><td>VAE</td><td>-14.07 ± 5.57</td></tr><tr><td>GAIL</td><td>-13.29 ± 5.84</td></tr><tr><td>Directed-Info GAIL</td><td>-11.74 ± 5.87</td></tr><tr><td>GAIL + L2 loss Directed-Info GAIL + L2 loss</td><td>-12.05 ± 4.94 -9.47 ± 4.84</td></tr></table>
|
| 180 |
+
|
| 181 |
+
We further analyze our proposed approach in more detail in the Appendix. In Appendix A.4 we visualize the sub-tasks in a low-dimensional sub-space. Also, in Appendix A.5 we show results when using a larger dimensional sub-task latent variable. A video of our results on Hopper and Walker environments can be seen at https://sites.google.com/view/directedinfo-gail.
|
| 182 |
+
|
| 183 |
+
# 4.3 OPENAI ROBOTICS ENVIRONMENT
|
| 184 |
+
|
| 185 |
+
We further performed experiments on the FetchPickandPlace-v1 task in OpenAI Gym. In each episode of this task, the object and goal locations are selected randomly. The robot then must first reach and pick the object, and then move it to the goal location.
|
| 186 |
+
|
| 187 |
+
We trained agents using both our proposed Directed-Info GAIL and the baseline GAIL approaches. We used 500 expert demonstrations. While our method was able to learn to segment the expert demonstrations into the Pick and Place sub-tasks correctly, as can be seen in Figure 6 and the videos at https://sites.google.com/view/directedinfo-gail/home#h.p_ 4dsbuC5expkZ, neither our approach, nor GAIL was able to successfully complete the task. In our preliminary results, we found that the robot, in both our proposed approach and GAIL, would reach the object but fail to grasp it despite repeated attempts. To the best of our knowledge, no other work has successfully trained GAIL on this task either. Our preliminary experiments suggested that stronger supervision may be necessary to teach the agent the subtle action of grasping.
|
| 188 |
+
|
| 189 |
+
In order to provide this supervision, we additionally trained the policy to minimize the L2 distance between the policy action and the expert action on states in the expert demonstrations. At every training step, we compute the discriminator and policy (generator) gradient using the Directed-Info GAIL (or in the baseline, GAIL) loss using states and actions generated by the policy. Along with this gradient, we also sample a batch of states from the expert demonstrations and compute the policy gradient that minimizes the L2 loss between actions that the policy takes at these states and the actions taken by the expert. We weigh these two gradients to train the policy.
|
| 190 |
+
|
| 191 |
+
Table 2 shows the returns computed over 100 episodes. Adding the L2 measure as an additional loss led to significant improvement. Our proposed approach Directed-Info $\mathrm { G A I L } + \mathrm { L } 2$ loss outperforms the baselines. Moreover, we believe that this quantitative improvement does not reflect the true performance gain obtained using our method. The reward function is such that a correct grasp but incorrect movement (e.g. motion in the opposite direction or dropping of the object) is penalized more than a failed grasp. Thus, the reward function does not capture the extent to which the task was completed.
|
| 192 |
+
|
| 193 |
+
Qualitatively, we observed a much more significant difference in performance between the proposed approach and the baseline. This can be seen in the sample videos of the success and failure cases for our and the baseline method at https://sites.google.com/view/ directedinfo-gail/home#h.p_qM39qD8xQhJQ. Our proposed method succeeds much more often than the baseline method. The most common failure cases for our method include the agent picking up the object, but not reaching the goal state before the end of the episode, moving the object to an incorrect location or dropping the object while moving it to the goal. Agents trained using GAIL $+ \mathrm { L } 2$ loss on the other hand often fail to grasp the object, either not closing the gripper or closing the gripper prematurely. We believe that our approach helps the agent alleviate this issue by providing it with the sub-task code, helping it disambiguate between the very similar states the agent observes just before and just after grasping.
|
| 194 |
+
|
| 195 |
+
# 5 CONCLUSION
|
| 196 |
+
|
| 197 |
+
Learning separate sub-task policies can help improve the performance of imitation learning when the demonstrated task is complex and has a hierarchical structure. In this work, we present an algorithm that infers these latent sub-task policies directly from given unstructured and unlabelled expert demonstrations. We model the problem of imitation learning as a directed graph with sub-task latent variables and observed trajectory variables. We use the notion of directed information in a generative adversarial imitation learning framework to learn sub-task and macro policies. We further show theoretical connections with the options literature as used in hierarchical reinforcement and imitation learning. We evaluate our method on both discrete and continuous environments. Our experiments show that our method is able to segment the expert demonstrations into different sub-tasks, learn sub-task specific policies and also learn a macro-policy that can combines these sub-task.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Jacob Andreas, Dan Klein, and Sergey Levine. Modular multitask reinforcement learning with policy sketches. In International Conference on Machine Learning, pp. 166–175. JMLR. org, 2017.
|
| 202 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 203 |
+
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, pp. 2172–2180, 2016.
|
| 204 |
+
Christian Daniel, Herke Van Hoof, Jan Peters, and Gerhard Neumann. Probabilistic inference for determining options in reinforcement learning. Machine Learning, 104(2-3):337–357, 2016.
|
| 205 |
+
Roy Fox, Sanjay Krishnan, Ion Stoica, and Ken Goldberg. Multi-level discovery of deep options. arXiv preprint arXiv:1703.08294, 2017.
|
| 206 |
+
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.
|
| 207 |
+
Alex Graves, Santiago Fernandez, Faustino Gomez, and J ´ urgen Schmidhuber. Connectionist tem- ¨ poral classification: labelling unsegmented sequence data with recurrent neural networks. In International Conference on Machine learning, pp. 369–376. ACM, 2006.
|
| 208 |
+
Karol Hausman, Yevgen Chebotar, Stefan Schaal, Gaurav Sukhatme, and Joseph J Lim. Multi-modal imitation learning from unstructured demonstrations using generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 1235–1245, 2017.
|
| 209 |
+
Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems, pp. 4565–4573, 2016.
|
| 210 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 211 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 212 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 213 |
+
Gerhard Kramer. Directed information for channels with feedback. PhD thesis, Eidgenossiche Technische Hochschule Zurich, 1998.
|
| 214 |
+
|
| 215 |
+
Sanjay Krishnan, Roy Fox, Ion Stoica, and Ken Goldberg. DDCO: Discovery of deep continuous options for robot learning from demonstrations. In 1st Conference on Robot Learning (CoRL), 2017.
|
| 216 |
+
|
| 217 |
+
Sanjay Krishnan, Animesh Garg, Sachin Patil, Colin Lea, Gregory Hager, Pieter Abbeel, and Ken Goldberg. Transition state clustering: Unsupervised surgical trajectory segmentation for robot learning. In Robotics Research, pp. 91–110. Springer, 2018.
|
| 218 |
+
|
| 219 |
+
O. Kroemer, H. van Hoof, G. Neumann, and J. Peters. Learning to predict phases of manipulation tasks as hidden states. In Proceedings of 2014 IEEE International Conference on Robotics and Automation, pp. 4009–4014. IEEE, 2014.
|
| 220 |
+
|
| 221 |
+
Yunzhu Li, Jiaming Song, and Stefano Ermon. Infogail: Interpretable imitation learning from visual demonstrations. In Advances in Neural Information Processing Systems, pp. 3815–3825, 2017.
|
| 222 |
+
|
| 223 |
+
James Massey. Causality, feedback and directed information. In Proc. Int. Symp. Inf. Theory Applic.(ISITA-90), pp. 303–305. Citeseer, 1990.
|
| 224 |
+
|
| 225 |
+
Amy McGovern and Andrew G Barto. Accelerating reinforcement learning through the discovery of useful subgoals. 2001.
|
| 226 |
+
|
| 227 |
+
Ishai Menache, Shie Mannor, and Nahum Shimkin. Q-cutdynamic discovery of sub-goals in reinforcement learning. In European Conference on Machine Learning, pp. 295–306. Springer, 2002.
|
| 228 |
+
|
| 229 |
+
Todd K Moon. The expectation-maximization algorithm. IEEE Signal processing magazine, 13(6): 47–60, 1996.
|
| 230 |
+
|
| 231 |
+
Scott Niekum and Andrew G Barto. Clustering via dirichlet process mixture models for portable skill discovery. In Advances in neural information processing systems, pp. 1818–1826, 2011.
|
| 232 |
+
|
| 233 |
+
Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In Advances in neural information processing systems, pp. 305–313, 1989.
|
| 234 |
+
|
| 235 |
+
Pravesh Ranchod, Benjamin Rosman, and George Konidaris. Nonparametric bayesian reward segmentation for skill discovery using inverse reinforcement learning. In Intelligent Robots and Systems (IROS), 2015 IEEE/RSJ International Conference on, pp. 471–477. IEEE, 2015.
|
| 236 |
+
|
| 237 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 238 |
+
|
| 239 |
+
Kyriacos Shiarlis, Markus Wulfmeier, Sasha Salter, Shimon Whiteson, and Ingmar Posner. Taco: Learning task decomposition via temporal alignment for control. In International Conference on Machine Learning, 2018.
|
| 240 |
+
|
| 241 |
+
Ozg ¨ ur¨ S¸ ims¸ek, Alicia P Wolfe, and Andrew G Barto. Identifying useful subgoals in reinforcement learning by local graph partitioning. In Proceedings of the 22nd international conference on Machine learning, pp. 816–823. ACM, 2005.
|
| 242 |
+
|
| 243 |
+
Richard S Sutton, Doina Precup, and Satinder P Singh. Intra-option learning about temporally abstract actions. In ICML, volume 98, pp. 556–564, 1998.
|
| 244 |
+
|
| 245 |
+
# A APPENDIX
|
| 246 |
+
|
| 247 |
+
A.1 DERIVATION FOR DIRECTED-INFO LOSS
|
| 248 |
+
|
| 249 |
+
The directed information flow from a sequence $\boldsymbol { X }$ to $\mathbf { Y }$ is given by:
|
| 250 |
+
|
| 251 |
+
$$
|
| 252 |
+
I ( \boldsymbol { X } \to \boldsymbol { Y } ) = H ( \boldsymbol { Y } ) - H ( \boldsymbol { Y } | | \boldsymbol { X } )
|
| 253 |
+
$$
|
| 254 |
+
|
| 255 |
+
where $H ( Y \| X )$ is the causally-conditioned entropy. Replacing $\boldsymbol { X }$ and $\mathbf { Y }$ with the sequences $\tau$ and $^ c$ give,
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
\begin{array} { r l } & { I ( \tau c ) = H ( c ) - H ( c ) \mid \tau } \\ & { \qquad = H ( c ) - \displaystyle \sum _ { \tau } H ( c ^ { i } \mid c ^ { i - 1 } , \tau ^ { 1 : t } ) } \\ & { \qquad = H ( c ) + \displaystyle \sum _ { \tau } \displaystyle \sum _ { c ^ { i + 1 } = 1 , \tau ^ { 1 : t } ) } [ p ( c ^ { i + t - 1 } , \tau ^ { 1 : t } ) \displaystyle \sum _ { c ^ { i } } p ( c ^ { i } \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \log p ( c ^ { i } \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) ] } \\ & { \qquad = H ( c ) + \displaystyle \sum _ { \tau } \displaystyle \sum _ { c ^ { i + 1 } = 1 , \tau ^ { 1 : t } ) } [ p ( c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) [ D _ { K L } ( p ( \cdot \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) | q ( \cdot \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) ) } \\ & { \qquad \quad \qquad + \displaystyle \sum _ { c ^ { i } } p ( c ^ { i } \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \log q ( c ^ { i } \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) ] ] } \\ & { \qquad \geq H ( c ) + \displaystyle \sum _ { \tau } \displaystyle \sum _ { c ^ { i + 1 } = 1 , \tau ^ { 1 : t } ) } [ p ( c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \displaystyle \sum _ { c ^ { i } } p ( c ^ { i } \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \log q ( c ^ { i } \mid c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) ] . } \end{array}
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
Here $\tau ^ { 1 : t } = ( s _ { 1 } , \cdots , a _ { t - 1 } , s _ { t } )$ . The lower bound in equation 7 requires us to know the true posterior distribution to compute the expectation. To avoid sampling from $p ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } )$ , we use the following,
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\begin{array} { r l } & { \displaystyle \sum _ { s = 1 } \sum _ { \tau = 1 } \left[ p ( c ^ { \lfloor k - 1 \rfloor } , \tau ^ { \lfloor k \rfloor } ) \sum _ { \sigma ^ { \prime } } \overline { { p } } ( c ^ { \lfloor k \rfloor } c ^ { \lfloor k - 1 \rfloor } , \tau ^ { \lfloor k \rfloor } ) \log q ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \right] } \\ & { \quad = \displaystyle \sum _ { s = 1 - 1 } \sum _ { \tau = 1 } \sum _ { \tau ^ { \lfloor k \rfloor } } \sum _ { \sigma ^ { \prime } } \left[ p ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) p ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \log q ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \right] } \\ & { \quad = \displaystyle \sum _ { s = 1 - 1 } \sum _ { \tau = 1 } \sum _ { \tau ^ { \lfloor k \rfloor } } \sum _ { \epsilon ^ { \ell } } \left[ p ( c ^ { \eta } , c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \log q ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \right] } \\ & { \quad = \displaystyle \sum _ { s = 1 - 1 } \sum _ { \tau \in \tau ^ { \lfloor k \rfloor } } \sum _ { \epsilon ^ { \ell } } \left[ p ( \tau ^ { \lfloor k \rfloor } | c , c ^ { \lfloor k - 1 \rfloor } ) p ( c ^ { \ell } , c ^ { \lfloor k - 1 \rfloor - 1 } ) \log q ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \right] } \\ & { \quad = \displaystyle \sum _ { s = 1 } ^ { \lfloor \eta } p ( c ^ { \lfloor k \rfloor } ) \sum _ { \tau ^ { \lfloor k \rfloor } } \left[ p ( \tau ^ { \lfloor k \rfloor } | c ^ { \ell } , c ^ { \lfloor k - 1 \rfloor } ) \log q ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \right] } \\ & { \quad = \displaystyle \sum _ { s = 1 } ^ { \lfloor \eta } p ( c ^ { \lfloor k \rfloor } ) \sum _ { \tau ^ { \lfloor k \rfloor } } \left[ p ( \tau ^ { \lfloor k \rfloor } | c ^ { \lfloor k - 1 \rfloor - 1 } ) \log q ( c ^ { \lfloor k \rfloor - 1 } , \tau ^ { \lfloor k \rfloor } ) \right] } \\ & \quad = \displaystyle \sum _ { s = 1 } ^ { \lfloor \eta \rfloor } p ( c ^ { \lfloor k \rfloor } ) \sum _ { \tau ^ { \lfloor k \rfloor } } \end{array}
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
where the last step follows from the causal restriction that future provided variables $( c ^ { t } )$ do not influence earlier predicted variables ( $\tau ^ { 1 : t }$ consists of states up to time $t$ . $c _ { t }$ does not effect state $s _ { t }$ ). Putting the result in equation 8 in equation 7 gives,
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
L _ { 1 } ( \pi , q ) = \sum _ { t } \mathbb { E } _ { c ^ { 1 : t } \sim p ( c ^ { 1 : t } ) , a ^ { t - 1 } \sim \pi ( \cdot | s ^ { t - 1 } , c ^ { 1 : t - 1 } ) } \left[ \log q ( c ^ { t } | c ^ { 1 : t - 1 } , \tau ^ { 1 : t } ) \right] + H ( c ) \le I ( \tau \to c )
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
Table 3: Experiment settings for all the different environments for both DirectedInfo-GAIL and VAE-pretraining step respectively.
|
| 274 |
+
|
| 275 |
+
<table><tr><td colspan="4">Directed Info-GAIL</td><td colspan="2">VAE pre-training</td></tr><tr><td>Environment</td><td>Epochs</td><td>Batch Size</td><td>posterior 入</td><td>Epochs</td><td>Batch Size</td></tr><tr><td>Discrete</td><td>1000</td><td>256</td><td>0.1</td><td>500</td><td>32</td></tr><tr><td>Circle-World</td><td>1000</td><td>512</td><td>0.01</td><td>1000</td><td>16</td></tr><tr><td>Pendulum (both)</td><td>2000</td><td>1024</td><td>0.01</td><td>1000</td><td>16</td></tr><tr><td>Hopper-v2</td><td>5000</td><td>4096</td><td>0.01</td><td>2000</td><td>32</td></tr><tr><td>Walker2d-v2</td><td>5000</td><td>8192</td><td>0.001</td><td>2000</td><td>32</td></tr></table>
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 7: Latent variable assignment on the expert trajectories in Circle-World (a) with and (b) without smoothing penalty $L _ { s }$ . Blue and green colors represent the two different values of the context variable. The centres of the two circles are shifted for clarity.
|
| 279 |
+
|
| 280 |
+
Thus, by maximizing directed information instead of mutual information, we can learn a posterior distribution over the next latent factor $c$ given the latent factors discovered up to now and the trajectory followed up to now, thereby removing the dependence on the future trajectory. In practice, we do not consider the $H ( c )$ term. This gives us the objective,
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\operatorname* { m i n } _ { \pi , q } \operatorname* { m a x } _ { D } \mathbb { E } _ { \pi } [ \log D ( s , a ) ] + \mathbb { E } _ { \pi _ { E } } [ 1 - \log D ( s , a ) ] - \lambda _ { 1 } L _ { 1 } ( \pi , q ) - \lambda _ { 2 } H ( \pi ) .
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
In practice, we fix $q$ from the VAE pre-training and only minimize over the policy $\pi$ in equation 4.
|
| 287 |
+
|
| 288 |
+
# A.2 IMPLEMENTATION DETAILS
|
| 289 |
+
|
| 290 |
+
Table 3 lists the experiment settings for all of the different environments. We use multi-layer perceptrons for our policy (generator), value, reward (discriminator) and posterior function representations. Each network consisted of 2 hidden layers with 64 units in each layer and ReLU as our non-linearity function. We used Adam (Kingma & Ba, 2014) as our optimizer setting an initial learning rate of $3 e ^ { - 4 }$ . Further, we used the Proximal Policy Optimization algorithm (Schulman et al., 2017) to train our policy network with $\epsilon = 0 . 2$ . For the VAE pre-training step we set the VAE learning rate also to $3 e ^ { - \hat { 4 } }$ . For the Gumbel-Softmax distribution we set an initial temperature $\tau = 5 . 0$ . The temperature is annealed using using an exponential decay with the following schedule $\tau = \operatorname* { m a x } ( 0 . 1 , \stackrel { - } { \exp } ^ { - k t } )$ , where $k = 3 e - 3$ and $t$ is the current epoch.
|
| 291 |
+
|
| 292 |
+
# A.3 CIRCLE-WORLD SMOOTHING
|
| 293 |
+
|
| 294 |
+
In the Circle-World experiment, we added another loss term $L _ { s }$ to VAE pre-training loss $L _ { V A E }$ , which penalizes the number of times the latent variable switches from one value to another.
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
L _ { s } = \sum _ { t } \left[ 1 - \frac { c _ { t - 1 } \cdot c _ { t } } { \operatorname* { m a x } ( | | c _ { t - 1 } | | _ { 2 } , | | c _ { t } | | _ { 2 } ) } \right]
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 8: PCA Visualization for Hopper and Walker environment with sub-task latent variable of size 4.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 9: Results on Hopper environment with sub-task latent variable of size 8.
|
| 305 |
+
|
| 306 |
+
Figure 7 shows the segmentation of expert trajectories with and without the $L _ { s }$ term. We observed that without adding the smoothing penalty, the VAE learns to segment the expert trajectories into semi-circles as shown in Figure 7(a). While a valid solution, this does not match with the intuitive segmentation of the task into two sub-tasks of drawing circles in clockwise and counter-clockwise directions. The smoothing term can be thought of as a prior, forcing the network to change the latent variable as few times as possible. This helps reach a solution where the network switches between latent variables only when required. Figure 7(b) shows an example of segmentation obtained on expert trajectories after smoothing. Thus, adding more terms to the VAE pre-training loss can be a good way to introduce priors and bias solutions towards those that match with human notion of sub-tasks.
|
| 307 |
+
|
| 308 |
+
# A.4 PCA VISUALIZATION OF SUB-TASKS
|
| 309 |
+
|
| 310 |
+
In Figure 8, we show the plots expert states, reduced in dimensionality using Principal Component Analysis (PCA), in Hopper and Walker environments. States are color coded by the latent code assigned at these states. We reduced the dimension of states in Hopper from 11 to 2 and in Walker from 17 to 3. These low dimensional representations are able to cover $\sim 9 0 \%$ of variance in the states. As can be seen in the figure, states in different parts of the space get assigned different latent variables. This further shows that our proposed approach is able to segment trajectories in such a way so that states that are similar to each other get assigned to the same segment (latent variable).
|
| 311 |
+
|
| 312 |
+
# A.5 USING LARGER CONTEXT
|
| 313 |
+
|
| 314 |
+
For the following discussion we will represent a $k$ -dimensional categorical variable as belonging to $\Delta ^ { k - 1 }$ simplex. To observe how the dimensionality of the sub-task latent variable affects our proposed approach we show results with larger dimensionality for the categorical latent variable $c _ { t }$ . Since DirectedInfo-GAIL infers the sub-tasks in an unsupervised manner, we expect our approach to output meaningful sub-tasks irrespective of the dimensionality of $c _ { t }$ . Figure 9 shows results for using a higher dimensional sub-task latent variable. Precisely, we assume $c _ { t }$ to be a 8-dimensional one hot vector, i.e., $c _ { t } \in \Delta ^ { 7 }$ .
|
| 315 |
+
|
| 316 |
+
As seen in the above figure, even with a larger context our approach identifies similar basic action primitives as done previously when $c _ { t } \in \bar { \Delta } ^ { 3 }$ . This shows that despite larger dimensionality our approach is able to reuse appropriate context inferred previously. We also visualize the context values for the low-dimensional state-space embedding obtained by PCA. Although not perfectly identical, these context values are similar to the visualizations observed previously for $\bar { c _ { t } } \in \Delta ^ { 3 }$ . Thus our proposed approach is able, to some extent, infer appropriate sub-task representations independent of the dimensionality of the context variable.
|
md/train/BJgr4kSFDS/BJgr4kSFDS.md
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QUERY2BOX: REASONING OVER KNOWLEDGEGRAPHS IN VECTOR SPACE USING BOX EMBEDDINGS
|
| 2 |
+
|
| 3 |
+
Hongyu Ren∗, Weihua $\mathbf { H u } ^ { * }$ , Jure Leskovec Department of Computer Science, Stanford University {hyren,weihuahu,jure}@cs.stanford.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Answering complex logical queries on large-scale incomplete knowledge graphs (KGs) is a fundamental yet challenging task. Recently, a promising approach to this problem has been to embed KG entities as well as the query into a vector space such that entities that answer the query are embedded close to the query. However, prior work models queries as single points in the vector space, which is problematic because a complex query represents a potentially large set of its answer entities, but it is unclear how such a set can be represented as a single point. Furthermore, prior work can only handle queries that use conjunctions $( \wedge )$ and existential quantifiers (∃). Handling queries with logical disjunctions (∨) remains an open problem. Here we propose QUERY2BOX, an embedding-based framework for reasoning over arbitrary queries with $\wedge , \vee$ , and ∃ operators in massive and incomplete KGs. Our main insight is that queries can be embedded as boxes (i.e., hyper-rectangles), where a set of points inside the box corresponds to a set of answer entities of the query. We show that conjunctions can be naturally represented as intersections of boxes and also prove a negative result that handling disjunctions would require embedding with dimension proportional to the number of KG entities. However, we show that by transforming queries into a Disjunctive Normal Form, QUERY2BOX is capable of handling arbitrary logical queries with ∧, ∨, ∃ in a scalable manner. We demonstrate the effectiveness of QUERY2BOX on three large KGs and show that QUERY2BOX achieves up to $2 5 \%$ relative improvement over the state of the art.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Knowledge graphs (KGs) capture different types of relationships between entities, e.g., Canada citizen−−−−→ Hinton. Answering arbitrary logical queries, such as “where did Canadian citizens with Turing Award graduate?”, over such KGs is a fundamental task in question answering, knowledge base reasoning, as well as AI more broadly.
|
| 12 |
+
|
| 13 |
+
First-order logical queries can be represented as Directed Acyclic Graphs (DAGs) (Fig. 1(A)) and be reasoned according to the DAGs to obtain a set of answers (Fig. 1(C)). While simple and intuitive, such approach has many drawbacks: (1) Computational complexity of subgraph matching is exponential in the query size, and thus cannot scale to modern KGs; (2) Subgraph matching is very sensitive as it cannot correctly answer queries with missing relations. To remedy (2) one could impute missing relations (Koller et al., 2007; Džeroski, 2009; De Raedt, 2008; Nickel et al., 2016) but that would only make the KG denser, which would further exacerbate issue (1) (Dalvi & Suciu, 2007; Krompaß et al., 2014).
|
| 14 |
+
|
| 15 |
+
Recently, a promising alternative approach has emerged, where logical queries as well as KG entities are embedded into a low-dimensional vector space such that entities that answer the query are embedded close to the query (Guu et al., 2015; Hamilton et al., 2018; Das et al., 2017). Such approach robustly handles missing relations (Hamilton et al., 2018) and is also orders of magnitude faster, as answering an arbitrary logical query is reduced to simply identifying entities nearest to the embedding of the query in the vector space.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Query2Box reasoning framework. (A) A given conjunctive query “Where did Canadian citizens with Turing Award graduate?” can be represented with a dependency graph. (B) Computation graph specifies the reasoning procedure to obtain a set of answers for the query in (A). (C) Example knowledge graph, where green nodes/entities denote answers to the query. Bold arrows indicate subgraphs that match the query graph in (A). (D) In QUERY2BOX, nodes of the KG are embedded as points in the vector space. We then obtain query embedding according to the computation graph (B) as a sequence of box operations: start with two nodes TuringAward and Canada and apply Win and Citizen projection operators, followed by an intersection operator (denoted as a shaded intersection of yellow and orange boxes) and another projection operator. The final embedding of the query is a green box and query’s answers are the entities inside the box.
|
| 19 |
+
|
| 20 |
+
However, prior work embeds a query into a single point in the vector space. This is problematic because answering a logical query requires modeling a set of active entities while traversing the KG (Fig. 1(C)), and how to effectively model a set with a single point is unclear. Furthermore, it is also unnatural to define logical operators (e.g., set intersection) of two points in the vector space. Another fundamental limitation of prior work is that it can only handle conjunctive queries, a subset of first-order logic that only involves conjunction $( \wedge )$ and existential quantifier (∃), but not disjunction $( \vee )$ . It remains an open question how to handle disjunction effectively in the vector space.
|
| 21 |
+
|
| 22 |
+
Here we present QUERY2BOX, an embedding-based framework for reasoning over KGs that is capable of handling arbitrary Existential Positive First-order (EPFO) logical queries (i.e., queries that include any set of $\wedge , \vee$ , and ∃) in a scalable manner. First, to accurately model a set of entities, our key idea is to use a closed region rather than a single point in the vector space. Specifically, we use a box (axis-aligned hyper-rectangle) to represent a query (Fig. 1(D)). This provides three important benefits: (1) Boxes naturally model sets of entities they enclose; (2) Logical operators (e.g., set intersection) can naturally be defined over boxes similarly as in Venn diagrams (Venn, 1880); (3) Executing logical operators over boxes results in new boxes, which means that the operations are closed; thus, logical reasoning can be efficiently performed in QUERY2BOX by iteratively updating boxes according to the query computation graph (Fig. 1(B)(D)).
|
| 23 |
+
|
| 24 |
+
We show that QUERY2BOX can naturally handle conjunctive queries. We first prove a negative result that embedding EPFO queries to only single points or boxes is intractable as it would require embedding dimension proportional to the number of KG entities. However, we provide an elegant solution, where we transform a given EPFO logical query into a Disjunctive Normal Form (DNF) (Davey & Priestley, 2002), i.e., disjunction of conjunctive queries. Given any EPFO query, QUERY2BOX represents it as a set of individual boxes, where each box is obtained for each conjunctive query in the DNF. We then return nearest neighbor entities to any of the boxes as the answers to the query. This means that to answer any EPFO query we first answer individual conjunctive queries and then take the union of the answer entities.
|
| 25 |
+
|
| 26 |
+
We evaluate QUERY2BOX on three standard KG benchmarks and show: (1) QUERY2BOX provides strong generalization as it can answer complex queries; (2) QUERY2BOX can generalize to new logical query structures that it has never seen during training; (3) QUERY2BOX is able to implicitly impute missing relations as it can answer any EPFO query with high accuracy even when relations involving answering the query are missing in the KG; (4) QUERY2BOX provides up to $2 5 \%$ relative improvement in accuracy of answering EPFO queries over state-of-the-art baselines.
|
| 27 |
+
|
| 28 |
+
# 2 FURTHER RELATED WORK
|
| 29 |
+
|
| 30 |
+
Most related to our work are embedding approaches for multi-hop reasoning over KGs (Bordes et al., 2013; Das et al., 2017; Guu et al., 2015; Hamilton et al., 2018). Crucial difference is that we provide a way to tractably handle a larger subset of the first-order logic (EPFO queries vs. conjunctive queries) and that we embed queries as boxes, which provides better accuracy and generalization.
|
| 31 |
+
|
| 32 |
+
Second line of related work is on structured embeddings, which associate images, words, sentences, or knowledge base concepts with geometric objects such as regions (Erk, 2009; Vilnis et al., 2018; Li et al., 2019), densities (Vilnis & McCallum, 2014; He et al., 2015; Athiwaratkun & Wilson, 2018), and orderings (Vendrov et al., 2016; Lai & Hockenmaier, 2017; Li et al., 2017). While the above work uses geometric objects to model individual entities and their pairwise relations, we use the geometric objects to model sets of entities and reason over those sets. In this sense our work is also related to classical Venn Diagrams (Venn, 1880), where boxes are essentially the Venn Diagrams in vector space, but our boxes and entity embeddings are jointly learned, which allows us to reason over incomplete KGs.
|
| 33 |
+
|
| 34 |
+
Box embeddings have also been used to model hierarchical nature of concepts in an ontology with uncertainty (Vilnis et al., 2018; Li et al., 2019). While our work is also based on box embeddings we employ them for logical reasoning in massive heterogeneous knowledge graphs.
|
| 35 |
+
|
| 36 |
+
# 3 QUERY2BOX: LOGICAL REASONING OVER KGS IN VECTOR SPACE
|
| 37 |
+
|
| 38 |
+
Here we present the QUERY2BOX, where we will define an objective function that allows us to learn embeddings of entities in the KG, and at the same time also learn parameterized geometric logical operators over boxes. Then given an arbitrary EPFO query $q$ (Fig. 1(A)), we will identify its computation graph (Fig. 1(B)), and embed the query by executing a set of geometric operators over boxes (Fig. 1(D)). Entities that are enclosed in the final box embedding are returned as answers to the query (Fig. 1(D)).
|
| 39 |
+
|
| 40 |
+
In order to train our system, we generate a set of queries together with their answers at training time and then learn entity embeddings and geometric operators such that queries can be accurately answered. We show in the following sections that our approach is able to generalize to queries and logical structures never seen during training. Furthermore, as we show in experiments, our approach is able to implicitly impute missing relations and answer queries that would be impossible to answer with traditional graph traversal methods.
|
| 41 |
+
|
| 42 |
+
In the following we first only consider conjunctive queries (conjunction and existential operator) and then we extend our method to also include disjunction.
|
| 43 |
+
|
| 44 |
+
# 3.1 KNOWLEDGE GRAPHS AND CONJUNCTIVE QUERIES
|
| 45 |
+
|
| 46 |
+
We denote a KG as $\mathcal { G } = ( \nu , \mathcal { R } )$ , where $v \in \mathcal V$ represents an entity, and $r \in \mathcal { R }$ is a binary function $r : \mathcal { V } \times \mathcal { V } \{ \mathrm { T r u e , F a l s e } \}$ , indicating whether the relation $r$ holds between a pair of entities or not. In the KG, such binary output indicates the existence of the directed edge between a pair of entities, i.e., $v \stackrel { r } { } v ^ { \prime }$ iff $r ( v , v ^ { \prime } ) = \mathrm { T r u e }$ .
|
| 47 |
+
|
| 48 |
+
Conjunctive queries are a subclass of the first-order logical queries that use existential $\textcircled{1}$ and conjunction $( \wedge )$ operations. They are formally defined as follows.
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { r l } & { q [ V _ { ? } ] = V _ { ? } \cdot \exists V _ { 1 } , \dotsc , V _ { k } : e _ { 1 } \wedge e _ { 2 } \wedge \dotsc \wedge e _ { n } , } \\ & { \mathrm { w h e r e ~ } e _ { i } = r ( v _ { a } , V ) , V \in \{ V _ { ? } , V _ { 1 } , \dotsc , V _ { k } \} , v _ { a } \in \mathcal { V } , r \in \mathcal { R } , } \\ & { \qquad \mathrm { o r ~ } e _ { i } = r ( V , V ^ { \prime } ) , V , V ^ { \prime } \in \{ V _ { ? } , V _ { 1 } , \dotsc , V _ { k } \} , V \neq V ^ { \prime } , r \in \mathcal { R } , } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $v _ { a }$ represents non-variable anchor entity, $V _ { 1 } , \ldots , V _ { k }$ are existentially quantified bound variables, $V _ { ? }$ is the target variable. The goal of answering the logical query $q$ is to find a set of entities $[ [ q ] ] \subseteq \nu$ such that $v \in [ [ q ] ]$ iff $q [ v ] = { \mathrm { T r u e } }$ . We call $[ [ q ] ]$ the denotation set (i.e., answer set) of query $q$ .
|
| 55 |
+
|
| 56 |
+
As shown in Fig. 1(A), the dependency graph is a graphical representation of conjunctive query $q$ where nodes correspond to variable or non-variable entities in $q$ and edges correspond to relations in $q$ . In order for the query to be valid, the corresponding dependency graph needs to be a Directed Acyclic Graph (DAG), with the anchor entities as the source nodes of the DAG and the query target $V _ { ? }$ as the unique sink node (Hamilton et al., 2018).
|
| 57 |
+
|
| 58 |
+
From the dependency graph of query $q$ , one can also derive the computation graph, which consists of two types of directed edges that represent operators over sets of entities:
|
| 59 |
+
|
| 60 |
+
• Projection: Given a set of entities $S \subseteq \nu$ , and relation $r \in \mathcal { R }$ , this operator obtains $\cup _ { v \in S } A _ { r } ( v )$ , where $A _ { r } ( v ) \equiv \{ v ^ { \prime } \in \mathcal { V } : \ r ( v , v ^ { \prime } ) = \mathrm { T r u e } \}$ . • Intersection: Given a set of entity sets $\{ S _ { 1 } , S _ { 2 } , \ldots , S _ { n } \}$ , this operator obtains $\cap _ { i = 1 } ^ { n } S _ { i }$ .
|
| 61 |
+
|
| 62 |
+
For a given query $q$ , the computation graph specifies the procedure of reasoning to obtain a set of answer entities, i.e., starting from a set of anchor nodes, the above two operators are applied iteratively until the unique sink target node is reached. The entire procedure is analogous to traversing KGs following the computation graph (Guu et al., 2015).
|
| 63 |
+
|
| 64 |
+
# 3.2 REASONING OVER SETS OF ENTITIES USING BOX EMBEDDINGS
|
| 65 |
+
|
| 66 |
+
So far we have defined conjunctive queries as computation graphs that can be executed directly over the nodes and edges in the KG. Now, we define logical reasoning in the vector space. Our intuition follows Fig. 1: Given a complex query, we shall decompose it into a sequence of logical operations, and then execute these operations in the vector space. This way we will obtain the embedding of the query, and answers to the query will be entities that are enclosed in the final query embedding box.
|
| 67 |
+
|
| 68 |
+
In the following, we detail our two methodological advances: (1) the use of box embeddings to efficiently model and reason over sets of entities in the vector space, and (2) how to tractably handle disjunction operator (∨), expanding the class of first-order logic that can be modeled in the vector space (Section 3.3).
|
| 69 |
+
|
| 70 |
+
Box embeddings. To efficiently model a set of entities in the vector space, we use boxes (i.e., axis-aligned hyper-rectangles). The benefit is that unlike a single point, the box has the interior; thus, if an entity is in a set, it is natural to model the entity embedding to be a point inside the box. Formally, we operate on $\mathbb { R } ^ { d }$ , and define a box in $\mathbb { R } ^ { d }$ by $\mathbf { p } \overset { \cdot } { = } ( \mathbf { C e n } ( \mathbf { p } ) , \mathbf { \bar { O } f f } ( \mathbf { p } ) ) \overset { \cdot } { \in } \mathbb { R } ^ { 2 d }$ as:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname { B o x } _ { \mathbf { p } } \equiv \{ \mathbf { v } \in \mathbb { R } ^ { d } : \operatorname { C e n } ( \mathbf { p } ) - \operatorname { O f f } ( \mathbf { p } ) \preceq \mathbf { v } \preceq \operatorname { C e n } ( \mathbf { p } ) + \operatorname { O f f } ( \mathbf { p } ) \} ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\preceq$ is element-wise inequality, $\mathbf { C e n } ( \mathbf { p } ) \in \mathbb { R } ^ { d }$ is the center of the box, and $\mathrm { O f f } ( \mathbf { p } ) \in \mathbb { R } _ { \geq 0 } ^ { d }$ is the positive offset of the box, modeling the size of the box. Each entity $v \in \mathcal V$ in KG is assigned a single vector $\mathbf { v } \in \mathbb { R } ^ { d }$ (i.e., a zero-size box), and the box embedding $\mathbf { p }$ models $\{ v \in \mathcal { V } : \mathbf { v } \in \mathrm { B o x } _ { \mathbf { p } } \}$ , i.e., a set of entities whose vectors are inside the box. For the rest of the paper, we use the bold face to denote the embedding, e.g., embedding of $v$ is denoted by $\mathbf { v }$ .
|
| 77 |
+
|
| 78 |
+
Our framework reasons over KGs in the vector space following the computation graph of the query, as shown in Fig. 1(D): we start from the initial box embeddings of the source nodes (anchor entities) and sequentially update the embeddings according to the logical operators. Below, we describe how we set initial box embeddings for the source nodes, as well as how we model projection and intersection operators (defined in Sec. 3.1) as geometric operators that operate over boxes. After that, we describe our entity-to-box distance function and the overall objective that learns embeddings as well as the geometric operators.
|
| 79 |
+
|
| 80 |
+
Initial boxes for source nodes. Each source node represents an anchor entity $v \in \mathcal V$ , which we can regard as a set that only contains the single entity. Such a single-element set can be naturally modeled by a box of size/offset zero centered at $\mathbf { v }$ . Formally, we set the initial box embedding as $( \mathbf { v } , \mathbf { 0 } )$ , where $\mathbf { v } \in \mathbb { R } ^ { d }$ is the anchor entity vector and 0 is a $d$ -dimensional all-zero vector.
|
| 81 |
+
|
| 82 |
+
Geometric projection operator. We associate each relation $r \in \mathcal { R }$ with relation embedding $\mathbf { r } =$ $( \mathbf { C e n } ( \mathbf { r } ) , \mathbf { O f f } ( \mathbf { r } ) ) \in \mathbb { R } ^ { 2 d }$ with $\mathrm { O f f } ( \mathbf { r } ) \succeq \mathbf { 0 }$ . Given an input box embedding p, we model the projection by $\mathbf { p } + \mathbf { r }$ , where we sum the centers and sum the offsets. This gives us a new box with the translated center and larger offset because $\mathrm { O f f } ( \mathbf { r } ) \succeq \mathbf { 0 }$ , as illustrated in Fig. 2(A). The adaptive box size effectively models a different number of entities/vectors in the set.
|
| 83 |
+
|
| 84 |
+
Geometric intersection operator. We model the intersection of a set of box embeddings $\{ \mathbf { p _ { 1 } } , \dotsc , \mathbf { p _ { n } } \}$ as $\mathbf { p } _ { \mathrm { i n t e r } } = ( \mathbf { C e n } ( \mathbf { p } _ { \mathrm { i n t e r } } ) , \mathbf { O f f } ( \mathbf { p } _ { \mathrm { i n t e r } } ) )$ , which is calculated by performing attention over the box centers (Bahdanau et al., 2015) and shrinking the box offset using the sigmoid function:
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: The geometric intuition of the two operations and distance function in QUERY2BOX. (A) Projection generates a larger box with a translated center. $\mathbf { ( B ) }$ Intersection generates a smaller box lying inside the given set of boxes. (C) Distance $\mathrm { d i s t _ { b o x } }$ is the weighted sum of $\mathrm { d i s t _ { o u t s i d e } }$ and $\mathrm { d i s t } _ { \mathrm { i n s i d e } }$ , where the latter is weighted less.
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r l } & { \displaystyle \mathrm { C e n } ( { \bf p } _ { \mathrm { i n t e r } } ) = \sum _ { i } { \bf a } _ { i } \odot \mathrm { C e n } ( { \bf p } _ { \mathrm { i } } ) , ~ { \bf a } _ { i } = \frac { \exp ( \mathrm { M L P } ( { \bf p } _ { \mathrm { i } } ) ) } { \sum _ { j } \exp ( \mathrm { M L P } ( { \bf p } _ { \mathrm { j } } ) ) } , } \\ & { \displaystyle \mathrm { O f f } ( { \bf p } _ { \mathrm { i n t e r } } ) = \mathrm { M i n } ( \{ \mathrm { O f f } ( { \bf p } _ { 1 } ) , \dots , \mathrm { O f f } ( { \bf p } _ { \mathrm { n } } ) \} ) \odot \sigma ( \mathrm { D e e p S e t s } ( \{ { \bf p } _ { 1 } , \dots , { \bf p } _ { \mathrm { n } } \} ) ) , } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\odot$ is the dimension-wise product, $\mathrm { M L P } ( \cdot ) : \mathbb { R } ^ { 2 d } \to \mathbb { R } ^ { d }$ is the Multi-Layer Perceptron, $\sigma ( \cdot )$ is the sigmoid function, $\mathrm { D e e p S e t s } ( \cdot )$ is the permutation-invariant deep architecture (Zaheer et al., 2017), and both $\mathrm { M i n } ( \cdot )$ and $\exp ( \cdot )$ are applied in a dimension-wise manner. Following Hamilton et al. (2018), we model all the deep sets by $\begin{array} { r } { \mathrm { D e e p S e t s } ( \{ \mathbf { x _ { 1 } } , . . . , \mathbf { x _ { N } } \} ) = \mathrm { M L P } ( ( 1 / N ) \cdot \sum _ { i = 1 } ^ { N } \mathrm { M L P } ( \mathbf { x _ { i } } ) ) , } \end{array}$ where all the hidden dimensionalities of the two MLPs are the same as the input dimensionality. The intuition behind our geometric intersection is to generate a smaller box that lies inside a set of boxes, as illustrated in Fig. 2(B).1 Different from the generic deep sets to model the intersection (Hamilton et al., 2018), our geometric intersection operator effectively constrains the center position and models the shrinking set size.
|
| 94 |
+
|
| 95 |
+
Entity-to-box distance. Given a query box $ { \mathbf { q } } \in \mathbb { R } ^ { 2 d }$ and an entity vector $\mathbf { v } \in \mathbb { R } ^ { d }$ , we define their distance as
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\mathrm { d i s t _ { b o x } ( { \bf v } ; { \bf q } ) } = \mathrm { d i s t _ { o u t s i d e } ( { \bf v } ; { \bf q } ) } + \alpha \cdot \mathrm { d i s t _ { i n s i d e } ( { \bf v } ; { \bf q } ) } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\mathbf { q } _ { \mathrm { m a x } } = \mathbf { C e n } ( \mathbf { q } ) + \mathbf { O f f } ( \mathbf { q } ) \in \mathbb { R } ^ { d }$ , $\mathbf { q } _ { \mathrm { m i n } } = \mathbf { C e n } ( \mathbf { q } ) - \mathbf { O f f } ( \mathbf { q } ) \in \mathbb { R } ^ { d }$ and $0 < \alpha < 1$ is a fixed scalar, and
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r l } & { \mathrm { d i s t } _ { \mathrm { o u t s i d e } } ( \mathbf { v } ; \mathbf { q } ) = \| \mathrm { M a x } ( \mathbf { v } - \mathbf { q } _ { \mathrm { m a x } } , \mathbf { 0 } ) + \mathrm { M a x } ( \mathbf { q } _ { \mathrm { m i n } } - \mathbf { v } , \mathbf { 0 } ) \| _ { 1 } , } \\ & { \mathrm { d i s t } _ { \mathrm { i n s i d e } } ( \mathbf { v } ; \mathbf { q } ) = \| \mathrm { C e n } ( \mathbf { q } ) - \mathrm { M i n } ( \mathbf { q } _ { \mathrm { m a x } } , \mathrm { M a x } ( \mathbf { q } _ { \mathrm { m i n } } , \mathbf { v } ) ) \| _ { 1 } . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
As illustrated in Fig. 2(C), $\mathrm { d i s t _ { o u t s i d e } }$ corresponds to the distance between the entity and closest corner/side of the box. Analogously, $\mathrm { d i s t } _ { \mathrm { i n s i d e } }$ corresponds to the distance between the center of the box and its side/corner (or the entity itself if the entity is inside the box).
|
| 108 |
+
|
| 109 |
+
The key here is to downweight the distance inside the box by using $0 < \alpha < 1$ . This means that as long as entity vectors are inside the box, we regard them as “close enough” to the query center $( i . e . , \mathrm { d i s t _ { o u t s i d e } }$ is 0, and $\mathrm { d i s t } _ { \mathrm { i n s i d e } }$ is scaled by $\alpha$ ). When $\alpha = 1$ , $\mathrm { d i s t } _ { \mathrm { b o x } }$ reduces to the ordinary $L _ { 1 }$ distance, i.e., $\| \mathbf { C e n } ( \mathbf { q } ) - \mathbf { v } \| _ { 1 }$ , which is used by the conventional TransE (Bordes et al., 2013) as well as prior query embedding methods (Guu et al., 2015; Hamilton et al., 2018).
|
| 110 |
+
|
| 111 |
+
Training objective. Our next goal is to learn entity embeddings as well as geometric projection and intersection operators.
|
| 112 |
+
|
| 113 |
+
Given a training set of queries and their answers, we optimize a negative sampling loss (Mikolov et al., 2013) to effectively optimize our distance-based model (Sun et al., 2019):
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
L = - \log \sigma \left( \gamma - \mathrm { d i s t } _ { \mathrm { b o x } } ( \mathbf { v } ; \mathbf { q } ) \right) - \sum _ { i = 1 } ^ { k } \frac { 1 } { k } \log \sigma \left( \mathrm { d i s t } _ { \mathrm { b o x } } ( \mathbf { v } _ { \mathbf { i } } ^ { \prime } ; \mathbf { q } ) - \gamma \right) ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\gamma$ represents a fixed scalar margin, $v \in \mathbb { I } q \mathbb { I }$ is a positive entity (i.e., answer to the query $q$ ), and $v _ { i } ^ { \prime } \notin \ [ q ]$ is the $i \cdot$ J K-th negative entity (non-answer to the query $q$ ) and $k$ is the number of negative entities.
|
| 120 |
+
|
| 121 |
+
3.3 TRACTABLE HANDLING OF DISJUNCTION USING DISJUNCTIVE NORMAL FORM
|
| 122 |
+
|
| 123 |
+
So far we have focused on conjunctive queries, and our aim here is to tractably handle in the vector space a wider class of logical queries, called Existential Positive First-order (EPFO) queries (Dalvi & Suciu, 2012) that involve $\vee$ in addition to $\exists$ and $\wedge$ . We specifically focus on EPFO queries whose computation graphs are a DAG, same as that of conjunctive queries (Section 3.1), except that we now have an additional type of directed edge, called union defined as follows:
|
| 124 |
+
|
| 125 |
+
• Union: Given a set of entity sets $\{ S _ { 1 } , S _ { 2 } , \ldots , S _ { n } \}$ , this operator obtains $\cup _ { i = 1 } ^ { n } S _ { i }$
|
| 126 |
+
|
| 127 |
+
A straightforward approach here would be to define another geometric operator for union and embed the query as we did in the previous sections. An immediate challenge for our box embeddings is that boxes can be located anywhere in the vector space, so their union would no longer be a simple box. In other words, union operation over boxes is not closed.
|
| 128 |
+
|
| 129 |
+
Theoretically, we prove a general negative result that holds for any embedding-based method that embeds query $q$ into $\mathbf { q }$ and uses some distance function to retrieve entities, i.e., $\mathrm { d i s t } ( \mathbf { v } ; \mathbf { q } ) \le \beta$ iff $v \in [ [ q ] ]$ . Here, $\operatorname { d i s t } ( \mathbf { v } ; \mathbf { q } )$ is the distance between entity and query embeddings, e.g., $\mathrm { d i s t } _ { \mathrm { b o x } } ( \mathbf { v } ; \mathbf { q } )$ or $\| \mathbf { v } - \mathbf { q } \| _ { 1 }$ , and $\beta$ is a fixed threshold.
|
| 130 |
+
|
| 131 |
+
Theorem 1. Consider any $M$ conjunctive queries $q _ { 1 } , \ldots , q _ { M }$ whose denotation sets $[ [ q _ { 1 } ] ] , \dots , [ [ q _ { M } ] ]$ are disjoint with each other, $\forall \ : i \neq j$ , $[ [ q _ { i } ] ] \cap [ [ q _ { j } ] ] = \emptyset$ . Let $D$ be the $V C$ J K J K dimension of the function class $\{ \operatorname { s i g n } ( \beta - \mathrm { d i s t } ( \cdot ; \mathbf { q } ) ) : \mathbf { q } \in \Xi \}$ J K, where $\Xi$ Krepresents the query embedding space and $\mathrm { s i g n } ( \cdot )$ is the sign function. Then, we need $D \geq M$ to model any EPFO query, i.e., $\operatorname { d i s t } ( \mathbf { v } ; \mathbf { q } ) \leq \beta \Leftrightarrow v \in [ [ q ] ]$ is satisfied for every EPFO query $q$ .
|
| 132 |
+
|
| 133 |
+
The proof is provided in Appendix A, where the key is that with the introduction of the union operation any subset of denotation sets can be the answer, which forces us to model the powerset $\bigl \{ \mathsf { U } _ { q _ { i } \in S } \bigl [ \| q _ { i } \| : \mathsf { S } \subseteq \{ q _ { 1 } , \ldots , q _ { M } \} \bigr \}$ in a vector space.
|
| 134 |
+
|
| 135 |
+
For a real-world KG, there are $M \approx | \nu |$ conjunctive queries with non-overlapping answers. For example, in the commonly-used FB15k dataset (Bordes et al., 2013), derived from the Freebase (Bollacker et al., 2008), we find $M = 1 3 { , } 3 6 5$ , while $| \nu |$ is 14,951 (see Appendix B for the details).
|
| 136 |
+
|
| 137 |
+
Theorem 1 shows that in order to accurately model any EPFO query with the existing framework, the complexity of the distance function measured by the VC dimension needs to be as large as the number of KG entities. This implies that if we use common distance functions based on hyper-plane, Euclidean sphere, or axis-aligned rectangle,2 their parameter dimensionality needs to be $\Theta ( M )$ , which is $\Theta ( \bar { | \nu | } )$ for real KGs we are interested in. In other words, the dimensionality of the logical query embeddings needs to be $\Theta ( | \nu | )$ , which is not low-dimensional; thus not scalable to large KGs and not generalizable in the presence of unobserved KG edges.
|
| 138 |
+
|
| 139 |
+
To rectify this issue, our key idea is to transform a given EPFO query into a Disjunctive Normal Form (DNF) (Davey & Priestley, 2002), i.e., disjunction of conjunctive queries, so that union operation only appears in the last step. Each of the conjunctive queries can then be reasoned in the low-dimensional space, after which we can aggregate the results by a simple and intuitive procedure. In the following, we describe the transformation to DNF and the aggregation procedure.
|
| 140 |
+
|
| 141 |
+
Transformation to DNF. Any first-order logic can be transformed into the equivalent DNF (Davey & Priestley, 2002). We perform such transformation directly in the space of computation graph, i.e., moving all the edges of type “union” to the last step of the computation graph. Let $G _ { q } = ( V _ { q } , E _ { q } )$ be the computation graph for a given EPFO query $q$ , and let $V _ { \mathrm { u n i o n } } \subset V _ { q }$ be a set of nodes whose in-coming edges are of type “union”. For each $v \in V _ { \mathrm { u n i o n } }$ , define $P _ { v } \subset V _ { q }$ as a set of its parent nodes. We first generate N = Qv∈Vunion different computation graphs $\bar { G } _ { q ^ { ( 1 ) } } , \dots , G _ { q ^ { ( N ) } }$ as follows, each with different choices of $v _ { \mathrm { p a r e n t } }$ in the first step.
|
| 142 |
+
|
| 143 |
+
1. For every $v \in V _ { \mathrm { u n i o n } }$ , select one parent node $v _ { \mathrm { p a r e n t } } \in P _ { v }$ .
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: Illustration of converting a computation graph of an EPFO query into an equivalent computation graph of the Disjunctive Normal Form.
|
| 147 |
+
|
| 148 |
+
2. Remove all the edges of type ‘union.’
|
| 149 |
+
|
| 150 |
+
3. Merge $v$ and $v _ { \mathrm { p a r e n t } }$ , while retaining all other edge connections.
|
| 151 |
+
|
| 152 |
+
We then combine the obtained computation graphs $G _ { q ^ { ( 1 ) } } , \dots , G _ { q ^ { ( N ) } }$ as follows to give the final equivalent computation graph.
|
| 153 |
+
|
| 154 |
+
1. Convert the target sink nodes of all the obtained computation graphs into the existentially quantified bound variables nodes.
|
| 155 |
+
2. Create a new target sink node $V _ { ? }$ , and draw directed edges of type “union” from all the above variable nodes to the new target node.
|
| 156 |
+
|
| 157 |
+
An example of the entire transformation procedure is illustrated in Fig. 3. By the definition of the union operation, our procedure gives the equivalent computation graph as the original one. Furthermore, as all the union operators are removed from $G _ { q ^ { ( 1 ) } } , \dots , G _ { q ^ { ( N ) } }$ , all of these computation graphs represent conjunctive queries, which we denote as $\boldsymbol q ^ { ( 1 ) } , \ldots , \boldsymbol q ^ { ( N ) }$ . We can then apply existing framework to obtain a set of embeddings for these conjunctive queries as $\mathbf { q } ^ { ( 1 ) } , \ldots , \mathbf { q } ^ { ( \bar { \mathbf { N } } ) }$ .
|
| 158 |
+
|
| 159 |
+
Aggregation. Next we define the distance function between the given EPFO query $q$ and an entity $v \in \nu$ . Since $q$ is logically equivalent to $q ^ { ( 1 ) } \vee \cdots \vee q ^ { ( N ) }$ , we can naturally define the aggregated distance function using the box distance $\mathrm { d i s t } _ { \mathrm { b o x } }$ :
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\mathrm { d i s t _ { a g g } ( { \bf v } ; { \boldsymbol q } ) } = \mathrm { M i n } ( \{ \mathrm { d i s t _ { b o x } ( { \bf v } ; { \bf q } ^ { ( 1 ) } ) , \dots , d i s t _ { b o x } ( { \bf v } ; { \bf q } ^ { ( N ) } ) } \} ) ,
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $\mathrm { d i s t _ { a g g } }$ is parameterized by the EPFO query $q$ . When $q$ is a conjunctive query, i.e., $N = 1$ , $\mathrm { d i s t } _ { \mathrm { a g g } } ( \mathbf { v } ; q ) ^ { \sim } = \mathrm { d i s t } _ { \mathrm { b o x } } ( \mathbf { v } ; \mathbf { q } )$ . For $N > 1$ , $\mathrm { d i s t _ { a g g } }$ takes the minimum distance to the closest box as the distance to an entity. This modeling aligns well with the union operation; an entity is inside the union of sets as long as the entity is in one of the sets. Note that our DNF-query rewriting scheme is general and is able to extend any method that works for conjunctive queries (e.g., (Hamilton et al., 2018)) to handle more general class of EPFO queries.
|
| 166 |
+
|
| 167 |
+
Computational complexity. The computational complexity of answering an EPFO query with our framework is equal to that of answering the $N$ conjunctive queries. In practice, $N$ might not be so large, and all the $N$ computations can be parallelized. Furthermore, answering each conjunctive query is very fast as it requires us to execute a sequence of simple box operations (each of which takes constant time) and then perform a range search (Bentley & Friedman, 1979) in the embedding space, which can also be done in constant time using techniques based on Locality Sensitive Hashing (Indyk & Motwani, 1998).
|
| 168 |
+
|
| 169 |
+
# 4 EXPERIMENTS
|
| 170 |
+
|
| 171 |
+
Our goal in the experiment section is to evaluate the performance of QUERY2BOX on discovering answers to complex logical queries that cannot be obtained by traversing the incomplete KG. This means, we will focus on answering queries where one or more missing edges in the KG have to be successfully predicted in order to obtain the additional answers.
|
| 172 |
+
|
| 173 |
+
# 4.1 KNOWLEDGE GRAPHS AND QUERY GENERATION
|
| 174 |
+
|
| 175 |
+
We perform experiments on three standard KG benchmarks, FB15k (Bordes et al., 2013), FB15k-237 (Toutanova & Chen, 2015), and NELL995 (Xiong et al., 2017) (see Appendix E for NELL995 pre-processing details). Dataset statistics are summarized in Table 5 in Appendix F.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 4: Query structures considered in the experiments, where anchor entities and relations are to be specified to instantiate logical queries. Naming for each query structure is provided under each subfigure, where ‘p’, ‘i’, and ‘u’ stand for ‘projection’, ‘intersection’, and ‘union’, respectively. Models are trained on the first 5 query structures, and evaluated on all 9 query structures. For example, “3p” is a path query of length three, and “2i” is an intersection of cardinality two.
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>1p</td><td rowspan=1 colspan=1>2p</td><td rowspan=1 colspan=1>3p</td><td rowspan=1 colspan=1>2i</td><td rowspan=1 colspan=1>3i</td><td rowspan=1 colspan=1>ip</td><td rowspan=1 colspan=1>pi</td><td rowspan=1 colspan=1>2u</td><td rowspan=1 colspan=1>up</td></tr><tr><td rowspan=1 colspan=1>FB15k</td><td rowspan=1 colspan=1>10.8</td><td rowspan=1 colspan=1>255.6</td><td rowspan=1 colspan=1>250.0</td><td rowspan=1 colspan=1>90.3</td><td rowspan=1 colspan=1>64.1</td><td rowspan=1 colspan=1>593.8</td><td rowspan=1 colspan=1>190.1</td><td rowspan=1 colspan=1>27.8</td><td rowspan=1 colspan=1>227.0</td></tr><tr><td rowspan=1 colspan=1>FB15k-237</td><td rowspan=1 colspan=1>13.3</td><td rowspan=1 colspan=1>131.4</td><td rowspan=1 colspan=1>215.3</td><td rowspan=1 colspan=1>69.0</td><td rowspan=1 colspan=1>48.9</td><td rowspan=1 colspan=1>593.8</td><td rowspan=1 colspan=1>257.7</td><td rowspan=1 colspan=1>35.6</td><td rowspan=1 colspan=1>127.7</td></tr><tr><td rowspan=1 colspan=1>NELL995</td><td rowspan=1 colspan=1>8.5</td><td rowspan=1 colspan=1>56.6</td><td rowspan=1 colspan=1>65.3</td><td rowspan=1 colspan=1>30.3</td><td rowspan=1 colspan=1>15.9</td><td rowspan=1 colspan=1>310.0</td><td rowspan=1 colspan=1>144.9</td><td rowspan=1 colspan=1>14.4</td><td rowspan=1 colspan=1>62.5</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Table 1: Average number of answer entities of test queries with missing edges grouped by different query structures (for a KG with $10 \%$ edges missing).
|
| 183 |
+
|
| 184 |
+
We follow the standard evaluation protocol in KG literture: Given the standard split of edges into training, test, and validation sets, we first augment the KG to also include inverse relations and effectively double the number of edges in the graph. We then create three graphs: $\mathcal { G } _ { \mathrm { t r a i n } }$ , which only contains training edges and we use this graph to train node embeddings as well as box operators. We then also generate two bigger graphs: $\mathcal { G } _ { \mathrm { v a l i d } }$ , which contains $\mathcal { G } _ { \mathrm { t r a i n } }$ plus the validation edges, and $\mathcal { G } _ { \mathrm { t e s t } }$ which includes $\mathcal { G } _ { \mathrm { v a l i d } }$ as well as the test edges.
|
| 185 |
+
|
| 186 |
+
We consider 9 kinds of diverse query structures shown and named in Fig. 4. We use 5 query structures for training and then evaluate on all the 9 query structures. We refer the reader to Appendix D for full details on query generation and Table 6 in Appendix F for statistics of the generated logical queries. Given a query $q$ , let $[ [ q ] ] _ { \mathrm { t r a i n } }$ , $[ [ q ] ] _ { \mathrm { v a l } }$ , and $[ [ q ] ] _ { \mathrm { t e s t } }$ denote a set of answer entities obtained by Jrunning subgraph matching of $q$ Kon $\mathcal { G } _ { \mathrm { t r a i n } }$ , $\mathcal { G } _ { \mathrm { v a l i d } }$ J K, and $\mathcal { G } _ { \mathrm { t e s t } }$ , respectively. At the training time, we use $[ [ q ] ] _ { \mathrm { t r a i n } }$ as positive examples for the query and other random entities as negative examples. However, J Kat the test/validation time we proceed differently. Note that we focus on answering queries where generalization performance is crucial and at least one edge needs to be imputed in order to answer the queries. Thus, rather than evaluating a given query on the full validation (or test) set $[ [ q ] ] _ { \mathrm { v a l } }$ $\left( \mathbb { I } q \mathbb { I } _ { \mathrm { t e s t } } \right)$ J K of answers, we validate the method only on answers that include missing relations. Given J Khow we constructed ${ \mathcal { G } } _ { \mathrm { t r a i n } } \subseteq { \mathcal { G } } _ { \mathrm { v a l i d } } \subseteq { \mathcal { G } } _ { \mathrm { t e s t } } .$ , we have $[ [ q ] ] _ { \mathrm { t r a i n } } \subseteq [ [ q ] ] _ { \mathrm { v a l } } \subseteq [ [ q ] ] _ { \mathrm { t e s t } }$ and thus we evaluate the method on $[ [ q ] _ { \mathrm { { l v a l } } } \backslash [ [ q ] ] _ { \mathrm { { t r a i n } } }$ J K J K J Kto tune hyper-parameters and then report results identifying answer entities in $[ [ q ] _ { \mathrm { t e s t } } \bar { \backslash } \bar { [ [ q ] ] _ { \mathrm { v a l } } }$ J K. This means we always evaluate on queries/entities that were not part of the J K J Ktraining set and the method has not seen them before. Furthermore, for these queries, traditional graph traversal techniques would not be able to find the answers (due to missing relations).
|
| 187 |
+
|
| 188 |
+
Table 1 shows the average number of answer entities for different query structures. We observe that complex logical queries (especially 2p, 3p, ip, pi, up) indeed require modeling a much larger number of answer entities (often more than 10 times) than the simple 1p queries do. Therefore, we expect our box embeddings to work particularly well in handling complex queries with many answer entities.3
|
| 189 |
+
|
| 190 |
+
# 4.2 EVALUATION PROTOCOL
|
| 191 |
+
|
| 192 |
+
Given a test query $q$ , for each of its non-trivial answers $v \in [ [ q ] ] _ { \mathrm { t e s t } } \backslash [ [ q ] ] _ { \mathrm { v a l } }$ , we use $\mathrm { d i s t } _ { \mathrm { b o x } }$ in Eq. 3 to rank $v$ among $\mathcal { V } \backslash \ [ q \ ] _ { \mathrm { t e s t } }$ . Denoting the rank of $v$ by Rank $( v )$ J K J K, we then calculate evaluation metrics for answering query $q$ K, such as Mean Reciprocal Rank (MRR) and Hits at $K$ $( \mathrm { H } @ K )$ :
|
| 193 |
+
|
| 194 |
+
$$
|
| 195 |
+
\mathrm { M e t r i c s } ( q ) = \frac { 1 } { | [ q ] _ { \mathrm { t e s t } } \setminus [ [ q ] _ { \mathrm { v a l } } ] } \sum _ { \substack { v \in [ [ q ] _ { \mathrm { t e s t } } \setminus [ q ] _ { \mathrm { v a l } } } } f _ { \mathrm { m e t r i c s } } ( \mathrm { R a n k } ( v ) ) ,
|
| 196 |
+
$$
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Method</td><td>Avg</td><td>1p</td><td>2p</td><td>3p</td><td>2i</td><td>3i</td><td>ip</td><td>pi</td><td>2u</td><td>up</td></tr><tr><td colspan="9"></td></tr><tr><td>Q2B</td><td>0.484</td><td>0.786</td><td>0.413</td><td>FB15k 0.303</td><td>0.593</td><td>0.712</td><td>0.211</td><td>0.397</td><td>0.608</td><td>0.33</td></tr><tr><td>GQE</td><td>0.386</td><td>0.636</td><td>0.345</td><td>0.248</td><td>0.515</td><td>0.624</td><td>0.151</td><td>0.310</td><td>0.376</td><td>0.273</td></tr><tr><td>GQE-DOUBLE</td><td>0.384</td><td>0.630</td><td>0.346</td><td>0.250</td><td>0.515</td><td>0.611</td><td>0.153</td><td>0.320</td><td>0.362</td><td>0.271</td></tr><tr><td colspan="9"></td></tr><tr><td>Q2B</td><td>0.268</td><td>0.467</td><td>0.24</td><td>FB15k-237 0.186</td><td>0.324</td><td>0.453</td><td>0.108</td><td>0.205</td><td>0.239</td><td>0.193</td></tr><tr><td>GQE</td><td>0.228</td><td>0.402</td><td>0.213</td><td>0.155</td><td>0.292</td><td>0.406</td><td>0.083</td><td>0.17</td><td>0.169</td><td>0.163</td></tr><tr><td>GQE-DOUBLE</td><td>0.23</td><td>0.405</td><td>0.213</td><td>0.153</td><td>0.298</td><td>0.411</td><td>0.085</td><td>0.182</td><td>0.167</td><td>0.16</td></tr><tr><td colspan="9">NELL995</td></tr><tr><td>Q2B</td><td>0.306</td><td>0.555</td><td>0.266</td><td>0.233</td><td>0.343</td><td>0.48</td><td>0.132</td><td>0.212</td><td>0.369</td><td>0.163</td></tr><tr><td>GQE</td><td>0.247</td><td>0.418</td><td>0.228</td><td>0.205</td><td>0.316</td><td>0.447</td><td>0.081</td><td>0.186</td><td>0.199</td><td>0.139</td></tr><tr><td>GQE-DOUBLE</td><td>0.248</td><td>0.417</td><td>0.231</td><td>0.203</td><td>0.318</td><td>0.454</td><td>0.081</td><td>0.188</td><td>0.2</td><td>0.139</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 2: $\mathrm { H @ 3 }$ results of QUERY2BOX vs. GQE on FB15k, FB15k-237 and NELL995.
|
| 201 |
+
|
| 202 |
+
where $\begin{array} { r } { f _ { \mathrm { m e t r i c s } } ( x ) = \frac { 1 } { x } } \end{array}$ for MRR, and $f _ { \mathrm { m e t r i c s } } ( x ) = \mathbf { 1 } [ x \leq K ]$ for $\mathrm { H @ } K$
|
| 203 |
+
|
| 204 |
+
We then average Eq. 6 over all the queries within the same query structure,4 and report the results separately for different query structures. The same evaluation protocol is applied to the validation stage except that we evaluate on $[ [ q ] _ { \mathrm { v a l } } \backslash [ [ q ] ] _ { \mathrm { t r a i n } }$ rather than $[ [ q ] _ { \mathrm { l e s t } } \backslash [ [ q ] ] _ { \mathrm { v a l } }$ .
|
| 205 |
+
|
| 206 |
+
# 4.3 BASELINE AND MODEL VARIANTS
|
| 207 |
+
|
| 208 |
+
We compare our framework QUERY2BOX against the state-of-the-art GQE (Hamilton et al., 2018). GQE embeds a query to a single vector, and models projection and intersection operators as translation and deep sets (Zaheer et al., 2017), respectively. The $L _ { 1 }$ distance is used as the distance between query and entity vectors. For a fair comparison, we also compare with GQE-DOUBLE (GQE with doubled embedding dimensionality) so that QUERY2BOX and GQE-DOUBLE have the same amount of parameters. Refer to Appendix G for the model hyper-parameters used in our experiments. Although the original GQE cannot handle EPFO queries, we apply our DNF-query rewriting strategy and in our evaluation extend GQE to handle general EPFO queries as well. Furthermore, we perform extensive ablation study by considering several variants of QUERY2BOX (abbreviated as Q2B). We list our method as well as its variants below.
|
| 209 |
+
|
| 210 |
+
• Q2B (our method): The box embeddings are used to model queries, and the attention mechanism is used for the intersection operator.
|
| 211 |
+
• Q2B-AVG: The attention mechanism for intersection is replaced with averaging.
|
| 212 |
+
• Q2B-DEEPSETS: The attention mechanism for intersection is replaced with the deep sets. Q2B-AVG-1P: The variant of Q2B-AVG that is trained with only 1p queries (see Fig. 4); thus, logical operators are not explicitly trained. Q2B-SHAREDOFFSET; The box offset is shared across all queries (every query is represented by a box with the same trainable size).
|
| 213 |
+
|
| 214 |
+
# 4.4 MAIN RESULTS
|
| 215 |
+
|
| 216 |
+
We start by comparing our Q2B with state-of-the-art query embedding method GQE (Hamilton et al., 2018) on FB15k, FB15k-237, and NELL995. As listed in Tables 2, our method significantly and consistently outperforms the state-of-the-art baseline across all the query structures, including those not seen during training as well as those with union operations. On average, we obtain $9 . 8 \%$ $2 5 \%$ relative), $3 . 8 \%$ 7 $1 5 \%$ relative), and $5 . 9 \%$ $24 \%$ relative) higher $\mathrm { H @ 3 }$ than the best baselines on FB15k, FB15k-237, and NELL995, respectively. Notice that naïvely increasing embedding dimensionality in GQE yields limited performance improvement. Our Q2B is able to effectively model a large set of entities by using the box embedding, and achieves a significant performance gain compared with GQE-DOUBLE (with same number of parameters) that represents queries as point vectors. Also notice that Q2B performs well on new queries with the same structure as the training queries as well as on new query structures never seen during training, which demonstrates that Q2B generalizes well within and beyond query structures.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Method</td><td>Avg</td><td>1p</td><td>2p</td><td>3p</td><td>2i</td><td>3i</td><td>ip</td><td>pi</td><td>2u</td><td>up</td></tr><tr><td colspan="9">FB15k</td></tr><tr><td>Q2B</td><td>0.484</td><td>0.786</td><td>0.413</td><td>0.303</td><td>0.593</td><td>0.712</td><td>0.211</td><td>0.397</td><td>0.608</td><td>0.330</td></tr><tr><td>Q2B-AVG</td><td>0.468</td><td>0.779</td><td>0.407</td><td>0.300</td><td>0.577</td><td>0.673</td><td>0.199</td><td>0.345</td><td>0.607</td><td>0.326</td></tr><tr><td>Q2B-DEEPSETS</td><td>0.467</td><td>0.755</td><td>0.407</td><td>0.294</td><td>0.588</td><td>0.699</td><td>0.197</td><td>0.378</td><td>0.562</td><td>0.324</td></tr><tr><td>Q2B-AVG-1P</td><td>0.385</td><td>0.812</td><td>0.262</td><td>0.173</td><td>0.463</td><td>0.529</td><td>0.126</td><td>0.263</td><td>0.653</td><td>0.187</td></tr><tr><td>Q2B-SHAREDOFFSET</td><td>0.372</td><td>0.684</td><td>0.335</td><td>0.232</td><td>0.442</td><td>0.559</td><td>0.144</td><td>0.282</td><td>0.417</td><td>0.252</td></tr><tr><td colspan="9">FB15k-237</td></tr><tr><td>Q2B</td><td>0.268</td><td>0.467</td><td>0.24</td><td>0.186</td><td>0.324</td><td>0.453</td><td>0.108</td><td>0.205</td><td>0.239</td><td>0.193</td></tr><tr><td>Q2B-AVG</td><td>0.249</td><td>0.462</td><td>0.242</td><td>0.182</td><td>0.278</td><td>0.391</td><td>0.101</td><td>0.158</td><td>0.236</td><td>0.189</td></tr><tr><td>Q2B-DEEPSETS</td><td>0.259</td><td>0.458</td><td>0.243</td><td>0.186</td><td>0.303</td><td>0.432</td><td>0.104</td><td>0.187</td><td>0.231</td><td>0.190</td></tr><tr><td>Q2B-AVG-1P</td><td>0.219</td><td>0.457</td><td>0.193</td><td>0.132</td><td>0.251</td><td>0.319</td><td>0.083</td><td>0.142</td><td>0.241</td><td>0.152</td></tr><tr><td>Q2B-SHAREDOFFSET</td><td>0.207</td><td>0.391</td><td>0.199</td><td>0.139</td><td>0.251</td><td>0.354</td><td>0.082</td><td>0.154</td><td>0.15</td><td>0.142</td></tr><tr><td colspan="9">NELL995</td></tr><tr><td>Q2B</td><td>0.306</td><td>0.555</td><td>0.266</td><td>0.233</td><td>0.343</td><td>0.480</td><td>0.132</td><td>0.212</td><td>0.369</td><td>0.163</td></tr><tr><td>Q2B-AVG</td><td>0.283</td><td>0.543</td><td>0.250</td><td>0.228</td><td>0.300</td><td>0.403</td><td>0.116</td><td>0.188</td><td>0.36</td><td>0.161</td></tr><tr><td>Q2B-DEEPSETS</td><td>0.293</td><td>0.539</td><td>0.26</td><td>0.231</td><td>0.317</td><td>0.467</td><td>0.11</td><td>0.202</td><td>0.349</td><td>0.16</td></tr><tr><td>Q2B-AVG-1P</td><td>0.274</td><td>0.607</td><td>0.229</td><td>0.182</td><td>0.277</td><td>0.315</td><td>0.097</td><td>0.18</td><td>0.443</td><td>0.133</td></tr><tr><td>Q2B-SHAREDOFFSET</td><td>0.237</td><td>0.436</td><td>0.219</td><td>0.201</td><td>0.278</td><td>0.379</td><td>0.096</td><td>0.174</td><td>0.217</td><td>0.137</td></tr></table>
|
| 219 |
+
|
| 220 |
+
Table 3: $\mathrm { H @ 3 }$ results of QUERY2BOX vs. several variants on FB15k, FB15k-237 and NELL995.
|
| 221 |
+
|
| 222 |
+
We also conduct extensive ablation studies (Tables 3). We summarize the results as follows:
|
| 223 |
+
|
| 224 |
+
Importance of attention mechanism. First, we show that our modeling of intersection using the attention mechanism is important. Given a set of box embeddings $\{ \mathbf { p _ { 1 } } , \dotsc , \mathbf { p _ { n } } \}$ , Q2B-AVG is the most naïve way to calculate the center of the resulting box embedding $\mathbf { p } _ { \mathrm { i n t e r } }$ while Q2B-DEEPSETS is too flexible and neglects the fact that the center should be a weighted average of $\mathbf { C e n } ( \mathbf { p _ { 1 } } ) , \dots , \mathbf { C e n } ( \mathbf { p _ { n } } )$ Compared with the two methods, Q2B achieves better performance in answering queries that involve intersection operation, e.g., 2i, 3i, pi, ip. Specifically, on FB15k-237, Q2B obtains more than $4 \%$ and $2 \%$ absolute gain in $\mathrm { H @ 3 }$ compared to Q2B-AVG and Q2B-DEEPSETS, respectively.
|
| 225 |
+
|
| 226 |
+
Necessity of training on complex queries. Second, we observe that explicitly training on complex logical queries beyond one-hop path queries (1p in Fig. 4) improves the reasoning performance. Although Q2B-AVG-1P is able to achieve strong performance on 1p and $2 \mathrm { u }$ , where answering $2 \mathrm { u }$ is essentially answering two 1p queries with an additional minimum operation (see Eq. 5 in Section 3.3), Q2B-AVG-1P fails miserably in answering other types of queries involving logical operators. On the other hand, other methods (Q2B, Q2B-AVG, and Q2B-DEEPSETS) that are explicitly trained on the logical queries achieve much higher accuracy, with up to $10 \%$ absolute average improvement of $\mathrm { H @ 3 }$ on FB15k.
|
| 227 |
+
|
| 228 |
+
Adaptive box size for different queries. Third, we investigate the importance of learning adaptive offsets (box size) for different queries. Q2B-SHAREDOFFSET is a variant of our Q2B where all the box embeddings share the same learnable offset. Q2B-SHAREDOFFSET does not work well on all types of queries. This is most likely because different queries have different numbers of answer entities, and the adaptive box size enables us to better model it. In fact, we find that box offset varies significantly across different relations, and one-to-many relations tend to have larger offset embeddings (see Appendix H for the details).
|
| 229 |
+
|
| 230 |
+
# 5 CONCLUSION
|
| 231 |
+
|
| 232 |
+
In this paper we proposed a reasoning framework called QUERY2BOX that can effectively model and reason over sets of entities as well as handle EPFO queries in a vector space. Given a logical query, we first transform it into DNF, embed each conjunctive query into a box, and output entities closest to their nearest boxes. Our approach is capable of handling all types of EPFO queries scalably and accurately. Experimental results on standard KGs demonstrate that QUERY2BOX significantly outperforms the existing work in answering diverse logical queries.
|
| 233 |
+
|
| 234 |
+
# ACKNOWLEDGMENTS
|
| 235 |
+
|
| 236 |
+
We thank William Hamilton, Rex Ying, and Jiaxuan You for their helpful discussion. W.H is supported by Funai Overseas Scholarship and Masason Foundation Fellowship. J.L is a Chan Zuckerberg Biohub investigator. We gratefully acknowledge the support of DARPA under Nos. FA865018C7880 (ASED), N660011924033 (MCS); ARO under Nos. W911NF-16-1-0342 (MURI), W911NF-16-1-0171 (DURIP); NSF under Nos. OAC-1835598 (CINES), OAC-1934578 (HDR); Stanford Data Science Initiative, Wu Tsai Neurosciences Institute, Chan Zuckerberg Biohub, JD.com, Amazon, Boeing, Docomo, Huawei, Hitachi, Observe, Siemens, UST Global.
|
| 237 |
+
|
| 238 |
+
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, ARO, or the U.S. Government.
|
| 239 |
+
|
| 240 |
+
# REFERENCES
|
| 241 |
+
|
| 242 |
+
Carl Allen, Ivana Balazevic, and Timothy M Hospedales. On understanding knowledge graph representation. arXiv preprint arXiv:1909.11611, 2019.
|
| 243 |
+
|
| 244 |
+
Ben Athiwaratkun and Andrew Gordon Wilson. Hierarchical density order embeddings. In International Conference on Learning Representations (ICLR), 2018.
|
| 245 |
+
|
| 246 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 247 |
+
|
| 248 |
+
Jon Louis Bentley and Jerome H Friedman. Data structures for range searching. ACM Computing Surveys (CSUR), 11(4):397–409, 1979.
|
| 249 |
+
|
| 250 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In ACM SIGMOD international conference on Management of data (SIGMOD), pp. 1247–1250. AcM, 2008.
|
| 251 |
+
|
| 252 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2787–2795, 2013.
|
| 253 |
+
|
| 254 |
+
Nilesh Dalvi and Dan Suciu. Efficient query evaluation on probabilistic databases. VLDB, 16(4): 523–544, 2007.
|
| 255 |
+
|
| 256 |
+
Nilesh Dalvi and Dan Suciu. The dichotomy of probabilistic inference for unions of conjunctive queries. Journal of the ACM (JACM), 59(6):30, 2012.
|
| 257 |
+
|
| 258 |
+
Rajarshi Das, Arvind Neelakantan, David Belanger, and Andrew McCallum. Chains of reasoning over entities, relations, and text using recurrent neural networks. In European Chapter of the Association for Computational Linguistics (EACL), pp. 132–141, 2017.
|
| 259 |
+
|
| 260 |
+
Brian A Davey and Hilary A Priestley. Introduction to lattices and order. Cambridge university press, 2002.
|
| 261 |
+
|
| 262 |
+
Luc De Raedt. Logical and relational learning. Springer Science & Business Media, 2008.
|
| 263 |
+
|
| 264 |
+
Sašo Džeroski. Relational data mining. In Data Mining and Knowledge Discovery Handbook, pp. 887–911. Springer, 2009.
|
| 265 |
+
|
| 266 |
+
Katrin Erk. Representing words as regions in vector space. In Proceedings of the Thirteenth Conference on Computational Natural Language Learning, pp. 57–65. Annual Meeting of the Association for Computational Linguistics (ACL), 2009.
|
| 267 |
+
|
| 268 |
+
Kelvin Guu, John Miller, and Percy Liang. Traversing knowledge graphs in vector space. In Empirical Methods in Natural Language Processing (EMNLP), pp. 318–327, 2015.
|
| 269 |
+
|
| 270 |
+
Will Hamilton, Payal Bajaj, Marinka Zitnik, Dan Jurafsky, and Jure Leskovec. Embedding logical queries on knowledge graphs. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2027–2038, 2018.
|
| 271 |
+
|
| 272 |
+
Shizhu He, Kang Liu, Guoliang Ji, and Jun Zhao. Learning to represent knowledge graphs with gaussian embedding. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 623–632. ACM, 2015.
|
| 273 |
+
|
| 274 |
+
Piotr Indyk and Rajeev Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the thirtieth annual ACM symposium on Theory of computing, pp. 604–613. ACM, 1998.
|
| 275 |
+
|
| 276 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 277 |
+
|
| 278 |
+
Daphne Koller, Nir Friedman, Sašo Džeroski, Charles Sutton, Andrew McCallum, Avi Pfeffer, Pieter Abbeel, Ming-Fai Wong, David Heckerman, Chris Meek, et al. Introduction to statistical relational learning. MIT press, 2007.
|
| 279 |
+
|
| 280 |
+
Denis Krompaß, Maximilian Nickel, and Volker Tresp. Querying factorized probabilistic triple databases. In International Semantic Web Conference, pp. 114–129. Springer, 2014.
|
| 281 |
+
|
| 282 |
+
Alice Lai and Julia Hockenmaier. Learning to predict denotational probabilities for modeling entailment. In Annual Meeting of the Association for Computational Linguistics (ACL), pp. 721–730, 2017.
|
| 283 |
+
|
| 284 |
+
Xiang Li, Luke Vilnis, and Andrew McCallum. Improved representation learning for predicting commonsense ontologies. arXiv preprint arXiv:1708.00549, 2017.
|
| 285 |
+
|
| 286 |
+
Xiang Li, Luke Vilnis, Dongxu Zhang, Michael Boratko, and Andrew McCallum. Smoothing the geometry of probabilistic box embeddings. In International Conference on Learning Representations (ICLR), 2019.
|
| 287 |
+
|
| 288 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. In International Conference on Learning Representations (ICLR), 2013.
|
| 289 |
+
|
| 290 |
+
Maximilian Nickel, Kevin Murphy, Volker Tresp, and Evgeniy Gabrilovich. A review of relational machine learning for knowledge graphs. Proceedings of the IEEE, 104(1):11–33, 2016.
|
| 291 |
+
|
| 292 |
+
Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. In International Conference on Learning Representations (ICLR), 2019.
|
| 293 |
+
|
| 294 |
+
Kristina Toutanova and Danqi Chen. Observed versus latent features for knowledge base and text inference. In Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality, pp. 57–66, 2015.
|
| 295 |
+
|
| 296 |
+
Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 2013.
|
| 297 |
+
|
| 298 |
+
Ivan Vendrov, Ryan Kiros, Sanja Fidler, and Raquel Urtasun. Order-embeddings of images and language. In International Conference on Learning Representations (ICLR), 2016.
|
| 299 |
+
|
| 300 |
+
John Venn. I. on the diagrammatic and mechanical representation of propositions and reasonings. The London, Edinburgh, and Dublin philosophical magazine and journal of science, 10(59):1–18, 1880.
|
| 301 |
+
|
| 302 |
+
Luke Vilnis and Andrew McCallum. Word representations via gaussian embedding. In International Conference on Learning Representations (ICLR), 2014.
|
| 303 |
+
|
| 304 |
+
Luke Vilnis, Xiang Li, Shikhar Murty, and Andrew McCallum. Probabilistic embedding of knowledge graphs with box lattice measures. In Annual Meeting of the Association for Computational Linguistics (ACL), 2018.
|
| 305 |
+
|
| 306 |
+
Wenhan Xiong, Thien Hoang, and William Yang Wang. Deeppath: A reinforcement learning method for knowledge graph reasoning. In Empirical Methods in Natural Language Processing (EMNLP), 2017.
|
| 307 |
+
|
| 308 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3391–3401, 2017.
|
| 309 |
+
|
| 310 |
+
# A PROOF OF THEOREM 1
|
| 311 |
+
|
| 312 |
+
Proof. To model any EPFO query, we need to at least model a subset of EPFO queries $\mathcal { Q } = \{ \lor _ { q _ { i } \in S } q _ { i } :$ ${ \cal S } \subseteq \{ q _ { 1 } , \dots , q _ { M } \} \}$ , where the corresponding denotation sets are $\left\{ \cup _ { q _ { i } \in S } \left[ \left[ q _ { i } \right] \right] : S \subseteq \left\{ q _ { 1 } , \ldots , { \overset { \cdot } { q } } _ { M } \right\} \right\}$ . For the sake of modeling $\mathcal { Q }$ J K, without loss of generality, we consider assigning a single entity embedding $\bf v _ { q _ { i } }$ to all $v \in [ [ q _ { i } ] ]$ , so there are $M$ kinds of entity vectors, $\mathbf { v _ { q 1 } } , \dots , \mathbf { v _ { q _ { M } } }$ . To model all queries in $\mathcal { Q }$ J K, it is necessary to satisfy the following.
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\exists \mathbf { v _ { q _ { 1 } } } , \dotsc , \exists \mathbf { v _ { q _ { M } } } , \forall S \subseteq \{ q _ { 1 } , \dotsc , q _ { M } \} , \exists \mathbf { q } _ { \mathbf { S } } \in \Xi , \mathrm { s u c h ~ t h a t ~ d i s t } ( \mathbf { v _ { q _ { i } } } ; \mathbf { q } _ { \mathbf { S } } ) \left\{ \underset { > \beta } \leq \beta \ \mathrm { i f } \ q _ { i } \in S , \right.
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
where qS is the embedding of query $\mathsf { V } _ { q _ { i } \in S } q _ { i }$ . Eq. 7 means that we can learn the $M$ kinds of entity vectors such that for every query in $\mathcal { Q }$ , we can obtain its embedding to model the corresponding set using the distance function. Notice that this is agnostic to the specific algorithm to embed query $\mathsf { V } _ { q \in S } q$ into $\mathbf { q } \mathbf { s }$ ; thus, our result is generally applicable to any method that embeds the query into a single vector.
|
| 319 |
+
|
| 320 |
+
Crucially, satisfying Eq. 7 is equivalent to $\{ \operatorname { s i g n } ( \beta - \mathrm { d i s t } ( \cdot ; \mathbf { q } ) ) : \mathbf { q } \in \Xi \}$ being able to shutter $\{ \mathbf { v _ { q _ { 1 } } } , \dotsc , \mathbf { v _ { q _ { M } } } \}$ , i.e., any binary labeling of the points can be perfectly fit by some classifier in the function class. To sum up, in order to model any EPFO query, we need to at least model any query in $\mathcal { Q }$ , which requires the VC dimension of the distance function to be larger than or equal to $M$
|
| 321 |
+
|
| 322 |
+
# B DETAILS ABOUT COMPUTING $M$ IN THEOREM 1
|
| 323 |
+
|
| 324 |
+
Given the full KG $\mathcal { G } _ { \mathrm { t e s t } }$ for the FB15k dataset, our goal is to find conjunctive queries $q _ { 1 } , \dots , q _ { M }$ such that $[ [ q _ { 1 } ] ] , \dots , [ [ q _ { M } ] ]$ are disjoint with each other. For conjunctive queries, we use two types of queries: J K J K‘1p’ and ‘2i’ whose query structures are shown in Figure 4. On the FB15k, we instantiate 308,006 queries of type $ { \mathrm { \cdot } } 1 { \mathrm { p } } ^ { { \prime } }$ , which we denote by $S _ { \mathrm { 1 p } }$ . Out of all the queries in $S _ { \mathrm { 1 p } }$ , 129,717 queries have more than one answer entities, and we denote such a set of the queries by $S _ { \mathrm { 1 p } } ^ { \prime }$ . We then generate a set of queries of type ‘2i’ by first randomly sampling two queries from $S _ { \mathrm { 1 p } } ^ { \prime }$ and then taking conjunction; we denote the resulting set of queries by $S _ { \mathrm { 2 i } }$ .
|
| 325 |
+
|
| 326 |
+
Now, we use $S _ { \mathrm { 1 p } }$ and $S _ { \mathrm { 2 i } }$ to generate a set of conjunctive queries whose denotation sets are disjoint with each other. First, we prepare two empty sets $\nu _ { \mathrm { s e e n } } = \emptyset$ , and $\mathcal { Q } = \mathcal { Q }$ . Then, for every $q \in S _ { \mathrm { 1 p } }$ , if $\mathcal { V } _ { \mathrm { s e e n } } \cap \ [ q ] = \emptyset$ holds, we let $\mathcal { Q } \mathcal { Q } \cup \{ q \}$ and $\mathcal { V } _ { \mathrm { s e e n } } \mathcal { V } _ { \mathrm { s e e n } } \cup [ [ q ] ]$ . This procedure already gives us $\mathcal { Q }$ J K J K, where we have 10, 812 conjunctive queries whose denotation sets are disjoint with each other. We can further apply the analogous procedure for $S _ { \mathrm { 2 i } }$ , which gives us a further increased $\mathcal { Q }$ , where we have 13, 365 conjunctive queries whose denotation sets are disjoint with each other. Therefore, we get $M = 1 3 , 3 6 5$ .
|
| 327 |
+
|
| 328 |
+
# C EXPERIMENTS ON LINK PREDICTION
|
| 329 |
+
|
| 330 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>FB15k</td><td rowspan=1 colspan=2>FB15k-237</td><td rowspan=1 colspan=2>NELL995</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>H@3</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>H@3</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>H@3</td><td rowspan=1 colspan=1>MRR</td></tr><tr><td rowspan=1 colspan=1>query2box</td><td rowspan=1 colspan=1>0.613</td><td rowspan=1 colspan=1>0.516</td><td rowspan=1 colspan=1>0.331</td><td rowspan=1 colspan=1>0.295</td><td rowspan=1 colspan=1>0.382</td><td rowspan=1 colspan=1>0.303</td></tr><tr><td rowspan=1 colspan=1>query2box-1p</td><td rowspan=1 colspan=1>0.633</td><td rowspan=1 colspan=1>0.531</td><td rowspan=1 colspan=1>0.323</td><td rowspan=1 colspan=1>0.292</td><td rowspan=1 colspan=1>0.415</td><td rowspan=1 colspan=1>0.320</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>0.611</td><td rowspan=1 colspan=1>0.522</td><td rowspan=1 colspan=1>0.318</td><td rowspan=1 colspan=1>0.289</td><td rowspan=1 colspan=1>0.413</td><td rowspan=1 colspan=1>0.320</td></tr></table>
|
| 331 |
+
|
| 332 |
+
Table 4: Performance comparison on the simple link prediction task on the three datasets.
|
| 333 |
+
|
| 334 |
+
In Table 4, we report the link prediction performance (no multi-hop logical reasoning required) following the conventional metrics (taking average over the triples of head, relation, and tail). Here query2box is trained on all five query structures as shown in Figure 4, and query2box-1p is only trained on simple 1p queries. We found that our query2box is comparable or slightly better than TransE on simple link prediction. Note that in the case of simple link prediction, we do not expect a huge performance gain by using box embeddings as link prediction does not involve logical reasoning nor handling a large set of answer entities. Also, we see that even if we train query2box over diverse queries, its performance on link prediction is still comparable to TransE and query2box-1p, which are trained solely on the link prediction task.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 5: Example of the degenerated queries, including (1) $r$ and $r ^ { - 1 }$ appear along one path and (2) same anchor node and relation in intersections.
|
| 338 |
+
|
| 339 |
+
# D DETAILS ON QUERY GENERATION
|
| 340 |
+
|
| 341 |
+
Given $\mathcal { G } _ { \mathrm { t r a i n } }$ , $\mathcal { G } _ { \mathrm { v a l i d } }$ , and $\mathcal { G } _ { \mathrm { t e s t } }$ as defined in Section 4.1, we generate training, validation and test queries of different query structures. During training, we consider the first 5 kinds of query structures. For evaluation, we consider all the 9 query structures in Fig. 4, containing query structures that are both seen and unseen during training time. We instantiate queries in the following way.
|
| 342 |
+
|
| 343 |
+
Given a KG and a query structure (which is a DAG), we use pre-order traversal to assign an entity and a relation to each node and edge in the DAG of query structure to instantiate a query. Namely, we start from the root of the DAG (which is the target node), we sample an entity $e$ uniformly from the KG to be the root, then for every node connected to the root in the DAG, we choose a relation $r$ uniformly from the in-coming relations of $e$ in the KG, and a new entity $e ^ { \prime }$ from the set of entities that reaches $e$ by $r$ in the KG. Then we assign the relation $r$ to the edge and $e ^ { \prime }$ to the node, and move on the process based on the pre-order traversal. This iterative process stops after we assign an entity and relation to every node and edge in DAG. The leaf nodes in the DAG serve as the anchor nodes. Note that during the entity and relation assignment, we specifically filter out all the degenerated queries, as shown in Fig. D. Then we perform a post-order traversal of the DAG on the KG, starting from the anchor nodes, to obtain a set of answer entities to this query.
|
| 344 |
+
|
| 345 |
+
When generating validation/test queries, we explicitly filter out trivial queries that can be fully answered by subgraph matching on $\mathcal { G } _ { \mathrm { t r a i n } } / \mathcal { G } _ { \mathrm { v a l i d } }$ .
|
| 346 |
+
|
| 347 |
+
# E DETAILS OF NELL995 DATASET
|
| 348 |
+
|
| 349 |
+
Here we detail our pre-processing of the NELL995 dataset, which is originally presented by Xiong et al. (2017). Following Allen et al. (2019), we first combine the validation and test sets with the training set to create the whole knowledge graph for NELL995. Then we create new validation and test set splits by randomly selecting 20,000 triples each from the whole knowledge graph. Note that we filter out all the entities that only appear in the validation and test sets but not in the training set.
|
| 350 |
+
|
| 351 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Entities</td><td rowspan=1 colspan=1>Relations</td><td rowspan=1 colspan=1>Training Edges</td><td rowspan=1 colspan=1>Validation Edges</td><td rowspan=1 colspan=1>Test Edges</td><td rowspan=1 colspan=1>Total Edges</td></tr><tr><td rowspan=1 colspan=1>FB15k</td><td rowspan=1 colspan=1>14,951</td><td rowspan=1 colspan=1>1,345</td><td rowspan=1 colspan=1>483,142</td><td rowspan=1 colspan=1>50,000</td><td rowspan=1 colspan=1>59,071</td><td rowspan=1 colspan=1>592,213</td></tr><tr><td rowspan=1 colspan=1>FB15k-237</td><td rowspan=1 colspan=1>14,505</td><td rowspan=1 colspan=1>237</td><td rowspan=1 colspan=1>272,115</td><td rowspan=1 colspan=1>17,526</td><td rowspan=1 colspan=1>20,438</td><td rowspan=1 colspan=1>310,079</td></tr><tr><td rowspan=1 colspan=1>NELL995</td><td rowspan=1 colspan=1>63,361</td><td rowspan=1 colspan=1>200</td><td rowspan=1 colspan=1>114,213</td><td rowspan=1 colspan=1>14,324</td><td rowspan=1 colspan=1>14,267</td><td rowspan=1 colspan=1>142,804</td></tr></table>
|
| 352 |
+
|
| 353 |
+
Table 5: Knowledge graph dataset statistics as well as the split into training, validation, and test sets.
|
| 354 |
+
|
| 355 |
+
<table><tr><td rowspan=1 colspan=1>Queries</td><td rowspan=1 colspan=2>Training</td><td rowspan=1 colspan=2>Validation</td><td rowspan=1 colspan=2>Test</td></tr><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>1p</td><td rowspan=1 colspan=1>others</td><td rowspan=1 colspan=1>1p</td><td rowspan=1 colspan=1>others</td><td rowspan=1 colspan=1>1p</td><td rowspan=1 colspan=1>others</td></tr><tr><td rowspan=1 colspan=1>FB15k</td><td rowspan=1 colspan=1>273,710</td><td rowspan=1 colspan=1>273,710</td><td rowspan=1 colspan=1>59,097</td><td rowspan=1 colspan=1>8,000</td><td rowspan=1 colspan=1>67,016</td><td rowspan=1 colspan=1>8,000</td></tr><tr><td rowspan=1 colspan=1>FB15k-237</td><td rowspan=1 colspan=1>149,689</td><td rowspan=1 colspan=1>149,689</td><td rowspan=1 colspan=1>20,101</td><td rowspan=1 colspan=1>5,000</td><td rowspan=1 colspan=1>22.812</td><td rowspan=1 colspan=1>5,000</td></tr><tr><td rowspan=1 colspan=1>NELL995</td><td rowspan=1 colspan=1>107,982</td><td rowspan=1 colspan=1>107,982</td><td rowspan=1 colspan=1>16,927</td><td rowspan=1 colspan=1>4,000</td><td rowspan=1 colspan=1>17,034</td><td rowspan=1 colspan=1>4,000</td></tr></table>
|
| 356 |
+
|
| 357 |
+
Table 6: Number of training, validation, and test queries generated for different query structures.
|
| 358 |
+
|
| 359 |
+
# F DATASET STATISTICS
|
| 360 |
+
|
| 361 |
+
Table 5 summarizes the basic statistics of the three datasets used in our experiments. Table 6 summarizes the basic statistics of the generated logical queries.
|
| 362 |
+
|
| 363 |
+
# G HYPER-PARAMETERS
|
| 364 |
+
|
| 365 |
+
We use embedding dimensionality of $d = 4 0 0$ and set $\gamma = 2 4$ , $\alpha = 0 . 2$ for the loss in Eq. 4. We train all types of training queries jointly. In every iteration, we sample a minibatch size of 512 queries for each query structure (details in Appendix D), and we sample 1 answer entity and 128 negative entities for each query. We optimize the loss in Eq. 4 using Adam Optimizer (Kingma & Ba, 2015) with learning rate $= 0 . 0 0 0 1$ . We train all models for 250 epochs, monitor the performance on the validation set, and report the test performance.
|
| 366 |
+
|
| 367 |
+
# H ANALYSIS OF LEARNED BOX OFFSET SIZE
|
| 368 |
+
|
| 369 |
+
Here we study the correlation between the box size (measured by the L1 norm of the box offset) and the average number of entities that are contained in 1p queries using the corresponding relation. Table 7 shows the top 10 relations with smallest/largest box sizes. We observe a clear trend that the size of the box has a strong correlation with the number of entities the box encloses. Specifically, we see that one-to-many relations tend to have larger offset embeddings, which demonstrates that larger boxes are indeed used to model sets of more points (entities).
|
| 370 |
+
|
| 371 |
+
<table><tr><td rowspan=1 colspan=1>Top10 relationswith largest box size</td><td rowspan=1 colspan=1>#Ent</td><td rowspan=1 colspan=1>Box size</td></tr><tr><td rowspan=1 colspan=1>Tcommon/.../topic</td><td rowspan=1 colspan=1>3616.0</td><td rowspan=1 colspan=1>147.0</td></tr><tr><td rowspan=1 colspan=1>/user/...taxonomy</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>137.2</td></tr><tr><td rowspan=1 colspan=1>Tcommon/.../category</td><td rowspan=1 colspan=1>1.3</td><td rowspan=1 colspan=1>125.6</td></tr><tr><td rowspan=1 colspan=1>/base/../administrative_area_type</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>123.6</td></tr><tr><td rowspan=1 colspan=1>/medicine/../legal_status</td><td rowspan=1 colspan=1>1.5</td><td rowspan=1 colspan=1>114.9</td></tr><tr><td rowspan=1 colspan=1>/people/.../spouse</td><td rowspan=1 colspan=1>889.8</td><td rowspan=1 colspan=1>114.3</td></tr><tr><td rowspan=1 colspan=1>/sports/.../team</td><td rowspan=1 colspan=1>397.9</td><td rowspan=1 colspan=1>113.9</td></tr><tr><td rowspan=1 colspan=1>/people/.../location_of_ceremony</td><td rowspan=1 colspan=1>132.0</td><td rowspan=1 colspan=1>108.4</td></tr><tr><td rowspan=1 colspan=1>/sports/../team</td><td rowspan=1 colspan=1>83.1</td><td rowspan=1 colspan=1>104.5</td></tr><tr><td rowspan=1 colspan=1>/user/.../subject</td><td rowspan=1 colspan=1>495.0</td><td rowspan=1 colspan=1>104.2</td></tr></table>
|
| 372 |
+
|
| 373 |
+
Table 7: Top 10 relations with smallest/largest box size in FB15k.
|
| 374 |
+
|
| 375 |
+
<table><tr><td rowspan=1 colspan=1>Top10 relationswithsmallestbox size</td><td rowspan=1 colspan=1>#Ent</td><td rowspan=1 colspan=1>Box size</td></tr><tr><td rowspan=1 colspan=1>/architecture/.../owner</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>2.3</td></tr><tr><td rowspan=1 colspan=1>/base/.../dog_breeds</td><td rowspan=1 colspan=1>2.0</td><td rowspan=1 colspan=1>4.0</td></tr><tr><td rowspan=1 colspan=1>/education/.../campuses</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>4.3</td></tr><tr><td rowspan=1 colspan=1>/education/.../educational_institution</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>4.6</td></tr><tr><td rowspan=1 colspan=1>/base/.../collective</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>5.1</td></tr><tr><td rowspan=1 colspan=1>/base/.../.member</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>5.1</td></tr><tr><td rowspan=1 colspan=1>/people/.../appointed_by</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>5.2</td></tr><tr><td rowspan=1 colspan=1>/base/../fashion_models_with_this_hair_color</td><td rowspan=1 colspan=1>2.0</td><td rowspan=1 colspan=1>5.2</td></tr><tr><td rowspan=1 colspan=1>/fictional_universe/.../parents</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>5.5</td></tr><tr><td rowspan=1 colspan=1>/american_football/.../team</td><td rowspan=1 colspan=1>2.0</td><td rowspan=1 colspan=1>6.7</td></tr></table>
|
| 376 |
+
|
| 377 |
+
I MRR RESULTS
|
| 378 |
+
|
| 379 |
+
<table><tr><td>Method</td><td>Avg</td><td>1p</td><td>2p 3p</td><td>2i</td><td>3i</td><td></td><td>ip</td><td>pi</td><td>2u up</td></tr><tr><td colspan="8">FB15k</td></tr><tr><td>Q2B</td><td>0.41</td><td>0.654 0.373</td><td>0.274</td><td>0.488</td><td>0.602</td><td>0.194</td><td>0.339</td><td>0.468</td><td>0.301</td></tr><tr><td>GQE</td><td>0.328</td><td>0.505</td><td>0.320 0.218</td><td>0.439</td><td>0.536</td><td>0.139</td><td>0.272</td><td>0.3</td><td>0.244</td></tr><tr><td>GQE-DOUBLE</td><td>0.326</td><td>0.49 0.3</td><td>0.222</td><td>0.438</td><td>0.532</td><td>0.142</td><td>0.28</td><td>0.285</td><td>0.242</td></tr><tr><td colspan="10">FB15k-237</td></tr><tr><td>Q2B</td><td>0.235 0.4</td><td></td><td>0.225</td><td>0.173</td><td>0.275 0.378</td><td>0.105</td><td></td><td>0.18</td><td>0.198</td><td>0.178</td></tr><tr><td>GQE</td><td>0.203</td><td>0.346</td><td>0.193</td><td>0.145</td><td>0.25</td><td>0.355</td><td>0.086</td><td>0.156</td><td>0.145</td><td>0.151</td></tr><tr><td>GQE-DOUBLE</td><td>0.205</td><td>0.346</td><td>0.191</td><td>0.144</td><td>0.258</td><td>0.361</td><td>0.087</td><td>0.164</td><td>0.144</td><td>0.149</td></tr><tr><td colspan="9">NELL995</td></tr><tr><td>Q2B</td><td>0.254</td><td>0.413</td><td>0.227</td><td>0.208 0.288</td><td>0.414</td><td></td><td>0.125</td><td>0.193</td><td>0.266</td><td>0.155</td></tr><tr><td>GQE</td><td>0.21</td><td>0.311</td><td>0.193</td><td>0.175</td><td>0.273</td><td>0.399</td><td>0.078</td><td>0.168</td><td>0.159</td><td>0.13</td></tr><tr><td>GQE-DOUBLE</td><td>0.211</td><td>0.309</td><td>0.192</td><td>0.174</td><td>0.275</td><td>0.408</td><td>0.08</td><td>0.17</td><td>0.156</td><td>0.129</td></tr></table>
|
| 380 |
+
|
| 381 |
+
Table 8: MRR results of QUERY2BOX vs. GQE on FB15k, FB15k-237 and NELL995.
|
| 382 |
+
|
| 383 |
+
<table><tr><td>Method</td><td>Avg</td><td>1p</td><td>2p</td><td>3p</td><td>2i</td><td>3i</td><td>ip</td><td>pi</td><td>2u</td><td>up</td></tr><tr><td colspan="9">FB15k</td></tr><tr><td>Q2B</td><td>0.41</td><td>0.654</td><td>0.373</td><td>0.274</td><td>0.488</td><td>0.602</td><td>0.194</td><td>0.339</td><td>0.468</td><td>0.301</td></tr><tr><td>Q2B-AVG</td><td>0.396</td><td>0.648</td><td>0.368</td><td>0.27</td><td>0.476</td><td>0.564</td><td>0.182</td><td>0.295</td><td>0.465</td><td>0.3</td></tr><tr><td>Q2B-DEEPSETS</td><td>0.402</td><td>0.631</td><td>0.371</td><td>0.269</td><td>0.499</td><td>0.605</td><td>0.181</td><td>0.325</td><td>0.437</td><td>0.298</td></tr><tr><td>Q2B-AVG-1P</td><td>0.324</td><td>0.688</td><td>0.236</td><td>0.159</td><td>0.378</td><td>0.435</td><td>0.122</td><td>0.225</td><td>0.498</td><td>0.178</td></tr><tr><td>Q2B-SHAREDOFFSET</td><td>0.296</td><td>0.511</td><td>0.273</td><td>0.199</td><td>0.351</td><td>0.444</td><td>0.132</td><td>0.233</td><td>0.311</td><td>0.213</td></tr><tr><td colspan="11">FB15k-237</td></tr><tr><td>Q2B</td><td></td><td>0.235 0.4</td><td>0.225</td><td>0.173</td><td>0.275</td><td>0.378</td><td>0.105</td><td>0.18</td><td>0.198</td><td>0.178</td></tr><tr><td>Q2B-AVG</td><td>0.219</td><td>0.398</td><td>0.222</td><td>0.171</td><td>0.236</td><td>0.328</td><td>0.1</td><td>0.145</td><td>0.193</td><td>0.177</td></tr><tr><td>Q2B-DEEPSETS</td><td>0.23</td><td>0.395</td><td>0.224</td><td>0.172</td><td>0.264</td><td>0.372</td><td>0.101</td><td>0.168</td><td>0.194</td><td>0.176</td></tr><tr><td>Q2B-AVG-1P</td><td>0.196</td><td>0.41</td><td>0.18</td><td>0.122</td><td>0.217</td><td>0.274</td><td>0.085</td><td>0.127</td><td>0.209</td><td>0.145</td></tr><tr><td>Q2B-SHAREDOFFSET</td><td>0.18</td><td>0.328</td><td>0.18</td><td>0.131 NELL995</td><td>0.207</td><td>0.289</td><td>0.083</td><td>0.136</td><td>0.135</td><td>0.132</td></tr><tr><td colspan="11"></td></tr><tr><td>Q2B</td><td>0.254</td><td>0.413</td><td>0.227</td><td>0.208</td><td>0.288</td><td>0.414</td><td>0.125</td><td>0.193</td><td>0.266</td><td>0.155</td></tr><tr><td>Q2B-AVG</td><td>0.235</td><td>0.406</td><td>0.219</td><td>0.2</td><td>0.251</td><td>0.342</td><td>0.114</td><td>0.174</td><td>0.259</td><td>0.149</td></tr><tr><td>Q2B-DEEPSETS</td><td>0.246</td><td>0.405</td><td>0.226</td><td>0.207</td><td>0.275</td><td>0.403</td><td>0.107</td><td>0.182</td><td>0.256</td><td>0.153</td></tr><tr><td>Q2B-AVG-1P</td><td>0.227</td><td>0.468</td><td>0.191</td><td>0.16</td><td>0.234</td><td>0.275</td><td>0.094</td><td>0.162</td><td>0.332</td><td>0.125</td></tr><tr><td>Q2B-SHAREDOFFSET</td><td>0.196</td><td>0.318</td><td>0.187</td><td>0.172</td><td>0.228</td><td>0.312</td><td>0.098</td><td>0.156</td><td>0.169</td><td>0.127</td></tr></table>
|
| 384 |
+
|
| 385 |
+
Table 9: MRR results of QUERY2BOX vs. several variants on FB15k, FB15k-237 and NELL995.
|
md/train/By5ugjyCb/By5ugjyCb.md
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PACT: PARAMETERIZED CLIPPING ACTIVATION FOR QUANTIZED NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep learning algorithms achieve high classification accuracy at the expense of significant computation cost. To address this cost, a number of quantization schemes have been proposed - but most of these techniques focused on quantizing weights, which are relatively smaller in size compared to activations. This paper proposes a novel quantization scheme for activations during training - that enables neural networks to work well with ultra low precision weights and activations without any significant accuracy degradation. This technique, PArameterized Clipping acTivation (PACT), uses an activation clipping parameter $\alpha$ that is optimized during training to find the right quantization scale. PACT allows quantizing activations to arbitrary bit precisions, while achieving much better accuracy relative to published state-of-the-art quantization schemes. We show, for the first time, that both weights and activations can be quantized to 4-bits of precision while still achieving accuracy comparable to full precision networks across a range of popular models and datasets. We also show that exploiting these reduced-precision computational units in hardware can enable a super-linear improvement in inferencing performance due to a significant reduction in the area of accelerator compute engines coupled with the ability to retain the quantized model and activation data in on-chip memories.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep Convolutional Neural Networks (CNNs) have achieved remarkable accuracy for tasks in a wide range of application domains including image processing (He et al. (2016b)), machine translation (Gehring et al. (2017)), and speech recognition (Zhang et al. (2017)). These state-of-the-art CNNs use very deep models, consuming 100s of ExaOps of computation during training and GBs of storage for model and data. This poses a tremendous challenge to widespread deployment, especially in resource constrained edge environments - leading to a plethora of explorations in compressed models that minimize memory footprint and computation while preserving model accuracy as much as possible.
|
| 12 |
+
|
| 13 |
+
Recently, a whole host of different techniques have been proposed to alleviate these computational costs. Among them, reducing the bit-precision of key CNN data structures, namely weights and activations, has gained attention due to its potential to significantly reduce both storage requirements and computational complexity. In particular, several weight quantization techniques (Li & Liu (2016) and Zhu et al. (2017)) showed significant reduction in the bit-precision of CNN weights with limited accuracy degradation. However, prior work (Hubara et al. (2016b); Zhou et al. (2016)) has shown that a straightforward extension of weight quantization schemes to activations incurs significant accuracy degradation in large-scale image classification tasks such as ImageNet (Russakovsky et al. (2015)). Recently, activation quantization schemes based on greedy layer-wise optimization were proposed (Park et al. (2017); Graham (2017); Cai et al. (2017)), but achieve limited accuracy improvement.
|
| 14 |
+
|
| 15 |
+
In this paper, we propose a novel activation quantization technique, PArameterized Clipping acTivation function (PACT), that automatically optimizes the quantization scales during model training. PACT allows significant reductions in the bit-widths needed to represent both weights and activations and opens up new opportunities for trading off hardware complexity with model accuracy.
|
| 16 |
+
|
| 17 |
+
The primary contributions of this work include:
|
| 18 |
+
|
| 19 |
+
1) PACT: A new activation quantization scheme for finding the optimal quantization scale during training. We introduce a new parameter $\alpha$ that is used to represent the clipping level in the activation function and is learnt via back-propagation. $\alpha$ sets the quantization scale smaller than ReLU to reduce the quantization error, but larger than a conventional clipping activation function (used in previous schemes) to allow gradients to flow more effectively. In addition, regularization is applied to $\alpha$ in the loss function to enable faster convergence. We provide reasoning and analysis on the expected effectiveness of PACT in preserving model accuracy.
|
| 20 |
+
|
| 21 |
+
3) Quantitative results demonstrating the effectiveness of PACT on a spectrum of models and datasets. Empirically, we show that: (a) for extremely low bit-precision ( $\leq 2$ -bits for weights and activations), PACT achieves the highest model accuracy compared to all published schemes and (b) 4-bit quantized CNNs based on PACT achieve accuracies similar to single-precision floating point representations.
|
| 22 |
+
4) System performance analysis to demonstrate the trade-offs in hardware complexity for different bit representations vs. model accuracy. We show that a dramatic reduction in the area of the computing engines is possible and use it to estimate the achievable system-level performance gains.
|
| 23 |
+
|
| 24 |
+
The rest of the paper is organized as follows: Section 2 provides a summary of related prior work on quantized CNNs. Challenges in activation quantization are presented in Section 3. We present PACT, our proposed solution for activation quantization in Section 4. In Section 5 we demonstrate the effectiveness of PACT relative to prior schemes using experimental results on popular CNNs. Overall system performance analysis for a representative hardware system is presented in Section 6 demonstrating the observed trade-offs in hardware complexity for different bit representations.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Recently, a whole host of different techniques have been proposed to minimize CNN computation and storage costs. One of the earliest studies in weight quantization schemes (Hwang & Sung (2014) and Courbariaux et al. (2015)) show that it is indeed possible to quantize weights to 1-bit (binary) or 2-bits (ternary), enabling an entire DNN model to fit effectively in resource-constrained platforms (e.g., mobile devices). Effectiveness of weight quantization techniques has been further improved (Li & Liu (2016) and Zhu et al. (2017)), by ternarizing weights using statistical distribution of weight values or by tuning quantization scales during training. However, gain in system performance is limited when only weights are quantized while activations are left in high precision. This is particularly severe in convolutional neural networks (CNNs) since weights are relatively smaller in convolution layers in comparison to fully-connected (FC) layers.
|
| 29 |
+
|
| 30 |
+
To reduce the overhead of activations, prior work (Kim & Smaragdis (2015),Hubara et al. (2016a), and Rastegari et al. (2016)) proposed the use of fully binarized neural networks where activations are quantized using 1-bit as well. More recently, activation quantization schemes using more general selections in bit-precision (Hubara et al. (2016b); Zhou et al. (2016; 2017); Mishra et al. (2017); Mellempudi et al. (2017)) have been studied. However, these techniques show significant degradation in accuracy $( > 1 \% )$ ) for ImageNet tasks (Russakovsky et al. (2015)) when bit precision is reduced significantly $( \leq 2 - b i t s )$ . Improvements to previous logarithmic quantization schemes (Miyashita et al. (2016)) using modified base and offset based on “weighted entropy” of activations have also been studied (Park et al. (2017)). Graham (2017) recommends that normalized activation, in the process of batch normalization (Ioffe & Szegedy (2015), BatchNorm), is a good candidate for quantization. Cai et al. (2017) further exploits the statistics of activations and proposes variants of the ReLU activation function for better quantization. However, such schemes typically rely on local (and greedy) optimizations, and are therefore not adaptable or optimized effectively during training. This is further elaborated in Section 3 where we present a detailed discussion on the challenges in quantizing activations.
|
| 31 |
+
|
| 32 |
+
# 3 CHALLENGES IN ACTIVATION QUANTIZATION
|
| 33 |
+
|
| 34 |
+
Quantization of weights is equivalent to discretizing the hypothesis space of the loss function with respect to the weight variables. Therefore, it is indeed possible to compensate weight quantization errors during model training (Hwang & Sung, 2014; Courbariaux et al., 2015). Traditional activation functions, on the other hand, do not have any trainable parameters, and therefore the errors arising from quantizing activations cannot be directly compensated using back-propagation.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 1: (a) Training error, (b) Validation error across epochs for different activation functions (relu and clipping) with and without quantization for the ResNet20 model using the CIFAR10 dataset
|
| 38 |
+
|
| 39 |
+
Activation quantization becomes even more challenging when ReLU (the activation function most commonly used in CNNs) is used as the layer activation function (ActFn). ReLU allows gradient of activations to propagate through deep layers and therefore achieves superior accuracy relative to other activation functions (Nair & Hinton (2010)). However, as the output of the ReLU function is unbounded, the quantization after ReLU requires a high dynamic range (i.e., more bit-precision). In Fig. 1 we present the training and validation errors of ResNet20 with the CIFAR10 dataset using ReLU and show that accuracy is significantly degraded with ReLU quantizations
|
| 40 |
+
|
| 41 |
+
It has been shown that this dynamic range problem can be alleviated by using a clipping activation function, which places an upper-bound on the output (Hubara et al. (2016b); Zhou et al. (2016)). However, because of layer to layer and model to model differences - it is difficult to determine a globally optimal clipping value. In addition, as shown in Fig 1, even though the training error obtained using clipping with quantization is less than that obtained with quantized ReLU, the validation error is still noticeably higher than the baseline.
|
| 42 |
+
|
| 43 |
+
Recently, this challenge has been partially addressed by applying a half-wave Gaussian quantization scheme to activations (Cai et al. (2017)). Based on the observation that activation after BatchNorm normalization is close to a Gaussian distribution with zero mean and unit variance, they used Lloyd’s algorithm to find the optimal quantization scale for this Gaussian distribution and use that scale for every layer. However, this technique also does not fully utilize the strength of backpropagation to optimally learn the clipping level because all the quantization parameters are determined offline and remain fixed throughout the training process.
|
| 44 |
+
|
| 45 |
+
# 4 PACT: PARAMETERIZED CLIPPING ACTIVATION FUNCTION
|
| 46 |
+
|
| 47 |
+
Building on these insights, we introduce PACT, a new activation quantization scheme in which the ActFn has a parameterized clipping level, $\alpha , \alpha$ is dynamically adjusted via gradient descent-based training with the objective of minimizing the accuracy degradation arising from quantization. In PACT, the conventional ReLU activation function in CNNs is replaced with the following:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
y = P A C T ( x ) = 0 . 5 ( | x | - | x - \alpha | + \alpha ) = { \left\{ \begin{array} { l l } { 0 , } & { x \in ( - \infty , 0 ) } \\ { x , } & { x \in [ 0 , \alpha ) } \\ { \alpha , } & { x \in [ \alpha , + \infty ) } \end{array} \right. }
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\alpha$ limits the range of activation to $[ 0 , \alpha ]$ . The truncated activation output is then linearly quantized to $k$ bits for the dot-product computations, where
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
y _ { q } = r o u n d ( y \cdot \frac { 2 ^ { k } - 1 } { \alpha } ) \cdot \frac { \alpha } { 2 ^ { k } - 1 }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
With this new activation function, $\alpha$ is a variable in the loss function, whose value can be optimized
|
| 60 |
+
during training. For back-propagation, gradient $\frac { \partial y _ { q } } { \partial \alpha }$ can be computed using the Straight-Through α ∂
|
| 61 |
+
Estimator (STE) (Bengio et al. (2013)) to estimate $\frac { \partial y _ { q } } { \partial y }$ as 1. Thus,
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\frac { \partial y _ { q } } { \partial \alpha } = \frac { \partial y _ { q } } { \partial y } \frac { \partial y } { \partial \alpha } = \left\{ 0 , \quad x \in ( - \infty , \alpha ) \right.
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
The larger the $\alpha$ , the more the parameterized clipping function resembles a ReLU Actfn. To avoid large quantization errors due to a wide dynamic range, we include a L2-regularizer for $\alpha$ in the loss function. Fig. 7 illustrates how the value of $\alpha$ changes during full-precision training of CIFAR10- ResNet20 starting with an initial value of 10 and using the L2-regularizer. It can be observed that $\alpha$ converges to values much smaller than the initial value as the training epochs proceed, thereby limiting the dynamic range of activations and minimizing quantization loss.
|
| 68 |
+
|
| 69 |
+
To provide further reasoning on why PACT works, we provide in-depth analysis in Appendix A and B. In particular, we show in Appendix A that PACT is as expressive as ReLU when it is used as an activation function. Further we explain in Appendix B that PACT finds a balancing point between clipping and quantization errors to minimize their impact to classification accuracy.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 2: Evolution of $\alpha$ values during training using a ResNet20 model on the CIFAR10 dataset.
|
| 73 |
+
|
| 74 |
+
4.1 UNDERSTANDING HOW PARAMETERIZED CLIPPING WORKS
|
| 75 |
+
|
| 76 |
+
When activation is quantized, the overall behavior of network parameters is affected by the quantization error during training. To observe the impact of activation quantization during network training, we sweep the clipping parameter $\alpha$ and record the training loss with and without quantization. Figs. $^ { 3 \mathrm { ~ a , b ~ } }$ and 3c show cross-entropy and training loss (cross entropy $^ +$ regularization), respectively, over a range of $\alpha$ for the pre-trained SVHN network. The loaded network is trained with the proposed quantization scheme in which ReLU is replaced with the proposed parameterized clipping ActFn for each of its seven convolution layers. We sweep the value of $\alpha$ one layer at a time, keeping all other parameters (weight $( W )$ , bias $( b )$ , BatchNorm parameters $( \beta , \gamma )$ , and the $\alpha$ of other layers) fixed when computing the cross-entropy and training loss.
|
| 77 |
+
|
| 78 |
+
The cross-entropy computed via full-precision forward-pass of training is shown in Fig. 7b. In this case, the cross-entropy converges to a small value in many layers as $\alpha$ increases, indicating that ReLU is a good activation function when no quantization is applied. But even for the full-precision case, training clipping parameter $\alpha$ may help reduce the cross-entropy for certain layers; for example, ReLU (i.e., $\alpha = \infty$ ) is not optimal for act0 and act6 layers.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 3: Cross-entropy vs $\alpha$ for SVHN image classification.
|
| 82 |
+
|
| 83 |
+
Next, the cross-entropy computed with quantization in the forward-pass is shown in Fig. 3b. With quantization, the cross-entropy increases in most cases as $\alpha$ increases, implying that ReLU is no longer effective. We also observe that the optimal $\alpha$ has different ranges for different layers, motivating the need to "learn" the quantization scale via training. In addition, we observe plateaus of cross-entropy for the certain ranges of $\alpha$ (e.g., act6), leading to difficulties for gradient descent-based training.
|
| 84 |
+
|
| 85 |
+
Finally, in Fig. 3c, we show the total training loss including both the cross-entropy discussed above and the cost from $\alpha$ regularization. The regularization effectively gets rid of the plateaus in the training loss, thereby favoring convergence for gradient-descent based training. At the same time, $\alpha$ regularization does not perturb the global minimum point. For example, the solid circles in Fig. 3c, which are the optimal $\alpha$ extracted from the pre-trained model, are at the minimum of the training loss curves. The regularization coefficient, $\lambda _ { \alpha }$ , discussed in the next section, is an additional hyper-parameter which controls the impact of regularization on $\alpha$ .
|
| 86 |
+
|
| 87 |
+
# 4.2 EXPLORATION OF HYPER-PARAMETERS
|
| 88 |
+
|
| 89 |
+
For this new quantization approach, we studied the scope of $\alpha$ , the choice of initial values of $\alpha$ ,and the impact of regularizing $\alpha$ . We briefly summarize our findings below, and present more detailed analysis in Appendix C.
|
| 90 |
+
|
| 91 |
+
From our experiments, the best scope for $\alpha$ was to share $\alpha$ per layer. This choice also reduces hardware complexity because $\alpha$ needs to be multiplied only once after all multiply-accumulate (MAC) operations in reduced-precision in a layer are completed.
|
| 92 |
+
|
| 93 |
+
Among initialization choices for $\alpha$ , we found it to be advantageous to initialize $\alpha$ to a larger value relative to typical values of activation, and then apply regularization to reduce it during training.
|
| 94 |
+
|
| 95 |
+
Finally, we observed that applying L2-regularization for $\alpha$ with the same regularization parameter $\lambda$ used for weight works reasonably well. We also observed that, as expected, the optimal value for $\lambda _ { \alpha }$ slightly decreases when higher bit-precision is used because more quantization levels result in higher resolution for activation quantization.
|
| 96 |
+
|
| 97 |
+
Additionally, we follow the practice of many other quantized CNN studies (e.g., Hubara et al. (2016b); Zhou et al. (2016)), and do not quantize the first and last layers, as these have been reported to significantly impact accuracy.
|
| 98 |
+
|
| 99 |
+
# 5 EXPERIMENTS
|
| 100 |
+
|
| 101 |
+
We implemented PACT in Tensorflow (Abadi et al. (2015)) using Tensorpack (Zhou et al. (2016)). To demonstrate the effectiveness of PACT, we studied several well-known CNNs. The following is a summary of the Dataset-Network for the tested CNNs. More implementation details can be found in Appendix.D. Note that the baseline networks use the same hyper-parameters and ReLU activation functions as described in the references. For PACT experiments, we only replace ReLU into PACT but the same hyper-parameters are used. All the time the networks are trained from scratch.
|
| 102 |
+
|
| 103 |
+
• CIFAR10-ResNet20 (CIFAR10, Krizhevsky & Hinton (2010)): a convolution (CONV) layer followed by 3 ResNet blocks (16 CONV layers with 3x3 filter) and a final fully-connected (FC) layer.
|
| 104 |
+
• SVHN-SVHN (SVHN, Netzer et al. (2011)): 7 CONV layers followed by 1 FC layer.
|
| 105 |
+
• IMAGENET-AlexNet (AlexNet, Krizhevsky et al. (2012)): 5 parallel-CONV layers followed by 3 FC layers. BatchNorm is used before ReLU.
|
| 106 |
+
• IMAGENET-ResNet18 (ResNet18, He et al. (2016b)): a CONV layer followed by 8 ResNet blocks (16 CONV layers with 3x3 filter) and a final FC layer. "full pre-activation" ResNet structure (He et al. (2016a)) is employed. IMAGENET-ResNet50 (ResNet50, He et al. (2016b)): a CONV layer followed by 16 ResNet “bottleneck” blocks (total 48 CONV layers) and a final FC layer. "full pre-activation" ResNet structure (He et al. (2016a)) is employed.
|
| 107 |
+
|
| 108 |
+
For comparisons, we include accuracy results reported in the following prior work: DoReFa (Zhou et al. (2016)), BalancedQ (Zhou et al. (2017)), WRPN (Mishra et al. (2017)), FGQ (Mellempudi et al. (2017)), WEP (Park et al. (2017)), LPBN (Graham (2017)), and HWGQ (Cai et al. (2017)). Detailed experimental setting for each of these papers, as well as full comparison of accuracy (top-1 and top5) for AlexNet, ResNet18, ResNet50, can be found in Appendix E. In the following section, we present key results demonstrating the effectiveness of PACT relative to prior work.
|
| 109 |
+
|
| 110 |
+
# 5.1 ACTIVATION QUANTIZATION PERFORMANCE
|
| 111 |
+
|
| 112 |
+
We first evaluate our activation quantization scheme using various CNNs. Fig 4 shows training and validation error of PACT for the tested CNNs. Overall, the higher the bit-precision, the closer the training/validation errors are to the full-precision reference. Specifically it can be seen that training using bit-precision higher than 3-bits converges almost identically to the full-precision baseline. The final validation error has less than $1 \%$ difference relative to the full-precision validation error for all cases when the activation bit-precision is at least 4-bits.
|
| 113 |
+
|
| 114 |
+
We further compare activation quantization performance with 3 previous schemes, DoReFa, LPBN, and HWGQ. We use accuracy degradation as the quantization performance metric, which is calculated as the difference between full-precision accuracy and the accuracy for each quantization bit-precision. Fig. 4f shows accuracy degradation (top-1) for ResNet18 (left) and ResNet50 (right) for increasing activation bit-precision, when the same weight bit-precision is used for each quantization scheme (indicated within the parenthesis). Overall, we observe that accuracy degradation is reduced as we increase the bit-precision of activations. For both ResNet18 and ResNet50, PACT achieves consistently lower accuracy degradation compared to the other quantization schemes, demonstrating the robustness of PACT relative to prior quantization approaches.
|
| 115 |
+
|
| 116 |
+
# 5.2 PACT PERFORMANCE FOR QUANTIZED CNNS
|
| 117 |
+
|
| 118 |
+
In this section, we demonstrate that although PACT targets activation quantization, it does not preclude us from using weight quantization as well. We used PACT to quantize activation of CNNs, and DoReFa scheme to quantize weights. Table 1 summarizes top-1 accuracy of PACT for the tested CNNs (CIFAR10, SVHN, AlexNet, ResNet18, and ResNet50). We also show the accuracy of CNNs when both the weight and activation are quantized by DoReFa’s scheme. As can be seen, with 4 bit precision for both weights and activation, PACT achieves full-precision accuracy consistently across the networks tested. To the best of our knowledge, this is the lowest bit precision for both weights and activation ever reported, that can achieve near $( \leq 1 \% )$ ) full-precision accuracy.
|
| 119 |
+
|
| 120 |
+
We further compare the performance of PACT-based quantized CNNs with 7 previous quantization schemes (DoReFa, BalancedQ, WRPN, FGQ, WEP, LPBN, and HWGQ). Fig. 5 shows comparison of accuracy degradation (top-1) for AlexNet, ResNet18, and ResNet50. Overall, the accuracy degradation decreases as bit-precision for activation or weight increases. For example, in Fig. 5a, the accuracy degradation decreases when activation bit-precision increases given the same weight precision or when weight bit-precision increases given the same activation bit-precision. PACT outperforms other schemes for all the cases. In fact, AlexNet even achieves marginally better accuracy (i.e., negative accuracy degradation) using PACT instead of full-precision.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: (a-e) Training and valid error with different bit-precision for various CNNs. (f) Comparison of accuracy degradation for ResNet18 (left) and ResNet50 (right). The lower the better.
|
| 124 |
+
|
| 125 |
+
# 6 SYSTEM-LEVEL PERFORMANCE GAIN
|
| 126 |
+
|
| 127 |
+
In this section, we demonstrate the gain in system performance as a result of the reduction in bit-precision achieved using PACT-CNN. To this end, as shown in Fig. 6(a), we consider a DNN accelerator system comprising of a DNN accelerator chip, comprising of multiple cores, interfaced with an external memory. Each core consists of a 2D-systolic array of fixed-point multiply-andaccumulate (MAC) processing elements on which DNN layers are executed. Each core also contains an on-chip memory, which stores the operands that are fed into the MAC processing array.
|
| 128 |
+
|
| 129 |
+
To estimate system performance at different bit precisions, we studied different versions of the DNN accelerator each comprising the same amount of on-chip memory, external memory bandwidth, and occupying iso-silicon area. First, using real hardware implementations in a state of the art technology $( 1 4 \ \mathrm { n m } \ C \mathbf { M } \mathrm { O S } )$ ), we accurately estimate the reduction in the MAC area achieved by aggressively scaling bit precision. As shown in Fig. 6(b), we achieve ${ \sim } 1 4 \times$ improvement in density when the bit-precisions of both activations and weights are uniformly reduced from 16 bits to 2 bits.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 5: Comparison of accuracy degradation (Top-1) for (a) AlexNet, (b) ResNet18, and (c) ResNet50.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 6: (a)System architecture and parameters, (b) Variation in MAC area with bit-precision and (b) Speedup at different quantizations for inference using ResNet50 DNN
|
| 136 |
+
|
| 137 |
+
Next, to translate the reduction in area to improvement in overall performance, we built a precisionconfigurable MAC unit, whose bit precision can be modulated dynamically. The peak compute capability (FLOPs) of the MAC unit varied such that we achieve iso-area at each precision. Note that the total on-chip memory and external bandwidth remains constant at all precisions. We estimate the overall system performance using DeepMatrix, a detailed performance modelling framework for DNN accelerators (Venkataramani et al.).
|
| 138 |
+
|
| 139 |
+
Fig. 6(c) shows the gain in inference performance for the ResNet50 DNN benchmark. We study the performance improvement using different external memory bandwidths, namely, a bandwidth unconstrained system (infinite memory bandwidth) and two bandwidth constrained systems at 32 and 64 GBps. In the bandwidth unconstrained scenario, the gain in performance is limited by how amenable it is to parallelize the work. In this case, we see a near-linear increase in performance for upto 4 bits and a small drop at extreme quantization levels (2 bits).
|
| 140 |
+
|
| 141 |
+
Practical systems, whose bandwidths are constrained, (surprisingly) exhibit a super-linear growth in performance with quantization. For example, when external bandwidth is limited to 64 GBps, quantizing from 16 to 4 bits leads to a $4 \times$ increase in peak FLOPs but a $4 . 5 \times$ improvement in performance. This is because, the total amount of on-chip memory remains constant, and at very low precision some of the data-structures begin to fit within the memory present in the cores, thereby avoiding data transfers from the external memory. Consequently, in bandwidth limited systems, reducing the amount of data transferred from off-chip can provide an additional boost in system performance beyond the increase in peak FLOPs. Note that for the 4 and 2 bit precision configurations, we still used 8 bit precision to execute the first and last layers of the DNN. If we are able to quantize the first and last layers as well to 4 or 2 bits, we estimate an additional $1 . 2 4 \times$ improvement in performance, motivating the need to explore ways to quantize the first and last layers.
|
| 142 |
+
|
| 143 |
+
Table 1: Comparison of top-1 accuracy between DoReFa and PACT. Weights are quantized with DoReFa scheme, whereas activations are quantized with our scheme. Note that CNNs with 4b quantization based on our scheme achieves full-precision accuracy for all the CNNs we explored.
|
| 144 |
+
|
| 145 |
+
<table><tr><td rowspan=2 colspan=1>Network</td><td rowspan=2 colspan=1>FullPrec</td><td rowspan=1 colspan=4>DoReFa</td><td rowspan=1 colspan=4>PACT</td></tr><tr><td rowspan=1 colspan=1>2b</td><td rowspan=1 colspan=1>3b</td><td rowspan=1 colspan=1>4b</td><td rowspan=1 colspan=1>5b</td><td rowspan=1 colspan=1>2b</td><td rowspan=1 colspan=1>3b</td><td rowspan=1 colspan=1>4b</td><td rowspan=1 colspan=1>5b</td></tr><tr><td rowspan=1 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>0.916</td><td rowspan=1 colspan=1>0.882</td><td rowspan=1 colspan=1>0.899</td><td rowspan=1 colspan=1>0.905</td><td rowspan=1 colspan=1>0.904</td><td rowspan=1 colspan=1>0.897</td><td rowspan=1 colspan=1>0.911</td><td rowspan=1 colspan=1>0.913</td><td rowspan=1 colspan=1>0.917</td></tr><tr><td rowspan=1 colspan=1>SVHN</td><td rowspan=1 colspan=1>0.978</td><td rowspan=1 colspan=1>0.976</td><td rowspan=1 colspan=1>0.976</td><td rowspan=1 colspan=1>0.975</td><td rowspan=1 colspan=1>0.975</td><td rowspan=1 colspan=1>0.977</td><td rowspan=1 colspan=1>0.978</td><td rowspan=1 colspan=1>0.978</td><td rowspan=1 colspan=1>0.979</td></tr><tr><td rowspan=1 colspan=1>AlexNet</td><td rowspan=1 colspan=1>0.551</td><td rowspan=1 colspan=1>0.536</td><td rowspan=1 colspan=1>0.550</td><td rowspan=1 colspan=1>0.549</td><td rowspan=1 colspan=1>0.549</td><td rowspan=1 colspan=1>0.550</td><td rowspan=1 colspan=1>0.556</td><td rowspan=1 colspan=1>0.557</td><td rowspan=1 colspan=1>0.557</td></tr><tr><td rowspan=1 colspan=1>ResNet18</td><td rowspan=1 colspan=1>0.702</td><td rowspan=1 colspan=1>0.626</td><td rowspan=1 colspan=1>0.675</td><td rowspan=1 colspan=1>0.681</td><td rowspan=1 colspan=1>0.684</td><td rowspan=1 colspan=1>0.644</td><td rowspan=1 colspan=1>0.681</td><td rowspan=1 colspan=1>0.692</td><td rowspan=1 colspan=1>0.698</td></tr><tr><td rowspan=1 colspan=1>ResNet50</td><td rowspan=1 colspan=1>0.769</td><td rowspan=1 colspan=1>0.671</td><td rowspan=1 colspan=1>0.699</td><td rowspan=1 colspan=1>0.714</td><td rowspan=1 colspan=1>0.714</td><td rowspan=1 colspan=1>0.722</td><td rowspan=1 colspan=1>0.753</td><td rowspan=1 colspan=1>0.765</td><td rowspan=1 colspan=1>0.767</td></tr></table>
|
| 146 |
+
|
| 147 |
+
# 7 CONCLUSION
|
| 148 |
+
|
| 149 |
+
In this paper, we propose a novel activation quantization scheme based on the PArameterized Clipping acTivation function (PACT). The proposed scheme replaces ReLU with an activation function with a clipping parameter, $\alpha$ , that is optimized via gradient descent based training. We provide analysis on why PACT outperforms ReLU when quantization is applied during training. Extensive empirical evaluation using several popular convolutional neural networks, such as CIFAR10, SVHN, AlexNet, ResNet18 and ResNet50, shows that PACT quantizes activations very effectively while simultaneously allowing weights to be heavily quantized. In comparison to all previous quantization schemes, we show that both weights and activations can be quantized much more aggressively (down to 4-bits) - while achieving near $( \leq 1 \% )$ ) full-precision accuracy. In addition, we have shown that the area savings from using reduced-precision MAC units enable a dramatic increase in the number of accelerator cores in the same area, thereby, significantly improving overall system-performance.
|
| 150 |
+
|
| 151 |
+
# REFERENCES
|
| 152 |
+
|
| 153 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
|
| 154 |
+
|
| 155 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron C. Courville. Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation. CoRR, abs/1308.3432, 2013.
|
| 156 |
+
|
| 157 |
+
Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep Learning With Low Precision by Half-Wave Gaussian Quantization. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 158 |
+
|
| 159 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. BinaryConnect: Training Deep Neural Networks with binary weights during propagations. CoRR, abs/1511.00363, 2015.
|
| 160 |
+
|
| 161 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. Convolutional Sequence to Sequence Learning. CoRR, abs/1705.03122, 2017.
|
| 162 |
+
|
| 163 |
+
Benjamin Graham. Low-Precision Batch-Normalized Activations. CoRR, abs/1702.08231, 2017.
|
| 164 |
+
|
| 165 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity Mappings in Deep Residual Networks. CoRR, abs/1603.05027, 2016a.
|
| 166 |
+
|
| 167 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016b.
|
| 168 |
+
|
| 169 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized Neural Networks. NIPs, pp. 4107–4115, 2016a.
|
| 170 |
+
|
| 171 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized Neural Networks: Training Neural Networks with Low Precision Weights and Activations. CoRR, abs/1609.07061, 2016b.
|
| 172 |
+
|
| 173 |
+
Kyuyeon Hwang and Wonyong Sung. Fixed-point Feedforward Deep Neural Network Design Using Weights $+ 1$ , 0, and -1. In IEEE Workshop on Signal Processing Systems (SiPS), pp. 1–6, Oct. 2014.
|
| 174 |
+
|
| 175 |
+
Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In Proceedings of the 32nd International Conference on Machine Learning, pp. 448–456, 2015.
|
| 176 |
+
|
| 177 |
+
Minje Kim and Paris Smaragdis. Bitwise Neural Networks. ICML Workshop on Resource-Efficient Machine Learning, 2015.
|
| 178 |
+
|
| 179 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. International Conference on Learning Representations (ICLR), 2015.
|
| 180 |
+
|
| 181 |
+
Alex Krizhevsky and G Hinton. Convolutional deep belief networks on cifar-10. Unpublished manuscript, 40, 2010.
|
| 182 |
+
|
| 183 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In Advances in Neural Information Processing Systems 25 (NIPS), pp. 1097–1105, 2012.
|
| 184 |
+
|
| 185 |
+
Fengfu Li and Bin Liu. Ternary Weight Networks. CoRR, abs/1605.04711, 2016.
|
| 186 |
+
|
| 187 |
+
Naveen Mellempudi, Abhisek Kundu, Dheevatsa Mudigere, Dipankar Das, Bharat Kaul, and Pradeep Dubey. Ternary Neural Networks with Fine-Grained Quantization. CoRR, abs/1705.01462, 2017.
|
| 188 |
+
|
| 189 |
+
Asit K. Mishra, Jeffrey J. Cook, Eriko Nurvitadhi, and Debbie Marr. WRPN: Training and Inference using Wide Reduced-Precision Networks. CoRR, abs/1704.03079, 2017.
|
| 190 |
+
|
| 191 |
+
Daisuke Miyashita, Edward H. Lee, and Boris Murmann. Convolutional Neural Networks using Logarithmic Data Representation. CoRR, abs/1603.01025, 2016.
|
| 192 |
+
|
| 193 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified Linear Units Improve Restricted Boltzmann Machines. 27th International Conference on Machine Learning (ICML), pp. 807–814, 2010.
|
| 194 |
+
|
| 195 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, number 2, pp. 5, 2011.
|
| 196 |
+
|
| 197 |
+
Eunhyeok Park, Junwhan Ahn, and Sungjoo Yoo. Weighted-Entropy-Based Quantization for Deep Neural Networks. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 198 |
+
|
| 199 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: ImageNet Classification Using Binary Convolutional Neural Networks. CoRR, abs/1603.05279, 2016.
|
| 200 |
+
|
| 201 |
+
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.
|
| 202 |
+
|
| 203 |
+
Swagath Venkataramani, Jungwook Choi, Vijayalakshmi Srinivasan, Kailash Gopalakrishnan, and Leland Chang. POSTER: Design Space Exploration for Performance Optimization of Deep Neural Networks on Shared Memory Accelerators. Proc. PACT 2017.
|
| 204 |
+
|
| 205 |
+
Ying Zhang, Mohammad Pezeshki, Philemon Brakel, Saizheng Zhang, César Laurent, Yoshua Bengio, and Aaron C. Courville. Towards End-to-End Speech Recognition with Deep Convolutional Neural Networks. CoRR, abs/1701.02720, 2017.
|
| 206 |
+
|
| 207 |
+
Shuchang Zhou, Zekun Ni, Xinyu Zhou, He Wen, Yuxin Wu, and Yuheng Zou. DoReFa-Net: Training Low Bitwidth Convolutional Neural Networks with Low Bitwidth Gradients. CoRR, abs/1606.06160, 2016.
|
| 208 |
+
|
| 209 |
+
Shuchang Zhou, Yuzhi Wang, He Wen, Qinyao He, and Yuheng Zou. Balanced Quantization: An Effective and Efficient Approach to Quantized Neural Networks. CoRR, abs/1706.07145, 2017.
|
| 210 |
+
|
| 211 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J. Dally. Trained Ternary Quantization. International Conference on Learning Representations (ICLR), 2017.
|
| 212 |
+
|
| 213 |
+
# APPENDIX A PACT IS AS EXPRESSIVE AS RELU
|
| 214 |
+
|
| 215 |
+
When used as an activation function of the neural network, PACT is as expressive as ReLU. This is because clipping parameter, $\alpha$ , introduced in PACT, allows flexibility in adjusting the dynamic range of activation for each layer. We demonstrate in the simple example below that PACT can reach the same solution as ReLU via SGD.
|
| 216 |
+
|
| 217 |
+
Lemma A.1. Consider a single-neuron network with PACT; $x = w \cdot a ,$ , $y = P A C T ( x )$ , where a is input and w is weight. This network can be trained with SGD to find the output the network with ReLU would produce.
|
| 218 |
+
|
| 219 |
+
Proof. Consider a sample of training data $( a , y ^ { * } )$ . For illustration purposes consider mean-squareerror (MSE) as the cost function: $L = 0 . 5 \cdot ( y ^ { * } - y ) ^ { 2 }$ .
|
| 220 |
+
|
| 221 |
+
If $x \leq \alpha$ , then clearly the network with PACT behaves the same as the network with ReLU.
|
| 222 |
+
|
| 223 |
+
If $x > \alpha$ , then $y = \alpha$ and $\begin{array} { r } { \frac { \partial y } { \partial \alpha } = 1 } \end{array}$ from (1). Thus,
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
{ \frac { \partial L } { \partial \alpha } } = { \frac { \partial L } { \partial y } } \cdot { \frac { \partial y } { \partial \alpha } } = { \frac { \partial L } { \partial y } }
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
Therefore, when $\alpha$ is updated by SGD,
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
\alpha _ { n e w } = \alpha - \eta \frac { \partial L } { \partial \alpha } = \alpha - \eta \frac { \partial L } { \partial y }
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
where $\eta$ is a learning rate. Note that during this update, the weight is not updated as $\begin{array} { r } { \frac { \partial L } { \partial w } = \frac { \partial L } { \partial y } \cdot \frac { \partial y } { \partial x } ( = } \end{array}$ $0 ) \cdot a = 0$ .
|
| 236 |
+
|
| 237 |
+
From MSE, $\begin{array} { r } { \frac { \partial L } { \partial y } = ( y - y ^ { * } ) } \end{array}$ . Therefore, if $y ^ { * } > x$ , $\alpha$ is increased for each update of (5) until $\alpha \geq x$ then the PACT network behaves the same as the ReLU network.
|
| 238 |
+
|
| 239 |
+
Interestingly, if $y ^ { * } \leq y$ or $y < y ^ { \ast } < x$ , $\alpha$ is decreased or increased to converge to $y ^ { * }$ . Note that in this case, ReLU would pass erroneous output $x$ to increase cost function, which needs to be fixed by updating $w$ with $\frac { \partial L } { \partial w }$ . PACT, on the other hand, ignores this erroneous output by directly adapting the dynamic range to match the target output $y ^ { * }$ . In this way, the PACT network can be trained to produce output which converges to the same target that the ReLU network would achieve via SGD.
|
| 240 |
+
|
| 241 |
+
In general cases, = Pi ∂L∂yi , and PACT considers output of neurons together to change the dynamic range. There are two options: (1) if output $x _ { i }$ is not clipped, then the network is trained via back-propagation of gradient to update weight, (2) if output $x _ { i }$ is clipped, then $\alpha$ is increased or decreased based on how close the overall output is to the target. Hence, there are configurations under which SGD would lead to a solution close to the one which the network with ReLU would achieve. Fig. 7 demonstrates that ResNet20 with PACT converges almost identical to the network with ReLU.
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
Figure 7: (a) Training error and (b) validation error of PACT for ResNet20 model on the CIFAR10 dataset. Note that the convergence curve for PACT is almost identical to ReLU, although the dynamic range via trained clipping levels are much lower than ReLU.
|
| 245 |
+
|
| 246 |
+
# APPENDIX B PACT FOR BALANCING CLIPPING AND QUANTIZATION ERRORS
|
| 247 |
+
|
| 248 |
+
In Section 3, when we briefly discussed the challenges in activation quantization, we mentioned that there is a trade-off between errors due to clipping and quantization. As the clipping level increases, larger range of activation can be passed to the next layer of the neural network causing less clipping error $( E r r C l i p _ { i } = m a x ( x _ { i } - \alpha , 0 ) )$ . However, the increased dynamic range incurs larger quantization error, since its magnitude is proportional to the clipping level $\begin{array} { r } { ( E r r Q u a n t { i } \le 0 . 5 \cdot \frac { \alpha } { 2 ^ { k } - 1 } } \end{array}$ , with $k$ -bit quantization). This imposes the challenge of finding a proper clipping level to balance between clipping and quantization errors.
|
| 249 |
+
|
| 250 |
+
This trade-off can be better observed in Fig. 8a, which shows normalized mean-square-error caused by clipping and quantization during training of the CIFAR10-ResNet20 with different clipping levels. It can be seen that activation functions with large dynamic range, such as ReLU, would suffer quantization errors whose magnitude increases exponentially as the bit-precision $k$ decreases. This explains why the network with ReLU fails to converge when the activation is quantized (Fig. 1).
|
| 251 |
+
|
| 252 |
+
PACT can find a balancing point between clipping and quantization errors. As explained in Section A, PACT adjusts dynamic range based on how close the output is to the target. As both clipping and quantization errors distort output far from the target, PACT would increase or decrease the dynamic range during training to minimize both clipping and quantization errors.
|
| 253 |
+
|
| 254 |
+
Fig. 8b shows how PACT balances the clipping and quantization errors during training. CIFAR10- ResNet20 is trained with clipping activation function with varying clipping level $\alpha$ from 1 to 16. When activation is quantized, the network trained with clipping activation shows significant accuracy degradation as $\alpha$ increases. This is consistent with the trend in quantization error we observed in Fig. 8a. In this case, PACT achieves the best accuracy one of the clipping activation could achieve, but without exhaustively sweeping over different clipping levels. In other words, PACT auto-tunes the clipping level to achieve best accuracy without incurring significant computation overhead. PACT’s auto-tuning of dynamic range is critical in efficient yet robust training of large scale quantized neural networks, especially because it does not increase the burden for hyper-parameter tuning. In fact, we used the same hyper-parameters as well as the original network structure for all the models we tested, except replacing ReLU to PACT, when we applied activation quantization.
|
| 255 |
+
|
| 256 |
+
Without quantization, there is a trend that validation error decreases as $\alpha$ increases. Surprisingly, some of the cases even outperforms the ReLU network. In this case, PACT also achieves comparable accuracy as ReLU, confirming its expressivity discussed in Section A.
|
| 257 |
+
|
| 258 |
+
# APPENDIX C EXPLORATION OF HYPER-PARAMETERS AND DESIGN CHOICES
|
| 259 |
+
|
| 260 |
+
In this section, we present details on the hyper-parameters and design choices studied for PACT.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 8: Experiment on CIFAR10-ResNet20 to validate that PACT balances clipping and quantization errors. (a) Trade-off between clipping and quantization error. (b) PACT achieving lowest validation error that clipping activation can achieve without exhaustive search over clipping level $\alpha$ .
|
| 264 |
+
|
| 265 |
+
# C.1 SCOPE OF $\alpha$
|
| 266 |
+
|
| 267 |
+
One of key questions is the optimal scope for $\alpha$ . In other words, determining which neuron activations should share the same $\alpha$ . We considered 3 possible choices: (a) Individual $\alpha$ for each neuron activation, (b) Shared $\alpha$ among neurons within the same output channel, and (c) Shared $\alpha$ within a layer. We empirically studied each of these choices of $\alpha$ (without quantization) using CIFAR10- ResNet20 and determined training and validation error for PACT. As shown in Fig. 9, sharing $\alpha$ per layer is the best choice in terms of accuracy. This is in fact a preferred option from the perspective of hardware complexity as well, since $\alpha$ needs to be multiplied only once after all multiply-accumulate(MAC) operations in a layer are completed.
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 9: Training and validation error of CIFAR10-ResNet20 for PACT with different scope of $\alpha$
|
| 271 |
+
|
| 272 |
+
C.2 INITIAL VALUE AND REGULARIZATION OF $\alpha$
|
| 273 |
+
|
| 274 |
+
The optimization behavior of $\alpha$ can be explained from the formulation of the parameterized clipping function. From Eq. 3 it is clear that, if $\alpha$ is initialized to a very small value, more activations fall into the range for the nonzero gradient, leading to unstable $\alpha$ in the early epochs, potentially causing accuracy degradation. On the other hand, if $\alpha$ is initialized to a very large value, the gradient becomes too small and $\alpha$ may be stuck at a large value, potentially suffering more on quantization error. Therefore, it is intuitive to start with a reasonably large value to cover a wide dynamic range and avoid unstable adaptation of $\alpha$ , but apply regularizer to reduce the value of $\alpha$ so as to alleviate quantization error.
|
| 275 |
+
|
| 276 |
+
In practice, we found that applying L2-regularization for $\alpha$ while setting its coefficient $\lambda _ { \alpha }$ the same as the L2-regularization coefficient for weight, $\lambda$ , works well. Fig. 10 shows that validation error for
|
| 277 |
+
|
| 278 |
+
PACT-quantized CIFAR10-ResNet20 does not significantly vary for a wide range of $\lambda _ { \alpha }$ . We also observed that, as expected, the optimal value for $\lambda _ { \alpha }$ slightly decreases when higher bit-precision is used because more quantization levels result in higher resolution for activation quantization.
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 10: Training and validation error of quantized CIFAR10-ResNet20 for PACT with different regularization parameter $\lambda _ { \alpha }$ .
|
| 282 |
+
|
| 283 |
+
# C.3 QUANTIZATION OF FIRST AND LAST LAYERS
|
| 284 |
+
|
| 285 |
+
Many previous work (e.g., Hubara et al. (2016b); Zhou et al. (2016)) follow the convention to keep the first and last layer in full precision during training, since quantizing those layers lead to substantial accuracy degradation. We empirically studied this for the proposed quantization approach for CIFAR10-ResNet20. In Fig. 11, the only difference among the curves is whether input activation and weight of the first convolution layer or the last fully-connected layer are quantized. As can be seen from the plots, there can be noticeable accuracy degradation if the first or last layers are aggressively quantized. But computation in floating point is very expensive in hardware.
|
| 286 |
+
|
| 287 |
+
Therefore, we further studied the option of quantizing the first and last layers with higher quantization bit-precision than the bit-precision of the other layers. Table 2 shows that independent of the quantization level for the other layers, there is little accuracy degradation if the first and last layer are quantized with 8-bits. This motivates us to employ reduced precision computation even for the first/last layers.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 11: Comparison of accuracy of CIFAR10-ResNet20 with and without quantization of the first and last layers.
|
| 291 |
+
|
| 292 |
+
# APPENDIX D CNN IMPLEMENTATION DETAILS
|
| 293 |
+
|
| 294 |
+
In this section, we summarize details of our CNN implementation as well as our training settings, which is based on the default networks provided by Tensorpack (Zhou et al. (2016)). Unless mentioned otherwise, ReLU following BatchNorm is used for ActFn of the convolution (CONV)
|
| 295 |
+
|
| 296 |
+
Table 2: Validation error (in $\%$ ) of CIFAR10-ResNet20 when first and last layers are quantized with different bit-precision. FL/M/FL means the first and last layers are quantized with Bit-FL bits, while the other layers are quantized with Bit-M bits. NQ represents no quantization is applied.
|
| 297 |
+
|
| 298 |
+
<table><tr><td rowspan=1 colspan=1>BIT-M (bits)</td><td rowspan=1 colspan=4>2</td><td rowspan=1 colspan=4>3</td><td rowspan=1 colspan=4>4</td><td rowspan=1 colspan=4>5</td></tr><tr><td rowspan=1 colspan=1>BIT-FL (bits)</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>32</td></tr><tr><td rowspan=1 colspan=1>FL/M/FL</td><td rowspan=1 colspan=1>21.0</td><td rowspan=1 colspan=1>12.9</td><td rowspan=1 colspan=1>11.1</td><td rowspan=1 colspan=1>10.9</td><td rowspan=1 colspan=1>17.4</td><td rowspan=1 colspan=1>10.0</td><td rowspan=1 colspan=1>9.4</td><td rowspan=1 colspan=1>8.9</td><td rowspan=1 colspan=1>15.9</td><td rowspan=1 colspan=1>9.7</td><td rowspan=1 colspan=1>9.2</td><td rowspan=1 colspan=1>8.9</td><td rowspan=1 colspan=1>18.2</td><td rowspan=1 colspan=1>9.0</td><td rowspan=1 colspan=1>8.4</td><td rowspan=1 colspan=1>8.5</td></tr><tr><td rowspan=1 colspan=1>FL/M/NQ</td><td rowspan=1 colspan=1>21.3</td><td rowspan=1 colspan=1>11.5</td><td rowspan=1 colspan=1>11.5</td><td rowspan=1 colspan=1>10.7</td><td rowspan=1 colspan=1>17.6</td><td rowspan=1 colspan=1>9.7</td><td rowspan=1 colspan=1>9.2</td><td rowspan=1 colspan=1>9.0</td><td rowspan=1 colspan=1>16.5</td><td rowspan=1 colspan=1>9.7</td><td rowspan=1 colspan=1>8.7</td><td rowspan=1 colspan=1>8.7</td><td rowspan=1 colspan=1>16.3</td><td rowspan=1 colspan=1>9.3</td><td rowspan=1 colspan=1>8.6</td><td rowspan=1 colspan=1>8.5</td></tr><tr><td rowspan=1 colspan=1>NQ/M/FL</td><td rowspan=1 colspan=1>12.1</td><td rowspan=1 colspan=1>11.2</td><td rowspan=1 colspan=1>11.0</td><td rowspan=1 colspan=1>11.5</td><td rowspan=1 colspan=1>9.8</td><td rowspan=1 colspan=1>8.9</td><td rowspan=1 colspan=1>9.2</td><td rowspan=1 colspan=1>9.2</td><td rowspan=1 colspan=1>8.4</td><td rowspan=1 colspan=1>8.4</td><td rowspan=1 colspan=1>8.7</td><td rowspan=1 colspan=1>8.8</td><td rowspan=1 colspan=1>8.5</td><td rowspan=1 colspan=1>9.0</td><td rowspan=1 colspan=1>8.5</td><td rowspan=1 colspan=1>8.5</td></tr></table>
|
| 299 |
+
|
| 300 |
+
layers, and Softmax is used for the fully-connected (FC) layer. Note that the baseline networks use the same hyper-parameters and ReLU activation functions as described in the references. For PACT experiments, we only replace ReLU into PACT but the same hyper-parameters are used. All the time the networks are trained from scratch.
|
| 301 |
+
|
| 302 |
+
The CIFAR10 dataset (Krizhevsky & Hinton (2010)) is an image classification benchmark containing $3 2 \times 3 2$ pixel RGB images. It consists of 50K training and 10K test image sets. We used the “standard” ResNet structure (He et al. (2016a)) which consists of a CONV layer followed by 3 ResNet blocks (16 CONV layers with 3x3 filter) and a final FC layer. We used stochastic gradient descent (SGD) with momentum of 0.9 and learning rate starting from 0.1 and scaled by 0.1 at epoch 60, 120. L2-regularizer with decay of 0.0002 is applied to weight. The mini-batch size of 128 is used, and the maximum number of epochs is 200.
|
| 303 |
+
|
| 304 |
+
The SVHN dataset (Netzer et al. (2011)) is a real-world digit recognition dataset containing photos of house numbers in Google Street View images, where the “cropped” $3 2 \times 3 2$ colored images (resized to $4 0 \times 4 0$ as input to the network) centered around a single character are used. It consists of 73257 digits for training and 26032 digits for testing. We used a CNN model which contains 7 CONV layers followed by 1 FC layer. We used ADAM(Kingma & Ba (2015)) with epsilon $1 0 ^ { - 5 }$ and learning rate starting from $1 0 ^ { - 3 }$ and scaled by 0.5 every 50 epoch. L2-regularizer with decay of $1 0 ^ { - 7 }$ is applied to weight. The mini-batch size of 128 is used, and the maximum number of epochs is 200.
|
| 305 |
+
|
| 306 |
+
The IMAGENET dataset (Russakovsky et al. (2015)) consists of 1000-categories of objects with over 1.2M training and 50K validation images. Images are first resized to 256 256 and randomly cropped to 224224 prior to being used as input to the network. We used a modified AlexNet, ResNet18 and ResNet50.
|
| 307 |
+
|
| 308 |
+
We used AlexNet network (Krizhevsky et al. (2012)) in which local contrast renormalization (RNorm) layer is replaced with BatchNorm layer. We used ADAM with epsilon $1 0 ^ { - 5 }$ and learning rate starting from $\mathrm { 1 0 ^ { - 4 } }$ and scaled by 0.2 at epoch 56 and 64. L2-regularizer with decay factor of $5 \times 1 0 ^ { - 6 }$ is applied to weight. The mini-batch size of 128 is used, and the maximum number of epochs is 100.
|
| 309 |
+
|
| 310 |
+
ResNet18 consists of a CONV layer followed by 8 ResNet blocks (16 CONV layers with 3x3 filter) and a final FC layer. "full pre-activation" ResNet structure (He et al. (2016a)) is employed. ResNet50 consists of a CONV layer followed by 16 ResNet “bottleneck” blocks (total 48 CONV layers) and a final FC layer. "full pre-activation" ResNet structure (He et al. (2016a)) is employed.
|
| 311 |
+
|
| 312 |
+
For both ResNet18 and ResNet50, we used stochastic gradient descent (SGD) with momentum of 0.9 and learning rate starting from 0.1 and scaled by 0.1 at epoch 30, 60, 85, 95. L2-regularizer with decay of $1 0 ^ { - 4 }$ is applied to weight. The mini-batch size of 256 is used, and the maximum number of epochs is 110.
|
| 313 |
+
|
| 314 |
+
# APPENDIX E COMPARISON WITH RELATED WORK
|
| 315 |
+
|
| 316 |
+
# E.1 QUANTIZATION EXPERIMENT SETTING
|
| 317 |
+
|
| 318 |
+
• DoReFa-Net (DoReFa, Zhou et al. (2016)): A general bit-precision uniform quantization schemes for weight, activation, and gradient of DNN training.We compared the experimental results of DoReFa for CIFAR10, SVHN, AlexNet and ResNet18 under the same experimental
|
| 319 |
+
|
| 320 |
+
setting as PACT. Note that a clipped absolute activation function is used for SVHN in DoReFa.
|
| 321 |
+
Balanced Quantization (BalancedQ, Zhou et al. (2017)): A quantization scheme based on recursive partitioning of data into balanced bins. We compared the reported top-1/top-5 validation accuracy of their quantization scheme for AlexNet and ResNet18.
|
| 322 |
+
Quantization using Wide Reduced-Precision Networks (WRPN, Mishra et al. (2017)): A scheme to increase the number of filter maps to increase robustness for activation quantization. We compared the reported top-1 accuracy of their quantization with various weight/activation bit-precision for AlexNet.
|
| 323 |
+
• Fine-grained Quantization (FGQ, Mellempudi et al. (2017)): A direct quantization scheme (i.e., little re-training needed) based on fine-grained grouping (i.e., within a small subset of filter maps). We compared the reported top-1 validation accuracy of their quantization with 2-bit weight and 4-bit activation for AlexNet and ResNet50.
|
| 324 |
+
• Weighted-entropy-based quantization (WEP, Park et al. (2017)): A quantization scheme that considers statistics of weight/activation. We compared the top-1/top-5 reported accuracy of their quantization with various bit-precision for AlexNet, where the first and last layers are not quantized.
|
| 325 |
+
Low-precision batch normalization (LPBN, Graham (2017)): A scheme for activation quantization in the process of batch normalization. We compared the top-1/top-5 reported accuracy of their quantization with 3-5 bit precision for activation. The first layer activation is not quantized.
|
| 326 |
+
Half-wave Gaussian quantization (HWGQ, Cai et al. (2017)): A quantization scheme that finds the scale via Lloyd search on Normal distribution. We compared the top-1/top-5 reported accuracy for their quantization with 1-bit weight and varying activation bit-precision for AlexNet, and 2-bit weight for ResNet18 and ResNet50. The first and last layers are not quantized.
|
| 327 |
+
|
| 328 |
+
# E.2 COMPARISON OF ACCURACY
|
| 329 |
+
|
| 330 |
+
In this section, we present full comparison of accuracy (top-1 and top-5) of the tested CNNs (AlexNet, ResNet18, ResNet50) for image classification on IMAGENET dataset. All the data points for PACT and DoReFa are obtained by running experiments on Tensorpack. All the other data points are accuracy reported in the corresponding papers. As can be seen, PACT achieves the best accuracy across the board for various flavors of quantization. We also observe that using PACT for activation quantization enables more aggressive weight quantization without loss in accuracy.
|
| 331 |
+
|
| 332 |
+
Table 3: Comparison of Top-1 accuracy (in $\%$ ) for AlexNet. Bold entries indicate the lowest accuracy degradation compared to single-precision reference from each work. Baseline (full-precision) accuracy for PACT is $5 5 . 1 \%$ .
|
| 333 |
+
|
| 334 |
+
<table><tr><td rowspan=1 colspan=1>BitW</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BitA</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>WRPN</td><td rowspan=1 colspan=1>57.2</td><td rowspan=1 colspan=1>52.7</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>54.4</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>51.3</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>50.5</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>52.4</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>54.4</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>BalancedQ</td><td rowspan=1 colspan=1>57.1</td><td rowspan=1 colspan=1>56.5</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>55.7</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>FGQ</td><td rowspan=1 colspan=1>56.8</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>49.0</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><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>WEQ</td><td rowspan=1 colspan=1>57.1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>50.6</td><td rowspan=1 colspan=1>53.7</td><td rowspan=1 colspan=1>54.4</td><td rowspan=1 colspan=1>51.8</td><td rowspan=1 colspan=1>54.9</td><td rowspan=1 colspan=1>55.5</td><td rowspan=1 colspan=1>52.3</td><td rowspan=1 colspan=1>55.1</td><td rowspan=1 colspan=1>55.9</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>DoReFa</td><td rowspan=1 colspan=1>55.1</td><td rowspan=1 colspan=1>54.1</td><td rowspan=1 colspan=1>55.1</td><td rowspan=1 colspan=1>54.8</td><td rowspan=1 colspan=1>54.9</td><td rowspan=1 colspan=1>46.4</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>45.0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>45.1</td><td rowspan=1 colspan=1>45.1</td></tr><tr><td rowspan=1 colspan=1>PACT</td><td rowspan=1 colspan=1>55.1</td><td rowspan=1 colspan=1>54.9</td><td rowspan=1 colspan=1>55.6</td><td rowspan=1 colspan=1>55.5</td><td rowspan=1 colspan=1>55.2</td><td rowspan=1 colspan=1>55.0</td><td rowspan=1 colspan=1>55.4</td><td rowspan=1 colspan=1>55.7</td><td rowspan=1 colspan=1>54.6</td><td rowspan=1 colspan=1>55.6</td><td rowspan=1 colspan=1>55.7</td><td rowspan=1 colspan=1>54.6</td><td rowspan=1 colspan=1>55.7</td><td rowspan=1 colspan=1>55.7</td><td rowspan=1 colspan=1>55.7</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 4: Comparison of Top-5 accuracy (in $\%$ ) for AlexNet. Bold entries indicate the lowest accuracy degradation compared to single-precision reference from each work. Baseline (full-precision) accuracy for PACT is $7 7 . 0 \%$ .
|
| 337 |
+
|
| 338 |
+
<table><tr><td rowspan=1 colspan=1>BitW</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BitA</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>LogQuant</td><td rowspan=1 colspan=1>78.3</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>77.1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><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>WEQ</td><td rowspan=1 colspan=1>80.2</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><td rowspan=1 colspan=1>75.0</td><td rowspan=1 colspan=1>77.5</td><td rowspan=1 colspan=1>78.0</td><td rowspan=1 colspan=1>76.0</td><td rowspan=1 colspan=1>78.5</td><td rowspan=1 colspan=1>79.1</td><td rowspan=1 colspan=1>76.5</td><td rowspan=1 colspan=1>78.5</td><td rowspan=1 colspan=1>79.2</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>BalancedQ</td><td rowspan=1 colspan=1>79.4</td><td rowspan=1 colspan=1>79.0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>78.0</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>DoReFa</td><td rowspan=1 colspan=1>77.0</td><td rowspan=1 colspan=1>76.9</td><td rowspan=1 colspan=1>77.9</td><td rowspan=1 colspan=1>77.5</td><td rowspan=1 colspan=1>77.5</td><td rowspan=1 colspan=1>76.8</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>77.8</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>77.5</td><td rowspan=1 colspan=1>77.9</td></tr><tr><td rowspan=1 colspan=1>PACT</td><td rowspan=1 colspan=1>77.0</td><td rowspan=1 colspan=1>77.2</td><td rowspan=1 colspan=1>77.8</td><td rowspan=1 colspan=1>77.6</td><td rowspan=1 colspan=1>77.2</td><td rowspan=1 colspan=1>77.7</td><td rowspan=1 colspan=1>77.9</td><td rowspan=1 colspan=1>78.0</td><td rowspan=1 colspan=1>77.1</td><td rowspan=1 colspan=1>78.0</td><td rowspan=1 colspan=1>78.0</td><td rowspan=1 colspan=1>77.1</td><td rowspan=1 colspan=1>78.0</td><td rowspan=1 colspan=1>78.0</td><td rowspan=1 colspan=1>77.8</td></tr></table>
|
| 339 |
+
|
| 340 |
+
Table 5: Comparison of Top-1 accuracy $( \mathrm { i n \% } )$ ) for ResNet18. Bold entries indicate the lowest accuracy degradation compared to single-precision reference from each work. Baseline (full-precision) accuracy for PACT is ${ \bar { 7 } } 0 . 4 \%$ .
|
| 341 |
+
|
| 342 |
+
<table><tr><td rowspan=1 colspan=1>BitW</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BitA</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BalancedQ</td><td rowspan=1 colspan=1>68.2</td><td rowspan=1 colspan=1>62.1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>59.4</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>LPBN</td><td rowspan=1 colspan=1>69.6</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>63.6</td><td rowspan=1 colspan=1>66.7</td><td rowspan=1 colspan=1>69.3</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><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>HWGQ</td><td rowspan=1 colspan=1>69.6</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><td rowspan=1 colspan=1>61.3</td><td rowspan=1 colspan=1>57.6</td><td rowspan=1 colspan=1>60.3</td><td rowspan=1 colspan=1>60.8</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>DoReFa</td><td rowspan=1 colspan=1>70.4</td><td rowspan=1 colspan=1>66.9</td><td rowspan=1 colspan=1>68.3</td><td rowspan=1 colspan=1>68.5</td><td rowspan=1 colspan=1>68.7</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><td rowspan=1 colspan=1>62.6</td><td rowspan=1 colspan=1>67.5</td><td rowspan=1 colspan=1>68.1</td><td rowspan=1 colspan=1>68.4</td></tr><tr><td rowspan=1 colspan=1>PACT</td><td rowspan=1 colspan=1>70.4</td><td rowspan=1 colspan=1>67.5</td><td rowspan=1 colspan=1>69.2</td><td rowspan=1 colspan=1>70.0</td><td rowspan=1 colspan=1>70.0</td><td rowspan=1 colspan=1>65.8</td><td rowspan=1 colspan=1>62.9</td><td rowspan=1 colspan=1>65.3</td><td rowspan=1 colspan=1>65.0</td><td rowspan=1 colspan=1>64.4</td><td rowspan=1 colspan=1>68.1</td><td rowspan=1 colspan=1>69.2</td><td rowspan=1 colspan=1>69.8</td></tr></table>
|
| 343 |
+
|
| 344 |
+
Table 6: Comparison of Top-5 accuracy $( \mathrm { i n \% } )$ ) for ResNet18. Bold entries indicate the lowest accuracy degradation compared to single-precision reference from each work. Baseline (full-precision) accuracy for PACT is ${ \bar { 8 } } 9 . 6 \%$ .
|
| 345 |
+
|
| 346 |
+
<table><tr><td rowspan=1 colspan=1>BitW</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BitA</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BalancedQ</td><td rowspan=1 colspan=1>87.5</td><td rowspan=1 colspan=1>82.7</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>82.0</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>LPBN</td><td rowspan=1 colspan=1>89.2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>85.2</td><td rowspan=1 colspan=1>87.5</td><td rowspan=1 colspan=1>88.8</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><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>HWGQ</td><td rowspan=1 colspan=1>89.2</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><td rowspan=1 colspan=1>83.6</td><td rowspan=1 colspan=1>81.0</td><td rowspan=1 colspan=1>82.8</td><td rowspan=1 colspan=1>83.4</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>DoReFa</td><td rowspan=1 colspan=1>89.6</td><td rowspan=1 colspan=1>87.3</td><td rowspan=1 colspan=1>88.2</td><td rowspan=1 colspan=1>88.5</td><td rowspan=1 colspan=1>88.6</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><td rowspan=1 colspan=1>84.4</td><td rowspan=1 colspan=1>87.6</td><td rowspan=1 colspan=1>88.1</td><td rowspan=1 colspan=1>88.3</td></tr><tr><td rowspan=1 colspan=1>PACT</td><td rowspan=1 colspan=1>89.6</td><td rowspan=1 colspan=1>87.6</td><td rowspan=1 colspan=1>88.9</td><td rowspan=1 colspan=1>89.3</td><td rowspan=1 colspan=1>89.3</td><td rowspan=1 colspan=1>86.7</td><td rowspan=1 colspan=1>84.7</td><td rowspan=1 colspan=1>85.9</td><td rowspan=1 colspan=1>85.9</td><td rowspan=1 colspan=1>85.6</td><td rowspan=1 colspan=1>88.2</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>89.3</td></tr></table>
|
| 347 |
+
|
| 348 |
+
Table 7: Comparison of Top-1 accuracy $( \mathrm { i n \% } )$ ) for ResNet50. Bold entries indicate the lowest accuracy degradation compared to single-precision reference from each work. Baseline (full-precision) accuracy for PACT is $7 6 . 9 \%$ .
|
| 349 |
+
|
| 350 |
+
Table 8: Comparison of Top-5 accuracy $( \mathrm { i n \% } )$ ) for ResNet50. Bold entries indicate the lowest accuracy degradation compared to single-precision reference from each work. Baseline (full-precision) accuracy for PACT is $9 3 . 1 \%$ .
|
| 351 |
+
|
| 352 |
+
<table><tr><td rowspan=1 colspan=1>BitW</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BitA</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>FGQ</td><td rowspan=1 colspan=1>75.1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>68.4</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>LPBN</td><td rowspan=1 colspan=1>76.0</td><td rowspan=1 colspan=1>56.1</td><td rowspan=1 colspan=1>73.8</td><td rowspan=1 colspan=1>75.6</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>HWGQ</td><td rowspan=1 colspan=1>76.0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>64.6</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><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>DoReFa</td><td rowspan=1 colspan=1>76.9</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><td rowspan=1 colspan=1>67.1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>69.9</td><td rowspan=1 colspan=1>71.4</td><td rowspan=1 colspan=1>71.4</td></tr><tr><td rowspan=1 colspan=1>PACT</td><td rowspan=1 colspan=1>76.9</td><td rowspan=1 colspan=1>75.5</td><td rowspan=1 colspan=1>75.9</td><td rowspan=1 colspan=1>76.0</td><td rowspan=1 colspan=1>67.8</td><td rowspan=1 colspan=1>72.2</td><td rowspan=1 colspan=1>74.5</td><td rowspan=1 colspan=1>75.3</td><td rowspan=1 colspan=1>76.5</td><td rowspan=1 colspan=1>76.7</td></tr></table>
|
| 353 |
+
|
| 354 |
+
<table><tr><td rowspan=1 colspan=1>BitW</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>BitA</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>LPBN</td><td rowspan=1 colspan=1>93.0</td><td rowspan=1 colspan=1>79.6</td><td rowspan=1 colspan=1>91.8</td><td rowspan=1 colspan=1>92.6</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>HWGQ</td><td rowspan=1 colspan=1>93.0</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>85.9</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><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>DoReFa</td><td rowspan=1 colspan=1>93.1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>87.3</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>89.2</td><td rowspan=1 colspan=1>89.8</td><td rowspan=1 colspan=1>93.3</td></tr><tr><td rowspan=1 colspan=1>PACT</td><td rowspan=1 colspan=1>93.1</td><td rowspan=1 colspan=1>92.6</td><td rowspan=1 colspan=1>92.9</td><td rowspan=1 colspan=1>92.9</td><td rowspan=1 colspan=1>87.9</td><td rowspan=1 colspan=1>90.5</td><td rowspan=1 colspan=1>91.9</td><td rowspan=1 colspan=1>92.6</td><td rowspan=1 colspan=1>93.2</td><td rowspan=1 colspan=1>93.3</td></tr></table>
|
md/train/ByedzkrKvH/ByedzkrKvH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BygNqoR9tm/BygNqoR9tm.md
ADDED
|
@@ -0,0 +1,563 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SINKHORN AUTOENCODERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Optimal Transport offers an alternative to maximum likelihood for learning generative autoencoding models. We show how this principle dictates the minimization of the Wasserstein distance between the encoder aggregated posterior and the prior, plus a reconstruction error. We prove that in the non-parametric limit the autoencoder generates the data distribution if and only if the two distributions match exactly, and that the optimum can be obtained by deterministic autoencoders. We then introduce the Sinkhorn AutoEncoder (SAE), which casts the problem into Optimal Transport on the latent space. The resulting Wasserstein distance is minimized by backpropagating through the Sinkhorn algorithm. SAE models the aggregated posterior as an implicit distribution and therefore does not need a reparameterization trick for gradients estimation. Moreover, it requires virtually no adaptation to different prior distributions. We demonstrate its flexibility by considering models with hyperspherical and Dirichlet priors, as well as a simple case of probabilistic programming. SAE matches or outperforms other autoencoding models in visual quality and FID scores.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Unsupervised learning aims to find the underlying rules that govern a given data distribution. It can be approached by learning to mimic the data generation process, or by finding an adequate representation of the data. Generative Adversarial Networks (GAN) (Goodfellow et al., 2014) belong to the former class, by learning to transform noise into a distribution that matches the given one. AutoEncoders (AE) (Hinton & Salakhutdinov, 2006) are of the latter type, by learning a representation that maximizes the mutual information between the data and its reconstruction, subject to an information bottleneck. Variational AutoEncoders (VAE) (Kingma & Welling, 2013; Rezende et al., 2014), provide both a generative model — i.e. a prior distribution on the latent space with a decoder that models the conditional likelihood — and an encoder — approximating the posterior distribution of the generative model. Optimizing the exact marginal likelihood is intractable in latent variable models such as VAE’s. Instead one maximizes the Evidence Lower BOund (ELBO) as a surrogate. This objective trades off a reconstruction error of the input and a regularization term that aims at minimizing the Kullback-Leibler (KL) divergence from the approximate posterior to the prior.
|
| 12 |
+
|
| 13 |
+
An alternative principle for learning generative autoencoders is proposed by Tolstikhin et al. (2018). The theory of Optimal Transport (OT) (Villani, 2008) prescribes a different regularizer: one that matches the prior with the aggregated posterior — the average (approximate) posterior over the training data. In Wasserstein AutoEncoders (WAE) (Tolstikhin et al., 2018), this is enforced by the choice of either the Maximum Mean Discrepancy (MMD) (Gretton et al., 2012)), or by adversarial training on the latent space. WAE empirically improves upon VAE. More recently, a family of Wasserstein divergences has been used by Ambrogioni et al. (2018) in the context of variational inference. The particular choice of Wasserstein distances may be crucial for convergence, due to the induced weaker topology as compared to other divergences, such as the KL (Arjovsky et al., 2017).
|
| 14 |
+
|
| 15 |
+
We contribute to the formal analysis of autoencoders with OT. First, we prove that in order to minimize the Wasserstein distance between the generative model and the data distribution, we can miniminize the usual reconstruction-plus-regularizer cost, where the regularizer is the Wasserstein distance between the encoder aggregated posterior and the prior. Second, in the non-parametric limit, the model learns the data distribution if and only if the aggregated posterior matches the prior exactly. Third, as a consequence of the Monge-Kontorovich equivalence (Villani, 2008), the functional space of this learning problem can be limited to that of deterministic autoencoders.
|
| 16 |
+
|
| 17 |
+
The theory supports practical innovations. We learn deterministic autoencoders by minimizing a reconstruction error and the Wasserstein distance on the latent space between samples of the aggregated posterior and the prior. The latter is known to be costly, but a fast approximate solution is provided by the Sinkhorn algorithm (Cuturi, 2013). We follow Frogner et al. (2015) and Genevay et al. (2018), by exploiting the differentiability of the Sinkhorn iterations, and unroll it for backpropagation. Altogether, we call our method the Sinkhorn AutoEncoder (SAE).
|
| 18 |
+
|
| 19 |
+
The Sinkhorn AutoEncoder is agnostic to the analytical form of the prior, as it optimizes a samplebased cost function which is aware of the geometry of the latent space. Furthermore, as a byproduct of using deterministic networks, it models the aggregated posterior as an implicit distribution (Mohamed & Lakshminarayanan, 2016) with no need of the reparametrization trick for learning the encoder (Kingma & Welling, 2013). Therefore, with essentially no change in the algorithm, we can learn models with Normally distributed priors and aggregated posteriors, as well as distributions living on manifolds such as hyperspheres (Davidson et al., 2018) and probability simplices.
|
| 20 |
+
|
| 21 |
+
We start our experiments by studying unsupervised representation learning by training an encoder in isolation. Our results demonstrate the capability of the Sinkhorn algorithm to produce embeddings that conserve the local geometry of the data, echoing results from Bojanowski & Joulin (2017). Next we move to the autoencoder. In an ablation study, we compare with the exact Hungarian algorithm in place of the Sinkhorn and show that our method performs equally well, while converging faster. We then compare against prior work on autoencoders with Normal and spherical priors on MNIST, CIFAR10 and CelebA. SAE with a spherical prior produces visually more appealing interpolations, crisper samples and comparable or lower FID (Heusel et al., 2017). Finally, we further show the flexibility of SAE with qualitative results by using a Dirichlet prior, which defines the latent space on a probability simplex, as well as with a simple probabilistic programming task.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND
|
| 24 |
+
|
| 25 |
+
# 2.1 WASSERSTEIN DISTANCE AND WASSERSTEIN AUTOENCODERS
|
| 26 |
+
|
| 27 |
+
We follow Tolstikhin et al. (2018) and denote with $x , y , z$ the sample spaces and with $X , Y , Z$ and $P _ { X } , P _ { Y } , P _ { Z }$ the corresponding random variables and distributions. Given a map $F : \mathcal { X } \mathcal { V }$ we denote by $F _ { \# }$ the push-forward map acting on a distribution $P$ as $P \circ F ^ { - 1 }$ . I f $F ( Y | X )$ is non-deterministic we define the push-forward of a distribution $P$ as the induced marginal of the joint distribution $F ( Y | X ) P _ { X }$ (denoted by $F ( Y | X ) _ { \# } P _ { X } )$ . For any measurable non-negative cost $c : \mathcal { X } \times \mathcal { Y } \mathbb { R } ^ { + } \cup \{ \infty \}$ , one can define the following $O T$ -cost between marginal distributions $P _ { X }$ and $P _ { Y }$ via:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
W _ { c } ( P _ { X } , P _ { Y } ) = \operatorname* { i n f } _ { \Gamma \in \Pi ( P _ { X } , P _ { Y } ) } \mathbb { E } _ { ( X , Y ) \sim \Gamma } [ c ( X , Y ) ] ,
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $\Pi ( P _ { X } , P _ { Y } )$ is the set of all joint distributions that have as marginals the given $P _ { X }$ and $P _ { Y }$ . The elements from $\Pi ( P _ { X } , P _ { Y } )$ are called couplings from $P _ { X }$ to $P _ { Y }$ . From now on we will assume that $\mathcal { X } = \mathcal { y }$ and $c ( x , y )$ is a distance. In this case $W _ { c } ( P _ { X } , P _ { Y } )$ is the Wasserstein distance w.r.t the cost $c$ . If $c ( x , y ) = \| x - y \| _ { p } ^ { p }$ for $p \geq 1$ then $W _ { p } = \sqrt [ p ] { W _ { c } }$ is called the $p$ -th Wasserstein distance.
|
| 34 |
+
|
| 35 |
+
Let $P _ { X }$ denote the true data distribution on $\mathcal { X }$ . We define a latent variable model given as follows: we fix a latent space $\mathcal { Z }$ and a prior distribution $P _ { Z }$ on $\mathcal { Z }$ and consider the conditional distribution $G ( X | Z )$ (the decoder) parameterized by a neural network $G$ . Together they specify a generative model as $G ( X | Z ) P _ { Z }$ . The induced marginal will be denoted by $P _ { G }$ . Learning $P _ { G }$ to approximate the true $P _ { X }$ is then defined as:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\operatorname* { m i n } _ { G } W _ { c } ( P _ { X } , P _ { G } ) .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Because of the infimum over $\Pi ( P _ { X } , P _ { G } )$ inside $W _ { c }$ , this is intractable. To rewrite this objective we consider the posterior distribution $Q ( Z | X )$ (the encoder) and its aggregated posterior $Q _ { Z }$ :
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
Q _ { Z } = Q ( Z | X ) _ { \# } P _ { X } = \mathbb { E } _ { X \sim P _ { X } } Q ( Z | X ) ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
the induced marginal of the joint distribution $Q ( Z | X ) P _ { X }$ . Tolstikhin et al. (2018) show that, if the decoder $G ( X | Z )$ is deterministic, i.e. $P _ { G } = G _ { \# } P _ { Z }$ , or in other words, if all stochasticity of the generative model is captured by $Z$ , then:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
W _ { c } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { Q ( Z | X ) : Q _ { Z } = P _ { Z } } \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } [ c ( X , G ( Z ) ) ] .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Learning the generative model $G$ with the Wasserstein AutoEncoder amounts to:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\operatorname* { m i n } _ { G } \operatorname* { m i n } _ { Q ( Z | X ) } \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } [ c ( X , G ( Z ) ) ] \ + \ \beta \cdot D _ { Z } ( Q _ { Z } , P _ { Z } ) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\beta > 0$ is a Lagrange multiplier and $D _ { Z }$ is any divergence measure on probability distributions on $\mathcal { Z }$ , which choice is left open. WAE uses either MMD or a discriminator trained adversarially for $D _ { Z }$ . As discussed in Bousquet et al. (2017), Equation 4 is a lower bound of Equation 3 for any value of $\beta > 0$ . Minimizing this lower bound does not ensure a minimization of the original objective of Equation 3.
|
| 60 |
+
|
| 61 |
+
# 2.2 THE SINKHORN ALGORITHM
|
| 62 |
+
|
| 63 |
+
In place of any choice of $D _ { Z }$ , in Section 3 we formally support the minimization of a Wasserstein distance on latent space. The distance is notoriously hard to compute, which is the reason why the rewriting of Equation 3 is of practical interest. When restricting to discrete distributions, the problem becomes more amenable and efficient approximations exist. To motivate this direction, recall that we can always see samples of a continuous distribution as Dirac deltas, whose expectation defines a discrete distribution. Let two discrete distributions with support on $M$ points be $\hat { P } =$ $\begin{array} { r } { \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \delta _ { z _ { i } } , \hat { Q } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \delta _ { z _ { i } ^ { \prime } } } \end{array}$ . Given a cost $c ^ { \prime }$ , their (empirical) Wasserstein distance is:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
W _ { c ^ { \prime } } ( \hat { Q } , \hat { P } ) = \operatorname* { m i n } _ { R \in \mathrm { S } _ { M } } { \textstyle \frac { 1 } { M } } \langle R , C ^ { \prime } \rangle _ { \cal F } ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $C _ { i j } ^ { \prime } = c ^ { \prime } ( z _ { i } ^ { \prime } , z _ { j } )$ is the matrix associated to the cost $c , R$ is a doubly stochastic matrix as defined in $\mathsf { S } _ { M } = \{ R \in \mathbb { R } _ { \geq 0 } ^ { M \times M } \mid R \mathbf { 1 } = \mathbf { 1 } , R ^ { T } \mathbf { 1 } = \mathbf { 1 } \}$ , and $\langle \cdot , \cdot \rangle _ { F }$ denotes the Frobenius inner product; 1 is the vector of ones. Eq. (5) is known to converge to the Wasserstein distance between the continuous distributions as $M$ tends to infinity (Weed & Bach, 2017). This linear program has solutions on the vertices of $\mathrm { S } _ { M }$ , which is the set of permutation matrices (Peyre & Cuturi, 2018). ´ The Hungarian algorithm finds an optimal solution in $O ( M ^ { 3 } )$ time (Kuhn, 1955).
|
| 70 |
+
|
| 71 |
+
An entropy-regularized version of problem (5) can be solved more efficiently. Let the entropy of $R$ be $\begin{array} { r } { H ( R ) = - \sum _ { i , j = 1 } ^ { M } R _ { i , j } \log R _ { i , j } } \end{array}$ . For $\varepsilon > 0$ , Cuturi (2013) defines the Sinkhorn distance $S _ { c ^ { \prime } }$ :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { R ^ { * } = \underset { R \in \mathrm { S } _ { M } } { \arg \operatorname* { m i n } } \frac { 1 } { M } \langle R , C ^ { \prime } \rangle _ { F } - \varepsilon H ( R ) , \qquad S _ { c ^ { \prime } } ( \hat { Q } , \hat { P } ) = \langle R ^ { * } , C ^ { \prime } \rangle _ { F } , } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
and shows that the (Sinkhorn, 1964)’s algorithm returns its regularized optimum — that is also unique due to strong convexity of the entropy. The Sinkhorn is a fixed point algorithm that runs nearly in $M ^ { 2 }$ time (Altschuler et al., 2017) and can be efficiently implemented with matrix multiplications; see Algorithm 1. Its convergence to the Wasserstein distance is studied by Weed (2018).
|
| 78 |
+
|
| 79 |
+
The smaller the $\varepsilon$ , the smaller the entropy and the better the approximation of the Wasserstein distance. At the same time, a larger number of steps $O ( L )$ is needed to converge. Conversely, high entropy encourages the solution to lie far from a permutation matrix. Note that all Sinkhorn operations are differentiable. So when the distance is used as a cost function, we can unroll $O ( L )$ iterations and backpropagate (Genevay et al., 2018). In conclusion, we obtain a differentiable surrogate for Wasserstein distances between empirical distributions; the approximation arises from sampling, entropy regularization and the finite amount of steps in place of convergence.
|
| 80 |
+
|
| 81 |
+
# 2.3 NOISE AS TARGETS
|
| 82 |
+
|
| 83 |
+
Bojanowski & Joulin (2017) introduce Noise As Targets (NAT), an algorithm for unsupervised representation learning. The method learns a neural network $f _ { \theta }$ by embedding images into a uniform hypersphere. A sample $z$ is drawn from the sphere for each training image and fixed. The goal is to learn $\theta$ such that 1-to-1 matching between images and samples is improved: matching is coded with a permutation matrix $R$ , and updated with the Hungarian algorithm. The objective is:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
{ \underset { \theta } { \operatorname* { m a x } } } \ { \underset { R \in P _ { M } } { \operatorname* { m a x } } } \ \operatorname { T r } ( R Z f _ { \theta } ( X ) ^ { \top } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\operatorname { T r } ( \cdot )$ is the trace operator, $Z$ and $X$ are respectively prior samples and images stacked in a matrix and $P _ { M } \subset S _ { M }$ is the set of $M$ -dimensional permutations. NAT learns by alternating SGD and the Hungarian. One can interpret this problem as supervised learning, where the samples are targets (sampled only once) but their assignment is learned; notice that freely learnable $Z$ would make the problem ill-defined. The authors relate NAT to OT, a link that we make formal below.
|
| 90 |
+
|
| 91 |
+
# 3 PRINCIPLES OF WASSERSTEIN AUTOENCODING
|
| 92 |
+
|
| 93 |
+
With Equation 3, Tolstikhin et al. (2018) reformulate the Wasserstein distance in image space in terms of autoencoders. The hard constraint $Q _ { Z } = P _ { Z }$ is in practice replaced with a soft constraint by adding a penalty in the form of a divergence $D _ { Z } ( Q _ { Z } , P _ { Z } )$ . The resulting objective (4) is a lower bound to the Wasserstein difference and the choice of a divergence $D _ { Z }$ is left open. In contrast, we show that one should opt for minimizing a Wasserstein distance in latent space and that this leads to an equality with — not a bound for — the original Wasserstein distance in image space.
|
| 94 |
+
|
| 95 |
+
More precisely, Theorem 3.1 first proves that the Wasserstein distance between the generative model and data distribution is bounded from above by a quantity consisting of the reconstruction error and the Wasserstein distance between $P _ { Z }$ and $Q _ { Z }$ . Theorem 3.2 shows that we can restrict learning to the class of deterministic (auto)encoders. Put together, Corollary 3.3 provides a principled learning objective in the framework of Optimal Transport by rewriting the Wasserstein distance in image space into an equivalent tractable form. We start with the following bound:
|
| 96 |
+
|
| 97 |
+
Theorem 3.1. If $G ( X | Z )$ is deterministic and $\gamma$ -Lipschitz then:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
W _ { p } ( P _ { X } , P _ { G } ) \leq W _ { p } ( P _ { X } , G _ { \# } Q _ { Z } ) + \gamma \cdot W _ { p } ( Q _ { Z } , P _ { Z } ) .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The proof (A.2) exploits the triangle inequality of the Wasserstein distance and its behaviour under composition with Lipschitz maps – a property not shared with divergences such as the KL. To effectively minimize the right-hand side in Theorem 3.1 over a class of encoders we need to further upper bound the reconstruction term with the following1:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
W _ { p } ( P _ { X } , G _ { \# } Q _ { Z } ) \leq \sqrt { \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } \mathbb { E } _ { X ^ { \prime } \sim G ( X | Z ) } [ \| X - X ^ { \prime } \| _ { p } ^ { p } ] } ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
which reduces to the $p$ -th root of $\mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ]$ if both $G$ and $Q$ are deterministic. The tightness of this bound and its use as an objective function for learning are discussed below.
|
| 110 |
+
|
| 111 |
+
We now improve the characterization of Equation 3, which is formulated in terms of stochastic encoders $Q ( Z | X )$ and deterministic decoders $G ( X | Z )$ . In fact, it is possible to restrict the learning class to that of deterministic autoencoders:
|
| 112 |
+
|
| 113 |
+
Theorem 3.2. Let $P _ { X }$ be not atomic2 and $G ( X | Z )$ deterministic. Then for every continuous cost $c$ :
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
W _ { c } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { \substack { Q ( Z | X ) d e t e r m i n i s t i c : Q _ { Z } = P _ { Z } } } \mathbb { E } _ { X \sim P _ { X } } [ c ( X , G ( Q ( X ) ) ) ] .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Using the cost $c ( x , y ) = \| x - y \| _ { p } ^ { p } ,$ , the equation holds with $W _ { p } ^ { p } ( P _ { X } , P _ { G } )$ in place of $W _ { c } ( P _ { X } , P _ { G } )$ .
|
| 120 |
+
|
| 121 |
+
The statement is a direct consequence of the equivalence between the Kantorovich and Monge formulations of OT (Villani, 2008); see the proof in A.3. We remark that this result is stronger than, and can be used to deduce Equation 3; see A.4 for a proof. Combining the two previous results, we are now in position to prove that the bound in Theorem 3.1 is tight for deterministic (auto)encoders:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r l } { W _ { p } ( P _ { X } , P _ { G } ) \overset { T h \ \mathrm { . 3 . 1 } } { \leq } } & { \underset { Q \ \mathrm { d e t . } } { \operatorname* { i n f } } \ \overset { \ell } { \sqrt { \mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ] } } + \gamma \cdot W _ { p } ( Q _ { Z } , P _ { Z } ) } \\ { \ } & { \qquad \overset { \mathrm { i n f } } { \leq } } \\ & { \ Q \underset { Q \ \mathrm { d e t . } , Q _ { Z } = P _ { Z } } { \operatorname * { i n f } } \ \overset { \ell } { \sqrt { \mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ] } } + \gamma \cdot \underset { = 0 } { \underbrace { W _ { p } ( Q _ { Z } , P _ { Z } ) } } } \\ { \ } & { \qquad T \underset { = } { \overset { h \ \cdot 3 \cdot 2 } { = } } \ W _ { p } ( P _ { X } , P _ { G } ) . } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Inequality in Step 10 holds because we restrict the domain of the infimum, which in turns implies $W _ { p } ( Q _ { Z } , P _ { Z } ) = 0$ . As a consequence we obtain the following Corollary, which provides us with an objective for learning generative autoencoders:
|
| 128 |
+
|
| 129 |
+
Corollary 3.3. Let $P _ { X }$ be non-atomic and $G ( X | Z )$ be deterministic and $\gamma$ -Lipschitz. Then we have the equality:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
W _ { p } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { \substack { Q ( Z | X ) } } \operatorname* { i n f } _ { \substack { d e t e r m i n i s t i c } } \big \{ \big \langle \mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ] + \gamma \cdot W _ { p } ( Q _ { Z } , P _ { Z } ) .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
More precisely, we can now formulate our learning problem as the minimization of the right-hand side of Equation 12 over deterministic decoders:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\operatorname* { m i n } _ { G } \operatorname* { m i n } _ { Q } \sqrt [ \gamma ] { \mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ] } + \gamma \cdot W _ { p } ( Q _ { Z } , P _ { Z } )
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
When the encoder is a neural network of limited capacity, enforcing $Q _ { Z } \approx P _ { Z }$ might not be feasible in the general case of dimension mismatch (Rubenstein et al., 2018). In fact, since the class of deterministic neural networks is much smaller than the class of deterministic measurable maps, one might consider adding noise to the output, i.e. use stochastic networks instead. Nonetheless, neural networks can approximate any measurable map up to arbitrarily small error (Hornik, 1991), and we prove a related bound for the Wasserstein distance in A.5. It follows that learning deterministic autoencoders is sufficient to approach the theoretical upper bound and thus it will be our empirical choice.
|
| 142 |
+
|
| 143 |
+
Finally, Theorems 3.1 and 3.2 strengthen the relevance of matching aggregated posterior and prior, which we show to be a sufficient and necessary condition for generative autoencoding. Justified by the previous results, we state it for deterministic autoencoders (proof in A.6).
|
| 144 |
+
|
| 145 |
+
Theorem 3.4 (Sufficiency and necessity for generative autoencoding). Suppose perfect reconstruction, that is, $P _ { X } = ( G \circ { \dot { Q } } ) _ { \# } P _ { X }$ . Then:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
i ) ~ P _ { Z } = Q _ { Z } \implies P _ { X } = P _ { G } , \qquad i i ) ~ P _ { Z } \neq Q _ { Z } \implies P _ { X } \neq P _ { G } .
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
In particular, Theorem 3.4 ii) certifies that, under perfect reconstruction, failing to match aggregated posterior and prior makes learning the data distribution impossible. Matching in latent space should be seen as fundamental as minimizing the reconstruction error, a fact known about the performance of VAE (Hoffman & Johnson, 2016; Higgins et al., 2017; Alemi et al., 2018; Rosca et al., 2018).
|
| 152 |
+
|
| 153 |
+
# 4 SINKHORN AUTOENCODERS
|
| 154 |
+
|
| 155 |
+
In light of our theory, we minimize the Wasserstein distance between the aggregated posterior and the prior, and we do so by running the Sinkhorn on their empirical samples. Let $\bar { \{ } x _ { i } \} _ { i = 1 } ^ { M }$ be the data input to the deterministic encoder $Q ( z _ { i } ^ { \prime } | x _ { i } ) = \delta _ { z _ { i } ^ { \prime } }$ and $\{ z _ { i } \} _ { i = 1 } ^ { M }$ the samples from the prior $P _ { Z }$ . The empirical distributions are $\begin{array} { r } { \hat { Q } _ { Z } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \delta _ { z _ { i } ^ { \prime } } } \end{array}$ and $\begin{array} { r } { \hat { P } _ { Z } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \delta _ { z _ { i } } } \end{array}$ . With $C _ { i j } ^ { \prime } = c ( z _ { i } ^ { \prime } , z _ { j } )$ , the Sinkhorn distance is $S _ { c ^ { \prime } } ( \hat { Q } _ { Z } , \hat { P } _ { Z } )$ as defined in Equation 6.
|
| 156 |
+
|
| 157 |
+
We compute the Sinkhorn distance in two steps: first obtain the optimal regularized coupling $R ^ { * }$ and then multiply it with the cost, i.e. set $\varepsilon = 0$ :
|
| 158 |
+
|
| 159 |
+
# Algorithm 1 SINKHORN
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\begin{array} { r } { R ^ { * } = \underset { R \in \mathrm { S } _ { M } } { \arg \operatorname* { m i n } } \frac { 1 } { M } \langle R , C ^ { \prime } \rangle _ { F } - \varepsilon H ( R ) } \\ { S _ { c ^ { \prime } } ( \hat { Q } _ { Z } , \hat { P } _ { Z } ) = \frac { 1 } { M } \langle R ^ { * } , C ^ { \prime } \rangle _ { F } \ . \ } \end{array}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Input: {zi}=1~ Pz,{2}m=1 ~ Qz,ε,L ∀i,j,Cij=c(zi,zj) K=e-C/ε,u←1</td></tr><tr><td># elem-wise exp repeat L times:</td></tr><tr><td>v ←1/(KTu) # elem-wise division</td></tr><tr><td>u ←1/(Kv) R* ←Diag(u)KDiag(u)</td></tr><tr><td>Output: M(R*,C) F</td></tr><tr><td></td></tr></table>
|
| 166 |
+
|
| 167 |
+
See Algorithm 1. Note that we do not sacrifice differentiability: we stack $O ( L )$ Sinkhorn operations on top of the encoder, without additional learnable parameters, and run auto-differentiation.
|
| 168 |
+
|
| 169 |
+
With a deterministic decoder $G$ and encoder $Q$ , we arrive at the objective for the Sinkhorn AutoEncoder (SAE):
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\operatorname* { m i n } _ { G } \operatorname* { m i n } _ { Q } \mathbb { E } _ { X \sim \hat { P } _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ] + \beta \cdot S _ { c ^ { \prime } } ( \hat { Q } _ { Z } , \hat { P } _ { Z } ) .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
In practice, we drop the $p$ -th root and tune a $\beta > 0$ hyper-parameter to mix the two terms. Small $\varepsilon$ and hence large $L$ worsen the numerical stability of the Sinkhorn; thus it is more convenient to scale $\boldsymbol { S _ { c ^ { \prime } } }$ by $\beta$ to explore the trade off, as in the WAE. In most experiments, both $c$ and $c ^ { \prime }$ will be $\| \cdot \| _ { 2 } ^ { 2 }$ . This objective is minimized by mini-batch SGD, which requires the re-calculation of an optimal regularized coupling $R ^ { * }$ at each iteration. Experimentally we found that this is not a significant overhead, unless a large $L$ is needed for convergence due to a small $\varepsilon$ . In practice, Algorithm 1 loops for $L$ iterations but can exit earlier if the updates of $u$ reach a fixed point.
|
| 176 |
+
|
| 177 |
+
We have not specified our distribution $P _ { Z }$ yet. In fact, SAE can work in principle with arbitrary priors. The only requirement coming from the Sinkhorn is the ability to generate samples. The choice should be motivated by the desired geometric properties of the latent space; Theorem 3.4 stresses the importance of such choice for the generative model. For quantitative comparison with prior work, we focus primarily on hyperspheres, as in the Hyperspherical VAE (HVAE) (Davidson et al., 2018). Moreover, considering the Wasserstein distance $\varepsilon = 0$ ) from a uniform hyperspherical prior with squared Euclidean cost, we recover the NAT objective as a special case of ours (see Appendix A.7); yet, our method enjoys lower complexity and differentiability. The remarkable performance of NAT on representation learning on ImageNet confirms the value of the spherical prior. Other distributions are also considered in the paper, in particular the Dirichlet prior — with a tunable bias towards the simplex vertices — as a choice for controlling latent space clustering.
|
| 178 |
+
|
| 179 |
+
Deterministic encoders model implicit distributions. Distributions are said to be implicit when their probability density may be intractable or even unknown, but it is possible to obtain samples and gradients for their parameters; GANs are examples of models with implicit distributions. Implicit distributions can give more flexibility as they are not limited by families of distributions with tractable density (Mohamed & Lakshminarayanan, 2016; Huszar, 2017). Moreover, by encoding with deter- ´ ministic neural networks, we bypass the use of reparametrization tricks for gradient estimation.
|
| 180 |
+
|
| 181 |
+
# 5 RELATED WORK
|
| 182 |
+
|
| 183 |
+
The normal prior is common in VAE for the reason of tractability. In fact, changing the prior and/or the approximate posterior distributions requires the use of tractable densities and the appropriate reparametrization trick. A hyperspherical prior is used by Davidson et al. (2018) with improved experimental performance; the algorithm models a Von Mises-Fisher posterior, with a non-trivial posterior sampling procedure and a reparametrization trick based on rejection sampling. Our implicit encoder distribution sidesteps these difficulties; recent advances on variable reparametrization can also simplify these requirements (Figurnov et al., 2018). We are not aware of methods embedding on probability simplices, except the use of Dirichlet priors by the same Figurnov et al. (2018).
|
| 184 |
+
|
| 185 |
+
Hoffman & Johnson (2016) showed that the objective of a VAE does not force the aggregated posterior and prior to match, and that the mutual information of input and codes may be minimized instead. Just like the WAE, SAE avoids this effect by construction. Makhzani et al. (2015) and WAE improve latent matching by GAN/MMD. With the same goal, Alemi et al. (2017), Tomczak & Welling (2017) introduce learnable priors in the form of a mixture of approximate posteriors, which can be used in SAE as well.
|
| 186 |
+
|
| 187 |
+
The Sinkhorn (1964) algorithm gained interest after Cuturi (2013) showed its application for fast computation of Wasserstein distances. The algorithm has been applied to ranking (Adams & Zemel, 2011), domain adaptation (Courty et al., 2014), multi-label classification (Frogner et al., 2015), metric learning (Huang et al., 2016) and ecological inference (Muzellec et al., 2017). Santa Cruz et al. (2017); Linderman et al. (2018) used it for supervised combinatorial losses. Our use of the Sinkhorn for generative modeling is akin to that of Genevay et al. (2018), which matches data and model samples with adversarial training, and to Ambrogioni et al. (2018), which matches samples from the model joint distribution and a variational joint approximation. WAE and WGAN objectives are linked respectively to primal and dual formulations of OT (Tolstikhin et al., 2018).
|
| 188 |
+
|
| 189 |
+
Our approach for training the encoder alone qualifies as self-supervised representation learning (Donahue et al., 2017; Noroozi & Favaro, 2016; Noroozi et al., 2017). As in NAT (Bojanowski & Joulin, 2017) and in constrast to most other methods, we can sample pseudo labels (from the prior) independently from the input. In Appendix A.7 we show a formal connection with NAT.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 1: a) Swiss Roll and its b) squared and c) spherical embeddings learned by Sinkhorn encoders. MNIST embedded onto a 10D sphere viewed through $t$ -SNE, with classes by colours: d) encoder only or e) encoder $^ +$ decoder.
|
| 193 |
+
|
| 194 |
+
# 6 EXPERIMENTS
|
| 195 |
+
|
| 196 |
+
We start our empirical analysis with a qualitative assessment of the representation learned with the Sinkhorn algorithm. In the rest we focus on the autoencoder. We compare with NAT and confirm the Sinkhorn to be a better choice than the Hungarian. We display interpolations and samples of SAE and compare numerically with AE, $( \beta )$ -VAE, HVAE and WAE-MMD. We further show the flexibility of SAE by using a Dirichlet prior and on a toy probabilistic programming task.
|
| 197 |
+
|
| 198 |
+
We experiment on MNIST, CIFAR10 (Krizhevsky & Hinton, 2009) and CelebA (Liu et al., 2015). MNIST is dynamically binarized and the reconstruction error is the binary cross-entropy (although not a distance, it is a commonly used divergence for binary data). For CIFAR10 and CelebA the reconstruction is the squared Euclidean distance; in every experiment, the latent cost is also squared Euclidean. We train fully connected neural networks for MNIST and the convolutional architectures from Tolstikhin et al. (2018) for the rest; the latent space dimensions are respectively 10, 64, 64. We run Adam (Kingma & Ba, 2014) with mini-batches of 128. Hyperspherical embedding is hardcoded in the architectures by $L 2$ normalization of the encoder output as in Bojanowski & Joulin (2017). The Sinkhorn runs with $\epsilon = 0 . 1$ , $L = 5 0$ , except when otherwise stated. FID scores for CIFAR10 and CelebA are calculated as in Heusel et al. (2017), while for MNIST we train a 2-layer convolutional network to extract features for the Frechet distance, similarly to Odena et al. (2018). Notice ´ that the FID score is a Wasserstein-2 distance and hence our theory applies directly.
|
| 199 |
+
|
| 200 |
+
# 6.1 REPRESENTATION LEARNING WITH SINKHORN ENCODERS
|
| 201 |
+
|
| 202 |
+
We demonstrate qualitatively that the Sinkhorn distance is a valid objective for unsupervised feature learning by showing that we can learn the encoder in isolation. The task is to embed the input distribution in a lower dimensional space, preserving the local data geometry, by solving Problem 14 with no reconstruction cost. We display the representation of a 3D Swiss Roll and MNIST. For the Swiss Roll we set $\varepsilon = 1 0 ^ { - 3 }$ , while for MNIST it is set to 0.5, and $L$ is picked to ensure convergence. For the Swiss roll (Figure 1a), we use a 50-50 fully connected network with ReLUs.
|
| 203 |
+
|
| 204 |
+
Figures 1b, 1c show that the local geometry of the Swiss Roll is conserved in the new representational spaces — a square and a sphere. While the global shape is not necessarily more unfolded than the original, it looks qualitatively more amenable for further computation. Figure 1d shows the $t$ -SNE visualization (Maaten & Hinton, 2008) of the learned representation of the MNIST test set. With neither labels nor reconstruction error, we learn an embedding that is aware of class-wise clusters. Minimization of the Sinkhorn distance achieves this by encoding onto a $d$ -dimensional uniform sphere, such that points are encouraged to map far apart; in particular, in high dimension we can prove (see A.8) that the collapse probability decreases with $d$ :
|
| 205 |
+
|
| 206 |
+
Proposition 6.1. Let $z , z ^ { \prime }$ be two uniform samples from a $d$ -dimensional sphere. In the high dimensional regime, for any δ < 2 we have P (kz − z0k2 > δ) ≥ 1 − 14d(√2−δ)2 .
|
| 207 |
+
|
| 208 |
+
Other than this repulsive effect — the uniform distribution has max-entropy on any compact space —, a contractive force is present due to the inductive prior of neural networks, which are known to be Lipschitz functions (Balan et al., 2017). On the one hand, points in the latent space disperse in order to fill up the sphere; on the other hand, points close on image space cannot be mapped too far from each other. As a result, local distances are conserved while the overall distribution is spread. When the encoder is combined with a decoder $G$ — the topic of the experiments below —, the contractive force strenghtens: they collaborate in learning a latent space which makes reconstruction possible despite finite capacity and hence favours the conservation of local similarities; see Figure 1e.
|
| 209 |
+
|
| 210 |
+
Table 1: Ablation for spherical SAE: Sinkhorn vs. Hungarian, fixed targets vs. sampling. MMD are scaled up by 1000. We compute a baseline for the MMD between two independent set of 10K samples (same as the test set size) from the prior. The baseline is 0.2 for both datasets.
|
| 211 |
+
|
| 212 |
+
<table><tr><td colspan="8">MNIST</td><td colspan="3">CIFAR10</td></tr><tr><td>method</td><td>prior</td><td>β</td><td>MMD</td><td>RE</td><td>FID</td><td>β</td><td>MMD</td><td></td><td>RE</td><td>FID</td></tr><tr><td>Hungarian</td><td>sample</td><td>10</td><td>0.37</td><td>65.9</td><td>10.3</td><td>10</td><td>0.25</td><td></td><td>22.4</td><td>98.5</td></tr><tr><td>Hungarian</td><td>targets</td><td>10</td><td>0.32</td><td>68.5</td><td>10.0</td><td>10</td><td></td><td>0.26</td><td>22.8</td><td>98.4</td></tr><tr><td>Hungarian</td><td>sample</td><td>100</td><td>0.60</td><td>85.0</td><td>9.7</td><td>100</td><td></td><td>0.23</td><td>23.8</td><td>98.6</td></tr><tr><td>Hungarian</td><td>targets</td><td>100</td><td>0.21</td><td>67.2</td><td>7.1</td><td>100</td><td></td><td>0.24</td><td>23.5</td><td>102.0</td></tr><tr><td>Sinkhorn</td><td>sample</td><td>10</td><td>0.35</td><td>66.2</td><td>9.4</td><td>10</td><td></td><td>0.25</td><td>22.5</td><td>97.5</td></tr><tr><td>Sinkhorn</td><td>targets</td><td>10</td><td>0.29</td><td>65.3</td><td>9.4</td><td>10</td><td></td><td>0.25</td><td>22.4</td><td>97.0</td></tr><tr><td>Sinkhorn</td><td>sample</td><td>100</td><td>0.30</td><td>66.8</td><td>6.8</td><td>100</td><td></td><td>0.21</td><td>23.7</td><td>100.4</td></tr><tr><td>Sinkhorn</td><td>targets</td><td>100</td><td>0.30</td><td>66.8</td><td>6.8</td><td>100</td><td></td><td>0.24</td><td>23.1</td><td>107.5</td></tr></table>
|
| 213 |
+
|
| 214 |
+
Table 2: SAE vs. prior work. In boldface the best two FID per dataset. Note that MMD are not comparable if the prior is different. †The ‘spherical’ AE amounts to normalizing the encoder output.
|
| 215 |
+
|
| 216 |
+
<table><tr><td></td><td></td><td></td><td colspan="4">MNIST</td><td colspan="4">CIFAR10</td><td colspan="4">CelebA</td></tr><tr><td>method</td><td>prior</td><td>cost</td><td>β</td><td>MMD</td><td>RE</td><td>FID</td><td>β</td><td>MMD</td><td>RE</td><td>FID</td><td>β</td><td>MMD</td><td>RE</td><td>FID</td></tr><tr><td>AE</td><td>-</td><td>-</td><td>:</td><td>-</td><td>62.6</td><td>45.2</td><td>·</td><td>-</td><td>22.6</td><td>375.6</td><td>·</td><td>-</td><td>61.8</td><td>357.0</td></tr><tr><td>VAE</td><td>normal</td><td>KL</td><td>1</td><td>0.63</td><td>66.4</td><td>7.2</td><td>1</td><td>4.6</td><td>40.6</td><td>161.0</td><td>1</td><td>0.35</td><td>75.1</td><td>51.4</td></tr><tr><td>β-VAE</td><td>normal</td><td>KL</td><td>0.1</td><td>2.3</td><td>62.8</td><td>15.2</td><td>0.1</td><td>0.23</td><td>22.8</td><td>106.6</td><td>0.1</td><td>0.21</td><td>63.7</td><td>56.5</td></tr><tr><td>WAE</td><td>normal</td><td>MMD</td><td>100</td><td>0.69</td><td>63.1</td><td>9.0</td><td>100</td><td>0.29</td><td>22.9</td><td>105.3</td><td>100</td><td>0.21</td><td>62.6</td><td>61.6</td></tr><tr><td>AE</td><td>sphere↑</td><td>-</td><td>-</td><td>4.7</td><td>66.2</td><td>22.0</td><td>-</td><td>1.8</td><td>22.4</td><td>107.8</td><td>-</td><td>1.1</td><td>62.4</td><td>83.9</td></tr><tr><td>HVAE</td><td>sphere</td><td>KL</td><td>1</td><td>0.33</td><td>72.2</td><td>9.5</td><td>-</td><td>-</td><td>=</td><td>-</td><td>-</td><td>=</td><td>-</td><td>-</td></tr><tr><td>WAE</td><td>sphere</td><td>MMD</td><td>100</td><td>0.25</td><td>65.7</td><td>8.9</td><td>100</td><td>0.24</td><td>22.4</td><td>99.7</td><td>100</td><td>0.23</td><td>61.9</td><td>61.3</td></tr><tr><td>SAE</td><td>sphere</td><td>Sinkhorn</td><td>100</td><td>0.30</td><td>66.8</td><td>6.8</td><td>10</td><td>0.23</td><td>22.5</td><td>97.2</td><td>10</td><td>0.26</td><td>63.4</td><td>56.5</td></tr></table>
|
| 217 |
+
|
| 218 |
+
# 6.2 AUTOENCODING WITH THE SINKHORN DISTANCE AND NAT
|
| 219 |
+
|
| 220 |
+
We investigate the advantages of the Sinkhorn with respect to NAT in training autoencoders; this is an ablation study for our method. First, Sinkhorn has a lower complexity than the Hungarian. In both cases, the complexity can be reduced by mini-batch optimization. Yet, training with large minibatches $( > 2 0 0 )$ becomes quickly impractical with the Hungarian. Second, the differentiability of the Sinkhorn allows us to avoid the alternating minimization and instead backpropagate on the joint parameter space of encoder and doubly stochastic matrices. Third, the Sinkhorn approximates the empirical Wasserstein distance, while the Hungarian is optimal. Last, NAT draws samples once and uses them as targets throughout learning; their assignment to training points is updated by optimizing a permutation matrix over mini-batches and storing the local optimal result. We term NAT in this context Hungarian-targets and our method Sinkhorn-sample. We can design two hybrid methods. Hungarian-sample: a permutation $R$ can be used to compute the cost $\langle R , C ^ { \prime } \rangle _ { F }$ and backpropagate. Sinkhorn-targets: a doubly stochastic matrix $R$ solution of the Sinkhorn can be used for sampling a permutation3 and targets can be re-assigned. We test the impact of these choices experimentally by test set reconstruction error and FID score on MNIST and CIFAR10; we measure latent space mismatch by the MMD with Gaussian kernel over the test set.
|
| 221 |
+
|
| 222 |
+
Table 1 shows the results. From the FID scores, we conclude that there is no significant difference in generative performance between either Sinkhorn vs. Hungarian, or samples vs. targets. The parameter $\beta$ trading off reconstruction and latent space cost is more influential than any of these choices. On MNIST, MMD is often lower with fixed targets; this is a sign that the FID does not fully account for all model qualities. Due to the additional overhead of the Hungarian and the targets updating, our algorithm implements the Sinkhorn with mini-batch sampling. In the rest, we also fix $\beta$ for MNIST and CIFAR as the best found here.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 2: From left to right: CIFAR10 interpolations, CelebA interpolations and samples. Models from Table 2: $( \beta$ -)VAE (top) and SAE (bottom).
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 3: $t$ -SNEs of SAE latent spaces on MNIST: a) 10-dimensional $\operatorname { D i r } ( 1 / 2 )$ and b) 16- dimensional $\operatorname { D i r } ( 1 / 5 )$ priors. For the latter: c) aggr. posterior (red) vs. prior (blue), d) interpolation between vertices and e) samples from the prior.
|
| 229 |
+
|
| 230 |
+
# 6.3 COMPARISON WITH OTHER AUTOENCODERS
|
| 231 |
+
|
| 232 |
+
We compare with AE, $( \beta \mathrm { - } ) \mathrm { V A E }$ , $\mathrm { H V A E ^ { 4 } }$ and WAE. Figures 2 shows interpolations and samples of SAE and VAE from CIFAR10 and CelebA. SAE interpolations are defined on geodesics connecting points on the hypersphere. SAE tends to produce crisper images, with higher contrast, and avoids averaging effects as particularly evident in the CelebA interpolations. The CelebA samples are also interesting: while SAE generally maintains a crisper look than VAE’s, faces appear more often malformed. Table 2 reports a quantitative comparison. Each baseline model has a version with normal and spherical prior. FID scores of SAE are on par or superior to that of VAE and consistently better than WAE. The spherical prior appears to reduce FID scores in several cases.
|
| 233 |
+
|
| 234 |
+
# 6.4 DIRICHLET PRIORS
|
| 235 |
+
|
| 236 |
+
We further demonstrate the flexibility of SAE by using Dirichlet priors on MNIST. The prior draws samples on the probability simplex; hence, here we constrain the encoder by a final softmax layer. We use priors that concentrate on the vertices, by the intuition that digits would naturally cluster around them. A 10-dimensional $\operatorname { D i r } ( 1 / 2 )$ prior (Figure 3a) results in an embedding qualitatively similar to the uniform sphere (1e). With a more skewed prior $\operatorname { D i r } ( 1 / 5 )$ , we could expect an organization in latent space where each digit is mapped to a vertex, as little mass lies in the center. We found that in dimension 10 this is seldom the case, as multiple vertices can be taken by the same digit to model different styles, while other digits share the same vertex.
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 4: Toy probabilistic programming: data and localization (left), reconstructions (center) and samples (right). AIR (top) and SAE (bottom).
|
| 240 |
+
|
| 241 |
+
We thus experiment with a 16-dimensional $\operatorname { D i r } ( 1 / 5 )$ , which yields more disconnected clusters (3b); the effect is evident when showing the prior and the aggregated posterior that tries to cover it (3c). Figure 3d (leftmost and rightmost columns) shows that every digit $0 - 9$ is indeed represented on one of the 16 vertices, while some digits are present with multiple styles, e.g. the 7. The central samples in the Figure are the interpolations obtained by sampling on edges connecting vertices – no real data is autoencoded. Samples from the vertices appear much crisper than other prior samples (3e), a sign of mismatch between prior and aggregated posterior on areas with lower probability mass. Finally, we point out that we could even learn the Dirichlet hyperparameter(s) with a reparametrization trick (Figurnov et al., 2018) and let the data inform the model on the best prior.
|
| 242 |
+
|
| 243 |
+
# 6.5 TOY PROBABILISTIC PROGRAMMING
|
| 244 |
+
|
| 245 |
+
We run a final experiment to showcase that SAE can handle more complex implicit distributions, on a toy example of probabilistic programming. The goal is to learn a generative model for MNIST digits positioned on a larger canvas; the data is corrupted with salt noise that we do not model explicitly and which are model is thus required to ignore. The generative model samples from a factored prior distribution for $z _ { w h a t }$ — the digit appearance — from a 10-dimensional sphere and for zwhere — the location and scale — from a 3-dimensional Normal. A decoder network is fed with $z _ { w h a t }$ and generates the digit; the digit is then positioned on the black canvas on the coordinates given by a spatial transformer (Jaderberg et al., 2015) which is fed with $z _ { w h e r e }$ . The inference model produces $z _ { w h a t } , z _ { w h e r e }$ from the canvas, by using a spatial transformer and a encoder mirroring the generator.
|
| 246 |
+
|
| 247 |
+
Our autoencoder is fully deterministic. The cost in latent space amounts to the sum of the Sinkhorn distances in the two prior components, Normal and hyperspherical. Figure 4 compares qualitatively with a simplified version of AIR (Eslami et al., 2016), that is built on variational inference with an explicit modelling of the approximate posterior distribution for this program. SAE is able to replicate the behaviour of AIR by locating the digit on the canvas, ignoring the noise in reconstruction and generating realistic samples.
|
| 248 |
+
|
| 249 |
+
# 7 CONCLUSIONS
|
| 250 |
+
|
| 251 |
+
We introduced a new generative model built on the principles of Optimal Transport. Working with empirical Wasserstein distances and deterministic networks provides us with a flexible likelihoodfree framework for latent variable modeling. Besides, the theory suggests improving matching in latent space which could be achieved by the use of parametric implicit prior distributions.
|
| 252 |
+
|
| 253 |
+
# REFERENCES
|
| 254 |
+
|
| 255 |
+
Ryan Prescott Adams and Richard S Zemel. Ranking via Sinkhorn propagation. arXiv preprint arXiv:1106.1925, 2011.
|
| 256 |
+
|
| 257 |
+
Alexander Alemi, Ben Poole, Ian Fischer, Joshua Dillon, Rif A Saurous, and Kevin Murphy. Fixing a broken ELBO. In ICML, 2018.
|
| 258 |
+
|
| 259 |
+
Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational information bottleneck. In ICLR, 2017.
|
| 260 |
+
|
| 261 |
+
Jason Altschuler, Jonathan Weed, and Philippe Rigollet. Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration. In NIPS, 2017.
|
| 262 |
+
|
| 263 |
+
Luca Ambrogioni, Umut Guc¸l ¨ u, Ya ¨ gmur G ˘ uc¸l ¨ ut¨ urk, Max Hinne, Marcel AJ van Gerven, and Eric ¨ Maris. Wasserstein variational inference. In NIPS, 2018.
|
| 264 |
+
|
| 265 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein GAN. In ´ ICML, 2017.
|
| 266 |
+
|
| 267 |
+
Radu Balan, Maneesh Singh, and Dongmian Zou. Lipschitz properties for deep convolutional networks. arXiv preprint arXiv:1701.05217, 2017.
|
| 268 |
+
|
| 269 |
+
Piotr Bojanowski and Armand Joulin. Unsupervised learning by predicting noise. In ICML, 2017.
|
| 270 |
+
|
| 271 |
+
Olivier Bousquet, Sylvain Gelly, Ilya Tolstikhin, Carl-Johann Simon-Gabriel, and Bernhard Schoelkopf. From optimal transport to generative modeling: the VEGAN cookbook. arXiv preprint arXiv:1705.07642, 2017.
|
| 272 |
+
|
| 273 |
+
Nicolas Courty, Remi Flamary, and Devis Tuia. Domain adaptation with regularized optimal trans- ´ port. In KDD, 2014.
|
| 274 |
+
|
| 275 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NIPS, 2013.
|
| 276 |
+
|
| 277 |
+
Tim R Davidson, Luca Falorsi, Nicola De Cao, Thomas Kipf, and Jakub M Tomczak. Hyperspherical variational auto-encoders. In UAI, 2018.
|
| 278 |
+
|
| 279 |
+
Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. In ¨ ICLR, 2017.
|
| 280 |
+
|
| 281 |
+
SM Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, Geoffrey E Hinton, et al. Attend, infer, repeat: Fast scene understanding with generative models. In NIPS, 2016.
|
| 282 |
+
|
| 283 |
+
Michael Figurnov, Shakir Mohamed, and Andriy Mnih. Implicit reparameterization gradients. In NIPS, 2018.
|
| 284 |
+
|
| 285 |
+
Fajwel Fogel, Rodolphe Jenatton, Francis Bach, and Alexandre d’Aspremont. Convex relaxations for permutation problems. In NIPS, 2013.
|
| 286 |
+
|
| 287 |
+
Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya, and Tomaso A Poggio. Learning with a wasserstein loss. In NIPS, 2015.
|
| 288 |
+
|
| 289 |
+
Aude Genevay, Gabriel Peyre, Marco Cuturi, et al. Learning generative models with Sinkhorn ´ divergences. In AISTATS, 2018.
|
| 290 |
+
|
| 291 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014.
|
| 292 |
+
|
| 293 |
+
Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander Smola. ¨ A kernel two-sample test. Journal of Machine Learning Research, 13(Mar):723–773, 2012.
|
| 294 |
+
|
| 295 |
+
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 NIPS, 2017.
|
| 296 |
+
|
| 297 |
+
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.
|
| 298 |
+
|
| 299 |
+
Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. science, 313(5786):504–507, 2006.
|
| 300 |
+
|
| 301 |
+
Matthew D Hoffman and Matthew J Johnson. ELBO surgery: yet another way to carve up the variational evidence lower bound. In Workshop in Advances in Approximate Bayesian Inference, NIPS, 2016.
|
| 302 |
+
|
| 303 |
+
Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4 (2):251–257, 1991.
|
| 304 |
+
|
| 305 |
+
Gao Huang, Chuan Guo, Matt J Kusner, Yu Sun, Fei Sha, and Kilian Q Weinberger. Supervised word mover’s distance. In NIPS, 2016.
|
| 306 |
+
|
| 307 |
+
Ferenc Huszar. Variational inference using implicit distributions. ´ arXiv preprint arXiv:1702.08235, 2017.
|
| 308 |
+
|
| 309 |
+
Max Jaderberg, Karen Simonyan, and Andrew Zisserman. Spatial transformer networks. In NIPS, 2015.
|
| 310 |
+
|
| 311 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014.
|
| 312 |
+
|
| 313 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 314 |
+
|
| 315 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 316 |
+
|
| 317 |
+
Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
|
| 318 |
+
|
| 319 |
+
Scott W Linderman, Gonzalo E Mena, Hal Cooper, Liam Paninski, and John P Cunningham. Reparameterizing the Birkhoff polytope for variational permutation inference. AISTATS, 2018.
|
| 320 |
+
|
| 321 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In ICCV, 2015.
|
| 322 |
+
|
| 323 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using $t$ -SNE. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 324 |
+
|
| 325 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. ICLR, 2015.
|
| 326 |
+
|
| 327 |
+
Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. In ICML, 2016.
|
| 328 |
+
|
| 329 |
+
Boris Muzellec, Richard Nock, Giorgio Patrini, and Frank Nielsen. Tsallis regularized optimal transport and ecological inference. In AAAI, 2017.
|
| 330 |
+
|
| 331 |
+
Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In ECCV, 2016.
|
| 332 |
+
|
| 333 |
+
Mehdi Noroozi, Hamed Pirsiavash, and Paolo Favaro. Representation learning by learning to count. CVPR, 2017.
|
| 334 |
+
|
| 335 |
+
Augustus Odena, Jacob Buckman, Catherine Olsson, Tom B Brown, Christopher Olah, Colin Raffel, and Ian Goodfellow. Is generator conditioning causally related to GAN performance? In ICML, 2018.
|
| 336 |
+
|
| 337 |
+
Gabriel Peyre and Marco Cuturi.´ Computational optimal transport. arXiv preprint arXiv:1803.00567, 2018.
|
| 338 |
+
|
| 339 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. ICML, 2014.
|
| 340 |
+
Mihaela Rosca, Balaji Lakshminarayanan, and Shakir Mohamed. Distribution matching in variational inference. arXiv preprint arXiv:1802.06847, 2018.
|
| 341 |
+
Paul K Rubenstein, Bernhard Schoelkopf, and Ilya Tolstikhin. Wasserstein auto-encoders: Latent dimensionality and random encoders. In ICLR workshop, 2018.
|
| 342 |
+
Rodrigo Santa Cruz, Basura Fernando, Anoop Cherian, and Stephen Gould. Deeppermnet: Visual permutation learning. In CVPR, 2017.
|
| 343 |
+
Richard Sinkhorn. A relationship between arbitrary positive matrices and doubly stochastic matrices. Ann. Math. Statist., 35, 1964.
|
| 344 |
+
Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein autoencoders. In ICLR, 2018.
|
| 345 |
+
Jakub M Tomczak and Max Welling. VAE with a VampPrior. In AISTATS, 2017.
|
| 346 |
+
C. Villani. Optimal Transport: Old and New. Grundlehren der mathematischen Wissenschaften. Springer Berlin Heidelberg, 2008.
|
| 347 |
+
Jonathan Weed. An explicit analysis of the entropic penalty in linear programming. arXiv preprint arXiv:1806.01879, 2018.
|
| 348 |
+
Jonathan Weed and Francis Bach. Sharp asymptotic and finite-sample rates of convergence of empirical measures in wasserstein distance. In NIPS, 2017.
|
| 349 |
+
Chao-Yuan Wu, R. Manmatha, Alexander J. Smola, and Philipp Krahenb ¨ uhl. Sampling matters in ¨ deep embedding learning. In ICCV, 2017.
|
| 350 |
+
|
| 351 |
+
# A APPENDIX
|
| 352 |
+
|
| 353 |
+
# A.1 LEMMA
|
| 354 |
+
|
| 355 |
+
As a useful helper Lemma, we prove a Lipschitz property for the Wasserstein distance $W _ { p }$ .
|
| 356 |
+
|
| 357 |
+
Lemma A.1. For every $P _ { X } , P _ { Y }$ distributions on a sample space $s$ and a Lipschitz map $F$ we have that
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
W _ { p } ( F _ { \# } P _ { X } , F _ { \# } P _ { Y } ) \leq \gamma \cdot W _ { p } ( P _ { X } , P _ { Y } ) ,
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
where $\gamma$ is the Lipschitz constant of $F$ .
|
| 364 |
+
|
| 365 |
+
Proof. Recall that
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
W _ { p } ( F _ { \# } P _ { X } , F _ { \# } P _ { Y } ) ^ { p } = \operatorname* { i n f } _ { \substack { \Gamma \in \Pi ( F _ { \# } P _ { X } , F _ { \# } P _ { Y } ) } } \int _ { S \times S } \| x - y \| _ { p } ^ { p } d \Gamma ( x , y ) .
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Notice then that for every $\Gamma \in \Pi ( P _ { X } , P _ { Y } )$ we have that $( F \times F ) _ { \# } \Gamma \in \Pi ( F _ { \# } P _ { X } , F _ { \# } P _ { Y } )$ . Hence
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\{ ( F \times F ) _ { \# } \Gamma : \Gamma \in \Pi ( P _ { X } , P _ { Y } ) \} \subset \Pi ( F _ { \# } P _ { X } , F _ { \# } P _ { Y } ) .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
From (16) we deduce that
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { l } { { \displaystyle W _ { p } ( F _ { \# } P _ { X } , F _ { \# } P _ { Y } ) ^ { p } \leq \operatorname* { i n f } _ { \Gamma \in \Pi ( P _ { X } , P _ { Y } ) } \int _ { S \times S } \| x - y \| _ { p } ^ { p } d ( F \times F ) _ { \# } \Gamma } } \\ { ~ = \operatorname* { i n f } _ { \Gamma \in \Pi ( P _ { X } , P _ { Y } ) } \int _ { S \times S } \| F ( x ) - F ( y ) \| _ { p } ^ { p } d \Gamma } \\ { ~ \leq \gamma ^ { p } \cdot ( W _ { p } ( P _ { X } , P _ { Y } ) ) ^ { p } . } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
Taking the $p$ -root on both sides we conclude.
|
| 384 |
+
|
| 385 |
+
# A.2 PROOF OF THEOREM 3.1
|
| 386 |
+
|
| 387 |
+
Proof. Using the triangle inequality of the Wasserstein distance we obtain
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\begin{array} { r l } & { W _ { p } ( P _ { X } , G _ { \# } P _ { Z } ) \leq W _ { p } ( P _ { X } , G _ { \# } Q _ { Z } ) + W _ { p } ( G _ { \# } Q _ { Z } , G _ { \# } P _ { Z } ) } \\ & { \qquad \leq W _ { p } ( P _ { X } , G _ { \# } Q _ { Z } ) + \gamma \cdot W _ { p } ( Q _ { Z } , P _ { Z } ) , } \end{array}
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
where in line (17) we have used Lemma A.1.
|
| 394 |
+
|
| 395 |
+
In case $G$ is not deterministic, defining
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\gamma = \operatorname* { s u p } _ { \mathcal { P } , \mathcal { Q } } \frac { W _ { p } ( G ( X \vert Z ) _ { \# } \mathcal { P } , G ( X \vert Z ) _ { \# } \mathcal { Q } ) } { W _ { p } ( \mathcal { P } , \mathcal { Q } ) }
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
exp we can still formulate a bound. The result follows directly from the first line of (17).
|
| 402 |
+
|
| 403 |
+
# A.3 PROOF OF THEOREM 3.2
|
| 404 |
+
|
| 405 |
+
The basic tool to prove Theorem 3.2 is the equivalence between Monge and Kantorovich formulation of optimal transport. For convenience we formulate its statement and we refer to Villani (2008) for a more detailed explanation.
|
| 406 |
+
|
| 407 |
+
Theorem A.2 (Monge-Kontorovich equivalence). Given $P _ { X }$ and $P _ { Y }$ probability distributions on $\mathcal { X }$ such that $P _ { X }$ is not atomic, $c : \mathcal { X } \times \mathcal { X } \mathbb { R }$ continuous, we have
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
W _ { c } ( P _ { X } , P _ { Y } ) = \operatorname* { i n f } _ { \stackrel { T : \mathcal { X } \to \mathcal { X } _ { Y } } { T _ { \# } P _ { X } = P _ { Y } } } \int _ { \mathcal { X } } c ( x , T ( x ) ) d P _ { X } ( x ) .
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
We are now in position to prove Theorem 3.2. We will prove it for a general continuous cost $c$
|
| 414 |
+
|
| 415 |
+
Proof. Notice that as the encoder $Q ( Z | X )$ is deterministic there exists $Q : \mathcal { X } \mathcal { Z }$ such that $Q _ { Z } = Q _ { \# } P _ { X }$ and $Q ( Z | X ) = \delta _ { \{ Q ( x ) = z \} }$ . Hence
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array} { l l l } { { \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } [ c ( X , G ( Z ) ) ] } } & { { = } } & { { \displaystyle \int _ { \mathcal { X } \times \mathcal { Z } } c ( x , G ( z ) ) d P _ { X } ( x ) d \delta _ { \{ Q ( x ) = z \} } ( z ) } } \\ { { } } & { { = } } & { { \displaystyle \int _ { \mathcal { X } } d P _ { X } ( x ) \int _ { \mathcal { Z } } c ( x , G ( z ) ) d \delta _ { \{ Q ( x ) = z \} } ( z ) } } \\ { { } } & { { = } } & { { \displaystyle \int _ { \mathcal { X } } c ( x , G ( Q ( x ) ) ) d P _ { X } ( x ) . } } \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
Therefore
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\operatorname* { i n f } _ { \substack { 2 ( Z | X ) \mathrm { \scriptsize ~ d e t e r m i n i s t i c : } Q _ { Z } = P _ { Z } } } \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } [ e ( X , G ( Z ) ) ] = \operatorname* { i n f } _ { \substack { Q _ { Z } \colon \mathcal { X } \to Z } \atop \mathcal { Q } _ { Z } = P _ { Z } } \int _ { \mathcal X } c ( x , G ( Q ( x ) ) ) d P _ { X } .
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
We now want to prove that
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\left\{ G \circ Q : Q _ { \# } P _ { X } = P _ { Z } \right\} = \left\{ T : \mathcal { X } \to \mathcal { X } : T _ { \# } P _ { X } = P _ { G } \right\} .
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
For the first inclusion $\subset$ notice that for every $Q : \mathcal { X } \mathcal { Z }$ such that $Q _ { Z } = P _ { Z }$ we have that $G \circ Q : \mathcal { X } \to \mathcal { X }$ and
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
( G \circ Q ) _ { \# } P _ { X } = G _ { \# } Q _ { \# } P _ { X } = G _ { \# } P _ { Z } .
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
For the other inclusion $\supset$ consider $T : \mathcal { X } \mathcal { X }$ such that $T _ { \# } P _ { X } = P _ { G } = G _ { \# } P _ { Z }$ . We want first to prove that there exists a set $A \subset { \mathcal { X } }$ with $P _ { X } ( A ) = 1$ such that $G : { \mathcal { Z } } \to T ( A )$ is surjective. Indeed if it does not hold there exists $B \subset { \mathcal { X } }$ with $P _ { X } ( B ) > 0$ and $G ^ { - 1 } ( T ( B ) ) = \mathrm { \hat { \varnothing } }$ . Hence
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
0 = G _ { \# } P _ { Z } ( T ( B ) ) = T _ { \# } P _ { X } ( T ( B ) ) = P _ { X } ( B ) > 0
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
that is a contraddiction. Therefore by standard set theory the map $G : { \mathcal { Z } } \to T ( A )$ has a right inverse that we denote by $\widetilde { G }$ . Then define $Q = \widetilde { G } \circ T$ . Notice that $G \circ Q = G \circ \widetilde { G } \circ T = T$ almost surely in $P _ { X }$ and also
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
( \widetilde G \circ T ) _ { \# } P _ { X } = P _ { Z } .
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Indeed for any $A \subset { \mathcal { Z } }$ Borel we have
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
( \widetilde G \circ T ) _ { \# } P _ { X } ( A ) = ( \widetilde G \circ G ) _ { \# } P _ { Z } ( A ) = P _ { Z } ( \widetilde G ^ { - 1 } ( G ^ { - 1 } ( A ) ) = P _ { Z } ( A ) .
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
This concludes the proof of the claim in (20). Now we have
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\operatorname* { i n f } _ { Q : \mathcal { X } \mathcal { Z } \atop Q _ { \# } ( P _ { X } ) = P _ { Z } } \int _ { \mathcal X } c ( x , G ( Q ( x ) ) ) d P _ { X } ( x ) = \operatorname* { i n f } _ { T : \mathcal { X } \mathcal { X } _ { G } } \int _ { \mathcal X } c ( x , T ( x ) ) d P _ { X } ( x ) .
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Notice that this is exactly the Monge formulation of optimal transport. Therefore by Theorem A.2 we conclude that
|
| 464 |
+
|
| 465 |
+
${ \underset { { \substack { \mathrm { 2 ( } } Z \mid X ) \mathrm { ~ d e t e r m i n i s t i c : } } \ Q _ { Z } = P _ { Z } } { \operatorname* { l i m } } } \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z \mid X ) } [ e ( X , G ( Z ) ) ] = { \underset { { \substack { \mathrm { ~ \tiny ~ \mathrm { 1 ( } } P _ { X } , P _ { G } ) } } } { \operatorname* { i n f } } } \mathbb { E } _ { ( X , Y ) \sim \Gamma } [ e ( X , Y ) ]$ as we aimed.
|
| 466 |
+
|
| 467 |
+
A.4 TOLSTIKHIN ET AL. (2018)’S THEOREM AS A CONSEQUENCE
|
| 468 |
+
|
| 469 |
+
Proof. Thanks to Theorem 3.2 we have that
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\begin{array} { r l r } { W _ { c } ( P _ { X } , P _ { G } ) } & { = } & { \underset { Q ( Z | X ) \mathrm { ~ d e t e r m i n i s t i c : ~ } Q _ { Z } = P _ { Z } } { \operatorname* { i n f } } \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } [ c ( X , G ( Z ) ) ] } \\ & { \geq } & { \underset { Q ( Z | X ) \colon Q _ { Z } = P _ { Z } } { \operatorname* { i n f } } \mathbb { E } _ { X \sim P _ { X } } \mathbb { E } _ { Z \sim Q ( Z | X ) } [ c ( X , G ( Z ) ) ] . } \end{array}
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
For the opposite inequality given $Q ( Z | X )$ such that $\begin{array} { r } { P _ { Z } \ = \ \int Q ( Z | X ) d P _ { X } } \end{array}$ define $Q ( X , Y ) =$ $P _ { X } \times \left[ G _ { \# } Q ( Z | X ) \right]$ . It is a distribution on $\mathcal { X } \times \mathcal { X }$ and it is easy to check that $\pi _ { \# } ^ { 1 } Q ( X , Y ) = P _ { X }$ and $\pi _ { \# } ^ { 2 } Q ( X , Y ) = G _ { \# } P _ { Z }$ , where $\pi ^ { 1 }$ and $\pi ^ { 2 }$ are the projection on the first and the second component. Therefore
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\{ Q ( X , Z ) : Q ( Z | X ) \mathrm { s u c h t h a t } Q _ { Z } = P _ { Z } \} \subset \Pi ( P _ { X } , P _ { G } )
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
and so
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { l } { { W _ { c } ( P _ { X } , P _ { G } ) \leq \underset { Q ( Z | X ) : Q _ { Z } = P _ { Z } } { \operatorname* { i n f } } \int _ { \mathcal { X } \times \mathcal { X } } c ( x , y ) d Q ( x , y ) } } \\ { { \ } } \\ { { \displaystyle \quad = \int _ { \mathcal { X } } \left[ \int _ { \mathcal { X } } c ( x , y ) d G _ { \# } Q ( Z | X ) ( y ) \right] d P _ { X } } } \\ { { \ \displaystyle \quad = \int _ { \mathcal { X } } \left[ \int _ { \mathcal { X } } c ( x , G ( z ) ) d Q ( Z | X ) ( z ) \right] d P _ { X } . } } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
# A.5 BOUNDS FOR NEURAL NETWORKS
|
| 488 |
+
|
| 489 |
+
Theorem A.3. Let $P _ { X }$ be non-atomic and $G ( X | Z )$ be deterministic and $\gamma$ -Lipschitz. If $Q ^ { N N }$ is a neural network approximating a near optimal deterministic encoder up to an error of $\varepsilon \geq 0$ in $L _ { p }$ -norm then we have the inequality:
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
0 \leq \left\{ \sqrt { \mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ^ { N N } ( X ) ) \| _ { p } ^ { p } ] } + \gamma \cdot W _ { p } ( Q _ { Z } ^ { N N } , P _ { Z } ) \right\} - W _ { p } ( P _ { X } , P _ { G } ) \leq 3 \gamma \varepsilon .
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
Proof. Let $Q ^ { * }$ be an optimal measurable deterministic encoder that optimizes the right-hand side of Theorem 3.1 among measurable deterministic encoder (or at least $\delta \leq \gamma \varepsilon$ close to it) and $Q ^ { \mathrm { N N } }$ a
|
| 496 |
+
|
| 497 |
+
neural network approximation of $Q ^ { * }$ such that $\sqrt { \mathbb { E } _ { X \sim P _ { X } } [ \| Q ^ { * } ( X ) - Q ^ { \mathrm { N N } } ( X ) ) \| _ { p } ^ { p } ] } \leq \varepsilon$ (existence by Hornik (1991)). Then we get:
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\begin{array} { r l } & { \sqrt { | \mathbf { E } \| _ { X \sim \mathcal { P } _ { x } } \| | X - G ( Q ^ { \mathrm { W } } ( X ) ) \| _ { \mathcal { F } } ^ { 2 } \Big ) + \gamma \cdot W _ { \mathcal { F } } ( Q _ { Z } ^ { \mathrm { W Z } } , P _ { Z } ) } } \\ & { \operatorname* { m a x } _ { \phi \leq \infty } \sqrt { | \mathbf { E } \| - G ( Q ^ { \mathrm { W } } ( X ) ) \| _ { \mathcal { F } } ^ { 2 } \Big ) + \gamma \cdot W _ { \mathcal { F } } ( Q _ { Z } ^ { \mathrm { W Z } } , P _ { Z } ) } } \\ & { \qquad + \underbrace { \sqrt { | \mathbf { E } _ { X \sim \mathcal { P } _ { x } } | | G ( Q ^ { \mathrm { W } } ( X ) ) - G ( Q ^ { \mathrm { W } } ( X ) ) | | _ { \mathcal { F } } ^ { 2 } | } } _ { \mathrm { C r e ~ } } } \\ & { \qquad + \frac { \gamma } { \gamma } \cdot \underbrace { \| \mathbf { U } _ { \mathcal { F } } ( Q _ { X } ^ { \mathrm { W } } , Q _ { Z } ^ { \mathrm { W Z } } ) + \gamma \cdot W _ { \mathcal { F } } ( Q _ { Z } ^ { \mathrm { W Z } } , P _ { Z } ) } _ { \leq 2 } } \\ & { \qquad \lesssim \sqrt { | \mathbf { E } _ { X \sim \mathcal { P } _ { x } } | | X - G ( Q ^ { \mathrm { W } } ( X ) ) | _ { \mathcal { F } } ^ { 2 } | } + \gamma \cdot W _ { \mathcal { S } } ( Q _ { Z } ^ { \mathrm { W } } , P _ { Z } ) + 2 \gamma \varepsilon } \\ & { \qquad \times \mathrm { d } _ { \mathcal { F } } ^ { \mathrm { a d } } \mathrm { ~ s i n c ~ } \Big \{ \sqrt { | \mathbf { E } _ { X \sim \mathcal { P } _ { x } } | | X - G ( Q ^ { \mathrm { W } } ( X ) ) | | _ { \mathcal { F } } ^ { 2 } | } + \gamma \cdot W _ { \mathcal { F } } ( Q _ { Z } , P _ { Z } ) \Big \} + \delta + 2 \gamma \varepsilon } \\ & { \qquad \leq \frac { \gamma } { \alpha } W _ { \mathcal { F } } ( P _ { X } , P _ { Z } ) + 3 \gamma \varepsilon , } \end{array}
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
where in the last inequality we use additionally that the upper bound in Theorem 3.1 is sharp.
|
| 504 |
+
|
| 505 |
+
Finally, we can also formulate a version of Corollary 3.3 restricted to deterministic neural networks as follows:
|
| 506 |
+
|
| 507 |
+
Theorem A.4. Let $P _ { X }$ be non-atomic and $G ( X | Z )$ be deterministic and $\gamma$ -Lipschitz. Then we have the equality:
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
W _ { p } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { Q N N } \sqrt { \mathbb { E } _ { X \sim P _ { X } } [ \| X - G ( Q ( X ) ) \| _ { p } ^ { p } ] } + \gamma \cdot W _ { p } ( Q _ { Z } , P _ { Z } ) ,
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
where $Q$ runs through all deterministic neural network encoders (or any other class of universal approximators).
|
| 514 |
+
|
| 515 |
+
Proof. This directly follows from A.3 in combination with Hornik (1991).
|
| 516 |
+
|
| 517 |
+
# A.6 PROOF OF THEOREM 3.4
|
| 518 |
+
|
| 519 |
+
Proof. Statement $i$ ) follows directly from the definition of push-forward of a measure.
|
| 520 |
+
|
| 521 |
+
For $_ { i i }$ ) notice that if $P _ { Z } \neq Q _ { Z }$ then there exists $A \subset { \mathcal { Z } }$ a Borel set such that $P _ { Z } ( A ) \neq Q _ { \# } P _ { X } ( A )$ . Then
|
| 522 |
+
|
| 523 |
+
$$
|
| 524 |
+
\begin{array} { r l } & { G _ { \# } P _ { Z } ( G ( A ) ) = P _ { Z } ( ( G ^ { - 1 } \circ G ) ( A ) ) = P _ { Z } ( A ) \neq Q _ { \# } P _ { X } ( A ) } \\ & { \qquad = Q _ { \# } P _ { X } ( A ) ( ( G ^ { - 1 } \circ G ) ( A ) ) = ( G \circ Q ) _ { \# } P _ { X } ( G ( A ) ) . } \end{array}
|
| 525 |
+
$$
|
| 526 |
+
|
| 527 |
+
Hence as $P _ { X } = ( G \circ Q ) _ { \# } P _ { X }$ by hypothesis, we immediately deduce that $P _ { X } \neq P _ { G }$ .
|
| 528 |
+
|
| 529 |
+
# A.7 COMPARISON WITH BOJANOWSKI & JOULIN (2017)
|
| 530 |
+
|
| 531 |
+
We prove that the cost function of NAT is equivalent to ours when the encoder output is $L _ { 2 }$ normalized, $c ^ { \prime }$ is squared Euclidean and the Sinkhorn distance is considered with $\varepsilon = 0$ :
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
\begin{array} { r l } & { \begin{array} { r l } & { \mathrm { s u r g ~ } _ { \theta } ^ { \mathrm { m a x } } \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } } \\ & { = \mathrm { a r g ~ } _ { \theta } ^ { \mathrm { m a x } } \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } } \end{array} \{ R \mathcal { L } \ell _ { 2 } f _ { \theta } ( X ) \} ^ { T } ) } \\ & { = \begin{array} { r l } & { ( R + \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } ) _ { \theta \in \mathcal { P } _ { n } } } \\ & { = \mathrm { a r g ~ } _ { \theta } ^ { \mathrm { i n } \operatorname* { i n } } \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } , } \end{array} } \\ & { = \begin{array} { r l } & { ( R + \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } ) _ { \theta \in \mathcal { P } _ { n } } } \\ & { = \mathrm { a r g ~ } _ { \theta } ^ { \mathrm { i n } \operatorname* { i n } } \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } } \end{array} \| R \mathbb { Z } \| _ { \theta } ^ { 2 } + \| \mathcal { L } \mu ( X ) \| _ { \theta } ^ { 2 } - 2 ( R \mathbb { Z } , \hat { \rho } _ { \theta } ( X ) ) F } \\ & { = \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } } \end{array} \\ & = \begin{array} { r l } & { ( R + \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } ) _ { \theta \in \mathcal { P } _ { n } } } \\ & { = \mathrm { a r g ~ } _ { \theta } ^ { \mathrm { i n } \operatorname* { i n } } \underset { \theta \in \mathcal { P } _ { n } } { \operatorname { I m } } } \end{array}
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
Step 24 holds because both $R$ and $f _ { \theta } ( X )$ are row normalized. Step 25 exploits $R$ being a permutation matrix. The inclusion in Step 28 extend to degenerate solutions of the linear program that may not lie on vertices. We have discussed several differences between our Sinkhorn encoder and NAT. There are other minor ones with Bojanowski $\&$ Joulin (2017): ImageNet inputs are first converted to grey and passed through Sobel filters and the permutations are updated with the Hungarian only every 3 epochs. Preliminary experiments ruled our any clear gain of those choices in our setting.
|
| 538 |
+
|
| 539 |
+
# A.8 PROOF OF PROPOSITION 6.1
|
| 540 |
+
|
| 541 |
+
Proof. Let $z , z ^ { \prime }$ two points sampled uniformrly from a $d$ -dimensional sphere. Let $\alpha$ be the Euclidean distance between the two points. $\alpha$ has an analytical form (Wu et al., 2017) :
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
p ( \| z - z ^ { \prime } \| _ { 2 } ) = p ( \alpha ) = \frac { \alpha ^ { d - 2 } } { c ( d ) } \left[ 1 - \frac { 1 } { 4 } \alpha ^ { 2 } \right] ^ { \frac { d - 3 } { 2 } } , \quad \mathrm { w h e r e } \quad c ( d ) = \sqrt { \pi } \frac { \Gamma \left( \frac { d - 1 } { 2 } \right) } { \Gamma \left( \frac { d } { 2 } \right) } .
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
For high dimension, it approaches a Gaussian: $\begin{array} { r } { p ( \alpha ) \approx \mathcal { N } ( \sqrt { 2 } , \frac { 1 } { 2 d } ) } \end{array}$ as $d \to + \infty$ . By the Chebischev inequality, for every $t > 0$
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
P ( | \alpha - \sqrt { 2 } | \geq t ) \leq \frac { 1 } { 2 d t ^ { 2 } } .
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
Choosing $t = - \delta + \sqrt { 2 }$ for $\delta < \sqrt { 2 }$ and using the symmetry of the Gaussian around the expectation we obtain
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\begin{array} { c } { { \displaystyle \frac 1 { 2 d ( \sqrt 2 - \delta ) ^ { 2 } } \geq P ( | \alpha - \sqrt 2 | \geq - \delta + \sqrt 2 ) } } \\ { { { } } } \\ { { { } = 2 P ( \alpha \leq \sqrt 2 + \delta - \sqrt 2 ) } } \\ { { { } } } \\ { { { } = 2 \left( 1 - P ( \alpha \geq \delta ) \right) . } } \end{array}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
Hence
|
| 560 |
+
|
| 561 |
+
$$
|
| 562 |
+
P ( \alpha \ge \delta ) \ge 1 - { \frac { 1 } { 4 d ( \sqrt { 2 } - \delta ) ^ { 2 } } } .
|
| 563 |
+
$$
|
md/train/BylJUTEKvB/BylJUTEKvB.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CROSS-ITERATION BATCH NORMALIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
A well-known issue of Batch Normalization is its significantly reduced effectiveness in the case of small mini-batch sizes. When a mini-batch contains few examples, the statistics upon which the normalization is defined cannot be reliably estimated from it during a training iteration. To address this problem, we present Cross-Iteration Batch Normalization (CBN), in which examples from multiple recent iterations are jointly utilized to enhance estimation quality. A challenge of computing statistics over multiple iterations is that the network activations from different iterations are not comparable to each other due to changes in network weights. We thus compensate for the network weight changes via a proposed technique based on Taylor polynomials, so that the statistics can be accurately estimated and batch normalization can be effectively applied. On object detection and image classification with small mini-batch sizes, CBN is found to outperform the original batch normalization and a direct calculation of statistics over previous iterations without the proposed compensation technique.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Batch Normalization (BN) (Ioffe & Szegedy, 2015) has played a significant role in the success of deep neural networks. It was introduced to address the issue of internal covariate shift, where the distribution of network activations changes during training iterations due to the updates of network parameters. This shift is commonly believed to be disruptive to network training, and BN alleviates this problem through normalization of the network activations by their mean and variance, computed over the examples within the mini-batch at each iteration. With this normalization, network training can be performed at much higher learning rates and with less sensitivity to weight initialization.
|
| 12 |
+
|
| 13 |
+
In BN, it is assumed that the distribution statistics for the examples within each mini-batch reflect the statistics over the full training set. While this assumption is generally valid for large batch sizes, it breaks down in the small batch size regime (Peng et al., 2018; Wu & He, 2018; Ioffe, 2017), where noisy statistics computed from small sets of examples can lead to a dramatic drop in performance. This problem hinders the application of BN to memory-consuming tasks such as object detection (Ren et al., 2015; Dai et al., 2017), semantic segmentation (Long et al., 2015; Chen et al., 2017) and action recognition (Wang et al., 2018b), where batch sizes are limited due to memory constraints.
|
| 14 |
+
|
| 15 |
+
Towards improving estimation of statistics in the small batch size regime, alternative normalizers have been proposed. Several of them, including Layer Normalization (LN) (Ba et al., 2016), Instance Normalization (IN) (Ulyanov et al., 2016), and Group Normalization (GN) (Wu & He, 2018), compute the mean and variance over the channel dimension, independent of batch size. Different channel-wise normalization techniques, however, tend to be suitable for different tasks, depending on the set of channels involved. On the other hand, synchronized BN (SyncBN) (Peng et al., 2018) yields consistent improvements by processing larger batch sizes across multiple GPUs. These gains in performance come at the cost of additional overhead needed for synchronization across the devices.
|
| 16 |
+
|
| 17 |
+
A seldom explored direction for estimating better statistics is to compute them over the examples from multiple recent training iterations, instead of from only the current iteration as done in previous techniques. This can substantially enlarge the pool of data from which the mean and variance are obtained. However, there exists an obvious drawback to this approach, in that the activation values from different iterations are not comparable to each other due to the changes in network weights. As shown in Figure 1, directly calculating the statistics over multiple iterations, which we refer to as Naive CBN, results in lower accuracy.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Top-1 classification accuracy vs. batch sizes per iteration. The base model is a ResNet-18 (He et al., 2016) trained on ImageNet (Russakovsky et al., 2015). BN (Ioffe & Szegedy, 2015)’s accuracy drops rapidly when the batch size is reduced. GN (Wu & He, 2018) exhibits stable performance but underperforms BN on adequate batch sizes. CBN compensates for the reduced batch size per GPU by exploiting approximated statistics from recent iterations (Temporal window size denotes how many recent iters are utilized for statistics computation). CBN shows relatively stable performance over different batch sizes. Naive CBN does not work well, which directly calculates statistics from recent iterations without compensation.
|
| 21 |
+
|
| 22 |
+
In this paper, we present a method that compensates for the network weight changes among iterations, so that examples from preceding iterations can be effectively used to improve batch normalization. Our method, called Cross-Iteration Batch Normalization (CBN), is motivated by the observation that network weights change gradually, instead of abruptly, between consecutive training iterations, thanks to the iterative nature of Stochastic Gradient Descent (SGD). As a result, the mean and variance of examples from recent iterations can be well approximated for the current network weights via a low-order Taylor polynomial, defined on gradients of the statistics with respect to the network weights. The compensated means and variances from multiple recent iterations are averaged with those of the current iteration to produce better estimates of the statistics.
|
| 23 |
+
|
| 24 |
+
In the small batch size regime, CBN leads to appreciable performance improvements over the original BN, as exhibited in Figure 1. The superiority of our proposed approach is further demonstrated through more extensive experiments on ImageNet classification and object detection on COCO. These gains are obtained with negligible overhead, as the statistics from previous iterations have already been computed and Taylor polynomials are simple to evaluate. With this work, it is shown that cues for batch normalization can successfully be extracted along the time dimension, opening a new direction for investigation.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
The importance of normalization in training neural networks has been recognized for decades (LeCun et al., 1998). In general, normalization can be performed on three components: input data, hidden activations, and network parameters. Among them, input data normalization is used most commonly because of its simplicity and effectiveness (Sola & Sevilla, 1997; LeCun et al., 1998).
|
| 29 |
+
|
| 30 |
+
After the introduction of Batch Normalization (Ioffe & Szegedy, 2015), the normalization of activations has become nearly as prevalent. By normalizing hidden activations by their statistics within each mini-batch, BN effectively alleviates the vanishing gradient problem and significantly speeds up the training of deep networks. To mitigate the mini-batch size dependency of BN, a number of variants have been proposed, including Layer Normalization (LN) (Ba et al., 2016), Instance Normalization (IN) (Ulyanov et al., 2016), Group Normalization (GN) (Wu & He, 2018), and Batch Instance Normalization (BIN) (Nam & Kim, 2018). The motivation of LN is to explore more suitable statistics for sequential models, while IN performs normalization in a manner similar to BN but with statistics only for each instance. GN achieves a balance between IN and LN, by dividing features into multiple groups along the channel dimension and computing the mean and variance within each group for normalization. BIN introduces a learnable method for automatically switching between normalizing and maintaining style information, enjoying the advantages of both BN and IN on style transfer tasks. Cross-GPU Batch Normalization (CGBN or SyncBN) (Peng et al., 2018) extends BN across multiple GPUs for the purpose of increasing the effective batch size. Though providing higher accuracy, it introduces synchronization overhead to the training process. Kalman Normalization (KN) (Wang et al., 2018a) presents a Kalman filtering procedure for estimating the statistics for a network layer from the layer’s observed statistics and the computed statistics of previous layers.
|
| 31 |
+
|
| 32 |
+
Batch Renormalization (BRN) (Ioffe, 2017) is the first attempt to utilize the statistics of recent iterations for normalization. It does not compensate for the statistics from recent iterations, but rather it down-weights the importance of statistics from distant iterations. This down-weighting heuristic, however, does not make the resulting statistics “correct", as the statistics from recent iterations are not of the current network weights. BRN can be deemed as a special version of our Naive CBN baseline (without Taylor polynomial approximation), where distant iterations are down-weighted.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: Illustration of BN and the proposed Cross-Iteration Batch Normalization (CBN).
|
| 36 |
+
|
| 37 |
+
Recent work have also investigated the normalization of network parameters. In Weight Normalization (WN) (Salimans & Kingma, 2016), the optimization of network weights is improved through a reparameterization of weight vectors into their length and direction. Weight Standardization (WS) (Qiao et al., 2019) instead reparameterizes weights based on their first and second moments for the purpose of smoothing the loss landscape of the optimization problem. To combine the advantages of multiple normalization techniques, Switchable Normalization (SN) (Luo et al., 2018) and Sparse Switchable Normalization (SSN) (Shao et al., 2019) make use of differentiable learning to switch among different normalization methods.
|
| 38 |
+
|
| 39 |
+
The proposed CBN takes an activation normalization approach that aims to mitigate the mini-batch dependency of BN. Different from existing techniques, it provides a way to effectively aggregate statistics across multiple training iterations.
|
| 40 |
+
|
| 41 |
+
# 3 METHOD
|
| 42 |
+
|
| 43 |
+
# 3.1 REVISITING BATCH NORMALIZATION
|
| 44 |
+
|
| 45 |
+
The original batch normalization (BN) (Ioffe & Szegedy, 2015) whitens the activations of each layer by the statistics computed within a mini-batch. Denote $\theta _ { t }$ and $x _ { t , i } ( \theta _ { t } )$ as the network weights and the feature response of a certain layer for the $i$ -th example in the $t$ -th mini-batch. With these values, BN conducts the following normalization:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\hat { x } _ { t , i } ( \theta _ { t } ) = \frac { x _ { t , i } ( \theta _ { t } ) - \mu _ { t } ( \theta _ { t } ) } { \sqrt { \sigma _ { t } ( \theta _ { t } ) ^ { 2 } + \varepsilon } } ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\hat { x } _ { t , i } ( \theta _ { t } )$ is the whitened activation with zero mean and unit variance, $\varepsilon$ is a small constant added for numerical stability, and $\mu _ { t } ( \theta _ { t } )$ and $\sigma _ { t } ( \theta _ { t } )$ are the mean and variance computed for all the examples from the current mini-batch, i.e.,
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { l } { \displaystyle \mu _ { t } ( \boldsymbol { \theta } _ { t } ) = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \boldsymbol { x } _ { t , i } ( \boldsymbol { \theta } _ { t } ) , } \\ { \displaystyle \sigma _ { t } ( \boldsymbol { \theta } _ { t } ) = \sqrt { \frac { 1 } { m } \sum _ { i = 1 } ^ { m } ( \boldsymbol { x } _ { t , i } ( \boldsymbol { \theta } _ { t } ) - \boldsymbol { \mu } _ { t } ( \boldsymbol { \theta } _ { t } ) ) ^ { 2 } } = \sqrt { \boldsymbol { \nu } _ { t } ( \boldsymbol { \theta } _ { t } ) - \boldsymbol { \mu } _ { t } ( \boldsymbol { \theta } _ { t } ) ^ { 2 } } , } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\begin{array} { r } { \nu _ { t } ( \theta _ { t } ) = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } x _ { t , i } ( \theta _ { t } ) ^ { 2 } } \end{array}$ , and $m$ denotes the number of examples in the current mini-batch. The whitened activation $\hat { x } _ { t , i } ( \theta _ { t } )$ further undergoes a linear transform with learnable weights, to increase its expressive power:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
y _ { t , i } ( \theta _ { t } ) = \gamma \hat { x } _ { t , i } ( \theta _ { t } ) + \beta ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $\gamma$ and $\beta$ are the learnable parameters (initialized to $\gamma = 1$ and $\beta = 0$ in this work).
|
| 64 |
+
|
| 65 |
+
When the batch size $m$ is small, the statistics $\mu _ { t } ( \theta _ { t } )$ and $\sigma _ { t } ( \theta _ { t } )$ become noisy estimates of the training set statistics, thus degrading the effects of batch normalization. In the ImageNet classification task for which the BN module was originally designed, a batch size of 32 is typical. However, for other tasks requiring larger models and/or higher image resolution, such as object detection, semantic segmentation and video recognition, the typical batch size may be as small as 1 or 2 due to GPU memory limitations. The original BN becomes considerably less effective in such cases.
|
| 66 |
+
|
| 67 |
+
# 3.2 LEVERAGING STATISTICS FROM PREVIOUS ITERATIONS
|
| 68 |
+
|
| 69 |
+
To address the issue of BN with small mini-batches, a naive approach is to compute the mean and variance over the current and previous iterations. However, the statistics $\mu _ { t - \tau } ( \theta _ { t - \tau } )$ and $\nu _ { t - \tau } ( \theta _ { t - \tau } )$ of the $\left( t - \tau \right)$ -th iteration are computed under the network weights $\theta _ { t - \tau }$ , making them obsolete for the current iteration. As a consequence, directly aggregating statistics from multiple iterations produces inaccurate estimates of the mean and variance, leading to significantly worse performance.
|
| 70 |
+
|
| 71 |
+
We observe that the network weights change smoothly between consecutive iterations, due to the nature of gradient-based training. This allows us to approximate $\mu _ { t - \tau } ( \theta _ { t } )$ and $\nu _ { t - \tau } ( \theta _ { t } )$ from the readily available $\mu _ { t - \tau } ( \theta _ { t - \tau } )$ and $\nu _ { t - \tau } ( \theta _ { t - \tau } )$ via a Taylor polynomial, i.e.,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \mu _ { t - \tau } ( \theta _ { t } ) = \mu _ { t - \tau } ( \theta _ { t - \tau } ) + \frac { \partial \mu _ { t - \tau } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } } ( \theta _ { t } - \theta _ { t - \tau } ) + \mathbf { O } ( | | \theta _ { t } - \theta _ { t - \tau } | | ^ { 2 } ) , } \\ { \nu _ { t - \tau } ( \theta _ { t } ) = \nu _ { t - \tau } ( \theta _ { t - \tau } ) + \frac { \partial \nu _ { t - \tau } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } } ( \theta _ { t } - \theta _ { t - \tau } ) + \mathbf { O } ( | | \theta _ { t } - \theta _ { t - \tau } | | ^ { 2 } ) , } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\partial \mu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau }$ and $\partial \nu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau }$ are gradients of the statistics with respect to the network weights, and $\mathbf { O } ( | | \theta _ { t } - \theta _ { t - \tau } | | ^ { 2 } )$ denotes higher-order terms of the Taylor polynomial, which can be omitted since the first-order term dominates when $\left( \theta _ { t } - \theta _ { t - \tau } \right)$ is small.
|
| 78 |
+
|
| 79 |
+
In Eq. (5) and Eq. (6), the gradients $\partial \mu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau }$ and $\partial \nu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau }$ cannot be precisely determined at a negligible cost because the statistics $\mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } )$ and $\nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } )$ for a node at the $l$ -th network layer depend on all the network weights prior to the $l$ -th layer, i.e., $\partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { r } \neq 0$ and $\partial { \nu _ { t - \tau } ^ { l } } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { r } \ne 0$ for $r \leq l$ , where $\theta _ { t - \tau } ^ { r }$ denotes the network weights at the $r$ -th layer. Only when $r = l$ can these gradients be derived in closed form efficiently.
|
| 80 |
+
|
| 81 |
+
Empirically, we find that as the layer index $r$ decreases $( r \leq l )$ , the partial gradients $\frac { \partial \mu _ { t } ^ { l } ( \theta _ { t } ) } { \theta _ { t } ^ { r } }$ and $\frac { \partial \nu _ { t } ^ { l } ( \theta _ { t } ) } { \theta _ { t } ^ { r } }$ rapidly diminish. These reduced effects of network weight changes at earlier layers on the activation distributions in later layers may perhaps be explained by the reduced internal covariate shift of BN. Motivated by this phenomenon, which is studied in Appendix C, we propose to truncate these partial gradients at layer $l$ .
|
| 82 |
+
|
| 83 |
+
Thus, we further approximate Eq. (5) and Eq. (6) by
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) \approx \mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) + \frac { \partial \mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { l } } ( \boldsymbol { \theta } _ { t } ^ { l } - \boldsymbol { \theta } _ { t - \tau } ^ { l } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\boldsymbol { v } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) \approx \boldsymbol { v } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) + \frac { \partial \boldsymbol { v } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { l } } ( \boldsymbol { \theta } _ { t } ^ { l } - \boldsymbol { \theta } _ { t - \tau } ^ { l } ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
A naive implementation of $\partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ and $\partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ involves computational overhead of $O ( C ^ { l } \times C ^ { l } \times C ^ { l - 1 } \times K )$ , where $C ^ { l }$ and $C ^ { l - 1 }$ denote the channel dimension of the $l$ -th layer and the $( l - 1 )$ -th layer, respectively, and $K$ denotes the kernel size of $\theta _ { t - \tau } ^ { l }$ . Here we find that the operation can be implemented efficiently in $O ( C ^ { l } \times C ^ { l - 1 } \times K )$ , thanks to the averaging over feature responses of $\mu$ and $\nu$ . See Appendix $\mathbf { B }$ for the details.
|
| 94 |
+
|
| 95 |
+
# 3.3 CROSS-ITERATION BATCH NORMALIZATION
|
| 96 |
+
|
| 97 |
+
After compensating for network weight changes, we aggregate the statistics of the $k - 1$ most recent iterations with those of the current iteration $t$ to obtain the statistics used in CBN:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r l } & { \bar { \mu } _ { t , k } ^ { l } ( \boldsymbol { \theta } _ { t } ) = \displaystyle \frac { 1 } { k } \sum _ { \tau = 0 } ^ { k - 1 } \mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) , } \\ & { \bar { \nu } _ { t , k } ^ { l } ( \boldsymbol { \theta } _ { t } ) = \displaystyle \frac { 1 } { k } \sum _ { \tau = 0 } ^ { k - 1 } \operatorname* { m a x } \left[ \nu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) , \mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) ^ { 2 } \right] , } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
<table><tr><td></td><td>batch size per iter</td><td>#examples for statistics</td><td>Norm axis</td></tr><tr><td>IN</td><td>#bs/GPU * #GPU</td><td>1</td><td>(spatial)</td></tr><tr><td>LN</td><td>#bs/GPU * #GPU</td><td>1</td><td>(channel, spatial)</td></tr><tr><td>GN</td><td>#bs/GPU * #GPU</td><td>1</td><td>(channel group,spatial)</td></tr><tr><td>BN</td><td>#bs/GPU * #GPU</td><td>#bs/GPU</td><td>(batch,spatial)</td></tr><tr><td>syncBN</td><td>#bs/GPU * #GPU</td><td>#bs/GPU *#GPU</td><td>(batch,spatial, GPU)</td></tr><tr><td>CBN</td><td>#bs/GPU * #GPU</td><td>#bs/GPU J* temporal window</td><td>(batch,spatial, iteration)</td></tr></table>
|
| 104 |
+
|
| 105 |
+
Table 1: Comparison of different feature normalization methods. #bs/GPU denotes batch size per GPU.
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\bar { \sigma } _ { t , k } ^ { l } ( \theta _ { t } ) = \sqrt { \bar { \nu } _ { t , k } ^ { l } ( \theta _ { t } ) - \bar { \mu } _ { t , k } ^ { l } ( \theta _ { t } ) ^ { 2 } } ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\mu _ { t - \tau } ^ { l } ( \theta _ { t } )$ and $\nu _ { t - \tau } ^ { l } ( \theta _ { t } )$ are computed from Eq. (7) and Eq. (8). In Eq. (10), $\bar { \nu } _ { t , k } ^ { l } ( \theta _ { t } )$ is determined from the maximum of $\nu _ { t - \tau } ^ { l } ( \theta _ { t } )$ and $\mu _ { t - \tau } ^ { l } ( \theta _ { t } ) ^ { 2 }$ in each iteration because $\nu _ { t - \tau } ^ { l } ( \theta _ { t } ) \geq \mu _ { t - \tau } ^ { l } ( \theta _ { t } ) ^ { 2 }$ should hold for valid statistics but may be violated by Taylor polynomial approximations in Eq. (7) and Eq. (8). Finally, $\bar { \mu } _ { t , k } ^ { l } ( \theta _ { t } )$ and $\bar { \sigma } _ { t , k } ^ { \tilde { l } } ( \theta _ { t } )$ are applied to normalize the corresponding feature responses $\{ x _ { t , i } ^ { l } ( \theta _ { t } ) \} _ { i = 1 } ^ { m }$ at the current iteration:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\hat { x } _ { t , i } ^ { l } ( \theta _ { t } ) = \frac { x _ { t , i } ^ { l } ( \theta _ { t } ) - \bar { \mu } _ { t , k } ^ { l } ( \theta _ { t } ) } { \sqrt { \bar { \sigma } _ { t , k } ^ { l } ( \theta _ { t } ) ^ { 2 } + \varepsilon } } .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
With CBN, the effective number of examples used to compute the statistics for the current iteration is $k$ times as large as that for the original BN. In training, the loss gradients are backpropagated to the network weights and activations at the current iteration, i.e., $\mathbf { \bar { \boldsymbol { \theta } } } _ { t } ^ { l }$ and $x _ { t , i } ^ { l } ( \theta _ { t } )$ . Those of the previous iterations are fixed and do not receive gradients. Hence, the computation cost of CBN in back-propagation is the same as that of BN.
|
| 118 |
+
|
| 119 |
+
Replacing the BN modules in a network by CBN leads to only minor increases in computational overhead and memory footprint. For computation, the additional overhead mainly comes from computing the partial derivatives $\partial \mu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ and $\partial \nu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ , which is insignificant in relation tothe statistics $( \{ \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) \} _ { \tau = 1 } ^ { k - 1 }$ theand $\{ \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) \} _ { \tau = 1 } ^ { k - 1 } )$ For memory, the and the gradients $( \{ \partial \mu _ { t - \tau } ( \stackrel { \cdot } { \theta _ { t - \tau } } ) / \partial \theta _ { t - \tau } ^ { l } \} _ { \tau = 1 } ^ { k - 1 }$ and $\{ \partial \nu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l } \} _ { \tau = 1 } ^ { k - 1 } )$ τ τ=1 computed for the most recent τ τ=1 iterations, which is also minor compared to the rest of the memory consumed in processing the input examples. The additional computation and memory of CBN is reported for our experiments in Table 6.
|
| 120 |
+
|
| 121 |
+
A key hyper-parameter in the proposed CBN is the temporal window size, $k$ , of recent iterations used for statistics estimation. A broader window enlarges the set of examples, but the example quality becomes increasingly lower for more distant iterations, since the differences in network parameters $\theta _ { t }$ and $\theta _ { t - \tau }$ become more significant and are compensated less well using a low-order Taylor polynomial. Empirically, we found that CBN is effective with a window size up to $k = 8$ in a variety of settings and tasks. The only trick is that the window size should be kept small at the beginning of training, when the network weights change quickly. Thus, we introduce a burn-in period of length $T _ { \mathrm { b u r n } }$ -in for the window size, where $k = 1$ and CBN degenerates to the original BN. In our experiments, the burn-in period is set to 25 epochs on ImageNet image classification and 3 epochs on COCO object detection by default. Ablations on this parameter are presented in the Appendix.
|
| 122 |
+
|
| 123 |
+
Table 1 compares CBN with other feature normalization methods. The key difference among these approaches is the axis along which the statistics are counted and the features are normalized. The previous techniques are all designed to exploit examples from the same iteration. By contrast, CBN explores the aggregation of examples along the temporal dimension. As the data utilized by CBN lies in a direction orthogonal to that of previous methods, the proposed CBN could potentially be combined with other feature normalization approaches to further enhance statistics estimation in certain challenging applications.
|
| 124 |
+
|
| 125 |
+
# 4 EXPERIMENTS
|
| 126 |
+
|
| 127 |
+
# 4.1 IMAGE CLASSIFICATION ON IMAGENET
|
| 128 |
+
|
| 129 |
+
Experimental settings. ImageNet (Russakovsky et al., 2015) is a benchmark dataset for image classification, containing 1.28M training images and 50K validation images from 1000 classes. We follow the standard setting in (He et al., 2015) to train deep networks on the training set and report the single-crop top-1 accuracy on the validation set. Our preprocessing and augmentation strategy strictly follows the GN baseline (Wu & He, 2018). We use a weight decay of 0.0001 for all weight layers, including $\gamma$ and $\beta$ . We train standard ResNet-18 for 100 epochs on 4 GPUs, and decrease the learning rate by the cosine decay strategy (He et al., 2019). We use the average over 5 trials for all results. All hyper-parameters, e.g. group size of GN, are carefully tuned via cross-validation. ResNet-18 with BN is our base model. To compare with other normalization methods, we directly replace BN with IN, LN, GN, BRN, and our proposed CBN.
|
| 130 |
+
|
| 131 |
+
Comparison of feature normalization methods. We compare the performance of each normalization method with a normal batch size, 32, in Table 2. With sufficient data for reliable statistics, BN easily reaches the highest top-1 accuracy. Similar as the results in previous papers
|
| 132 |
+
|
| 133 |
+
<table><tr><td></td><td>IN</td><td>LN</td><td>GN</td><td>BN</td><td>CBN</td></tr><tr><td>Top-1 accuracy</td><td>64.4</td><td>67.9</td><td>68.9</td><td>70.2</td><td>70.2</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 2: Top-1 accuracy of feature normalization methods using ResNet-18 on ImageNet.
|
| 136 |
+
|
| 137 |
+
(Wu & He, 2018), IN and LN achieve significantly worse performance than BN. GN works well on image classification, but still has a small degradation of $1 . 2 \%$ compared with BN. Over all the methods, our CBN is the only one that is able to achieve comparable accuracy with BN, as it converges to the procedure of BN as the batch size becomes larger.
|
| 138 |
+
|
| 139 |
+
Sensitivity to batch size. We compare the behavior of CBN, original BN (Ioffe & Szegedy, 2015), GN (Wu & He, 2018), and BRN (Ioffe, 2017) at the same number of images per GPU on ImageNet classification. For CBN, the recent iterations are utilized so as to ensure that the number of effective examples is no fewer than 16. For BRN, the settings strictly follow the original paper. We adopt a learning rate of 0.1 for the batch size of 32, and linearly scale the learning rate by $N / 3 2$ for a batch size of $N$ .
|
| 140 |
+
|
| 141 |
+
Table 3: Top-1 accuracy of feature normalization methods with different batch sizes using ResNet-18 as the base model on ImageNet.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>batch size per GPU</td><td>32</td><td>16</td><td>8</td><td>4</td><td>2</td></tr><tr><td>BN</td><td>70.2</td><td>70.2</td><td>68.4</td><td>65.1</td><td>55.9</td></tr><tr><td>GN</td><td>68.9</td><td>69.0</td><td>68.9</td><td>69.0</td><td>69.1</td></tr><tr><td>BRN</td><td>70.1</td><td>68.5</td><td>68.2</td><td>67.9</td><td>60.3</td></tr><tr><td>CBN</td><td>70.2</td><td>70.2</td><td>70.1</td><td>69.8</td><td>69.3</td></tr></table>
|
| 144 |
+
|
| 145 |
+
The results are shown in Table 3. For the original BN, its accuracy drops noticeably as the number of images per GPU is reduced from 32 to 2. BRN suffers a significant performance drop as well. GN maintains its accuracy by utilizing the channel dimension but not batch dimension. For CBN, its accuracy holds by exploiting the examples of recent iterations. Also, CBN outperforms GN by $0 . 9 \%$ on average top-1 accuracy with different batch sizes. This is reasonable, because the statistics computation of CBN introduces uncertainty caused by the stochastic batch sampling like in BN, but this uncertainty is missing in GN which results in some loss of regularization ability.
|
| 146 |
+
|
| 147 |
+
# 4.2 OBJECT DETECTION AND INSTANCE SEGMENTATION ON COCO
|
| 148 |
+
|
| 149 |
+
Experimental settings. COCO (Lin et al., 2014) is chosen as the benchmark for object detection and instance segmentation. Models are trained on the COCO 2017 train split with $1 1 8 \mathrm { k }$ images, and evaluated on the COCO 2017 validation split with 5k images. Following the standard protocol in (Lin et al., 2014), the object detection and instance segmentation accuracies are measured by the mean average precision (mAP) scores at different intersection-over-union (IoU) overlaps at the box and the mask levels, respectively.
|
| 150 |
+
|
| 151 |
+
Following (Wu & He, 2018), Faster R-CNN (Ren et al., 2015) and Mask R-CNN (He et al., 2017) with FPN (Lin et al., 2017) are chosen as the baselines for object detection and instance segmentation, respectively. For both, the 2fc box head is replaced by a 4conv1fc head for better use of the normalization mechanism (Wu & He, 2018). The backbone networks are ImageNet pretrained ResNet-50 (default) or ResNet-101, with specific normalization. Finetuning is performed on the COCO train set for 12 epochs on 4 GPUs by SGD, where each GPU processes 4 images (default). Note that the mean and variance statistics in CBN are computed within each GPU. The learning rate is initialized to be $0 . 0 2 * N / 1 6$ for a batch size per GPU of $N$ , and is decayed by a factor of 10 at the 9-th and the 11-th epochs. The weight decay and momentum parameters are set to 0.0001 and 0.9, respectively. We use the average over 5 trials for all results. All hyper-parameters, e.g. group size of GN, are carefully tuned via cross-validation.
|
| 152 |
+
|
| 153 |
+
Table 4: Results of feature normalization methods on Faster R-CNN with FPN and ResNet50 on COCO.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>backbone</td><td>box head</td><td>Apbbox</td><td>APbbox 50</td><td></td><td>APbbox S</td><td>APbbox M</td><td>APbbox</td></tr><tr><td>fixed BN</td><td>1</td><td>36.9</td><td>58.2</td><td>39.9</td><td>21.2</td><td>40.8</td><td>46.9</td></tr><tr><td>fixed BN</td><td>BN</td><td>36.3</td><td>57.3</td><td>39.2</td><td>20.8</td><td>39.7</td><td>47.3</td></tr><tr><td>fixed BN</td><td>syncBN</td><td>37.7</td><td>58.5</td><td>41.1</td><td>22.0</td><td>40.9</td><td>49.0</td></tr><tr><td>fixed BN</td><td>GN</td><td>37.8</td><td>59.0</td><td>40.8</td><td>22.3</td><td>41.2</td><td>48.4</td></tr><tr><td>fixed BN</td><td>CBN</td><td>37.7</td><td>59.0</td><td>40.7</td><td>22.1</td><td>40.9</td><td>48.8</td></tr><tr><td>BN</td><td>BN</td><td>35.5</td><td>56.4</td><td>38.7</td><td>19.7</td><td>38.8</td><td>47.3</td></tr><tr><td>syncBN</td><td>syncBN</td><td>37.9</td><td>58.5</td><td>41.1</td><td>21.7</td><td>41.5</td><td>49.7</td></tr><tr><td>GN</td><td>GN</td><td>37.8</td><td>59.1</td><td>40.9</td><td>22.4</td><td>41.2</td><td>49.0</td></tr><tr><td>CBN</td><td>CBN</td><td>37.3</td><td>57.7</td><td>39.3</td><td>21.9</td><td>40.8</td><td>48.2</td></tr></table>
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Backbone</td><td>method</td><td>norm</td><td>Apbbox</td><td>APbox 50</td><td>AP5ox</td><td>APbbox S</td><td>APbox M</td><td>APbbox</td></tr><tr><td rowspan="3">R50+FPN</td><td rowspan="3">Faster RCNN</td><td>GN</td><td>37.8</td><td>59.0</td><td>40.8</td><td>22.3</td><td>41.2</td><td>48.4</td></tr><tr><td>syncBN</td><td>37.7</td><td>58.5</td><td>41.1</td><td>22.0</td><td>40.9</td><td>49.0</td></tr><tr><td>CBN</td><td>37.7</td><td>59.0</td><td>40.7</td><td>22.1</td><td>40.9</td><td>48.8</td></tr><tr><td rowspan="2">R101+FPN</td><td rowspan="2">Faster RCNN</td><td rowspan="2">GN syncBN CBN</td><td>39.3 39.2</td><td>60.6</td><td>42.7 43.0</td><td>22.5</td><td>42.5</td><td>51.3</td></tr><tr><td>39.2</td><td>59.8 60.0</td><td>42.6</td><td>22.2 22.3</td><td>42.9 42.6</td><td>51.6 51.1</td></tr><tr><td rowspan="3">R50+FPN</td><td rowspan="3">Mask RCNN</td><td rowspan="3">GN syncBN</td><td>Apbbox</td><td>APo</td><td>AP5box</td><td>Apmask</td><td>APsk</td><td>APmsk</td></tr><tr><td>38.6</td><td>59.8</td><td>41.9</td><td>35.0</td><td>56.7</td><td>37.3</td></tr><tr><td>38.5</td><td>58.9</td><td>42.3</td><td>34.7</td><td>56.3</td><td>36.8</td></tr><tr><td rowspan="3">R101+FPN</td><td rowspan="3">Mask RCNN</td><td>CBN</td><td>38.5</td><td>59.2</td><td>42.1</td><td>34.6</td><td>56.4</td><td>36.6</td></tr><tr><td>GN</td><td>40.3</td><td>61.2</td><td>44.2</td><td>36.6</td><td>58.5</td><td>39.2</td></tr><tr><td>syncBN</td><td>40.3</td><td></td><td>44.2</td><td></td><td></td><td>38.6</td></tr><tr><td rowspan="2"></td><td rowspan="2"></td><td rowspan="2">CBN</td><td></td><td>60.8</td><td></td><td>36.0</td><td>57.7</td><td></td></tr><tr><td>40.1</td><td>60.5</td><td>44.1</td><td>35.8</td><td>57.3</td><td>38.5</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 5: Results with stronger backbones on COCO object detection and instance segmentation.
|
| 160 |
+
|
| 161 |
+
As done in (Wu & He, 2018), we experiment with two settings where the normalizers are activated only at the task-specific heads with frozen BN at the backbone (default), or the normalizers are activated at all the layers except for the early conv1 and conv2 stages in ResNet.
|
| 162 |
+
|
| 163 |
+
Normalizers at backbone and task-specific heads. We further study the effect of different normalizers on the backbone network and task-specific heads for object detection on COCO. CBN, original BN, syncBN, and GN are included in the comparison.
|
| 164 |
+
|
| 165 |
+
Table 4 presents the results. When BN is frozen in the backbone and no normalizer is applied at the head, the $\mathsf { A P } ^ { \mathsf { b b o x } }$ score is $3 6 . 9 \%$ . When the original BN is applied at the head only and at both the backbone and the head, the accuracy drops to $3 6 . 3 \%$ and $3 5 . 5 \%$ , respectively. For CBN, the accuracy is $3 7 . 7 \%$ and $3 7 . 3 \%$ at these two settings, respectively. Without any synchronization across GPUs, CBN can achieve comparable performance with syncBN and GN, showing the superiority of the proposed approach. Unfortunately, due to the accumulation of approximation error, CBN observes a $0 . 4 \%$ decrease in $\mathsf { A P } ^ { \mathsf { b b o x } }$ when replacing frozen BN with CBN in the backbone. Even so, CBN still outperforms the variant with unfrozen BN in backbone by $1 . 8 \%$ .
|
| 166 |
+
|
| 167 |
+
Instance segmentation and stronger backbones. Results of object detection (Faster R-CNN (Ren et al., 2015)) and instance segmentation (Mask R-CNN (He et al., 2017)) with ResNet-50 and ResNet-101 are presented in Table 5. We can observe that our proposed CBN achieves performance comparable to syncBN and GN with R50 and R101 as the backbone on both Faster R-CNN and Mask R-CNN, which demonstrates that CBN is robust and versatile to various deep models and tasks.
|
| 168 |
+
|
| 169 |
+
# 4.3 ABLATION STUDY
|
| 170 |
+
|
| 171 |
+
Effect of temporal window size $k$ . We conduct this ablation on ImageNet image classification and COCO object detection, with each GPU processing 4 images. Figure 3 presents the results. When $k = 1$ , only the batch from the current iteration is utilized; therefore, CBN degenerates to the original BN. The accuracy suffers due to the noisy statistics on small batch sizes. As the window size $k$ gradually increases, more examples from recent iterations are utilized for statistics estimation, leading to greater accuracy. Accuracy saturates at $k = 8$ and even drops slightly. For more distant iterations, the network weights differ more substantially and the Taylor polynomial approximation becomes less accurate.
|
| 172 |
+
|
| 173 |
+
On the other hand, it is empirically observed that the original BN saturates at a batch size of 16 or 32 for numerous applications (Peng et al., 2018; Wu & He, 2018), indicating that the computed statistics become accurate. Thus, a temporal window size of $k = \mathrm { m i n } \big ( \lceil \frac { 1 6 } { \mathrm { b s } \mathrm { p e r G P U } } \rceil , 8 \big )$ is suggested.
|
| 174 |
+
|
| 175 |
+
Effect of compensation. To study this, we compare CBN with 1) a naive baseline where statistics from recent iterations are directly aggregated without compensation via Taylor polynomial, referred to as Naive CBN; and 2) the original BN applied with the same
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 3: The effect of temporal window size ${ \bf ( k ) }$ on ImageNet (ResNet-18) and COCO (Faster R-CNN with ResNet-50 and FPN) with $\# \mathrm { b s / G P U } = 4$ for CBN and Naive CBN. Naive CBN directly utilizes statistics from recent iterations, while BN uses the equivalent #examples as CBN for statistics computation.
|
| 179 |
+
|
| 180 |
+
effective example number as CBN (i.e., its batch size per GPU is set to the product of the batch size per GPU and the temporal window size of CBN), which does not require any compensation and serves as an upper performance bound.
|
| 181 |
+
|
| 182 |
+
The experimental results are also presented in Figure 3. CBN clearly surpasses Naive CBN when the previous iterations are included. Actually, Naive CBN fails when the temporal window size grows to $k = 8$ as shown in Figure 3(a), demonstrating the necessity of compensating for changing network weights over iterations. Compared with the original BN upper bound, CBN achieves similar accuracy at the same effective example number. This result indicates that the compensation using a low-order Taylor polynomial by CBN is effective.
|
| 183 |
+
|
| 184 |
+
Figure 4 presents the train and test curves of CBN, Naive CBN, BN-bs4, and BN-bs16 on ImageNet, with 4 images per GPU and a temporal window size of 4 for CBN, Naive CBN, and BN-bs4, and 16 images per GPU for BN-bs16. The train curve of CBN is close to BN-bs4 at the beginning, and approaches BN-bs16 at the end. The reason is that we adopt a burn-in period to avoid the disadvantage of rapid statistics change at beginning of training. The gap between the train curve of Naive CBN and CBN shows that
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 4: Training and test curves for CBN, Naive CBN, and BN on ImageNet, with batch size per GPU of 4 and temporal window size $k = \overset { \cdot } { 4 }$ for CBN, Naive CBN, and BN-bs4, and batch size per GPU of 16 for BN-bs16. Thus, the plot of BN-bs16 is the ideal bound.
|
| 188 |
+
|
| 189 |
+
Naive CBN cannot even reach a good convergence on the training set. The test curve of CBN is close to BN-bs16 at the end, while Naive CBN exhibits considerable jitter. All these phenomena indicate the effectiveness of our proposed Taylor compensation.
|
| 190 |
+
|
| 191 |
+
Additional computational overhead and memory footprint. As the inference stage of CBN is the same as BN, we only need to compare the computational overhead and memory footprint at the training time, shown in Table 6. The extra computational overhead mainly includes calculations of the statistics’ respective gradients, Taylor compensations, and averaging operations. For the extra memory, the statistics ( $\mu$ and $\nu$ ), their respective gradients, and the network parameters $( \theta _ { t - 1 } \cdot \cdot \cdot \theta _ { t - ( k - 1 ) } )$ of previous iterations are all stored when applying CBN.
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=1>ImageNet</td><td rowspan=1 colspan=1>COCO</td></tr><tr><td rowspan=1 colspan=1>BN CBN</td><td rowspan=1 colspan=1>BN CBN</td></tr><tr><td rowspan=1 colspan=1>Base modelGFLOPs Taylor expansionTotal</td><td rowspan=1 colspan=1>5.965.96- 0.215.966.17</td><td rowspan=1 colspan=1>5155.15809.7- 654.65155.15809.7</td></tr><tr><td rowspan=3 colspan=1>MemoryFeature mapNet params(GB) Total</td><td rowspan=1 colspan=1>0.150.45</td><td rowspan=1 colspan=1>14.1 15.1</td></tr><tr><td rowspan=1 colspan=1>0.090.21</td><td rowspan=2 colspan=1>0.3 0.614.4 15.7</td></tr><tr><td rowspan=1 colspan=1>0.240.66</td></tr></table>
|
| 194 |
+
|
| 195 |
+
Table 6: Comparison of theoretical FLOPs and memory footprint between CBN and original BN in both forward and backward passes at training time.
|
| 196 |
+
|
| 197 |
+
From these results, the additional overhead of CBN is seen to be minor.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 202 |
+
|
| 203 |
+
Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4):834–848, 2017.
|
| 204 |
+
|
| 205 |
+
Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In Proceedings of the IEEE international conference on computer vision, pp. 764–773, 2017.
|
| 206 |
+
|
| 207 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 208 |
+
|
| 209 |
+
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.
|
| 210 |
+
|
| 211 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 2961–2969, 2017.
|
| 212 |
+
|
| 213 |
+
Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 214 |
+
|
| 215 |
+
Sergey Ioffe. Batch renormalization: Towards reducing minibatch dependence in batch-normalized models. In Advances in Neural Information Processing Systems, pp. 1945–1953, 2017.
|
| 216 |
+
|
| 217 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 218 |
+
|
| 219 |
+
Yann LeCun, Léon Bottou, Genevieve B Orr, and Klaus-Robert Müller. Efficient backprop. In Neural Networks: Tricks of the Trade, this book is an outgrowth of a 1996 NIPS workshop, pp. 9–50. Springer-Verlag, 1998.
|
| 220 |
+
|
| 221 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pp. 740–755. Springer, 2014.
|
| 222 |
+
|
| 223 |
+
Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 224 |
+
|
| 225 |
+
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.
|
| 226 |
+
|
| 227 |
+
Ping Luo, Jiamin Ren, and Zhanglin Peng. Differentiable learning-to-normalize via switchable normalization. arXiv preprint arXiv:1806.10779, 2018.
|
| 228 |
+
|
| 229 |
+
Hyeonseob Nam and Hyo-Eun Kim. Batch-instance normalization for adaptively style-invariant neural networks. In Advances in Neural Information Processing Systems, pp. 2563–2572, 2018.
|
| 230 |
+
|
| 231 |
+
Chao Peng, Tete Xiao, Zeming Li, Yuning Jiang, Xiangyu Zhang, Kai Jia, Gang Yu, and Jian Sun. Megdet: A large mini-batch object detector. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6181–6189, 2018.
|
| 232 |
+
|
| 233 |
+
Siyuan Qiao, Huiyu Wang, Chenxi Liu, Wei Shen, and Alan Yuille. Weight standardization. arXiv preprint arXiv:1903.10520, 2019.
|
| 234 |
+
|
| 235 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015.
|
| 236 |
+
|
| 237 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 238 |
+
|
| 239 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909, 2016.
|
| 240 |
+
|
| 241 |
+
Wenqi Shao, Tianjian Meng, Jingyu Li, Ruimao Zhang, Yudian Li, Xiaogang Wang, and Ping Luo. Ssn: Learning sparse switchable normalization via sparsestmax. arXiv preprint arXiv:1903.03793, 2019.
|
| 242 |
+
|
| 243 |
+
J Sola and Joaquin Sevilla. Importance of input data normalization for the application of neural networks to complex industrial problems. IEEE Transactions on nuclear science, 44(3):1464–1468, 1997.
|
| 244 |
+
|
| 245 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 246 |
+
|
| 247 |
+
Guangrun Wang, Ping Luo, Xinjiang Wang, Liang Lin, et al. Kalman normalization: Normalizing internal representations across network layers. In Advances in Neural Information Processing Systems, pp. 21–31, 2018a.
|
| 248 |
+
|
| 249 |
+
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, pp. 7794–7803, 2018b.
|
| 250 |
+
|
| 251 |
+
Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 3–19, 2018.
|
| 252 |
+
|
| 253 |
+
# A ALGORITHM OUTLINE
|
| 254 |
+
|
| 255 |
+
Algorithm 1 presents an outline of our proposed Cross-Iteration Batch Normalization (CBN).
|
| 256 |
+
|
| 257 |
+
# Algorithm 1: Cross-Iteration Batch Normalization(CBN)
|
| 258 |
+
|
| 259 |
+
Input: Feature responses of a network node of the $l$ -th layer at the $t$ -th iteration $\{ x _ { t , i } ^ { l } ( \theta _ { t } ) \} _ { i = 1 } ^ { m }$ , network weights $\{ \theta _ { t - \tau } ^ { l } \} _ { \tau = 0 } ^ { k - 1 }$ , statistics $\{ \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) \} _ { \tau = 1 } ^ { k - 1 }$ and $\{ \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) \} _ { \tau = 1 } ^ { k - 1 }$ , and gradients $\{ \partial \mu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l } \} _ { \tau = 1 } ^ { k - 1 }$ =0 and $\{ \partial \nu _ { t - \tau } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l } \} _ { \tau = 1 } ^ { k - 1 }$ τ τfrom most recent $k - 1$ iterations Output: $\{ y _ { t , i } ^ { l } ( \theta _ { t } ) = \mathbf { C B N } ( x _ { t , i } ^ { l } ( \theta _ { t } ) ) \}$
|
| 260 |
+
1 $\begin{array} { r } { \mu _ { t } ( \theta _ { t } ) \gets \frac { 1 } { m } \sum _ { i = 1 } ^ { m } x _ { t , i } ( \theta _ { t } ) , \nu _ { t } ( \theta _ { t } ) \gets \frac { 1 } { m } \sum _ { i = 1 } ^ { m } x _ { t , i } ^ { 2 } ( \theta _ { t } ) } \end{array}$ //statistics on the current iteration
|
| 261 |
+
2 for $\tau \in \{ 1 , \ldots , k \}$ do
|
| 262 |
+
3 $\begin{array} { r l } & { \mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) \dot { \mu } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) + \frac { \partial \mu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { l } } ( \boldsymbol { \theta } _ { t } ^ { l } - \boldsymbol { \theta } _ { t - \tau } ^ { l } ) } \\ & { \nu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t } ) \nu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) + \frac { \partial \nu _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { l } } ( \boldsymbol { \theta } _ { t } ^ { l } - \boldsymbol { \theta } _ { t - \tau } ^ { l } ) } \end{array}$ //approximation from recent iterations
|
| 263 |
+
4 //approximation from recent iterations
|
| 264 |
+
5 end
|
| 265 |
+
6 $\begin{array} { r } { \bar { \mu } _ { t , k } ^ { l } ( \theta _ { t } ) \gets \frac { 1 } { k } \sum _ { \tau = 0 } ^ { k - 1 } \mu _ { t - \tau } ^ { l } ( \theta _ { t } ) } \end{array}$ //averaging over recent iterations
|
| 266 |
+
7 $\begin{array} { r } { \bar { \nu } _ { t , k } ^ { l } ( \theta _ { t } ) \gets \frac { 1 } { k } \sum _ { \tau = 0 } ^ { k - 1 } \operatorname* { m a x } \left[ \nu _ { t - \tau } ^ { l } ( \theta _ { t } ) , \mu _ { t - \tau } ^ { l } ( \theta _ { t } ) ^ { 2 } \right] } \end{array}$ //validation and averaging over recent iterations
|
| 267 |
+
8 $\bar { \sigma } _ { t , k } ^ { l } ( \theta _ { t } ) ^ { 2 } \gets \bar { \nu } _ { t , k } ^ { l } ( \theta _ { t } ) - \bar { \mu } _ { t , k } ^ { l } ( \theta _ { t } ) ^ { 2 }$ $\begin{array} { r } { \hat { x } _ { t , i } ^ { l } ( \theta _ { t } ) = \frac { x _ { t , i } ^ { l } ( \theta _ { t } ) - \bar { \mu } _ { t , k } ^ { l } ( \theta _ { t } ) } { \sqrt { \bar { \sigma } _ { t , k } ^ { l } ( \theta _ { t } ) ^ { 2 } + \varepsilon } } } \end{array}$ //normalize
|
| 268 |
+
10 $y _ { t , i } ^ { l } ( \theta _ { t } ) \gets \gamma \hat { x } _ { t , i } ^ { l } ( \theta _ { t } ) + \beta$ //scale and shift
|
| 269 |
+
|
| 270 |
+
B EFFICIENT IMPLEMENTATION OF $\partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l } \ \cdot$ ND $\partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$
|
| 271 |
+
|
| 272 |
+
Let $C ^ { l }$ and $C ^ { l - 1 }$ denote the channel dimension of the $l$ -th layer and the $( l - 1 )$ -th layer, respectively, and $K$ denotes the kernel size of $\theta _ { t - \tau } ^ { l }$ . $\mu _ { t - \tau } ^ { l }$ and $\nu _ { t - \tau } ^ { l }$ are thus of $C ^ { l }$ dimensions in channels, and $\theta _ { t - \tau } ^ { l }$ is a $C ^ { l } \times C ^ { l - 1 } \times K$ dimensional tensor. A naive implementation of $\partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ and $\partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ involves computational overhead of $O ( C ^ { l } \times C ^ { l } \times C ^ { l - 1 } \times K )$ . Here we find that the operations of $\mu$ and $\nu$ can be implemented efficiently in $O ( C ^ { l - 1 } \times K )$ and $O ( C ^ { l } \times C ^ { l - 1 } \times K )$ , respectively, thanks to the averaging of feature responses in $\mu$ and $\nu$ .
|
| 273 |
+
|
| 274 |
+
Here we derive the efficient implementation of $\partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ . That of $\partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) / \partial \theta _ { t - \tau } ^ { l }$ is about the same. Let us first simplify the notations a bit. Let $\mu ^ { l }$ and $\theta ^ { l }$ denote $\mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } )$ and $\theta _ { t - \tau } ^ { l }$ respectively, by removing the irrelevant notations for iterations. The element-wise computation in the forward pass can be computed as
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\mu _ { j } ^ { l } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } x _ { i , j } ^ { l } ,
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
where $\mu _ { j } ^ { l }$ denotes the $j$ -th channel in $\mu ^ { l }$ , and $x _ { i , j } ^ { l }$ denotes the $j$ -th channel in the $i$ -th example. $x _ { i , j } ^ { l }$ is computed as
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
x _ { i , j } ^ { l } = \sum _ { n = 1 } ^ { C ^ { l - 1 } } \sum _ { k = 1 } ^ { K } \theta _ { j , n , k } ^ { l } \cdot y _ { i + \mathrm { o f f s e t } ( k ) , n } ^ { l - 1 } ,
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
where $n$ and $k$ enumerate the input feature dimension and the convolution kernel index, respectively, offset $( k )$ denotes the spatial offset in applying the $k$ -th kernel, and $y ^ { l - 1 }$ is the output of the $\bar { ( } l - 1 )$ -th layer.
|
| 287 |
+
|
| 288 |
+
The element-wise calculation of ${ \partial \mu ^ { l } } / { \partial \theta ^ { l } } \in \mathbb { R } ^ { C ^ { l } \times C ^ { l } \times C ^ { l - 1 } \times K }$ is as follows, taking Eq. (13) and Eq. (14) into consideration:
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\begin{array} { l } { \displaystyle { | \frac { \partial \mu ^ { l } } { \partial \theta ^ { l } } | _ { j , q , p , \eta } = \frac { \partial \mu _ { j } ^ { l } } { \partial \theta _ { q , p , \eta } ^ { l } } } } \\ { \displaystyle { \ } = \frac { \partial \frac { 1 } { m } \sum _ { i = 1 } ^ { m } x _ { i , j } ^ { l } } { \partial \theta _ { i , p , \eta } ^ { l } } } \\ { \displaystyle { \ } = \frac { \partial \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \sum _ { n = 1 } ^ { c ^ { l - 1 } } \sum _ { k = 1 } ^ { K } \theta _ { j , n , k } ^ { l } \cdot y _ { i + \mathrm { o f i s e t } ( k ) , n } ^ { l - 1 } } { \partial \theta _ { q , p , \eta } ^ { l } } } \\ { \displaystyle { \ } = \left\{ \begin{array} { l l } { \frac { 1 } { m } \sum _ { i = 1 } ^ { m } y _ { i + \mathrm { o f i s e t } ( \eta ) , p } ^ { l - 1 } } & { , j = q } \\ { 0 } & { , j \neq q } \end{array} \right. . } \end{array}
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
Thus, $\lbrack { \frac { \partial \mu ^ { l } } { \partial \theta ^ { l } } } \rbrack _ { j , q , p , \eta }$ takes non-zero values only when $j = q$ . This operation can be implemented efficiently in $O ( C ^ { l - 1 } \times K )$ . Similarly, the calculation of $\partial \nu ^ { l } / \partial \theta ^ { l }$ can be obtained in $O ( C ^ { l } \times C ^ { l - 1 } \times K )$ .
|
| 295 |
+
|
| 296 |
+
# C ADDITIONAL EXPERIMENTS
|
| 297 |
+
|
| 298 |
+
CIFAR-10 is selected for the experiments in this section. It consists of 50k training images and 10k test images from 10 classes. We train the standard ResNet-18 for 160 epochs on one GPU by SGD. The momentum and weight decay parameters are set to 0.9 and 0.0001, respectively. We experiment with batch sizes of 32, 16, 8, 4, and 2 images per GPU. The learning rate is scaled linearly to different batch sizes, following the practice in (Peng et al., 2018). The initial learning rate is $0 . 0 2 5 * N / 3 2$ for a batch size per
|
| 299 |
+
|
| 300 |
+
<table><tr><td>Trials</td><td>1 2</td><td>3</td><td>4</td><td></td><td>overall</td></tr><tr><td>BN-bs16</td><td>95.3</td><td>95.0 95.4</td><td>95.3</td><td></td><td>95.395.26±0.14</td></tr><tr><td>BN-bs4</td><td>93.6</td><td>93.5 93.6</td><td>93.6</td><td></td><td>93.8 93.62±0.11</td></tr><tr><td>BRN</td><td>94.4</td><td>94.7 94.5</td><td>94.3</td><td></td><td>94.4 94.46±0.15</td></tr><tr><td>GN</td><td>94.3</td><td>94.0 94.4</td><td>94.2</td><td></td><td>94.4 94.26±0.17</td></tr><tr><td>CBN</td><td>95.095.0</td><td>94.6</td><td></td><td></td><td>95.0 95.2 94.96±0.22</td></tr></table>
|
| 301 |
+
|
| 302 |
+
Table 7: Top-1 accuracy of ResNet-18 with different trials on CIFAR-10. The batch size per GPU is 16 and 4 for BN-bs16 and the other methods, respectively.
|
| 303 |
+
|
| 304 |
+
iteration of $N$ . The learning rate is divided by 10 at epochs 80 and 120. The images are of $3 2 \times 3 2$ pixels with per-image standardization in both training and inference. Random flipping is applied in training.
|
| 305 |
+
|
| 306 |
+
We report the results of BN, BRN, GN, CBN with five trials on CIFAR-10, as shown in Table 7. CBN has the smallest gap with BN-bs16 compared to BN-bs4, BRN, and GN. This result is consistent with previous experiments on ImageNet and COCO. Also the std is tiny, indicating that performance on CIFAR-10 is stable enough for some empirical studies.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 5: Results of different burn-in periods (in epochs) on CBN, with batch size per iteration of 4, on CIFAR-10 and COCO.
|
| 310 |
+
|
| 311 |
+
On the burn-in period length $T _ { \mathbf { b u r n - i n } }$ . We further study the influence of varying the burn-in period length $T _ { \mathrm { b u r n - i n } }$ , at 4 images per GPU on both CIFAR-10 image classification (ResNet-18) and COCO object detection (Faster R-CNN with FPN and ResNet-50).
|
| 312 |
+
|
| 313 |
+
Figure 5(a) and 5(b) present the results. When the burn-in period is too short, the accuracy suffers. This is because at the beginning of training, the network weights change rapidly, causing the compensation across iterations to be less effective. On the other hand, the accuracy is stable for a wide range of burn-in periods $T _ { \mathrm { b u r n - i n } }$ that are not too short.
|
| 314 |
+
|
| 315 |
+
On the effect of using more than one layer. The efficient implementation is no longer applicable when more than one layer of compensation is adopted. Therefore, we only conduct a two-layer experiment of ResNet-18 on CIFAR-10 in consideration of the heavy extra memory and computational overhead. CBN using two layers for compensation achieves 95.0 on CIFAR-10 (batch size $^ { = 4 }$ , $\mathrm { k } { = } 4$ ), which is comparable to CBN using only one layer. As using more layers does not further improve performance but consumes more FLOPs, we adopt one-layer compensation on CBN in practice.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 6: Comparison of gradients of statistics w.r.t. current layer vs. that w.r.t. previous layers on CIFAR-10.
|
| 319 |
+
|
| 320 |
+
On the gradients from different layers. The key assumption in Eq. (7) and Eq. (8) is that for a node at the $l$ -th layer, the gradient of its statistics with respect to the network weights at the l-th layer is larger than that of weights from the prior layers, i.e., || ∂ µlt−τ (θt−τ )∂ θ l || $| | \frac { \partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l } } | | _ { F } \gg | | \frac { \partial \bar { \mu _ { t - \tau } ^ { l } } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { r } } | | _ { F }$ and $| | \frac { \partial \boldsymbol { v } _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l } } | | _ { F } \gg | | \frac { \partial \boldsymbol { v } _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { r } } | | _ { F }$ || ∂ νlt−τ (θt−τ )∂ θ r− ||F for r < l, where || · ||F denotes the Frobenius norm. Here we τexamine this assumption empirically for networks trained on CIFAR-10 image recognition.
|
| 321 |
+
|
| 322 |
+
Figure 6 presents the computed ratio of $| | \frac { \partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { r } } | | _ { F } / | | \frac { \partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l } } | | _ { F }$ and $| | \frac { \partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { r } } | | _ { F } / | | \frac { \partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l } } | | _ { F }$ || ∂ νlt−τ (θt−τ )l ||F for r ≤ l, at different training epochs. The results suggest that $| | \frac { \partial \boldsymbol { \mu } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { l } } | | _ { F } \gg | | \frac { \partial \boldsymbol { \mu } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { r } } | | _ { F }$ || ∂ µlt−τ (θt−τ )r ||F and | $| | \frac { \partial \boldsymbol { v } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { l } } | | _ { F } \gg | | \frac { \partial \boldsymbol { v } _ { t - \tau } ^ { l } ( \boldsymbol { \theta } _ { t - \tau } ) } { \partial \boldsymbol { \theta } _ { t - \tau } ^ { r } } | | _ { F }$ || ∂ νlt−τ (θt−τ )r ||F hold for r < l, thus validating the approximation in Eq. (7) and Eq. (8).
|
| 323 |
+
|
| 324 |
+
We also study the gradients of non-ResNet models. $| | \frac { \partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l - 2 } } | | _ { F } / | | \frac { \partial \mu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l } } | | _ { F }$ and $| | \frac { \partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l - 2 } } | | _ { F } / | | \frac { \partial \nu _ { t - \tau } ^ { l } ( \theta _ { t - \tau } ) } { \partial \theta _ { t - \tau } ^ { l } } | | _ { F }$ || ∂ νlt−τ (θt−τ )l ||F on VGG-16 and InceptionV3 are (0.22 and 0.46) and (0.17 and 0.38), respectively, which is similar to ResNet-18 (0.13 and 0.40), indicating that the assumption should also hold for VGG and the Inception series.
|
md/train/C0GmZH2RnVR/C0GmZH2RnVR.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Breaking the Dilemma of Medical Image-to-image Translation
|
| 2 |
+
|
| 3 |
+
Lingke Kong∗ Manteia Tech konglingke@manteiatech.com
|
| 4 |
+
|
| 5 |
+
Chenyu Lian∗ Xiamen University cylian@stu.xmu.edu.cn
|
| 6 |
+
|
| 7 |
+
Detian Huang Huaqiao University huangdetian@hqu.edu.cn
|
| 8 |
+
|
| 9 |
+
Zhenjiang Li Shandong University zhenjli1987@163.com
|
| 10 |
+
|
| 11 |
+
Yanle Hu† Mayo Clinic Arizona Hu.Yanle@mayo.edu
|
| 12 |
+
|
| 13 |
+
Qichao Zhou† Manteia Tech zhouqc@manteiatech.com
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
Supervised Pix2Pix and unsupervised Cycle-consistency are two modes that dominate the field of medical image-to-image translation. However, neither modes are ideal. The Pix2Pix mode has excellent performance. But it requires paired and well pixel-wise aligned images, which may not always be achievable due to respiratory motion or anatomy change between times that paired images are acquired. The Cycle-consistency mode is less stringent with training data and works well on unpaired or misaligned images. But its performance may not be optimal. In order to break the dilemma of the existing modes, we propose a new unsupervised mode called RegGAN for medical image-to-image translation. It is based on the theory of "loss-correction". In RegGAN, the misaligned target images are considered as noisy labelsaand the generator is trained with an addi- ˘ tional registration network to fit the misaligned noise distribution adaptively. The goal is to search for the common optimal solution to both image-to-image translation and registration tasks. We incorporated RegGAN into a few state-of-the-art image-to-image translation methods and demonstrated that RegGAN could be easily combined with these methods to improve their performances. Such as a simple CycleGAN in our mode surpasses latest NICEGAN even though using less network parameters. Based on our results, RegGAN outperformed both Pix2Pix on aligned data and Cycle-consistency on misaligned or unpaired data. RegGAN is insensitive to noises which makes it a better choice for a wide range of scenarios, especially for medical image-to-image translation tasks in which well pixel-wise aligned data are not available. Code and data used in this study can be found at https://github.com/Kid-Liet/Reg-GAN.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Generative adversarial networks (GANs)[1] is a framework that simultaneously trains a generator $G$ and a discriminator $D$ through an adversarial process. The generator is used to translate the distribu
|
| 22 |
+
|
| 23 |
+
tion of source domain images $X$ to the distribution of target domain images $Y$ . The discriminator is used to determine if the target domain images are likely from the generator or from the real data.
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \mathcal { L } _ { A d v } \left( G , D \right) = \mathbb { E } _ { y } \left[ l o g \left( D \left( y \right) \right) \right] + \mathbb { E } _ { x } \left[ l o g \left( 1 - D \left( G \left( x \right) \right) \right) \right]
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
Supervised Pix2Pix[2] and unsupervised Cycle-consistency[3] are the two commonly used modes in GANs. Pix2Pix updates the generator $G : X Y$ ) by minimizing pixel-level $L 1$ loss between the source image $x$ and the target image $y$ . Therefore, it requires well aligned paired images, where each pixel has a corresponding label.
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\operatorname* { m i n } _ { G } { \mathcal { L } } _ { L 1 } \left( G \right) = \mathbb { E } _ { x , y } \left[ \left\| y - G \left( x \right) \right\| _ { 1 } \right]
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Well aligned paired images, however, are not always available in real-world scenarios. To address the challenges caused by misaligned images, Cycle-consistency was developed which was based on the assumption that the generator $G$ from the source domain $X$ to the target domain $Y$ $( G : X \to Y )$ was the reverse of the generator $F$ from $Y$ to $X$ $F : Y X$ ). Compared to the Pix2Pix mode, the Cycle-consistency mode works better on misaligned or unpaired images.
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\underset { G } { \mathop { \operatorname* { m i n } } } \underset { F } { \operatorname* { m i n } } \mathcal { L } _ { C y c } \left( G , F \right) = \mathbb { E } _ { x } \left[ \| F \left( G \left( x \right) \right) - x \| _ { 1 } \right] + \mathbb { E } _ { y } \left[ \| G \left( F \left( y \right) \right) - y \| _ { 1 } \right]
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
The Cycle-consistency mode, however, has its limitations. In the field of medical image-to-image translation, it requires not only the style translation between image domains, but also the translation between specific pair of images. The optimal solution should be unique. For example, the translated images should maintain the anatomical features of the original images as much as possible. It is known that the Cycle-consistency mode may produce multiple solutions[4, 5], meaning that the training process may be relatively perturbing and the results may not be accurate. The pix2pix mode is not ideal either. Even though it has a unique solution, it is difficult to satisfy the requirement asking for well aligned paired images. With misaligned images, the errors are propagated through the Pix2Pix mode which may result in unreasonable displacements on the final translated images.
|
| 42 |
+
|
| 43 |
+
As of today, there is no image-to-image translation mode that can outperform both the Pix2Pix mode on aligned data and the Cycle-consistency mode on misaligned or unpaired data. Inspired by[6–10], we consider the misaligned target images as noisy labels, which means that the existing problem is regarded as supervised learning with noisy labels. So we introduce a new image-to-image translation mode called RegGAN. Figure 1 provides a comparison of the three modes: Pix2Pix, Cycle-consistency and RegGAN. To facilitate reading, we summarize our contributions as follows.
|
| 44 |
+
|
| 45 |
+
• We demonstrate the feasibility of RegGAN from the theoretical perspective of "losscorrection". Specifically, we train the generator using an additional registration network to fit the misaligned noise distribution adaptively, with the goal to search for the common optimal solution for both image-to-image translation and registration tasks. RegGAN eliminates the requirement for well aligned paired images and searches unique solution in training process. Based on our results, RegGAN outperformed both Pix2Pix on aligned data and Cycle-consistencyaon misaligned or unpaired data. ˘ RegGAN can be integrated into other methods without changing the original network architecture. Compared to Cycle-consistency with two generators and discriminators, RegGAN can provide better performance using less network parameters.
|
| 46 |
+
|
| 47 |
+
# 2 Related Work
|
| 48 |
+
|
| 49 |
+
Image-to-image Translation: Generative adversarial networks (GANs) have shown great potential in the field of image-to-image translation[11–16]. It has been successfully implemented in medical image analysis like segmentation[17], registration[18, 19] and dose calculation[20]. The existing modes, however, have their limitations. Specifically, the Pix2Pix mode[2] requires well aligned paired images which may not always be available. The Cycle-consistency mode can achieve unsupervised image-to-image translation. With a Cycle-consistency loss, it can be used for misaligned images. Based on Cycle-consistency, many methods[3, 21–30] have been developed including CycleGAN[3] and its variants such as MUNIT[31] and UNIT[32] in which both image content and style information are used to decouple and reconstruct the image-to-image translation task; U-gat-it[33] with a self-attention mechanism added; and NICEGAN[34] proposed to reuse the discriminator for encoding. The main limitation of Cycle-consistency is that it may produce multiple solutions and therefore is sensitive to perturbation, making it difficult to meet the high accuracy requirements of medical image-to-image translation tasks.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 1: Comparison among the modes of Pix2Pix, CycleGAN and RegGAN.
|
| 53 |
+
|
| 54 |
+
Learning From Noisy Labels: Neural network anti-noise training has made great progress. Current research are mainly focused on: estimating the noise transition matrix[7, 35–40], designing a robust loss function[41–44], correcting the noise label[45–50], sampling importance weighting[51– 55] and meta-learning[56–59]. Our work is in the category of estimating the noise transition matrix. Compared to conventional noise transition estimation, we mitigate the issue and simplify the task by acquiring prior knowledge of noise distribution.
|
| 55 |
+
|
| 56 |
+
Deformable Registration: Traditional image registration methods have gained widespread acceptance, such as Demons[60], B-spline[61] and elastic deformation model[62]. One of the most popular deep learning methods is Voxelmorph[63]. In this study, a CNN model was trained to predict the deformable vector filed (DVF). The time-consuming gradient derivation process was thus skipped to improve the calculation efficiency. Affine registration and a vector momentum-parameterized stationary velocity field (vSVF)[64] was implemented to get better transformation regulation. Fast Symmetric method[65] used symmetric maximum similarity. Deep flash[66] outperformed other models in terms of training and calculation time.
|
| 57 |
+
|
| 58 |
+
Closest to our work, Arar.M et al[67] introduced a multi-modal registration method for natural images based on geometry preserving. But their work focused only on registration and did not demonstrate results of image-to-image translation or discuss the relationship between registration and image-to-image translation. The key insight of our work is that we demonstrated the feasibility of using registration to significantly improve the performance of image-to-image translation because the noise could be eliminated adaptively during the joint training process. What we propose in the paper is a completely new mode for medical image-to-image translation.
|
| 59 |
+
|
| 60 |
+
# 3 Methodology
|
| 61 |
+
|
| 62 |
+
# 3.1 Theoretical Motivation
|
| 63 |
+
|
| 64 |
+
If we consideramisaligned target images as noisy labels, ˘ athe training for image-to-image translation ˘ becomes aasupervised learning process ˘ awith noisy labels. Given a training dataset ˘ $\{ ( x _ { n } , \widetilde { y } _ { n } ) \} _ { n = 1 } ^ { N }$ with $N$ noisy labels in which $x _ { n }$ , $\widetilde { y } _ { n }$ are images from two modalities and assume $y _ { n }$ is the correct label for $x _ { n }$ e, but it is unknown in real-world scenarios. Our goal is to train a generator using the dataset $\{ ( x _ { n } , \widetilde { y } _ { n } ) \} _ { n = 1 } ^ { N }$ with noisy labels and achieve the performance equivalent to trained on clean dataset not wor $\left\{ \left( x _ { n } , y _ { n } \right) \right\} _ { n = 1 } ^ { N }$ as much as possible. Direct optimization based on Equations 4 usually does to bad results because the generator cannot squeeze out the influence of noise.
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\hat { G } = \underset { G } { \arg \operatorname* { m i n } } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } \left( G \left( x _ { n } \right) , \widetilde { y } _ { n } \right)
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
To address the noise issue, we propose a solution based on "loss-correction"[7] shown in Equations 5. Our solution corrects the output of the generator $G ( x _ { n } )$ by modeling a noise transition $\phi$ to match the noise distribution. Previously, Patrini et al[7] proved mathematically that the model trained with the noisy labels could be equivalent to the model trained with the clean labels, if the noise transition $\phi$ matches the noise distribution.
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\hat { G } = \underset { G } { \arg \operatorname* { m i n } } \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } \left( \phi \circ G \left( x _ { n } \right) , \widetilde { y } _ { n } \right)
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
To achieve this, Goldberger et al[36] proposed to view the correct label as a latent random variable and explicitly model the label noise as a part of the network architecture, denoted by $R$ . Then, Equations 5 can be rewritten in the form of log-likelihood, which is used as the loss function for neural network training.
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { l } { \displaystyle \mathcal { L } \left( G , R \right) = - \sum _ { n = 1 } ^ { N } l o g \left( p \left( \widetilde { y } _ { n } | y _ { n } ; R \right) p \left( y _ { n } | x _ { n } ; G \right) \right) } \\ { \displaystyle = - \sum _ { n = 1 } ^ { N } l o g \left( p \left( \widetilde { y } _ { n } | x _ { n } ; G , R \right) \right) } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
# 3.2 RegGAN
|
| 83 |
+
|
| 84 |
+
Compared to existing methods that use expectation-maximum[7, 36], fully connected layers[35], anchor point estimate[37] and Drichlet-distribution[38] to solve Equations 6. In our problem, the type of noise distribution is clearer, it can be expressed as displacement error: $\widetilde { y } = y \circ T$ . Here $T$ is expressed as a random deformation field, which produces random displacement for each pixel. So we adopt a registration network $R$ after the generator $G$ as label noise model to correct the results. The Correction loss is shown Equations 7:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\operatorname* { m i n } _ { G , R } { \mathcal { L } } _ { C o r r } \left( G , R \right) = \mathbb { E } _ { x , \widetilde { y } } \left[ \left. \widetilde { y } - G \left( x \right) \circ R \left( G \left( x \right) , \widetilde { y } \right) \right. _ { 1 } \right]
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where, $R \left( G \left( x \right) , \widetilde { y } \right)$ is the deformation field and $\circ$ represents the resamples operation. The registration network is based on U-Net[68]. A smoothness loss[63] is defined in Equations 8 to evaluate the smoothness of the deformation field and minimize the gradient of the deformation field.
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\operatorname* { m i n } _ { R } \mathcal { L } _ { S m o o t h } \left( R \right) = \mathbb { E } _ { x , \widetilde { y } } \left[ \| \nabla R \left( G \left( x \right) , \widetilde { y } \right) \| ^ { 2 } \right]
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Finally, we add the Aversarial loss between the generator and the discriminator (Equations 1), and the total loss is expressed in Equations 9.
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\operatorname* { m i n } _ { G , R } \operatorname* { m a x } _ { D } \mathcal { L } _ { T o t a l } \left( G , R , D \right) = \mathcal { L } _ { C o r r } + \mathcal { L } _ { S m o o t h } + \mathcal { L } _ { A d v }
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
# 4 Experiments
|
| 103 |
+
|
| 104 |
+
Performance evaluation of RegGAN was conducted through three investigations to 1) demonstrate the feasibility and superiority of the RegGAN mode in various methods, and 2) assess RegGANs sensitivity to noise, and 3) explore the availability of the RegGAN on unpaired data.
|
| 105 |
+
|
| 106 |
+
# 4.1 Dataset
|
| 107 |
+
|
| 108 |
+
The open-access dataset (BraTS 2018[69]) was used to evaluate the proposed RegGAN mode. The training dataset and testing dataset contained 8457 and 979 pairs of T1 and T2 MR images, respectively. BraTS 2018 was selected because the original images were paired and well aligned. We created misaligned images by randomly adding different levels of rotation, translation and rescaling to the original images. And we randomly sample one image from T1 and the other one from T2 when training on unpaired images. The availability of well aligned paired images, misaligned paired images, and unpaired images allow us to evaluate the performances of all three modes (Pix2Pix, Cycle-consistency and RegGAN).
|
| 109 |
+
|
| 110 |
+
# 4.2 Performances in Different Methods
|
| 111 |
+
|
| 112 |
+
The primary motivation of introducing RegGAN was to address challenges caused by misaligned data. Therefore, in this section, misaligned data were used in model training to demonstrate the feasibility and superiority of RegGAN. We selected the most popular CycleGAN[3] and its variants MUNIT[31], UNIT[32], and NICEGAN[34] as the methods for evaluation and compared the following four modes for each method.
|
| 113 |
+
|
| 114 |
+
• C(Cycle-consistency): The most primitive mode of all methods, with Cycle-consistency loss (Equations 3) as the main constraint. Two generators and two discriminators are required in this mode. $\mathbf { C } { \ + } \mathbf { R }$ (Cycle-consistency $^ +$ Registration): The RegGAN mode is combined with the mode C. Registration network $( R )$ and Correction loss (Equations 7) are added to the constraints. NC(Non Cycle-consistency): Only Adversarial loss (Equations 1) is used for updating. Compared to the mode C, Cycle-consistency loss is removed. Only one generator and one discriminator are required in this mode.
|
| 115 |
+
• $\mathbf { N C } { + } \mathbf { R }$ (Non Cycle-consistency $^ +$ Registration): A registration network $( R )$ and Correction loss (Equations 7) are added to the mode NC. It is the proposed RegGAN mode.
|
| 116 |
+
|
| 117 |
+
Table 1: Comparison of CycleGAN, MUNIT, UNIT and NICEGAN using four training modes(C, $\mathrm { C } { \ + } \mathrm { R }$ , NC and $\mathrm { N C } { + } \mathrm { R }$ ).
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Modes Methods</td><td rowspan="3"></td><td rowspan="3">CycleGAN</td><td rowspan="3">MUNIT</td><td rowspan="3">UNIT</td><td rowspan="3">NICEGAN</td></tr><tr><td>Index</td><td></td></tr><tr><td>C</td><td>0.089 0.11</td></tr><tr><td rowspan="2">NMAE↓</td><td>C+R NC</td><td>(-0.012)0.077 0.11</td><td>(-0.022)0.088 0.10</td><td>0.087 (-0.013)0.074 0.098</td><td>0.082 (-0.011)0.071 0.089</td></tr><tr><td>NC+R C</td><td>(-0.038)0.072 23.5</td><td>(-0.021)0.079 20.6</td><td>(-0.027)0.071 24.6</td><td>(-0.019)0.070 25.2</td></tr><tr><td>PSNR ↑</td><td>C+R NC NC+R</td><td>(+0.3)23.8 20.2 (+5.4)25.6</td><td>(+2.1)22.7 21.5 (+2.3)23.8</td><td>(+0.7)25.3 23.7 (+1.8)25.5</td><td>(+0.9)26.1 23.5 (+2.8)26.3</td></tr><tr><td>SSIM↑</td><td>C C+R NC NC+R</td><td>0.83 (+0.02)0.85 0.79 (+0.07)0.86</td><td>0.80 (+0.03) 0.83 0.81 (+0.04)0.85</td><td>0.84 (+0.02)0.86 0.83 (+0.03) 0.86</td><td>0.83 (+0.03)0.86 0.84 (+0.02)0.86</td></tr></table>
|
| 120 |
+
|
| 121 |
+
To evaluate the performance of each method on misaligned data, we randomly added $[ - 5 , + 5 ]$ degrees of angle rotation, $[ - 5 , + 5 ]$ percent of translation, and $[ - 5 , + 5 ]$ percent of rescaling to the original T1 and T2 images on the training dataset.
|
| 122 |
+
|
| 123 |
+
To ensure fair comparison, we used the same training strategy and hyperparameters for all methods and modes (see supplementary materials for details). The Normalized Mean Absolute Error (NMAE), Peak Signal to Noise Ratio (PSNR) and Structural Similarity (SSIM) were used as metrics to evaluate the performances of trained models based on the testing dataset. To avoid false high results of index, we excluded the image background from the calculation. Table 1 summarized the results for all methods and modes under the current investigation.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 2: The errors of different modes in different methods.
|
| 127 |
+
|
| 128 |
+
Based on the results from the Table 1, we can reach several conclusions. First, adding the registration network $\mathbf { \tau } ( + \mathbf { R } )$ significantly improves the performances of the methods. This is true for all methods in both C and NC modes. It clearly demonstrates that $\operatorname { R e g G A N }$ can be incorporated in various methods or combined with different network architectures to improve the performances. Second, the C mode is in general better than the NC mode for most of methods. Adding the registration network $\mathbf { \tau } ( + \mathbf { R } )$ improves the performance of the NC mode more than that of the C mode. In fact, our results show that the $\mathbf { N C } { + } \mathbf { R }$ mode is even better than the $\mathbf { C } { \ + } \mathbf { R }$ mode, implying that "Cycle-consistency loss" may play a negative role when it is combined with RegGAN. Compared with the commonly used C mode with two generators and two discriminators, RegGAN has fewer parameters but provides better performance. The simple CycleGAN method in the $\mathbf { N C } { + } \mathbf { R }$ mode outperforms the current state-of-the-art method NICEGAN in the C mode by 0.01, 0.4, 0.03 for NMAE, PSNR and SSIM, respectively. The $\mathbf { N C } { + } \mathbf { R }$ mode can also be used to improve the performance of NICEGAN. In fact, the performance of NICEGAN in the $\mathbf { N C } { + } \mathbf { R }$ mode is the best among all combinations of the 4 methods and 4 modes.
|
| 129 |
+
|
| 130 |
+
Figure 2 shows representative results from various combinations of the 4 methods (CycleGAN, MUNIT, UNIT and NICEGAN) and 4 modes (C, $\mathbf { C } { \ + } \mathbf { R }$ , NC and $\mathbf { N C + R }$ ). For all aspects of the image (from the tumor areas and the details), the combinations that use the registration network $\mathbf { \tau } ( + \mathbf { R } )$ always provide more realistic and accurate results than those that do not use the registration network $\mathbf { \tau } ( + \mathbf { R } )$ .
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 3: Example images at seven different levels of introduced noise.
|
| 134 |
+
|
| 135 |
+
Table 2: Comparison of the NMAE, PSNR and SSIM for CycleGAN(C), Pix2Pix and RegGAN under 7 levels of noise.
|
| 136 |
+
|
| 137 |
+
<table><tr><td colspan="2"></td><td>Noise.0</td><td>Noise.1</td><td>Noise.2</td><td>Noise.3</td><td>Noise.4</td><td></td><td>Noise.5 Noise.NA</td></tr><tr><td rowspan="3">Setting</td><td>Rotate</td><td>0°</td><td>±1°</td><td>±2°</td><td>±3°</td><td>±4°</td><td>±5°</td><td>X</td></tr><tr><td>Translation</td><td>0%</td><td>±2%</td><td>±4%</td><td>±6%</td><td>±8%</td><td>±10%</td><td>X</td></tr><tr><td>Rescaling</td><td>0%</td><td>±2%</td><td>±4%</td><td>±6%</td><td>±8%</td><td>±10%</td><td>X</td></tr><tr><td rowspan="3">CycleGAN(C)</td><td>NMAE↓</td><td>0.084</td><td>0.095</td><td>0.087</td><td>0.094</td><td>0.087</td><td>0.110</td><td>0.091</td></tr><tr><td>PSNR ↑</td><td>23.9</td><td>22.5</td><td>23.7</td><td>23.3</td><td>23.9</td><td>23.7</td><td>23.5</td></tr><tr><td>SSIM↑</td><td>0.83</td><td>0.83</td><td>0.82</td><td>0.81</td><td>0.82</td><td>0.79</td><td>0.83</td></tr><tr><td rowspan="3">Pix2Pix</td><td>NMAE ↓</td><td>0.075</td><td>0.103</td><td>0.139</td><td>0.161</td><td>0.175</td><td>0.181</td><td>0.086</td></tr><tr><td>PSNR ↑</td><td>25.6</td><td>22.3</td><td>18.9</td><td>16.2</td><td>15.3</td><td>15.0</td><td></td></tr><tr><td>SSIM ↑</td><td>0.85</td><td>0.82</td><td>0.78</td><td>0.76</td><td>0.74</td><td>0.74</td><td>21.1</td></tr><tr><td rowspan="3">RegGAN</td><td>NMAE ↓</td><td>0.071</td><td>0.073</td><td>0.071</td><td>0.072</td><td>0.072</td><td>0.072</td><td>0.82 0.071</td></tr><tr><td>PSNR ↑</td><td>26</td><td>25.6</td><td>25.9</td><td>25.7</td><td>25.4</td><td>25.2</td><td></td></tr><tr><td>SSIM ↑</td><td>0.86</td><td>0.86</td><td>0.86</td><td>0.86</td><td>0.86</td><td>0.85</td><td>25.9 0.86</td></tr></table>
|
| 138 |
+
|
| 139 |
+
# 4.3 Performances in Different Noise Levels
|
| 140 |
+
|
| 141 |
+
To evaluate the sensitivity of $\operatorname { R e g G A N }$ to noise, we selected a simple network architecture.(CycleGAN) with the intention to minimize interference from other factors. The same network architecture was used for all three modes: CycleGAN(C), Pix2Pix and RegGAN. Seven levels of noise were used in the evaluation. Table 2 lists the specific noise setting and range for each noise level. Noise.0 means the original dataset with no added noise. Noise.5 is the highest level of noise. At Noise.5, the data are likely from different patients. In addition, we also made non-affine noise(Noise.NA) settings. The non-affine noise is generated by spatially transforming T1 and T2 using elastic transformations on control points followed by Gaussian smoothing. Figure 3 shows example images at different levels of introduced noise.
|
| 142 |
+
|
| 143 |
+
Table 2 lists the quantitative evaluation metrics from 3 modes at 7 levels of noise. It is clear that RegGAN outperforms CycleGAN(C) under all noise levels. Figure 4(a) shows the test results from each epoch during the training process for both RegGAN and CycleGAN(C). Curves of different colors corresponds to different levels of noise. We notice that CycleGAN(C) is not very stable during the training process. The test results fluctuate significantly and cannot converge well. This may be caused by the fact that the solution of CycleGAN (C) is not unique. As a comparison, RegGAN is quite stable. Although the results from different levels of noise may vary at the beginning of training, all curves converge to a similar result after multiple epoches of training, indicating that RegGAN is more robust to noise compared to CycleGAN (C).
|
| 144 |
+
|
| 145 |
+
Based on Table 2, we notice that the performance of Pix2Pix deteriorates rapidly as the noise increases. This is as expected because Pix2Pix requires well aligned paired images. Surprisingly, the performances of RegGAN at all noise levels exceed those of Pix2Pix with no noise. Figure 4(b) shows the test results at each epoch of RegGAN and Pix2Pix under Noise.0 (i.e., no noise). Theoretically, the performances of RegGAN and Pix2Pix should be similar on perfectly aligned paired datasets because the registration network of RegGAN does not help and RegGAN is equivalent to
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 4: Quantitative evaluation metrics at different epochs in the training process. (a) Comparison of CycleGAN and $\operatorname { R e g G A N }$ at different levels of noise. (b) Comparison of $\mathrm { P i x 2 P i x }$ and $\mathsf { R e g G A N }$ at Noise.0 (i.e., no noise). (c) RegGAN’s Smoothness loss under different levels of noise.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 5: The misalignment of orginal image pairs and corresponding deformation fields.
|
| 152 |
+
|
| 153 |
+
Pix2Pix. A possible explanation to our results is that in the medical field, the perfectly pixel-wise aligned dataset may not practically exist. Even for BraTS 2018[63] which is recognized as well aligned, it is still possible that there exists slight misalignment. As a result, adding the registration network is always likely to improve the performances in real-world scenarios. To verify our explanation, we plotted the Smoothness loss of RegGAN under different noise levels as shown in Figure 4(c). Large Smoothness loss corresponds to large deformation field displacement. First, we notice that the Smoothness loss under Noise.0 never completely goes to 0, indicating the existence of misalignment and potential usefulness of the registration network. Second, the noise level and Smoothness loss show a step-like positive correlation, which means that RegGAN can adaptively handle the noise distribution, i.e., the registration network can determine the range of deformation according to the noise level. In addition, we can see that even under the setting of non-affine noise, the above conclusion still holds. Because what the registration network corrects is deformation noise.
|
| 154 |
+
|
| 155 |
+
we also show some original image pairs and visualize the corresponding deformation fields output by registration network in Figure 5. Obviously, there is some misalignment between the original T1 and T2 images, and such misalignment is represented by the deformation fields (highlighted by red circle).
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 6: Performance comparison of the three modes (CycleGAN(C), Pix2Pix and RegGAN) on unpaired dataset.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 7: Display of RegGAN’s output on unpaired data. T1 and T2 are unpaired images. The Translated represents the translation result of T1 to T2. Registered represents the registration result of the translated images. D.F represents deformation fields.
|
| 162 |
+
|
| 163 |
+
# 4.4 Performances on Unpaired Dataset
|
| 164 |
+
|
| 165 |
+
So far, our investigations are based on paired datasets. We also want to explore how RegGAN performs using unpaired datasets. In practice, this is not recommended because even different patients may have similarities in their body tissues of adjacent layers. For unpaired datasets, we can conduct rigid registration first in 3D space and then use RegGAN for training. Unpaired data can be treated as having larger scale noise. If the correction capability is strong enough, RegGAN can still work effectively. The comparison of the performances of three modes on the unpaired dataset is shown in Figure 6.
|
| 166 |
+
|
| 167 |
+
With unpaired datasets, Pix2Pix no longer considers the characteristics of the input T1 images and thus has the worst performance. Due to the challenges in fitting the noise, the performance improvement from replacing CycleGAN(C) with RegGAN using unpaired datasets may not be as dramatic as that demonstrated using paired datasets, but RegGAN still has the best performance under unpaired conditions. In Figure 7, we show some examples of how RegGAN corrects noise on unpaired dataset. It can be seen that RegGAN will try its best to eliminate the influnce of noise through registration.
|
| 168 |
+
|
| 169 |
+
Based on our results, it is reasonable to reach the conclusions below. In all circumstances, RegGAN demonstrates better performance compared to Pix2Pix and CycleGAN(C).
|
| 170 |
+
|
| 171 |
+
• For paired and aligned conditions, RegGA $\mathsf { N } \geq \mathsf { P i x 2 P i x } > \mathsf { C y c l e }$ GAN(C).
|
| 172 |
+
|
| 173 |
+
• For paired but misaligned conditions, RegGAN $>$ CycleGAN(C) $>$ Pix2Pix.
|
| 174 |
+
|
| 175 |
+
• For unpaired conditions, RegGAN $>$ CycleGAN(C) $>$ Pix2Pix.
|
| 176 |
+
|
| 177 |
+
# Conclusion
|
| 178 |
+
|
| 179 |
+
In this study, we introduced a new image-to-image translation mode RegGAN to the medical community that can break the dilemma of image-to-image translation task. Using a public BraTS 2018 dataset, we demonstrated the feasibility of RegGAN and its superior performance compared to Pix2Pix and Cycle-consistency. We validated that RegGAN can be incorporated into various existing methods to improve their performances. We also evaluated the sensitivity of RegGAN to noise. Our results confirmed that RegGAN could adapt well to various scenarios from no noise to large-scale noise. The superior performance of RegGAN makes it a better choice over Pix2Pix and Cycle-consistency whether datasets are aligned or not. However, this mode may not work well on natural images. The noise may cannot be considered simply as deformation errors due to the differences in natural images are much greater than those in medical images.
|
| 180 |
+
|
| 181 |
+
# Broader Impact
|
| 182 |
+
|
| 183 |
+
Image-to-image translation has been one of the main focuses in medical image analysis, as it aids in diagnosis and treatment. Previously, physicians had to use different medical imaging equipments if they wanted to get different image sequences of a patient, which was time-consuming and expensive. Pix2Pix mode is expected to solve this problem by its outstanding performance in image-to-image translation. In most of clinical scenarios, however, it is not practical to create such a large well aligned dataset for Pix2Pix mode. Cycle-consistence mode does not need well aligned dataset but can not meet the high-precision requirements of medical image analysis. Our work aims to provide a general image-to-image translation mode, which not only has no strict requirements on the dataset, but also can meet the clinical requirements in terms of image quality. In the future, we will attempt to obtain multi-modal dataset(eg MR-CT) for clinical verification. We foresee positive impacts if the mode is applied to diagnosis in radiology, treatment planning and research.
|
| 184 |
+
|
| 185 |
+
References
|
| 186 |
+
[1] Goodfellow I, Pouget-Abadie J, Mirza M, et al. Generative adversarial nets[C]//Ghahramani Z, Welling M, Cortes C, et al. Advances in Neural Information Processing Systems. Curran Associates, Inc., 2014.
|
| 187 |
+
[2] Isola P, Zhu J Y, Zhou T, et al. Image-to-image translation with conditional adversarial networks[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2017: 1125-1134.
|
| 188 |
+
[3] Zhu J Y, Park T, Isola P, et al. Unpaired image-to-image translation using cycle-consistent adversarial networks[C]//Proceedings of the IEEE international conference on computer vision. 2017: 2223-2232.
|
| 189 |
+
[4] Sim B, Oh G, Lim S, et al. Optimal transport, cyclegan, and penalized ls for unsupervised learning in inverse problems[J]. 2019.
|
| 190 |
+
[5] Moriakov N, Adler J, Teuwen J. Kernel of cyclegan as a principal homogeneous space[C]// International Conference on Learning Representations. 2020.
|
| 191 |
+
[6] Huang L, Zhang C, Zhang H. Self-adaptive training: beyond empirical risk minimization[J]. Advances in Neural Information Processing Systems, 2020, 33.
|
| 192 |
+
[7] Patrini G, Rozza A, Krishna Menon A, et al. Making deep neural networks robust to label noise: A loss correction approach[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2017: 1944-1952.
|
| 193 |
+
[8] Dgani Y, Greenspan H, Goldberger J. Training a neural network based on unreliable human annotation of medical images[C]//2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018). IEEE, 2018: 39-42.
|
| 194 |
+
[9] Yao Y, Liu T, Han B, et al. Dual t: Reducing estimation error for transition matrix in labelnoise learning[C/OL]//Larochelle H, Ranzato M, Hadsell R, et al. Advances in Neural Information Processing Systems: volume 33. Curran Associates, Inc., 2020: 7260-7271. https: //proceedings.neurips.cc/paper/2020/file/512c5cad6c37edb98ae91c8a76c3a291-Paper.pdf.
|
| 195 |
+
[10] Zhang L, Tanno R, Xu M C, et al. Disentangling human error from ground truth in segmentation of medical images[C/OL]//Larochelle H, Ranzato M, Hadsell R, et al. Advances in Neural Information Processing Systems: volume 33. Curran Associates, Inc., 2020: 15750-15762. https://proceedings.neurips.cc/paper/2020/file/ b5d17ed2b502da15aa727af0d51508d6-Paper.pdf.
|
| 196 |
+
[11] wang y, Yu L, van de Weijer J. Deepi2i: Enabling deep hierarchical image-toimage translation by transferring from gans[C/OL]//Larochelle H, Ranzato M, Hadsell R, et al. Advances in Neural Information Processing Systems: volume 33. Curran Associates, Inc., 2020: 11803-11815. https://proceedings.neurips.cc/paper/2020/file/ 88855547570f7ff053fff7c54e5148cc-Paper.pdf.
|
| 197 |
+
[12] Zhang P, Zhang B, Chen D, et al. Cross-domain correspondence learning for exemplar-based image translation[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 5143-5153.
|
| 198 |
+
[13] Kim T, Cha M, Kim H, et al. Learning to discover cross-domain relations with generative adversarial networks[C]//International Conference on Machine Learning. PMLR, 2017: 1857- 1865.
|
| 199 |
+
[14] Cao Y, Wan X. Divgan: Towards diverse paraphrase generation via diversified generative adversarial network[C]//Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings. 2020: 2411-2421.
|
| 200 |
+
[15] Choi Y, Choi M, Kim M, et al. Stargan: Unified generative adversarial networks for multidomain image-to-image translation[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 8789-8797.
|
| 201 |
+
[16] Choi Y, Uh Y, Yoo J, et al. Stargan v2: Diverse image synthesis for multiple domains[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 8188-8197.
|
| 202 |
+
[17] Chen C, Dou Q, Chen H, et al. Synergistic image and feature adaptation: Towards crossmodality domain adaptation for medical image segmentation[C]//Proceedings of the AAAI Conference on Artificial Intelligence: volume 33. 2019: 865-872.
|
| 203 |
+
[18] Fan J, Cao X, Wang Q, et al. Adversarial learning for mono-or multi-modal registration[J]. Medical image analysis, 2019, 58:101545.
|
| 204 |
+
[19] Qin C, Shi B, Liao R, et al. Unsupervised deformable registration for multi-modal images via disentangled representations[C]//International Conference on Information Processing in Medical Imaging. Springer, 2019: 249-261.
|
| 205 |
+
[20] Sahiner B, Pezeshk A, Hadjiiski L M, et al. Deep learning in medical imaging and radiation therapy[J]. Medical physics, 2019, 46(1):e1-e36.
|
| 206 |
+
[21] Hoffman J, Tzeng E, Park T, et al. Cycada: Cycle-consistent adversarial domain adaptation [C]//International conference on machine learning. PMLR, 2018: 1989-1998.
|
| 207 |
+
[22] Li M, Huang H, Ma L, et al. Unsupervised image-to-image translation with stacked cycleconsistent adversarial networks[C]//Proceedings of the European conference on computer vision (ECCV). 2018: 184-199.
|
| 208 |
+
[23] Deng W, Zheng L, Ye Q, et al. Image-image domain adaptation with preserved self-similarity and domain-dissimilarity for person re-identification[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 994-1003.
|
| 209 |
+
[24] Li J, Chen E, Ding Z, et al. Cycle-consistent conditional adversarial transfer networks[C]// Proceedings of the 27th ACM International Conference on Multimedia. 2019: 747-755.
|
| 210 |
+
[25] Schmidt V, Luccioni A, Mukkavilli S K, et al. Visualizing the consequences of climate change using cycle-consistent adversarial networks[J]. arXiv preprint arXiv:1905.03709, 2019.
|
| 211 |
+
[26] Chen Z, Li J, Luo Y, et al. Canzsl: Cycle-consistent adversarial networks for zero-shot learning from natural language[C]//Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. 2020: 874-883.
|
| 212 |
+
[27] Ren C X, Ziemann A, Theiler J, et al. Cycle-consistent adversarial networks for realistic pervasive change generation in remote sensing imagery[C]//2020 IEEE Southwest Symposium on Image Analysis and Interpretation (SSIAI). IEEE, 2020: 42-45.
|
| 213 |
+
[28] Liu J, Ding Y, Xiong J, et al. Multi-cycle-consistent adversarial networks for ct image denoising[C]//2020 IEEE 17th International Symposium on Biomedical Imaging (ISBI). IEEE, 2020: 614-618.
|
| 214 |
+
[29] Zheng C, Pan L, Wu P. Camu: Cycle-consistent adversarial mapping model for user alignment across social networks[J]. IEEE Transactions on Cybernetics, 2021.
|
| 215 |
+
[30] Shah M, Chen X, Rohrbach M, et al. Cycle-consistency for robust visual question answering [C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019: 6649-6658.
|
| 216 |
+
[31] Huang X, Liu M Y, Belongie S, et al. Multimodal unsupervised image-to-image translation [C]//Proceedings of the European conference on computer vision (ECCV). 2018: 172-189.
|
| 217 |
+
[32] Liu M Y, Breuel T, Kautz J. Unsupervised image-to-image translation networks[C/OL]// Guyon I, Luxburg U V, Bengio S, et al. Advances in Neural Information Processing Systems: volume 30. Curran Associates, Inc., 2017. https://proceedings.neurips.cc/paper/2017/ file/dc6a6489640ca02b0d42dabeb8e46bb7-Paper.pdf.
|
| 218 |
+
[33] Kim J, Kim M, Kang H, et al. U-gat-it: Unsupervised generative attentional networks with adaptive layer-instance normalization for image-to-image translation[C/OL]// International Conference on Learning Representations. 2020. https://openreview.net/forum? id=BJlZ5ySKPH.
|
| 219 |
+
[34] Chen R, Huang W, Huang B, et al. Reusing discriminators for encoding: Towards unsupervised image-to-image translation[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 8168-8177.
|
| 220 |
+
[35] S. Sukhbaatar M P L B R F, J. Bruna. Training convolutional networks with noisy labels[C]// International Conference on Learning Representations. 2015.
|
| 221 |
+
[36] Goldberger J, Ben-Reuven E. Training deep neural-networks using a noise adaptation layer[J]. 2016.
|
| 222 |
+
[37] Xia X, Liu T, Wang N, et al. Are anchor points really indispensable in labelnoise learning?[C/OL]//NeurIPS. 2019: 6835-6846. http://papers.nips.cc/paper/ 8908-are-anchor-points-really-indispensable-in-label-noise-learning.
|
| 223 |
+
[38] Yao J, Wu H, Zhang Y, et al. Safeguarded dynamic label regression for noisy supervision[C]// Proceedings of the AAAI Conference on Artificial Intelligence: volume 33. 2019: 9103-9110.
|
| 224 |
+
[39] Xiao T, Xia T, Yang Y, et al. Learning from massive noisy labeled data for image classification [C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2015: 2691-2699.
|
| 225 |
+
[40] Misra I, Lawrence Zitnick C, Mitchell M, et al. Seeing through the human reporting bias: Visual classifiers from noisy human-centric labels[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2016: 2930-2939.
|
| 226 |
+
[41] Tanno R, Saeedi A, Sankaranarayanan S, et al. Learning from noisy labels by regularized estimation of annotator confusion[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019: 11244-11253.
|
| 227 |
+
[42] Rodrigues F, Pereira F. Deep learning from crowds[C]//Proceedings of the AAAI Conference on Artificial Intelligence: volume 32. 2018.
|
| 228 |
+
[43] Branson S, Van Horn G, Perona P. Lean crowdsourcing: Combining humans and machines in an online system[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2017: 7474-7483.
|
| 229 |
+
[44] Izadinia H, Russell B C, Farhadi A, et al. Deep classifiers from image tags in the wild[C]// Proceedings of the 2015 Workshop on Community-Organized Multimodal Mining: Opportunities for Novel Solutions. 2015: 13-18.
|
| 230 |
+
[45] Jaehwan L, Donggeun Y, Hyo-Eun K. Photometric transformer networks and label adjustment for breast density prediction[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops. 2019: 0-0.
|
| 231 |
+
[46] Veit A, Alldrin N, Chechik G, et al. Learning from noisy large-scale datasets with minimal supervision[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2017: 839-847.
|
| 232 |
+
[47] Tanaka D, Ikami D, Yamasaki T, et al. Joint optimization framework for learning with noisy labels[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018: 5552-5560.
|
| 233 |
+
[48] Zheng S, Wu P, Goswami A, et al. Error-bounded correction of noisy labels[C]//International Conference on Machine Learning. PMLR, 2020: 11447-11457.
|
| 234 |
+
[49] Han J, Luo P, Wang X. Deep self-learning from noisy labels[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. 2019: 5138-5147.
|
| 235 |
+
[50] Durand T, Mehrasa N, Mori G. Learning a deep convnet for multi-label classification with partial labels[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019: 647-657.
|
| 236 |
+
[51] Wu X, He R, Sun Z, et al. A light cnn for deep face representation with noisy labels[J]. IEEE Transactions on Information Forensics and Security, 2018, 13(11):2884-2896.
|
| 237 |
+
[52] Huang J, Qu L, Jia R, et al. O2u-net: A simple noisy label detection approach for deep neural networks[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. 2019: 3326-3334.
|
| 238 |
+
[53] Li J, Socher R, Hoi S C. Dividemix: Learning with noisy labels as semi-supervised learning [C/OL]//International Conference on Learning Representations. 2020. https://openreview.net/ forum?id=HJgExaVtwr.
|
| 239 |
+
[54] Yan Y, Xu Z, Tsang I, et al. Robust semi-supervised learning through label aggregation[C]// Proceedings of the AAAI Conference on Artificial Intelligence: volume 30. 2016.
|
| 240 |
+
[55] Jiang J, Ma J, Wang Z, et al. Hyperspectral image classification in the presence of noisy labels [J]. IEEE Transactions on Geoscience and Remote Sensing, 2018, 57(2):851-865.
|
| 241 |
+
[56] Li J, Wong Y, Zhao Q, et al. Learning to learn from noisy labeled data[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019: 5051-5059.
|
| 242 |
+
[57] Li Y, Yang J, Song Y, et al. Learning from noisy labels with distillation[C]//Proceedings of the IEEE International Conference on Computer Vision. 2017: 1910-1918.
|
| 243 |
+
[58] Algan G, Ulusoy I. Meta soft label generation for noisy labels[C]//2020 25th International Conference on Pattern Recognition (ICPR). IEEE, 2021: 7142-7148.
|
| 244 |
+
[59] Garcia L P, de Carvalho A C, Lorena A C. Noise detection in the meta-learning level[J]. Neurocomputing, 2016, 176:14-25.
|
| 245 |
+
[60] Thirion J P. Image matching as a diffusion process: an analogy with maxwell’s demons[J]. Medical image analysis, 1998, 2:243260.
|
| 246 |
+
[61] Rueckert D, Sonoda L I, Hayes C, et al. Nonrigid registration using free-form deformations: application to breast mr images[J]. IEEE transactions on medical imaging, 1999, 18(8):712- 721.
|
| 247 |
+
[62] Shen D, Davatzikos C. Hammer: hierarchical attribute matching mechanism for elastic registration[J]. IEEE transactions on medical imaging, 2002, 21(11):1421-1439.
|
| 248 |
+
[63] Balakrishnan G, Zhao A, Sabuncu M R, et al. Voxelmorph: a learning framework for deformable medical image registration[J]. IEEE transactions on medical imaging, 2019, 38(8): 1788-1800.
|
| 249 |
+
[64] Shen Z, Han X, Xu Z, et al. Networks for joint affine and non-parametric image registration [C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2019: 4224-4233.
|
| 250 |
+
[65] Mok T C, Chung A. Fast symmetric diffeomorphic image registration with convolutional neural networks[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 4644-4653.
|
| 251 |
+
[66] Wang J, Zhang M. Deepflash: An efficient network for learning-based medical image registration[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 4444-4452.
|
| 252 |
+
[67] Arar M, Ginger Y, Danon D, et al. Unsupervised multi-modal image registration via geometry preserving image-to-image translation[C]//Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2020: 13410-13419.
|
| 253 |
+
[68] Ronneberger O, Fischer P, Brox T. U-net: Convolutional networks for biomedical image segmentation[C]//International Conference on Medical image computing and computer-assisted intervention. Springer, 2015: 234-241.
|
| 254 |
+
[69] Menze B H, Jakab A, Bauer S, et al. The multimodal brain tumor image segmentation benchmark (brats)[J]. IEEE transactions on medical imaging, 2014, 34(10):1993-2024.
|
md/train/CBmJwzneppz/CBmJwzneppz.md
ADDED
|
@@ -0,0 +1,634 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OPTIMISM IN REINFORCEMENT LEARNING WITH GENERALIZED LINEAR FUNCTION APPROXIMATION
|
| 2 |
+
|
| 3 |
+
Yining Wang
|
| 4 |
+
University of Florida
|
| 5 |
+
yining.wang@warrington.ufl.edu
|
| 6 |
+
|
| 7 |
+
Ruosong Wang Carnegie Mellon University ruosongw@andrew.cmu.edu
|
| 8 |
+
|
| 9 |
+
Simon S. Du University of Washington ssdu@cs.washington.edu
|
| 10 |
+
|
| 11 |
+
Akshay Krishnamurthy Microsoft Research akshaykr@microsoft.com
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We design a new provably efficient algorithm for episodic reinforcement learning with generalized linear function approximation. We analyze the algorithm under a new expressivity assumption that we call “optimistic closure,” which is strictly weaker than assumptions from prior analyses for the linear setting. With optimistic closure, we prove that our algorithm enjoys a regret bound of $\widetilde { \mathcal { O } } \left( H \sqrt { d ^ { 3 } T } \right)$ where $H$ is the horizon, $d$ is the dimensionality of the state-action features and $T$ is the number of episodes. This is the first statistically and computationally efficient algorithm for reinforcement learning with generalized linear functions.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
We study episodic reinforcement learning problems with infinitely large state spaces, where the agent must use function approximation to generalize across states while simultaneously engaging in strategic exploration. Such problems form the core of modern empirical/deep-RL, but relatively little work focuses on exploration, and even fewer algorithms enjoy strong sample efficiency guarantees.
|
| 20 |
+
|
| 21 |
+
On the theoretical side, classical sample efficiency results from the early 00s focus on “tabular” environments with small finite state spaces (Kearns & Singh, 2002; Brafman & Tennenholtz, 2002; Strehl et al., 2006), but as these methods scale with the number of states, they do not address problems with infinite or large state spaces. While this classical work has inspired practically effective approaches for large state spaces (Bellemare et al., 2016; Osband et al., 2016; Tang et al., 2017), these methods do not enjoy sample efficiency guarantees. More recent theoretical progress has produced provably sample efficient algorithms for complex environments where function approximation is required, but these algorithms are relatively impractical (Krishnamurthy et al., 2016; Jiang et al., 2017). In particular, these methods are computationally inefficient or rely crucially on strong dynamics assumptions (Du et al., 2019b).
|
| 22 |
+
|
| 23 |
+
In this paper, with an eye toward practicality, we study a simple variation of Q-learning, where we approximate the optimal Q-function with a generalized linear model. The algorithm is appealingly simple: collect a trajectory by following the greedy policy corresponding to the current model, perform a dynamic programming back-up to update the model, and repeat. The key difference over traditional Q-learning-like algorithms is in the dynamic programming step. Here we ensure that the updated model is optimistic in the sense that it always overestimates the optimal Q-function. This optimism is essential for our guarantees.
|
| 24 |
+
|
| 25 |
+
Optimism in the face of uncertainty is a well-understood and powerful algorithmic principle in shorthorizon (e.g,. bandit) problems, as well as in tabular reinforcement learning (Azar et al., 2017; Dann et al., 2017; Jin et al., 2018). With linear function approximation, Yang & Wang (2019) and Jin et al. (2019) show that the optimism principle can also yield provably sample-efficient algorithms, when the environment dynamics satisfy certain linearity properties. Their assumptions are always satisfied in tabular problems, but are somewhat unnatural in settings where function approximation is required. Moreover as these assumptions are directly on the dynamics, it is unclear how their analysis can accommodate other forms of function approximation, including generalized linear models.
|
| 26 |
+
|
| 27 |
+
In the present paper, we replace explicit dynamics assumptions with expressivity assumptions on the function approximator, and, by analyzing a similar algorithm to Jin et al. (2019), we show that the optimism principle succeeds under these strictly weaker assumptions.1 More importantly, the relaxed assumption facilitates moving beyond linear models, and we demonstrate this by providing the first practical and provably efficient RL algorithm with generalized linear function approximation.
|
| 28 |
+
|
| 29 |
+
The paper is organized as follows: In Section 2 we formalize our setting, introduce the optimistic closure assumption, and discuss related assumptions in the literature. In Section 3 we study optimistic closure in detail and verify that it is strictly weaker than the recently proposed Linear MDP assumption. Our main algorithm and results are presented in Section 4, with the main proof in Section A. We close with some final remarks and future directions in Section 5.
|
| 30 |
+
|
| 31 |
+
# 2 PRELIMINARIES
|
| 32 |
+
|
| 33 |
+
We consider episodic reinforcement learning in a finite-horizon markov decision process (MDP) with possibly infinitely large state space $s$ , finite action space $\mathcal { A }$ , initial distribution $\mu \in \Delta ( { \cal S } )$ , transition operator $P : \mathcal { S } \times \mathcal { A } \ \ \Delta ( \mathcal { S } )$ , reward function $R \ : \ S \times A \ \to \ \Delta ( [ 0 , 1 ] )$ and horizon $H$ . The agent interacts with the MDP in episodes and, in each episode, a trajectory $\left( s _ { 1 } , a _ { 1 } , r _ { 1 } , s _ { 2 } , a _ { 2 } , r _ { 2 } , \dots , s _ { H } , a _ { H } , r _ { H } \right)$ is generated where $s _ { 1 } \sim \mu$ , for $h > 1$ we have $s _ { h } \stackrel { \cdot } { \sim } P ( \cdot \stackrel { \cdot } { | }$ $s _ { h - 1 } , a _ { h - 1 } )$ $r _ { h } \sim R ( s _ { h } , a _ { h } )$ , and actions almost surely. $a _ { 1 : H }$ are chosen by the agent. For normalization, we $\textstyle \sum _ { h = 1 } ^ { H } r _ { h } \in [ 0 , 1 ]$
|
| 34 |
+
|
| 35 |
+
A (deterministic, nonstationary) policy $\pi = ( \pi _ { 1 } , \cdots , \pi _ { H } )$ consists of $H$ mappings $\pi _ { h } : S A$ , where $\pi _ { h } ( s _ { h } )$ denotes the action to be taken at time point $h$ if at state $s _ { h } \in S$ The value function for a policy $\pi$ is a collection of functions $( V _ { 1 } ^ { \pi } , \ldots , V _ { H } ^ { \pi } )$ where $V _ { h } ^ { \pi } : { \cal S } \mathbb { R }$ is the expected future reward the policy collects if it starts in a particular state at time point $h$ . Formally,
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
V _ { h } ^ { \pi } ( s ) \triangleq \mathbb { E } \left[ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } \mid s _ { h } = s , a _ { h : H } \sim \pi \right] .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
The value for a policy $\pi$ is simply $V ^ { \pi } \triangleq \mathbb { E } _ { s _ { 1 } \sim \mu } \left[ V _ { 1 } ^ { \pi } ( s _ { 1 } ) \right]$ , and the optimal value is $V ^ { \star } \triangleq \operatorname* { m a x } _ { \pi } V ^ { \pi }$ , where the maximization is over all nonstationary policies. The typical goal is to find an approximately optimal policy, and in this paper, we measure performance by the regret accumulated over $T$ episodes,
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathrm { R e g } ( T ) \triangleq T V ^ { \star } - \mathbb { E } \left[ \sum _ { t = 1 } ^ { T } \sum _ { h = 1 } ^ { H } r _ { h , t } \right] .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Here ${ r } _ { h , t }$ is the reward collected by the agent at time point $h$ in the $t ^ { \mathrm { { t h } } }$ episode. We seek algorithms with regret that is sublinear in $T$ , which demonstrates the agent’s ability to act near-optimally over the long run.
|
| 48 |
+
|
| 49 |
+
# 2.1 Q-VALUES AND FUNCTION APPROXIMATION
|
| 50 |
+
|
| 51 |
+
For any policy $\pi$ , the state-action value function, or the $Q$ -function is a sequence of mappings $Q ^ { \pi } = ( Q _ { 1 } ^ { \pi } , \ldots , Q _ { H } ^ { \pi } )$ where $Q _ { h } ^ { \pi } : S \times \mathcal { A } \mathbb { R }$ is defined as
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
Q _ { h } ^ { \pi } ( s , a ) \triangleq \mathbb { E } \left[ \sum _ { h ^ { \prime } = h } ^ { H } r _ { h ^ { \prime } } \ | \ s _ { h } = s , a _ { h } = a , a _ { h + 1 : H } \sim \pi \right] .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
The optimal $Q$ -function is $Q _ { h } ^ { \star } \triangleq Q _ { h } ^ { \pi ^ { \star } }$ where $\pi ^ { \star } \triangleq \operatorname { a r g m a x } _ { \pi } V ^ { \pi }$ is the optimal policy.
|
| 58 |
+
|
| 59 |
+
In the value-based function approximation setting, we use a function class $\mathcal { G }$ to model $Q ^ { \star }$ . In this paper, we always take $\mathcal { G }$ to be a class of generalized linear models (GLMs), defined as follows: Let $d \in \mathbb { N }$ be a dimensionality parameter and let $\mathbb { B } _ { d } \triangleq \left\{ x \in \mathbb { R } ^ { d } : \| x \| _ { 2 } \leq 1 \right\}$ be the $\ell _ { 2 }$ ball in $\mathbb { R } ^ { d }$ .
|
| 60 |
+
|
| 61 |
+
Definition 1. For a known feature map $\phi : \mathcal { S } \times \mathcal { A } \mathbb { B } _ { d }$ and $a$ known link function $f : [ - 1 , 1 ] \mapsto$ $[ - 1 , 1 ]$ the class of generalized linear models is $\mathcal { G } \triangleq \{ ( s , a ) \mapsto f ( \langle \phi ( s , a ) , \theta \rangle ) : \theta \in \mathbb { B } _ { d } \}$ .
|
| 62 |
+
|
| 63 |
+
As is standard in the literature (Filippi et al., 2010; Li et al., 2017), we assume the link function satisfies certain regularity conditions.
|
| 64 |
+
|
| 65 |
+
Assumption 1. $f ( \cdot )$ is either monotonically increasing or decreasing. Furthermore, there exist absolute constants $0 < \kappa < K < \infty$ and $M < \infty$ such that $\kappa \leq | f ^ { \prime } ( z ) | \leq K$ and $| f ^ { \prime \prime } ( z ) | \le M$ for all $| z | \le 1$ .
|
| 66 |
+
|
| 67 |
+
For intuition, two example link functions are the identity map $f ( z ) = z$ and the logistic map $f ( z ) =$ $1 / ( 1 + e ^ { - z } )$ with bounded $z$ . It is easy to verify that both of these maps satisfy Assumption 1.
|
| 68 |
+
|
| 69 |
+
# 2.2 EXPRESSIVITY ASSUMPTIONS: REALIZABILITY AND OPTIMISTIC CLOSURE
|
| 70 |
+
|
| 71 |
+
To obtain sample complexity guarantees that scale polynomially with problem parameters in the function approximation setting, it is necessary to posit expressivity assumptions on the function class $\mathcal { G }$ (Krishnamurthy et al., 2016; Du et al., 2019a). The weakest such condition is realizability, which posits that the optimal $Q$ function is in $\mathcal { G }$ , or at least well-approximated by $\mathcal { G }$ . Realizability alone suffices for provably efficient algorithms in the “contextual bandits” setting where $H = 1$ (Li et al., 2017; Filippi et al., 2010; Abbasi-Yadkori et al., 2011), but it does not seem to be sufficient when $H > 1$ . Indeed in these settings it is common to make stronger expressivity assumptions (Chen & Jiang, 2019; Yang & Wang, 2019; Jin et al., 2019).
|
| 72 |
+
|
| 73 |
+
Following these works, our main assumption is a closure property of the Bellman update operator $\mathcal { T } _ { h }$ . This operator has type $\mathcal { T } _ { h } : ( S \times \mathcal { A } \to \mathbb { R } ) \to ( S \times \mathcal { A } \to \mathbb { R } )$ and is defined for all $s \in \mathcal S , a \in \mathcal A$ as
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { c l } { \mathcal { T } _ { h } ( Q ) ( s , a ) \triangleq \mathbb { E } [ r _ { h } + V _ { Q } ( s _ { h + 1 } ) { | \begin{array} { l } { s _ { h } = s , a _ { h } = a } \end{array} } , } \\ { V _ { Q } ( s ) \triangleq \displaystyle \operatorname* { m a x } _ { a \in \mathcal { A } } Q ( s , a ) . } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
The Bellman update operator for time point $H$ is simply $\begin{array} { r } { { \mathcal { T } } _ { H } ( Q ) ( s , a ) \triangleq { \mathbb { E } } [ r _ { H } \mid s _ { H } = s , a _ { H } = a ] . } \end{array}$ , which is degenerate. To state the assumption, we must first define the enlarged function class $\mathcal { G } _ { \mathrm { u p } }$ . For a $d \times d$ matrix $A$ , $A \succeq 0$ denotes that $A$ is positive semi-definite. For a positive semi-definite matrix $A$ , $\| A \| _ { \mathrm { o p } }$ is the matrix operator norm, which is just the largest eigenvalue, and $\| x \| _ { A } \triangleq$ $\sqrt { x ^ { \top } A x }$ is the matrix Mahalanobis seminorm. For a fixed constant $\Gamma \in \mathbb { R } _ { + }$ that we will set to be polynomial in $d$ and $\log ( T )$ , define
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { \mathcal { G } _ { \mathtt { u p } } \triangleq \bigg \{ ( s , a ) \mapsto 1 \wedge f ( \langle \phi ( s , a ) , \theta \rangle ) + \gamma \| \phi ( s , a ) \| _ { A } : \theta \in \mathbb { B } _ { d } , A \succeq 0 , \| A \| _ { \mathrm { o p } } \le 1 \bigg \} , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Here we use $a \wedge b \triangleq \operatorname* { m i n } \{ a , b \}$ . The class $\mathcal { G } _ { \mathrm { u p } }$ contains $\mathcal { G }$ in addition to all possible upper confidence bounds that arise from solving least squares regression problems using the class $\mathcal { G }$ . We now state our main expressivity assumption, which we call optimistic closure.
|
| 86 |
+
|
| 87 |
+
Assumption 2 (Optimistic closure). For any $1 \leq h < H$ and $g \in \mathcal G _ { u p }$ , we have $\mathcal { T } _ { h } ( g ) \in \mathcal { G }$
|
| 88 |
+
|
| 89 |
+
In words, when we perform a Bellman backup on any upper confidence bound function for time point $h + 1$ , we obtain a generalized linear function at time $h$ . While this property seems quite strong, we note that a similar notion is mentioned informally in Jin et al. (2019) and that related closure-type assumptions are common in the literature (see Section 2.3 for detailed discussion). More importantly, we will prove in Section 3 that optimistic closure is actually strictly weaker than previous assumptions used in our RL setting where exploration is required. Before turning to these discussions, we mention two basic properties of optimistic closure.
|
| 90 |
+
|
| 91 |
+
Fact 1 (Optimistic closure and realizability). Optimistic closure implies that $Q ^ { \star } \in { \mathcal { G } }$ (realizability).
|
| 92 |
+
|
| 93 |
+
Proof. We will solve for $Q ^ { \star }$ via dynamic programming, starting from time point $H$ . In this case, the Bellman update operator is degenerate, and we start by observing that $\mathcal { T } _ { H } ( g ) \equiv Q _ { H } ^ { \star }$ for all $g$ . Consequently we have $Q _ { H } ^ { \star } \in { \mathcal { G } }$ . Next, inductively we assume that we have $Q _ { h + 1 } ^ { \star } \in \mathcal { G }$ , which implies that $Q _ { h + 1 } ^ { \star } \in \mathcal { G } _ { \mathrm { u p } }$ as we may take the same parameter $\theta$ and set $A \equiv 0$ . Then, by the standard Bellman fixed-point characterization, we know that $Q _ { h } ^ { \star } = \tau _ { h } ( Q _ { h + 1 } ^ { \star } )$ , at which point Assumption 2 yields that $Q _ { h } ^ { \star } \in \mathcal { G }$ . □
|
| 94 |
+
|
| 95 |
+
Fact 2 (Optimistic closure in tabular settings). If $s$ is finite and $\phi ( s , a ) = e _ { s , a }$ is the standard-basis feature map, then under Assumption 1 we have optimistic closure.
|
| 96 |
+
|
| 97 |
+
Proof. We simply verify that $\mathcal { G }$ contains all mappings from $( s , a ) \mapsto [ 0 , 1 ]$ , at which point the result is immediate. To see why, observe that via Assumption 1 we know that $f$ is invertible (it is monotonic with derivative bounded from above and below). Then, note that any function $( s , a ) \mapsto$ $[ 0 , 1 ]$ can be written as a vector $v \in [ 0 , 1 ] ^ { | S | \times | \mathcal { A } | }$ . For such a vector $v$ , if we define $\theta _ { s , a } \triangleq f ^ { - 1 } ( v _ { s , a } )$ we have that $f ( \langle e _ { s , a } , \theta \rangle ) = v _ { s , a }$ . Hence $\mathcal { G }$ contains all functions, so we trivially have optimistic closure. □
|
| 98 |
+
|
| 99 |
+
# 2.3 RELATED WORK
|
| 100 |
+
|
| 101 |
+
The majority of the theoretical results for reinforcement learning focus on the tabular setting where the state space is finite and sample complexities scaling polynomially with $| S |$ are tolerable (Kearns & Singh, 2002; Brafman & Tennenholtz, 2002; Strehl et al., 2006). Indeed, by now there are a number of algorithms that achieve strong guarantees in this setting (Dann et al., 2017; Azar et al., 2017; Jin et al., 2018; Simchowitz & Jamieson, 2019). Via Fact 2, our results apply to this setting, and indeed our algorithm can be viewed as a generalization of the canonical tabular algorithm (Azar et al., 2017; Dann et al., 2017; Simchowitz & Jamieson, 2019) to the function approximation setting.2
|
| 102 |
+
|
| 103 |
+
Turning to the function approximation setting, several other results concern function approximation in settings where exploration is not an issue, including the infinite-data regime (Munos, 2003; Farahmand et al., 2010) and the “batch RL” setting where the agent does not control the data-collection process (Munos & Szepesvari, 2008; Antos et al., 2008; Chen & Jiang, 2019). While the details ´ differ, all of these results require that the function class satisfy some form of (approximate) closure with respect to the Bellman operator. As an example, one assumption is that $\mathcal { T } ( g ) \in \mathcal { G }$ for all $g \in { \mathcal { G } }$ , with an appropriately defined approximate variant (Chen & Jiang, 2019). These results therefore provide motivation for our optimistic closure assumption. While optimistic closure is stronger than the assumptions in these works, we emphasize that we are also addressing exploration, so our setting is also significantly more challenging.
|
| 104 |
+
|
| 105 |
+
A recent line of work studies function approximation in settings where the agent must explore the environment (Krishnamurthy et al., 2016; Jiang et al., 2017; Du et al., 2019b). The algorithms developed here can accommodate function classes beyond generalized linear models, but they are still relatively impractical and the more practical ones require strong dynamics assumptions (Du et al., 2019b). In contrast, our algorithm is straightforward to implement and does not require any explicit dynamics assumption. As such, we view these results as complementary to our own.
|
| 106 |
+
|
| 107 |
+
Most closely related to our work are the recent results of Yang & Wang (2019) and Jin et al. (2019). Both papers study MDPs with certain linear dynamics assumptions (what they call the Linear MDP assumption) and use linear function approximation to obtain provably efficient algorithms. Jin et al. (2019) hint at optimistic closure as a weakening of their Linear MDP assumption and remark that their guarantees continues to hold under this weaker assumption. One of our contributions is to formalize this remark. Indeed, our algorithm is almost identical to theirs. However we emphasize that optimistic closure is strictly weaker than their Linear MDP assumption, which in turn is strictly weaker than the assumption of Yang & Wang (2019). Further, and perhaps more importantly, by avoiding explicit dynamics assumptions, we enable approximation with GLMs, which are incompatible with the Linear MDP structure. Hence, the present paper can be seen as a significant generalization of these recent results.
|
| 108 |
+
|
| 109 |
+
Since the initial version of this paper appeared, several other works have studied linear function approximation in reinforcement learning. A number of papers (Cai et al., 2019; Ayoub et al., 2020; Modi et al., 2020; Zhou et al., 2020) study an incomparable class of dynamics models that permit linear function approximation. Others study weakenings of the Linear MDP assumptions. In particular, Agarwal et al. (2020) only require small transfer error for linear regression, which formalizes out-of-distribution generalization and is always zero in Linear MDPs. Zanette et al. (2020a) only require that the Bellman operator is closed with respect to linear functions, which is considerably weaker than our optimistic closure assumption. However, their algorithm is not computationally efficient. Computational efficiency is addressed in Zanette et al. (2020b) in the reward-free setting with reachability assumptions. As we do not require reachability assumptions, this latter result is incomparable to ours. None of these results considers generalized linear models.
|
| 110 |
+
|
| 111 |
+
# 3 ON OPTIMISTIC CLOSURE
|
| 112 |
+
|
| 113 |
+
For a more detailed comparison to the recent work of Yang & Wang (2019) and Jin et al. (2019), we define the linear MDP model studied in the latter work.
|
| 114 |
+
|
| 115 |
+
Definition 2. An MDP is said to be a linear MDP if there exist known feature map $\psi : \mathcal { S } \times \mathcal { A } \mathbb { R } ^ { d }$ , unknown signed measures $\mu : \mathcal { S } \mathbb { R } ^ { d }$ , and an unknown vector $\eta \in \mathbf { \mathbb { R } } ^ { d }$ such that (1) $P ( s ^ { \prime } | s , a ) =$ $\langle \psi ( s , a ) , \mu ( \acute { s } ^ { \prime } ) \rangle$ holds for all states $s , s ^ { \prime }$ and actions $a$ , and ( $2 ) \mathbb { E } [ r \mid s , a ] = \langle \psi ( s , a ) , \eta \rangle$ .
|
| 116 |
+
|
| 117 |
+
Linear MDPs are studied by Jin et al. (2019), who establish a $\sqrt { T }$ -type regret bound for an optimistic algorithm. This assumption already subsumes that of Yang & Wang (2019), and related assumptions also appear elsewhere in the literature (Bradtke & Barto, 1996; Melo $\&$ Ribeiro, 2007; Zanette et al., 2019). In this section, we show that optimistic closure (Assumption 2) is strictly weaker than assuming the environment is a linear MDP.
|
| 118 |
+
|
| 119 |
+
Proposition 1. If an MDP is linear then Assumption 2 holds with ${ \mathcal { G } } = \{ ( s , a ) \mapsto \langle w , \psi ( s , a ) \rangle$ : $w \in \mathbb { B } _ { d } \}$ .
|
| 120 |
+
|
| 121 |
+
Proof. The result is implicit in Jin et al. (2019), and we include the proof for completeness. For any function $g$ , observe that owing to the linear MDP property
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\mathcal { T } _ { h } ( g ) ( s , a ) = \mathbb { E } \left[ r + \operatorname* { m a x } _ { a ^ { \prime } } g ( s ^ { \prime } , a ^ { \prime } ) \mid s , a \right] = \langle \psi ( s , a ) , \eta \rangle + \int \langle \psi ( s , a ) , \mu ( s ^ { \prime } ) \rangle \operatorname* { m a x } _ { a ^ { \prime } } g ( s ^ { \prime } , a ^ { \prime } ) \mathrm { d } s ^ { \prime } ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
which is clearly a linear function in $\psi ( s , a )$ . Hence for any function $g$ , which trivially includes the optimistic functions, we have $\mathcal { T } _ { h } ( g ) \in \mathcal { G }$ . □
|
| 128 |
+
|
| 129 |
+
Thus the linear MDP assumption is stronger than Assumption 2. Next, we show that it is strictly stronger.
|
| 130 |
+
|
| 131 |
+
Proposition 2. There exists an MDP with $H = 2$ , $d = 2$ , $| { \mathcal { A } } | = 2$ and $| S | = \infty$ such that Assumption 2 is satisfied, but the MDP is not a linear MDP.
|
| 132 |
+
|
| 133 |
+
Thus we have that optimistic closure is strictly weaker than the linear MDP assumption from Jin et al. (2019). Thus, our results strictly generalize theirs.
|
| 134 |
+
|
| 135 |
+
Proof. Fix the link function to be $f ( z ) ~ = ~ z$ . We first construct the MDP. Set the action space $\mathcal { A } \stackrel { \cdot } { = } \{ a _ { 1 } , a _ { 2 } \}$ . We use $e _ { i }$ to denote the $i ^ { \mathrm { { t h } } }$ standard basis element, and let $x = ( 0 . 1 / \Gamma , 0 . 1 / \bar { \Gamma } )$ be a fixed vector where $\Gamma$ appears in the construction of $\mathcal { G } _ { \mathrm { u p } }$ . Recall that $s _ { 1 }$ is the first state in each trajectory. In our example, for all $a \in { \mathcal { A } }$ , $\phi ( s _ { 1 } , a )$ is sampled uniformly at random from the set $\{ \alpha e _ { 1 } + ( 1 - \alpha ) e _ { 2 } : \alpha \in [ 0 , 1 ] \}$ . The transition rule is deterministic and given by:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\forall a \in { \mathcal { A } } : \phi ( s _ { 2 } , a ) = \alpha x { \mathrm { ~ i f ~ } } \phi ( s _ { 1 } , a ) = \alpha e _ { 1 } + ( 1 - \alpha ) e _ { 2 } .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Moreover, for the reward function, $R ( s _ { 1 } , a ) = 0$ and $R ( s _ { 2 } , a ) = 0 . 1 \alpha / \Gamma$ .
|
| 142 |
+
|
| 143 |
+
We first show that the Linear MDP property does not hold for the constructed MDP and the given feature map $\phi$ . Let $s _ { 1 } ^ { ( 1 ) }$ be the state with $\phi ( s _ { 1 } ^ { ( 1 ) } , a ) = e _ { 2 }$ and $s _ { 1 } ^ { ( 2 ) }$ be the state with $\phi ( s _ { 1 } ^ { ( 2 ) } , a ) \stackrel { \textstyle - } { = } e _ { 1 }$ Notice that we deterministically transition from s(1)1 to a state s(1)2 with φ(s(1)2 , a) = 0, and we deterministically transition from $s _ { 1 } ^ { ( 2 ) }$ to a state $s _ { 2 } ^ { ( 2 ) }$ with $\phi ( s _ { 2 } ^ { ( 2 ) } , a ) = x$ , which already fixes the whole transition operator under the linear MDP assumption. Thus, under the linear MDP assumption, we must therefore have a randomized transition for any state $s _ { 1 }$ with $\phi ( s _ { 1 } , a ) = \alpha e _ { 1 } + ( 1 - \alpha ) e _ { 2 }$ where $\alpha \in ( 0 , 1 )$ . This contradicts the fact that our constructed MDP has deterministic transitions everywhere, so the linear MDP cannot hold.
|
| 144 |
+
|
| 145 |
+
We next show that Assumption 2 holds. Consider an arbitrary optimistic √ $Q$ estimate of the form $g ( z ) = \operatorname* { m i n } \{ 1 , z ^ { \top } \theta + \gamma \sqrt { z ^ { \top } A z } \} \in \mathcal { G } _ { \mathrm { u p } }$ . Notice that for $x = ( 0 . 1 / \Gamma , 0 . 1 / \Gamma )$ , we always have that
|
| 146 |
+
|
| 147 |
+
1: Initialize estimates $\bar { Q } _ { h , 0 } \equiv 1$ for all $h \leq H$ and $\overline { { Q _ { H + 1 , t } \equiv 0 } }$ for all $1 \leq t \leq T$ ;
|
| 148 |
+
2: Set $\gamma = C K \kappa ^ { - 1 } \sqrt { 1 + M + K + d ^ { 2 } \ln ( ( 1 + K + \Gamma ) T H ) }$ for a universal constant $C$ ;
|
| 149 |
+
3: for $t = 1 , 2 , \cdots , T$ do
|
| 150 |
+
4: Commit to policy $\begin{array} { r } { { \hat { \pi } } _ { h , t } ( s ) \triangleq \operatorname { a r g m a x } _ { a \in \mathcal { A } } \bar { Q } _ { h , t - 1 } ( s , a ) } \end{array}$ ;
|
| 151 |
+
5: Use policy $\hat { \pi } _ { \cdot , t }$ to collect one trajectory $\{ ( s _ { h , t } , a _ { h , t } , r _ { h , t } ) \} _ { h = 1 } ^ { H }$ ;
|
| 152 |
+
6: for $h = H , H - 1 , \cdots , 1$ do
|
| 153 |
+
7: Compute $x _ { h , \tau } \triangleq \phi ( s _ { h , \tau } , a _ { h , \tau } )$ and $\begin{array} { r } { y _ { h , \tau } \triangleq r _ { h , \tau } + \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } \bar { Q } _ { h + 1 , t } ( s _ { h + 1 , \tau } , a ^ { \prime } ) } \end{array}$ for all
|
| 154 |
+
$\tau \leq t$ ;
|
| 155 |
+
8: Compute ridge estimate
|
| 156 |
+
$\hat { \theta } _ { h , t } \triangleq \operatorname { a r g m i n } _ { \| \theta \| _ { 2 } \leq 1 } \sum _ { \tau \leq t } ( y _ { h , \tau } - f ( \langle x _ { h , \tau } , \theta \rangle ) ) ^ { 2 } ;$ (1)
|
| 157 |
+
9: Compute $\begin{array} { r } { \Lambda _ { h , t } \triangleq \sum _ { \tau \leq t } x _ { h , \tau } x _ { h , \tau } ^ { \top } + I } \end{array}$ ;
|
| 158 |
+
10: Construct $\bar { Q } _ { h , t } ( s , a ) \triangleq \operatorname* { m i n } \Big \{ 1 , f ( \phi ( s , a ) ^ { \top } \hat { \theta } _ { h , t } ) + \gamma \left\| \phi ( s , a ) \right\| _ { \Lambda _ { h , t } ^ { - 1 } } \Big \} ;$
|
| 159 |
+
11: end for
|
| 160 |
+
12: end for
|
| 161 |
+
|
| 162 |
+
$x ^ { \top } \theta + \gamma { \sqrt { x ^ { \top } A x } } \leq 1$ for any $\theta \in \mathbb { B } _ { d }$ and $A$ with $\| A \| _ { \mathrm { o p } } \leq 1$ . Moreover, for all $s _ { 2 }$ , i.e., the second state in the trajectory, we always have $\phi ( s _ { 2 } , a ) = \alpha x$ for some $\alpha \in [ 0 , 1 ]$ . Hence we can ignore the first term in the minimum, and, by direct calculation, we have that when $\bar { \phi } ( s , a ) = \alpha e _ { 1 } + ( \bar { 1 } - \alpha ) e _ { 2 }$ :
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\begin{array} { c } { { \mathcal { T } _ { 1 } ( g ) ( s , a ) = \alpha x ^ { \top } \theta + \gamma \sqrt { \alpha ^ { 2 } x ^ { \top } A x } } } \\ { { { } } } \\ { { = \alpha ( x ^ { \top } \theta + \gamma \sqrt { x ^ { \top } A x } ) = \alpha c _ { 0 } . } } \end{array}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
Hence we can write $\mathcal { T } _ { 1 } ( g ) = \langle \phi ( s , a ) , ( c _ { 0 } , 0 ) \rangle$ , which verifies Assumption 2.
|
| 169 |
+
|
| 170 |
+
# 4 ALGORITHM AND MAIN RESULT
|
| 171 |
+
|
| 172 |
+
We now turn to presenting our algorithm and main results. We study a least-squares dynamic programming style algorithm that we call LSVI-UCB, with pseudocode presented in Algorithm 1. The algorithm is nearly identical to the algorithm proposed by Jin et al. (2019) with the same name. A similar algorithmic template has also been extensively studied in the tabular setting Azar et al. (2017); Dann et al. (2017); Simchowitz & Jamieson (2019), albeit with slightly different confidence bounds. As our algorithm applies to all of these settings, it should be considered as a generalization.
|
| 173 |
+
|
| 174 |
+
The algorithm uses dynamic programming to maintain optimistic $Q$ function estimates $\{ \bar { Q } _ { h , t } \} _ { h \leq H , t \leq T }$ for each time point $h$ and each episode $t$ . In the $t ^ { \mathrm { t h } }$ episode, we use the previously computed estimates to define the greedy policy $\begin{array} { r } { { \hat { \pi } } _ { h , t } ( \cdot ) \triangleq \operatorname { a r g m a x } _ { a \in \mathcal { A } } \bar { Q } _ { h , t - 1 } ( \cdot , a ) } \end{array}$ , which we use to take actions for the episode. Then, with all of the trajectories collected so far, we perform a dynamic programming update, where the main per-step optimization problem is (1). Starting from time point $H$ , we update our $Q$ function estimates by solving constrained least squares problems using our class of GLMs. At time point $H$ , the covariates are $\{ \phi ( s _ { H , \tau } , a _ { H , \tau } ) \} _ { \tau \leq t }$ , and the regression targets are simply the immediate rewards $\{ r _ { H , \tau } \} _ { \tau \leq t }$ . For time points $h < H$ , the covariates are defined similarly as $\{ { \dot { \phi } } ( s _ { h , \tau } , a _ { h , \tau } ) \} _ { \tau \leq t }$ but the regression targets are defined by inflating the learned $Q$ function for time point $h + 1$ by an optimism bonus.
|
| 175 |
+
|
| 176 |
+
In detail, the least squares problem for time point $h + 1$ yields a parameter $\widehat { \theta } _ { h + 1 , t }$ and we also form the second moment matrix $\Lambda _ { h + 1 , t }$ of all the covariates at time $h + 1$ that we have seen so far. Using these, we define the optimistic $Q$ function $\begin{array} { r l } { \bar { Q } _ { h + 1 , t } ( s , a ) } & { { } \triangleq } \end{array}$ $\operatorname* { m i n } \left\{ 1 , f ( \langle \phi ( s , a ) , \hat { \theta } _ { h + 1 , t } \rangle ) + \gamma \left\| \phi ( s , a ) \right\| _ { \Lambda _ { h + 1 , t } ^ { - 1 } } \right\}$ . In our analysis, we verify that $\bar { Q } _ { h + 1 , t }$ is optimistic in the sense that it over-estimates $Q ^ { \star }$ for every $( s , a )$ . Then, the regression targets for the least squares problem at time point $h$ are $\begin{array} { r } { r _ { h , \tau } + \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } \bar { Q } _ { h + 1 , t } ( s _ { h + 1 , \tau } , a ^ { \prime } ) } \end{array}$ , which is a natural stochastic approximation to the Bellman backup of $\bar { Q } _ { h + 1 , t }$ . Applying this update backward from time point $H$ to 1, we obtain the $Q$ -function estimates that we use to define the policy for the next episode.
|
| 177 |
+
|
| 178 |
+
The main conceptual difference between Algorithm 1 and the algorithm of Jin et al. (2019) is that we allow non-linear function approximation with GLMs, while they consider only linear models. On a more technical level, we use constrained least squares for our dynamic programming backup which we find easier to analyze, while they use the ridge regularized version.
|
| 179 |
+
|
| 180 |
+
On the computational side, the algorithm is straightforward to implement, and, depending on the link function $f$ , it can be easily shown to run in polynomial time. For example, if $f$ is the identity map, then (1) is equivalent to standard least square ridge regression, which can be solved in closed form. Moreover, we can use the Sherman-Morrison formula to amortize matrix inversions, and, by doing so, we obtain a running time of $O \left( d ^ { 2 } | A | H T ^ { 2 } \right)$ . The dominant cost in this calculation is evaluating the optimism bonus when computing the regression targets. In practice, using an epoch schedule or incremental optimization algorithms for updating $\bar { Q }$ would yield an even faster algorithm. Of course, with modern machine learning libraries, it is also straightforward to implement the algorithm with a non-trivial link function $f$ , even though (1) may be non-convex.
|
| 181 |
+
|
| 182 |
+
# 4.1 MAIN RESULT
|
| 183 |
+
|
| 184 |
+
Our main result is a regret bound for LSVI-UCB when the link function satisfies Assumption 1 and the function class satisfies Assumption 2.
|
| 185 |
+
|
| 186 |
+
Theorem 1. For any episodic MDP, with Assumption $^ { l }$ and Assumption 2, and for any $T$ , the cumulative regret of Algorithm $\textit { l i s } ^ { 3 }$
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
O \left( H K \kappa ^ { - 1 } \sqrt { ( M + K + d ^ { 2 } \ln ( K T H ) ) \cdot T d \ln ( T / d ) } \right) = \widetilde { O } \left( H \sqrt { d ^ { 3 } T } \right) ,
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
with probability $1 - 1 / ( T H )$
|
| 193 |
+
|
| 194 |
+
The result states that LSVI-UCB enjoys $\sqrt { T }$ -regret for any episodic MDP problem and any GLM, provided that the regularity conditions are satisfied and that optimistic closure holds. As we have mentioned, these assumptions are relatively mild, encompassing the tabular setting and prior work on linear function approximation. Importantly, no explicit dynamics assumptions are required. Thus, Theorem 1 is one of the most general results we are aware of for provably efficient exploration with function approximation.
|
| 195 |
+
|
| 196 |
+
Nevertheless, to develop further intuition for our bound, it is worth comparing to prior results. First, in the linear MDP setting of Jin et al. (2019), we use the identity link function so that $K = \kappa = 1$ and $M = 1$ , and we also are guaranteed to satisfy Assumption 2. In this case, our bound differs from that of Jin et al. (2019) only in the dependence on $H$ , which arises due to a difference in normalization. Our bound is essentially equivalent to theirs and can therefore be seen as a strict generalization.
|
| 197 |
+
|
| 198 |
+
To capture the tabular setting, we use the standard basis featurization as in Fact 2 and the identity link function, which gives $\bar { d } = | { \cal S } | | { \cal A } |$ , $K = \kappa = 1$ , and $M = 1$ . Thus, we obtain the following corollary:
|
| 199 |
+
|
| 200 |
+
Corollary 2. For MDPs with finite state and action spaces, using feature map $\phi ( s , a ) \triangleq e _ { s , a } \in$ $\mathbb { R } ^ { | \boldsymbol { S } | \times | \boldsymbol { A } | }$ , for any $T$ , the cumulative regret of Algorithm $^ { l }$ is $\widetilde { \mathcal { O } } \left( H \sqrt { | { \cal S } | ^ { 3 } | { \cal A } | ^ { 3 } T } \right)$ , with probability $1 - 1 / ( T H )$ .
|
| 201 |
+
|
| 202 |
+
Note that this bound is polynomially worse than the near-optimal $\widetilde { \mathcal { O } } ( H \sqrt { S A T } + H ^ { 2 } S ^ { 2 } A \log ( T ) )$ bound of Azar et al. (2017). However, a refined analysis specialized to the tabular setting can be shown to obtain a better regret bound of $\widetilde { \mathcal { O } } \left( H \sqrt { | { \cal S } | ^ { 2 } | { \cal A } | ^ { 2 } T } \right)$ . Of course, our algorithm and analysis address problems with infinitely large state spaces and other settings that are significantly more complex than tabular MDPs, which we believe is more important than recovering the optimal guarantee for tabular MDPs.
|
| 203 |
+
|
| 204 |
+
# 5 DISCUSSION
|
| 205 |
+
|
| 206 |
+
This paper presents a provably efficient reinforcement learning algorithm that approximates the √ $Q ^ { \star }$ function with a generalized linear model. We prove that the algorithm obtains $\widetilde { \mathcal { O } } ( H \sqrt { d ^ { 3 } T } )$ regret under mild regularity conditions and a new expressivity condition that we call optimistic closure. These assumptions generalize both the tabular setting, which is classical, and the linear MDP setting studied in recent work. Further they represent the first statistically and computationally efficient algorithms for reinforcement learning with generalized linear function approximation, without explicit dynamics assumptions.
|
| 207 |
+
|
| 208 |
+
We close with some open problems. First, using the fact that Corollary 3 applies beyond GLMs, can we develop algorithms that can employ general function classes? While such algorithms do exist for the contextual bandit setting (Foster et al., 2018), it seems quite difficult to generalize this analysis to multi-step reinforcement learning. More importantly, while optimistic closure is weaker than some prior assumptions (and incomparable to others), it is still quite strong, and stronger than what is required for the batch RL setting. An important direction is to investigate weaker assumptions that enable provably efficient reinforcement learning with function approximation. We look forward to studying these questions in future work.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Yasin Abbasi-Yadkori, David P ´ al, and Csaba Szepesv ´ ari. Improved algorithms for linear stochastic ´ bandits. In Advances in Neural Information Processing Systems, 2011.
|
| 213 |
+
|
| 214 |
+
Yasin Abbasi-Yadkori, David Pal, and Csaba Szepesvari. Online-to-confidence-set conversions and application to sparse stochastic bandits. In International Conference on Artificial Intelligence and Statistics, 2012.
|
| 215 |
+
|
| 216 |
+
Alekh Agarwal, Mikael Henaff, Sham Kakade, and Wen Sun. Pc-pg: Policy cover directed exploration for provable policy gradient learning. arXiv preprint arXiv:2007.08459, 2020.
|
| 217 |
+
|
| 218 |
+
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, 2008.
|
| 219 |
+
|
| 220 |
+
Alex Ayoub, Zeyu Jia, Csaba Szepesvari, Mengdi Wang, and Lin F Yang. Model-based reinforcement learning with value-targeted regression. arXiv preprint arXiv:2006.01107, 2020.
|
| 221 |
+
|
| 222 |
+
Mohammad Gheshlaghi Azar, Ian Osband, and Remi Munos. Minimax regret bounds for reinforce- ´ ment learning. In International Conference on Machine Learning, 2017.
|
| 223 |
+
|
| 224 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, 2016.
|
| 225 |
+
|
| 226 |
+
Steven J Bradtke and Andrew G Barto. Linear least-squares algorithms for temporal difference learning. Machine Learning, 1996.
|
| 227 |
+
|
| 228 |
+
Ronen I. Brafman and Moshe Tennenholtz. R-MAX - A general polynomial time algorithm for near-optimal reinforcement learning. The Journal of Machine Learning Research, 2002.
|
| 229 |
+
|
| 230 |
+
Qi Cai, Zhuoran Yang, Chi Jin, and Zhaoran Wang. Provably efficient exploration in policy optimization. arXiv preprint arXiv:1912.05830, 2019.
|
| 231 |
+
|
| 232 |
+
Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. In International Conference on Machine Learning, 2019.
|
| 233 |
+
|
| 234 |
+
Christoph Dann, Tor Lattimore, and Emma Brunskill. Unifying PAC and regret: Uniform PAC bounds for episodic reinforcement learning. In Advances in Neural Information Processing Systems, 2017.
|
| 235 |
+
|
| 236 |
+
Simon S Du, Sham M Kakade, Ruosong Wang, and Lin F Yang. Is a good representation sufficient for sample efficient reinforcement learning? arXiv:1910.03016, 2019a.
|
| 237 |
+
|
| 238 |
+
Simon S Du, Akshay Krishnamurthy, Nan Jiang, Alekh Agarwal, Miroslav Dud´ık, and John Langford. Provably efficient RL with rich observations via latent state decoding. In International Conference on Machine Learning, 2019b.
|
| 239 |
+
|
| 240 |
+
Amir-massoud Farahmand, Csaba Szepesvari, and R ´ emi Munos. Error propagation for approximate ´ policy and value iteration. In Advances in Neural Information Processing Systems, 2010.
|
| 241 |
+
|
| 242 |
+
Sarah Filippi, Olivier Cappe, Aurelien Garivier, and Csaba Szepesv ´ ari. Parametric bandits: The ´ generalized linear case. In Advances in Neural Information Processing Systems, 2010.
|
| 243 |
+
|
| 244 |
+
Dylan J Foster, Alekh Agarwal, Miroslav Dud´ık, Haipeng Luo, and Robert E Schapire. Practical contextual bandits with regression oracles. In International Conference on Machine Learning, 2018.
|
| 245 |
+
|
| 246 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. arXiv:1812.02900, 2018.
|
| 247 |
+
|
| 248 |
+
Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low Bellman rank are PAC-learnable. In International Conference on Machine Learning, 2017.
|
| 249 |
+
|
| 250 |
+
Chi Jin, Zeyuan Allen-Zhu, Sebastien Bubeck, and Michael I Jordan. Is Q-learning provably efficient? In Advances in Neural Information Processing Systems, 2018.
|
| 251 |
+
|
| 252 |
+
Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. arXiv:1907.05388, 2019.
|
| 253 |
+
|
| 254 |
+
Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Machine learning, 2002.
|
| 255 |
+
|
| 256 |
+
Akshay Krishnamurthy, Alekh Agarwal, and John Langford. PAC reinforcement learning with rich observations. In Advances in Neural Information Processing Systems, 2016.
|
| 257 |
+
|
| 258 |
+
Lihong Li, Yu Lu, and Dengyong Zhou. Provably optimal algorithms for generalized linear contextual bandits. In International Conference on Machine Learning, 2017.
|
| 259 |
+
|
| 260 |
+
Francisco S Melo and M Isabel Ribeiro. Q-learning with linear function approximation. In Conference on Learning Theory, 2007.
|
| 261 |
+
|
| 262 |
+
Aditya Modi, Nan Jiang, Ambuj Tewari, and Satinder Singh. Sample complexity of reinforcement learning using linearly combined model ensembles. In International Conference on Artificial Intelligence and Statistics, pp. 2010–2020, 2020.
|
| 263 |
+
|
| 264 |
+
Remi Munos. Error bounds for approximate policy iteration. In ´ International Conference on Machine Learning, 2003.
|
| 265 |
+
|
| 266 |
+
Remi Munos and Csaba Szepesv ´ ari. Finite-time bounds for fitted value iteration. ´ The Journal of Machine Learning Research, 2008.
|
| 267 |
+
|
| 268 |
+
Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped DQN. In Advances in neural information processing systems, 2016.
|
| 269 |
+
|
| 270 |
+
Victor H Pena, Tze Leung Lai, and Qi-Man Shao. ˜ Self-normalized processes: Limit theory and Statistical Applications. Springer Science & Business Media, 2008.
|
| 271 |
+
|
| 272 |
+
Max Simchowitz and Kevin Jamieson. Non-asymptotic gap-dependent regret bounds for tabular mdps. arXiv:1905.03814, 2019.
|
| 273 |
+
|
| 274 |
+
Alexander L. Strehl, Lihong Li, Eric Wiewiora, John Langford, and Michael L. Littman. PAC model-free reinforcement learning. In International Conference on Machine Learning, 2006.
|
| 275 |
+
|
| 276 |
+
Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, OpenAI Xi Chen, Yan Duan, John Schulman, Filip DeTurck, and Pieter Abbeel. #Exploration: A study of count-based exploration for deep reinforcement learning. In Advances in Neural Information Processing Systems, 2017.
|
| 277 |
+
|
| 278 |
+
Lin F Yang and Mengdi Wang. Reinforcement leaning in feature space: Matrix bandit, kernels, and regret bound. arXiv:1905.10389, 2019.
|
| 279 |
+
|
| 280 |
+
Andrea Zanette, David Brandfonbrener, Matteo Pirotta, and Alessandro Lazaric. Frequentist regret bounds for randomized least-squares value iteration. arXiv preprint arXiv:1911.00567, 2019.
|
| 281 |
+
|
| 282 |
+
Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal policies with low inherent bellman error. arXiv preprint arXiv:2003.00153, 2020a.
|
| 283 |
+
|
| 284 |
+
Andrea Zanette, Alessandro Lazaric, Mykel J Kochenderfer, and Emma Brunskill. Provably efficient reward-agnostic navigation with linear value iteration. arXiv preprint arXiv:2008.07737, 2020b.
|
| 285 |
+
|
| 286 |
+
Dongruo Zhou, Jiafan He, and Quanquan Gu. Provably efficient reinforcement learning for discounted mdps with feature mapping. arXiv preprint arXiv:2006.13165, 2020.
|
| 287 |
+
|
| 288 |
+
# A PROOF OF THEOREM 1
|
| 289 |
+
|
| 290 |
+
We now provide the proof of Theorem 1, deferring some technical details to later sections in this appendix. The proof has three main components: a regret decomposition for optimistic $Q$ learning, a deviation analysis for least squares with GLMs to ensure optimism, and a potential argument to obtain the final regret bound.
|
| 291 |
+
|
| 292 |
+
Regret decomposition. The first step of the proof is a regret decomposition that applies generically to optimistic algorithms.4 The lemma demonstrates concisely the value of optimism in reinforcement learning, and is the primary technical motivation for our interest in optimistic algorithms.
|
| 293 |
+
|
| 294 |
+
We state the lemma more generally, which requires some additional notation. Fix round $t$ and let $\{ \bar { Q } _ { h , t - 1 } \} _ { h \leq H }$ denote the current estimated $Q$ functions. The precondition is that $\bar { Q } _ { h , t - 1 }$ is optimistic and has controlled overestimation. Precisely, we assume that there exists a function $\mathrm { c n f } _ { h , t - 1 } : \mathcal { S } \times \mathcal { A } \to \mathbb { R } _ { + }$ such that
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array} { r l } & { \quad Q _ { h } ^ { \star } ( s , a ) \leq \bar { Q } _ { h , t - 1 } ( s , a ) } \\ & { \quad \bar { Q } _ { h , t - 1 } ( s , a ) \leq { \mathcal T } _ { h } ( \bar { Q } _ { h + 1 , t - 1 } ) ( s , a ) + \mathrm { c n f } _ { h , t - 1 } ( s , a ) } \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
We will verify that our estimates ${ \bar { Q } } _ { h , \ l }$ · satisfy these properties subsequently. Before doing so, we state the regret decomposition lemma and an immediate corollary.
|
| 301 |
+
|
| 302 |
+
Lemma 1. Fix episode $t$ and let $\mathcal { F } _ { t - 1 }$ be the filtration of $\{ ( s _ { h , \tau } , a _ { h , \tau } , r _ { h , \tau } ) \} _ { \tau < t }$ . Assume that $\bar { Q } _ { h , t - 1 }$ satisfies (3) for some function $\mathrm { c n f } _ { h , t - 1 }$ . Then, $i f \pi _ { t } = \operatorname { a r g m a x } _ { a \in \mathcal { A } } \bar { Q } _ { h , t - 1 } ( \cdot , a )$ is deployed we have
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
V ^ { \star } - \mathbb { E } \left[ \sum _ { h = 1 } ^ { H } r _ { h , t } \mid \mathcal { F } _ { t - 1 } \right] \leq \zeta _ { t } + \sum _ { h = 1 } ^ { H } \operatorname { c n f } _ { h , t - 1 } ( s _ { h , t } , a _ { h , t } ) ,
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
where $\mathbb { E } \left[ \zeta _ { t } \mid \mathcal { F } _ { t - 1 } \right] = 0$ and $| \zeta _ { t } | \leq 2 H$ almost surely.
|
| 309 |
+
|
| 310 |
+
Corollary 3. Assume that for all $t _ { : }$ , $\bar { Q } _ { h , t - 1 }$ satisfies (3) and that $\pi _ { t }$ is the greedy policy with respect to $\bar { Q } _ { h , t - 1 }$ . Then with probability at least $1 - \delta$ , we have
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\mathrm { R e g } ( T ) \leq \sum _ { t = 1 } ^ { T } \sum _ { h = 1 } ^ { H } \mathrm { c n f } _ { h , t - 1 } ( s _ { h , t } , a _ { h , t } ) + \ O ( H { \sqrt { T \log ( 1 / \delta ) } } ) .
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
Proof of Lemma $^ { l }$ . Observe that
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\begin{array} { r l } & { V ^ { \star } = \operatorname { \mathbb { E } } \left[ Q ^ { \star } ( s _ { 1 } , \pi ^ { \star } ( s _ { 1 } ) ) \right] \leq \operatorname { \mathbb { E } } \left[ \bar { Q } _ { 1 , t - 1 } ( s _ { 1 } , \pi ^ { \star } ( s _ { 1 } ) ) \right] } \\ & { \quad \leq \operatorname { \mathbb { E } } \left[ \bar { Q } _ { 1 , t - 1 } ( s _ { 1 } , \pi _ { t } ( s _ { 1 } ) ) \right] } \\ & { \quad \leq \operatorname { \mathbb { E } } \left[ \operatorname { c n f } _ { 1 , t - 1 } ( s _ { 1 } , \pi _ { t } ( s _ { 1 } ) ) \right] + \operatorname { \mathbb { E } } \left[ { \mathcal { T } } _ { 1 } ( \bar { Q } _ { 2 , t - 1 } ) ( s _ { 1 } , \pi _ { t } ( s _ { 1 } ) ) \right] } \\ & { \quad = \operatorname { \mathbb { E } } \left[ \operatorname { c n f } _ { 1 , t - 1 } ( s _ { 1 } , \pi _ { t } ( s _ { 1 } ) ) \right] + \operatorname { \mathbb { E } } \left[ r _ { 1 } \mid s _ { 1 } , a _ { 1 } = \pi _ { t } ( s _ { 1 } ) \right] } \\ & { \quad \quad + \operatorname { \mathbb { E } } _ { s _ { 2 } \sim \pi _ { t } } \left[ \bar { Q } _ { 2 , t - 1 } ( s _ { 2 } , \pi _ { t } ( s _ { 2 } ) ) \right] } \end{array}
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
Throughout this calculation, $s _ { 1 } \sim \mu$ . The first step here is by definition, the second uses the optimism property for $\bar { Q } _ { 1 , t - 1 }$ . The third uses that $\pi _ { t }$ is the greedy policy with respect to $\bar { Q } _ { 1 , t - 1 }$ while the fourth uses the upper bound on $\bar { Q } _ { 1 , t - 1 }$ . Finally we use the definition of the Bellman operator and the fact that $\pi _ { t }$ is the greedy policy yet again. Comparing this upper bound with the expected reward collected by $\pi _ { t }$ we observe that $r _ { 1 }$ cancels, and we get
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r } { \quad / ^ { \star } - \mathbb { E } \left[ \displaystyle \sum _ { h = 1 } ^ { H } r _ { h , t } \mid \mathcal { F } _ { t - 1 } \right] \leq \mathbb { E } _ { \pi _ { t } } \left[ \operatorname { c n f } _ { 1 , t - 1 } ( s _ { 1 } , \pi _ { t } ( s _ { 1 } ) ) \right] + \mathbb { E } _ { \pi _ { t } } \left[ \bar { Q } _ { 2 , t - 1 } ( s _ { 2 } , \pi _ { t } ( s _ { 2 } ) ) - \displaystyle \sum _ { h = 2 } ^ { H } r _ { h , t } \mid \mathcal { F } _ { t - 1 } \right] } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
At this point, notice that $\bar { Q } _ { 2 , t - 1 } ( s _ { 2 } , \pi _ { t } ( s _ { 2 } ) )$ is precisely what we alreacy upper bounded at time point $h = 1$ and we are always considering the state-action distribution induced by $\pi _ { t }$ . Hence, repeating the argument for all $h$ , we obtain
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
V ^ { \star } - \mathbb { E } \left[ \sum _ { h = 1 } ^ { H } r _ { h , t } \mid \mathcal { F } _ { t - 1 } \right] \leq \sum _ { h = 1 } ^ { H } \mathbb { E } _ { \pi _ { t } } \left[ \operatorname { c n f } _ { h , t - 1 } ( s _ { h } , a _ { h } ) \right] = \sum _ { h = 1 } ^ { H } \operatorname { c n f } _ { h , t - 1 } ( s _ { h , t } , a _ { h , t } ) + \zeta _ { t } ,
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $\textstyle \zeta _ { t } \triangleq \sum _ { h = 1 } ^ { H } \zeta _ { h , t }$ and
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { r } { \zeta _ { h , t } \triangleq \mathbb { E } _ { \pi _ { t } } \left[ \mathrm { c n f } _ { h , t - 1 } ( \boldsymbol { s } _ { h } , \pi _ { t } ( \boldsymbol { s } _ { h } ) ) \right] - \mathrm { c n f } _ { h , t - 1 } ( \boldsymbol { s } _ { h , t } , \boldsymbol { a } _ { h , t } ) , } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
which is easily seen to have the required properties.
|
| 341 |
+
|
| 342 |
+
The lemma states that if $\bar { Q } _ { h , t - 1 }$ is optimistic and we deploy the greedy policy $\pi _ { t }$ , then the perepisode regret is controlled by the overestimation error of $\bar { Q } _ { h , t - 1 }$ , up to a stochastic term that enjoys favorable concentration properties. Crucially, the errors are accumulated on the observed trajectory, or, stated another way, the $\mathrm { c n f } _ { h , t - 1 }$ is evaluated on the states and actions visited during the episode. As these states and actions will be used to update $\bar { Q }$ , we can expect that the cnf function will decrease on these arguments. This can yield one of two outcomes: either we will incur lower regret in the next episode, or we will explore the environment by visiting new states and actions. In this sense, the lemma demonstrates how optimism navigates the exploration-exploitation tradeoff in the multi-step RL setting, analogously to the bandit setting.
|
| 343 |
+
|
| 344 |
+
Note that Lemma 1 does not assume any form for $\bar { Q } _ { h , t - 1 }$ and does not require Assumption 2. In particular, they are not specialized to GLMs. In our proof, we use the GLM representation and Assumption 2 to ensure that (3) holds and to bound the confidence sum in Corollary 3. We believe these technical results will be useful in designing RL algorithms for general function classes, which is a natural direction for future work.
|
| 345 |
+
|
| 346 |
+
Deviation analysis. The next step of the proof is to design the cnf function and ensure that (3) holds, with high probability. This is the contents of the next lemma.
|
| 347 |
+
|
| 348 |
+
Lemma 2. Under Assumption $^ { l }$ and Assumption 2, with probability $1 - 1 / ( T H )$ , we have that $\forall t , h , s , a$ :
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\left| f ( \langle \phi ( s , a ) , \widehat { \theta } _ { h , t } \rangle ) - { \mathcal { T } } _ { h } ( \bar { Q } _ { h + 1 , t } ) ( s , a ) \right| \leq \gamma \left\| \phi ( s , a ) \right\| _ { \Lambda _ { h , t } ^ { - 1 } }
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
where $\gamma , \Lambda _ { h , t }$ are defined in Algorithm $^ { l }$ .
|
| 355 |
+
|
| 356 |
+
A simple induction argument then verifies that (3) holds, which we summarize in the next corollary.
|
| 357 |
+
|
| 358 |
+
Corollary 4. Under Assumption $^ { l }$ and Assumption 2, with probability $1 - 1 / ( T H )$ , we have that (3) holds for all $t , h$ with $\begin{array} { r } { \mathrm { c n f } _ { h , t - 1 } ( s , a ) = \operatorname* { m i n } \{ \bar { 2 } , 2 \gamma \Vert \phi ( s , a ) \Vert _ { \Lambda _ { h , t - 1 } ^ { - 1 } } \} } \end{array}$ .
|
| 359 |
+
|
| 360 |
+
As the proof of Lemma 2 is rather long and technical, we defer the details to the appendix and instead explain the high-level argument here. The proof requires an intricate deviation analysis to account for the dependency structure in the data sequence. The intuition is that, thanks to Assumption 2 and the fact that $\bar { Q } _ { h + 1 , t } \in \mathcal { G } _ { \operatorname* { u p } }$ , we know that there exists a parameter $\bar { \theta } _ { h , t }$ such that $f ( \langle \phi ( s , \bar { a } ) , \bar { \theta } _ { h , t } \rangle ) =$ $\mathcal { T } _ { h } ( \bar { Q } _ { h + 1 , t } ) ( s , a )$ . It is easy to verify that $\bar { \theta } _ { h , t }$ is the Bayes optimal predictor for the square loss problem in (1), and so with a uniform convergence argument we can expect that $\widehat { \theta } _ { h , t }$ is close to $\bar { \theta } _ { h , t }$ , which is our desired conclusion.
|
| 361 |
+
|
| 362 |
+
There are two subtleties with this argument. First, we want to show that $\bar { \theta } _ { h , t }$ and $\widehat { \theta } _ { h , t }$ are close in a data-dependent sense, to obtain the dependence on the $\Lambda _ { h , t } ^ { - 1 }$ -Mahalanobis norm in the bound. This can be done using vector-valued self-normalized martingale inequalities (Pena et al., 2008), as in ˜ prior work on linear stochastic bandits (Abbasi-Yadkori et al., 2012; Filippi et al., 2010; AbbasiYadkori et al., 2011).
|
| 363 |
+
|
| 364 |
+
However, the process we are considering is not a martingale, since $\bar { Q } _ { h + 1 , t }$ , which determines the regression targets $y _ { h , \tau }$ , depends on all data collected so far. Hence $y _ { h , \tau }$ is not measurable with respect to the filtration $\mathcal { F } _ { \tau }$ , which prevents us from directly applying a self-normalized martingale concentration inequality. To circumvent this issue, we use a uniform convergence argument and introduce a deterministic covering of $\mathcal { G } _ { \mathrm { u p } }$ . Each element of the cover induces a different sequence of regression targets $y _ { h , \tau }$ , but as the covering is deterministic, we do obtain martingale structure. Then, we show that the error term for the random $\bar { Q } _ { h + 1 , t }$ that we need to bound is close to a corresponding term for one of the covering elements, and we finish the proof with a uniform convergence argument over all covering elements.
|
| 365 |
+
|
| 366 |
+
The corollary is then obtained by a straightforward inductive argument. Assuming $\bar { Q } _ { h + 1 , t }$ dominates $Q ^ { \star }$ , it is easy to show that $\bar { Q } _ { h , t }$ also dominates $Q ^ { \star }$ , and the upper bound is immediate. Combining Corollary 4 with Corollary 3, all that remains is to upper bound the confidence sum.
|
| 367 |
+
|
| 368 |
+
Potential argument. To bound the confidence sum, we use a standard potential argument that appears in a number of works on stochastic linear bandits. We summarize the conclusion with the following lemma, which follows directly from Lemma 11 of Abbasi-Yadkori et al. (2012).
|
| 369 |
+
|
| 370 |
+
Lemma 3. For any $h \leq H$ we have that
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\sum _ { t = 1 } ^ { T } \| \phi ( s _ { h , t } , a _ { h , t } ) \| _ { \Lambda _ { h , t - 1 } ^ { - 1 } } ^ { 2 } \leq 2 d \ln ( 1 + T / d ) .
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
Wrapping up. Equipped with the above results, we are now prepared to prove Theorem 1.
|
| 377 |
+
|
| 378 |
+
Proof of Theorem $^ { l }$ . Assume that Corollary 4 holds for all $1 \leq h \leq H$ and $1 \leq t \leq T$ . Applying Lemma 1 and the definition of $\mathrm { c n f } _ { h , t - 1 }$ implied by Corollary 4, the cumulative expected regret is at most
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\begin{array} { r l } & { T V ^ { * } - \mathbb { E } \left[ \displaystyle \sum _ { t = 1 } ^ { T } \displaystyle \sum _ { h = 1 } ^ { H } r _ { h , t } \right] } \\ & { \le \displaystyle \sum _ { t = 1 } ^ { T } \zeta _ { t } + \displaystyle \sum _ { t = 1 } ^ { T } \displaystyle \sum _ { h = 1 } ^ { H } \operatorname* { m i n } \left\{ 2 , \gamma \| \dot { \varphi } ( s _ { h , t } , a _ { h , t } ) \| _ { \Lambda _ { h , t - 1 } ^ { - 1 } } \right\} } \\ & { \le \displaystyle \sum _ { t = 1 } ^ { T } \zeta _ { t } + \displaystyle \sum _ { h = 1 } ^ { H } \sqrt { T \gamma ^ { 2 } } \cdot \sqrt { \displaystyle \sum _ { t = 1 } ^ { T } \| \dot { \phi } ( s _ { h , t } , a _ { h , t } ) \| _ { \Lambda _ { h , t - 1 } ^ { - 1 } } ^ { 2 } } } \\ & { \le \displaystyle \sum _ { t = 1 } ^ { T } \zeta _ { t } + \displaystyle \sum _ { h = 1 } ^ { H } \sqrt { T \gamma ^ { 2 } } \cdot \sqrt { 2 d \ln ( 1 + T / d ) } . } \end{array}
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
Here, the second step follows from the Cauchy-Schwarz inequality, and the last step is an application of Lemma 3. The first term forms a martingale, and we know that $| \zeta _ { t } | \leq 2 H$ . Therefore, by Azuma’s inequality, we have that with probability at least $1 - 1 / T H$
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\sum _ { t = 1 } ^ { T } \zeta _ { t } \leq \sqrt { 8 T H ^ { 2 } \ln ( T H ) } .
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
Finally, using the definition of $\gamma$ , the final regret is upper bounded by
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { r l } & { \mathsf { x e g } ( T ) \leq O \big ( H \sqrt { T \ln ( T H ) } + H K \kappa ^ { - 1 } \times \sqrt { \big ( M + K + d ^ { 2 } \ln ( ( K + \Gamma ) T H ) \big ) \cdot T d \ln ( 1 + T / d ) } \big ) } \\ & { \qquad \leq \widetilde { O } \left( H \sqrt { d ^ { 3 } T } \right) , } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
which proves the result.
|
| 397 |
+
|
| 398 |
+
# B PROOF OF LEMMA 2 AND COROLLARY 4
|
| 399 |
+
|
| 400 |
+
To facilitate our analysis we define the following important intermediate quantity:
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\bar { \theta } _ { h , t } \in \mathbb { B } _ { d } : f \big ( \langle \phi ( s , a ) , \bar { \theta } _ { h , t } \rangle \big ) \triangleq \mathbb { E } \left[ r _ { h } + \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } \bar { Q } _ { h + 1 , t } \big ( s ^ { \prime } , a ^ { \prime } \big ) \mid s , a \right] .
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
In words, $\bar { \theta } _ { h , t }$ is the Bayes optimal predictor for the squared loss problem at time point $h$ in the $t ^ { \mathrm { { t h } } }$ episode. Since by inspection $\bar { Q } _ { h + 1 , t } \in \mathcal { G } _ { \operatorname* { u p } }$ , by Assumption 2 we know that $\bar { \theta } _ { h , t }$ exists for all $h$ and $t$ .
|
| 407 |
+
|
| 408 |
+
Lemma 4. For any $\theta , \theta ^ { \prime } , x \in \mathbb { R } ^ { d }$ satisfying $\| \theta \| _ { 2 } , \| \theta ^ { \prime } \| _ { 2 } , \| x \| _ { 2 } \leq 1 ,$ ,
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { r } { \kappa ^ { 2 } \left| \langle x , \theta ^ { \prime } - \theta \rangle \right| ^ { 2 } \leq \left| f ( \langle x , \theta ^ { \prime } \rangle ) - f ( \langle x , \theta \rangle ) \right| ^ { 2 } \leq K ^ { 2 } \left\| \theta ^ { \prime } - \theta \right\| _ { 2 } ^ { 2 } . } \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
Proof. By the mean-value theorem, there exists $\tilde { \theta } = \theta + \lambda ( \theta ^ { \prime } - \theta )$ for some $\lambda \in ( 0 , 1 )$ such that $f ( \langle x , \theta ^ { \prime } \rangle ) - f ( \langle x , \theta \rangle ) = \Big \langle \nabla _ { \theta } f ( \langle x , \tilde { \theta } \rangle ) , \theta ^ { \prime } - \theta \Big \rangle$ . On the other hand, by the chain rule and Assumption 1, $\nabla _ { \boldsymbol { \theta } } f ( \langle x , \tilde { \boldsymbol { \theta } } \rangle ) = f ^ { \prime } ( \langle x , \tilde { \boldsymbol { \theta } } \rangle ) \cdot x$ . Hence,
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\begin{array} { r l } & { | \langle \nabla _ { \theta } f ( x ^ { \top } \tilde { \theta } ) , \theta ^ { \prime } - \theta \rangle | ^ { 2 } \leq f ^ { \prime } ( \langle x , \tilde { \theta } \rangle ) ^ { 2 } \cdot \left| \langle x , \theta ^ { \prime } - \theta \rangle \right| ^ { 2 } \leq K ^ { 2 } \left\| x \right\| _ { 2 } ^ { 2 } \left\| \theta ^ { \prime } - \theta \right\| _ { 2 } ^ { 2 } \leq K ^ { 2 } \left\| \theta ^ { \prime } - \theta \right\| _ { 2 } ^ { 2 } ; } \\ & { | \langle \nabla _ { \theta } f ( x ^ { \top } \tilde { \theta } ) , \theta ^ { \prime } - \theta \rangle | ^ { 2 } \geq \kappa ^ { 2 } \left| \langle x , \theta ^ { \prime } - \theta \rangle \right| ^ { 2 } , } \end{array}
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
which are to be demonstrated.
|
| 421 |
+
|
| 422 |
+
Lemma 5. For any $0 < \varepsilon \le 1$ , there exists a finite subset $\mathcal { V } _ { \varepsilon } \subset \mathcal G _ { u p }$ with $\ln | \mathcal { V } _ { \varepsilon } | \leq 6 d ^ { 2 } \ln ( 2 ( 1 +$ $K + \Gamma ) / \varepsilon ,$ ), such that
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\operatorname* { s u p } _ { g \in \mathcal { G } _ { u p } } \operatorname* { m i n } _ { v \in \mathcal { V } _ { \varepsilon } } \operatorname* { s u p } _ { s , a } \left| g ( \phi ( s , a ) ) - v ( \phi ( s , a ) ) \right| \le \varepsilon .
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
Proof. Recall that for every $g \in \mathcal { G } _ { \mathrm { u p } }$ , there exists $\theta \in \mathbb { B } _ { d }$ , $0 \leq \gamma \leq \Gamma$ and $\| A \| _ { \mathrm { o p } } \leq 1$ such that $g ( x ) = \operatorname* { m i n } \{ 1 , f ( \langle x , \theta \rangle ) + \gamma \| x \| _ { A } \}$ . Let $\Theta _ { \varepsilon } \subseteq \mathbb { B } _ { d }$ , $\Gamma _ { \varepsilon } \subseteq [ 0 , \Gamma ]$ and $\mathcal { M } _ { \varepsilon } \subseteq \{ M \in \mathbb { S } _ { d } ^ { + } : \| M \| _ { \mathrm { o p } } \leq$ $1 \}$ be finite subsets such that for any $\theta , \gamma , A$ , there exist $\theta ^ { \prime } \in \Theta _ { \varepsilon }$ , $\gamma ^ { \prime } \in \Gamma _ { \varepsilon }$ , $A ^ { \prime } \in \mathcal { M } _ { \varepsilon }$ such that
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\operatorname* { m a x } \left\{ \left\| \theta - \theta ^ { \prime } \right\| _ { 2 } , \left| \gamma - \gamma ^ { \prime } \right| , \left\| A - A ^ { \prime } \right\| _ { \mathrm { o p } } \right\} \leq \varepsilon ^ { \prime } ,
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
where $ { \varepsilon } ^ { \prime } \in \left( 0 , 1 \right)$ will be specified later in the proof. For the function $g \in \mathcal { G } _ { \mathrm { u p } }$ corresponding to the parameters $\theta , \gamma , A$ the function $g ^ { \prime }$ corresponding to parameters $\theta ^ { \prime } , \gamma ^ { \prime } , A ^ { \prime }$ satisfies
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\begin{array} { r l } { \underset { s , a } { \operatorname* { s u p } } | g ( \phi ( s , a ) ) - g ^ { \prime } ( \phi ( s , a ) ) | \leq \underset { x \in \mathbb { B } _ { d } } { \operatorname* { s u p } } | g ( x ) - g ^ { \prime } ( x ) | } \\ & { \leq \underset { x \in \mathbb { B } _ { d } } { \operatorname* { s u p } } | f ( \langle x , \theta \rangle ) - f ( \langle x , \theta ^ { \prime } \rangle ) + \gamma \| x \| _ { A } - \gamma ^ { \prime } \| x \| _ { A ^ { \prime } } | } \\ & { \leq K \| \theta - \theta ^ { \prime } \| _ { 2 } + | \gamma - \gamma ^ { \prime } | + \Gamma \| | x \| _ { A } - \| x \| _ { A ^ { \prime } } | } \\ & { \leq K \| \theta - \theta ^ { \prime } \| _ { 2 } + | \gamma - \gamma ^ { \prime } | + \Gamma \sqrt { | x ^ { \top } ( A - A ^ { \prime } ) x | } } \\ & { \leq K \varepsilon ^ { \prime } + \varepsilon ^ { \prime } + \Gamma \sqrt { \varepsilon ^ { \prime } } \leq ( 1 + K + \Gamma ) \sqrt { \epsilon ^ { \prime } } . } \end{array}
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
In the last step we use $\varepsilon ^ { \prime } \leq 1$ . Therefore, if we define the class $\begin{array} { r c c l } { { \mathcal V } _ { \varepsilon } } & { { \triangleq } } & { { \{ ( s , a ) } } & { { \mapsto } } \end{array}$ $\operatorname* { m i n } \{ 1 , f ( \langle \phi ( s , a ) , \theta ^ { \prime } \rangle ) + \gamma ^ { \prime } \left\| \phi ( s , a ) \right\| _ { A ^ { \prime } } : \theta ^ { \prime } \in \Theta _ { \varepsilon } , \gamma \in \Gamma _ { \varepsilon } , A \in \mathcal { M } _ { \varepsilon } \}$ , we know that the covering property is satisfied with parameter $( 1 + K + \Gamma ) \sqrt { \varepsilon ^ { \prime } }$ . Setting $\varepsilon ^ { \prime } = \varepsilon ^ { 2 } / ( 1 + K + \Gamma ) ^ { 2 }$ we have the desired covering property.
|
| 441 |
+
|
| 442 |
+
Finally, we upper bound $\ln { | \gamma _ { \varepsilon } | }$ . By definition, we have that ln $\left| \mathcal { V } _ { \varepsilon } \right| \leq \ln \left| \Theta _ { \varepsilon } \right| + \ln \left| \Gamma _ { \varepsilon } \right| + \ln \left| \mathcal { M } _ { \varepsilon } \right|$ . Furthermore, standard covering number bounds reveals that l $\mathrm { n } | \Theta _ { \varepsilon } | \leq d \mathrm { l n } ( 2 / \varepsilon ^ { \prime } )$ , l $\mathrm { n } | \Gamma _ { \varepsilon } | \leq \mathrm { l n } ( 1 / \varepsilon ^ { \prime } )$ and $\ln | \mathcal { M } _ { \varepsilon } | \leq d ^ { 2 } \ln ( 2 / \varepsilon ^ { \prime } )$ . Plugging in the definition of $\varepsilon ^ { \prime }$ yields the result. □
|
| 443 |
+
|
| 444 |
+
For the next lemma, let $\mathcal { F } _ { t - 1 } \triangleq \sigma ( \{ ( s _ { h , \tau } , a _ { h , \tau } , r _ { h , \tau } ) \} _ { \tau < t } )$ be the filtration induced by all observed trajectories up to but not including time $t$ . Observe that $\bar { Q } . \ l _ { t - 1 }$ and our policy $\hat { \pi } _ { h , t }$ are $\mathcal { F } _ { t - 1 }$ measurable.
|
| 445 |
+
|
| 446 |
+
Lemma 6 (Restatement of Lemma 2). Fix any $1 \leq t \leq T$ and $1 \leq h \leq H$ . Then as long as $\pi _ { t }$ is $\mathcal { F } _ { t - 1 }$ measurable, with probability $1 - 1 / ( T H ) ^ { 2 }$ it holds that
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\Big | f ( \langle \phi ( s , a ) , \widehat { \theta } _ { h , t } \rangle ) - f ( \langle \phi ( s , a ) , \bar { \theta } _ { h , t } \rangle ) \Big | \leq \operatorname* { m i n } \Big \{ 2 , \gamma \| \phi ( s , a ) \| _ { \Lambda _ { h , t } ^ { - 1 } } \Big \} , \quad \quad \forall s , a .
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
$f o r \gamma \ge C K \kappa ^ { - 1 } \sqrt { 1 + M + K + d ^ { 2 } \ln ( ( 1 + K + \Gamma ) T H ) }$ and $0 < C < \infty$ is a universal constant.
|
| 453 |
+
|
| 454 |
+
Note that this is precisely Lemma 2, as $\bar { \theta } _ { h , t }$ is defined as $f ( \langle \phi ( s , a ) , { \bar { \theta } } _ { h , t } ) = { \mathcal { T } } _ { h } ( { \bar { Q } } _ { h + 1 , t } ) ( s , a ) .$
|
| 455 |
+
|
| 456 |
+
Proof. The upper bound of 2 is obvious, since both terms are upper bounded by 1 in absolute value. Therefore we focus on the second term in the minimum. To simplify notation we omit the dependence on $h$ in the subscripts and write $x _ { \tau } , y _ { \tau }$ for $x _ { h , \tau }$ and $y _ { h , \tau }$ . We also abbreviate $\widehat { \theta } \triangleq \widehat { \theta } _ { h , t }$ and $\bar { \theta } \triangleq \bar { \theta } _ { h , t }$ .
|
| 457 |
+
|
| 458 |
+
Since $\begin{array} { r } { \left. \bar { \theta } \right. _ { 2 } \leq 1 } \end{array}$ , the optimality of $\hat { \theta }$ for (1) implies that
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\sum _ { \tau \leq t } \Big ( f \big ( \langle x _ { \tau } , \hat { \theta } \rangle \big ) - y _ { \tau } \Big ) ^ { 2 } \leq \sum _ { \tau \leq t } \big ( f \big ( \langle x _ { \tau } , \bar { \theta } \rangle \big ) - y _ { \tau } \big ) ^ { 2 } .
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
Decomposing the squares and re-organizing the terms, we have that
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\sum _ { \tau \leq t } \Big ( f \big ( \langle x _ { \tau } , \hat { \theta } \rangle \big ) - f \big ( \langle x _ { \tau } , \bar { \theta } \rangle \big ) \Big ) ^ { 2 } \leq 2 | \sum _ { \tau \leq t } \xi _ { \tau } \big ( f \big ( \langle x _ { \tau } , \hat { \theta } \rangle \big ) - f \big ( \langle x _ { \tau } , \bar { \theta } \rangle \big ) ) | ,
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
where $\xi _ { \tau } \triangleq y _ { \tau } - f ( \langle x _ { \tau } , { \bar { \theta } } \rangle )$ . By the fundamental theorem of calculus, we have
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
f ( \langle x _ { \tau } , \hat { \theta } \rangle ) - f ( \langle x _ { \tau } , \bar { \theta } \rangle ) = \int _ { \langle x _ { \tau } , \bar { \theta } \rangle } ^ { \langle x _ { \tau } , \hat { \theta } \rangle } f ^ { \prime } ( s ) \mathrm { d } s = \langle x _ { \tau } , \hat { \theta } - \bar { \theta } \rangle \underbrace { \int _ { 0 } ^ { 1 } f ^ { \prime } ( \langle x _ { \tau } , s \hat { \theta } + ( 1 - s ) \bar { \theta } \rangle ) \mathrm { d } s } _ { \triangleq D _ { \tau } } .
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
Using this identity on both sides of (5), we have that
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
\displaystyle \sum _ { \tau \leq t } D _ { \tau } ^ { 2 } \left( \left. x _ { \tau } , \hat { \theta } - \bar { \theta } \right. \right) ^ { 2 } \leq 2 \left| \displaystyle \sum _ { \tau \leq t } \xi _ { \tau } D _ { \tau } \langle x _ { \tau } , \hat { \theta } - \bar { \theta } \rangle \right| .
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Note also that, by Assumption 1, $D _ { \tau }$ satisfies $\kappa ^ { 2 } \le D _ { \tau } ^ { 2 } \le K ^ { 2 }$ almost surely for all $\tau$ .
|
| 483 |
+
|
| 484 |
+
The difficulty in controlling (6) is that $\bar { \theta }$ itself is a random variable that depends on $\{ ( x _ { \tau } , y _ { \tau } ) \} _ { \tau \leq t }$ . In particular, we want that $\mathbb { E } [ \xi _ { \tau } ~ \vert ~ D _ { \tau } \left. x _ { \tau } , \phi \right. , \mathcal { F } _ { \tau - 1 } ] = 0$ for any fixed $\phi$ , but this is not immediate as $\stackrel { } { \theta }$ depends on $x _ { \tau }$ . To proceed, we eliminate this dependence with a uniform convergence argument. Let $\varepsilon \in ( 0 , 1 )$ be a covering accuracy parameter to be determined later in this proof. Let $\gamma _ { \varepsilon }$ be the pointwise covering for $\mathcal { G } _ { \mathrm { u p } }$ that is implied by Lemma 5. Let $g _ { \varepsilon } \in \mathcal { V } _ { \varepsilon }$ be the approximation for $\bar { Q } _ { h + 1 , t }$ that satisfies (4). By Assumption 2, there exists some $\theta ^ { \sharp } \in { \mathbb { B } } _ { d }$ such that
|
| 485 |
+
|
| 486 |
+
$$
|
| 487 |
+
\forall s , a : f ( \langle \phi ( s , a ) , \theta ^ { \sharp } \rangle ) = \mathbb { E } \left[ r + \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } g _ { \varepsilon } ( s ^ { \prime } , a ^ { \prime } ) \mid s , a \right] .
|
| 488 |
+
$$
|
| 489 |
+
|
| 490 |
+
Now, define $y _ { \tau } ^ { \sharp }$ and $\xi _ { \tau } ^ { \sharp }$ as
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
y _ { \tau } ^ { \sharp } \triangleq x _ { h , \tau } + \operatorname* { m a x } _ { a ^ { \prime } \in A } g _ { \varepsilon } ( s _ { h + 1 , \tau } , a ^ { \prime } ) , \qquad \xi _ { \tau } ^ { \sharp } \triangleq y _ { \tau } ^ { \sharp } - f ( \langle x _ { h , \tau } , \theta ^ { \sharp } \rangle ) .
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
The right-hand side of (6) can then be upper bounded as
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
2 \left| \sum _ { \tau \leq t } \xi _ { \tau } D _ { \tau } \langle x _ { \tau } , \hat { \theta } - \bar { \theta } \rangle \right| \leq 2 \left| \sum _ { \tau \leq t } \xi _ { \tau } ^ { \sharp } D _ { \tau } \langle x _ { \tau } , \hat { \theta } - \bar { \theta } \rangle \right| + \Delta ,
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
where $\begin{array} { r } { | \Delta | \le K t \times \operatorname* { m a x } _ { \tau \le t } | \xi _ { \tau } ^ { \sharp } - \xi _ { \tau } | } \end{array}$ almost surely.
|
| 503 |
+
|
| 504 |
+
Upper bounding $\Delta$ in (7). Fix $\tau \leq t$ . By definition, we have that
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
\begin{array} { r l } & { \left| \xi _ { \tau } ^ { \sharp } - \xi _ { \tau } \right| \leq \left| y _ { \tau } ^ { \sharp } - y _ { \tau } \right| + \left| f ( \langle x _ { \tau } , { \bar { \theta } } \rangle ) - f ( \langle x _ { \tau } , \theta ^ { \sharp } \rangle ) \right| } \\ & { \qquad \leq \underset { a \in { \mathcal { A } } } { \operatorname* { m a x } } \left| g _ { \varepsilon } \big ( s _ { h + 1 , \tau } , a \big ) - { \bar { Q } } _ { h + 1 , t } \big ( s _ { h + 1 , \tau } , a \big ) \right| + K \left\| { \bar { \theta } } - \theta ^ { \sharp } \right\| _ { 2 } } \\ & { \qquad \leq \epsilon + K \epsilon \leq ( K + 1 ) \epsilon , } \end{array}
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
where (8) holds by Lemma 4 and (9) follows from Lemma 5. In particular, the bound on $\left. { \bar { \theta } } - \theta ^ { \sharp } \right. _ { 2 }$ can be verified by expanding the definitions and noting that $g _ { \varepsilon }$ is pointwise close to $\bar { Q } _ { h + 1 , t }$ . Therefore, we have
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
| \Delta | \leq ( K + 1 ) ^ { 2 } t \epsilon .
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
Upper bounding (7). Note that $D _ { \tau }$ is a function of $x _ { \tau } , \ \hat { \theta }$ , and $\bar { \theta }$ . For clarity, we define $\begin{array} { r } { D _ { \tau } ( \theta , \theta ^ { \prime } ) : = \int _ { 0 } ^ { 1 } f ^ { \prime } ( \langle x _ { \tau } , s \theta + ( 1 - s ) \theta ^ { \prime } ) \rangle ) \mathrm { d } s } \end{array}$ . As $| f ^ { \prime \prime } ( z ) | \le M$ for all $| z | \le 1$ and $\| x _ { \tau } \| _ { 2 } \leq 1$ , we have that for every $\theta , \theta ^ { \prime } , \tilde { \theta } , \tilde { \theta } ^ { \prime } \in \mathbb { B } _ { d }$
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array} { r l r } { { \Big | D _ { \tau } ( \theta , \theta ^ { \prime } ) - D _ { \tau } ( \tilde { \theta } , \tilde { \theta } ^ { \prime } ) \Big | \leq \int _ { 0 } ^ { 1 } \Big | f ^ { \prime } \big ( \langle x _ { \tau } , s \theta + ( 1 - s ) \theta ^ { \prime } \rangle \big ) - f ^ { \prime } \big ( \langle x _ { \tau } , s \tilde { \theta } + ( 1 - s ) \tilde { \theta } ^ { \prime } \rangle \big ) \Big | \mathrm { d } s } } \\ & { } & { \leq M \big ( \| \theta - \tilde { \theta } \| _ { 2 } + \| \theta ^ { \prime } - \tilde { \theta } ^ { \prime } \| _ { 2 } \big ) . ~ } \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
Hence, for any $( \theta , \theta ^ { \prime } )$ and $( \tilde { \theta } , \tilde { \theta } ^ { \prime } )$ pairs, we have for every $\tau$ that
|
| 523 |
+
|
| 524 |
+
$$
|
| 525 |
+
\begin{array} { r l } & { \left| \xi _ { \tau } ^ { \sharp } \left. x _ { \tau } , D _ { \tau } ( \theta , \theta ^ { \prime } ) ( \theta - \theta ^ { \prime } ) - D _ { \tau } ( \widetilde { \theta } , \widetilde { \theta } ^ { \prime } ) ( \widetilde { \theta } - \widetilde { \theta } ^ { \prime } ) \right. \right| } \\ & { \leq \left| D _ { \tau } ( \theta , \theta ^ { \prime } ) - D _ { \tau } ( \widetilde { \theta } , \widetilde { \theta } ^ { \prime } ) \right| \times \| \theta - \theta ^ { \prime } \| _ { 2 } + \left| D _ { \tau } ( \widetilde { \theta } , \widetilde { \theta } ^ { \prime } ) \right| \times ( \| \theta - \widetilde { \theta } \| _ { 2 } + \| \theta ^ { \prime } - \widetilde { \theta } ^ { \prime } \| _ { 2 } ) } \\ & { \leq M ( \| \theta - \widetilde { \theta } \| _ { 2 } + \| \theta ^ { \prime } - \widetilde { \theta } ^ { \prime } \| _ { 2 } ) \times 2 + K ( \| \theta - \widetilde { \theta } \| _ { 2 } + \| \theta ^ { \prime } - \widetilde { \theta } ^ { \prime } \| _ { 2 } ) } \\ & { \leq ( 2 M + K ) ( \| \theta - \widetilde { \theta } \| _ { 2 } + \| \theta ^ { \prime } - \widetilde { \theta } ^ { \prime } \| _ { 2 } ) . } \end{array}
|
| 526 |
+
$$
|
| 527 |
+
|
| 528 |
+
Here we are using that $| \xi _ { \tau } | \leq 1$ .
|
| 529 |
+
|
| 530 |
+
We are now in a position to invoke Lemma 8. Consider a fixed function $g _ { \varepsilon }$ , which defines a fixed $\theta ^ { \sharp }$ . We will bound $\begin{array} { r l } { { | \sum _ { \tau \leq t } \xi _ { \tau } ^ { \sharp } \langle x _ { \tau } , D _ { \tau } ( \theta , \theta ^ { \prime } ) ( \theta - \theta ^ { \prime } ) \rangle | } \quad } & { { } } \end{array}$ uniformly over all pairs $( \theta , \theta ^ { \prime } )$ . With $g _ { \varepsilon } , \theta ^ { \sharp }$ fixed and since $\pi _ { t }$ is $\mathcal { F } _ { t - 1 }$ measurable, we have that $\{ x _ { \tau } , \xi _ { \tau } ^ { \sharp } \} _ { \tau \leq t }$ are random variables satisfying $\mathbb { E } [ \xi _ { \tau } ^ { \sharp } \ | \ x _ { 1 : \tau } , \xi _ { 1 : \tau - 1 } ^ { \sharp } ] = 0$ . For $\phi = \left( \theta , \theta ^ { \prime } \right)$ we define the function $q ( x _ { \tau } , \phi ) = \langle x , D _ { \tau } ( \phi ) ( \theta - \theta ^ { \prime } ) \rangle$ , which as we have just calculated satisfies $| q ( x _ { \tau } , \phi ) - q ( x _ { \tau } , \phi ^ { \prime } ) | ~ \leq ~ ( 2 M + K ) \| \phi - \phi ^ { \prime } \| _ { 2 }$ . For $\delta ^ { \prime } \in ( 0 , 1 / 2 )$ with probability $1 - \delta ^ { \prime }$ we have $\forall \phi = ( \theta , \theta ^ { \prime } ) \in \mathbb { B } _ { d } ^ { 2 }$ :
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\begin{array} { r l } & { \displaystyle \left. \sum _ { \tau \le t } \xi _ { \tau } ^ { \sharp } \langle x _ { \tau } , D _ { \tau } ( \phi ) ( \theta - \theta ^ { \prime } ) \rangle \right. \le ( 2 M + K ) + 2 \left( 1 + \sqrt { V ( \phi ) } \right) \sqrt { 2 d \ln ( 4 T ) + \ln ( 1 / \delta ^ { \prime } ) } } \\ & { \le 4 \operatorname* { m a x } \left\{ M + K + \sqrt { 2 d \ln ( 4 T ) + \ln ( 1 / \delta ^ { \prime } ) } , \sqrt { V ( \phi ) } \sqrt { 2 d \ln ( 4 T ) + \ln ( 1 / \delta ^ { \prime } ) } \right\} , } \end{array}
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
where $\begin{array} { r } { V ( \phi ) \triangleq \sum _ { \tau \leq t } \langle x _ { \tau } , D _ { \tau } ( \phi ) ( \theta - \theta ^ { \prime } ) \rangle ^ { 2 } } \end{array}$ . The last inequality holds because $a + b \leq 2 \operatorname* { m a x } \{ a , b \}$ .
|
| 537 |
+
|
| 538 |
+
Next, take a union bound over all $g _ { \varepsilon } \in \mathcal { V } _ { \varepsilon }$ so (11) holds for any $g _ { \varepsilon }$ and any subsequently induced choice of $\xi _ { \tau } ^ { \sharp }$ with probability at least $1 - | \mathcal { V } _ { \varepsilon } | \delta ^ { \prime }$ . In particular, this union bound implies that (11) holds for the choice of $g _ { \varepsilon }$ that approximates $\bar { Q } _ { h + 1 , t }$ . Therefore, combining (6), (7), (10) with (11) for this choice of $g _ { \varepsilon }$ , we have that with probability at least $1 - | \mathcal { V } _ { \varepsilon } | \delta ^ { \prime }$
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
\begin{array} { r l } & { \displaystyle \sum _ { \tau \leq t } D _ { \tau } ^ { 2 } \langle x _ { \tau } , \hat { \theta } - \bar { \theta } \rangle ^ { 2 } \leq 2 \Delta + 2 \left| \displaystyle \sum _ { \tau \leq t } \xi _ { \tau } ^ { \sharp } \langle x _ { \tau } , D _ { \tau } ( \hat { \theta } - \bar { \theta } ) \rangle \right| } \\ & { \leq 2 ( K + 1 ) ^ { 2 } t \varepsilon + 8 \operatorname* { m a x } \left\{ M + K + \sqrt { 2 d \ln ( 4 T ) + \ln ( | \mathcal { V } _ { \varepsilon } | / \delta ^ { \prime } ) } , \sqrt { V ( \hat { \theta } , \bar { \theta } ) } \cdot \sqrt { 2 d \ln ( 4 T ) + \ln ( | \mathcal { V } _ { \varepsilon } | / \delta ^ { \prime } ) } \right\} } \end{array}
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
Observe that the left hand side is precisely $V ( \hat { \theta } , \bar { \theta } )$ . Now, set $\varepsilon = 1 / ( 2 ( K + 1 ) ^ { 2 } T )$ and $\delta ^ { \prime } =$ $1 / ( | \mathcal { V } _ { \varepsilon } | T ^ { 2 } H ^ { 2 } )$ and use the bound on $\ln { | \gamma _ { \varepsilon } | }$ from Lemma 5 to get
|
| 545 |
+
|
| 546 |
+
$$
|
| 547 |
+
\begin{array} { r l } & { \sqrt { 2 d \ln ( 4 T ) + \ln ( | \mathcal { V } _ { \varepsilon } | / \delta ^ { \prime } ) } \leq \sqrt { 2 d \ln ( 4 T ) + 1 2 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) / \varepsilon ) + 2 \ln ( T H ) } } \\ & { \leq \sqrt { 4 d \ln ( 2 T H ) + 2 4 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T ) } \leq \sqrt { 2 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) } } \end{array}
|
| 548 |
+
$$
|
| 549 |
+
|
| 550 |
+
Therefore, we obtain
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\begin{array} { r l r } & { } & { { \boldsymbol \gamma } ( \hat { \theta } , \bar { \theta } ) \leq 1 + 8 \operatorname* { m a x } \bigg \{ M + K + \sqrt { 2 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) } , \sqrt { V ( \hat { \theta } , \bar { \theta } ) } \cdot \sqrt { 2 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) } \bigg \} } \\ & { } & { \leq 1 6 \operatorname* { m a x } \bigg \{ 1 + M + K + \sqrt { 2 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) } , \sqrt { V ( \hat { \theta } , \bar { \theta } ) } \cdot \sqrt { 2 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) } \bigg \} } \end{array}
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
Subsequently,
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
\begin{array} { r l } & { V ( \hat { \theta } , \bar { \theta } ) = { \displaystyle \sum _ { \tau \leq t } } D _ { \tau } ^ { 2 } \langle x _ { \tau } , \hat { \theta } - \bar { \theta } \rangle ^ { 2 } } \\ & { \leq 1 6 \operatorname* { m a x } \Big \{ 1 + M + K + \sqrt { 2 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) } , 4 4 8 d ^ { 2 } \ln ( 2 ( 1 + K + \Gamma ) T H ) \Big \} } \\ & { \leq C _ { V } ^ { 2 } ( 1 + M + K + d ^ { 2 } \ln ( ( 1 + K + \Gamma ) T H ) ) , } \end{array}
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
where $0 < C _ { V } < \infty$ is a universal constant.
|
| 563 |
+
|
| 564 |
+
Next, note that $D _ { \tau } ^ { 2 } \geq \kappa ^ { 2 }$ , thanks to Assumption 1. We then have
|
| 565 |
+
|
| 566 |
+
$$
|
| 567 |
+
\sqrt { ( \hat { \theta } - \bar { \theta } ) ^ { \top } \Lambda _ { h , t } ( \hat { \theta } - \bar { \theta } ) } \leq \kappa ^ { - 1 } \sqrt { V ( \hat { \theta } , \bar { \theta } ) } \leq C _ { V } \kappa ^ { - 1 } \sqrt { 1 + M + K + d ^ { 2 } \ln ( ( 1 + K + \Gamma ) T H ) } ,
|
| 568 |
+
$$
|
| 569 |
+
|
| 570 |
+
where $\begin{array} { r } { \Lambda _ { h , t } = \sum _ { \tau < t } x _ { \tau } , x _ { \tau } ^ { \top } } \end{array}$ . Finally, for any $( s , a )$ pair, invoking Lemma 4 and the Cauchy-Schwarz inequality we have
|
| 571 |
+
|
| 572 |
+
$$
|
| 573 |
+
\begin{array} { r l } & { \left| f ( \langle \phi ( s , a ) , \hat { \theta } \rangle ) - f ( \langle \phi ( s , a ) , \bar { \theta } \rangle ) \right| \leq K \left| \langle \phi ( s , a ) , \hat { \theta } - \bar { \theta } \rangle \right| } \\ & { \leq K \sqrt { ( \hat { \theta } - \bar { \theta } ) ^ { \top } \Lambda _ { h , t } ( \hat { \theta } - \bar { \theta } ) } \times \sqrt { \phi ( s , a ) ^ { \top } \Lambda _ { h , t } ^ { - 1 } \phi ( s , a ) } } \\ & { \leq C _ { V } K \kappa ^ { - 1 } \sqrt { 1 + M + K + d ^ { 2 } \ln ( ( 1 + K + \Gamma ) T H ) } \times \| \phi ( s , a ) \| _ { \Lambda _ { h , t } ^ { - 1 } } } \end{array}
|
| 574 |
+
$$
|
| 575 |
+
|
| 576 |
+
which is to be demonstrated.
|
| 577 |
+
|
| 578 |
+
Corollary 5 (Restatement of Corollary 4). With probability $1 - 1 / ( T H ) , \bar { Q } _ { h , t } ( s , a ) \geq Q _ { h } ^ { \star } ( s , a )$ holds for all $h , t , s , a$ .
|
| 579 |
+
|
| 580 |
+
Proof. Fix $1 \leq t \leq T$ . We use induction on $h$ to prove this corollary. For $h = H { + } 1$ , $\bar { Q } _ { H + 1 , t } ( \cdot , \cdot ) \geq$ $Q _ { H + 1 } ^ { \star } ( \cdot , \cdot )$ clearly holds because $\bar { Q } _ { H + 1 , t } \equiv Q _ { H + 1 } ^ { \star } \equiv 0$ . Now assume that $\bar { Q } _ { h + 1 , t } \geq Q _ { h + 1 } ^ { \star }$ , and let us prove that this is also true for time step $h$ .
|
| 581 |
+
|
| 582 |
+
Since $\bar { Q } _ { h + 1 , t } ( s ^ { \prime } , a ^ { \prime } ) \geq Q _ { h + 1 } ^ { \star } ( s ^ { \prime } , a ^ { \prime } )$ for all $s ^ { \prime } , a ^ { \prime }$ , we have that $f ( \langle \phi ( s , a ) , \bar { \theta } _ { h , t } \rangle ) \geq f ( \langle \phi ( s , a ) , \theta _ { h } ^ { \star } \rangle )$ for all $( s , a )$ pairs. Then, by the definition of $\bar { Q } _ { h , t }$ and Lemma 6, with probability $1 - 1 / ( T H ) ^ { 2 }$ it holds uniformly for all $( s , a )$ pairs that $\bar { Q } _ { h , t } ( s , a ) \ge f ( \langle \phi ( s , a ) , \bar { \theta } _ { h , t } \rangle )$ . Hence, with the same probability, we have $\bar { Q } _ { h , t } ( s , a ) \geq Q _ { h } ^ { \star } ( s , a )$ for all $( s , a )$ pairs. A union bound over all $t \leq T$ and $h \leq H$ completes the proof. □
|
| 583 |
+
|
| 584 |
+
# C TAIL INEQUALITIES
|
| 585 |
+
|
| 586 |
+
Lemma 7 (Azuma’s inequality). Suppose $X _ { 0 } , X _ { 1 } , X _ { 2 } , \cdot \cdot \cdot , X _ { N }$ form $a$ martingale (i.e., $\mathbb { E } [ X _ { k + 1 } | X _ { 1 } , \cdot \cdot \cdot , X _ { k } ] = X _ { k } \bar { ) }$ and satisfy $| X _ { k } - X _ { k - 1 } | \leq c _ { k }$ almost surely. Then for any $\epsilon > 0$ ,
|
| 587 |
+
|
| 588 |
+
$$
|
| 589 |
+
\operatorname* { P r } \left[ \left| X _ { n } - X _ { 0 } \right| \geq \epsilon \right] \leq 2 \exp \left\{ - { \frac { \epsilon ^ { 2 } } { 2 \sum _ { k = 1 } ^ { N } c _ { k } ^ { 2 } } } \right\} .
|
| 590 |
+
$$
|
| 591 |
+
|
| 592 |
+
Lemma 8. Fix $t , D \in { \mathbb { N } } .$ . Let $\{ \xi _ { \tau } , u _ { \tau } \} _ { \tau \leq t }$ be random variables such that $\mathbb { E } [ \xi _ { \tau } | u _ { 1 } , \xi _ { 1 } , \cdot \cdot \cdot , u _ { \tau - 1 } , \xi _ { \tau - 1 } , u _ { \tau } ] \ = \ 0$ and $| \xi _ { \tau } | ~ \le ~ 1$ almost surely. Let $q ~ : ~ ( u , \phi ) \ \mapsto \ \mathbb { R }$ be an arbitrary deterministic function satisfying $| q ( u , \phi ) - q ( u , \phi ^ { \prime } ) | \leq C \| \phi - \phi ^ { \prime } \| _ { 2 }$ for all $u , \phi$ and $\phi ^ { \prime }$ , where $\phi , \phi ^ { j } \in \mathbb { R } ^ { D }$ . Then for any $\delta \in ( 0 , 1 )$ and $R > 0$ ,
|
| 593 |
+
|
| 594 |
+
$$
|
| 595 |
+
\mathfrak { r } _ { \mathrm { T } } \left[ \forall \phi \in \mathbb { B } _ { D } ( R ) : \ \left. \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ) \right. \leq C + 2 \left( 1 + \sqrt { V _ { q } ( \phi ) } \right) \sqrt { D \ln ( 2 t R ) + \ln ( 1 / \delta ) } \right] \geq 1 - \delta ,
|
| 596 |
+
$$
|
| 597 |
+
|
| 598 |
+
where $\mathbb { B } _ { D } ( R ) \triangleq \{ x \in \mathbb { R } ^ { D } : \| x \| _ { 2 } \leq R \}$ and $\begin{array} { r } { V _ { q } ( \phi ) \triangleq \sum _ { \tau \leq t } q ^ { 2 } ( u _ { \tau } , \phi ) } \end{array}$ .
|
| 599 |
+
|
| 600 |
+
Proof. Let $\epsilon > 0$ be a small precision parameter to be specified later. Let $\mathcal { H } \subseteq \mathbb { B } _ { D } ( R )$ be a finite $\epsilon$ - covering of $\mathbb { B } _ { D } ( R )$ such that $\begin{array} { r } { \operatorname* { s u p } _ { x \in \mathbb { B } _ { D } ( R ) } \operatorname* { m i n } _ { z \in \mathcal { H } } \| x - z \| _ { 2 } \leq \epsilon } \end{array}$ . Using standard covering number arguments, such a covering exists with $\ln | \mathcal { H } | \leq D \ln ( 2 R / \epsilon )$ .
|
| 601 |
+
|
| 602 |
+
For any $\phi \in \mathbb { B } _ { D } ( R )$ let $\phi ^ { \prime } \triangleq \operatorname { a r g m i n } _ { z \in \mathcal { H } } \| \phi - z \| _ { 2 }$ . By definition, $\| \phi - \phi ^ { \prime } \| _ { 2 } \leq \epsilon$ . This implies $\begin{array} { r } { \left| \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } [ q ( u _ { \tau } , \phi ) - q ( u _ { \tau } , \phi ^ { \prime } ) ] \right| \leq C t \epsilon } \end{array}$ because $| \xi _ { \tau } | \le 1$ almost surely. Subsequently, for any $\dot { \Delta } > 0$ ,
|
| 603 |
+
|
| 604 |
+
$$
|
| 605 |
+
\begin{array} { r l } & { \operatorname* { P r } \left[ \exists \phi \in \mathbb { B } _ { D } ( R ) : \ \left. \displaystyle \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ) \right. > C t \epsilon + \Delta \right] \le \operatorname* { P r } \left[ \exists \phi ^ { \prime } \in \mathcal { H } : \ \left. \displaystyle \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ^ { \prime } ) \right. > \Delta \right] } \\ & { \le \displaystyle \sum _ { \phi ^ { \prime } \in \mathcal { H } } \operatorname* { P r } \left[ \left. \displaystyle \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ^ { \prime } ) \right. > \Delta \right] , } \end{array}
|
| 606 |
+
$$
|
| 607 |
+
|
| 608 |
+
where the last inequality holds by the union bound.
|
| 609 |
+
|
| 610 |
+
For any fixed $\phi ^ { \prime } \in \mathcal { H }$ , $h ( u _ { \tau } , \phi ^ { \prime } )$ only depends on $u _ { \tau }$ , and therefore $\mathbb { E } [ \xi _ { \tau } \ | \ q ( u _ { \tau } , \phi ^ { \prime } ) ] = 0$ for all $\tau$ . Invoking Lemma 7 with $\begin{array} { r } { X _ { \tau } \triangleq \sum _ { \tau ^ { \prime } \leq \tau } \xi _ { \tau ^ { \prime } } q ( u _ { \tau ^ { \prime } } , \phi ^ { \prime } ) } \end{array}$ and $c _ { \tau ^ { \prime } } = | q ( u _ { \tau ^ { \prime } } , \phi ^ { \prime } ) |$ , we have
|
| 611 |
+
|
| 612 |
+
$$
|
| 613 |
+
\mathrm { P r } \left[ \left| \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ^ { \prime } ) \right| > \Delta \right] \leq 2 \exp \left\{ \frac { - \Delta ^ { 2 } } { 2 \sum _ { \tau \leq t } q ^ { 2 } ( u _ { \tau } , \phi ^ { \prime } ) } \right\} = 2 \exp \left\{ \frac { - \Delta ^ { 2 } } { 2 V _ { q } ( \phi ^ { \prime } ) } \right\}
|
| 614 |
+
$$
|
| 615 |
+
|
| 616 |
+
Equating the right-hand side of the above inequality with $\delta ^ { \prime }$ and combining with the union bound application, we have
|
| 617 |
+
|
| 618 |
+
$$
|
| 619 |
+
\operatorname* { P r } \left[ \exists \phi \in \mathbb { B } _ { d } ( R ) : \ \left| \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } h ( u _ { \tau } , \phi ) \right| > C t \epsilon + \sqrt { 2 V _ { q } ( \phi ^ { \prime } ) \ln ( 2 / \delta ^ { \prime } ) } \right] \leq \delta ^ { \prime } | \mathcal { H } | .
|
| 620 |
+
$$
|
| 621 |
+
|
| 622 |
+
Further equating $\delta ^ { \prime } = \delta / | \mathcal { H } |$ and using the fact that ln $| \mathcal { H } | \le D \ln ( 2 R / \epsilon )$ , we have
|
| 623 |
+
|
| 624 |
+
$$
|
| 625 |
+
\operatorname* { P r } \left[ \exists \phi \in \mathbb { B } _ { d } ( R ) : \ \left| \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ) \right| > C t \epsilon + \sqrt { 2 D V _ { q } ( \phi ^ { \prime } ) \ln ( 2 R / \epsilon ) + 2 V _ { q } ( \phi ^ { \prime } ) \ln ( 1 / \delta ) } \right] \le \delta .
|
| 626 |
+
$$
|
| 627 |
+
|
| 628 |
+
Finally, as $| q ( u _ { \tau } , \phi ^ { \prime } ) - q ( u _ { \tau } , \phi ) | \leq \epsilon$ , we have $V _ { q } ( \phi ^ { \prime } ) \leq 2 V _ { q } ( \phi ) + 2 t \epsilon ^ { 2 }$ and so
|
| 629 |
+
|
| 630 |
+
$$
|
| 631 |
+
\mathrm { ~ \hat { ~ } r ~ } \left[ \exists \phi \in \mathbb { B } _ { D } ( R ) : \ \left| \sum _ { \tau = 1 } ^ { t } \xi _ { \tau } q ( u _ { \tau } , \phi ) \right| > C t \epsilon + 2 \epsilon \sqrt { D t \ln ( 2 R / \epsilon \delta ) } + 2 \sqrt { V _ { q } ( \phi ) ( D \ln ( 2 R / \epsilon ) + \ln ( 1 / \delta ) ) } \right] .
|
| 632 |
+
$$
|
| 633 |
+
|
| 634 |
+
Setting $\epsilon = 1 / t$ in the above inequality completes the proof.
|
md/train/DfGu8WwT0d/DfGu8WwT0d.md
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Large Scale Learning on Non-Homophilous Graphs: New Benchmarks and Strong Simple Methods
|
| 2 |
+
|
| 3 |
+
Derek Lim⇤ Cornell University dl772@cornell.edu
|
| 4 |
+
|
| 5 |
+
Felix Hohne⇤ Cornell University fmh42@cornell.edu
|
| 6 |
+
|
| 7 |
+
Xiuyu Li⇤ Cornell University xl289@cornell.edu
|
| 8 |
+
|
| 9 |
+
Sijia Linda Huang Cornell University sh837@cornell.edu
|
| 10 |
+
|
| 11 |
+
Vaishnavi Gupta Cornell University vg222@cornell.edu
|
| 12 |
+
|
| 13 |
+
Omkar Bhalerao Cornell University opb7@cornell.edu
|
| 14 |
+
|
| 15 |
+
Ser-Nam Lim Facebook AI sernam@gmail.com
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Many widely used datasets for graph machine learning tasks have generally been homophilous, where nodes with similar labels connect to each other. Recently, new Graph Neural Networks (GNNs) have been developed that move beyond the homophily regime; however, their evaluation has often been conducted on small graphs with limited application domains. We collect and introduce diverse nonhomophilous datasets from a variety of application areas that have up to $3 8 4 \mathrm { x }$ more nodes and 1398x more edges than prior datasets. We further show that existing scalable graph learning and graph minibatching techniques lead to performance degradation on these non-homophilous datasets, thus highlighting the need for further work on scalable non-homophilous methods. To address these concerns, we introduce LINKX — a strong simple method that admits straightforward minibatch training and inference. Extensive experimental results with representative simple methods and GNNs across our proposed datasets show that LINKX achieves state-ofthe-art performance for learning on non-homophilous graphs. Our codes and data are available at https://github.com/CUAI/Non-Homophily-Large-Scale.
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
Graph learning methods generate predictions by leveraging complex inductive biases captured in the topology of the graph [7]. A large volume of work in this area, including graph neural networks (GNNs), exploits homophily as a strong inductive bias, where connected nodes tend to be similar to each other in terms of labels [46, 3]. Such assumptions of homophily, however, do not always hold true. For example, malicious node detection, a key application of graph machine learning, is known to be non-homophilous in many settings [55, 13, 25, 11].
|
| 24 |
+
|
| 25 |
+
Further, while new GNNs that work better in these non-homophilous settings have been developed [82, 44, 81, 17, 15, 73, 36, 35, 9, 54], their evaluation is limited to a few graph datasets used by Pei et al. [58] (collected by [61, 66, 48]) that have certain undesirable properties such as small size, narrow range of application areas, and high variance between different train/test splits $[ \textcircled { 8 2 } ]$ Consequently, method scalability has not been thoroughly studied in non-homophilous graph learning. In fact, many non-homophilous techniques frequently require more parameters and computational resources [82, 1, 17], which is neither evident nor detrimental when they are evaluated on very small datasets. Even though scalable graph learning techniques do exist, these methods generally cannot be directly applied to the non-homophilous setting, as they oftentimes assume homophily in their construction $\boxed { \boxed { 7 1 } \boxed { 3 2 } \boxed { 2 0 } \boxed { 1 0 } }$ .
|
| 26 |
+
|
| 27 |
+
Non-homophily in graphs also degrades proven graph learning techniques that have been instrumental to strong performance in scalable graph learning. For instance, label propagation, personalized PageRank, and low-pass graph filtering have been used for scalable graph representation learning models, but these methods all assume homophily [71, 32, 20, 10]. Moreover, we give empirical evidence that existing minibatching techniques in graph learning [16, $\textcircled { 7 7 }$ significantly degrade performance in non-homophilous settings. In response, we develop a novel model, LINKX, that addresses these concerns; LINKX outperforms existing graph learning methods on large-scale nonhomophilous datasets and admits a simple minibatching procedure that maintains strong performance.
|
| 28 |
+
|
| 29 |
+
To summarize, we demonstrate three key areas of deficiency as mentioned above, namely: (1) that there is a lack of large, high-quality datasets covering different non-homophilous applications, (2) that current graph minibatching techniques and scalable methods do not work well in non-homophilous settings, and (3) that prior non-homophilous methods are not scalable. To these ends, this paper makes the following contributions:
|
| 30 |
+
|
| 31 |
+
Dataset Collection and Benchmarking. We collect a diverse series of large, non-homophilous graph datasets and define new node features and tasks for classification. These datasets are substantially larger than previous non-homophilous datasets, span wider application areas, and capture different types of complex label-topology relationships. With these proposed datasets, we conduct extensive experiments with 14 graph learning methods and 3 graph minibatching techniques that are broadly representative of the graph machine learning model space.
|
| 32 |
+
|
| 33 |
+
Analyzing Scalable Methods and Minibatching. We analyze current graph minibatching techniques like GraphSAINT $\mathbb { [ [ \overline { { \mathsf { Z } } } ] ] }$ in non-homophilous settings, showing that they substantially degrade performance in experiments. Also, we show empirically that scalable methods for graph learning like SGC and C&S [71, 32] do not perform well in non-homophilous settings — even though they achieve state-of-the-art results on many homophilous graph benchmarks. Finally, we demonstrate that existing non-homophilous methods often suffer from issues with scalability and performance in large non-homophilous graphs, in large part due to a lack of study of large-scale non-homophilous graph learning.
|
| 34 |
+
|
| 35 |
+
LINKX: a strong, simple method. We propose a simple method LINKX that achieves excellent results for non-homophilous graphs while overcoming the above-mentioned minibatching issues. LINKX works by separately embedding the adjacency A and node features $\mathbf { X }$ , then combining them with multilayer perceptrons and simple transformations, as illustrated in Figure $^ { 1 . }$ It generalizes node feature MLP and LINK regression $\textcircled { 1 7 9 }$ , two baselines that often work well on non-homophilous graphs. This method is simple to train and evaluate in a minibatched fashion, and does not face the performance degradation that other methods do in the minibatch setting. We develop the model and give more details in Section 4.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Our model LINKX separately embeds node features and adjacency information with MLPs, combines the embeddings together by concatenation, then uses a final MLP to generate predictions.
|
| 39 |
+
|
| 40 |
+
# 2 Prior Work
|
| 41 |
+
|
| 42 |
+
Graph Representation Learning. Graph neural networks $\textcircled { 1 2 8 } , \textcircled { 3 8 } , \textcircled { 6 9 }$ have demonstrated their utility on a variety of graph machine learning tasks. Most GNNs are constructed by stacking layers that propagate transformed node features, which are then aggregated via different mechanisms. The neighborhood aggregation used in many existing GNNs implicitly leverage homophily, so they often fail to generalize on non-homophilous graphs $\boxed { 8 2 } \boxed { 6 }$ . Indeed, a wide range of GNNs operate as low-pass graph filters $\pm \pm \pm \pm \pm \pm \pm \pm \pm \pm \pm \pm$ that smooth features over the graph topology, which produces similar representations and thus similar predictions for neighboring nodes.
|
| 43 |
+
|
| 44 |
+
Scalable methods. A variety of scalable graph learning methods have been developed for efficient computation in larger datasets [77, 16, 75, 28, 71, 32, 20, 10]. Many of these methods explicitly make use of an assumption of homophily in the data [71, 32, 20, 10]. By leveraging this assumption, several simple, inexpensive models are able to achieve state-of-the-art performance on homophilic datasets [71, 32]. However, these methods are unable to achieve comparable performance in non-homophilous settings, as we show empirically in Section 5.
|
| 45 |
+
|
| 46 |
+
Graph sampling. As node representations depend on other nodes in the graph, there are no simple minibatching techniques in graph learning as there are for i.i.d. data. To scale to large graphs, one line of work samples nodes that are used in each layer of a graph neural network $\overline { { \| 2 8 \| } } \widetilde { \bigtriangledown } \widetilde { \| 4 \| }$ . Another family of methods samples subgraphs of an input graph, then passes each subgraph through a GNN to make a prediction for each node of the subgraph [16, 76, 77]. While these methods are useful for scalable graph learning, we show that they substantially degrade performance in our non-homphilous experiments (see Section 5)
|
| 47 |
+
|
| 48 |
+
Non-Homophilous methods. Various GNNs have been proposed to achieve higher performance in low-homophily settings [82, 44, 81, 17, 15, 73, 36, 35]. Geom-GCN $\left[ \left[ 5 8 \right] \right]$ introduces a geometric aggregation scheme, MixHop [1] proposes a graph convolutional layer that mixes powers of the adjacency matrix, GPR-GNN [17] features learnable weights that can be positive and negative in feature propagation, GCNII [15] allows deep graph convolutional networks with relieved oversmoothing, which empirically performs better in non-homophilous settings, and $\mathrm { H } _ { 2 } \mathrm { G C N }$ $\pmb { \Vert 8 2 \Vert }$ shows that separation of ego and neighbor embeddings, aggregation in higher-order neighborhoods, and the combination of intermediate representations improves GNN performance in low-homophily.
|
| 49 |
+
|
| 50 |
+
There are several recurring design decisions across these methods that appear to strengthen performance in non-homophilous settings: using higher-order neighborhoods, decoupling neighbor information from ego information, and combining graph information at different scales $[ \bar { 8 2 } ] $ . Many of these design choices require additional overhead (see Section $4 . 3 )$ , thus reducing their scalability.
|
| 51 |
+
|
| 52 |
+
Datasets. The widely used citation networks Cora, Citeseer, and Pubmed $[ [ 6 2 , 7 4 ]$ are highly homophilous (see Appendix $\mathbf { A } )$ $\pmb { \Vert 8 2 \Vert }$ . Recently, the Open Graph Benchmark [31] has provided a series of datasets and leaderboards that improve the quality of evaluation in graph representation learning; however, most of the node classification datasets tend to be homophilous, as noted in past work $\lVert \tilde { \otimes } 2 \rVert$ and expanded upon in Appendix $\boxed { \mathbf { A } . 2 }$ A comparable set of high-quality benchmarks to evaluate non-homophilous methods does not currently exist.
|
| 53 |
+
|
| 54 |
+
# 3 Datasets for Non-Homophilous Graph Learning
|
| 55 |
+
|
| 56 |
+
# 3.1 Currently Used Datasets
|
| 57 |
+
|
| 58 |
+
The most widely used datasets to evaluate non-homophilous graph representation learning methods were used by Pei et al. $\left[ \left[ 5 8 \right] \right]$ (and collected by [61, 66, 48]); see our Table $^ 1$ for statistics. However, these datasets have fundamental issues. First, they are very small — the Cornell, Texas, and Wisconsin datasets have between 180-250 nodes, and the largest dataset Actor has 7,600 nodes. In analogy to certain pitfalls of graph neural network evaluation on small (homophilic) datasets discussed in $\overline { { \mathbb { B } 3 } } \|$ , evaluation on the datasets of Pei et al. $ { \mathbb { B } } { \mathbb { B } }$ is plagued by high variance across different train/test splits (see results in $\mathbb { \lVert 8 2 \rVert }$ ). The small size of these datasets may tend to create models that are more prone to overfitting $\pmb { \mathbb { D } } \mathbf { 1 } \mathbf { h }$ , which prevents the scaling up of GNNs designed for non-homophilous settings.
|
| 59 |
+
|
| 60 |
+
Peel $ { \mathbb { B } } 5 7 { \mathbb { I } }$ also studies node classification on network datasets with various types of relationships between edges and labels. However, they only study methods that act on graph topology, and thus their datasets do not necessarily have node features. We take inspiration from their work, by testing on Pokec and Facebook networks with node features that we define, and by introducing other year-prediction tasks on citation networks that have node features.
|
| 61 |
+
|
| 62 |
+
# 3.2 An Improved Homophily Measure
|
| 63 |
+
|
| 64 |
+
Various metrics have been proposed to measure the homophily of a graph. However, these metrics are sensitive to the number of classes and the number of nodes in each class. Let $G = ( V , E )$ be a graph with $n$ nodes, none of which are isolated. Further let each node $u \in V$ have a class label $k _ { u } \in \{ 0 , 1 , \ldots , C - 1 \}$ for some number of classes $C$ , and denote by $C _ { k }$ the set of nodes in class $k$ . The edge homophily $\lVert 8 2 \rVert$ is the proportion of edges that connect two nodes of the same class:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
h = { \frac { | \{ ( u , v ) \in E : k _ { u } = k _ { v } \} | } { | E | } } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Another related measure is what we call the node homophily $\begin{array} { r l } { \mathrm { \bf \delta } } & { { } \| \boldsymbol { \bar { 5 } } \mathrm { \bf { 8 } } \| } \end{array}$ , defined as $\begin{array} { r } { \frac { 1 } { \vert V \vert } \sum _ { u \in V } \frac { d _ { u } ^ { ( k _ { u } ) } } { d _ { u } } } \end{array}$ , in which $d _ { u }$ is the number of neighbors of node $u$ , and $d _ { u } ^ { ( k _ { u } ) }$ is the number of neighbors of $u$ that have the same class label. We focus on the edge homophily $\mathbb { \underline { { ( 1 ) } } }$ in this work, but find that node homophily tends to have similar qualitative behavior in experiments.
|
| 71 |
+
|
| 72 |
+
The sensitivity of edge homophily to the number of classes and size of each class limits its utility. We consider a null model for graphs in which the graph topology is independent of the labels; suppose that nodes with corresponding labels are fixed, and include edges uniformly at random in the graph that are independent of node labels. Under this null model, a node $u \in V$ would be expected to have $d _ { u } ^ { ( k _ { u } ) } / d _ { u } \approx | C _ { k _ { u } } | / n$ as the proportion of nodes of the same class that they connect to $\mathbb { \left[ 3 \right] }$ . For a dataset with $C$ balanced classes, we would thus expect the edge homophily to be around $\textstyle { \frac { 1 } { C } }$ , so the interpretation of the measure depends on the number of classes. Also, if classes are imbalanced, then the edge homophily may be misleadingly large. For instance, if $9 9 \%$ of nodes were of one class, then most edges would likely be within that same class, so the edge homophily would be high, even when the graph is generated from the null model where labels are independent of graph topology. Thus, the edge homophily does not capture deviation of the label distribution from the null model.
|
| 73 |
+
|
| 74 |
+
We introduce a metric that better captures the presence or absence of homophily. Unlike the edge homophily, our metric measures excess homophily that is not expected from the above null model where edges are randomly wired. Our metric does not distinguish between different non-homophilous settings (such as heterophily or independent edges); we believe that there are too many degrees of freedom in non-homophilous settings for a single scalar quantity to be able to distinguish them all. Our measure is given as:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\hat { h } = \frac { 1 } { C - 1 } \sum _ { k = 0 } ^ { C - 1 } \left[ h _ { k } - \frac { | C _ { k } | } { n } \right] _ { + } ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $[ a ] _ { + } = \operatorname* { m a x } ( a , 0 )$ , and $h _ { k }$ is the class-wise homophily metric
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
h _ { k } = \frac { \sum _ { u \in C _ { k } } d _ { u } ^ { ( k _ { u } ) } } { \sum _ { u \in C _ { k } } d _ { u } } .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Note that $\hat { h } \in [ 0 , 1 ]$ , with a fully homophilous graph (in which every node is only connected to nodes of the same class) having $\hat { h } = 1$ . Since each class-wise homophily metric $h _ { k }$ only contributes positive deviations from the null expected proportion $| C _ { k } | / n$ , the class-imbalance problem is substantially mitigated. Also, graphs in which edges are independent of node labels are expected to have $\hat { h } \approx 0$ , for any number of classes. Our measure $\hat { h }$ measures presence of homophily, but does not distinguish between the many types of possibly non-homophilous relationships. This is reasonable given the diversity of non-homophilous relationships. For example, non-homophily can imply independence of edges and classes, extreme heterophily, connections only among subsets of classes, or certain chemically / biologically determined relationships. Indeed, these relationships are very different, and are better captured by more than one scalar quantity, such as the compatibility matrices presented in the appendix. Further discussion is given in Appendix A.
|
| 87 |
+
|
| 88 |
+
Table 1: Statistics for previously used datasets from Pei et al. $\pmb { \Vert 5 8 \Vert }$ (collected by [61, 66, 48]). #C is the number of node classes. The highest number of nodes or edges overall are bolded.
|
| 89 |
+
|
| 90 |
+
<table><tr><td>Dataset</td><td># Nodes</td><td>#Edges</td><td>#Feat.</td><td>#C</td><td>Context</td><td>Edge hom.</td><td>h (ours)</td></tr><tr><td>Chameleon</td><td>2,277</td><td>36,101</td><td>2,325</td><td>5</td><td>Wiki pages</td><td>.23</td><td>.062</td></tr><tr><td>Cornell</td><td>183</td><td>295</td><td>1,703</td><td>5</td><td>Web pages</td><td>.30</td><td>.047</td></tr><tr><td>Actor</td><td>7,600</td><td>29,926</td><td>931</td><td>5</td><td>Actors in movies</td><td>.22</td><td>.011</td></tr><tr><td>Squirrel</td><td>5,201</td><td>216,933</td><td>2.089</td><td>5</td><td>Wiki pages</td><td>.22</td><td>.025</td></tr><tr><td>Texas</td><td>183</td><td>309</td><td>1,703</td><td>5</td><td>Web pages</td><td>.11</td><td>.001</td></tr><tr><td>Wisconsin</td><td>251</td><td>499</td><td>1,703</td><td>5</td><td>Web pages</td><td>.21</td><td>.094</td></tr></table>
|
| 91 |
+
|
| 92 |
+
# 3.3 Proposed Datasets
|
| 93 |
+
|
| 94 |
+
Here, we detail the non-homophilous datasets that we propose for graph machine learning evaluation. Our datasets and tasks span diverse application areas. Penn94 [67], Pokec [41], genius [43], and twitch-gamers $[ [ 6 0 ] ]$ are online social networks, where the task is to predict reported gender, certain account labels, or use of explicit content on user accounts. For the citation networks arXiv-year [31] and snap-patents [42, 41] the goal is to predict year of paper publication or the year that a patent is granted. The dataset wiki consists of Wikipedia articles, where the goal is to predict total page views of each article. Detailed descriptions about the graph structure, node features, node labels, and licenses of each dataset are given in Appendix D.2.
|
| 95 |
+
|
| 96 |
+
Most of these datasets have been used for evaluation of graph machine learning models in past work; we make adjustments such as modifying node labels and adding node features that allow for evaluation of GNNs in non-homophilous settings. We define node features for Pokec, genius, and snap-patents, and we also define node labels for arXiv-year, snap-patents, and genius. Additionally, we crawl and clean the large-scale wiki dataset — a new Wikipedia dataset where the task is to predict page views, which is non-homophilous with respect to the graph of articles connected by links between articles (see Appendix $\mathbf { D } . { \dot { 3 } } )$ . This wiki dataset has 1,925,342 nodes and 303,434,860 edges, so training and inference require scalable algorithms.
|
| 97 |
+
|
| 98 |
+
Basic dataset statistics are given in Table 2. Note the substantial difference between the size of our datasets and those of Pei et al. [58] in Table 1; our datasets have up to $3 8 4 \mathrm { x }$ more nodes and $1 3 9 8 \mathrm { x }$ more edges. The homophily measures along with the lower empirical performance of homophilyassuming models (Section $\dot { 5 } _ { , }$ and examination of compatibility matrices (Appendix $\boxed { \mathrm { A } }$ show that our datasets are indeed non-homophilous. As there is little study in large-scale non-homophilous graph learning, our proposed large datasets strongly motivate the need for developing a new, scalable approach that can accurately learn on non-homophilous graphs.
|
| 99 |
+
|
| 100 |
+
Table 2: Statistics of our proposed non-homophilous graph datasets. # C is the number of distinct node classes. Note that our datasets come from more diverse applications areas and are much larger than those shown in Table 1, with up to 384x more nodes and $1 3 9 8 \mathrm { x }$ more edges.
|
| 101 |
+
|
| 102 |
+
<table><tr><td>Dataset</td><td>#Nodes</td><td>#Edges</td><td>#Feat.</td><td>#C</td><td>Class types</td><td>Edge hom.</td><td>h (ours)</td></tr><tr><td>Penn94</td><td>41,554</td><td>1,362,229</td><td>5</td><td>2</td><td>gender</td><td>.470</td><td>.046</td></tr><tr><td>pokec</td><td>1,632,803</td><td>30,622,564</td><td>65</td><td>2</td><td>gender</td><td>.445</td><td>.000</td></tr><tr><td>arXiv-year</td><td>169,343</td><td>1,166,243</td><td>128</td><td>5</td><td> pub year</td><td>.222</td><td>.272</td></tr><tr><td>snap-patents</td><td>2,923,922</td><td>13,975,788</td><td>269</td><td>5</td><td>time granted</td><td>.073</td><td>.100</td></tr><tr><td>genius</td><td>421,961</td><td>984,979</td><td>12</td><td>2</td><td>marked act.</td><td>.618</td><td>.080</td></tr><tr><td>twitch-gamers</td><td>168,114</td><td>6,797,557</td><td>7</td><td>2</td><td>mature content</td><td>.545</td><td>.090</td></tr><tr><td>wiki</td><td>1,925,342</td><td>303,434,860</td><td>600</td><td>5</td><td>views</td><td>.389</td><td>.107</td></tr></table>
|
| 103 |
+
|
| 104 |
+
# 4 LINKX: A New Scalable Model
|
| 105 |
+
|
| 106 |
+
In this section, we introduce our novel model, LINKX, for scalable node classification in nonhomophilous settings. LINKX is built out of multilayer perceptrons (MLPs) and linear transformations, thus making it simple and scalable. It also admits simple row-wise minibatching procedures that allow it to perform well on large non-homophilous graphs. As a result, LINKX is able to circumvent aforementioned issues of graph minibatching and non-homophilous GNNs in large-scale non-homophilous settings.
|
| 107 |
+
|
| 108 |
+
# 4.1 Motivation from two simple baselines
|
| 109 |
+
|
| 110 |
+
Here, we detail two simple baselines for node classification that we build on to develop LINKX.
|
| 111 |
+
|
| 112 |
+
MLP on node features. A naïve method for node classification is to ignore the graph topology and simply train an MLP on node features. For the same reason that the graph topology has more complicated relationships with label distributions in non-homophilous graphs, many GNNs are not able to effectively leverage the graph topology in these settings. Thus, MLPs can actually perform comparatively well on non-homophilous graphs — achieving higher or approximately equal performance to various GNNs $\pmb { \Vert 8 2 \Vert }$ .
|
| 113 |
+
|
| 114 |
+
LINK regression on graph topology. On the other extreme, there is LINK $\left[ \left[ 7 9 \right] \right]$ — a simple baseline that only utilizes graph topology. In particular, we consider LINK regression, which trains a logistic regression model in which each node’s features are taken from a column of the adjacency matrix. Letting $\mathbf { A } \in \{ 0 , 1 \} ^ { n \times n }$ be the binary adjacency matrix of the graph, and $\mathbf { W } \in \mathbb { R } ^ { c \hat { \times } n }$ be a learned weight matrix, LINK computes class probabilities as
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbf { Y } = \operatorname { s o f t m a x } ( \mathbf { W } \mathbf { A } ) .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Let $u \in \{ 1 , \ldots , n \}$ be a specific node, and let $k \in \{ 1 , \ldots , c \}$ be a specific class. Then, expanding the matrix multiplication, the log-odds of node $u$ belonging to class $k$ is given by
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
( \mathbf { W } \mathbf { A } ) _ { k u } = \sum _ { v \in \mathcal { N } ( u ) } \mathbf { W } _ { k v } ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\mathcal { N } ( u )$ contains the 1-hop neighbors of $u$ . In other words, the logit is given by the sum of weights $\mathbf { W } _ { k v }$ across the 1-hop neighbors of $u$ . If a specific node $v$ has many neighbors of class $k$ , then $\mathbf { W } _ { k v }$ is probably large, as we would expect with a high probability that any neighbor of $v$ is of class $k$ . In this sense, LINK is like a 2-hop method: for a given node $u$ , the probability of being in a given class is related to the class memberships of $u$ ’s 2-hop neighbors in $\bar { \mathcal { N } } ( v )$ for each neighbor $v \in \mathcal { N } ( u )$ . Related interpretations of LINK as a method acting on 2-hop paths between nodes are given by Altenburger and Ugander $\pmb { \mathbb { B } } \|$ .
|
| 127 |
+
|
| 128 |
+
Though it is simple and has been overlooked in the recent non-homophilous GNN literature, LINK has been found to perform well in certain node classification tasks like gender prediction in social networks $\mathbb { B } \mathbb { H }$ . A major reason why LINK does well in many settings is exactly because it acts as a 2-hop method. For example, while 1-hop neighbors are often not so informative for gender prediction in social networks due to lack of homophily, 2-hop neighbors are very informative due to so-called “monophily,” whereby many nodes have extreme preferences for connecting to a certain class $\pmb { \mathbb { B } } \|$ . Beyond just gender prediction, we show in Section $\boxed { 5 }$ that LINK empirically outperforms many models across the various application areas of the non-homophilous datasets we propose.
|
| 129 |
+
|
| 130 |
+
# 4.2 LINKX
|
| 131 |
+
|
| 132 |
+
We combine these two simple baselines through simple linear transformations and component-wise nonlinearities. Let $\mathbf { X } \in \mathbb { R } ^ { \boldsymbol { \hat { D } \times n } }$ denote the matrix of node features with input dimension $D$ , and let $\left[ \mathbf { h } _ { 1 } ; \mathbf { h } _ { 2 } \right]$ denote concatenation of vectors $\mathbf { h } _ { 1 }$ and $\mathbf { h } _ { 2 }$ . Then our model outputs predictions $\mathbf { Y }$ through the following mapping:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { r l } & { \mathbf { h } _ { \mathbf { A } } = \mathrm { M L P } _ { \mathbf { A } } ( \mathbf { A } ) \in \mathbb { R } ^ { d \times n } } \\ & { \mathbf { h } _ { \mathbf { X } } = \mathrm { M L P } _ { \mathbf { X } } ( \mathbf { X } ) \in \mathbb { R } ^ { d \times n } } \\ & { \mathbf { Y } = \mathrm { M L P } _ { f } \left( \sigma \left( \mathbf { W } [ \mathbf { h } _ { \mathbf { A } } ; \mathbf { h } _ { \mathbf { X } } ] + \mathbf { h } _ { \mathbf { A } } + \mathbf { h } _ { \mathbf { X } } \right) \right) , } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
in which $d$ is the hidden dimension, $\mathbf { W } \in \mathbb { R } ^ { d \times 2 d }$ is a weight matrix, and $\sigma$ is a component-wise nonlinearity (which we take to be ReLU). We call our model LINKX, as it extends LINK with node feature information from the matrix $\mathbf { X }$ . A diagram of LINKX is given in Figure 1.
|
| 139 |
+
|
| 140 |
+
First, LINKX computes hidden representations $\mathbf { h _ { A } }$ of the adjacency (extending LINK) and $\mathbf { h } _ { \mathbf { X } }$ of the feature matrix (as in node-feature MLPs). Then it combines these hidden representations through a linear transform W of their concatenation, with skip connections that add back in $\mathbf { h _ { A } }$ and $\mathbf { h } _ { \mathbf { X } }$ to better preserve pure adjacency or node feature information. Finally, it puts this combined representation through a non-linearity and another MLP to make a prediction.
|
| 141 |
+
|
| 142 |
+
Separating then mixing adjacency and feature information. LINKX separately embeds the adjacency A to $\mathbf { h _ { A } }$ and the features $\mathbf { X }$ into $\mathbf { h } _ { \mathbf { X } }$ before mixing them for a few reasons. First, we note that this design is reminiscent of fusion architectures in multimodal networks, where data from different modalities are processed and combined in a neural network $\underline { { [ 2 4 , 7 8 ] } }$ . In our setting, we can view adjacency information and node feature information as separate modalities. Since node feature MLPs and LINK do well independently on different datasets, this allows us to preserve their individual performance if needed. Ignoring $\mathbf { h } _ { \mathbf { X } }$ information is similar to just using LINK, and ignoring $\mathbf { h _ { A } }$ information is just using an node feature MLP. Still, to preserve the ability to just learn a similar mapping to LINK or to a node feature MLP, we find that having the additive skip connections helps to get performance at least as good as either baseline. Our initial empirical results showed that simply concatenating adjacency and node features as input to a network does worse overall empirically (see Appendix $\checkmark$
|
| 143 |
+
|
| 144 |
+
There are also computational benefits to our design choices. Embedding A is beneficial for depth as adding more layers to the MLPs only gives an $\mathcal { O } ( \bar { d } ^ { 2 } )$ cost — depending only on the hidden dimension $d$ — and thus does not scale in the number of edges $| E |$ as when adding layers to message-passing GNNs. This is because the graph information in $\mathbf { A }$ is already compressed to hidden feature vectors after the first linear mapping of $\mathrm { M L P } _ { \mathbf { A } }$ , and we do not need to propagate along the graph in later steps. Moreover, this enables a sparse-dense matrix product to compute the first linear mapping of $\mathrm { M L P } _ { \mathbf { A } }$ on A, which greatly increases efficiency as $\mathbf { A }$ is typically very sparse for real-world graphs. Separate embeddings are key here, as this would not be possible if we for instance concatenated A and $\mathbf { X }$ when $\mathbf { X }$ is large and dense.
|
| 145 |
+
|
| 146 |
+
Simple minibatching. Message-passing GNNs must take graph topology into account when minibatching with techniques such as neighbor sampling, subgraph sampling, or graph partitioning. However, LINKX does not require this, as it utilizes graph information solely through defining adjacency matrix columns as features. Thus, we can train LINKX with standard stochastic gradient descent variants by taking i.i.d. samples of nodes along with the corresponding columns of the adjacency and feature matrix as features. This is much simpler than the graph minibatching procedures for message-passing GNNs, which require specific hyperparameter choices, have to avoid exponential blowup of number of neighbors per layer, and are generally more complex to implement $\mathbb { \ m }$ . In Section $\left\lceil 5 . 3 \right\rceil$ we use the simple LINKX minibatching procedure for large-scale experiments that show that LINKX with this minibatching style outperforms GNNs with graph minibatching methods. This is especially important on the scale of the wiki dataset, where none of our tested methods — other than MLP — is capable of running on a Titan RTX GPU with 24 GB GPU RAM (see Section $\textcircled { 5 }$ .
|
| 147 |
+
|
| 148 |
+
# 4.3 Complexity Analysis
|
| 149 |
+
|
| 150 |
+
Using the above notation, a forward pass of LINKX has a time complexity of $\mathcal { O } \left( d \vert E \vert + n d ^ { 2 } L \right)$ , in which $d$ is the hidden dimension (which we assume to be on the same order as the input feature dimension $D$ ), $L$ is the number of layers, $n$ is the number of nodes, and $| E |$ is the number of edges. We require a $\mathcal { O } ( d \vert E \vert )$ cost for the first linear mapping of $\mathbf { A }$ and a $\mathcal { O } ( d ^ { 2 } )$ cost per layer for MLP operations on hidden features, for $L$ total layers and each of $n$ nodes.
|
| 151 |
+
|
| 152 |
+
As mentioned above, message passing GNNs have to propagate using the adjacency in each layer, so they have an $L | E |$ term in the complexity. For instance, an $L$ -layer GCN $\pmb { \Vert 3 8 \Vert }$ with $d$ hidden dimensions has $\dot { \mathcal { O } } ( d \dot { L } \vert E \vert + n d ^ { 2 } L )$ complexity, as it costs $\mathcal { O } ( d \vert E \vert )$ to propagate features in each layer, and $\mathcal { O } ( n d ^ { 2 } )$ to multiply by the weight matrix in each layer.
|
| 153 |
+
|
| 154 |
+
Non-homophilous methods often make modifications to standard architectures that increase computational cost, such as using higher-order neighborhoods or using additional hidden embeddings $\mathbf { \widehat { \| 8 2 \| } }$ . For instance, the complexity of MixHop $\mathbb { I I }$ is $\mathcal { O } ( K ( d L \vert E \vert + n d ^ { 2 } L ) )$ , which has an extra factor $K$ that is the number of adjacency powers to propagate with. The complexity of GCNII $\mathbb { \left. \overline { { 1 5 } } \right. }$ i s asymptotically the same as that of GCN, but in practice it requires more computations per layer due to residual connections and linear combinations, and it also often achieves best performance with a large number of layers $L$ . $\mathrm { H } _ { 2 } \mathrm { G C N }$ $\pmb { \Vert 8 2 \Vert }$ is significantly more expensive due to its usage of strict two-hop neighborhoods, which requires it to form the squared adjacency ${ \bf A } ^ { 2 }$ . This makes the memory requirements intractable even for medium sized graphs (see Section $\textcircled { 5 }$
|
| 155 |
+
|
| 156 |
+
# 5 Experiments
|
| 157 |
+
|
| 158 |
+
We conduct two sets of experiments for node classification on our proposed non-homophilous datasets. One set of experiments does full batch gradient descent training for all applicable methods. This of course limits the size of each model, as the large datasets require substantial GPU memory to train on. Our other set of experiments uses minibatching methods. As all graph-based methods run out of memory on the wiki dataset, even on 24 GB GPUs, we only include wiki results in the minibatching section. In all settings, our LINKX model matches or outperforms other methods.
|
| 159 |
+
|
| 160 |
+
Table 3: Experimental results. Test accuracy is displayed for most datasets, while genius displays test ROC AUC. Standard deviations are over 5 train/val/test splits. The three best results per dataset are highlighted. (M) denotes some (or all) hyperparameter settings run out of memory.
|
| 161 |
+
|
| 162 |
+
<table><tr><td></td><td>Penn94</td><td>pokec</td><td>arXiv-year</td><td>snap-patents</td><td>genius</td><td>twitch-gamers</td></tr><tr><td>MLP</td><td>73.61 ±0.40</td><td>62.37 ±0.02</td><td>36.70±0.21</td><td>31.34 ± 0.05</td><td>86.68± 0.09</td><td>60.92 ±0.07</td></tr><tr><td>L Prop 1-hop</td><td>63.21王0.39</td><td>53.09±0.05</td><td>43.42±0.17</td><td>30.28 ±0.09</td><td>66.02±0.16</td><td>62.77±0.24</td></tr><tr><td>L Prop 2-hop</td><td>74.13±0.46</td><td>76.76±0.03</td><td>46.07 ± 0.15</td><td>38.61 ±0.07</td><td>67.04 ± 0.20</td><td>63.88±0.24</td></tr><tr><td>LINK</td><td>80.79±0.49</td><td>80.54 ±0.03</td><td>53.97 ±0.18</td><td>60.39±0.07</td><td>73.56±0.14</td><td>64.85 ± 0.21</td></tr><tr><td>SGC 1-hop</td><td>66.790.27</td><td>53.61±0.17</td><td>32.83±0.13</td><td>30.31±0.06</td><td>82.36±0.37</td><td>58.97±0.19</td></tr><tr><td>SGC 2-hop</td><td>76.09 ±0.45</td><td>62.81 ± 1.42</td><td>32.27 ±0.06</td><td>29.09 ±0.09</td><td>82.10 ±0.14</td><td>59.94 ± 0.21</td></tr><tr><td>C&S1-hop</td><td>74.28 ± 1.19</td><td>62.35 ±0.06</td><td>44.51 ±0.16</td><td>35.55 ± 0.05</td><td>82.93 ±0.15</td><td>64.86±0.27</td></tr><tr><td>C&S2-hop</td><td>78.40±3.12</td><td>81.69 ±0.09</td><td>49.78±0.26</td><td>49.08±0.04</td><td>84.94 ± 0.49</td><td>65.02 ±0.16</td></tr><tr><td>GCN</td><td>82.470.27</td><td>75.45±0.17</td><td>46.02±0.26</td><td>45.65±0.04</td><td>87.42±0.37</td><td>62.18±0.26</td></tr><tr><td>GAT</td><td>81.53 ±0.55</td><td>71.77±6.18(M)</td><td>46.05 ±0.51</td><td>45.37± 0.44 (M)</td><td>55.80 ±0.87</td><td>59.89 ± 4.12</td></tr><tr><td>GCNJK</td><td>81.63 ±0.54</td><td>77.00±0.14</td><td>46.28±0.29</td><td>46.88 ±0.13</td><td>89.30 ±0.19</td><td>63.45±0.22</td></tr><tr><td>GATJK</td><td>80.69 ± 0.36</td><td>71.19 ±6.96 (M)</td><td>45.80±0.72</td><td>44.78±0.50</td><td>56.70±2.07</td><td>59.98 ±2.87</td></tr><tr><td>APPNP</td><td>74.33 ±0.38</td><td>62.58±0.08</td><td>38.15±0.26</td><td>32.19 ±0.07</td><td>85.36 ±0.62</td><td>60.97 ±0.10</td></tr><tr><td>HGCN</td><td>(M)</td><td>(M)</td><td>49.09±0.10</td><td>(M)</td><td>(M)</td><td>(M)</td></tr><tr><td>MixHop</td><td>83.47 ± 0.71</td><td>81.07 ± 0.16</td><td>51.81 ± 0.17</td><td>52.16 ± 0.09 (M)</td><td>90.58 ± 0.16</td><td>65.64 ± 0.27</td></tr><tr><td>GPR-GNN GCNII</td><td>81.38±0.16 82.92 ± 0.59</td><td>78.83± 0.05</td><td>45.07 ± 0.21</td><td>40.19±0.03</td><td>90.05 ± 0.31</td><td>61.89 ± 0.29</td></tr><tr><td></td><td></td><td>78.94± 0.11 (M)</td><td>47.21 ± 0.28</td><td>37.88 ±0.69 (M)</td><td>90.24 ± 0.09</td><td>63.39 ±0.61</td></tr><tr><td>LINKX</td><td>84.71 ± 0.52</td><td>82.04 ± 0.07</td><td>56.00 ±1.34</td><td>61.95 ± 0.12</td><td>90.77±0.27</td><td>66.06 ± 0.19</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 5.1 Experimental Setup
|
| 165 |
+
|
| 166 |
+
Methods. We include both methods that are graph-agnostic and node-feature-agnostic as simple baselines. The node-feature-agnostic models of two-hop label propagation $\mathbb { \lVert \Xi \rVert }$ and LINK (logistic regression on the adjacency matrix) $\pmb { \mathbb { Z } } 9 \|$ have been found to perform well in various non-homophilous settings, but they have often been overlooked by recent graph representation learning work. Also, we include SGC $\dot { [ ] } \dot { [ ] \begin{array} { r l } \end{array} }$ and C&S $\mathbb { \lVert 3 2 \rVert }$ as simple, scalable methods that perform well on homophilic datasets. We include a two-hop propagation variant of C&S in analogy with two-step label propagation. In addition to representative general GNNs, we also include GNNs recently proposed for non-homophilous settings. The full list of methods is: Only node features: MLP $\dot { \left. 2 6 \right. }$ . Only graph topology: label propagation (standard and two-hop) [80, 57], LINK $\mathbb { \underline { { \Pi 9 } } }$ . Simple methods: SGC [71], C&S [32] and their two-hop variants. General GNNs: GCN $\pmb { \| } \pmb { \mathrm { 3 8 } } \|$ , GAT $\overline { { \| 6 9 \| } }$ , jumping knowledge networks (GCNJK, GATJK) $\pmb { \mathbb { Z } 2 }$ , and APPNP $\pmb { \mathbb { B } } \pmb { \mathrm { 9 } } \|$ . Non-homophilous methods: $\mathrm { H } _ { 2 } \mathrm { G C N }$ $[ \textcircled { 8 2 } ]$ , MixHop [1], GPR-GNN [17], GCNII [15], and LINKX (ours).
|
| 167 |
+
|
| 168 |
+
Minibatching methods. We also evaluate GNNs with various minibatching methods. We take GCNJK $\pmb { \mathbb { Z } 2 } \|$ and MixHop [1] as our base models for evaluation, as they are representative of many GNN design choices and MixHop performs very well in full batch training. As other minibatching methods are trickier to make work with these models, we use the Cluster-GCN $\boxed { 1 6 }$ and GraphSAINT $\mathbb { \ m }$ minibatching methods, which sample subgraphs. We include both the node based sampling and random walk based sampling variants of GraphSAINT. We compare these GNNs with MLP, LINK, and our LINKX, which use simple i.i.d. node minibatching.
|
| 169 |
+
|
| 170 |
+
Training and evaluation. Following other works in non-homophilous graph learning evaluation, we take a high proportion of training nodes [82, 58, 73]; we run each method on the same five random 50/25/25 train/val/test splits for each dataset. All methods requiring gradient-based optimization are run for 500 epochs, with test performance reported for the learned parameters of highest validation performance. We use ROC-AUC as the metric for the class-imbalanced genius dataset (about $80 \%$ of nodes are in the majority class), as it is less sensitive to class-imbalance than accuracy. For other datasets, we use classification accuracy as the metric. Further experimental details are in Appendix B.
|
| 171 |
+
|
| 172 |
+
# 5.2 Full-Batch Results
|
| 173 |
+
|
| 174 |
+
Table $\triangledown$ lists the results of each method across the datasets that we propose. Our datasets reveal several important properties of non-homophilous node classification. Firstly, the stability of performance across runs is better for our datasets than those of Pei et al. $\left[ \left[ 5 8 \right] \right]$ (see $\pmb { \Vert 8 2 \Vert }$ results). Secondly, as suggested by prior theory and experiments [82, 1, 17], the non-homophilous GNNs usually do well — though not necessarily on every dataset.
|
| 175 |
+
|
| 176 |
+
The core assumption of homophily in SGC and C&S that enables them to be simple and efficient does not hold on these non-homophilous datasets, and thus the performance of these methods is typically relatively low. Still, as expected, two-hop variants generally improve upon their one-hop counter-parts in these low-homophily settings.
|
| 177 |
+
|
| 178 |
+
One consequence of using larger datasets for benchmarks is that the tradeoff between scalability and learning performance of non-homophilous methods has become starker, with some methods facing memory issues. This tradeoff is especially important to consider in light of the fact that many scalable graph learning methods rely on implicit or explicit homophily assumptions [71, 32, 20, 10], and thus face issues when used in non-homophilous settings.
|
| 179 |
+
|
| 180 |
+
Finally, LINKX achieves superior performance on all datasets, taking advantage of LINK’s power, while also being able to utilize node features where they provide additional information.
|
| 181 |
+
|
| 182 |
+
# 5.3 Minibatching Results
|
| 183 |
+
|
| 184 |
+
Table 4: Minibatching results on our proposed datasets. $\dagger$ denotes that 10 random partitions of the graphs are used for testing GraphSAINT sampling. (T) denotes that five runs takes $\geq 4 8$ hours for a single hyperparameter setting. Best results up to a standard deviation are highlighted.
|
| 185 |
+
|
| 186 |
+
<table><tr><td></td><td>Penn94</td><td>pokec †</td><td>arXiv-year</td><td>snap-patents †</td><td>genius</td><td>twitch-gamers †</td><td>wiki †</td></tr><tr><td>MLP Minibatch</td><td>74.24±0.55</td><td>62.14±0.05</td><td>36.89±0.11</td><td>22.96±0.81</td><td>82.35±0.38</td><td>61.01±0.06</td><td>37.38±0.21</td></tr><tr><td>LINK Minibatch</td><td>81.61±0.34</td><td>81.15±0.25</td><td>53.76±0.28</td><td>45.65±8.25</td><td>80.95±0.07</td><td>64.38±0.26</td><td>57.11±0.26</td></tr><tr><td>GCNJK-Cluster</td><td>69.99±0.85</td><td>72.67±0.05</td><td>44.05±0.11</td><td>37.62±0.31</td><td>83.04±0.56</td><td>61.15±0.16</td><td>(T)</td></tr><tr><td>GCNJK-SAINT-Node</td><td>72.80±0.43</td><td>63.68±0.06</td><td>44.30±0.22</td><td>26.97±0.10</td><td>80.96±0.09</td><td>59.50±0.35</td><td>44.86±0.19</td></tr><tr><td>GCNJK-SAINT-RW</td><td>72.29±0.49</td><td>65.00±0.11</td><td>47.40±0.17</td><td>33.05±0.06</td><td>81.04±0.14</td><td>59.82±0.27</td><td>47.39±0.19</td></tr><tr><td>MixHop-Cluster</td><td>75.79±0.44</td><td>76.67±0.07</td><td>48.41±0.31</td><td>46.82±0.11</td><td>81.12±0.10</td><td>62.95±0.08</td><td>(T)</td></tr><tr><td>MixHop-SAINT-Node</td><td>75.61±0.55</td><td>66.42±0.06</td><td>44.84±0.18</td><td>27.45±0.11</td><td>81.06±0.08</td><td>59.58±0.27</td><td>47.39±0.18</td></tr><tr><td>MixHop-SAINT-RW</td><td>76.38±0.50</td><td>67.92±0.06</td><td>50.55±0.20</td><td>34.21±0.07</td><td>82.25±0.78</td><td>60.39±0.16</td><td>49.15±0.26</td></tr><tr><td>LINKXMinibatch</td><td>84.50±0.65</td><td>81.27±0.38</td><td>53.74±0.27</td><td>60.27±0.29</td><td>85.81±0.10</td><td>65.84±0.19</td><td>59.80±0.41</td></tr></table>
|
| 187 |
+
|
| 188 |
+
Our experimental results for minibatched methods on our proposed datasets are in Table 4. Since GraphSAINT does not partition the nodes of the graph into subgraphs that cover all nodes, we test on the full input graph for the smaller datasets and uniformly random partitions of the graph into 10 induced subgraphs for the larger datasets.
|
| 189 |
+
|
| 190 |
+
First, we note that both Cluster-GCN and GraphSAINT sampling lead to performance degradation for these methods on our proposed non-homophilous datasets. When compared to the full-batch training results of the previous section, classification accuracy is typically substantially lower. Further experiments in Appendix C.2 give evidence that the performance degradation is often more substantial in non-homophilous settings, and provides possible explanations for why this may be the case.
|
| 191 |
+
|
| 192 |
+
On the other hand, LINKX does not suffer much performance degradation with the simple i.i.d. node minibatching technique. In fact, it matches or outperforms all methods in this setting, often by a wide margin. Though LINK performs on par with LINKX in arXiv-year and pokec, our LINKX model significantly outperforms it on other datasets, again due to LINKX’s ability to integrate node feature information. We again stress that the LINKX minibatching is very simple to implement, yet it still substantially outperforms other methods. Consequently, LINKX is generally well-suited for scalable node classification across a broad range of non-homophilous settings, surpassing even specially designed non-homophilous GNNs with current graph minibatching techniques.
|
| 193 |
+
|
| 194 |
+
# 6 Discussion and Conclusion
|
| 195 |
+
|
| 196 |
+
In this paper, we propose new, high-quality non-homophilous graph learning datasets, and we benchmark simple baselines and representative graph representation learning methods across these datasets. Further, we develop LINKX: a strong, simple, and scalable method for non-homophilous classification. Our experiments show that LINKX significantly outperforms other methods on our proposed datasets, thus providing one powerful method in the underexplored area of scalable learning on non-homophilous graphs. We hope that our contributions will provide researchers with new avenues of research in learning on non-homophilous graphs, along with better tools to test models and evaluate utility of new techniques.
|
| 197 |
+
|
| 198 |
+
While we do find utility in our proposed datasets and LINKX model, this work is somewhat limited by only focusing on transductive node classification. This setting is the most natural for studying performance in the absence of homophily, since here we define homophily in terms of the node labels, and previous non-homophilous GNN work using the Pei et al. [58] data also studies this setting exclusively $\scriptstyle [ 8 2 , \boxed { 1 7 } ]$ . Using other Facebook 100 datasets besides Penn94 $[ [ 6 7 ] ]$ would allow for inductive node classification, but LINKX does not directly generalize to this setting. Our proposed datasets and model LINKX could be used for link prediction, but this is left for future work.
|
| 199 |
+
|
| 200 |
+
Broader Impact. Fundamental research in graph learning on non-homophilous graphs has the potential for positive societal benefit. As a major application, it enables malicious node detection techniques in social networks and transaction networks that are not fooled by fraudsters’ connections to legitimate users and customers. This is a widely studied task, and past works have noted that non-homophilous structures are present in many such networks [11, 25, 55]. We hope that this paper provides insight on the homophily limitations of existing scalable graph learning models and help researchers design scalable models that continue to work well in the non-homophilous regime, thus improving the quality of node classification on graphs more broadly. As our proposed datasets have diverse structures and our model performs well across all of these datasets, the potential for future application of our work to important non-homophilous tasks is high.
|
| 201 |
+
|
| 202 |
+
Nevertheless, our work could also have potential for different types of negative social consequences. Nefarious behavior by key actors could be one source of such consequences. Nonetheless, we expect that the actors that can make use of large-scale social networks for gender prediction as studied in our work are limited in number. Actors with both the capability and incentive to perform such operations probably mostly consist of entities with access to large social network data such as social media companies or government actors with auxiliary networks $\mathbb { \boldsymbol { 0 } }$ . Smaller actors can perform certain attacks, but this may be made more difficult by resource requirements such as the need for certain external information $\pmb { \Vert 5 0 \Vert }$ or the ability to add nodes and edges before an anonymized version of a social network is released $\pmb { \Vert 5 \Vert }$ . Furthermore, additional actors could make use of deanonymization attacks $\textcircled { 1 3 0 } , \textcircled { 4 9 } , \textcircled { 5 0 } $ to reveal user identities in supposedly anonymized datasets.
|
| 203 |
+
|
| 204 |
+
Also, accidental consequences and implicit biases are a potential issue, even if the applications of the learning algorithms are benign and intended to benefit society [47]. Performance of algorithms may vary substantially between intersectional subgroups of subjects — as in the case of vision-based gender predictors $\dot { \mathbb { E } } \dot { 2 } \mathbb { I }$ (and some have questioned the propriety of vision-based gender classifiers altogether). Thus, there may be disparate effects on different populations, so care should be taken to understand the impact of those differences across subgroups. Moreover, large datasets require computing resources, so projects can only be pursued by large entities at the possible expense of the individual and smaller research groups $\boxed { 1 8 }$ . This is alleviated by the fact that our experiments are each run on one GPU, and hence have significantly less GPU computing requirements than much current deep learning research. Thus, smaller research groups and independent researchers should find our work beneficial, and should be able to build on it.
|
| 205 |
+
|
| 206 |
+
Finally, the nature of collection of online user information also comes with notable ethical concerns. Common notice-and-consent policies are often ineffective in actually protecting user privacy [52]. Indeed, users may not actually have much choice in using certain platforms or sharing data due to social or economic reasons. Also, users are generally unable to fully read and understand all of the different privacy policies that they come across, and may not understand the implications of having their data available for long periods of time to entities with powerful inference algorithms. Furthermore, people may rely on obscurity for privacy $\mathbb { \left[ \left[ 2 9 \right] \right] }$ , but this assumption may be ignored in courts of law, and it may be directly broken when data leaks or is released in aggregated form without sufficient privacy protections. Overall, while we believe that our work will benefit machine learning research and enable positive applications, we must still be aware of possible negative consequences.
|
| 207 |
+
|
| 208 |
+
# Acknowledgements
|
| 209 |
+
|
| 210 |
+
We thank Abhay Singh, Austin Benson, and Horace He for insightful discussions. We also thank the rest of Cornell University Artificial Intelligence for their support and discussion. We thank Facebook AI for funding equipment that made this work possible.
|
| 211 |
+
|
| 212 |
+
# References
|
| 213 |
+
|
| 214 |
+
[1] 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, 2019.
|
| 215 |
+
[2] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework, 2019.
|
| 216 |
+
[3] Kristen M Altenburger and Johan Ugander. Monophily in social networks introduces similarity among friends-of-friends. Nature human behaviour, 2(4):284–290, 2018.
|
| 217 |
+
[4] Kristen M Altenburger and Johan Ugander. Node attribute prediction: An evaluation of withinversus across-network tasks. NeurIPS Workshop on Relational Representation Learning, 2018.
|
| 218 |
+
[5] Lars Backstrom, Cynthia Dwork, and Jon M. Kleinberg. Wherefore art thou $\mathrm { r } 3 5 7 9 \mathrm { x } ?$ : anonymized social networks, hidden patterns, and structural steganography. In WWW $^ { , } 0 7$ , 2007.
|
| 219 |
+
[6] Muhammet Balcilar, Guillaume Renton, Pierre Héroux, Benoit Gaüzère, Sébastien Adam, and Paul Honeine. Analyzing the expressive power of graph neural networks in a spectral perspective. In International Conference on Learning Representations, 2021.
|
| 220 |
+
[7] Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 221 |
+
[8] Abeba Birhane, Pratyusha Kalluri, Dallas Card, William Agnew, Ravit Dotan, and Michelle Bao. The values encoded in machine learning research, 2021.
|
| 222 |
+
[9] Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. Beyond low-frequency information in graph convolutional networks. arXiv preprint arXiv:2101.00797, 2021.
|
| 223 |
+
[10] Aleksandar Bojchevski, Johannes Klicpera, Bryan Perozzi, Amol Kapoor, Martin Blais, Benedek Rózemberczki, Michal Lukasik, and Stephan Günnemann. Scaling graph neural networks with approximate pagerank. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2464–2473, 2020.
|
| 224 |
+
[11] Adam Breuer, Roee Eilat, and Udi Weinsberg. Friend or faux: Graph-based early detection of fake accounts on social networks, 2020.
|
| 225 |
+
[12] Joy Buolamwini and Timnit Gebru. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Sorelle A. Friedler and Christo Wilson, editors, Proceedings of the 1st Conference on Fairness, Accountability and Transparency, volume 81 of Proceedings of Machine Learning Research, pages 77–91. PMLR, 23–24 Feb 2018. URL https:// proceedings.mlr.press/v81/buolamwini18a.html.
|
| 226 |
+
[13] Duen Horng Chau, Shashank Pandit, and Christos Faloutsos. Detecting fraudulent personalities in networks of online auctioneers. In European conference on principles of data mining and knowledge discovery, pages 103–114. Springer, 2006.
|
| 227 |
+
[14] Jie Chen, Tengfei Ma, and Cao Xiao. Fastgcn: Fast learning with graph convolutional networks via importance sampling. In International Conference on Learning Representations, 2018.
|
| 228 |
+
|
| 229 |
+
[15] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In International Conference on Machine Learning, pages 1725–1735. PMLR, 2020.
|
| 230 |
+
|
| 231 |
+
[16] Wei-Lin Chiang, Xuanqing Liu, Si Si, Yang Li, Samy Bengio, and Cho-Jui Hsieh. Cluster-gcn: An efficient algorithm for training deep and large graph convolutional networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 257–266, 2019.
|
| 232 |
+
|
| 233 |
+
[17] Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. In International Conference on Learning Representations, 2021.
|
| 234 |
+
|
| 235 |
+
[18] Alex Chin, Yatong Chen, Kristen M. Altenburger, and Johan Ugander. Decoupled smoothing on graphs. In The World Wide Web Conference, pages 263–272, 2019.
|
| 236 |
+
|
| 237 |
+
[19] Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 238 |
+
|
| 239 |
+
[20] Chenhui Deng, Zhiqiang Zhao, Yongyu Wang, Zhiru Zhang, and Zhuo Feng. Graphzoom: A multi-level spectral approach for accurate and scalable graph embedding. In International Conference on Learning Representations, 2020.
|
| 240 |
+
|
| 241 |
+
[21] Vijay Prakash Dwivedi, Chaitanya K Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020.
|
| 242 |
+
|
| 243 |
+
[22] Paul Erdos and Alfréd Rényi. On the evolution of random graphs. ˝ Publ. Math. Inst. Hung. Acad. Sci, 5(1):17–60, 1960.
|
| 244 |
+
|
| 245 |
+
[23] Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 246 |
+
|
| 247 |
+
[24] Konrad Gadzicki, Razieh Khamsehashari, and Christoph Zetzsche. Early vs late fusion in multimodal convolutional neural networks. In 2020 IEEE 23rd International Conference on Information Fusion (FUSION), pages 1–6. IEEE, 2020.
|
| 248 |
+
|
| 249 |
+
[25] Wolfgang Gatterbauer. Semi-supervised learning with heterophily. arXiv preprint arXiv:1412.3100, 2014.
|
| 250 |
+
|
| 251 |
+
[26] Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning. MIT press Cambridge, 2016.
|
| 252 |
+
|
| 253 |
+
[27] Bronwyn H Hall, Adam B Jaffe, and Manuel Trajtenberg. The nber patent citation data file: Lessons, insights and methodological tools. Working Paper 8498, National Bureau of Economic Research, October 2001. URL http://www.nber.org/papers/w8498.
|
| 254 |
+
|
| 255 |
+
[28] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pages 1024–1034, 2017.
|
| 256 |
+
|
| 257 |
+
[29] Woodrow Hartzog and Frederic Stutzman. The case for online obscurity. California Law Review, 101(1):1–49, 2013. ISSN 00081221. URL http://www.jstor.org/stable/23409387.
|
| 258 |
+
|
| 259 |
+
[30] Michael Hay, Gerome Miklau, David Jensen, Donald Towsley, and Philipp Weis. Resisting structural identification in anonymized social networks. PVLDB, 1:102–114, 08 2008. doi: 10.14778/1453856.1453873.
|
| 260 |
+
|
| 261 |
+
[31] 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.
|
| 262 |
+
|
| 263 |
+
[32] Qian Huang, Horace He, Abhay Singh, Ser-Nam Lim, and Austin Benson. Combining label propagation and simple models out-performs graph neural networks. In International Conference on Learning Representations, 2021.
|
| 264 |
+
|
| 265 |
+
[33] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. PMLR, 2015.
|
| 266 |
+
[34] Junteng Jia and Austion R Benson. Residual correlation in graph neural network regression. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 588–598, 2020.
|
| 267 |
+
[35] Wei Jin, Tyler Derr, Yiqi Wang, Yao Ma, Zitao Liu, and Jiliang Tang. Node similarity preserving graph convolutional networks. In Proceedings of the 14th ACM International Conference on Web Search and Data Mining, pages 148–156, 2021.
|
| 268 |
+
[36] Dongkwan Kim and Alice Oh. How to find your friendly neighborhood: Graph attention design with self-supervision. In International Conference on Learning Representations, 2021.
|
| 269 |
+
[37] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 270 |
+
[38] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks, 2017.
|
| 271 |
+
[39] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In International Conference on Learning Representations, 2019.
|
| 272 |
+
[40] M. Zabovsky L. Takac. Data analysis in public social networks. International Scientific Conference & International Workshop Present Day Trends of Innovations, 2012.
|
| 273 |
+
[41] Jure Leskovec and Andrej Krevl. SNAP Datasets: Stanford large network dataset collection. http://snap.stanford.edu/data, June 2014.
|
| 274 |
+
[42] Jure Leskovec, Jon Kleinberg, and Christos Faloutsos. Graphs over time: densification laws, shrinking diameters and possible explanations. In Proceedings of the eleventh ACM SIGKDD international conference on Knowledge discovery in data mining, pages 177–187, 2005.
|
| 275 |
+
[43] Derek Lim and Austin R Benson. Expertise and dynamics within crowdsourced musical knowledge curation: A case study of the genius platform. In Proceedings of the International AAAI Conference on Web and Social Media, 2021.
|
| 276 |
+
[44] Meng Liu, Zhengyang Wang, and Shuiwang Ji. Non-local graph neural networks, 2020.
|
| 277 |
+
[45] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018.
|
| 278 |
+
[46] Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual review of sociology, 27(1):415–444, 2001.
|
| 279 |
+
[47] Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. A survey on bias and fairness in machine learning, 2019.
|
| 280 |
+
[48] Tom Mitchell et al. The 4 universities data set, 1997. URL http://www.cs.cmu.edu/afs/ cs.cmu.edu/project/theo-20/www/data/.
|
| 281 |
+
[49] Arvind Narayanan and Vitaly Shmatikov. Robust de-anonymization of large sparse datasets. In 2008 IEEE Symposium on Security and Privacy (sp 2008), pages 111–125, 2008. doi: 10.1109/SP.2008.33.
|
| 282 |
+
[50] Arvind Narayanan and Vitaly Shmatikov. De-anonymizing social networks. In 2009 30th IEEE Symposium on Security and Privacy, pages 173–187, 2009. doi: 10.1109/SP.2009.22.
|
| 283 |
+
[51] Mark EJ Newman. Mixing patterns in networks. Physical review E, 67(2):026126, 2003.
|
| 284 |
+
[52] Helen Nissenbaum. A contextual approach to privacy online. Daedalus, 140:32–48, 2011.
|
| 285 |
+
|
| 286 |
+
[53] Hoang Nt and Takanori Maehara. Revisiting graph neural networks: All we have is low-pass filters. arXiv preprint arXiv:1905.09550, 2019.
|
| 287 |
+
|
| 288 |
+
[54] Hoang NT, Takanori Maehara, and Tsuyoshi Murata. Stacked graph filter. arXiv preprint arXiv:2011.10988, 2020.
|
| 289 |
+
|
| 290 |
+
[55] Shashank Pandit, Duen Horng Chau, Samuel Wang, and Christos Faloutsos. Netprobe: a fast and scalable system for fraud detection in online auction networks. In Proceedings of the 16th international conference on World Wide Web, pages 201–210, 2007.
|
| 291 |
+
|
| 292 |
+
[56] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in Neural Information Processing Systems, 32:8026–8037, 2019.
|
| 293 |
+
|
| 294 |
+
[57] Leto Peel. Graph-based semi-supervised learning for relational networks. In Proceedings of the 2017 SIAM International Conference on Data Mining, pages 435–443. SIAM, 2017.
|
| 295 |
+
|
| 296 |
+
[58] Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. In International Conference on Learning Representations, 2019.
|
| 297 |
+
|
| 298 |
+
[59] Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1162.
|
| 299 |
+
|
| 300 |
+
[60] Benedek Rozemberczki and Rik Sarkar. Twitch gamers: a dataset for evaluating proximity preserving and structural role-based node embeddings. arXiv preprint arXiv:2101.03091, 2021.
|
| 301 |
+
|
| 302 |
+
[61] Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. Journal of Complex Networks, 9(2):cnab014, 2021.
|
| 303 |
+
|
| 304 |
+
[62] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
|
| 305 |
+
|
| 306 |
+
[63] Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
|
| 307 |
+
|
| 308 |
+
[64] Neil JA Sloane. The on-line encyclopedia of integer sequences. In Towards mechanized mathematical assistants, pages 130–130. Springer, 2007.
|
| 309 |
+
|
| 310 |
+
[65] 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.
|
| 311 |
+
|
| 312 |
+
[66] Jie Tang, Jimeng Sun, Chi Wang, and Zi Yang. Social influence analysis in large-scale networks. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 807–816, 2009.
|
| 313 |
+
|
| 314 |
+
[67] Amanda L Traud, Peter J Mucha, and Mason A Porter. Social structure of facebook networks. Physica A: Statistical Mechanics and its Applications, 391(16):4165–4180, 2012.
|
| 315 |
+
|
| 316 |
+
[68] Nate Veldt, Austin R Benson, and Jon Kleinberg. Higher-order homophily is combinatorially impossible. arXiv preprint arXiv:2103.11818, 2021.
|
| 317 |
+
|
| 318 |
+
[69] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. In International Conference on Learning Representations, 2018.
|
| 319 |
+
|
| 320 |
+
[70] Kuansan Wang, Zhihong Shen, Chiyuan Huang, Chieh-Han Wu, Yuxiao Dong, and Anshul Kanakia. Microsoft Academic Graph: When experts are not enough. Quantitative Science Studies, 1(1):396–413, 02 2020. ISSN 2641-3337. doi: 10.1162/qss_a_00021. URL https: //doi.org/10.1162/qss_a_00021.
|
| 321 |
+
|
| 322 |
+
[71] Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In International conference on machine learning, pages 6861–6871. PMLR, 2019.
|
| 323 |
+
[72] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning, pages 5453–5462. PMLR, 2018.
|
| 324 |
+
[73] Yujun Yan, Milad Hashemi, Kevin Swersky, Yaoqing Yang, and Danai Koutra. Two sides of the same coin: Heterophily and oversmoothing in graph convolutional neural networks. arXiv preprint arXiv:2102.06462, 2021.
|
| 325 |
+
[74] Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. In International conference on machine learning, pages 40–48. PMLR, 2016.
|
| 326 |
+
[75] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 974–983, 2018.
|
| 327 |
+
[76] Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Accurate, efficient and scalable graph embedding. In 2019 IEEE International Parallel and Distributed Processing Symposium (IPDPS), pages 462–471. IEEE, 2019.
|
| 328 |
+
[77] Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Graphsaint: Graph sampling based inductive learning method. In International Conference on Learning Representations, 2019.
|
| 329 |
+
[78] Jin Zeng, Yanfeng Tong, Yunmu Huang, Qiong Yan, Wenxiu Sun, Jing Chen, and Yongtian Wang. Deep surface normal estimation with hierarchical rgb-d fusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6153–6162, 2019.
|
| 330 |
+
[79] Elena Zheleva and Lise Getoor. To join or not to join: the illusion of privacy in social networks with mixed public and private user profiles. In Proceedings of the 18th international conference on World wide web, pages 531–540, 2009.
|
| 331 |
+
[80] Dengyong Zhou, Olivier Bousquet, Thomas N Lal, Jason Weston, and Bernhard Schölkopf. Learning with local and global consistency. In Advances in neural information processing systems, pages 321–328, 2004.
|
| 332 |
+
[81] Jiong Zhu, Ryan A Rossi, Anup Rao, Tung Mai, Nedim Lipka, Nesreen K Ahmed, and Danai Koutra. Graph neural networks with heterophily. arXiv preprint arXiv:2009.13566, 2020.
|
| 333 |
+
[82] Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. Beyond homophily in graph neural networks: Current limitations and effective designs. Advances in Neural Information Processing Systems, 33, 2020.
|
| 334 |
+
[83] Michael Zimmer. Facebook data of 1.2 million users from 2005 released: Limited exposure, but very problematic, Feb 2011. URL https://michaelzimmer.org/2011/02/15/ facebook-data-of-1-2-million-users-from-2005-released/.
|
| 335 |
+
|
| 336 |
+
# Checklist
|
| 337 |
+
|
| 338 |
+
1. For all authors...
|
| 339 |
+
|
| 340 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] We have supported the claims in the main paper and appendix.
|
| 341 |
+
(b) Did you describe the limitations of your work? [Yes] See discussion / conclusion Section $6 .$
|
| 342 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See discussion / conclusion Section 6.
|
| 343 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 344 |
+
|
| 345 |
+
2. If you are including theoretical results...
|
| 346 |
+
|
| 347 |
+
(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]
|
| 348 |
+
|
| 349 |
+
3. If you ran experiments...
|
| 350 |
+
|
| 351 |
+
(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] We include our proposed datasets and our codes for reproducing the experimental results in the supplemental material.
|
| 352 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 5.1 and Appendix Section B.
|
| 353 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We include standard deviation of performance metrics across multiple runs in Section 5.
|
| 354 |
+
(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] We provide GPU information in Appendix Section B.
|
| 355 |
+
|
| 356 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 357 |
+
|
| 358 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We cite the creators of existing datasets and methods in the main paper. Also, in Appendix B, we cite codes that we used.
|
| 359 |
+
(b) Did you mention the license of the assets? [Yes] In Appendix D, we note the licenses of datasets, if provided in published work. Also, we include the license of open-source codes we build off of in Appendix B.
|
| 360 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our proposed datasets along with codes for reproducing our results in the supplemental material.
|
| 361 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] We discuss this in Appendix D. Most of the datasets were constructed and presented in previously published academic work. This mostly does not apply to the wiki dataset that we collect, as it is encyclopedic in nature.
|
| 362 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] In Appendix D, we discuss this. Our datasets are primarily numerical, so they do not contain offensive content. To the best of our knowledge, our datasets do not contain personally identifiable content.
|
| 363 |
+
|
| 364 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 365 |
+
|
| 366 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 367 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 368 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/Ggx8fbKZ1-D/Ggx8fbKZ1-D.md
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADAPTIVE HIERARCHICAL HYPER-GRADIENT DESCENT
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this study, we investigate learning rate adaption at different levels based on the hyper-gradient descent framework and propose a method that adaptively learns the optimizer parameters by combining different levels of adaptations. Meanwhile, we show the relationship between regularizing over-parameterized learning rates and building combinations of adaptive learning rates at different levels. The experiments on several network architectures, including feed-forward networks, LeNet-5 and ResNet-18/34, show that the proposed multi-level adaptive approach can significantly outperforms baseline adaptive methods in a variety of circumstances.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The basic optimization algorithm for training deep neural networks is the gradient descent method (GD), which includes stochastic gradient descent (SGD), mini-batch gradient descent, and batch gradient descent. The model parameters are updated according to the first-order gradients of the empirical risks with respect to the parameters being optimized, while back-propagation is implemented for calculating the gradients of parameters (Ruder, 2016). Naïve gradient descent methods apply fixed learning rates without any adaptation mechanisms. However, considering the change of available information during the learning process, SGD with fixed learning rates can result in inefficiency and requires a large amount of computing resources in hyper-parameter searching. One solution is to introduce a learning rate adaptation. This idea can be traced back to the work on gain adaptation for connectionist learning methods (Sutton, 1992) and related extensions for non-linear cases (Schraudolph, 1999; Yu et al., 2006). In recent years, optimizers with adaptive updating rules were developed in the context of deep learning, while the learning rates are still fixed in training. The proposed methods include AdaGrad (Duchi et al., 2011), RMSProp (Tieleman and Hinton, 2012), and Adam (Kingma and Ba, 2015). In addition, there are optimizers aiming to address the convergence issue in Adam (Reddi et al., 2018; Luo et al., 2018) and to rectify the variance of the adaptive learning rate (Liu et al., 2019). Other techniques, such as Lookahead, can also achieve variance reduction and stability improvement with negligible extra computational cost (Zhang et al., 2019).
|
| 12 |
+
|
| 13 |
+
Even though the adaptive optimizers with fixed learning rates can converge faster than SGD in a wide range of tasks, the updating rules are designed manually while more hyper-parameters are introduced. Another idea is to use objective function information and update the learning rates as trainable parameters. These methods were introduced as automatic differentiation, where the hyper-parameters can be optimized with backpropagation (Maclaurin et al., 2015; Baydin et al., 2018). As gradient-based hyper-parameter optimization methods, they can be implemented as an online approach (Franceschi et al., 2017). With the idea of auto-differentiation, learning rates can be updated in real-time with the corresponding derivatives of the empirical risk (Almeida et al., 1998), which can be generated to all types of optimizers for deep neural networks (Baydin et al., 2017). Another step size adaptation approach called “L4”, is based on the linearized expansion of the loss functions, which rescales the gradient to make fixed predicted progress on the loss (Rolinek and Martius, 2018). Furthermore, by addressing the issue of poor generalization performance of adaptive methods, dynamically bound for gradient methods was introduced to build a gradual transition between adaptive approach and SGD (Luo et al., 2018).
|
| 14 |
+
|
| 15 |
+
Another set of approaches train an RNN (recurrent neural network) agent to generate the optimal learning rates in the next step given the historical training information, known as “learning to learn”
|
| 16 |
+
|
| 17 |
+
(Andrychowicz et al., 2016). This approach empirically outperforms hand-designed optimizers in a variety of learning tasks, but another study has shown that it may not be effective for long horizons (Lv et al., 2017). The generalization ability of this approach can be improved by using meta training samples and hierarchical LSTMs (long short-term memory) (Wichrowska et al., 2017).
|
| 18 |
+
|
| 19 |
+
Beyond the adaptive learning rate, learning rate schedules can also improve the convergence of optimizers, including time-based decay, step decay, exponential decay (Li and Arora, 2019). The most fundamental and widely applied one is a piece-wise step-decay learning rate schedule, which could vastly improve the convergence of SGD and even adaptive optimizers(Luo et al., 2018; Liu et al., 2019). It can be further improved by introducing a statistical test to determine when to apply step-decay (Lang et al., 2019; Zhang et al., 2020). Also, there are works on warm-restart (O’donoghue and Candes, 2015; Loshchilov and Hutter, 2017), which could improve the performance of SGD anytime when training deep neural networks.
|
| 20 |
+
|
| 21 |
+
We find that the existing gradient or model-based learning rate adaptation methods including hypergradient descent, L4 and learning to learn only focus on global adaptation, which could be further extended to multi-level cases. That focus aims to introduce locally shared adaptive learning rates such as the layer-wise learning rate and parameter-wise learning rate and considers all levels’ information in determining the updating step-size for each parameter. The main contribution of our study can be summarized as follows:
|
| 22 |
+
|
| 23 |
+
• We introduce hierarchical learning rate structures for neural networks and apply hypergradient descent to obtain adaptive learning rates at different levels. We introduce a set of regularization techniques for learning rates to address the balance of global and local adaptations and show the relationship with weighted combinations. • We propose an algorithm implementing the combination of adaptive learning rates at multiple levels for model parameter updating.
|
| 24 |
+
|
| 25 |
+
# 2 MULTI-LEVEL ADAPTATION METHODS
|
| 26 |
+
|
| 27 |
+
# 2.1 LAYER-WISE, UNIT-WISE AND PARAMETER-WISE ADAPTATION
|
| 28 |
+
|
| 29 |
+
In the paper on hyper-descent (Baydin et al., 2017), the learning rate is set to be a scalar. However, to make the most of learning rate adaptation, in this study, we introduce layer-wise or even parameterwise updating rules, where the learning rate $\pmb { \alpha } _ { t }$ in each iteration time step is considered to be a vector (layer-wise) or even a list of matrices (parameter-wise). For the sake of simplicity, we collect all the learning rates in a vector: ${ \pmb { \alpha } } _ { t } = ( \alpha _ { 1 , t } , . . . , \alpha _ { N , t } ) ^ { T }$ . Correspondingly, the objective $f ( \pmb \theta )$ is a function of $\pmb { \theta } = ( \theta _ { 1 } , \theta _ { 2 } , . . . , \theta _ { N } ) ^ { T }$ , collecting all the model parameters. In this case, the derivative of the objective function $f$ with respect to each learning rate can be written as
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\frac { \partial f ( \theta _ { t - 1 } ) } { \partial \alpha _ { i , t - 1 } } = \frac { \partial f ( \theta _ { 1 , t - 1 } , . . . , \theta _ { N , t - 1 } ) } { \partial \alpha _ { i , t - 1 } } = \sum _ { j = 1 } ^ { N } \frac { \partial f ( \theta _ { 1 , t - 1 } , . . . , \theta _ { N , t - 1 } ) } { \partial \theta _ { j , t - 1 } } \frac { \partial \theta _ { j , t - 1 } } { \partial \alpha _ { i , t - 1 } } ,
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
where $N$ is the total number of all the model parameters. Eq. (1) can be generalized to groupwise updating, where we associate a learning rate with a special group of parameters, and each parameter group is updated according to its only learning rate. Notice that although there is a dependency between $\alpha _ { t - 1 }$ and $\theta _ { t - 2 }$ with: $\alpha _ { t - 1 } = \alpha _ { t - 2 } - \beta \nabla f ( \theta _ { t - 2 } )$ , where $\beta$ is the updating rate of hyper-gradient descent, we consider that $\alpha _ { t - 1 }$ is calculated after $\theta _ { t - 2 }$ and thus a change of $\alpha _ { t - 1 }$ will not result in a change of $\theta _ { t - 2 }$ . Assume $\pmb \theta _ { t } = u ( \pmb \Theta _ { t - 1 } , \alpha )$ is the updating rule, where $\Theta _ { t } = \{ \pmb { \theta } _ { s } \} _ { s = 0 } ^ { t }$ and $\alpha$ is the learning rate, then the basic gradient descent method for each group $i$ gives $\pmb { \theta } _ { i , t } = u ( \pmb { \Theta } _ { t - 1 } , \alpha _ { i , t - 1 } ) = \pmb { \theta } _ { i , t - 1 } - \alpha _ { i , t - 1 } \nabla _ { \pmb { \theta } _ { i } } f ( \pmb { \theta } _ { t - 1 } )$ . Hence for gradient descent
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\frac { \partial f ( \pmb { \theta } _ { t - 1 } ) } { \partial \alpha _ { i , t - 1 } } = \nabla _ { \pmb { \theta } _ { i } } f ( \pmb { \theta } _ { t - 1 } ) ^ { T } \nabla _ { \alpha _ { i , t - 1 } } u ( \pmb { \Theta } _ { t - 1 } , \alpha _ { i , t - 1 } ) = - \nabla _ { \pmb { \theta } _ { i } } f ( \pmb { \theta } _ { t - 1 } ) ^ { T } \nabla _ { \pmb { \theta } _ { i } } f ( \pmb { \theta } _ { t - 2 } ) .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Here $\alpha _ { i , t - 1 }$ is a scalar with index $i$ at time step $t - 1$ , corresponding to the learning rate of the ith group, while the shape of $\nabla _ { \pmb { \theta } _ { i } } f ( \pmb { \theta } )$ is the same as the shape of $\theta _ { i }$ . We particularly consider two special cases: (1) In layer-wise adaptation, $\theta _ { i }$ is the weight matrix of ith layer, and $\alpha _ { i }$ is the particular learning rate for this layer. (2) In parameter-wise adaptation, $\theta _ { i }$ corresponds to a certain parameter involved in the model, which can be an element of the weight matrix in a certain layer.
|
| 42 |
+
|
| 43 |
+
# 2.2 REGULARIZATION ON ADAPTIVE LEARNING RATES
|
| 44 |
+
|
| 45 |
+
The selection of adaptation level should depend on a case-by-case basis. Global or parameter-wise adaptation is usually not the optimal choice across all circumstances. Recall that for deep neural networks, we typically use a relatively large architecture with regularization. This idea can also be applied to learning rate space with parameter structure. To address over-parameterization in implementing lower-level learning rate adaptation, we introduce regularization on learning rates to control the flexibility. First, for layer-wise adaptation, we can add the following regularization term to the loss function
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
L _ { \mathrm { l r \_ r e g \_ l a y e r } } = \lambda _ { \mathrm { l a y e r } } \sum _ { l } ( \alpha _ { l } - \alpha _ { g } ) ^ { 2 } ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $l$ is the indices for each layer, $\lambda _ { \mathrm { l a y e r } }$ is the layer-wise regularization coefficient, $\alpha _ { l }$ and $\alpha _ { g }$ are the layer-wise and global-wise adaptive learning rates. A larger $\lambda _ { \mathrm { l a y e r } }$ can push each layer’s learning rate towards the global learning rate across all the layers. Given a particular $\alpha _ { g , t }$ , the gradient of the loss function with respect to the learning rate $\alpha _ { l }$ in layer $l$ can be written as
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \frac { \partial L _ { \mathrm { f u l l } } ( \theta , \alpha ) } { \partial \alpha _ { l , t } } = \frac { \partial L _ { \mathrm { m o d e l } } ( \theta , \alpha ) } { \partial \alpha _ { l , t } } + \frac { \partial L _ { \mathrm { l r _ { \mathrm { - } } r e g } } ( \theta , \alpha ) } { \partial \alpha _ { l , t } } } \\ & { \qquad = \nabla _ { \theta _ { l } } f ( \theta _ { t - 1 } ) ^ { T } \nabla _ { \alpha _ { l , t - 1 } } u ( \Theta _ { t - 2 } , \alpha _ { t - 1 } ) + 2 \lambda _ { \mathrm { l a y e r } } ( \alpha _ { l , t } - \alpha _ { g , t } ) . } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Notice that the time step index of layer-wise regularization term is $t$ rather than $t - 1$ , which ensures that we push the layer-wise learning rates towards the corresponding global learning rates of the current step $t$ . Denoting by $h _ { l , t - 1 } = - \nabla _ { \theta _ { l } } f ( \theta _ { t - 1 } ) ^ { T } \nabla _ { \theta _ { l } } u ( \Theta _ { t - 2 } , \alpha _ { l , t - 1 } )$ , then the updating rule for learning rates can be written as
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\alpha _ { l , t } = \alpha _ { l , t - 1 } - \beta \frac { \partial L _ { \mathrm { f u l l } } ( \pmb { \theta } , \alpha ) } { \partial \alpha _ { l , t } } = \alpha _ { l , t - 1 } - \beta ( - h _ { l , t - 1 } + 2 \lambda _ { \mathrm { l a y e r } } ( \alpha _ { l , t } - \alpha _ { g , t } ) ) .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Eq. (5) has a close form solution but only applicable in the two-levels case. However, there is an extra hyper-parameter $\lambda _ { \mathrm { l a y e r } }$ to be tuned. In addition, when there are more levels, components of learning rates at different levels can be interdependent. To construct a workable updating scheme for Eq. (5), we replace $\alpha _ { l , t }$ and $\alpha _ { g , t }$ with their relevant approximations. We take the strategy of using their updated version without considering regularization, i.e., $\hat { \alpha } _ { l , t } = \alpha _ { l , t - 1 } + \beta h _ { l , t - 1 }$ and $\hat { \alpha } _ { g , t } = \alpha _ { g , t - 1 } + \beta h _ { g , t - 1 }$ , where $h _ { g , t - 1 } = - \nabla _ { \pmb { \theta } } f ( \pmb { \theta } _ { t - 1 } ) ^ { T } \nabla _ { \alpha _ { g , t - 1 } } u ( \pmb { \Theta } _ { t - 2 } , \alpha _ { g , t - 1 } )$ is the global $h$ for all parameters. Here we regard $\hat { \alpha } _ { l , t }$ and $\hat { \alpha } _ { g , t }$ as the “virtual” layer-wise and global-wise learning rates for time step $t$ and taking them into the right-hand side of Eq. (5) gives the new updating rule as follows
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\alpha _ { l , t } ^ { * } = \alpha _ { l , t - 1 } + \beta h _ { l , t - 1 } - 2 \beta \lambda _ { \mathrm { l a y e r } } ( \hat { \alpha } _ { l , t } - \hat { \alpha } _ { g , t } ) = ( 1 - 2 \beta \lambda _ { \mathrm { l a y e r } } ) \hat { \alpha } _ { l , t } + 2 \beta \lambda _ { \mathrm { l a y e r } } \hat { \alpha } _ { g , t } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Notice that in Eq. (6), the two terms are actually a weighted average of the layer-wise learning rate $\hat { \alpha } _ { l , t }$ and global learning rate $\hat { \alpha } _ { g , t }$ at the current time step. Since we hope to push the layer-wise learning rates towards the global one, the parameters should meet the constraint: $0 < 2 \beta \lambda _ { \mathrm { l a y e r } } < 1$ , and thus they can be optimized using hyper-parameter searching within a bounded interval as well as gradient-based hyper-parameter optimizations. We can also consider the case where three levels of learning rate adaptations are involved, including global-wise, layer-wise, and parameter-wise adaptation. If we introduce two more regularization terms to control the variation of parameter-wise learning rate with respect to layer-wise learning rate and global learning rates, the regularization loss can be written as
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
L _ { \mathrm { l r . r e g . p a r a } } = \lambda _ { \mathrm { l a y e r } } \sum _ { l } ( \alpha _ { l } - \alpha _ { g } ) ^ { 2 } + \lambda _ { \mathrm { p a r a . l a y e r } } \sum _ { l } \sum _ { p } ( \alpha _ { p l } - \alpha _ { l } ) ^ { 2 } + \lambda _ { \mathrm { p a r a } } \sum _ { l } \sum _ { p } ( \alpha _ { p l } - \alpha _ { g } ) ^ { 2 } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\alpha _ { p l }$ is the learning rate for the $p$ -th parameter inside layer $l$ . The second and third terms push each parameter-wise learning rate towards the layer-wise learning rate and the global learning rates, respectively. Like the two-level case, the updating rule with this three-level regularization can be approximated by the weighted combination of three components under “virtual approximation”. The detail of the updating rule for the three-levels case is given by Algorithm 1 in Section 2.3. We also provided a discussion on the bias of implementing “virtual approximation” in Appendix A.1.
|
| 76 |
+
|
| 77 |
+
In general, we can organize all the learning rates in a tree structure. For example, in the three-level case above, $\alpha _ { g }$ will be the root node, while $\left\{ \alpha _ { l } \right\}$ are the children node at level 1 of the tree and $\{ \alpha _ { l p } \}$ are the children node of $\alpha _ { l }$ as leaf nodes at level three of the tree. In a general case, we assume there are $L$ levels in the tree. Denote the set of all the paths from the root node to each of leave nodes as $\mathcal { P }$ and a path is denoted by $p = \{ \alpha _ { 1 } , \alpha _ { 2 } , . . . , \bar { \alpha _ { L } } \}$ where $\alpha _ { 1 }$ is the root node, and $\alpha _ { L }$ is the left node on the path. On this path, denote ancestors $( i )$ all the ancestor nodes of $\alpha _ { i }$ along the path, i.e., ancestors $\mathbf { \alpha } ( i ) = \{ \alpha _ { 1 } , . . . , \alpha _ { i - 1 } \}$ . We will construct a regularizer to push $\alpha _ { i }$ towards each of its parents. Then the regularization can be written as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
L _ { \mathrm { l r _ { - } r e g } } = \sum _ { p \in \mathcal { P } } \sum _ { \alpha _ { i } \in p } \sum _ { \alpha _ { j } \in \mathrm { a n c e s t o r } ( i ) } \lambda _ { i j } ( \alpha _ { i } - \alpha _ { j } ) ^ { 2 } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Under this pair-wise $L _ { 2 }$ regularization, the updating rule for any leave node learning rate $\alpha _ { L }$ can be given by the following theorem whose proof is provided in Appendix A.2.
|
| 84 |
+
|
| 85 |
+
Theorem 1. Under virtual approximation, the effect of applying pair-wise $L _ { 2 }$ regularization Eq. (7) results in performing a weighted linear combination of virtual learning rates at different levels $\begin{array} { r } { \alpha _ { L } ^ { * } = \sum _ { j = 1 } ^ { \bar { L } } \gamma _ { j } \hat { \alpha } _ { j } } \end{array}$ with $\textstyle \sum _ { j = 1 } ^ { L } \gamma _ { j } \ = \ 1$ , where each component ${ \hat { \alpha } } _ { j }$ is calculated by assuming no regularization.
|
| 86 |
+
|
| 87 |
+
Remarks: Theorem 1 actually suggests that a similar updating rule can be obtained for the learning rate at any level on the path. All these have been demonstrated in Algorithm 1 for the three-level case.
|
| 88 |
+
|
| 89 |
+
# 2.3 PROSPECTIVE OF ADAPTIVE LEARNING RATE COMBINATION
|
| 90 |
+
|
| 91 |
+
Motivated by the analytical derivation in Section 2.2, we can consider combining adaptive learning rates at different levels as a substitute and approximation of regularization on the differences in learning rates. This makes the effect of learning rate regularization trainable with gradient-based methods. In a general form, assume that we have $L$ levels, which could include global-level, $\begin{array} { r } { \dot { \alpha _ { t } } = \sum _ { j = 1 } ^ { L } \gamma _ { j } \hat { \alpha } _ { j , t } } \end{array}$ vel and parameter-level, etc, Theorem 1 suggests the following updating rule:. In a more general form, we can implement non-linear models such as neural networks to model the final adaptive learning rates with respect to the learning rates at different levels: $\alpha _ { t } = g ( \hat { \alpha } _ { 1 , t } , \hat { \alpha } _ { 2 , t } . . . \hat { \alpha } _ { L , t } ; \theta )$ , where $\theta$ is the vector of parameters of the non-linear model. We can treat the combination weights $\{ \gamma _ { 1 } , . . . , \gamma _ { L } \}$ as trainable parameters, which can also be globally shared or parameter/layer-specific. In this study, we consider the globally shared combination weights. We only need these different levels of learning rate to have a hierarchical relationship to apply this method. For example, we can further introduce “filter level” to replace layer-level for the convolutional neural network if there is no clear layer structure, where the parameters in each filter will share the same learning rate.
|
| 92 |
+
|
| 93 |
+
As the real learning rates implemented in model parameter updating are weighted combinations, the corresponding gradient matrices cannot be directly used for learning rate updating. In this case, we first break down the gradient by the combined learning rate to three levels, use each of them to update the learning rate at each level, and then calculate the combination by the updated learning rates. Especially, $h _ { p , t } , h _ { l , t }$ and $h _ { g , t }$ are calculated by the gradients of model losses without regularization, as is shown in Eq. (8)1.
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { \displaystyle h _ { p , t } = \frac { \partial f ( \pmb { \theta } , \alpha ) } { \partial \alpha _ { p , t } } = - \nabla _ { \pmb { \theta } } f ( \pmb { \theta } _ { t - 1 } , \alpha ) | _ { p } \cdot \nabla _ { \alpha } u ( \pmb { \Theta } _ { t - 2 } , \alpha ) | _ { p } } \\ & { \displaystyle h _ { l , t } = \frac { \partial f ( \pmb { \theta } , \alpha ) } { \partial \alpha _ { l , t } } = - \mathrm { t r } ( \nabla _ { \pmb { \theta } } f ( \pmb { \theta } _ { t - 1 } , \alpha ) | _ { l } ^ { T } \nabla _ { \alpha } u ( \pmb { \Theta } _ { t - 2 } , \alpha ) | _ { l } ) } \\ & { \displaystyle h _ { g , t } = \frac { \partial f ( \pmb { \theta } , \alpha ) } { \partial \alpha _ { t } } = - \sum _ { l = 1 } ^ { n } \mathrm { t r } ( \nabla _ { \pmb { \theta } } f ( \pmb { \theta } _ { t - 1 } , \alpha ) | _ { l } ^ { T } \nabla _ { \alpha } u ( \pmb { \Theta } _ { t - 2 } , \alpha ) _ { l } ) } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\begin{array} { r } { h _ { t } = \sum _ { l } h _ { l , t } = \sum _ { p } h _ { p , t } } \end{array}$ and $\begin{array} { r } { h _ { l , t } = \sum _ { p \in l \mathrm { t h } \ : \mathrm { l a y e r } } h _ { p } } \end{array}$ and $f ( \theta , \alpha )$ corresponds to the model loss $L _ { m o d e l } ( \theta , \alpha )$ in Section 2.2. Algorithm 1 is the full updating rules for the newly proposed optimizer with three levels, which can be denoted as combined adaptive multi-level hyper-gradient descent (CAM-HD). In Algorithm 1, we introduce the general form of gradient descent based optimizers (Reddi et al., 2018; Luo et al., 2018): for SGD, $\phi _ { t } ( g _ { 1 } , . . . g _ { t } ) = g _ { t }$ and $\psi _ { t } ( g _ { 1 } , . . . g _ { t } ) = 1$ , while
|
| 100 |
+
|
| 101 |
+
Algorithm 1: Updating the rule of three-level CAM-HD
|
| 102 |
+
end return $\theta _ { T }$ , $\gamma _ { 1 , T } , \gamma _ { 2 , T } , \gamma _ { 3 , T } , \alpha _ { p , T } , \alpha _ { l , T } , \alpha _ { T }$
|
| 103 |
+
|
| 104 |
+
<table><tr><td>input: αo, β, δ,T initialization: 00, γ1,0, 72,0, Y3,0, αp,0, a1,0, a0,α0 = Y1,0αp,0 + Y2,0at,0 + 73,000 for t ∈1,2,...,T do</td></tr><tr><td>gt =Vef(0,a) Update hp,t, hl,t and hg,t by Eq. (8).</td></tr><tr><td></td></tr><tr><td>dap,t-1 of(0t-1)0p.t-1 α,t = α,t-1- β∑p = αl,t-1- βtγ2,t-1∑php,t =αl,t-1- βγ2,t-1hl,t</td></tr><tr><td>dα,t-1 af(0) 0pt-1</td></tr><tr><td>=αt-1-βgY3,t-1hg,t ap,t = Y1t-1pt+72,t-1t+3tt</td></tr><tr><td>aL =1,t-1-δ∑p aL 1=γ1,t-1-δap,t-1∑p γ1,t =γ1,t-1-δ 8L Y1,t-1 DY1,t-1</td></tr><tr><td>t-1 3L 8L =γ1,t-1-δa,t-1∑p aL 22,t = 72,t-1-8 Y2,t-1 Dy2,t-1</td></tr><tr><td>aL t-1 aL =γ3,t-1-δat-1∑p at-1 aL Y3,t-1</td></tr><tr><td>γ1=γ1/(γ1+γ2+γ3),γ2=γ1/(γ1+γ2+3),3=γ1/(γ1+2+γ3)</td></tr><tr><td>mt =t(g1,..gt)</td></tr><tr><td>Vt =t(g1,..gt)</td></tr><tr><td>0t=0t-1-αptmt/√Vt</td></tr><tr><td></td></tr></table>
|
| 105 |
+
|
| 106 |
+
for Adam, Meanwhile $\phi _ { t } ( g _ { 1 } , . . . g _ { t } ) \ : = \ : ( 1 - \beta _ { 1 } ) \Sigma _ { i = 1 } ^ { t } \beta _ { 1 } ^ { t - 1 } g _ { i }$ and ld b $\psi _ { t } ( g _ { 1 } , . . . g _ { t } ) = ( 1 - \beta _ { 2 } ) \mathtt { d i a g } ( \Sigma _ { i = 1 } ^ { t } \beta _ { 2 } ^ { t - 1 } g _ { i } ^ { 2 } )$ $u ( \Theta _ { t - 2 } , \alpha )$
|
| 107 |
+
updating time step of Algorithm 1, we re-normalize the combination weights $\gamma _ { 1 } , \gamma _ { 2 }$ and $\gamma _ { 3 }$ to ensure that their summation is always 1 even after updating with stochastic gradient-based methods. An alternative way of doing this is to implement Softmax function. In addition, the training of $\gamma \mathbf { s }$ can also be extended to multi-level cases, which means we can have different combination weights in different layers. For the updating rates $\beta _ { p }$ , $\beta _ { l }$ and $\beta _ { g }$ of the learning rates at different levels, we set: $\beta _ { p } = n _ { p } \beta \stackrel { \cdot } { = } \beta$ , $\beta _ { l } = n _ { l } \beta$ , $\beta _ { g } = n \beta$ , where $\beta$ is a shared parameter. This setting will make the updating steps of learning rates at different levels be on the same scale considering their difference in the number of parameters. An alternative way is to take the average based on the number of parameters in Eq. (8) at first.
|
| 108 |
+
|
| 109 |
+
# 2.4 CONVERGENCE ANALYSIS AND ALGORITHM COMPLEXITY
|
| 110 |
+
|
| 111 |
+
The proposed CAM-HD is not an independent optimization method, which can be applied in any gradient-based updating rules. Its convergence properties highly depend on the base optimizer that is applied. By referring to the discussion on convergence in (Baydin et al., 2017), we introduce $\kappa _ { p , t } \bar { = } \tau ( t ) \alpha _ { p , t } ^ { \dot { * } } + ( 1 - \bar { \tau } ( t ) ) \alpha _ { \infty }$ , where the function $\tau ( t )$ is selected to satisfy $t \tau ( t ) 0$ as $t \to \infty$ and $\alpha _ { \infty }$ is a chosen constant value. Then we can demonstrate the convergence analysis for the three-level case in the following theorem.
|
| 112 |
+
|
| 113 |
+
Theorem 2 (Convergence under mild assumptions about $f$ ). Suppose that $f$ is convex and $L$ -Lipschitz smooth with $\| \nabla _ { p } f ( \theta ) \| < M _ { p }$ , $\| \nabla _ { l } f ( \theta ) \| < M _ { l }$ , $\| \nabla _ { g } f ( \theta ) \| < M _ { g }$ for some fixed $M _ { p }$ , $M _ { l }$ , $M _ { g }$ and all $\theta$ . Then $\theta _ { t } \ \to \ \theta ^ { * }$ if $\alpha _ { \infty } < 1 / L$ where $L$ is the Lipschitz constant for all the gradients and $t \cdot \tau ( t ) 0$ as $t \to \infty$ , where the $\theta _ { t }$ are generated according to (non-stochastic) gradient descent.
|
| 114 |
+
|
| 115 |
+
In the above theorem, $\nabla _ { p }$ is the gradient of target function w.r.t. a model parameter with index $p$ , $\nabla _ { l }$ is the average gradient of target function w.r.t. parameters in a layer with index $l$ , and $\nabla _ { g }$ is the global average gradient of target function w.r.t. all model parameters. The proof of this theorem is given in Appendix A.3. Notice that when we introduce $\kappa _ { p , t }$ instead of $\alpha _ { p , t } ^ { * }$ in Algorithm 1, the corresponding gradients $\frac { \partial L ( \theta ) } { \partial \alpha _ { p , t - 1 } ^ { * } }$ will also be replaced by $\begin{array} { r } { \frac { \partial L ( \theta ) } { \partial \kappa _ { p , t - 1 } ^ { * } } \frac { \partial \kappa _ { p , t - 1 } ^ { * } } { \partial \alpha _ { p , t - 1 } ^ { * } } = \frac { \partial L ( \theta ) } { \partial \kappa _ { p , t - 1 } ^ { * } } \tau ( t ) } \end{array}$ .
|
| 116 |
+
|
| 117 |
+
We also made an analysis on the number of parameters and algorithm complexity (See Appendix A.4). Our method will not increase the number of model parameters but requires extra space complexity $\Delta T$ during training. Also it requires an extra time complexity but at least one-order smaller than training with baseline setting, while the absolute ratio is smaller than the inverse of batch size $\begin{array} { c c c } { { \frac { \Delta T } { T } < < 1 / m \overline { { { b } } } } } \end{array}$
|
| 118 |
+
|
| 119 |
+
# 3 EXPERIMENTS
|
| 120 |
+
|
| 121 |
+
We use the feed-forward neural network models and different types of convolutions neural networks on multiple benchmark datasets to compare with existing baseline optimizers.For each learning task, the following optimizers will be applied: (a) standard baseline optimizers such as Adam and SGD; (b) hyper-gradient descent in (Baydin et al., 2017); (c) L4 stepsize adaptation for standard optimizers (Rolinek and Martius, 2018); (d) Adabound optimizer (Luo et al., 2018); (e) RAdam optimizer (Liu et al., 2019); and (f) the proposed adaptive combination of different levels of hyper-descent. The implementation of (b) is based on the code provided with the original paper. For each experiment, we provide the average curve and standard error bar in each time step with ten runs.
|
| 122 |
+
|
| 123 |
+
# 3.1 HYPER-PARAMETER TUNING
|
| 124 |
+
|
| 125 |
+
To compare the effect of CAM-HD with baseline optimizers, we first do hyperparameter tuning for the model training process with baseline optimizers by referring to related papers (Kingma and Ba, 2015; Baydin et al., 2017; Rolinek and Martius, 2018; Luo et al., 2018) as well as implementing an independent grid search. We mainly consider the hyper-parameters of batch size, learning rate, and momentum for models with different architecture. The search space for batch size is the set of $\{ 2 ^ { n } \} _ { n = 3 , \ldots , 9 }$ , while the search space for learning rate, hyper-gradient updating rate and combination weight updating rate (CAM-HD-lr) are $\{ 1 0 ^ { - 1 } , . . . , 1 0 ^ { - 4 } \}$ , $\{ 1 0 ^ { - 1 } , . . . , 1 0 ^ { - 1 0 } \}$ and $\{ 1 0 ^ { - 1 } , . . . , 1 0 ^ { - 4 } \}$ respectively. The selection criterion is the 5-fold cross-validation loss by early-stopping at the patience of 3. The optimized hyper-parameters for the tasks in this paper are given in Table 1. For the learning tasks with recommended learning rate schedules, we will apply these schedules as well.
|
| 126 |
+
|
| 127 |
+
Table 1: Hyperparameter Settings for Experiments
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Architecture</td><td>Dataset</td><td>Batch size</td><td>lr (SGD/SGDN)</td><td>lr (Adam)</td><td>Hyper-gradlr (SGD/SGDN)</td><td>Hyper-grad lr (Adam)</td><td>CAM-HD-lr</td></tr><tr><td>MLP1</td><td></td><td>32</td><td>=</td><td>0.0003</td><td>-</td><td>1.00E-07</td><td>0.01</td></tr><tr><td>MLP 2</td><td rowspan="3">MNIST</td><td>64</td><td></td><td>0.001</td><td></td><td>1.00E-07</td><td>0.01</td></tr><tr><td>MLP3</td><td>128</td><td></td><td>0.001</td><td>=</td><td>1.00E-07</td><td>0.01</td></tr><tr><td></td><td>256</td><td></td><td>0.001</td><td>1.00E-03</td><td>1.00E-08</td><td>0.03</td></tr><tr><td rowspan="3">LeNet-5</td><td>CIFAR10</td><td>256</td><td></td><td>0.001</td><td>1.00E-03</td><td>1.00E-08</td><td>0.03</td></tr><tr><td>SVHN</td><td>128</td><td>=</td><td>0.001</td><td>1.00E-03</td><td>1.00E-08</td><td>0.03</td></tr><tr><td></td><td>256</td><td>0.1</td><td>0.001</td><td>1.00E-06</td><td>1.00E-08</td><td>0.001</td></tr><tr><td>ResNet-18 ResNet-34</td><td>CIFAR10</td><td>256</td><td>0.1</td><td>0.001</td><td>1.00E-06</td><td>1.00E-08</td><td>0.001</td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 3.2 COMBINATION RATIO AND MODEL PERFORMANCES
|
| 132 |
+
|
| 133 |
+
First, we perform a study on the combination of different level learning rates. The simulations are based on image classification tasks on MNIST and CIFAR10 (LeCun et al., 1998; Krizhevsky and Hinton, 2012). One feed-forward neural network with three hidden layers of size [100, 100, 100] and two convolutional network models, including LeNet-5 (LeCun et al., 2015) and ResNet-18 (He et al., 2016), are implemented. We use full training sets of MNIST and CIFAR10 for training and full test sets for validation. In each case, two levels of learning rates are considered, which are the global and layer-wise adaptation for FFNN, and global and filter-wise adaptation for CNNs. Adam-CAM-HD optimizer is implemented in all three simulations. We change the combination weights of two levels in each case to see the change of model performance in terms of test classification accuracy at epoch 10, with the corresponding updating rate $\delta = 0$ . Another hyper-parameter setting follows Table 1. We conduct ten runs at each combination weights with different parameter initializations for all three simulations and draw the error bars for standard errors. The result is given in Figure 1. We can see that in all three cases, the optimal performance is neither at full global level nor full layer/filter level, but a combination of two levels of adaptive learning rates. Still, the differences between the endpoints and the optimal combination in terms of model performance have some statistical significance level. This supports our analysis in Section 2.2. Also, in real training processes, it is possible that the learning in favor of different combination weights in various stages and this requires the online updating of the combination weights.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 1: The diagram of model performances (at epoch 10) trained by Adam-CAM-HD with different fixed combination ratios in the case of two-level learning rates adaptation.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 2: The comparison of learning curves of FFNN on MNIST with different adaptive optimizers.
|
| 140 |
+
|
| 141 |
+
# 3.3 FEED FORWARD NEURAL NETWORK FOR IMAGE CLASSIFICATION
|
| 142 |
+
|
| 143 |
+
This experiment is conducted with feed-forward neural networks for image classification on MNIST, including 60,000 training examples and 10,000 test examples. We use the full training set for training and the full test set for validation. Three FFNN with three different hidden layer configurations are implemented, including [100, 100], [1000, 100], and [1000, 1000]. Adaptive optimizers including Adam, Adam-HD with two hyper-gradient updating rates, and proposed Adam-CAM-HD are applied. For Adam-CAM-HD, we apply three-level parameter-layer-global adaptation with initialization of $\gamma _ { 1 } = \gamma _ { 2 } = 0 . 3$ and $\gamma _ { 3 } ~ = ~ 0 . 4$ , and two-level layer-global adaptation with $\gamma _ { 1 } = \gamma _ { 2 } = 0 . 5 .$ . Figure 2 shows the validation accuracy for different optimizers during the training process of 30 epochs. We can learn that both the two-level and three-level Adam-CAM-HD outperform the baseline Adam optimizer with optimized hyper-parameters significantly. For Adam-HD, we find that the default hyper-gradient updating rate $( 1 0 ^ { - 7 } )$ for Adam applied in (Baydin et al., 2017) is not optimal in our experiments, while an optimized one of $1 0 ^ { - 9 }$ can outperform Adam but still worse than Adam-CAM-HD with default hyper-gradient updating rate $( 1 0 ^ { - 7 } )$ .
|
| 144 |
+
|
| 145 |
+
# 3.4 LENET-5 FOR IMAGE CLASSIFICATION
|
| 146 |
+
|
| 147 |
+
The second experiment is done with LeNet-5, an early-year convolutional neural network without involving many building and training tricks. We compare a set of adaptive Adam optimizers including Adam, Adam-HD, Adam-CAM-HD, and L4 for the image classification learning task of MNIST, CIFAR10 and SVHN (Netzer et al., 2011). For Adam-CAM-HD, we apply a two-level setting with filter-wise and global learning rates adaptation and initialize $\gamma _ { 1 } = 0 . 2$ , $\gamma _ { 2 } = 0 . 8$ . We also implement an exponential decay function $\tau ( t ) = \exp ( - r t )$ as was discussed in Section 2.4 with rate $r = 0 . 0 0 2$ , while $t$ is the number of iterations. For L4, we implement the recommended L4 learning rate of 0.15. For Adabound and RAdam, we also apply the recommended hyper-parameters in the original papers. The other hyper-parameter settings are optimized in Table 1. As we can see in Figure 3,
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 3: The comparison of learning curves of training LeNet-5 with different adaptive optimizers.
|
| 151 |
+
|
| 152 |
+
Adam-CAM-HD again shows the advantage over other methods in all the three sub-experiments, except MNIST L4 that could perform better in a later stage. The experiment on CIFAR10 and SVHN indicates that the recommended hyper-parameters for Adabound, RAdam and L4 could fail in some cases with unstable accuracy curves. On the other hand, Adam-HD can not significantly outperform Adam with the recommended and optimized hyper-gradient updating rate shared with Adam-CAM-HD. The corresponding summary of test performance is given in Table 2, in which the test accuracy of Adam-CAM-HD outperform other optimizers on both CIFAR10 and SVHN. Especially, it gives significantly better results than Adam and Adam-HD for all the three datasets.
|
| 153 |
+
|
| 154 |
+
Table 2: Summary of test performances with LeNet-5
|
| 155 |
+
|
| 156 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MNIST</td><td colspan="2">CIFAR10</td><td colspan="2">SVHN</td></tr><tr><td>Test acc</td><td>Test S.E</td><td>Test acc</td><td>Test S.E</td><td>Test acc</td><td>Test S.E</td></tr><tr><td>Adam-CAM-HD</td><td>98.93</td><td>0.07</td><td>65.55</td><td>0.18</td><td>87.58</td><td>0.37</td></tr><tr><td>Adam-HD</td><td>98.83</td><td>0.05</td><td>63.3</td><td>0.66</td><td>86.94</td><td>0.13</td></tr><tr><td>Adam-L4</td><td>99.19</td><td>0.05</td><td>63.76</td><td>0.26</td><td>85.44</td><td>0.42</td></tr><tr><td>Adabound</td><td>99.11</td><td>0.05</td><td>59.79</td><td>0.70</td><td>87.22</td><td>0.14</td></tr><tr><td>RAdam</td><td>98.94</td><td>0.06</td><td>61.17</td><td>0.79</td><td>87.31</td><td>0.41</td></tr><tr><td>Adam</td><td>98.89</td><td>0.05</td><td>63.88</td><td>0.45</td><td>86.82</td><td>0.16</td></tr></table>
|
| 157 |
+
|
| 158 |
+
# 3.5 RESNET FOR IMAGE CLASSIFICATION
|
| 159 |
+
|
| 160 |
+
In the third experiment, we apply ResNets for image classification task on CIFAR10. We compare Adam and its adaptive optimizers, as well as SGD with Nestorov momentum (SGDN) and corresponding adaptive optimizers for training both ResNet-18 and ResNet-34. For SGDN methods, we apply a learning rate schedule, in which the learning rate is initialized to a default value of 0.1 and reduced to 0.01 or $10 \%$ (for SGDN-CAM-HD) after epoch 150. The momentum is set to be 0.9 for all SGDN methods. For Adam-CAM-HD SGDN-CAM-HD, we apply two-level CAM-HD with the same setting as the second experiment. In addition, we apply an exponential decay function with a decay rate $r = 0 . 0 0 1$ . The validation accuracy results, training loss, and validation loss are shown in Figure 4. We can see that the validation accuracy of Adam-CAM-HD reaches about $90 \%$ in 40 epochs and consistently outperforms Adam, L4 and Adam-HD optimizers in a later stage. The L4 optimizer with recommended hyper-parameter and an optimized weight-decay rate of 0.0005 (instead of 1e-4 applied in other Adam-based optimizers) can outperform baseline Adam for both ResNet-18 and ResNet-34, while its training loss outperforms all other methods but with potential over-fitting. Adam-HD achieves better training loss than Adam after epoch 100. However, we find that the validation performance is not good with a default hyper-gradient coefficient of $1 0 ^ { - 8 }$ (shared with Adam-CAM-HD). Instead, an optimized coefficient of $1 0 ^ { - 9 }$ can make a safe but small improvement from Adam. RAdam performs slightly better than Adam-CAM-HD in terms of validation accuracy, but the validation cross-entropy of both RAdam and Adabound are worse than our method. Also, we find that in training ResNet-18/34, the validation accuracy and validation loss of SGDN-CAM-HD slightly outperform SGDN in most epochs even after the resetting of the learning rate at epoch 150.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 4: The learning curves of training ResNet on CIFAR10 with adaptive optimizers.
|
| 164 |
+
|
| 165 |
+
The test performances of different optimizers for ResNet-18 and ResNet-34 after 200 epoch of training are shown in Table 3. Notice that the results of SGDN and SGDN-CAM-HD are achieved with a piece-wise constant learning rates schedule, while the results of Adam-based optimizers are achieved without a learning rate schedule. We can learn that the proposed CAMHD method can improve the corresponding baseline method (Adam, Adam-HD and SGDN)
|
| 166 |
+
|
| 167 |
+
Table 3: Summary of test performances with ResNet-18/34
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2"></td><td colspan="2">ResNet-18</td><td colspan="2">ResNet-34</td></tr><tr><td>Test acc</td><td>Test S.E</td><td>Test acc</td><td>Test S.E</td></tr><tr><td>Adam</td><td>86.94</td><td>0.13</td><td>87.87</td><td>0.2</td></tr><tr><td>Adam-HD</td><td>87.26</td><td>0.35</td><td>88.48</td><td>0.48</td></tr><tr><td>Adam-L4</td><td>87.81</td><td>0.22</td><td>88.02</td><td>0.15</td></tr><tr><td>Adabound</td><td>90.29</td><td>0.15</td><td>90.15</td><td>0.30</td></tr><tr><td>RAdam</td><td>91.54</td><td>0.17</td><td>91.76</td><td>0.28</td></tr><tr><td>Adam-CAM-HD</td><td>90.10</td><td>0.23</td><td>90.18</td><td>0.06</td></tr><tr><td>SGDN</td><td>93.04</td><td>0.23</td><td>92.93</td><td>0.19</td></tr><tr><td>SGDN-CAM-HD</td><td>93.2</td><td>0.24</td><td>93.47</td><td>0.23</td></tr></table>
|
| 170 |
+
|
| 171 |
+
with statistical significance in almost every case. Adam-CAM-HD performs a bit worse than RAdam but comparable to Adabound in terms of the average test accuracy for both ResNet-18 and ResNet-34. As a higher-level adaptation method, CAM-HD can be applied on top of RAdam/Adabound/L4 for further improvement.
|
| 172 |
+
|
| 173 |
+
# 4 CONCLUSION
|
| 174 |
+
|
| 175 |
+
In this study, we propose a gradient-based learning rate adaptation strategy by introducing hierarchical multiple-level learning rates in deep neural networks. By considering the relationship between regularization and the combination of adaptive learning rate at different levels, we further propose a joint algorithm for adaptively learning each level’s combination weight. Experiments on FFNN, LeNet-5, and ResNet-18/34 indicate that the proposed methods can outperform the standard ADAM/SGDN and other baseline methods with statistical significance. Although the advantage is not fully guaranteed, our method achieves a higher adaptation level and can be continuously reduced to baseline methods under a specific set of hyper-parameters. This could bring more thoughts and further study on implementing a hierarchical learning rate system for deep neural networks.
|
| 176 |
+
|
| 177 |
+
REFERENCES
|
| 178 |
+
L. B. Almeida, T. Langlois, J. D. Amaral, and A. Plakhov. Parameter adaptation in stochastic optimization. On-Line Learning in Neural Networks, Publications of the Newton Institute, pages 111–134, 1998.
|
| 179 |
+
M. Andrychowicz, M. Denil, S. Gomez, M. W. Hoffman, D. Pfau, T. Schaul, B. Shillingford, and N. De Freitas. Learning to learn by gradient descent by gradient descent. In NeurIPS, pages 3981–3989, 2016.
|
| 180 |
+
A. G. Baydin, R. Cornish, D. M. Rubio, M. Schmidt, and F. Wood. Online learning rate adaptation with hypergradient descent. ICLR, 2017.
|
| 181 |
+
A. G. Baydin, B. A. Pearlmutter, A. A. Radul, and J. M. Siskind. Automatic differentiation in machine learning: a survey. JMLR, 18(153), 2018.
|
| 182 |
+
J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12:2121–2159, 2011.
|
| 183 |
+
L. Franceschi, M. Donini, P. Frasconi, and M. Pontil. Forward and reverse gradient-based hyperparameter optimization. In ICML, pages 1165–1173. JMLR. org, 2017.
|
| 184 |
+
K. He and J. Sun. Convolutional neural networks at constrained time cost. In CVPR, pages 5353–5360, 2015.
|
| 185 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
|
| 186 |
+
H. Karimi, J. Nutini, and M. Schmidt. Linear convergence of gradient and proximal-gradient methods under the polyak-łojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 795–811. Springer, 2016.
|
| 187 |
+
D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. ICLR, 2015.
|
| 188 |
+
A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. University of Toronto, 2012.
|
| 189 |
+
H. Lang, L. Xiao, and P. Zhang. Using statistics to automate stochastic optimization. In Advances in Neural Information Processing Systems, pages 9540–9550, 2019.
|
| 190 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 191 |
+
Y. LeCun et al. Lenet-5, convolutional neural networks. URL: http://yann. lecun. com/exdb/lenet, 20: 5, 2015.
|
| 192 |
+
Z. Li and S. Arora. An exponential learning rate schedule for deep learning. In International Conference on Learning Representations, 2019.
|
| 193 |
+
L. Liu, H. Jiang, P. He, W. Chen, X. Liu, J. Gao, and J. Han. On the variance of the adaptive learning rate and beyond. In ICLR, 2019.
|
| 194 |
+
I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient descent with warm restarts. 2017.
|
| 195 |
+
L. Luo, Y. Xiong, Y. Liu, and X. Sun. Adaptive gradient methods with dynamic bound of learning rate. In ICLR, 2018.
|
| 196 |
+
K. Lv, S. Jiang, and J. Li. Learning gradient descent: Better generalization and longer horizons. In ICML, pages 2247–2255. JMLR. org, 2017.
|
| 197 |
+
D. Maclaurin, D. Duvenaud, and R. Adams. Gradient-based hyperparameter optimization through reversible learning. In ICML, pages 2113–2122, 2015.
|
| 198 |
+
Y. Netzer, T. Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011. URL http://ufldl.stanford.edu/housenumbers/ nips2011_housenumbers.pdf.
|
| 199 |
+
B. O’donoghue and E. Candes. Adaptive restart for accelerated gradient schemes. Foundations of computational mathematics, 15(3):715–732, 2015.
|
| 200 |
+
S. J. Reddi, S. Kale, and S. Kumar. On the convergence of adam and beyond. In ICLR, 2018.
|
| 201 |
+
M. Rolinek and G. Martius. L4: Practical loss-based stepsize adaptation for deep learning. In NeurIPS, pages 6433–6443, 2018.
|
| 202 |
+
S. Ruder. An overview of gradient descent optimization algorithms. arXiv:1609.04747, 2016.
|
| 203 |
+
N. N. Schraudolph. Local gain adaptation in stochastic gradient descent. In 1999 Ninth International Conference on Artificial Neural Networks ICANN 99. (Conf. Publ. No. 470), volume 2, pages 569–574 vol.2, 1999.
|
| 204 |
+
R. Sun. Optimization for deep learning: theory and algorithms. arXiv:1912.08957, 2019.
|
| 205 |
+
R. S. Sutton. Gain adaptation beats least squares. In Proceedings of the 7th Yale workshop on adaptive and learning systems, volume 161168, 1992.
|
| 206 |
+
T. Tieleman and G. Hinton. Rmsprop: Divide the gradient by a running average of its recent magnitude. coursera: Neural networks for machine learning. Tech. Rep., Technical report, page 31, 2012.
|
| 207 |
+
O. Wichrowska, N. Maheswaranathan, M. W. Hoffman, S. G. Colmenarejo, M. Denil, N. de Freitas, and J. Sohl-Dickstein. Learned optimizers that scale and generalize. In ICML, pages 3751–3760. JMLR. org, 2017.
|
| 208 |
+
J. Yu, D. Aberdeen, and N. N. Schraudolph. Fast online policy gradient learning with smd gain vector adaptation. In NeurIPS, pages 1185–1192, 2006.
|
| 209 |
+
M. Zhang, J. Lucas, J. Ba, and G. E. Hinton. Lookahead optimizer: k steps forward, 1 step back. In NeurIPS, pages 9593–9604, 2019.
|
| 210 |
+
P. Zhang, H. Lang, Q. Liu, and L. Xiao. Statistical adaptive stochastic gradient methods. arXiv:2002.10597, 2020.
|
| 211 |
+
|
| 212 |
+
# A APPENDIX FOR PAPER: ADAPTIVE MULTI-LEVEL HYPER-GRADIENT DESCENT
|
| 213 |
+
|
| 214 |
+
A.1 ANALYSIS ABOUT VIRTUAL APPROXIMATION
|
| 215 |
+
|
| 216 |
+
Consider the difference between Eq. (5) and Eq. (6) in the paper:
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\alpha _ { l , t } ^ { * } - \alpha _ { l , t } = - 2 \beta \lambda _ { \mathrm { l a y e r } } \big ( \big ( \hat { \alpha } _ { l , t } - \hat { \alpha } _ { g , t } \big ) - \big ( \alpha _ { l , t } - \alpha _ { g , t } \big ) \big ) .
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
Based on the setting of multi-level adaptation, on the right-hand side of Eq. (9), global learning rate is updated without regularization $\hat { \alpha } _ { g , t } = \alpha _ { g , t }$ . For the layer-wise learning rates, the difference is given by $\hat { \alpha } _ { l , t } - \alpha _ { l , t } = 2 \beta \lambda _ { \mathrm { l a y e r } } \big ( \alpha _ { l , t } - \alpha _ { g , t } \big )$ , which corresponds to the gradient with respect to the regularization term. Thus, Eq. (9) can be rewritten as:
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
\alpha _ { l , t } ^ { * } - \alpha _ { l , t } = - 2 \beta \lambda _ { \mathrm { l a y e r } } \big ( 2 \beta \lambda _ { \mathrm { l a y e r } } \big ( \alpha _ { l , t } - \alpha _ { g , t } \big ) \big ) = - 4 \beta ^ { 2 } \lambda _ { l } ^ { 2 } \big ( 1 - \frac { \alpha _ { g , t } } { \alpha _ { l , t } } \big ) \alpha _ { l , t }
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
which is the error of the virtual approximation introduced in Eq. (6) in the paper. If $4 \beta ^ { 2 } \lambda _ { l } ^ { 2 } < < 1$ or $\frac { \alpha _ { g , t } } { \alpha _ { l , t } } 1$ , this approximation becomes accurate. Another way for handling Eq. (4) in the paper is to implement the previous-step learning rates in the regularization term.
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
\alpha _ { l , t } \approx \alpha _ { l , t - 1 } - \beta ( - h _ { l , t - 1 } + 2 \lambda _ { \mathrm { l a y e r } } ( \alpha _ { l , t - 1 } - \alpha _ { g , t - 1 } ) ) .
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
Since we have $\alpha _ { l , t } = \hat { \alpha } _ { l , t } - 2 \beta \lambda _ { \mathrm { l a y e r } } ( \alpha _ { l , t } - \alpha _ { g , t } )$ and $\hat { \alpha } _ { l , t } = \alpha _ { l , t - 1 } + \beta h _ { l , t - 1 }$ , using the learning rates in the last step for regularization will introduce a higher variation from term $\beta h _ { l , t - 1 }$ , with respect to the true learning rates in the current step. Thus, we consider the proposed virtual approximation works better than last-step approximation.
|
| 235 |
+
|
| 236 |
+
# A.2 PROOF OF THEOREM 1:
|
| 237 |
+
|
| 238 |
+
Proof. Consider the learning regularizer
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
L _ { \mathrm { l r \_ r e g } } ( \alpha ) = \sum _ { p \in \mathcal { P } } \sum _ { \alpha _ { i } \in p } \sum _ { \alpha _ { j } \in \mathrm { p a r e n t s } ( i ) } \lambda _ { i j } ( \alpha _ { i } - \alpha _ { j } ) ^ { 2 } .
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
To apply hyper-gradient descent method to update the learning rate $\alpha _ { L }$ at level $L$ , we need to work out the derivative of $L _ { \mathrm { l r \_ r e g } }$ with respect to $\alpha _ { L }$ . The terms in Eq. (12) involving $\alpha _ { L }$ are only $( \alpha _ { i } - \alpha _ { j } ) ^ { 2 }$ where $\alpha _ { j }$ is an ancestor on the path from the root to the leave node $\alpha _ { L }$ . Hence
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\begin{array} { r l r } { { \frac { \partial L _ { \mathrm { f u l l } } ( \theta , \alpha ) } { \partial \alpha _ { L , t } } = \frac { \partial L _ { \mathrm { m o d e l } } ( \theta , \alpha ) } { \partial \alpha _ { L , t } } + \frac { \partial L _ { \mathrm { l r . r e g } } ( \alpha ) } { \partial \alpha _ { L , t } } } } \\ & { } & { = - \nabla _ { \theta _ { L } } f ( \theta _ { t - 1 } ) ^ { T } \nabla _ { \theta _ { L } } u ( \Theta _ { t - 2 } , \alpha _ { t - 1 } ) + \sum _ { \alpha _ { j } \in \mathrm { a c e n s t o r s } ( L ) } 2 \lambda _ { L j } ( \alpha _ { L , t } - \alpha _ { j , t } ) . } \end{array}
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
As there are exactly $L - 1$ ancestors on the path, we can simply use the index $j = 1 , 2 , . . . , L - 1$ . The corresponding updating function for $\alpha _ { n , t }$ is:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\begin{array} { l } { \displaystyle \alpha _ { L , t } = \alpha _ { n , t - 1 } - \beta \big ( h _ { L } + \sum _ { j = 1 } ^ { L - 1 } 2 \lambda _ { L j } \big ( \alpha _ { L , t } - \alpha _ { j , t } \big ) \big ) } \\ { \displaystyle \approx \hat { \alpha } _ { L , t } \big ( 1 - 2 \beta \sum _ { j = 1 } ^ { L - 1 } \lambda _ { L j } \alpha _ { n , t } \big ) + \sum _ { j = 1 } ^ { L - 1 } ( 2 \beta \lambda _ { L j } \hat { \alpha } _ { j , t } ) \big ) } \\ { \displaystyle = \sum _ { j = 1 } ^ { L } \gamma _ { j } \hat { \alpha } _ { j , t } . } \end{array}
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
where
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\begin{array} { l } { { \displaystyle \gamma _ { L } = 1 - 2 \beta \sum _ { j = 1 } ^ { L - 1 } \lambda _ { L j } , } } \\ { { \displaystyle \gamma _ { j } = 2 \beta \lambda _ { L j } , \quad \mathrm { f o r } j = 1 , 2 , . . . , L - 1 . } } \end{array}
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
This form satisfies $\begin{array} { r } { \alpha _ { L } ^ { * } = \sum _ { j = 1 } ^ { L } \gamma _ { j } \hat { \alpha } _ { j } } \end{array}$ with $\begin{array} { r } { \sum _ { j = 1 } ^ { L } \gamma _ { j } = 1 } \end{array}$ . This completes the proof.
|
| 263 |
+
|
| 264 |
+
# A.3 PROOF OF THEOREM 2:
|
| 265 |
+
|
| 266 |
+
Proof. We take three-level’s case discussed in Section 2 for example, which includes global level, layer-level and parameter-level. Suppose that the target function $f$ is convex, L-Lipschitz smooth at all levels, which means for all $\theta _ { 1 }$ and $\theta _ { 2 }$ :
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { r l } & { \left| | \nabla _ { p } f ( \theta _ { 1 } ) - \nabla _ { p } f ( \theta _ { 2 } ) | | \leq L _ { p } | | \theta _ { 1 } - \theta _ { 2 } | | \right. } \\ & { \left. | | \nabla _ { l } f ( \theta _ { 1 } ) - \nabla _ { l } f ( \theta _ { 2 } ) | | \leq L _ { l } | | \theta _ { 1 } - \theta _ { 2 } | | \right. } \\ & { \left. | | \nabla _ { g } f ( \theta _ { 1 } ) - \nabla _ { g } f ( \theta _ { 2 } ) | | \leq L _ { g } | | \theta _ { 1 } - \theta _ { 2 } | | \right. } \\ & { \left. L = \operatorname* { m a x } \{ L _ { p } , L _ { l } , L _ { g } \} \right. } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
and its gradient with respect to parameter-wise, layer-wise, global-wise parameter groups satisfy $\| \nabla _ { p } f ( \theta ) \| < M _ { p }$ , $\| \nabla _ { l } f ( \theta ) \| < M _ { l }$ , $\lVert \nabla _ { g } f ( \theta ) \rVert < M _ { g }$ for some fixed $M _ { p } , M _ { l } ,$ $M _ { g }$ and all $\theta$ . Then the effective combined learning rate for each parameter satisfies:
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array} { r l } { | \alpha _ { p , t } ^ { * } | = | \gamma _ { p , t - 1 } \alpha _ { p , t } + \gamma _ { d , t - 1 } \alpha _ { t , t } + \gamma _ { g , t - 1 } \alpha _ { t } | } & { } \\ & { \leq \big ( \gamma _ { p , t - 1 } + \gamma _ { d , t - 1 } + \gamma _ { g , t - 1 } \big ) \alpha _ { 0 } + \displaystyle \sum _ { i = 0 } ^ { t - 1 } \Bigg ( \gamma _ { p , t - 1 } n _ { p } \operatorname* { m a x } _ { p } \{ | \nabla f ( \theta _ { p , i + 1 } ) ^ { T } \nabla f ( \theta _ { p , i } ) | \} } \\ & { + \gamma _ { d , t - 1 } n _ { i } \operatorname* { m a x } _ { i } \{ | \nabla f ( \theta _ { i , i + 1 } ) ^ { T } \nabla f ( \theta _ { i , s } ) | \} + \gamma _ { g , t - 1 } \big | \nabla f ( \theta _ { g , i + 1 } ) ^ { T } \nabla f ( \theta _ { g , s } ) | \Big ) } \\ & { \leq \alpha _ { 0 } + \displaystyle \beta \sum _ { i = 0 } ^ { t - 1 } \Bigg ( \gamma _ { p , t - 1 } n _ { p } \operatorname* { m a x } _ { \theta } \{ \| \nabla f ( \theta _ { p , i + 1 } ) \| \| \nabla f ( \theta _ { p , i } ) \| \} } \\ & + \gamma _ { d , t - 1 } n _ { i } \operatorname* { m a x } _ { i } \{ | \nabla f ( \theta _ { i , i + 1 } ) | \} | \nabla f ( \theta _ { i , i } ) | \} \} + \gamma _ { g , t - 1 } { | \nabla f ( \theta _ { g , i + 1 } ) | \| \nabla f ( \theta _ { g , i } ) \| \} } \\ & { \leq \alpha _ { 0 } + i \beta ( n _ { p } \mathcal { M } _ { p } ^ { 2 } + n _ { t } \mathcal { M } _ { t } ^ { 2 } + { M _ { g } ^ { 2 } } ) } \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
where $\theta _ { p , i }$ refers to the value of parameter indexed by $p$ at time step $i$ , $\theta _ { l , i }$ refers to the set/vector of parameters in layer with index $l$ at time step $i$ , and $\theta _ { g , i }$ refers to the whole set of model parameters at time step $i$ . In addition, $n _ { p }$ and $n _ { l }$ are the total number of parameters and number of the layers, and we have applied $0 < \gamma _ { p } , \gamma _ { l } , \gamma _ { g } < 1$ . This gives an upper bound for the learning rate in each particular time step, which is $O ( t )$ as $t \to \infty$ . By introducing $\kappa _ { p , t } = \tau ( t ) \alpha _ { p , t } ^ { * } + ( 1 - \tau ( t ) ) \alpha _ { \infty }$ , where the function $\tau ( t )$ is selected to satisfy $t \tau ( t ) 0$ as $t \to \infty$ , so we have $\kappa _ { p , t } \alpha _ { \infty }$ as $t \to \infty$ . If $\begin{array} { r } { \alpha _ { \infty } < { \frac { 1 } { L } } } \end{array}$ , for larger enough $t$ , we have $1 / ( L + 1 ) < \kappa _ { p , t } < 1 / L$ , and the algorithm converges when the corresponding gradient-based optimizer converges for such a learning rate under our assumptions about $f$ . This follows the discussion in (Karimi et al., 2016; Sun, 2019). □
|
| 279 |
+
|
| 280 |
+
# A.4 ALGORITHM COMPLEXITY
|
| 281 |
+
|
| 282 |
+
# A.4.1 NUMBER OF PARAMETERS AND SPACE COMPLEXITY
|
| 283 |
+
|
| 284 |
+
The proposed adaptive optimizer is for efficiently updating the model parameters, while the final model parameters will not be increase by introducing CAM-HD optimizer. However, during the training process, several extra intermediate variables are introduced. For example, in the discussed three-level’s case for feed-forward neural network with $n _ { \mathrm { l a y e r } }$ layers, we need to restore $h _ { p , t } , h _ { l , t }$ and $h _ { g , t }$ , which have the sizes of $\begin{array} { r } { S ( h _ { p , t } ) = \sum _ { l = 1 } ^ { n _ { \mathrm { l a y e r } } - 1 } ( n _ { l } + 1 ) n _ { l + 1 } } \end{array}$ , $S ( h _ { l , t } ) = n _ { \mathrm { l a y e r } }$ and $S ( h _ { g , t } ) = 1$ , take the sizes of respectively, where $\begin{array} { r } { S ( { a _ { p , t } } ) = \sum _ { l = 1 } ^ { n _ { \mathrm { l a y e r } } - 1 } ( n _ { l } + 1 ) n _ { l + 1 } , S ( { a _ { l , t } } ) = n _ { \mathrm { l a y e r } } , S ( { a _ { g , t } } ) = 1 , S ( { a _ { g , t } } ) = 1 } \end{array}$ is the number of units in ith layer. Also, learning rates $\alpha _ { p , t }$ , $\alpha _ { l , t } , \alpha _ { g , t }$ , and and $\begin{array} { r } { S ( a _ { p , t } ^ { * } ) = \sum _ { l = 1 } ^ { { n _ { \mathrm { l a y e r } } } - 1 } ( n _ { l } + 1 ) n _ { l + 1 } } \end{array}$ , respectively. Also we need a small set of scalar parameters to restore $\gamma _ { 1 } , \gamma _ { 2 }$ and $\gamma _ { 3 }$ and other coefficients.
|
| 285 |
+
|
| 286 |
+
Consider the fact that in training the baseline models, we need to restore model parameters, corresponding gradients, as well as the intermediate gradients during the implementation of chain rule, CAM-HD will take twice of the space for storing intermediate variables in the worst case. For two-level learning rate adaptation considering global and layer-wise learning rates, the extra space complexity by CAM-HD will be one to two orders’ smaller than that of baseline model during training.
|
| 287 |
+
|
| 288 |
+
# A.4.2 TIME COMPLEXITY
|
| 289 |
+
|
| 290 |
+
In CAM-HD, we need to calculate gradient of loss with respect to the learning rates at each level, which are $h _ { p , t }$ , $h _ { l , t }$ and $h _ { g , t }$ in three-level’s case. However, the gradient of each parameter is already known during normal model training, the extra computational cost comes from taking summations and updating the lowest-level learning rates. In general, this cost is in linear relation with the number of differentiable parameters in the original models. Here we discuss the case of feed-forward networks and convolutional networks.
|
| 291 |
+
|
| 292 |
+
Recall that for feed-forward neural network the whole computational complexity is:
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
T ( n ) = O ( m \cdot n _ { \mathrm { i t e r } } \cdot \sum _ { l = 2 } ^ { n _ { \mathrm { l a y e r } } } n _ { l } \cdot n _ { l - 1 } \cdot n _ { l - 2 } )
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
where $m$ is the number of training examples, $n _ { \mathrm { i t e r } }$ is the iterations of training, and $n _ { l }$ is the number of units in the $l$ -th layer. On the other hand, when using three-level CAM-HD with, where the lowest level is parameter-wise, we need $n _ { \mathrm { l a y e r } }$ element products to calculate $h _ { p , t }$ for all layers, one $n _ { \mathrm { l a y e r } }$ matrix element summations to calculate $h _ { l , t }$ for all layers, as well as a list summation to calculate $h _ { g , t }$ . In addition, two element-wise summations will also be implemented for calculating $\alpha _ { p , t }$ and $\alpha _ { p } ^ { * }$ . Therefore, the extra computational cost of using CAM-HD is $\begin{array} { r } { \Delta T ( n ) = O ( n _ { b } \cdot n _ { \mathrm { i t e r } } \sum _ { l = 2 } ^ { n _ { \mathrm { l a y e r } } } ( n _ { l } \cdot } \end{array}$ $\bar { n _ { l - 1 } } + n _ { l } )$ ), where $n _ { b }$ is the number of mini-batches for training. Notice that $m _ { b } = m / n _ { b }$ is the batch size, which is usually larger than 100. This extra cost is more than one-order smaller than the computational complexity of training a model without learning rate adaptation. For the cases when the lowest level is layer-wise, only one element-wise matrix product is needed in each layer to calculate $h _ { l , t }$ . For convolutional neural networks, we have learned that the total time complexity of all convolutional layers is (He and Sun, 2015):
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
O ( n _ { b } \cdot n _ { \mathrm { i t e r } } \cdot \sum _ { l = 1 } ^ { n _ { c o n v _ { - } l a y e r } } ( n _ { l - 1 } \cdot s _ { l } ^ { 2 } \cdot n _ { l } \cdot m _ { l } ^ { 2 } ) )
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
where $l$ is the index of a convolutional layer, and $n _ { c o n v \_ l a y e r }$ is the depth (number of convolutional layers). $n _ { l }$ is the number of filters in the $l$ -th layer, while $n _ { l - 1 }$ is known as the number of input channels of the $l$ -th layer. $s _ { l }$ is the spatial size of the filter. $m _ { l }$ is the spatial size of the output feature map. Icase is $\begin{array} { r } { \Delta T ( n ) = O ( n _ { b } \cdot n _ { \mathrm { i t e r } } \sum _ { l = 1 } ^ { n _ { c o n v \_ l a y e r } } ( ( \dot { n } _ { l - 1 } \cdot s _ { l } ^ { 2 } + 1 ) \cdot n _ { l } ) } \end{array}$ putational cost for CAM-HD in this), which is still more than one order
|
| 305 |
+
|
| 306 |
+
Therefore, for large networks, applying CAM-HD will not significantly increase the computational cost from the theoretical prospective.
|
| 307 |
+
|
| 308 |
+
# A.5 SUPPLEMENTARY EXPERIMENTAL RESULTS
|
| 309 |
+
|
| 310 |
+
# A.5.1 LEARNING OF COMBINATION WEIGHTS
|
| 311 |
+
|
| 312 |
+
The following figures including Figure 5, Figure 6, Figure 7 and Figure 8 give the learning curves of combination weights with respect to the number of training iterations in each experiments, in which each curve is averaged by 5 trials with error bars. Through these figures, we can compare the updating curves with different models, different datasets and different CAM-HD optimizers.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 5: Learning curves of $\gamma \mathbf { s }$ for FFNN on MNIST with Adam.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 6: Learning curves of $\gamma \mathbf { s }$ for LeNet-5 on MNIST with SGD, SGDN and Adam.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 7: Learning curves of $\gamma \mathbf { s }$ for LeNet-5 on CIFAR10 and SVHN.
|
| 322 |
+
|
| 323 |
+
Figure 5 corresponds to the experiment of FFNN on MNIST in Section 3.3, which is a three-level case. We can see that for different FFNN architecture, the learning behaviors of $\gamma \mathbf { s }$ also show different patterns, although trained on a same dataset. Meanwhile, the standard errors for multiple trials are much smaller relative to the changes of the average combination weight values.
|
| 324 |
+
|
| 325 |
+
Figure 6 corresponds to the learning curves of $\gamma \mathbf { s }$ in the experiments of LeNet-5 for MNIST image classification with SGD, SGDN and Adam, which are trained on $10 \%$ of original training dataset.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 8: Learning curves of $\gamma \mathbf { s }$ for ResNet-18.
|
| 329 |
+
|
| 330 |
+
In addition, Figure 7 corresponds to the learning curves of $\gamma \mathbf { s }$ in the experiments of LeNet-5 for CIFAR10 and SVHN image classification with Adam-CAM-HD.
|
| 331 |
+
|
| 332 |
+
As is shown in Figure 6, for SGD-CAM-HD, SGDN-CAM-HD and Adam-CAM-HD, the equilibrium values of combination weights are different from each other. Although the initialization $\gamma _ { 1 } = 0 . 2$ , $\gamma _ { 2 } = 0 . 8$ and the updating rate $\delta = 0 . 0 3$ are set to be the same for the three optimizers, the values of $\gamma _ { 1 }$ and $\gamma _ { 2 }$ only change in a small proportion when training with Adam-CAM-HD, while the change is much more significant towards larger filter/layer-wise adaptation when SGD-CAM-HD or SGDN-CAM-HD is implemented. The numerical results show that for SGDN-CAM-HD, the average value of weight for layer-wise adaptation $\gamma _ { 1 }$ jumps from 0.2 to 0.336 in the first epoch, then drop back to 0.324 before keeping increasing till about 0.388. For Adam-CAM-HD, the average $\gamma _ { 1 }$ moves from 0.20 to 0.211 with about $5 \%$ change. In Figure 7, both the two subplots are models trained with Adam-CAM-HD. For the updating curves in Figure 7(a), which is trained on CIFAR10 with Adam-CAM-HD, the combination weight for filter-wise adaptation moves from 0.20 to 0.188. Meanwhile, for the updating curves in Figure 7(b), which is trained on SVHN, the combination weight for filter-wise adaptation moves from 0.20 to 0.195.
|
| 333 |
+
|
| 334 |
+
The similar effect can also be observed from the learning curves of $\gamma \mathbf { s }$ for ResNet-18, which is given in Figure 8 and we only take the first 8,000 iterations. Again, we find that in training ResNet-18 on CIFAR10, the combination weights of SGD/SGDN-CAM-HD change much faster than that of Adam-CAM-HD. There are several reasons for this effect: First, in the cases when $\gamma \mathbf { s }$ do not move significantly, we apply Adam-CAM-HD, where the main learning rate (1e-3) is only about $1 \% - 6 \%$ of the learning rate of SGD or SGDN (1e-1). In Algorithm 1, we can see that the updating rate of $\gamma \mathbf { s }$ is in proportion of alpha given other terms unchanged. Thus, for the same tasks, if the same value of updating rate $\delta$ is applied, the updating scale of $\gamma \mathbf { s }$ for Adam-CAM-HD can be much smaller than that for SGDN-CAM-HD. Second, this does not mean that if we apply a much larger $\delta$ for Adam-CAM-HD, the combination weights will still not change significantly or the performance will not be improved. It simply means that using a small $\delta$ can also achieve good performance due to the goodness of initialisation points. Third, it is possible that Adam requires lower level of combination ratio adaptation for the same network architecture compared with SGD/SGDN due to the fact that Adam itself involves stronger adaptiveness.
|
| 335 |
+
|
| 336 |
+
# A.5.2 OTHER EXPERIMENTAL RESULTS
|
| 337 |
+
|
| 338 |
+
In Figure 2, Figure 3 and Figure 4 of the paper, we have shown the curves of validation accuracies to compare different adaptive optimizers in a variety of learning tasks. Here we further provide the training and validation cross-entropy loss curves for corresponding methods in these tasks. Figure 8 is the full results of FFNNs, and Figure 9 is the results of LeNet-5.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 9: The comparison of learning curves of FFNN on MNIST with different adaptive optimizers.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 10: The comparison of learning curves of training LeNet-5 on MNIST, CIFAR10 and SVHN with different adaptive optimizers.
|
md/train/H1T2hmZAb/H1T2hmZAb.md
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP COMPLEX NETWORKS
|
| 2 |
+
|
| 3 |
+
Chiheb Trabelsi,∗♦♣ Olexa Bilaniuk,∗♦ Ying Zhang,† ♦♠ Dmitriy Serdyuk,† ♦ Sandeep Subramanian,† ♦
|
| 4 |
+
|
| 5 |
+
João Felipe Santos,♦ Soroush Mehri,♥ Negar Rostamzadeh,♠ Yoshua Bengio♦¶ & Christopher J Pal♦♣
|
| 6 |
+
|
| 7 |
+
♦ Montreal Institute for Learning Algorithms (MILA), Montreal
|
| 8 |
+
♣ Ecole Polytechnique, Montreal
|
| 9 |
+
♥ Microsoft Research, Montreal
|
| 10 |
+
♠ Element AI, Montreal
|
| 11 |
+
¶ CIFAR Senior Fellow
|
| 12 |
+
chiheb.trabelsi@polymtl.ca, olexa.bilaniuk@umontreal.ca, ying.zhlisa@gmail.com,
|
| 13 |
+
{serdyuk@iro, sandeep.subramanian.1@}umontreal.ca, jfsantos@emt.inrs.ca,
|
| 14 |
+
soroush.mehri@microsoft.com, negar@elementai.com,
|
| 15 |
+
find.me@the.web, christopher.pal@polymtl.ca
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
At present, the vast majority of building blocks, techniques, and architectures for deep learning are based on real-valued operations and representations. However, recent work on recurrent neural networks and older fundamental theoretical analysis suggests that complex numbers could have a richer representational capacity and could also facilitate noise-robust memory retrieval mechanisms. Despite their attractive properties and potential for opening up entirely new neural architectures, complex-valued deep neural networks have been marginalized due to the absence of the building blocks required to design such models. In this work, we provide the key atomic components for complex-valued deep neural networks and apply them to convolutional feed-forward networks and convolutional LSTMs. More precisely, we rely on complex convolutions and present algorithms for complex batch-normalization, complex weight initialization strategies for complex-valued neural nets and we use them in experiments with end-to-end training schemes. We demonstrate that such complex-valued models are competitive with their realvalued counterparts. We test deep complex models on several computer vision tasks, on music transcription using the MusicNet dataset and on Speech Spectrum Prediction using the TIMIT dataset. We achieve state-of-the-art performance on these audio-related tasks.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
Recent research advances have made significant progress in addressing the difficulties involved in learning deep neural network architectures. Key innovations include normalization techniques (Ioffe and Szegedy, 2015; Salimans and Kingma, 2016) and the emergence of gating-based feed-forward neural networks like Highway Networks (Srivastava et al., 2015). Residual networks (He et al., 2015a; 2016) have emerged as one of the most popular and effective strategies for training very deep convolutional neural networks (CNNs). Both highway networks and residual networks facilitate the training of deep networks by providing shortcut paths for easy gradient flow to lower network layers thereby diminishing the effects of vanishing gradients (Hochreiter, 1991). He et al. (2016)
|
| 24 |
+
|
| 25 |
+
show that learning explicit residuals of layers helps in avoiding the vanishing gradient problem and provides the network with an easier optimization problem. Batch normalization (Ioffe and Szegedy, 2015) demonstrates that standardizing the activations of intermediate layers in a network across a minibatch acts as a powerful regularizer as well as providing faster training and better convergence properties. Further, such techniques that standardize layer outputs become critical in deep architectures due to the vanishing and exploding gradient problems.
|
| 26 |
+
|
| 27 |
+
The role of representations based on complex numbers has started to receive increased attention, due to their potential to enable easier optimization (Nitta, 2002), better generalization characteristics (Hirose and Yoshida, 2012), faster learning (Arjovsky et al., 2015; Danihelka et al., 2016; Wisdom et al., 2016) and to allow for noise-robust memory mechanisms (Danihelka et al., 2016). Wisdom et al. (2016) and Arjovsky et al. (2015) show that using complex numbers in recurrent neural networks (RNNs) allows the network to have a richer representational capacity. Danihelka et al. (2016) present an LSTM (Hochreiter and Schmidhuber, 1997) architecture augmented with associative memory with complex-valued internal representations. Their work highlights the advantages of using complex-valued representations with respect to retrieval and insertion into an associative memory. In residual networks, the output of each block is added to the output history accumulated by summation until that point. An efficient retrieval mechanism could help to extract useful information and process it within the block.
|
| 28 |
+
|
| 29 |
+
In order to exploit the advantages offered by complex representations, we present a general formulation for the building components of complex-valued deep neural networks and apply it to the context of feed-forward convolutional networks and convolutional LSTMs. Our contributions in this paper are as follows:
|
| 30 |
+
|
| 31 |
+
1. A formulation of complex batch normalization, which is described in Section 3.5;
|
| 32 |
+
2. Complex weight initialization, which is presented in Section 3.6;
|
| 33 |
+
3. A comparison of different complex-valued ReLU-based activation functions presented in Section 4.1;
|
| 34 |
+
4. A state of the art result on the MusicNet multi-instrument music transcription dataset, presented in Section 4.2;
|
| 35 |
+
5. A state of the art result in the Speech Spectrum Prediction task on the TIMIT dataset, presented in Section 4.3.
|
| 36 |
+
|
| 37 |
+
We perform a sanity check of our deep complex network and demonstrate its effectiveness on standard image classification benchmarks, specifically, CIFAR-10, CIFAR-100. We also use a reducedtraining set of SVHN that we call $\mathrm { S V H N } ^ { * }$ . For audio-related tasks, we perform a music transcription task on the MusicNet dataset and a Speech Spectrum prediction task on TIMIT. The results obtained for vision classification tasks show that learning complex-valued representations results in performance that is competitive with the respective real-valued architectures. Our promising results in music transcription and speech spectrum prediction underscore the potential of deep complexvalued neural networks applied to acoustic related tasks1 – We continue this paper with discussion of motivation for using complex operations and related work.
|
| 38 |
+
|
| 39 |
+
# 2 MOTIVATION AND RELATED WORK
|
| 40 |
+
|
| 41 |
+
Using complex parameters has numerous advantages from computational, biological, and signal processing perspectives. From a computational point of view, Danihelka et al. (2016) has shown that Holographic Reduced Representations (Plate, 2003), which use complex numbers, are numerically efficient and stable in the context of information retrieval from an associative memory. Danihelka et al. (2016) insert key-value pairs in the associative memory by addition into a memory trace. Although not typically viewed as such, residual networks (He et al., 2015a; 2016) and Highway Networks (Srivastava et al., 2015) have a similar architecture to associative memories: each ResNet residual path computes a residual that is then inserted – by summing into the “memory” provided by the identity connection. Given residual networks’ resounding success on several benchmarks and their functional similarity to associative memories, it seems interesting to marry both together. This motivates us to incorporate complex weights and activations in residual networks. Together, they offer a mechanism by which useful information may be retrieved, processed and inserted in each residual block.
|
| 42 |
+
|
| 43 |
+
Orthogonal weight matrices provide a novel angle of attack on the well-known vanishing and exploding gradient problems in RNNs. Unitary RNNs (Arjovsky et al., 2015) are based on unitary weight matrices, which are a complex generalization of orthogonal weight matrices. Compared to their orthogonal counterparts, unitary matrices provide a richer representation, for instance being capable of implementing the discrete Fourier transform, and thus of discovering spectral representations. Arjovsky et al. (2015) show the potential of this type of recurrent neural networks on toy tasks. Wisdom et al. (2016) provided a more general framework for learning unitary matrices and they applied their method on toy tasks and on a real-world speech task.
|
| 44 |
+
|
| 45 |
+
Using complex weights in neural networks also has biological motivation. Reichert and Serre (2013) have proposed a biologically plausible deep network that allows one to construct richer and more versatile representations using complex-valued neuronal units. The complex-valued formulation allows one to express the neuron’s output in terms of its firing rate and the relative timing of its activity. The amplitude of the complex neuron represents the former and its phase the latter. Input neurons that have similar phases are called synchronous as they add constructively, whereas asynchronous neurons add destructively and thus interfere with each other. This is related to the gating mechanism used in both deep feed-forward neural networks (Srivastava et al., 2015; van den Oord et al., 2016a;b) and recurrent neural networks (Hochreiter and Schmidhuber, 1997; Cho et al., 2014; Zilly et al., 2016) as this mechanism learns to synchronize inputs that the network propagates at a given feed-forward layer or time step. In the context of deep gating-based networks, synchronization means the propagation of inputs whose controlling gates simultaneously hold high values. These controlling gates are usually the activations of a sigmoid function. This ability to take into account phase information might explain the effectiveness of incorporating complex-valued representations in the context of recurrent neural networks.
|
| 46 |
+
|
| 47 |
+
The phase component is not only important from a biological point of view but also from a signal processing perspective. It has been shown that the phase information in speech signals affects their intelligibility (Shi et al., 2006). Also Oppenheim and Lim (1981) show that the amount of information present in the phase of an image is sufficient to recover the majority of the information encoded in its magnitude. In fact, phase provides a detailed description of objects as it encodes shapes, edges, and orientations.
|
| 48 |
+
|
| 49 |
+
Recently, Rippel et al. (2015) leveraged the Fourier spectral representation for convolutional neural networks, providing a technique for parameterizing convolution kernel weights in the spectral domain, and performing pooling on the spectral representation of the signal. However, the authors avoid performing complex-valued convolutions, instead building from real-valued kernels in the spatial domain. In order to ensure that a complex parametrization in the spectral domain maps onto real-valued kernels, the authors impose a conjugate symmetry constraint on the spectral-domain weights, such that when the inverse Fourier transform is applied to them, it only yields real-valued kernels.
|
| 50 |
+
|
| 51 |
+
As pointed out in Reichert and Serre (2013), the use of complex-valued neural networks (Georgiou and Koutsougeras, 1992; Zemel et al., 1995; Kim and Adalı, 2003; Hirose, 2003; Nitta, 2004) has been investigated long before the earliest deep learning breakthroughs (Hinton et al., 2006; Bengio et al., 2007; Poultney et al., 2007). Recently Reichert and Serre (2013); Bruna et al. (2015); Arjovsky et al. (2015); Danihelka et al. (2016); Wisdom et al. (2016) have tried to bring more attention to the usefulness of deep complex neural networks by providing theoretical and mathematical motivation for using complex-valued deep networks. However, to the best of our knowledge, most of the recent works using complex valued networks have been applied on toy tasks, with the exception of some attempts. In fact, (Oyallon and Mallat, 2015; Tygert et al., 2015; Worrall et al., 2016) have used complex representation in vision tasks. Wisdom et al. (2016) have also performed a real-world speech task consisting of predicting the log magnitude of the future short time Fourier transform frames. In Natural Language Processing, (Trouillon et al., 2016; Trouillon and Nickel, 2017) have used complex-valued embeddings. Much remains to be done to develop proper tools and a general framework for training deep neural networks with complex-valued parameters.
|
| 52 |
+
|
| 53 |
+
Given the compelling reasons for using complex-valued representations, the absence of such frameworks represents a gap in machine learning tooling, which we fill by providing a set of building blocks for deep complex-valued neural networks that enable them to achieve competitive results with their real-valued counterparts on real-world tasks.
|
| 54 |
+
|
| 55 |
+
# 3 COMPLEX BUILDING BLOCKS
|
| 56 |
+
|
| 57 |
+
In this section, we present the core of our work, laying down the mathematical framework for implementing complex-valued building blocks of a deep neural network.
|
| 58 |
+
|
| 59 |
+
# 3.1 REPRESENTATION OF COMPLEX NUMBERS
|
| 60 |
+
|
| 61 |
+
We start by outlining the way in which complex numbers are represented in our framework. A complex number $z = a + i b$ has a real component $a$ and an imaginary component $b$ . We represent the real part $a$ and the imaginary part $b$ of a complex number as logically distinct real valued entities and simulate complex arithmetic using real-valued arithmetic internally. Consider a typical realvalued $2 D$ convolution layer that has $N$ feature maps such that $N$ is divisible by 2; to represent these as complex numbers, we allocate the first $N / 2$ feature maps to represent the real components and the remaining $N / 2$ to represent the imaginary ones. Thus, for a four dimensional weight tensor $W$ that links $N _ { i n }$ input feature maps to $N _ { o u t }$ output feature maps and whose kernel size is $m \times m$ we would have a weight tensor of size $\left( N _ { o u t } \times N _ { i n } \times m \times m \right) / 2$ complex weights.
|
| 62 |
+
|
| 63 |
+
# 3.2 COMPLEX CONVOLUTION
|
| 64 |
+
|
| 65 |
+
In order to perform the equivalent of a traditional real-valued 2D convolution in the complex domain, we convolve a complex filter matrix $\mathbf { W } = \mathbf { A } + i \mathbf { B }$ by a complex vector $\mathbf { h } = \mathbf { x } + i \mathbf { y }$ where $\mathbf { A }$ and $\mathbf { B }$ are real matrices and $\mathbf { X }$ and $\mathbf { y }$ are real vectors since we are simulating complex arithmetic using real-valued entities. As the convolution operator is distributive, convolving the vector $\mathbf { h }$ by the filter W we obtain:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathbf { W } * \mathbf { h } = \mathbf { \Gamma } \bigl ( \mathbf { A } * \mathbf { x } - \mathbf { B } * \mathbf { y } \bigr ) + i \bigl ( \mathbf { B } * \mathbf { x } + \mathbf { A } * \mathbf { y } \bigr ) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
As illustrated in Figure 1a, if we use matrix notation to represent real and imaginary parts of the convolution operation we have:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\left[ \Re ( \mathbf { W } * \mathbf { h } ) \right] = \left[ \mathbf { A } - \mathbf { B } \right] * \left[ \mathbf { x } \right] .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
# 3.3 COMPLEX DIFFERENTIABILITY
|
| 78 |
+
|
| 79 |
+
In order to perform backpropagation in a complex-valued neural network, a sufficient condition is to have a cost function and activations that are differentiable with respect to the real and imaginary parts of each complex parameter in the network. See Section 6.3 in the Appendix for the complex chain rule.
|
| 80 |
+
|
| 81 |
+
By constraining activation functions to be complex differentiable or holomorphic, we restrict the use of possible activation functions for a complex valued neural networks (For further details about holomorphism please refer to Section 6.2 in the appendix). Hirose and Yoshida (2012) shows that it is unnecessarily restrictive to limit oneself only to holomorphic activation functions; Those functions that are differentiable with respect to the real part and the imaginary part of each parameter are also compatible with backpropagation. (Arjovsky et al., 2015; Wisdom et al., 2016; Danihelka et al., 2016) have used non-holomorphic activation functions and optimized the network using regular, real-valued backpropagation to compute partial derivatives of the cost with respect to the real and imaginary parts.
|
| 82 |
+
|
| 83 |
+
Even though their use greatly restricts the set of potential activations, it is worth mentioning that holomorphic functions can be leveraged for computational efficiency purposes. As pointed out in Sarroff et al. (2015), using holomorphic functions allows one to share gradient values (because the activation satisfies the Cauchy-Riemann equations 11 and 12 in the appendix). So, instead of computing and backpropagating 4 different gradients, only 2 are required.
|
| 84 |
+
|
| 85 |
+
# 3.4.1 MODRELU
|
| 86 |
+
|
| 87 |
+
Numerous activation functions have been proposed in the literature in order to deal with complexvalued representations. (Arjovsky et al., 2015) have proposed modReLU, which is defined as follows:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \mathrm { \ m o d R e L U } ( z ) = \mathrm { R e L U } ( | z | + b ) e ^ { i \theta _ { z } } = \left\{ \begin{array} { l l } { \left( | z | + b \right) \frac { z } { | z | } } & { \mathrm { i f ~ } | z | + b \ge 0 , } \\ { 0 } & { \mathrm { o t h e r w i s e } , } \end{array} \right. } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $z \in \mathbb { C }$ , $\theta _ { z }$ is the phase of $z$ , and $b \in \mathbb { R }$ is a learnable parameter. As $| z |$ is always positive, a bias $b$ is introduced in order to create a “dead zone” of radius $b$ around the origin 0 where the neuron is inactive, and outside of which it is active. The authors have used modReLU in the context of unitary RNNs. Their design of modReLU is motivated by the fact that applying separate ReLUs on both real and imaginary parts of a neuron performs poorly on toy tasks. The intuition behind the design of modReLU is to preserve the pre-activated phase $\theta _ { z }$ , as altering it with an activation function severely impacts the complex-valued representation. modReLU does not satisfy the Cauchy-Riemann equations, and thus is not holomorphic. We have tested modReLU in deep feed-forward complex networks and the results are given in Table 6.4.
|
| 94 |
+
|
| 95 |
+
# 3.4.2 CRELU AND zRELU
|
| 96 |
+
|
| 97 |
+
We call Complex ReLU (or CReLU) the complex activation that applies separate ReLUs on both of the real and the imaginary part of a neuron, i.e:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \mathbb { C } \mathrm { R e } \mathrm { L U } ( z ) = \mathrm { R e } \mathrm { L U } ( \mathfrak { R } ( z ) ) + i \mathrm { R e } \mathrm { L U } ( \mathfrak { I } ( z ) ) . } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
CReLU satisfies the Cauchy-Riemann equations when both the real and imaginary parts are at the same time either strictly positive or strictly negative. This means that CReLU satisfies the CauchyRiemann equations when $\theta _ { z } \in ] 0 , \pi / 2 [$ or $\overline { { \theta _ { z } } } \overline { { \angle } } \overline { { \angle } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } } \overline { { \vert } { \vert } }$ [. We have tested CReLU in deep feedforward neural networks and the results are given in Table 6.4.
|
| 104 |
+
|
| 105 |
+
It is also worthwhile to mention the work done by Guberman (2016) where a ReLU-based complex activation which satisfies the Cauchy-Riemann equations everywhere except for the set of points $\{ \Re ( z ) > 0 , \Im ( z ) = 0 \} \cup \{ \Re ( z ) = 0 , \Im ( z ) > 0 \}$ ias used. The activation function has similarities to CReLU. We call Guberman (2016) activation as $z$ ReLU and is defined as follows:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
z \mathrm { R e L U } ( z ) = \left\{ z \begin{array} { l l } { z } & { \mathrm { i f } \theta _ { z } \in [ 0 , \pi / 2 ] , } \\ { 0 } & { \mathrm { o t h e r w i s e } , } \end{array} \right.
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
We have tested $z$ ReLU in deep feed-forward complex networks and the results are given in Table 6.4.
|
| 112 |
+
|
| 113 |
+
# 3.5 COMPLEX BATCH NORMALIZATION
|
| 114 |
+
|
| 115 |
+
Deep networks generally rely upon Batch Normalization (Ioffe and Szegedy, 2015) to accelerate learning. In some cases batch normalization is essential to optimize the model. The standard formulation of Batch Normalization applies only to real values. In this section, we propose a batch normalization formulation that can be applied for complex values.
|
| 116 |
+
|
| 117 |
+
To standardize an array of complex numbers to the standard normal complex distribution, it is not sufficient to translate and scale them such that their mean is 0 and their variance 1. This type of normalization does not ensure equal variance in both the real and imaginary components, and the resulting distribution is not guaranteed to be circular; It will be elliptical, potentially with high eccentricity.
|
| 118 |
+
|
| 119 |
+
We instead choose to treat this problem as one of whitening 2D vectors, which implies scaling the data by the square root of their variances along each of the two principal components. This can be done by multiplying the 0-centered data $( { \pmb x } - { \mathbb E } [ { \pmb x } ] )$ by the inverse square root of the $2 \times 2$ covariance matrix $V$ :
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\tilde { \pmb { x } } = ( \pmb { V } ) ^ { - \frac 1 2 } \left( \pmb { x } - \mathbb { E } [ \pmb { x } ] \right) ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where the covariance matrix $V$ is
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\begin{array} { r } { V = \left( \begin{array} { l l } { V _ { r r } } & { V _ { r i } } \\ { V _ { i r } } & { V _ { i i } } \end{array} \right) = \left( \begin{array} { l l } { \mathrm { C o v } ( \Re \{ x \} , \Re \{ x \} ) } & { \mathrm { C o v } ( \Re \{ x \} , \Im \{ x \} ) } \\ { \mathrm { C o v } ( \Im \{ x \} , \Re \{ x \} ) } & { \mathrm { C o v } ( \Im \{ x \} , \Im \{ x \} ) } \end{array} \right) . } \end{array}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
The square root and inverse of $2 \times 2$ matrices has an inexpensive, analytical solution, and its existence is guaranteed by the positive (semi-)definiteness of $V$ . Positive definiteness of $V$ is ensured by the addition of $\epsilon I$ to $V$ (Tikhonov regularization). The mean subtraction and multiplication by the inverse square root of the variance ensures that $\tilde { \pmb x }$ has standard complex distribution with mean $\mu = 0$ , covariance $\Gamma = 1$ and pseudo-covariance (also called relation) $C = 0$ . The mean, the covariance and the pseudo-covariance are given by:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l } & { \mu = \operatorname { \mathbb { E } } \left[ \tilde { { \boldsymbol { x } } } \right] } \\ & { \Gamma = \operatorname { \mathbb { E } } \left[ \left( \tilde { { \boldsymbol { x } } } - { \boldsymbol { \mu } } \right) ( \tilde { { \boldsymbol { x } } } - { \boldsymbol { \mu } } ) ^ { * } \right] = V _ { r r } + V _ { i i } + i \left( V _ { i r } - V _ { r i } \right) } \\ & { C = \operatorname { \mathbb { E } } \left[ \left( \tilde { { \boldsymbol { x } } } - { \boldsymbol { \mu } } \right) ( \tilde { { \boldsymbol { x } } } - { \boldsymbol { \mu } } ) \right] = V _ { r r } - V _ { i i } + i \left( V _ { i r } + V _ { r i } \right) . } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
The normalization procedure allows one to decorrelate the imaginary and real parts of a unit. This has the advantage of avoiding co-adaptation between the two components which reduces the risk of overfitting (Cogswell et al., 2015; Srivastava et al., 2014).
|
| 138 |
+
|
| 139 |
+
Analogously to the real-valued batch normalization algorithm, we use two parameters, $\beta$ and $\gamma$ . The shift parameter $\beta$ is a complex parameter with two learnable components (the real and imaginary means). The scaling parameter $\gamma$ is a $2 \times 2$ positive semi-definite matrix with only three degrees of freedom, and thus only three learnable components. In much the same way that the matrix $( V ) ^ { - { \frac { 1 } { 2 } } }$ normalized the variance of the input to 1 along both of its original principal components, so does $\gamma$ scale the input along desired new principal components to achieve a desired variance. The scaling parameter $\gamma$ is given by:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\gamma = \left( \begin{array} { c c } { { \gamma _ { r r } } } & { { \gamma _ { r i } } } \\ { { \gamma _ { r i } } } & { { \gamma _ { i i } } } \end{array} \right) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
As the normalized input $\tilde { \pmb x }$ has real and imaginary variance 1, we initialize both $\gamma _ { r r }$ and $\gamma _ { i i }$ to $1 / \sqrt { 2 }$ in order to obtain a modulus of 1 for the variance of the normalized value. $\gamma _ { r i }$ , $\Re \{ \beta \}$ and $\Im \{ \beta \}$ are initialized to 0. The complex batch normalization is defined as:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathrm { B N } \left( \tilde { \mathbf { x } } \right) = \gamma \tilde { \mathbf { x } } + \beta .
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
We use running averages with momentum to maintain an estimate of the complex batch normalization statistics during training and testing. The moving averages of $V _ { r i }$ and $\beta$ are initialized to 0. The moving averages of $V _ { r r }$ and $V _ { i i }$ are initialized to $1 / \bar { \sqrt { 2 } }$ . The momentum for the moving averages is set to 0.9.
|
| 152 |
+
|
| 153 |
+
# 3.6 COMPLEX WEIGHT INITIALIZATION
|
| 154 |
+
|
| 155 |
+
In a general case, particularly when batch normalization is not performed, proper initialization is critical in reducing the risks of vanishing or exploding gradients. To do this, we follow the same steps as in Glorot and Bengio (2010) and He et al. (2015b) to derive the variance of the complex weight parameters.
|
| 156 |
+
|
| 157 |
+
A complex weight has a polar form as well as a rectangular form
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
W = | W | e ^ { i \theta } = \Re \{ W \} + i \Im \{ W \} ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
where $\theta$ and $| W |$ are respectively the argument (phase) and magnitude of $W$ .
|
| 164 |
+
|
| 165 |
+
Variance is the difference between the expectation of the squared magnitude and the square of the expectation:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\operatorname { V a r } ( W ) = \operatorname { \mathbb { E } } \left[ W W ^ { * } \right] - ( \operatorname { \mathbb { E } } \left[ W \right] ) ^ { 2 } = \operatorname { \mathbb { E } } \left[ | W | ^ { 2 } \right] - ( \operatorname { \mathbb { E } } \left[ W \right] ) ^ { 2 } ,
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
which reduces, in the case of $W$ symmetrically distributed around 0, to $\mathbb { E } \left[ | W | ^ { 2 } \right]$ . We do not know yet the value of $\operatorname { V a r } ( W ) = \mathbb { E } \left[ | W | ^ { 2 } \right]$ . However, we do know a related quantity, $\mathrm { V a r } ( | W | )$ , because the magnitude of complex normal values, $| W |$ , follows the Rayleigh distribution (Chi-distributed with two degrees of freedom (DOFs)). This quantity is
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\operatorname { V a r } ( | W | ) = \operatorname { \mathbb { E } } \left[ | W | | W | ^ { * } \right] - ( \operatorname { \mathbb { E } } \left[ | W | \right] ) ^ { 2 } = \operatorname { \mathbb { E } } \left[ | W | ^ { 2 } \right] - ( \operatorname { \mathbb { E } } \left[ | W | \right] ) ^ { 2 } .
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
Putting them together:
|
| 178 |
+
|
| 179 |
+
$\operatorname { V a r } ( | W | ) = \operatorname { V a r } ( W ) - ( \mathbb { E } \left[ | W | \right] ) ^ { 2 }$ , and $\operatorname { V a r } ( W ) = \operatorname { V a r } ( | W | ) + ( \mathbb { E } \left[ | W | \right] ) ^ { 2 } .$
|
| 180 |
+
|
| 181 |
+
We now have a formulation for the variance of $W$ in terms of the variance and expectation of its magnitude, both properties analytically computable from the Rayleigh distribution’s single parameter, $\sigma$ , indicating the mode. These are:
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\mathbb { E } \left[ \lvert W \rvert \right] = \sigma \sqrt { \frac { \pi } { 2 } } , ~ \mathrm { V a r } ( \lvert W \rvert ) = \frac { 4 - \pi } { 2 } \sigma ^ { 2 } .
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
The variance of $W$ can thus be expressed in terms of its generating Rayleigh distribution’s single parameter, $\sigma$ , thus:
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\operatorname { V a r } ( W ) = { \frac { 4 - \pi } { 2 } } \sigma ^ { 2 } + \left( \sigma { \sqrt { \frac { \pi } { 2 } } } \right) ^ { 2 } = 2 \sigma ^ { 2 } .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
If we want to respect the Glorot and Bengio (2010) criterion which ensures that the variances of the input, the output and their gradients are the same, then we would have $\operatorname { V a r } ( W ) = 2 / ( n _ { i n } +$ $n _ { o u t } )$ ), where √ $n _ { i n }$ and $n _ { o u t }$ are the number of input and output units respectively. In such case, $\sigma = 1 / \sqrt { n _ { i n } + n _ { o u t } }$ . If we want to respect the He et al. (2015b) initialization that presents an initialization criterion that is specific to ReLUs, then $\operatorname { V a r } ( W ) = 2 / n _ { i n }$ which $\sigma = 1 / \sqrt { n _ { i n } }$ .
|
| 194 |
+
|
| 195 |
+
The magnitude of the complex parameter $W$ is then initialized using the Rayleigh distribution with the appropriate mode $\sigma$ . We can see from equation 10, that the variance of $W$ depends on on its magnitude and not on its phase. We then initialize the phase using the uniform distribution between $- \pi$ and $\pi$ . By performing the multiplication of the magnitude by the phasor as is detailed in equation 8, we perform the complete initialization of the complex parameter.
|
| 196 |
+
|
| 197 |
+
In all the experiments that we report, we use variant of this initialization which leverages the independence property of unitary matrices. As it is stated in Cogswell et al. (2015), Srivastava et al. (2014), and Tompson et al. (2015), learning decorrelated features is beneficial for learning as it allows to perform better generalization and faster learning. This motivates us to achieve initialization by considering a (semi-)unitary matrix which is reshaped to the size of the weight tensor. Once this is done, the weight tensor is mutiplied by $\sqrt { H e _ { v a r } / \mathrm { V a r } ( W ) }$ or $\sqrt { G l o r o t _ { v a r } / \mathrm { V a r } ( W ) }$ where $G l o r o t _ { v a r }$ and $H e _ { v a r }$ are respectively equal to $2 / ( n _ { i n } + n _ { o u t } )$ and $2 / n _ { i n }$ . In such a way we allow kernels to be independent from each other as much as possible while respecting the desired criterion. Note that we perform the analogous initialization for real-valued models by leveraging the independence property of orthogonal matrices in order to build kernels that are as much independent from each other as possible while respecting a given criterion.
|
| 198 |
+
|
| 199 |
+
# 3.7 COMPLEX CONVOLUTIONAL RESIDUAL NETWORK
|
| 200 |
+
|
| 201 |
+
A deep convolutional residual network of the nature presented in He et al. (2015a; 2016) consists of 3 stages within which feature maps maintain the same shape. At the end of a stage, the feature maps are downsampled by a factor of 2 and the number of convolution filters are doubled. The sizes of the convolution kernels are always set to $3 \mathrm { ~ x ~ } 3$ . Within a stage, there are several residual blocks which comprise 2 convolution layers each. The contents of one such residual block in the real and complex setting is illustrated in Appendix Figure 1b.
|
| 202 |
+
|
| 203 |
+
In the complex valued setting, the majority of the architecture remains identical to the one presented in He et al. (2016) with a few subtle differences. Since all datasets that we work with have realvalued inputs, we present a way to learn their imaginary components to let the rest of the network operate in the complex plane. We learn the initial imaginary component of our input by performing the operations present within a single real-valued residual block
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
B N R e L U C o n v B N R e L U C o n v
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
Using this learning block yielded better emprical results than assuming that the input image has a null imaginary part. The parameters of this real-valued residual block are trained by backpropagating errors from the task specific loss function. Secondly, we perform a $C o n v \dot { B N } \mathsf { \bar { A } } c \dot { t } i \dot { v } a t i o n$ operation on the obtained complex input before feeding it to the first residual block. We also perform the same operation on the real-valued network input instead of $C o n v M$ axpooling as in He et al. (2016). Inside, residual blocks, we subtly alter the way in which we perform a projection at
|
| 210 |
+
|
| 211 |
+
Table 1: Classification error on CIFAR-10, CIFAR-100 and $\mathrm { S V H N ^ { * } }$ using different complex activations functions (zReLU, modReLU and CReLU). WS, DN and IB stand for the wide and shallow, deep and narrow and in-between models respectively. The prefixes R & C refer to the real and complex valued networks respectively. Performance differences between the real network and the complex network using CReLU are reported between their respective best models. All models are constructed to have roughly 1.7M parameters except the modReLU models which have roughly $2 . 5 \mathbf { M }$ parameters. modReLU and zReLU were largely outperformed by CReLU in the reported experiments. Due to limited resources, we haven’t performed all possible experiments as the conducted ones are already conclusive. A "-" is filled in front of an unperformed experiment.
|
| 212 |
+
|
| 213 |
+
Table 2: Classification error on CIFAR-10, CIFAR-100 and $\operatorname { S V H N } ^ { * }$ using different normalization strategies. NCBN, CBN and BN stand for a Naive variant of the complex batch-normalization, complex batch-normalization and regular batch normalization respectively. (R) & (C) refer to the use of the real- and complex-valued convolution respectively. The complex models use CReLU as activation. All models are constructed to have roughly 1.7M parameters. 5 out of 6 experiments using the naive variant of the complex batch normalization failed with the apparition of NaNs during training. As these experiments are already conclusive and due to limited resources, we haven’t conducted other experiments for the NCBN model. A "-" is filled in front of an unperformed experiment.
|
| 214 |
+
|
| 215 |
+
<table><tr><td rowspan=1 colspan=1>ARCH</td><td rowspan=1 colspan=3>CIFAR-10</td><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>SVHN*</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4>zRELU MODRELU CRELU zRELU MODRELU (CRELU</td><td rowspan=1 colspan=1>zRELU MODRELU CRELU</td></tr><tr><td rowspan=2 colspan=1>cwsCDN</td><td rowspan=1 colspan=3>11.71 23.42 6.17</td><td rowspan=1 colspan=1>50.38 26.36</td><td rowspan=1 colspan=1>80.41 7.43 3.70</td></tr><tr><td rowspan=1 colspan=1>9.</td><td rowspan=1 colspan=2>22.49 6.73</td><td rowspan=2 colspan=1>50.64 28.2248.10 28.64</td><td rowspan=1 colspan=1>80.41 1 3.72</td></tr><tr><td rowspan=1 colspan=1>CIB</td><td rowspan=1 colspan=3>11.36 23.63 5.59</td><td rowspan=1 colspan=1>4.98 1 3.62</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>RELU</td><td rowspan=1 colspan=1>RELU</td><td rowspan=1 colspan=1>RELU</td></tr><tr><td rowspan=1 colspan=1>RWS</td><td rowspan=1 colspan=3>5.42</td><td rowspan=2 colspan=1>27.2227.8427.71</td><td rowspan=2 colspan=1>3.423.524.30</td></tr><tr><td rowspan=1 colspan=1>RDNRIB</td><td rowspan=1 colspan=3>6.296.07</td><td rowspan=1 colspan=1>6.29</td><td rowspan=1 colspan=1>3.52</td></tr><tr><td rowspan=1 colspan=1>DIFF</td><td rowspan=1 colspan=3>-0.17</td><td rowspan=1 colspan=1>+0.86</td><td rowspan=1 colspan=1>-0.20</td></tr></table>
|
| 216 |
+
|
| 217 |
+
<table><tr><td>ARCH</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td><td colspan="3">SVHN*</td></tr><tr><td></td><td>NCBN(C)</td><td>CBN(R)</td><td>BN(C)</td><td>NCBN(C)</td><td>CBN(R)</td><td>BN(C)</td><td>NCBN(C)</td><td>CBN(R)</td><td>BN(C)</td></tr><tr><td>WS</td><td>1</td><td>5.47</td><td>6.32</td><td>27.29</td><td>26.63</td><td>27.89</td><td>NAN</td><td>3.80</td><td>3.52</td></tr><tr><td>DN</td><td></td><td>5.89</td><td>6.71</td><td>NAN</td><td>27.13</td><td>28.83</td><td>NAN</td><td>3.54</td><td>3.58</td></tr><tr><td>IB</td><td>-</td><td>5.66</td><td>6.83</td><td>NAN</td><td>26.99</td><td>29.89</td><td>NAN</td><td>3.74</td><td>3.56</td></tr></table>
|
| 218 |
+
|
| 219 |
+
the end of a stage in our network. We concatenate the output of the last residual block with the output of a 1x1 convolution applied on it with the same number of filters used throughout the stage and subsample by a factor of 2. In contrast, He et al. (2016) perform a similar 1x1 convolution with twice the number of feature filters in the current stage to both downsample the feature maps spatially and double them in number.
|
| 220 |
+
|
| 221 |
+
# 4 EXPERIMENTAL RESULTS
|
| 222 |
+
|
| 223 |
+
In this section, we present empirical results from using our model to perform image, music classification and spectrum prediction. First, we present our model’s architecture followed by the results we obtained on CIFAR-10, CIFAR-100, and $\mathrm { S V H N ^ { * } }$ as well as the results on automatic music transcription on the MusicNet benchmark and speech spectrum prediction on TIMIT.
|
| 224 |
+
|
| 225 |
+
# 4.1 IMAGE RECOGNITION
|
| 226 |
+
|
| 227 |
+
We adopt an architecture inspired by He et al. (2016). The latter will also serve as a baseline to compare against. We train comparable real-valued Neural Networks using the standard ReLU activation function. We have tested our complex models with the CReLU, zReLU and modRelu activation functions. We use a cross entropy loss for both real and complex models. A global average pooling layer followed by a single fully connected layer with a softmax function is used to classify the input as belonging to one of 10 classes in the CIFAR-10 and SVHN datasets and 100 classes for CIFAR-100.
|
| 228 |
+
|
| 229 |
+
We consider architectures that trade-off model depth (number of residual blocks per stage) and width (number of convolutional filters in each layer) given a fixed parameter budget. Specifically, we build three different models - wide and shallow (WS), deep and narrow (DN) and in-between (IB). In a model that has roughly 1.7 million parameters, our WS architecture for a complex network starts with 12 complex filters (24 real filters) per convolution layer in the initial stage and 16 residual blocks per stage. The DN architecture starts with 10 complex filters and 23 blocks per stage while the IB variant starts with 11 complex filters and 19 blocks per stage. The real-valued counterpart has also 1.7 million parameters. Its WS architecture starts with 18 real filters per convolutional layer and 14 blocks per stage. The DN architecture starts with 14 real filters and 23 blocks per stage and the IB architecture starts with 16 real filters and 18 blocks per stage.
|
| 230 |
+
|
| 231 |
+
All models (real and complex) were trained using the backpropagation algorithm with Stochastic Gradient Descent with Nesterov momentum (Nesterov, 1983) set at 0.9. We also clip the norm of our gradients to 1. We tweaked the learning rate schedule used in He et al. (2016) in both the real and complex residual networks to extract small performance improvements in both. We start our learning rate at 0.01 for the first 10 epochs to warm up the training and then set it at 0.1 from epoch 10-100 and then anneal the learning rates by a factor of 10 at epochs 120 and 150. We end the training at epoch 200.
|
| 232 |
+
|
| 233 |
+
Table 6.4 presents our results on performing image classification on CIFAR-10, CIFAR-100. In addition, we also consider a truncated version of the Street View House Numbers (SVHN) dataset which we call $\operatorname { S V H N } ^ { * }$ . For computational reasons, we use the required 73,257 training images of Street View House Numbers (SVHN). We still test on all 26,032 images. For all the tasks and for both the real- and complex-valued models, The WS architecture has yielded the best performances. This is in concordance with Zagoruyko and Komodakis (2016) who observed that wider and shallower residual networks perform better than their deeper and narrower counterpart. On CIFAR-10 and $\mathrm { S V H N ^ { * } }$ , the real-valued representation performs slightly better than its complex counterpart. On CIFAR100, the complex representation outperforms the real one. In general, the obtained results for both representation are quite comparable. To understand the effect of using either real or complex representation for a given task, we designed hybrid models that combine both. Table 2 contains the results for hybrid models. We can observe in the Table 2 that in cases where complex representation outperformed the real one (wide and shallow on CIFAR-100), combining a real-valued convolutional filter with a complex batch normalization improves the accuracy of the real-valued convolutional model. However, the complex-valued one is still outperforming it. In cases, where real-valued representation outperformed the complex one (wide and shallow on CIFAR-10 and ${ \mathrm { S V H N } } ^ { * }$ ), replacing a complex batch normalization by a regular one increased the accuracy of the complex convolutional model. Despite that replacement, the real-valued model performs better in terms of accuracy for such tasks. In general, these experiments show that the difference in efficiency between the real and complex models varies according to the dataset, to the task and to the architecture.
|
| 234 |
+
|
| 235 |
+
Ablation studies were performed in order to investigate the importance of the 2D whitening operation that occurs in the complex batch normalization. We replaced the complex batch normalization layers with a naive variant (NCBN) which, instead of left multiplying the centred unit by the inverse square root of its covariance matrix, just divides it by its complex variance. Here, this naive variant of CBN is Mimicking the regular BN by not taking into account correlation between the elements in the complex unit. The Naive variant of the Complex Batch Normalization performed very poorly; In 5 out of 6 experiments, training failed with the appearance of NaNs (See Section 6.6 for the explanation). By way of contrast, all 6 complex-valued Batch Normalization experiments converged. Results are given in Table 2.
|
| 236 |
+
|
| 237 |
+
Another ablation study was undertaken to compare CReLU, modReLU and $z$ RELU. Again the differences were stark: All CReLU experiments converged and outperformed both modReLU and $z$ ReLU, both which variously failed to converge or fared substantially worse. We think that modRelu didn’t perform as well as CReLU due to the fact that consecutive layers in a feed-forward net do not represent time-sequential patterns, and so, they might need to drop some phase information. Results are reported in Table 6.4. More discussion about phase information encoding is presented in section 6.7.
|
| 238 |
+
|
| 239 |
+
Table 3: MusicNet experiments. $F S$ is the sampling rate. Params is the total number of parameters. We report the average precision (AP) metric that is the area under the precision-recall curve.
|
| 240 |
+
|
| 241 |
+
<table><tr><td>ARCHITECTURE</td><td>FS</td><td>PARAMS</td><td>AP,%</td></tr><tr><td>SHALLOW, REAL</td><td>11kHz</td><td></td><td>66.1</td></tr><tr><td>SHALLOW, COMPLEX</td><td>11kHz</td><td></td><td>66.0</td></tr><tr><td>SHALLOW, THICKSTUN ET AL. (2016)</td><td>44.1kHz</td><td>=</td><td>67.8</td></tr><tr><td>DEEP, REAL</td><td>11kHz</td><td>10.0M</td><td>69.6</td></tr><tr><td>DEEP, COMPLEX</td><td>11kHz</td><td>8.8M</td><td>72.9</td></tr></table>
|
| 242 |
+
|
| 243 |
+
# 4.2 AUTOMATIC MUSIC TRANSCRIPTION
|
| 244 |
+
|
| 245 |
+
In this section we present results for the automatic music transcription (AMT) task. The nature of an audio signal allows one to exploit complex operations as presented earlier in the paper. The experiments were performed on the MusicNet dataset (Thickstun et al., 2016). For computational efficiency we resampled the original input from $4 4 . 1 \mathrm { k H z }$ to 11kHz using the algorithm described in Smith (2002). This sampling rate is sufficient to recognize frequencies presented in the dataset while reducing computational cost dramatically. We modeled each of the 84 notes that are present in the dataset with independent sigmoids (due to the fact that notes can fire simultaneously). We initialized the bias of the last layer to the value of -5 to reflect the distribution of silent/non-silent notes. As in the baseline, we performed experiments on the raw signal and the frequency spectrum. For complex experiments with the raw signal, we considered its imaginary part equal to zero. When using the spectrum input we used its complex representation (instead of only the magnitudes, as usual for AMT) for both real and complex models. For the real model, we considered the real and imaginary components of the spectrum as separate channels. The model we used for raw signals is a shallow convolutional network similar to the model used in the baseline, with the size reduced by a factor of 4 (corresponding to the reduction of the sampling rate). The filter size was 512 samples (about $1 2 \mathrm { m s } \mathrm { \Omega }$ ) with a stride of 16. The model for the spectral input is similar to the VGG model (Simonyan and Zisserman, 2015). The first layer has filter with size of 7 and is followed by 5 convolutional layers with filters of size 3. The final convolution block is followed by a fully connected layer with 2048 units. The latter is followed, in its turn, by another fully connected layer with 84 sigmoidal units. In all of our experiments we use an input window of 4096 samples or its corresponding FFT (which corresponds to the 16,384 window used in the baseline) and predicted notes in the center of the window. All networks were optimized with Adam. We start our learning rate at $1 0 ^ { - 3 }$ for the first 10 epochs and then anneal it by a factor of 10 at each of the epochs 100, 120 and 150. We end the training at epoch 200. For the real-valued models, we have used ReLU as activation. CReLU has been used as activation for the complex-valued models.
|
| 246 |
+
|
| 247 |
+
The complex network was initialized using the unitary initialization scheme respecting the He criterion as described in Section 3.6. For the real-valued network, we have used the analogue initial√ization of the weight tensor. It consists of performing an orthogonal initialization with a gain of $\sqrt { 2 }$ . The complex batch normalization was applied according to Section 3.5. Following Thickstun et al. (2016) we used recordings with ids $, 2 3 0 3 ^ { \prime }$ , ’2382’, ’1819’ as the test subset and additionally we created a validation subset using recording ids ’2131’, ’2384’, ’1792’, ’2514’, ’2567’, ’1876’ (randomly chosen from the training set). The validation subset was used for model selection and early stopping. The remaining 321 files were used for training. The results are summarized on Table 3. We achieve a performance comparable to the baseline with the shallow convolutional network. our VGG-based deep real-valued model reaches $6 9 . 6 \%$ average precision on the downsampled data. With significantly fewer parameters than its real counterpart, the VGG-based deep complex model, achieves $7 2 . 9 \%$ average precision which is the state of the art to the best of our knowledge. See Figures 2 and 3 in the Appendix for precision-recall curves and a sample of the output of the model.
|
| 248 |
+
|
| 249 |
+
Table 4: Speech Spectrum Prediction on TIMIT test set. CConv-LSTM denotes the Complex Convolutional LSTM.
|
| 250 |
+
|
| 251 |
+
<table><tr><td>MODEL</td><td>#PARAMS</td><td>MSE(VALIDATION)</td><td>MSE(TEST)</td></tr><tr><td>LSTM WISDOM ET AL. (2016)</td><td>~135K</td><td>16.59</td><td>16.98</td></tr><tr><td>FULL-CAPACITY URNN WISDOM ET AL.(2016)</td><td>~135K</td><td>14.56</td><td>14.66</td></tr><tr><td>CONV-LSTM (OUR BASELINE)</td><td>≈88K</td><td>11.10</td><td>12.18</td></tr><tr><td>CCONV-LSTM (OURS)</td><td>~88K</td><td>10.78</td><td>11.90</td></tr></table>
|
| 252 |
+
|
| 253 |
+
# 4.3 SPEECH SPECTRUM PREDICTION
|
| 254 |
+
|
| 255 |
+
We apply both a real Convolutional LSTM Xingjian et al. (2015) and a complex Convolutional LSTM on speech spectrum prediction task (See section 6.5 in the Appendix for the details of the real and complex Convolutional LSTMs). In this task, the model predicts the magnitude spectrum. It implicitly infers the real and imaginary components of the spectrum at time $t + 1$ , given all the spectrum (imaginary part and real components) up to time $t$ . This is slightly different from (Wisdom et al., 2016). The real and imaginary components are considered as separate channels in both model. We evaluate the model with mean-square-error (MSE) on log-magnitude to compare with the others Wisdom et al. (2016). The experiments are conducted on a downsampled (8kHz) version of the TIMIT dataset. By following the steps in Wisdom et al. (2016), raw audio waves are transformed into frequency domain via short-time Fourier transform (STFT) with a Hann analysis window of 256 samples and a window hop of 128 samples $5 0 \%$ overlap). We use a training set with 3690 utterances, a validation set with 400 utterances and a standard test set with 192 utterance.
|
| 256 |
+
|
| 257 |
+
To match the number of parameters for both model, the Convolutional LSTM has 84 feature maps while the complex model has 60 complex feature maps (120 feature maps in total). Adam Kingma and Ba (2014) with a fixed learning rate of 1e-4 is used in both experiments. We initialize the complex model with the unitary initialization scheme and the real model with orthogonal initialization respecting the Glorot criterion. The result is shown in Table 4 and the learning curve is shown in Figure 4. Our baseline model has achieved the state of the art and the complex convolutional LSTM model performs better over the baseline in terms of MSE and convergence.
|
| 258 |
+
|
| 259 |
+
# 5 CONCLUSIONS
|
| 260 |
+
|
| 261 |
+
We have presented key building blocks required to train complex valued neural networks, such as complex batch normalization and complex weight initialization. We have also explored a wide variety of complex convolutional network architectures, including some yielding competitive results for image classification and state of the art results for a music transcription task and speech spectrum prediction. We hope that our work will stimulate further investigation of complex valued networks for deep learning models and their application to more challenging tasks such as generative models for audio and images.
|
| 262 |
+
|
| 263 |
+
# ACKNOWLEDGEMENTS
|
| 264 |
+
|
| 265 |
+
We are grateful to Roderick Murray-Smith, Jörn-Henrik Jacobsen, Jesse Engel and all the students at MILA, especially Jason Jo, Anna Huang and Akram Erraqabi for helpful feedback and discussions. We also thank the developers of Theano (Theano Development Team, 2016) and Keras (Chollet et al., 2015). We are grateful to Samsung and the Fonds de Recherche du Québec – Nature et Technologie for their financial support. We would also like to acknowledge NVIDIA for donating a DGX-1 computer used in this work.
|
| 266 |
+
|
| 267 |
+
# REFERENCES
|
| 268 |
+
|
| 269 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 270 |
+
|
| 271 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. arXiv preprint arXiv:1602.07868, 2016.
|
| 272 |
+
|
| 273 |
+
Rupesh K Srivastava, Klaus Greff, and Jürgen Schmidhuber. Training very deep networks. In Advances in neural information processing systems, pages 2377–2385, 2015.
|
| 274 |
+
|
| 275 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015a.
|
| 276 |
+
|
| 277 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. arXiv preprint arXiv:1603.05027, 2016.
|
| 278 |
+
|
| 279 |
+
Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen Netzen. PhD thesis, diploma thesis, institut für informatik, lehrstuhl prof. brauer, technische universität münchen, 1991.
|
| 280 |
+
|
| 281 |
+
T Nitta. On the critical points of the complex-valued neural network. In Neural Information Processing, 2002. ICONIP’02. Proceedings of the 9th International Conference on, volume 3, pages 1099–1103. IEEE, 2002.
|
| 282 |
+
|
| 283 |
+
Akira Hirose and Shotaro Yoshida. Generalization characteristics of complex-valued feedforward neural networks in relation to signal coherence. IEEE Transactions on Neural Networks and learning systems, 23(4): 541–551, 2012.
|
| 284 |
+
|
| 285 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. arXiv preprint arXiv:1511.06464, 2015.
|
| 286 |
+
|
| 287 |
+
Ivo Danihelka, Greg Wayne, Benigno Uria, Nal Kalchbrenner, and Alex Graves. Associative long short-term memory. arXiv preprint arXiv:1602.03032, 2016.
|
| 288 |
+
|
| 289 |
+
Scott Wisdom, Thomas Powers, John Hershey, Jonathan Le Roux, and Les Atlas. Full-capacity unitary recurrent neural networks. In Advances in Neural Information Processing Systems, pages 4880–4888, 2016.
|
| 290 |
+
|
| 291 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
|
| 292 |
+
|
| 293 |
+
Tony A Plate. Holographic reduced representation: Distributed representation for cognitive structures. 2003.
|
| 294 |
+
|
| 295 |
+
David P Reichert and Thomas Serre. Neuronal synchrony in complex-valued deep networks. arXiv preprint arXiv:1312.6115, 2013.
|
| 296 |
+
|
| 297 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances In Neural Information Processing Systems, pages 4790– 4798, 2016a.
|
| 298 |
+
|
| 299 |
+
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. CoRR abs/1609.03499, 2016b.
|
| 300 |
+
|
| 301 |
+
Kyunghyun Cho, Bart Van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
|
| 302 |
+
|
| 303 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. arXiv preprint arXiv:1607.03474, 2016.
|
| 304 |
+
|
| 305 |
+
Guangji Shi, Maryam Modir Shanechi, and Parham Aarabi. On the importance of phase in human speech recognition. IEEE transactions on audio, speech, and language processing, 14(5):1867–1874, 2006.
|
| 306 |
+
|
| 307 |
+
Alan V Oppenheim and Jae S Lim. The importance of phase in signals. Proceedings of the IEEE, 69(5): 529–541, 1981.
|
| 308 |
+
|
| 309 |
+
Oren Rippel, Jasper Snoek, and Ryan P Adams. Spectral representations for convolutional neural networks. In Advances in Neural Information Processing Systems, pages 2449–2457, 2015.
|
| 310 |
+
|
| 311 |
+
George M Georgiou and Cris Koutsougeras. Complex domain backpropagation. IEEE transactions on Circuits and systems II: analog and digital signal processing, 39(5):330–334, 1992.
|
| 312 |
+
|
| 313 |
+
Richard S Zemel, Christopher KI Williams, and Michael C Mozer. Lending direction to neural networks. Neural Networks, 8(4):503–512, 1995.
|
| 314 |
+
|
| 315 |
+
Taehwan Kim and Tülay Adalı. Approximation by fully complex multilayer perceptrons. Neural computation, 15(7):1641–1666, 2003.
|
| 316 |
+
|
| 317 |
+
Akira Hirose. Complex-valued neural networks: theories and applications, volume 5. World Scientific, 2003.
|
| 318 |
+
|
| 319 |
+
Tohru Nitta. Orthogonality of decision boundaries in complex-valued neural networks. Neural Computation, 16(1):73–97, 2004.
|
| 320 |
+
|
| 321 |
+
Geoffrey E Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527–1554, 2006.
|
| 322 |
+
|
| 323 |
+
Yoshua Bengio, Pascal Lamblin, Dan Popovici, Hugo Larochelle, et al. Greedy layer-wise training of deep networks. Advances in neural information processing systems, 19:153, 2007.
|
| 324 |
+
|
| 325 |
+
Christopher Poultney, Sumit Chopra, Yann L Cun, et al. Efficient learning of sparse representations with an energy-based model. In Advances in neural information processing systems, pages 1137–1144, 2007.
|
| 326 |
+
|
| 327 |
+
Joan Bruna, Soumith Chintala, Yann LeCun, Serkan Piantino, Arthur Szlam, and Mark Tygert. A mathematical motivation for complex-valued convolutional networks. arXiv preprint arXiv:1503.03438, 2015.
|
| 328 |
+
|
| 329 |
+
Edouard Oyallon and Stéphane Mallat. Deep roto-translation scattering for object classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2865–2873, 2015.
|
| 330 |
+
|
| 331 |
+
Mark Tygert, Arthur Szlam, Soumith Chintala, Marc’Aurelio Ranzato, Yuandong Tian, and Wojciech Zaremba. Scale-invariant learning and convolutional networks. arXiv preprint arXiv:1506.08230, 2015.
|
| 332 |
+
|
| 333 |
+
Daniel E Worrall, Stephan J Garbin, Daniyar Turmukhambetov, and Gabriel J Brostow. Harmonic networks: Deep translation and rotation equivariance. arXiv preprint arXiv:1612.04642, 2016.
|
| 334 |
+
|
| 335 |
+
Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In International Conference on Machine Learning, pages 2071–2080, 2016.
|
| 336 |
+
|
| 337 |
+
Théo Trouillon and Maximilian Nickel. Complex and holographic embeddings of knowledge graphs: a comparison. arXiv preprint arXiv:1707.01475, 2017.
|
| 338 |
+
|
| 339 |
+
Andy M Sarroff, Victor Shepardson, and Michael A Casey. Learning representations using complex-valued nets. arXiv preprint arXiv:1511.06351, 2015.
|
| 340 |
+
|
| 341 |
+
Nitzan Guberman. On complex valued convolutional neural networks. arXiv preprint arXiv:1602.09046, 2016.
|
| 342 |
+
|
| 343 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. arXiv preprint arXiv:1511.06068, 2015.
|
| 344 |
+
|
| 345 |
+
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.
|
| 346 |
+
|
| 347 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pages 249–256, 2010.
|
| 348 |
+
|
| 349 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing humanlevel performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pages 1026–1034, 2015b.
|
| 350 |
+
|
| 351 |
+
Jonathan Tompson, Ross Goroshin, Arjun Jain, Yann LeCun, and Christoph Bregler. Efficient object localization using convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 648–656, 2015.
|
| 352 |
+
|
| 353 |
+
Yurii Nesterov. A method of solving a convex programming problem with convergence rate o (1/k2). 1983.
|
| 354 |
+
|
| 355 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 356 |
+
|
| 357 |
+
John Thickstun, Zaid Harchaoui, and Sham Kakade. Learning features of music from scratch. In Proc. ICLR, 2016.
|
| 358 |
+
|
| 359 |
+
Julius O Smith. Digital audio resampling. Online http://www-ccrma. stanford. edu/˜ jos/resample, 2002.
|
| 360 |
+
|
| 361 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Proc. ICLR, 2015.
|
| 362 |
+
|
| 363 |
+
SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems, pages 802–810, 2015.
|
| 364 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 365 |
+
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.
|
| 366 |
+
François Chollet et al. Keras: Deep learning library for theano and tensorflow. URL: https://keras. io/k, 2015.
|
| 367 |
+
|
| 368 |
+
# 6 APPENDIX
|
| 369 |
+
|
| 370 |
+
In practice, the complex convolution operation is implemented as illustrated in Fig.1a where $M _ { I }$ , $M _ { R }$ refer to imaginary and real feature maps and $K _ { I }$ and $K _ { R }$ refer to imaginary and real kernels. ${ M } _ { I } K _ { I }$ refers to result of a real-valued convolution between the imaginary kernels $K _ { I }$ and the imaginary feature maps $M _ { I }$ .
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
(b) A complex convolutional residual network (left) and an equivalent real-valued residual network (right).
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 1: Complex convolution and residual network implementation details.
|
| 377 |
+
|
| 378 |
+
(a) An illustration of the complex convolution operator.
|
| 379 |
+
|
| 380 |
+
# 6.1 MUSICNET ILLUSTRATIONS
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 2: Precision-recall curve
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 3: Predictions (Top) vs. ground truth (Bottom) for a music segment from the test set.
|
| 387 |
+
|
| 388 |
+
# 6.2 HOLOMORPHISM AND CAUCHY–RIEMANN EQUATIONS
|
| 389 |
+
|
| 390 |
+
Holomorphism, also called analyticity, ensures that a complex-valued function is complex differentiable in the neighborhood of every point in its domain. This means that the derivative, $f ^ { \prime } ( z _ { 0 } ) \equiv$ $\begin{array} { r } { \operatorname* { l i m } _ { \Delta z 0 } \big [ \frac { ( f ( z _ { 0 } ) + \bar { \Delta } z ) - f ( z _ { 0 } ) } { \Delta z } \big ] } \end{array}$ of le $f$ very poinsuch that $z _ { \mathrm { 0 } }$ $f$ er. $f$ is and complex-valuedare real-valued $z = x + i y$ $f ( z ) = u ( x , y ) + i v ( x , y )$ $u$ $v$ functions. One possible way of expressing $\Delta z$ is to have $\Delta z = \Delta x + i \Delta y$ . $\Delta z$ can approach 0 from multiple directions (along the real axis, imaginary axis or in-between). However, in order to be complex differentiable, $f ^ { \prime } ( z _ { 0 } )$ must be the same complex quantity regardless of direction of approach. When $\Delta z$ approaches 0 along the real axis, $f ^ { \prime } ( z _ { 0 } )$ could be written as:
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { r } { f ^ { \prime } ( z _ { 0 } ) \equiv \underset { \Delta z 0 } { \mathrm { l i m } } [ \frac { ( f ( z _ { 0 } ) + \Delta z ) - f ( z _ { 0 } ) } { \Delta z } ] } \\ { = \underset { \Delta x 0 } { \mathrm { l i m } } \underset { \Delta y 0 } { \mathrm { l i m } } [ \frac { \Delta u ( x _ { 0 } , y _ { 0 } ) + i \Delta v ( x _ { 0 } , y _ { 0 } ) } { \Delta x + i \Delta y } ] } \\ { = \underset { \Delta x 0 } { \mathrm { l i m } } [ \frac { \Delta u ( x _ { 0 } , y _ { 0 } ) + i \Delta v ( x _ { 0 } , y _ { 0 } ) } { \Delta x + i 0 } ] . } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
When $\Delta z$ approaches 0 along the imaginary axis, $f ^ { \prime } ( z _ { 0 } )$ could be written as:
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\begin{array} { r l } & { = \underset { \Delta y 0 } { \operatorname* { l i m } } \underset { \Delta x 0 } { \operatorname* { l i m } } [ \frac { \Delta u ( x _ { 0 } , y _ { 0 } ) + i \Delta v ( x _ { 0 } , y _ { 0 } ) } { \Delta x + i \Delta y } ] } \\ & { = \underset { \Delta y 0 } { \operatorname* { l i m } } [ \frac { \Delta u ( x _ { 0 } , y _ { 0 } ) + i \Delta v ( x _ { 0 } , y _ { 0 } ) } { 0 + i \Delta y } ] } \end{array}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
Satisfying equations 11 and 12 is equivalent of having $\begin{array} { r } { \frac { \partial f } { \partial z } = \frac { \partial u } { \partial x } + i \frac { \partial v } { \partial x } = - i \frac { \partial u } { \partial y } + \frac { \partial v } { \partial y } } \end{array}$ . So, in order to be complex differentiable, $f$ should satisfy $\begin{array} { r } { { \frac { \partial u } { \partial x } } = { \frac { \partial v } { \partial y } } } \end{array}$ and $\begin{array} { r } { \frac { \partial u } { \partial y } = - \frac { \partial v } { \partial x } } \end{array}$ . These are called the Cauchy–Riemann equations and they give a necessary condition for $f$ to be complex differentiable or "holomorphic". Given that $u$ and $v$ have continuous first partial derivatives, the Cauchy-Riemann equations become a sufficient condition for $f$ to be holomorphic.
|
| 403 |
+
|
| 404 |
+
# 6.3 THE GENRALIZED COMPLEX CHAIN RULE FOR A REAL-VALUED LOSS FUNCTION
|
| 405 |
+
|
| 406 |
+
If $L$ is a real-valued loss function and $z$ is a complex variable such that $z = x + i y$ where $x , y \in \mathbb { R }$ , then:
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\nabla _ { L } ( z ) = \frac { \partial L } { \partial z } = \frac { \partial L } { \partial x } + i \frac { \partial L } { \partial y } = \frac { \partial L } { \partial \Re ( z ) } + i \frac { \partial L } { \partial \Im ( z ) } = \Re ( \nabla _ { L } ( z ) ) + i \Im \left( \nabla _ { L } ( z ) \right) .
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
Now if we have another complex variable $t = r + i s$ where $z$ could be expressed in terms of $t$ and $r , s \in \mathbb { R }$ , we would then have:
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\begin{array} { r l } & { \nabla _ { L } ( t ) = \displaystyle \frac { \partial L } { \partial t } = \frac { \partial L } { \partial r } + i \frac { \partial L } { \partial s } } \\ & { \qquad = \displaystyle \frac { \partial L } { \partial x } \frac { \partial x } { \partial r } + \frac { \partial L } { \partial y } \frac { \partial y } { \partial r } + i \bigg ( \frac { \partial L } { \partial x } \frac { \partial x } { \partial s } + \frac { \partial L } { \partial y } \frac { \partial y } { \partial s } \bigg ) } \\ & { \qquad = \displaystyle \frac { \partial L } { \partial x } \bigg ( \frac { \partial x } { \partial r } + i \frac { \partial x } { \partial s } \bigg ) + \frac { \partial L } { \partial y } \bigg ( \frac { \partial y } { \partial r } + i \frac { \partial y } { \partial s } \bigg ) } \\ & { \qquad = \displaystyle \frac { \partial L } { \partial \Re ( z ) } \bigg ( \frac { \partial x } { \partial r } + i \frac { \partial x } { \partial s } \bigg ) + \frac { \partial L } { \partial \Re ( z ) } \bigg ( \frac { \partial y } { \partial r } + i \frac { \partial y } { \partial s } \bigg ) } \\ & { \qquad = \Re ( \nabla _ { L } ( z ) ) \bigg ( \frac { \partial x } { \partial r } + i \frac { \partial x } { \partial s } \bigg ) + \Im ( \nabla _ { L } ( z ) ) \bigg ( \frac { \partial y } { \partial r } + i \frac { \partial y } { \partial s } \bigg ) . } \end{array}
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
# 6.4 COMPUTATIONAL COMPLEXITY AND FLOPS
|
| 419 |
+
|
| 420 |
+
In terms of computational complexity, the convolutional operation and the complex batchnorm are of the same order as their real counterparts. However, as a complex multiplication is 4 times more expensive than its real counterpart, all complex convolutions are 4 times more expensive as well.
|
| 421 |
+
|
| 422 |
+
Additionally, the complex BatchNorm is not implemented in cuDNN and therefore had to be simulated with a sizeable sequence of elementwise operations. This leads to a ballooning of the number of nodes in the compute graph and to inefficiencies due to lack of effective operation fusion. A dedicated cuDNN kernel will, however, reduce the cost to little more than that of the real-valued BatchNorm.
|
| 423 |
+
|
| 424 |
+
Ignoring elementwise operations, which constitute a negligible fraction of the floating-point operations in the neural network, we find that for all architectures in and for all of CIFAR10, CIFAR100 or SVHN, the inference cost in real FLOPS per example is roughly identical. It is $\sim 2 6 5$ MFLOPS for the $\mathbb { R }$ -valued variant and $\sim 1 0 3 0$ MFLOPS for the $\mathbb { C }$ -valued variant of the architecture, approximately quadruple.
|
| 425 |
+
|
| 426 |
+
# 6.5 CONVOLUTIONAL LSTM
|
| 427 |
+
|
| 428 |
+
A Convolutional LSTM is similar to a fully connected LSTM. The only difference is that, instead of using matrix multiplications to perform computation, we use convolutional operations. The computation in a realvalued Convolutional LSTM is defined as follows:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\begin{array} { r l } & { \mathbf i _ { t } = \sigma \big ( \mathbf W _ { x i } * \mathbf x _ { t } + \mathbf W _ { h i } * \mathbf W _ { t - 1 } + \mathbf b _ { i } \big ) } \\ & { \mathbf f _ { t } = \sigma \big ( \mathbf W _ { x f } * \mathbf x _ { t } + \mathbf W _ { h f } * \mathbf h _ { t - 1 } + \mathbf b _ { f } \big ) } \\ & { \mathbf c _ { t } = \mathbf f _ { t } \circ \mathbf c _ { t - 1 } + \mathbf i _ { t } \circ \operatorname { t a n h } ( \mathbf W _ { x c } * \mathbf x _ { t } + \mathbf W _ { h c } * \mathbf h _ { t - 1 } + \mathbf b _ { c } ) } \\ & { \mathbf o _ { t } = \sigma \big ( \mathbf W _ { x o } * \mathbf x _ { t } + \mathbf W _ { h o } * \mathbf h _ { t - 1 } + \mathbf b _ { o } \big ) } \\ & { \mathbf h _ { t } = \mathbf o _ { t } \circ \operatorname { t a n h } ( \mathbf c _ { t } ) } \end{array}
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
Where $\sigma$ denotes the sigmoidal activation function, $^ { \circ }$ the elementwise multiplication and $^ *$ the real-valued convolution. $\mathbf { i } _ { t } , \mathbf { f } _ { t }$ , $\mathbf { o } _ { t }$ represent the vector notation of the input, forget and output gates respectively. $\mathbf { c } _ { t }$ and $\mathbf { h } _ { t }$ represent the vector notation of the cell and hidden states respectively. the gates and states in a ConvLSTM are tensors whose last two dimensions are spatial dimensions. For each of the gates, $\mathbf { W } _ { x g a t e }$ and $\mathbf { W } _ { h g a t e }$ are respectively the input and hidden kernels.
|
| 435 |
+
|
| 436 |
+
For the Complex Convolutional LSTM, we just replace the real-valued convolutional operation by its complex counterpart. We maintain the real-valued elementwise multiplication. The sigmoid and tanh are both performed separately on the real and the imaginary parts.
|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
Figure 4: Learning curve for speech spectrum prediction from dev set.
|
| 440 |
+
|
| 441 |
+
6.6 COMPLEX STANDARDIZATION AND INTERNAL COVARIATE SHIFT
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 5: Depiction of Complex Standardization in Deep Complex Networks. At left, Naive Complex Standardization (division by complex standard deviation); At right, Complex Standardization (left-multiplication by inverse square root of covariance matrix between $\Re$ and $\mathfrak { I }$ ). The 250 input complex scalars are at the bottom, with $\Re ( v )$ plotted on $x$ (red axis) and $\Im ( v )$ plotted on $y$ (green axis). Deeper representations correspond to greater $z$ (blue axis). The gray ellipse encloses the input scalars within 1 standard deviation of the mean. Red ellipses enclose all scalars within 1 standard deviation of the mean after “standardization”. Blue ellipses enclose all scalars within 1 standard deviation of the mean after left-multiplying all the scalars by a random $2 \times 2$ linear transformation matrix. With the naive standardization, the distribution becomes progressively more elliptical with every layer, eventually collapsing to a line. This ill-conditioning manifests itself as NaNs in the forward pass or backward pass. With the complex standardization, the points’ distribution is always successfully re-circularized.
|
| 445 |
+
|
| 446 |
+
# 6.7 PHASE INFORMATION ENCODING
|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
|
| 450 |
+
Figure 6: Phase information encoding for each of the activation functions tested for the Deep Complex Network. The $\mathbf { X }$ -axis represents the real part and the y-axis axis represents the imaginary part; The bottom figure corresponds to the case where $b < 0$ for modReLU. The radius of the white circle is equal to $| b |$ . In case where $b \geq 0$ , the whole complex plane would be preserving both phase and magnitude information and the whole plane would have been colored with orange. Different colors represents different encoding of the complex information in the plane. We can see the for both zReLU and modReLU, the complex representation is discriminated into two regions, i.e, the one that preserves the whole complex information (colored in orange) and the one that cancels it (colored in white). However, CReLU discriminates the complex information into 4 regions where in two of which, phase information is projected and not canceled. This allows CReLU to discriminate information easier with respect to phase information than the other activation functions. For both zReLU and modReLU, we can see that phase information may be preserved explicitly through a number of layers when these activation functions are operating in their linear regime, prior to a layer further up in a network where the phase of an input lies in a zero region. CReLU has more flexibility manipulating phase as it can either set it to zero or $\pi / 2$ , or even delete the phase information (when both real and imaginary parts are canceled) at a given level of depth in the network.
|
md/train/H1TWfmnNf/H1TWfmnNf.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DO CONVOLUTIONAL NEURAL NETWORKS ACT AS COMPOSITIONAL NEAREST NEIGHBORS?
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a simple approach based on pixel-wise nearest neighbors to understand and interpret the internal operations of state-of-the-art neural networks for pixel-level tasks. Specifically, we aim to understand the synthesis and prediction mechanisms of state-of-the-art convolutional neural networks for pixel-level tasks. To this end, we primarily analyze the synthesis process of generative models and the prediction mechanism of discriminative models. The main hypothesis of this work is that convolutional neural networks for pixel-level tasks learn a fast compositional nearest neighbor synthesis or prediction function. Our experiments on semantic segmentation and image-to-image translation show qualitative and quantitative evidence supporting this hypothesis.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Convolutional neural networks (CNNs) have revolutionized computer vision, producing impressive results for discriminative tasks such as image classification and semantic segmentation. More recently, they have also produced startlingly impressive results for image generation through generative models. However, in both cases, such feed-forward networks largely operate as “black boxes.” As a community, we are still not able to succinctly state why and how such feed-forward functions generate a particular output from a given input. If a network fails on a particular input, why? How will a network behave on never-before-seen data? To answer such questions, there is a renewed interest in so-called explainable $A I ^ { 1 }$ . The central goal in this (re)invigorated space is the development of machine learning systems that are designed to be more interpretable and explanatory.
|
| 12 |
+
|
| 13 |
+
Explanation-by-correspondence: One attractive approach to interpretability stems from casebased reasoning or “explanation-by-example” (Lipton, 2016). Such an approach dates back to classic AI systems that predict medical diagnoses or legal judgments that were justified through case studies or historical precedent (Aamodt $\&$ Plaza, 1994). For example, radiologists can justify diagnoses of an imaged tumor as ‘malignant’ by reference to a previously-seen example (Caruana et al., 1999). However, this approach can generate only $N$ explanations given $N$ training exemplars. Our work demonstrates that deep networks can generate exponentially more explanations through composition: e.g., this part of the image looks like this part of exemplar A, while another part looks like that part of exemplar B. We term this “explanation-by-correspondence”, since our explanations provide detailed correspondence of parts (or even pixels) of a query image to a set of exemplars.
|
| 14 |
+
|
| 15 |
+
Spatial prediction: In this work, we focus on the class of CNNs designed to make predictions at each image pixel. Many problems in computer vision can be cast in this framework, e.g., semantic segmentation, depth estimation, image synthesis, and image translation. We explore a simple hypothesis for explaining the behavior of such networks: they operate by cutting-and-pasting image patches found in training data. Consider the top row of Fig. 1, where we visualize the output of Isola et al. (2016)’s translation network trained to synthesize images of building facades from label masks. Why does the network generate the strange diagonal gray edge at the top? To answer this question, we visualize image pixels extracted from the closest-matching nearest-neighbor (NN) patches found in the training data. Remarkably, NN-synthesis looks quite similar to the CNN output, providing a clear explanation for the synthesized corner artifact.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: We propose a non-parametric method to explain and modify the behavior of convolutional Figure 1: We propose a non-parametric method to explain and modifyrametric method to explain and modify the behavior of convolutionalnetworks, including those that classify pixels and those that generate images. For example, given the label mask on the top, why does a network generate strange gray border artifacts? Given the cluding those that classify pixels and those that generate images. Forluding those that classify pixels and those that generate images. For enetworks, including those that classify pixels and those that generate classify pixels and those that generate images. For example, givenimage on the bottom, how is a network able to segment out the left-most telephone pole in shadow? ask on the top, why does a network generate strange gray border artifk on the top, why does a network generate strange gray border artifacthe label mask on the top, why does a network generate strange grayy does a network generate strange gray border artifacts? Given theWe advocate an “explanation-by-example” approach to interpretation (Caruana et al., 1999). Next to the CNN output, we show the closest-matching training exemplar image. It appears to provide e bottom, how is a network able to segment out the barely-visible la bottom, how is a network able to segment out the barely-visible lam coarse explanations of such behaviors, though the quality of the output is still lacking (e.g., addixplanation-by-example” approach to interpretation (Caruana et al., 19planation-by-example” approach to interpretation (Caruana et al., 199vocate an “explanation-by-example” approach to interpretation (Carumple” approach to interpretation (Caruana et al., 1999). Next to thetional cars are hallucinated in the bottom row). One the right, we show the output obtained through CNN output, we show the closest-matching training exemplar image.est-matching training exemplar image. It appears to provide coarsea compositional nearest-neighbor operation that simply (1) matches input patches to those in the training set and (2) returns the corresponding output label. This means that the output is created by s of such behaviors, though the quality of the output is still lacking (e.g.of such behaviors, though the quality of the output is still lacking (e.g., cutting-and-pasting (composing) patches of training images. To ensure that inconsistent patches are ated in the bottom row). One the right, we show the output obtainedted in the bottom row). One the right, we show the output obtained tare hallucinated in the bottom row). One the right, we show the outrow). One the right, we show the output obtained through a com-not composed together, one needs to match patches using an embedding that captures both global semantics (e.g., architectural styles) and local structure (e.g., windows versus doors). We demonearest-neighbor operation that simply (1) matches input patches to thoarest-neighbor operation that simply (1) matches input patches to those strate that local convolutional neighborhoods of feature activations produce such rich embedding. eturns the corresponding output label. This means that the output is crturns the corresponding output label. This means that the output is creaset and (2) returns the corresponding output label. This means that thending output label. This means that the output is created by cutting-Such a perspective allows one to explain errors and modify the biases of a network by changing the and-pasting (composing) patches of thes of training images. To ensure thatset of image patches used for non-parametric matching.
|
| 19 |
+
|
| 20 |
+
., architectural styles) and local structure (e.g., windows versus doors). architectural styles) and local structure (e.g., windows versus doors). Wmantics (e.g., architectural styles) and local structure (e.g., windows ves) and local structure (e.g., windows versus doors). We demonstrateCompositional nearest-neighbors: Our central thesis is consistent with recent work on network that local convolutional neighborhoods of feature activations produceorhoods of feature activations produce such rich embedding. Such amemorization (Zhang et al., 2016), but notably, naive memorization fails to explain how and why perspective allows one to explain errors and modify the biases of a neain errors and modify the biases of a network by changing the set ofnetworks generalize to never-before-seen data. We explain the latter through composition: the synallows one to explain errors and modify the biases of a network by challows one to explain errors and modify the biases of a network by chan thesized output in Fig. 1 consists of image patches copied from different training images. Given a es useds used foimagerametricdatabase of $N$ r non-parametrnon-parametricatches used foratching. [Devtraining images with $K$ matching. [Deva: Can you switcmatching. [Deva: Can you switchon-parametric matching. [Deva: Ca Can you switch the order of compixels each, global nearest-neighbors can produce $N$ the ore orde you s nnpossible and global nn, like teaser-deva.pdf?]a.pdf?]output images. On the other hand, compositional nearest-neighbors can produce $( N K ) ^ { K }$ outputs, nn, like teaser-deva.pdf?]n, like teaser-deva.pdf?]an exponentially larger set of outputs. Each output image can be obtained by independently matching each of the $K$ patches in the input query to one of $N K$ patches in the training set. However, many of these outputs may be unrealistic. For example, one should not synthesize a facade by composing a door above a window. To ensure global consistency, one needs to match patches using a carefully-tuned metric that captures such global knowledge. But where do we obtain such a metric?
|
| 21 |
+
|
| 22 |
+
Patch embeddings: Much past work has demonstrated that intermediate feature activations of a nal nearest-neighbors: Our central thesis is consistent with recent wal nearest-neighbors: Our central thesis is consistent with recent woCompositional nearest-neighbors: Our central thesis is consistent bors: Our central thesis is consistent with recent work on networkneural network can be interpreted as global embeddings for comparing entire images. For exammemorization (Zhang et al., 2016), but notably, naive memorization f016), but notably, naive memorization fails to explain how and whyple, Sharif Razavian et al. (2014); Devlin et al. (2015) show that the penultimate (“FC7”) layer of n (Zhang et al., 2016), but notably, naive memorization fails to expla (Zhang et al., 2016), but notably, naive memorization fails to explainimage classification networks learn embeddings of images that produce remarkably accurate nearestneralize to never-before-seen data. We explain the latter through comperalize to never-before-seen data. We explain the latter through compos neighbors. We apply this observation to spatial prediction networks in order to learn local embeddings of image patches or even pixels. These embeddings are quite rich in that they encode semantic knowledge that is both local (geometric structures centered at the pixel) and global (e.g., color and architectural style of the entire facade).
|
| 23 |
+
|
| 24 |
+
Correspondence and bias: Beyond being a mechanism for interpretation, we demonstrate that compositional NN matching is a viable algorithm that may approach the accuracy of highly-tuned CNNs. Although slower than a feed-forward net, compositional matching is attractive in two respects: (1) It provides spatial correspondences between pixels in the predicted output and pixels in the training set. Spatial correspondences may be useful in practical applications such as label transfer (Liu et al., 2011). (2) Implicit biases of the network can be explicitly manipulated by changing the set of images used for matching – it need not be the same set used for training the network. As an illustrative example, we can force a pre-trained image generation network to predict European or American building facades by restricting the set of images used for matching. Such a manipulation may, for example, be used to modify a biased face recognition network to process genders and races in a more egalitarian fashion.
|
| 25 |
+
|
| 26 |
+
Contribution: We introduce a Compositional Nearest Neighbors pipeline for interpreting and modifying the behavior of Convolutional Neural Networks. Specifically, we demonstrate that CNNs appear to work by memorizing image patches from training data, and then composing them into new configurations. To make compositional matching viable, CNNs learn a local embedding of image patches that captures both global and local semantics. An accurate local embedding is crucial in order to efficiently process an exponentially-large set of potential outputs. We validate our hypothesis on state-of-the-art networks for image translation and semantic image segmentation. Finally, we also show evidence that compositional matching can be used to predict activations of internal layers, generate spatial correspondences, and manipulate the implicitly-learned biases of a network.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
We broadly classify networks for spatial prediction into two categories: (1) discriminative prediction, where one is seeking to infer high-level semantic information from RGB values; and (2) image generation, where the intent is to synthesize a new image from a given input “prior”. There is a broad literature for each of these tasks, and here we discuss the ones most relevant to ours.
|
| 31 |
+
|
| 32 |
+
Discriminative models: An influential formulation for state-of-the-art spatial prediction tasks is that of fully convolutional networks (Long et al., 2015). These have been used for pixel prediction problems such as semantic segmentation (Long et al., 2015; Hariharan et al., 2015; Ronneberger et al., 2015; Bansal et al., 2017a; Chen et al., 2016), depth/surface-normal estimation (Bansal et al., 2016; Eigen & Fergus, 2015), or low-level edge detection (Xie & Tu, 2015; Bansal et al., 2017a). Substantial progress has been made to improve the performance by employing deeper architectures (He et al., 2015), or increasing the capacity of the models (Bansal et al., 2017a), or utilizing skip connections, or intermediate supervision (Xie & Tu, 2015). However, we do not precisely know what these models are actually capturing to do pixel-level prediction. In the race for better performance, the interpretability of these models has been typically ignored. In this work, we focus on interpreting encoder-decoder architectures for spatial classification (Ronneberger et al., 2015; Badrinarayanan et al., 2017).
|
| 33 |
+
|
| 34 |
+
Image generation: Goodfellow et al. (2014) proposed a two-player min-max formulation where a generator $G$ synthesized an image from random noise $z$ , and a discriminator $( D )$ is used to distinguish the generated images from the real images. While this Generative Adversarial Network (GAN) formulation was originally proposed to synthesize an image from random noise vectors $z$ , this formulation could also be used to synthesize new images from other priors, such as, a low resolution image or label mask by treating $z$ as an explicit input to be conditioned upon. This conditional image synthesis via generative adversarial formulation has been well utilized by multiple follow-up works to synthesize a new image conditioned on a low-resolution image (Denton et al., 2015), class labels (Radford et al., 2015), and other inputs (Isola et al., 2016; Zhu et al., 2017). While the quality of synthesis from different inputs has rapidly improved in recent history, interpretation of GANs has been relatively unexplored. In this work, we examine the influential Pix2Pix network Isola et al. (2016) and demonstrate an intuitive non-parametric representation for explaining its impressive results.
|
| 35 |
+
|
| 36 |
+
Interpretability: There is a substantial body of work (Zeiler & Fergus, 2014; Mahendran & Vedaldi, 2015; Zhou et al., 2014; Bau et al., 2017) on interpreting general convolutional neural networks (CNNs). The earlier work of Zeiler & Fergus (2014) presented an approach to understand and visualize the functioning of intermediate layers of CNN. Mahendran & Vedaldi (2015) proposed to invert deep features to visualize what is learned by CNNs, similar to inverting HOG features to understand object detection (Vondrick et al., 2013). Zhou et al. (2014) demonstrated that object detectors automatically pop up while learning the representation for scene categories. Krishnan & Ramanan (2016) explored interactive modification of a pre-trained network to learn novel concepts, and recently Bau et al. (2017) proposed to quantify interpretability by measuring scene semantics such as objects, parts, texture, material etc. Despite this, understanding the space of pixel-level CNNs is not well studied. The recent work of PixelNN (Bansal et al., 2017b) focuses on highquality image synthesis by making use of a two-stage matching process that begins by feed-forward CNN processing and ends with a nonparametric matching of high-frequency detail. We differ in our focus on interpretability rather than image synthesis, our examination of networks for both discriminative classification and image synthesis, and our simpler single-stage matching process that does not require feed-forward processing.
|
| 37 |
+
|
| 38 |
+
Compositionality: The design of part-based models (Crandall et al., 2005; Felzenszwalb et al., 2008), pictorial structures or spring-like connections (Fischler & Elschlager, 1973; Felzenszwalb & Huttenlocher, 2005), star-constellation models (Weber et al., 2000; Fergus et al., 2003), and the recent works using CNNs share a common theme of compositionality. While the earlier works explicitly enforce the idea of composing different parts for object recognition in the algorithmic formulation, there have been suggestions that CNNs also take a compositional approach (Zeiler & Fergus, 2014; Krishnan & Ramanan, 2016; Bau et al., 2017). We see compositional embeddings as rather different than compositional objects/parts. Using (Hinton, 1986)’s terminology, embeddings can be viewed as “distributed representations”, while objects/parts can be viewed as “sparse representations”. Much past work has argued that distributed representations are central to the success of deep networks (LeCun et al., 2015). We agree and posit that this is one reason why CNNs outperform classic hierarchical models of parts/objects. Specifically, Girshick et al. (2015) point out that classic part models can be implemented as CNNs with sparse activations, where individual neurons correspond to individual part responses. In practice, many neurons are not interpretable when examined individually, as pointed out by Zhou et al. (2014). An embedding perspective offers one solution that does not require individual dimensions to be meaningful - e.g., nearest neighbors in an embedding will not change if one applies a well-behaved linear transformation (e.g., rotation) to the embedding space. This is consistent with past work (Szegedy et al., 2013) that suggests that that linear combinations of activations are equally as informative as the original activations. Finally, if high-level activations represent objects, how can 4K activations (e.g., the typical dimension of FC7) represent $3 0 \mathrm { K } +$ objects (Biederman, 1987)? Our central thesis is that activations do not correspond to individual objects/parts, but rather the dimensions of a local embedding space in which objects/parts are points (matchable with nearest-neighbors).
|
| 39 |
+
|
| 40 |
+
# 3 COMPOSITIONAL NEAREST NEIGHBORS
|
| 41 |
+
|
| 42 |
+
We now introduce our method to interpret various fully convolutional networks designed for pixellevel tasks.
|
| 43 |
+
|
| 44 |
+
Global nearest-neighbors: Our starting point is the observation that classification networks can be interpreted as linear classifiers defined on nonlinear features extracted from the penultimate layer (e.g., “FC7” features) of the network. We formalize this perspective with the following notation:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\operatorname { L a b e l } ( x ) = k ^ { * } \quad { \mathrm { w h e r e } } \quad k ^ { * } = { \underset { k \in \{ 1 \ldots K \} } { \operatorname { a r g m a x } } } \ w _ { k } \cdot \phi ( x ) , \qquad [ \operatorname { K - w a y } \ { \mathrm { c l a s s i f i c a t i o n } } ]
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $\boldsymbol { \phi } ( \boldsymbol { x } ) \in \mathbb { R } ^ { N }$ corresponds to the penultimate FC7 features computed from input image $x$ . Typically, the parameters of the linear classifier $\{ w _ { y } \}$ and those of the feature encoder $\phi ( \cdot )$ are trained on large-scale supervised datasets:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { D } = \{ ( x _ { n } , y _ { n } ) \} . \quad [ \mathrm { T r a i n i n g ~ d a t a b a s e } ]
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Devlin et al. (2015) make the observation that penultimate features $\phi ( x )$ can be interpreted as an embedding in $\mathbb { R } ^ { N }$ . By extracting such embeddings for training images $x _ { n }$ , Devlin et al. (2015) build
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: Overview of pipeline: Given an input label or image (top-left of each box), our approach extracts an embedding for each pixel. We visualize two pixels with a yellow and white dot. The embedding captures both local and global context, which are crudely visualized with the surrounding rectangular box. We then find the closest matching patches in the training set (with a nearest neighbor search), and then report back the corresponding pixel labels to generate the final output (bottom-left of each box). We visualize an example for label-to-image synthesis on the left, and image-to-label prediction on the right.
|
| 60 |
+
|
| 61 |
+
a nonparametric nearest-neighbor (NN) predictor for complex tasks such as image captioning. We write this as follows:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\operatorname { L a b e l } ( x ) = y _ { n ^ { * } } \quad { \mathrm { w h e r e } } \quad n ^ { * } = \operatorname { a r g m i n } _ { n } \operatorname { D i s t } \Bigl ( \phi ( x ) , \phi ( x _ { n } ) \Bigr ) . \qquad [ \operatorname { G l o b a l } \operatorname { N I }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Importantly, the above NN classifier performs quite well even when feature encoders $\phi ( \cdot )$ are trained for classification rather than as an explicit embedding. In some sense, deep nets seem to implicitly learn embeddings upon which simple linear classifiers (or regressors) operate. We argue that such a NN perspective is useful in interpreting the predicted classification since the corresponding training example can be seen as a visual “explanation” of the prediction - e.g., the predicted label for $x$ is “dog” because $x$ looks similar to training image $x _ { n * }$ .
|
| 68 |
+
|
| 69 |
+
Pixel nearest-neighbors: We now extend the above observation to pixel-prediction networks that return back a prediction for each pixel $i$ in an image:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\operatorname { L a b e l } _ { i } ( x ) = k ^ { * } \quad { \mathrm { w h e r e } } \quad k ^ { * } = \operatorname { a r g m a x } _ { k \in \{ 1 . . . K \} } w _ { k } \cdot \phi _ { i } ( x ) . \qquad [ \operatorname { K - w a y } \operatorname { p i x e l } \operatorname { c l a s s i f i c a t i o n } ]
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
We write $\mathrm { L a b e l } _ { i } ( \cdot )$ for the label of the $i ^ { t h }$ pixel and $\phi _ { i } ( \cdot )$ for its corresponding feature vector. Because we will also examine pixel-level prediction networks trained to output a continuous value, we write out the following formulation for pixel-level regression:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathrm { P r e d i c t } _ { i } ( x ) = W \phi _ { i } ( x ) \quad \mathrm { w h e r e } \quad W \in \mathbb { R } ^ { M \times N } . \qquad [ \mathrm { P i x e l ~ r e g r e s s i o n } ]
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
For concreteness, consider a Pix2Pix (Isola et al., 2016) network trained to regress RGB values at each pixel location. These predictions are obtained by convolving features from the penultimate layer with filters of size $4 \times 4 \times 1 2 8$ . In this case, the three filters that generate R,G, and B values can be written as a matrix $W$ of size $M \times N$ , where $M = 3$ and $N = 4 * 4 * 1 2 8 = 2 0 4 8$ . Analogously, $\phi _ { i } ( x )$ corresponds to $N$ dimensional features extracted by reshaping local $4 \times 4$ convolutional neighborhoods of features from the penultimate feature map (of size $H \times W \times 1 2 8$ ). We now can perform nearest-neighbor regression to output pixel values:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathsf { r e d i c t } _ { i } ( x ) = y _ { n ^ { * } , m ^ { * } } \quad \mathrm { w h e r e } \quad ( n ^ { * } , m ^ { * } ) = \underset { n , m } { \mathrm { a r g m i n } } \mathrm { D i s t } \Big ( \phi _ { i } ( x ) , \phi _ { m } ( x _ { n } ) \Big ) , \qquad [ \mathrm { C o m p ~ N N ~ P i x e l s ~ o f ~ \phi _ { i } ( x ) ~ , }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $y _ { n ^ { * } , m ^ { * } }$ refers to the $m ^ { t h }$ pixel from the $n ^ { t h }$ training image. Importantly, pixel-level nearest neighbors reveals spatial correspondences for each output pixel. We demonstrate that these can be used to provide an intuitive explanation of pixel outputs, including an explanation of errors that otherwise seem quite mysterious (see Fig.1 and Fig. 2).
|
| 88 |
+
|
| 89 |
+
Distance function: We explored different distance functions such as Euclidean and cosine distance. Similar to past work (Devlin et al., 2015), we found that cosine distance consistently performed slightly better, so we use that in all of our experiments.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: We visualize a non-parametric approach to computing activations from internal layers. By matching to a training database of $\mathop { d e c o d e r _ { 4 } }$ features from Pix2Pix, we can compute activations for the next layer (decoder3) with nearest-neighbors. Each image represents a feature map of 3 continuous channels visualized in the R,G, and B planes. The collective set of 4 images displays 12 out of the 256 channels in decoder3. Global nearest-neighbors (i.e., matching to the training image with the most similar $\mathop { d e c o d e r _ { 4 } }$ layer and returning its associated decoder3 layer) produces poor matches, but compositional-pasting matches together from different exemplars produce activations that are nearly identical to those computed by the underlying CNN.
|
| 93 |
+
|
| 94 |
+
Convolutional embeddings: We now extend our compositional nearest-neighbor formulation to internal convolutional layers. Recall that activations $a$ at a spatial position $i$ and layer $j$ can be computed using thresholded linear functions of features (activations) from the previous layer:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
a _ { i j } ( x ) = \operatorname* { m a x } { \Bigl ( } 0 , W \phi _ { i j } ( x ) { \Bigr ) } , \qquad \mathrm { w h e r e } \quad a _ { i j } \in \mathbb { R } ^ { M } , \phi _ { i j } \in \mathbb { R } ^ { N } , W \in \mathbb { R } ^ { M \times N }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where we write $a _ { i j }$ for the vector of activations corresponding to the $i ^ { t h }$ pixel position from layer $j$ , possibly computed with bilinear interpolation (Long et al., 2015). We write $\phi _ { i j }$ for the local convolutional neighborhood of features (activations) from the previous layer that are linearly combined with bank of linear filters $W$ to produce $a _ { i j }$ . For concreteness, let the previous layer be decoder4 from Pix2Pix, and the current layer be decoder3. We can then write, $a _ { i j } \in R ^ { M }$ where $M = 2 5 6$ and $\phi _ { i j } \in R ^ { N }$ where $N = 4 * 4 * 5 1 2 = 8 1 9 2$ . We similarly posit that one can produce approximate activations by nearest neighbors. Specifically, let us run Pix2Pix on the set of training images, and construct a dataset of training patches with features $\phi _ { i j } ( x _ { n } )$ as data and corresponding activation vectors $a _ { i j } ( x _ { n } )$ as labels. We can then predict activation maps for a query image $x$ with NN:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
a _ { i j } ( x ) = a _ { m ^ { * } , j } ( x _ { n ^ { * } } ) \quad { \mathrm { w h e r e } } \quad ( m ^ { * } , n ^ { * } ) = \underset { m , n } { \mathrm { a r g m i n } } \ : \mathrm { D i s t } \Bigl ( \phi _ { i j } ( x ) , \phi _ { m j } ( x _ { n } ) \Bigr ) .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Notably, this is done without requiring explicit access to the filters $W$ . Rather such responses are implicitly encoded in the training dataset of patches and activation labels. We show that such an approach actually produces reasonable activations (Fig. 3).
|
| 107 |
+
|
| 108 |
+
Patch nearest-neighbors: The previous paragraph demonstrated that composing image patches using embeddings from interior layers could “explain” the behavior of the subsequent layer. We now ask a more ambitious question - could such a procedure “explain” the behavior of all subsequent layers? That is, could it produce output predictions that mimic the behavior of the entire network? To do so, we regress the final-layer pixel value from each stored patch:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
{ \mathrm { P r e d i c t } } _ { i j } ( x ) = y _ { n ^ { * } , m ^ { * } } \quad { \mathrm { w h e r e } } \quad ( n ^ { * } , m ^ { * } ) = { \underset { n , m } { \mathrm { a r g m i n } } } { \mathrm { D i s t } } \Bigl ( \phi _ { i j } ( x ) , \phi _ { m j } ( x _ { n } ) \Bigr ) .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
[Comp NN Patches]
|
| 115 |
+
|
| 116 |
+
As written, the above procedure is inefficient because features are interpolated (to pixel resolution) before they are matched to the patch database. Instead, it is natural to match features at their native resolution, and then interpolate the matches. This results in significant speed ups. For example, the bottleneck layer has an activation map of size $1 \times 1 \times 5 1 2$ . Matching to bottleneck features in the re y refers to pixels of set S (m⇤) from the nth training image.training set is quite fast because it acts as a compact global descriptor for matching entire images. j The downside is that the matches are not compositional. By matching to convolutional embeddings rse-to-fine nearest-neighbor search: An important special case is the bottleneck feature, whichextracted from later layers, one can compute progressively more compositional matches, that are omputed from an activation map of size 1 ⇥ 1 ⇥ 512. In this case, we posit that the corresponding512initially global, then patch-based, and finally pixel-based (see Fig. 4). In our experiments, we found ure ij (x) 2 R is a good global descriptor of image x. In our experiments, we found thatthat such patch embeddings could be used to prune the NN pixel search, significantly speeding up run-time performance (e.g., we first prune the training database to a shortlist of images with similar bottleneck features, and then search through these images for similar patches, and then search through those patches for similar pixels).
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Comp-NN in different embedding space: [Deva: Add the input label image on theFigure 4: Adding composition by matching to later layers: We apply compositional nearestneighbor matching to features extracted from different layers, starting with the bottleneck layer 6 2 and progressing to the penultimate deconv2 layer. We match local neighborhoods of convolutional embeddings, which naturally allows for more composition as we use later laters.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
ixels to apply a linear projection. For correctness, considering feature positions i in decoder4Figure 5: Original labels v.s. self-supervised labels: Given the label input on the left, we show reh a shape of 32 ⇤ 32 ⇤ 256, we can rewrite i as (x, y) where x = i/32, y = i%32. Thus, eachsults of Pix2Pix in the Convolutional Neural Networks column, and non-parametric matching to the ure is corresponding to a 8 ⇤ 8 image patch on final output with a shape of 256 ⇤ 256 ⇤ 3. Hence,training set using the original labels and the predicted “self-supervised” labels of the Pix2Pix netj ⇤ ⇤ ⇤ ⇤work. Generating images with the predicted labels looks smoother, though the qualitative behavior ...3]. Thus, one can generate output results by constructing a dataset of training patches withof the network is still explained by the original training labels. We quantify this in our experimental ij n n,Sj (i) results, and include additional qualitative visualizations of the original and self-supervised labels in Figs. 13 and 14.
|
| 123 |
+
|
| 124 |
+
Bias modification: Finally, our results suggest that the matching database from Eq.(2) serves as mory by changing the dataset of training images x , labels y , or both. We experimentan explicit “associative memory” of a network (Carpenter, 1989). We can explicitly modify the various modifications in our experimental results. Onememory by changing the dataset of training images $\ { \bar { \{ \{ x } } _ { n } \}$ cation th, labels $\left\{ y _ { n } \right\}$ sistently produced, or both. We experiment other visual results was to refine the training labels to those predicted by a network:with various modifications in our experimental results. One modification that consistently produced smoother visual results was to refine the training labels to those predicted by a network:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\{ \left( x _ { n } , y _ { n } \right) \} \Rightarrow \{ \left( x _ { n } , C N N ( x _ { n } ) \right) \} .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Such as procedure for “self-supervised” learning is sometimes used when training labels are known to be noisy. From an associative network perspective, we posit that such labels capture a more 7faithful representation of a network’s internal memory. Unless otherwise specified, all results make use of the above matching database. We visualize the impact of self-supervised labels in Fig. 5.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6: Reconstruction: We can use our nonparametric matching framework to generate reconstructions by replacing the exemplar target label $y _ { n }$ with the exemplar input image $x _ { n }$ . This can be done for both image generation and discrete label prediction. We find that, perhaps surprisingly, pixel embeddings contain enough local information to reconstruct the input pixel. We show additional results in Fig. 10.
|
| 134 |
+
|
| 135 |
+
Reconstruction: We found that replacing the label $y _ { n }$ with the input image $x _ { n }$ is a helpful diagnostic for visualization. This illustrates the ability of the learned embedding and compositional matching framework to reconstruct the input query. The reconstructed input for a global NN match is simply the best-matching exemplar input image (see Fig. 6). We find that, perhaps surprisingly, pixel embeddings contain enough local information to reconstruct the input pixel. We show additional results in our experimental results.
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\left\{ \left( x _ { n } , y _ { n } \right) \right\} \Rightarrow \left\{ \left( x _ { n } , x _ { n } \right) \right\} \quad { \mathrm { [ R e c o n s t r u c t i o n ] } }
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
# 3.1 SUFFICIENT STATISTICS FOR PIXEL-LEVEL TASKS
|
| 142 |
+
|
| 143 |
+
We now discuss information-theoretic properties of the introduced nearest-neighbor embedding $\phi _ { i } ( \cdot )$ presented in Sec. 3. Specifically, we show that this embedding produces sufficient statistics (Tishby & Zaslavsky, 2015; Shwartz-Ziv & Tishby, 2017; Achille & Soatto, 2017) for various pixel level tasks.
|
| 144 |
+
|
| 145 |
+
Global embeddings: We begin with the simpler case of predicting a global class label $y$ from an image $x$ . If we assume that the input image $x$ , global feature embedding $\phi ( x )$ , and output label $y$ form a Markov chain $x \to \phi ( x ) \to y$ , we can write the following:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
p ( y ~ | ~ \phi ( x ) , ~ x ) = p ( y ~ | ~ \phi ( x ) ) . \qquad [ \mathrm { S u f f i c i e n c y } ]
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
As Achille & Soatto (2017) show, standard loss functions in deep learning (such as cross-entropy) search for an embedding that minimizes the entropy of the label $y$ given the representation $\phi ( x )$ . This observation explicitly shows that the embedding $\phi ( x )$ is trained to serve as a sufficient representation of the data $x$ that is rich enough in information to predict the label $y$ . In particular, if the learned embedding satisfies the above Markov assumption, the prediction $y$ will not improve even when given access to the raw data $x$ .
|
| 152 |
+
|
| 153 |
+
Pixel-wise embeddings: Spatial networks predict a set of pixel-wise labels $\{ y _ { i } \}$ given an input image. If we assume that the pixel-wise labels are conditionally independent given $\{ \phi _ { i } ( x ) \}$ and $x$ , then we can write the joint posterior distribution over labels with the following product:
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\begin{array} { l l } { { p ( \{ y _ { i } \} \mid \phi ( x ) , x ) = \displaystyle { \prod _ { i } p ( y _ { i } \mid \phi ( x ) , x ) } } } & { { \quad \scriptstyle { [ \mathrm { C o n d i t i o n a l ~ S p a t i a l ~ I n d e p e n d e n c e } ] } } } \\ { { \displaystyle { \phantom { \sum _ { i } p ( y _ { i } \mid \phi ( x ) , x ) } } } } & { { \quad \scriptstyle { [ \mathrm { S u f f i c i e n c y } ] } } } \end{array}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
where $\phi _ { i } ( x )$ are the sufficient statistics needed to predict label $y _ { i }$ , and $\phi ( x ) ~ = ~ \{ \phi _ { i } ( x ) \}$ is the aggregate set of these sufficient statistics. One can similarly show that pixel-wise cross-entropy losses jointly minimize the entropy of the labels $y _ { i }$ given $\phi _ { i } ( x )$ . This suggests that pixel-wise features $\phi _ { i } ( x )$ do serve as a remarkably rich characterization of the image. This characterization includes both global properties (e.g., the color of a building facade being synthesized) as well as local properties (e.g., the presence of a particular window ledge being synthesized). Importantly, this requires the conditional independence assumption from Eq. (11) to be conditioned on the entire image $x$ rather than just the local pixel value $x _ { i }$ (from which it would be hard to extract global properties).
|
| 160 |
+
|
| 161 |
+
An interesting observation from the factorization shown in Eq. (12) is that we can synthesize an image by predicting pixel values independently. Thus, this theoretical observation suggests that a simple nearest-neighbor regression for every output pixel can synthesize plausible images.
|
| 162 |
+
|
| 163 |
+
Multi-layered representations: The above pixel-wise formulation also suggests that internal feature layers serve as sufficient representations to predict activations for subsequent layers. Interestingly, skip connections that directly connect lower layers to higher layers break the Markov independence assumption. In other words, skip connections suggest that higher layer features often do not serve as sufficient representations, in that subsequent predictions improve when given access to earlier layers. However, Eq.(12) technically still holds so long as we write $\phi _ { i } ( x )$ for the concatenated representation including lower-level features. For example, in Pix2Pix, we write $\phi _ { i } ( x ) \in \mathbb { R } ^ { N }$ where $N = 4 * 4 * ( 6 4 + 6 4 ) = 2 0 4 8$ , where the second set of 64 channel features are copied from the first encoder layer. In the next Section, we show qualitative and quantitative experiments supporting this analysis.
|
| 164 |
+
|
| 165 |
+
Prior work on embeddings: Now that our framework has been described both algorithmically and theoretically, we compare it to a large body of related work. The idea that intermediate CNN layers learn embeddings is not new. This dates back at least to Caruana et al. (1999), and was popularized in recent history with (Sharif Razavian et al., 2014; Devlin et al., 2015). Indeed, much contemporary work makes use of “off-the-shelf” CNN layers as features, where earlier layers tend to encode more generic feature representations (Zeiler & Fergus, 2013). However, such representations are typically global and refer to the entire image. Alternatively, one can extract local pixel-based feature representations, but these are typically defined by $1 x 1$ slices of a convolutional feature map (Hariharan et al., 2015; Long et al., 2014). Our theoretical analysis, while quite straightforward, shows that the optimal local representation (in terms of sufficiency) is given by a convolutional neighborhood of overlapping activations. Finally, we show that compositional matching with such local embeddings significantly outperforms global matching (see Fig. 3), and rivals the accuracy of feedforward CNN predictions (Table 1).
|
| 166 |
+
|
| 167 |
+
# 4 EXPERIMENTS
|
| 168 |
+
|
| 169 |
+
We now present experimental results for discriminative networks trained for semantic segmentation, as well as generative networks trained for image synthesis. The goal of the experiments is to show that images generated with a simple NN regression are a good way to interpret the internal operations of a convolutional neural network.
|
| 170 |
+
|
| 171 |
+
Networks: We use SegNet (Badrinarayanan et al., 2017), a recent state-of-the-art network for image segmentation, and Pix2Pix (Isola et al., 2016), a state-of-the-art network for conditional image synthesis and translation. We evaluate our findings for multiple datasets and tasks on which the original networks were trained. These include tasks such as synthesizing facades from architectural labels and vice versa, predicting segmentation class labels from urban RGB images, and synthesizing Google maps from aerial or satellite views.
|
| 172 |
+
|
| 173 |
+
Semantic segmentation: We use the CityScape (Cordts et al., 2016) and CamVid (Brostow et al., 2008; 2009) datasets for the task of semantic segmentation. Both datasets are annotated with semantic class labels for outdoor images collected from a car driving on the road. We use SegNet (Badrinarayanan et al., 2017) for CamVid sequences, and Pix2Pix (Isola et al., 2016) for the CityScape dataset. Figure 7 shows qualitatively results for these datasets. We can observe in Figure 7 that the compositional NN produces a nearly-identical result (CompNN column) to the one produced by the network (Pix2Pix and SegNet columns). This suggests that our method enables a good interpretation of discriminative deep networks on pixel-level classification.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 7: Semantic segmentation: The results of semantic segmentation on cityscape and CamVid dataset. This result suggests the following observations. First, the difference between images generated by generative networks (Pix2Pix and SegNet columns) and NN embedding (CompNN column) is surprisingly small. Thus, our method can perfectly interpret discriminative deep networks on pixel-level classification. Second, we can notice some noise edges with a high gradient (see columns 5-8). This phenomenon can also be used to understand the difficulty of image segmentation task: borders with high gradients are usually hard to classify due to the ambiguous patches in training set.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 8: Image synthesis: The results suggest that Comp NN (our approach) can also explain the results from $\mathrm { P i x 2 P i x }$ . We conclude this because our approach reproduces color and the structure of the Pix2Pix output, including a few artifacts (e.g., the image cuts in the 6th and 7th columns).
|
| 180 |
+
|
| 181 |
+
Architectural labels-to-facades: We followed Isola et al. (2016) for this setting and used the annotations from (Tylecek & ˇ Sˇ ara, 2013). There are 400 training images in this dataset, and 100 images ´ in the validation set. We use the same dataset to generate architectural labels from images of facades. Pix2Pix (Isola et al., 2016) models are trained using 400 images from the training set for both labels-to-facades and vice versa. Figure 8 shows qualitative examples of synthesizing real-world images using pixel-wise nearest neighbor embedding in its first and second rows. We observe that the NN-embedding perfectly explains the generation of deformed edges (see CompNN column), and how the generative architecture is eventually memorizing patches from the training set.
|
| 182 |
+
|
| 183 |
+
Satellite-to-maps: This dataset contains 1096 training images and 1000 testing images scraped from Google Maps. We use the same settings used by Isola et al. (2016) for this task. Figure 8 qualitatively shows in its third row how Google maps are synthesized from satellite images. We can observe that our synthesis (CompNN column) is nearly identical to the image generated by the network (Pix2Pix columns).
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 9: Bias modification: Given the same label input, we show different results obtained by matching to different databases (using an embedding learned by Pix2Pix). By modifying the database to include specific buildings from specific locations, one can introduce and remove implicit biases in the original network (e.g.,one can generate “European” facades versus “American” facades).
|
| 187 |
+
|
| 188 |
+
Bias modification: Figure 9 shows that the output of nonparametric matching (3rd - 6th columns from left to right) can be controlled through explicit modification of the matching database. In simple words, this experiment shows that we can control properties of the synthesized image by simply specifying the exemplars in the database. We can observe in Figure 9 that the synthesized images preserve the structure (e.g., windows, doors, and roof), since it is the conditional input, but the textural components (e.g., color) change given different databases.
|
| 189 |
+
|
| 190 |
+
Reconstruction: This experiment shows that the learned embeddings of a CNN also enables the reconstruction of the input images in a compositional fashion (as discussed in Sec. 3). The results of this experiment are shown in Fig. 10. The Figure has the following organization. In the middle columns (enclosed in a box), the Figure shows the input and output images. The first two columns (from left-to-right) show the reconstructions of the input images using a global nearest-neighbors and the proposed compositional nearest-neighbors approach. The last two columns show the reconstruction of the output images, also using a global nearest-neighbors and the proposed compositional nearest-neighbors approach. We can observe that the reconstructions of the input images using the global nearest-neighbors approach overall resembles the structure of the scene. However, the reconstructions of the input images using the proposed compositional nearest-neighbors reproduce the input scene with a remarkable accuracy. These results suggest that the learned embedding is rich in global and local information to either reconstruct both the input and output images. We can conclude then that CNNs understand an input image by finding the patches from the training images that enable the composition of an image reproducing the input. To the best of our knowledge, this is the first approach that reconstructs an input image using training instances using a learned pixel-embedding.
|
| 191 |
+
|
| 192 |
+
Correspondence map: Figure 11 shows a correspondence map that explicitly illustrates how an output image is synthesized by cutting-and-pasting patches from training images. We can observe that patches are selected from many different styles of facades, but in such a manner that ensures that the composed output is globally consistent while maintaining the appropriate local structures (such as windows, doors, awnings, etc.). This implies the learned patch embedding captures both global semantics and local structure.
|
| 193 |
+
|
| 194 |
+
Quantitative evaluation: We present the quantitative analysis of our pixel-wise nearest neighbor approach with an end-to-end pipeline in Table 1. We report classification accuracy of ground truth labels and mean intersection-over-union (IoU) compared to the predicted labels for the task of semantic segmentation. We can observe in Table 1 that compositional matching approaches the accuracy of the baseline CNN, and dramatically outperforms global matching (sometimes by a factor of 2X). Finally, self-supervised labels (SS) overall perform similarly to the original labels (O), but almost consistently help for compositional matching and consistently hurt for global matching. We posit that this is due to the fact that self-supervised labels tend to be overly-smoothed, and so act as a form of spatial regularization that helps compositional matching.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 10: Reconstruction: Given the correspondences of NN features from penultimate the layer, we reconstruct the test input images (third column from left-to-right) by using the compositional nearest-neighbor approach: copying and pasting corresponding image patches from the input images of the training set. The reconstructions using a compositional nearest-neighbor approach is shown in the second column, while the reconstructions using a global nearest-neighbor approach is shown in the first column. The learned embedding thus enables not only the reconstruction of the input image, but also of the output image (see the last two columns). These results suggest that the embedding possess not only the information relevant to a specific task, but also semantic information from the original image. We can conclude then that CNNs understand an input image by finding the patches from the training images that enable the composition of an image reproducing the input.
|
| 198 |
+
|
| 199 |
+
Implementation Details: We used U-net as the generator for Pix2Pix, and used publicly available Tensorflow code for $\operatorname { P i x } 2 \mathrm { P i x } ^ { 2 }$ and SegNet3. For a slightly faster computation, we used the Eigen Library to implement the cosine distance. For Cityscape dataset, we shortlist 100 global neighborhoods using global bottleneck features for compositional NN searching. This leads to a 30 times speedup. For CamVid dataset, we shortlist 10 global neighborhoods. We can observe in previous results that the quality of generated images is hardly affected. We used 40-threads for these experiments. The average compute time per image is 22 minutes and 13 minutes for Cityscape and CamVid dataset respectively.
|
| 200 |
+
|
| 201 |
+
# 5 DISCUSSION
|
| 202 |
+
|
| 203 |
+
In this paper, we have presented a simple approach based on pixel-wise nearest neighbors to understand and interpret the functioning of convolutional neural networks for spatial prediction tasks. Our analysis suggests that CNNs behave as compositional nearest neighbor operators over a training set of patch-label pairs that act as an associative memory. But beyond simply memorizing, CNNs can generalize to novel data by composing together local patches from different training instances. Also, we argued that networks for pixel-level tasks learn sufficient statistics that enable the gener
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 11: Correspondence map: Given the input label mask on the top left, we show the groundtruth image and the output of Pix2Pix below. Why does Pix2Pix synthesize the peculiar red awning from the input mask? To provide an explanation, we use CompNN to synthesize an image by explicitly cutting-and-pasting (composing) patches from training images. We color code pixels in the training images to denote correspondences. For example, CompNN copies doors from training image A (blue) and the red awning from training image C (yellow).
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Approach</td><td colspan="3">Facades CityScape CamVid (Mean Pixel Accuracy)</td><td colspan="3">Facades CityScape (Mean IoU)</td></tr><tr><td>Baseline CNN</td><td>0.545</td><td>0.735</td><td>0.790</td><td>0.157</td><td>0.217</td><td>0.444</td></tr><tr><td>Comp NN (SS)</td><td>0.505</td><td>0.738</td><td>0.767</td><td>0.137</td><td>0.210</td><td>0.378</td></tr><tr><td>Comp NN (O)</td><td>0.493</td><td>0.722</td><td>0.754</td><td>0.134</td><td>0.217</td><td>0.372</td></tr><tr><td>Global Bottleneck NN (SS)</td><td>0.324</td><td>0.579</td><td>0.564</td><td>0.057</td><td>0.109</td><td>0.246</td></tr><tr><td>Global Bottleneck NN (O)</td><td>0.381</td><td>0.585</td><td>0.570</td><td>0.065</td><td>0.133</td><td>0.226</td></tr><tr><td>Global Decode2 NN (SS)</td><td>0.387</td><td>0.590</td><td>0.659</td><td>0.087</td><td>0.110</td><td>0.287</td></tr><tr><td>Global Decode2 NN (O)</td><td>0.393</td><td>0.600</td><td>0.664</td><td>0.090</td><td>0.136</td><td>0.308</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 1: We compare compositional nearest neighbors (CompNN) to the baseline CNN and different global nearest neighbor approaches, obtained by matching feature maps from different layers (Global-Bottleneck and Global-Decode2). We report mean pixel accuracy and intersection-overunion, where predicted segmentation labels are compared to ground-truth labels. We specifically use the embedding learned by Isola et al. (2016) for Facades-to-Labels (Facades) and CityScape, and embedding learned by Badrinarayanan et al. (2017) for CamVid. On average, CompNN performs $5 \%$ worse than the baseline CNN, though in some cases (CityScapes) it performs equally. However, compositional matching dramatically outperforms global matching, sometimes by a factor of 2X (Facade and CityScape IoU). In terms of global matching, the last feature layer (Decode2) strictly outperforms the intermediate Bottleneck layer, but is significantly larger ( $1 2 \mathrm { { 8 ^ { 3 } } }$ versus 512 dimensions). Finally, self-supervised labels (SS) overall perform similarly to the original labels (O), but almost consistently help for compositional matching and consistently hurt for global matching. We posit that this is due to the fact that self-supervised labels tend to be overly-smoothed, and so act as a form of spatial regularization for compositional matching.
|
| 211 |
+
|
| 212 |
+
ation of pixel predictions. Our analysis and experiments not only support this argument, but also enables example-based explanations of network behavior and explicit modulation of the implicit biases learned by the network. We hope that our framework enables further analysis of convolutional networks from a non-parametric perspective.
|
| 213 |
+
|
| 214 |
+
# REFERENCES
|
| 215 |
+
|
| 216 |
+
Agnar Aamodt and Enric Plaza. Case-based reasoning: Foundational issues, methodological variations, and system approaches. AI communications, 7(1):39–59, 1994.
|
| 217 |
+
|
| 218 |
+
Alessandro Achille and Stefano Soatto. On the emergence of invariance and disentangling in deep representations. CoRR, abs/1706.01350, 2017. URL http://arxiv.org/abs/1706.01350.
|
| 219 |
+
|
| 220 |
+
Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for scene segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2017.
|
| 221 |
+
|
| 222 |
+
Aayush Bansal, Bryan Russell, and Abhinav Gupta. Marr Revisited: 2D-3D model alignment via surface normal prediction. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 223 |
+
|
| 224 |
+
Aayush Bansal, Xinlei Chen, Bryan Russell, Abhinav Gupta, and Deva Ramanan. PixelNet: Representation of the pixels, by the pixels, and for the pixels. arXiv:1702.06506, 2017a.
|
| 225 |
+
|
| 226 |
+
Aayush Bansal, Yaser Sheikh, and Deva Ramanan. PixelNN: Example-based image synthesis. CoRR, abs/1708.05349, 2017b.
|
| 227 |
+
|
| 228 |
+
David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. CoRR, abs/1704.05796, 2017.
|
| 229 |
+
|
| 230 |
+
I. Biederman. Recognition by components: a theory of human image interpretation. Pyschological review, 94: 115–147, 1987.
|
| 231 |
+
|
| 232 |
+
Gabriel J. Brostow, Jamie Shotton, Julien Fauqueur, and Roberto Cipolla. Segmentation and recognition using structure from motion point clouds. In Proc. of the European Conference on Computer Vision (ECCV), pp. 44–57, 2008.
|
| 233 |
+
|
| 234 |
+
Gabriel J Brostow, Julien Fauqueur, and Roberto Cipolla. Semantic object classes in video: A high-definition ground truth database. Pattern Recognition Letters, 30(2):88–97, 2009.
|
| 235 |
+
|
| 236 |
+
Gail A Carpenter. Neural network models for pattern recognition and associative memory. Neural networks, 2 (4):243–257, 1989.
|
| 237 |
+
|
| 238 |
+
Rich Caruana, Hooshang Kangarloo, JD Dionisio, Usha Sinha, and David Johnson. Case-based explanation of non-case-based learning methods. In Proceedings of the AMIA Symposium, pp. 212. American Medical Informatics Association, 1999.
|
| 239 |
+
|
| 240 |
+
Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L. Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. CoRR, abs/1606.00915, 2016.
|
| 241 |
+
|
| 242 |
+
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.
|
| 243 |
+
|
| 244 |
+
David Crandall, Pedro Felzenszwalb, and Daniel Huttenlocher. Spatial priors for part-based recognition using statistical models. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2005.
|
| 245 |
+
|
| 246 |
+
Emily L. Denton, Soumith Chintala, Arthur Szlam, and Robert Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. CoRR, abs/1506.05751, 2015.
|
| 247 |
+
|
| 248 |
+
Jacob Devlin, Saurabh Gupta, Ross B. Girshick, Margaret Mitchell, and C. Lawrence Zitnick. Exploring nearest neighbor approaches for image captioning. CoRR, abs/1505.04467, 2015.
|
| 249 |
+
|
| 250 |
+
David Eigen and Rob Fergus. Predicting depth, surface normals and semantic labels with a common multiscale convolutional architecture. In Proc. of the IEEE International Conference on Computer Vision (ICCV), 2015.
|
| 251 |
+
|
| 252 |
+
Pedro Felzenszwalb, David McAllester, and Deva Ramanan. A discriminatively trained, multiscale, deformable part model. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2008.
|
| 253 |
+
Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Pictorial structures for object recognition. International Journal of Computer Vision, 2005.
|
| 254 |
+
R. Fergus, P. Perona, and A. Zisserman. Object class recognition by unsupervised scale-invariant learning. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2003.
|
| 255 |
+
M. A. Fischler and R. A. Elschlager. The representation and matching of pictorial structures. IEEE Trans. Comput., 22(1), January 1973.
|
| 256 |
+
Ross Girshick, Forrest Iandola, Trevor Darrell, and Jitendra Malik. Deformable part models are convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 437–446, 2015.
|
| 257 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial networks. CoRR, abs/1406.2661, 2014.
|
| 258 |
+
Bharath Hariharan, Pablo Arbelaez, Ross Girshick, and Jitendra Malik. Hypercolumns for object segmentation ´ and fine-grained localization. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 259 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 260 |
+
Geoffrey E. Hinton. Learning distributed representations of concepts. In Proceedings of the Eighth Annual Conference of the Cognitive Science Society, pp. 1–12. Hillsdale, NJ: Erlbaum, 1986.
|
| 261 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arxiv, 2016.
|
| 262 |
+
Vivek Krishnan and Deva Ramanan. Tinkering under the hood: Interactive zero-shot learning with net surgery. CoRR, abs/1612.04901, 2016.
|
| 263 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 264 |
+
Zachary C Lipton. The mythos of model interpretability. arXiv preprint arXiv:1606.03490, 2016.
|
| 265 |
+
Ce Liu, Jenny Yuen, and Antonio Torralba. Nonparametric scene parsing via label transfer. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(12):2368–2382, 2011.
|
| 266 |
+
Jonathan Long, Ning Zhang, and Trevor Darrell. Do convnets learn correspondence? In Advances in Neural Information Processing Systems (NIPS), 2014.
|
| 267 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional models for semantic segmentation. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 268 |
+
Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015.
|
| 269 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015.
|
| 270 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. CoRR, abs/1505.04597, 2015.
|
| 271 |
+
Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features off-the-shelf: an astounding baseline for recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 806–813, 2014.
|
| 272 |
+
Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
|
| 273 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. CoRR, abs/1312.6199, 2013.
|
| 274 |
+
Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. CoRR, abs/1503.02406, 2015. URL http://arxiv.org/abs/1503.02406.
|
| 275 |
+
Radim Tylecek and Radim ˇ Sˇ ara. Spatial pattern templates for recognition of objects with regular structure. In ´ Proc. German Conference on Pattern Recognition (GCPR), Saarbrucken, Germany, 2013.
|
| 276 |
+
C. Vondrick, A. Khosla, T. Malisiewicz, and A. Torralba. HOGgles: Visualizing Object Detection Features. Proc. of the IEEE International Conference on Computer Vision (ICCV), 2013.
|
| 277 |
+
Markus Weber, Max Welling, and Pietro Perona. Towards automatic discovery of object categories. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2000.
|
| 278 |
+
Saining Xie and Zhuowen Tu. Holistically-nested edge detection. In Proc. of the IEEE International Conference on Computer Vision (ICCV), 2015.
|
| 279 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. CoRR, abs/1311.2901, 2013.
|
| 280 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Proc. of the European Conference on Computer Vision (ECCV), pp. 818–833, 2014.
|
| 281 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 282 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in \` deep scene cnns. In Proc. of the International Conference on Learning Representations (ICLR), 2014.
|
| 283 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. CoRR, abs/1703.10593, 2017.
|
| 284 |
+
|
| 285 |
+
# A APPENDIX: ADDITIONAL EXPERIMENTAL RESULTS
|
| 286 |
+
|
| 287 |
+
# A.1 GLOBAL NEAREST NEIGHBORS
|
| 288 |
+
|
| 289 |
+
We also present synthesized images using a global nearest neighbors (NN) approach. In this case, we use the global information from the bottleneck features and FC7 features. These bottleneck features can reveal which patches are learned and which training instances have more influence than others.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 12: Global NN v.s. Comp NN. We show synthesized images using our CompNN methods and four global NN approaches (global nearest neighbor on bottleneck feature embedding and Decode2 feature embedding using self-supervised labels and original labels respectively). We can observe that (1) compositional nearest neighbor outperforms other global nearest neighbor approaches, (2) using Decode2 features (the penultimate layer) sometimes can generate more similar structures (See row 1,4).
|
| 293 |
+
|
| 294 |
+
Fig. 12 shows the synthesized images using several global NN approaches and a CompNN approach. We can observe that the results of global NN approaches overall resembles global properties of the output of the Convolutional Neural Network (CNN) and of the CompNN approach. For instance, in the top two rows, the output of the global NN resembles the color of the facade and structural properties of the buildings. Also, in the bottom two rows, we can observe that the global NN overall captures the organization of the scene because many labels in the global NN overlap considerably with the output of the CNN and the ground truth.
|
| 295 |
+
|
| 296 |
+
# A.2 COMPOSITIONAL NEAREST NEIGHBORS
|
| 297 |
+
|
| 298 |
+
In this section, we show more results of our proposed Compositional Nearest Neighbors. Both self-supervised labels and original labels are evaluated in this section. We can observe in Fig.13 that the results of the Compositional Nearest Neighbors (CompNN) approach are quite similar to those of the Convolutional Neural Network. We can also observe that the CompNN produces smoother results when it uses self-supervised labels than when it uses the original ones. Moreover, the self-supervised CompNN method produces results that are more alike to those of the Convolutional Neural Network.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 13: Compositional Nearest Neighbors (CompNN) segmentation results using self-supervised and original labels. Overall, CompNN produces similar results compared with those of the Convolutional Neural Network. In particular, CompNN produces smoother results when it uses selfsupervised labels than when it uses the original labels.
|
| 302 |
+
|
| 303 |
+
# A.3 ADDITIONAL IMAGE SYNTHESIS RESULTS
|
| 304 |
+
|
| 305 |
+
Fig. 14 shows additional image syntheses using a CNN and CompNN with original and self-supervised labels. As discussed earlier, the CompNN with self-supervised labels produces a smoother image than when it uses the original labels.
|
| 306 |
+
|
| 307 |
+
# B APPENDIX: EXPERIMENTAL DETAILS
|
| 308 |
+
|
| 309 |
+
# B.1 COMPUTATIONAL COMPLEXITY
|
| 310 |
+
|
| 311 |
+
Although Compositional Nearest Neighbors provide insights into the internal operations of a CNN, its computational complexity is very high. In this section, we show some experimental details to speed up the CompNN process. Assume a dataset with $N$ images, each with $H \times W$ pixels, and $M$ filters from the last layer of a CNN. Then, the computational complexity for synthesizing one image using CompNN is
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
O ( N H ^ { 2 } W ^ { 2 } M ^ { 2 } ) .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 14: Synthesized images for pixel-wise prediction tasks with a Convolutional Neural Network, and Compositional Nearest Neighbors using self-supervised and original labels.
|
| 319 |
+
|
| 320 |
+
We now introduce several approaches to speed up searching process. (1) Although Numpy from Python calculates the distance between two features quickly, the iterations for synthesizing a pixel are slow. To alleviate this, we implemented the CompNN using $\mathrm { C } { + } { + }$ . (2) When a dataset has a large number of training instances, we used bottleneck features to narrow the training set. Especially in the segmentation problem, we can generate OK results with only 5-10 training reference. (3) Our implementation uses several threads in order to speedup the process. Specifically, each thread is in charge of synthesizing a disjoint set of pixels.
|
| 321 |
+
|
| 322 |
+
The synthesis of facades using the Facades dataset (400 training samples) takes about 2 hours with 20-30 threads on the CPU. This can be used as a reference for experiments on other datasets.
|
md/train/H1x-x309tm/H1x-x309tm.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/HKtsGW-lNbw/HKtsGW-lNbw.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Online and Offline Reinforcement Learning by Planning with a Learned Model
|
| 2 |
+
|
| 3 |
+
Julian Schrittwieser∗ DeepMind swj@google.com
|
| 4 |
+
|
| 5 |
+
Thomas Hubert∗ DeepMind tkhubert@google.com
|
| 6 |
+
|
| 7 |
+
Amol Mandhane DeepMind mandhane@google.com
|
| 8 |
+
|
| 9 |
+
Mohammadamin Barekatain DeepMind barekatain@google.com
|
| 10 |
+
|
| 11 |
+
Ioannis Antonoglou
|
| 12 |
+
DeepMind
|
| 13 |
+
University College London
|
| 14 |
+
ioannisa@google.com David Silver DeepMind
|
| 15 |
+
University College London
|
| 16 |
+
davidsilver@google.com
|
| 17 |
+
|
| 18 |
+
# Abstract
|
| 19 |
+
|
| 20 |
+
Learning efficiently from small amounts of data has long been the focus of modelbased reinforcement learning, both for the online case when interacting with the environment and the offline case when learning from a fixed dataset. However, to date no single unified algorithm has demonstrated state-of-the-art results in both settings. In this work, we describe the Reanalyse algorithm which uses modelbased policy and value improvement operators to compute new improved training targets on existing data points, allowing efficient learning for data budgets varying by several orders of magnitude. We further show that Reanalyse can also be used to learn entirely from demonstrations without any environment interactions, as in the case of offline Reinforcement Learning (offline RL). Combining Reanalyse with the MuZero algorithm, we introduce MuZero Unplugged, a single unified algorithm for any data budget, including offline RL. In contrast to previous work, our algorithm does not require any special adaptations for the off-policy or offline RL settings. MuZero Unplugged sets new state-of-the-art results in the RL Unplugged offline RL benchmark as well as in the online RL benchmark of Atari in the standard 200 million frame setting.
|
| 21 |
+
|
| 22 |
+
# 1 Introduction
|
| 23 |
+
|
| 24 |
+
Offline reinforcement learning holds the promise of learning useful policies from many existing real-world datasets in a wide range of important problems such as robotics, healthcare or education (Levine et al., 2020). Learning effectively from offline data is crucial for such tasks where interaction with the environment is costly or comes with safety concerns, but a large amount of logged and other offline data is often available.
|
| 25 |
+
|
| 26 |
+
A wide variety of effective reinforcement learning (RL) algorithms for the online case have been described, achieving impressive results in video games (Mnih et al., 2015), robotic control (Akkaya et al., 2019) and many other problems. However, applying these online RL algorithms to offline data often remains challenging due to off-policy issues, with the best results in offline RL so far obtained by specialised offline algorithms (Kumar et al., 2020; Wang et al., 2020; Agarwal et al., 2020). At the same time, model-based reinforcement learning (RL) has long focused on learning efficiently from little data, even going as far as learning completely within a model of the environment (Hafner et al., 2018) - an approach ideally suited for offline RL.
|
| 27 |
+
|
| 28 |
+
So far, these developments have been relatively independent, with no unified algorithm that could achieve state-of-the art results in both the online and offline settings.
|
| 29 |
+
|
| 30 |
+
In this paper, we describe the Reanalyse algorithm, a simple yet effective technique for policy and value improvement at any data budget, including the fully offline case. A preliminary version of Reanalyse was briefly introduced in the context of MuZero (Schrittwieser et al., 2020), but limited to data efficiency improvements in the discrete action case. Here, we delve deeper into the algorithm and push its capabilities much further – ultimately to the point where most or all of the data is reanalysed.
|
| 31 |
+
|
| 32 |
+
Starting with the possible uses of Reanalyse, we show how it can be used for data efficient learning and offline RL, leading to MuZero Unplugged. We demonstrate its effectiveness for the online case through results on Atari and for the offline case through results on the RL Unplugged benchmark for Atari and DM Control.
|
| 33 |
+
|
| 34 |
+
# 2 Related Work
|
| 35 |
+
|
| 36 |
+
Recent work by Levine et al. (2020) provides a thorough review of offline RL literature and presents an excellent introduction to the subject. Much research has focused on regularising the value or policy learning to counteract off-policy issues and learn only from high quality data. Critic-Regularized Regression (CRR) uses a critic to filter out bad actions and uses only good actions to train the policy (Wang et al., 2020). Random Ensemble Mixture (REM) regularises q-value estimation by using random convex combinations of ensemble members during training, and the ensemble mean during evaluation (Agarwal et al., 2020). Conservative Q-Learning (CQL) learns a conservative Q-function, used to lower bound the value of the current policy (Kumar et al., 2020). Pessimistic Offline Policy Optimization (POPO) also uses a pessimistic value function for policy learning (He & Hou, 2021).
|
| 37 |
+
|
| 38 |
+
Existing work has also demonstrated the promise of model-based RL for offline learning (Matsushima et al., 2020; Argenson & Dulac-Arnold, 2020), but has often been restricted to tasks with lowdimensional action or state spaces, and has not been applied to visually more complex tasks such as Atari (Bellemare et al., 2013).
|
| 39 |
+
|
| 40 |
+
Model-Based Offline Reinforcement Learning (MOReL) implements a two-step procedure, first learning a pessimistic MDP from offline data using Gaussian dynamics models, then a policy within this learned MDP (Kidambi et al., 2020). Results are presented for state-based control tasks. Modelbased Offline Policy Optimization (MOPO) penalises rewards by the uncertainty of the model dynamics to avoid distributional shift issues (Yu et al., 2020). Offline Reinforcement Learning from Images with Latent Space Models (LOMPO) extends MOPO to image based tasks (Rafailov et al., 2021). Results are reported on newly introduced datasets with image observations, which the authors aim to open-source in the near future. Deep Averagers with Costs MDP (DAC-MDP) (Shrestha et al., 2021) builds non-parametric models from the offline data, solves these tabular MDPs using value iteration, then generalizes back to the original MDP.
|
| 41 |
+
|
| 42 |
+
Most previous approaches primarily use the learned model for uncertainty estimation and to train a policy; they do not directly use the learned model for planning over action sequences. In contrast, our method focuses on using the learned model directly for policy and value improvement through planning both offline (when learning from data) and online (when interacting with an environment). It requires no regularisation of the value or policy function either in the online or offline case, works well even in very high dimensional state spaces and is equally applicable to both discrete and continuous action spaces.
|
| 43 |
+
|
| 44 |
+
Reanalyse is also qualitatively different from Dyna (Sutton, 1991) in several important regards: it uses both value and policy rather than value function alone; and it also updates the state representation. In the specific case of MuZero Reanalyse it also performs a tree search rather than a single step lookahead used in Dyna.
|
| 45 |
+
|
| 46 |
+
A combination of MuZero Unplugged with regularisation approaches such as introduced in the previous work discussed above (Kidambi et al., 2020; Yu et al., 2020; Rafailov et al., 2021) is possible; we leave such investigations for future work.
|
| 47 |
+
|
| 48 |
+
# 3 Reanalyse
|
| 49 |
+
|
| 50 |
+
Reanalyse takes advantage of model-based value and policy improvement operators to generate new value and policy training targets for a given state (Algorithm 1). In this work, we will use MuZero’s Monte Carlo Tree Search (MCTS) planning algorithm combined with its learned model of the environment dynamics as the improvement operator.2
|
| 51 |
+
|
| 52 |
+
As the learned model and its predictions are updated and improved throughout training, Reanalyse can be repeatedly applied to the same state to generate better and better training targets. The improved training targets in turn are used to improve the model and predictions, leading to a virtuous cycle of improvement.
|
| 53 |
+
|
| 54 |
+
Algorithm 1 The Reanalyse algorithm. MuZero Unplugged instantiates representation, predict, dynamics with the MuZero network architecture; plan with MCTS; loss with the MuZero loss in eqn (1); and optimise with Adam.
|
| 55 |
+
|
| 56 |
+
for $\mathrm { s t e p } \gets 0 . . . N$ do t ∼ random(1 : T ) s0t = representation(h1:t, θ) for $\mathrm { i } 0 . . . k$ do π it , $\nu _ { t } ^ { i } =$ plan(representation(h1:t+i, θ), θ) pit, vit = predict(sit, θ) ri+1t , si+1t = dynamics(sit, at+i, θ) end for $l = \mathrm { l o s s } ( h _ { t : t + k } , \{ r , p , v , u , \pi , \nu \} _ { t } ^ { 0 : k } , \theta )$ $\Delta \theta = \mathrm { o p t i m i s e } ( l , \theta )$
|
| 57 |
+
end for
|
| 58 |
+
|
| 59 |
+
To run MCTS and compute new targets for a training point, the representation function of MuZero maps the history $h _ { 1 : t }$ of observations, actions and rewards up to timestep $t$ into an agent state or embedding $s _ { t }$ . The search over possible future action sequences then takes place entirely in this embedding space, by rolling the dynamics forward and applying prediction functions at every step. These predictions output the key quantities required by planning: the policy, value function and reward. The resulting MCTS statistics at the root of the search tree - visit counts for the actions and value estimate averaged over the tree - are then used as new training targets. During reanalysis, no actions $a$ are selected – instead the agent updates its model and prediction parameters based on the data it has already experienced.
|
| 60 |
+
|
| 61 |
+
Specifically, MuZero Reanalyse jointly adjusts its parameters $\theta$ to repeatedly optimise the following loss at every time-step $t$ , applied to a model that is unrolled $0 . . . K$ steps into the future,
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
l _ { t } ( \theta ) = \sum _ { k = 0 } ^ { K } l ^ { p } ( \pi _ { t + k } , p _ { t } ^ { k } ) + \ \sum _ { k = 0 } ^ { K } l ^ { v } ( z _ { t + k } , v _ { t } ^ { k } ) + \sum _ { k = 1 } ^ { K } l ^ { r } ( u _ { t + k } , r _ { t } ^ { k } )
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $p _ { t } ^ { k } , v _ { t } ^ { k }$ , and $r _ { k } ^ { t }$ are respectively the policy, value and reward prediction produced by the $k$ -step unrolled model. The respective targets for these predictions are drawn from the corresponding time-step $t + k$ of the real trajectory: $\pi _ { t + k } , \nu _ { t + k }$ are the improved policy and value generated by the search, $z _ { t + k } = u _ { t + k + 1 } + . . . + \gamma ^ { n - 1 } u _ { t + k + n } + \gamma ^ { n } \nu _ { t + k + n }$ is an $n$ -step return, and $u _ { t + k }$ is the true reward.
|
| 68 |
+
|
| 69 |
+
The policy and value predictions are then updated towards the new training targets, in the same way they would be for targets computed based on environment interactions - through minimising losses $l ^ { p } , l ^ { v }$ and $l ^ { r }$ . In other words, Reanalyse requires no changes on the part of the learner and can be implemented purely in terms of adapting the actors to generate improved targets based on stored data instead of environment interactions.
|
| 70 |
+
|
| 71 |
+
Since the actual MCTS procedure used to Reanalyse a state is the same as the one used to choose an action when interacting with an environment, it is straightforward to perform a mix of both. We refer to this ratio between targets computed from direct interactions with the environment, and targets
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 1: Reanalyse scaling in Atari. By varying the Reanalyse fraction alone, MuZero can learn efficiently at data budgets differing by orders of magnitude. All other parameters are held constant. Left: Final scores in Ms. Pac-Man for different Reanalyse fractions. Note the logarithmic $\mathbf { X }$ -axis: Linear improvements in score require exponentially more data, matching scaling laws such as described by (Kaplan et al., 2020) for language models.
|
| 75 |
+
|
| 76 |
+
<table><tr><td>Reanalyse</td><td>Median</td><td>Mean</td><td>#Frames</td></tr><tr><td>50.0%</td><td>1331.7%</td><td>4094.4%</td><td>2000M</td></tr><tr><td>95.0%</td><td>1006.4%</td><td>2856.2%</td><td>200M</td></tr><tr><td>99.5%</td><td>126.6%</td><td>450.6%</td><td>20M</td></tr></table>
|
| 77 |
+
|
| 78 |
+
Right: Mean & median human normalised scores over 57 Atari games, by Reanalyse fraction.
|
| 79 |
+
|
| 80 |
+
computed by reanalysing existing data points as the Reanalyse fraction. A Reanalyse fraction of $0 \%$ refers to training by only interacting with the environment, no Reanalyse of stored data, whereas a fraction of $100 \%$ refers to the fully offline case with no environment interaction at all.
|
| 81 |
+
|
| 82 |
+
Since Reanalyse only uses stored data points and the learned model to compute improved targets, it can be employed flexibly for many different purposes:
|
| 83 |
+
|
| 84 |
+
• Data Efficiency. The simplest use of Reanalyse is to improve data efficiency by repeatedly computing updated targets on previously collected data throughout training. By scaling the Reanalyse fraction as described in Section 4, learning can be optimised for any data budget. For this purpose, the data to be reanalysed is sampled from the $N$ most recent environment interactions; in the limit this includes all interactions throughout training. Offline RL. When increasing the Reanalyse fraction to $100 \%$ , learning takes place entirely from stored offline data as described in Section 5, without any interaction with the environment. Offline data may be obtained from a variety of sources, such as other agents, logged data from a heuristic control system or human examples. Demonstrations. Reanalyse can be used to quickly bootstrap learning from demonstrations containing desirable behaviour that might otherwise be hard to discover - collected for instance from humans - while still interacting with the environment, learning from both sources of data at the same time. This is useful to skip past what might otherwise be hard exploration problems while still improving beyond the quality of the initial demonstrations. Exploitation of good episodes. When using Reanalyse to improve data efficiency, Reanalyse is applied to the most recently collected data. If instead data is ordered by some other metric, such as episode reward, Reanalyse can be used to quickly learn from rare events, such as rewards observed in hard-exploration tasks. This variant is most useful in deterministic environments, as it could otherwise bias the value estimates in stochastic environments.
|
| 85 |
+
|
| 86 |
+
In this paper, we will focus on the data efficiency and offline RL cases. Remaining cases require no adjustments to the algorithm and only differ in the source of data to be reanalysed. Further combinations of the cases above are also possible, such as a mix of exploitation and data efficiency Reanalyse which we leave for future work.
|
| 87 |
+
|
| 88 |
+
The Reanalyse algorithm has some similarities to experience replay (Lin, 1992). Whereas replay performs multiple gradient descent updates for the same data point and target, Reanalyse uses modelbased improvement operators to generate multiple training targets for the same data point. Reanalyse and replay have independent effects and can be combined to further improve data efficiency of learning; in fact we do so for all experiments in this paper.
|
| 89 |
+
|
| 90 |
+
# 4 Reanalyse for Data Efficiency
|
| 91 |
+
|
| 92 |
+
By adjusting the ratio between targets computed from interactions with the environment and from stored trajectories (Reanalyse fraction), Reanalyse can be used to train MuZero at any desired data
|
| 93 |
+
|
| 94 |
+
<table><tr><td>Loss</td><td>Median</td><td>Mean</td></tr><tr><td>a BC</td><td>53.3 %</td><td>48.5 %</td></tr><tr><td>DQN</td><td>86.2 %</td><td>89.5 %</td></tr><tr><td>IQN</td><td>100.8 %</td><td>96.1 %</td></tr><tr><td>BCQ</td><td>107.5 %</td><td>120.0 %</td></tr><tr><td>REM</td><td>107.9 %</td><td>113.5 %</td></tr><tr><td>CRR (ours)</td><td>155.6 %</td><td>271.2 %</td></tr><tr><td>b MuZero BC</td><td>54.0 %</td><td>46.9 %</td></tr><tr><td>MuZero Unplugged</td><td>265.3 %</td><td>595.5 %</td></tr></table>
|
| 95 |
+
|
| 96 |
+
<table><tr><td>Game</td><td>QR-DQN</td><td>REM</td><td>CQL(H)</td><td>MZ</td></tr><tr><td>asterix (1%)</td><td>359.8</td><td>363.3</td><td>592.4</td><td>27220.5</td></tr><tr><td>breakout</td><td>6.8</td><td>4.5</td><td>61.1</td><td>251.9</td></tr><tr><td>pong</td><td>-14.5</td><td>-20.8</td><td>19.3</td><td>-16.2</td></tr><tr><td>qbert</td><td>156.0</td><td>160.1</td><td>14012.0</td><td>6953.2</td></tr><tr><td>seaquest</td><td>250.1</td><td>370.5</td><td>779.4</td><td>4964.0</td></tr><tr><td>asterix (10%)</td><td>1293.9</td><td>3912.3</td><td>156.3</td><td>40554.0</td></tr><tr><td>breakout</td><td>61.8</td><td>56.9</td><td>269.3</td><td>485.8</td></tr><tr><td>pong</td><td>12.7</td><td>9.5</td><td>18.5</td><td>15.6</td></tr><tr><td>qbert</td><td>9420.5</td><td>5800.0</td><td>13855.6</td><td>16817.9</td></tr><tr><td>seaquest</td><td>353.1</td><td>3643.5</td><td>3674.1</td><td>8556.3</td></tr></table>
|
| 97 |
+
|
| 98 |
+
# Table 1: RL Unplugged Atari benchmark.
|
| 99 |
+
|
| 100 |
+
Left: Overall results. Mean and median normalised scores over the 46 Atari games of the RL Unplugged benchmark. a) Baseline algorithms. CRR results are for our own reimplementation, other results are from (Gulcehre et al., 2020). b) Results using the MuZero network architecture.
|
| 101 |
+
|
| 102 |
+
Behaviour cloning (BC) with the MuZero network replicated the baseline BC results from a), confirming correct import of the dataset and evaluation settings. Critic Regularized Regression (CRR) (Wang et al., 2020) significantly improved performance of the policy. MuZero Unplugged training with Reanalyse loss and MCTS for action selection led to overall best performance.
|
| 103 |
+
|
| 104 |
+
Right: Low-data setting. QR-DQN (Dabney et al., 2018), REM (Agarwal et al., 2020), CQL(H) (Kumar et al., 2020) and MuZero Unplugged results when trained on only $1 \%$ (top, 2 million frames) or $10 \%$ (bottom, 20 million frames) of Atari data. QR-DQN and REM results from (Agarwal et al., 2020). MuZero Unplugged performance improves consistently when trained on more data.
|
| 105 |
+
|
| 106 |
+
budget, as shown in Figure 1. The total amount of computation for each training run (number of updates on the learner and number of searches on the actors) is held constant.
|
| 107 |
+
|
| 108 |
+
As training progresses, the policy produced by MCTS with the latest network weights will increasingly differ from the policy originally used to generate the trajectories that are being reanalysed. This can bias the state distribution used for training as well as some of the training targets:
|
| 109 |
+
|
| 110 |
+
• The policy prediction $p _ { t }$ for a state $s _ { t }$ is always updated towards the MCTS statistics $\pi _ { t }$ for that same state. In this way, the policy can be learned completely independently from the trajectory; no off-policy issues can arise.
|
| 111 |
+
• The reward prediction only depends on the state and the action that was taken from this state and is not affected by off-policy issues as such. However, if the state distribution is very biased - in the extreme an action may never be observed - the reward function will be unable to learn the correct reward prediction for these cases, limiting the maximum policy improvement step.
|
| 112 |
+
The situation for the value function depends on the choice of training target; when using an n-step TD return such as in Atari $( n = 5$ ), the target depends on the trajectory and off-policy issues can potentially arise. Whether this is an issue depends on how different the data distribution is from the policy that is being learned. Empirically, we observed that the gain from bootstrapping with the actually observed environment rewards seems to outweigh any harm from being off-policy. We speculate that the bias introduced by early bootstrapping may be larger than the bias introduced by off-policy targets, as also seen in prior work (Vinyals et al., 2019).
|
| 113 |
+
|
| 114 |
+
# 5 MuZero Unplugged: Offline RL with Reanalyse
|
| 115 |
+
|
| 116 |
+
We obtain MuZero Unplugged, an offline version of MuZero, by adjusting the Reanalyse fraction to $100 \%$ - learning without any environment interactions, purely from stored trajectories. In contrast to previous work, we perform no off-policy corrections or adjustments to the value and policy learning: the exact same algorithm applies to both the online and offline case.
|
| 117 |
+
|
| 118 |
+
We used the RL Unplugged (Gulcehre et al., 2020) benchmark dataset for all offline RL experiments in this paper. To demonstrate the generality of the approach, we report results for both discrete and continuous action spaces as well as state and pixel based data, specifically:
|
| 119 |
+
|
| 120 |
+
Table 2: Median score in RL Unplugged Atari: ablations of action selection and training loss. Median normalized scores over the 46 Atari games from RL Unplugged.
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Loss Unroll</td><td colspan="3">supervised 0 1</td><td>CRR 5</td><td>Reanalyse 5</td></tr><tr><td>policy</td><td>60.6</td><td>61.4</td><td>5 54.0</td><td>155.6</td><td>203.2</td></tr><tr><td>value</td><td>92.2</td><td>105.0</td><td>159.2</td><td>153.0</td><td>239.9</td></tr><tr><td>MCTS</td><td>1</td><td>137.3</td><td>169.7</td><td>172.5</td><td>265.3</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Rows of the table correspond to different action selection methods: sampling according to the policy probabilities, selecting the action with the highest value or selecting according to MCTS visit counts. Columns correspond to different number of unroll steps of the MuZero learned model and different losses. The leftmost three columns use the action from the training data as a supervised policy target, the rightmost two columns use the CRR and the Reanalyse loss respectively. For the case of 0 unroll steps, an action-value head is used to predict action values, instead of the state-value predicted by the normal model. All columns use a 5-step TD bootstrap towards a target network as the value target. For all action selection methods, Reanalyse loss led to the best performance; for all losses, MCTS action selection also led to the best performance. Overall, the combination of MCTS action selection and Reanalyse loss - the MuZero Unplugged algorithm - led to the best results.
|
| 125 |
+
|
| 126 |
+
• DM Control Suite, 9 different tasks, number of frames varies by task (Table 3). Continuous action space with 1 to 21 dimensions, state observations.
|
| 127 |
+
|
| 128 |
+
• Atari, 46 games with 200M frames each. Discrete action space, pixel observations, stochasticity through sticky actions (Machado et al., 2017).
|
| 129 |
+
|
| 130 |
+
MuZero Unplugged was highly effective in either setting, outperforming baseline algorithms in Atari (Table 1) as well as the DM Control Suite (Table 3). We performed no tuning of hyperparameters for these experiments, instead using the same hyperparameter values as for the online RL case (Schrittwieser et al., 2020; Hubert et al., 2021).
|
| 131 |
+
|
| 132 |
+
To add another strong baseline for the Atari benchmark, we also implemented Critic Regularized Regression (CRR), a recent offline RL algorithm (Wang et al., 2020). For the critic value required by CRR we used the value head of MuZero model, trained by 5-step TD with respect to a target network, as in previous work (Schrittwieser et al., 2020) and the same as used for MuZero Unplugged. Using CRR to train the policy head led to improved results in Atari (Table 1a, CRR), matching results reported for continuous action tasks, but did not reach the same performance as MuZero Unplugged.
|
| 133 |
+
|
| 134 |
+
Performance of MuZero Unplugged was robust across the whole range of 46 Atari games in the RL Unplugged benchmark, reaching the same or better performance as the DQN policy used to generate the data in 44 games, and slightly worse performance in only 2 games (Figure 2). Improvements in performance with respect to the training data were considerable, exceeding a 20 times increase in score in several games.
|
| 135 |
+
|
| 136 |
+
To examine the performance of MuZero Unplugged in detail and ascertain the contributions of action selection methods and training losses, we also performed a set of ablations (Tables 2 and 7) based on the Atari dataset. We chose Atari because the large number of diverse levels enables robust performance estimates and its discrete action space allows us to cleanly disentangle the contributions of value and policy predictions as well as planning with MCTS. In contrast, for continuous action spaces such as in the DM Control suite, the contributions of policy and value are entangled, as the value function can only evaluate actions already sampled from the policy.
|
| 137 |
+
|
| 138 |
+
For our ablations, we considered three possible action selection methods: Sampling actions according to the policy network probabilities, selecting the action with the maximum value, or selecting actions based on the MCTS visit count distribution (rows of Table 2). We also considered different losses and network architectures: the leftmost three columns use variants of the MuZero learned model with 0 (no model at all), 1 or 5 steps of model unroll, all trained using the supervised behaviour cloning policy target and a 5-step TD value target based on a target network. The next column used CRR to train the policy. The last column used the the MCTS visit count distribution from the Reanalyse loss. These ablations allow us to separately measure the contribution of MCTS at training time (rightmost column) and evaluation time (bottom row), with the combination of MCTS at evaluation time and Reanalyse loss (bottom right cell) corresponding to MuZero Unplugged.
|
| 139 |
+
|
| 140 |
+
As expected, the policy prediction was insensitive to the choice of model depth, but benefited from an improved training target: the CRR loss significantly improved results. Best results were obtained when using the rich MCTS visit count distribution from the Reanalyse loss as a training target (top row of Table 2).
|
| 141 |
+
|
| 142 |
+
When selecting actions according to the value estimate for each action (middle row of Table 2), the depth of the learned model was surprisingly important. The difference between estimating q-values (0-step model) and state-values (1-step model) was small, with both attaining results similar to the IQN baseline (Table 1a) — expected, since all of these results use a distributional value prediction. However, learning a full 5-step model led to a big improvement even though only 1-step value predictions were used for evaluation. We speculate that learning a full 5-step model is beneficial because it regularises the network representation and acts as a useful auxiliary loss.3
|
| 143 |
+
|
| 144 |
+
<table><tr><td rowspan="2">Task</td><td rowspan="2"># dims # episodes</td><td rowspan="2"></td><td colspan="4">Baselines</td><td rowspan="2">MuZero BC Unplugged</td></tr><tr><td>BC</td><td>D4PG</td><td>BRAC</td><td>RABM</td></tr><tr><td>cartpole.swingup</td><td>1</td><td>40</td><td>386.0</td><td>856.0</td><td>869.0</td><td>798.0</td><td>143.7 343.3</td></tr><tr><td>finger.turn_hard</td><td></td><td>500</td><td>238.0</td><td>714.0</td><td>227.0</td><td>433.0</td><td>308.8 405.0</td></tr><tr><td>fish.swim</td><td>255</td><td>200</td><td>444.0</td><td>180.0</td><td>222.0</td><td>504.0</td><td>542.8 585.4</td></tr><tr><td>manipulator.insert_ball</td><td></td><td>1500</td><td>385.0</td><td>154.0</td><td>55.6</td><td>409.0</td><td>412.7 557.0</td></tr><tr><td>manipulator.insert_peg</td><td>5</td><td>1500</td><td>279.0</td><td>50.4</td><td>49.5</td><td>290.0</td><td>309.9 432.7</td></tr><tr><td>walker.stand</td><td>6</td><td>200</td><td>386.0</td><td>930.0</td><td>829.0</td><td>689.0 444.4</td><td>759.8</td></tr><tr><td>walker.walk</td><td>6</td><td>200</td><td>380.0</td><td>549.0</td><td>786.0</td><td>651.0 496.3</td><td>901.5</td></tr><tr><td>cheetah.run</td><td>6</td><td>300</td><td>408.0</td><td>308.0</td><td>539.0</td><td>304.0 592.9</td><td>798.9</td></tr><tr><td>humanoid.run</td><td>21</td><td>3000</td><td>382.0</td><td>1.7</td><td>9.6</td><td>303.0 408.5</td><td>633.4</td></tr><tr><td>mean</td><td></td><td></td><td>365.3</td><td>415.9</td><td>398.5</td><td>486.8</td><td>406.7 601.9</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 3: Results for DM Control benchmark from RL Unplugged. Mean final score on 9 DM Control tasks, as well as mean score across all tasks. First three columns indicate task, action dimensonality and dataset size, subsequent four columns reproduce baseline results from (Gulcehre et al., 2020). Final columns show performance of Behaviour Cloning (BC) with the MuZero network and results for MuZero Unplugged. As the data sets for the DM Control tasks are very small and vary a hundredfold between tasks, to keep the number of model parameters per datapoint constant and prevent memorisation, we scaled the neural network according to channel $\begin{array} { r } { s = { \sqrt { \frac { d a t a p o i n t s } { l a y e r s } } } } \end{array}$ . For an ablation of network size see Table 9.
|
| 147 |
+
|
| 148 |
+
Keeping the 5-step model but changing the loss for the policy head, we observed that CRR had no effect on the quality of the value prediction for action selection, while the richer MCTS visit count distribution from the Reanalyse loss led to another big improvement. Even though the policy head is not used when selecting actions according to the maximum 1-step value, we hypothesise that the auxiliary loss has a strong regularising effect and further improved the internal representation of the model. This matches the results of (Silver et al., 2017) that training a single combined network to estimate both policy and value led to improved value prediction accuracy.
|
| 149 |
+
|
| 150 |
+
Finally, using MCTS to select actions at evaluation time (bottom row of Table 2) improved results no matter which loss was used at training time, with best results obtained when using MCTS for both training and evaluation - the full MuZero Unplugged algorithm.
|
| 151 |
+
|
| 152 |
+
We also verified that our training setup correctly interpreted the offline data4 and reproduced the baseline performance when using the same loss: Using the actions played in the training data as a supervised policy target to train a policy head using cross-entropy loss and sampling from it for evaluation (Table 1, policy BC a and b) reproduced the behaviour cloning (BC) baseline results.
|
| 153 |
+
|
| 154 |
+
Table 4: Comparison of MuZero Unplugged and CRR. Results for CRR (Wang et al., 2020) were reported by selecting the checkpoint with the highest mean reward from each training run. Since this does not follow the offline policy selection guidelines from RL Unplugged and is therefore not directly comparable to the baseline results, we compared to it separately. The same highest mean reward evaluation scheme as used in CRR was used for MuZero Unplugged results in this table as well. All other tables report results at the end of training.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Task</td><td>CRR BC</td><td>MuZero Unplugged</td></tr><tr><td>cartpole.swingup</td><td>664.0</td><td>501.8 594.3</td></tr><tr><td>finger.turn_hard</td><td>714.0</td><td>333.8 759.0</td></tr><tr><td>fish.swim</td><td>517.0 556.8</td><td>681.6</td></tr><tr><td>manipulator.insert_ball</td><td>625.0 465.6</td><td>659.2</td></tr><tr><td>manipulator.insert_peg</td><td>387.0</td><td>325.9 556.0</td></tr><tr><td>walker.stand</td><td>797.0 473.3</td><td>887.2</td></tr><tr><td>walker.walk</td><td>901.0 637.9</td><td>949.5</td></tr><tr><td>cheetah.run</td><td>577.0</td><td>765.3 869.9</td></tr><tr><td>humanoid.run</td><td>586.0</td><td></td></tr><tr><td>mean</td><td>640.9 497.4</td><td>416.5 643.1 733.3</td></tr></table>
|
| 157 |
+
|
| 158 |
+
# 6 Offline RL and Continuous Action Spaces
|
| 159 |
+
|
| 160 |
+
An important motivation for offline RL is the application to real-world systems such as robotics, which often have continuous and high-dimensional action spaces. To investigate the applicability of MuZero Unplugged to this setting, we used the DM Control Suite dataset from the RL Unplugged dataset. DM Control is a collection of physics based benchmark tasks (Tassa et al., 2018) with a variety of robotic bodies of different action and state dimensionalities (Table 3).
|
| 161 |
+
|
| 162 |
+
In order to use planning and Reanalyse with continuous action spaces, we used the sample based search extension of MuZero introduced by (Hubert et al., 2021). This extension uses a policy head to produce a set of candidate actions to search over, where the MCTS considers only the sampled actions instead of fully enumerating the action space. Finally, the policy is updated towards the search distribution only at the sampled actions.
|
| 163 |
+
|
| 164 |
+
When applying Reanalyse for data efficiency improvements to data generated by the agent itself, no modifications are required to use sample based search and Reanalyse together. In offline RL or when reanalysing demonstrations from a source other than the agent itself, the policy that generated the actions making up the dataset is often quite different from the one learned by MuZero Unplugged, and unlikely to sample the same actions, at least at the beginning of training. Since in this case the MCTS (and by extension, Reanalyse) can only consider actions that have been sampled from the policy, it would be unlikely to learn about the actions contained in the dataset, and thus unable to sample them from the policy in the future. This effect is most pronounced in very high dimensional action spaces.
|
| 165 |
+
|
| 166 |
+
To prevent this issue, we explicitly included the action from the trajectory being reanalysed in the sample of actions searched over at the root of the MCTS tree. This serves the same purpose as the Dirichlet exploration noise used in standard MuZero - encouraging the MCTS to explore actions it would not otherwise consider. For the prior of the injected action we therefore use the same value as for the Dirichlet probability mass, $2 5 \%$ , though the algorithm is not sensitive to the exact value. This step is redundant for discrete action spaces (such as in Atari) where the policy already always produces a prior for all possible actions.
|
| 167 |
+
|
| 168 |
+
We compared the performance of MuZero Unplugged to offline RL algorithms from the literature such as D4PG (Barth-Maron et al., 2018), BRAC (Wu et al., 2019) and RABM (Siegel et al., 2020; Gulcehre et al., 2020) (Table 3), as well as the recent Critic Regularized Regression (CRR) (Wang et al., 2020) algorithm (Table 4, shown separately as CRR was evaluated by selecting the maximum performance throughout training and results are thus not comparable to the other baselines).
|
| 169 |
+
|
| 170 |
+
We first measured the performance of Behaviour Cloning (BC) when implemented using the MuZero network to ensure we used the offline dataset correctly and that it matches the evaluation environment. Overall performance indeed approximately matches the BC baseline (Table 3).
|
| 171 |
+
|
| 172 |
+
MuZero Unplugged outperformed baseline algorithms both in individual tasks and for the mean return5 averaged across all tasks. It did best in difficult high-dimensional tasks such as humanoid.run or the manipulator tasks, classified as ”hard” by (Wang et al., 2020), compared to ”easy” for the other tasks. Performance in the simplest tasks, especially cartpole, was somewhat lower — primarily due to the very small datasets6 leading to overfitting of the learned model and value function throughout training: in cartpole, performance of the best checkpoint (Figure 4) was much better than performance at the end of training (Figure 3). Additional regularisation techniques such as dropout (Hinton et al., 2012) could be employed to prevent this. We leave this for future work since we are primarily interested in performance on complex tasks that we consider most representative of real-world problems.
|
| 173 |
+
|
| 174 |
+
# 7 Limitations
|
| 175 |
+
|
| 176 |
+
MuZero Unplugged uses a deterministic model, potentially limiting its performance in stochastic or partially observed environments. The learned model is a single time-step model, which may limit the time horizon of planning. MuZero Unplugged also does not employ explicit forms of regularizations; combination with existing methods from the literature may improve its performance on very small datasets.
|
| 177 |
+
|
| 178 |
+
The MCTS improvement operator in MuZero Unplugged requires a suitable value function; in environments where value learning is very difficult this may limit the magnitude of the improvement obtained by Reanalyse.
|
| 179 |
+
|
| 180 |
+
# 8 Conclusions
|
| 181 |
+
|
| 182 |
+
In this paper we have investigated the Reanalyse algorithm and its applications to both data efficient online RL at any data budget and completely offline RL. We combined Reanalyse with MuZero to obtain MuZero Unplugged, a unified model-based RL algorithm that achieved a new state of the art in both online and offline reinforcement learning. Specifically, MuZero Unplugged outperformed prior baselines in the Atari Learning Environment both using a standard online budget of 200 million frames and other data budgets spanning multiple orders of magnitude. Furthermore, MuZero Unplugged also outperformed offline baselines in the RL Unplugged benchmark for Atari and continuous control. Unlike previous approaches, MuZero Unplugged uses the same algorithm for multiple regimes without any special treatment for off-policy or offline data.
|
| 183 |
+
|
| 184 |
+
This work represents a further step towards the vision of a single algorithm that can address a wide range of reinforcement learning applications, extending the capabilities of model-based planning algorithms to encompass new dimensions such as online and offline learning, using discrete and continuous action spaces, across pixel and state-based observation spaces, in addition to the wide array of challenging planning tasks addressed by prior work (Silver et al., 2018).
|
| 185 |
+
|
| 186 |
+
# Acknowledgements
|
| 187 |
+
|
| 188 |
+
We would like to thank Caglar Gulcehre for providing very detailed feedback and helpful suggestions to improve the paper.
|
| 189 |
+
|
| 190 |
+
All of the work in this paper was funded by DeepMind.
|
| 191 |
+
|
| 192 |
+
# References
|
| 193 |
+
|
| 194 |
+
Agarwal, R., Schuurmans, D., and Norouzi, M. An optimistic perspective on offline reinforcement learning. In International Conference on Machine Learning, pp. 104–114. PMLR, 2020.
|
| 195 |
+
Akkaya, I., Andrychowicz, M., Chociej, M., Litwin, M., McGrew, B., Petron, A., Paino, A., Plappert, M., Powell, G., Ribas, R., et al. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
|
| 196 |
+
Argenson, A. and Dulac-Arnold, G. Model-based offline planning, 2020.
|
| 197 |
+
Ba, J. L., Kiros, J. R., and Hinton, G. E. Layer normalization, 2016.
|
| 198 |
+
Barth-Maron, G., Hoffman, M. W., Budden, D., Dabney, W., Horgan, D., TB, D., Muldal, A., Heess, N., and Lillicrap, T. Distributed Distributional Deterministic Policy Gradients, 2018.
|
| 199 |
+
Bellemare, M. G., Naddaf, Y., Veness, J., and Bowling, M. The Arcade Learning Environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 200 |
+
Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., Wanderman-Milne, S., and Zhang, Q. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
|
| 201 |
+
Dabney, W., Rowland, M., Bellemare, M. G., and Munos, R. Distributional reinforcement learning with quantile regression. In AAAI, 2018.
|
| 202 |
+
Espeholt, L., Soyer, H., Munos, R., Simonyan, K., Mnih, V., Ward, T., Doron, Y., Firoiu, V., Harley, T., Dunning, I., et al. IMPALA: Scalable distributed deep-RL with importance weighted actor-learner architectures. In Proceedings of the International Conference on Machine Learning (ICML), 2018.
|
| 203 |
+
Google, 2018. Cloud TPU. https://cloud.google.com/tpu/. Accessed: 2019.
|
| 204 |
+
Gulcehre, C., Wang, Z., Novikov, A., Paine, T. L., Colmenarejo, S. G., Zolna, K., Agarwal, R., Merel, J., Mankowitz, D., Paduraru, C., Dulac-Arnold, G., Li, J., Norouzi, M., Hoffman, M., Nachum, O., Tucker, G., Heess, N., and de Freitas, N. RL Unplugged: Benchmarks for Offline Reinforcement Learning. 2020. URL https://arxiv.org/pdf/2006.13888.
|
| 205 |
+
Hafner, D., Lillicrap, T., Fischer, I., Villegas, R., Ha, D., Lee, H., and Davidson, J. Learning latent dynamics for planning from pixels. arXiv preprint arXiv:1811.04551, 2018.
|
| 206 |
+
He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. CoRR, abs/1603.05027, 2016. URL http://arxiv.org/abs/1603.05027.
|
| 207 |
+
He, Q. and Hou, X. POPO: Pessimistic Offline Policy Optimization, 2021.
|
| 208 |
+
Hennigan, T., Cai, T., Norman, T., and Babuschkin, I. Haiku: Sonnet for JAX, 2020. URL http://github.com/deepmind/dm-haiku.
|
| 209 |
+
Hessel, M., Modayil, J., Van Hasselt, H., Schaul, T., Ostrovski, G., Dabney, W., Horgan, D., Piot, B., Azar, M., and Silver, D. Rainbow: Combining improvements in deep reinforcement learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 210 |
+
Hinton, G. E., Srivastava, N., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. R. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012.
|
| 211 |
+
Hubert, T., Schrittwieser, J., Antonoglou, I., Barekatain, M., Schmitt, S., and Silver, D. Learning and Planning in Complex Action Spaces. arXiv e-prints, April 2021.
|
| 212 |
+
Jaderberg, M., Mnih, V., Czarnecki, W. M., Schaul, T., Leibo, J. Z., Silver, D., and Kavukcuoglu, K. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
|
| 213 |
+
Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., and Amodei, D. Scaling laws for neural language models, 2020.
|
| 214 |
+
Kidambi, R., Rajeswaran, A., Netrapalli, P., and Joachims, T. MOReL : Model-Based Offline Reinforcement Learning, 2020.
|
| 215 |
+
Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015.
|
| 216 |
+
Kumar, A., Zhou, A., Tucker, G., and Levine, S. Conservative Q-learning for Offline Reinforcement Learning, 2020.
|
| 217 |
+
Levine, S., Kumar, A., Tucker, G., and Fu, J. Offline reinforcement learning: Tutorial, review, and perspectives on open problems, 2020.
|
| 218 |
+
Lin, L.-J. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293–321, 1992.
|
| 219 |
+
Loshchilov, I. and Hutter, F. Fixing weight decay regularization in adam. CoRR, abs/1711.05101, 2017. URL http://arxiv.org/abs/1711.05101.
|
| 220 |
+
Machado, M., Bellemare, M., Talvitie, E., Veness, J., Hausknecht, M., and Bowling, M. Revisiting the Arcade Learning Environment: Evaluation protocols and open problems for general agents. Journal of Artificial Intelligence Research, 61, 09 2017. doi: 10.1613/jair.5699.
|
| 221 |
+
Matsushima, T., Furuta, H., Matsuo, Y., Nachum, O., and Gu, S. Deployment-efficient reinforcement learning via model-based offline optimization, 2020.
|
| 222 |
+
Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 223 |
+
Rafailov, R., Yu, T., Rajeswaran, A., and Finn, C. Offline reinforcement learning from images with latent space models. In Learning for Dynamics and Control, pp. 1154–1168. PMLR, 2021.
|
| 224 |
+
Schaul, T., Quan, J., Antonoglou, I., and Silver, D. Prioritized experience replay. In International Conference on Learning Representations, Puerto Rico, 2016.
|
| 225 |
+
Schmitt, S., Hessel, M., and Simonyan, K. Off-policy actor-critic with shared experience replay. arXiv preprint arXiv:1909.11583, 2019.
|
| 226 |
+
Schrittwieser, J., Antonoglou, I., Hubert, T., Simonyan, K., Sifre, L., Schmitt, S., Guez, A., Lockhart, E., Hassabis, D., Graepel, T., Lillicrap, T. P., and Silver, D. Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model. Nature, 588(7839):604–609, 2020.
|
| 227 |
+
Shrestha, A. K., Lee, S., Tadepalli, P., and Fern, A. Deepaveragers: Offline reinforcement learning by solving derived non-parametric $\{ { \mathrm { m d p } } \} { \mathrm { s } }$ . In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $\equiv$ eMP1j9efXtX.
|
| 228 |
+
Siegel, N. Y., Springenberg, J. T., Berkenkamp, F., Abdolmaleki, A., Neunert, M., Lampe, T., Hafner, R., and Riedmiller, M. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020.
|
| 229 |
+
Silver, D., Schrittwieser, J., Simonyan, K., Antonoglou, I., Huang, A., Guez, A., Hubert, T., Baker, L., Lai, M., Bolton, A., Chen, Y., Lillicrap, T., Hui, F., Sifre, L., van den Driessche, G., Graepel, T., and Hassabis, D. Mastering the game of Go without human knowledge. Nature, 550:354–359, October 2017.
|
| 230 |
+
Silver, D., Hubert, T., Schrittwieser, J., Antonoglou, I., Lai, M., Guez, A., Lanctot, M., Sifre, L., Kumaran, D., Graepel, T., et al. A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science, 362(6419):1140–1144, 2018.
|
| 231 |
+
Sutton, R. S. Dyna, an integrated architecture for learning, planning, and reacting. ACM Sigart Bulletin, 2(4):160–163, 1991.
|
| 232 |
+
Tassa, Y., Doron, Y., Muldal, A., Erez, T., Li, Y., de Las Casas, D., Budden, D., Abdolmaleki, A., Merel, J., Lefrancq, A., Lillicrap, T., and Riedmiller, M. Deepmind control suite, 2018.
|
| 233 |
+
Vinyals, O., Babuschkin, I., Czarnecki, W. M., Mathieu, M., Dudzik, A., Chung, J., Choi, D. H., Powell, R., Ewalds, T., Georgiev, P., et al. Grandmaster level in StarCraft II using multi-agent reinforcement learning. Nature, pp. 1–5, 2019.
|
| 234 |
+
Wang, Z., Novikov, A., Zolna, K., Merel, J. S., Springenberg, J. T., Reed, S. E., Shahriari, B., Siegel, N., Gulcehre, C., Heess, N., et al. Critic Regularized Regression. Advances in Neural Information Processing Systems, 33, 2020.
|
| 235 |
+
Wu, Y., Tucker, G., and Nachum, O. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
|
| 236 |
+
Yu, T., Thomas, G., Yu, L., Ermon, S., Zou, J., Levine, S., Finn, C., and Ma, T. MOPO: Model-based Offline Policy Optimization, 2020.
|
md/train/Hk4_qw5xe/Hk4_qw5xe.md
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS PRINCIPLED METHODS FOR TRAINING GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Martin Arjovsky Courant Institute of Mathematical Sciences martinarjovsky@gmail.com
|
| 4 |
+
|
| 5 |
+
Leon Bottou´ Facebook AI Research leonb@fb.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
The goal of this paper is not to introduce a single algorithm or method, but to make theoretical steps towards fully understanding the training dynamics of generative adversarial networks. In order to substantiate our theoretical analysis, we perform targeted experiments to verify our assumptions, illustrate our claims, and quantify the phenomena. This paper is divided into three sections. The first section introduces the problem at hand. The second section is dedicated to studying and proving rigorously the problems including instability and saturation that arize when training generative adversarial networks. The third section examines a practical and theoretically grounded direction towards solving these problems, while introducing new tools to study them.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Generative adversarial networks (GANs)(Goodfellow et al., 2014a) have achieved great success at generating realistic and sharp looking images. However, they are widely general methods, now starting to be applied to several other important problems, such as semisupervised learning, stabilizing sequence learning methods for speech and language, and 3D modelling. (Denton et al., 2015; Radford et al., 2015; Salimans et al., 2016; Lamb et al., 2016; Wu et al., 2016)
|
| 14 |
+
|
| 15 |
+
However, they still remain remarkably difficult to train, with most current papers dedicated to heuristically finding stable architectures. (Radford et al., 2015; Salimans et al., 2016)
|
| 16 |
+
|
| 17 |
+
Despite their success, there is little to no theory explaining the unstable behaviour of GAN training. Furthermore, approaches to attacking this problem still rely on heuristics that are extremely sensitive to modifications. This makes it extremely hard to experiment with new variants, or to use them in new domains, which limits their applicability drastically. This paper aims to change that, by providing a solid understanding of these issues, and creating principled research directions towards adressing them.
|
| 18 |
+
|
| 19 |
+
It is interesting to note that the architecture of the generator used by GANs doesn’t differ significantly from other approaches like variational autoencoders (Kingma & Welling, 2013). After all, at the core of it we first sample from a simple prior $z \sim p ( z )$ , and then output our final sample $g _ { \boldsymbol { \theta } } ( z )$ , sometimes adding noise in the end. Always, $g _ { \theta }$ is a neural network parameterized by $\theta$ , and the main difference is how $g _ { \theta }$ is trained.
|
| 20 |
+
|
| 21 |
+
Traditional approaches to generative modeling relied on maximizing likelihood, or equivalently minimizing the Kullback-Leibler (KL) divergence between our unknown data distribution $\mathbb { P } _ { r }$ and our generator’s distribution $\mathbb { P } _ { g }$ (that depends of course on $\theta$ ). If we assume that both distributions are continuous with densities $P _ { r }$ and $P _ { g }$ , then these methods try to minimize
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
K L ( \mathbb { P } _ { r } \| \mathbb { P } _ { g } ) = \int _ { \mathcal { X } } P _ { r } ( x ) \log { \frac { P _ { r } ( x ) } { P _ { g } ( x ) } } \mathrm { d } x
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
This cost function has the good property that it has a unique minimum at $\mathbb { P } _ { g } = \mathbb { P } _ { r }$ , and it doesn’t require knowledge of the unknown $P _ { r } ( x )$ to optimize it (only samples). However, it is interesting to see how this divergence is not symetrical between $\boldsymbol { \mathbb { P } } _ { r }$ and $\mathbb { P } _ { g }$ :
|
| 28 |
+
|
| 29 |
+
• If $P _ { r } ( x ) > P _ { g } ( x )$ , then $x$ is a point with higher probability of coming from the data than being a generated sample. This is the core of the phenomenon commonly described as ‘mode dropping’: when there are large regions with high values of $P _ { r }$ , but small or zero values in $P _ { g }$ . It is important to note that when $P _ { r } ( x ) > 0$ but $P _ { g } ( x ) \to 0$ , the integrand inside the KL grows quickly to infinity, meaning that this cost function assigns an extremely high cost to a generator’s distribution not covering parts of the data. If $P _ { r } ( x ) < P _ { g } ( x )$ , then $x$ has low probability of being a data point, but high probability of being generated by our model. This is the case when we see our generator outputting an image that doesn’t look real. In this case, when $P _ { r } ( x ) 0$ and $P _ { g } ( x ) > 0$ , we see that the value inside the KL goes to 0, meaning that this cost function will pay extremely low cost for generating fake looking samples.
|
| 30 |
+
|
| 31 |
+
Clearly, if we would minimize $K L ( \mathbb { P } _ { g } \| \mathbb { P } _ { r } )$ instead, the weighting of these errors would be reversed, meaning that this cost function would pay a high cost for generating not plausibly looking pictures. Generative adversarial networks have been shown to optimize (in its original formulation), the Jensen-shannon divergence, a symmetric middle ground to this two cost functions
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
J S D ( \mathbb { P } _ { r } \| \mathbb { P } _ { g } ) = \frac { 1 } { 2 } K L ( \mathbb { P } _ { r } \| \mathbb { P } _ { A } ) + \frac { 1 } { 2 } K L ( \mathbb { P } _ { g } \| \mathbb { P } _ { A } )
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\mathbb { P } _ { A }$ is the ‘average’ distribution, with density Pr+Pg2 . An impressive experimental analysis of the similarities, uses and differences of these divergences in practice can be seen at Theis et al. (2016). It is indeed conjectured that the reason of GANs success at producing reallistically looking images is due to the switch from the traditional maximum likelihood approaches. (Theis et al., 2016; Huszar, 2015). However, the problem is far from closed.
|
| 38 |
+
|
| 39 |
+
Generative adversarial networks are formulated in two steps. We first train a discriminator $D$ to maximize
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
L ( D , g _ { \theta } ) = \mathbb { E } _ { x \sim \mathbb { P } _ { r } } [ \log D ( x ) ] + \mathbb { E } _ { x \sim \mathbb { P } _ { g } } [ \log ( 1 - D ( x ) ) ]
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
One can show easily that the optimal discriminator has the shape
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
D ^ { * } ( x ) = \frac { P _ { r } ( x ) } { P _ { r } ( x ) + P _ { g } ( x ) }
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
and that $L ( D ^ { * } , g _ { \theta } ) = 2 J S D ( \mathbb { P } _ { r } \| \mathbb { P } _ { g } ) - 2 \log 2$ , so minimizing equation (1) as a function of $\theta$ yields minimizing the Jensen-Shannon divergence when the discriminator is optimal. In theory, one would expect therefore that we would first train the discriminator as close as we can to optimality (so the cost function on $\theta$ better approximates the $J S D$ ), and then do gradient steps on $\theta$ , alternating these two things. However, this doesn’t work. In practice, as the discriminator gets better, the updates to the generator get consistently worse. The original GAN paper argued that this issue arose from saturation, and switched to another similar cost function that doesn’t have this problem. However, even with this new cost function, updates tend to get worse and optimization gets massively unstable. Therefore, several questions arize:
|
| 52 |
+
|
| 53 |
+
• Why do updates get worse as the discriminator gets better? Both in the original and the new cost function.
|
| 54 |
+
• Why is GAN training massively unstable?
|
| 55 |
+
• Is the new cost function following a similar divergence to the JSD? If so, what are its properties?
|
| 56 |
+
• Is there a way to avoid some of these issues?
|
| 57 |
+
|
| 58 |
+
The fundamental contributions of this paper are the answer to all these questions, and perhaps more importantly, to introduce the tools to analyze them properly. We provide a new direction designed to avoid the instability issues in GANs, and examine in depth the theory behind it. Finally, we state a series of open questions and problems, that determine several new directions of research that begin with our methods.
|
| 59 |
+
|
| 60 |
+
# 2 SOURCES OF INSTABILITY
|
| 61 |
+
|
| 62 |
+
The theory tells us that the trained discriminator will have cost at most $2 \log 2 - 2 J S D ( \mathbb { P } _ { r } \Vert \mathbb { P } _ { g } )$ . However, in practice, if we just train $D$ till convergence, its error will go to 0, as observed in Figure 1, pointing to the fact that the $J S D$ between them is maxed out. The only way this can happen is if the distributions are not continuous1, or they have disjoint supports.
|
| 63 |
+
|
| 64 |
+
One possible cause for the distributions not to be continuous is if their supports lie on low dimensional manifolds. There is strong empirical and theoretical evidence to believe that $\mathbb { P } _ { r }$ is indeed extremely concentrated on a low dimensional manifold (Narayanan & Mitter, 2010). As of $\mathbb { P } _ { g }$ , we will prove soon that such is the case as well.
|
| 65 |
+
|
| 66 |
+
In the case of GANs, $\mathbb { P } _ { g }$ is defined via sampling from a simple prior $z \sim p ( z )$ , and then applying a function $g : { \mathcal { Z } } { \mathcal { X } }$ , so the support of $\mathbb { P } _ { g }$ has to be contained in $g ( \mathcal { Z } )$ . If the dimensionality of $\mathcal { Z }$ is less than the dimension of $\mathcal { X }$ (as is typically the case), then it’s imposible for $\mathbb { P } _ { g }$ to be continuous. This is because in most cases $g ( \mathcal { Z } )$ will be contained in a union of low dimensional manifolds, and therefore have measure 0 in $\mathcal { X }$ . Note that while intuitive, this is highly nontrivial, since having an $n$ - dimensional parameterization does absolutely not imply that the image will lie on an $n$ -dimensional manifold. In fact, there are many easy counterexamples, such as Peano curves, lemniscates, and many more. In order to show this for our case, we rely heavily on $g$ being a neural network, since we are able to leverage that $g$ is made by composing very well behaved functions. We now state this properly in the following Lemma:
|
| 67 |
+
|
| 68 |
+
Lemma 1. Let $g : { \mathcal { Z } } { \mathcal { X } }$ be a function composed by affine transformations and pointwise nonlinearities, which can either be rectifiers, leaky rectifiers, or smooth strictly increasing functions (such as the sigmoid, tanh, softplus, etc). Then, $g ( \mathcal { Z } )$ is contained in a countable union of manifolds of dimension at most $\operatorname { d i m } \mathcal { Z }$ . Therefore, if the dimension of $\mathcal { Z }$ is less than the one of $\mathcal { X }$ , $g ( \mathcal { Z } )$ will be $a$ set of measure $O$ in $\mathcal { X }$ .
|
| 69 |
+
|
| 70 |
+
Proof. See Appendix A.
|
| 71 |
+
|
| 72 |
+
Driven by this, this section shows that if the supports of $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ are disjoint or lie in low dimensional manifolds, there is always a perfect discriminator between them, and we explain exactly how and why this leads to an unreliable training of the generator.
|
| 73 |
+
|
| 74 |
+
# 2.1 THE PERFECT DISCRIMINATION THEOREMS
|
| 75 |
+
|
| 76 |
+
For simplicity, and to introduce the methods, we will first explain the case where $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ have disjoint supports. We say that a discriminator $D : \mathcal { X } [ 0 , 1 ]$ has accuracy 1 if it takes the value 1 on a set that contains the support of $\mathbb { P } _ { r }$ and value 0 on a set that contains the support of $\mathbb { P } _ { g }$ . Namely, $\mathbb { P } _ { r } [ D ( x ) = 1 ] = 1$ and $\mathbb { P } _ { g } [ D ( x ) = 0 ] = 1$ .
|
| 77 |
+
|
| 78 |
+
Theorem 2.1. If two distributions $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ have support contained on two disjoint compact subsets $\mathcal { M }$ and $\mathcal { P }$ respectively, then there is a smooth optimal discrimator $D ^ { * } : \mathcal { X } [ 0 , 1 ]$ that has accuracy $I$ and $\nabla _ { x } D ^ { * } ( x ) = 0$ for all $x \in \mathcal { M } \cup \mathcal { P }$ .
|
| 79 |
+
|
| 80 |
+
Proof. The discriminator is trained to maximize
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathbb { E } _ { x \sim \mathbb { P } _ { r } } [ \log D ( x ) ] + \mathbb { E } _ { x \sim \mathbb { P } _ { g } } [ \log ( 1 - D ( x ) ) ]
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Since $\mathcal { M }$ and $\mathcal { P }$ are compact and disjoint, $0 < \delta = d ( \mathcal { P } , \mathcal { M } )$ the distance between both sets. We now define
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { c } { { \hat { \mathcal { M } } = \{ x : d ( x , M ) \leq \delta / 3 \} } } \\ { { \hat { \mathcal { P } } = \{ x : d ( x , P ) \leq \delta / 3 \} } } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
By definition of $\delta$ we have that $\hat { P }$ and $\hat { M }$ are clearly disjoint compact sets. Therefore, by Urysohn’s smooth lemma there exists a smooth function $D ^ { * } : \mathcal { X } [ 0 , 1 ]$ such that $D ^ { * } | _ { \hat { \mathcal { M } } } \equiv 1$ and $D ^ { * } | _ { \hat { \mathcal P } } \equiv 0$ . Since $\log D ^ { * } ( x ) = 0$ for all $x$ in the support of $\mathbb { P } _ { r }$ and $\bar { \log ( 1 - D ^ { * } ( x ) ) } = 0$ for all $x$ in the support of $\mathbb { P } _ { g }$ , the discriminator is completely optimal and has accuracy 1. Furthermore, let $x$ be in ${ \mathcal { M } } \cup { \mathcal { P } }$ . If we assume that $x \in \mathcal { M }$ , there is an open ball $B = B ( x , \delta / 3 )$ on which $D ^ { * } | _ { B }$ is constant. This shows that $\nabla _ { x } D ^ { * } ( x ) \equiv 0$ . Taking $x \in \mathcal { P }$ and working analogously we finish the proof. □
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 1: First, we trained a DCGAN for 1, 10 and 25 epochs. Then, with the generator fixed we train a discriminator from scratch. We see the error quickly going to 0, even with very few iterations on the discriminator. This even happens after 25 epochs of the DCGAN, when the samples are remarkably good and the supports are likely to intersect, pointing to the non-continuity of the distributions. Note the logarithmic scale. For illustration purposes we also show the accuracy of the discriminator, which goes to 1 in sometimes less than 50 iterations. This is 1 even for numerical precision, and the numbers are running averages, pointing towards even faster convergence.
|
| 96 |
+
|
| 97 |
+
In the next theorem, we take away the disjoint assumption, to make it general to the case of two different manifolds. However, if the two manifolds match perfectly on a big part of the space, no discriminator could separate them. Intuitively, the chances of two low dimensional manifolds having this property is rather dim: for two curves to match in space in a specific segment, they couldn’t be perturbed in any arbitrarilly small way and still satisfy this property. To do this, we will define the notion of two manifolds perfectly aligning, and show that this property never holds with probability 1 under any arbitrarilly small perturbations.
|
| 98 |
+
|
| 99 |
+
Definition 2.1. We first need to recall the definition of transversallity. Let $\mathcal { M }$ and $\mathcal { P }$ be two boundary free regular submanifolds of $\mathcal { F }$ , which in our cases will simply be $\mathcal { F } = \mathbb { R } ^ { d }$ . Let $x \in \mathcal { M } \cap \mathcal { P }$ be an intersection point of the two manifolds. We say that $\mathcal { M }$ and $\mathcal { P }$ intersect transversally in $x$ if $T _ { x } { \mathcal { M } } + T _ { x } { \mathcal { P } } = { \overline { { T } } } _ { x } { \mathcal { F } }$ , where $T _ { x } { \mathcal { M } }$ means the tangent space of $\mathcal { M }$ around $x$ .
|
| 100 |
+
|
| 101 |
+
Definition 2.2. We say that two manifolds without boundary $\mathcal { M }$ and $\mathcal { P }$ perfectly align if there is an $x \in \mathcal { M } \cap \mathcal { P }$ such that $\mathcal { M }$ and $\mathcal { P }$ don’t intersect transversally in $x$ .
|
| 102 |
+
|
| 103 |
+
We shall note the boundary and interior of a manifold $\mathcal { M }$ by $\partial M$ and Int $M$ respectively. We say that two manifolds $\mathcal { M }$ and $\mathcal { P }$ (with or without boundary) perfectly align if any of the boundary free manifold pairs $( \operatorname { I n t } \mathcal { M } , \operatorname { I n t } \mathcal { P } _ { }$ ), (I $\mathrm { n t } \mathcal { M } , \partial \mathcal { P } )$ , $( \partial \mathcal { M } , \mathrm { I n t } \mathcal { P } )$ or $( \partial \mathcal { M } , \partial \mathcal { P } )$ perfectly align.
|
| 104 |
+
|
| 105 |
+
The interesting thing is that we can safely assume in practice that any two manifolds never perfectly align. This can be done since an arbitrarilly small random perturbation on two manifolds will lead them to intersect transversally or don’t intersect at all. This is precisely stated and proven in Lemma 2.
|
| 106 |
+
|
| 107 |
+
As stated by Lemma 3, if two manifolds don’t perfectly align, their intersection $\mathcal { L } = \mathcal { M } \cap \mathcal { P }$ will be a finite union of manifolds with dimensions strictly lower than both the dimension of $\mathcal { M }$ and the one of $\mathcal { P }$ .
|
| 108 |
+
|
| 109 |
+
Lemma 2. Let $\mathcal { M }$ and $\mathcal { P }$ be two regular submanifolds of $\mathbb { R } ^ { d }$ that don’t have full dimension. Let $\eta , \eta ^ { \prime }$ be arbitrary independent continuous random variables. We therefore define the perturbed manifolds as $\tilde { \mathcal { M } } = \tilde { \mathcal { M } } + \eta$ and $\tilde { \mathcal P } = \mathcal P + \eta ^ { \prime }$ . Then
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathbb { P } _ { \eta , \eta ^ { \prime } } ( \tilde { \mathcal { M } } d o e s n o t p e r f e c t l y a l i g n w i t h \tilde { \mathcal { P } } ) = 1
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Proof. See Appendix A.
|
| 116 |
+
|
| 117 |
+
Lemma 3. Let $\mathcal { M }$ and $\mathcal { P }$ be two regular submanifolds of $\mathbb { R } ^ { d }$ that don’t perfectly align and don’t have full dimension. Let $\mathcal { L } = \mathcal { M } \cap \mathcal { P }$ . If $\mathcal { M }$ and $\mathcal { P }$ don’t have boundary, then $\mathcal { L }$ is also a manifold, and has strictly lower dimension than both the one of $\mathcal { M }$ and the one of $\mathcal { P }$ . If they have boundary, $\mathcal { L }$ is a union of at most 4 strictly lower dimensional manifolds. In both cases, $\mathcal { L }$ has measure 0 in both $\mathcal { M }$ and $\mathcal { P }$ .
|
| 118 |
+
|
| 119 |
+
Proof. See Appendix A.
|
| 120 |
+
|
| 121 |
+
We now state our perfect discrimination result for the case of two manifolds.
|
| 122 |
+
|
| 123 |
+
Theorem 2.2. Let $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ be two distributions that have support contained in two closed manifolds $\mathcal { M }$ and $\mathcal { P }$ that don’t perfectly align and don’t have full dimension. We further assume that $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ are continuous in their respective manifolds, meaning that if there is a set $A$ with measure $O$ in $\mathcal { M }$ , then $\mathbb { P } _ { r } ( A ) = 0$ (and analogously for $\mathbb { P } _ { g , \mathbb { \Lambda } }$ . Then, there exists an optimal discriminator $D ^ { * } : \mathcal { X } [ 0 , 1 ]$ that has accuracy $^ { l }$ and for almost any $x$ in $\mathcal { M }$ or $\mathcal { P }$ , $D ^ { * }$ is smooth in a neighbourhood of $x$ and $\nabla _ { x } D ^ { * } ( x ) = 0$ .
|
| 124 |
+
|
| 125 |
+
Proof. By Lemma 3 we know that $\mathcal { L } = \mathcal { M } \cap \mathcal { P }$ is strictly lower dimensional than both $\mathcal { M }$ and $\mathcal { P }$ , and has measure 0 on both of them. By continuity, $\mathbb { P } _ { r } ( \mathcal { L } ) = 0$ and $\mathbb { P } _ { g } ( \mathcal { L } ) = 0$ . Note that this implies the support of $\mathbb { P } _ { r }$ is contained in $\mathcal { M } \backslash \mathcal { L }$ and the support of $\mathbb { P } _ { g }$ is contained in $\mathcal { P } \backslash \mathcal { L }$ .
|
| 126 |
+
|
| 127 |
+
Let $x \in \mathcal { M } \backslash \mathcal { L }$ . Therefore, $x \in \mathcal { P } ^ { c }$ (the complement of $\mathcal { P }$ ) which is an open set, so there exists a ball of radius $\epsilon _ { x }$ such that $B ( x , \epsilon _ { x } ) \cap \mathcal { P } = \varnothing$ . This way, we define
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\hat { \mathcal { M } } = \bigcup _ { x \in \mathcal { M } \setminus \mathcal { L } } B ( x , \epsilon _ { x } / 3 )
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
We define $\hat { \mathcal { P } }$ analogously. Note that by construction these are both open sets on $\mathbb { R } ^ { d }$ . Since $\mathcal { M } \backslash \mathcal { L } \subseteq$ $\hat { \mathcal { M } }$ , and $\mathcal { P } \setminus \mathcal { L } \subseteq \hat { \mathcal { P } }$ , the support of $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ is contained in $\hat { \mathcal { M } }$ and $\hat { \mathcal { P } }$ respectively. As well by construction, $\hat { \mathcal { M } } \cap \hat { \mathcal { P } } = \varnothing$ .
|
| 134 |
+
|
| 135 |
+
Let us define $D ^ { * } ( x ) = 1$ for all $x \in { \hat { \mathcal { M } } }$ , and 0 elsewhere (clearly including $\hat { \mathcal { P } }$ . Since $\log D ^ { * } ( x ) = 0$ for all $x$ in the support of $\mathbb { P } _ { r }$ and $\log ( 1 - D ^ { * } ( x ) ) = 0$ for all $x$ in the support of $\mathbb { P } _ { g }$ , the discriminator is completely optimal and has accuracy 1. Furthermore, let $x \in { \hat { \mathcal { M } } }$ . Since $\hat { \mathcal { M } }$ is an open set and $D ^ { * }$ is constant on $\hat { \mathcal { M } }$ , then $\nabla _ { x } D ^ { * } | _ { \hat { \mathcal { M } } } \equiv 0$ . Analogously, $\nabla _ { x } D ^ { * } | _ { \hat { \mathcal { P } } } \equiv 0$ . Therefore, the set of points where $D ^ { * }$ is non-smooth or has non-zero gradient inside $\mathcal { M } \cup \mathbf { \dot { \mathcal { P } } }$ is contained in $\mathcal { L }$ , which has null-measure in both manifolds, therefore concluding the theorem. □
|
| 136 |
+
|
| 137 |
+
These two theorems tell us that there are perfect discriminators which are smooth and constant almost everywhere in $\mathcal { M }$ and $\mathcal { P }$ . The fact that the discriminator is constant in both manifolds points to the fact that we won’t really be able to learn anything by backproping through it, as we shall see in the next subsection. To conclude this general statement, we state the following theorem on the divergences of $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , whose proof is trivial and left as an exercise to the reader.
|
| 138 |
+
|
| 139 |
+
Theorem 2.3. Let $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ be two distributions whose support lies in two manifolds $\mathcal { M }$ and $\mathcal { P }$ that don’t have full dimension and don’t perfectly align. We further assume that $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ are continuous in their respective manifolds. Then,
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r } { J S D ( \mathbb { P } _ { r } \| \mathbb { P } _ { g } ) = \log 2 } \\ { K L ( \mathbb { P } _ { r } \| \mathbb { P } _ { g } ) = + \infty } \\ { K L ( \mathbb { P } _ { g } \| \mathbb { P } _ { r } ) = + \infty } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Note that these divergences will be maxed out even if the two manifolds lie arbitrarilly close to each other. The samples of our generator might look impressively good, yet both KL divergences will be infinity. Therefore, Theorem 2.3 points us to the fact that attempting to use divergences out of the box to test similarities between the distributions we typically consider might be a terrible idea. Needless to say, if these divergencies are always maxed out attempting to minimize them by gradient descent isn’t really possible. We would like to have a perhaps softer measure, that incorporates a notion of distance between the points in the manifolds. We will come back to this topic later in section 3, where we explain an alternative metric and provide bounds on it that we are able to analyze and optimize.
|
| 146 |
+
|
| 147 |
+
# 2.2 THE CONSEQUENCES, AND THE PROBLEMS OF EACH COST FUNCTION
|
| 148 |
+
|
| 149 |
+
Theorems 2.1 and 2.2 showed one very important fact. If the two distributions we care about have supports that are disjoint or lie on low dimensional manifolds, the optimal discriminator will be perfect and its gradient will be zero almost everywhere.
|
| 150 |
+
|
| 151 |
+
# 2.2.1 THE ORIGINAL COST FUNCTION
|
| 152 |
+
|
| 153 |
+
We will now explore what happens when we pass gradients to the generator through a discriminator. One crucial difference with the typical analysis done so far is that we will develop the theory for an approximation to the optimal discriminator, instead of working with the (unknown) true discriminator. We will prove that as the approximaton gets better, either we see vanishing gradients or the massively unstable behaviour we see in practice, depending on which cost function we use.
|
| 154 |
+
|
| 155 |
+
In what follows, we denote by $\| D \|$ the norm
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\| D \| = \operatorname* { s u p } _ { x \in \mathcal { X } } | D ( x ) | + \| \nabla _ { x } D ( x ) \| _ { 2 }
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
The use of this norm is to make the proofs simpler, but could have been done in another Sobolev norm $\| \cdot \| _ { 1 , p }$ for $p < \infty$ covered by the universal approximation theorem in the sense that we can guarantee a neural network approximation in this norm (Hornik, 1991).
|
| 162 |
+
|
| 163 |
+
Theorem 2.4 (Vanishing gradients on the generator). Let $g _ { \theta } : \mathcal { Z } \mathcal { X }$ be a differentiable function that induces a distribution $\mathbb { P } _ { g }$ . Let $\mathbb { P } _ { r }$ be the real data distribution. Let $D$ be a differentiable discriminator. If the conditions of Theorems 2.1 or 2.2 are satisfied, $\lVert D - D ^ { * } \rVert < \epsilon ,$ , and $\mathbb { E } _ { z \sim p ( z ) } \left[ \| J _ { \theta } g _ { \theta } ( z ) \| _ { 2 } ^ { 2 } \right] \le M ^ { 2 }$ , 2 then
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\| \nabla _ { \theta } \mathbb { E } _ { z \sim p ( z ) } [ \log ( 1 - D ( g _ { \theta } ( z ) ) ) ] \| _ { 2 } < M \frac { \epsilon } { 1 - \epsilon }
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Proof. In both proofs of Theorems 2.1 and 2.2 we showed that $D ^ { * }$ is locally 0 on the support of $\mathbb { P } _ { g }$ Then, using Jensen’s inequality and the chain rule on this support we have
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\begin{array} { r l } & { \| \nabla _ { \theta } \mathbb { E } _ { z \sim p ( z ) } [ \log ( 1 - D ( g \theta ( z ) ) ) ] \| _ { 2 } ^ { 2 } \le \mathbb { E } _ { \pi \sim p ( z ) } \left[ \frac { \| \nabla _ { \theta } D ( g \theta ( z ) ) \| _ { 2 } ^ { 2 } } { \| 1 - D ( g \theta ( z ) ) \| ^ { 2 } } \right] } \\ & { \qquad \le \mathbb { E } _ { \pi \sim p ( z ) } \left[ \frac { \| \nabla _ { x } D ( g \theta ( z ) ) \| _ { 2 } ^ { 2 } \| J _ { g } g \theta ( z ) \| _ { 2 } ^ { 2 } } { \| 1 - D ( g \theta ( z ) ) \| ^ { 2 } } \right] } \\ & { \qquad < \mathbb { E } _ { z \sim p ( z ) } \left[ \frac { \left( \| \nabla _ { x } D ^ { * } ( g _ { \theta } ( z ) ) \| _ { 2 } + \epsilon ^ { 2 } \right) ^ { 2 } \| J _ { g } g _ { \theta } ( z ) \| _ { 2 } ^ { 2 } } { \left( \| 1 - D ^ { * } ( g _ { \theta } ( z ) ) \| _ { - } \epsilon \right) ^ { 2 } } \right] } \\ & { \qquad = \mathbb { E } _ { z \sim p ( z ) } \left[ \frac { \epsilon ^ { 2 } \| J _ { g } g _ { \theta } ( z ) \| _ { 2 } ^ { 2 } } { \left( 1 - \epsilon \right) ^ { 2 } } \right] } \\ & { \qquad \le M ^ { 2 } \frac { \epsilon ^ { 2 } } { \left( 1 - \epsilon \right) ^ { 2 } } } \end{array}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
Taking square root of everything we get
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\| \nabla _ { \theta } \mathbb { E } _ { z \sim p ( z ) } [ \log ( 1 - D ( g _ { \theta } ( z ) ) ) ] \| _ { 2 } < M \frac { \epsilon } { 1 - \epsilon }
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
finishing the proof
|
| 182 |
+
|
| 183 |
+
Corollary 2.1. Under the same assumptions of Theorem 2.4
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\operatorname* { l i m } _ { \| D - D ^ { * } \| \to 0 } \nabla _ { \theta } \mathbb { E } _ { z \sim p ( z ) } [ \log ( 1 - D ( g _ { \theta } ( z ) ) ) ] = 0
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 2: First, we trained a DCGAN for 1, 10 and 25 epochs. Then, with the generator fixed we train a discriminator from scratch and measure the gradients with the original cost function. We see the gradient norms decay quickly, in the best case 5 orders of magnitude after 4000 discriminator iterations. Note the logarithmic scale.
|
| 191 |
+
|
| 192 |
+
This shows that as our discriminator gets better, the gradient of the generator vanishes. For completeness, this was experimentally verified in Figure 2. The fact that this happens is terrible, since the fact that the generator’s cost function being close to the Jensen Shannon divergence depends on the quality of this approximation. This points us to a fundamental: either our updates to the discriminator will be inacurate, or they will vanish. This makes it difficult to train using this cost function, or leave up to the user to decide the precise amount of training dedicated to the discriminator, which can make GAN training extremely hard.
|
| 193 |
+
|
| 194 |
+
# 2.2.2 $\mathrm { T H E } - \log D$ ALTERNATIVE
|
| 195 |
+
|
| 196 |
+
To avoid gradients vanishing when the discriminator is very confident, people have chosen to use a different gradient step for the generator.
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\Delta \theta = \nabla _ { \theta } \mathbb { E } _ { z \sim p ( z ) } \left[ - \log D ( g _ { \theta } ( z ) ) \right]
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
We now state and prove for the first time which cost function is being optimized by this gradient step. Later, we prove that while this gradient doesn’t necessarily suffer from vanishing gradients, it does cause massively unstable updates (that have been widely experienced in practice) under the prescence of a noisy approximation to the optimal discriminator.
|
| 203 |
+
|
| 204 |
+
Theorem 2.5. Let $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g _ { \theta } }$ be two continuous distributions, with densities $P _ { r }$ and $P _ { g _ { \theta } }$ respectively. Let $\begin{array} { r } { D ^ { * } = \frac { P _ { r } } { { P _ { g _ { \theta _ { 0 } } } } + P _ { r } } } \end{array}$ be the optimal discriminator, fixed for a value ${ \theta _ { 0 } } ^ { 3 }$ . Therefore,
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
\mathbb { E } _ { z \sim p ( z ) } \left[ - \nabla _ { \theta } \log D ^ { * } ( g _ { \theta } ( z ) ) | _ { \theta = \theta _ { 0 } } \right] = \nabla _ { \theta } \left[ K L ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { r } ) - 2 J S D ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { r } ) \right] | _ { \theta = \theta _ { 0 } }
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
Before diving into the proof, let’s look at equation (3) for a second. This is the inverted $\mathrm { K L }$ minus two JSD. First of all, the JSDs are in the opposite sign, which means they are pushing for the distributions to be different, which seems like a fault in the update. Second, the KL appearing in the equation is $K L ( \mathbb { P } _ { g } \| \mathbb { P } _ { r } )$ , not the one equivalent to maximum likelihood. As we know, this KL assigns an extremely high cost to generating fake looking samples, and an extremely low cost on mode dropping; and the JSD is symetrical so it shouldn’t alter this behaviour. This explains what we see in practice, that GANs (when stabilized) create good looking samples, and justifies what is commonly conjectured, that GANs suffer from an extensive amount of mode dropping.
|
| 211 |
+
|
| 212 |
+
Proof. We already know by Goodfellow et al. (2014a) that
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\mathbb { E } _ { z \sim p ( z ) } \left[ \nabla _ { \theta } \log ( 1 - D ^ { * } ( g _ { \theta } ( z ) ) ) | _ { \theta = \theta _ { 0 } } \right] = \nabla _ { \theta } 2 J S D ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { r } ) | _ { \theta = \theta _ { 0 } }
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
Furthermore, as remarked by Huszar (2016),
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\begin{array} { l } { { \displaystyle K L ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { r } ) = \mathbb { E } _ { x \sim \mathbb { P } _ { g _ { \theta } } } \left[ \log \frac { P _ { g _ { \theta } } ( x ) } { P _ { r } ( x ) } \right] } } \\ { { \displaystyle \qquad = \mathbb { E } _ { x \sim \mathbb { P } _ { g _ { \theta } } } \left[ \log \frac { P _ { g _ { \theta _ { 0 } } } ( x ) } { P _ { r } ( x ) } \right] - \mathbb { E } _ { x \sim \mathbb { P } _ { g _ { \theta } } } \left[ \log \frac { P _ { g _ { \theta } } ( x ) } { P _ { g _ { \theta _ { 0 } } } ( x ) } \right] } } \\ { { \displaystyle \qquad = - \mathbb { E } _ { x \sim \mathbb { P } _ { g _ { \theta } } } \left[ \log \frac { D ^ { * } ( x ) } { 1 - D ^ { * } ( x ) } \right] - K L ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { g _ { \theta _ { 0 } } } ) } } \\ { { \displaystyle \qquad = - \mathbb { E } _ { z \sim p ( z ) } \left[ \log \frac { D ^ { * } ( g _ { \theta } ( z ) ) } { 1 - D ^ { * } ( g _ { \theta } ( z ) ) } \right] - K L ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { g _ { \theta _ { 0 } } } ) } } \end{array}
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
Taking derivatives in $\theta$ at $\theta _ { 0 }$ we get
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\begin{array} { r l } & { \nabla _ { \theta } K L ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { r } ) | _ { \theta = \theta _ { 0 } } = - \nabla _ { \theta } \mathbb { E } _ { z \sim p ( z ) } \left[ \log \frac { D ^ { * } \left( g _ { \theta } ( z ) \right) } { 1 - D ^ { * } \left( g _ { \theta } ( z ) \right) } \right] | _ { \theta = \theta _ { 0 } } - \nabla _ { \theta } K L ( \mathbb { P } _ { g _ { \theta } } \| \mathbb { P } _ { g _ { \theta _ { 0 } } } ) | _ { \theta = \theta _ { 0 } } } \\ & { \qquad = \mathbb { E } _ { z \sim p ( z ) } \left[ - \nabla _ { \theta } \log \frac { D ^ { * } \left( g _ { \theta } ( z ) \right) } { 1 - D ^ { * } \left( g _ { \theta } ( z ) \right) } \right] | _ { \theta = \theta _ { 0 } } } \end{array}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
Substracting this last equation with the result for the JSD, we obtain our desired result.
|
| 231 |
+
|
| 232 |
+
We now turn to our result regarding the instability of a noisy version of the true distriminator.
|
| 233 |
+
|
| 234 |
+
Theorem 2.6 (Instability of generator gradient updates). Let $g _ { \theta } : \mathcal { Z } \mathcal { X }$ be a differentiable function that induces a distribution $\mathbb { P } _ { g }$ . Let $\mathbb { P } _ { r }$ be the real data distribution, with either conditions of Theorems 2.1 or 2.2 satisfied. Let $D$ be a discriminator such that $D ^ { * } - D = \epsilon$ is a centered Gaussian process indexed by $x$ and independent for every $x$ (popularly known as white noise) and $\nabla _ { x } D ^ { * } - \nabla _ { x } D = r$ another independent centered Gaussian process indexed by $x$ and independent for every $x$ . Then, each coordinate of
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\mathbb { E } _ { z \sim p ( z ) } \left[ - \nabla _ { \theta } \log D ( g _ { \theta } ( z ) ) \right]
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
is a centered Cauchy distribution with infinite expectation and variance.4
|
| 241 |
+
|
| 242 |
+
Proof. Let us remember again that in this case $D$ is locally constant equal to 0 on the support of $\mathbb { P } _ { g }$ . We denote $r ( z ) , \epsilon ( z )$ the random variables $r ( g _ { \boldsymbol { \theta } } ( z ) ) , \epsilon ( g _ { \boldsymbol { \theta } } ( z ) )$ . By the chain rule and the definition of $r , \epsilon$ , we get
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
\begin{array} { r l } & { \mathbb { E } _ { z \sim p ( z ) } \left[ - \nabla _ { \theta } \log D ( g _ { \theta } ( z ) ) \right] = \mathbb { E } _ { z \sim p ( z ) } \left[ - \frac { J _ { \theta } g _ { \theta } ( z ) \nabla _ { x } D ( g _ { \theta } ( z ) ) } { D ( g _ { \theta } ( z ) ) } \right] } \\ & { \qquad = \mathbb { E } _ { z \sim p ( z ) } \left[ - \frac { J _ { \theta } g _ { \theta } ( z ) r ( z ) } { \epsilon ( z ) } \right] } \end{array}
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
Since $r ( z )$ is a centered Gaussian distribution, multiplying by a matrix doesn’t change this fact. Furthermore, when we divide by $\epsilon ( z )$ , a centered Gaussian independent from the numerator, we get a centered Cauchy random variable on every coordinate. Averaging over $z$ the different independent Cauchy random variables again yields a centered Cauchy distribution. 5 □
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
Figure 3: First, we trained a DCGAN for 1, 10 and 25 epochs. Then, with the generator fixed we train a discriminator from scratch and measure the gradients with the $- \log D$ cost function. We see the gradient norms grow quickly. Furthermore, the noise in the curves shows that the variance of the gradients is also increasing. All these gradients lead to updates that lower sample quality notoriously.
|
| 252 |
+
|
| 253 |
+
Note that even if we ignore the fact that the updates have infinite variance, we still arrive to the fact that the distribution of the updates is centered, meaning that if we bound the updates the expected update will be 0, providing no feedback to the gradient.
|
| 254 |
+
|
| 255 |
+
Since the assumption that the noises of $D$ and $\nabla D$ are decorrelated is albeit too strong, we show in Figure 3 how the norm of the gradient grows drastically as we train the discriminator closer to optimality, at any stage in training of a well stabilized DCGAN except when it has already converged. In all cases, using this updates lead to a notorious decrease in sample quality. The noise in the curves also shows that the variance of the gradients is increasing, which is known to delve into slower convergence and more unstable behaviour in the optimization (Bottou et al., 2016).
|
| 256 |
+
|
| 257 |
+
# 3 TOWARDS SOFTER METRICS AND DISTRIBUTIONS
|
| 258 |
+
|
| 259 |
+
An important question now is how to fix the instability and vanishing gradients issues. Something we can do to break the assumptions of these theorems is add continuous noise to the inputs of the discriminator, therefore smoothening the distribution of the probability mass.
|
| 260 |
+
|
| 261 |
+
Theorem 3.1. If $X$ has distribution $\mathbb { P } _ { X }$ with support on $\mathcal { M }$ and $\epsilon$ is an aboslutely continuous distribution with density $P _ { \epsilon }$ , then $\mathbb { P } _ { X + \epsilon }$ is absolutely continuous with density
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\begin{array} { r l } & { P _ { X + \epsilon } ( x ) = \mathbb { E } _ { y \sim \mathbb { P } _ { X } } \left[ P _ { \epsilon } ( x - y ) \right] } \\ & { \quad \quad = \displaystyle \int _ { \mathcal { M } } P _ { \epsilon } ( x - y ) \mathrm { d } \mathbb { P } _ { X } ( y ) } \end{array}
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
Proof. See Appendix A.
|
| 268 |
+
|
| 269 |
+
Corollary 3.1.
|
| 270 |
+
|
| 271 |
+
• $I f \epsilon \sim { \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ then
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
P _ { X + \epsilon } ( x ) = \frac { 1 } { Z } \int _ { \mathcal { M } } e ^ { - \frac { \| y - x \| ^ { 2 } } { 2 \sigma ^ { 2 } } } \mathrm { d } \mathbb { P } _ { X } ( y )
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
• If $\epsilon \sim \mathcal { N } ( 0 , \Sigma )$ then
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
P _ { X + \epsilon } ( x ) = \frac { 1 } { Z } \mathbb { E } _ { y \sim \mathbb { P } _ { X } } \left[ e ^ { - \frac { 1 } { 2 } \left\| y - x \right\| _ { \Sigma ^ { - 1 } } ^ { 2 } } \right]
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
• If $\begin{array} { r } { P _ { \epsilon } ( x ) \propto \frac { 1 } { \| x \| ^ { d + 1 } } } \end{array}$ then
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
P _ { X + \epsilon } ( x ) = \frac { 1 } { Z } \mathbb { E } _ { y \sim \mathbb { P } _ { X } } \left[ \frac { 1 } { \| x - y \| ^ { d + 1 } } \right]
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
This theorem therefore tells us that the density $P _ { X + \epsilon } ( x )$ is inversely proportional to the average distance to points in the support of $\mathbb { P } _ { X }$ , weighted by the probability of these points. In the case of the support of $\mathbb { P } _ { X }$ being a manifold, we will have the weighted average of the distance to the points along the manifold. How we choose the distribution of the noise $\epsilon$ will impact the notion of distance we are choosing. In our corolary, for example, we can see the effect of changing the covariance matrix by altering the norm inside the exponential. Different noises with different types of decays can therefore be used.
|
| 290 |
+
|
| 291 |
+
Now, the optimal discriminator between $\mathbb { P } _ { g + \epsilon }$ and $\mathbb { P } _ { r + \epsilon }$ is
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
D ^ { * } ( x ) = \frac { P _ { r + \epsilon } ( x ) } { P _ { r + \epsilon } ( x ) + P _ { g + \epsilon } ( x ) }
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
and we want to calculate what the gradient passed to the generator is.
|
| 298 |
+
|
| 299 |
+
Theorem 3.2. Let $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ be two distributions with support on $\mathcal { M }$ and $\mathcal { P }$ respectively, with $\epsilon \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ . Then, the gradient passed to the generator has the form
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\begin{array} { r l } & { \mathbb { E } _ { z \sim p ( z ) } \left[ \nabla _ { \theta } \log ( 1 - D ^ { * } ( g _ { \theta } ( z ) ) ) \right] } \\ & { \qquad = \mathbb { E } _ { z \sim p ( z ) } \bigg [ a ( z ) \int _ { \mathcal { M } } P _ { \epsilon } ( g _ { \theta } ( z ) - y ) \nabla _ { \theta } \| g _ { \theta } ( z ) - y \| ^ { 2 } \mathrm { d } \mathbb { P } _ { r } ( y ) } \\ & { \qquad - b ( z ) \int _ { \mathcal { P } } P _ { \epsilon } ( g _ { \theta } ( z ) - y ) \nabla _ { \theta } \| g _ { \theta } ( z ) - y \| ^ { 2 } \mathrm { d } \mathbb { P } _ { g } ( y ) \bigg ] } \end{array}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
where $a ( z )$ and $b ( z )$ are positive functions. Furthermore, $b > a$ if and only if $P _ { r + \epsilon } > P _ { g + \epsilon }$ , and $b < a$ if and only if $P _ { r + \epsilon } < P _ { g + \epsilon }$ .
|
| 306 |
+
|
| 307 |
+
This theorem proves that we will drive our samples $g _ { \boldsymbol { \theta } } ( z )$ towards points along the data manifold, weighted by their probability and the distance from our samples. Furthermore, the second term drives our points away from high probability samples, again, weighted by the sample manifold and distance to these samples. This is similar in spirit to contrastive divergence, where we lower the free energy of our samples and increase the free energy of data points. The importance of this term is seen more clearly when we have samples that have higher probability of coming from $\mathbb { P } _ { g }$ than from $\mathbb { P } _ { r }$ . In this case, we will have $b > a$ and the second term will have the strength to lower the probability of this too likely samples. Finally, if there’s an area around $x$ that has the same probability to come from $\mathbb { P } _ { g }$ than $\mathbb { P } _ { r }$ , the gradient contributions between the two terms will cancel, therefore stabilizing the gradient when $\mathbb { P } _ { r }$ is similar to $\mathbb { P } _ { g }$ .
|
| 308 |
+
|
| 309 |
+
There is one important problem with taking gradient steps exactly of the form (4), which is that in that case, $D$ will disregards errors that lie exactly in $g ( \mathcal { Z } )$ , since this is a set of measure 0. However, $g$ will be optimizing its cost only on that space. This will make the discriminator extremely susceptible to adversarial examples, and will render low cost on the generator without high cost on the discriminator, and lousy meaningless samples. This is easilly seen when we realize the term inside the expectation of equation (4) will be a positive scalar times $\nabla _ { x } \log ( 1 - D ^ { * } ( x ) ) \nabla _ { \theta } g _ { \theta } ( z )$ , which is the directional derivative towards the exact adversarial term of Goodfellow et al. (2014b). Because of this, it is important to backprop through noisy samples in the generator as well. This will yield a crucial benefit: the generator’s backprop term will be through samples on a set of positive measure that the discriminator will care about. Formalizing this notion, the actual gradient through the generator will now be proportional to $\nabla _ { \theta } J S D ( \mathbb { P } _ { r + \epsilon } \| \mathbb { P } _ { g + \epsilon } )$ , which will make the two noisy distributions match. As we anneal the noise, this will make $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ match as well. For completeness, we show the smooth gradient we get in this case. The proof is identical to the one of Theorem 3.2, so we leave it to the reader.
|
| 310 |
+
|
| 311 |
+
Corollary 3.2. Let $\epsilon , \epsilon ^ { \prime } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ and $\tilde { g } _ { \boldsymbol { \theta } } ( z ) = g _ { \boldsymbol { \theta } } ( z ) + \epsilon ^ { \prime }$ , then
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r l r } { { \mathbb { E } _ { z \sim p ( z ) , \epsilon ^ { \prime } } \bigl [ \nabla _ { \theta } \log ( 1 - D ^ { * } ( \tilde { g } _ { \theta } ( z ) ) ) \bigr ] } } \\ & { } & { = \mathbb { E } _ { z \sim p ( z ) , \epsilon ^ { \prime } } \bigg [ a ( z ) \int _ { \mathcal { M } } P _ { \epsilon } ( \tilde { g } _ { \theta } ( z ) - y ) \nabla _ { \theta } \| \tilde { g } _ { \theta } ( z ) - y \| ^ { 2 } \mathrm { d } \mathbb { P } _ { r } ( y ) } \\ & { } & { - b ( z ) \int _ { \mathcal { P } } P _ { \epsilon } ( \tilde { g } _ { \theta } ( z ) - y ) \nabla _ { \theta } \| \tilde { g } _ { \theta } ( z ) - y \| ^ { 2 } \mathrm { d } \mathbb { P } _ { g } ( y ) \bigg ] } \\ & { } & { = 2 \nabla _ { \theta } J S D ( \mathbb { P } _ { r + \epsilon } \| \mathbb { P } _ { g + \epsilon } ) } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
In the same as with Theorem 3.2, $a$ and $b$ will have the same properties. The main difference is that we will be moving all our noisy samples towards the data manifold, which can be thought of as moving a small neighbourhood of samples towards it. This will protect the discriminator against measure 0 adversarial examples.
|
| 318 |
+
|
| 319 |
+
Proof of theorem 3.2. Since the discriminator is assumed fixed when backproping to the generator, the only thing that depends on $\theta$ is $g _ { \theta } ( z )$ for every $z$ . By taking derivatives on our cost function
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
\begin{array} { r l } & { \mathbb { E } _ { z \sim p ( z ) } [ \nabla _ { \theta } \log ( 1 - D ^ { * } ( g _ { \theta } ( z ) ) ) ] } \\ & { \quad = \mathbb { E } _ { z \sim p ( z ) } [ \nabla _ { \theta } \log \frac { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) } { P _ { r + \epsilon } ( g _ { \theta } ( z ) ) + P _ { g + \epsilon } ( g _ { \theta } ( z ) ) } ] } \\ & { \quad \quad = \mathbb { E } _ { z \sim p ( z ) } [ \nabla _ { \theta } \log P _ { g + \epsilon } ( g _ { \theta } ( z ) ) - \nabla _ { \theta } \log ( P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) ) ] } \\ & { \quad \quad = \mathbb { E } _ { z \sim p ( z ) } [ \frac { \nabla _ { \theta } P _ { g + \epsilon } ( g _ { \theta } ( z ) ) } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) } - \frac { \nabla _ { \theta } P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + \nabla _ { \theta } P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } ] } \\ & { \quad \quad = \mathbb { E } _ { z \sim p ( z ) } [ \frac { 1 } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } \nabla _ { \theta } [ \cdot \ : \ : \ : \ : \ : \ : } \\ & { \quad \quad \frac { 1 } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } \nabla _ { \theta } [ \cdot \ : \ : \ : \ : \ : \ : } \\ & { \quad \ : \ : \frac { 1 } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } \nabla _ { \theta } [ \cdot \ : \ : \ : \ : \ : \ : ( g _ { \theta } ( z ) ) ] - } \\ & \quad \ : \ : \frac { 1 } P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } \end{array}
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
Let the density of $\epsilon$ be $\frac { 1 } { Z } e ^ { - \frac { \| x \| ^ { 2 } } { 2 \sigma ^ { 2 } } }$ . We now define
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { l } { { a ( z ) = \displaystyle \frac { 1 } { 2 \sigma ^ { 2 } } \frac { 1 } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } } } \\ { { b ( z ) = \displaystyle \frac { 1 } { 2 \sigma ^ { 2 } } \frac { 1 } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) + P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } \frac { P _ { r + \epsilon } ( g _ { \theta } ( z ) ) } { P _ { g + \epsilon } ( g _ { \theta } ( z ) ) } } } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
Trivially, $a$ and $b$ are positive functions. Since $\begin{array} { r } { b \ = \ a \frac { P _ { r + \epsilon } } { P _ { g + \epsilon } } } \end{array}$ a Pr+P , we know that b > a if and only if $P _ { r + \epsilon } > P _ { g + \epsilon }$ , and $b < a$ if and only if $P _ { r + \epsilon } < P _ { g + \epsilon }$ as we wanted. Continuing the proof, we know
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r l } { \mathbb { E } _ { z \sim p ( z ) } \big [ \nabla _ { \theta } \log ( 1 - D ^ { * } ( g _ { \theta } ( z ) ) ) \big ] } & { } \\ & { = \mathbb { E } _ { z \sim p ( z ) } \left[ 2 \sigma ^ { 2 } a ( z ) \nabla _ { \theta } \big ( - P r _ { + } ( g _ { \theta } ( z ) ) \big ) - 2 \sigma ^ { 2 } b ( z ) \nabla _ { \theta } \big [ - P _ { g } + ( g _ { \theta } ( z ) ) \big ] \right. } \\ & { = \mathbb { E } _ { z \sim p ( z ) } \left[ 2 \sigma ^ { 2 } a ( z ) \int _ { M } - \nabla _ { \theta } \frac { 1 } { Z } e ^ { - \frac { \mathrm { l i g n } ( z ) - \mathrm { s i g n } ( z ) } { 2 q } } \mathrm { d } \mathrm { P r } _ { \theta } ( g ) - 2 \sigma ^ { 2 } b ( z ) \int _ { p ^ { - } } - \nabla _ { \theta } \frac { 1 } { Z } e ^ { - \frac { \mathrm { l i g n } ( z ) - \mathrm { s i g n } ( z ) } { 2 q } } \mathrm { d } \mathrm { P } _ { g } \right. } \\ & { = \mathbb { E } _ { \sim \sim p ( z ) } \bigg [ a ( z ) \int _ { M } \frac { 1 } { Z } e ^ { - \frac { \mathrm { l i g n } ( z ) - \mathrm { s i g n } ( z ) } { 2 q } } \nabla _ { \theta } \big \| g _ { \theta } ( z ) - y \big \| ^ { 2 } \mathrm { d } \mathrm { P r } _ { \theta } ( y ) } \\ & { - b ( z ) \int _ { p } \frac { 1 } { Z } e ^ { - \frac { \mathrm { l i g n } ( z ) - \mathrm { s i g n } ( z ) } { 2 q } } \nabla _ { \theta } \big \| g _ { \theta } ( z ) - y \big \| ^ { 2 } \mathrm { d } \mathrm { P } _ { g } ( y ) \bigg ] } \\ & { = \mathbb { E } _ { \sim p ( z ) } \bigg [ a ( z ) \int _ { M } P _ { + } ( g _ { \theta } ( z ) - y ) \nabla _ { \theta } \big \| g _ { \theta } ( z ) - y \big \| ^ { 2 } \mathrm { d } \mathrm { P r } _ { \theta } ( y ) } \\ & { - b ( z ) \int _ { p ^ { \star } } ( g _ { \theta } ( z ) - y ) \nabla _ { \theta } \big \| g _ { \theta } ( z ) - y \big \| ^ { 2 } \mathrm { d } \mathrm { P r } _ { \theta } ( y ) \bigg ] } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Finishing the proof.
|
| 338 |
+
|
| 339 |
+
An interesting observation is that if we have two distributions $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ with support on manifolds that are close, the noise terms will make the noisy distributions $\mathbb { P } _ { r + \epsilon }$ and $\mathbb { P } _ { g + \epsilon }$ almost overlap, and the JSD between them will be small. This is in drastic contrast to the noiseless variants $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , where all the divergences are maxed out, regardless of the closeness of the manifolds. We could argue to use the JSD of the noisy variants to measure a similarity between the original distributions, but this would depend on the amount of noise, and is not an intrinsic measure of $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ . Luckilly, there are alternatives.
|
| 340 |
+
|
| 341 |
+
Definition 3.1. We recall the definition of the Wasserstein metric $W ( P , Q )$ for $P$ and $Q$ two distributions over $\mathcal { X }$ . Namely,
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
W ( P , Q ) = \operatorname* { i n f } _ { \gamma \in \Gamma } \int _ { \mathcal { X } \times \mathcal { X } } \| x - y \| _ { 2 } d \gamma ( x , y )
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
where $\Gamma$ is the set of all possible joints on $\mathcal { X } \times \mathcal { X }$ that have marginals $P$ and $Q$
|
| 348 |
+
|
| 349 |
+
The Wasserstein distance also goes by other names, most commonly the transportation metric and the earth mover’s distance. This last name is most explicative: it’s the minimum cost of transporting the whole probability mass of $P$ from its support to match the probability mass of $Q$ on $Q$ ’s support. This identification of transporting points from $P$ to $Q$ is done via the coupling $\gamma$ . We refer the reader to Villani (2009) for an in-depth explanation of these ideas. It is easy to see now that the Wasserstein metric incorporates the notion of distance (as also seen inside the integral) between the elements in the support of $P$ and the ones in the support of $Q$ , and that as the supports of $P$ and $Q$ get closer and closer, the metric will go to 0, inducing as well a notion of distance between manifolds.
|
| 350 |
+
|
| 351 |
+
Intuitively, as we decrease the noise, $\mathbb { P } _ { X }$ and $\mathbb { P } _ { X + \epsilon }$ become more similar. However, it is easy to see again that $J S D ( \mathbb { P } _ { X } \| \mathbb { P } _ { X + \epsilon } )$ is maxed out, regardless of the amount of noise. The following Lemma shows that this is not the case for the Wasserstein metric, and that it goes to 0 smoothly when we decrease the variance of the noise.
|
| 352 |
+
|
| 353 |
+
Lemma 4. If is a random vector with mean $O$ , then we have
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
W ( \mathbb { P } _ { X } , \mathbb { P } _ { X + \epsilon } ) \leq V ^ { \frac { 1 } { 2 } }
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
where $V = \mathbb { E } [ \| \epsilon \| _ { 2 } ^ { 2 } ]$ is the variance of .
|
| 360 |
+
|
| 361 |
+
Proof. Let $x \sim \mathbb { P } _ { X }$ , and $y = x + \epsilon$ with $\epsilon$ independent from $x$ . We call $\gamma$ the joint of $( x , y )$ , which clearly has marginals $\mathbb { P } _ { X }$ and $\mathbb { P } _ { X + \epsilon }$ . Therefore,
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { r l } & { W ( \mathbb { P } _ { X } , \mathbb { P } _ { X + \epsilon } ) \leq \int \| x - y \| _ { 2 } d \gamma ( x , y ) } \\ & { \qquad = \mathbb { E } _ { x \sim \mathbb { P } _ { X } } \mathbb { E } _ { y \sim x + \epsilon } [ \| x - y \| _ { 2 } ] } \\ & { \qquad = \mathbb { E } _ { x \sim \mathbb { P } _ { X } } \mathbb { E } _ { y \sim x + \epsilon } [ \| \epsilon \| _ { 2 } ] } \\ & { \qquad = \mathbb { E } _ { x \sim \mathbb { P } _ { X } } \mathbb { E } _ { \epsilon } [ \| \epsilon \| _ { 2 } ] } \\ & { \qquad = \mathbb { E } _ { \epsilon } [ \| \epsilon \| _ { 2 } ] } \\ & { \qquad \leq \mathbb { E } _ { \epsilon } [ \| \epsilon \| _ { 2 } ^ { 2 } ] ^ { \frac { 1 } { 2 } } = V ^ { \frac { 1 } { 2 } } } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
where the last inequality was due to Jensen.
|
| 368 |
+
|
| 369 |
+
We now turn to one of our main results. We are interested in studying the distance between $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ without any noise, even when their supports lie on different manifolds, since (for example) the closer these manifolds are, the closer to actual points on the data manifold the samples will be. Furthermore, we eventually want a way to evaluate generative models, regardless of whether they are continuous (as in a VAE) or not (as in a GAN), a problem that has for now been completely unsolved. The next theorem relates the Wasserstein distance of $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , without any noise or modification, to the divergence of $\mathbb { P } _ { r + \epsilon }$ and $\mathbb { P } _ { g + \epsilon }$ , and the variance of the noise. Since $\mathbb { P } _ { r + \epsilon }$ and $\mathbb { P } _ { g + \epsilon }$ are continuous distributions, this divergence is a sensible estimate, which can even be attempted to minimize, since a discriminator trained on those distributions will approximate the JSD between them, and provide smooth gradients as per Corolary 3.2.
|
| 370 |
+
|
| 371 |
+
Theorem 3.3. Let $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ be any two distributions, and $\epsilon$ be a random vector with mean 0 and variance $V$ . If $\mathbb { P } _ { r + \epsilon }$ and $\mathbb { P } _ { g + \epsilon }$ have support contained on a ball of diameter $C$ , then 6
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
W ( \mathbb { P } _ { r } , \mathbb { P } _ { g } ) \leq 2 V ^ { \frac { 1 } { 2 } } + 2 C \sqrt { J S D ( \mathbb { P } _ { r + \epsilon } \| \mathbb { P } _ { g + \epsilon } ) }
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Proof.
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { r l } & { W ( \mathbb { P } _ { r } , \mathbb { P } _ { g } ) \leq W ( \mathbb { P } _ { r } , \mathbb { P } _ { r + \epsilon } ) + W ( \mathbb { P } _ { r + \epsilon } , \mathbb { P } _ { g + \epsilon } ) + W ( \mathbb { P } _ { g + \epsilon } , \mathbb { P } _ { g } ) } \\ & { \qquad \leq 2 V ^ { \frac { 1 } { 2 } } + W ( \mathbb { P } _ { r + \epsilon } , \mathbb { P } _ { g + \epsilon } ) } \\ & { \qquad \leq 2 V ^ { \frac { 1 } { 2 } } + C \delta ( \mathbb { P } _ { r + \epsilon } , \mathbb { P } _ { g + \epsilon } ) } \\ & { \qquad \leq 2 V ^ { \frac { 1 } { 2 } } + C \left( \delta ( \mathbb { P } _ { r + \epsilon } , \mathbb { P } _ { m } ) + \delta ( \mathbb { P } _ { g + \epsilon } , \mathbb { P } _ { m } ) \right) } \\ & { \qquad \leq 2 V ^ { \frac { 1 } { 2 } } + C \left( \sqrt { \frac { 1 } { 2 } K L ( \mathbb { P } _ { r + \epsilon } \| \mathbb { P } _ { m } ) } + \sqrt { \frac { 1 } { 2 } K L ( \mathbb { P } _ { g + \epsilon } \| \mathbb { P } _ { m } ) } \right) } \\ & { \qquad \leq 2 V ^ { \frac { 1 } { 2 } } + 2 C \sqrt { J S D ( \mathbb { P } _ { r + \epsilon } \| \mathbb { P } _ { g + \epsilon } ) } } \\ & { \qquad \leq 2 V ^ { \frac { 1 } { 2 } } + 2 C \sqrt { J S D ( \mathbb { P } _ { r + \epsilon } \| \mathbb { P } _ { g + \epsilon } ) } } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
We first used the Lemma 4 to bound everything but the middle term as a function of $V$ . After that, we followed by the fact that $W ( P , Q ) \leq C \delta ( P , Q )$ wih $\delta$ the total variation, which is a popular Lemma arizing from the Kantorovich-Rubinstein duality. After that, we used the triangular inequality on $\delta$ and $\mathbb { P } _ { m }$ the mixture distribution between $\mathbb { P } _ { g + \epsilon }$ and $\mathbb { P } _ { r + \epsilon }$ . Finally, we used Pinsker’s inequality and later the fact that each individual $K L$ is only one of the non-negative sumands of the $J S D$ . □
|
| 384 |
+
|
| 385 |
+
Theorem 3.3 points us to an interesting idea. The two terms in equation (6) can be controlled. The first term can be decreased by annealing the noise, and the second term can be minimized by a GAN when the discriminator is trained on the noisy inputs, since it will be approximating the JSD between the two continuous distributions. One great advantage of this is that we no longer have to worry about training schedules. Because of the noise, we can train the discriminator till optimality without any problems and get smooth interpretable gradients by Corollary 3.2. All this while still minimizing the distance between $\mathbb { P } _ { r }$ and $\mathbb { P } _ { g }$ , the two noiseless distributions we in the end care about.
|
| 386 |
+
|
| 387 |
+
# ACKNOWLEDGMENTS
|
| 388 |
+
|
| 389 |
+
The first author would like to especially thank Luis Scoccola for help with the proof of Lemma 1.
|
| 390 |
+
|
| 391 |
+
The authors would also like to thank Ishmael Belghazi, Yoshua Bengio, Gerry Che, Soumith Chintala, Caglar Gulcehre, Daniel Jiwoong Im, Alex Lamb, Luis Scoccola, Pablo Sprechmann, Arthur Szlam, Jake Zhao for insightful comments and advice.
|
| 392 |
+
|
| 393 |
+
# REFERENCES
|
| 394 |
+
|
| 395 |
+
Leon Bottou, Frank E. Curtis, and Jorge Nocedal. Optimization methods for large-scale machine ´ learning. CoRR, abs/1606.04838, 2016.
|
| 396 |
+
|
| 397 |
+
Emily L. Denton, Soumith Chintala, Arthur Szlam, and Rob Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in Neural Information Processing Systems 28, pp. 1486–1494. Curran Associates, Inc., 2015.
|
| 398 |
+
|
| 399 |
+
Ian J. 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 27, pp. 2672–2680. Curran Associates, Inc., 2014a.
|
| 400 |
+
|
| 401 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. CoRR, abs/1412.6572, 2014b.
|
| 402 |
+
|
| 403 |
+
Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural Networks, 4 (2):251 – 257, 1991.
|
| 404 |
+
|
| 405 |
+
Ferenc Huszar. How (not) to train your generative model: Scheduled sampling, likelihood, adversary? CoRR, abs/1511.05101, 2015.
|
| 406 |
+
|
| 407 |
+
Ferenc Huszar. An alternative update rule for generative adversarial networks. Blogpost, 2016. URL http://www.inference.vc/ an-alternative-update-rule-for-generative-adversarial-networks/.
|
| 408 |
+
|
| 409 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. CoRR, abs/1312.6114, 2013.
|
| 410 |
+
|
| 411 |
+
Alex Lamb, Anirudh Goyal, Ying Zhang, Saizheng Zhang, Aaron Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. Corr, abs/1610.09038, 2016.
|
| 412 |
+
|
| 413 |
+
Hariharan Narayanan and Sanjoy Mitter. Sample complexity of testing the manifold hypothesis. In Advances in Neural Information Processing Systems 23, pp. 1786–1794. Curran Associates, Inc., 2010.
|
| 414 |
+
|
| 415 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015.
|
| 416 |
+
|
| 417 |
+
Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. CoRR, abs/1606.03498, 2016.
|
| 418 |
+
|
| 419 |
+
Lucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. In International Conference on Learning Representations, Apr 2016.
|
| 420 |
+
|
| 421 |
+
Cedric Villani. ´ Optimal Transport: Old and New. Grundlehren der mathematischen Wissenschaften. Springer, Berlin, 2009. ISBN 978-3-540-71049-3. URL http://opac.inria. fr/record $\underline { { \underline { { \mathbf { \Pi } } } } } =$ b1129524.
|
| 422 |
+
|
| 423 |
+
Jiajun Wu, Chengkai Zhang, Tianfan Xue, William T. Freeman, and Joshua B. Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. Corr, abs/1610.07584, 2016.
|
| 424 |
+
|
| 425 |
+
# A PROOFS OF THINGS
|
| 426 |
+
|
| 427 |
+
Proof of Lemma 1. We first consider the case where the nonlinearities are rectifiers or leaky rectifiers of the form $\sigma ( x ) ~ = ~ \mathbb { 1 } [ x ~ < ~ 0 ] c _ { 1 } x + \mathbb { 1 } [ x ~ \geq ~ 0 ] c _ { 2 } x$ for some $c _ { 1 } , c _ { 2 } \ \in \ \mathbb { R }$ . In this case, $g ( z ) = \mathbf { D } _ { n } \mathbf { W } _ { n } \ldots \mathbf { D } _ { 1 } \mathbf { W } _ { 1 } z$ , where $\mathbf { W } _ { i }$ are affine transformations and $\mathbf { D } _ { i }$ are some diagonal matrices dependent on $z$ that have diagonal entries $c _ { 1 }$ or $c _ { 2 }$ . If we consider $\mathcal { D }$ to be the (finite) set of all diagonal matrices with diagonal entries $c _ { 1 }$ or $c _ { 2 }$ , then $g ( \mathcal { Z } ) \subseteq \bigcup _ { D _ { i } \in \mathcal { D } } \mathbf { D } _ { n } \mathbf { W } _ { n } \ldots \mathbf { D } _ { 1 } \mathbf { W } _ { 1 } \mathcal { Z }$ , which is a finite union of linear manifolds.
|
| 428 |
+
|
| 429 |
+
The proof for the second case is technical and slightly more involved. When $\sigma$ is a pointwise smooth strictly increasing nonlinearity, then applying it vectorwise it’s a diffeomorphism to its image. Therefore, it sends a countable union of manifolds of dimension $d$ to a countable union of manifolds of dimension $d$ . If we can prove the same thing for affine transformations we will be finished, since $g ( \mathcal { Z } )$ is just a composition of these applied to a $\mathrm { d i m } \mathcal { Z }$ dimensional manifold. Of course, it suffices to prove that an affine transformation sends a manifold to a countable union of manifolds without increasing dimension, since a countable union of countable unions is still a countable union. Furthermore, we only need to show this for linear transformations, since applying a bias term is a diffeomorphism.
|
| 430 |
+
|
| 431 |
+
Let $\mathbf { W } \in \mathbb { R } ^ { n \times m }$ be a matrix. Note that by the singular value decomposition, $\mathbf { W } = \mathbf { U } \pmb { \Sigma } \mathbf { V }$ , where $\pmb { \Sigma }$ is a square diagonal matrix with diagonal positive entries and $\mathbf { U } , \mathbf { V }$ are compositions of changes of basis, inclusions (meaning adding 0s to new coordinates) and projections to a subset of the coordinates. Multiplying by $\Sigma$ and applying a change of basis are diffeomorphisms, and adding 0s to new coordinates is a manifold embedding, so we only need to prove our statement for projections onto a subset of the coordinates. Let $\pi : \bar { \mathbb { R } } ^ { n + k } \bar { \mathbb { R } } ^ { \bar { n } }$ , where $\pi ( x _ { 1 } , \ldots , x _ { n + k } ) = ( x _ { 1 } , \ldots , x _ { n } )$ be our projection and $\mathcal { M } \subseteq \mathbb { R } ^ { n + k }$ our $d$ -dimensional manifold. If $n \leq d$ , we are done since the image of $\pi$ is contained in all $\mathbb { R } ^ { n }$ , a manifold with at most dimension $d$ . We now turn to the case where $n > d$ . Let $\pi _ { i } ( x ) = x _ { i }$ be the projection onto the $i$ -th coordinate. If $x$ is a critical point of $\pi$ , since the coordinates of $\pi$ are independent, then $x$ has to be a critical point of a $\pi _ { i }$ . By a consequence of the Morse Lemma, the critical points of $\pi _ { i }$ are isolated, and therefore so are the ones of $\pi$ , meaning that there is at most a countable number of them. Since $\pi$ maps the non-critical points onto a $d$ dimensional manifold (because it acts as an embedding) and the countable number of critical points into a countable number of points (or 0 dimensional manifolds), the proof is finished. □
|
| 432 |
+
|
| 433 |
+
Proof of Lemma 2. For now we assume that $\mathcal { M }$ and $\mathcal { P }$ are without boundary. If $\dim { \mathcal { M } } + \dim { \mathcal { P } } \geq$ $d$ it is known that under arbitrarilly small perturbations defined as the ones in the statement of this Lemma, the two dimensions will intersect only transversally with probability 1 by the General Position Lemma. If $\dim { \mathcal { M } } + \dim { \mathcal { P } } < d$ , we will show that with probability 1, $\mathcal { M } + \eta$ and $\mathcal { P } + \eta ^ { \prime }$ will not intersect, thereby getting our desired result. Let us then assume $\dim { \mathcal { M } } + \dim { \mathcal { P } } < d$ . Note that $\hat { \mathcal { M } } \cap \hat { \mathcal { P } } \neq \varnothing$ if and only if there are $x \in { \mathcal { M } } , y \in { \mathcal { P } }$ such that $x + \eta = y + \eta ^ { \prime }$ , or equivalently $x - y = \eta ^ { \prime } - \eta$ . Therefore, $\hat { \mathcal { M } }$ and $\hat { \mathcal { P } }$ intersect if and only if $\eta ^ { \prime } - \eta \in \mathcal { M } - \mathcal { P }$ . Since $\eta , \eta ^ { \prime }$ are independent continuous random variables, the difference is also continuous. If $\mathcal { M } - \mathcal { P }$ has measure 0 in $\mathbf { \bar { \mathbb { R } } } ^ { d }$ then $\mathbb { P } ( \eta ^ { \prime } - \eta \in \mathcal { M } - \mathcal { P } ) = 0$ , concluding the proof. We will therefore show that $\mathcal { M } - \mathcal { P }$ has measure 0. Let $f : \mathcal { M } \times \mathcal { P } \to \mathbb { R } ^ { d }$ be $f ( x , y ) = x - y$ . If $m$ and $p$ are the dimensions of $\mathcal { M }$ and $\mathcal { P }$ , then $f$ is a smooth function between an $m + p$ -dimensional manifold and a $d$ dimensional one. Clearly, the image of $f$ is $\mathcal { M } - \mathcal { P }$ . Therefore,
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\begin{array} { r l } & { \mathcal { M } - \mathcal { P } = f ( \{ z \in \mathcal { M } \times \mathcal { P } | \mathrm { r a n k } ( d _ { z } f ) < m + p \} ) } \\ & { \qquad \cup \ f ( \{ z \in \mathcal { M } \times \mathcal { P } | \mathrm { r a n k } ( d _ { z } f ) = m + p \} ) } \end{array}
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
The first set is the image of the critical points, namely the critical values. By Sard’s Lemma, this set has measure 0. Let’s call $A = \{ z \in \mathcal { M } \times \mathcal { P } | \mathrm { r a n k } ( d _ { z } f ) = m + p \}$ . Let $z$ be an element of $A$ . By the inverse function theorem, there is a neighbourhood $U _ { z } \subseteq \mathcal { M } \times \mathcal { P }$ of $z$ such that $f | _ { U _ { z } }$ is an embedding. Since every manifold has a countable topological basis, we can cover $A$ by countable sets $U _ { z _ { n } }$ , where $n \in \mathbb N$ . We will just note them by $U _ { n }$ . Since $f | _ { U _ { n } }$ is an embedding, $f ( U _ { n } )$ is an $m + p$ -dimensional manifold, and since $m + p < d$ , this set has measure 0 in $\mathbb { R } ^ { d }$ . Now, $\textstyle f ( A ) = \bigcup _ { n \in \mathbb { N } } f ( U _ { n } )$ , which therefore has measure 0 in $\mathbb { R } ^ { d }$ , finishing the proof of the boundary free case.
|
| 440 |
+
|
| 441 |
+
Now we consider the case where $\mathcal { M }$ and $\mathcal { P }$ are manifolds with boundary. By a simple union bound,
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r l } { \mathbb { P } _ { \eta , \eta ^ { \prime } } \big ( \tilde { \mathcal { M } } \mathrm { p e r f e c t l y ~ a l i g n s ~ w i t h ~ } \tilde { \mathcal { P } } \big ) \le \mathbb { P } _ { \eta , \eta ^ { \prime } } \big ( \mathrm { I n t } \tilde { \mathcal { M } } \mathrm { p e r f e c t l y ~ a l i g n s ~ w i t h ~ I n t } \tilde { \mathcal { P } } \big ) } & { } \\ { + \mathbb { P } _ { \eta , \eta ^ { \prime } } \big ( \mathrm { I n t } \tilde { \mathcal { M } } \mathrm { p e r f e c t l y ~ a l i g n s ~ w i t h ~ } \partial \tilde { \mathcal { P } } \big ) } & { } \\ { + \mathbb { P } _ { \eta , \eta ^ { \prime } } \big ( \partial \tilde { \mathcal { M } } \mathrm { p e r f e c t l y ~ a l i g n s ~ w i t h ~ I n t } \tilde { \mathcal { P } } \big ) } & { } \\ { + \mathbb { P } _ { \eta , \eta ^ { \prime } } \big ( \partial \tilde { \mathcal { M } } \mathrm { p e r f e c t l y ~ a l i g n s ~ w i t h ~ } \partial \tilde { \mathcal { P } } \big ) } & { } \\ { = 0 } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
where the last equality arizes when combining the facts that Int $\mathcal { M } = \eta + \mathrm { I n t } \mathcal { M } = \mathrm { I n t } \left( \eta + \mathcal { M } \right) =$ Int $\tilde { \mathcal { M } }$ (and analogously for the boundary and $\mathcal { P }$ ), that the boundary and interiors of $\mathcal { M }$ and $\mathcal { P }$ are boundary free regular submanifolds of ${ \bar { \mathbb { R } } } ^ { d }$ without full dimension, and then applying the boundary free case of the proof. □
|
| 448 |
+
|
| 449 |
+
Proof of Lemma 3. Let $m = \dim { \mathcal { M } }$ and $p = \dim { \mathcal { P } }$ . We again consider first the case where $\mathcal { M }$ and $\mathcal { P }$ are manifolds without boundary. If $m + p < d$ , then ${ \mathcal { L } } = \emptyset$ so the statement is obviously true. If $m + p \geq d$ , then $\mathcal { M }$ and $\mathcal { P }$ intersect transversally. This implies that $\mathcal { L }$ is a manifold of dimension $m + p - d < m , p$ . Since $\mathcal { L }$ is a submanifold of both $\mathcal { M }$ and $\mathcal { P }$ that has lower dimension, it has measure 0 on both of them.
|
| 450 |
+
|
| 451 |
+
We now tackle the case where $\mathcal { M }$ and $\mathcal { P }$ have boundaries. Let us remember that ${ \mathcal { M } } = \operatorname { I n t } { \mathcal { M } } \cup { \partial { \mathcal { M } } }$ and the union is disjoint (and analogously for $\mathcal { P }$ ). By using elementary properties of sets, we can trivially see that
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
{ \mathcal { L } } = { \mathcal { M } } \cap { \mathcal { P } } = ( { \mathrm { I n t } } { \mathcal { M } } \cap { \mathrm { I n t } } \mathscr { P } ) \cup ( { \mathrm { I n t } } { \mathcal { M } } \cap \partial { \mathcal { P } } ) \cup ( \partial { \mathcal { M } } \cap { \mathrm { I n t } } \mathscr { P } ) \cup ( \partial { \mathcal { M } } \cap \partial { \mathcal { P } } )
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
where the unions are disjoint. This is the disjoint union of 4 strictly lower dimensional manifolds, by using the first part of the proof. Since each one of these intersections has measure 0 on either the interior or boundary of $\mathcal { M }$ (again, by the first part of the proof), and interior and boundary are contained in $\mathcal { M }$ , each one of the four intersections has measure 0 in $\mathcal { M }$ . Analogously, they have measure 0 in $\mathcal { P }$ , and by a simple union bound we see that $\mathcal { L }$ has measure 0 in $\mathcal { M }$ and $\mathcal { P }$ finishing the remaining case of the proof. □
|
| 458 |
+
|
| 459 |
+
Proof of Theorem 3.1. We first need to show that $\mathbb { P } _ { X + \epsilon }$ is absolutely continuous. Let $A$ be a Borel set with Lebesgue measure 0. Then, by the fact that $\epsilon$ and $X$ are independent, we know by Fubini
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\begin{array} { l l l } { \mathbb { P } _ { X + \epsilon } \mathopen { } \mathclose \bgroup \left( A \aftergroup \egroup \right) = \biggr \rvert _ { \mathbb { R } ^ { d } } \mathbb { P } _ { \epsilon } \mathopen { } \mathclose \bgroup \left( A - x \aftergroup \egroup \right) \mathrm { d } \mathbb { P } _ { X } \mathopen { } \mathclose \bgroup \left( x \aftergroup \egroup \right) } \\ { \qquad = \biggr \rvert _ { \mathbb { R } ^ { d } } 0 \mathrm { d } \mathbb { P } _ { X } \mathopen { } \mathclose \bgroup \left( x \aftergroup \egroup \right) = 0 } \end{array}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
Where we used the fact that if $A$ has Lebesgue measure zero, then so does $A - x$ and since $\mathbb { P } _ { \epsilon }$ is absolutely continuous, $\mathbb { P } _ { \epsilon } ( A - x ) = 0$ .
|
| 466 |
+
|
| 467 |
+
Now we calculate the density of $\mathbb { P } _ { X + \epsilon }$ . Again, by using the independence of $X$ and $\epsilon$ , for any Borel set $B$ we know
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\begin{array} { l l } { \displaystyle \mathbb { P } _ { X + \epsilon } ( B ) = \int _ { \mathbb { R } ^ { d } } \mathbb { P } _ { \epsilon } ( B - y ) \mathrm { d } \mathbb { P } _ { X } ( y ) } \\ { \displaystyle \quad \quad = \mathbb { E } _ { y \sim \mathbb { P } _ { X } } \left[ \mathbb { P } _ { \epsilon } ( B - y ) \right] } \\ { \displaystyle \quad = \mathbb { E } _ { y \sim \mathbb { P } _ { \epsilon } } \left[ \int _ { B - y } P _ { \epsilon } ( x ) d x \right] } \\ { \displaystyle \quad \quad = \mathbb { E } _ { y \sim \mathbb { P } _ { z } } \left[ \int _ { B } P _ { \epsilon } ( x - y ) d x \right] } \\ { \displaystyle \quad = \int _ { B } \mathbb { E } _ { y \sim \mathbb { P } _ { z } } \left[ P _ { \epsilon } ( x - y ) \right] d x } \end{array}
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
Therefore, $\begin{array} { r } { \mathbb { P } _ { X + \epsilon } ( B ) = \int _ { B } P _ { X + \epsilon } ( x ) d x } \end{array}$ for our proposed $P _ { X + \epsilon }$ and all Borel sets $B$ . By the uniqueness of the Radon-Nikodym theorem, this implies the proposed $P _ { X + \epsilon }$ is the density of $\mathbb { P } _ { X + \epsilon }$ . The equivalence of the formula changing the expectation for $\ b { \int _ { \mathcal { M } } \mathbb { P } _ { X } }$ is trivial by the definition of expectation and the fact that the support of $\mathbb { P } _ { X }$ lies on $\mathcal { M }$ . □
|
| 474 |
+
|
| 475 |
+
# B FURTHER CLARIFICATIONS
|
| 476 |
+
|
| 477 |
+
In this appendix we further explain some of the terms and ideas mentioned in the paper, which due to space constrains, and to keep the flow of the paper, couldn’t be extremely developed in the main text. Some of these have to do with notation, others with technical elements of the proofs. On the latter case, we try to convey more intuition than we previously could. We present these clarifications in a very informal fashion in the following item list.
|
| 478 |
+
|
| 479 |
+
• There are two different but very related properties a random variable can have. A random variable $X$ is said to be continuous if $P ( { \bar { X } } { \bar { = } } x ) = 0$ for all single points $x \in \mathcal { X }$ . Note that a random variable concentrated on a low dimensional manifold such as a plane can have this property. However, an absolutely continuous random variable has the following property: if a set $A$ has Lebesgue measure 0, then $P ( X \in A ) = 0$ . Since points have measure 0 with the Lebesgue measure, absolute continuity implies continuity. A random variable that’s supported on a low dimensional manifold therefore will not be absolutely continuous: let $\mathcal { M }$ a low dimensional manifold be the support of $X$ . Since a low dimensional manifold has 0 Lebesgue measure, this would imply $P ( X \in M ) = 0$ , which is an absurd since $\mathcal { M }$ was the support of $X$ . The property of $X$ being absolutely continuous can be shown to be equivalent to $X$ having a density: the existence of a function $f : \mathcal { X } \mathbb { R }$ such that $\textstyle P ( X \in { \bar { A } } ) = \int _ { A } f ( x ) \operatorname { d } x$ (this is a consequence of the Radon-Nikodym theorem).
|
| 480 |
+
|
| 481 |
+
The annoying part is that in everyday paper writing when we talk about continuous random variables, we omit the ”absolutely” word to keep the text concise and actually talk about absolutely continuous random variables (ones that have a density), this is done through almost all sciences and throughout mathematics as well, annoying as it is. However we made the clarification in here since it’s relevant to our paper not to mistake the two terms.
|
| 482 |
+
|
| 483 |
+
• The notation $\mathbb { P } _ { r } [ D ( x ) = 1 ] = 1$ is the abbreviation of $\mathbb { P } _ { r } [ \{ x \in \mathcal { X } : D ( x ) = 1 \} ] = 1$ for a measure $\mathbb { P } _ { r }$ . Another way of expressing this more formally is $\mathbb { P } _ { r } [ D ^ { - 1 } ( 1 ) ] = 1$ .
|
| 484 |
+
|
| 485 |
+
• In the proof of Theorem 2.1, the distance between sets $d ( A , B )$ is defined as the usual distance between sets in a metric space
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
d ( A , B ) = \operatorname* { i n f } _ { x \in A , y \in B } d ( x , y )
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
where $d ( x , y )$ is the distance between points (in our case the Euclidean distance).
|
| 492 |
+
|
| 493 |
+
• Note that not everything that’s outside of the support of $\mathbb { P } _ { r }$ has to be a generated image. Generated images are only things that lie in the support of $\mathbb { P } _ { g }$ , and there are things that don’t need to be in the support of either $\mathbb { P } _ { r }$ or $\mathbb { P } _ { g }$ (these could be places where $0 < D < 1$ for example). This is because the discriminator is not trained to discriminate $\mathbb { P } _ { r }$ from all things that are not $\mathbb { P } _ { r }$ , but to distinguish $\mathbb { P } _ { r }$ from $\mathbb { P } _ { g }$ . Points that don’t lie in the support of $\mathbb { P } _ { r }$ or $\mathbb { P } _ { g }$ are not important to the performance of the discriminator (as is easily evidenced in its cost). Why we define accuracy 1 as is done in the text is to avoid the identification of a single ‘tight’ support, since this typically leads to problems (if I take a measure 0 set from any support it still is the support of the distribution). In the end, what we aim for is:
|
| 494 |
+
|
| 495 |
+
– We want $D ( x ) = 1$ with probability 1 when $x \sim \mathbb { P } _ { r }$ .
|
| 496 |
+
– We want $D ( x ) = 0$ with probability 1 when $x \sim \mathbb { P } _ { g }$ .
|
| 497 |
+
– Whatever happens elsewhere is irrelevant (as it is also reflected by the cost of the discriminator)
|
| 498 |
+
|
| 499 |
+
• We say that a discriminator $D ^ { * }$ is optimal for $g _ { \theta }$ (or its corresponding $\mathbb { P } _ { g }$ ) if for all measurable functions $D : \mathcal { X } [ 0 , 1 ]$ we have
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
L ( D ^ { * } , g _ { \boldsymbol { \theta } } ) \geq L ( D , g _ { \boldsymbol { \theta } } )
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
for $L$ defined as in equation (1).
|
md/train/Hk4dFjR5K7/Hk4dFjR5K7.md
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADEF: AN ITERATIVE ALGORITHM TO CONSTRUCT ADVERSARIAL DEFORMATIONS
|
| 2 |
+
|
| 3 |
+
Rima Alaifari
|
| 4 |
+
Department of Mathematics
|
| 5 |
+
ETH Zurich
|
| 6 |
+
rima.alaifari@math.ethz.ch
|
| 7 |
+
|
| 8 |
+
Giovanni S. Alberti Department of Mathematics University of Genoa alberti@dima.unige.it
|
| 9 |
+
|
| 10 |
+
Tandri Gauksson
|
| 11 |
+
Department of Mathematics
|
| 12 |
+
ETH Zurich
|
| 13 |
+
tandri.gauksson@math.ethz.ch
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
While deep neural networks have proven to be a powerful tool for many recognition and classification tasks, their stability properties are still not well understood. In the past, image classifiers have been shown to be vulnerable to so-called adversarial attacks, which are created by additively perturbing the correctly classified image. In this paper, we propose the ADef algorithm to construct a different kind of adversarial attack created by iteratively applying small deformations to the image, found through a gradient descent step. We demonstrate our results on MNIST with convolutional neural networks and on ImageNet with Inception-v3 and ResNet-101.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
In a first observation in Szegedy et al. (2013) it was found that deep neural networks exhibit unstable behavior to small perturbations in the input. For the task of image classification this means that two visually indistinguishable images may have very different outputs, resulting in one of them being misclassified even if the other one is correctly classified with high confidence. Since then, a lot of research has been done to investigate this issue through the construction of adversarial examples: given a correctly classified image $x$ , we look for an image $y$ which is visually indistinguishable from $x$ but is misclassified by the network. Typically, the image $y$ is constructed as $y = x + r$ , where $r$ is an adversarial perturbation that is supposed to be small in a suitable sense (normally, with respect to an $\ell ^ { p \ }$ norm). Several algorithms have been developed to construct adversarial perturbations, see Goodfellow et al. (2014); Moosavi Dezfooli et al. (2016); Kurakin et al. (2017b); Madry et al. (2018); Carlini & Wagner (2017b) and the review paper Akhtar & Mian (2018).
|
| 22 |
+
|
| 23 |
+
Even though such pathological cases are very unlikely to occur in practice, their existence is relevant since malicious attackers may exploit this drawback to fool classifiers or other automatic systems. Further, adversarial perturbations may be constructed in a black-box setting (i.e., without knowing the architecture of the DNN but only its outputs) (Papernot et al., 2017; Moosavi-Dezfooli et al., 2017) and also in the physical world (Kurakin et al., 2017b; Athalye & Sutskever, 2017; Brown et al., 2017; Sharif et al., 2016). This has motivated the investigation of defenses, i.e., how to make the network invulnerable to such attacks, see Kurakin et al. (2017a); Carlini & Wagner (2017a); Madry et al. (2018); Tramer et al. (2018); Wong & Kolter (2018); Raghunathan et al. (2018); Athalye et al. \` (2018); Kannan et al. (2018). In most cases, adversarial examples are artificially created and then used to retrain the network, which becomes more stable under these types of perturbations.
|
| 24 |
+
|
| 25 |
+
Most of the work on the construction of adversarial examples and on the design of defense strategies has been conducted in the context of small perturbations $r$ measured in the $\ell ^ { \infty }$ norm. However, this is not necessarily a good measure of image similarity: e.g., for two translated images $x$ and $y$ , the norm of $x - y$ is not small in general, even though $x$ and $y$ will look indistinguishable if the translation is small. Several papers have investigated the construction of adversarial perturbations not designed
|
| 26 |
+
|
| 27 |
+
for norm proximity (Rozsa et al., 2016; Sharif et al., 2016; Brown et al., 2017; Engstrom et al., 2017;
|
| 28 |
+
Xiao et al., 2018).
|
| 29 |
+
|
| 30 |
+
In this work, we build up on these ideas and investigate the construction of adversarial deformations. In other words, the misclassified image $y$ is not constructed as an additive perturbation $y = x + r$ , but as a deformation $y = x \circ ( { \mathrm { i d } } + \tau )$ , where $\tau$ is a vector field defining the transformation. In this case, the similarity is not measured through a norm of $y - x$ , but instead through a norm of $\tau$ , which quantifies the deformation between $y$ and $x$ .
|
| 31 |
+
|
| 32 |
+
We develop an efficient algorithm for the construction of adversarial deformations, which we call ADef. It is based on the main ideas of DeepFool (Moosavi Dezfooli et al., 2016), and iteratively constructs the smallest deformation to misclassify the image. We test the procedure on MNIST (LeCun) (with convolutional neural networks) and on ImageNet (Russakovsky et al., 2015) (with Inception-v3 (Szegedy et al., 2016) and ResNet-101 (He et al., 2016)). The results show that ADef can succesfully fool the classifiers in the vast majority of cases (around $9 9 \%$ ) by using very small and imperceptible deformations. We also test our adversarial attacks on adversarially trained networks for MNIST. Our implementation of the algorithm can be found at https://gitlab.math. ethz.ch/tandrig/ADef.
|
| 33 |
+
|
| 34 |
+
The results of this work have initially appeared in the master’s thesis Gauksson (2017), to which we refer for additional details on the mathematical aspects of this construction. While writing this paper, we have come across Xiao et al. (2018), in which a similar problem is considered and solved with a different algorithm. Whereas in Xiao et al. (2018) the authors use a second order solver to find a deforming vector field, we show how a first order method can be formulated efficiently and justify a smoothing operation, independent of the optimization step. We report, for the first time, success rates for adversarial attacks with deformations on ImageNet. The topic of deformations has also come up in Jaderberg et al. (2015), in which the authors introduce a class of learnable modules that deform inputs in order to increase the performance of existing DNNs, and Fawzi & Frossard (2015), in which the authors introduce a method to measure the invariance of classifiers to geometric transformations.
|
| 35 |
+
|
| 36 |
+
# 2 ADVERSARIAL DEFORMATIONS
|
| 37 |
+
|
| 38 |
+
# 2.1 ADVERSARIAL PERTURBATIONS
|
| 39 |
+
|
| 40 |
+
Let $\kappa$ be a classifier of images consisting of $P$ pixels into $L \geq 2$ categories, i.e. a function from the space of images $X = \mathbb { R } ^ { c P }$ , where $c = 1$ (for grayscale images) or $c = 3$ (for color images), and into the set of labels $\mathcal { L } = \{ 1 , \ldots , L \}$ . Suppose $x \in X$ is an image that is correctly classified by $\kappa$ and suppose $y \in X$ is another image that is imperceptible from $x$ and such that $\kappa ( y ) \neq \kappa ( x )$ , then $y$ is said to be an adversarial example. The meaning of imperceptibility varies, but generally, proximity in $\ell ^ { p \ }$ -norm (with $1 \leq p \leq \infty )$ is considered to be a sufficient substitute. Thus, an adversarial perturbation for an image $x \in X$ is a vector $r \in X$ such that $\boldsymbol { \mathcal { K } } ( \boldsymbol { x } + \boldsymbol { r } ) \neq \boldsymbol { \mathcal { K } } ( \boldsymbol { x } )$ and $\| r \| _ { p }$ is small, where
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\left\| r \right\| _ { p } = \left( \sum _ { j = 1 } ^ { c P } \left| r _ { j } \right| ^ { p } \right) ^ { 1 / p } \quad { \mathrm { i f ~ } } 1 \leq p < \infty { \mathrm { , ~ a n d } } \quad \left\| r \right\| _ { \infty } = \operatorname* { m a x } _ { j = 1 , \ldots , c P } \left| r _ { j } \right| .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Given such a classifier $\kappa$ and an image $x$ , an adversary may attempt to find an adversarial example $y$ by minimizing $\| x - y \| _ { p }$ subject to $\mathcal { K } ( y ) \neq \mathcal { K } ( x )$ , or even subject to $\boldsymbol { \mathcal { K } } ( \boldsymbol { y } ) = \boldsymbol { k }$ for some target label $k \neq \mathcal { K } ( x )$ . Different methods for finding minimal adversarial perturbations have been proposed, most notably FGSM (Goodfellow et al., 2014) and PGD (Madry et al., 2018) for $\ell ^ { \infty }$ , and the DeepFool algorithm (Moosavi Dezfooli et al., 2016) for general $\ell ^ { p \ }$ -norms.
|
| 47 |
+
|
| 48 |
+
# 2.2 DEFORMATIONS
|
| 49 |
+
|
| 50 |
+
Instead of constructing adversarial perturbations, we intend to fool the classifier by small deformations of correctly classified images. Our procedure is in the spirit of the DeepFool algorithm. Before we explain it, let us first clarify what we mean by a deformation of an image. The discussion is at first more intuitive if we model images as functions $\xi : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { c }$ (with $c = 1$ or $c = 3$ ) instead of discrete vectors $x$ in $\mathbb { R } ^ { c P }$ . In this setting, perturbing an image $\xi : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { c }$ corresponds to adding to it another function $\rho : [ 0 , 1 ] ^ { 2 } \to { \breve { \mathbb { R } } } ^ { c }$ with a small $L ^ { p }$ -norm.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 1: First row: The original $2 8 \times 2 8$ pixel image from the MNIST database, and the same image translated by $( - 2 , 1 )$ , rotated by an angle of $1 0 ^ { \circ }$ , and deformed w.r.t. an arbitrary smooth vector field $\tau$ . The $\ell ^ { \infty }$ -norm of the corresponding perturbation is shown under each deformed image. The pixel values range from 0 (white) to 1 (black), so the deformed images all lie far from the original image in the $\ell ^ { \infty }$ -norm. Second row: The vector fields corresponding to the above deformations and their $T$ -norms (cf. equation (3)).
|
| 54 |
+
|
| 55 |
+
While any transformation of an image $\xi$ can be written as a perturbation $\xi + \rho$ , we shall restrict ourselves to a particular class of transformations. A deformation with respect to a vector field $\tau : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { \dot { 2 } }$ is a transformation of the form $\xi \mapsto \xi ^ { \tau }$ , where for any image $\xi : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { c }$ , the image $\bar { \xi ^ { \tau } } : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { c }$ is defined by
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\xi ^ { \tau } ( u ) = \xi \left( u + \tau ( u ) \right) \quad \mathrm { f o r \ a l l } u \in [ 0 , 1 ] ^ { 2 } ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
extending $\xi$ by zero outside of $[ 0 , 1 ] ^ { 2 }$ . Deformations capture many natural image transformations. For example, a translation of the image $\xi$ by a vector $v \in \mathbb { R } ^ { 2 }$ is a deformation with respect to the constant vector field $\tau = v$ . If $v$ is small, the images $\xi$ and $\xi ^ { v }$ may look similar, but the corresponding perturbation $\rho = \xi ^ { v } - \xi$ may be arbitrarily large in the aforementioned $L ^ { p }$ -norms. Figure 1 shows three minor deformations, all of which yield large $L ^ { \infty }$ -norms.
|
| 62 |
+
|
| 63 |
+
In the discrete setting, deformations are implemented as follows. We consider square images of $W \times W$ pixels and define the space of images to be $\boldsymbol { X } = \left( \mathbb { R } ^ { W \times W } \right) ^ { c }$ . A discrete vector field is a function $\tau : \{ 1 , \dots , W \} ^ { 2 } \to \mathbb { R } ^ { 2 }$ . In what follows we will only consider the set $T$ of vector fields that do not move points on the grid $\{ 1 , \ldots , W \} ^ { 2 }$ outside of $[ 1 , { \dot { W } } ] ^ { 2 }$ . More precisely,
|
| 64 |
+
|
| 65 |
+
$T : = \{ \tau : \{ 1 , \dots , W \} ^ { 2 } \to \mathbb { R } ^ { 2 } \mid \tau ( s , t ) + ( s , t ) \in [ 1 , W ] ^ { 2 }$ r all $s , t \in \{ 1 , \ldots , W \} \}$
|
| 66 |
+
|
| 67 |
+
An image $x \in X$ can be viewed as the collection of values of a function $\xi : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { c }$ on a regular grid $\left\{ 1 / ( W + 1 ) , \ldots , W { \big / } ( W + 1 ) \right\} ^ { 2 } \subseteq [ 0 , 1 ] ^ { 2 }$ , i.e. $x _ { s , t } = \xi \big ( s / ( W + 1 ) , t / ( W + 1 ) \big )$ for $s , t = 1 , \dots , W$ . Such a function $\xi$ can be computed by interpolating from $x$ . Thus, the deformation of an image $x$ with respect to the discrete vector field $\tau$ can be defined as the discrete deformed image $x ^ { \tau }$ in $X$ by
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
x _ { s , t } ^ { \tau } = \xi \left( \frac { ( s , t ) + \tau ( s , t ) } { W + 1 } \right) , \qquad s , t \in \{ 1 , \ldots , W \} .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
It is not straightforward to measure the size of a deformation such that it captures the visual difference between the original image $x$ and its deformed counterpart $x ^ { \tau }$ . We will use the size of the
|
| 74 |
+
|
| 75 |
+
corresponding vector field, $\tau$ , in the norm defined by
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\left\| \tau \right\| _ { T } = \operatorname* { m a x } _ { s , t = 1 , \ldots , W } \left\| \tau ( s , t ) \right\| _ { 2 }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
as a proxy. The $\ell ^ { p \ }$ -norms defined in (1), adapted to vector fields, can be used as well. (We remark, however, that none of these norms define a distance between $x$ and $x ^ { \tau }$ , since two vector fields $\tau , \sigma \in T$ with $\| \tau \| _ { T } \neq \| \sigma \| _ { T }$ may produce the same deformed image $x ^ { \tau } = x ^ { \sigma }$ .)
|
| 82 |
+
|
| 83 |
+
# 2.3 THE ALGORITHM ADEF
|
| 84 |
+
|
| 85 |
+
We will now describe our procedure for finding deformations that will lead a classifier to yield an output different from the original label.
|
| 86 |
+
|
| 87 |
+
Let $F = ( F _ { 1 } , \dots , F _ { L } ) : X \to \mathbb { R } ^ { L }$ be the underlying model for the classifier $\kappa$ , such that
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\ K ( x ) = \underset { k = 1 , \ldots , L } { \arg \operatorname* { m a x } } F _ { k } ( x ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Let $x \in X$ be the image of interest and fix $\xi : [ 0 , 1 ] ^ { 2 } \to \mathbb { R } ^ { c }$ obtained by interpolation from $x$ . Let $l = \kappa ( x )$ denote the true label of $x$ , let $k \in \mathcal { L }$ be a target label and set $f = F _ { k } - F _ { l }$ . We assume that $x$ does not lie on a decision boundary, so that we have $f ( x ) < 0$ .
|
| 94 |
+
|
| 95 |
+
We define the function $g : T \mathbb { R } , \tau \mapsto f ( x ^ { \tau } )$ and note that $g ( 0 ) = f ( x ^ { 0 } ) = f ( x ) < 0$ . Our goal is to find a small vector field $\tau \in T$ such that $g ( \tau ) = f ( x ^ { \tau } ) \geq 0$ . We can use a linear approximation of $g$ around the zero vector field as a guide:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
g ( \tau ) \approx g ( 0 ) + ( \mathrm { D } _ { 0 } g ) \tau
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
for small enough $\tau \in T$ and $D _ { 0 } g : T \mathbb { R }$ the derivative of $g$ at $\tau = 0$ . Hence, if $\tau$ is a vector field such that
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
( \mathrm { D } _ { 0 } g ) \tau = - g ( 0 )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
and $\| \tau \| _ { T }$ is small, then the classifier $\kappa$ has approximately equal confidence for the deformed image $x ^ { \tau }$ to have either label $l$ or $k$ . This is a scalar equation with unknown in $T$ , and so has infinitely many solutions. In order to select $\tau$ with small norm, we solve it in the least-squares sense.
|
| 108 |
+
|
| 109 |
+
In view of (2), we have $\begin{array} { r } { \frac { \partial x ^ { \tau } } { \partial \tau } | _ { \tau = 0 } ( s , t ) = \frac { 1 } { W + 1 } \nabla \xi \left( \frac { ( s , t ) } { W + 1 } \right) \in \mathbb { R } ^ { c \times 2 } } \end{array}$ . Thus, by applying the chain rule to $g ( \tau ) = f ( x ^ { \tau } )$ , we obtain that its derivative at $\tau = 0$ can, with a slight abuse of notation, be identified with the vector field
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathrm { D } _ { 0 } g ( s , t ) = \frac { 1 } { W + 1 } \big ( \nabla f ( x ) \big ) _ { s , t } \nabla \xi \left( \frac { ( s , t ) } { W + 1 } \right) ,
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $\left( \nabla f ( x ) \right) _ { s , t } \in \mathbb { R } ^ { 1 \times c }$ is the derivative of $f$ in $x$ calculated at $( s , t )$ . With this, $( \mathrm Ḋ 0 Ḍ _ { 0 } g ) \tau$ stands for $\begin{array} { r } { \sum _ { s , t = 1 } ^ { W } \operatorname { D } _ { 0 } g ( s , t ) \cdot \tau ( s , t ) } \end{array}$ , and the solution to (5) in the least-square sense is given by
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\tau = - \frac { f ( x ) } { \sum _ { s , t = 1 } ^ { W } | \mathrm { D } _ { 0 } g ( s , t ) | ^ { 2 } } \operatorname { D } _ { 0 } g .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
Finally, we define the deformed image $x ^ { \tau } \in X$ according to (2).
|
| 122 |
+
|
| 123 |
+
One might like to impose some degree of smoothness on the deforming vector field. In fact, it suffices to search in the range of a smoothing operator $\mathcal { S } : T T$ . However, this essentially amounts to applying $s$ to the solution from the larger search space $T$ . Let $\alpha = \mathcal { S } ( \mathrm { D } _ { 0 } g ) = \varphi \ast ( \mathrm { D } _ { 0 } g )$ , where $s$ denotes the componentwise application of a two-dimensional Gaussian filter $\varphi$ (of any standard deviation). Then the vector field
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\tilde { \tau } = - \frac { f ( x ) } { \sum _ { s , t = 1 } ^ { W } | \alpha ( s , t ) | ^ { 2 } } S \alpha = - \frac { f ( x ) } { \sum _ { s , t = 1 } ^ { W } | \alpha ( s , t ) | ^ { 2 } } S ^ { 2 } ( \mathrm { D } _ { 0 } g )
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
also satisfies (5), since $s$ is self-adjoint. We can hence replace $\tau$ by $\tilde { \tau }$ to obtain a smooth deformation of the image $x$ .
|
| 130 |
+
|
| 131 |
+
We iterate the deformation process until the deformed image is misclassified. More explicitly, let $x ^ { ( 0 ) } = x$ and for $n \geq 1$ let $\tau ^ { ( n ) }$ be given by (7) for $x ^ { ( n - 1 ) }$ . Then we can define the iteration as $x ^ { ( n ) } = x ^ { ( n - 1 ) } \circ ( \operatorname { i d } + \tau ^ { ( n ) } )$ . The algorithm terminates and outputs an adversarial example $y = x ^ { ( n ) }$ if ${ \mathcal { K } } ( x ^ { ( n ) } ) \neq l$ . The iteration also terminates if $x ^ { ( n ) }$ lies on a decision boundary of $\kappa$ , in which case we propose to introduce an overshoot factor $1 + \eta$ on the total deforming vector field. Provided that the number of iterations is moderate, the total vector field can be well approximated by $\tau ^ { * } =$ $\tau ^ { ( 1 ) } + \cdot \cdot \cdot + \tau ^ { ( n ) }$ and the process can be altered to output the deformed image $y = x \circ ( \mathrm { i d } + ( 1 + \eta ) \tau ^ { * } )$ instead.
|
| 132 |
+
|
| 133 |
+
The target label $k$ may be chosen in each iteration to minimize the vector field to obtain a better approximation in the linearization (4). More precisely, for a candidate set of labels $k _ { 1 } , \ldots , k _ { m }$ , we compute the corresponding vectors fields $\tau _ { 1 } , \ldots , \tau _ { m }$ and select
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
k = \underset { j = 1 , \dots , m } { \arg \operatorname* { m i n } } \| \tau _ { j } \| _ { T } .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
The candidate set consists of the labels corresponding to the indices of the $m$ smallest entries of $F - F _ { l }$ , in absolute value.
|
| 140 |
+
|
| 141 |
+
# Algorithm ADef
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Input: Classification model F,image x,correct label l, candidate labels k1,..., km Output: Deformed image y Initializey←x</td></tr><tr><td>while C(y) = l do forj=1,..:,mdo</td></tr><tr><td>αj ←s(∑ (VFkj):-(VFi)i)·∀yi)</td></tr><tr><td>Fk(y)-F((y) Sαj Tj←1</td></tr><tr><td>1aj12 end for</td></tr><tr><td>i ← arg minj=-...,:m |lTjlltT</td></tr><tr><td>y←yo (id+Ti)</td></tr><tr><td>end while return y</td></tr></table>
|
| 144 |
+
|
| 145 |
+
By equation (6), provided that $\nabla f$ is moderate, the deforming vector field takes small values wherever $\xi$ has a small derivative. This means that the vector field will be concentrated on the edges in the image $x$ (see e.g. the first row of figure 2). Further, note that the result of a deformation is always a valid image in the sense that it does not violate the pixel value bounds. This is not guaranteed for the perturbations computed with DeepFool.
|
| 146 |
+
|
| 147 |
+
# 3 EXPERIMENTS
|
| 148 |
+
|
| 149 |
+
# 3.1 SETUP
|
| 150 |
+
|
| 151 |
+
We evaluate the performance of ADef by applying the algorithm to classifiers trained on the MNIST (LeCun) and ImageNet (Russakovsky et al., 2015) datasets. Below, we briefly describe the setup of the experiments and in tables 1 and 2 we summarize their results.
|
| 152 |
+
|
| 153 |
+
MNIST: We train two convolutional neural networks based on architectures that appear in Madry et al. (2018) and Tramer et al. (2018) respectively. The network MNIST-A consists of two convo- \` lutional layers of sizes $3 2 \times 5 \times 5$ and $6 4 \times 5 \times 5$ , each followed by $2 \times 2$ max-pooling and a rectifier activation function, a fully connected layer into dimension 1024 with a rectifier activation function, and a final linear layer with output dimension 10. The network MNIST-B consists of two convolutional layers of sizes $1 2 8 \times 3 \times 3$ and $6 4 \times 3 \times 3$ with a rectifier activation function, a fully connected layer into dimension 128 with a rectifier activation function, and a final linear layer with output dimension 10. During training, the latter convolutional layer and the former fully connected layer of MNIST-B are subject to dropout of drop probabilities $^ 1 / 4$ and $^ 1 / 2$ . We use ADef to produce adversarial deformations of the images in the test set. The algorithm is configured to pursue any label different from the correct label (all incorrect labels are candidate labels). It performs smoothing by a Gaussian filter of standard deviation $^ 1 / 2$ , uses bilinear interpolation to obtain intermediate pixel intensities, and it overshoots by $\eta = 2 / 1 0$ whenever it converges to a decision boundary.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 2: Sample deformations for the Inception-v3 model. The vector fields and perturbations have been amplified for visualization. First row: An image from the ILSVRC2012 validation set, the output of ADef with a Gaussian filter of standard deviation 1, the corresponding vector field and perturbation. The rightmost image is a close-up of the vector field around the nose of the ape. Second row: A larger deformation of the same image, obtained by using a wider Gaussian filter (standard deviation 6) for smoothing.
|
| 157 |
+
|
| 158 |
+
ImageNet: We apply ADef to pretrained Inception-v3 (Szegedy et al., 2016) and ResNet-101 (He et al., 2016) models to generate adversarial deformations for the images in the ILSVRC2012 validation set. The images are preprocessed by first scaling so that the smaller axis has 299 pixels for the Inception model and 224 pixels for ResNet, and then they are center-cropped to a square image. The algorithm is set to focus only on the label of second highest probability. It employs a Gaussian filter of standard deviation 1, bilinear interpolation, and an overshoot factor $\eta = 1 / \bar { 1 0 }$ .
|
| 159 |
+
|
| 160 |
+
We only consider inputs that are correctly classified by the model in question, and, since $\tau ^ { * } =$ $\tau ^ { ( 1 ) } + \cdot \cdot + \tau ^ { ( n ) }$ approximates the total deforming vector field, we declare ADef to be successful if its output is misclassified and $\| \tau ^ { * } \| _ { T } \leq \varepsilon$ , where we choose $\varepsilon = 3$ . Observe that, by (3), a deformation with respect to a vector field $\tau$ does not displace any pixel further away from its original position than $\| \tau \| _ { T }$ . Hence, for high resolution images, the choice $\varepsilon = 3$ indeed produces small deformations if the vector fields are smooth. In appendix A, we illustrate how the success rate of ADef depends on the choice of $\varepsilon$ .
|
| 161 |
+
|
| 162 |
+
When searching for an adversarial example, one usually searches for a perturbation with $\ell ^ { \infty }$ -norm smaller than some small number $\varepsilon > 0$ . Common choices of $\varepsilon$ range from $^ { 1 / 1 0 }$ to $^ { 3 / 1 0 }$ for MNIST classifiers (Goodfellow et al., 2014; Madry et al., 2018; Wong & Kolter, 2018; Tramer et al., 2018;\` Kannan et al., 2018) and $^ { 2 / 2 5 5 }$ to $^ { 1 6 } / 2 5 5$ for ImageNet classifiers (Goodfellow et al., 2014; Kurakin et al., 2017a; Tramer et al., 2018; Kannan et al., 2018). Table 1 shows that on average, the pertur- \` bations obtained by ADef are quite large compared to those constraints. However, as can be seen in figure 2, the relatively high resolution images of the ImageNet dataset can be deformed into adversarial examples that, while corresponding to large perturbations, are not visibly different from the original images. In appendices B and C, we give more examples of adversarially deformed images.
|
| 163 |
+
|
| 164 |
+
Table 2: Success rates for PGD and ADef attacks on adversarially trained networks.
|
| 165 |
+
inal Target: 0 Target: 1 Target: 2 Target: 3 Target: 4 Target: 5 Target: 6 Target: 7 Target
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Model</td><td>Adv. training</td><td>Accuracy</td><td>PGD success</td><td>ADef success</td></tr><tr><td rowspan="2">MNIST-A</td><td>PGD</td><td>98.36%</td><td>5.81%</td><td>6.67%</td></tr><tr><td>ADef</td><td>98.95%</td><td>100.00%</td><td>54.16%</td></tr><tr><td rowspan="2">MNIST-B</td><td>PGD</td><td>98.74%</td><td>5.84%</td><td>20.35%</td></tr><tr><td>ADef</td><td>98.79%</td><td>100.00%</td><td>45.07%</td></tr></table>
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Targeted ADef against MNIST-A. First row: The original image and deformed images produced by restricting ADef to the target labels 0 to 8. The $\ell ^ { \infty }$ -norms of the corresponding perturbations are shown under the deformed images. Second row: The vector fields corresponding to the deformations and their $T$ -norms.
|
| 171 |
+
|
| 172 |
+
# 3.2 ADVERSARIAL TRAINING
|
| 173 |
+
|
| 174 |
+
In addition to training MNIST-A and MNIST-B on the original MNIST data, we train independent copies of the networks using the adversarial training procedure described by Madry et al. (2018). That is, before each step of the training process, the input images are adversarially perturbed using the PGD algorithm. This manner of training provides increased robustness against adversarial perturbations of low $\ell ^ { \infty }$ -norm. Moreover, we train networks using ADef instead of PGD as an adversary. In table 2 we show the results of attacking these adversarially trained networks, using ADef on the one hand, and PGD on the other. We use the same configuration for ADef as above, and for PGD we use 40 iterations, step size $^ 1 / 1 0 0$ and $^ { 3 } / 1 0$ as the maximum $\ell ^ { \infty }$ -norm of the perturbation. Interestingly, using these configurations, the networks trained against PGD attacks are more resistant to adversarial deformations than those trained against ADef.
|
| 175 |
+
|
| 176 |
+
# 3.3 TARGETED ATTACKS
|
| 177 |
+
|
| 178 |
+
ADef can also be used for targeted adversarial attacks, by restricting the deformed image to have a particular target label instead of any label which yields the optimal deformation. Figure 3 demonstrates the effect of choosing different target labels for a given MNIST image, and figure 4 shows the result of targeting the label of lowest probability for an image from the ImageNet dataset.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Untargeted vs. targeted attack on the ResNet-101 model. An image from the ILSVRC2012 validation set deformed to the labels of second highest (first row) and lowest (second row) probabilities (out of 1,000) for the original image. The vector fields and perturbations have been amplified for visualization.
|
| 182 |
+
|
| 183 |
+
# 4 CONCLUSION
|
| 184 |
+
|
| 185 |
+
In this work, we proposed a new efficient algorithm, ADef, to construct a new type of adversarial attacks for DNN image classifiers. The procedure is iterative and in each iteration takes a gradient descent step to deform the previous iterate in order to push to a decision boundary.
|
| 186 |
+
|
| 187 |
+
We demonstrated that with almost imperceptible deformations, state-of-the art classifiers can be fooled to misclassify with a high success rate of ADef. This suggests that networks are vulnerable to different types of attacks and that simply training the network on a specific class of adversarial examples might not form a sufficient defense strategy. Given this vulnerability of neural networks to deformations, we wish to study in future work how ADef can help for designing possible defense strategies. Furthermore, we also showed initial results on fooling adversarially trained networks. Remarkably, PGD trained networks on MNIST are more resistant to adversarial deformations than ADef trained networks. However, for this result to be more conclusive, similar tests on ImageNet will have to be conducted. We wish to study this in future work.
|
| 188 |
+
|
| 189 |
+
# ACKNOWLEDGMENTS
|
| 190 |
+
|
| 191 |
+
The authors would like to thank Helmut Bolcskei and Thomas Wiatowski for fruitful discussions. ¨
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
N. Akhtar and A. Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. IEEE Access, 6:14410–14430, 2018. doi: 10.1109/ACCESS.2018.2807385.
|
| 196 |
+
|
| 197 |
+
Anish Athalye and Ilya Sutskever. Synthesizing robust adversarial examples. arXiv preprint arXiv:1707.07397, 2017.
|
| 198 |
+
|
| 199 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
|
| 200 |
+
|
| 201 |
+
Tom B Brown, Dandelion Mane, Aurko Roy, Mart ´ ´ın Abadi, and Justin Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017.
|
| 202 |
+
|
| 203 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 3–14. ACM, 2017a.
|
| 204 |
+
|
| 205 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy (SP), pp. 39–57. IEEE, 2017b.
|
| 206 |
+
|
| 207 |
+
Logan Engstrom, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. A Rotation and a Translation Suffice: Fooling CNNs with Simple Transformations. arXiv preprint arXiv:1712.02779, 2017.
|
| 208 |
+
|
| 209 |
+
Alhussein Fawzi and Pascal Frossard. Manitest: Are classifiers really invariant? arXiv preprint arXiv:1507.06535, 2015.
|
| 210 |
+
|
| 211 |
+
Tandri Gauksson. Adversarial perturbations and deformations for convolutional neural networks. https://www.research-collection.ethz.ch/handle/20.500. 11850/258550/, 2017.
|
| 212 |
+
|
| 213 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 214 |
+
|
| 215 |
+
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 (CVPR), pp. 770–778, 2016.
|
| 216 |
+
|
| 217 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2017–2025. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5854-spatial-transformer-networks.pdf.
|
| 218 |
+
|
| 219 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing. arXiv preprint arXiv:1803.06373, 2018.
|
| 220 |
+
|
| 221 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In International Conference on Learning Representations, 2017a.
|
| 222 |
+
|
| 223 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In International Conference on Learning Representations, 2017b.
|
| 224 |
+
|
| 225 |
+
Yann LeCun. The MNIST database of handwritten digits. http://yann.lecun.com/exdb/ mnist/.
|
| 226 |
+
|
| 227 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ rJzIBfZAb.
|
| 228 |
+
|
| 229 |
+
S. M. Moosavi-Dezfooli, A. Fawzi, O. Fawzi, and P. Frossard. Universal adversarial perturbations. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 86–94, July 2017. doi: 10.1109/CVPR.2017.17.
|
| 230 |
+
|
| 231 |
+
Seyed Mohsen Moosavi Dezfooli, Alhussein Fawzi, and Pascal Frossard. DeepFool: a simple and accurate method to fool deep neural networks. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), number EPFL-CONF-218057, 2016.
|
| 232 |
+
|
| 233 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, pp. 506–519. ACM, 2017.
|
| 234 |
+
|
| 235 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id=Bys4ob-Rb.
|
| 236 |
+
|
| 237 |
+
Andras Rozsa, Ethan M Rudd, and Terrance E Boult. Adversarial diversity and hard positive generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 25–32, 2016.
|
| 238 |
+
|
| 239 |
+
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.
|
| 240 |
+
|
| 241 |
+
Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 1528–1540. ACM, 2016.
|
| 242 |
+
|
| 243 |
+
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.
|
| 244 |
+
|
| 245 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818–2826, 2016.
|
| 246 |
+
|
| 247 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick\` McDaniel. Ensemble adversarial training: Attacks and defenses. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rkZvSe-RZ.
|
| 248 |
+
|
| 249 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning, 2018.
|
| 250 |
+
|
| 251 |
+
Chaowei Xiao, Jun-Yan Zhu, Bo Li, Warren He, Mingyan Liu, and Dawn Song. Spatially transformed adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ HyydRMZC-.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 5: The (normalized) distribution of $\| \tau ^ { * } \| _ { T }$ from the MNIST experiments. Deformations that fall to the left of the vertical line at $\varepsilon = 3$ are considered successful. The networks in the first column were trained using the original MNIST data, and the networks in the second and third columns were adversarially trained using ADef and PGD, respectively.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure 6: The (normalized) distribution of $\| \tau ^ { * } \| _ { T }$ from the ImageNet experiments. Deformations that fall to the left of the vertical line at $\varepsilon = 3$ are considered successful.
|
| 258 |
+
|
| 259 |
+
# A DISTRIBUTION OF VECTOR FIELD NORMS
|
| 260 |
+
|
| 261 |
+
Figures 5 and 6 show the distribution of the norms of the total deforming vector fields, $\tau ^ { * }$ , from the experiments in section 3. For networks that have not been adversarially trained, most deformations fall well below the threshold of $\epsilon = 3$ . Out of the adversarially trained networks, only MNIST-A trained against PGD is truly robust against ADef. Further, a comparison between the first column of figure 5 and figure 6 indicates that ImageNet is much more vulnerable to adversarial deformations than MNIST, also considering the much higher resolution of the images in ImageNet. Thus, it would be very interesting to study the performance of ADef with adversarially trained network for ImageNet, as mentioned in the Conclusion.
|
| 262 |
+
|
| 263 |
+
Table 3: The results of applying ADef to the images in the ILSVRC2012 validation set and the Inception model, using different values for the standard deviation $\sigma$ of the Gaussian filter. As before, we define ADef to be successful if $\| \tau ^ { * } \| _ { T } \le 3$ .
|
| 264 |
+
|
| 265 |
+
<table><tr><td>0</td><td>ADef success</td><td>Avg.|/t*|t</td><td>Avg. IIrlla</td><td>Avg. # iterations</td></tr><tr><td>0</td><td>99.12%</td><td>0.5272</td><td>0.1628</td><td>5.247</td></tr><tr><td>1</td><td>98.94%</td><td>0.5984</td><td>0.2039</td><td>4.050</td></tr><tr><td>2</td><td>95.91%</td><td>0.7685</td><td>0.2573</td><td>3.963</td></tr><tr><td>4</td><td>86.66%</td><td>0.9632</td><td>0.3128</td><td>4.379</td></tr><tr><td>8</td><td>67.54%</td><td>1.1684</td><td>0.3687</td><td>5.476</td></tr></table>
|
| 266 |
+
|
| 267 |
+
# B SMOOTH DEFORMATIONS
|
| 268 |
+
|
| 269 |
+
The standard deviation of the Gaussian filter used for smoothing in the update step of ADef has significant impact on the resulting vector field. To explore this aspect of the algorithm, we repeat the experiment from section 3 on the Inception-v3 model, using standard deviations $\sigma = 0 , 1 , 2 , 4 , 8$ (where $\sigma = 0$ stands for no smoothing). The results are shown in table 3, and the effect of varying $\sigma$ is illustrated in figures 7 and 8. We observe that as $\sigma$ increases, the adversarial distortion steadily increases both in terms of vector field norm and perturbation norm. Likewise, the success rate of ADef decreases with larger $\sigma$ . However, from figure 8 we see that the constraint $\| \tau ^ { * } \| _ { T } \le 3$ on the total vector field may provide a rather conservative measure of the effectiveness of ADef in the case of smooth high dimensional vector fields.
|
| 270 |
+
|
| 271 |
+
# C ADDITIONAL DEFORMED IMAGES
|
| 272 |
+
|
| 273 |
+
# C.1 MNIST
|
| 274 |
+
|
| 275 |
+
Figures 9 and 10 show adversarial deformations for the models MNIST-A and MNIST-B, respectively. The attacks are performed using the same configuration as in the experiments in section 3. Observe that in some cases, features resembling the target class have appeared in the deformed image. For example, the top part of the 4 in the fifth column of figure 10 has been curved slightly to more resemble a 9.
|
| 276 |
+
|
| 277 |
+
# C.2 IMAGENET
|
| 278 |
+
|
| 279 |
+
Figures 11 – 15 show additional deformed images resulting from attacking the Inception-v3 model using the same configuration as in the experiments in section 3. Similarly, figures 16 – 20 show deformed images resulting from attacking the ResNet-10 model. However, in order to increase variability in the output labels, we perform a targeted attack, targeting the label of 50th highest probability.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 7: The effects of increasing the smoothness parameter $\sigma$ on adversarial deformations for Inception-v3. First and fourth rows: A correctly classified image and deformed versions. Second and fifth rows: The corresponding deforming vector fields and their $T$ -norms. Third and sixth rows: The corresponding perturbations and their $\ell ^ { \infty }$ norms.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 8: The effects of increasing the smoothness parameter $\sigma$ on adversarial deformations for Inception-v3. Note that according to the criterion $\Vert \tau ^ { * } \Vert _ { T } \leq 3$ , the value $\sigma = 8$ yields an unsuccessful deformation of the recreational vehicle.
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\begin{array} { r } { \frac { 1 } { 2 } \boxed { 2 } \boxed { 1 } \boxed { 2 } \boxed { 1 } \boxed { 6 } \boxed { 4 } \boxed { 7 } \boxed { 4 } \boxed { 4 } \boxed { 7 } \boxed { 2 } \boxed { 4 } \boxed { 5 } \boxed { 7 } } \\ { \frac { 1 } { 2 } \boxed { 2 } \boxed { 2 } \boxed { 7 } \boxed { 6 } \boxed { 6 } \boxed { 6 } \boxed { 7 } \boxed { 7 } \boxed { 7 } \boxed { 4 } \boxed { 7 } \boxed { 6 } \boxed { 7 } \boxed { 7 } } \\ { \frac { 1 } { 2 \times 1 0 } \boxed { 6 } \boxed { 7 } \boxed { 7 } \boxed { 0 } \boxed { 1 } \boxed { 5 } \boxed { 9 } \boxed { 7 } \boxed { 7 } \boxed { 2 } \boxed { 7 } \boxed { 3 } \boxed { 4 } \boxed { 7 } \boxed { 7 } } \\ { \vdots \boxed { 7 } \boxed { 7 } \boxed { 7 } \boxed { 7 } \boxed { 7 } \boxed { 1 } \boxed { 1 } \boxed { 5 } \boxed { 9 } \boxed { 7 } \boxed { 7 } \boxed { 3 } \boxed { 4 } \boxed { 7 } } \\ { \vdots \boxed { 7 } \boxed { 6 } \boxed { 7 } \boxed { 7 } \boxed { 5 } \boxed { 1 } \boxed { 5 } \boxed { 7 } \boxed { 7 } \boxed { 7 } \boxed { 3 } \boxed { 7 } \boxed { 4 } \boxed { 7 } \boxed { 7 } \boxed { 7 } \boxed { 7 } } \end{ 1 } \end{array}
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
Figure 9: Adversarial deformations for MNIST-A. First and third rows: Original images from the MNIST test set. Second and fourth rows: The deformed images and the norms of the corresponding deforming vector fields.
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\begin{array} { c } \frac { 1 } { 2 } [ \begin{array} { c c c c c c c c } { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } \\ { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 2 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & { { \frac { 1 } { 4 } } } & \frac { 1 } 4 \end{array} \end{array}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
Figure 10: Adversarial deformations for MNIST-B. Note that image 9 in row 3 is misclassified, and is then deformed to its correct label.
|
| 298 |
+
|
| 299 |
+
Original: water bottle
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
|
| 303 |
+
Deformed: oil filter
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
T : 0.028
|
| 307 |
+
|
| 308 |
+
Original: sea cucumber
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
|
| 312 |
+
Deformed: chiton
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
T : 0.584
|
| 316 |
+
|
| 317 |
+
Original: reflex camera
|
| 318 |
+
|
| 319 |
+
Deformed: projector
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 11: ADef attacks on the Inception-v3 model using the same configuration as in the experiments in section 3.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
T : 0.548
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 12: ADef attacks on the Inception-v3 model using the same configuration as in the experiments in section 3.
|
| 329 |
+
|
| 330 |
+
Original: water tower
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
|
| 334 |
+
Deformed: chime
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
|
| 338 |
+
T : 2.791
|
| 339 |
+
|
| 340 |
+
Original: pelican
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
|
| 344 |
+
Deformed: bath towel
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
T : 0.906
|
| 348 |
+
|
| 349 |
+
Original: reflex camera
|
| 350 |
+
|
| 351 |
+
Deformed: Polaroid camera
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 13: ADef attacks on the Inception-v3 model using the same configuration as in the experiments in section 3.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
T : 0.061
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 14: ADef attacks on the Inception-v3 model using the same configuration as in the experiments in section 3.
|
| 361 |
+
|
| 362 |
+
Original: tobacco shop
|
| 363 |
+
|
| 364 |
+
Deformed: bookshop
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 15: ADef attacks on the Inception-v3 model using the same configuration as in the experiments in section 3.
|
| 368 |
+
|
| 369 |
+
Original: sewing machine
|
| 370 |
+
|
| 371 |
+
Deformed: paper towel
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
|
| 377 |
+
T : 1.139
|
| 378 |
+
|
| 379 |
+
Original: starfish
|
| 380 |
+
|
| 381 |
+
Deformed: electric ray
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
|
| 387 |
+
T : 1.505
|
| 388 |
+
|
| 389 |
+
Original: freight car
|
| 390 |
+
|
| 391 |
+
Deformed: triceratops
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 16: ADef attacks on the ResNet-101 model targeting the 50th most likely label.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
T : 1.270
|
| 398 |
+
|
| 399 |
+
Original: parachute
|
| 400 |
+
|
| 401 |
+
Deformed: golfcart
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
|
| 407 |
+
T : 1.060
|
| 408 |
+
|
| 409 |
+
Original: Christmas stocking
|
| 410 |
+
|
| 411 |
+
Deformed: crane
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
|
| 417 |
+
T : 0.995
|
| 418 |
+
|
| 419 |
+
Original: sock
|
| 420 |
+
|
| 421 |
+
Deformed: ice cream
|
| 422 |
+
|
| 423 |
+

|
| 424 |
+
Figure 17: ADef attacks on the ResNet-101 model targeting the 50th most likely label.
|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
T : 1.233
|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
Figure 18: ADef attacks on the ResNet-101 model targeting the 50th most likely label.
|
| 431 |
+
|
| 432 |
+
Original: mousetrap
|
| 433 |
+
|
| 434 |
+
Deformed: perfume
|
| 435 |
+
|
| 436 |
+

|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
|
| 440 |
+
T : 0.904
|
| 441 |
+
|
| 442 |
+
Original: pillow
|
| 443 |
+
|
| 444 |
+
Deformed: electric guitar
|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
|
| 450 |
+
T : 0.588
|
| 451 |
+
|
| 452 |
+
Original: pickup
|
| 453 |
+
|
| 454 |
+
Deformed: projector
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
Figure 19: ADef attacks on the ResNet-101 model targeting the 50th most likely label.
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
T : 0.922
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
Figure 20: ADef attacks on the ResNet-101 model targeting the 50th most likely label.
|
md/train/Hk9Xc_lR-/Hk9Xc_lR-.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/HkeGhoA5FX/HkeGhoA5FX.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RESIDUAL NON-LOCAL ATTENTION NETWORKS FOR IMAGE RESTORATION
|
| 2 |
+
|
| 3 |
+
Yulun Zhang1, Kunpeng $\mathbf { L i } ^ { 1 }$ , Kai $\mathbf { L i } ^ { 1 }$ , Bineng Zhong2 & Yun $\mathbf { F u ^ { 1 , 3 } }$
|
| 4 |
+
|
| 5 |
+
1Department of ECE, Northeastern University, Boston, MA 02115, USA 2School of Computer Science and Technology, Huaqiao University, Xiamen 362100, China 3College of CIS, Northeastern University, Boston, MA 02115, USA {yulun100,kinpeng.li.1994,li.kai.gml}@gmail.com, bnzhong@hqu.edu.cn,yunfu@ece.neu.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In this paper, we propose a residual non-local attention network for high-quality image restoration. Without considering the uneven distribution of information in the corrupted images, previous methods are restricted by local convolutional operation and equal treatment of spatial- and channel-wise features. To address this issue, we design local and non-local attention blocks to extract features that capture the long-range dependencies between pixels and pay more attention to the challenging parts. Specifically, we design trunk branch and (non-)local mask branch in each (non-)local attention block. The trunk branch is used to extract hierarchical features. Local and non-local mask branches aim to adaptively rescale these hierarchical features with mixed attentions. The local mask branch concentrates on more local structures with convolutional operations, while non-local attention considers more about long-range dependencies in the whole feature map. Furthermore, we propose residual local and non-local attention learning to train the very deep network, which further enhance the representation ability of the network. Our proposed method can be generalized for various image restoration applications, such as image denoising, demosaicing, compression artifacts reduction, and super-resolution. Experiments demonstrate that our method obtains comparable or better results compared with recently leading methods quantitatively and visually.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Image restoration aims to recover high-quality (HQ) images from their corrupted low-quality (LQ) observations and plays a fundamental role in various high-level vision tasks. It is a typical ill-posed problem due to the irreversible nature of the image degradation process. Some most widely studied image restoration tasks include image denoising, demosaicing, and compression artifacts reduction. By distinctively modelling the restoration process from LQ observations to HQ objectives, i.e., without assumption for a specific restoration task when modelling, these tasks can be uniformly addressed in the same framework. Recently, deep convolutional neural network (CNN) has shown extraordinary capability of modelling various vision problems, ranging from low-level (e.g., image denoising (Zhang et al., 2017a), compression artifacts reduction (Dong et al., 2015), and image super-resolution (Kim et al., 2016; Lai et al., 2017; Tai et al., 2017; Lim et al., 2017; Zhang et al., 2018a; Haris et al., 2018; Wang et al., 2018c; Zhang et al., 2018b; Wang et al., 2018b)) to high-level (e.g., image recognition (He et al., 2016)) vision applications.
|
| 14 |
+
|
| 15 |
+
Stacked denoising auto-encoder (Vincent et al., 2008) is one of the best well-known CNN based model for image restoration. Dong et al. proposed SRCNN (Dong et al., 2014) for image superresolution and ARCNN (Dong et al., 2015) for image compression artifacts reduction. Both SRCNN and ARCNN achieved superior performance against previous works. By introducing residual learning to ease the training difficulty for deeper network, Zhang et al. proposed DnCNN (Zhang et al., 2017a) for image denoising and compression artifacts reduction. The denoiser prior was lately introduced in IRCNN (Zhang et al., 2017b) for fast image restoration. Mao et al. proposed a very deep fully convolutional encoding-decoding framework with symmetric skip connections for image restoration (Mao et al., 2016). Tai et al. later proposed a very deep end-to-end persistent memory network (MemNet) for image restoration (Tai et al., 2017) and achieved promising results. These CNN based methods have demonstrated the great ability of CNN for image restoration tasks.
|
| 16 |
+
|
| 17 |
+
However, there are mainly three issues in the existing CNN based methods above. First, the receptive field size of these networks is relatively small. Most of them extract features in a local way with convolutional operation, which fails to capture the long-range dependencies between pixels in the whole image. A larger receptive field size allows to make better use of training inputs and more context information. This would be very helpful to capture the latent degradation model of LQ images, especially when the images suffer from heavy corruptions. Second, distinctive ability of these networks is also limited. Let’s take image denoising as an example. For a noisy image, the noise may appear in both the plain and textural regions. Noise removal would be easier in the plain area than that in the textural one. It is desired to make the denoising model focus on textual area more. However, most previous denoising methods neglect to consider different contents in the noisy input and treat them equally. This would result in over-smoothed outputs and some textural details would also fail to be recovered. Third, all channel-wise features are treated equally in those networks. This naive treatment lacks flexibility in dealing with different types of information (e.g., low- and high-frequency information). For a set of features, some contain more information related to HQ image and the others may contain more information related to corruptions. The interdependencies among channels should be considered for more accurate image restoration.
|
| 18 |
+
|
| 19 |
+
To address the above issues, we propose the very deep residual non-local attention networks (RNAN) for high-quality image restoration. We design residual local and non-local attention blocks as the basic building modules for the very deep network. Each attention block consists of trunk and mask branches. We introduce residual block (He et al., 2016; Lim et al., 2017) for trunk branch and extract hierarchical features. For mask branch, we conduct feature downscaling and upscaling with largestride convolution and deconvolution to enlarge receptive field size. Furthermore, we incorporate non-local block in the mask branch to obtain residual non-local mixed attention. We apply RNAN for various restoration tasks, including image denoising, demosaicing, and compression artifacts reduction. Extensive experiments show that our proposed RNAN achieves state-of-the-art results compared with other recent leading methods in all tasks. To the best of our knowledge, this is the first time to consider residual non-local attention for image restoration problems.
|
| 20 |
+
|
| 21 |
+
The main contributions of this work are three-fold:
|
| 22 |
+
|
| 23 |
+
• We propose the very deep residual non-local networks for high-quality image restoration. The powerful networks are based on our proposed residual local and non-local attention blocks, which consist of trunk and mask branches. The network obtains non-local mixed attention with non-local block in the mask branch. Such attention mechanis helps to learn local and non-local information from the hierarchical features. • We propose residual non-local attention learning to train very deep networks by preserving more low-level features, being more suitable for image restoration. Using non-local lowlevel and high-level attention from the very deep network, we can pursue better network representational ability and finally obtain high-quality image restoration results. We demonstrate with extensive experiments that our RNAN is powerful for various image restoration tasks. RNAN achieves superior results over leading methods for image denoising, demosaicing, compression artifacts reduction, and super-resolution. In addition, RNAN achieves superior performance with moderate model size and performs very fast.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Non-local prior. As a classical filtering algorithm, non-local means (Buades et al., 2005) is computed as weighted mean of all pixels of an image. Such operation allows distant pixels to contribute to the response of a position at a time. It was lately introduced in BM3D (Dabov et al., 2007b) for image denoising. Recently, Wang et al. (2018a) proposed non-local neural network by incorporating non-local operations in deep neural network for video classification. We can see that those methods mainly introduce non-local information in the trunk pipeline. Liu et al. (2018) proposed non-local recurrent network for image restoration. However, in this paper, we mainly focus on learning nonlocal attention to better guide feature extraction in trunk branch.
|
| 28 |
+
|
| 29 |
+
Attention mechanisms. Generally, attention can be viewed as a guidance to bias the allocation of available processing resources towards the most informative components of an input (Hu et al.,
|
| 30 |
+
|
| 31 |
+
2017). Recently, tentative works have been proposed to apply attention into deep neural networks (Wang et al., 2017; Hu et al., 2017). It’s usually combined with a gating function (e.g., sigmoid) to rescale the feature maps. Wang et al. (2017) proposed residual attention network for image classification with a trunk-and-mask attention mechanism. Hu et al. (2017) proposed squeezeand-excitation (SE) block to model channel-wise relationships to obtain significant performance improvement for image classification. In all, these works mainly aim to guide the network pay more attention to the regions of interested. However, few works have been proposed to investigate the effect of attention for image restoration tasks. Here, we want to enhances the network with distinguished power for noise and image content.
|
| 32 |
+
|
| 33 |
+
Image restoration architectures. Stacked denoising auto-encoder (Vincent et al., 2008) is one of the most well-known CNN-based image restoration method. (Dong et al., 2015) proposed ARCNN for image compression artifact reduction with several stacked convolutional layers. With the help of residual learning and batch normalization (Ioffe & Szegedy, 2015), Zhang et al. proposed DnCNN (Zhang et al., 2017a) for accurate image restoration and denoiser priors for image restoration in IRCNN (Zhang et al., 2017b). Recently, great progresses have been made in image restoration community, where Timofte et al. (Timofte et al., 2017), Ancuti et al. (Ancuti et al., 2018), and Blau et al. (Blau et al., 2018) lead the main competitions recently and achieved new research status and records. For example, Wang et al. (Wang et al., 2018c) proposed a fully progressive image SR approach. However, most methods are plain networks and neglect to use non-local information.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: The framework of our proposed residual non-local attention network for image restoration. ‘Conv’, ‘RNAB’, and ‘RAB’ denote convolutional layer, residual non-local attention block, and residual local attention block respectively. Here, we take image denoising as a task of interest.
|
| 37 |
+
|
| 38 |
+
# 3 RESIDUAL NON-LOCAL ATTENTION NETWORK FOR IMAGE RESTORATION
|
| 39 |
+
|
| 40 |
+
# 3.1 FRAMEWORK
|
| 41 |
+
|
| 42 |
+
The framework of our proposed residual non-local attention network (RNAN) is shown in Figure 1. Let’s denote $I _ { L }$ and $I _ { H }$ as the low-quality (e.g., noisy, blurred, or compressed images) and highquality images. The reconstructed image $I _ { R }$ can be obtained by
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
I _ { R } = H _ { R N A N } \left( I _ { L } \right) ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $H _ { R N A N }$ denotes the function of our proposed RNAN. With the usage of global residual learning in pixel space, the main part of our network can concentrate on learning the degradation components (e.g., noisy, blurring, or compressed artifacts).
|
| 49 |
+
|
| 50 |
+
The first and last convolutional layers are shallow feature extractor and reconstruction layer respectively. We propose residual local and non-local attention blocks to extract hierarchical attentionaware features. In addition to making the main network learn degradation components, we further concentrate on more challenging areas by using local and non-local attention. We only incorporate residual non-local attention block in low-level and high-level feature space. This is mainly because a few non-local modules can well offer non-local ability to the network for image restoration.
|
| 51 |
+
|
| 52 |
+
Then RNAN is optimized with loss function. Several loss functions have been investigated, such as $L _ { 2 }$ (Mao et al., 2016; Zhang et al., 2017a; Tai et al., 2017; Zhang et al., 2017b), $L _ { 1 }$ (Lim et al., 2017; Zhang et al., 2018c), perceptual and adversarial losses (Ledig et al., 2017). To show the effectiveness of our RNAN, we choosprevious works. Given a training set the same loss fu, which contains ionlo .g., qua $L _ { 2 }$ loss function) as inputs and their $\left\{ I _ { L } ^ { i } , I _ { H } ^ { i } \right\} _ { i = 1 } ^ { N }$ $N$ high-quality counterparts. The goal of training RNAN is to minimize the $L _ { 2 }$ loss function
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
L \left( \Theta \right) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left| \left| H _ { R N A N } \left( I _ { L } ^ { i } \right) - I _ { H } ^ { i } \right| \right| _ { 2 } ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\lVert \cdot \rVert _ { 2 }$ denotes $l _ { 2 }$ norm. As detailed in Section 4, we use the same loss function as that in other compared methods. Such choice makes it clearer and more fair to see the effectiveness of our proposed RNAN. Then we give more details to residual local and non-local attention blocks.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Residual (non-)local attention block. It mainly consists of trunk branch (labelled with gray dashed) and mask branch (labelled with red dashed). The trunk branch consists of $t$ RBs. The mask branch is used to learning mixed attention maps in channel- and spatial-wise simultaneously.
|
| 62 |
+
|
| 63 |
+
# 3.2 RESIDUAL NON-LOCAL ATTENTION BLOCK
|
| 64 |
+
|
| 65 |
+
Our residual non-local attention network is constructed by stacking several residual local and nonlocal attention blocks shown in Figure 2. Each attention block is divided into two parts: $q$ residual blocks (RBs) in the beginning and end of attention block. Two branches in the middle part: trunk branch and mask branch. For non-local attention block, we incorporate non-local block (NLB) in the mask branch, resulting non-local attention. Then we give more details to those components.
|
| 66 |
+
|
| 67 |
+
# 3.2.1 TRUNK BRANCH
|
| 68 |
+
|
| 69 |
+
As shown in Figure 2, the trunk branch includes $t$ residual blocks (RBs). Different from the original residual block in ResNet (He et al., 2016), we adopt the simplified RB from (Lim et al., 2017). The simplified RB (labelled with blue dashed) only consists of two convolutional layers and one ReLU (Nair & Hinton, 2010), omitting unnecessary components, such as maxpooling and batch normalization (Ioffe & Szegedy, 2015) layers. We find that such simplified RB not only contributes to image super-resolution (Lim et al., 2017), but also helps to construct very deep network for other image restoration tasks.
|
| 70 |
+
|
| 71 |
+
Feature maps from trunk branch of different depths serve as hierarchical features. If attention mechanism is not considered, the proposed network would become a simplified ResNet. With mask branch, we can take channel and spatial attention to adaptively rescale hierarchical features. Then we give more details about local and non-local attention.
|
| 72 |
+
|
| 73 |
+
# 3.2.2 MASK BRANCH
|
| 74 |
+
|
| 75 |
+
As labelled with red dashed in Figure 2, the mask branches used in our network include local and non-local ones. Here, we mainly focus on local mask branch, which can become a non-local one by using non-local block (NLB, labelled with green dashed arrow).
|
| 76 |
+
|
| 77 |
+
The key point in mask branch is how to grasp information of larger scope, namely larger receptive field size, so that it’s possible to obtain more sophisticated attention map. One possible solution is to perform maxpooling several times, as used in (Wang et al., 2017) for image classification. However, more pixel-level accurate results are desired in image restoration. Maxpooling would lose lots of details of the image, resulting in bad performance. To alleviate such drawbacks, we choose to use large-stride convolution and deconvolution to enlarge receptive field size. Another way is considering non-local information across the whole inputs, which will be discussed in the next subsection.
|
| 78 |
+
|
| 79 |
+
From the input, large-stride (stride $\geq 2$ ) convolutional layer increases the receptive field size after $m$ RBs. After additional $2 m$ RBs, the downscaled feature maps are then expanded by a deconvolutional layer (also known as transposed convolutional layer). The upscaled features are further forwarded through $m$ RBs and one $1 \times 1$ convolutional layer. Then a sigmoid layer normalizes the output values, ranging in $[ 0 , 1 ]$ . Although the receptive field size of the mask branch is much larger than that of the trunk branch, it cannot cover the whole features at a time. This can be achieved by using non-local block (NLB), resulting in non-local mixed attention.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: Non-local block. Red dashed line denotes matrix reshaping. $H \times W \times C$ means $C$ features with height $H$ and width W. $\otimes$ denotes matrix multiplication. $\oplus$ denotes element-wise addition.
|
| 83 |
+
|
| 84 |
+
# 3.2.3 NON-LOCAL MIXED ATTENTION
|
| 85 |
+
|
| 86 |
+
As discussed above, convolution operation processes one local neighbourhood at a time. In order to obtain better attention maps, here we seek to take all the positions into consideration at a time. Inspired by classical non-local means method (Buades et al., 2005) and non-local neural networks (Wang et al., 2018a), we incorporate non-local block (NLB) into the mask branch to obtain non-local mixed attention (shown in Figure 3). The non-local operation can be defined as
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
y _ { i } = \left( \sum _ { \forall j } f ( x _ { i } , x _ { j } ) g ( x _ { j } ) \right) / \sum _ { \forall j } f ( x _ { i } , x _ { j } ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $i$ is the output feature position index and $j$ is the index that enumerates all possible positions. $x$ and $y$ are the input and output of non-local operation. The pairwise function $f ( x _ { i } , x _ { j } )$ computes relationship between $x _ { i }$ and $x _ { j }$ . The function $g ( x _ { j } )$ computes a representation of the input at the position $j$ .
|
| 93 |
+
|
| 94 |
+
As shown in Figure 3, we use embedded Gaussian function to evaluate the pairwise relationship
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
f ( x _ { i } , x _ { j } ) = e x p ( u ( x _ { i } ) ^ { T } v ( x _ { j } ) ) = e x p ( ( W _ { u } x _ { i } ) ^ { T } W _ { v } x _ { j } ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $W _ { u }$ and $W _ { v }$ are weight matrices. As investigated in (Wang et al., 2018a), there are several versions of $f$ , such as Gaussian function, dot product similarity, and feature concatenation. We also consider a linear embedding for $g$ : $g ( x _ { j } ) = W _ { g } x _ { j }$ with weight matrix $W _ { g }$ . Then the output $z$ at position $i$ of non-local block (NLB) is calculated as
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
z _ { i } = W _ { z } y _ { i } + x _ { i } = W _ { z } s o f t m a x ( ( W _ { u } x _ { i } ) ^ { T } W _ { v } x _ { j } ) g ( x _ { j } ) + x _ { i } ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $W _ { z }$ is a weight matrix. For a given $i$ , $\textstyle \sum _ { \forall j } f ( x _ { i } , x _ { j } ) / \sum _ { \forall j } f ( x _ { i } , x _ { j } )$ in Eq. 3 becomes the softmax computation along dimension $j$ . The residual connection allows us to insert the NLB into pretrained networks (Wang et al., 2018a) by initializing $W _ { z }$ as zero.
|
| 107 |
+
|
| 108 |
+
With non-local and local attention computation, feature maps in the mask branch are finally mapped by sigmoid function
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
f _ { m i x } ( x _ { i , c } ) = \frac { 1 } { 1 + e x p ( - x _ { i , c } ) } ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $i$ ranges over spatial positions and $c$ ranges over feature channel positions. Such simple sigmoid operation is applied to each channel and spatial position, resulting mixed attention (Wang et al., 2017). As a result, the mask branch with non-local block can produce non-local mixed attention. However, simple multiplication between features from trunk and mask branches is not powerful enough or proper to form very deep trainable network. We propose residual non-local attention learning to solve those problems.
|
| 115 |
+
|
| 116 |
+
# 3.3 RESIDUAL NON-LOCAL ATTENTION LEARNING
|
| 117 |
+
|
| 118 |
+
How to train deep image restoration network with non-local mixed attention remains unclear. Here we only consider the trunk and mask branches, and residual connection with them (Figure 2). We focus on obtaining non-local attention information from the input feature $x$ . It should be noted that one form of attention residual learning was proposed in Wang et al. (2017), whose formulation is
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
H _ { R N A } ( x ) = H _ { t r u n k } ( x ) ( H _ { m a s k } ( x ) + 1 ) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
We find that this form of attention learning is not suitable for image restoration tasks. This is mainly because Eq. 7 is more suitable for high-level vision tasks (e.g., image classification), where low-level features are not preserved too much. However, low-level features are more important for image restoration. As a result, we propose a simple yet more suitable residual attention learning method by introducing input feature $x$ directly. We compute its output $H _ { R N A } ( x )$ as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
H _ { R N A } ( x ) = H _ { t r u n k } ( x ) H _ { m a s k } ( x ) + x ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $H _ { t r u n k } ( x )$ and $H _ { m a s k } ( x )$ denote the functions of trunk and mask branches respectively. Such residual learning tends to preserve more low-level features and allows us to form very deep networks for high-quality image restoration tasks with stronger representation ability.
|
| 131 |
+
|
| 132 |
+
# 3.4 IMPLEMENTATION DETAILS
|
| 133 |
+
|
| 134 |
+
Now, we specify the implementation details of our proposed RNAN. We use 10 residual local and non-local attention blocks (2 non-local one). In each residual (non-)local block, we set $q , t , m =$ $2 , 2 , 1$ . We set $3 \times 3$ as the size of all convolutional layers except for those in non-local block and convolutional layer before sigmoid function, where the kernel size is $1 \times 1$ . Features in RBs have 64 filters, except for that in the non-local block (see Figure 3), where $C = 3 2$ . In each training batch, 16 low-quality (LQ) patches with the size of $4 8 \times 4 8$ are extracted as inputs. Our model is trained by ADAM optimizer (Kingma & Ba, 2014) with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , and $\epsilon = 1 0 ^ { - 8 }$ . The initial learning rate is set to $1 0 ^ { - 4 }$ and then decreases to half every $2 \times 1 0 ^ { 5 }$ iterations of back-propagation. We use PyTorch (Paszke et al., 2017) to implement our models with a Titan $\mathrm { X p }$ GPU.
|
| 135 |
+
|
| 136 |
+
# 4 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
We apply our proposed RNAN to three classical image restoration tasks: image denoising, demosaicing, and compression artifacts reduction. For image denoising and demosaicing, we follow the same setting as IRCNN (Zhang et al., 2017b). For image compression artifacts reduction, we follow the same setting as ARCNN (Dong et al., 2015). We use 800 training images in DIV2K (Timofte et al., 2017; Agustsson & Timofte, 2017) to train all of our models. For each task, we use commonly used dataset for testing and report PSNR and/or SSIM (Wang et al., 2004) to evaluate the results of each method. More results are shown in Appendix A.
|
| 139 |
+
|
| 140 |
+
Table 1: Ablation study of different components. PSNR values are based on Urban100 $\scriptstyle { \overbrace { \boldsymbol { \sigma } } = 3 0 } $ .
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Case Index</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td></tr><tr><td>Mask Branch</td><td>X</td><td>X</td><td>X</td><td>?</td><td>√</td><td>√</td><td>?</td><td>√</td></tr><tr><td>Non-local Block</td><td>×</td><td></td><td>√</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RAB Number</td><td>7</td><td>7</td><td>5</td><td>5</td><td>1</td><td>2</td><td>5</td><td>8</td></tr><tr><td>RNABNumber</td><td>0</td><td>0</td><td>2</td><td>2</td><td>1</td><td>2</td><td>1</td><td>2</td></tr><tr><td>PSNR (dB)</td><td>30.96</td><td>31.17</td><td>31.20</td><td>31.32</td><td>30.78</td><td>30.99</td><td>31.27</td><td>31.50</td></tr></table>
|
| 143 |
+
|
| 144 |
+
# 4.1 ABLATION STUDY
|
| 145 |
+
|
| 146 |
+
We show ablation study in Table 1 to investigate the effects of different components in RNAN.
|
| 147 |
+
|
| 148 |
+
Non-local Mixed Attention. In cases 1, all the mask branches and non-local blocks are removed. In case 4, we enable non-local mixed attention with same block number as in case 1. The positive effect of non-local mixed attention is demonstrated by its obvious performance improvement.
|
| 149 |
+
|
| 150 |
+
Mask branch. We also learn that mask branch contributes to performance improvement, no matter non-local blocks are used (cases 3 and 4) or not (cases 1 and 2). This’s mainly because mask branch provides informative attention to the network, gaining better representational ability.
|
| 151 |
+
|
| 152 |
+
Non-local block. Non-local block also contributes to the network ability obviously, no matter mask branches are used (cases 2 and 4) or not (cases 1 and 3). With non-local information from low-level and high-level features, RNAN performs better image restoration.
|
| 153 |
+
|
| 154 |
+
Block Number. When comparing cases 2, 4, and 7, we learn that more non-local blocks achieve better results. However, the introduction of non-local block consumes much time. So we use 2 non-local blocks by considering low- and high-level features. When RNAB number is fixed in cases 5 and 7 or cases 6 and 8, performance also benefits from more RABs.
|
| 155 |
+
|
| 156 |
+
Table 2: Quantitative results about color image denoising. Best results are highlighted.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=4>Kodak24</td><td rowspan=1 colspan=4>BSD68</td><td rowspan=1 colspan=4>Urban100</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td></tr><tr><td rowspan=1 colspan=1>CBM3D</td><td rowspan=1 colspan=1>36.57</td><td rowspan=1 colspan=1>30.89</td><td rowspan=1 colspan=1>28.63</td><td rowspan=1 colspan=1>27.27</td><td rowspan=1 colspan=1>35.91</td><td rowspan=1 colspan=1>29.73</td><td rowspan=1 colspan=1>27.38</td><td rowspan=1 colspan=1>26.00</td><td rowspan=1 colspan=1>36.00</td><td rowspan=1 colspan=1>30.36</td><td rowspan=1 colspan=1>27.94</td><td rowspan=1 colspan=1>26.31</td></tr><tr><td rowspan=1 colspan=1>TNRD</td><td rowspan=1 colspan=1>34.33</td><td rowspan=1 colspan=1>28.83</td><td rowspan=1 colspan=1>27.17</td><td rowspan=1 colspan=1>24.94</td><td rowspan=1 colspan=1>33.36</td><td rowspan=1 colspan=1>27.64</td><td rowspan=1 colspan=1>25.96</td><td rowspan=1 colspan=1>23.83</td><td rowspan=1 colspan=1>33.60</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>25.52</td><td rowspan=1 colspan=1>22.63</td></tr><tr><td rowspan=1 colspan=1>RED</td><td rowspan=1 colspan=1>34.91</td><td rowspan=1 colspan=1>29.71</td><td rowspan=1 colspan=1>27.62</td><td rowspan=1 colspan=1>26.36</td><td rowspan=1 colspan=1>33.89</td><td rowspan=1 colspan=1>28.46</td><td rowspan=1 colspan=1>26.35</td><td rowspan=1 colspan=1>25.09</td><td rowspan=1 colspan=1>34.59</td><td rowspan=1 colspan=1>29.02</td><td rowspan=1 colspan=1>26.40</td><td rowspan=1 colspan=1>24.74</td></tr><tr><td rowspan=1 colspan=1>DnCNN</td><td rowspan=1 colspan=1>36.98</td><td rowspan=1 colspan=1>31.39</td><td rowspan=1 colspan=1>29.16</td><td rowspan=1 colspan=1>27.64</td><td rowspan=1 colspan=1>36.31</td><td rowspan=1 colspan=1>30.40</td><td rowspan=1 colspan=1>28.01</td><td rowspan=1 colspan=1>26.56</td><td rowspan=1 colspan=1>36.21</td><td rowspan=1 colspan=1>30.28</td><td rowspan=1 colspan=1>28.16</td><td rowspan=1 colspan=1>26.17</td></tr><tr><td rowspan=1 colspan=1>MemNet</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>29.67</td><td rowspan=1 colspan=1>27.65</td><td rowspan=1 colspan=1>26.40</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>28.39</td><td rowspan=1 colspan=1>26.33</td><td rowspan=1 colspan=1>25.08</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>28.93</td><td rowspan=1 colspan=1>26.53</td><td rowspan=1 colspan=1>24.93</td></tr><tr><td rowspan=1 colspan=1>IRCNN</td><td rowspan=1 colspan=1>36.70</td><td rowspan=1 colspan=1>31.24</td><td rowspan=1 colspan=1>28.93</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>36.06</td><td rowspan=1 colspan=1>30.22</td><td rowspan=1 colspan=1>27.86</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>35.81</td><td rowspan=1 colspan=1>30.28</td><td rowspan=1 colspan=1>27.69</td><td rowspan=1 colspan=1>N/A</td></tr><tr><td rowspan=1 colspan=1>FFDNet</td><td rowspan=1 colspan=1>36.81</td><td rowspan=1 colspan=1>31.39</td><td rowspan=1 colspan=1>29.10</td><td rowspan=1 colspan=1>27.68</td><td rowspan=1 colspan=1>36.14</td><td rowspan=1 colspan=1>30.31</td><td rowspan=1 colspan=1>27.96</td><td rowspan=1 colspan=1>26.53</td><td rowspan=1 colspan=1>35.77</td><td rowspan=1 colspan=1>30.53</td><td rowspan=1 colspan=1>28.05</td><td rowspan=1 colspan=1>26.39</td></tr><tr><td rowspan=1 colspan=1>RNAN (ours)</td><td rowspan=1 colspan=1>37.24</td><td rowspan=1 colspan=1>31.86</td><td rowspan=1 colspan=1>29.58</td><td rowspan=1 colspan=1>28.16</td><td rowspan=1 colspan=1>36.43</td><td rowspan=1 colspan=1>30.63</td><td rowspan=1 colspan=1>28.27</td><td rowspan=1 colspan=1>26.83</td><td rowspan=1 colspan=1>36.59</td><td rowspan=1 colspan=1>31.50</td><td rowspan=1 colspan=1>29.08</td><td rowspan=1 colspan=1>27.45</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 3: Quantitative results about gray-scale image denoising. Best results are highlighted.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=4>Kodak24</td><td rowspan=1 colspan=4>BSD68</td><td rowspan=1 colspan=4>Urban100</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>70</td></tr><tr><td rowspan=1 colspan=1>BM3D</td><td rowspan=1 colspan=1>34.39</td><td rowspan=1 colspan=1>29.13</td><td rowspan=1 colspan=1>26.99</td><td rowspan=1 colspan=1>25.73</td><td rowspan=1 colspan=1>33.31</td><td rowspan=1 colspan=1>27.76</td><td rowspan=1 colspan=1>25.62</td><td rowspan=1 colspan=1>24.44</td><td rowspan=1 colspan=1>34.47</td><td rowspan=1 colspan=1>28.75</td><td rowspan=1 colspan=1>25.94</td><td rowspan=1 colspan=1>24.27</td></tr><tr><td rowspan=1 colspan=1>TNRD</td><td rowspan=1 colspan=1>34.41</td><td rowspan=1 colspan=1>28.87</td><td rowspan=1 colspan=1>27.20</td><td rowspan=1 colspan=1>24.95</td><td rowspan=1 colspan=1>33.41</td><td rowspan=1 colspan=1>27.66</td><td rowspan=1 colspan=1>25.97</td><td rowspan=1 colspan=1>23.83</td><td rowspan=1 colspan=1>33.78</td><td rowspan=1 colspan=1>27.49</td><td rowspan=1 colspan=1>25.59</td><td rowspan=1 colspan=1>22.67</td></tr><tr><td rowspan=1 colspan=1>RED</td><td rowspan=1 colspan=1>35.02</td><td rowspan=1 colspan=1>29.77</td><td rowspan=1 colspan=1>27.66</td><td rowspan=1 colspan=1>26.39</td><td rowspan=1 colspan=1>33.99</td><td rowspan=1 colspan=1>28.50</td><td rowspan=1 colspan=1>26.37</td><td rowspan=1 colspan=1>25.10</td><td rowspan=1 colspan=1>34.91</td><td rowspan=1 colspan=1>29.18</td><td rowspan=1 colspan=1>26.51</td><td rowspan=1 colspan=1>24.82</td></tr><tr><td rowspan=1 colspan=1>DnCNN</td><td rowspan=1 colspan=1>34.90</td><td rowspan=1 colspan=1>29.62</td><td rowspan=1 colspan=1>27.51</td><td rowspan=1 colspan=1>26.08</td><td rowspan=1 colspan=1>33.88</td><td rowspan=1 colspan=1>28.36</td><td rowspan=1 colspan=1>26.23</td><td rowspan=1 colspan=1>24.90</td><td rowspan=1 colspan=1>34.73</td><td rowspan=1 colspan=1>28.88</td><td rowspan=1 colspan=1>26.28</td><td rowspan=1 colspan=1>24.36</td></tr><tr><td rowspan=1 colspan=1>MemNet</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>29.72</td><td rowspan=1 colspan=1>27.68</td><td rowspan=1 colspan=1>26.42</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>28.43</td><td rowspan=1 colspan=1>26.35</td><td rowspan=1 colspan=1>25.09</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>29.10</td><td rowspan=1 colspan=1>26.65</td><td rowspan=1 colspan=1>25.01</td></tr><tr><td rowspan=1 colspan=1>IRCNN</td><td rowspan=1 colspan=1>34.76</td><td rowspan=1 colspan=1>29.53</td><td rowspan=1 colspan=1>27.45</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>33.74</td><td rowspan=1 colspan=1>28.26</td><td rowspan=1 colspan=1>26.15</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>34.60</td><td rowspan=1 colspan=1>28.85</td><td rowspan=1 colspan=1>26.24</td><td rowspan=1 colspan=1>N/A</td></tr><tr><td rowspan=1 colspan=1>FFDNet</td><td rowspan=1 colspan=1>34.81</td><td rowspan=1 colspan=1>29.70</td><td rowspan=1 colspan=1>27.63</td><td rowspan=1 colspan=1>26.34</td><td rowspan=1 colspan=1>33.76</td><td rowspan=1 colspan=1>28.39</td><td rowspan=1 colspan=1>26.29</td><td rowspan=1 colspan=1>25.04</td><td rowspan=1 colspan=1>34.45</td><td rowspan=1 colspan=1>29.03</td><td rowspan=1 colspan=1>26.52</td><td rowspan=1 colspan=1>24.86</td></tr><tr><td rowspan=1 colspan=1>RNAN (ours)</td><td rowspan=1 colspan=1>35.20</td><td rowspan=1 colspan=1>30.04</td><td rowspan=1 colspan=1>27.93</td><td rowspan=1 colspan=1>26.60</td><td rowspan=1 colspan=1>34.04</td><td rowspan=1 colspan=1>28.61</td><td rowspan=1 colspan=1>26.48</td><td rowspan=1 colspan=1>25.18</td><td rowspan=1 colspan=1>35.52</td><td rowspan=1 colspan=1>30.20</td><td rowspan=1 colspan=1>27.65</td><td rowspan=1 colspan=1>25.89</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 4.2 COLOR AND GRAY IMAGE DENOISING
|
| 165 |
+
|
| 166 |
+
We compare our RNAN with state-of-the-art denoising methods: BM3D (Dabov et al., 2007b), CBM3D (Dabov et al., 2007a), TNRD (Chen & Pock, 2017), RED (Mao et al., 2016), DnCNN (Zhang et al., 2017a), MemNet (Tai et al., 2017), IRCNN (Zhang et al., 2017b), and FFDNet (Zhang et al., 2017c). Kodak24 (http://r0k.us/graphics/kodak/), BSD68 (Martin et al., 2001), and Urban100 (Huang et al., 2015) are used for color and gray-scale image denoising. AWGN noises of different levels (e.g., 10, 30, 50, and 70) are added to clean images.
|
| 167 |
+
|
| 168 |
+
Quantitative results are shown in Tables 2 and 3. As we can see that our proposed RNAN achieves the best results on all the datasets with all noise levels. Our proposed non-local attention covers the information from the whole image, which should be effective for heavy image denoising. To demonstrate this analysis, we take noise level $\sigma = 7 0$ as an example. We can see that our proposed RNAN achieves 0.48, 0.30, and 1.06 dB PSNR gains over the second best method FFDNet. This comparison strongly shows the effectiveness of our proposed non-local mixed attention.
|
| 169 |
+
|
| 170 |
+
We also show visual results in Figures 4 and 5. With the learned non-local mixed attention, RNAN treats different image parts distinctively, alleviating over-smoothing artifacts obviously.
|
| 171 |
+
|
| 172 |
+
Table 4: Quantitative results about color image demosaicing. Best results are highlighted.
|
| 173 |
+
|
| 174 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=2>McMaster18</td><td rowspan=1 colspan=2>Kodak24</td><td rowspan=1 colspan=2>BSD68</td><td rowspan=1 colspan=2>Urban100</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=1 colspan=1>Mosaiced</td><td rowspan=1 colspan=1>9.17</td><td rowspan=1 colspan=1>0.1674</td><td rowspan=1 colspan=1>8.56</td><td rowspan=1 colspan=1>0.0682</td><td rowspan=1 colspan=1>8.43</td><td rowspan=1 colspan=1>0.0850</td><td rowspan=1 colspan=1>7.48</td><td rowspan=1 colspan=1>0.1195</td></tr><tr><td rowspan=1 colspan=1>IRCNN</td><td rowspan=1 colspan=1>37.47</td><td rowspan=1 colspan=1>0.9615</td><td rowspan=1 colspan=1>40.41</td><td rowspan=1 colspan=1>0.9807</td><td rowspan=1 colspan=1>39.96</td><td rowspan=1 colspan=1>0.9850</td><td rowspan=1 colspan=1>36.64</td><td rowspan=1 colspan=1>0.9743</td></tr><tr><td rowspan=1 colspan=1>RNAN (ours)</td><td rowspan=1 colspan=1>39.71</td><td rowspan=1 colspan=1>0.9725</td><td rowspan=1 colspan=1>43.09</td><td rowspan=1 colspan=1>0.9902</td><td rowspan=1 colspan=1>42.50</td><td rowspan=1 colspan=1>0.9929</td><td rowspan=1 colspan=1>39.75</td><td rowspan=1 colspan=1>0.9848</td></tr></table>
|
| 175 |
+
|
| 176 |
+
# 4.3 IMAGE DEMOSAICING
|
| 177 |
+
|
| 178 |
+
Following the same setting in IRCNN (Zhang et al., 2017b), we compare image demosaicing results with those of IRCNN on McMaster (Zhang et al., 2017b), Kodak24, BSD68, and Urban100. Since IRCNN has been one of the best methods for image demosaicing and limited space, we only compare with IRCNN in Table 4. As we can see, mosaiced images have very poor quality, resulting in very low PSNR and SSIM values. IRCNN can enhance the low-quality images and achieve relatively high values of PSNR and SSIM. Our RNAN can still make significant improvements over IRCNN. Using local and non-local attention, our RNAN can better handle the degradation situation.
|
| 179 |
+
|
| 180 |
+
Visual results are shown in Figure 6. Although IRCNN can remove mosaicing effect greatly, there’re still some artifacts in its results (e.g., blocking artifacts in ‘img 026’). However, RNAN recovers more faithful color and alliciates blocking artifacts.
|
| 181 |
+
|
| 182 |
+
# 4.4 IMAGE COMPRESSION ARTIFACTS REDUCTION
|
| 183 |
+
|
| 184 |
+
We further apply our RNAN to reduce image compression artifacts. We compare our RNAN with SA-DCT (Foi et al., 2007), ARCNN (Dong et al., 2015), TNRD (Chen & Pock, 2017), and DnCNN (Zhang et al., 2017a). We apply the standard JPEG compression scheme to obtain the compressed images by following (Dong et al., 2015). Four JPEG quality settings $q = 1 0$ , 20, 30, 40 are used in Matlab JPEG encoder. Here, we only focus on the restoration of $\mathrm { Y }$ channel (in YCbCr space) to keep fair comparison with other methods. We use the same datasets LIVE1 (Sheikh et al., 2005) and Classic5 (Foi et al., 2007) in ARCNN and report PSNR/SSIM values in Table 5. As we can see, our RNAN achieves the best PSNR and SSIM values on LIVE1 and Classic5 with all JPEG qualities.
|
| 185 |
+
|
| 186 |
+
We further shown visual comparisons in Figure 7. We provide comparisons under very low image quality $\scriptstyle ( q = 1 0 )$ . The blocking artifacts can be removed to some degree, but ARCNN, TNRD, and DnCNN would also over-smooth some structures. RNAN obtains more details with consistent structures by considering non-local mixed attention.
|
| 187 |
+
|
| 188 |
+
Table 5: Quantitative results about compression artifacts reduction. Best results are highlighted.
|
| 189 |
+
|
| 190 |
+
<table><tr><td rowspan=2 colspan=1>Dataset</td><td rowspan=2 colspan=1>q</td><td rowspan=1 colspan=2>JPEG</td><td rowspan=1 colspan=3>SA-DCT</td><td rowspan=1 colspan=2>ARCNN</td><td rowspan=1 colspan=2>TNRD</td><td rowspan=1 colspan=2>DnCNN</td><td rowspan=1 colspan=1>RNAN</td><td rowspan=1 colspan=1>(ours)</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=2>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=4 colspan=1>LIVE1</td><td rowspan=4 colspan=1>10203040</td><td rowspan=4 colspan=1>27.7730.0731.4132.35</td><td rowspan=4 colspan=1>0.79050.86830.90000.9173</td><td rowspan=3 colspan=2>28.6530.8132.08</td><td rowspan=1 colspan=1>0.8093</td><td rowspan=1 colspan=1>28.98</td><td rowspan=1 colspan=1>0.8217</td><td rowspan=2 colspan=1>29.1531.46</td><td rowspan=2 colspan=1>0.81110.8769</td><td rowspan=2 colspan=1>29.1931.59</td><td rowspan=2 colspan=1>0.81230.8802</td><td rowspan=2 colspan=1>29.6332.03</td><td rowspan=2 colspan=1>0.82390.8877</td></tr><tr><td rowspan=1 colspan=1>0.8781</td><td rowspan=1 colspan=1>31.29</td><td rowspan=1 colspan=1>0.8871</td></tr><tr><td rowspan=1 colspan=1>.08</td><td rowspan=1 colspan=1>0.9078</td><td rowspan=1 colspan=1>32.69</td><td rowspan=1 colspan=1>0.9166</td><td rowspan=1 colspan=1>32.84</td><td rowspan=1 colspan=1>0.9059</td><td rowspan=1 colspan=1>32.98</td><td rowspan=2 colspan=1>0.90900.9247</td><td rowspan=2 colspan=1>33.4534.47</td><td rowspan=2 colspan=1>0.91490.9299</td></tr><tr><td rowspan=1 colspan=2>32.99</td><td rowspan=1 colspan=1>0.9240</td><td rowspan=1 colspan=1>33.63</td><td rowspan=1 colspan=1>0.9306</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>33.96</td></tr><tr><td rowspan=3 colspan=1>Classic5</td><td rowspan=3 colspan=1>10203040</td><td rowspan=3 colspan=1>27.8230.1231.4832.43</td><td rowspan=3 colspan=1>0.78000.85410.88440.9011</td><td rowspan=2 colspan=2>28.8830.9232.14</td><td rowspan=1 colspan=1>0.80710.8663</td><td rowspan=1 colspan=1>29.0431.16</td><td rowspan=1 colspan=1>0.81110.8694</td><td rowspan=1 colspan=1>29.2831.47</td><td rowspan=1 colspan=1>0.79920.8576</td><td rowspan=1 colspan=1>29.4031.63</td><td rowspan=1 colspan=1>0.80260.8610</td><td rowspan=1 colspan=1>29.9632.11</td><td rowspan=3 colspan=1>0.81780.86930.89240.9061</td></tr><tr><td rowspan=1 colspan=1>0.8914</td><td rowspan=1 colspan=1>32.52</td><td rowspan=1 colspan=1>0.8967</td><td rowspan=1 colspan=1>32.78</td><td rowspan=1 colspan=1>0.8837</td><td rowspan=1 colspan=1>32.91</td><td rowspan=2 colspan=1>0.88610.9003</td><td rowspan=2 colspan=1>33.3834.27</td></tr><tr><td rowspan=1 colspan=2>33.00</td><td rowspan=1 colspan=1>0.9055</td><td rowspan=1 colspan=1>33.34</td><td rowspan=1 colspan=1>0.9101</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>33.77</td></tr></table>
|
| 191 |
+
|
| 192 |
+
# 4.5 IMAGE SUPER-RESOLUTION
|
| 193 |
+
|
| 194 |
+
We further compare our RNAN with state-of-the-art SR methods: EDSR (Lim et al., 2017), SRMDNF (Zhang et al., 2018a), D-DBPN (Haris et al., 2018), and RCAN (Zhang et al., 2018b). Similar to (Lim et al., 2017; Zhang et al., 2018c), we also introduce self-ensemble strategy to further improve our RNAN and denote the self-ensembled one as ${ \mathrm { R N A N } } +$ .
|
| 195 |
+
|
| 196 |
+
As shown in Table 6, our ${ \mathrm { R N A N } } +$ achieves the second best performance among benchmark datasets: Set5 (Bevilacqua et al., 2012), Set14 (Zeyde et al., 2010), B100 (Martin et al., 2001), Urban100 (Huang et al., 2015), and Manga109 (Matsui et al., 2017). Even without self-ensemble, our RNAN achieves third best results in most cases. Such improvements are notable, because the parameter number of RNAN is $7 . 5 { \bf M }$ , far smaller than $4 3 \mathrm { { M } }$ in EDSR and $1 6 \mathbf { M }$ in RCAN. The network depth of our RNAN (about 120 convolutional layers) is also far shallower than that of RCAN, which has about 400 convolutional layers. It indicates that non-local attention make better use of main network, saving much network parameter.
|
| 197 |
+
|
| 198 |
+
In Figure 8, we conduct image SR $( \times 4 )$ with several state-of-the-art methods. We can see that our RNAN obtains better visually pleasing results with finer structures. These comparisons further demonstrate the effectiveness of our proposed RNAN with the usage of non-local mixed attention.
|
| 199 |
+
|
| 200 |
+
Table 6: Quantitative image SR results. Best and second best results are highlighted and underlined
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=2 colspan=1>Scale</td><td rowspan=1 colspan=2>Set5</td><td rowspan=1 colspan=2>Set14</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=1>00</td><td rowspan=1 colspan=2>Urban100</td><td rowspan=1 colspan=2>Manga109</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=6 colspan=1>BicubicEDSRSRMDNFD-DBPNRCANRNAN (ours)RNAN+ (ours)</td><td rowspan=2 colspan=1>×2×2</td><td rowspan=1 colspan=1>33.66</td><td rowspan=1 colspan=1>0.9299</td><td rowspan=1 colspan=1>30.24</td><td rowspan=1 colspan=1>0.8688</td><td rowspan=1 colspan=1>29.56</td><td rowspan=1 colspan=1>0.8431</td><td rowspan=1 colspan=1>26.88</td><td rowspan=1 colspan=1>0.8403</td><td rowspan=1 colspan=1>30.80</td><td rowspan=1 colspan=1>0.9339</td></tr><tr><td rowspan=1 colspan=1>38.11</td><td rowspan=1 colspan=1>0.9602</td><td rowspan=1 colspan=1>33.92</td><td rowspan=1 colspan=1>0.9195</td><td rowspan=1 colspan=1>32.32</td><td rowspan=1 colspan=1>0.9013</td><td rowspan=1 colspan=1>32.93</td><td rowspan=1 colspan=1>0.9351</td><td rowspan=1 colspan=1>39.10</td><td rowspan=1 colspan=1>0.9773</td></tr><tr><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>37.79</td><td rowspan=1 colspan=1>0.9601</td><td rowspan=1 colspan=1>33.32</td><td rowspan=1 colspan=1>0.9159</td><td rowspan=1 colspan=1>32.05</td><td rowspan=1 colspan=1>0.8985</td><td rowspan=1 colspan=1>31.33</td><td rowspan=1 colspan=1>0.9204</td><td rowspan=1 colspan=1>38.07</td><td rowspan=1 colspan=1>0.9761</td></tr><tr><td rowspan=3 colspan=1>×2×2×2×2</td><td rowspan=1 colspan=1>38.09</td><td rowspan=1 colspan=1>0.9600</td><td rowspan=1 colspan=1>33.85</td><td rowspan=1 colspan=1>0.9190</td><td rowspan=1 colspan=1>32.27</td><td rowspan=1 colspan=1>0.9000</td><td rowspan=1 colspan=1>32.55</td><td rowspan=1 colspan=1>0.9324</td><td rowspan=1 colspan=1>38.89</td><td rowspan=1 colspan=1>0.9775</td></tr><tr><td rowspan=2 colspan=1>38.2738.1738.22</td><td rowspan=2 colspan=1>0.96140.96110.9613</td><td rowspan=1 colspan=1>34.12</td><td rowspan=1 colspan=1>0.9216</td><td rowspan=1 colspan=1>32.41</td><td rowspan=1 colspan=1>0.9027</td><td rowspan=1 colspan=1>33.34</td><td rowspan=1 colspan=1>0.9384</td><td rowspan=1 colspan=1>39.44</td><td rowspan=1 colspan=1>0.9786</td></tr><tr><td rowspan=1 colspan=1>33.8733.97</td><td rowspan=1 colspan=1>0.92070.9216</td><td rowspan=1 colspan=1>32.3232.36</td><td rowspan=1 colspan=1>0.90140.9018</td><td rowspan=1 colspan=1>32.7332.90</td><td rowspan=1 colspan=1>0.93400.9351</td><td rowspan=1 colspan=1>39.2339.41</td><td rowspan=1 colspan=1>0.97850.9789</td></tr><tr><td rowspan=7 colspan=1>BicubicEDSRSRMDNFD-DBPNRCANRNAN (ours)RNAN+ (ours)</td><td rowspan=2 colspan=1>×4×4</td><td rowspan=1 colspan=1>28.42</td><td rowspan=1 colspan=1>0.8104</td><td rowspan=1 colspan=1>26.00</td><td rowspan=1 colspan=1>0.7027</td><td rowspan=1 colspan=1>25.96</td><td rowspan=1 colspan=1>0.6675</td><td rowspan=1 colspan=1>23.14</td><td rowspan=1 colspan=1>0.6577</td><td rowspan=1 colspan=1>24.89</td><td rowspan=1 colspan=1>0.7866</td></tr><tr><td rowspan=1 colspan=1>32.46</td><td rowspan=1 colspan=1>0.8968</td><td rowspan=1 colspan=1>28.80</td><td rowspan=1 colspan=1>0.7876</td><td rowspan=1 colspan=1>27.71</td><td rowspan=1 colspan=1>0.7420</td><td rowspan=1 colspan=1>26.64</td><td rowspan=1 colspan=1>0.8033</td><td rowspan=1 colspan=1>31.02</td><td rowspan=1 colspan=1>0.9148</td></tr><tr><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>31.96</td><td rowspan=1 colspan=1>0.8925</td><td rowspan=1 colspan=1>28.35</td><td rowspan=1 colspan=1>0.7787</td><td rowspan=1 colspan=1>27.49</td><td rowspan=1 colspan=1>0.7337</td><td rowspan=1 colspan=1>25.68</td><td rowspan=1 colspan=1>0.7731</td><td rowspan=1 colspan=1>30.09</td><td rowspan=1 colspan=1>0.9024</td></tr><tr><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>32.47</td><td rowspan=1 colspan=1>0.8980</td><td rowspan=1 colspan=1>28.82</td><td rowspan=1 colspan=1>0.7860</td><td rowspan=1 colspan=1>27.72</td><td rowspan=1 colspan=1>0.7400</td><td rowspan=1 colspan=1>26.38</td><td rowspan=1 colspan=1>0.7946</td><td rowspan=1 colspan=1>30.91</td><td rowspan=1 colspan=1>0.9137</td></tr><tr><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>32.63</td><td rowspan=1 colspan=1>0.9002</td><td rowspan=1 colspan=1>28.87</td><td rowspan=1 colspan=1>0.7889</td><td rowspan=1 colspan=1>27.77</td><td rowspan=1 colspan=1>0.7436</td><td rowspan=1 colspan=1>26.82</td><td rowspan=1 colspan=1>0.8087</td><td rowspan=1 colspan=1>31.22</td><td rowspan=1 colspan=1>0.9173</td></tr><tr><td rowspan=2 colspan=1>×4×4</td><td rowspan=1 colspan=1>32.49</td><td rowspan=1 colspan=1>0.8982</td><td rowspan=1 colspan=1>28.83</td><td rowspan=1 colspan=1>0.7878</td><td rowspan=1 colspan=1>27.72</td><td rowspan=1 colspan=1>0.7421</td><td rowspan=1 colspan=1>26.61</td><td rowspan=1 colspan=1>0.8023</td><td rowspan=2 colspan=1>31.0931.37</td><td rowspan=2 colspan=1>0.91490.9175</td></tr><tr><td rowspan=1 colspan=1>32.56</td><td rowspan=1 colspan=1>0.8992</td><td rowspan=1 colspan=1>28.90</td><td rowspan=1 colspan=1>0.7883</td><td rowspan=1 colspan=1>27.77</td><td rowspan=1 colspan=1>0.7424</td><td rowspan=1 colspan=1>26.75</td><td rowspan=1 colspan=1>0.8052</td></tr></table>
|
| 203 |
+
|
| 204 |
+
# 4.6 PARAMETERS AND RUNNING TIME ANALYSES
|
| 205 |
+
|
| 206 |
+
We also compare parameters, running time, and performance based on color image denoising in Table 7. PSNR values are tested on Urban100 $\scriptstyle ( \sigma = 5 0 )$ ). RNAN with 10 blocks achieves the best performance with the highest parameter number, which can be reduced to only 2 blocks and obtains second best performance. Here, we report running time for reference, because the time is related to implementation platform and code.
|
| 207 |
+
|
| 208 |
+
Table 7: Parameter and time comparisons. ‘\*’ means being applied channel-wise for color images.
|
| 209 |
+
|
| 210 |
+
<table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=1>RED*</td><td rowspan=1 colspan=1>DnCNN</td><td rowspan=1 colspan=1>MemNet*</td><td rowspan=1 colspan=1>RNAN (1LB+1NLB)</td><td rowspan=1 colspan=1>RNAN (8LBs+2NLBs)</td></tr><tr><td rowspan=1 colspan=1>Parameter Number</td><td rowspan=1 colspan=1>4,131 K</td><td rowspan=1 colspan=1>672K</td><td rowspan=1 colspan=1>677K</td><td rowspan=1 colspan=1>1,494k</td><td rowspan=1 colspan=1>7,409K</td></tr><tr><td rowspan=1 colspan=1>PSNR (dB)</td><td rowspan=1 colspan=1>26.40</td><td rowspan=1 colspan=1>28.16</td><td rowspan=1 colspan=1>26.53</td><td rowspan=1 colspan=1>28.36</td><td rowspan=1 colspan=1>29.15</td></tr><tr><td rowspan=1 colspan=1>Time (s) (Platform)</td><td rowspan=1 colspan=1>58.7(Caffe)</td><td rowspan=1 colspan=1>16.5(Matlab+GPU Array)</td><td rowspan=1 colspan=1>239.0 (Caffe)</td><td rowspan=1 colspan=1>2.6 (PyTorch)</td><td rowspan=1 colspan=1>6.5 (PyTorch)</td></tr></table>
|
| 211 |
+
|
| 212 |
+
# 5 CONCLUSIONS
|
| 213 |
+
|
| 214 |
+
In this paper, we propose residual non-local attention networks for high-quality image restoration. The networks are built by stacking local and non-local attention blocks, which extract local and non-local attention-aware features and consist of trunk and (non-)local mask branches. They’re used to extract hierarchical features and adaptively rescale hierarchical features with soft weights. We further generate non-local attention by considering the whole feature map. Furthermore, we propose residual local and non-local attention learning to train very deep networks. We introduce the input feature into attention computation, being more suitable for image restoration. RNAN achieves state-of-the-art image restoration results with moderate model size and running time.
|
| 215 |
+
|
| 216 |
+
Acknowledgements. This research is supported in part by the NSF IIS award 1651902 and U.S.
|
| 217 |
+
Army Research Office Award W911NF-17-1-0367.
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 4: Color image denoising results with noise level $\sigma = 5 0$ .
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure 5: Gray image denoising results with noise level $\sigma = 5 0$ .
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 6: Image demosaicing results.
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 7: Image compression artifacts reduction results with JPEG quality $q = 1 0$ .
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 8: Image super-resolution results with scaling factor $s = 4$ .
|
| 233 |
+
|
| 234 |
+
# REFERENCES
|
| 235 |
+
|
| 236 |
+
Eirikur Agustsson and Radu Timofte. Ntire 2017 challenge on single image super-resolution: Dataset and study. In CVPRW, 2017.
|
| 237 |
+
|
| 238 |
+
Cosmin Ancuti, Codruta O Ancuti, Radu Timofte, Luc Van Gool, Lei Zhang, Ming-Hsuan Yang, Vishal M Patel, He Zhang, Vishwanath A Sindagi, Ruhao Zhao, et al. Ntire 2018 challenge on image dehazing: Methods and results. In CVPRW, 2018.
|
| 239 |
+
|
| 240 |
+
Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Lowcomplexity single-image super-resolution based on nonnegative neighbor embedding. In BMVC, 2012.
|
| 241 |
+
|
| 242 |
+
Yochai Blau, Roey Mechrez, Radu Timofte, Tomer Michaeli, and Lihi Zelnik-Manor. 2018 pirm challenge on perceptual image super-resolution. In ECCVW, 2018.
|
| 243 |
+
|
| 244 |
+
Antoni Buades, Bartomeu Coll, and J-M Morel. A non-local algorithm for image denoising. In CVPR, 2005.
|
| 245 |
+
|
| 246 |
+
Yunjin Chen and Thomas Pock. Trainable nonlinear reaction diffusion: A flexible framework for fast and effective image restoration. TPAMI, 2017.
|
| 247 |
+
|
| 248 |
+
Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Color image denoising via sparse 3d collaborative filtering with grouping constraint in luminance-chrominance space. In ICIP, 2007a.
|
| 249 |
+
|
| 250 |
+
Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Image denoising by sparse 3-d transform-domain collaborative filtering. TIP, 2007b.
|
| 251 |
+
|
| 252 |
+
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.
|
| 253 |
+
|
| 254 |
+
Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang. Learning a deep convolutional network for image super-resolution. In ECCV, 2014.
|
| 255 |
+
|
| 256 |
+
Chao Dong, Yubin Deng, Chen Change Loy, and Xiaoou Tang. Compression artifacts reduction by a deep convolutional network. In ICCV, 2015.
|
| 257 |
+
|
| 258 |
+
Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang. Image super-resolution using deep convolutional networks. TPAMI, 2016.
|
| 259 |
+
|
| 260 |
+
Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Pointwise shape-adaptive dct for highquality denoising and deblocking of grayscale and color images. TIP, May 2007.
|
| 261 |
+
|
| 262 |
+
Muhammad Haris, Greg Shakhnarovich, and Norimichi Ukita. Deep back-projection networks for super-resolution. In CVPR, 2018.
|
| 263 |
+
|
| 264 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 265 |
+
|
| 266 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. arXiv preprint arXiv:1709.01507, 2017.
|
| 267 |
+
|
| 268 |
+
Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In CVPR, 2015.
|
| 269 |
+
|
| 270 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 271 |
+
|
| 272 |
+
Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In CVPR, 2016.
|
| 273 |
+
|
| 274 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014.
|
| 275 |
+
|
| 276 |
+
Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In CVPR, 2017.
|
| 277 |
+
|
| 278 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro ´ Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, and Wenzhe Shi. Photorealistic single image super-resolution using a generative adversarial network. In CVPR, 2017.
|
| 279 |
+
|
| 280 |
+
Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee. Enhanced deep residual networks for single image super-resolution. In CVPRW, 2017.
|
| 281 |
+
|
| 282 |
+
Ding Liu, Bihan Wen, Yuchen Fan, Chen Change Loy, and Thomas S Huang. Non-local recurrent network for image restoration. In NIPS, 2018.
|
| 283 |
+
|
| 284 |
+
Kede Ma, Zhengfang Duanmu, Qingbo Wu, Zhou Wang, Hongwei Yong, Hongliang Li, and Lei Zhang. Waterloo exploration database: New challenges for image quality assessment models. TIP, 2017.
|
| 285 |
+
|
| 286 |
+
Xiaojiao Mao, Chunhua Shen, and Yu-Bin Yang. Image restoration using very deep convolutional encoder-decoder networks with symmetric skip connections. In NIPS, 2016.
|
| 287 |
+
|
| 288 |
+
David Martin, Charless Fowlkes, Doron Tal, and Jitendra Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In ICCV, 2001.
|
| 289 |
+
|
| 290 |
+
Yusuke Matsui, Kota Ito, Yuji Aramaki, Azuma Fujimoto, Toru Ogawa, Toshihiko Yamasaki, and Kiyoharu Aizawa. Sketch-based manga retrieval using manga109 dataset. Multimedia Tools and Applications, 2017.
|
| 291 |
+
|
| 292 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
|
| 293 |
+
|
| 294 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
|
| 295 |
+
|
| 296 |
+
Hamid R Sheikh, Zhou Wang, Lawrence Cormack, and Alan C Bovik. Live image quality assessment database release 2 (2005), 2005.
|
| 297 |
+
|
| 298 |
+
Ying Tai, Jian Yang, Xiaoming Liu, and Chunyan Xu. Memnet: A persistent memory network for image restoration. In ICCV, 2017.
|
| 299 |
+
|
| 300 |
+
Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, Lei Zhang, Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, Kyoung Mu Lee, et al. Ntire 2017 challenge on single image super-resolution: Methods and results. In CVPRW, 2017.
|
| 301 |
+
|
| 302 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In ICML, 2008.
|
| 303 |
+
|
| 304 |
+
Fei Wang, Mengqing Jiang, Chen Qian, Shuo Yang, Cheng Li, Honggang Zhang, Xiaogang Wang, and Xiaoou Tang. Residual attention network for image classification. In CVPR, 2017.
|
| 305 |
+
|
| 306 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, 2018a.
|
| 307 |
+
|
| 308 |
+
Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Chen Change Loy, Yu Qiao, and Xiaoou Tang. Esrgan: Enhanced super-resolution generative adversarial networks. In ECCVW, 2018b.
|
| 309 |
+
|
| 310 |
+
Yifan Wang, Federico Perazzi, Brian McWilliams, Alexander Sorkine-Hornung, Olga SorkineHornung, and Christopher Schroers. A fully progressive approach to single-image superresolution. In CVPRW, 2018c.
|
| 311 |
+
|
| 312 |
+
Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. TIP, 2004.
|
| 313 |
+
|
| 314 |
+
Jianchao Yang, John Wright, Thomas Huang, and Yi Ma. Image super-resolution as sparse representation of raw image patches. In CVPR, 2008.
|
| 315 |
+
|
| 316 |
+
Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparserepresentations. In Proc. 7th Int. Conf. Curves Surf., 2010.
|
| 317 |
+
Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. TIP, 2017a.
|
| 318 |
+
Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In CVPR, 2017b.
|
| 319 |
+
Kai Zhang, Wangmeng Zuo, and Lei Zhang. Ffdnet: Toward a fast and flexible solution for cnn based image denoising. arXiv preprint arXiv:1710.04026, 2017c.
|
| 320 |
+
Kai Zhang, Wangmeng Zuo, and Lei Zhang. Learning a single convolutional super-resolution network for multiple degradations. In CVPR, 2018a.
|
| 321 |
+
Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image superresolution using very deep residual channel attention networks. In ECCV, 2018b.
|
| 322 |
+
Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image super-resolution. In CVPR, 2018c.
|
| 323 |
+
|
| 324 |
+
# A APPENDIX
|
| 325 |
+
|
| 326 |
+
# A.1 TRAIN RNAN WITH SMALL TRAINING DATA
|
| 327 |
+
|
| 328 |
+
All the results shown in the main paper are based on DIV2K training data. Here, we retrain our RNAN on small training sets for 5 tasks. In Table 8, for each task, we only refer the second best method from our main paper to compare. For training data, we use BSD400 (Martin et al., 2001) for color/gray-scale image denoising and demosaicing. We use 91 images in Yang et al. (2008) and 200 images in Martin et al. (2001) (denoted as SR291) for image compression artifacts reduction and super-resolution. FFDNet used BSD400 (Martin et al., 2001), 400 images from ImageNet Deng et al. (2009), and 4,744 images in Waterloo Exploration Database Ma et al. (2017). Here, $\mathrm { \cdot B S D 4 0 0 + } ^ { \mathrm { \cdot } }$ ’ is used to denote $\mathbf { \cdot B S D 4 0 0 + I m a g e N e t 4 0 0 + W E D 4 7 4 4 } ^ { \prime }$ . According to Table 8, we use the same or even smaller training set for our RNAN and obtain better results for 5 tasks. These experiments demonstrate the effectiveness of our RNAN for general image restoration tasks.
|
| 329 |
+
|
| 330 |
+
Table 8: Quantitative results about image restoration. Best results are highlighted.
|
| 331 |
+
|
| 332 |
+
<table><tr><td rowspan=1 colspan=14>Task1:Color image denoising.o denotes noise level.</td></tr><tr><td rowspan=2 colspan=1>Data</td><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=4>Kodak24</td><td rowspan=1 colspan=4>BSD68</td><td rowspan=1 colspan=4>Urban100</td></tr><tr><td rowspan=1 colspan=1>g=10</td><td rowspan=1 colspan=1>=30</td><td rowspan=1 colspan=1>=50</td><td rowspan=1 colspan=1>g=70</td><td rowspan=1 colspan=1>g=10</td><td rowspan=1 colspan=1>=30</td><td rowspan=1 colspan=1>=50</td><td rowspan=1 colspan=1>=70</td><td rowspan=1 colspan=1>=10</td><td rowspan=1 colspan=1>=30</td><td rowspan=1 colspan=1>=50</td><td rowspan=1 colspan=1>g=70</td></tr><tr><td rowspan=1 colspan=1>BSD400+</td><td rowspan=1 colspan=1>FFDNet</td><td rowspan=1 colspan=1>36.81</td><td rowspan=1 colspan=1>31.39</td><td rowspan=1 colspan=1>29.10</td><td rowspan=1 colspan=1>27.68</td><td rowspan=1 colspan=1>36.14</td><td rowspan=1 colspan=1>30.31</td><td rowspan=1 colspan=1>27.96</td><td rowspan=1 colspan=1>26.53</td><td rowspan=1 colspan=1>35.77</td><td rowspan=1 colspan=1>30.53</td><td rowspan=1 colspan=1>28.05</td><td rowspan=1 colspan=1>26.39</td></tr><tr><td rowspan=1 colspan=1>BSD400</td><td rowspan=1 colspan=1>RNAN</td><td rowspan=1 colspan=1>37.16</td><td rowspan=1 colspan=1>31.81</td><td rowspan=1 colspan=1>29.55</td><td rowspan=1 colspan=1>28.15</td><td rowspan=1 colspan=1>36.60</td><td rowspan=1 colspan=1>30.73</td><td rowspan=1 colspan=1>28.35</td><td rowspan=1 colspan=1>26.88</td><td rowspan=1 colspan=1>36.39</td><td rowspan=1 colspan=1>30.90</td><td rowspan=1 colspan=1>28.65</td><td rowspan=1 colspan=1>27.11</td></tr><tr><td rowspan=1 colspan=14>Task 2: Gray image denoising. g denotes noise level.</td></tr><tr><td rowspan=2 colspan=1>Data</td><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=4>Kodak24</td><td rowspan=1 colspan=4>BSD68</td><td rowspan=1 colspan=4>Urban100</td></tr><tr><td rowspan=1 colspan=1>g=10</td><td rowspan=1 colspan=1>g=30</td><td rowspan=1 colspan=1>=50</td><td rowspan=1 colspan=1>g=70</td><td rowspan=1 colspan=1>g=10</td><td rowspan=1 colspan=1>g=30</td><td rowspan=1 colspan=1>g=50</td><td rowspan=1 colspan=1>g=70</td><td rowspan=1 colspan=1>g=10</td><td rowspan=1 colspan=1>g=30</td><td rowspan=1 colspan=1>σ=50</td><td rowspan=1 colspan=1>g=70</td></tr><tr><td rowspan=1 colspan=1>BSD400+</td><td rowspan=1 colspan=1>FFDNet</td><td rowspan=1 colspan=1>34.81</td><td rowspan=1 colspan=1>29.70</td><td rowspan=1 colspan=1>27.63</td><td rowspan=1 colspan=1>26.34</td><td rowspan=1 colspan=1>33.76</td><td rowspan=1 colspan=1>28.39</td><td rowspan=1 colspan=1>26.29</td><td rowspan=1 colspan=1>25.04</td><td rowspan=1 colspan=1>34.45</td><td rowspan=1 colspan=1>29.03</td><td rowspan=1 colspan=1>26.52</td><td rowspan=1 colspan=1>24.86</td></tr><tr><td rowspan=1 colspan=1>BSD400</td><td rowspan=1 colspan=1>RNAN</td><td rowspan=1 colspan=1>35.15</td><td rowspan=1 colspan=1>29.87</td><td rowspan=1 colspan=1>27.92</td><td rowspan=1 colspan=1>26.50</td><td rowspan=1 colspan=1>34.18</td><td rowspan=1 colspan=1>28.72</td><td rowspan=1 colspan=1>26.61</td><td rowspan=1 colspan=1>25.34</td><td rowspan=1 colspan=1>35.08</td><td rowspan=1 colspan=1>29.82</td><td rowspan=1 colspan=1>27.30</td><td rowspan=1 colspan=1>25.57</td></tr><tr><td rowspan=1 colspan=6>Task3:Image demosaicing</td><td rowspan=1 colspan=3>Task4:Imagecompress</td><td rowspan=1 colspan=5>Task 4: Image compression artifacts reduction. q denotes JPEG quality.</td></tr><tr><td rowspan=2 colspan=1>Data</td><td rowspan=2 colspan=1>Method</td><td rowspan=2 colspan=2>Kodak24</td><td rowspan=2 colspan=2>BSD68</td><td rowspan=2 colspan=3>Data</td><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=1>LI</td><td rowspan=1 colspan=1>E1</td><td rowspan=1 colspan=2>Classic5</td></tr><tr><td rowspan=1 colspan=1>q=20</td><td rowspan=1 colspan=1>q=40</td><td rowspan=1 colspan=1>q=20</td><td rowspan=1 colspan=1>q=40</td></tr><tr><td rowspan=1 colspan=1>BSD400</td><td rowspan=1 colspan=1>IRCNN</td><td rowspan=1 colspan=2>40.41</td><td rowspan=1 colspan=2>39.96</td><td rowspan=1 colspan=3>SR291</td><td rowspan=1 colspan=1>DnCNN</td><td rowspan=1 colspan=1>31.59</td><td rowspan=1 colspan=1>33.96</td><td rowspan=1 colspan=1>31.63</td><td rowspan=1 colspan=1>33.77</td></tr><tr><td rowspan=1 colspan=1>BSD400</td><td rowspan=1 colspan=1>RNAN</td><td rowspan=1 colspan=2>42.86</td><td rowspan=1 colspan=2>42.61</td><td rowspan=1 colspan=3>SR291</td><td rowspan=1 colspan=1>RNAN</td><td rowspan=1 colspan=1>31.87</td><td rowspan=1 colspan=1>34.32</td><td rowspan=1 colspan=1>31.99</td><td rowspan=1 colspan=1>34.03</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=10>Task 5:Image super-resolution (SR).Low-resolution (LR) images are obtained by Bicubic downsampling.</td><td rowspan=1 colspan=3>mpling.</td></tr><tr><td rowspan=2 colspan=1>Data</td><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=3>Set5</td><td rowspan=1 colspan=3>Set14</td><td rowspan=1 colspan=3>B100</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Urban100</td></tr><tr><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>×4</td></tr><tr><td rowspan=1 colspan=1>SR291</td><td rowspan=1 colspan=1>MemNet</td><td rowspan=1 colspan=1>37.78</td><td rowspan=1 colspan=1>34.09</td><td rowspan=1 colspan=1>31.74</td><td rowspan=1 colspan=1>33.28</td><td rowspan=1 colspan=1>30.00</td><td rowspan=1 colspan=1>28.26</td><td rowspan=1 colspan=1>32.08</td><td rowspan=1 colspan=1>28.96</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>31.31</td><td rowspan=1 colspan=1>27.56</td><td rowspan=1 colspan=1>25.50</td></tr><tr><td rowspan=1 colspan=1>SR291</td><td rowspan=1 colspan=1>RNAN</td><td rowspan=1 colspan=1>37.95</td><td rowspan=1 colspan=1>34.30</td><td rowspan=1 colspan=1>31.93</td><td rowspan=1 colspan=1>33.41</td><td rowspan=1 colspan=1>30.22</td><td rowspan=1 colspan=1>28.43</td><td rowspan=1 colspan=1>32.23</td><td rowspan=1 colspan=1>29.09</td><td rowspan=1 colspan=1>27.51</td><td rowspan=1 colspan=1>31.64</td><td rowspan=1 colspan=1>27.84</td><td rowspan=1 colspan=1>25.71</td></tr></table>
|
| 333 |
+
|
| 334 |
+
# A.2 VISUAL RESULTS
|
| 335 |
+
|
| 336 |
+
Color and Gray Image Denoising. We show color and gray-scale image denoising comparisons in Figures 9 and 10 respectively. We can see that our RNAN recovers shaper edges. Unlike most of other methods, which over-smooth some details (e.g., tiny lines), RNAN can reduce noise and maintain more details. With the learned non-local mixed attention, RNAN treats different image parts distinctively, alleviating over-smoothing artifacts obviously.
|
| 337 |
+
|
| 338 |
+
Image Compression Artifacts Reduction (CAR). In Figure 11, we provide comparisons under very low image quality $\scriptstyle ( q = 1 0 )$ . The blocking artifacts can be removed to some degree, but ARCNN, TNRD, and DnCNN would also over-smooth some structures. In contrast, RNAN obatins more details with consistent structures by considering non-local mixed attention.
|
| 339 |
+
|
| 340 |
+
Image Super-Resolution (SR). In Figure 12, we conduct image SR $( \times 4 )$ with several state-of-theart methods, such as SRCNN (Dong et al., 2016), VDSR (Kim et al., 2016), LapSRN (Lai et al., 2017), MemNet (Tai et al., 2017), EDSR (Lim et al., 2017), SRMDNF (Zhang et al., 2018a), and DDBPN (Haris et al., 2018). We can see that most of compared methods would suffer from distortion or output totally wrong structures. For tiny line, edge structures, or some textures, they fail to recover and introduce blurring artifacts. Instead, our RNAN obtains better visually pleasing results with finer structures. These comparisons further demonstrate the effectiveness of our proposed RNAN with the usage of non-local mixed attention.
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 9: Color image denoising results with noise level $\sigma = 5 0$ .
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 10: Gray-scale image denoising results with noise level $\sigma = 5 0$ .
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 11: Image compression artifacts reduction results with JPEG quality $q = 1 0$
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 12: Image super-resolution results with scaling factor $s = 4$
|
md/train/HkehD3VtvS/HkehD3VtvS.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP REASONING NETWORKS FOR UNSUPERVISED PATTERN DE-MIXING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce Deep Reasoning Networks (DRNets), an end-to-end framework that combines deep learning with reasoning for solving pattern de-mixing problems, typically in an unsupervised or weakly-supervised setting. DRNets exploit problem structure and prior knowledge by tightly combining logic and constraint reasoning with stochastic-gradient-based neural network optimization. We illustrate the power of DRNets on de-mixing overlapping hand-written Sudokus (MultiMNIST-Sudoku) and on a substantially more complex task in scientific discovery that concerns inferring crystal structures of materials from X-ray diffraction data (Crystal-Structure-Phase-Mapping). DRNets significantly outperform the state of the art and experts’ capabilities on Crystal-Structure-Phase-Mapping, recovering more precise and physically meaningful crystal structures. On Multi-MNISTSudoku, DRNets perfectly recovered the mixed Sudokus’ digits, with $100 \%$ digit accuracy, outperforming the supervised state-of-the-art MNIST de-mixing models.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has achieved tremendous success in areas such as vision, speech recognition, language translation, and autonomous driving. Nevertheless, certain limitations of deep learning are generally recognized, in particular, limitations due to the fact that deep learning approaches heavily depend on the availability of large amounts of labeled data. In certain domains, such as scientific discovery, it is often the case that scientists don’t have large amounts of labeled data and instead have to rely on prior knowledge to make sense of the data. One grand challenge in scientific discovery is to perform high-throughput unsupervised interpretation of scientific data, given its exponential growth in generation rates, dramatically outpacing humans’ ability to analyze them. Herein we consider pattern de-mixing problems, which involve decomposing a mixed signal into the collection of source patterns, such as separating mixtures of X-ray diffraction (XRD) signals into the source XRD signals of the corresponding crystal structures, a key challenge in materials discovery. More generally, pattern de-mixing problems are pervasive in scientific areas as diverse as biology, astronomy, and materials science, as well as in commercial applications for e.g., healthcare and music.
|
| 12 |
+
|
| 13 |
+
We propose Deep Reasoning Networks (DRNets), an end-to-end framework that combines deep learning with logical and constraint reasoning for solving unsupervised or very-weakly-supervised pattern de-mixing tasks. We illustrate the power of DRNets for disentangling two overlapping handwritten Sudokus (Multi-MNIST-Sudoku) (see Fig.1) and for solving a substantially more complex de-mixing task in scientific discovery that concerns inferring crystal structures of materials from X-ray diffraction data, which we refer to as Crystal-Structure-Phase-Mapping. Both de-mixing tasks require probabilistic reasoning to interpret noisy and uncertain data, while satisfying a set of rules: Sudoku rules and thermodynamic rules, respectively. For example, de-mixing hand written digits is challenging, but it becomes more feasible when we reason about the prior knowledge concerning the two overlapping Sudokus. Crystal structure phase mapping is yet substantially more complex. In fact, crystal structure phase mapping easily becomes too complex for experts to solve and is a major bottleneck in high-throughput materials discovery. DRNets are inspired and motivated by problems from scientific discovery, such as crystal structure phase mapping.
|
| 14 |
+
|
| 15 |
+
Our contributions: (1) We introduce Deep Reasoning Networks (DRNets), an end-to-end framework that combines deep learning with logical and constraint reasoning for unsupervised or veryweakly-supervised de-mixing tasks. Specifically, DRNets perform end-to-end deep reasoning by encoding a latent space of the input data that captures the structure and prior knowledge constraints within and among data points (Fig.2). The latent space is used by a generative decoder to generate the targeted output, which should be consistent with the input data and prior knowledge. Subsequently, DRNets optimize an objective function capturing the overall problem objective as well as prior knowledge in the form of weighted constraints. (2) To instantiate the logical constraints in DRNets, we introduce a group of entropy-based continuous relaxations that use probabilistic modeling to encode general discrete constraints including sparsity, cardinality and so-called AllDifferent constraints.To optimize those constraints, we introduce a variant of standard SGD method (Robbins & Monro, 1985) called constraint-aware stochastic gradient descent, which batches data points involved in the same constraint component together and dynamically adjust the constraints’ weights as a function of their satisfiability. In the following sections, we show how to encode Multi-MNIST-Sudoku and Crystal-Structure-Phase-Mapping as DRNets, by properly defining the structure of the latent space, additional reasoning modules to model the problem constraints (prior knowledge), and the components of the objective function. De facto, these examples illustrate how to develop “gadgets” to encode a variety of constraints and prior knowledge in DRNets. (3) We demonstrate the potential of DRNets on two de-mixing tasks with detailed experimental results. We show how (3.1) DRNets significantly outperformed the state of the art and human experts on Crystal-Structure-Phase-Mapping instances, recovering more precise, interpretable, and physically meaningful crystal structure pattern decompositions. In this task, DRNets solve a previously unsolved chemical system, which subsequently led to the discovery of a new material that is important for solar fuels technology. (3.2) On Multi-MNIST-Sudoku instances, without direct supervision, DRNets perfectly recovered the digits in the mixed Sudokus with $100 \%$ digit accuracy, outperforming the supervised state-of-the-art MNIST de-mixing models, including CapsuleNet (Sabour et al., 2017) and ResNet (He et al., 2016).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (a) Two $4 \mathbf { x } 4$ Sudokus: The cells in each row, column, and any of the four $2 \mathbf { x } 2$ boxes involving the corner cells have non-repeating digits. (b) Two overlapping Sudokus, with a mixture of two digits in each cell: one from 1 to 4 and the other from 5 to 8. In Multi-MNIST-Sudoku, the digits of two overlapping hand written Sudokus (b) have to be de-mixed (as done by DRNets in (c)). (d) The reconstructed overlapping hand written Sudokus from DRNets.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 2: Deep Reasoning Networks (DRNets) perform end-to-end deep reasoning by encoding a latent space of the input data that captures prior knowledge constraints and is used by a generative decoder to generate the targeted output. (a) Prior knowledge includes prototypes of digits, which are used to pre-train and build the decoder’s generative module, and Sudoku’s rules, which help DRNet reason about the overlapping digits. (b) Reasoning modules batch data points involved in the same constraints (cells in rows, columns, blocks of a Sudoku) together, enforce that the structure of the latent space satisfies prior knowledge, and dynamically adjust the weights of constraints based on their satisfiability. (c) The overall objective combines responses from the generative decoder (thinking fast) and the reasoning modules (thinking slow).
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
DRNets have been motivated by scientific tasks such as crystal phase mapping that involve identifying or de-mixing patterns in data that satisfy prior scientific knowledge. In general, for such tasks there are no labeled datasets. So our work focus on unsupervised or weakly supervised learning, using prior knowledge.
|
| 26 |
+
|
| 27 |
+
Most closely related work: Unsupervised or weakly supervised de-mixing approaches. Pattern de-mixing approaches have been developed under the name of source separation in the signal processing community. The unsupervised methods in this area mostly try to solve the de-mixing, which is in general ill-posed, using different regularizations. Among existing methods, recent work for weakly supervised audio source separation (Zhang et al., 2017) is most related to DRNets since they also employed a generative adversarial network (GAN) in their model. However, their model mainly employs the decoder of GAN to discriminate the reality of separated sources, while DRNets only utilize the generator of GAN as the generative model of possible sources. Moreover, the weakly supervised setting in their paper is actually too strong: they need the true labels of mixed sources, which is almost the goal of our tasks, and therefore it is not applicable to our settings. We now consider the state-of-the-art models for the tasks considered in this paper. For Crystal-structurephase-mapping, due to the lack of labeled datasets, existing models (Ermon et al., 2015; Xue et al., 2017; Bai et al., 2017; 2018; Stanev et al., 2018) are mainly based on non-negative matrix factorization (NMF), which is in general unsupervised. Stanev et al. (2018) proposed the NMF- $\mathbf { \nabla } \cdot \mathbf { k }$ algorithm, which applies a customized clustering process over the results of thousands of runs of pure NMF algorithm (Long et al., 2009) to cluster the common phase patterns. However, NMF- $\mathbf { \nabla } \cdot \mathbf { k }$ does not enforce prior knowledge (namely thermodynamic rules) and therefore the solutions produced are often not completly physically meaningful. To address this limitation several approaches have been developed that use external mixed-integer programming modules to interact with the NMF de-mixing module to enforce prior knowledge (Ermon et al., 2015; Bai et al., 2017; 2018). However, the coordination barrier between the NMF de-mixing module and the reasoning module often results in inferiror performance, where the solution satisfies constraints at the cost of huge reconstruction loss. In contrast to existing models, DRNets seamlessly integrate the pattern de-mixing module and the reasoning module, recovering almost exact ground truth decomposition. In our experiments we thoroughly compare DRNets’ performance against the state of the art (IAFD and NMF-k) for crystal-structure pattern de-mixing. MNIST de-mixing was first studied by Hinton et al. in 2000, where the aim is to identify or de-mix overlapping digits coming from the MNIST datasets (LeCun et al., 1998). More recently, it has been tackled with state-of-the-art neural network models such as CapsuleNet (Sabour et al., 2017) and ResNet (He et al., 2016). Existing works concerning this task are mainly in supervised settings, where we have labels of digits for each overlapping image. However, in this paper, we aim to tackle this task in a weakly supervised setting, where we only have access to the prototypes of single digits and the extra Sudoku rules. Due to the lack of existing models with the same setting, we compared DRNets’s performance against the state-of-the-art supervised models (CapsuleNet and ResNet). By utilizing the supervision from prior knowledge and reasoning, we show that DRNets’ outperformed all supervised models with $100 \%$ digit accuracy.
|
| 28 |
+
|
| 29 |
+
Enhancing deep learning with symbolic prior knowledge. Exploiting problem structure and reasoning about prior knowledge has been of increasing interest to facilitate deep learning (Garcez et al., 2019). In computer vision, symmetry constraints, bone-length constraints and linear constraints were introduced for human pose estimation (Zhou et al., 2017; 2016) and image segmentation (Pathak et al., 2015) to regularize the output and enhance generalization. In natural language processing, Hu et al. (2016a;b) introduced the posterior regularization (Ganchev et al., 2010) framework into deep learning to incorporate rule-based grammatical knowledge using first order logic. Xu et al. (2017) proposed a semantic loss function to enforce propositional logic constraints on the output of neural networks for semi-supervised multi-class classification tasks. Wang et al. (2019) proposed SATNet, which approximately encodes a MAXSAT solver into a neural network layer called SATNet layer, to explicitly learn the logical structures (e.g., parity function and Sudoku) from the labeled training data.
|
| 30 |
+
|
| 31 |
+
Previous works in this area primarily focus on supervised or semi-supervised settings for data-rich domains, where direct supervision from labels reduce the importance of explicitly reasoning about prior knowledge. In contrast, with an unsupervised setting, the supervision of DRNets comes from reasoning about prior knowledge and self-reconstruction, which is strongly desired for problems in scientific discovery due to the lack of labeled datasets, and strongly motivated by extensive prior knowledge from sources ranging from fundamental principles to the intuitive experience of scientists.
|
| 32 |
+
|
| 33 |
+
Among existing works, SATNet is mostly related to DRNets in the sense of bridging logical reasoning with deep learning. However, SATNet is essentially designed for learning logical structures (prior knowledge) from labeled training examples while DRNets aim to facilitate unsupervised learning with known logical constraints. In terms of the encoding of the reasoning module, the semantic loss (Xu et al., 2017) is mostly related to ours. However, the semantic loss encodes constraints by propositional logic, which requires enumerating all possible Boolean assignments that satisfy the constraints. Consequently, the semantic loss has to enumerate a large number of assignments to encode constraints such as $\mathbf { k }$ -sparsity constraints and All-Different constraints, which is not applicable to tasks considered in this paper.
|
| 34 |
+
|
| 35 |
+
# 3 DEEP REASONING NETWORKS
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 3: The reduction flow of Deep Reasoning Networks.
|
| 39 |
+
|
| 40 |
+
DRNets (see Fig.2) are inspired by human thinking (Shivhare & Kumar, 2016): we abstract patterns to higher-level descriptions and combine them with prior-knowledge to fill-in the gaps. Consider the Multi-MNIST-Sudoku example (Fig.1): we first guess the digits in each cell based on the patterns; we re-adjust our initial beliefs and re-image the overlapping patterns by reasoning about Sudoku rules and comparing them to the original ones, potentially involving several iterations. Analogously, in a reasoning system, an inference procedure derives what follows from an initial set of axioms and rules. For example, in a standard $9 \mathrm { x } 9$ Sudoku, an inference procedure identifies the missing cell values of the input Sudoku. A constraint solver is a particular type of reasoning system in which axioms and rules are expressed as constraints and the inference procedure is a search method. Formally, DRNets formulate unsupervised pattern de-mixing as a data-driven constrained optimization, incorporating abstractions and reasoning about structure and prior knowledge:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\operatorname* { m i n } _ { \theta } \ \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } ( G ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) , \mathbf { x } _ { i } ) \quad \mathrm { ~ s . t . ~ } \phi _ { \theta } ( \mathbf { x } _ { i } ) \in \Omega ^ { \mathrm { l o c a l } } \mathrm { ~ a n d ~ } ( \phi _ { \theta } ( \mathbf { x } _ { 1 } ) , . . . , \phi _ { \theta } ( \mathbf { x } _ { N } ) ) \in \Omega ^ { \mathrm { g l o b a l } }
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
In this formulation, $\mathbf { x } _ { i } \in R ^ { n }$ is the $i$ -th $n$ -dimensional input data point, $\phi _ { \theta } ( \cdot )$ is the function of the encoder in DRNets parameterized by $\theta$ , $G ( \cdot )$ denotes the generative decoder, $\dot { \mathcal { L } } ( \cdot , \cdot )$ is the loss function (e.g., evaluating the reconstruction of patterns), $\Omega ^ { \mathrm { l o c a l } }$ and $\Omega ^ { \mathrm { g l o b a l } }$ are the constrained spaces w.r.t. a single input data point and several input data points, respectively. $G ( \cdot )$ is in general a fixed pre-trained or parametric model. For example, in Multi-MNIST-Sudoku, $G ( \cdot )$ is a pre-trained conditional GAN (Mirza & Osindero, 2014) using hand-written digits, and for Crystal-Structure-Phase-Mapping, $G ( \cdot )$ is a Gaussian Mixture model. Note that constraints can involve several (potentially all) data points: e.g., in Sudoku, all digits should form a valid Sudoku and in crystal-structure-phase-mapping, all data points in a composition graph should form a valid phase diagram. Thus, we specify local and global constraints in DRNets – local constraints only involve a single input data point whereas global constraints involve several input data points, and they are optimized using different strategies.
|
| 47 |
+
|
| 48 |
+
Solving the constrained optimization problem (1) directly is extremely challenging since the objective function in general involves deep neural networks, which are highly non-linear and non-convex, and prior knowledge often even involves combinatorial constraints (Fig.3). Therefore, we use Lagrangian relaxation to approximate equation (1) with an unconstrained optimization problem, i.e.,
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\operatorname* { m i n } _ { \theta } \ \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } ( G ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) , \mathbf { x } _ { i } ) + \lambda ^ { l } \psi ^ { l } ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) + \sum _ { j = 1 } ^ { N _ { g } } \lambda _ { j } ^ { g } \psi _ { j } ^ { g } ( \{ \phi _ { \theta } ( \mathbf { x } _ { k } ) | k \in S _ { j } \} )
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
$N$ is the number of input data points, $N _ { g }$ denotes the number of global constraints, $S _ { j }$ denotes the set of indices w.r.t. the data points involved in the $j$ -th global constraint, and $\psi ^ { l } , \psi _ { j } ^ { g }$ denote the penalty functions for local constraints and global constraints, respectively, along with their corresponding penalty weights $\lambda ^ { l }$ and $\lambda _ { j } ^ { g }$ . In the following, we propose two mechanisms to tackle the above unconstrained optimization task (Fig.3).
|
| 55 |
+
|
| 56 |
+
Continuous Relaxation: Prior knowledge often involves combinatorial constraints with discrete variables that are difficult to optimize in an end-to-end manner using gradient-based methods. Therefore, we need to design proper continuous relaxations for discrete constraints to make the overall objective function differentiable. Existing works (Hu et al., 2016a; Xu et al., 2017) proposed several relaxations for injecting first-order logic and propositional logic into deep learning. However, limited by the expressive power of those logic formulas, we need a large number of logical terms to express constraints such as $\mathbf { k }$ -sparsity constraints or All-Different constraints. Therefore, to instantiate DRNets for our tasks, we propose a group of entropy-based continuous relaxations to encode general discrete constraints such as sparsity, cardinality and All-Different constraints (see Fig.4). We construct continuous relaxations based on probabilistic modelling of discrete variables, where we model a probability distribution over all possible values for each discrete variable. For example, in Multi-MNIST-Sudoku, a way of encoding the possible two digits in the cell indicated by data point $x _ { i }$ (one from $\{ 1 . . . 4 \}$ and the other from $\{ 5 . . . 8 \}$ ), is to use 8 binary variables $e _ { i , j } \in \{ 0 , 1 \}$ , while requiring $\textstyle \sum _ { j = 1 } ^ { 4 } e _ { i , j } = 1$ and $\textstyle \sum _ { j = 5 } ^ { 8 } e _ { i , j } = 1$ . In DRNets, we model probability distribution $P _ { i }$ and $Q _ { i }$ over digits 1 to 4 and 5 to 8 respectively: $P _ { i , j } , j { = } 1 { \ldots } 4$ and $Q _ { i , j } , j { = } 1 { \ldots } 4$ denote the probability of digit $j$ and the probability of digit $j + 4$ , respectively. We approximate the cardinality constraint of $e _ { i , j }$ by minimizing the entropy of $P _ { i }$ and $Q _ { i }$ , which encourages $P _ { i }$ and $Q _ { i }$ to collapse to one value. Another combinatorial constraint in Multi-MNIST-Sudoku is the All-Different constraint, where all the cells in a constrained set $S$ , i.e., each row, column, and any of four $2 \mathbf { x } 2$ boxes involving the corner cells, must be filled with non-repeating digits. For a probabilistic relaxation of the All-Different constraint, we analogously define the entropy of the averaged digit distribution for all cells in a constrained set $S$ , i.e., $H ( { \bar { P } } _ { S } )$ :
|
| 57 |
+
|
| 58 |
+
Figure 4: Examples of continuous relaxations: $e _ { i , j } , P _ { i } , Q _ { i } , P _ { M }$ denote binary variables, the discrete distribution over digits 1 to 4, the discrete distribution over digits 5 to 8, and the discrete distribution over values 1 to $M$ .
|
| 59 |
+
|
| 60 |
+
<table><tr><td rowspan=1 colspan=1>Cardinality Constraintei,j ∈{0,1} j=1...8s.t.∑=1eij=1and∑j=5eij=1</td><td rowspan=1 colspan=1>Cardinality Constraint Relaxationmin H(Pi)+H(Qi)Θ=-∑=1Pi,jlogPi,j-∑=1Qi,jlogQi,j</td></tr><tr><td rowspan=1 colspan=1>All-Different ConstraintFor all constrained set Ss.t.∑i∈s ei,j = 1 forj = 1...8</td><td rowspan=1 colspan=1>All-Different Constraint RelaxationFor all constrained set SmaxH(Ps)+H(Qs)Θ</td></tr><tr><td rowspan=1 colspan=1>k-Sparsity Constrainteij ∈ {0,1} j=1..M s.t.∑-1eij≤k</td><td rowspan=1 colspan=1>k-SparsityConstraintRelaxationmin max{H(Pm),c},where c <log k</td></tr></table>
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
H ( \hat { P } _ { S } ) = - \sum _ { j = 1 } ^ { 4 } \hat { P } _ { S , j } \log \hat { P } _ { S , j } = - \sum _ { j = 1 } ^ { 4 } \left( \frac { 1 } { | S | } \sum _ { i \in S } P _ { i , j } \right) \log \left( \frac { 1 } { | S | } \sum _ { i \in S } P _ { i , j } \right)
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
In this equation, a larger value implies that the digits in the cells of $S$ distribute more uniformly. Thus, we can analogously approximate All-Different constraints by maximizing $H ( \bar { P } _ { S } ) _ { - }$ and $H ( { \bar { Q } } _ { S } )$ . One can see, by minimizing all $H ( P _ { i } )$ and $H ( Q _ { i } )$ to 0 as well as maximizing all $H ( \bar { P } _ { S } )$ and $H ( Q _ { S } )$ to $\log | S |$ , we find a valid solution for the two 4x4 Sudoku puzzles, where all $P _ { i , j }$ are either 0 or 1.
|
| 67 |
+
|
| 68 |
+
We also relax $k$ -sparsity constraints, which for example in Crystal-Phase-Mapping state the maximum number $k$ of pure phases in an XRD-pattern, by minimizing the entropy of the phase distribution $P _ { M }$ below a threshold $c < \log k$ . We choose the threshold $c < \log k$ because the entropy of a discrete distribution $P _ { M }$ concentrated on at most $k$ values cannot exceed $\log k$ . Note that other relaxations can be adapted in DRNets, for these and other tasks. See also additional relaxations (e.g., for SAT constraints), detailed relaxation derivations, and implementation details in supplementary materials.
|
| 69 |
+
|
| 70 |
+
Constraint-Aware Stochastic Gradient Descent: We introduce a variant of standard SGD method called constraint-aware SGD, which is conceptually similar to the optimization process in GraphRNN (You et al., 2018), to tackle the optimization of global penalty functions $\psi _ { j } ^ { \dot { g } } ( \{ \phi _ { \underline { { \theta } } } ( \mathbf { x } _ { k } ) | k \ \in \ S _ { j } \} )$ , which involve several (potentially all) data points. We define a constraint graph, an undirected
|
| 71 |
+
|
| 72 |
+
Input: (i) Data points $\{ x _ { i } \} _ { i = 1 } ^ { N }$ . (ii) Constraint graph. (iii) Penalty functions $\psi ^ { l } ( \cdot )$ and $\psi _ { j } ^ { g } ( \cdot )$ for the local and the global constraints. (iv) Pre-trained or parametric generative decoder $G \bar { ( \cdot ) }$ . 1: Initialize the penalty weights $\lambda ^ { l } , \lambda _ { j } ^ { g }$ and thresholds for all constraints.
|
| 73 |
+
2: for number of optimization iterations do
|
| 74 |
+
3: Batch data points $\{ \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { m } \}$ from the sampled (maximal) connected components. 4: Collect the global penalty functions $\{ \psi _ { j } ^ { g } ( \cdot ) \} _ { j = 1 } ^ { \hat { M } }$ concerning those data points.
|
| 75 |
+
5: Compute the latent space $\{ \phi _ { \theta } ( \mathbf { x } _ { 1 } ) , . . . , \bar { \phi } _ { \theta } ( \mathbf { x } _ { m } ) \}$ from the encoder.
|
| 76 |
+
6: Adjust the penalty weights $\lambda _ { l } , \lambda _ { j } ^ { g }$ and thresholds accordingly.
|
| 77 |
+
7: minimize $\begin{array} { r } { \frac { 1 } { m } \big ( \sum _ { i = 1 } ^ { m } \mathcal { L } ( G ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) , \mathbf { x } _ { i } ) + \lambda _ { l } \psi ^ { l } ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) \big ) + \sum _ { j = 1 } ^ { M } \lambda _ { j } ^ { g } \psi _ { j } ^ { g } ( \{ \phi _ { \theta } ( \mathbf { x } _ { k } ) | k \ \in \ S _ { j } \} ) } \end{array}$ using any standard gradient-based optimization method and update the parameters $\theta$ . 8: end for
|
| 78 |
+
|
| 79 |
+
graph in which each data point forms a vertex and two data points are linked if they are in the same global constraint. Constraint-aware SGD batches data points from the randomly sampled (maximal) connected components in the constraint graph, and optimizes the objective function w.r.t. the subset of global constraints concerning those data points and the associated local constraints. For example, in Multi-MNIST-Sudoku, each overlapping Sudoku forms a maximal connected component, we batch the data points from several randomly sampled overlapping Sudokus and optimize the All-Different constraints (global) as well as the cardinality constraints (local) within them. However, in Crystal-Structure-Phase-Mapping, the maximal connected component becomes too large to batch together, due to the constraints (phase field connectivity and Gibbs-alloying rule) concerning all data points in the composition graph. Thus, we instead only batch a subset (still a connected component) of the maximal connected component – e.g., a path in the composition graph, and optimize the objective function that only concerns constraints within the subset (along the path). By iteratively solving sampled local structures of the ”large” maximal component, we cost-efficiently approximate the entire global constraint. Moreover, for optimizing the overall objective, constraint-aware SGD dynamically adjusts the thresholds and the weights of constraints according to their satisfiability, which can involve non-differentiable functions (See details in appendix). For efficiency and potential capability of generalization, DRNets solve all instances together using constraint-aware SGD (see Algorithm 2).
|
| 80 |
+
|
| 81 |
+
Algorithm 1 Constraint-aware stochastic gradient descent optimization of deep reasoning networks.
|
| 82 |
+
|
| 83 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=2>Accuracy(%)</td><td rowspan=2 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>Digit</td><td rowspan=1 colspan=1>Sudoku</td></tr><tr><td rowspan=1 colspan=1>DRNets (Optimization w/Restart)</td><td rowspan=1 colspan=1>100.0</td><td rowspan=1 colspan=1>100.0</td><td rowspan=1 colspan=1>50min</td></tr><tr><td rowspan=1 colspan=1>DRNets (Optimization)</td><td rowspan=1 colspan=1>99.9</td><td rowspan=1 colspan=1>98.6</td><td rowspan=1 colspan=1>28min</td></tr><tr><td rowspan=1 colspan=1>DRNets (Optimization w/oReasoning)</td><td rowspan=1 colspan=1>88.8</td><td rowspan=1 colspan=1>15.0</td><td rowspan=1 colspan=1>110min</td></tr><tr><td rowspan=1 colspan=1>DRNets (Generalization)</td><td rowspan=1 colspan=1>98.0</td><td rowspan=1 colspan=1>75.7</td><td rowspan=1 colspan=1>13min+4hrs</td></tr><tr><td rowspan=1 colspan=1>CapsuleNet</td><td rowspan=1 colspan=1>97.9</td><td rowspan=1 colspan=1>50.9</td><td rowspan=1 colspan=1>1min+30min</td></tr><tr><td rowspan=1 colspan=1>CapsuleNet + local search</td><td rowspan=1 colspan=1>97.9</td><td rowspan=1 colspan=1>57.8</td><td rowspan=1 colspan=1>3hrs+30mins</td></tr><tr><td rowspan=1 colspan=1>ResNet-18</td><td rowspan=1 colspan=1>97.7</td><td rowspan=1 colspan=1>68.5</td><td rowspan=1 colspan=1>3min+10hrs</td></tr><tr><td rowspan=1 colspan=1>ResNet-18 + local search</td><td rowspan=1 colspan=1>97.7</td><td rowspan=1 colspan=1>88.3</td><td rowspan=1 colspan=1>3hrs+10hrs</td></tr></table>
|
| 84 |
+
|
| 85 |
+
# 4 EXPERIMENTS
|
| 86 |
+
|
| 87 |
+
We illustrate the power of DRNets mainly on two pattern de-mixing tasks – disentangling two overlapping hand-written Sudokus (Multi-MNIST-Sudoku) and inferring crystal structures of materials from X-ray diffraction data (Crystal-Structure-Phase-Mapping). Limited by the space, we put the details of the experiments and the experimental results of DRNets on other tasks in supplementary material. Note that, since DRNets are an unsupervised framework, we can apply the restart (Gomes et al., 1998) mechanism, i.e., we can re-run DRNets for unsolved instances.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 5: Left: The latent space of DRNets for Multi-MNIST-Sudoku. Right: Accuracy comparison. We show ”test time $^ +$ training time” for supervised baselines and the generalization mode of DRNet, and ”solving time” for the optimization mode of DRNets. (See also supplementary materials.)
|
| 91 |
+
|
| 92 |
+
Multi-MNIST-Sudoku: We generated 160,000 input data points for each training set, validation set and test set, where each data point corresponds to a $3 2 \mathbf { x } 3 2$ image of overlapping digits coming from MNIST (LeCun et al., 1998) and every 16 data points form a 4-by-4 overlapping Sudokus. For Multi-MNIST-Sudoku, DRNets batch every 16 data points together to enforce the All-Different constraints among the cells of each Sudoku. The encoder of DRNets is composed of two ResNet-18 He et al. (2016) and we use a conditional GAN (Mirza & Osindero, 2014) as our generative decoder (denoted as $G ( \cdot ) )$ ), which is trained using the digits in the training set of MNIST. For each cell $\mathbf { x } _ { i }$ , the encoder encodes a latent space, which consists of two parts: The first part includes two distribution $P _ { i }$ and $Q _ { i }$ (see Fig.5) concerning the possible digits in the cell, and the second part is the latent encodings $z _ { i , 1 } , . . . , z _ { i , 8 }$ of each possible digit conditioned on the overlapping digits, which is used by the generative decoder to generate the corresponding digits $G ( z _ { i , j } )$ . We estimate the two digits in the cell by computing the expected digits over $P _ { i }$ and $Q _ { i }$ , i.e., $\textstyle \sum _ { j = 1 } ^ { 4 } P _ { i , j } G ( z _ { i , j } )$ and $\textstyle \sum _ { j = 1 } ^ { 4 } Q _ { i , j } G ( z _ { i , j + 4 } )$ , and reconstruct the original input mixture (see Fig.5). As described above, we impose the continuous relaxation of the cardinality and All-Different constraints to reason about the the Sudoku structure among cells of the overlapping Sudokus. To demonstrate the power of reasoning, we compared our unsupervised DRNets with supervised start-of-the-art MNIST de-mixing models – CapsuleNet (Sabour et al., 2017) and ResNet (He et al., 2016), and a variant of DRNets that removes the reasoning modules (”DRNets w/o Reasoning”). To saturate the performance of baseline models, we also applied a post-process local search for them to incorporate the Sudoku Rules. Specifically, we did a local search for the top-2 (top-3 would take too long to search) most likely choice of digits for each Sudoku of the two overlapping Sudokus and try to satisfy Sudoku rules with minimal modification compared with the original prediction. We evaluate both the percentage of digits that are correctly de-mixed (digit accuracy) and the percentage of overlapping Sudokus that have all digits correctly de-mixed (Sudoku accuracy). Empowered by reasoning, DRNets significantly outperformed CapsuleNet, ResNet, and DRNets without reasoning, perfectly recovered all digits with the restart mechanism (see Fig.5), and additionally reconstructed the mixture with high-quality (see Fig.1). Moreover, because DRNets solve all instances together (see Algorithm 2), not only can DRNets solve instances directly on the test set from random initialization, DRNets can also generalize from the training set to test set, given enough training examples. DRNets learn to generalize its de-mixing performance on the test set by solving the training set instances self-supervised (Jing & Tian, 2019) by Sudoku rules, instead of labels, and even outperform CapsuleNet and ResNet (Fig.5). Note that, for unseen instances in the test set, we further optimize the instances for 25 steps to achieve the reported performance (Additional details in the supplementary material).
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 6: The latent space of DRNets for Crystal-Structure-Phase-Mapping. $M$ denotes the number of possible phases. (For Al-Li-Fe, $M = 1 5 9$ ; For Bi- $\mathbf { \mathrm { C u } }$ -V, $M = 1 0 0 .$ .)
|
| 96 |
+
|
| 97 |
+
Crystal-Structure-Phase-Mapping concerns inferring crystal structures from a set of X-ray diffraction measurements (XRDs) of a given chemical system, satisfying thermodynamic constraints. Crystal structure phase mapping is a very challenging task, a major bottleneck in high-throughput materials discovery: Each X-ray measurement may involve several mixed crystal structures; each chemical system includes hundreds of possible crystal structures; for each crystal structure pattern, we only have a theoretical (idealized) model of pure crystal phases; the thermodynamic rules are also complex; and the crystal patterns are difficult for human experts to interpret. Herein, we illustrate DRNet for crystal structure phase mapping for two chemical systems: (1) a ternary Al-Li-Fe oxide system (Le Bras et al., 2014), which is theoretically based, synthetically generated, with ground truth solutions, and (2) a ternary Bi-Cu-V oxide system, which is a more challenging real experiment-based system, more noisy and uncertain. For each system, each input data point is the XRD of a mixture of crystal structures. Additionally, the input includes the composition graph specifying elemental compositions and the constraint graph of the data points. We also collected a library of possible crystal structures from the International Centre for Diffraction Data (ICDD) database. Each crystal structure (also named phase) is given as a list of diffraction peak location-amplitude pairs, (referred to as stick pattern), representing the ideal phase patterns measured in a perfect condition (see Fig.6). To model more realistic conditions, DRNets simulate the real phase patterns from stick patterns using Gaussian mixture models, where the relative peak locations and mixture coefficients are given by the stick locations and amplitudes. Moreover, the peak width, peak location shift, and peak amplitude variance are parameterized by the latent encoding $z _ { i , j }$ and used by the generative decoder to generate the corresponding possible phase patterns in the reconstructed XRD measurement.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 7: Left: Comparison of phase concentration and reconstruction loss for different methods in Al-Li-Fe oxide system. Note that, 6 pure phases (out of 159 possible candidates) appear in the system and result in 15 different mixtures. Each dot represents an XRD measurement whose size is proportional to the estimated phase concentration. DRNet’s phase concentration closely match the ground truth in contrast to IAFD’s and NMF-k’s. The heatmap on the right shows that DRNets reconstruct the XRD measurements much better than other methods with respect to the L1 loss. Right: DRNets outperform both IAFD and NMF- $\mathbf { \nabla } \cdot \mathbf { k }$ with better reconstruction error and perfect rule satisfaction on both systems. (additional details for Bi-Cu-V in the supplementary material).
|
| 101 |
+
|
| 102 |
+
<table><tr><td rowspan=1 colspan=1>ChemicalSystems:</td><td rowspan=1 colspan=2>ReconstructionLosses</td><td rowspan=1 colspan=1>PhaseFidelity Loss</td><td rowspan=1 colspan=3>Thermodynamic Rules Satisfaction(Percentage of data points / phasefield that satisfy each constraint)</td></tr><tr><td rowspan=1 colspan=1>Al-Li-Fe</td><td rowspan=1 colspan=1>L1Loss</td><td rowspan=1 colspan=1>L2Loss</td><td rowspan=1 colspan=1>JS distance(×10-2)</td><td rowspan=1 colspan=1>Gibbs</td><td rowspan=1 colspan=1>Gibbs-Alloy</td><td rowspan=1 colspan=1>Phase FieldConnectivity</td></tr><tr><td rowspan=1 colspan=1>DRNets</td><td rowspan=1 colspan=1>0.039</td><td rowspan=1 colspan=1><0.001</td><td rowspan=1 colspan=1><0.001</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td></tr><tr><td rowspan=1 colspan=1>IAFD</td><td rowspan=1 colspan=1>5.994</td><td rowspan=1 colspan=1>0.535</td><td rowspan=1 colspan=1>11.30</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td></tr><tr><td rowspan=1 colspan=1>NMF-k</td><td rowspan=1 colspan=1>7.267</td><td rowspan=1 colspan=1>0.438</td><td rowspan=1 colspan=1>56.10</td><td rowspan=1 colspan=1>94%</td><td rowspan=1 colspan=1>87%</td><td rowspan=1 colspan=1>71%</td></tr><tr><td rowspan=1 colspan=1>Bi-Cu-V</td><td rowspan=1 colspan=1>L1Loss</td><td rowspan=1 colspan=1>L2Loss</td><td rowspan=1 colspan=1>JS distance(×10-2)</td><td rowspan=1 colspan=1>Gibbs</td><td rowspan=1 colspan=1>Gibbs-Alloy</td><td rowspan=1 colspan=1>Phase FieldConnectivity</td></tr><tr><td rowspan=1 colspan=1>DRNets</td><td rowspan=1 colspan=1>3.993</td><td rowspan=1 colspan=1>0.196</td><td rowspan=1 colspan=1>8.370</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>100%</td></tr><tr><td rowspan=1 colspan=1>IAFD</td><td rowspan=1 colspan=1>7.425</td><td rowspan=1 colspan=1>0.545</td><td rowspan=1 colspan=1>93.36</td><td rowspan=1 colspan=1>100%</td><td rowspan=1 colspan=1>99%</td><td rowspan=1 colspan=1>95%</td></tr><tr><td rowspan=1 colspan=1>NMF-k</td><td rowspan=1 colspan=1>8.033</td><td rowspan=1 colspan=1>0.675</td><td rowspan=1 colspan=1>92.63</td><td rowspan=1 colspan=1>51%</td><td rowspan=1 colspan=1>35%</td><td rowspan=1 colspan=1>83%</td></tr></table>
|
| 103 |
+
|
| 104 |
+
We compared DRNets with IAFD (Bai et al., 2017) and NMF- $\mathbf { \nabla } \cdot \mathbf { k }$ (Stanev et al., 2018), which are both state-of-the-art non-negative matrix factorization (NMF) based unsupervised de-mixing models. NMF-k improves the pure NMF algorithm (Long et al., 2009) by clustering common phase patterns from thousands of runs. However, NMF-k does not directly enforce thermodynamic rules and therefore the solutions produced are often not completely physically meaningful. IAFD uses external mixed-integer programming modules to enforce thermodynamic rules during the de-mixing. However, due to the gap between the external optimizer and NMF module, the solution of IAFD is still far from the ground truth. Our evaluation criteria include reconstruction losses, phase fidelity loss and the satisfaction of thermodynamic rules. Note that, the phase fidelity loss measures the JS distance between the de-mixed phases and the closest ideal phases by fitting the de-mixed phases with the ICDD stick patterns using the physical model (Le Bras et al., 2014). As shown in Fig.7, for the Al-Li-Fe oxide system, the phase concentration (the distribution of de-mixed pure phases over all data points of that chemical system) of either IAFD or NMF-k is far from the ground truth. In contrast, DRNet almost exactly recovered the ground truth solution by seamlessly integrating pattern recognition, reasoning and prior knowledge. Moreover, by explicitly incorporating the ICDD stick pattern information into DRNets, the phases de-mixed by DRNets are much more real than those from IAFD and NMF-k (see phase fidelity loss). For Bi-Cu-V oxide system, DRNets solved this previously unsolved real system, producing valid crystal structures and significantly outperforming IAFD and NMF-k w.r.t. reconstruction errors and phase fidelity loss. In addition, materials science experts thoroughly checked DRNet’s solution of Bi-Cu-V oxide system, approved it, and subsequently discovered a new material that is important for solar fuels technology.
|
| 105 |
+
|
| 106 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 107 |
+
|
| 108 |
+
We propose DRNets, a powerful end-to-end framework that combines deep learning with logical and constraint reasoning for solving unsupervised pattern de-mixing tasks. DRNets outperform the state of the art for de-mixing MNIST Sudokus and crystal-structure phase mapping, solving previously unsolved chemical systems substantially beyond the reach of other methods and materials science experts’ capabilities. While we illustrate the potential of DRNets with unsupervised settings, it is straightforward to impose supervision into DRNets. Future research includes exploring DRNets for incorporating other types of constraints, prior knowledge, and objective functions, for other applications.
|
| 109 |
+
|
| 110 |
+
# REFERENCES
|
| 111 |
+
|
| 112 |
+
Saeed Amizadeh, Sergiy Matusevych, and Markus Weimer. Pdp: A general neural framework for learning constraint satisfaction solvers. arXiv preprint arXiv:1903.01969, 2019.
|
| 113 |
+
|
| 114 |
+
Junwen Bai, Johan Bjorck, Yexiang Xue, Santosh K Suram, John Gregoire, and Carla Gomes. Relaxation methods for constrained matrix factorization problems: solving the phase mapping problem in materials discovery. In International Conference on AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, pp. 104–112. Springer, 2017.
|
| 115 |
+
|
| 116 |
+
Junwen Bai, Sebastian Ament, Guillaume Perez, John Gregoire, and Carla Gomes. An efficient relaxed projection method for constrained non-negative matrix factorization with application to the phase-mapping problem in materials science. In International Conference on the Integration of Constraint Programming, Artificial Intelligence, and Operations Research, pp. 52–62. Springer, 2018.
|
| 117 |
+
|
| 118 |
+
Stefano Ermon, Ronan Le Bras, Santosh K Suram, John M Gregoire, Carla P Gomes, Bart Selman, and Robert B Van Dover. Pattern decomposition with complex combinatorial constraints: Application to materials discovery. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015.
|
| 119 |
+
|
| 120 |
+
Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 11(Jul):2001–2049, 2010.
|
| 121 |
+
|
| 122 |
+
Artur d’Avila Garcez, Marco Gori, Luis C Lamb, Luciano Serafini, Michael Spranger, and Son N Tran. Neural-symbolic computing: An effective methodology for principled integration of machine learning and reasoning. arXiv preprint arXiv:1905.06088, 2019.
|
| 123 |
+
|
| 124 |
+
Carla P Gomes, Bart Selman, Henry Kautz, et al. Boosting combinatorial search through randomization. AAAI/IAAI, 98:431–437, 1998.
|
| 125 |
+
|
| 126 |
+
Gordon Royle. Minimum sudoku, 2014. URL http://staffhome.ecm.uwa.edu.au/ ˜00013890/sudokumin.php.
|
| 127 |
+
|
| 128 |
+
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.
|
| 129 |
+
|
| 130 |
+
Geoffrey E Hinton, Zoubin Ghahramani, and Yee Whye Teh. Learning to parse images. In Advances in neural information processing systems, pp. 463–469, 2000.
|
| 131 |
+
|
| 132 |
+
Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. arXiv preprint arXiv:1603.06318, 2016a.
|
| 133 |
+
|
| 134 |
+
Zhiting Hu, Zichao Yang, Ruslan Salakhutdinov, and Eric Xing. Deep neural networks with massive learned knowledge. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1670–1679, 2016b.
|
| 135 |
+
|
| 136 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 137 |
+
|
| 138 |
+
Longlong Jing and Yingli Tian. Self-supervised visual feature learning with deep neural networks: A survey. arXiv preprint arXiv:1902.06162, 2019.
|
| 139 |
+
|
| 140 |
+
Khanrc. Mnist!: learn mnist classifier with very high accuracy, 2017. URL https://github. com/khanrc/mnist.
|
| 141 |
+
|
| 142 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 143 |
+
|
| 144 |
+
Laodar. A tensorflow implementation for capsnet, 2017. URL https://github.com/laodar/ tf_CapsNet.
|
| 145 |
+
|
| 146 |
+
Ronan Le Bras, Richard Bernstein, John M Gregoire, Santosh K Suram, Carla P Gomes, Bart Selman, and R Bruce Van Dover. Challenges in materials discovery–synthetic generator and real datasets. In Twenty-Eighth AAAI Conference on Artificial Intelligence, 2014.
|
| 147 |
+
|
| 148 |
+
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.
|
| 149 |
+
|
| 150 |
+
Erik Linder-Noren. Pytorch-gan, 2019. URL https://github.com/eriklindernoren/ PyTorch-GAN.
|
| 151 |
+
|
| 152 |
+
CJ Long, D Bunker, X Li, VL Karen, and I Takeuchi. Rapid identification of structural phases in combinatorial thin-film libraries using x-ray diffraction and non-negative matrix factorization. Review of Scientific Instruments, 80(10):103902, 2009.
|
| 153 |
+
|
| 154 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
|
| 155 |
+
|
| 156 |
+
David Mitchell, Bart Selman, and Hector Levesque. Hard and easy distributions of sat problems. In AAAI, volume 92, pp. 459–465, 1992.
|
| 157 |
+
|
| 158 |
+
Rasmus Berg Palm, Ulrich Paquet, and Ole Winther. Recurrent relational networks for complex relational reasoning. arXiv preprint arXiv:1711.08028, 2017.
|
| 159 |
+
|
| 160 |
+
Deepak Pathak, Philipp Krahenbuhl, and Trevor Darrell. Constrained convolutional neural networks for weakly supervised segmentation. In Proceedings of the IEEE international conference on computer vision, pp. 1796–1804, 2015.
|
| 161 |
+
|
| 162 |
+
Herbert Robbins and Sutton Monro. A stochastic approximation method. In Herbert Robbins Selected Papers, pp. 102–109. Springer, 1985.
|
| 163 |
+
|
| 164 |
+
Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in neural information processing systems, pp. 3856–3866, 2017.
|
| 165 |
+
|
| 166 |
+
Daniel Selsam, Matthew Lamm, Benedikt Bunz, Percy Liang, Leonardo de Moura, and David L Dill. ¨ Learning a sat solver from single-bit supervision. arXiv preprint arXiv:1802.03685, 2018.
|
| 167 |
+
|
| 168 |
+
Radhika Shivhare and Ch Aswani Kumar. On the cognitive process of abstraction. Procedia Computer Science, 89:243–252, 2016.
|
| 169 |
+
|
| 170 |
+
Valentin Stanev, Velimir V Vesselinov, A Gilad Kusne, Graham Antoszewski, Ichiro Takeuchi, and Boian S Alexandrov. Unsupervised phase mapping of $\mathbf { X }$ -ray diffraction data by nonnegative matrix factorization integrated with custom clustering. npj Computational Materials, 4(1):43, 2018.
|
| 171 |
+
|
| 172 |
+
Po-Wei Wang, Priya L Donti, Bryan Wilder, and Zico Kolter. Satnet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver. arXiv preprint arXiv:1905.12149, 2019.
|
| 173 |
+
|
| 174 |
+
Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. Empirical evaluation of rectified activations in convolutional network. arXiv preprint arXiv:1505.00853, 2015.
|
| 175 |
+
|
| 176 |
+
Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. arXiv preprint arXiv:1711.11157, 2017.
|
| 177 |
+
|
| 178 |
+
Yexiang Xue, Junwen Bai, Ronan Le Bras, Brendan Rappazzo, Richard Bernstein, Johan Bjorck, Liane Longpre, Santosh K Suram, Robert B van Dover, John Gregoire, et al. Phase-mapper: an ai platform to accelerate high throughput materials discovery. In Twenty-Ninth IAAI Conference, 2017.
|
| 179 |
+
|
| 180 |
+
Jiaxuan You, Rex Ying, Xiang Ren, William L Hamilton, and Jure Leskovec. Graphrnn: Generating realistic graphs with deep auto-regressive models. arXiv preprint arXiv:1802.08773, 2018.
|
| 181 |
+
|
| 182 |
+
Ning Zhang, Junchi Yan, and Yuchen Zhou. Weakly supervised audio source separation via spectrum energy preserved wasserstein learning. arXiv preprint arXiv:1711.04121, 2017.
|
| 183 |
+
|
| 184 |
+
Xingyi Zhou, Xiao Sun, Wei Zhang, Shuang Liang, and Yichen Wei. Deep kinematic pose regression. In European Conference on Computer Vision, pp. 186–201. Springer, 2016.
|
| 185 |
+
|
| 186 |
+
Xingyi Zhou, Qixing Huang, Xiao Sun, Xiangyang Xue, and Yichen Wei. Weaklysupervised transfer for 3d human pose estimation in the wild. In IEEE International Conference on Computer Vision, volume 206, pp. 3, 2017.
|
| 187 |
+
|
| 188 |
+
# A SUPPLEMENTARY MATERIALS
|
| 189 |
+
|
| 190 |
+
Herein, we provide additional details about DRNets and our experimental settings for a better understanding of DRNets and reproducibility of our results. Code and datasets to reproduce the experiments will be provided with the final version of the paper.
|
| 191 |
+
|
| 192 |
+
# A.1 CONTINUOUS RELAXATION
|
| 193 |
+
|
| 194 |
+
In this section, we provide more relxations for other constraints such as SAT constraints and provide an intuitive high-level informal proof that all the relaxations converge to a valid solution of the discrete version when it achieves its minimal value. Fig.8 summarizes the relaxations.
|
| 195 |
+
|
| 196 |
+
Figure 8: Examples of continuous relaxations: $e _ { i , j } , P _ { i } , Q _ { i } , P _ { M } , N _ { c } , N _ { l } , K _ { j } , \lambda _ { h } ,$ $B _ { i }$ denote binary variables, the discrete distribution over digits 1 to 4, the discrete distribution over digits 5 to 8, the discrete distribution over values 1 to $M$ , the number of clauses, the number of literals, the number of literals in the $j$ -th clause, the weights of entropy terms, and the Bernoulli distribution for the $i$ -th literal. ”leaky relu” is the leaky ReLU.
|
| 197 |
+
|
| 198 |
+
<table><tr><td rowspan=1 colspan=1>Cardinality Constraintei,j ∈{0,1} j= 1...8s.t.∑=1eij=1and∑j=5eij=1</td><td rowspan=1 colspan=1>Cardinality ConstraintRelaxationmin H(Pi)+H(Qi)e=-∑=1Pi,jlog Pi,j-∑=1Qi,jlogQi,j</td></tr><tr><td rowspan=1 colspan=1>All-Different ConstraintFor all constrained set Ss.t.∑i∈s ei,j = 1 forj = 1...8</td><td rowspan=1 colspan=1>All-Different ConstraintRelaxationFor all constrained set SmaxH(Ps)+H(Qs)0</td></tr><tr><td rowspan=1 colspan=1>k-Sparsity Constrainteij ∈{0,1} j=1...M s.t.∑1ei,j ≤k</td><td rowspan=1 colspan=1>k-Sparsity Constraint Relaxationmin max{H(Pm),c},where c <log k0</td></tr><tr><td rowspan=1 colspan=1>Integer Programming Encoding of SATFor any literal xi and its negation xi,s.t.xi,xi∈{0,1} and xi+xi=1For any clause Cj = αj,1 V.V ajKj</td><td rowspan=1 colspan=1>SATRelaxationFor any literal xi and its negation xi (i = 1..Nt),we modela distribution Bi~Bern(piqi),s.t.xi=Pi,and xi=qiFor all clause Cj = αj,1 V …V aj,Kj,j= 1 ... NcmjnΣ1leakyrelu(1-Σaj)+n∑1H(B)</td></tr></table>
|
| 199 |
+
|
| 200 |
+
For cardinality constraints, when the entropy of distribution $P _ { i }$ and $Q _ { i }$ reaches 0, all the probability mass collapses to only one variable. Therefore, all $P _ { i , j }$ and $Q _ { i , j }$ are either 0 or 1, which is a valid solution of the original discrete constraints.
|
| 201 |
+
|
| 202 |
+
For All-Different constraints, we maximize the entropy of the averaged digit distribution for all cells in a constrained set $S$ , i.e., $H ( \bar { P } _ { S } )$ . Note that, the All-Different constraints are imposed together with the cardinality constraints. Therefore, when the entropy of the digit distribution in each cell is zero, we know that the digit distribution of each cell converges to one digit. Hence, if $H ( \bar { P } _ { S } )$ reaches its maximum, i.e., $\log | S |$ , we have $\begin{array} { r } { \frac { 1 } { | S | } \sum _ { i \in S } P _ { i , j } = \frac { 1 } { | S | } } \end{array}$ for all digit $j$ . Crossed with the fact that $P _ { i , j }$ are either 0 or 1 when the cardinality constraints are satisfied, we know that only one $P _ { i , j }$ is equal to 1 for all cell $i$ in the set $S$ and others are 0, which directly states the All-Different constraints.
|
| 203 |
+
|
| 204 |
+
We derive the k-Sparsity constraints in a similar way as the cardinality constraints except that we now want to force the distribution to concentrate on at most $\mathrm { k }$ digits. By normalizing the values of discrete variables $e _ { i , j }$ $( j = 1 . . . M )$ to a discrete distribution $P _ { M }$ , we can minimize the entropy of distribution $P _ { M }$ to at most $\log k$ , which is the maximal entropy when the distribution concentrates on only $k$ values. Though, $H ( P _ { M } ) < \log k$ is not a sufficient condition for $\mathbf { k }$ -sparsity, we can initialize the threshold $c$ of $\mathbf { k }$ -sparsity constraints to $\log k$ and dynamically adjust the value of $c$ based on the satisfaction of the $\mathbf { k }$ -sparsity constraints. In practice, it works well with the supervision from other modules, such as the self-reconstruction.
|
| 205 |
+
|
| 206 |
+
For SAT constraint relaxations, the key idea is to minimize the entropy of the Bernoulli distribution over each literal to force it converge to either 1 or 0. Then, we maximize the sum of the value of literals in each clause (or their negation) to encourage one of the literals to be 1. However, maximizing the sum of the value of literals does not necessarily give you a valid assignment because there could exist an assignment that the sum of literals in some clauses are 0 and the sum of literals in other clauses are very large. Therefore, we use leaky rule ( $\mathrm { { X u } }$ et al., 2015) function to discount the loss when the sum is larger than 1. As shown in Fig.8, we formulate the relaxation loss function in a form to be minimized. For k-SAT problems with $N _ { c }$ clauses, we can set the leaky ratio to be 1N k , so that any invalid assignment cannot have a loss that is less or equal to 0. On the other hand, for any valid assignment, the sum of literals in each clause is at least 1. Thus, we can obtain a valid assignment of k-SAT constraints by minimizing the loss function to 0.
|
| 207 |
+
|
| 208 |
+
We describe other task specific constraints (e.g., phase field connectivity constraints) in the following experimental sections.
|
| 209 |
+
|
| 210 |
+
# A.2 CONSTRAINT-AWARE STOCHASTIC GRADIENT DESCENT:
|
| 211 |
+
|
| 212 |
+
Algorithm 2 Constraint-aware stochastic gradient descent optimization of deep reasoning networks.
|
| 213 |
+
|
| 214 |
+
Input: (i) Data points $\{ x _ { i } \} _ { i = 1 } ^ { N }$ . (ii) Constraint graph. (iii) Penalty functions $\psi ^ { l } ( \cdot )$ and $\psi _ { j } ^ { g } ( \cdot )$ for the local and the global constraints. (iv) Pre-trained or parametric generative decoder $G ( \cdot )$ .
|
| 215 |
+
1: Initialize the penalty weights $\lambda ^ { l } , \lambda _ { j } ^ { g }$ and thresholds for all constraints.
|
| 216 |
+
2: for number of optimization iterations do
|
| 217 |
+
3: Batch data points $\{ \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { m } \}$ from the sampled (maximal) connected components.
|
| 218 |
+
4: Collect the global penalty functions $\{ \psi _ { j } ^ { g } ( \cdot ) \} _ { j = 1 } ^ { \hat { M } }$ concerning those data points.
|
| 219 |
+
5: Compute the latent space $\{ \phi _ { \theta } ( \mathbf { x } _ { 1 } ) , . . . , \phi _ { \theta } ( \mathbf { x } _ { m } ) \}$ from the encoder.
|
| 220 |
+
6: Adjust the penalty weights $\lambda _ { l } , \lambda _ { j } ^ { g }$ and thresholds accordingly.
|
| 221 |
+
7: minimize $\begin{array} { r } { \frac { 1 } { m } \big ( \sum _ { i = 1 } ^ { m } \mathcal { L } ( G ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) , \mathbf { x } _ { i } ) + \lambda _ { l } \psi ^ { l } ( \phi _ { \theta } ( \mathbf { x } _ { i } ) ) \big ) + \sum _ { j = 1 } ^ { M } \lambda _ { j } ^ { g } \psi _ { j } ^ { g } ( \{ \phi _ { \theta } ( \mathbf { x } _ { k } ) | k \ \in \ S _ { j } \} ) } \end{array}$ using any standard gradient-based optimization method and update the parameters $\theta$ .
|
| 222 |
+
|
| 223 |
+
We introduce a variant of standard SGD method called constraint-aware SGD, which is conceptually similar to the optimization process in GraphRNN (You et al., 2018), to tackle the optimization of global penalty functions $\psi _ { j } ^ { \dot { g _ { ( } } } ( \{ \phi _ { \theta } ( \mathbf { x } _ { k } ) | k \in \mathsf { \bar { S } } _ { j } \} )$ , which involve several (potentially all) data points. We define a constraint graph, an undirected graph in which each data point forms a vertex and two data points are linked if they are in the same global constraint. Constraint-aware SGD batches data points from the randomly sampled (maximal) connected components in the constraint graph, and optimizes the objective function w.r.t. the subset of global constraints concerning those data points and the associated local constraints. For example, in Multi-MNIST-Sudoku, each overlapping Sudoku forms a maximal connected component, we batch the data points from several randomly sampled overlapping Sudokus and optimize the All-Different constraints (global) as well as the cardinality constraints (local) within them. However, in Crystal-Structure-Phase-Mapping, the maximal connected component becomes too large to batch together, due to the constraints (phase field connectivity and Gibbs-alloying rule) concerning all data points in the composition graph. Thus, we instead only batch a subset (still a connected component) of the maximal connected component – e.g., a path in the composition graph, and optimize the objective function that only concerns constraints within the subset (along the path). By iteratively solving sampled local structures of the ”large” maximal component, we cost-efficiently approximate the entire global constraint.
|
| 224 |
+
|
| 225 |
+
Moreover, for optimizing the overall objective, constraint-aware SGD dynamically adjusts the thresholds and the weights of constraints according to their satisfiability, which can involve nondifferentiable functions. Specifically, we initialize penalty weights of constraints and thresholds for penalty functions using hyper-parameters. During training, we check the satisfiability of constraints (this step could involve non-differentiable functions) after several epochs and increase the penalty for violated constraints. For example, the threshold $c$ of $\mathbf { k }$ -sparsity is initialized as $\log k$ , which is the entropy of the case that the probability mass is evenly distributed among $k$ entities. Thus, it could be the case that there are more than $k$ entities, but their probability mass is not evenly distributed. Hence, we check the satisfiability of k-sparsity constraint: if the entropy is already below the current threshold $( \log k )$ and there are still more than $k$ entities with probability mass more than $\epsilon \left( 0 . 0 1 \right)$ , we decrease the threshold $c$ to keep enforcing the model to minimize the entropy to reach the k-sparsity.
|
| 226 |
+
|
| 227 |
+
Finally, to better exploit parallelization, DRNets solve all instances together using constraint-aware SGD (see Algorithm 2).
|
| 228 |
+
|
| 229 |
+
# A.3 RESTART MECHANISM FOR DRNETS:
|
| 230 |
+
|
| 231 |
+
Note that, since DRNets are an unsupervised framework, we can apply the restart (Gomes et al., 1998) mechanism, i.e., we can re-run DRNets for unsolved instances. Specifically, since DRNets directly incorporate logical constraints, we can check whether those constraints are satisfied at the end of a run. If not, for instances with violated constraints, we re-run the algorithm again on them. We only applied restart mechanism on Multi-MNIST-Sudoku and other NP-C problems (in the appendix) such as 3-SAT problems and standard Sudoku problems. For crystal-structure phase mapping, the results generated from one run of DRNets is already good enough.
|
| 232 |
+
|
| 233 |
+
# A.4 EXPERIMENTAL CONFIGURATION
|
| 234 |
+
|
| 235 |
+
All the experiments are performed on one NVIDIA Tesla V100 GPU with 16GB memory. For the training process of our DRNets, we select a learning rate in $\{ 0 . 0 0 0 1 , 0 . 0 0 0 5 , 0 . 0 0 1 \}$ with Adam optimizer (Kingma & Ba, 2014), for all the experiments.
|
| 236 |
+
|
| 237 |
+
For baseline models, we followed their original configurations and further fine-tuned their hyperparameters to saturate their performance on our tasks.
|
| 238 |
+
|
| 239 |
+
# A.4.1 MULTI-MNIST-SUDOKU
|
| 240 |
+
|
| 241 |
+
For Multi-MNIST-Sudoku, we compared DRNets with CapsuleNet (Sabour et al., 2017) and ResNet (He et al., 2016). Because Sabour et al. (2017) did not provide a source code for CapsuleNet, we adopted the implementation of Laodar (2017), with minor modifications. For ResNet, we adopted a 18-layer ResNet architecture (Khanrc, 2017) to saturate its performance.
|
| 242 |
+
|
| 243 |
+
In Multi-MNIST-Sudoku, a data point corresponds to a $3 2 \times 3 2$ image of overlapping digits. For the optimization mode of DRNets, we generated 160, 000 input data points that all come from the test set of MNIST (LeCun et al., 1998) and every 16 data points form a 4-by-4 overlapping Sudokus. Thus, these 160, 000 data points form 10, 000 Sudokus. These 10, 000 Sudokus are used as the test set and shared across DRNets and baselines. For the generalization mode of DRNets, we split the training set of MNIST into three parts: 160, 000 data points for DRNets learning, 25, 000 original MNIST images for training conditional GAN and another 160, 000 data points for validation. Note that these three datasets are disjoint. Baselines share the same training set as the generalization mode of DRNets. By using the constraint-aware SGD, DRNet batches every 16 data points together, which forms an overlapping Sudoku as well as a maximal connected component in the constraint graph, to enforce the All-Different constraints among the cells of each Sudoku.
|
| 244 |
+
|
| 245 |
+
DRNet for Multi-MNIST-Sudoku: the encoder is made of two ResNet-18 models adapted from the PyTorch source code. The output layer for the first network has 8 dimensions, which models the two distributions $P _ { i }$ and $Q _ { i }$ for the two overlapping digits. Another network outputs eight 100-dimensional (800 dimensions in total) latent encoding $z _ { i , j }$ to encode the shape of the possible eight digits conditioned on the input mixture, and is used by the generative decoder to generate the reconstructed digits. We use a conditional GAN (Mirza & Osindero, 2014) as our generative decoder, which is pre-trained using the digits in the partial training set (see the paragraph above) of MNIST. Note that this is the only supervision we have in this task, which is even weaker than the general concept of the weakly-supervised setting (Zhang et al., 2017). We adopted the implementation of Linder-Noren (2019) for our conditional GAN. On the other hand, the 10,000 overlapping Sudokus in the test set were all generated using the digits in the test set of MNIST, which had never been seen, even by the conditional GAN. Moreover, we overlap the images of two digits pixel-wisely, maximizing the whiteness of the two images. For robustness concern, we used $L 1$ loss as the reconstruction loss between the reconstructed mixture and the original input. For the initial weights, we set 0.01 for the cardinality constraints, 1.0 for the All-Different constraints, and 0.001 for the $L 1$ loss. Finally, we trained DRNets for 100 epochs with a batch size of 100, and it took 50 minutes to finish the optimization and achieve the reported performance for the 10,000 overlapping Sudokus.
|
| 246 |
+
|
| 247 |
+
Figure 9: Accuracy comparison. We show ”test time $^ +$ training time” for supervised baselines and the generalization mode of DRNet, and ”solving time” for the optimization mode of DRNets.
|
| 248 |
+
|
| 249 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=2>Accuracy (%)</td><td rowspan=2 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>Digit</td><td rowspan=1 colspan=1>Sudoku</td></tr><tr><td rowspan=1 colspan=1>DRNets (Optimization w/Restart)</td><td rowspan=1 colspan=1>100.0</td><td rowspan=1 colspan=1>100.0</td><td rowspan=1 colspan=1>50min</td></tr><tr><td rowspan=1 colspan=1>DRNets (Optimization)</td><td rowspan=1 colspan=1>99.9</td><td rowspan=1 colspan=1>98.6</td><td rowspan=1 colspan=1>28min</td></tr><tr><td rowspan=1 colspan=1>DRNets (Optimization W/oReasoning)</td><td rowspan=1 colspan=1>88.8</td><td rowspan=1 colspan=1>15.0</td><td rowspan=1 colspan=1>110min</td></tr><tr><td rowspan=1 colspan=1>DRNets (Generalization)</td><td rowspan=1 colspan=1>98.0</td><td rowspan=1 colspan=1>75.7</td><td rowspan=1 colspan=1>13min+4hrs</td></tr><tr><td rowspan=1 colspan=1>CapsuleNet</td><td rowspan=1 colspan=1>97.9</td><td rowspan=1 colspan=1>50.9</td><td rowspan=1 colspan=1>1min+30min</td></tr><tr><td rowspan=1 colspan=1>CapsuleNet + local search</td><td rowspan=1 colspan=1>97.9</td><td rowspan=1 colspan=1>57.8</td><td rowspan=1 colspan=1>3hrs+30mins</td></tr><tr><td rowspan=1 colspan=1>ResNet-18</td><td rowspan=1 colspan=1>97.7</td><td rowspan=1 colspan=1>68.5</td><td rowspan=1 colspan=1>3min+10hrs</td></tr><tr><td rowspan=1 colspan=1>ResNet-18 +local search</td><td rowspan=1 colspan=1>97.7</td><td rowspan=1 colspan=1>88.3</td><td rowspan=1 colspan=1>3hrs+10hrs</td></tr></table>
|
| 250 |
+
|
| 251 |
+
For the generalization mode of DRNets, we first ”train” DRNets on the training set and validate its generalization performance on the validation set to apply the early stop mechanism. Finally, we start from the ”trained” DRNets and further optimize it for 25 steps on the test set to achieve the reported performance. Note that, to generalize well on the test set, we ”trained” DRNets for a longer time than the optimization mode. Essentially, the procedure of the generalization mode of DRNets is similar to standard supervised learning process except that we do not need labels to supervise DRNets. In contrast, DRNets are really ”self-supervised” (Jing & Tian, 2019) by the Sudoku rules and the self-reconstruction, instead of the standard supervision by labeled data. Note that, during the test, instead of predicting the overlapping digits directly as other networks, we further optimize DRNets on the test set for 25 epochs to achieve a better result.
|
| 252 |
+
|
| 253 |
+
# A.4.2 CRYSTAL-STRUCTURE-PHASE-MAPPING
|
| 254 |
+
|
| 255 |
+
We illustrate DRNets for crystal structure phase mapping for two chemical systems: (1) a ternary Al-Li-Fe oxide system (Le Bras et al., 2014), which is theoretically-based, synthetically generated, with ground-truth solutions, and (2) a ternary $\mathbf { B i - C u - V }$ oxide system, which is a more challenging real system obtained from chemical experiments and is more noisy and uncertain. For each system, the input data points are mixtures of XRDs, associated with a composition graph identifying elemental compositions and the constraint graph of data points. Specifically, each XRD data point is associated with a 3-dimensional composition vector, which is the proportion of the three different metal elements at that data point (e.g., $[ 8 0 \%$ of Al, $5 \%$ of Fe, $15 \%$ of Li]) and could help identify possible phases. Then, we can locate each data point into a triangular system. Note that, since the vector is a probability distribution, there are only 2 degrees of freedom and we can plot it in a 2-D triangle (See Fig.11). After locating each data point into the 2-D triangle as vertices, we did a Delaunay triangulation over those points to build edges among vertices. Therefore, we can use Breadth-First Search on this graph to sample paths in the composition graph and infer thermodynamic rules accordingly.
|
| 256 |
+
|
| 257 |
+
The XRD pattern of each data point is a $D$ -dimensional vector representing the intensity of the mixture of XRDs at different diffraction angles (referred as $Q$ values). For Al-Li-Fe oxide system, we have 231 data points (mixtures of XRDs) in the composition graph, 159 stick patterns for the possible phases, and each data point has 650 different $\mathrm { Q }$ values $Q _ { i } \in [ 1 5 ^ { \circ } , 8 0 ^ { \circ } ]$ and the corresponding intensities $I _ { i } \in [ 0 , 1 ]$ . For $\mathrm { B i - C u - V }$ oxide system, we have 353 data points in the composition graph, 100 stick patterns for the possible phases, and each data point has 4096 different $\mathrm { Q }$ values $Q _ { i } \in [ 5 ^ { \circ } , 4 5 ^ { \circ } ]$ and the corresponding intensities $I _ { i } \in [ 0 , 1 ]$ . To better utilize the memory, we down-sampled the raw data of $\mathrm { B i - C u - V }$ oxide system to 512 different $\mathrm { Q }$ values. Note that, though we have hundreds of possible pure phases for each system, only a few phases would appear. For example, in Al-Fe-Li oxide system, only 6 of them appear and there are 15 different mixtures of those 6 pure phases exist in this system. For the Bi-Cu-V-O system, there are 13 pure phases and 19 different mixtures. Note that, each XRD data point is like a cell in the Multi-MNIST-Sudoku (with mixed pure phases) and each pure phase is like a digit. For Multi-MNIST-Sudoku, we know a priori that there are exact 2 digits in each cell but the number of mixed pure phases in each XRD is undetermined (1 to 3). Moreover, the number of possible candidate phases is way more than possible digits (e.g., 159 vs 8), which is the reason why this task is so challenging.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 10: Deep reasoning networks (DRNets) for crystal-structure-phase-mapping. (a) Prior knowledge includes the ICDD stick patterns of possible pure phases, which are used to build the GMM generative module in the decoder, and the thermodynamic rules that help DRNets reason about the mixture of XRD patterns. (b) reasoning modules batch data points involved in a connected component of the constraint graph (a path in the composition graph) together, enforce that the structure of the latent space satisfies prior knowledge, and dynamically adjust the weights of constraints based on their satisfiability. (c) The overall objective combines responses from the generative decoder and the reasoning modules.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure 11: The composition graph of the Al-Fe-Li oxide system. The red path is a sampled path in the composition graph.
|
| 264 |
+
|
| 265 |
+
We also collected a library of possible crystal structures from the International Centre for Diffraction Data (ICDD) database. Each crystal structure (also named phase) is given as a list of diffraction peak location-amplitude pairs, (referred to as stick pattern), representing the ideal phase patterns measured in a perfect condition (see Fig.12). To model more realistic conditions, DRNets simulate the real phase patterns from stick patterns using Gaussian mixture models, where the relative peak locations and mixture coefficients are given by the stick locations and amplitudes. Moreover, the peak width, multiplicative location shift, and possible amplitude variance are parameterized by the latent encoding $z _ { i , j }$ and used by the generative decoder to generate the corresponding possible phase patterns in the reconstructed XRD measurement.
|
| 266 |
+
|
| 267 |
+
Imposing thermodynamic rules is challenging, especially when constraints, such as phase field connectivity and Gibbs-alloying rule, potentially concern all data points in the composition graph.
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 12: Some examples of stick patterns and their corresponding Gaussian Mixture Models. The horizontal axis denotes the Q values, and the vertical axis denotes the diffraction intensity.
|
| 271 |
+
|
| 272 |
+
In Multi-MNIST-Sudoku, where each overlapping Sudoku naturally forms the maximal connected components in the constraint graph, we can easily batch every 16 data points together to reason about the All-Different constraints among them. However, in Crystal-Structure-Phase-Mapping, since the maximal connected component involves all data points in the composition graph, neither batching all data points into the memory nor reasoning about the whole graph is tractable. Therefore, we devised a strategy of sampling the large connected component through many local structures (still connected components) and iteratively solve each of them. Specifically, for each oxide system, we sampled 100,000 paths in the composition graph via Breadth First Search to construct a path pool. Then, for every iteration, DRNets randomly sample a path from the pool and batches the data points along that path (see 10). Finally, we only reason about the thermodynamic rules along the path. By iteratively solving sampled local structures (paths) of the ”large” maximal component, we can cost-efficiently approximate all global constraints.
|
| 273 |
+
|
| 274 |
+
We summarize the thermodynamic rules we imposed in DRNets:
|
| 275 |
+
|
| 276 |
+
Gibbs Phase Rule: This rule states the maximum number of co-existing phases, which is imposed via our relaxation of the $\mathbf { k }$ -sparsity constraints.
|
| 277 |
+
|
| 278 |
+
Gibbs-Alloying Rule: This rule states that if ”alloying” happens, then the maximum number of possible co-existing phases should decrease by one. ”Alloying” is a phenomenon that the stick locations of a phase (crystal structure) shift (change) along with adjacent data points. DRNet explicitly models the shifting ratio in the generative decoder and penalize the difference between adjacent data points along our sampled path. The reasoning module keeps track of the difference of shifting ratio between adjacent data points, and when it is larger than a threshold (0.001), we confirm the existence of ”alloying” and reduce the maximum number of possible co-existing phases by one via adjusting the threshold $c$ in the $\mathbf { k }$ -Sparsity Constraints.
|
| 279 |
+
|
| 280 |
+
Phase Field Connectivity: This states that the distribution (also referred as activation) of a phase field should form a connected component in the composition graph, and the variation of the activation of each phase should also be smooth (see Fig.13). (Herein, the phase field refers to the co-existence of a combination of phases, including the existence of a pure phase.) We impose this rule by penalizing the difference of the phase distribution $P _ { i }$ between adjacent data points along our sampled path.
|
| 281 |
+
|
| 282 |
+
Multiplicative Shifting: This states how a cubic crystal structure shifts when ”alloying” happens, and this can also be used to approximate the shifting of other crystal structures. We explicitly modeled the multiplicative shifting in our generative decoder.
|
| 283 |
+
|
| 284 |
+
Noise Threshold: To remove negligible activations that are mainly caused by noise we applied simple post-processing that cuts-off all the activations that are lower than $1 . 0 \%$ .
|
| 285 |
+
|
| 286 |
+
Here, we visualized the DRNets’ solution of Bi-Cu-V oxide system (see Fig.13 and the comparison among different methods Fig.14).
|
| 287 |
+
|
| 288 |
+
In our comparison, we evaluated the percentage of data points or phase field that satisfy each thermodynamic rule. Though IAFD enforced the thermodynamic rule using an external mixed-integer programming module, it may compromise some rules to achieve a better reconstruction error, which explains IAFD’s result for Bi-Cu-V oxide system. The phase fidelity loss we mentioned in our comparison is the JS distance between the de-mixed pure phase and the closest ideal phase generated using the ICDD stick patterns and the physical model proposed in Le Bras et al. (2014). The reason of using JS distance to measure the fidelity is that the location of peaks are the most important characteristics of a phase pattern. Therefore, by normalizing the XRD patterns of pure phases into probability distributions, we can use the JS distance to measure the mismatch of ”peaks” between them.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 13: DRNets’ solution for the Bi-Cu-V oxide system. a. The de-mixed crystal phases for the 353 XRD measurements of the Bi-Cu-V oxide system (each plot includes the signal for the recognized phase and the corresponding ICDD stick pattern). b. DRNets’ phase concentration maps for the corresponding phases on the left of the map. Dot sizes are proportional to their estimated phase concentrations and heatmap denotes estimated shifting (alloying). c. DRNets’ crystal phase map for the Bi-Cu-V-O system in the composition graph; the phase fields are labeled with corresponding crystal phases.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 14: Comparison of the activation map and the heatmap of L1 reconstruction loss for different methods for the Bi-Cu-V oxide system: Each row denotes the activation of the different phases for the the different methods; Though we do not have ground truth for the $\mathrm { B i - C u - V }$ oxide system, the solution generated by DRNets satisfies all thermodynamic rules with excellent reconstruction performance; The heatmap on the right shows that DRNets reconstruct the XRD measurements much better than other methods with respect to the (log scale) L1 reconstruction under physical constraints of decomposed phases; In addition, materials science experts thoroughly checked DRNets’ solution of Bi-Cu-V oxide system, approved it, and subsequently discovered a new material that is important for solar fuels technology.
|
| 295 |
+
|
| 296 |
+
In terms of the optimization process, DRNets took about 30 minutes to achieve the reported performance for both systems. IAFD and NMF-k have a similar time performance but a much worse performance w.r.t. the solution quality. In fact, for the Bi-Cu-V oxide system, both NMF-k’s solution and IAFD’s solution are not physically meaningful.
|
| 297 |
+
|
| 298 |
+
In summary, by combining reasoning and deep learning, DRNets significantly outperformed the state of the art and human experts on the crystal-Structure-Phase-Mapping instances, recovering more precise, interpretable, and physically meaningful crystal structure pattern decompositions, and even solving phase diagrams of chemical systems that had not been solved before, such as the Bi-Cu-V-O system, but also other systems not reported here.
|
| 299 |
+
|
| 300 |
+
# A.4.3 OTHER EXPERIMENTS FOR COMBINATORIAL PROBLEMS
|
| 301 |
+
|
| 302 |
+
As a proof of concept of how DRNets can encode general combinatorial constraints using our entropybased continuous relaxation, we solved 9-by-9 Sudoku puzzles and Boolean satisfiability problems (SAT) using DRNets. For those two tasks, we use a 3-layer-fully-connected network as our encoder and the reasoning modules.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 15: A standard 9-by-9 Sudoku puzzle: a partially filled Soduku has to be completed as a valid Sudoku.
|
| 306 |
+
|
| 307 |
+
For 9-by-9 Sudoku puzzles, we generated 10,000 instances using the dataset gathered by Gordon Royle (2014), where each Sudoku instance has 24 to 32 (uniformly distributed) known cells and is guaranteed to have one unique solution (e.g., see Fig.15). Because a standard 9x9 Sudoku puzzle requires reasoning about the unknown structure based on given clues, we need to treat each entire Sudoku as a single input data point. Therefore, in this task, even the All-Different constraints are conceptually the local constraints since each of them only concerns a single data point. We used a one-hot encoding for digits 1 to 9 and the empty cell (denoted as 0), and the entire Sudoku is an 810-dimensional input data. We used a 3-layer-fully-connected network with batch normalization (Ioffe & Szegedy, 2015) as the encoder, where every hidden layer has 2048 units and the output is an 81-by-9 matrix, which represents the digit distributions (1 to 9) for 81 cells. Moreover, we enforced the distribution of every known cell to collapse to the digit in that cell. For the initial weights, we set 0.0001 for the cardinality constraints and 1.0 for the All-Different constraints. Finally, we trained DRNets for 800,000 iterations with a batch size of 500, and it took 1 hour to solve the $1 0 , 0 0 0 9 \mathrm { x } 9$ Sudokus with the accuracy reported in this paper.
|
| 308 |
+
|
| 309 |
+
In our experiments, DRNets achieved the same level of performance as the Recurrent Relational Networks (RRNets) (Palm et al., 2017), which is the state-of-the-art supervised deep learning $9 \mathrm { x } 9$ Sudoku solver (see Table 1).
|
| 310 |
+
|
| 311 |
+
<table><tr><td rowspan=1 colspan=1>Instances (10,000)</td><td rowspan=1 colspan=1>DRNets</td><td rowspan=1 colspan=1>DRNets+Restart</td><td rowspan=1 colspan=1>NeuralSAT</td><td rowspan=1 colspan=1>PDP</td><td rowspan=1 colspan=1>RRNets</td></tr><tr><td rowspan=1 colspan=1>3-SAT n=30 m=129</td><td rowspan=1 colspan=1>81.0% (4min)</td><td rowspan=1 colspan=1>99.0% (33min)</td><td rowspan=1 colspan=1>45.5% (2min+1hr)</td><td rowspan=1 colspan=1>78.9% (5min+2hr)</td><td rowspan=1 colspan=1>NA</td></tr><tr><td rowspan=1 colspan=1>3-SAT n=50 m=215</td><td rowspan=1 colspan=1>63.3% (7min)</td><td rowspan=1 colspan=1>94.0% (47min)</td><td rowspan=1 colspan=1>26.1% (3min+1hr)</td><td rowspan=1 colspan=1>62.2% (8min+2hr)</td><td rowspan=1 colspan=1>NA</td></tr><tr><td rowspan=1 colspan=1>3-SAT n=100 m=430</td><td rowspan=1 colspan=1>34.7% (17min)</td><td rowspan=1 colspan=1>77.9% (2hr)</td><td rowspan=1 colspan=1>4.7% (5min+1hr)</td><td rowspan=1 colspan=1>31.4%(2hr+2hr)</td><td rowspan=1 colspan=1>NA</td></tr><tr><td rowspan=1 colspan=1>3-SAT n=30,m=90</td><td rowspan=1 colspan=1>97.9% (5min)</td><td rowspan=1 colspan=1>99.9% (6min)</td><td rowspan=1 colspan=1>78.5% (2min + 1hr)</td><td rowspan=1 colspan=1>99.1% (4min+ 2hr)</td><td rowspan=1 colspan=1>NA</td></tr><tr><td rowspan=1 colspan=1>3-SAT n=50,m=150</td><td rowspan=1 colspan=1>98.2%(7min)</td><td rowspan=1 colspan=1>99.4% (8min)</td><td rowspan=1 colspan=1>70.1% (3min + 1hr)</td><td rowspan=1 colspan=1>99.2%(7min +2hr)</td><td rowspan=1 colspan=1>NA</td></tr><tr><td rowspan=1 colspan=1>3-SAT n=100,m=300</td><td rowspan=1 colspan=1>98.1% (20min)</td><td rowspan=1 colspan=1>99.7% (22min)</td><td rowspan=1 colspan=1>52.9% (5min + 1hr)</td><td rowspan=1 colspan=1>99.1% (2hr + 2hr)</td><td rowspan=1 colspan=1>NA</td></tr><tr><td rowspan=1 colspan=1>9x9Sudoku</td><td rowspan=1 colspan=1>99.5% (1hr)</td><td rowspan=1 colspan=1>99.8% (1hr)</td><td rowspan=1 colspan=1>NA</td><td rowspan=1 colspan=1>NA</td><td rowspan=1 colspan=1>99.6% (lmin+1day)</td></tr></table>
|
| 312 |
+
|
| 313 |
+
Table 1: Percentage of instances solved for 3-SAT $( m / n = 4 . 3$ and $m / n = 3 . 0 $ ) and standard $9 \mathrm { x } 9$ Sudoku (24 to 32 known cells). We show the ”test time $^ +$ training time” for supervised baselines and the ”solving time” for our unsupervised DRNets. The units min, hr, day denote minute(s), hour(s) and day(s). $m , n$ denote the number of literals and clauses, respectively. NA, not applicable. DRNets, without supervision, outperform the supervised state of the art.
|
| 314 |
+
|
| 315 |
+
For SAT problems, we generated 10,000 satisfiable random 3-SAT instances of different difficulties based on the number of literals $n$ and the number of clauses $m$ , and our goal is to find a valid assignment for each literal. We challenged our DRNet with the hardest random 3-SAT instances, where #clauses/#literal ${ = } 4 . 3$ (Mitchell et al., 1992), i.e., $n = 3 0$ , $m = 1 2 9$ , $n = 5 0$ , $m = 2 1 5$ and $n = 1 0 0$ , $m = 4 3 0$ . For easier instances (e.g. #clauses/#literals $= 3 . 0$ ), DRNets can almost solve all instances (see Table 1).
|
| 316 |
+
|
| 317 |
+
We use a 3-layer-fully-connected network as the encoder, where the number of hidden units in the network is 2048, 2048, 2048. We used the standard CNF representation of 3-SAT as the input data, so that each data point is an $m$ -by-3 matrix and the three values in the $j$ -th row represent the three literals in the $j$ -th clauses. For the initial weights, we select a value from $\{ 0 . 0 5 , 0 . 0 3 , 0 . 0 2 5 , 0 . 0 2$ $0 . 0 1 \}$ to be the weight of the entropy loss as we described in the Fig.4 of the main paper. For the three settings of different difficulty, we consistently trained DRNets with a batch size of 100 and the running time for solving 10,000 instances varies from several minutes to a couple of hours.
|
| 318 |
+
|
| 319 |
+
We compared DRNets with NeuroSAT Selsam et al. (2018) and PDP (Amizadeh et al., 2019). Both NeuroSAT and PDP are the state-of-the-art deep learning SAT solvers with one-bit supervision. In addition, PDP needs extra optimizing process to solve SAT instances during the test phase, where it also applied the restart mechanism in their framework. For fair comparison, we saturated the performance of all our baseline models. For all instances, DRNets took less than 2 hours to achieve the reported performance with the restart mechanism. Without supervision, DRNets outperformed both supervised baseline models.
|
| 320 |
+
|
| 321 |
+
Interestingly, though DRNets are best suited for problems that combine deep learning and reasoning, such as de-mixing Multi-MNIST-Sudokus or crystal structure phase mapping, it still achieved such a promising result in pure combinatorial problems. These results further demonstrate that DRNets can encode a broad range of combinatorial constraints and prior knowledge and effectively combine deep learning with reasoning.
|
md/train/HkzZBi0cFQ/HkzZBi0cFQ.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QUANTIZATION FOR RAPID DEPLOYMENT OF DEEP NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper aims at rapid deployment of the state-of-the-art deep neural networks (DNNs) to energy efficient accelerators without time-consuming fine tuning or the availability of the full datasets. Converting DNNs in full precision to limited precision is essential in taking advantage of the accelerators with reduced memory footprint and computation power. However, such a task is not trivial since it often requires the full training and validation datasets for profiling the network statistics and fine tuning the networks to recover the accuracy lost after quantization. To address these issues, we propose a simple method recognizing channel-level distribution to reduce the quantization-induced accuracy loss and minimize the required image samples for profiling. We evaluated our method on eleven networks trained on the ImageNet classification benchmark and a network trained on the Pascal VOC object detection benchmark. The results prove that the networks can be quantized into 8-bit integer precision without fine tuning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deploying state-of-the-art deep neural networks (DNNs) to embedded systems is a challenging task due to the inherent nature of huge number of computations and large memory requirements. These impediments are partly caused by the considerable amount of the redundancies found in the network parameters intended for ease of training. Thus, the parameters encompasses abundant opportunities for trimming strategies, namely pruning and quantizing to low precision (Choi et al., 2017; Courbariaux et al., 2015b; Han et al., 2015). However, running DNN inference on accelerators equipped with fixed-point arithmetic units in an energy efficient manner also requires limiting the precision of the feature maps (Lin & Annapureddy, 2016; Migacz, 2017; Mishra et al., 2017).
|
| 12 |
+
|
| 13 |
+
Previous works (Courbariaux et al., 2015b; Gysel, 2016; Lin & Annapureddy, 2016; Migacz, 2017) have exhibited converting pretrained DNNs to 8-bit precision does not induce any accuracy loss. The feature maps and the network parameters were quantized at the granularity of layers to accommodate for large diversities in the dynamic range across the layers. Even though they showed good results for a few popular DNNs like AlexNet, VGG-Net, or GoogLeNet, it is not clear whether it would still work for many other recent DNNs with compact architectures.
|
| 14 |
+
|
| 15 |
+
From our experiments, we were able to observe that this was not the case for some of the recent stateof-the-art DNNs. For example, applying 8-bit quantization to the individual layers of the MobileNet series as done in the previous works showed large accuracy degradations. The excessive accuracy loss could be mitigated by fine tuning the quantized networks (Gysel, 2016; Lin & Annapureddy, 2016). However, in order to reach a competitive level of accuracy for each network with fine tuning, full-size training and validation datasets were needed to be incorporated along with painstakingly long periods of optimization. As many DNN developers only provide the pretrained networks in full precision without the training or the validation datasets from reasons such as privacy or the outright massiveness of the data size, such obstacles hinder rapid and easy deployment of DNNs in full precision to embedded accelerators designed for low precision.
|
| 16 |
+
|
| 17 |
+
Instead of converting a full precision pretrained network to lower precision suitable for embedded accelerators, it is also possible to train one from scratch by constraining the weights and the activations (Hubara et al., 2016; Mishra et al., 2017; Zhou et al., 2016; Zhuang et al., 2017). However, achieving state-of-the-art accuracy on large benchmarks such as ImageNet classification, increase in the network size in terms of connections (Mishra et al., 2017) or integrating complicated training process (Zhuang et al., 2017) is required. Nevertheless, these methods have not been proven for various types of network architectures. Considering the fact that GPUs are the most popular devices for training, it is more practical to convert DNNs into lower precision after utilizing the GPUs’ full precision data path for training.
|
| 18 |
+
|
| 19 |
+
In this paper, we introduce a novel technique in which fine tuning is not necessary for 8-bit linear quantization which quantizes the feature maps and the parameters for individual channels instead of layers to accommodate for the inter-channel variations in the dynamic range. We propose manipulating the kernel weights prior to inference for HW-friendly implementation of channel-wise quantization. Our method significantly reduces the accuracy loss caused by quantizing to lower precision without increasing the inference computation cost. The results show that various state-of-the-art DNNs trained on the ImageNet dataset can readily be converted for 8-bit fixed-point accelerators without fine tuning by using a few training samples for profiling.
|
| 20 |
+
|
| 21 |
+
# 2 LOW PRECISION QUANTIZATION
|
| 22 |
+
|
| 23 |
+
It is common practice to quantize the activations and the network parameters for each layer to account for the differences in the dynamic range across the layers (Gysel, 2016; Lin & Annapureddy, 2016; Migacz, 2017). Previous implementations such as Ristretto(Gysel, 2016), a fixed-point quantization simulator based on Caffe, reserves three placeholders for the fractional lengths (defined as the number of required bits for the fractional part of a fixed-point number) per layer, one each for the input and output feature maps (IFM and OFM respectively) and for the layer parameters (weights and biases). At every layer, IFM, OFM, and the weights are polled separately for max values and the fractional lengths are calculated accordingly. During run-time, the MSBs and LSBs of the parameters and the activations of each layer are clipped to be containable within the given bit-width and the fractional lengths in order to emulate a generic fixed-point H/W implementation. We will use the term layer-wise quantization hereafter to describe this scheme in contrast with channel-wise quantization proposed in this paper.
|
| 24 |
+
|
| 25 |
+
A major down-side of the layer-wise quantization is that the inter-channel variations of the feature maps and the weights are not fully accounted for. Since the fractional length is usually selected to cover the maximum value in a layer, the layer-wise quantization tends to cause excessive information loss in channels with a smaller dynamic range. Therefore, accuracy may be degraded significantly and sometimes never recovered even after exhaustive retraining.
|
| 26 |
+
|
| 27 |
+
# 2.1 CHANNEL-WISE QUANTIZATION
|
| 28 |
+
|
| 29 |
+
In the channel-wise quantization, the fractional lengths for the feature maps and the weights can be customized for each channel to minimize the impact of low-precision rounding. Each channel of the IFMs and the OFMs has an independent fractional length based on its expected dynamic range while each channel of the kernels has a fractional length which tightly fits its known values.
|
| 30 |
+
|
| 31 |
+
Figure 1 demonstrates how the IFMs and the kernels from different channels having different fractional lengths in the channel-wise quantization scheme are computed through a convolution layer compared to the layer-wise scheme. In this example, the input and the output of the convolution layer and weights are all bound to 8 bits while the partial sums are allowed to be accumulated in 32 bits as to avoid data loss. The traversal in the layer-wise scheme is straight-forward as there aren’t any discrepancies while adding up the partial sums. On the other hand, the channel-wise method must cope with adding partial sums of varying fractional lengths. A naive solution would be to place a shifter in front of the partial sum adder to adjust all the partial sums to have the same fractional length. However, this scheme is not practical since too many shift operations are required. We resolve this complication by pre-coordinating the fractional lengths of the weights.
|
| 32 |
+
|
| 33 |
+
The fractional length of a partial sum is determined by adding those of the IFM and the kernel being multiplied together. As the partial sums resulting from different input channels will have different fractional lengths, the smallest fractional length across all partial sums is selected as the reference. The red box in Figure 1 depicts this step. Then, the fractional lengths of the kernels in all the other channels are adjusted during the pre-processing stage to produce this reference fractional length when multiplied with their corresponding IFMs. Limitation was set on the amount adjusted so that the minimum value of the modified fractional lengths of the kernels would not be smaller than the layer-wise quantization. The overall procedure to determining the channel-wise fractional length is summarized in Algorithm 1.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Comparison between layer-wise and channel-wise quantization in a simple convolution layer with 2 IFM channels and 1 OFM channel. $\mathbf { Q } n . m$ represents a fixed point integer format with $n$ bits for integer part, $m$ bits for fractional part, and 1 bit for the sign. Total bit-width is equal to $( n + m + 1 )$ bits. min fl(A, B) returns a format with the minimum fractional length. For layer-wise quantization in (a), all the channels of both the inputs and the kernels are forced to share the biggest integer part length across all channels in order to retain the most significant bits. Thus, the number of bits for fractional parts are identical for all paths at the partial sum stage. Channel-wise quantization methods in (b) and (c) could spare more bits for fractional part in accumulator and adder due to channel level granularity, thereby reducing the low precision rounding error during summation. However, the naive approach shown in (b) is not practical since it requires large number of extra bit shifters in front of the partial sum adder to adjust the format of its inputs before adding them. On the contrary, the proposed channel-wise quantization method in (c) does not require such HW cost by considering the bit shifts in the kernel weights in advance.
|
| 37 |
+
|
| 38 |
+
The channel-wise quantization can be applied to a fully-connected (FC) layer by considering each unit as a channel. However, for simplicity, we use the layer-wise quantization for the activations of fully-connected (FC) layers. Notwithstanding, the weights of FC layers still needs to be adapted to the preceding layer. Figure 2 shows three such scenarios where we fallback to the layer-wise quantization. In scenario (b) and (d), the activations quantized channel-wise from the previous convolution layer are multiplied with the channel-wise quantized weights of an FC layer which are pre-adjusted to yield the activations having an identical fractional length, hence, the layer-wise quantization for the activations. For scenario (c) where two FCs are stacked consecutively, the layer-wise quantization is utilized throughout the path.
|
| 39 |
+
|
| 40 |
+
# 2.2 FRACTIONAL LENGTH DETERMINATION
|
| 41 |
+
|
| 42 |
+
Determining the fractional length (placing the dot in between the integer and fractional part within the given bit-width) is easier said than done. Previous works (Gysel, 2016; Migacz, 2017) profiled the target dataset to look for the max value which became the max representable value in the dynamic range. Profiling, running a network in forward path and collecting statistics, provides either an estimation of the dynamic range when executed during pre-processing stage on a subset of the training dataset or an exact fit when performed during run-time on the actual data being processed.
|
| 43 |
+
|
| 44 |
+
<table><tr><td>Algorithm1 HW-friendly channel-wise quantization. Profiling dataset is a subset of training data set. fl stands for fractional length (flker: kernel fl, kernel and one input, flgdder: adder fl, flbias: bias fl, shiftj: layer output bit-wise shift amount).</td></tr><tr><td>Require: network architecture, network parameters,profiling dataset Ensure: flker,flbias, flifm, flofm,shift,quantized network parameters</td></tr><tr><td>1. Profile weights and activations Calculate statistics of weights and activations of each channel on profiling dataset 2.Calculate channel-wise fractional lengths</td></tr><tr><td>For each layer,</td></tr><tr><td>calculate fiker from statistics for each channel of kernels calculate flifm,flofm from statistics of activations for each channel</td></tr><tr><td>flpSum 'ji fiadder := min ( (frpsum) for each j</td></tr><tr><td>flbias := flgdder</td></tr><tr><td>fier←flger (fpsum-fbias) shiftj := flbias f1ofm 3. Quantize network parameters with flker, flbias</td></tr></table>
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: Quantization policy varies with network configurations. $a$ and $w$ represent activation and weights, respectively. (cw: channel-wise quantization, $l w$ : layer-wise quantization)
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 3: Superpositioned PDFs of pre-activation values of each channel (GoogLeNet w/ ImageNet dataset). Every distribution is normalized to have unit variance. Y-axis is in log scale. Mean dist. represents the averaged PDF of all channels.
|
| 51 |
+
|
| 52 |
+
The obvious side effect is that selecting just the right size of the dataset to profile is not trivial. A large dataset will increase the chance of electing an outlier as the max value which will overestimate the dynamic range. This will consequently penalize the fractional part of the fixed-point representation. On the other extreme where insufficient size of the profiling dataset is used, the values overflowing the determined fixed-point notation during inference will cause severe performance degradation.
|
| 53 |
+
|
| 54 |
+
Lin proposed to use the $n$ -th moments of the distribution instead of the max value to identify the optimal fixed-point bit-width and the fractional length (Lin & Annapureddy, 2016). The dynamic range of the activation is determined so that the signal-to-quantization-noise-ratio (SQNR) caused by quantization would be minimized. In this case, two factors contribute to the quantization noise. The first is the quantization error found within the dynamic range and the latter is the overload error where the values beyond the range are clipped to either the upper or the lower bound. When the number of the quantization levels is fixed, there exists an optimum interval between the levels which makes these two errors balanced. This method is much less sensitive to the size of the profiling dataset since the $n$ -th moments of a distribution are more stable measures than the max value. A positive side effect is that optimum interval can be found even with a small dataset as shown in Section 3.1.
|
| 55 |
+
|
| 56 |
+
Figure 3 illustrates the superpositioned probability density functions (PDFs) of the pre-activation values of the individual OFM channels measured on GoogLeNet(Szegedy et al., 2014) trained with the ImageNet dataset. All PDFs were normalized and shifted to have an unit variance and a mean of zero prior to compositing the functions. As can be seen from the graph, there is a large variation in the distribution of the pre-activation values. In Lin & Annapureddy (2016), normal distribution was used to approximate them. However, the mean distribution over all the channels, shown in Figure 3, suggests Laplace distribution rather than normal distribution. We also found that the fractional length obtained by either normal or Laplace distribution tends to underestimate the dynamic range due to the heavy tails of the actual distribution in many channels. In those cases, truncated super Cauchy distribution, defined as follows, provides smaller quantization-induced noise by appropriately considering the tails.
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
f ( x ) = { \left\{ \begin{array} { l l } { { \frac { \sqrt { 2 } } { \pi { \gamma } \left[ 1 + \left( { \frac { x - x _ { 0 } } { \gamma } } \right) ^ { 4 } \right] } } , } & { { \mathrm { i f } } - 1 5 < x - x _ { 0 } < 1 5 } \\ { 0 , \quad { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Here, $x _ { 0 }$ is the location parameter and $\gamma$ is the scale parameter.
|
| 63 |
+
|
| 64 |
+
# 2.3 EXPLOITING CHANNEL-WISE PDF
|
| 65 |
+
|
| 66 |
+
Large variations in distributions across the OFM channels naturally led us to search for the optimal PDF for each channel in determining the fractional length. For this purpose, we constructed a dataset consisting of the best-fit PDFs producing the highest SQNR for the individual OFM channels in GoogLeNet, Inception-v3(Szegedy et al., 2015), and MobileNet(Howard et al., 2017). A simple classifier was trained to select the best-fit PDF during quantization by taking a vector of n-th moments of activation values in each channel. The classifier was trained to choose from truncated super Cauchy or Laplace distribution. We obtained $83 \%$ classification accuracy by using the k-nearest neighbors classifier with $k = 1 2$ (Samworth, 2013).
|
| 67 |
+
|
| 68 |
+
# 3 BENCHMARK RESULTS
|
| 69 |
+
|
| 70 |
+
# 3.1 IMAGENET CLASSIFICATION TASK
|
| 71 |
+
|
| 72 |
+
The proposed quantization method was evaluated on various state-of-the-art deep networks trained on the ImageNet dataset containing 1.2M training and 50k validation examples. Pretrained networks were quantized into 8-bit fixed point format by using the profiling dataset sampled from the training set and evaluated on the whole validation dataset (50k examples). Uniform linear quantization was used for all the cases. Batch normalization(Ioffe & Szegedy, 2015) layers were fused into convolution layers before the quantization process. Unsigned integer format was employed for the activation values with the ReLU nonlinearity.
|
| 73 |
+
|
| 74 |
+
A comparison against the layer-wise quantization is summarized in Table 1. Conventional method with the layer-wise quantization based on the max value provided good quantization results for GoogLeNet, VGG16(Simonyan & Zisserman, 2014), and Inception-v3 which were the most popular networks in the previous quantization and pruning papers. With more recent networks such as MobileNet, MobileNet2(Sandler et al., 2018), ResNet(He et al., 2015), Inception-v4(Szegedy et al., 2016), and Xception(Chollet, 2016), severe accuracy loss was observed. We figured out that the outliers were the major source of accuracy degradation after layer-wise quantization. For example, using the max value of a parameter could significantly overestimate its dynamic range when there are outliers with extraordinarily large values which cannot be seen in the validation set or when deployed. Carefully removing those outliers will significantly improve the quality of quantization even if layer-wise max-based method is used. Thus, there are previous papers showing better results than our baseline layer-wise quantization. However, we did not consider such improvement in the baseline because it requires extra effort and the process itself might taint the dataset since there’s no explicitly clear boundary of the outliers.
|
| 75 |
+
|
| 76 |
+
We evaluated the channel-wise quantization in four modes depending on the method to determine the fractional lengths: MAX, Laplace, S.Cauchy, and PDF-aware. In MAX mode, the max values of the activation tensors were used to decide the factional lengths of the feature maps. As for the Laplace or S.Cauchy modes, the optimal fractional lengths were estimated from the $n$ -th moments of the activations by assuming PDF as either Laplace or truncated super Cauchy distribution.
|
| 77 |
+
|
| 78 |
+
Regardless of the modes, the channel-wise quantization exhibited significantly improved accuracy losses for all the mentioned networks. In the MAX mode, we still observed a large accuracy degradation in the Inception-v4 network. We discovered that there were extremely large outliers in the activations of a few layers causing significant overestimation of their dynamic ranges. This problem can be resolved by applying other modes (Laplace, S.Cauchy, or PDF-aware). The Laplace and S.Cauchy modes showed similar performance overall but different behavior depending on the network. The best result came with the PDF-aware mode which selects the best-fit PDF for each channel.
|
| 79 |
+
|
| 80 |
+
Figure 4 illustrates the required size of the profiling dataset for the MAX and the OPT methods when measured on Inception-v3. Fractional lengths were calculated based on randomly selected images from the ImageNet training dataset. The MAX method required a large number of samples $( \romannumeral 1 0 0 )$ to reach a stable accuracy, whereas a few samples were enough to stabilize the accuracy for the OPT method. Since most of the published networks are trained in full precision while accelerators mandate low-precision representation, being able to readily port a network with just a few training samples is a huge advantage for easy deployment of pretrained full-precision DNNs. Accordingly, the proposed quantization method is able to reach a competitive accuracy without the need for profiling a large number of samples or fine tuning.
|
| 81 |
+
|
| 82 |
+
Table 1: Top-1 accuracy loss after 8-bit quantization in various large scale networks trained on the ImageNet dataset. No retraining is performed. Reference (Float32) lists baseline accuracies while all other figures are accuracy losses. Modes for determining the fractional length: MAX (reserve integer length to include at least the max value), Laplace (optimal fraction length based on Laplace distribution), S.Cauchy (optimal fraction length based on truncated super Cauchy distribution), $P D F$ - aware (optimal fractional length based on optimum PDF for each channel). Accuracy losses above $1 . 0 \%$ point are in bold face.
|
| 83 |
+
|
| 84 |
+
<table><tr><td rowspan="2">Network</td><td rowspan="2">Reference (Float32)</td><td colspan="2">Layer-wise</td><td colspan="4">Channel-wise</td></tr><tr><td>MAX</td><td>Laplace</td><td>MAX</td><td>Laplace</td><td>S.Cauchy</td><td>PDF-aware</td></tr><tr><td>GoogLeNet [1]</td><td>68.93%</td><td>0.23%</td><td>0.23%</td><td>0.13%</td><td>0.15%</td><td>0.08%</td><td>0.05%</td></tr><tr><td>SqueezeNet [2]</td><td>58.39%</td><td>2.02%</td><td>0.68%</td><td>0.22%</td><td>0.23%</td><td>0.43%</td><td>0.27%</td></tr><tr><td>MobileNet [3]</td><td>69.50%</td><td>5.48%</td><td>4.02%</td><td>1.17%</td><td>0.66%</td><td>0.66%</td><td>0.73%</td></tr><tr><td>MobileNet2 [4]</td><td>71.23%</td><td>71.13%</td><td>71.13%</td><td>1.73%</td><td>1.81%</td><td>3.09%</td><td>1.68 %</td></tr><tr><td>VGG16 [5]</td><td>68.34%</td><td>0.29%</td><td>0.19%</td><td>-0.01%</td><td>-0.04%</td><td>0.01%</td><td>-0.06%</td></tr><tr><td>ResNet101-v2 [6]</td><td>78.04%</td><td>9.52%</td><td>5.17%</td><td>1.01%</td><td>0.74%</td><td>1.58%</td><td>0.83%</td></tr><tr><td>ResNeXt50-32x4d [7]</td><td>76.84%</td><td>1.13%</td><td>0.65%</td><td>0.51%</td><td>0.65%</td><td>0.78%</td><td>0.32%</td></tr><tr><td>Inception-v3 [8]</td><td>77.97%</td><td>0.99%</td><td>0.66%</td><td>0.23%</td><td>0.09%</td><td>0.18%</td><td>0.24%</td></tr><tr><td>Inception-v4 [9]</td><td>79.90%</td><td>74.65%</td><td>0.61%</td><td>26.07%</td><td>-0.06%</td><td>0.07%</td><td>0.13%</td></tr><tr><td>Incep.-ResNet-v2 [10]</td><td>80.19%</td><td>1.45%</td><td>0.71%</td><td>0.18%</td><td>1.11%</td><td>0.64%</td><td>0.36%</td></tr><tr><td>Xception [11]</td><td>78.72%</td><td>54.72%</td><td>0.57%</td><td>1.11%</td><td>0.60%</td><td>0.48%</td><td>0.33%</td></tr></table>
|
| 85 |
+
|
| 86 |
+
[1] Szegedy et al. (2014), [2] Iandola et al. (2016), [3] Howard et al. (2017), [4] Sandler et al. (2018), [5] Simonyan & Zisserman (2014), [6] He et al. (2015), [7] Xie et al. (2016), [8] Szegedy et al. (2015), [9] Szegedy et al. (2016), [10] Szegedy et al. (2016), [11] Chollet (2016)
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: Effect of profiling dataset size on accuracy with quantization for Inception-v3. MAX method requires large number of samples for profiling to reach a stable accuracy. Laplace method stabilizes quickly with a few samples.
|
| 90 |
+
|
| 91 |
+
# 3.2 OBJECT DETECTION
|
| 92 |
+
|
| 93 |
+
We performed network quantization on YOLO-v2(Redmon & Farhadi, 2016), a state-of-the-art object detection network. The network was trained and tested on the Pascal VOC dataset (Everingham et al., 2015).
|
| 94 |
+
|
| 95 |
+
Table 2 shows the loss in mean AP after quantization using our method in comparison with the layer-wise quantization. The layer-wise quantization caused $2 . 5 \%$ point drop in mean AP after
|
| 96 |
+
|
| 97 |
+
Table 2: Loss in mean AP after 8-bit quantization in YOLO-v2 (Redmon & Farhadi, 2016). No retraining performed. ’Reference (Float32)’ lists baseline accuracy while all other figures are accuracy losses. Loss above $1 . 0 \%$ point is in bold face.
|
| 98 |
+
|
| 99 |
+
<table><tr><td rowspan="2">Network</td><td rowspan="2">Reference (Float32)</td><td colspan="2">Layer-wise</td><td colspan="4">Channel-wise</td></tr><tr><td>MAX</td><td>Laplace</td><td>MAX</td><td>Laplace</td><td>S.Cauchy</td><td>PDF-aware</td></tr><tr><td>Y0L0-v2</td><td>72.64%</td><td>2.50%</td><td>2.25%</td><td>0.14%</td><td>0.22%</td><td>0.70%</td><td>0.38%</td></tr></table>
|
| 100 |
+
|
| 101 |
+
quantization. However, our method did not suffer from such a problem by selecting the fractional lengths adapted to the individual channels.
|
| 102 |
+
|
| 103 |
+
# 4 RELATED WORKS
|
| 104 |
+
|
| 105 |
+
Han quantized the network parameters after pruning for compression in Han et al. (2015). Kim proposed on using Hessian-weighted clustering to achieve a better compression ratio in quantization (Choi et al., 2017). However, in those works, only the network parameters were quantized to save storage space leaving the feature maps in full-precision. Both the activations and the network parameters were quantized layer-wise to accommodate the large variations in the dynamic range across the layers in Courbariaux et al. (2015b); Gysel (2016). The max values found in activations were used to decide on the fractional lengths, and intensive fine tuning were required to recover accuracies degraded by quantization in some networks. Lin used SQNR instead of the max value to minimize the bit-width for each layer and optimized DNNs for fixed-point operation (Lin & Annapureddy, 2016). Migacz achieved linear quantization for 8-bit integer operation without fine tuning by minimizing the information loss with Kullback-Leibler (KL) divergence (Migacz, 2017). Unfortunately, collection of the activation histograms were required from a large number of samples. All in all, these methods used the layer-wise quantization scheme.
|
| 106 |
+
|
| 107 |
+
Aggressively lowering the precision to be under 4 bits for both the weights and the activations have been actively explored (Courbariaux et al., 2015a; Rastegariy et al., 2016; Hubara et al., 2016; Li et al., 2016; Zhou et al., 2016; Leng et al., 2017; Lin et al., 2017). Although they revealed impressive results on small benchmarks, there is still a huge gap in accuracy on large benchmarks such as the ImageNet classification using state-of-the-art networks trained in full precision. Recent progress shows that it is possible to reduce the precision of DNNs to 4 bits without sacrificing accuracy by increasing the network size (Mishra et al., 2017) or training the networks in multiple stages with guided training (Zhuang et al., 2017). These work focus on training DNNs for low-precision inference from scratch rather than quantizing pretrained full-precision networks.
|
| 108 |
+
|
| 109 |
+
# 5 CONCLUSION
|
| 110 |
+
|
| 111 |
+
In this paper, we proposed a set of methods for rapid deployment of DNNs trained in full precision to fixed point accelerators with limited precision computation units. The channel-wise quantization recognizes the inter-channel diversities in the dynamic range of the feature maps. HW cost for implementation is minimized by adjusting the fractional lengths of the kernel parameters. We evaluated our method on eleven state-of-the-art DNNs trained on the ImageNet dataset and an object detection network trained on Pascal VOC dataset. In comparison to the previous method (i.e the layer-wise quantization), the channel-wise quantization can reduce the accuracy loss caused by quantization substantially.
|
| 112 |
+
|
| 113 |
+
We also showed that quantization requires just a few image samples if we utilize the $n$ -th moments of the activations instead of the maximum value. In this way, deployment is possible even when just a few training samples are available for the trained network model. We further improved our method by considering the variations in distribution across the channels. A simple classifier was used for selecting the best-fit PDF for each channel from the statistical features. We were able to accomplish negligible accuracy loss (less than $1 \%$ point in eleven networks out of twelve) after quantization without fine tuning.
|
| 114 |
+
|
| 115 |
+
# REFERENCES
|
| 116 |
+
|
| 117 |
+
Yoojin Choi, Mostafa El-Khamy, and Jungwon Lee. Towards the limit of network quantization. arXiv preprint arXiv:1612.01543v2, 2017.
|
| 118 |
+
|
| 119 |
+
Franc¸ois Chollet. Xception: Deep learning with depthwise separable convolutions. CoRR, abs/1610.02357, 2016.
|
| 120 |
+
|
| 121 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. Advances in Neural Information Processing Systems (NIPS), pp. 3123–3131, 2015a.
|
| 122 |
+
|
| 123 |
+
Matthieu Courbariaux, Jean-Pierre David, and Yoshua Bengio. Training deep neural networks with low precision multiplications. arXiv preprint arXiv:1412.7024v4, 2015b.
|
| 124 |
+
|
| 125 |
+
M. Everingham, S. M. A. Eslami, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The pascal visual object classes challenge: A retrospective. International Journal of Computer Vision, 111(1):98–136, January 2015.
|
| 126 |
+
|
| 127 |
+
Philipp Gysel. Ristretto: Hardware-oriented approximation of convolutional neural networks. arXiv preprint arXiv:1605.06402, 2016.
|
| 128 |
+
|
| 129 |
+
Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 130 |
+
|
| 131 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015.
|
| 132 |
+
|
| 133 |
+
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.
|
| 134 |
+
|
| 135 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:609.07061, 2016.
|
| 136 |
+
|
| 137 |
+
Forrest N. Iandola, Matthew W. Moskewicz, Khalid Ashraf, Song Han, William J. Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and ${ < } 0 . 5 \mathrm { m b }$ model size. CoRR, abs/1602.07360, 2016.
|
| 138 |
+
|
| 139 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 140 |
+
|
| 141 |
+
Cong Leng, Hao Li, Shenghuo Zhu, and Rong Jin. Extremely low bit neural network: Squeeze the last bit out with admm. arXiv preprint arXiv:1707.09870, 2017.
|
| 142 |
+
|
| 143 |
+
Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
|
| 144 |
+
|
| 145 |
+
Sachin Lin, Darryl smf Talathi and Sreekanth Annapureddy. Fixed point quantization of deep convolutional networks. International Conference on Machine Learning (ICML), pp. 344–352, 2016.
|
| 146 |
+
|
| 147 |
+
Xiaofan Lin, Cong Zhao, and Wei Pan. Towards accurate binary convolutional neural network. Advances in Neural Information Processing Systems (NIPS), pp. 344–352, 2017.
|
| 148 |
+
|
| 149 |
+
Szymon Migacz. 8-bit inference with tensorrt. In NVIDIA GPU Technology Conference (GTC), 2017.
|
| 150 |
+
|
| 151 |
+
Asit Mishra, Eriko Nurvitadhi, J Jeffrey Cook, and Debbie Marr. Wrpn: Wide reduced-precision networks. arXiv preprint arXiv:170901134, 2017.
|
| 152 |
+
|
| 153 |
+
Mohammad Rastegariy, Vicente Ordonezy, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. arXiv preprint arXiv:1605.06402, 2016.
|
| 154 |
+
|
| 155 |
+
Joseph Redmon and Ali Farhadi. Yolo9000: Better, faster, stronger. arXiv preprint arXiv:1612.08242, 2016.
|
| 156 |
+
Richard J. Samworth. Optimal weighted nearest neighbour classifiers. arXiv preprint arXiv:11015783v3, 2013.
|
| 157 |
+
Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. CoRR, abs/1801.04381, 2018.
|
| 158 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014.
|
| 159 |
+
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.
|
| 160 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. CoRR, abs/1512.00567, 2015.
|
| 161 |
+
Christian Szegedy, Sergey Ioffe, and Vincent Vanhoucke. Inception-v4, inception-resnet and the impact of residual connections on learning. CoRR, abs/1602.07261, 2016.
|
| 162 |
+
Saining Xie, Ross B. Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual ´ transformations for deep neural networks. CoRR, abs/1611.05431, 2016.
|
| 163 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1605.06402, 2016.
|
| 164 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Towards effective lowbitwidth convolutional neural networks. arXiv preprint arXiv:1711.00205, 2017.
|
md/train/Hye4KeSYDr/Hye4KeSYDr.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVALUATIONS AND METHODS FOR EXPLANATION THROUGH ROBUSTNESS ANALYSIS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Among multiple ways of interpreting a machine learning model, measuring the importance of a set of features tied to a prediction is probably one of the most intuitive way to explain a model. In this paper, we establish the link between a set of features to a prediction with a new evaluation criterion, robustness analysis, which measures the minimum distortion distance of adversarial perturbation. By measuring the tolerance level for an adversarial attack, we can extract a set of features that provides the most robust support for a current prediction, and also can extract a set of features that contrasts the current prediction to a target class by setting a targeted adversarial attack. By applying this methodology to various prediction tasks across multiple domains, we observe the derived explanations are indeed capturing the significant feature set qualitatively and quantitatively.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
With the significant progress of recent machine learning research, various machine learning models have been being rapidly adopted to countless real-world applications. This rapid adaptation increasingly questions the machine learning model’s credibility, fairness, and more generally interpretability. In the line of this research, researchers have explored various notions of model interpretability. Some researchers directly answer the trustability (Ribeiro et al., 2016) or the fairness of a model (Zhao et al., 2017), while some other researchers seek to actually improve the model’s performance by understanding the model’s weak points (Koh & Liang, 2017). Even though the goal of such various model interpretability tasks varies, vast majority of them are built upon extracting relevant features for a prediction, so called feature-based explanation.
|
| 12 |
+
|
| 13 |
+
Feature-based explanation is commonly based on measuring the fidelity of the explanation to the model, which is essentially how close the sum of attribution scores for a set of features approximates the function value difference before and after removing the set of features. Depending on their design, the fidelity-based attribution evaluation varies: completeness (Sundararajan et al., 2017), sensitivity-n (Ancona et al., 2018), infidelity (Yeh et al., 2019), and causal local explanation metric (Plumb et al., 2018). The idea of smallest sufficient region (SSR) and smallest destroying region (SDR) (Fong & Vedaldi, 2017; Dabkowski & Gal, 2017) is worth noting because it considers the ranking of the feature attribution scores, not the actual score itself. Intuitively, for a faithful attribution score, removing the most salient features would naturally lead to a large difference in prediction score. Therefore, SDR-based evaluations measure how much the function value changes when the most high-valued salient features are removed.
|
| 14 |
+
|
| 15 |
+
Although the aforementioned attribution evaluations made success in many cases, setting features with an arbitrary reference values to zero-out the input is limited, in the sense that it only considers the prediction at the reference value while ignoring the rest of the input space. Furthermore, the choice of reference value inherently introduces bias. For example, if we set the feature value to 0 in rgb images, this introduces a bias in the attribution map that favors the bright pixels. As a result, explanations that optimize upon such evaluations often omit important dark objects and the pertinent negative features in the image, which is the part of the image that does not contain object but is crucial to the prediction (Dhurandhar et al., 2018). An alternative way to remove pixels is to use sampling from some predefined distribution or a generative model (Chang et al., 2018), which nevertheless could still introduce some bias with respect to the defined distribution. Moreover, they require a generative model that approximates the data distribution, which may not be available in certain domains.
|
| 16 |
+
|
| 17 |
+
In this paper, we remove such inherit bias by taking a different perspective on the input perturbation. We start from an intuition that if a set of features are important to make a specific prediction, keeping them in the same values would preserve the prediction even though other irrelevant features are modified. In other words, the model would be more sensitive on the changes of those important or relevant features than the ones that are not. Unlike the foremost approaches including SDR and SSR that perturbs features to a specific reference point, we consider the minimum norm of perturbation to arbitrary directions, not just to a reference point, that can change model’s prediction, also known as “minimum adversarial perturbation” in the literature (Goodfellow et al., 2014; Weng et al., 2018b).
|
| 18 |
+
|
| 19 |
+
Based on this idea, we define new evaluation criteria to test the importance of a set of features. By computing the minimum adversarial perturbation on the complementary set of features that can alter the model’s decision, we could test the degree of importance of the set. Although explicitly computing the importance value is NP-hard (Katz et al., 2017), Carlini & Wagner (2017) and Madry et al. (2017) showed that the perturbations computed by adversarial attacks can serve as reasonably tight upper bounds, which lead to an efficient approximation for the proposed evaluation.
|
| 20 |
+
|
| 21 |
+
Furthermore, we can derive a new explanation framework by formulating the model explanation to a two-player min-max game between explanator and adversarial attacker. The explanator aims to find a set of important features to maximize the minimum perturbation computed by the attacker. This framework empirically performs much better than previous approaches quantitatively, with very inspiring examples.
|
| 22 |
+
|
| 23 |
+
To summarize our contributions:
|
| 24 |
+
|
| 25 |
+
• We define new evaluation criteria for feature-based explanations based on robustness analysis. The evaluation criteria consider the worst case perturbations when a set of features are anchored, which does not introduce bias into the evaluation.
|
| 26 |
+
We design efficient algorithms to generate explanations that maximize the proposed criteria, which perform favorably against baseline methods on the proposed evaluation criteria.
|
| 27 |
+
Experiments in computer vision and NLP models demonstrate that the proposed explanation can indeed identify some important features that are not captured by previous methods. Furthermore, our method is able to extract a set of features that contrasts the current prediction to a target class.
|
| 28 |
+
|
| 29 |
+
# 2 ROBUSTNESS ANALYSIS FOR EVALUATING FEATURE-BASED EXPLANATIONS
|
| 30 |
+
|
| 31 |
+
# 2.1 PROBLEM NOTATION
|
| 32 |
+
|
| 33 |
+
Let us consider the following setting: a general $K$ -way classification problem with input space $\mathcal { X } \subseteq \mathbb { R } ^ { d }$ , output space $\mathcal { V } = \{ 1 , \ldots , K \}$ , and a predictor function $f : \mathcal { X } \mathcal { Y }$ where $f ( { \pmb x } )$ denotes the output class for some input example $\pmb { x } = [ \bar { \pmb { x } } _ { 1 } , \dots , \pmb { x } _ { d } ] \in \mathcal { X }$ . Then, for a particular prediction $f ( { \pmb x } ) = { \boldsymbol y }$ , despite the different forms of existing feature-based explanations ranging from attributing an importance value to each feature, ranking the features by their importance, to simply identify a set of important features, a common goal of them is to extract a compact set of relevant features with respect to the prediction.
|
| 34 |
+
|
| 35 |
+
# 2.2 EVALUATION THROUGH ROBUSTNESS ANALYSIS
|
| 36 |
+
|
| 37 |
+
We note that however, given an explanation that identifies a set of said to be relevant features, how can we evaluate the quality of such explanation, or in other words, justify whether the distinguished features are truly relevant to the prediction? While one generally has no ground truth about the underlying true relevance of the features, recent studies take an axiomatic approach to define what properties the relevant features should hold and evaluate the explanations through verifying if the identified relevant features satisfy the properties. One such properties that is widely adopted in the literature is to assume that the importance of a set of features corresponds to the degree of change in prediction when the features are removed from the original input. Nevertheless, as we discussed in the previous section, the practice of approximating removal of features by setting their value to some reference point poses the risk of introducing bias in the evaluation. As a result, to escape from the caveat, we follow a similar concept but propose two new criteria to evaluate the importance of features based on the following assumptions.
|
| 38 |
+
|
| 39 |
+
Assumption 1 When the values of the most salient features are anchored (fixed), perturbation on the complementary set of features has weaker influence on the model’s prediction. In other words, the model could tolerate a larger degree of perturbation on the less important and non-anchored features.
|
| 40 |
+
|
| 41 |
+
Assumption 2 If perturbation is allowed on a set of important features, a small perturbation could easily change the model prediction even when we fix the values for the rest of the features.
|
| 42 |
+
|
| 43 |
+
Based on these two assumptions, we propose a new framework for evaluating explanations. The evaluation is based on the adversarial robustness when a set of features are fixed, which is formally defined below.
|
| 44 |
+
|
| 45 |
+
Definition 2.1 The minimum adversarial perturbation norm on a set of features $S$ , which we will also name as Robustness- $S$ , can be defined as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\epsilon _ { S } ^ { * } = g ( \pmb { x } , S ) = \{ \operatorname* { m i n } _ { \pmb { \delta } } \| \pmb { \delta } \| _ { p } s . t . \ f ( \pmb { x } + \pmb { \delta } ) \neq y , \ \pmb { \delta } _ { \overline { { S } } } = 0 \} ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where ${ \overline { { S } } } = U \setminus S$ is the complementary set of features, and $\delta _ { \overline { { S } } } = 0$ means that the perturbation value on features in $\overline { S }$ is constraint to be $O$ .
|
| 52 |
+
|
| 53 |
+
Assume that we are given an explanation that partitions the input features into a relevant set $S _ { r }$ and an irrelevant set $\overline { { S _ { r } } }$ . Assumption 1 implies that the quality of the relevant set can be measured by $\epsilon _ { S _ { r } } ^ { * } -$ the robustness of irrelevant that a higher robustness on when the relevant set is anchored. Specifically, Assumptiofollows from a larger coverage of pertinent features in set $\overline { { S _ { r } } }$ $S _ { r }$ and thus an explanation is considered better if it leads to a higher robustness against perturbation in $\overline { { S _ { r } } }$ . On the other hand, based on Assumption 2, an explanation that has included important salient features in $S _ { r }$ should lead to a smaller robustness level on $\epsilon _ { S _ { r } } ^ { * }$ . Therefore, Assumption 1 and 2 build up our proposed evaluation criteria Robustness- $\overline { { S _ { r } } }$ and Robustness- $S _ { r }$ respectively, as listed below.
|
| 54 |
+
|
| 55 |
+
Robustness- $\overline { { S _ { r } } }$ measures the minimum adversarial distortion $\epsilon _ { \overline { { S _ { r } } } }$ when the set of important features $S _ { r }$ , typically represented by the high-weight features in an attribution map, are anchored and perturbation is only allowed in low-weight regions. The higher the score the better the explanation. To measure Robustness- $\overline { { S _ { r } } }$ , we would need to first determine the size of $\lvert S _ { r } \rvert$ . We can set $\lvert S _ { r } \rvert$ to the amount of anchors that an user is interested in or we may vary the size of $\lvert S _ { r } \rvert$ and evaluate the corresponding Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ at different points. By varying the size of $\lvert S _ { r } \rvert$ , we could plot an evaluation curve for each explanation and in turn measure the area under curve (AUC), which corresponds to the average Robustness- $\overline { { S _ { r } } }$ at different sizes of relevant set.
|
| 56 |
+
|
| 57 |
+
Robustness- $S _ { r }$ measures the minimum distortion distance $\epsilon _ { S _ { r } }$ when the set of important features $S _ { r }$ are the only region that is perturbable, and the rest of feature values are anchored. Contrary to Robustness- $\overrightarrow { S _ { r } }$ , lower scores on this metric indicate better explanation. We similarly define AUC of Robustness- $S _ { r }$ as the average of Robustness- $\overline { { S _ { r } } }$ when we vary the size of $\lvert S _ { r } \rvert$ .
|
| 58 |
+
|
| 59 |
+
Evaluation dinality of rocedure Note that both Robustness-. For instance, including all features $\overline { { S _ { r } } }$ nd Robustnwill make $S _ { r }$ e sensitive to the car-. Therefore, we will $S _ { r }$ $S _ { r }$ $\epsilon _ { S _ { r } } ^ { * } = 0$ a feature attribution method that assigns a weight with each feature, we can sort the features by the decending order of weights and then for each set of top- $K$ features with $K = 1 , 2 , \ldots , d$ , we evaluate Robustness- $\overline { { S _ { r } } } ( S _ { r } )$ and plot a curve. A larger (smaller) area under curve indicates a better feature attribution ranking. (See examples in Figure 1).
|
| 60 |
+
|
| 61 |
+
Untargeted v.s. Targeted Explanation Definition 2.1 corresponds to the untargeted adversarial robustness – a perturbation that changes the predicted class to any label except $y$ is considered as a successful attack. Instead of doing this, our formulation can also extend to targeted adversarial robustness, where we replace (1) by
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\epsilon _ { S , t } ^ { * } = \lbrace \operatorname* { m i n } _ { \delta } \| \delta \| _ { p } \mathrm { ~ s . t . ~ } f ( \pmb { x } + \delta ) = t ; \delta _ { \overline { { S } } } = 0 \rbrace ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $t$ is the targeted class. Using this definition, our approach will try to address the question “Why is this example classified as $y$ instead of $t ^ { \ast }$ , and the important features that optimize this criterion will highlight the contrast between class $y$ and $t$ . We will give several interesting results in the experiment section.
|
| 68 |
+
|
| 69 |
+
Comparing to existing measurement The proposed criteria at the first glance look similar to SSR- and SDR-based measurements. We note that, however, the key differences between our proposed criteria and SSR- (SDR-) based criteria are in two-folds: 1) Conceptually, to measure whether a set of features is important, instead of concerning the prediction change before and after removing the features, we consider whether perturbation on the feature values would significantly alter the prediction. 2) Practically, our proposed criteria allow us to eschew the difficulty of modeling feature removal as discussed in section 1. In fact, as most implementations of removal-based criteria set the values of the features of interest to some fixed reference point, our criteria could be viewed as generalized versions where we consider all possible reference points by allowing perturbations in any directions. As a result, the proposed criteria enjoys a broader view of prediction behavior around the input, and in turn could capture a broader range of important features like the pertinent negative features in Dhurandhar et al. (2018), as we shall show in the experiment section.
|
| 70 |
+
|
| 71 |
+
Robustness Evaluation under Fixed Anchor Set It is known that computing the exact minimum distortion distance in modern neural networks is intractable (Katz et al., 2017), so many different methods have been developed to estimate the value. Adversarial attacks, such as C&W (Carlini & Wagner, 2017) and PGD attack (Madry et al., 2017), aim to find a feasible solution of (1), which leads to an upper bound of $\epsilon _ { S } ^ { * }$ . They are based on gradient based optimizers which are usually efficient. On the other hand, neural network verification methods aim to provide a lower bound of $\epsilon _ { S } ^ { * }$ to ensure that the model prediction will not change within certain perturbation range (Singh et al., 2018; Wong & Kolter, 2018; Weng et al., 2018a; Gehr et al., 2018; Zhang et al., 2018; Wang et al., 2018; Zhang et al., 2019). However, these methods are usually time consuming (often $> 5 0$ times slower than a backpropagation).
|
| 72 |
+
|
| 73 |
+
The proposed framework can be combined with any method that aims to approximately compute (1), including attack, verification, and some other statistical estimations. However, for simplicity we only choose to evaluate (1) by the state-of-the-art projected gradient descent (PGD) attack (Madry et al., 2017), since the verification methods are too slow and often lead to much looser estimation as reported in some recent studies (Salman et al., 2019).
|
| 74 |
+
|
| 75 |
+
# 3 NEW EXPLANATIONS TOWARDS OPTIMIZING THE CRITERIA
|
| 76 |
+
|
| 77 |
+
Given the new evaluation criteria, a natural follow-up question is how to design explanations that optimize the measurements. Recall that under the proposed criteria the goal of an optimal explanation is to maximize (minimize) robustness- $\bar { S } _ { r }$ (robustness- $S _ { r }$ ) under the cardinality constraint on $S _ { r }$ . Searching for such explanations thus leads to the following optimization problems, (3) for Robustness- $\overline { { S _ { r } } }$ and (4) for Robustness- $S _ { r }$ :
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l } { \underset { S _ { r } \in \{ 0 , 1 \} ^ { d } } { \mathrm { m a x i m i z e } } } & { { } g ( \pmb { x } , \pmb { S _ { r } } ) } \\ { \mathrm { s u b j e c t t o } } & { { } \lVert \pmb { S _ { r } } \rVert _ { 0 } \leq K , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r l } { \underset { S _ { r } \in \{ 0 , 1 \} ^ { d } } { \mathrm { m i n i m i z e } } } & { { } g ( \pmb { x } , S _ { r } ) } \\ { \mathrm { s u b j e c t ~ t o } } & { { } \| S _ { r } \| _ { 0 } \leq K , } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $g ( { \pmb x } , S )$ computes the value in Eq. (1), the minimum distortion distance when the features in set $\bar { S _ { r } }$ is not allowed to be perturbed, and $K$ is a pre-defined size constraint on the set $S _ { r }$ .
|
| 88 |
+
|
| 89 |
+
# 3.1 GREEDY ALGORITHM
|
| 90 |
+
|
| 91 |
+
Directly solving (3) and (4) is challenging since $g$ is an implicit function computed by solving (1) approximately, and furthermore, the discrete input constraint makes it intractible to find the optimal solution. As a result, we propose a greedy-styled algorithm, where we iteratively add the most promising feature into $S _ { r }$ that optimizes the objective at each local step until $S _ { r }$ reaches the size constraint. In other words, we initialize the set $S _ { r }$ as empty, and sequentially solve the following subproblem at every step $t$ :
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\arg \operatorname* { m a x } _ { i } \ g ( { \pmb x } , \overline { { S _ { r } ^ { t } \cup i } } ) , \ \mathrm { o r \ a r g m i n } \ g ( { \pmb x } , S _ { r } ^ { t } \cup i ) , \ \forall i \in \overline { { S _ { r } } }
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $S _ { r } ^ { t }$ is the anchor set at step $t$ , and $S _ { r } ^ { 0 } \ = \ \varnothing$ . We repeat this subprocedure until the size of set $S _ { r } ^ { t }$ reaches $K$ . We name this method as Greedy. A straightforward way for solving (5) is to exhaustively search over every single feature. However, considering a single feature at a time ignores the correlation between features, which tends to introduce noise (see our experimental results). If we consider multiple features at a single step, searching over all possible combinations will become intractable. For example, considering all possible combinations of two features requires $O ( d ^ { 2 } )$ evaluations of function $g$ at every step. To consider the joint influence between features efficiently, we propose a smoothed regression version of solving (5) in the following subsection.
|
| 98 |
+
|
| 99 |
+
Table 1: Area under curve of the proposed criteria for various explanations on MNIST. The higher the better for Robustness- $\overline { { S _ { r } } }$ ; the lower the better for Robustness- $S _ { r }$ . Robustness measured with (1).
|
| 100 |
+
|
| 101 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LO0</td><td>BBMP</td><td>Reg-Greedy</td><td>Greedy</td><td>One-Step Reg</td></tr><tr><td>Robustness-Sr</td><td>88.00</td><td>85.98</td><td>75.48</td><td>76.59</td><td>81.31</td><td>98.01</td><td>83.57</td><td>86.37</td></tr><tr><td>Robustness-Sr</td><td>91.72</td><td>91.97</td><td>101.49</td><td>98.82</td><td>173.90</td><td>82.81</td><td>171.56</td><td>83.59</td></tr></table>
|
| 102 |
+
|
| 103 |
+
# 3.2 REGRESSION GREEDY
|
| 104 |
+
|
| 105 |
+
As considering the correlation between features by searching over all possible subsets of $\overline { { S _ { r } ^ { t } } }$ at every step $t$ is computationally infeasible, we instead propose to approximate the function $g$ by learning a mapping from the binary space of $\{ 0 , 1 \} ^ { d }$ , where ones indicate the inclusion of corresponding feature indices and zeros otherwise, to their resulting function value $g ( x , \{ 0 , 1 \} ^ { d } )$ . Specifically, we can sample a subset $Q \subseteq \{ 0 , 1 \} ^ { d }$ and then consider the following linear regression:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r } { \pmb { w } ^ { * } = \underset { \pmb { w } } { \arg \operatorname* { m i n } } \sum _ { z \in Q } ( \pmb { w } ^ { T } z - g ( \pmb { x } , z ) ) ^ { 2 } . } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
After the regression is learned, we can treat the coefficients $w$ that correspond to each feature as their approximated effect on the function value of $g$ when they are included into the set $S _ { r }$ . By learning such regression where we sample from the possible subsets, we are able to capture the joint relationships between features, and as well smooth out possible noises. In fact, the greedy approach can be viewed as a special case of Reg-Greedy where the sampled subset $Q$ , in (6), in each iterative step contains exactly the one-hot encoded vectors with the “on” indices correspond to the remaining feature indices. That is, each one-hot vector indicates the inclusion of a corresponding single feature into the relevant set. In this case, the coefficients of the learned linear regression would be equivalent to the difference in objective value before and after the corresponding feature is included into the relevant set. To take into account feature interactions, Reg-Greedy samples from the whole distribution of $\{ 0 , 1 \} ^ { d }$ where most of the sampled vectors in $Q$ contains multiple “on” indices. In this way, the learned regression captures feature correlations on the objective value and could smooth out possible noises encountered by greedy. There has been a great line of research on studying the interaction between features including the well-known Shapley value which tackles the problem through cooperative game theory perspective. And Lundberg $\&$ Lee (2017) proposed a way to use regression with a special kernel to approximate the Shapley value. However, sampling from the whole distribution of $\{ 0 , 1 \} ^ { d }$ could still incur exponential complexity, and using only a reasonable amount of samples might not be able to precisely capture the behavior of the highly nonlinear objective function $g$ . Therefore, we propose the Regression Greedy (Reg-Greedy) approach, where we still run greedy steps to incrementally add indices to $S _ { r } ^ { t }$ , but at each iteration we run this regression and use the weights to decide which index to be added to $S _ { r } ^ { t }$ . Note that at each step the samples $Q$ must be in a restricted domain, where indices that are already chosen in $S _ { r } ^ { t }$ should be 1 and we sample 0/1 only for the rest of the indices. We distinguish Reg-Greedy from onestep regression (One-Step Reg) which directly determines the importance of each feature by merely solving (6) once. By combining regression in a greedy procedure, we are able to gradually narrow down our sampling space (by sampling only from a restricted domain), focusing on the feature interactions between remaining features and the ones that are already added into the relevant set. This enables us to find from the remaining features that have the greatest interaction with the current relevant set, and could in turn maximally optimize the objective value when added into the relevant set. In practice, a sample complexity of $O ( d )$ for learning the regression could generally work well.
|
| 112 |
+
|
| 113 |
+
# 4 EXPERIMENTS
|
| 114 |
+
|
| 115 |
+
We present both qualitative and quantitative comparisons in the experiments. For $\| \cdot \| _ { p }$ in (1) and (2), we consider $p = 2$ , i.e., the $\ell _ { 2 }$ norm for all experiments. In quantitative results, including evaluation curves and the corresponding AUC, we report the average over 50 random examples. For
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 1: Different Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ (left) with varying $| \overline { { S _ { r } } } |$ and Robustness- $S _ { r }$ (right) with varying $\lvert S _ { r } \rvert$ . For Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ (left), the higher the better; for Robustness- $S _ { r }$ (right), the lower the better. We omit points in the plot with value too high to fit in the scale of y-axis.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 2: Visualization on our proposed methods. The top features selected by RegGreedy are less noisy.
|
| 122 |
+
|
| 123 |
+
Table 2: Area under curve of the proposed criteria for various explanations on ImageNet. The higher the better for Robustness- $\overline { { S _ { r } } }$ ; the lower the better for Robustness- $S _ { r }$ . Robustness measured with (1).
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LO0</td><td>BBMP</td><td>Reg-Greedy</td><td>Greedy</td><td>One-Step Reg</td></tr><tr><td>Robustness-Sr</td><td>27.13</td><td>26.01</td><td>18.25</td><td>23.54</td><td>22.60</td><td>31.62</td><td>21.16</td><td>24.54</td></tr><tr><td>Robustness-Sr</td><td>45.53</td><td>46.28</td><td>60.02</td><td>52.77</td><td>154.14</td><td>43.97</td><td>58.45</td><td>47.07</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Table 3: Area under curve of the Insertion and Deletion criteria for various explanations on MNIST. The higher the better for Insertion; the lower the better for Deletion.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LOO</td><td>BBMP</td><td>Reg-Greedy</td></tr><tr><td>Insertion</td><td>250.81</td><td>262.74</td><td>200.50</td><td>192.44</td><td>102.53</td><td>379.15</td></tr><tr><td>Deletion</td><td>281.88</td><td>273.71</td><td>362.68</td><td>442.65</td><td>527.80</td><td>159.77</td></tr></table>
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LO0</td><td>BBMP</td><td>Reg-Greedy</td></tr><tr><td>Rank Correlation</td><td>0.3001</td><td>0.3042</td><td>0.1108</td><td>0.4966</td><td>0.1775</td><td>0.1835</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 4: Rank correlation between explanations with respect to original and randomized model.
|
| 134 |
+
|
| 135 |
+
the proposed algorithms, we consider Reg-Greedy (Sec 3.2), One-Step Reg (Sec 3.2) and Greedy (Sec 3.1). For other baselines we include vanilla gradient (Grad) (Shrikumar et al., 2017) and integrated gradient (IG) (Sundararajan et al., 2017) from gradient-based approaches; leave-one-out (LOO), or occlusion-1, (Zeiler & Fergus, 2014; Li et al., 2016) and SHAP (Lundberg & Lee, 2017) from perturbation-based approaches (Ancona et al., 2018), and black-box meaningful perturbation (BBMP) (Fong & Vedaldi, 2017) from SSR/SDR-based approaches. We perform our experiments on two image datasets, MNIST and ImageNet, as well as a text dataset YahooAnswers.
|
| 136 |
+
|
| 137 |
+
# 4.1 QUANTITATIVE ANALYSIS ACROSS DIFFERENT EXPLANATIONS
|
| 138 |
+
|
| 139 |
+
The proposed measurements: Robustness- $\overline { { S _ { r } } }$ and Robustness- $S _ { r }$ . We compare different explanations under the two proposed criteria, robustness- $\overline { { \boldsymbol { S } _ { r } } }$ and robustness- $S _ { r }$ , and plot their evaluation curves respectively. For ease of comparison, we calculate the area under curve (AUC) for each corresponding evaluation. We list the results in Table 3, and leave the plots in appendix A. As shown in Table 3, under both criteria, comparing to regression-based methods, the pure greedy method usually suffers degraded performances that could be due to the ignorance of feature correlations, which ultimately results in the introduction of noise as shown in Figure 2. Furthermore from the table, we observe that the proposed regression-greedy method consistently outperforms others on both criteria. On one hand, this suggests that the proposed algorithm indeed successfully optimizes towards the criteria; on the other hand, this might indicate the proposed criteria do capture different characteristics of explanations which most of the current explanations do not possess. Another somewhat interesting finding from the table is that while vanilla gradient has generally been viewed as a baseline method, it nonetheless performs competitively on the proposed criteria. To investigate deeper into such observation, we shall visualize the explanations in the following subsection. For simplicity we will just apply Reg-Greedy with Robustness- $\overline { { S _ { r } } }$ criterion in the qualitative comparisons with previous methods.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 3: Visualization on top 20 percent relevant features provided by existing explanations.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 4: Visualization of targeted explanation. In each row, we highlight relevant regions explaining why the input is not predicted as the target class.
|
| 148 |
+
Figure 5: Comparisons between different targeted explanations against different targeted class on MNIST.
|
| 149 |
+
|
| 150 |
+
Existing commonly adopted measurements: Insertion and Deletion. Indeed, it might not be surprising that Reg-Greedy achieves the best performances on the proposed criteria it is explicitly designed to optimize. To more objectively showcase the usefulness of the proposed explanation, we compare Reg-Greedy with other explanations on existing commonly used quantitative measurements. Particularly, we adopt the Deletion and Insertion criteria proposed by Petsiuk et al. (2018), which are generalized variants of the region perturbation criterion presented in Samek et al. (2016). The Deletion criterion measures the probability drop in the predicted class as top-relevant features, indicated by the given explanation, are progressively removed from the input. On the other hand, the Insertion criterion measures the increase in probability of the predicted class as top-relevant features are gradually revealed from the input whose features are originally all masked. Similar to our proposed criteria, a quick drop (and thus a small area under curve) or a sharp increase (that leads to a large area under curve) in Deletion and Insertion respectively suggest a good explanation as the selected top-important features could indeed greatly influence the prediction. In the experiments, we follow Samek et al. (2016) to remove features by setting their values to randomly sampled values. We plot the evaluation curves and report corresponding AUCs in Figure 12 and Table 3. On these additional two criteria, we observe that our proposed method consistently performs favorably against other explanations.
|
| 151 |
+
|
| 152 |
+
Sanity Check. As pointed out in recent literature that an appropriate explanation should at least be loosely related the model being explained (Adebayo et al., 2018), to ensure that our proposed explanation does indeed reflect the model behavior, we conduct the sanity check proposed by (Adebayo et al., NeurIPS’18) to check if our explanations are adequately different when the model parameters are randomly re-initialized. In the experiment, we randomly re-initialize the last fully-connected layer of the neural network model. We then compute the rank correlation between explanation computed w.r.t. the original model and that w.r.t. the randomized model. From Table 4, we observe that Reg-Greedy has a much lower rank correlation comparing to Grad, IG, and LOO, suggesting that Reg-Greedy is indeed sensitive to model parameter change and is able to pass the sanity check.
|
| 153 |
+
|
| 154 |
+
# 4.2 QUALITATIVE VISUALIZATIONS
|
| 155 |
+
|
| 156 |
+
Visualized Explanations on MNIST. Figure 3 illustrates the top features identified by various explanation methods. From this figure, we observe that Gradient, IG, SHAP mainly highlights the white pixels in the digit, while gradient and IG are more noisy compared to SHAP. In the contrary, Reg-Greedy focuses on both the “crucial positive” of the digits “pertinent negative” of regions around the digit. For example, in the first row, a 7 might have been predicted as a 4 or 0 if the pixels highlighted by Reg-Greedy are set to 1. Similarly, a 1 may be turned to a 4 or a 7 given additional white pixels to its left, and a 9 may become a 7 if deleted the lower circular part of its head. As a result, Reg-Greedy focuses on “the region in which perturbing will lead to easier prediction change”, which includes both the crucial positive pixels and pertinent negative pixels, and provides additional insights that are not captured by the baseline explanations. The superiority of Reg-Greedy is also validated by the better performance on the Robustness- $\overline { { S _ { r } } }$ score.
|
| 157 |
+
|
| 158 |
+
Targeted Explanation. Recall that in section 2.2, we discussed about the possibility of defining the robustness measurement by considering a targeted distortion distance as formulated in (2). Here, we provide examples, as shown in Figure 4, where we answer the question of “why the input digit is an A but not a $B ^ { \prime \prime }$ by defining a targeted perturbation distance towards class B as our robustness measurement. In each row of the figure, we provide targeted explanation towards two different target classes for a same input image. Interestingly, as the target classes changes, the generated explanation varies in an interpretatble way. For example, in the first row, we explain why the input digit 7 is not classified as a 9 (middle column) or a 2 (rightmost column). The resulting explanation against 9 highlights the upper-left part of the 7. Semantically, this region is indeed pertinent to the classification between 7 and 9, since turning on the highlighted pixel values in the region (currently black in the original image) will then make the 7 resemble a 9. However, the targeted explanation against 2 highlights a very different but also meaningful region, which is the lower-right part of the 7; since adding a horizontal stroke on the area would turn a 7 into a 2. This finding demonstrates a special characteristic of our explanation which cannot be easily found in most of the existing methods.
|
| 159 |
+
|
| 160 |
+
While the capability of capturing not only the crucial positive but also the pertinent negative features have also been observed in some recently proposed explanations such as Layer-wise Relevance Propagation (LRP) (Bach et al., 2015), as reported in Samek et al. (2016), as well as the explanation technique proposed in Oramas et al. (2019). Both of the above mentioned methods are not explicitly designed to handle the targeted explanation task which attempt to answer the question “what are the important features that lead to the prediction of class A but not class $\mathbf { B } ^ { \ast }$ , and thus has different limitations. For example, the ability of LRP to capture pertinent negative features in fact heavily depends on the input range. In Samek et al. (2016) where inputs are normalized to have zero mean and a standard deviation of one, the black background will have non-zero value, and LRP would have non-zero attributions on the black background pixels which allows the explanation to capture pertinent negative features. However, as later shown in Dhurandhar et al. (2018), if the input pixel intensity is normalized into the range between 0 and 1 (where background pixels have the values of 0), LRP failed to highlight the pertinent negative pixels, as background would always have zero attribution (since LRP is equivalent to multiplication between Grad and input in a Rectified Linear Unit (ReLU) network as shown in Ancona et al. (2018)). In Oramas et al. (2019), unlike our targeted explanation where we know exactly which targeted class the explanation is suggesting against (and by varying the targeted class we observe varying corresponding explanation given), their method by design does not convey such information. The pertinent negative features highlighted by their method by construction is not directly related to a specific target class, and users in fact need to infer what target class the pertinent negative features are preventing against. To further grasp the difference, we compare our explanation with theirs in Figure 5 (we borrow the results from Oramas et al. (2019) for visualization of their method). Qualitatively, we also observe that our method seems to be giving the most natural explanations. For example, in the first row of left image where the highlighted features are against the class 0, in addition to the left vertical gap (which when presence would make 2 looks like a 0) that is roughly highlighted by all three methods, our method is the only one that highlights the right tail part (green circled) of the digit 2 which might also serve as crucial evidence of 2 against 0. Furthermore, as we change the targeted class to 7 (the second row), while LRP seems to be providing similar explanations, we observe that our explanation has a drastic change and highlights the green circled part which when turned off will make 2 becomes a 7. These results might suggest our method is more capable of handling such targeted explanation task.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 6: Visualization of different explanations on ImageNet, where the predicted class for each input is “fish”, “bird”, “dog”, and “sea lion”.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 7: Explanations on a text classification model where the predicted label for this sentence is “sport”.
|
| 167 |
+
|
| 168 |
+
Visualized Explanations on ImageNet. On ImageNet, we as well compare different explanations quantitatively on both of the proposed criteria. We plot the evaluation curves (in appendix A), and compute the corresponding AUC, as listed in Table 2. In general, we observe similar trends as the experiments shown in MNIST. In particular, Reg-Greedy enjoys an overall superior performances than existing explanations on the criteria. In addition, several visualization results in Figure 6 also qualitatively demonstrate that our method provides more compact explanations that focuses more on the actual object being classified.
|
| 169 |
+
|
| 170 |
+
Text Classification. We demonstrate how our explanation method could be applied to text classification models. Note that a length- $\mathbf { \nabla } \cdot n$ sentence is usually represented by $n$ embedding vectors, and thus when applying our Greedy algorithm, at each iteration we will try to add each embedding vector to the set $S _ { r }$ and choose the one with largest reward. Since there are only at most $n$ choices, the Greedy algorithm doesn’t suffer much from noise and has similar behavior with Reg-Greedy.
|
| 171 |
+
|
| 172 |
+
We perform experiments on an LSTM network which learns to classify a given sentence into one of the ten classes (Society, Science, Health, . . . ). We showcase an example with explanations generated with different methods in Figure 7. We note that although the top-5 relevant keyword sets generated by the three methods do not vary much, the rankings within the highlighted keywords for each explanation are in fact different. We observe that our method Greedy tends to generate explanation that matches human intuition the most. Particularly, to predict the label of “sport”, one might consider “cleats”, “football”, and “cut” as the strongest indications towards the concept “sport”.
|
| 173 |
+
|
| 174 |
+
# 5 RELATED WORK
|
| 175 |
+
|
| 176 |
+
Our work proposes an objective measurement of feature-based explanation by measuring the “minimum adversarial perturbation” in adversarial literature, which is estimated by adversarial attack. We provide a necessarily incomplete review on related works in objective measurement of explanations and adversarial robustness.
|
| 177 |
+
|
| 178 |
+
Objective Measurements for Explanations Evaluation of explanations has been a difficult problem mainly due to the absence of ground truth (Ancona et al., 2018; Sundararajan et al., 2017). Although one could rely on human intuitions to assess the quality of the generated explanations (Lundberg & Lee, 2017; Doshi-Velez & Kim, 2017), for example, judging whether the explanation focuses on the object of interest in an image classification task, these evaluations subject to human perceptions are prone to fall into the pitfall of favoring user-friendly explanations, such as attributions that visually aligns better with the input image, which might not reflect the model behavior (Adebayo et al., 2018). As a result, in addition to subjective measurements, recent literature has also proposed objective measurements, which is also called functionally-grounded evaluations (DoshiVelez & Kim, 2017). We roughly categorize existing objective measurements into two families.
|
| 179 |
+
|
| 180 |
+
This first family of explanation evaluation is called fidelity-based measurement. This includes that Completeness or Sum to Delta which requires the sum of attributions to equal the prediction difference of the original input and baseline (Sundararajan et al., 2017; Shrikumar et al., 2017); sensitivity-n which further generalizes completeness to any subset of the feature (Ancona et al., 2018); local accuracy Ribeiro et al. (2016); Lundberg & Lee (2017); and infidelity which is a framework that encompasses several (Yeh et al., 2019). The general philosophy for this line of methods is to require the sum of attribution value faithfully reflect the change in prediction function value given the presence or absence of certain subset of features. The second family of explanation evaluation are removal-based and preservation-based measurements, which focus on identifying the most important set of features with respect to a particular prediction. The underlying assumption made is that by removing the most (least) salient feature, the resulting function value should drop (increase) the most. (Samek et al., 2016) proposed this idea as an evaluation to evaluate the ranking of featureattribution score. Later on, Fong & Vedaldi (2017) derive explanations by solving an optimization problem to optimize the evaluation. And Dabkowski & Gal (2017) proposed to learn the explanation generating process by training an auxiliary model.
|
| 181 |
+
|
| 182 |
+
We note the implicitly in the evaluation process of both fidelity and removal (preservation) based measurement involves computing the change in function value given some set of features being absent. However, it is difficult to carefully model the concept of feature absence in practice, as most models by construction are not able to handle inputs with real missing features. As a result, previous work has compromised by using approximation to estimate the effect of removing certain features. This includes setting the values of the features to be removed by zero (Ancona et al., 2018; Sundararajan et al., 2017) or the mean value (Lundberg & Lee, 2017), blurred value (Fong & Vedaldi, 2017), random value (Samek et al., 2016; Dabkowski & Gal, 2017), or more advanced generative model that attempts to model the given data distribution (Chang et al., 2018). Unfortunately, such approximations that represent feature absence by setting the their values to some predefined distribution would inevitably introduce bias into the evaluation process. With the presence of this inherent caveat, we are thus inspired to adopt another angle to tackle the explanation problem.
|
| 183 |
+
|
| 184 |
+
Adversarial Robustness Adversarial robustness has been extensively studied in the past few years. The adversarial robustness of a machine learning model on a given sample can be defined as the shortest distance from the sample to the decision boundary, which corresponds to our definition in (1). Algorithms have been proposed for finding adversarial examples (feasible solutions of (1)), including (Goodfellow et al., 2014; Carlini & Wagner, 2017; Madry et al., 2017). However, those algorithms only work for neural networks, while for other models such as tree based models or nearest neighbor classifiers, adversarial examples can be found by decision based attacks (Brendel et al., 2017; Cheng et al., 2018; Chen et al., 2019). Therefore the proposed framework can also be used in other decision based classifiers. On the other hand, several works aim to solve the neural network verification problem, which is equivalent to finding a lower bound of (1). Examples include (Singh et al., 2018; Wong & Kolter, 2018; Zhang et al., 2018). In principal, our work can also apply these verification methods for getting an approximate solution of (1), but in practice they are very slow to run and often gives loose lower bounds on regular trained networks.
|
| 185 |
+
|
| 186 |
+
Our work is also closely related to related works that consider the question ”For situation A, why was the outcome B and not $\mathbf { { C } } ^ { \ast }$ , which we call counterfactual explanations. Xu et al. (2018) add group sparsity regularization to adversarial attack to enforce semantic structure for the perturbation, which is more interpretable. Ribeiro et al. (2018) find a set of features that once fixed, probability of the prediction is high when perturbing other features. Goyal et al. (2019) show how one could change the input feature such that the system would output a different class, where the change is limited to replacing a part of input feature by a part of an distractor image. Dhurandhar et al. (2018) consider the pertinent negative in a binary setting by solving a carefully designed loss function.
|
| 187 |
+
|
| 188 |
+
# 6 CONCLUSION
|
| 189 |
+
|
| 190 |
+
In this paper, we establish the link between a set of features to a prediction with a new evaluation criteria, robustness analysis, which measures the minimum tolerance of adversarial perturbation. Furthermore, we develop a new explanation method to find important set of features to optimize this new criterion. Experimental results demonstrate that the proposed new explanations are indeed capturing significant feature sets across multiple domains.
|
| 191 |
+
|
| 192 |
+
# REFERENCES
|
| 193 |
+
|
| 194 |
+
Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks for saliency maps. In Advances in Neural Information Processing Systems, pp. 9525–9536, 2018.
|
| 195 |
+
|
| 196 |
+
Marco Ancona, Enea Ceolini, Cengiz Oztireli, and Markus Gross. A unified view of gradient-based attribution methods for deep neural networks. International Conference on Learning Representations, 2018.
|
| 197 |
+
|
| 198 |
+
Sebastian Bach, Alexander Binder, Gre´goire Montavon, Frederick Klauschen, Klaus-Robert Mu¨ller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015.
|
| 199 |
+
|
| 200 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. arXiv preprint arXiv:1712.04248, 2017.
|
| 201 |
+
|
| 202 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy $( S P )$ , pp. 39–57. IEEE, 2017.
|
| 203 |
+
|
| 204 |
+
Chun-Hao Chang, Elliot Creager, Andrew A. Goldenberg, and David Kristjanson Duvenaud. Explaining image classifiers by counterfactual generation. In ICLR 2019, 2018.
|
| 205 |
+
|
| 206 |
+
Hongge Chen, Huan Zhang, Duane Boning, and Cho-Jui Hsieh. Robust decision trees against adversarial examples. In ICML, 2019.
|
| 207 |
+
|
| 208 |
+
Minhao Cheng, Thong Le, Pin-Yu Chen, Jinfeng Yi, Huan Zhang, and Cho-Jui Hsieh. Queryefficient hard-label black-box attack: An optimization-based approach. arXiv preprint arXiv:1807.04457, 2018.
|
| 209 |
+
|
| 210 |
+
Piotr Dabkowski and Yarin Gal. Real time image saliency for black box classifiers. In NIPS, 2017.
|
| 211 |
+
|
| 212 |
+
Amit Dhurandhar, Pin-Yu Chen, Ronny Luss, Chun-Chen Tu, Paishun Ting, Karthikeyan Shanmugam, and Payel Das. Explanations based on the missing: Towards contrastive explanations with pertinent negatives. In Advances in Neural Information Processing Systems, pp. 592–603, 2018.
|
| 213 |
+
|
| 214 |
+
Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608, 2017.
|
| 215 |
+
|
| 216 |
+
Ruth C. Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. 2017 IEEE International Conference on Computer Vision (ICCV), pp. 3449–3457, 2017.
|
| 217 |
+
|
| 218 |
+
Timon Gehr, Matthew Mirman, Dana Drachsler-Cohen, Petar Tsankov, Swarat Chaudhuri, and Martin Vechev. Ai2: Safety and robustness certification of neural networks with abstract interpretation. In 2018 IEEE Symposium on Security and Privacy $( S P )$ , pp. 3–18. IEEE, 2018.
|
| 219 |
+
|
| 220 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 221 |
+
|
| 222 |
+
Yash Goyal, Ziyan Wu, Jan Ernst, Dhruv Batra, Devi Parikh, and Stefan Lee. Counterfactual visual explanations. In International Conference on Machine Learning, pp. 2376–2384, 2019.
|
| 223 |
+
|
| 224 |
+
Guy Katz, Clark Barrett, David L Dill, Kyle Julian, and Mykel J Kochenderfer. Reluplex: An efficient smt solver for verifying deep neural networks. In International Conference on Computer Aided Verification, pp. 97–117. Springer, 2017.
|
| 225 |
+
|
| 226 |
+
Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pp. 1885–1894, 2017.
|
| 227 |
+
|
| 228 |
+
Jiwei Li, Will Monroe, and Dan Jurafsky. Understanding neural networks through representation erasure. CoRR, abs/1612.08220, 2016. URL http://arxiv.org/abs/1612.08220.
|
| 229 |
+
|
| 230 |
+
Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, pp. 4765–4774, 2017.
|
| 231 |
+
|
| 232 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 233 |
+
|
| 234 |
+
Jose Oramas, Kaili Wang, and Tinne Tuytelaars. Visual explanation by interpretation: Improving visual feedback capabilities of deep neural networks. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1ziPjC5Fm.
|
| 235 |
+
|
| 236 |
+
Vitali Petsiuk, Abir Das, and Kate Saenko. Rise: Randomized input sampling for explanation of black-box models. arXiv preprint arXiv:1806.07421, 2018.
|
| 237 |
+
|
| 238 |
+
Gregory Plumb, Denali Molitor, and Ameet S Talwalkar. Model agnostic supervised local explanations. In Advances in Neural Information Processing Systems, pp. 2515–2524, 2018.
|
| 239 |
+
|
| 240 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1135–1144. ACM, 2016.
|
| 241 |
+
|
| 242 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Anchors: High-precision model-agnostic explanations. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 243 |
+
|
| 244 |
+
Hadi Salman, Greg Yang, Huan Zhang, Cho-Jui Hsieh, and Pengchuan Zhang. A convex relaxation barrier to tight robust verification of neural networks. arXiv preprint arXiv:1902.08722, 2019.
|
| 245 |
+
|
| 246 |
+
Wojciech Samek, Alexander Binder, Gre´goire Montavon, Sebastian Lapuschkin, and Klaus-Robert Mu¨ller. Evaluating the visualization of what a deep neural network has learned. IEEE transactions on neural networks and learning systems, 28(11):2660–2673, 2016.
|
| 247 |
+
|
| 248 |
+
Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. International Conference on Machine Learning, 2017.
|
| 249 |
+
|
| 250 |
+
Gagandeep Singh, Timon Gehr, Matthew Mirman, Markus Pu¨schel, and Martin Vechev. Fast and effective robustness certification. In Advances in Neural Information Processing Systems, pp. 10802–10813, 2018.
|
| 251 |
+
|
| 252 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In International Conference on Machine Learning, 2017.
|
| 253 |
+
|
| 254 |
+
Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, and Suman Jana. Efficient formal safety analysis of neural networks. In Advances in Neural Information Processing Systems, pp. 6367– 6377, 2018.
|
| 255 |
+
|
| 256 |
+
Tsui-Wei Weng, Huan Zhang, Hongge Chen, Zhao Song, Cho-Jui Hsieh, Luca Daniel, Duane Boning, and Inderjit Dhillon. Towards fast computation of certified robustness for relu networks. In International Conference on Machine Learning, pp. 5273–5282, 2018a.
|
| 257 |
+
|
| 258 |
+
Tsui-Wei Weng, Huan Zhang, Pin-Yu Chen, Jinfeng Yi, Dong Su, Yupeng Gao, Cho-Jui Hsieh, and Luca Daniel. Evaluating the robustness of neural networks: An extreme value theory approach. arXiv preprint arXiv:1801.10578, 2018b.
|
| 259 |
+
|
| 260 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning, pp. 5283–5292, 2018.
|
| 261 |
+
|
| 262 |
+
Kaidi Xu, Sijia Liu, Pu Zhao, Pin-Yu Chen, Huan Zhang, Quanfu Fan, Deniz Erdogmus, Yanzhi Wang, and Xue Lin. Structured adversarial attack: Towards general implementation and better interpretability. arXiv preprint arXiv:1808.01664, 2018.
|
| 263 |
+
|
| 264 |
+
Chih-Kuan Yeh, Cheng-Yu Hsieh, Arun Sai Suggala, David I. Inouye, and Pradeep Ravikumar. On the (in)fidelity and sensitivity for explanations. CoRR, abs/1901.09392, 2019.
|
| 265 |
+
|
| 266 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818–833. Springer, 2014.
|
| 267 |
+
|
| 268 |
+
Huan Zhang, Tsui-Wei Weng, Pin-Yu Chen, Cho-Jui Hsieh, and Luca Daniel. Efficient neural network robustness certification with general activation functions. In Advances in neural information processing systems, pp. 4939–4948, 2018.
|
| 269 |
+
|
| 270 |
+
Huan Zhang, Pengchuan Zhang, and Cho-Jui Hsieh. Recurjac: An efficient recursive algorithm for bounding jacobian matrix of neural networks and its applications. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 5757–5764, 2019.
|
| 271 |
+
|
| 272 |
+
Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2979–2989, 2017.
|
| 273 |
+
|
| 274 |
+
# A EVALUATION CURVES
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 8: Comparisons between our proposed methods under different criteria. From left to right: untargeted Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ , targeted Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ , untargeted Robustness- $S _ { r }$ , targeted Robustness$S _ { r }$ . We omit points in the plot with value too high to fit in the scale of y-axis.
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
Figure 9: Comparisons between our proposed methods and existing explanations under different criteria. From left to right: untargeted Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ , targeted Robustness- $\overline { { S _ { r } } }$ , untargeted Robustness$S _ { r }$ , targeted Robustness- $S _ { r }$ . We omit points in the plot with value too high to fit in the scale of y-axis.
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 10: Comparisons between our proposed methods under different criteria on ImageNet. From left to right: untargeted Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ , targeted Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ , untargeted Robustness- $S _ { r }$ , targeted Robustness- $S _ { r }$ . We omit points in the plot with value too high to fit in the scale of y-axis.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 11: Comparisons between our proposed methods under different criteria on ImageNet. From left to right: untargeted Robustness- $\vec { \cdot S _ { r } }$ , targeted Robustness- $\overline { { \boldsymbol { S } _ { r } } }$ , untargeted Robustness- $S _ { r }$ , targeted Robustness- $S _ { r }$ . We omit points in the plot with value too high to fit in the scale of y-axis.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 12: Comparisons between explanations under different criteria on MNIST. Left figure: change in output logits as relevant features are inserted into the input. Right figure: change in output logits as relevant features are removed from the input.
|
| 290 |
+
|
| 291 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LOO</td><td>BBMP</td><td>Reg-Greedy</td></tr><tr><td>Insertion</td><td>250.81</td><td>262.74</td><td>200.50</td><td>192.44</td><td>102.53</td><td>379.15</td></tr><tr><td>Deletion</td><td>281.88</td><td>273.71</td><td>362.68</td><td>442.65</td><td>527.80</td><td>159.77</td></tr></table>
|
| 292 |
+
|
| 293 |
+
Table 5: Area under curve of the Insertion and Deletion criteria for various explanations on MNIST.
|
| 294 |
+
The higher the better for Insertion; the lower the better for Deletion.
|
| 295 |
+
|
| 296 |
+
# C T-TEST ON AUC
|
| 297 |
+
|
| 298 |
+
Table 6: The proposed Reg-Greedy versus other explanations on MNIST under our proposed criteria with Student’s $t$ -test at $9 5 \%$ confidence level.
|
| 299 |
+
|
| 300 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LOO</td><td>BBMP</td></tr><tr><td>Robustness-Sr</td><td>win</td><td>win</td><td>win</td><td>win</td><td>win</td></tr><tr><td>Robustness-Sr</td><td>win</td><td>win</td><td>win</td><td>win</td><td>win</td></tr></table>
|
| 301 |
+
|
| 302 |
+
Table 7: The proposed Reg-Greedy versus other explanations on MNIST under Insertion and Deletion criteria with Student’s $t$ -test at $9 5 \%$ confidence level.
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LO0</td><td>BBMP</td></tr><tr><td>Insertion</td><td>win</td><td>win</td><td>win</td><td>win</td><td>win</td></tr><tr><td>Deletion</td><td>win</td><td>win</td><td>win</td><td>win</td><td>win</td></tr></table>
|
| 305 |
+
|
| 306 |
+
# D SANITY CHECK
|
| 307 |
+
|
| 308 |
+
<table><tr><td>Explanations</td><td>Grad</td><td>IG</td><td>SHAP</td><td>LOO</td><td>BBMP</td><td>Reg-Greedy</td></tr><tr><td>Rank Correlation</td><td>0.3001</td><td>0.3042</td><td>0.1108</td><td>0.4966</td><td>0.1775</td><td>0.1835</td></tr></table>
|
| 309 |
+
|
| 310 |
+
Table 8: Rank correlation between explanations with respect to original and randomized model.
|
| 311 |
+
|
| 312 |
+
# E COMPARISONS ON TARGETED EXPLANATION
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 13: Comparisons between different targeted explanations against different targeted class on MNIST.
|
| 316 |
+
|
| 317 |
+
# F HEATMAP VISUALIZATION ON MNIST
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 14: Heatmap Visualization of different explanations on MNIST.
|
md/train/HygtHnR5tQ/HygtHnR5tQ.md
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GENERATIVE ADVERSARIAL NETWORKS FOR EXTREME LEARNED IMAGE COMPRESSION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a framework for extreme learned image compression based on Generative Adversarial Networks (GANs), obtaining visually pleasing images at significantly lower bitrates than previous methods. This is made possible through our GAN formulation of learned compression combined with a generator/decoder which operates on the full-resolution image and is trained in combination with a multi-scale discriminator. Additionally, if a semantic label map of the original image is available, our method can fully synthesize unimportant regions in the decoded image such as streets and trees from the label map, therefore only requiring the storage of the preserved region and the semantic label map. A user study confirms that for low bitrates, our approach is preferred to state-of-the-art methods, even when they use more than double the bits.
|
| 8 |
+
|
| 9 |
+
Ours 1567 Bytes
|
| 10 |
+
|
| 11 |
+

|
| 12 |
+
BPG 3573 Bytes $12 8 \%$ larger JPEG 13959B $+ 7 9 0 \%$ WebP 9437B $+ 5 0 2 \%$
|
| 13 |
+
Figure 1: Visual comparison of our result to that obtained by other codecs. Note that even when using more than twice the number of bytes, all other codecs are outperformed by our method visually.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Image compression systems based on deep neural networks (DNNs), or deep compression systems for short, have become an active area of research recently. These systems (e.g. (Theis et al., 2017; Balle et al., 2016b; Rippel & Bourdev, 2017; Ball ´ e et al., 2018; Mentzer et al., 2018)) are often com- ´ petitive with modern engineered codecs such as WebP (WebP), JPEG2000 (Taubman & Marcellin, 2001) and even BPG(Bellard) (the state-of-the-art engineered codec). Besides achieving competitive compression rates on natural images, they can be easily adapted to specific target domains such as stereo or medical images, and promise efficient processing and indexing directly from compressed representations (Torfason et al., 2018). However, deep compression systems are typically optimized for traditional distortion metrics such as peak signal-to-noise ratio (PSNR) or multi-scale structural similarity (MS-SSIM) (Wang et al., 2003). For very low bitrates (below 0.1 bits per pixel (bpp)), where preserving the full image content becomes impossible, these distortion metrics lose significance as they favor pixel-wise preservation of local (high-entropy) structure over preserving texture and global structure. To further advance deep image compression it is therefore of great importance to develop new training objectives beyond PSNR and MS-SSIM. A promising candidate towards this goal are adversarial losses (Goodfellow et al., 2014) which were shown recently to capture global semantic information and local texture, yielding powerful generators that produce visually appealing high-resolution images from semantic label maps (Isola et al., 2017; Wang et al., 2018).
|
| 18 |
+
|
| 19 |
+
In this paper, we propose and study a generative adversarial network (GAN)-based framework for extreme image compression, targeting bitrates below 0.1 bpp. We rely on a principled GAN formulation for deep image compression that allows for different degrees of content generation. In contrast to prior works on deep image compression which applied adversarial losses to image patches for artifact suppression (Rippel & Bourdev, 2017; Galteri et al., 2017), generation of texture details (Ledig et al., 2017), or representation learning for thumbnail images (Santurkar et al., 2017), our generator/decoder operates on the full-resolution image and is trained with a multi-scale discriminator (Wang et al., 2018).
|
| 20 |
+
|
| 21 |
+
We consider two modes of operation (corresponding to unconditional and conditional GANs (Goodfellow et al., 2014; Mirza & Osindero, 2014)), namely
|
| 22 |
+
|
| 23 |
+
• generative compression $( G C )$ , preserving the overall image content while generating structure of different scales such as leaves of trees or windows in the facade of buildings, and • selective generative compression $( S C )$ , completely generating parts of the image from a semantic label map while preserving user-defined regions with a high degree of detail.
|
| 24 |
+
|
| 25 |
+
We emphasize that GC does not require semantic label maps (neither for training, nor for deployment). A typical use case for GC are bandwidth constrained scenarios, where one wants to preserve the full image as well as possible, while falling back to synthesized content instead of blocky/blurry blobs for regions for which not sufficient bits are available to store the original pixels. SC could be applied in a video call scenario where one wants to fully preserve people in the video stream, but a visually pleasing synthesized background serves the purpose as well as the true background. In the GC operation mode the image is transformed into a bitstream and encoded using arithmetic coding. SC requires a semantic/instance label map of the original image which can be obtained using off-the-shelf semantic/instance segmentation networks, e.g., PSPNet (Zhao et al., 2017) and Mask R-CNN (He et al., 2017), and which is stored as a vector graphic. This amounts to a small, image dimension-independent overhead in terms of coding cost. On the other hand, the size of the compressed image is reduced proportionally to the area which is generated from the semantic label map, typically leading to a significant overall reduction in storage cost.
|
| 26 |
+
|
| 27 |
+
For GC, a comprehensive user study shows that our compression system yields visually considerably more appealing results than BPG (Bellard) (the current state-of-the-art engineered compression algorithm) and the recently proposed autoencoder-based deep compression (AEDC) system (Mentzer et al., 2018). In particular, our GC models trained for compression of general natural images are preferred to BPG when BPG uses up to $9 5 \%$ and $12 4 \%$ more bits than those produced by our models on the Kodak (Kodak) and RAISE1K (Dang-Nguyen et al., 2015) data set, respectively. When constraining the target domain to the street scene images of the Cityscapes data set (Cordts et al., 2016), the reconstructions of our GC models are preferred to BPG even when the latter uses up to $181 \%$ more bits. To the best of our knowledge, these are the first results showing that a deep compression method outperforms BPG on the Kodak data set in a user study—and by large margins. In the SC operation mode, our system seamlessly combines preserved image content with synthesized content, even for regions that cross multiple object boundaries, while faithfully preserving the image semantics. By partially generating image content we achieve bitrate reductions of over $50 \%$ without notably degrading image quality.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Deep image compression has recently emerged as an active area of research. The most popular DNN architectures for this task are to date auto-encoders (Theis et al., 2017; Balle et al., 2016b; Agustsson ´ et al., 2017; Li et al., 2017; Torfason et al., 2018; Minnen et al., 2018) and recurrent neural networks (RNNs) (Toderici et al., 2015; 2016). These DNNs transform the input image into a bit-stream, which is in turn losslessly compressed using entropy coding methods such as Huffman coding or arithmetic coding. To reduce coding rates, many deep compression systems rely on context models to capture the distribution of the bit stream (Balle et al., 2016b; Toderici et al., 2016; Li et al., 2017; ´ Rippel & Bourdev, 2017; Mentzer et al., 2018). Common loss functions to measure the distortion between the original and decompressed images are the mean-squared error (MSE) (Theis et al., 2017; Balle et al., 2016b; Agustsson et al., 2017; Li et al., 2017; Ball ´ e et al., 2018; Torfason et al., ´ 2018), or perceptual metrics such as MS-SSIM (Toderici et al., 2016; Rippel & Bourdev, 2017; Balle et al., 2018; Mentzer et al., 2018). Some authors rely on advanced techniques including multi- ´ scale decompositions (Rippel & Bourdev, 2017), progressive encoding/decoding strategies (Toderici et al., 2015; 2016), and generalized divisive normalization (GDN) layers (Balle et al., 2016b;a). ´
|
| 32 |
+
|
| 33 |
+
Generative adversarial networks (GANs) (Goodfellow et al., 2014) have emerged as a popular technique for learning generative models for intractable distributions in an unsupervised manner. Despite stability issues (Salimans et al., 2016; Arjovsky & Bottou, 2017; Arjovsky et al., 2017; Mao et al., 2017), they were shown to be capable of generating more realistic and sharper images than prior approaches and to scale to resolutions of $1 0 2 4 \times 1 0 2 4 \mathrm { p x }$ (Zhang et al., 2017; Karras et al., 2017) for some datasets. Another direction that has shown great progress are conditional GANs (Goodfellow et al., 2014; Mirza & Osindero, 2014), obtaining impressive results for image-to-image translation (Isola et al., 2017; Wang et al., 2018; Zhu et al., 2017; Liu et al., 2017) on various datasets (e.g. maps to satellite images), reaching resolutions as high as $1 0 2 4 \times 2 0 4 8 \mathrm { p x }$ (Wang et al., 2018).
|
| 34 |
+
|
| 35 |
+
Arguably the most closely related work to ours is (Rippel & Bourdev, 2017), which uses an adversarial loss term to train a deep compression system. However, this loss term is applied to small image patches and its purpose is to suppress artifacts rather than to generate image content. Furthermore, it uses a non-standard GAN formulation that does not (to the best of our knowledge) have an interpretation in terms of divergences between probability distributions, as in (Goodfellow et al., 2014; Nowozin et al., 2016). We refer to Sec. 6.1 and Appendix A for a more detailed discussion. Santurkar et al. (2017) use a GAN framework to learn a generative model over thumbnail images, which is then used as a decoder for thumbnail image compression. Other works use adversarial training for compression artifact removal (for engineered codecs) (Galteri et al., 2017) and single image super-resolution (Ledig et al., 2017). Finally, related to our SC mode, spatially allocating bitrate based on saliency of image content has a long history in the context of engineered compression algorithms, see, e.g.,, (Stella & Lisin, 2009; Guo & Zhang, 2010; Gupta et al., 2013).
|
| 36 |
+
|
| 37 |
+
# 3 BACKGROUND
|
| 38 |
+
|
| 39 |
+
Generative Adversarial Networks: Given a data set $\mathcal { X }$ , Generative Adversarial Networks (GANs) can learn to approximate its (unknown) distribution $p _ { { \pmb x } }$ through a generator $G ( z )$ that tries to map samples $_ z$ from a fixed prior distribution $p _ { z }$ to the distribution $p _ { \pmb { x } }$ . The generator $G$ is trained in parallel with a discriminator $D$ by searching (using stochastic gradient descent (SGD)) for a saddle point of a mini-max objective
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } ~ \mathbb { E } [ f ( D ( \pmb { x } ) ) ] + \mathbb { E } [ g ( D ( G ( z ) ) ) ] ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $G$ and $D$ are DNNs and $f$ and $g$ are scalar functions. The original paper (Goodfellow et al., 2014) uses the “Vanilla GAN” objective with $f ( y ) = \log ( y )$ and $g ( y ) = \log ( 1 - y )$ . This corresponds to $G$ minimizing the Jensen-Shannon (JS) Divergence between the (empirical) distribution of $_ { \textbf { \em x } }$ and $G ( z )$ . The JS Divergence is a member of a more generic family of $f$ -divergences, and Nowozin et al. (2016) show that for suitable choices of $f$ and $g$ , all such divergences can be minimized with (1). In particular, if one uses $f ( y ) = ( y - 1 ) ^ { 2 }$ and $g ( y ) = y ^ { 2 }$ , one obtains the LeastSquares GAN (Mao et al., 2017) (which corresponds to the Pearson $\chi ^ { 2 }$ divergence), which we adopt in this paper. We refer to the divergence minimized over $G$ as
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathcal { L } _ { \mathrm { G A N } } : = \operatorname* { m a x } _ { D } ~ \mathbb { E } [ f ( D ( \pmb { x } ) ) ] + \mathbb { E } [ g ( D ( G ( z ) ) ) ] .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Conditional Generative Adversarial Networks: For conditional GANs (cGANs) (Goodfellow et al., 2014; Mirza $\&$ Osindero, 2014), each data point $_ { \textbf { \em x } }$ is associated with additional information $\pmb { s }$ , where $( { \pmb x } , { \pmb s } )$ have an unknown joint distribution $p _ { { \pmb x } , { \pmb s } }$ . We now assume that $\pmb { s }$ is given and that we want to use the GAN to model the conditional distribution $p _ { { \pmb x } | { \pmb s } }$ . In this case, both the generator $G ( z , s )$ and discriminator $D ( z , s )$ have access to the side information $\pmb { s }$ , leading to the divergence
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } _ { \mathrm { c G A N } } : = \operatorname* { m a x } _ { D } ~ \mathbb { E } [ f ( D ( \pmb { x } , \pmb { s } ) ) ] + \mathbb { E } [ g ( D ( G ( z , \pmb { s } ) , \pmb { s } ) ) ] .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Deep Image Compression: To compress an image $\mathbf { \boldsymbol { x } } \in \mathcal { X }$ , we follow the formulation of (Agustsson et al., 2017; Mentzer et al., 2018) where one learns an encoder $E$ , a decoder $G$ , and a finite quantizer $q$ . The encoder $E$ maps the image to a latent feature map $\pmb { w }$ , whose values are then quantized to $L$ levels $\{ c _ { 1 } , \ldots , c _ { L } \} \subset \mathbf { \bar { \mathbb { R } } }$ to obtain a representation $\pmb { \hat { w } } = q ( E ( \pmb { x } ) )$ that can be encoded to a bitstream. The decoder then tries to recover the image by forming a reconstruction $\hat { \pmb x } = G ( \hat { \pmb w } )$ . To be able to backpropagate through the non-differentiable $q$ , one can use a differentiable relaxation of $q$ , as in (Mentzer et al., 2018).
|
| 58 |
+
|
| 59 |
+
The average number of bits needed to encode $\hat { \pmb { w } }$ is measured by the entropy $H ( \hat { \pmb w } )$ , which can be modeled with a prior (Agustsson et al., 2017) or a conditional probability model (Mentzer et al., 2018). The trade-off between reconstruction quality and bitrate to be optimized is then
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbb { E } [ d ( { \pmb x } , \hat { \pmb x } ) ] + \beta H ( \hat { \pmb w } ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $d$ is a loss that measures how perceptually similar $\hat { \pmb x }$ is to $_ { \textbf { \em x } }$ . Given a differentiable estimator of the entropy $H ( \hat { \pmb w } )$ , the weight $\beta$ controls the bitrate of the model (large $\beta$ pushes the bitrate down). However, since the number of dimensions $\mathrm { d i m } ( \hat { \pmb w } )$ and the number of levels $L$ are finite, the entropy is bounded by (see, e.g., (Cover $\&$ Thomas, 2012))
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
H ( \hat { w } ) \leq \dim ( \hat { w } ) \log _ { 2 } ( L ) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
It is therefore also valid to set $\beta = 0$ and control the maximum bitrate through the bound (5) (i.e., adjusting $L$ and/or $\mathrm { d i m } ( \hat { \pmb w } )$ through the architecture of $E$ ). While potentially leading to suboptimal bitrates, this avoids to model the entropy explicitly as a loss term.wˆ
|
| 72 |
+
|
| 73 |
+
# 4 GANS FOR EXTREME IMAGE COMPRESSIONxˆ
|
| 74 |
+
|
| 75 |
+
# 4.1 GENERATIVE COMPRESSION
|
| 76 |
+
|
| 77 |
+
The proposed GAN framework for extreme image compression can be viewed as a combination of (conditional) GANs and learned compression. With an encoder $E$ and quantizer $q$ , we encode the image $_ { \textbf { \em x } }$ to a compressed representation $\hat { \pmb { w } } = q ( E ( \pmb { x } ) )$ . This representation is optionally concatenated with noise $\pmb { v }$ drawn from a fixed prior $p _ { v }$ , to form the latent vector $_ z$ . The decoder/generator $G$ then tries to generate an image ${ \hat { \pmb x } } = G ( { \pmb z } )$ that is consistent with the image distribution $p _ { \pmb { x } }$ while also recovering the specific encoded image $_ { \textbf { \em x } }$ to a certain degree (see inset Fig.). Using $z = [ \hat { \pmb w } , \pmb v ]$ , this can be expressed by our saddle-point objective for (unconditional) generative compression,
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\operatorname* { m i n } _ { E , G } \operatorname* { m a x } _ { D } \mathbb { E } [ f ( D ( \pmb { x } ) ) ] + \mathbb { E } [ g ( D ( G ( z ) ) ] + \lambda \mathbb { E } [ d ( \pmb { x } , G ( z ) ) ] + \beta H ( \pmb { \hat { w } } ) ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\lambda > 0$ balances the distortion term against the GAN loss and entropy terms. Using this formulation, we need to encode a real image, ${ \hat { \pmb w } } = E ( \pmb { x } )$ , to be able to sample from $p _ { \hat { \mathbf { \alpha } } \hat { \mathbf { \beta } } }$ . However, this is not a limitation as our goal is to compress real images and not to generate completely new ones.
|
| 86 |
+
|
| 87 |
+
Since the last two terms of (6) do not depend on the discriminator $D$ , they do not affect its optimization directly. This means that the discriminator still computes the same $f$ divergence $\mathcal { L } _ { \mathrm { G A N } }$ as in (2), so we can write (6) as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\operatorname* { m i n } _ { E , G } \quad \mathcal { L } _ { \mathrm { G A N } } + \lambda \mathbb { E } [ d ( \pmb { x } , G ( z ) ) ] + \beta H ( \pmb { \hat { w } } ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
We note that equation (6) has completely different dynamics than a normal GAN, because the latent space $_ { z }$ contains $\hat { \pmb { w } }$ , which stores information about a real image $_ { \textbf { \em x } }$ . A crucial ingredient is the bitrate limitation on $H ( \hat { \pmb w } )$ . If we allow $\hat { \pmb { w } }$ to contain arbitrarily many bits by setting $\beta = 0$ and letting $L$ and $\mathrm { d i m } ( \hat { \pmb w } )$ be large enough, $E$ and $G$ could learn to near-losslessly recover $_ { \textbf { \em x } }$ from $G ( z ) \bar { = } \ G ( q ( E ( \bar { \bf x } ) ) )$ , such that the distortion term would vanish. In this case, the divergence between $p _ { { \pmb x } }$ and $p _ { G ( z ) }$ would also vanish and the GAN loss would have no effect.
|
| 94 |
+
|
| 95 |
+
By constraining the entropy of $\hat { \pmb { w } }$ , $E$ and $G$ will never be able to make $d$ fully vanish. In this case, $E , G$ need to balance the GAN objective ${ \mathcal { L } } _ { \mathrm { G A N } }$ and the distortion term $\lambda \mathbb { E } [ d ( \dot { \pmb { x } } , G ( \pmb { z } ) ) ]$ , which leads to $G ( z )$ on one hand looking “realistic”, and on the other hand preserving the original image. For example, if there is a tree for which $E$ cannot afford to store the exact texture (and make $d$ small) $G$ can synthesize it to satisfy $\mathcal { L } _ { \mathrm { G A N } }$ , instead of showing a blurry green blob.
|
| 96 |
+
|
| 97 |
+
In the extreme case where the bitrate becomes zero (i.e., $H ( \hat { \pmb w } ) 0$ , e.g., by setting $\beta = \infty$ or $\mathrm { d i m } ( \hat { \pmb w } ) = 0 ,$ ), $\hat { \pmb { w } }$ becomes deterministic. In this setting, $_ z$ is random and independent of $_ { \textbf { \em x } }$ (through the $\textbf { { v } }$ component) and the objective reduces to a standard GAN plus the distortion term, which acts as a regularizer.
|
| 98 |
+
|
| 99 |
+
We refer to the setting in (6) as generative compression (GC), where $E , G$ balance reconstruction and generation automatically over the image. As for the conditional GANs described in Sec. 3, we can easily extend GC to a conditional case. Here, we also consider this setting, where the additional information $\pmb { s }$ for an image $_ { \textbf { \em x } }$ is a semantic label map of the scene, but with a twist: Instead of feeding the semantics to $E , G$ and $D$ , we only give them to the discriminator $D$ during training.1 This means that no semantics are needed to encode or decode images with the trained models (since $E , G$ do not depend on $\pmb { s }$ ). We refer to this setting as GC $( D ^ { + } )$ .
|
| 100 |
+
|
| 101 |
+
# 4.2 SELECTIVE GENERATIVE COMPRESSION
|
| 102 |
+
|
| 103 |
+
For GC and its conditional variant described in the previous section, $E , G$ automatically navigate the trade-off between generation and preservation over the entire image, without any guidance. Here, we consider a different setting, where we guide the network in terms of which regions should be preserved and which regions should be synthesized. We refer to this setting as selective generative compression (SC) (an overview of the network structure is given in Fig. 8 in Appendix C).
|
| 104 |
+
|
| 105 |
+
For simplicity, we consider a binary setting, where we construct a single-channel binary heatmap $_ { m }$ of the same spatial dimensions as $\hat { \pmb { w } }$ . Regions of zeros correspond to regions that should be fully synthesized, whereas regions of ones correspond to regions that should be preserved. However, since our task is compression, we constrain the fully synthesized regions to have the same semantics $\pmb { s }$ as the original image $_ { \textbf { \em x } }$ . We assume the semantics $\pmb { s }$ are separately stored, and thus feed them through a feature extractor $F$ before feeding them to the generator $G$ . To guide the network with the semantics, we mask the (pixel-wise) distortion $d$ , such that it is only computed over the region to be preserved. Additionally, we zero out the compressed representation $\hat { \pmb w }$ in the regions that should be synthesized. Provided that the heatmap $_ { \mathbf { \nabla } } \mathbf { m }$ is also stored, we then only encode the entries of $\hat { \pmb { w } }$ corresponding to the preserved regions, greatly reducing the bitrate needed to store it.
|
| 106 |
+
|
| 107 |
+
At bitrates where $\hat { \pmb { w } }$ is normally much larger than the storage cost for $\pmb { s }$ and $_ { m }$ (about 2kB per image when encoded as a vector graphic), this approach can result in large bitrate savings.
|
| 108 |
+
|
| 109 |
+
We consider two different training modes: Random instance (RI) which randomly selects $2 5 \%$ of the instances in the semantic label map and preserves these, and random box (RB) which picks an image location uniformly at random and preserves a box of random dimensions. While the RI mode is appropriate for most use cases, the RB can create more challenging situations for the generator as it needs to integrate the preserved box seamlessly into the generated content.
|
| 110 |
+
|
| 111 |
+
# 5 EXPERIMENTS
|
| 112 |
+
|
| 113 |
+
5.1 ARCHITECTURE, LOSSES, AND HYPERPARAMETERS
|
| 114 |
+
|
| 115 |
+
The architecture for our encoder $E$ and generator $G$ is based on the global generator network proposed in (Wang et al., 2018), which in turn is based on the architecture of (Johnson et al., 2016). We present details in Appendix C.
|
| 116 |
+
|
| 117 |
+
For the entropy term $\beta H ( \hat { \pmb w } )$ , we adopt the simplified approach described in Sec. 3, where we set $\beta = 0$ , use $L = 5$ centers $\mathcal { C } = \{ - 2 , 1 , 0 , 1 , 2 \}$ , and control the bitrate through the upper bound $H ( \pmb { \hat { w } } ) \leq \dim ( \pmb { \hat { w } } ) \log _ { 2 } ( L )$ . For example, for GC, with $C = 2$ channels, we obtain 0.0181bpp.2 We note that this is an upper bound; the actual entropy of $H ( \hat { \pmb w } )$ is generally smaller, since the learned distribution will neither be uniform nor i.i.d, which would be required for the bound to hold with equality. When encoding the channels of $\hat { \pmb { w } }$ to a bit-stream, we use an arithmetic encoder where frequencies are stored for each channel separately and then encode them in a static (non-adaptive)
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 2: Visual example of images produced by our GC network with $C = 4$ along with the corresponding results for BPG, and a baseline model with the same architecture $C = 4$ ) but trained for MSE only (MSE bl.), on Cityscapes. The reconstruction of our GC network is sharper and has more realistic texture than those of BPG and the MSE baseline, even though the latter two have higher PSNR (indicated in dB for each image) than our GC network. In particular, the MSE baseline produces blurry reconstructions even though it was trained on the Cityscapes data set, demonstrating that domain-specific training alone is not enough to obtain sharp reconstructions at low bitrates.
|
| 121 |
+
|
| 122 |
+
manner, similar to Agustsson et al. (2017). In our experiments, this leads to $8 . 8 \%$ smaller bitrates compared to the upper bound.
|
| 123 |
+
|
| 124 |
+
By using a context model and adaptive arithmetic encoding, we could reduce the bitrate further, either in a post processing step (as in (Rippel & Bourdev, 2017; Balle et al., 2016b)), or jointly ´ during training (as in (Mentzer et al., 2018; Minnen et al., 2018))—which led to $\approx 1 0 \%$ savings in these prior works.
|
| 125 |
+
|
| 126 |
+
For the distortion term we adopt $d ( \pmb { x } , \hat { \pmb { x } } ) = \mathbf { M S E } ( \pmb { x } , \hat { \pmb { x } } )$ with coefficient $\lambda = 1 0$ . Furthermore, we adopt the feature matching and VGG perceptual losses, $\mathcal { L } _ { \mathrm { F M } }$ and ${ \mathcal { L } } _ { \mathrm { V G G } }$ , as proposed in (Wang et al., 2018) with the same weights, which improved the quality for images synthesized from semantic label maps. These losses can be viewed as a part of $d ( { \pmb x } , \hat { { \pmb x } } )$ . However, we do not mask them in SC, since they also help to stabilize the GAN in this operation mode (as in (Wang et al., 2018)). We refer to Appendix D for training details.
|
| 127 |
+
|
| 128 |
+
# 5.2 EVALUATION
|
| 129 |
+
|
| 130 |
+
Data sets: We train GC models (without semantic label maps) for compression of diverse natural images using $1 8 8 \mathrm { k }$ images from the Open Images data set (Krasin et al., 2017) and evaluate them on the widely used Kodak image compression data set (Kodak) as well as 20 randomly selected images from the RAISE1K data set (Dang-Nguyen et al., 2015). To investigate the benefits of having a somewhat constrained application domain and semantic information at training time, we also train GC models with semantic label maps on the Cityscapes data set (Cordts et al., 2016), using 20 randomly selected images from the validation set for evaluation. To evaluate the proposed SC method (which requires semantic label maps for training and deployment) we again rely on the Cityscapes data set. Cityscapes was previously used to generate images form semantic label maps using GANs (Isola et al., 2017; Zhu et al., 2017).
|
| 131 |
+
|
| 132 |
+
Baselines: We compare our method to the HEVC-based image compression algorithm BPG (Bellard) (in the 4:2:2 chroma format) and to the AEDC network from (Mentzer et al., 2018). BPG is the current state-of-the-art engineered image compression codec and outperforms other recent codecs such as JPEG2000 and WebP on different data sets in terms of PSNR (see, e.g. (Balle et al., 2018)). ´ We train the AEDC network (with bottleneck depth $C = 4$ ) on Cityscapes exactly following the procedure in (Mentzer et al., 2018) except that we use early stopping to prevent overfitting (note that Cityscapes is much smaller than the ImageNet dataset used in (Mentzer et al., 2018)). The so-obtained model has a bitrate of 0.07 bpp and gets a slightly better MS-SSIM than BPG at the same bpp on the validation set. To investigate the effect of the GAN term in our total loss, we train a baseline model with an MSE loss only (with the same architecture as GC and the same training parameters, see Sec. D in the Appendix), referred to as “MSE baseline”.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: Visual example of images from RAISE1k produced by our GC network with $C = 4$ along with the corresponding results for BPG.
|
| 136 |
+
|
| 137 |
+
User study: In the extreme compression regime realized by our GC models, where texture and sometimes even more abstract image content is synthesized, common reconstruction quality measures such as PSNR and MS-SSIM arguably lose significance as they penalize changes in local structure rather than assessing preservation of the global image content (this also becomes apparent by comparing reconstructions produced by our GC model with those obtained by the MSE baseline and BPG, see Fig. 2). Indeed, measuring PSNR between synthesized and real texture patches essentially quantifies the variance of the texture rather than the visual quality of the synthesized texture.
|
| 138 |
+
|
| 139 |
+
To quantitatively evaluate the perceptual quality of our GC models in comparison with BPG and AEDC (for Cityscapes) we therefore conduct a user study using Amazon Mechanical Turk (AMT).3 We consider two GC models with $C = 4 , 8$ trained on Open Images, three GC $( D ^ { + } )$ models with $C = 2 , 4 , 8$ trained on Cityscapes, and BPG at rates ranging from 0.045 to 0.12 bpp. Questionnaires are composed by combining the reconstructions produced by the selected GC model for all testing images with the corresponding reconstruction produced by the competing baseline model side-byside (presenting the reconstructions in random order). The original image is shown along with the reconstructions, and the pairwise comparisons are interleaved with 3 probing comparisons of an additional uncompressed image from the respective testing set with an obviously JPEG-compressed version of that image. 20 randomly selected unique users are asked to indicate their preference for each pair of reconstructions in the questionnaire, resulting in a total of 480 ratings per pairing of methods for Kodak, and 400 ratings for RAISE1K and Cityscapes. For each pairing of methods, we report the mean preference score as well as the standard error (SE) of the per-user mean preference percentages. Only users correctly identifying the original image in all probing comparisons are taken into account for the mean preference percentage computation. To facilitate comparisons for future works, we will release all images used in the user studies.
|
| 140 |
+
|
| 141 |
+
Semantic quality of SC models: The issues with PSNR and MS-SSIM for evaluating the quality of generated content described in the previous paragraph become even more severe for SC models as a large fraction of the image content is generated from a semantic label map. Following image translation works Isola et al. (2017); Wang et al. (2018), we therefore measure the capacity of our SC models to preserve the image semantics in the synthesized regions and plausibly blend them with the preserved regions—the objective SC models are actually trained for. Specifically, we use PSPNet (Zhao et al., 2016) and compute the mean intersection-over-union (IoU) between the label map obtained for the decompressed validation images and the ground truth label map. For reference we also report this metric for baselines that do not use semantic label maps for training and/or deployment.
|
| 142 |
+
|
| 143 |
+
# 6 RESULTS
|
| 144 |
+
|
| 145 |
+
# 6.1 GENERATIVE COMPRESSION
|
| 146 |
+
|
| 147 |
+
Fig. 4 shows the mean preference percentage obtained by our GC models compared to BPG at different rates, on the Kodak and the RAISE1K data set. In addition, we report the mean preference percentage for GC models compared to BPG and AEDC on Cityscapes. Example validation images for side-by-side comparison of our method with BPG for images from the Kodak, RAISE1K, and Cityscapes data set can be found in Figs. 1, 3, and 2, respectively. Furthermore, we perform extensive visual comparisons of all our methods and the baselines, presented in Appendix F.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: User study results evaluating our GC models on Kodak, RAISE1K (top) and Cityscapes GC C=4 preferred GC C=8 preferredGC C=4 preferred GC C=8 preferred(bottom). For Kodak and RAISE1K, we use GC models trained on Open Images, without any semantic label maps. For Cityscapes, we used GC $( D ^ { + } )$ , using semantic label maps only for $D$ and BPG 123% larger, andGC C=4 still preferredrger, andpreferred BPG 40% larger, andGC C=8 still preferredBPG 123% larger, andGC C=4 still preferredger, andreferred BPG 40% larger, andGC C=8 still preferredonly during training. The standard error is computed over per-user mean preference percentages. [bpp][bpp] 0.069AEDC[bpp][bpp] 0.069AEDCThe blue arrows visualize how many more bits BPG uses when $> 5 0 \%$ users still prefer our result.
|
| 151 |
+
|
| 152 |
+
Our GC models with $C = 4$ are preferred to BPG even when images produced by BPG use $9 5 \%$ and $12 4 \%$ more bits than those produced by our models for Kodak and RAISE1K, respectively. Notably this is achieved even though there is a distribution shift between the training and testing set (recall 2ch 8chthat these GC models are trained on Open Images). The gains of domain-specificity and semantic BPG X 0.04974 0.059375 BPG X 0.079155 0.09909 0.12171BPG Preflabel maps (for training) becomes apparent from the results on Cityscapes: Our GC models with $C = 2$ CVPR X 0.069 CVPR X are preferred to BPG even when the latter uses $181 \%$ 069 more bits. For $C = 4$ the gains on CVPR Pref 47.8125% CVPR Pref 83%Cityscapes are comparable to those obtained for GC on RAISE1K. For all three data sets, BPG BPG STDDEV 0.0requires between 21 and $49 \%$ 0.056529 BPG STDDEV 0.029273 more bits than our GC models with $C = 8$ 7 .
|
| 153 |
+
|
| 154 |
+
ours 0.01767578125 ours Discussion: The GC models produce images with much finer detail than BPG, which suffers from smoothed patches and blocking artifacts. In particular, the GC models convincingly reconstruct BPG X 0.079155 0.09909 0.12171 BPG X 0.079155 0.09909 0.12171BPG X 0.059375 0.079155 0.09909texture in natural objects such as trees, water, and sky, and is most challenged with scenes involving 52.6667% 38% BPG Pref 63.125% 53.5714% 44.7222% 52.6667% 38% BPG Pref 63.125% 53.5714% 44.7222% BPG Pref 62.0588% 50.3571% 32.6667%humans. AEDC and the MSE baseline both produce blurry images.
|
| 155 |
+
|
| 156 |
+
47.8125% CVPR Pref 83%47.8125% CVPR Pref 83%CVPR Pref 79.3333%We see that the gains of our models are maximal at extreme bitrates, with BPG needing $9 5 \mathrm { - } 1 8 1 \%$
|
| 157 |
+
0.071782 0.0565290.071782 0.056529BPG STDDEV more bits for the $C = 2 , 4$ STDDEV 0.029273 0.038276 0.024047TDDEV 0.029273 0.038276 0.0240470.036931models on the three datasets. For $C = 8$ gains are smaller but still
|
| 158 |
+
0.072210.07221 ours 0.035592651very large (BPG needing $2 1 \mathrm { - } 4 9 \%$ 0.070944976810.07094497681 more bits). This is expected, since as the bitrate increases the
|
| 159 |
+
.81401988950276 gain 1.3967162222827481401988950276 gain 1.39671622228274gain 2.22391412140534classical compression measures (PSNR/MS-SSIM) become more meaningful—and our system does
|
| 160 |
+
4ch4chnot employ the full complexity of current state-of-the-art systems, as discussed next.
|
| 161 |
+
|
| 162 |
+
0.059375 0.079155 0.0990962.0588% 50.3571% 32.6667%0.059375 0.079155 0.0990962.0588% 50.3571% 32.6667%State-of-the-art on Kodak: We give an overview of relevant recent learned compression methods 0.0690.069and their differences to our GC method and BPG in Table 1 in the Appendix. Rippel & Bourdev 79.3333%79.3333%(2017) also used GANs (albeit a different formulation) and were state-of-the-art in MS-SSIM in 0.07221 0.072212017, while the concurrent work of Minnen et al. (2018) is the current state-of-the-art in image 0.035592651370.03559265137compression in terms of classical metrics (PSNR and MS-SSIM) when measured on the Kodak .2239141214053422391412140534dataset (Kodak). Notably, all methods except ours (BPG, Rippel et al., and Minnen et al.) employ adaptive arithmetic coding using context models for improved compression performance. Such models could also be implemented for our system, and have led to additional savings of $10 \%$ in Mentzer et al. (2018). Since Rippel et al. and Minnen et al. have only released a selection of their decoded images (for 3 and 4, respectively, out of the 24 Kodak images), and at significantly higher bitrates, a comparison with a user study is not meaningful. Instead, we try to qualitatively put our results into context with theirs.
|
| 163 |
+
|
| 164 |
+
In Figs. 12–14 in the Appendix, we compare qualitatively to Rippel & Bourdev (2017). We can observe that even though Rippel & Bourdev (2017) use $2 9 - 1 7 9 \%$ more bits, our models produce images of comparable or better quality.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
|
| 168 |
+
In Figs. 15–18, we show a qualitative comparison of our results to the images provided by the concurrent work of Minnen et al. (2018), as well as to BPG (Bellard) on those images. First, we see that BPG is still visually competitive with the current state-of-the-art, which is consistent with moderate $8 . 4 1 \%$ bitrate savings being reported by Minnen et al. (2018) in terms of PSNR. Second, even though we use much fewer bits compared to the example images available from Minnen et al. (2018), for some of them (Figs. 15 and 16) our method can still produce images of comparable visual quality.
|
| 169 |
+
|
| 170 |
+
Given the dramatic bitrate savings we achieve according to the user study (BPG needing $2 1 \mathrm { - } 1 8 1 \%$ more bits), and the competitiveness of BPG to the most recent state-of-the-art (Minnen et al., 2018), we conclude that our proposed system presents a significant step forward for visually pleasing compression at extreme bitrates.
|
| 171 |
+
|
| 172 |
+
Sampling the compressed representations: In Fig. 5 we explore the representation learned by our GC models (with $C = 4$ ), by sampling the (discrete) latent space of $\hat { \pmb { w } }$ . When we sample uniformly, and decode with our GC model into images, we obtain a “soup of image patches” which reflects the domain the models were trained on (e.g. street sign and building patches on Cityscapes). Note that we should not expect these outputs to look like normal images, since nothing forces the encoder output $\hat { \pmb w }$ to be uniformly distributed over the discrete latent space.
|
| 173 |
+
|
| 174 |
+
However, given the low dimensionality of $\hat { \pmb { w } }$ $3 2 \times 6 4 \times 4$ for $5 1 2 \times 1 0 2 4 \mathrm { p x }$ Cityscape images), it would be interesting to try to learn the true distribution. To this end, we perform a simple experiment and train an improved Wasserstein GAN (WGAN-GP) (Gulrajani et al., 2017) on $\hat { \pmb { w } }$ extracted from Cityscapes, using default parameters and a ResNet architecture.4 By feeding our GC model with samples from the WGAN-GP generator, we easily obtain a powerful generative model, which generates sharp $1 0 2 4 \times 5 1 2 \mathrm { p x }$ images from scratch. We think this could be a promising direction for building high-resolution generative models. In Figs. 19–21 in the Appendix, we show more samples, and samples obtained by feeding the MSE baseline with uniform and learned code samples. The latter yields noisier “patch soups” and much blurrier image samples than our GC network.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 6: Mean IoU as a function of bpp on the Cityscapes validation set for our GC and SC networks, and for the MSE baseline. We show both SC modes: RI (inst.), RB (box). $D ^ { + }$ annotates models where instance semantic label maps are fed to the discriminator (only during training); $E D G ^ { + }$ indicates that semantic label maps are used both for training and deployment. The pix2pixHD baseline (Wang et al., 2018) was trained from scratch for 50 epochs, using the same downsampled $1 0 2 4 \times 5 1 2 \mathrm { p x }$ training images as for our method.
|
| 178 |
+
|
| 179 |
+
Fig. 6 shows the mean IoU on the Cityscapes validation set as a function of bpp for SC networks with $C = 2 , 4 , 8$ , along with the values obtained for the baselines. Additionally, we plot mean IoU for GC with semantic label maps fed to the discriminator $( D ^ { + } )$ , and the MSE baseline.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 7: Synthesizing different classes using our SC network with $C = 8$ . In each image except for no synthesis, we additionally synthesize the classes vegetation, sky, sidewalk, ego vehicle, wall. The heatmaps in the lower left corners show the synthesized parts in gray. We show the bpp of each image as well as the relative savings due to the selective generation.
|
| 183 |
+
|
| 184 |
+
In Fig. 7 we present example Cityscapes validation images produced by the SC network trained in the RI mode with $C = 8$ , where different semantic classes are preserved. More visual results for the SC networks trained on Cityscapes can be found in Appendix F.7, including results obtained for the RB operation mode and by using semantic label maps estimated from the input image via PSPNet (Zhao et al., 2017).
|
| 185 |
+
|
| 186 |
+
Discussion: The quantitative evaluation of the semantic preservation capacity (Fig. 6) reveals that the SC networks preserve the semantics somewhat better than pix2pixHD, indicating that the SC networks faithfully generate texture from the label maps and plausibly combine generated with preserved image content. The mIoU of BPG, AEDC, and the MSE baseline is considerably lower than that obtained by our SC and GC models, which can arguably be attributed to blurring and blocking artifacts. However, it is not surprising as these baseline methods do not use label maps during training and prediction.
|
| 187 |
+
|
| 188 |
+
In the SC operation mode, our networks manage to seamlessly merge preserved and generated image content both when preserving object instances and boxes crossing object boundaries (see Appendix F.7). Further, our networks lead to reductions in bpp of $50 \%$ and more compared to the same networks without synthesis, while leaving the visual quality essentially unimpaired, when objects with repetitive structure are synthesized (such as trees, streets, and sky). In some cases, the visual quality is even better than that of BPG at the same bitrate. The visual quality of more complex synthesized objects (e.g. buildings, people) is worse. However, this is a limitation of current GAN technology rather than our approach. As the visual quality of GANs improves further, SC networks will as well. Notably, the SC networks can generate entire images from the semantic label map only.
|
| 189 |
+
|
| 190 |
+
Finally, the semantic label map, which requires 0.036 bpp on average for the downscaled $1 0 2 4 \times$ 512px Cityscapes images, represents a relatively large overhead compared to the storage cost of the preserved image parts. This cost vanishes as the image size increases, since the semantic mask can be stored as an image dimension-independent vector graphic.
|
| 191 |
+
|
| 192 |
+
# 7 CONCLUSION
|
| 193 |
+
|
| 194 |
+
We proposed and evaluated a GAN-based framework for learned compression that significantly outperforms prior works for low bitrates in terms of visual quality, for compression of natural images. Furthermore, we demonstrated that constraining the application domain to street scene images leads to additional storage savings, and we explored combining synthesized with preserved image content with the potential to achieve even larger savings. Interesting directions for future work are to develop a mechanism for controlling spatial allocation of bits for GC (e.g. to achieve better preservation of faces; possibly using semantic label maps), and to combine SC with saliency information to determine what regions to preserve. In addition, the sampling experiments presented in Sec. 6.1 indicate that combining our GC compression approach with GANs to (unconditionally) generate compressed representations is a promising avenue to learn high-resolution generative models.
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Kodak PhotoCD dataset. http://r0k.us/graphics/kodak/.
|
| 199 |
+
|
| 200 |
+
WebP Image format. https://developers.google.com/speed/webp/.
|
| 201 |
+
|
| 202 |
+
Eirikur Agustsson, Fabian Mentzer, Michael Tschannen, Lukas Cavigelli, Radu Timofte, Luca Benini, and Luc Van Gool. Soft-to-hard vector quantization for end-to-end learning compressible representations. arXiv preprint arXiv:1704.00648, 2017.
|
| 203 |
+
|
| 204 |
+
Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial´ networks. arXiv preprint arXiv:1701.04862, 2017.
|
| 205 |
+
|
| 206 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 207 |
+
|
| 208 |
+
Johannes Balle, Valero Laparra, and Eero P Simoncelli. End-to-end optimization of nonlinear trans- ´ form codes for perceptual quality. arXiv preprint arXiv:1607.05006, 2016a.
|
| 209 |
+
|
| 210 |
+
Johannes Balle, Valero Laparra, and Eero P Simoncelli. End-to-end optimized image compression. ´ arXiv preprint arXiv:1611.01704, 2016b.
|
| 211 |
+
|
| 212 |
+
Johannes Balle, David Minnen, Saurabh Singh, Sung Jin Hwang, and Nick Johnston. Variational ´ image compression with a scale hyperprior. In International Conference on Learning Representations (ICLR), 2018.
|
| 213 |
+
|
| 214 |
+
Fabrice Bellard. BPG Image format. https://bellard.org/bpg/.
|
| 215 |
+
|
| 216 |
+
M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele. The Cityscapes Dataset for Semantic Urban Scene Understanding. ArXiv e-prints, April 2016.
|
| 217 |
+
|
| 218 |
+
Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012.
|
| 219 |
+
|
| 220 |
+
Duc-Tien Dang-Nguyen, Cecilia Pasquini, Valentina Conotter, and Giulia Boato. Raise: a raw images dataset for digital image forensics. In Proceedings of the 6th ACM Multimedia Systems Conference, pp. 219–224. ACM, 2015.
|
| 221 |
+
|
| 222 |
+
Leonardo Galteri, Lorenzo Seidenari, Marco Bertini, and Alberto Del Bimbo. Deep generative adversarial compression artifact removal. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4826–4835, 2017.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
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.
|
| 227 |
+
|
| 228 |
+
Chenlei Guo and Liming Zhang. A novel multiresolution spatiotemporal saliency detection model and its applications in image and video compression. IEEE transactions on image processing, 19 (1):185–198, 2010.
|
| 229 |
+
|
| 230 |
+
Rupesh Gupta, Meera Thapar Khanna, and Santanu Chaudhury. Visual saliency guided video compression algorithm. Signal Processing: Image Communication, 28(9):1006–1022, 2013.
|
| 231 |
+
|
| 232 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016.
|
| 233 |
+
|
| 234 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. In ´ Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 2980–2988. IEEE, 2017.
|
| 235 |
+
|
| 236 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 237 |
+
|
| 238 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1125–1134, 2017.
|
| 239 |
+
|
| 240 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, 2016.
|
| 241 |
+
|
| 242 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations (ICLR), 2017.
|
| 243 |
+
|
| 244 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
|
| 245 |
+
|
| 246 |
+
Ivan Krasin, Tom Duerig, Neil Alldrin, Vittorio Ferrari, Sami Abu-El-Haija, Alina Kuznetsova, Hassan Rom, Jasper Uijlings, Stefan Popov, Shahab Kamali, Matteo Malloci, Jordi PontTuset, Andreas Veit, Serge Belongie, Victor Gomes, Abhinav Gupta, Chen Sun, Gal Chechik, David Cai, Zheyun Feng, Dhyanesh Narayanan, and Kevin Murphy. Openimages: A public dataset for large-scale multi-label and multi-class image classification. Dataset available from https://storage.googleapis.com/openimages/web/index.html, 2017.
|
| 247 |
+
|
| 248 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4681–4690, 2017.
|
| 249 |
+
|
| 250 |
+
Mu Li, Wangmeng Zuo, Shuhang Gu, Debin Zhao, and David Zhang. Learning convolutional networks for content-weighted image compression. arXiv preprint arXiv:1703.10553, 2017.
|
| 251 |
+
|
| 252 |
+
Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In Advances in Neural Information Processing Systems, pp. 700–708, 2017.
|
| 253 |
+
|
| 254 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In 2017 IEEE International Conference on Computer Vision (ICCV), pp. 2813–2821. IEEE, 2017.
|
| 255 |
+
|
| 256 |
+
Fabian Mentzer, Eirikur Agustsson, Michael Tschannen, Radu Timofte, and Luc Van Gool. Conditional probability models for deep image compression. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 257 |
+
|
| 258 |
+
David Minnen, Johannes Balle, and George Toderici. Joint autoregressive and hierarchical priors ´ for learned image compression. arXiv preprint arXiv:1809.02736, 2018.
|
| 259 |
+
|
| 260 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
|
| 261 |
+
|
| 262 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pp. 271–279, 2016.
|
| 263 |
+
|
| 264 |
+
Oren Rippel and Lubomir Bourdev. Real-time adaptive image compression. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2922–2930, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR.
|
| 265 |
+
|
| 266 |
+
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.
|
| 267 |
+
|
| 268 |
+
Shibani Santurkar, David Budden, and Nir Shavit. Generative compression. arXiv preprint arXiv:1703.01467, 2017.
|
| 269 |
+
|
| 270 |
+
X Yu Stella and Dimitri A Lisin. Image compression based on visual saliency at individual scales. In International Symposium on Visual Computing, pp. 157–166. Springer, 2009.
|
| 271 |
+
|
| 272 |
+
David S. Taubman and Michael W. Marcellin. JPEG 2000: Image Compression Fundamentals, Standards and Practice. Kluwer Academic Publishers, Norwell, MA, USA, 2001. ISBN 079237519X.
|
| 273 |
+
|
| 274 |
+
Lucas Theis, Wenzhe Shi, Andrew Cunningham, and Ferenc Huszar. Lossy image compression with compressive autoencoders. In International Conference on Learning Representations (ICLR), 2017.
|
| 275 |
+
|
| 276 |
+
George Toderici, Sean M O’Malley, Sung Jin Hwang, Damien Vincent, David Minnen, Shumeet Baluja, Michele Covell, and Rahul Sukthankar. Variable rate image compression with recurrent neural networks. arXiv preprint arXiv:1511.06085, 2015.
|
| 277 |
+
|
| 278 |
+
George Toderici, Damien Vincent, Nick Johnston, Sung Jin Hwang, David Minnen, Joel Shor, and Michele Covell. Full resolution image compression with recurrent neural networks. arXiv preprint arXiv:1608.05148, 2016.
|
| 279 |
+
|
| 280 |
+
Robert Torfason, Fabian Mentzer, Eirikur Agustsson, Michael Tschannen, Radu Timofte, and Luc Van Gool. Towards image understanding from deep compression without decoding. In International Conference on Learning Representations (ICLR), 2018. URL https:// openreview.net/forum?id $=$ HkXWCMbRW.
|
| 281 |
+
|
| 282 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor S. Lempitsky. Instance normalization: The missing ingredient for fast stylization. CoRR, abs/1607.08022, 2016. URL http://arxiv.org/ abs/1607.08022.
|
| 283 |
+
|
| 284 |
+
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Highresolution image synthesis and semantic manipulation with conditional gans. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 285 |
+
|
| 286 |
+
Z. Wang, E. P. Simoncelli, and A. C. Bovik. Multiscale structural similarity for image quality assessment. In Asilomar Conference on Signals, Systems Computers, 2003, volume 2, pp. 1398– 1402 Vol.2, Nov 2003.
|
| 287 |
+
|
| 288 |
+
Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaolei Huang, Xiaogang Wang, and Dimitris Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In IEEE Int. Conf. Comput. Vision (ICCV), pp. 5907–5915, 2017.
|
| 289 |
+
|
| 290 |
+
H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid Scene Parsing Network. ArXiv e-prints, December 2016.
|
| 291 |
+
|
| 292 |
+
Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 293 |
+
|
| 294 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2223–2232, 2017.
|
| 295 |
+
|
| 296 |
+
A COMPARISON WITH STATE-OF-THE-ART
|
| 297 |
+
Table 1: Overview of differences between (Minnen et al., 2018) (s.o.t.a. in MS-SSIM and PSNR), to BPG (previous s.o.t.a. in PSNR) and (Rippel & Bourdev, 2017) (s.o.t.a. in MS-SSIM in 2017, also used GANs).
|
| 298 |
+
|
| 299 |
+
<table><tr><td></td><td>BPG</td><td>Rippel et al. (2017)</td><td>Minnen et al. (2018)</td><td>Ours (GC)</td></tr><tr><td>Learned</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>Arithmetic encoding</td><td>Adaptive</td><td>Adaptive</td><td>Adaptive</td><td>Static</td></tr><tr><td>Context model</td><td>CABAC</td><td>Autoregressive</td><td>Autoregressive</td><td>None</td></tr><tr><td>Visualized bitrates [bpp]5</td><td>al16</td><td>0.08-</td><td>0.12-</td><td>0.033-0.066</td></tr><tr><td>GAN</td><td>No</td><td>Non-standard</td><td>No</td><td>f-div. based</td></tr><tr><td>S.o.t.a. in MS-SSIM</td><td>No</td><td>No</td><td>Yes</td><td>No</td></tr><tr><td>S.o.t.a. in PSNR</td><td>No</td><td>No</td><td>Yes</td><td>No</td></tr><tr><td>Savings to BPG in PSNR</td><td></td><td></td><td>8.41%</td><td></td></tr><tr><td>Savings to BPG in User Study</td><td></td><td></td><td></td><td>17.2-48.7%</td></tr></table>
|
| 300 |
+
|
| 301 |
+
# B COMPRESSION DETAILS
|
| 302 |
+
|
| 303 |
+
When encoding the channels of $\hat { \pmb { w } }$ to a bit-stream, we use an arithmetic encoder where frequencies are stored for each channel separately and then encode them in a static (non-adaptive) manner, similar to Agustsson et al. (2017). In our experiments, this leads to $8 . 8 \%$ smaller bitrates compared to the upper bound.
|
| 304 |
+
|
| 305 |
+
We compress the semantic label map for SC by quantizing the coordinates in the vector graphic to the image grid and encoding coordinates relative to preceding coordinates when traversing object boundaries (rather than relative to the image frame). The so-obtained bitstream is then compressed using arithmetic coding.
|
| 306 |
+
|
| 307 |
+
To ensure fair comparison, we do not count header sizes for any of the baseline methods throughout.
|
| 308 |
+
|
| 309 |
+
# C ARCHITECTURE DETAILS
|
| 310 |
+
|
| 311 |
+
For the GC, the encoder $E$ convolutionally processes the image $_ { \textbf { \em x } }$ and optionally the label map $\pmb { s }$ , with spatial dimension $W \times H$ , into a feature map of size $W / 1 6 \times H / 1 6 \times 9 6 0$ (with 6 layers, of which four have 2-strided convolutions), which is then projected down to $C$ channels (where $C \in \{ 2 , 4 , 8 \}$ is much smaller than 960). This results in a feature map $\pmb { w }$ of dimension $W \big / 1 6 \times H \big / 1 6 \times C$ , which is quantized over $L$ centers to obtain the discrete $\hat { \pmb { w } }$ . The generator $G$ projects $\hat { \pmb { w } }$ up to 960 channels, processes these with 9 residual units (He et al., 2016) at dimension $W / 1 6 \times H / 1 6 \times 9 6 0$ , and then mirrors $E$ by convolutionally processing the features back to spatial dimensions $W \times H$ (with transposed convolutions instead of strided ones).
|
| 312 |
+
|
| 313 |
+
Similar to $E$ , the feature extractor $F$ for SC processes the semantic map $\pmb { s }$ down to the spatial dimension of $\hat { \pmb w }$ , which is then concatenated to $\hat { \pmb { w } }$ for generation. In this case, we consider slightly higher bitrates and downscale by $8 \times$ instead of $1 6 \times$ in the encoder $E$ , such that $\mathrm { d i m } ( \hat { \pmb w } ) = \bar { W } / 8 \stackrel { } { \times }$ $H / _ { 8 } \times C$ . The generator then first processes $\hat { \pmb { w } }$ down to $W / 1 6 \times H / 1 6 \times 9 6 0$ and then proceeds as for GC.
|
| 314 |
+
|
| 315 |
+
For both GC and SC, we use the multi-scale architecture of (Wang et al., 2018) for the discriminator $D$ , which measures the divergence between $p _ { \pmb { x } }$ and $p _ { G ( z ) }$ both locally and globally.
|
| 316 |
+
|
| 317 |
+
We adopt the notation from (Wang et al., 2018) to describe our encoder and generator/decoder architectures and additionally use $\mathrm { \Delta q }$ to denote the quantization layer (see Sec. 3 for details). The output of $\mathrm { \Delta q }$ is encoded and stored.
|
| 318 |
+
|
| 319 |
+
# • Encoders SC:
|
| 320 |
+
|
| 321 |
+
– Semantic label map encoder: c7s1-60,d120,d240,d480,d960
|
| 322 |
+
– Image encoder: c7s1-60,d120,d240,d480,c3s1-C,q,c3s1-480,d960
|
| 323 |
+
|
| 324 |
+
The outputs of the semantic label map encoder and the image encoder are concatenated and fed to the generator/decoder.
|
| 325 |
+
|
| 326 |
+
• Generator/decoder: c3s1-960,R960,R960,R960,R960,R960,R960,R960, R960,R960,u480,u240,u120,u60,c7s1-3
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 8: Structure of the proposed SC network. $E$ is the encoder for the image $_ { \textbf { \em x } }$ and the semantic label map s. $q$ quantizes the latent code $\pmb { w }$ to $\hat { \pmb w }$ . The subsampled heatmap multiplies $\hat { \pmb { w } }$ (pointwise) for spatial bit allocation. $G$ is the generator/decoder, producing the decompressed image $\hat { \textbf { \textit { x } } }$ , and $D$ is the discriminator used for adversarial training. $F$ extracts features from $\pmb { s }$ .
|
| 330 |
+
|
| 331 |
+
# D TRAINING DETAILS
|
| 332 |
+
|
| 333 |
+
We employ the ADAM optimizer (Kingma & Ba, 2014) with a learning rate of 0.0002 and set the mini-batch size to 1. Our networks are trained for 150000 iterations on Cityscapes and for 280000 iterations on Open Images. For normalization we used instance normalization (Ulyanov et al., 2016), except in the second half of the Open Images training, we train the generator/decoder with fixed batch statistics (as implemented in the test mode of batch normalization (Ioffe & Szegedy, 2015)), since we found this reduced artifacts and color shift.
|
| 334 |
+
|
| 335 |
+
# E DATASET AND PREPROCESSING DETAILS
|
| 336 |
+
|
| 337 |
+
To train GC models (which do not require semantic label maps, neither during training nor for deployment) for compression of diverse natural images, we use $2 0 0 \mathrm { k }$ images sampled randomly from the Open Images data set (Krasin et al., 2017) (9M images). The training images are rescaled so that the longer side has length 768px, and images for which rescaling does not result in at least $1 . 2 5 \times$ downscaling as well as high saturation images (average $\mathrm { \ S > 0 . 9 }$ or $\mathrm { \Delta V > 0 . 8 }$ in HSV color space) are discarded (resulting in an effective training set size of 188k). We evaluate these models on the Kodak image compression dataset (Kodak) (24 images, $7 6 8 \times 5 1 2 \mathrm { p x } ,$ ), which has a long tradition in the image compression literature and is still the most frequently used dataset for comparisons of learned image compression methods. Additionally, we evaluate our GC models on 20 randomly selected images from the RAISE1K data set (Dang-Nguyen et al., 2015), a real-world image dataset consisting of 8156 high-resolution RAW images (we rescale the images such that the longer side has length 768px). To investigate the benefits of having a somewhat constrained application domain and semantic labels at training time, we also train GC models with semantic label maps on the Cityscapes data set (Cordts et al., 2016) (2975 training and 500 validation images, 34 classes, $2 0 4 8 \times 1 0 2 4 \mathrm { p x }$ resolution) consisting of street scene images and evaluate it on 20 randomly selected validation images (without semantic labels). Both training and validation images are rescaled to $1 0 2 4 \times 5 1 2 \mathrm { p x }$ resolution.
|
| 338 |
+
|
| 339 |
+
To evaluate the proposed SC method (which requires semantic label maps for training and deployment) we again rely on the Cityscapes data set. Cityscapes was previously used to generate images form semantic label maps using GANs (Isola et al., 2017; Zhu et al., 2017). The preprocessing for SC is the same as for GC.
|
| 340 |
+
|
| 341 |
+
# F VISUALS
|
| 342 |
+
|
| 343 |
+
In the following Sections, F.1, F.2, F.3, we show the first five images of each of the three datasets we used for the user study, next to the outputs of BPG at similar bitrates.
|
| 344 |
+
|
| 345 |
+
Secs. F.4 and F.5 provide visual comparisons of our GC models with Rippel & Bourdev (2017) and Minnen et al. (2018), respectively, on a subset of images form the Kodak data set.
|
| 346 |
+
|
| 347 |
+
In Section F.6, we show visualizations of the latent representation of our GC models.
|
| 348 |
+
|
| 349 |
+
Finally, Section F.7 presents additional visual results for SC.
|
| 350 |
+
|
| 351 |
+
# F.1 GENERATIVE COMPRESSION ON KODAK
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 9: First 5 images of the Kodak data set, produced by our GC model with $C = 4$ and BPG.
|
| 355 |
+
|
| 356 |
+
# F.2 GENERATIVE COMPRESSION ON RAISE1K
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure 10: First 5 images of RAISE1k, produced by our GC model with $C = 4$ and BPG.
|
| 360 |
+
|
| 361 |
+
# F.3 GENERATIVE COMPRESSION ON CITYSCAPES
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 11: First 5 images of Cityscapes, produced by our GC model with $C = 4$ and BPG.
|
| 365 |
+
|
| 366 |
+
# F.4 COMPARISON TO RIPPEL & BOURDEV (2017)
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 12: Our model loses more texture but has less artifacts on the knob. Overall, it looks comparable to the output of Rippel & Bourdev (2017), using significantly fewer bits.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Rippel et al., 0.0840bpp $( + 2 9 \% )$
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 13: Notice that compared to Rippel & Bourdev (2017), our model produces smoother lines at the jaw and a smoother hat, but proides a worse reconstruction of the eye.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Rippel et al., 0.0928bpp $( + 3 9 \% )$
|
| 381 |
+
|
| 382 |
+
Figure 14: Notice that our model produces much better sky and grass textures than Rippel & Bourdev (2017), and also preserves the texture of the light tower more faithfully.
|
| 383 |
+
|
| 384 |
+
# F.5 COMPARISON TO MINNEN ET AL. (2018)
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 15: Notice that our model yields sharper grass and sky, but a worse reconstruction of the fence and the lighthouse compared to Minnen et al. (2018). Compared to BPG, Minnen et al. produces blurrier grass, sky and lighthouse but BPG suffers from ringing artifacts on the roof of the second building and the top of the lighthouse.
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
BPG, 0.164bpp
|
| 391 |
+
|
| 392 |
+
Minnen et al., 0.155bpp, $12 7 \%$ larger
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 16: Our model produces an overall sharper face compared to Minnen et al. (2018), but the texture on the cloth deviates more from the original. Compared to BPG, Minnen et al. has a less blurry face and fewer artifacts on the cheek.
|
| 396 |
+
Figure 17: Here we obtain a significantly worse reconstruction than Minnen et al. (2018) and BPG, but use only a fraction of the bits. Between BPG and Minnen et al., it is hard to see any differences.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Original
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Ours, 0.03418bpp
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
BPG, 0.119bpp
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
Figure 18: Here we obtain a significantly worse reconstruction compared to Minnen et al. (2018) and BPG, but use only a fraction of the bits. Compared to BPG, Minnen et al.has a smoother background but less texture on the birds.
|
| 409 |
+
|
| 410 |
+
Minnen et al., 0.123bpp, $2 5 9 \%$ larger,
|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
Figure 19: We uniformly sample codes from the (discrete) latent space $\hat { \pmb w }$ of our generative compression models (GC with $C = 4$ ) trained on Cityscapes and Open Images. The Cityscapes model outputs domain specific patches (street signs, buildings, trees, road), whereas the Open Images samples are more colorful and consist of more generic visual patches.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 20: We train the same architecture with $C = 4$ for MSE and for generative compression on Cityscapes. When uniformly sampling the (discrete) latent space $\hat { \pmb { w } }$ of the models, we see stark differences between the decoded images $G ( \hat { \textbf { \em w } } )$ . The GC model produces patches that resemble parts of Cityscapes images (street signs, buildings, etc.), whereas the MSE model outputs looks like low-frequency noise.
|
| 417 |
+
|
| 418 |
+
GC model with $C = 4$
|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
MSE baseline model with $C = 4$
|
| 422 |
+
Figure 21: We experiment with learning the distribution of $\hat { \pmb { w } } = E ( \pmb { x } )$ by training an improved Wasserstein GAN (Gulrajani et al., 2017). When sampling form the decoder/generator $G$ of our model by feeding it with samples from the improved WGAN generator, we obtain much sharper images than when we do the same with an MSE model.
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 22: Synthesizing different classes for two different images from Cityscapes, using our SC network with $C = 4$ . In each image except for no synthesis, we additionally synthesize the classes vegetation, sky, sidewalk, ego vehicle, wall.
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
Figure 23: Example images obtained by our SC network $C = 8$ ) preserving a box and synthesizing the rest of the image, on Cityscapes. The SC network seamlessly merges preserved and generated image content even in places where the box crosses object boundaries.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 24: Reconstructions obtained by our SC network using semantic label maps estimated from the input image via PSPNet (Zhao et al., 2017).
|
| 432 |
+
|
| 433 |
+
We collect here additional results for the discussion with the reviewers, so that they are easily found.
|
| 434 |
+
We will integrate these results into the paper.
|
| 435 |
+
|
| 436 |
+
In Table 2 we compute the PSNR on the Cityscapes test set, when varying the entropy constraint (i.e. changing $C$ ), and the two extremes (a) when MSE is only optimized and (b) when the GAN loss is only optimized. The first three rows shows as the entropy constraint is relaxed, the network can more easily optimize the distortion term leading to a higher PSNR. The fourth row shows that when optimizing for MSE only (see Fig.7 for a qualitative example) we obtain superior PSNR (but at the expense of visual quality with blurry images). The last rows shows that when turning off distortion losses $\lambda = 0$ ), the network does optimize reconstruction at all. Here we observe that the GAN ”collapses” and outputs repetitive textures (see Fig. 25), suggesting the distortion losses are crucial for stability of training.
|
| 437 |
+
|
| 438 |
+
In Figures 26&27 we show the loss curves when training our GC, $C = 8$ model on OpenImages(Krasin et al., 2017). We note that the loss fluctuates heavily across iterations due to the small batch size (one), but the smoothed losses are stable. For all our experiments, both on Cityscapes and OpenImages, we kept the weights of the losses and ratio between discriminator/generator iterations constant and at point did our (GC and SC) models collapse during training for either dataset.
|
| 439 |
+
|
| 440 |
+
Table 2: We consider the effect of the GAN loss, the distortion losses and the entropy constraint on the PSNR of the trained model on the Cityscapes dataset.
|
| 441 |
+
|
| 442 |
+
<table><tr><td>Setting</td><td>PSNR (dB)</td></tr><tr><td>Our GC,C = 2,H(ω)< 0.018bpp</td><td>21.46</td></tr><tr><td>Our GC,C = 4,H(ω) <0.036</td><td>23.17</td></tr><tr><td>Our GC, C = 8,H(ω) <0.072</td><td>24.93</td></tr><tr><td>MSE bl.,C = 4,H(ω)<0.036</td><td>25.91</td></tr><tr><td>GC,λ=0,C=8,H(ω)<0.072</td><td>11.65</td></tr></table>
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
Figure 25: When disabling the distortion losses (i.e. $\lambda = 0$ ), such that only $\mathcal { L } _ { \mathrm { G A N } }$ remains, we observe that the training ”collapses” and produces repetitive textures, both for OpenImages and Citycapes.
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
G_GAN_FeatFigure 26: We show convergence plots for the generator and discriminator losses from training our GC $C = 8$ ) channel model on OpenImages.
|
| 449 |
+
|
| 450 |
+

|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
|
| 454 |
+
Ⅲ□
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
Figure 27: We show convergence plots for the distortion losses from training our GC $C = 8$ ) channel model on OpenImages.
|
md/train/HyxnZh0ct7/HyxnZh0ct7.md
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# META-LEARNING WITH DIFFERENTIABLE CLOSED-FORM SOLVERS
|
| 2 |
+
|
| 3 |
+
Luca Bertinetto FiveAI & University of Oxford luca@robots.ox.ac.uk
|
| 4 |
+
|
| 5 |
+
João Henriques University of Oxford joao@robots.ox.ac.uk
|
| 6 |
+
|
| 7 |
+
Philip H.S. Torr FiveAI & University of Oxford philip.torr@eng.ox.ac.uk
|
| 8 |
+
|
| 9 |
+
Andrea Vedaldi
|
| 10 |
+
University of Oxford
|
| 11 |
+
vedaldi@robots.ox.ac.uk
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Adapting deep networks to new concepts from a few examples is challenging, due to the high computational requirements of standard fine-tuning procedures. Most work on few-shot learning has thus focused on simple learning techniques for adaptation, such as nearest neighbours or gradient descent. Nonetheless, the machine learning literature contains a wealth of methods that learn non-deep models very efficiently. In this paper, we propose to use these fast convergent methods as the main adaptation mechanism for few-shot learning. The main idea is to teach a deep network to use standard machine learning tools, such as ridge regression, as part of its own internal model, enabling it to quickly adapt to novel data. This requires back-propagating errors through the solver steps. While normally the cost of the matrix operations involved in such a process would be significant, by using the Woodbury identity we can make the small number of examples work to our advantage. We propose both closed-form and iterative solvers, based on ridge regression and logistic regression components. Our methods constitute a simple and novel approach to the problem of few-shot learning and achieve performance competitive with or superior to the state of the art on three benchmarks.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Humans can efficiently perform fast mapping (Carey, 1978; Carey & Bartlett, 1978), i.e. learning a new concept after a single exposure. By contrast, supervised learning algorithms — and neural networks in particular — typically need to be trained using a vast amount of data in order to generalize well. This requirement is problematic, as the availability of large labelled datasets cannot always be taken for granted. Labels can be costly to acquire: in drug discovery, for instance, campaign budgets often limits researchers to only operate with a small amount of biological data that can be used to form predictions about properties and activities of compounds (Altae-Tran et al., 2017). In other circumstances, data itself can be scarce, as it can happen for example with the problem of classifying rare animal species, whose exemplars are not easy to observe. Such a scenario, in which just one or a handful of training examples is provided, is referred to as one-shot or few-shot learning (Miller et al., 2000; Fei-Fei et al., 2006; Lake et al., 2015; Hariharan & Girshick, 2017) and has recently seen a tremendous surge in interest within the machine learning community (e.g.Vinyals et al. (2016); Bertinetto et al. (2016); Ravi & Larochelle (2017); Finn et al. (2017)).
|
| 20 |
+
|
| 21 |
+
Currently, most methods tackling few-shot learning operate within the general paradigm of metalearning, which allows one to develop algorithms in which the process of learning can improve with the number of training episodes (Thrun, 1998; Vilalta & Drissi, 2002). This can be achieved by distilling and transferring knowledge across episodes. In practice, for the problem of few-shot classification, meta-learning is often implemented using two “nested training loops”. The base learner works at the level of individual episodes, which correspond to learning problems characterised by having only a small set of labelled training images available. The meta learner, by contrast, learns from a collection of such episodes, with the goal of improving the performance of the base learner across episodes.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Diagram of the proposed method for one episode, of which several are seen during meta-training. The task is to learn new classes given just a few sample images per class. In this illustrative example, there are 3 classes and 2 samples per class, making each episode a 3-way, 2-shot classification problem. At the base learning level, learning is accomplished by a differentiable ridge regression layer (R.R.), which computes episode-specific weights (referred to as $w \varepsilon$ in Section 3.1 and as $W$ in Section 3.2). At the meta-training level, by back-propagating errors through many of these small learning problems, we train a network whose weights are shared across episodes, together with the hyper-parameters of the R.R. layer. In this way, the R.R. base learner can improve its learning capabilities as the number of experienced episodes increases.
|
| 25 |
+
|
| 26 |
+
Clearly, in any meta-learning algorithm, it is of paramount importance to choose the base learner carefully. On one side of the spectrum, methods related to nearest-neighbours, such as learning similarity functions (Koch et al., 2015; Vinyals et al., 2016; Snell et al., 2017), are fast but rely solely on the quality of the similarity metric, with no additional data-dependent adaptation at test-time. On the other side of the spectrum, methods that optimize standard iterative learning algorithms, such as backpropagating through gradient descent (Finn et al., 2017; Nichol et al., 2018) or explicitly learning the learner’s update rule (Hochreiter et al., 2001; Andrychowicz et al., 2016; Ravi & Larochelle, 2017), are slower but allow more adaptability to different problems/datasets.
|
| 27 |
+
|
| 28 |
+
In this paper, we take a different perspective. As base learners, we propose to adopt simple learning algorithms that admit a closed-form solution such as ridge regression. Crucially, the simplicity and differentiability of these solutions allow us to backpropagate through learning problems. Moreover, these algorithms are particularly suitable for use within a meta-learning framework for few-shot classification for two main reasons. First, their closed-form solution allows learning problems to be solved efficiently. Second, in a data regime characterized by few examples of high dimensionality, the Woodbury’s identity (Petersen et al., 2008, Chapter 3.2) can be used to obtain a very significant gain in terms of computational speed.
|
| 29 |
+
|
| 30 |
+
We demonstrate the strength of our approach by performing extensive experiments on Omniglot (Lake et al., 2015), CIFAR-100 (Krizhevsky & Hinton, 2009) (adapted to the few-shot problem) and miniImageNet (Vinyals et al., 2016). Our base learners are fast, simple to implement, and can achieve performance that is competitive with or superior to the state of the art in terms of accuracy.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
The topic of meta-learning gained importance in the machine learning community several decades ago, with the first examples already appearing in the eighties and early nineties (Utgoff, 1986; Schmidhuber, 1987; Naik & Mammone, 1992; Bengio et al., 1992; Thrun & Pratt, 1998). Utgoff (1986) proposed a framework describing when and how it is useful to dynamically adjust the inductive bias of a learning algorithm, thus implicitly “changing the ordering” of the elements of its hypothesis space (Vilalta & Drissi, 2002). Later, Bengio et al. (1992) interpreted the update rule of a neural network’s weights as a function that is learnable. Another seminal work is the one of Thrun (1996), which presents the so-called lifelong learning scenario, where a learning algorithm gradually encounters an ordered sequence of learning problems. Throughout this course, the learner can benefit from re-using the knowledge accumulated during previous tasks. In later work, Thrun & Pratt (1998) stated that an algorithm is learning to learn if “[...] its performance at each task improves with experience and with the number of tasks”. This characterisation has been inspired by Mitchell et al. (1997)’s definition of a learning algorithm as a computer program whose performance on a task improves with experience. Similarly, Vilalta & Drissi (2002) explained meta-learning as organised in two “nested learning levels”. At the base level, an algorithm is confined within a limited hypothesis space while solving a single learning problem. Contrarily, the meta-level can “accrue knowledge” by spanning multiple problems, so that the hypothesis space at the base level can be adapted effectively.
|
| 35 |
+
|
| 36 |
+
Arguably, the simplest approach to meta-learning is to train a similarity function by exposing it to many matching problems (Bromley et al., 1993; Chopra et al., 2005; Koch et al., 2015). Despite its simplicity, this general strategy is particularly effective and it is at the core of several stateof-the-art few-shot classification algorithms (Vinyals et al., 2016; Snell et al., 2017; Sung et al., 2018). Interestingly, Garcia & Bruna (2018) interpret learning as information propagation from support (training) to query (test) images and propose a graph neural network that can generalize matching-based approaches. Since this line of work relies on learning a similarity metric, one distinctive characteristic is that parameter updates only occur within the long time horizon of the outer training loop. While this can clearly spare costly computations, it also prevents these methods from performing adaptation at test time. A possible way to overcome the lack of adaptability is to train a neural network capable of predicting (some of) its own parameters. This technique has been first introduced in Schmidhuber (1992; 1993) and recently revamped by Bertinetto et al. (2016) and Munkhdalai & Yu (2017). Rebuffi et al. (2017) showed that a similar approach can be used to adapt a neural network, on the fly, to entirely different visual domains.
|
| 37 |
+
|
| 38 |
+
Another popular approach to meta-learning is to interpret the gradient update of SGD as a parametric and learnable function rather than a fixed ad-hoc routine. Younger et al. (2001) and Hochreiter et al. (2001) observed that, because of the sequential nature of a learning algorithm, a recurrent neural network can be considered as a meta-learning system. They identify LSTMs as particularly apt for the task because of their ability to span long-term dependencies, which are essential in order to meta-learn. A modern take on this idea has been presented by Andrychowicz et al. (2016) and Ravi & Larochelle (2017), showing benefits on large-scale classification, style transfer and few-shot learning.
|
| 39 |
+
|
| 40 |
+
A recent and promising research direction is the one set by Maclaurin et al. (2015) and by the MAML algorithm (Finn et al., 2017; Finn & Levine, 2018). Instead of explicitly designing a meta-learner module for learning the update rule, they backpropagate through the very operation of gradient descent to optimize for the hyperparameters or the initial parameters of the learner. However, backpropagation through gradient descent steps is costly in terms of memory, and thus the total number of steps must be kept small.
|
| 41 |
+
|
| 42 |
+
To alleviate the drawback of catastrophic forgetting typical of deep neural networks (McCloskey & Cohen, 1989), several recent methods (Santoro et al., 2016; Kaiser et al., 2017; Munkhdalai & Yu, 2017; Sprechmann et al., 2018) make use of memory-augmented models, which can first retain and then access important and previously unseen information associated with newly encountered episodes. While such memory modules store and retrieve information in the long time range, approaches based on attention like the one of Vinyals et al. (2016) are useful to specify the most relevant pieces of knowledge within an episode. Mishra et al. (2018) complemented soft attention with temporal convolutions (Oord et al., 2016), thus allowing the attention mechanism to access information related to past episodes.
|
| 43 |
+
|
| 44 |
+
In this paper, we instead argue for simple, fast and differentiable base learners such as ridge regression. Compared to nearest-neighbour methods, they allow more flexibility because they produce a different set of parameters for different episodes $W _ { i }$ in Figure 1). Compared to methods that adapt SGD, they exhibit an inherently fast rate of convergence, particularly in cases where a closed form solution exists. A similar idea has been discussed by Bengio (2000), where the analytic formulations of zero-gradient solutions are used to obtain meta-gradients analytically and optimize hyper-parameters. More recently, Ionescu et al. (2015) and Valmadre et al. (2017) have derived backpropagation forms for the SVD and Correlation Filter, so that SGD can be applied, respectively, to a deep neural network that computes the solution to either an eigenvalue problem or a system of linear equations where the data matrix has a circulant structure.
|
| 45 |
+
|
| 46 |
+
# 3 METHOD
|
| 47 |
+
|
| 48 |
+
# 3.1 META-LEARNING
|
| 49 |
+
|
| 50 |
+
According to widely accepted definitions of learning (Mitchell, 1980) and meta-learning (Vilalta & Drissi, 2002; Vinyals et al., 2016), an algorithm is “learning to learn” if it can improve its learning skills with the number of experienced episodes (by progressively and dynamically modifying its inductive bias). There are two main components in a meta-learning algorithm: a base learner and a meta-learner (Vilalta & Drissi, 2002). The base learner works at the level of individual episodes (or tasks), which in the few-shot scenario correspond to learning problems characterised by having only a small set of labelled training images available. The meta-learner learns from several such episodes in sequence with the goal of improving the performance of the base learner across episodes.
|
| 51 |
+
|
| 52 |
+
In other words, the goal of meta-learning is to enable a base learning algorithm to adapt to new episodes efficiently by generalizing from a set of training episodes $\mathcal { E } \in \mathbb { E }$ . $\mathcal { E }$ can be modelled as a probability distribution of example inputs $x \in \mathbb { R } ^ { m }$ and outputs $\boldsymbol { y } \in \mathbb { R } ^ { o }$ , such that we can write $( x , y ) \sim \mathcal { E }$ .
|
| 53 |
+
|
| 54 |
+
In the case of few-shot classification, the inputs are represented by few images belonging to different unseen classes, while the outputs are the (episode-specific) class labels. It is important not to confuse the small sets that are used in an episode $\mathcal { E }$ with the super-set $\mathbb { E }$ (such as Omniglot or miniImageNet, Section 4.1) from which they are drawn.
|
| 55 |
+
|
| 56 |
+
Consider a generic feature extractor, such as commonly used pre-trained networks $\mathbf { \mathbb { \Lambda } } ^ { ! } \phi ( x ) : \mathbb { R } ^ { m } \to \mathbb { R } ^ { e }$ Then, a much simpler episode-specific predictor $f ( \phi ( x ) ; w \varepsilon ) : \mathbb { R } ^ { e } \times \mathbb { R } ^ { p } \mathbb { R } ^ { o }$ can be trained to map input embeddings to outputs. The predictor is parameterized by a set of parameters $w _ { \mathcal { E } } \in \mathbb { R } ^ { p }$ , which are specific to the episode $\mathcal { E }$ .
|
| 57 |
+
|
| 58 |
+
To train and assess the predictor on one episode, we are given access to training samples $Z _ { \mathcal { E } } =$ $\{ ( x _ { i } , y _ { i } ) \} \sim \mathcal { E }$ and test samples $Z _ { \mathcal { E } } ^ { \prime } = \{ ( x _ { i } ^ { \prime } , y _ { i } ^ { \prime } ) \} \sim \mathcal { E }$ , sampled independently from the distribution $\mathcal { E }$ . We can then use a learning algorithm $\Lambda$ to obtain the parameters $w \varepsilon = \Lambda ( \phi ( Z \varepsilon ) )$ , where $\phi ( Z \varepsilon ) \triangleq \{ ( \phi ( x _ { i } ) , y _ { i } ) \}$ . The expected quality of the trained predictor is then computed by a standard loss or error function $\bar { L } : \mathbb { R } ^ { o } \times \mathbb { R } ^ { o } \to \mathbb { R }$ , which is evaluated on the test samples $Z _ { \mathcal { E } } ^ { \prime }$ :
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
q ( \mathcal { E } ) = \frac { 1 } { | Z _ { \mathcal { E } } ^ { \prime } | } \sum _ { ( x ^ { \prime } , y ^ { \prime } ) \in Z _ { \mathcal { E } } ^ { \prime } } L \left( f \left( \phi \left( x ^ { \prime } \right) ; w _ { \mathcal { E } } \right) , y ^ { \prime } \right) , \quad \mathrm { w i t h } \ w _ { \mathcal { E } } = \Lambda ( \phi ( Z _ { \mathcal { E } } ) ) .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Other than abstracting away the complexities of the learning algorithm as $\Lambda$ , eq. (1) corresponds to the standard train-test protocol commonly employed in machine learning, here applied to a single episode $\mathcal { E }$ . However, simply re-training a predictor for each episode ignores potentially useful knowledge that can be transferred between them. For this reason, we now take the step of parameterizing $\phi$ and $\Lambda$ with two sets of meta-parameters, respectively $\omega$ and $\rho$ , which can aid the training procedure. In particular, $\omega$ affects the representation of the input of the base learner algorithm $\Lambda$ , while $\rho$ corresponds to its hyper-parameters, which here can be learnt by the meta-learner loop instead of being manually set, as it usually happens in a standard training scenario. These meta-parameters will affect the generalization properties of the learned predictors. This motivates evaluating the result of training on a held-out test set $Z _ { \mathcal { E } } ^ { \prime }$ (eq. (1)). In order to learn $\omega$ and $\rho$ , we minimize the expected loss on held-out test sets over all episodes $\mathcal { E } \in \mathbb { E }$ :
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\operatorname* { m i n } _ { \omega , \rho } \frac { 1 } { | \mathbb { E } | \cdot | Z _ { \mathcal { E } } ^ { \prime } | } \sum _ { \mathcal { E } \in \mathbb { E } } \sum _ { \left( x ^ { \prime } , y ^ { \prime } \right) \in Z _ { \mathcal { E } } ^ { \prime } } L \left( f \left( \phi \left( x ^ { \prime } ; \omega \right) ; w \varepsilon \right) , y ^ { \prime } \right) , \quad \mathrm { w i t h } \ w _ { \mathcal { E } } = \Lambda ( \phi ( Z _ { \mathcal { E } } ; \omega ) ; \rho ) .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Since eq. (2) consists of a composition of non-linear functions, we can leverage the same tools used successfully in deep learning, namely back-propagation and stochastic gradient descent (SGD), to optimize it. The main obstacle is to choose a learning algorithm $\Lambda$ that is amenable to optimization with such tools. This means that, in practice, $\Lambda$ must be quite simple.
|
| 71 |
+
|
| 72 |
+
Examples of meta-learning algorithms. Using eq. 2, it is possible to describe several of the metalearning methods in the literature, which mostly differ for the choice of $\Lambda$ . The feature extractor $\phi$ is typically a standard CNN, whose intermediate layers are trained jointly as $\omega$ (and thus are not episode-specific). The last layer represents the linear predictor $f$ , with episode-specific parameters $w \varepsilon$ . In Siamese networks (Bromley et al., 1993; Chopra et al., 2005; Koch et al., 2015), $f$ is a nearest neighbour classifier, which becomes soft $k$ -means in the semi-supervised setting proposed by Ren et al. (2018). Ravi & Larochelle (2017) and Andrychowicz et al. (2016) used an LSTM to implement $\Lambda$ , while the Learnet (Bertinetto et al., 2016) uses a factorized CNN and MAML (Finn et al., 2017) implements it using SGD (and furthermore adapts all parameters of the CNN).
|
| 73 |
+
|
| 74 |
+
Instead, we use simple and fast-converging methods as base learner $\Lambda$ , namely least-squares based solutions for ridge regression and logistic regression. In the outer loop, we allow SGD to learn both the parameters $\omega$ of the feature representation of $\Lambda$ and its hyper-parameters $\rho$ .
|
| 75 |
+
|
| 76 |
+
# 3.2 EFFICIENT RIDGE REGRESSION BASE LEARNERS
|
| 77 |
+
|
| 78 |
+
Similarly to the methods discussed in Section 3.1, over the course of a single episode we adapt a linear predictor $f$ , which can be considered as the final layer of a CNN. The remaining layers $\phi$ are trained from scratch (within the outer loop of meta-learning) to generalize between episodes, but for the purposes of one episode they are considered fixed. In this section, we assume that the inputs were pre-processed by the CNN $\phi$ , and that we are dealing only with the final linear predictor $f ( \phi ( x ) ) = \phi ( x ) W \in \mathbb { R } ^ { o }$ , where the parameters $w \varepsilon$ are reorganized into a matrix $W \in \mathbb { R } ^ { e \times o }$ .
|
| 79 |
+
|
| 80 |
+
The motivation for our work is that, while not quite as simple as nearest neighbours, least-squares regressors admit closed-form solutions. Although simple least-squares is prone to overfitting, it is easy to augment it with $L ^ { 2 }$ regularization (controlled by a positive hyper-parameter $\lambda$ ), in what is known as ridge regression:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { c } { \Lambda ( Z ) = \underset { W } { \arg \operatorname* { m i n } } \left\| X W - Y \right\| ^ { 2 } + \lambda \left\| W \right\| ^ { 2 } } \\ { = \big ( X ^ { T } X + \lambda I \big ) ^ { - 1 } X ^ { T } Y , } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\ b X \in \mathbb R ^ { n \times e }$ and $Y \in \mathbb { R } ^ { n \times o }$ contain the $n$ sample pairs of input embeddings and outputs from $Z$ , stacked as rows.
|
| 87 |
+
|
| 88 |
+
Because ridge regression admits a closed form solution (eq. (4)), it is relatively easy to integrate into meta-learning (eq. (2)) using standard automatic differentiation packages. The only element that may have to be treated more carefully is the matrix inversion. When the matrix to invert is close to singular (which we do not expect when $\lambda > 0$ ), it is possible to achieve more numerically accurate results by replacing the matrix inverse and vector product with a linear system solver (Murphy, 2012, 7.5.2). In our experiments, the matrices were not close to singular and we did not find this necessary.
|
| 89 |
+
|
| 90 |
+
Another concern about eq. (4) is that the intermediate matrix $X ^ { T } X \in \mathbb { R } ^ { e \times e }$ grows quadratically with the embedding size $e$ . Given the high dimensionality of features typically used in deep networks, the inversion could come at a very expensive cost. To alleviate this, we rely on the Woodbury formula (Petersen et al., 2008, Chapter 3.2), obtaining:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
W = \Lambda ( Z ) = X ^ { T } ( X X ^ { T } + \lambda I ) ^ { - 1 } Y .
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
The main advantage of eq. (5) is that the intermediate matrix $X X ^ { T } \in \mathbb { R } ^ { n \times n }$ now grows quadratically with the number of samples in the episode, $n$ . As we are interested in one or few-shot learning, this is typically very small. The overall cost of eq. (5) is only linear in the embedding size $e$ .
|
| 97 |
+
|
| 98 |
+
Although this method was originally designed for regression, we found that it works well also in a (few-shot) classification scenario, where the target outputs are one-hot vectors representing classes. However, since eq. 4 does not directly produce classification labels, it is important to calibrate its output for the cross-entropy loss, which is used to evaluate the episode’s test samples ( $L$ in eq. 2). This can be done by simply adjusting our prediction $X ^ { \prime } W$ with a scale and a bias $\alpha , \beta \in \mathbb { R }$ :
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\widehat { Y } = \alpha X ^ { \prime } W + \beta .
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Note that $\lambda$ , $\alpha$ and $\beta$ are hyper-parameters of the base learner $\Lambda$ and can be learnt by the outer learning loop represented by the meta-learner, together with the CNN parameters $\omega$ .
|
| 105 |
+
|
| 106 |
+
# 3.3 ITERATIVE BASE LEARNERS AND LOGISTIC REGRESSION
|
| 107 |
+
|
| 108 |
+
It is natural to ask whether other learning algorithms can be integrated as efficiently as ridge regression within our meta-learning framework. In general, a similar derivation is possible for iterative solvers, as long as the operations are differentiable. For linear models with convex loss functions, a better choice than gradient descent is Newton’s method, which uses curvature (second-order) information to reach the solution in very few steps. One learning objective of particular interest is logistic regression, which unlike ridge regression directly produces classification labels, and thus does not require the use of calibration before the (binary) cross-entropy loss.
|
| 109 |
+
|
| 110 |
+
When one applies Newton’s method to logistic regression, the resulting algorithm takes a familiar form — it consists of a series of weighted least squares (or ridge regression) problems, giving it the name Iteratively Reweighted Least Squares (IRLS) (Murphy, 2012, Chapter 8.3.4). Given inputs $\ b X \in \mathbb R ^ { n \times e }$ and binary outputs $y \in \{ - \bar { 1 } , 1 \} ^ { n }$ , the $i$ -th iteration updates the parameters $w _ { i } \in \mathbb { R } ^ { e }$ as:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
w _ { i } = \left( X ^ { T } \mathrm { d i a g } ( s _ { i } ) X + \lambda I \right) ^ { - 1 } X ^ { T } \mathrm { d i a g } ( s _ { i } ) z _ { i } ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $I$ is an identity matrix, $s _ { i } = \mu _ { i } ( 1 - \mu _ { i } )$ , $z _ { i } = w _ { i - 1 } ^ { T } X + ( y - \mu _ { i } ) / s _ { i }$ , and $\mu _ { i } = \sigma ( w _ { i - 1 } ^ { T } X )$ applies a sigmoid function $\sigma$ to the predictions using the previous parameters $w _ { i - 1 }$ .
|
| 117 |
+
|
| 118 |
+
Since eq. (7) takes a similar form to ridge regression, we can use it for meta-learning in the same way as in section 3.2, with the difference that a small number of steps (eq. (7)) must be performed in order to obtain the final parameters $w \varepsilon$ . Similarly, at each step $i$ , we obtain a solution with a cost which is linear rather than quadratic in the embedding size by employing the Woodbury formula:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
w _ { i } = X ^ { T } \Big ( X X ^ { T } + \lambda \mathrm { d i a g } ( s _ { i } ) ^ { - 1 } \Big ) ^ { - 1 } z _ { i } ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where the inner inverse has negligible cost since it is a diagonal matrix. Note that a similar strategy could be followed for other learning algorithms based on IRLS, such as $L ^ { 1 }$ minimization and LASSO. We take logistic regression to be a sufficiently illustrative example, of particular interest for binary classification in one/few-shot learning, leaving the exploration of other variants for future work.
|
| 125 |
+
|
| 126 |
+
# 3.4 TRAINING POLICY
|
| 127 |
+
|
| 128 |
+
Figure 1 illustrates our overall framework. Like most meta-learning techniques, we organize our training procedure into episodes, each of which corresponds to a few-shot classification problem. In standard classification, training requires sampling from a distribution of images and labels. Instead, in our case we sample from a distribution of episodes, each containing its own training set and test set, with just a few samples per image. Each episode also contains two sets of labels: $Y$ and $Y ^ { \prime }$ . The former is used to train the base learner, while the latter to compute the error of the just-trained base learner, enabling back-propagation in order to learn $\omega$ , $\lambda$ , $\alpha$ and $\beta$ .
|
| 129 |
+
|
| 130 |
+
In our implementation, one episode corresponds to a mini-batch of size $S = N ( K + Q )$ , where $N$ is the number of different classes (“ways”), $K$ the number of samples per classes (“shots”) and $Q$ the number of query (or test) images per class.
|
| 131 |
+
|
| 132 |
+
# 4 EXPERIMENTS
|
| 133 |
+
|
| 134 |
+
In this section, we provide practical details for the two novel methods introduced in Section 3.2 and 3.3, which we dub R2-D2 (Ridge Regression Differentiable Discriminator) and LR-D2 (Logistic Regression Differentiable Discriminator). We analyze their performance against the recent literature on multi-class and binary classification problems using three few-shot learning benchmarks: Omniglot (Lake et al., 2015), miniImageNet (Vinyals et al., 2016) and CIFAR-FS, which we introduce in this paper. The code for both our methods and the splits of CIFAR-FS are available at http://www.robots.ox.ac.uk/\~luca/r2d2.html.
|
| 135 |
+
|
| 136 |
+
# 4.1 FEW-SHOT LEARNING BENCHMARKS
|
| 137 |
+
|
| 138 |
+
Let $I _ { \star }$ and $C _ { \star }$ be respectively the set of images and the set of classes belonging to a certain data split $\star$ . In standard classification datasets, $I _ { \mathrm { t r a i n } } \cap I _ { \mathrm { t e s t } } = \emptyset$ and $C _ { \mathrm { t r a i n } } = C _ { \mathrm { t e s t } }$ . Instead, the few-shot setup requires both $I _ { \mathrm { m e t a - t r a i n } } \cap I _ { \mathrm { m e t a - t e s t } } = \emptyset$ and Cmeta-train $\cap C _ { \mathrm { m e t a - t e s t } } = \emptyset$ , while within an episode we have $C _ { \mathrm { t a s k - t r a i n } } = C _ { \mathrm { t a s k - t } }$ est.
|
| 139 |
+
|
| 140 |
+
Omniglot (Lake et al., 2015) is a dataset of handwritten characters that has been referred to as the “MNIST transpose” for its high number of classes and small number of instances per class. It contains
|
| 141 |
+
|
| 142 |
+
20 examples of 1623 characters, grouped in 50 different alphabets. In order to be able to compare against the state of the art, we adopt the same setup and data split used in Vinyals et al. (2016). Hence, we resize images to $2 8 \times 2 8$ and we augment the dataset using four rotated versions of the each instance $0 ^ { \circ }$ , $9 0 ^ { \circ }$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ ). Including rotations, we use 4800 classes for meta-training and meta-validation and 1692 for meta-testing.
|
| 143 |
+
|
| 144 |
+
miniImageNet (Vinyals et al., 2016) aims at representing a challenging dataset without demanding considerable computational resources. It is randomly sampled from ImageNet (Russakovsky et al., 2015) and it is constituted by a total of 60,000 images from 100 different classes, each with 600 instances. All images are RGB and have been downsampled to $8 4 \times 8 4$ . As all recent work, we adopt the same splits of Ravi & Larochelle (2017), who employ 64 classes for meta-training, 16 for meta-validation and 20 for meta-testing.
|
| 145 |
+
|
| 146 |
+
CIFAR-FS. On the one hand, despite being lightweight, Omniglot is becoming too simple for modern few-shot learning methods, especially with the splits of Vinyals et al. (2016). On the other, miniImageNet is more challenging, but it might still require a model to train for several hours before convergence. Thus, we propose CIFAR-FS (CIFAR100 few-shots), which is randomly sampled from CIFAR-100 (Krizhevsky & Hinton, 2009) by using the same criteria with which miniImageNet has been generated. We observed that the average inter-class similarity is sufficiently high to represent a challenge for the current state of the art. Moreover, the limited original resolution of $3 2 \times 3 2$ makes the task harder and at the same time allows fast prototyping.
|
| 147 |
+
|
| 148 |
+
# 4.2 EXPERIMENTAL RESULTS
|
| 149 |
+
|
| 150 |
+
In order to produce the features $X$ for the base learners (eq. 4 and 7), as many recent methods we use a shallow network of four convolutional “blocks”, each consisting of the following sequence: a $3 { \times } 3$ convolution (padding $^ { = 1 }$ , stride $^ { = 1 }$ ), batch-normalization, $2 \times 2$ max-pooling, and a leaky-ReLU with a factor of 0.1. Max pooling’s stride is 2 for the first three layers and 1 for the last one. The four convolutional layers have [96, 192, 384, 512] filters. Dropout is applied to the last two blocks for the experiments on miniImageNet and CIFAR-FS, respectively with probabilities 0.1 and 0.4. We do not use any fully connected layer. Instead, we flatten and concatenate the output of the third and fourth convolutional blocks and feed it to the base learner. Doing so, we obtain high-dimensional features of size 3584, 72576 and 8064 for Omniglot, miniImageNet and CIFAR-FS respectively. It is important to mention that the use of the Woodbury formula (section 3.2) allows us to make use of high-dimensional features without incurring burdensome computations. In fact, in few-shot problems the data matrix $X$ is particularly “large and short”. As an example, with a 5-way/1-shot problem from miniImageNet we have $X \in \mathbb { R } ^ { 5 \times 7 2 5 7 6 }$ . Applying the Woodbury identity, we obtain significant gains in computation, as in eq. 5 we invert a matrix that is only $5 \times 5$ instead of $7 2 5 7 6 \times 7 2 5 7 6$ .
|
| 151 |
+
|
| 152 |
+
As Snell et al. (2017), we observe that using a higher number of classes during training is important. Hence, despite the few-shot problem at test time being 5 or 20-way, in our multi-class classification experiments we train using 60 classes for Omniglot, 16 for miniImageNet and 20 for CIFAR-FS. Moreover, in order not to train a different model for every single configuration (two for miniImageNet and CIFAR-FS, four for Omniglot), similarly to (Mishra et al., 2018) and differently from previous work, we train our models with a random number of shots, which does not deteriorate the performance and allow us to simply train one model per dataset. We then choose $Q$ (the size of the query or test set) accordingly, so that the batch size $S$ remains constant throughout the episodes. We set $S$ to 600 for Omniglot and 240 for both miniImageNet and CIFAR-FS.
|
| 153 |
+
|
| 154 |
+
At the meta-learning level, we train our methods with Adam (Kingma & Ba, 2015) with an initial learning rate of 0.005, dampened by 0.5 every 2,000 episodes. Training is stopped when the error on the meta-validation set does not decrease meaningfully for 20,000 episodes.
|
| 155 |
+
|
| 156 |
+
As for the base learner, we let SGD learn the parameters $\omega$ of the CNN, as well as the regularization factor $\lambda$ and the scale $\alpha$ and bias $\beta$ of the calibration layer of R2-D2 (end of Section 3.2). In practice, we observed that it is important to use SGD to adapt $\alpha$ and $\beta$ , while it is indifferent whether $\lambda$ is learnt or not. A more detailed analysis can be found in Appendix C.
|
| 157 |
+
|
| 158 |
+
Multi-class classification. Tables 1 and 2 show the performance of our closed-form base learner R2-D2 against the current state of the art for shallow architectures of four convolutional layers. Values represent average classification accuracies obtained by sampling 10,000 episodes from the meta test-set and are presented with $9 5 \%$ confidence intervals. For each column, the best performance is in bold. If more than one value is outlined, it means their intervals overlap. For prototypical networks, we report the results reproduced by the code provided by the authors. For our comparison, we report the results of methods which train their models from scratch for few-shot classification, omitting very recent work of Qiao et al. (2018) and Gidaris & Komodakis (2018), which instead make use of pre-trained embeddings.
|
| 159 |
+
|
| 160 |
+
Table 1: Few-shot multi-class classification accuracies on miniImageNet and CIFAR-FS.
|
| 161 |
+
|
| 162 |
+
<table><tr><td colspan="3">miniImageNet,5-way</td><td colspan="2">CIFAR-FS,5-way</td></tr><tr><td>Method</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>MATCHING NET (Vinyals et al., 2016)</td><td>44.2%</td><td>57%</td><td></td><td></td></tr><tr><td>MAML (Finn et al., 2017)</td><td>48.7±1.8%</td><td>63.1±0.9%</td><td>58.9±1.9%</td><td>71.5±1.0%</td></tr><tr><td>MAML *</td><td>40.9±1.5%</td><td>58.9±0.9%</td><td>53.8±1.8%</td><td>67.6±1.0%</td></tr><tr><td>META-LSTM (Ravi& Larochelle,2017)</td><td>43.4±0.8%</td><td>60.6±0.7%</td><td></td><td></td></tr><tr><td>PROTO NET (Snell et al., 2017)</td><td>47.4±0.6%</td><td>65.4±0.5%</td><td>55.5±0.7%</td><td>72.0±0.6%</td></tr><tr><td>PROTO NET *</td><td>42.9±0.6%</td><td>65.9±0.6%</td><td>57.9±0.8%</td><td>76.7±0.6%</td></tr><tr><td>RELATION NET (Sung et al., 2018)</td><td>50.4±0.8%</td><td>65.3±0.7%</td><td>55.0±1.0%</td><td>69.3±0.8%</td></tr><tr><td>SNAIL (with ResNet) (Mishra et al.,2018)</td><td>55.7±1.0%</td><td>68.9±0.9%</td><td></td><td></td></tr><tr><td>SNAIL (with 32C) (Mishra et al., 2018)</td><td>45.1%</td><td>55.2%</td><td></td><td></td></tr><tr><td>GNN (Garcia & Bruna,2018)</td><td>50.3%</td><td>66.4%</td><td>61.9%</td><td>75.3%</td></tr><tr><td>GNN*</td><td>50.3%</td><td>68.2%</td><td>56.0%</td><td>72.5%</td></tr><tr><td>OURS/R2-D2 (with 64C)</td><td>49.5±0.2%</td><td>65.4±0.2%</td><td>62.3±0.2%</td><td>77.4±0.2%</td></tr><tr><td>OURS/R2-D2</td><td>51.8±0.2%</td><td>68.4±0.2%</td><td>65.4±0.2%</td><td>79.4±0.2%</td></tr><tr><td>OURS/LR-D2 (1 iter.)</td><td>51.0±0.2%</td><td>65.6±0.2%</td><td>64.5±0.2%</td><td>75.8±0.2%</td></tr><tr><td>OURS/LR-D2 (5 iter.)</td><td>51.9±0.2%</td><td>68.7±0.2%</td><td>65.3±0.2%</td><td>78.3±0.2%</td></tr></table>
|
| 163 |
+
|
| 164 |
+
In terms of feature embeddings, Vinyals et al. (2016); Finn et al. (2017); Snell et al. (2017); Ravi & Larochelle (2017) use 64 filters per layer (which become 32 for miniImageNet in (Ravi & Larochelle, 2017; Finn et al., 2017) to limit overfitting). On top of this, Sung et al. (2018) also uses a relation module of two convolutional and two fully connected layers. GNN (Garcia & Bruna, 2018) employs an embedding with [64, 96, 128, 256] filters, a fully connected layer and a graph neural network (with its own extra parameters). In order to ensure a fair comparison, we increased the capacity of the architectures of three representative methods (MAML, prototypical networks and GNN) to match ours. The results of these experiments are reported with $^ { \textrm { a * } }$ on Table 1. We make use of dropout on the last two layers for all the experiments on baselines with $^ *$ , as we verified it is helpful to reduce overfitting. Moreover, we report results for experiments on our R2-D2 in which we use a 64 channels embedding.
|
| 165 |
+
|
| 166 |
+
Despite its simplicity, our proposed method achieves an average accuracy that, on miniImageNet and CIFAR-FS, is superior to the state of the art with shallow architectures. For example, on the four problems of Table 1, R2-D2 improves on average of a relative $4 . 3 \%$ w.r.t. GNN (the second best method). R2-D2 shows competitive results also on Omniglot (Table 2), achieving among the best performance for all problems. Furthermore, when we use the “lighter” embedding, we can still observe a performance which is in line with the state of the art. Interestingly, increasing the capacity of the other methods it is not particularly helpful. It is beneficial only for GNN on miniImageNet and prototypical networks on CIFAR-FS, while being detrimental in all the other cases.
|
| 167 |
+
|
| 168 |
+
Our R2-D2 is also competitive against SNAIL, which uses a much deeper architecture (a ResNet with a total of 14 convolutional layers). Despite being outperformed for the 1-shot case, we can match its results on the 5-shot one. Moreover, it is paramount for SNAIL to make use of such deep embedding, as its performance drops significantly with a shallow one.
|
| 169 |
+
|
| 170 |
+
LR-D2 performance on multi-class classification. In order to be able to compare our binary classifier LR-D2 with the state-of-the-art in few-shot $N$ -class classification, it is possible to jointly consider $N$ binary classifiers, each of which discriminates between a specific class and all the remaining ones (Bishop, 2006, Chapter 4.1). In our framework, this can be easily implemented by concatenating together the outputs of $_ \mathrm { N }$ instances of LR-D2, resulting in a single multi-class prediction.
|
| 171 |
+
|
| 172 |
+
Table 2: Few-shot multi-class classification accuracies on Omniglot.
|
| 173 |
+
|
| 174 |
+
<table><tr><td></td><td colspan="2">Omniglot, 5-way</td><td colspan="2">Omniglot, 20-way</td></tr><tr><td>Method</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>SIAMESE NET (Koch et al., 2015)</td><td>96.7%</td><td>98.4%</td><td>88%</td><td>96.5%</td></tr><tr><td>MATCHING NET (Vinyals et al., 2016)</td><td>98.1%</td><td>98.9%</td><td>93.8%</td><td>98.5%</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>98.7±0.4%</td><td>99.9±0.1%</td><td>95.8±0.3%</td><td>98.9±0.2%</td></tr><tr><td>PROTO NET (Snell et al., 2017)</td><td>98.5±0.2%</td><td>99.5±0.1%</td><td>95.3±0.2%</td><td>98.7±0.1%</td></tr><tr><td>SNAIL (Mishra et al.,2018)</td><td>99.07±0.16%</td><td>99.77±0.09%</td><td>97.64±0.30%</td><td>99.36±0.18%</td></tr><tr><td>GNN(Garcia& Bruna,2018)</td><td>99.2%</td><td>99.7%</td><td>97.4%</td><td>99.0%</td></tr><tr><td>OURS/R2-D2 (with 64C)</td><td>98.55±0.05%</td><td>99.66±0.02%</td><td>94.70±0.05%</td><td>98.91±0.02%</td></tr><tr><td>OURS/R2-D2</td><td>98.91±0.05%</td><td>99.74±0.02%</td><td>96.24±0.05%</td><td>99.20±0.02%</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Table 3: Few-shot binary classification accuracies on miniImageNet and CIFAR-FS.
|
| 177 |
+
|
| 178 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">miniImageNet, 2-way</td><td colspan="2">CIFAR-FS,2-way</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>MAML (Finn et al.,2017)</td><td>74.9±3.0%</td><td>84.4±1.2%</td><td>82.8±2.7%</td><td>88.3±1.1%</td></tr><tr><td>PROTO NETs (Snell et al., 2017)</td><td>71.7±1.0%</td><td>84.8±0.7%</td><td>76.4±0.9%</td><td>88.5±0.6%</td></tr><tr><td>RELATION NET (Sung et al., 2018)</td><td>76.2±1.2%</td><td>86.8±1.0%</td><td>75.0±1.5%</td><td>86.7±0.9%</td></tr><tr><td>GNN(Garcia & Bruna,2018)</td><td>78.4%</td><td>87.1%</td><td>79.3%</td><td>89.1%</td></tr><tr><td>OURS/R2-D2</td><td>77.4±0.3%</td><td>86.8±0.2%</td><td>84.1±0.3%</td><td>91.7±0.2%</td></tr><tr><td>OURS/LR-D2 (10 iter.)</td><td>78.1±0.3%</td><td>86.5±0.2%</td><td>84.7±0.3%</td><td>91.5±0.2%</td></tr></table>
|
| 179 |
+
|
| 180 |
+
We use the same setup and hyper-parameters of R2-D2 (Section 4), except for the number of classes/ways used at training, which we limit to 10. Interestingly, with five IRLS iterations the accuracy of the 1-vs-all variant of LR-D2 is similar to the one of R2-D2 (Table 1): $5 1 . 9 \%$ and $6 8 . 7 \%$ for miniImageNet (1-shot and 5-shot); $6 5 . 3 \%$ and $7 8 . 3 \%$ for CIFAR-FS. With a single iteration, performance is still very competitive: $5 1 . 0 \%$ and $6 5 . 6 \%$ for miniImageNet; $6 4 . 5 \%$ and $7 5 . 8 \%$ for CIFAR-FS. However, the requirement of solving $N$ binary problems per iteration makes it much less efficient than R2-D2, as evident in Table 4.
|
| 181 |
+
|
| 182 |
+
Binary classification. Finally, in Table 3 we report the performance of both our ridge regression and logistic regression base learners, together with four representative methods. Since LR-D2 is limited to operate in a binary classification setup, we run our R2-D2 and prototypical network without oversampling the number of ways. For both methods and prototypical networks, we report the performance obtained annealing the learning rate by a factor of 0.99, which works better than the schedule used for multi-class classification. Moreover, motivated by the small size of the mini-batches, we replace Batch Normalization with Group Normalization (Wu & He, 2018). For this table, we use the default setup found in the code of MAML, which uses 5 SGD iterations during training and 10 during testing. Table 3 confirms the validity of both our approaches on the binary classification problem.
|
| 183 |
+
|
| 184 |
+
Although different in nature, both MAML and our LR-D2 make use of iterative base learners: the former is based on SGD, while the latter on Newton’s method (under the form of Iteratively Reweighted Least Squares). The use of second-order optimization might suggest that LR-D2 is characterized by computationally demanding steps. However, we can apply the Woodbury identity at every iteration and obtain a significant speedup. In Figure 2 we compare the performance of LR-D2 vs the one of MAML for a different number of steps of the base learner (kept constant between training and testing). LR-D2 is superior to MAML, especially for a higher number of steps.
|
| 185 |
+
|
| 186 |
+
Efficiency. In Table 4 we compare the amount of time required by two representative methods and ours to solve 10,000 episodes (each with 10 images) on a single NVIDIA GTX 1080 GPU. We use miniImageNet (5-way, 1-shot) and adopt, for the lower part of the table, a lightweight embedding network of 4 layers and 32 channels per layer. For reference, in the upper part of the table we also report the timings for R2-D2 with [64, 64, 64, 64] and [96, 192, 384, 512] embeddings.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 2: Binary classification accuracy on two datasets and two setups at different number of steps of the base learner for MAML, R2-D2 and LR-D2. Shaded areas represent $9 5 \%$ confidence intervals.
|
| 190 |
+
|
| 191 |
+
Interestingly, we can observe how R2-D2 allows us to achieve an efficiency that is comparable to the one of prototypical networks and significantly higher than MAML. Notably, unlike prototypical networks, our methods do allow per-episode adaptation through the weights $W$ of the solver.
|
| 192 |
+
|
| 193 |
+
Table 4: Time required to solve 10,000 miniImageNet episodes of 10 samples each.
|
| 194 |
+
|
| 195 |
+
<table><tr><td></td><td>miniImageNet,5-way,1-shot</td></tr><tr><td>OURS/R2-D2</td><td>1 min 23 sec</td></tr><tr><td>OURS/R2-D2 (with 64C)</td><td>1 min 4 sec</td></tr><tr><td>MAML (Finn et al.,2017) (with 32C)</td><td>6 min 35 sec</td></tr><tr><td>OURs/LR-D2 (1-vs-all) (1 iter.) (with 32C)</td><td>5 min 48 sec</td></tr><tr><td>OURS/R2-D2 (with 32C)</td><td>57 sec</td></tr><tr><td>PROTO NETs (Snell et al.,2017) (with 32C)</td><td>24 sec</td></tr></table>
|
| 196 |
+
|
| 197 |
+
# 5 CONCLUSIONS
|
| 198 |
+
|
| 199 |
+
With the aim of allowing efficient adaptation to unseen learning problems, in this paper we explored the feasibility of incorporating fast solvers with closed-form solutions as the base learning component of a meta-learning system. Importantly, the use of the Woodbury identity allows significant computational gains in a scenario presenting only a few samples with high dimensionality, like one-shot of few-shot learning. R2-D2, the differentiable ridge regression base learner we introduce, is almost as fast as prototypical networks and strikes a useful compromise between not performing adaptation for new episodes (like metric-learning-based approaches) and conducting a costly iterative approach (like MAML or LSTM-based meta-learners). In general, we showed that our base learners work remarkably well, with excellent results on few-shot learning benchmarks, generalizing to episodes with new classes that were not seen during training. We believe that our findings point in an exciting direction of more sophisticated yet efficient online adaptation methods, able to leverage the potential of prior knowledge distilled in an offline training phase. In future work, we would like to explore Newton’s methods with more complicated second-order structure than ridge regression.
|
| 200 |
+
|
| 201 |
+
# ACKNOWLEDGMENTS
|
| 202 |
+
|
| 203 |
+
We would like to thank Jack Valmadre, Namhoon Lee and the anonymous reviewers for their insightful comments, which have been useful to improve the manuscript. This work was partially supported by the ERC grant 638009-IDIU.
|
| 204 |
+
|
| 205 |
+
# REFERENCES
|
| 206 |
+
|
| 207 |
+
Han Altae-Tran, Bharath Ramsundar, Aneesh S Pappu, and Vijay Pande. Low data drug discovery with one-shot learning. ACS central science, 2017.
|
| 208 |
+
|
| 209 |
+
Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, 2016.
|
| 210 |
+
|
| 211 |
+
Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, pp. 6–8. Univ. of Texas, 1992.
|
| 212 |
+
|
| 213 |
+
Yoshua Bengio. Gradient-based optimization of hyperparameters. Neural computation, 2000.
|
| 214 |
+
|
| 215 |
+
Luca Bertinetto, João F Henriques, Jack Valmadre, Philip Torr, and Andrea Vedaldi. Learning feed-forward one-shot learners. In Advances in Neural Information Processing Systems, 2016.
|
| 216 |
+
|
| 217 |
+
Christopher M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). Springer-Verlag, Berlin, Heidelberg, 2006.
|
| 218 |
+
|
| 219 |
+
Jane Bromley, James W Bentz, Léon Bottou, Isabelle Guyon, Yann LeCun, Cliff Moore, Eduard Säckinger, and Roopak Shah. Signature verification using a “Siamese” time delay neural network. International Journal of Pattern Recognition and Artificial Intelligence, 1993.
|
| 220 |
+
|
| 221 |
+
Susan Carey. Less may never mean more. Recent advances in the psychology of language, 1978.
|
| 222 |
+
|
| 223 |
+
Susan Carey and Elsa Bartlett. Acquiring a single new word. 1978.
|
| 224 |
+
|
| 225 |
+
Rich Caruana. Multitask learning. In Learning to learn. Springer, 1998.
|
| 226 |
+
|
| 227 |
+
Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In IEEE Conference on Computer Vision and Pattern Recognition, 2005.
|
| 228 |
+
|
| 229 |
+
Brian Chu, Vashisht Madhavan, Oscar Beijbom, Judy Hoffman, and Trevor Darrell. Best practices for fine-tuning visual classifiers to new domains. In European Conference on Computer Vision workshops. Springer, 2016.
|
| 230 |
+
|
| 231 |
+
Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006.
|
| 232 |
+
|
| 233 |
+
Chelsea Finn and Sergey Levine. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. 2018.
|
| 234 |
+
|
| 235 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, 2017.
|
| 236 |
+
|
| 237 |
+
Victor Garcia and Joan Bruna. Few-shot learning with graph neural networks. In International Conference on Learning Representations, 2018.
|
| 238 |
+
|
| 239 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 240 |
+
|
| 241 |
+
Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, 2012.
|
| 242 |
+
|
| 243 |
+
Bharath Hariharan and Ross B Girshick. Low-shot visual recognition by shrinking and hallucinating features. In IEEE International Conference on Computer Vision, 2017.
|
| 244 |
+
|
| 245 |
+
Sepp Hochreiter, A Steven Younger, and Peter R Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pp. 87–94. Springer, 2001.
|
| 246 |
+
|
| 247 |
+
Catalin Ionescu, Orestis Vantzos, and Cristian Sminchisescu. Training deep networks with structured layers by matrix backpropagation. arXiv preprint arXiv:1509.07838, 2015.
|
| 248 |
+
|
| 249 |
+
Łukasz Kaiser, Ofir Nachum, Aurko Roy, and Samy Bengio. Learning to remember rare events. In International Conference on Learning Representations, 2017.
|
| 250 |
+
|
| 251 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2015.
|
| 252 |
+
|
| 253 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In International Conference on Machine Learning workshops, 2015.
|
| 254 |
+
|
| 255 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 256 |
+
|
| 257 |
+
Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 2015.
|
| 258 |
+
|
| 259 |
+
Dougal Maclaurin, David Duvenaud, and Ryan Adams. Gradient-based hyperparameter optimization through reversible learning. In International Conference on Machine Learning, pp. 2113–2122, 2015.
|
| 260 |
+
|
| 261 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation. 1989.
|
| 262 |
+
|
| 263 |
+
Erik G Miller, Nicholas E Matsakis, and Paul A Viola. Learning from one example through shared densities on transforms. In IEEE Conference on Computer Vision and Pattern Recognition. IEEE, 2000.
|
| 264 |
+
|
| 265 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive metalearner. In International Conference on Learning Representations, 2018.
|
| 266 |
+
|
| 267 |
+
Tom M Mitchell. The need for biases in learning generalizations. Department of Computer Science, Laboratory for Computer Science Research, Rutgers Univ. New Jersey, 1980.
|
| 268 |
+
|
| 269 |
+
Tom M Mitchell et al. Machine learning. 1997. Burr Ridge, IL: McGraw Hill, 1997.
|
| 270 |
+
|
| 271 |
+
Tsendsuren Munkhdalai and Hong Yu. Meta networks. In International Conference on Machine Learning, 2017.
|
| 272 |
+
|
| 273 |
+
Kevin P. Murphy. Machine Learning: A Probabilistic Perspective. The MIT Press, 2012.
|
| 274 |
+
|
| 275 |
+
Devang K Naik and RJ Mammone. Meta-neural networks that learn by learning. In Neural Networks, 1992. IJCNN., International Joint Conference on. IEEE, 1992.
|
| 276 |
+
|
| 277 |
+
Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. CoRR, 2018. URL http://arxiv.org/abs/1803.02999.
|
| 278 |
+
|
| 279 |
+
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.
|
| 280 |
+
|
| 281 |
+
Kaare Brandt Petersen, Michael Syskind Pedersen, et al. The matrix cookbook. Technical University of Denmark, 2008.
|
| 282 |
+
|
| 283 |
+
Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L. Yuille. Few-shot image recognition by predicting parameters from activations. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 284 |
+
|
| 285 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations, 2017.
|
| 286 |
+
|
| 287 |
+
Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems, 2017.
|
| 288 |
+
|
| 289 |
+
Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. In International Conference on Learning Representations, 2018.
|
| 290 |
+
|
| 291 |
+
Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017.
|
| 292 |
+
|
| 293 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. 2015.
|
| 294 |
+
|
| 295 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International Conference on Machine Learning, 2016.
|
| 296 |
+
|
| 297 |
+
Jürgen Schmidhuber. Evolutionary principles in self-referential learning, or on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universität München, 1987.
|
| 298 |
+
|
| 299 |
+
Jürgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 1992.
|
| 300 |
+
|
| 301 |
+
Jürgen Schmidhuber. A neural network that embeds its own meta-levels. In Neural Networks, 1993., IEEE International Conference on. IEEE, 1993.
|
| 302 |
+
|
| 303 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, 2017.
|
| 304 |
+
|
| 305 |
+
Pablo Sprechmann, Siddhant M Jayakumar, Jack W Rae, Alexander Pritzel, Adrià Puigdomènech Badia, Benigno Uria, Oriol Vinyals, Demis Hassabis, Razvan Pascanu, and Charles Blundell. Memory-based parameter adaptation. 2018.
|
| 306 |
+
|
| 307 |
+
Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 308 |
+
|
| 309 |
+
Albert Tarantola. Inverse problem theory and methods for model parameter estimation, volume 89. siam, 2005.
|
| 310 |
+
|
| 311 |
+
Sebastian Thrun. Is learning the n-th thing any easier than learning the first? In Advances in Neural Information Processing Systems, 1996.
|
| 312 |
+
|
| 313 |
+
Sebastian Thrun. Lifelong learning algorithms. In Learning to learn. Springer, 1998.
|
| 314 |
+
|
| 315 |
+
Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 1998.
|
| 316 |
+
|
| 317 |
+
Paul E Utgoff. Shift of bias for inductive concept learning. Machine learning: An artificial intelligence approach, 1986.
|
| 318 |
+
|
| 319 |
+
Jack Valmadre, Luca Bertinetto, João Henriques, Andrea Vedaldi, and Philip HS Torr. End-to-end representation learning for correlation filter based tracking. In IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 320 |
+
|
| 321 |
+
Ricardo Vilalta and Youssef Drissi. A perspective view and survey of meta-learning. Artificial Intelligence Review, 2002.
|
| 322 |
+
|
| 323 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, 2016.
|
| 324 |
+
|
| 325 |
+
Yuxin Wu and Kaiming He. Group normalization. CoRR, 2018. URL http://arxiv.org/ abs/1803.08494.
|
| 326 |
+
|
| 327 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in Neural Information Processing Systems, 2014.
|
| 328 |
+
|
| 329 |
+
A Steven Younger, Sepp Hochreiter, and Peter R Conwell. Meta-learning with backpropagation. In Neural Networks, 2001. Proceedings. IJCNN’01. International Joint Conference on. IEEE, 2001.
|
| 330 |
+
|
| 331 |
+
# A EXTENDED DISCUSSION
|
| 332 |
+
|
| 333 |
+
Contributions within the few-shot learning paradigm. In this work, we evaluated our proposed methods R2-D2 and LR-D2 in the few-shot learning scenario (Fei-Fei et al., 2006; Lake et al., 2015; Vinyals et al., 2016; Ravi & Larochelle, 2017; Hariharan & Girshick, 2017), which consists in learning how to discriminate between images given one or very few examples. For methods tackling this problem, it is common practice to organise the training procedure in two nested loops. The inner loop is used to solve the actual few-shot classification problem, while the outer loop serves as a guidance for the former by gradually modifying the inductive bias of the base learner (Vilalta & Drissi, 2002). Differently from standard classification benchmarks, the few-shot ones enforce that classes are disjoint between dataset splits.
|
| 334 |
+
|
| 335 |
+
In the literature (e.g. Vinyals et al. (2016)), the very small classification problems with unseen classes solved within the inner loop have often been referred to as episodes or tasks. Considering the general few-shot learning paradigm just described, methods in the recent literature mostly differ for the type of learner they use in the inner loop and the amount of per-episode adaptability they allow. For example, at the one end of the spectrum in terms of “amount of adaptability”, we can find methods such as MAML Finn et al. (2017), which learns how to efficiently fine-tune the parameters of a neural-network with few iterations of SGD. On the other end, we have methods based on metric learning such as prototypical networks Snell et al. (2017) and relation network Sung et al. (2018), which are fast but do not perform adaptation. Note that the amount of adaptation to a new episode (i.e.a new classification problem with unseen classes) is not at all indicative of the performance in few-shot learning benchmarks. As a matter of fact, both Snell et al. (2017) and Sung et al. (2018) achieve higher accuracy than MAML. Nonetheless, adaptability is a desirable property, as it allows more design flexibility.
|
| 336 |
+
|
| 337 |
+
Within this landscape, our work proposes a novel technique (R2-D2) that does allow per-episode adaptation while at the same time being fast (Table 4) and achieving strong performance (Table 1). The key innovation is to use a simple (and differentiable) solver such as ridge regression within the inner loop, which requires back-propagating through the solution of a learning problem. Crucially, its closed-form solution and the use of the Woodbury identity (particularly advantageous in the low data regime) allow this non-trivial endeavour to be efficient. We further demonstrate that this strategy is not limited to the ridge regression case, but it can also be extended to other solvers (LR-D2) by dividing the problem into a short series of weighted least squares problems ((Murphy, 2012, Chapter 8.3.4)).
|
| 338 |
+
|
| 339 |
+
Disambiguation from the multi-task learning paradigm. Our work – and more generally the few-shot learning literature as a whole – is related to the multi-task learning paradigm (Caruana, 1998; Ruder, 2017). However, several crucial differences exist. In terms of setup, multi-task learning methods are trained to solve a fixed set of $T$ tasks (or domains). At test time, the same $T$ tasks or domains are encountered. For instance, the popular Office-Caltech (Gong et al., 2012) dataset is constructed by considering all the images from 10 classes present in 4 different datasets (the domains). For multi-task learning, the splits span the domains but contain all the 10 classes. Conversely, few-shot learning datasets have splits with disjoint sets of classes (i.e. each split’s classes are not contained in other splits). Moreover, only a few examples (shots) can be used as training data within one episode, while in multi-task learning this limitation is not present. For this reason, meta-learning methods applied to few-shot learning (e.g.ours, (Vinyals et al., 2016; Finn et al., 2017; Ravi & Larochelle, 2017; Mishra et al., 2018)) crucially take into account adaptation already during the training process to mimic the test-time setting, de facto learning how to learn from limited data.
|
| 340 |
+
|
| 341 |
+
The importance of considering adaptation during training. Considering adaptation during training is also one of the main traits that differentiate our approach from basic transfer learning approaches in which a neural network is first pre-trained on one dataset/task and then adapted to a different dataset/task by simply adapting the final layer(s) (e.g. Yosinski et al. (2014); Chu et al. (2016)).
|
| 342 |
+
|
| 343 |
+
To better illustrate this point, we conducted a baseline experiment. First, we pre-trained for a standard classification problem the same 4-layers CNN architecture using the same training datasets. We simply added a final fully-connected layer (with 64 outputs, like the number of classes in the training splits) and used the cross-entropy loss. Then, we used the convolutional part of this trained network as a feature extractor and fed its activations to our ridge-regression layer to produce a per-episode set of weights $W$ . On miniImagenet, the drop in performance w.r.t. our proposed R2-D2 is very significant: $- 1 3 . 8 \%$ and $- 1 1 . 6 \%$ accuracy for the 1 and 5 shot problems respectively. The drop in performance is consistent on CIFAR, though a bit less drastic: $- 1 1 . 5 \%$ and $- 5 . 9 \%$ .
|
| 344 |
+
|
| 345 |
+
These results empirically confirm that simply using basic transfer learning techniques with a shared feature representation and task-specific final layers is not a good strategy to obtain results competitive with the state-of-the-art in few-shot learning. Instead, it is necessary to enforce the generality of the underlying features during training explicitly, which we do by back-propagating through the adaptation procedure (the regressors R2-D2 and LR-D2).
|
| 346 |
+
|
| 347 |
+
# B DIFFERENT GAUSSIAN PRIORS FOR REGULARIZATION
|
| 348 |
+
|
| 349 |
+
The regularization term can be seen as a prior gaussian distribution of the parameters in a Bayesian interpretation, or more simply Tikhonov regularization (Tarantola, 2005). In the most common case of $\lambda I$ , it corresponds to an isotropic gaussian prior on the parameters.
|
| 350 |
+
|
| 351 |
+
In addition to the case in which $\lambda$ is a scalar, we also experiment with the variant $\operatorname { d i a g } ( \lambda )$ , corresponding to an axis-aligned gaussian prior with an independent variance for each parameter, which can potentially exploit the fact that the parameters have different scales. Replacing $\lambda I$ with $\mathrm { d i a g } ( \lambda )$ in 4, the final expression for W after having applied the Woodbury identity becomes:
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
W = \Lambda ( Z ) = \mathrm { d i a g } ( \lambda ) ^ { - 1 } X ^ { T } ( X \mathrm { d i a g } ( \lambda ) ^ { - 1 } X ^ { T } + I ) ^ { - 1 } Y .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
# C BASE LEARNER HYPER-PARAMETERS
|
| 358 |
+
|
| 359 |
+
Figure 3 illustrates the effect of using SGD to learn, together with the parameters $\omega$ of the CNN, also the hyper-parameters ( $\vert \rho \rrangle$ in eq. 2) of the base learner $\Lambda$ . We find that it is very important to learn the scalar $\alpha$ (right plot of Figure 3) used to calibrate the output of R2-D2 in eq. 6, while it is indifferent whether or not to learn $\lambda$ . Note that, by using SGD to update $\alpha$ , it is possible (e.g.in the range $[ 1 0 ^ { - 3 } , 1 0 ^ { 0 } ] )$ to recover from poor initial values and suffer just a little performance loss w.r.t. the optimal value of $\alpha = 1 0$ .
|
| 360 |
+
|
| 361 |
+
The left plot of Figure 3 also shows the performance of R2-D2 with the variant $\operatorname { d i a g } ( \lambda )$ introduced in Appendix B. Unfortunately, despite this formulation allows us to make use of a more expressive prior, it does not improve the results compared to using a simple scalar $\lambda$ . Moreover, performance abruptly deteriorate for $\lambda > 0 . 0 1$ .
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 3: Shaded areas represent $9 5 \%$ confidence intervals.
|
md/train/HyydRMZC-/HyydRMZC-.md
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPATIALLY TRANSFORMED ADVERSARIAL EXAMPLES
|
| 2 |
+
|
| 3 |
+
Chaowei Xiao1 ∗, Jun-Yan $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { 2 }$ ∗, $\mathbf { B o L i ^ { 3 } }$ , Warren $\mathbf { H e ^ { 3 } }$ , Mingyan Liu1, Dawn Song3
|
| 4 |
+
1University of Michigan, Ann Arbor, USA
|
| 5 |
+
2Massachusetts Institute of Technology, MA, USA
|
| 6 |
+
3University of California, Berkeley, USA
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Recent studies show that widely used deep neural networks (DNNs) are vulnerable to carefully crafted adversarial examples. Many advanced algorithms have been proposed to generate adversarial examples by leveraging the ${ \mathcal { L } } _ { p }$ distance for penalizing perturbations. Researchers have explored different defense methods to defend against such adversarial attacks. While the effectiveness of ${ \mathcal { L } } _ { p }$ distance as a metric of perceptual quality remains an active research area, in this paper we will instead focus on a different type of perturbation, namely spatial transformation, as opposed to manipulating the pixel values directly as in prior works. Perturbations generated through spatial transformation could result in large ${ \mathcal { L } } _ { p }$ distance measures, but our extensive experiments show that such spatially transformed adversarial examples are perceptually realistic and more difficult to defend against with existing defense systems. This potentially provides a new direction in adversarial example generation and the design of corresponding defenses. We visualize the spatial transformation based perturbation for different examples and show that our technique can produce realistic adversarial examples with smooth image deformation. Finally, we visualize the attention of deep networks with different types of adversarial examples to better understand how these examples are interpreted.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Deep neural networks (DNNs) have demonstrated their outstanding performance in different domains, ranging from image processing (Krizhevsky et al., 2012; He et al., 2016), text analysis (Collobert & Weston, 2008) to speech recognition (Hinton et al., 2012). Though deep networks have exhibited high performance for these tasks, recently they have been shown to be particularly vulnerable to adversarial perturbations added to the input images (Szegedy et al., 2013; Goodfellow et al., 2015). These perturbed instances are called adversarial examples, which can lead to undesirable consequences in many practical applications based on DNNs. For example, adversarial examples can be used to subvert malware detection, fraud detection, or even potentially mislead autonomous navigation systems (Papernot et al., 2016b; Evtimov et al., 2017; Grosse et al., 2016) and therefore pose security risks when applied to security-related applications. A comprehensive study about adversarial examples is required to motivate effective defenses. Different methods have been proposed to generate adversarial examples such as fast gradient sign methods (FGSM) (Goodfellow et al., 2015), which can produce adversarial instances rapidly, and optimization-based methods (C&W) (Carlini & Wagner, 2017a), which search for adversarial examples with smaller magnitude of perturbation.
|
| 15 |
+
|
| 16 |
+
One important criterion for adversarial examples is that the perturbed images should “look like” the original instances. The traditional attack strategies adopt $L _ { 2 }$ (or other ${ \mathcal { L } } _ { p }$ ) norm distance as a perceptual similarity metric to evaluate the distortion (Gu & Rigazio, 2014). However, this is not an ideal metric (Johnson et al., 2016; Isola et al., 2017), as $L _ { 2 }$ similarity is sensitive to lighting and viewpoint change of a pictured object. For instance, an image can be shifted by one pixel, which will lead to large $L _ { 2 }$ distance, while the translated image actually appear “the same” to human perception. Motivated by this example, in this paper we aim to look for other types of adversarial examples and propose to create perceptually realistic examples by changing the positions of pixels instead of directly manipulating existing pixel values. This has been shown to better preserve the identity and structure of the original image (Zhou et al., 2016b). Thus, the proposed spatially transformed adversarial example optimization method (stAdv) can keep adversarial examples less distinguishable from real instances (such examples can be found in Figure 3).
|
| 17 |
+
|
| 18 |
+
Various defense methods have also been proposed to defend against adversarial examples. Adversarial training based methods have so far achieved the most promising results (Goodfellow et al., 2015; Tramèr et al., 2017; M ˛adry et al., 2017). They have demonstrated the robustness of improved deep networks under certain constraints. However, the spatially transformed adversarial examples are generated through a rather different principle, whereby what is being minimized is the local geometric distortion rather than the ${ \mathcal { L } } _ { p }$ pixel error between the adversarial and original instances. Thus, the previous adversarial training based defense method may appear less effective against this new attack given the fact that these examples generated by stAdv have never been seen before. This opens a new challenge about how to defend against such attacks, as well as other attacks that are not based on direct pixel value manipulation.
|
| 19 |
+
|
| 20 |
+
We visualize the spatial deformation generated by stAdv; it is seen to be locally smooth and virtually imperceptible to the human eye. In addition, to better understand the properties of deep neural networks on different adversarial examples, we provide visualizations of the attention of the DNN given adversarial examples generated by different attack algorithms. We find that the spatial transformation based attack is more resilient across different defense models, including adversarially trained robust models.
|
| 21 |
+
|
| 22 |
+
Our contributions are summarized as follows:
|
| 23 |
+
|
| 24 |
+
• We propose to generate adversarial examples based on spatial transformation instead of direct manipulation of the pixel values, and we show realistic and effective adversarial examples on the MNIST, CIFAR-10, and ImageNet datasets.
|
| 25 |
+
We provide visualizations of optimized transformations and show that such geometric changes are small and locally smooth, leading to high perceptual quality.
|
| 26 |
+
• We empirically show that, compared to other attacks, adversarial examples generated by stAdv are more difficult to detect with current defense systems.
|
| 27 |
+
• Finally, we visualize the attention maps of deep networks on different adversarial examples and demonstrate that adversarial examples based on stAdv can more consistently mislead the adversarial trained robust deep networks compared to other existing attack methods.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Here we first briefly summarize the existing adversarial attack algorithms as well as the current defense methods. We then discuss the spatial transformation model used in our adversarial attack.
|
| 32 |
+
|
| 33 |
+
Adversarial Examples Given a benign sample $\mathbf { x }$ , an attack instance $\mathbf { x } _ { \mathrm { a d v } }$ is referred to as an adversarial example, if a small magnitude of perturbation $\epsilon$ is added to $\mathbf { x }$ (i.e. ${ \bf x } _ { \mathrm { a d v } } = { \bf x } + { \bf \epsilon } \mathrm { ) }$ so that $\mathbf { x } _ { \mathrm { a d v } }$ is misclassified by the targeted classifier $g$ . Based on the adversarial goal, attacks can be classified into two categories: targeted and untargeted attacks. In a targeted attack, the adversary’s objective is to modify an input $\mathbf { x }$ such that the target model $g$ classifies the perturbed input $\mathbf { x } _ { \mathrm { a d v } }$ in a targeted class chosen, which differs from its ground truth. In a untargeted attack, the adversary’s objective is to cause the perturbed input $\mathbf { x } _ { \mathrm { a d v } }$ to be misclassified in any class other than its ground truth. Based on the adversarial capabilities, these attacks can be categorized as white-box and black-box attacks, where an adversary has full knowledge of the classifier and training data in the white-box setting (Szegedy et al., 2014; Goodfellow et al., 2015; Carlini & Wagner, 2017a; Moosavi-Dezfooli et al., 2015; Papernot et al., 2016b; Biggio et al., 2013; Fawzi & Frossard, 2015; Kanbak, 2017; Kurakin et al., 2016); while having zero knowledge about them in the black-box setting (Papernot et al., 2016a; Liu et al., 2017; Moosavi-Dezfooli et al., 2016; Mopuri et al., 2017). In this work, we will focus on the white-box setting to explore what a powerful adversary can do based on the Kerckhoffs’s principle (Shannon, 1949) to better motivate defense methods.
|
| 34 |
+
|
| 35 |
+
Spatial Transformation In computer vision and graphics literature, Two main aspects determine the appearance of a pictured object (Szeliski, 2010): (1) the lighting and material, which determine the brightness of a point as a function of illumination and object material properties, and (2) the geometry, which determines where the projection of a point will be located in the scene. Most previous adversarial attacks (Goodfellow et al., 2015) focus on changing the lighting and material aspect, while assuming the underlying geometry stays the same during the adversarial perturbation generation process.
|
| 36 |
+
|
| 37 |
+
Modeling geometric transformation with neural networks was first explored by “capsules,” computational units that locally transform their input for modeling 2D and 3D geometric changes (Hinton et al., 2011). Later, Jaderberg et al. (2015) demonstrated that similar computational units, named spatial transformers, can benefit many visual recognition tasks. Zhou et al. (2016a) adopted the spatial transformers for synthesizing novel views of the same object and has shown that a geometric method can produce more realistic results compared to pure pixel-based methods. Inspired by these successes, we also use the spatial transformers to deform the input images, but with a different goal: to generate realistic adversarial examples.
|
| 38 |
+
|
| 39 |
+
Defensive Methods Following the emergence of adversarial examples, various defense methods have been studied, including adversarial training (Goodfellow et al., 2015), distillation (Papernot et al., 2016c), gradient masking (Gu & Rigazio, 2014) and feature squeezing (Xu et al., 2017). However, these defenses can either be evaded by C&W attacks or only provide marginal improvements (Carlini & Wagner, 2017b; He et al., 2017). Among these defenses, adversarial training has achieved the state-of-the-art performance. Goodfellow et al. (2015) proposed to use the fast gradient sign attack as an adversary to perform adversarial training, which is much faster, followed by ensemble adversarial training (Tramèr et al., 2017) and projected gradient descent (PGD) adversarial training (M ˛adry et al., 2017). In this work, we explicitly analyze how effective the spatial transformation based adversarial examples are under these adversarial training based defense methods.
|
| 40 |
+
|
| 41 |
+
# 3 GENERATING ADVERSARIAL EXAMPLES
|
| 42 |
+
|
| 43 |
+
Here we first introduce several existing attack methods and then present our formulation for producing spatially transformed adversarial examples.
|
| 44 |
+
|
| 45 |
+
# 3.1 PROBLEM DEFINITION
|
| 46 |
+
|
| 47 |
+
Given a learned classifier $g : \mathcal { X } \mathcal { Y }$ from a feature space $\mathcal { X }$ to a set of classification outputs $\mathcal { V }$ (e.g., $\mathcal { V } = \{ 0 , 1 \}$ for binary classification), an adversary aims to generate adversarial example $\mathbf { x } _ { \mathrm { a d v } }$ for an original instance $\mathbf { x } \in \mathcal { X }$ with its ground truth label $y \in \mathcal { V }$ , so that the classifier predicts $g ( \mathbf { x } _ { \mathrm { a d v } } ) \neq y$ (untargeted attack) or $g ( \mathbf { x } _ { \mathrm { a d v } } ) = t$ (targeted attack) where $t$ is the target class.
|
| 48 |
+
|
| 49 |
+
# 3.2 BACKGROUND: CURRENT PIXEL-VALUE BASED ATTACK METHODS
|
| 50 |
+
|
| 51 |
+
All of the current methods for generating adversarial examples are built on directly modifying the pixel values of the original image.
|
| 52 |
+
|
| 53 |
+
The fast gradient sign method (FGSM) (Goodfellow et al., 2015) uses a first-order approximation of the loss function to construct adversarial samples for the adversary’s target classifier $g$ . The algorithm achieves untargeted attack by performing a single gradient ascent step: ${ \bf x } _ { \mathrm { a d v } } = { \bf x } + { \bf \delta }$ $\epsilon \cdot \mathrm { s i g n } ( \nabla _ { \mathbf { x } } \ell _ { g } ( \mathbf { x } , y ) )$ , where $\ell _ { g } ( \mathbf x , y )$ is the loss function (e.g. cross-entropy loss) used to train the original model $g , y$ denotes the ground truth label, and the hyper-parameter $\epsilon$ controls the magnitude of the perturbation. A targeted version of it can be done similarly.
|
| 54 |
+
|
| 55 |
+
Optimization-based attack (C&W) produces an adversarial perturbation for a targeted attack based on certain constraints (Carlini & Wagner, 2017a; Liu et al., 2017) as formulated below:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\operatorname* { m i n } | | \delta | | _ { p } ^ { 2 } \quad \mathrm { s . t . } \qquad g ( \mathbf { x } + \delta ) = t \quad \mathrm { a n d } \quad \mathbf { x } + \delta \in X ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where the ${ \mathcal { L } } _ { p }$ norm penalty ensures that the added perturbation $\epsilon$ is small. The same optimization procedure can achieve untargeted attacks with a modified constraint $g ( \mathbf { x } + \delta ) \neq y$ .
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 1: Generating adversarial examples with spatial transformation: the blue point denotes the coordinate of a pixel in an output adversarial image and the green point is its corresponding pixel in an input image. The flow field in red represents the displacement from the pixels in the adversarial image to the pixels in the input image.
|
| 65 |
+
|
| 66 |
+
# 3.3 OUR APPROACH: SPATIALLY TRANSFORMED ADVERSARIAL EXAMPLES
|
| 67 |
+
|
| 68 |
+
All the existing approaches directly modify pixel values, which may sometimes produce noticeable artifacts. Instead, we aim to smoothly change the geometry of the scene while keeping the original appearance, producing more perceptually realistic adversarial examples. In this section, we first introduce our spatial transformation model and then describe our objective function for generating spatially transformed adversarial examples.
|
| 69 |
+
|
| 70 |
+
Spatial transformation We use $\mathbf { x } _ { \mathrm { a d v } } ^ { ( i ) }$ to denote the pixel value of the $i$ -th pixel and 2D coordinate (u adv, v adv) to denote its location in the adversarial image $\mathbf { x } _ { \mathrm { a d v } }$ . We assume that $\mathbf { x } _ { \mathrm { a d v } } ^ { ( i ) }$ is transformed from the pixel $\mathbf { x } ^ { ( i ) }$ from the original image. We use the per-pixel flow (displacement) field $f$ to synthesize the adversarial image $\mathbf { x } _ { \mathrm { a d v } }$ using pixels from the input $\mathbf { x }$ . For the $i$ -th pixel within $\mathbf { x } _ { \mathrm { a d v } }$ at the pixel location $( u _ { \mathrm { a d v } } ^ { ( i ) } , v _ { \mathrm { a d v } } ^ { ( i ) } )$ , we optimize the amount of displacement in each image dimension, with the pair denoted by the flow vector $f _ { i } : = ( \Delta u ^ { ( i ) } , \Delta v ^ { ( i ) } )$ . Note that the flow vector $f _ { i }$ goes from a pixel $\mathbf { x } _ { \mathrm { a d v } } ^ { ( i ) }$ in the adversarial image to its corresponding pixel $\mathbf { x } ^ { ( i ) }$ in the input image. Thus, the location of its corresponding pixel $\mathbf { x } ^ { ( i ) }$ can be derived as $( \boldsymbol { u } ^ { ( i ) } , \boldsymbol { v } ^ { ( i ) } ) = ( u _ { \mathrm { a d v } } ^ { ( i ) } + \Delta u ^ { ( i ) } , v _ { \mathrm { a d v } } ^ { ( i ) } + \Delta v ^ { ( i ) } )$ . As the $( u ^ { ( i ) } , v ^ { ( i ) } )$ can be fractional numbers and does not necessarily lie on the integer image grid, we use the differentiable bilinear interpolation (Jaderberg et al., 2015) to transform the input image with the flow field. We calculate x(i)adv as:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathbf { x } _ { \mathrm { a d v } } ^ { ( i ) } = \sum _ { q \in \mathcal { N } ( u ^ { ( i ) } , v ^ { ( i ) } ) } \mathbf { x } ^ { ( q ) } ( 1 - | u ^ { ( i ) } - u ^ { ( q ) } | ) ( 1 - | v ^ { ( i ) } - v ^ { ( q ) } | ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\mathcal { N } ( u ^ { ( i ) } , v ^ { ( i ) } )$ are the indices of the 4-pixel neighbors at the location $( u ^ { ( i ) } , v ^ { ( i ) } )$ (top-left, topright, bottom-left, bottom-right). We can obtain the adversarial image $\mathbf { x } _ { \mathrm { a d v } }$ by calculating Equation 1 for every pixel $\mathbf { x } _ { \mathrm { a d v } } ^ { ( i ) }$ . Note that $\mathbf { x } _ { \mathrm { a d v } }$ is differentiable with respect to the flow field $f$ (Jaderberg et al., 2015; Zhou et al., 2016b). The estimated flow field essentially captures the amount of spatial transformation required to fool the classifier.
|
| 77 |
+
|
| 78 |
+
Objective function Most of the previous methods constrain the added perturbation to be small regarding a ${ \mathcal { L } } _ { p }$ metric. Here instead of imposing the ${ \mathcal { L } } _ { p }$ norm on pixel space, we introduce a new regularization loss $\mathcal { L } _ { f l o w }$ on the local distortion $f$ , producing higher perceptual quality for adversarial examples. Therefore, the goal of the attack is to generate adversarial examples which can mislead the classifier as well as minimizing the local distortion introduced by the flow field $f$ .
|
| 79 |
+
|
| 80 |
+
Formally, given a benign instance $\mathbf { x }$ , we obtain the flow field $f$ by minimize the following objective:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
f ^ { * } = \underset { f } { \mathrm { a r g m i n } } \quad \mathcal { L } _ { a d v } ( x , f ) + \tau \mathcal { L } _ { f o w } ( f ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\mathcal { L } _ { a d v }$ encourages the generated adversarial examples to be misclassified by the target classifier. $L _ { f l o w }$ ensures that the spatial transformation distance is minimized to preserve high perceptual quality, and $\tau$ balances these two losses.
|
| 87 |
+
|
| 88 |
+
The goal of $\mathcal { L } _ { a d v }$ is to guarantee the targeted attack $g ( \mathbf { x } _ { \mathrm { a d v } } ) ~ = ~ t$ where $t$ is the targeted class, different from the ground truth label $y$ . Recall that we transform the input image $\mathbf { x }$ to $\mathbf { x } _ { \mathrm { a d v } }$ with the flow field $f$ (Equation 1). In practice, directly enforcing $g ( \mathbf { x } _ { \mathrm { a d v } } ) = t$ during optimization is highly non-linear, we adopt the objective function suggested in Carlini & Wagner (2017a).
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathcal { L } _ { a d v } ( x , f ) = \operatorname* { m a x } ( \operatorname* { m a x } _ { i \neq t } g ( \mathbf { x } _ { \mathrm { a d v } } ) _ { i } - g ( \mathbf { x } _ { \mathrm { a d v } } ) _ { t } , \kappa ) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $g ( x )$ represents the logit output of model $g , g ( x ) _ { i }$ denotes the $i$ -th element of the logit vector, and $\kappa$ is used to control the attack confidence level.
|
| 95 |
+
|
| 96 |
+
To compute ${ \mathcal { L } } _ { f l o w }$ , we calculate the sum of spatial movement distance for any two adjacent pixels. Given an arbitrary pixel $p$ and its neighbors $q \in \mathcal { N } ( p )$ , we enforce the locally smooth spatial transformation perturbation $\mathcal { L } _ { f l o w }$ based on the total variation (Rudin et al., 1992):
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathcal { L } _ { f l o w } ( f ) = \sum _ { p } ^ { a l l p i x e l s } \sum _ { q \in N ( p ) } \sqrt { | | \Delta u ^ { ( p ) } - \Delta u ^ { ( q ) } | | _ { 2 } ^ { 2 } + | | \Delta v ^ { ( p ) } - \Delta v ^ { ( q ) } | | _ { 2 } ^ { 2 } } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Intuitively, minimizing the spatial transformation can help ensure the high perceptual quality for stAdv, since adjacent pixels tend to move towards close direction and distance. We solve the above optimization with L-BFGS solver (Liu & Nocedal, 1989).
|
| 103 |
+
|
| 104 |
+
# 4 EXPERIMENTAL RESULTS
|
| 105 |
+
|
| 106 |
+
In this section, we first show adversarial examples generated by the proposed spatial transformation method and analyze the properties of these examples from different perspectives. We then visualize the estimated flows for adversarial examples and show that with small and smooth transformation, the generated adversarial examples can already achieve a high attack success rate against deep networks. We also show that stAdv can preserve a high attack success rate against current defense methods, which motivates more sophisticated defense methods in the future. Finally, we analyze the attention regions of DNNs, to better understand the attack properties of stAdv.
|
| 107 |
+
|
| 108 |
+
Experiment Setup We set $\tau$ as 0.05 for all our experiments. We use confidence $\kappa = 0$ for both C&W and stAdv for a fair comparison. We leverage L-BFGS (Liu & Nocedal, 1989) as our solver with backtracking linear search.
|
| 109 |
+
|
| 110 |
+
# 4.1 ADVERSARIAL EXAMPLES BASED ON SPATIAL TRANSFORMATIONS
|
| 111 |
+
|
| 112 |
+
We show adversarial examples with high perceptual quality for both MNIST (LeCun & Cortes, 1998) and CIFAR-10 (Krizhevsky et al., 2014) datasets.
|
| 113 |
+
|
| 114 |
+
stAdv on MNIST In our experiments, we generate adversarial examples againsts three target models in the white-box setting on the MNIST dataset. Model A, B, and C are derived from the prior work (Tramèr et al., 2017), which represent different architectures. See Appendix A and Table 4 for more details about their network architectures. Table 1 presents the accuracy of pristine MNIST test data on each model as well as the attack success rate of adversarial examples generated by stAdv on these models. Figure 2 shows the adversarial examples against different models where the original instances appear in the diagonal. Each adversarial example achieves a targeted attack, with the target class shown on the top of the column. It is clear that the generated adversarial examples still appear to be in the same class as the original instance for humans. Another advantage for stAdv compared with traditional attacks is that examples based on stAdv seldom show noise pattern within the adversarial examples. Instead, stAdv smoothly deforms the digits and since such natural deformation also exists in the dataset digits, humans can barely notice such manipulation.
|
| 115 |
+
|
| 116 |
+
Table 1: Top: accuracy of different models on pristine data (p); bottom: attack success rates of adversarial examples generated by stAdv on MNIST dataset.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Model</td><td>A</td><td>B</td><td>C</td></tr><tr><td>Accuracy (p)</td><td>98.58%</td><td>98.94%</td><td>99.11%</td></tr><tr><td>Attack Success Rate</td><td>99.95%</td><td>99.98%</td><td>100.00%</td></tr></table>
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 2: Adversarial examples generated by stAdv against different models on MNIST. The ground truth images are shown in the diagonal and the rest are adversarial examples that are misclassified to the target classes shown on the top.
|
| 122 |
+
|
| 123 |
+
stAdv on CIFAR-10 For CIFAR-10, we use ResNet- $3 2 ^ { 1 }$ and wide ResNet- $3 4 ^ { 2 }$ as the target classifers (Zagoruyko & Komodakis, 2016; He et al., 2016; M ˛adry et al., 2017). We show the classification accuracy of pristine CIFAR-10 test data (p) and attack success rates of adversarial examples generated by stAdv on different models in Table 2. Figure 3 shows the generated examples on CIFAR-10 against different models. The original images are shown in the diagonal. The other images are targeted adversarial examples, with the index of the target classes shown at the top of the column. Here we use $^ { 6 6 } 0 { - } 9 ^ { 7 }$ to denote the ground truth labels of images lying in the diagonal for each corresponding column. These adversarial examples based on stAdv are randomly selected from the instances that can successfully attack the corresponding classifier. Humans can hardly distinguish these adversarial examples from the original instances.
|
| 124 |
+
|
| 125 |
+
Table 2: Top: accuracy of different models on pristine data (p); bottom: attack success rates of adversarial examples generated by stAdv on the CIFAR-10 dataset. The numbers in parentheses denote the number of parameters in each target model.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Model</td><td>ResNet32 (0.47M)</td><td>Wide ResNet34 (46.16M)</td></tr><tr><td>Accuracy (p)</td><td>93.16%</td><td>95.82%</td></tr><tr><td>Attack Success Rate</td><td>99.56%</td><td>98.84%</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Comparison of different adversarial examples In Figure 4, we show adversarial examples that are targeted attacked to the same class (“0” for MNIST and “airplane” for CIFAR-10), which is different from their ground truth. We compare adversarial examples generated from different methods and show that those based on stAdv look more visually realistic compared with FGSM (Goodfellow et al., 2015) and C&W (Carlini & Wagner, 2017b) methods.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: Adversarial examples generated by stAdv against different models on CIFAR-10. The ground truth images are shown in the diagonal while the adversarial examples on each column are classified into the same class as the ground truth image within that column.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 4: Comparison of adversarial examples generated by FGSM, C&W and stAdv. (Left: MNIST, right: CIFAR-10) The target class for MNIST is $ { { } ^ { 6 } } { 0 ^ { 9 } }$ and “air plane” for CIFAR-10. We generate adversarial examples by FGSM and C&W with perturbation bounded in terms of $L _ { \infty }$ as 0.3 on MNIST and 8 on CIFAR-10.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: Flow visualization on MNIST. A digit “0” is misclassified as “2”.
|
| 139 |
+
|
| 140 |
+
# 4.2 VISUALIZING SPATIAL TRANSFORMATION
|
| 141 |
+
|
| 142 |
+
To better understand the spatial transformation applied to the original images, we visualize the optimized transformation flow for different datasets, respectively. Figure 5 visualizes a transformation on an MNIST instance, where the digit $\mathbf { \bar { \theta } } ^ { 6 } 0 ^ { 9 }$ is misclassified as “2.” We can see that the adjacent flows move in a similar direction in order to generate smooth results. The flows are more focused on the edge of the digit and sometimes these flows move in different directions along the edge, which implies that the object boundary plays an important role in our stAdv optimization. Figure 6 illustrates a similar visualization on CIFAR-10. It shows that the optimized flows often focus on the area of the main object, such as the airplane. We also observe that the magnitude of flows near the edge are usually larger, which similarly indicates the importance of edges for misleading the classifiers. This observation confirms the observation that when DNNs extract edge information in the earlier layers for visual recognition tasks (Viterbi, 1998). In addition, we visualize the similar flow for the ImageNet dataset (Deng et al., 2009) in Figure 7. The top-1 label of the original image in Figure 7 (a) is “mountain bike”. Figure 7 (b)-(d) show targeted adversarial examples generated by stAdv, which have target classes “goldfish,” “Maltese dog,” and “tabby cat,” respectively, and which are predicted as such as the top-1 class. An interesting observation is that, although there are other objects within the image, nearly $90 \%$ of the spatial transformation flows tend to focus on the target object bike. Different target class corresponds to different directions for these flows, which still fall into the similar area.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: Flow visualization on CIFAR-10. An “airplane” image is misclassified as “bird”.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 7: Flow visualization on ImageNet. (a): the original image, (b)-(c): images are misclassified into goldfish, dog and cat, respectively. Note that to display the flows more clearly, we fade out the color of the original image.
|
| 149 |
+
|
| 150 |
+
# 4.3 HUMAN PERCEPTUAL STUDY
|
| 151 |
+
|
| 152 |
+
To quantify the perceptual realism of stAdv’s adversarial examples, we perform a user study with human participants on Amazon Mechanical Turk (AMT). We follow the same perceptual study protocol used in prior image synthesis work (Zhang et al., 2016; Isola et al., 2017). We generate 600 images from an ImageNet-compatible dataset, described in Appendix C. In our study, the participants are asked to choose the more visually realistic image between an adversarial example generated by stAdv and its original image. During each trial, these two images appear side-by-side for 2 seconds. After the images disappear, our participants are given unlimited time to make their decision. To avoid labeling bias, we allow each user to conduct at most 50 trails. For each pair of an original image and its adversarial example, we collect about 5 annotations from different users.
|
| 153 |
+
|
| 154 |
+
In total, we collected 2, 740 annotations from 93 AMT users. Examples generated by our method were chosen as the more realistic in $4 7 . 0 1 \% \pm 1 . 9 6 \%$ of the trails (perfectly realistic results would achieve $5 0 \%$ ). This indicates that our adversarial examples are almost indistinguishable from natural images.
|
| 155 |
+
|
| 156 |
+
Table 3: Attack success rates of adversarial examples generated by stAdv against models A, B, and C on MNIST, and against ResNet and wide ResNet on CIFAR-10, under standard defenses.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Model</td><td>Def.</td><td>FGSM</td><td>C&W.</td><td>stAdv</td></tr><tr><td rowspan="3">A</td><td>Adv.</td><td>4.3%</td><td>4.6%</td><td>32.62%</td></tr><tr><td>Ens.</td><td>1.6%</td><td>4.2%</td><td>48.07%</td></tr><tr><td>PGD</td><td>4.4%</td><td>2.96%</td><td>48.38%</td></tr><tr><td rowspan="3">B</td><td>Adv.</td><td>6.0%</td><td>4.5%</td><td>50.17%</td></tr><tr><td>Ens.</td><td>2.7%</td><td>3.18%</td><td>46.14%</td></tr><tr><td>PGD</td><td>9.0%</td><td>3.0%</td><td>49.82%</td></tr><tr><td rowspan="3">C</td><td>Adv.</td><td>3.22%</td><td>0.86%</td><td>30.44%</td></tr><tr><td>Ens.</td><td>1.45%</td><td>0.98%</td><td>28.82%</td></tr><tr><td>PGD</td><td>2.1%</td><td>0.98%</td><td>28.13%</td></tr></table>
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Model</td><td>Def.</td><td>FGSM</td><td>C&W.</td><td>stAdv</td></tr><tr><td rowspan="2">ResNet32</td><td>Adv.</td><td>13.10%</td><td>11.9%</td><td>43.36%</td></tr><tr><td>Ens. PGD</td><td>10.00% 22.8%</td><td>10.3% 21.4%</td><td>36.89% 49.19%</td></tr><tr><td rowspan="4">wide ResNet34</td><td>Adv.</td><td>5.04%</td><td>7.61%</td><td>31.66%</td></tr><tr><td>Ens.</td><td>4.65%</td><td>8.43%</td><td>29.56%</td></tr><tr><td>PGD</td><td>14.9%</td><td>13.90%</td><td></td></tr><tr><td></td><td></td><td></td><td>31.6%</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 4.4 ATTACK EFFICIENCY UNDER DEFENSE METHODS
|
| 163 |
+
|
| 164 |
+
Here we generate adversarial examples in the white-box setting and test different defense methods against these samples to evaluate the strength of these attacks under defenses.
|
| 165 |
+
|
| 166 |
+
We mainly focus on the adversarial training defenses due to their state-of-the-art performance. We apply three defense strategies in our evaluation: the FGSM adversarial training (Adv.) (Goodfellow et al., 2015), ensemble adversarial training (Ens.) (Tramèr et al., 2017), and projectile gradient descent (PGD) adversarial training (M ˛adry et al., 2017) methods. For adversarial training purposes, we generate adversarial examples based on $L _ { \infty }$ bound (Carlini & Wagner, 2017a) as 0.3 on MNIST and 8 on CIFAR-10. We test adversarial examples generated against model A, B, and C on MNIST as shown in Table 4, and similarly adversarial examples generated against ResNet32 and wide ResNet34 on CIFAR-10.
|
| 167 |
+
|
| 168 |
+
The results on the MNIST and CIFAR-10 datasets are shown in Table 3. We observe that the three defense strategies can achieve high performance (less than $10 \%$ attack success rate) against FGSM and C&W attacks.
|
| 169 |
+
|
| 170 |
+
These defense methods only achieve low defense performance on stAdv, which improve the attack success rate to more than $3 0 \%$ among all defense strategies. These results indicate that new type of adversarial strategy, such as our spatial transformation-based attack, may open new directions for developing better defense systems. However, for stAdv, we cannot use ${ \mathcal { L } } _ { p }$ norm to bound the distance as translating an image by one pixel may introduce large ${ \mathcal { L } } _ { p }$ penalty. We instead constrain the spatial transformation flow and show that our adversarial examples have high perceptual quality in Figures 2, 3, and 4 as well as Section 4.3.
|
| 171 |
+
|
| 172 |
+
Mean blur defense We also test our adversarial examples against the $3 { \times } 3$ average pooling restoration mechanism (Li & Li, 2016). Table 5 in Appendix B shows the classification accuracy of recovered images after performing $3 \times 3$ average filter on different models. We find that the simple $3 \times 3$ average pooing restoration mechanism can recover the original class from fast gradient sign examples and improve the classification accuracy up to around $70 \%$ . Carlini & Wagner have also shown that such mean blur defense strategy can defend against adversarial examples generated by their attack and improve the model accuracy to around $80 \%$ (2017b). From Table 5, we can see that the mean blur defense method can only improve the model accuracy to around $50 \%$ on stAdv examples, which means adversarial examples generated by stAdv are more robust compared to other attacks. We also perform a perfect knowledge adaptive attack against the mean blur defense following the same attack strategy suggested in (Carlini & Wagner, 2017b), where we add the $3 \times 3$ average pooling layer into the original network and apply stAdv to attack the new network again. We observe that the success rate of an adaptive attack is nearly $100 \%$ , which is consistent with Carlini & Wagner’s findings (2017b).
|
| 173 |
+
|
| 174 |
+
# 4.5 VISUALIZING ATTENTION OF NETWORKS ON ADVERSARIAL EXAMPLES
|
| 175 |
+
|
| 176 |
+
In addition to the analyzing adversarial examples themselves, in this section, we further characterize these spatially transformed adversarial examples from the perspective of deep neural networks.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 8: CAM attention visualizations for ImageNet inception_v3 model. (a) the original image and (b)-(d) stAdv adversarial examples targeting different classes. The second row shows the attention visualizations for the corresponding images displayed above.
|
| 180 |
+
|
| 181 |
+
Here we apply Class Activation Mapping (CAM) (Zhou et al., 2016a), an implicit attention visualization technique for localizing the discriminative regions implicitly detected by a DNN. We use it to show the attention of the target ImageNet inception_v3 model (Szegedy et al., 2016)) for both original images and generated adversarial examples. Figure 8(a) shows an input bike image and Figure 8(b)–(d) show the targeted adversarial examples based on stAdv targeting three different classes (goldfish, dog, and cat). Figure 8(e) illustrates that the target model draws attention to the bicycle region. Interestingly, attention regions on examples generated by stAdv varies for different target classes as shown in Figure 8(f)–(h). Though humans can barely distinguish between the original image and the ones generated by stAdv, CAM map focus on completely different regions, implying that our attack can mislead the network’s attention.
|
| 182 |
+
|
| 183 |
+
In addition, we also compare and visualize the attention regions of both naturally trained and the adversarial trained inception_v3 model3 on adversarial images generated by different attack algorithms (Figure 9). The ground truth top-1 label is “cinema,” so the attention region for the original image (Figure 9 (a)) includes both tower and building regions. However, when the adversarial examples are targeted attacked into the adversarial label “missile,” the attention region focuses on only the tower for all the attack algorithms as shown in Figure 9 (b)-(d) with slight different attention region sizes. More interestingly, we also test these adversarial examples on the public adversarial trained robust inception_v3 model. The result appears in Figure 9 (f)–(h). This time, the attention regions are drawn to the building again for both FGSM and C&W methods, which are close to the attention regions of the original image. The top-1 label for Figure 9 (f) and (g) are again the ground truth “cinema”, which means both FGSM and C&W fail to attack the robust model. However, Figure 9 (h) is still misclassified as “missile” under the robust model and the CAM visualization shows that the attention region still focuses on the tower. This example again implies that adversarial examples generated by stAdv are challenging to defend for the current “robust” ImageNet models.
|
| 184 |
+
|
| 185 |
+
# 5 CONCLUSIONS
|
| 186 |
+
|
| 187 |
+
Different from the previous works that generate adversarial examples by directly manipulating pixel values, in this work we propose a new type of perturbation based on spatial transformation, which aims to preserve high perceptual quality for adversarial examples. We have shown that adversarial examples generated by stAdv are more difficult for humans to distinguish from original instances.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 9: CAM attention visualizations for ImageNet inception_v3 model. The first column shows the CAM maps corresponding to the original images. Column 2-4 show the adversarial examples generated by different methods. The visualizations are drawn for Row 1 (inception_v3 model) and Row 2 (adversarial trained inception_v3 model). (a) and (e)-(g) are labeled as the ground truth “cinema”, while (b)-(d) and (h) are labeled as the adversarial target “missile.”
|
| 191 |
+
|
| 192 |
+
We also analyze the attack success rate of these examples under existing defense methods and demonstrate they are harder to defend against, which opens new directions for developing more robust defense algorithms. Finally, we visualize the attention regions of DNNs on our adversarial examples to better understand this new attack.
|
| 193 |
+
|
| 194 |
+
# ACKNOWLEDGMENTS
|
| 195 |
+
|
| 196 |
+
We thank Zhuang Liu, Richard Shin, Kun Jin, Armin Sarabi and George Philipp for their valuable discussions on this work. This work was supported in part by Berkeley Deep Drive, the Center for Long-Term Cybersecurity, and FORCES (Foundations Of Resilient CybEr-Physical Systems), which receives support from the National Science Foundation (NSF award numbers CNS-1238959, CNS-1238962, CNS-1239054, CNS-1239166), and NSF under grants CNS-1422211 and CNS1616575.
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndic, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 387– 402. Springer, 2013.
|
| 201 |
+
|
| 202 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, 2017, 2017a.
|
| 203 |
+
|
| 204 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. arXiv preprint arXiv:1705.07263, 2017b.
|
| 205 |
+
|
| 206 |
+
Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pp. 160–167. ACM, 2008.
|
| 207 |
+
|
| 208 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pp. 248–255. IEEE, 2009.
|
| 209 |
+
|
| 210 |
+
Ivan Evtimov, Kevin Eykholt, Earlence Fernandes, Tadayoshi Kohno, Bo Li, Atul Prakash, Amir Rahmati, and Dawn Song. Robust physical-world attacks on machine learning models. arXiv preprint arXiv:1707.08945, 2017.
|
| 211 |
+
|
| 212 |
+
Alhussein Fawzi and Pascal Frossard. Manitest: Are classifiers really invariant? arXiv preprint arXiv:1507.06535, 2015.
|
| 213 |
+
|
| 214 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015.
|
| 215 |
+
|
| 216 |
+
Kathrin Grosse, Nicolas Papernot, Praveen Manoharan, Michael Backes, and Patrick McDaniel. Adversarial perturbations against deep neural networks for malware classification. arXiv preprint arXiv:1606.04435, 2016.
|
| 217 |
+
|
| 218 |
+
Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Warren He, James Wei, Xinyun Chen, Nicholas Carlini, and Dawn Song. Adversarial example defenses: Ensembles of weak defenses are not strong. arXiv preprint arXiv:1706.04701, 2017.
|
| 223 |
+
|
| 224 |
+
Geoffrey Hinton, Li Deng, Dong Yu, George E Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara N Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, 2012.
|
| 225 |
+
|
| 226 |
+
Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
|
| 227 |
+
|
| 228 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. CVPR, 2017.
|
| 229 |
+
|
| 230 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In NIPS, pp. 2017–2025, 2015.
|
| 231 |
+
|
| 232 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, 2016.
|
| 233 |
+
|
| 234 |
+
Can Kanbak. Measuring robustness of classifiers to geometric transformations. Technical report, 2017.
|
| 235 |
+
|
| 236 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 237 |
+
|
| 238 |
+
Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. The cifar-10 dataset. online: http://www. cs. toronto. edu/kriz/cifar. html, 2014.
|
| 239 |
+
|
| 240 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 241 |
+
|
| 242 |
+
Yann LeCun and Corrina Cortes. The MNIST database of handwritten digits. 1998.
|
| 243 |
+
|
| 244 |
+
Xin Li and Fuxin Li. Adversarial examples detection in deep networks with convolutional filter statistics. arXiv preprint arXiv:1612.07767, 2016.
|
| 245 |
+
|
| 246 |
+
Dong C Liu and Jorge Nocedal. On the limited memory bfgs method for large scale optimization. Mathematical programming, 45(1):503–528, 1989.
|
| 247 |
+
|
| 248 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. In ICLR, 2017.
|
| 249 |
+
|
| 250 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. arXiv preprint arXiv:1511.04599, 2015.
|
| 251 |
+
|
| 252 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. arXiv preprint arXiv:1610.08401, 2016.
|
| 253 |
+
|
| 254 |
+
Konda Reddy Mopuri, Utsav Garg, and R Venkatesh Babu. Fast feature fool: A data independent approach to universal adversarial perturbations. arXiv preprint arXiv:1707.05572, 2017.
|
| 255 |
+
|
| 256 |
+
Aleksander M ˛adry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv:1706.06083 [cs, stat], June 2017.
|
| 257 |
+
|
| 258 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016a.
|
| 259 |
+
|
| 260 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In 2016 IEEE European Symposium on Security and Privacy (EuroS&P), pp. 372–387. IEEE, 2016b.
|
| 261 |
+
|
| 262 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pp. 582–597. IEEE, 2016c.
|
| 263 |
+
|
| 264 |
+
Leonid I Rudin, Stanley Osher, and Emad Fatemi. Nonlinear total variation based noise removal algorithms. Physica D: Nonlinear Phenomena, 60(1-4):259–268, 1992.
|
| 265 |
+
|
| 266 |
+
Claude E Shannon. Communication theory of secrecy systems. Bell Labs Technical Journal, 28(4): 656–715, 1949.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014.
|
| 271 |
+
|
| 272 |
+
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.
|
| 273 |
+
|
| 274 |
+
Richard Szeliski. Computer vision: algorithms and applications. Springer Science & Business Media, 2010.
|
| 275 |
+
|
| 276 |
+
Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 277 |
+
Andrew J. Viterbi. An intuitive justification and a simplified implementation of the map decoder for convolutional codes. IEEE Journal on Selected Areas in Communications, 16(2):260–264, 1998.
|
| 278 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
|
| 279 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 280 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European Conference on Computer Vision, pp. 649–666. Springer, 2016.
|
| 281 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921–2929, 2016a.
|
| 282 |
+
Tinghui Zhou, Shubham Tulsiani, Weilun Sun, Jitendra Malik, and Alexei A Efros. View synthesis by appearance flow. In ECCV, pp. 286–301. Springer, 2016b.
|
| 283 |
+
|
| 284 |
+
# A MODEL ARCHITECTURES
|
| 285 |
+
|
| 286 |
+
Table 4: Architecture of models applied on MNIST
|
| 287 |
+
|
| 288 |
+
<table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>Conv(64,5,5) + Relu</td><td>Conv(64,8,8) + Relu</td><td>Conv(128,3,3) + Relu</td></tr><tr><td>Conv(64,5,5) + Relu</td><td>Dropout(0.2)</td><td>Conv(64,3,3) +Relu</td></tr><tr><td>Dropout(0.25)</td><td>Conv(128,6,6)+Relu</td><td>Dropout(0.25)</td></tr><tr><td>FC(128) + Relu</td><td>Conv(128,5,5) +Relu</td><td>FC(128) +Relu</td></tr><tr><td>Dropout(0.5)</td><td>Dropout(0.5)</td><td>Dropout(0.5)</td></tr><tr><td>FC(10) + Softmax</td><td>FC(10) +Softmax</td><td>FC(10)+Softmax</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# B ANALYSIS FOR MEAN BLUR DEFENSE
|
| 291 |
+
|
| 292 |
+
Here we evaluated adversarial examples generated by stAdv against the $3 \times 3$ average pooling restoration mechanism suggested in Li & Li (2016). Table 5 shows the classification accuracy of recovered images after performing $3 \times 3$ average pooling on different models.
|
| 293 |
+
|
| 294 |
+
Table 5: Performance of adversarial examples against the mean blur defense strategy with $3 \times 3$ mean filter.
|
| 295 |
+
|
| 296 |
+
<table><tr><td>Accuracy on recovered images</td><td>A</td><td>MNIST B</td><td>C</td><td>CIFAR-10 Resnet32 wide ResNet34</td></tr><tr><td>3 × 3 Average Filter</td><td>59.00%</td><td>64.22%</td><td>79.71%</td><td>45.12%</td><td>50.12%</td></tr></table>
|
| 297 |
+
|
| 298 |
+
# C ADVERSARIAL EXAMPLES FOR AN IMAGENET-COMPATIBLE SET, MNIST, AND CIFAR-10
|
| 299 |
+
|
| 300 |
+
Experiment settings. In the following experiments, we perform a grid search of hyper-parameter $\tau$ so that the adversarial examples can attack the target model with minimal deformation. Values of $\tau$ are searched from 0.0005 to 0.05.
|
| 301 |
+
|
| 302 |
+
ImageNet-compatible. We use benign images from the DEV set from the NIPS 2017 targeted adversarial attack competition.4 This competition provided a dataset compatible with ImageNet and containing target labels for a targeted attack. We generate targeted adversarial examples for the target inception_v3 model. In Figure 10 below, we show the original images on the left with the correct label, and we show adversarial examples generated by stAdv on the right with the target label.
|
| 303 |
+
|
| 304 |
+
MNIST. We generate adversarial examples for the target Model B. In Figure 11, we show original images with ground truth classes 0–9 in the diagonal, and we show adversarial examples generated by stAdv targeting the class of the original image within that column.
|
| 305 |
+
|
| 306 |
+
CIFAR-10. We generate adversarial examples for the target ResNet-32 model. In Figure 12, we show the original images in the diagonal, and we show adversarial examples generated by stAdv targeting the class of the original image within that column.
|
| 307 |
+
|
| 308 |
+
Table 6 shows the magnitude of the generated flow regarding total variation (TV) and $\mathcal { L } _ { 2 }$ distance on the ImageNet-compatible set, MNIST, CIFAR-10, respectively. These metrics are calculated by the following equations, where $n$ is the number of pixels:
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\mathrm { T V } = \sqrt { \frac { 1 } { n } \sum _ { p } ^ { a l l p i c e l s } \sum _ { q \in \mathcal { N } ( p ) } | | \Delta u ^ { ( p ) } - \Delta u ^ { ( q ) } | | _ { 2 } ^ { 2 } + | | \Delta v ^ { ( p ) } - \Delta v ^ { ( q ) } | | _ { 2 } ^ { 2 } } .
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\mathcal { L } _ { 2 } = \sqrt { \frac { 1 } { n } \sum _ { p } ^ { a l l p i x e l s } | | \Delta u ^ { ( p ) } | | _ { 2 } ^ { 2 } + | | \Delta v ^ { ( p ) } | | _ { 2 } ^ { 2 } }
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
Table 6: Evaluation Metric (the number in bracket is image size)
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Metric</td><td>ImageNet-compatible (299x299)</td><td>MNIST (28x28)</td><td>CIFAR-10 (32x32)</td></tr><tr><td>flow TV</td><td>2.85×10-4±7.28×10-5</td><td>8.26×10-3±4.95×10-3</td><td>2.21× 10-3±1.26×10-3</td></tr><tr><td>flow L2</td><td>2.11 × 10-4 ±5.19 × 10-5</td><td>5.18 × 10-² ± 5.66 × 10-2</td><td>2.76 × 10-3± 2.31 × 10-3</td></tr></table>
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
(a) Benign image (labeled as dung beetle)
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
(c) Benign image (labeled as jeep)
|
| 329 |
+
(e) Benign image (labeled as bull mastiff)
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
(b) Adversarial image (labeled as scale)
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
(d) Adversarial image (labeled as coil)
|
| 338 |
+
(f) Adversarial image (labeled as American lobster)
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
(g) Benign image (labeled as buckeye)
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
(i) Benign image (labeled as thatch)
|
| 347 |
+
(k) Benign image (labeled as beaker)
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
(h) Adversarial image (labeled as goose)
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
(j) Adversarial image (labeled as miniature poodle)
|
| 356 |
+
(l) Adversarial image (labeled as padlock)
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
(m) Benign image (labeled as strawberry)
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
(o) Benign image (labeled as folding chair)
|
| 365 |
+
(q) Benign image (labeled as jeep)
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
(n) Adversarial image (labeled as tench)
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
(p) Adversarial image (labeled as power drill)
|
| 374 |
+
(r) Adversarial image (labeled as house finch)
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 10: Examples from an ImageNet-compatible set. Left: original image; right: adversarial image generated by stAdv against inception_v3.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 11: Adversarial examples generated by stAdv against Model B on MNIST. The original images are shown in the diagonal; the rest are adversarial examples that are classified into the same class as the original image within that column.
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 12: Adversarial examples generated by stAdv against a ResNet-32 on CIFAR-10. The original images are shown in the diagonal; the rest are adversarial examples that are classified into the same class as the original image within that column.
|
md/train/S1eYKlrYvr/S1eYKlrYvr.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIAGNOSING THE ENVIRONMENT BIAS IN VISION-AND-LANGUAGE NAVIGATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Vision-and-Language Navigation (VLN) requires an agent to follow naturallanguage instructions, explore the given environments, and reach the desired target locations. These step-by-step navigational instructions are extremely useful in navigating new environments that the agent does not know about previously. Most recent works that study VLN observe a significant performance drop when tested on unseen environments (i.e., environments not used in training), indicating that the neural agent models are highly biased towards training environments. Although this issue is considered as one of the major challenges in VLN research, it is still under-studied and needs a clearer explanation. In this work, we design novel diagnosis experiments via environment re-splitting and feature replacement, looking into possible reasons for this environment bias. We observe that neither the language nor the underlying navigational graph, but the low-level visual appearance conveyed by ResNet features directly affects the agent model and contributes to this environment bias in results. According to this observation, we explore several kinds of semantic representations which contain less low-level visual information, hence the agent learned with these features could be better generalized to unseen testing environments. Without modifying the baseline agent model and its training method, our explored semantic features significantly decrease the performance gap between seen and unseen on multiple datasets (i.e., $8 . 6 \%$ to $0 . 2 \%$ on R2R, $2 3 . 9 \%$ to $0 . 1 \%$ on R4R, and 3.74 to 0.17 on CVDN) and achieve competitive unseen results to previous state-of-the-art models.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Vision-and-Language Navigation (VLN) tests an agent’s ability to follow complex natural language instructions as well as explore the given environments, so as to be able to reach the desired target locations. As shown in Fig. 1, the agent is put in an environment and given a detailed step-by-step navigational instruction. With these inputs, the agent needs to navigate the environment and find the correct path to the target location. In this work, we focus on the instruction-guided navigation (MacMahon et al., 2006; Anderson et al., 2018b; Misra et al., 2018; Blukis et al., 2018; Chen et al., 2019c) where detailed step-by-step navigational instructions are used (e.g., ‘Go outside the dining room and turn left ...’), in contrast to the target-oriented navigation (Gordon et al., 2018; Das et al., 2018; Mirowski et al., 2018; Yu et al., 2019) where only the target is referred (e.g., ‘Go to the kitchen’ or ‘Tell me the color of the bedroom’). Although these step-by-step instructions are overdetailed when navigating local areas (e.g., your home), they are actively used in unseen environments (e.g., your friend’s house, a new city) where the desired target is usually unknown to navigational agents. For this purpose, testing on unseen environments which are not used during agent-training is important and widely accepted by instruction-guided navigation datasets.
|
| 12 |
+
|
| 13 |
+
Recent works propose different methods to improve generalizability of agents on these unseen testing environments; and most of the existing works (Anderson et al., 2018b; Wang et al., 2018b; Fried et al., 2018; Wang et al., 2019b; Ma et al., 2019a;b; Tan et al., 2019; Huang et al., 2019; Hu et al., 2019) observe a significant performance drop from seen environments (i.e., the environments used in training) to unseen environments (i.e., the environments not used in training), which indicates a strong bias in the model towards the training environments. While this performance gap is emphasized as one of the major challenges in current VLN research, the issue is still left unresolved and waits for an explicit explanation. Thus, in this paper, we aim to answer three questions to this environment bias: 1. Where (i.e., in which component) is the bias located? 2. Why does this bias exist? 3. How to eliminate this bias?
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Vision-language-navigation: performance of the agent drops in unseen environments.
|
| 17 |
+
|
| 18 |
+
To locate where the bias is, we start by showing that natural-language navigational instructions and underlying navigational graphs are not direct reasons for this performance gap. We then investigate the effect of environments on the agent’s performance. In order to conduct a detailed analysis, we resplit the environment and categorize the validation data into three sets based on their visibility to the training set: path-seen data intersecting with the training paths, path-unseen data using the training environments but away from the training paths, and env-unseen data using unseen environments (environments not used in training). By showing that the results gradually decrease from path-seen data to env-unseen data, we characterize the environment bias at three levels: path level, region level, and environment level.
|
| 19 |
+
|
| 20 |
+
These three levels of environment biases indicate strong ‘spatial localities’ in the tasks of VLN, which are intuitively reasonable because environments and regions (e.g., houses and cities) usually have their own styles when built or decorated. We next want to analyze the detailed reason why this locality would further lead to a gap in seen versus unseen results. Our hypothesis is that the low-level information carried by the ResNet features (He et al., 2016) is the reason. To keep minimal low-level visual information and promote more high-level semantic information, we replace the ResNet features with the 1000 ImageNet classification probabilities. Although the semantic information encoded by these features is not accurate because of the shifted domain of images and labels, the same model with ImageNet-Labels features performs surprisingly well on various VLN datasets (i.e., Room-to-Room, R4R, and $\mathrm { C V D N ^ { 1 } }$ ). Most importantly, these noisy semantic features effectively eliminate the performance gap between seen and unseen environments, which suggests that the environment bias is attributed to the ResNet features as our hypothesis.
|
| 21 |
+
|
| 22 |
+
Following the practice in using ImageNet labels as semantic features, we further provide a discussion on how the environment bias could be eliminated. For this, we employ advanced high-level semantic features which are more rational for the VLN domain. We explore three kinds of semantic features: (1) areas of detected object labels (Ren et al., 2015); (2) ground truth semantic views (Chang et al., 2017); and (3) learned semantic view features. We show that all of these semantic features significantly reduce the environment bias in multiple datasets and also achieve strong results in testing unseen environments. We hope this work encourages more investigation and research into improving the generalization of vision-language models to unseen real-world scenarios.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Vision-and-Language Navigation: Vision-and-language navigation is an emerging task in the vision-and-language area. A lot of datasets have been proposed in recent years, such as Roomto-Room (Anderson et al., 2018b), Room-for-Room (Jain et al., 2019), TouchDown (Chen et al., 2019c), CVDN (Thomason et al., 2019b), RERERE (Qi et al., 2019), House3D (Wu et al., 2018) and EQA (Das et al., 2018). Recent works (Thomason et al., 2019a; Wang et al., 2018b; Fried et al.,
|
| 27 |
+
|
| 28 |
+
2018; Wang et al., 2019b; Ma et al., 2019a;b; Tan et al., 2019; Hu et al., 2019; Ke et al., 2019; Anderson et al., 2019) focusing on improving the performance of navigation models, especially in unseen testing environments, have helped to increase the navigational success rate.
|
| 29 |
+
|
| 30 |
+
Domain Adaptation: The general setup of domain adaption contains two sets of data samples $\{ x _ { i } \} _ { x _ { i } \in X }$ and $\{ y _ { i } \} _ { y _ { i } \in Y }$ from two domains $X$ and $Y$ . Based on these samples, we could learn domain invariant feature with adversarial training (Goodfellow et al., 2014; Zhu et al., 2017; Long et al., 2018; Wang et al., 2019a; Hosseini-Asl et al., 2019; Zhang et al., 2019; Gong et al., 2019; Chen et al., 2019b) or learn a transfer function $f : X \to Y$ (Wang et al., 2018a; Chen et al., 2019a; Rozantsev et al., 2018). However, samples from the target domain may not be available (e.g., the testing environments in navigation should not be used in training) in applications. Thus, we try to give an interpretable explanation to why performance varies in different domains and design a robust feature for it without deliberately considering the target domain. Two methods in VLN, RCM (Wang et al., 2019b) and EnvDrop (Tan et al., 2019), explore the possibility of domain adaptation. Both works take the testing environments in training while RCM also uses testing instructions.
|
| 31 |
+
|
| 32 |
+
Domain Generalization: In domain generalization (Blanchard et al., 2011), the goal is to predict the labels in the previous unseen domain. Similar to the test setting of VLN tasks, the testing data is unrevealed in training. Works have been proposed to learn the common features of the training domain (Muandet et al., 2013; Blanchard et al., 2017; Li et al., 2017; 2018; Carlucci et al., 2019; Deshmukh et al., 2019). In this paper, we focus on the domain generalization problem in VLN task, and try to find the reasons for the failures.
|
| 33 |
+
|
| 34 |
+
# 3 VISION-AND-LANGUAGE NAVIGATION AND ITS ENVIRONMENT BIAS
|
| 35 |
+
|
| 36 |
+
We first introduce the task of vision-and-language navigation (VLN) and briefly describe the neural agent models used in our work. We next survey previous works on multiple indoor navigation datasets to show that the environment bias is widely observed in current VLN research. Lastly, we claim that this bias also exists in the outdoor navigation tasks, if the agent is tested on unseen regions.
|
| 37 |
+
|
| 38 |
+
# 3.1 VISION-AND-LANGUAGE NAVIGATION
|
| 39 |
+
|
| 40 |
+
Tasks: As shown in Fig. 1, the goal of the VLN task is to train an agent to navigate a certain type of environments $\{ { \bf E } \}$ (e.g., indoor or outdoor environments) given the instruction I. Each environment $\mathbf { E }$ is an independent space, such as a room or a house, and consists of a set of viewpoints. Each viewpoint is represented as a panoramic image and can be decomposed into separate views $\{ o \}$ as inputs to the neural agent models. The viewpoints and their connectivity form the navigational graph. In practice, after being placed at a particular viewpoint and given the instruction in the beginning, at each time step, the agent can observe the panoramic image of the viewpoint where it is located, and choose to move along an edge of the graph to the next node (i.e., viewpoint) or stop. This navigational process produces a path (i.e., a list of viewpoints), and the performance of the agent is evaluated by whether it reaches the target location that the instruction indicates in the end.
|
| 41 |
+
|
| 42 |
+
Neural Agent Models: Most instruction-guided navigational agents are built based on attentive encoder-decoder models (Bahdanau et al., 2015). The encoder reads the instructions while the decoder outputs actions based on the encoded instructions and perceived environments. Since the main purpose of this work is to understand the environment bias in vision-and-language navigation, we use a minimal representative neural agent model that achieves comparable results to previous works. Specifically, we adopt the panoramic-view neural agent model in Fried et al. (2018) (‘Follower’) with modifications from Tan et al. (2019) as our baseline model. We also exclude advanced training techniques (i.e., reinforcement learning and data augmentation) and only train the agent with imitation learning in all our experiments for the same purpose. More details in original papers.
|
| 43 |
+
|
| 44 |
+
# 3.2 ENVIRONMENT BIAS IN INDOOR NAVIGATION
|
| 45 |
+
|
| 46 |
+
In order to evaluate the generalizability of agent models, indoor vision-and-language navigation datasets (e.g., those collected from Matterport3D (Chang et al., 2017)) use disjoint sets of environments in training and testing. Most of the datasets provide two validation splits to verify the agent’s performance in both sets of environments: validation seen, which takes the data from training environments, and validation unseen, whose data is from new environments apart from the training environments.
|
| 47 |
+
|
| 48 |
+
Table 1: Results show the performance gap between seen (‘Val Seen’) and unseen (‘Val Unseen’) environments in several VLN tasks. Room-to-Room and Room-for-Room are evaluated with ‘Success Rate’, CVDN is evaluated with ‘Goal Progress’, Touchdown is evaluated with ‘Task Completion’.
|
| 49 |
+
|
| 50 |
+
<table><tr><td rowspan="2">Task</td><td rowspan="2">Method</td><td colspan="3">Result</td></tr><tr><td>Val Seen</td><td>Val Unseen</td><td>Abs Gap |△|</td></tr><tr><td rowspan="10">Room-to-Room (Anderson et al.,2018b)</td><td>R2R (Anderson et al.,2018b)</td><td>38.6</td><td>21.8</td><td>16.8</td></tr><tr><td>RPA (Wang et al., 2018b)</td><td>42.9</td><td>24.6</td><td>18.3</td></tr><tr><td>S-Follower (Fried et al., 2018)</td><td>66.4</td><td>35.5</td><td>30.9</td></tr><tr><td>RCM(Wang et al.,2019b)</td><td>66.7</td><td>42.8</td><td>23.9</td></tr><tr><td>SMNA (Ma et al., 2019a)</td><td>67</td><td>45</td><td>22</td></tr><tr><td>Regretful (Ma et al.,2019b)</td><td>69</td><td>50</td><td>19</td></tr><tr><td>EnvDrop (Tan et al., 2019)</td><td>62.1</td><td>52.2</td><td>9.9</td></tr><tr><td>ALTR (Huang et al.,2019)</td><td>55.8</td><td>46.1</td><td>9.7</td></tr><tr><td>RN+Obj (Hu et al., 2019)</td><td>59.2</td><td>39.5</td><td>19.7</td></tr><tr><td>CG (Anderson et al., 2019) Our baseline</td><td>31</td><td>31</td><td>0</td></tr><tr><td>Our learned-semantic</td><td></td><td>56.1 53.1</td><td>47.5</td><td>8.6</td></tr><tr><td rowspan="4">Room-for-Room (Jain et al., 2019)</td><td></td><td></td><td>53.3</td><td>0.2</td></tr><tr><td>Speaker-Follower</td><td>51.9</td><td>23.8</td><td>28.1</td></tr><tr><td>RCM</td><td>55.5</td><td>28.6</td><td>26.9</td></tr><tr><td>Our baseline Our learned-semantic</td><td>54.6 36.2</td><td>30.7 36.1</td><td>23.9</td></tr><tr><td rowspan="3">CVDN (Thomason et al., 2019b)</td><td>NDH</td><td>5.92</td><td>2.10</td><td>0.1</td></tr><tr><td>Our baseline</td><td>5.97</td><td>2.23</td><td>3.82 3.74</td></tr><tr><td>Our learned-semantic</td><td>2.60</td><td>2.43</td><td>0.17</td></tr><tr><td rowspan="4">Touchdown (Chen et al., 2019c)</td><td></td><td>7.9 (dev)</td><td></td><td></td></tr><tr><td>GA (original split) RCONCAT (original split)</td><td>9.8 (dev)</td><td>5.5 (test) 10.7 (test)</td><td>1</td></tr><tr><td>Our baseline (original split)</td><td>15.0 (dev)</td><td>14.2 (test)</td><td>1</td></tr><tr><td>Our baseline (seen/unseen split)</td><td>17.5</td><td>5.3</td><td>1 12.2</td></tr></table>
|
| 51 |
+
|
| 52 |
+
In the first part of Table 1, we list most of the previous works on the Room-to-Room dataset (Anderson et al., 2018b) and report the success rate under greedy decoding (i.e., without beam-search) on validation seen and validation unseen splits. The large absolute gaps (from $3 0 . 9 \%$ to $9 . 7 \%$ ) between the results of seen and unseen environments show that current neural agent models on R2R suffer from environment bias2. Besides Room-to-Room (R2R), we also analyze two newly-released indoor navigation datasets that were also collected from Matterport3D environments: Room-forRoom (R4R) (Jain et al., 2019) and Cooperative Vision-and-Dialog Navigation (CVDN) (Thomason et al., 2019b). As shown in the second and third parts of Table. 1, results drop significantly from seen to unseen environments (i.e., $2 6 . 9 \%$ on R4R and 3.74 on CVDN), indicating that agent models also suffer from the environment bias in these datasets. Lastly, we show the results (denoted as ‘ours’ in Table. 1) when the environment bias (reason analyzed in Sec. 5) is effectively eliminated by our learned semantic features (described in Sec. 6.3). As a result, the performance gaps are effectively decreased on all three datasets without changing the model and learning hyper-parameters, compared to our baselines (denoted as ‘Our baseline’) and previous works 3.
|
| 53 |
+
|
| 54 |
+
# 3.3 ENVIRONMENT BIAS IN OUTDOOR NAVIGATION
|
| 55 |
+
|
| 56 |
+
Since the three indoor navigational datasets in previous sections are collected from the Matterport3D environments (Chang et al., 2017), in order to show that the environment bias is a general phenomenon also existing in other kinds of environments, we investigate the outdoor navigation task from Touchdown dataset (Chen et al., 2019c), whose environments are taken from New York City. In the original data splits of Touchdown, the environment is not specifically divided into seen and unseen and only involved one city. Thus the trained agent is only tested on the training environments (similar to validation seen split). To reveal the environment bias in Touchdown dataset, we split the city environment according to latitude and create two sub-environments: ‘training’ and ‘unseen’. The data are then re-split into training, val-seen, and val-unseen, accordingly. We adapt our baseline R2R agent model with additional convolutional layers to fit this new task. As shown in the last part of Table. 1, when experimenting on the original data split, our baseline model achieves state-of-theart results on the original ‘dev’ set and ‘test’ set, proving the validity of our model in this dataset. However, the results on our re-split data (denoted as ‘Our baseline (seen/unseen split)’) still show a big drop from the ’training’ to the ’unseen’ sub-environment (from $1 7 . 5 \%$ to $5 . 3 \%$ ), indicating that environment bias is a broad issue.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: The language ’distance’ distribution (defined by language scores) and its relationship to success rate.
|
| 60 |
+
|
| 61 |
+
# 4 WHERE: THE EFFECT OF DIFFERENT TASK COMPONENTS
|
| 62 |
+
|
| 63 |
+
In Sec. 3, we showed that current neural agent models are biased towards the training environments on multiple vision-and-language navigation (VLN) datasets. In this section, our goal is to locate the component of VLN tasks which this environment bias is attributed to. As one of the early-released and well-explored datasets of VLN, Room-to-Room (R2R) dataset (Anderson et al., 2018b) is used as the diagnosing dataset in the experiments. We start by showing that two possible candidates, the natural language instructions and the underlying navigational graph, do not directly contribute to the environment bias. Then the effect of visual environments is analyzed in detail.
|
| 64 |
+
|
| 65 |
+
# 4.1 THE EFFECT OF NATURAL-LANGUAGE NAVIGATIONAL INSTRUCTIONS
|
| 66 |
+
|
| 67 |
+
A common hypothesis is that the navigational instructions for unseen environments (e.g., val unseen) are much different from the training environments (i.e., training and val seen) due to the different objects and layouts in new environments; and this lingual difference thus leads to the performance gap. In this section, we analyze the distributions of success rate with regard to the relationship between validation data’s instructions and training instructions. In order to quantitatively evaluate this relationship, we define the ‘distances’ from a validating instruction to all training instructions as the phrase-matching metric. Suppose $x$ is a validating datum, $\mathbb { T }$ is the training set, and $\operatorname { i n s t } ( x )$ is the instruction of the datum $x$ , we use ROUGE-L (Lin, 2004) and BLEU-4 (Papineni et al., 2002) to
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: Graph split: left is original data and right is re-splitting data. Black vertices are viewpoints visited during training; red paths are val seen $/$ val path-seen; blue paths are val path-unseen.
|
| 71 |
+
|
| 72 |
+
calculate this ‘distance’:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\operatorname { d i s } _ { \mathrm { R o U G E } } ( x , \mathbb { T } ) = \operatorname* { m i n } _ { t \in \mathbb { T } } \mathrm { R O U G E - L } \left( \operatorname { i n s t } ( x ) , \operatorname { i n s t } ( t ) \right)
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mathrm { d i s } _ { \mathrm { B L E U } } ( x , \mathbb { T } ) = \mathrm { B L E U } \ – 4 \left( \mathrm { i n s t } ( x ) , \{ \mathrm { i n s t } ( t ) \} _ { t \in \mathbb { T } } \right)
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where we consider all the training instructions as references in calculating the BLEU-4 score.
|
| 83 |
+
|
| 84 |
+
We show the distributions of success rates and distances in Fig. 2. As opposed to the hypothesis, we do not observe a significant difference between the distributions of ‘distances’ (as shown in Fig. 2 (a, b)) on seen validation and unseen validation. For the success rate distributions (in Fig. 2(c,d)), the performance is better on instructions with smaller ‘distances’ (i.e., higher BLEU-4/ROUGE-L scores w.r.t. the training instructions) on both validation splits. However, comparing two splits, with the same ‘distance’ to training instructions, seen validation still significantly outperforms the unseen validation set on success rate, which implies the existence of other reasons rather than language attributed to this performance gap.
|
| 85 |
+
|
| 86 |
+
# 4.2 THE EFFECT OF UNDERLYING NAVIGATIONAL GRAPH
|
| 87 |
+
|
| 88 |
+
As shown in Fig. 3, an environment could be considered as its underlying navigational graph with visual information (as in Fig. 1). In order to test whether the agent model could overfit to these navigational graphs (and thus be biased towards training environments), we follow the experiments in Hu et al. (2019) to train the agent without visual information. Specifically, we mask out the ResNet features with zero vectors thus the agent could only make the decision based on the instructions and the navigational graph. With our baseline model, the success rate is $3 8 . 5 \%$ on validation seen and $4 1 . 0 \%$ on validation unseen in this setting, which is consistent with the finding in Hu et al. (2019). Besides showing the relatively good performance of unseen split without visual contents (similar to Thomason et al. (2019a) and Hu et al. (2019)), we also want to emphasize the low performance gap between seen and unseen environments $2 . 5 \%$ compared to the $\bar { > } 1 0 \%$ gap in usual). Hence, we claim that the underlying graph is not a dominant reason for the environment bias.
|
| 89 |
+
|
| 90 |
+
# 4.3 THE EFFECT OF VISUAL ENVIRONMENTS
|
| 91 |
+
|
| 92 |
+
To show how the visual environments affect the agent’s performance, we analyze the results on unseen environments and in different spatial regions of the training environments. In order to give a detailed characterization of the effect of environments, we are going to reveal the spatial localities which are related to the agent’s performance at three different levels:
|
| 93 |
+
|
| 94 |
+
• Path-level Locality: Agents are better at paths which intersect with the training paths. • Region-level Locality: Agents are better in regions which are closer to the training data. • Environment-level Locality: Agents perform better on training environments than on unseen environments.
|
| 95 |
+
|
| 96 |
+
Table 2: Results on our re-splitting data showing the path-level and environment-level localities.
|
| 97 |
+
|
| 98 |
+
<table><tr><td colspan="2">Splitting Method</td><td rowspan="2">Train</td><td colspan="3">Validation</td></tr><tr><td></td><td></td><td>Path-seen</td><td>Path-unseen</td><td>Env-unseen</td></tr><tr><td rowspan="3">Environments</td><td>R2R</td><td>61</td><td>56</td><td>0</td><td>11</td></tr><tr><td>X-split</td><td>61</td><td>57</td><td>16</td><td>11</td></tr><tr><td>Z-split</td><td>61</td><td>56</td><td>29</td><td>11</td></tr><tr><td rowspan="3">Number of Data</td><td>R2R</td><td>14,025</td><td>1,020</td><td>0</td><td>2,349</td></tr><tr><td>X-split</td><td>11,631</td><td>1,230</td><td>1,098</td><td>2,349</td></tr><tr><td>Z-split</td><td>10,894</td><td>867</td><td>2,324</td><td>2.349</td></tr><tr><td rowspan="3">Success Rate</td><td>R2R</td><td>88.3</td><td>56.1</td><td>1</td><td>47.5</td></tr><tr><td>X-split</td><td>87.3</td><td>58.9</td><td>52.6</td><td>46.7</td></tr><tr><td>Z-split</td><td>94.7</td><td>62.5</td><td>47.8</td><td>42.4</td></tr></table>
|
| 99 |
+
|
| 100 |
+
And the existence of these spatial locality inspires us to find the direct cause of the problem in Sec. 3.2. However, the original split of data is not fine-grained enough to separately reveal these spatial localities. To better illustrate this, we visualize the data from one environment of the Roomto-Room dataset in Fig. 3, where the vertices are viewpoints with visual information and edges are valid connections between viewpoints. The vertices highlighted with dark-black indicate the viewpoints which are used in training paths, and the red edges are the connections covered by original val-seen paths. As shown in Fig. 3, nearly all viewpoints in val-seen paths (vertices connected to red lines) are used as viewpoints in training data (vertices marked by dark-black). We thus cannot categorize the path-level and region-level localities. To bypass this, we propose a novel re-splitting method to create our diagnosis data splits.
|
| 101 |
+
|
| 102 |
+
Structural Data Re-splitting We employ two kinds of structural data splitting methods based on the horizontal or vertical coordinates, denoted as $\mathbf { \epsilon } ^ { \bullet } \mathbf { X }$ -split’ and $^ { \bullet } \mathrm { Z }$ -split’, respectively. The $^ { 6 } \mathrm { Z }$ - split’ intuitively separates different floors in the houses and $\mathbf { \epsilon } ^ { \bullet } \mathbf { X }$ -split’ creates separate areas. When applying to the training environments in R2R dataset, we use one side of the splitting line (see the ‘X-splitting line’ Fig. 3) as the new training ‘environment’, and the other side as the path-unseen ‘environment’. In addition to this split of environments, we also re-split the original training data and val-seen data while keeping the val-unseen data the same. The data paths across the splitting line are dropped. As shown in the right part of Fig. 3, we create three new data splits: training split, val-path-seen split, and val-path-unseen split. The edges covered by the new val-path-unseen split are highlighted in blue, while the color style of training split and val-path-seen split (‘Black’ for viewpoints in training and ‘Red’ for edges in val path-seen) are the same. Since the amount of original val-seen data are inadequate to fill two new validation sets (val path-seen and val pathunseen), we bring some (original) training data into our new validation splits. The overall statistics of original splits and our new splits are shown in Table 2.4
|
| 103 |
+
|
| 104 |
+
Existence of Path-level and Environment-level Localities For both splitting methods, we train our baseline model on the newly-split training set and evaluate on our three validation sets (denoted as $\mathbf { \epsilon } ^ { \bullet } \mathbf { X }$ -split’ or $^ { 6 } \mathrm { Z }$ -split’ rows in Table 2). The results of our baseline model on the original R2R (denoted as ‘R2R’ rows) splits are listed for comparison. As shown in Table. 2, the agent performs better on val path-seen than val path-unseen, which suggests that a path-level locality exists in current VLN agent models. Meanwhile, the results on val path-unseen are further higher than val env-unseen and it indicates the environment-level locality which is independent of the path-level locality.
|
| 105 |
+
|
| 106 |
+
Existence of the Region-level Locality To further demonstrate region-level locality, we study how the success rate changes in different regions of the environment with respect to their distances to the training data, which is similar to the analysis of language ‘distance’ in Sec. 4.1. We first calculate the point-by-point shortest paths using the Dijkstra’s algorithm (Dijkstra, 1959), where the shortest distances between viewpoints $v$ and $v ^ { \prime }$ are denoted as the graph distance $\mathrm { d i s } _ { \mathrm { G R A P H } } ( v , v ^ { \prime } )$ . Based on this graph distance, we define the viewpoint distance disVIEWPOINT from a viewpoint $v$ to the training data $\mathbb { T }$ as $v$ ’s minimal graph distance to a viewpoint $v ^ { \prime }$ in training data. We then define the path distance $\mathrm { d i s } _ { \mathrm { P A T H } }$ from a validating data $x$ to the whole training data $\mathbb { T }$ as the maximal viewpoint distance in the path of $x$ :
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: The success rate declines as the path moves further from training regions.
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r l } { \left. { \mathrm { d i s } _ { \mathrm { P A T H } } ( x , \mathbb { T } ) = \operatorname* { m a x } _ { \boldsymbol { v } \in \mathrm { p a t h } ( x ) } \mathrm { d i s } _ { \mathrm { V I E W P O I N T } } ( \boldsymbol { v } , \mathbb { T } ) } } \\ & { = \operatorname* { m a x } _ { \boldsymbol { v } \in \mathrm { p a t h } ( x ) } \left\{ \begin{array} { l } { \qquad \mathrm { ~ m i n ~ } } \\ { \boldsymbol { v } ^ { \prime } \in \mathrm { p a t h } ( t ) } \end{array} \right. \mathrm { d i s } _ { \mathrm { G R A P H } } \left( \boldsymbol { v } , \boldsymbol { v } ^ { \prime } \right) \right\} } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
We compute this path distance between paths in the env-seen validation set and training environments in our re-split data. As shown in Fig. 4, the success rate declines as the path moves further from the training environment on both re-splitting methods (i.e., $\mathbf { \hat { x } }$ -split’ and $^ { 6 } \mathrm { Z }$ -split’). As conclusion, the closer the path to the training data, the higher the agent performance is, which suggests the existence of region-level locality.
|
| 116 |
+
|
| 117 |
+
# 5 WHY: WHAT INSIDE THE ENVIRONMENTS CONTRIBUTES TO THE BIAS?
|
| 118 |
+
|
| 119 |
+
In Sec. 4, we locate the cause of performance gap in visual environments by excluding other potential reasons and categorizing the spatial localities. However, there are still multiple possible aspects inside the environment which could lead to these spatial localities, e.g., the object layout convention and the room connections. The agent model could be biased towards the training environments by over-fitting or memorizing these environment-specific characteristics. In this section, we want to identify which aspect directly contributes to the bias and draw the following conclusion: the environment bias is attributed to low-level visual information carried by the ResNet features.
|
| 120 |
+
|
| 121 |
+
We first show an experiment that effectively decreases the gap between seen and unseen environments with minimal model modifications. We then clarify our conclusions based on the findings.
|
| 122 |
+
|
| 123 |
+
5.1 AN INVESTIGATION EXPERIMENT: IMAGENET LABELS AS VISUAL FEATURES
|
| 124 |
+
|
| 125 |
+
Suspecting that the over-fitting happens when the agent over-learns low-level features, we hope to find the replacement of ResNet 2048-features that contain minimal low-level information while preserving distinguishable visual contents. The most straightforward replacement is that instead of using mean-pooled features, we inject the frozen 1000-way classifying layer in ResNet pre-training, and use the probabilities of ImageNet labels as visual features. Shown as ‘ImageNet’ in Table. 3, the probability distribution almost closes the gap between seen and unseen. These results further constrain the reason of environment bias to the low-level ResNet features of image views. Combining with the findings of spatial localities, we suggest that environments (i.e., houses) and regions (i.e., rooms) usually have their own ‘style’. Thus the same semantic label (captured by ImageNet-1000 features) has different visual appearances (captured by ResNet features) in different environments or regions. As a result, ImageNet-1000 features, in spite of being noisy, are not distracted by low-level visual appearance and could generalize to unseen environments, while ResNet features could not.
|
| 126 |
+
|
| 127 |
+
Although these ImageNet-1000 features decrease the performance gap, it has a disagreement with the VLN domain so that the validation unseen results of R4R and CVDN are slightly worse than baseline (and not much better for R2R). Hence it motivates us to find better semantic representations of environmental features that can both close the seen-unseen gap while also achieving state-of-theart on unseen results (which we discuss next).
|
| 128 |
+
|
| 129 |
+
Table 3: Results showing that our semantic feature representations eliminate the performance gap in all three datasets.
|
| 130 |
+
|
| 131 |
+
<table><tr><td rowspan="2">Task</td><td colspan="3">Feature</td><td colspan="3">Result</td></tr><tr><td>Type</td><td>Name</td><td>Dim</td><td>Val Seen</td><td>Val Unseen</td><td>Abs Gap |△|</td></tr><tr><td rowspan="6">Room-to-Room</td><td>Baseline</td><td>ResNet NoDrop</td><td>2,048</td><td>54.5</td><td>38.2</td><td>16.3</td></tr><tr><td>Baseline</td><td>ResNet</td><td>2,048</td><td>56.1</td><td>47.5</td><td>8.6</td></tr><tr><td>Invesgation</td><td>ImageNet</td><td>1,000</td><td>47.1</td><td>48.2</td><td>1.1</td></tr><tr><td>Semantic</td><td>Detection</td><td>152</td><td>55.9</td><td>50.0</td><td>5.9</td></tr><tr><td>Semantic</td><td>Ground Truth</td><td>42</td><td>55.6</td><td>56.2</td><td>0.6</td></tr><tr><td>Semantic</td><td>Learned</td><td>42</td><td>53.1</td><td>53.3</td><td>0.2</td></tr><tr><td rowspan="6">R4R</td><td>Baseline</td><td>ResNet NoDrop</td><td>2,048</td><td>52.5</td><td>25.8</td><td>26.7</td></tr><tr><td>Baseline</td><td>ResNet</td><td>2,048</td><td>54.6</td><td>30.7</td><td>23.9</td></tr><tr><td>Investigation</td><td>ImageNet</td><td>1,000</td><td>28.7</td><td>28.9</td><td>0.2</td></tr><tr><td>Semantic</td><td>Detection</td><td>152</td><td>48.8</td><td>32.0</td><td>16.8</td></tr><tr><td>Semantic</td><td>Ground Truth</td><td>42</td><td>47.6</td><td>35.9</td><td>11.7</td></tr><tr><td>Semantic</td><td>Learned</td><td>42</td><td>36.2</td><td>36.1</td><td>0.1</td></tr><tr><td rowspan="6">CVDN</td><td>Baseline</td><td>ResNet NoDrop</td><td>2,048</td><td>5.88</td><td>2.14</td><td>3.74</td></tr><tr><td>Baseline</td><td>ResNet</td><td>2,048</td><td>5.97</td><td>2.23</td><td>3.74</td></tr><tr><td>Invesgation</td><td>ImageNet</td><td>1,000</td><td>3.22</td><td>2.08</td><td>1.14</td></tr><tr><td>Semantic</td><td>Detection</td><td>152</td><td>3.34</td><td>2.08</td><td>1.26</td></tr><tr><td>Semantic</td><td>Ground Truth</td><td>42</td><td>3.75</td><td>2.69</td><td>1.06</td></tr><tr><td>Semantic</td><td>Learned</td><td>42</td><td>2.60</td><td>2.43</td><td>0.17</td></tr></table>
|
| 132 |
+
|
| 133 |
+
# 6 HOW: METHODOLOGY TO FIX THE ENVIRONMENT BIAS
|
| 134 |
+
|
| 135 |
+
In the previous section (Sec. 5), we found that the environment bias is related to the low-level visual features (i.e., 2048-dim ResNet features). Following the findings we observed in Sec. 5.1, we build our agent on the features which are more correlated to the VLN environmental semantics than the ImageNet label features in Sec. 5.1. We first demonstrate our baseline results on three VLN datasets and then explore the advanced semantic feature replacements. As shown in Table 3, these advanced semantic features could effectively reduce the performance gap between seen and unseen environments and improve the unseen results compared to our strong baselines. The effectiveness of these semantic features supports our explanation of the environment bias in Sec. 5 and also suggests that future work in VLN tasks should think about such generalization issues.
|
| 136 |
+
|
| 137 |
+
# 6.1 BASELINE
|
| 138 |
+
|
| 139 |
+
In our baseline model, following the previous works we use the standard ResNet features as the representation of environments (Anderson et al., 2018b; Jain et al., 2019; Thomason et al., 2019b). These features come from the mean-pooled layer after the final convolutional layer of ResNet152 (He et al., 2016) pre-trained on ImageNet (Russakovsky et al., 2015). As shown in ‘Baseline’5 rows of Table. 3, val-seen results are significantly higher than val-unseen results in all three datasets. Note that our baseline method takes the ‘feature dropout’ technique demonstrated in Tan et al. (2019) (without back translation): the ResNet features are randomly masked by zero before used as inputs of the agent. Without this ‘feature dropout’ (denoted as ‘ResNet NoDrop’ in Table. 3), the gaps will increase in R2R and R4R, which suggests that this ‘feature dropout’ technique also helps to eliminate the low-level visual information over-fitting as we discussed in Sec. 5. However, the performance gap is still large, which leads us to the following discussions of semantic features.
|
| 140 |
+
|
| 141 |
+
# 6.2 DETECTED OBJECTS AREAS
|
| 142 |
+
|
| 143 |
+
During navigation, the objects in the environments are crucial since their matchings with the instruction often indicate the locations that can guide the agent, thus object detection results of the environments can provide relevant semantic information. In our work, we utilize the detection information generated by Faster R-CNN (Ren et al., 2015) to create the feature representations. Comparing to
|
| 144 |
+
|
| 145 |
+
ImageNet-1000 features (Sec. 5.1), these detection features include more environmental information since the viewing images in VLN usually contain multiple objects. Instead of directly using classification probabilities of the labels from ResNet and different from the approach in $\mathrm { H u }$ et al. (2019) who utilized the embeddings of detected labels, we design our detection features f DETECT of each image view as the sum of the areas of detected objects weighted by detection confidence:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathrm { f _ { \mathrm { { D E T E C T } } } } \mathrm { = } [ a _ { c _ { 1 } } , a _ { c _ { 2 } } , \dotsc , a _ { c _ { n } } ] ; \qquad a _ { c _ { i } } = \sum _ { \mathrm { o b j i s } ~ c _ { i } } \mathrm { { A r e a } ( o b j ) } \cdot \mathrm { { C o n f ( o b j ) } }
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where the $c _ { i }$ and $\boldsymbol { a } _ { c _ { i } }$ are the label and feature of each detected object, $\mathrm { A r e a } ( * )$ and $\operatorname { C o n f } ( * )$ are the area and confidence of each object. For implementation details, we use the Faster R-CNN (Ren et al., 2015) trained on Visual Genome (Krishna et al., 2017) provided in Bottom-Up Attention (Anderson et al., 2018a). To eliminate the labels irrelevant to VLN task, we calculate the total areas of each detection object among all environments and pick the labels that take up a relatively large proportion of the environments, creating features of dimension 152.6 Denoted as ‘Detection’ in Table 3, the performance gap is diminished with these detection features compared to baselines in all three datasets, indicating that changing the features to a higher semantic level has a positive effect on alleviating the environment bias. Meanwhile, the improvement of unseen validation results on R2R an R4R datasets suggests the better efficiency in the VLN task than the ImageNet labels.
|
| 152 |
+
|
| 153 |
+
# 6.3 SEMANTIC SEGMENTATION
|
| 154 |
+
|
| 155 |
+
Although the detection features can provide adequate semantic information for the agent to achieve comparable results as the baseline model, they do not fully utilize the visual information where the content left over from detection may contain useful knowledge for navigation. A better semantic representation is the semantic segmentation, which segments each view image on the pixel level and gives the label to each segment region, allowing us to utilize the semantics from the entire environment. Matterport3D (Chang et al., 2017) dataset provides the labeled semantic segmentation information of every scene and we take the rendered images from Tan et al. (2019)7. A comparison example of RGB images and semantic views is available in the Appendix. Since the semantic segmentation images are fine-grained and blurry in boundaries, we follow the design of detection features, using the areas of semantic classes in each image view as the semantic features (confidence is excluded since semantic segmentation does not provide this value). The areas are normalized to $[ 0 , 1 ]$ by dividing the area of the whole image region. We first assume that the semantic information is provided as additional environmental information and the results of the model using the ground truth semantic areas are shown in the ‘ground truth’ rows in Table. 3. We next study the situation where the semantic information is not available in testing environments thus the information needs to be learned from training environments. Thus we train a separate multi-layer perceptron to predict the areas of these semantic classes (details in Appendix), and the results of the model with these predicted semantics as features are shown in ‘learned’. As shown in Table. 3, both ‘ground truth’ and ‘learned’ semantic representations bring the performance of seen and unseen closer comparing to the baseline model, and the smallest performance gaps come from learned semantic segmentation features in all three datasets. The highest validation unseen success rates among all the proposed feature representations are also produced by semantic segmentation features, ‘learned’ semantic for R4R and ‘ground truth’ semantic for R2R and CVDN. Overall, among all the semantic representations we have explored, the semantic segmentation features are most effective in eliminating the environment bias.
|
| 156 |
+
|
| 157 |
+
# 7 CONCLUSION
|
| 158 |
+
|
| 159 |
+
In this paper, we focus on studying the performance gap between seen and unseen environments widely observed in vision-and-language navigation (VLN) tasks, trying to find where and why this environment bias exists and provide possible initial solutions. By designing the diagnosis experiments of environment re-splitting and feature replacement, we locate the environment bias to be in the low-level visual appearance; and we discuss semantic features that decrease the performance gap in three VLN datasets and achieve state-of-the-art results.
|
| 160 |
+
|
| 161 |
+
# REFERENCES
|
| 162 |
+
|
| 163 |
+
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6077–6086, 2018a.
|
| 164 |
+
|
| 165 |
+
Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sunderhauf, Ian Reid, ¨ Stephen Gould, and Anton van den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3674–3683, 2018b.
|
| 166 |
+
|
| 167 |
+
Peter Anderson, Ayush Shrivastava, Devi Parikh, Dhruv Batra, and Stefan Lee. Chasing ghosts: Instruction following as bayesian state tracking. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 168 |
+
|
| 169 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In The International Conference on Learning Representations (ICLR), 2015.
|
| 170 |
+
|
| 171 |
+
Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. In Advances in neural information processing systems, pp. 2178–2186, 2011.
|
| 172 |
+
|
| 173 |
+
Gilles Blanchard, Aniket Anand Deshmukh, Urun Dogan, Gyemin Lee, and Clayton Scott. Domain generalization by marginal transfer learning. arXiv preprint arXiv:1711.07910, 2017.
|
| 174 |
+
|
| 175 |
+
Valts Blukis, Dipendra Misra, Ross A Knepper, and Yoav Artzi. Mapping navigation instructions to continuous control actions with position-visitation prediction. In Conference on Robot Learning, pp. 505–518, 2018.
|
| 176 |
+
|
| 177 |
+
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.
|
| 178 |
+
|
| 179 |
+
Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niebner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from rgb-d data in indoor environments. In 2017 International Conference on 3D Vision (3DV), pp. 667–676. IEEE, 2017.
|
| 180 |
+
|
| 181 |
+
Chao Chen, Zhihong Chen, Boyuan Jiang, and Xinyu Jin. Joint domain alignment and discriminative feature learning for unsupervised deep domain adaptation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3296–3303, 2019a.
|
| 182 |
+
|
| 183 |
+
Chaoqi Chen, Weiping Xie, Wenbing Huang, Yu Rong, Xinghao Ding, Yue Huang, Tingyang Xu, and Junzhou Huang. Progressive feature alignment for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 627–636, 2019b.
|
| 184 |
+
|
| 185 |
+
Howard Chen, Alane Suhr, Dipendra Misra, Noah Snavely, and Yoav Artzi. Touchdown: Natural language navigation and spatial reasoning in visual street environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 12538–12547, 2019c.
|
| 186 |
+
|
| 187 |
+
Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Embodied question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 2054–2063, 2018.
|
| 188 |
+
|
| 189 |
+
Aniket Anand Deshmukh, Yunwen Lei, Srinagesh Sharma, Urun Dogan, James W Cutler, and Clayton Scott. A generalization error bound for multi-class domain generalization. arXiv preprint arXiv:1905.10392, 2019.
|
| 190 |
+
|
| 191 |
+
Edsger W Dijkstra. A note on two problems in connexion with graphs. Numerische mathematik, 1 (1):269–271, 1959.
|
| 192 |
+
|
| 193 |
+
Daniel Fried, Ronghang Hu, Volkan Cirik, Anna Rohrbach, Jacob Andreas, Louis-Philippe Morency, Taylor Berg-Kirkpatrick, Kate Saenko, Dan Klein, and Trevor Darrell. Speaker-follower models for vision-and-language navigation. In Advances in Neural Information Processing Systems, pp. 3314–3325, 2018.
|
| 194 |
+
|
| 195 |
+
Rui Gong, Wen Li, Yuhua Chen, and Luc Van Gool. Dlow: Domain flow for adaptation and generalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2477–2486, 2019.
|
| 196 |
+
|
| 197 |
+
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.
|
| 198 |
+
|
| 199 |
+
Daniel Gordon, Aniruddha Kembhavi, Mohammad Rastegari, Joseph Redmon, Dieter Fox, and Ali Farhadi. Iqa: Visual question answering in interactive environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4089–4098, 2018.
|
| 200 |
+
|
| 201 |
+
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.
|
| 202 |
+
|
| 203 |
+
Ehsan Hosseini-Asl, Yingbo Zhou, Caiming Xiong, and Richard Socher. Augmented cyclic adversarial learning for low resource domain adaptation. In The International Conference on Learning Representations (ICLR), 2019.
|
| 204 |
+
|
| 205 |
+
Ronghang Hu, Daniel Fried, Anna Rohrbach, Dan Klein, Kate Saenko, et al. Are you looking? grounding to multiple modalities in vision-and-language navigation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019.
|
| 206 |
+
|
| 207 |
+
Haoshuo Huang, Vihan Jain, Harsh Mehta, Alexander Ku, Gabriel Magalhaes, Jason Baldridge, and Eugene Ie. Transferable representation learning in vision-and-language navigation. In IEEE International Conference on Computer Vision, 2019.
|
| 208 |
+
|
| 209 |
+
Vihan Jain, Gabriel Magalhaes, Alexander Ku, Ashish Vaswani, Eugene Ie, and Jason Baldridge. Stay on the path: Instruction fidelity in vision-and-language navigation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2019.
|
| 210 |
+
|
| 211 |
+
Liyiming Ke, Xiujun Li, Yonatan Bisk, Ari Holtzman, Zhe Gan, Jingjing Liu, Jianfeng Gao, Yejin Choi, and Siddhartha Srinivasa. Tactical rewind: Self-correction via backtracking in vision-andlanguage navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6741–6749, 2019.
|
| 212 |
+
|
| 213 |
+
Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision, 123(1):32–73, 2017.
|
| 214 |
+
|
| 215 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5542–5550, 2017.
|
| 216 |
+
|
| 217 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Learning to generalize: Metalearning for domain generalization. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 218 |
+
|
| 219 |
+
Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pp. 74–81, 2004.
|
| 220 |
+
|
| 221 |
+
Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. In Advances in Neural Information Processing Systems, pp. 1640–1650, 2018.
|
| 222 |
+
|
| 223 |
+
Chih-Yao Ma, Jiasen Lu, Zuxuan Wu, Ghassan AlRegib, Zsolt Kira, Richard Socher, and Caiming Xiong. Self-monitoring navigation agent via auxiliary progress estimation. In The International Conference on Learning Representations (ICLR), 2019a.
|
| 224 |
+
|
| 225 |
+
Chih-Yao Ma, Zuxuan Wu, Ghassan AlRegib, Caiming Xiong, and Zsolt Kira. The regretful agent: Heuristic-aided navigation through progress estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6732–6740, 2019b.
|
| 226 |
+
|
| 227 |
+
Matt MacMahon, Brian Stankiewicz, and Benjamin Kuipers. Walk the talk: connecting language, knowledge, and action in route instructions. In proceedings of the 21st national conference on Artificial intelligence-Volume 2, pp. 1475–1482. AAAI Press, 2006.
|
| 228 |
+
|
| 229 |
+
Piotr Mirowski, Matt Grimes, Mateusz Malinowski, Karl Moritz Hermann, Keith Anderson, Denis Teplyashin, Karen Simonyan, Andrew Zisserman, Raia Hadsell, et al. Learning to navigate in cities without a map. In Advances in Neural Information Processing Systems, pp. 2419–2430, 2018.
|
| 230 |
+
|
| 231 |
+
Dipendra Misra, Andrew Bennett, Valts Blukis, Eyvind Niklasson, Max Shatkhin, and Yoav Artzi. Mapping instructions to actions in 3d environments with visual goal prediction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2667–2678, 2018.
|
| 232 |
+
|
| 233 |
+
Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. Domain generalization via invariant ¨ feature representation. In International Conference on Machine Learning, pp. 10–18, 2013.
|
| 234 |
+
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
Yuankai Qi, Qi Wu, Peter Anderson, Marco Liu, Chunhua Shen, and Anton van den Hengel. Rerere: Remote embodied referring expressions in real indoor environments. arXiv preprint arXiv:1904.10151, 2019.
|
| 238 |
+
|
| 239 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015.
|
| 240 |
+
|
| 241 |
+
Artem Rozantsev, Mathieu Salzmann, and Pascal Fua. Residual parameter transfer for deep domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4339–4348, 2018.
|
| 242 |
+
|
| 243 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 244 |
+
|
| 245 |
+
Hao Tan, Licheng Yu, and Mohit Bansal. Learning to navigate unseen environments: Back translation with environmental dropout. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 2610–2621, 2019.
|
| 246 |
+
|
| 247 |
+
Jesse Thomason, Daniel Gordan, and Yonatan Bisk. Shifting the baseline: Single modality performance on visual navigation & qa. In NACCL, 2019a.
|
| 248 |
+
|
| 249 |
+
Jesse Thomason, Michael Murray, Maya Cakmak, and Luke Zettlemoyer. Vision-and-dialog navigation. In CoRL, 2019b.
|
| 250 |
+
|
| 251 |
+
Daixin Wang, Peng Cui, and Wenwu Zhu. Deep asymmetric transfer network for unbalanced domain adaptation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
|
| 252 |
+
|
| 253 |
+
Ximei Wang, Liang Li, Weirui Ye, Mingsheng Long, and Jianmin Wang. Transferable attention for domain adaptation. In AAAI Conference on Artificial Intelligence (AAAI), 2019a.
|
| 254 |
+
|
| 255 |
+
Xin Wang, Wenhan Xiong, Hongmin Wang, and William Yang Wang. Look before you leap: Bridging model-free and model-based reinforcement learning for planned-ahead vision-and-language navigation. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 37–53, 2018b.
|
| 256 |
+
|
| 257 |
+
Xin Wang, Qiuyuan Huang, Asli Celikyilmaz, Jianfeng Gao, Dinghan Shen, Yuan-Fang Wang, William Yang Wang, and Lei Zhang. Reinforced cross-modal matching and self-supervised imitation learning for vision-language navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6629–6638, 2019b.
|
| 258 |
+
|
| 259 |
+
Yi Wu, Yuxin Wu, Georgia Gkioxari, and Yuandong Tian. Building generalizable agents with a realistic and rich 3d environment. arXiv preprint arXiv:1801.02209, 2018.
|
| 260 |
+
|
| 261 |
+
Licheng Yu, Xinlei Chen, Georgia Gkioxari, Mohit Bansal, Tamara L Berg, and Dhruv Batra. Multitarget embodied question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6309–6318, 2019.
|
| 262 |
+
|
| 263 |
+
Yabin Zhang, Hui Tang, Kui Jia, and Mingkui Tan. Domain-symmetric networks for adversarial domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5031–5040, 2019.
|
| 264 |
+
|
| 265 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pp. 2223–2232, 2017.
|
| 266 |
+
|
| 267 |
+
# A APPENDIX
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 5: Comparisons between RGB images and their semantic views.
|
| 271 |
+
|
| 272 |
+
A.1 EXAMPLES OF RGB IMAGES AND SEMANTIC VIEWS
|
| 273 |
+
|
| 274 |
+
In Fig. 5, we show a rendered semantic view from Tan et al. (2019) and its original RGB image. Different colors indicate different semantic segmentation areas and 40 semantic labels are considered in the Matterport3D dataset Chang et al. (2017).
|
| 275 |
+
|
| 276 |
+
# A.2 DETAILS OF ‘LEARNED’ SEMANTIC TRAINING
|
| 277 |
+
|
| 278 |
+
We use a multi-layer perceptron over the ResNet features to generate the ‘learned’ semantic features. The multi-layer perceptron includes three fully-connected layers with ReLU activation on the outputs of the first two layers. The input is the 2048-dim ResNet feature $f$ of each image view. The hidden sizes of the first two layers are 512 and 128. The final layer will output the 42-dim semantic feature $y$ that represents the areas of each semantic class. After the linear layers, we use the sigmoid function $\sigma$ to convert the output to the ratio of areas.
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\begin{array} { c } { { x _ { 1 } = \mathrm { R e L U } ( A _ { 1 } f + b _ { 1 } ) } } \\ { { x _ { 2 } = \mathrm { R e L U } ( A _ { 2 } x _ { 1 } + b _ { 2 } ) } } \\ { { y = \sigma ( A _ { 3 } x _ { 2 } + b _ { 3 } ) } } \end{array}
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
The model is trained with ground truth semantic areas $y _ { \mathrm { A R E A } }$ (normalized to $[ 0 , 1 ] )$ and only the views in training environments are used in training. We minimize the binary cross-entropy loss between the ground truth areas $\{ y _ { i } ^ { * } \}$ and the predicted areas $\{ y _ { i } \}$ , where $i$ indicate the $i$ -th semantic class.
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathcal { L } = - \sum _ { i } \left( y _ { i } ^ { * } \log y _ { i } + \left( 1 - y _ { i } ^ { * } \right) \log \left( 1 - y _ { i } \right) \right)
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
Dropout layers with a probability of 0.5 are added between fully-connected layers while training.
|
| 291 |
+
The sigmoid function $\sigma$ and the cross-entropy loss are combined to improve numerical stability.
|
| 292 |
+
|
| 293 |
+
After the model is fitted, we freeze the weight and use it to predict the semantic features of all seen and unseen environments (i.e., environments for training, val-seen, and val-unseen data). The predicted features are then used as the input of our neural agent model for different datasets (i.e., R2R, R4R, and CVDN), and the neural agent models are the same except we change the input dimension from 2048 (the dimension of ResNet features) to 42 (the number of semantic classes).
|
md/train/S1evHerYPr/S1evHerYPr.md
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING GENERALIZATION IN META REINFORCEMENT LEARNING USING LEARNED OBJECTIVES
|
| 2 |
+
|
| 3 |
+
Louis Kirsch, Sjoerd van Steenkiste, Jurgen Schmidhuber ¨ The Swiss AI Lab IDSIA, USI, SUPSI {louis, sjoerd, juergen}@idsia.ch
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Biological evolution has distilled the experiences of many learners into the general learning algorithms of humans. Our novel meta reinforcement learning algorithm MetaGenRL is inspired by this process. MetaGenRL distills the experiences of many complex agents to meta-learn a low-complexity neural objective function that decides how future individuals will learn. Unlike recent meta-RL algorithms, MetaGenRL can generalize to new environments that are entirely different from those used for meta-training. In some cases, it even outperforms humanengineered RL algorithms. MetaGenRL uses off-policy second-order gradients during meta-training that greatly increase its sample efficiency.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The process of evolution has equipped humans with incredibly general learning algorithms. They enable us to solve a wide range of problems, even in the absence of a large number of related prior experiences. The algorithms that give rise to these capabilities are the result of distilling the collective experiences of many learners throughout the course of natural evolution. By essentially learning from learning experiences in this way, the resulting knowledge can be compactly encoded in the genetic code of an individual to give rise to the general learning capabilities that we observe today.
|
| 12 |
+
|
| 13 |
+
In contrast, Reinforcement Learning (RL) in artificial agents rarely proceeds in this way. The learning rules that are used to train agents are the result of years of human engineering and design, (e.g. Williams (1992); Wierstra et al. (2008); Mnih et al. (2013); Lillicrap et al. (2016); Schulman et al. (2015a)). Correspondingly, artificial agents are inherently limited by the ability of the designer to incorporate the right inductive biases in order to learn from previous experiences.
|
| 14 |
+
|
| 15 |
+
Several works have proposed an alternative framework based on meta reinforcement learning (Schmidhuber, 1994; Wang et al., 2016; Duan et al., 2016; Finn et al., 2017; Houthooft et al., 2018; Clune, 2019). Meta-RL distinguishes between learning to act in the environment (the reinforcement learning problem) and learning to learn (the meta-learning problem). Hence, learning itself is now a learning problem, which in principle allows one to leverage prior learning experiences to meta-learn general learning rules that surpass human-engineered alternatives. However, while prior work found that learning rules could be meta-learned that generalize to slightly different environments or goals (Finn et al., 2017; Plappert et al., 2018; Houthooft et al., 2018), generalization to entirely different environments remains an open problem.
|
| 16 |
+
|
| 17 |
+
In this paper we present MetaGenRL1, a novel meta reinforcement learning algorithm that metalearns learning rules that generalize to entirely different environments. MetaGenRL is inspired by the process of natural evolution as it distills the experiences of many agents into the parameters of an objective function that decides how future individuals will learn. Similar to Evolved Policy Gradients (EPG; Houthooft et al. (2018)), it meta-learns low complexity neural objective functions that can be used to train complex agents with many parameters. However, unlike EPG, it is able to meta-learn using second-order gradients, which offers several advantages as we will demonstrate.
|
| 18 |
+
|
| 19 |
+
We evaluate MetaGenRL on a variety of continuous control tasks and compare to $\mathrm { { R L ^ { 2 } } }$ (Wang et al., 2016; Duan et al., 2016) and EPG in addition to several human engineered learning algorithms.
|
| 20 |
+
|
| 21 |
+
Compared to $\mathtt { R L } ^ { 2 }$ we find that MetaGenRL does not overfit and is able to train randomly initialized agents using meta-learned learning rules on entirely different environments. Compared to EPG we find that MetaGenRL is more sample efficient, and outperforms significantly under a fixed budget of environment interactions. The results of an ablation study and additional analysis provide further insight into the benefits of our approach.
|
| 22 |
+
|
| 23 |
+
# 2 PRELIMINARIES
|
| 24 |
+
|
| 25 |
+
Notation We consider the standard MDP Reinforcement Learning setting defined by a tuple $e =$ $( S , A , P , \rho _ { 0 } , r , \gamma , T )$ consisting of states $S$ , actions $A$ , the transition probability distribution $P :$ $S \times A \times S \to \mathbb { R } _ { + } .$ , an initial state distribution $\rho _ { 0 } : S \to \mathbb { R } _ { + }$ , the reward function $r : S \times A \to$ $[ - R _ { m a x } , R _ { m a x } ]$ , a discount factor $\gamma$ , and the episode length $T$ . The objective for the probabilistic policy $\pi _ { \phi } : S \times A \to \mathbb { R } _ { + }$ parameterized by $\phi$ is to maximize the expected discounted return:
|
| 26 |
+
|
| 27 |
+
$\mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { T - 1 } \gamma ^ { t } r _ { t } ]$ $[ \sum \gamma ^ { t } r _ { t } ] , \mathrm { ~ w h e r e ~ } s _ { 0 } \sim \rho _ { 0 } ( s _ { 0 } ) , a _ { t } \sim \pi _ { \phi } ( a _ { t } | s _ { t } ) , s _ { t + 1 } \sim P ( s _ { t + 1 } | s _ { t } , a _ { t } ) , r _ { t } = r ( s _ { t } , a _ { t } ) ,$ with $\tau = ( s _ { 0 } , a _ { 0 } , r _ { 0 } , s _ { 1 } , . . . , s _ { T - 1 } , a _ { T - 1 } , r _ { T - 1 } ) .$
|
| 28 |
+
|
| 29 |
+
Human Engineered Gradient Estimators A popular gradient-based approach to maximizing Equation 1 is REINFORCE (Williams, 1992). It directly differentiates Equation 1 with respect to $\phi$ using the likelihood ratio trick to derive gradient estimates of the form:
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\nabla _ { \phi } \mathbb { E } _ { \tau } \big [ L _ { R E I N F } ( \tau , \pi _ { \phi } ) \big ] : = \mathbb { E } _ { \tau } \big [ \nabla _ { \phi } \sum _ { t = 0 } ^ { T - 1 } \log \pi _ { \phi } ( a _ { t } | s _ { t } ) \cdot \sum _ { t ^ { \prime } = t } ^ { T - 1 } \gamma ^ { t ^ { \prime } - t } r _ { t ^ { \prime } } ) \big ] .
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Although this basic estimator is rarely used in practice, it has become a building block for an entire class of policy-gradient algorithms of this form. For example, a popular extension from Schulman et al. (2015b) combines REINFORCE with a Generalized Advantage Estimate (GAE) to yield the following policy gradient estimator:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\nabla _ { \phi } \mathbb { E } _ { \tau } [ L _ { G A E } ( \tau , \pi _ { \phi } , V ) ] : = \mathbb { E } _ { \tau } [ \nabla _ { \phi } \sum _ { t = 0 } ^ { T - 1 } \log \pi _ { \phi } ( a _ { t } \vert s _ { t } ) \cdot A ( \tau , V , t ) ] .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $A ( \tau , V , t )$ is the GAE and $V : S \mathbb { R }$ is a value function estimate. Several recent other extensions include TRPO (Schulman et al., 2015a), which discourages bad policy updates using trust regions and iterative off-policy updates, or PPO (Schulman et al., 2017), which offers similar benefits using only first order approximations.
|
| 42 |
+
|
| 43 |
+
Parametrized Objective Functions In this work we note that many of these human engineered policy gradient estimators can be viewed as specific implementations of a general objective function $L$ that is differentiated with respect to the policy parameters:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r } { \nabla _ { \phi } \mathbb { E } _ { \tau } [ L ( \tau , \pi _ { \phi } , V ) ] . } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Hence, it becomes natural to consider a generic parametrization of $L$ that, for various choices of parameters $\alpha$ , recovers some of these estimators. In this paper, we will consider neural objective functions where $L _ { \alpha }$ is implemented by a neural network. Our goal is then to optimize the parameters $\alpha$ of this neural network in order to give rise to a new learning algorithm that best maximizes Equation 1 on an entire class of (different) environments.
|
| 50 |
+
|
| 51 |
+
# 3 META-LEARNING NEURAL OBJECTIVES
|
| 52 |
+
|
| 53 |
+
In this work we propose MetaGenRL, a novel meta reinforcement learning algorithm that metalearns neural objective functions of the form $L _ { \alpha } ( \tau , \pi _ { \phi } , V )$ . MetaGenRL makes use of value functions and second-order gradients, which makes it more sample efficient compared to prior work (Duan et al., 2016; Wang et al., 2016; Houthooft et al., 2018). More so, as we will demonstrate, MetaGenRL meta-learns objective functions that generalize to vastly different environments.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: A schematic of MetaGenRL. On the left a population of agents $( i \in { 1 , \ldots , N } )$ , where each member consist of a critic ${ Q } _ { \theta } ^ { ( i ) }$ and a policy $\pi _ { \phi } ^ { ( i ) }$ that interact with a particular environment $e ^ { ( i ) }$ and store collected data in a corresponding replay buffer $B ^ { ( i ) }$ . On the right a meta-learned neural objective function $L _ { \alpha }$ that is shared across the population. Learning (dotted arrows) proceeds as follows: Each policy is updated by differentiating $L _ { \alpha }$ , while the critic is updated using the usual TD-error (not shown). $L _ { \alpha }$ is meta-learned by computing second-order gradients that can be obtained by differentiating through the critic.
|
| 57 |
+
|
| 58 |
+
Our key insight is that a differentiable critic $Q _ { \theta } : S \times A \mathbb { R }$ can be used to measure the effect of locally changing the objective function parameters $\alpha$ based on the quality of the corresponding policy gradients. This enables a population of agents to use and improve a single parameterized objective function $L _ { \alpha }$ through interacting with a set of (potentially different) environments. During evaluation (meta-test time), the meta-learned objective function can then be used to train a randomly initialized RL agent in a new environment.
|
| 59 |
+
|
| 60 |
+
# 3.1 FROM DDPG TO GRADIENT-BASED META-LEARNING OF NEURAL OBJECTIVES
|
| 61 |
+
|
| 62 |
+
We will formally introduce MetaGenRL as an extension of the DDPG actor-critic framework (Silver et al., 2014; Lillicrap et al., 2016). In DDPG, a parameterized critic of the form $Q _ { \theta } : S \times A \mathbb { R }$ transforms the non-differentiable RL reward maximization problem into a myopic value maximization problem for any $s _ { t } \in S$ . This is done by alternating between optimization of the critic $Q _ { \theta }$ and the (here deterministic) policy $\pi _ { \phi }$ . The critic is trained to minimize the TD-error by following:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\nabla _ { \theta } \sum _ { ( s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } ) } ( Q _ { \theta } ( s _ { t } , a _ { t } ) - y _ { t } ) ^ { 2 } , \mathrm { w h e r e } y _ { t } = r _ { t } + \gamma \cdot Q _ { \theta } \big ( s _ { t + 1 } , \pi _ { \phi } \big ( s _ { t + 1 } \big ) \big ) ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
and the dependence of $y _ { t }$ on the parameter vector $\theta$ is ignored. The policy $\pi _ { \phi }$ is improved to increase the expected return from arbitrary states by following the gradient $\begin{array} { r } { \nabla _ { \phi } \sum _ { s _ { t } } Q _ { \theta } \big ( s _ { t } , \pi _ { \phi } ( s _ { t } ) \big ) } \end{array}$ . Both gradients can be computed entirely off-policy by sampling trajectories from a replay buffer.
|
| 69 |
+
|
| 70 |
+
MetaGenRL builds on this idea of differentiating the critic $Q _ { \theta }$ with respect to the policy parameters. It incorporates a parameterized objective function $L _ { \alpha }$ that is used to improve the policy (i.e. by following the gradient $\nabla _ { \phi } L _ { \alpha } )$ , which adds one extra level of indirection: The critic $Q _ { \theta }$ improves $L _ { \alpha }$ , while $L _ { \alpha }$ improves the policy $\pi _ { \phi }$ . By first differentiating with respect to the objective function parameters $\alpha$ , and then with respect to the policy parameters $\phi$ , the critic can be used to measure the effect of updating $\pi _ { \phi }$ using $L _ { \alpha }$ on the estimated return2:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\nabla _ { \alpha } Q _ { \theta } \bigl ( s _ { t } , \pi _ { \phi ^ { \prime } } \bigl ( s _ { t } \bigr ) \bigr ) , \mathrm { w h e r e } \phi ^ { \prime } = \phi - \nabla _ { \phi } L _ { \alpha } ( \tau , x ( \phi ) , V ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
This constitutes a type of second order gradient $\nabla _ { \alpha } \nabla _ { \phi }$ that can be used to meta-train $L _ { \alpha }$ to provide better updates to the policy parameters in the future. In practice we will use batching to optimize Equation 6 over multiple trajectories $\tau$ .
|
| 77 |
+
|
| 78 |
+
Similarly to the policy-gradient estimators from Section 2, the objective function $L _ { \alpha } ( \tau , x ( \phi ) , V )$ receives as inputs an episode trajectory $\tau = ( s _ { 0 : T - 1 } , a _ { 0 : T - 1 } , r _ { 0 : T - 1 } )$ , the value function estimates
|
| 79 |
+
|
| 80 |
+
<table><tr><td colspan="2">Algorithm1MetaGenRL:Meta-Training</td></tr><tr><td>Require: p(e) a distribution of environments P←{(ei~p(e),Φ1,01,B1←O),..} Randomly initialize objective function Lα while L has not converged do</td><td>>Randomly initialize population of agents</td></tr><tr><td>for e,Φ,0,B∈Pdo if extend replay bufferB then</td><td>For each agent iin parallel</td></tr><tr><td>Extend Busing T in e</td><td></td></tr><tr><td>Sample trajectories from B Update critic Qe using TD-error</td><td></td></tr><tr><td>Update policy by following VLα Compute objective function gradient △i for agent i according to Equation 6</td><td></td></tr><tr><td>Sum gradients Σ △i to update Lα</td><td></td></tr></table>
|
| 81 |
+
|
| 82 |
+
$V$ , and an auxiliary input $x ( \phi )$ (previously $\pi _ { \phi } .$ ) that can be differentiated with respect to the policy parameters. The latter is critical to be able to differentiate with respect to $\phi$ and in the simplest case it consists of the action as predicted by the policy. While Equation 6 is used for meta-learning $L _ { \alpha }$ , the objective function $L _ { \alpha }$ itself is used for policy learning by following $\nabla _ { \phi } L _ { \alpha } ( \tau , x ( \phi ) , V )$ . See Figure 1 for an overview. MetaGenRL consists of two phases: During meta-training, we alternate between critic updates, objective function updates, and policy updates to meta-learn an objective function $L _ { \alpha }$ as described in Algorithm 1. During meta-testing in Algorithm 2, we take the learned objective function $L _ { \alpha }$ and keep it fixed while training a randomly initialized policy in a new environment to assess its performance.
|
| 83 |
+
|
| 84 |
+
We note that the inputs to $L _ { \alpha }$ are sampled from a replay buffer rather than solely using on-policy data. If $L _ { \alpha }$ were to represent a REINFORCE-type objective then it would mean that differentiating $L _ { \alpha }$ yields biased policy gradient estimates. In our experiments we will find that the gradients from $L _ { \alpha }$ work much better in comparison to a biased off-policy REINFORCE algorithm, and to an importance-sampled unbiased REINFORCE algorithm, while also improving over the popular on-policy REINFORCE and PPO algorithms.
|
| 85 |
+
|
| 86 |
+
# 3.2 PARAMETRIZING THE OBJECTIVE FUNCTION
|
| 87 |
+
|
| 88 |
+
We will implement $L _ { \alpha }$ using an LSTM (Gers et al., 2000; Hochreiter & Schmidhuber, 1997) that iterates over $\tau$ in reverse order and depends on the current policy action $\pi _ { \phi } ( s _ { t } )$ (see Figure 2). At every time-step $L _ { \alpha }$ receives the reward $r _ { t }$ , taken action $a _ { t }$ , predicted action by the current policy $\pi _ { \phi } ( s _ { t } )$ , the time $t$ , and value function estimates $V _ { t } , V _ { t + 1 } { } ^ { 3 }$ . At each step the LSTM outputs the objective value $l _ { t }$ , all of which are summed to yield a single scalar output value that can be differentiated with respect to $\phi$ . In order to accommodate varying action dimensionalities across different environments, both $\pi _ { \phi } ( s _ { t } )$ and $a _ { t }$ are first convolved and then averaged to obtain an action embedding that does not depend on the action dimensionality. Additional details, including suggestions for more expressive alternatives are available in Appendix B.
|
| 89 |
+
|
| 90 |
+
By presenting the trajectory in reverse order to the LSTM (and $L _ { \alpha }$ correspondingly), it is able to assign credit to an action $a _ { t }$ based on its future impact on the reward, similar to policy gradient estimators. More so, as a general function approximator using these inputs, the LSTM is in principle able to learn different variance and bias reduction techniques, akin to advantage estimates, generalized advantage estimates, or importance weights4. Due to these properties, we expect the class of objective functions that is supported to somewhat relate to a REINFORCE (Williams, 1992) estimator that uses generalized advantage estimation (Schulman et al., 2015b).
|
| 91 |
+
|
| 92 |
+
<table><tr><td>Algorithm2 MetaGenRL: Meta-Testing</td></tr><tr><td>Require: A test environment e,and an objective function Lα Randomly initialize π,Vθ,B ←</td></tr><tr><td>while f has not converged do if extend replay buffer B then</td></tr><tr><td>Extend Busing π in e</td></tr><tr><td>Sample trajectories from B Update Vθ using TD-error</td></tr></table>
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 2: An overview of $L _ { \alpha } ( \tau , x ( \phi ) , V )$
|
| 96 |
+
|
| 97 |
+
# 3.3 GENERALITY AND EFFICIENCY OF METAGENRL
|
| 98 |
+
|
| 99 |
+
MetaGenRL offers a general framework for meta-learning objective functions that can represent a wide range of learning algorithms. In particular, it is only required that both $\pi _ { \phi }$ and $L _ { \alpha }$ can be differentiated w.r.t. to the policy parameters $\phi$ . In the present work, we use this flexibility to leverage population-based meta-optimization, increase sample efficiency through off-policy secondorder gradients, and to improve the generalization capabilities of meta-learned objective functions.
|
| 100 |
+
|
| 101 |
+
Population-Based A general objective function should be applicable to a wide range of environments and agent parameters. To this extent MetaGenRL is able to leverage the collective experience of multiple agents to perform meta-learning by using a single objective function $L _ { \alpha }$ shared among a population of agents that each act in their own (potentially different) environment. Each agent locally computes Equation 6 over a batch of trajectories, and the resulting gradients are combined to update $L _ { \alpha }$ . Thus, the relevant learning experience of each individual agent is compressed into the objective function that is available to the entire population at any given time.
|
| 102 |
+
|
| 103 |
+
Sample Efficiency An alternative to learning neural objective functions using a population of agents is through evolution as in EPG (Houthooft et al., 2018). However, we expect meta-learning using second-order gradients as in MetaGenRL to be much more sample efficient. This is due to off-policy training of the objective function $L _ { \alpha }$ and its subsequent off-policy use to improve the policy. Indeed, unlike in evolution there is no need to train multiple randomly initialized agents in their entirety in order to evaluate the objective function, thus speeding up credit assignment. Rather, at any point in time, any information that is deemed useful for future environment interactions can directly be incorporated into the objective function. Finally, using the formulation in Equation 6 one can measure the effects of improving the policy using $L _ { \alpha }$ for multiple steps by increasing the corresponding number of gradient steps before applying $Q _ { \theta }$ , which we will explore in Section 5.2.3.
|
| 104 |
+
|
| 105 |
+
Meta-Generalization The focus of this work is to learn general learning rules that during testtime can be applied to vastly different environments. A strict separation between the policy and the learning rule, the functional form of the latter, and training across many environments all contribute to this. Regarding the former, a clear separation between the policy and the learning rule as in MetaGenRL is expected to be advantageous for two reasons. Firstly, it allows us to specify the number of parameters of the learning rule independent of the policy and critic parameters. For example, our implementation of $L _ { \alpha }$ uses only $1 5 K$ parameters for the objective function compared to $3 8 4 K$ parameters for the policy and critic. Hence, we are able to only use a short description length for the learning rule. A second advantage that is gained is that the meta-learner is unable to directly change the policy and must, therefore, learn to make use of the objective function. This makes it difficult for the meta-learner to overfit to the training environments.
|
| 106 |
+
|
| 107 |
+
# 4 RELATED WORK
|
| 108 |
+
|
| 109 |
+
Among the earliest pursuits in meta-learning are meta-hierarchies of genetic algorithms (Schmidhuber, 1987) and learning update rules in supervised learning (Bengio et al., 1990). While the former introduced a general framework of entire meta-hierarchies, it relied on discrete non-differentiable programs. The latter introduced local update rules that included free parameters, which could be learned using gradients in a supervised setting. Schmidhuber (1993) introduced a differentiable self-referential RNN that could address and modify its own weights, albeit difficult to learn.
|
| 110 |
+
|
| 111 |
+
Hochreiter et al. (2001) introduced differentiable meta-learning using RNNs to scale to larger problem instances. By giving an RNN access to its prediction error, it could implement its own metalearning algorithm, where the weights are the meta-learned parameters, and the hidden states the subject of learning. This was later extended to the RL setting (Wang et al., 2016; Duan et al., 2016; Santoro et al., 2016; Mishra et al., 2018) (here refered to as $\bar { \mathsf { R L } } ^ { 2 }$ ). As we show empirically in our paper, meta-learning with $\mathtt { R L } ^ { 2 }$ does not generalize well. It lacks a clear separation between policy and objective function, which makes it easy to overfit on training environments. This is exacerbated by the imbalance of $O ( n ^ { 2 } )$ meta-learned parameters to learn $O ( n )$ activations, unlike in MetaGenRL.
|
| 112 |
+
|
| 113 |
+
Many other recent meta-learning algorithms learn a policy parameter initialization that is later finetuned using a fixed reinforcement learning algorithm (Finn et al., 2017; Schulman et al., 2017; Grant et al., 2018; Yoon et al., 2018). Different from MetaGenRL, these approaches use second order gradients on the same policy parameter vector instead of using a separate objective function. Albeit in principle general (Finn & Levine, 2018), the mixing of policy and learning algorithm leads to a complicated way of expressing general update rules. Similar to $\mathrm { { R L ^ { 2 } } }$ , adaptation to related tasks is possible, but generalization is difficult (Houthooft et al., 2018).
|
| 114 |
+
|
| 115 |
+
Objective functions have been learned prior to MetaGenRL. Houthooft et al. (2018) evolve an objective function that is later used to train an agent. Unlike MetaGenRL, this approach is extremely costly in terms of the number of environment interactions required to evaluate and update the objective function. Most recently, Bechtle et al. (2019) introduced learned loss functions for reinforcement learning that also make use of second-order gradients, but use a policy gradient estimator instead of a Q-function. Similar to other work, their focus is only on narrow task distributions. Learned objective functions have also been used for learning unsupervised representations (Metz et al., 2019), DDPG-like meta-gradients for hyperparameter search (Xu et al., 2018), and learning from human demonstrations (Yu et al., 2018). Concurrent to our work, Alet et al. (2020) uses techniques from architecture search to search for viable artificial curiosity objectives that are composed of primitive objective functions.
|
| 116 |
+
|
| 117 |
+
Li & Malik (2016; 2017) and Andrychowicz et al. (2016) conduct meta-learning by learning optimizers that update parameters $\phi$ by modulating the gradient of some fixed objective function $L$ : $\Delta \phi = f _ { \alpha } ( \nabla _ { \phi } L )$ where $\alpha$ is learned. They differ from MetaGenRL in that they only modulate the gradient of a fixed objective function $L$ instead of learning $L$ itself.
|
| 118 |
+
|
| 119 |
+
Another connection exists to meta-learned intrinsic reward functions (Schmidhuber, 1991a; Dayan & Hinton, 1993; Wiering & Schmidhuber, 1996; Singh et al., 2004; Niekum et al., 2011; Zheng et al., 2018; Jaderberg et al., 2019). Choosing $\begin{array} { r } { \nabla _ { \phi } L _ { \alpha } = \tilde { \nabla _ { \phi } } \sum _ { t = 1 } ^ { T } \bar { r } _ { t } ( \tau ) } \end{array}$ , where $\bar { r } _ { t }$ is a meta-learned reward and $\tilde { \nabla } _ { \theta }$ is a gradient estimator (such as a value based or policy gradient based estimator) reveals that meta-learning objective functions includes meta-learning the gradient estimatior $\tilde { \nabla }$ itself as long as it is expressible by a gradient $\nabla _ { \theta }$ on an objective $L _ { \alpha }$ . In contrast, for intrinsic reward functions, the gradient estimator $\tilde { \nabla }$ is normally fixed.
|
| 120 |
+
|
| 121 |
+
Finally, we note that positive transfer between different tasks (reward functions) as well as environments (e.g. different Atari games) has been shown previously in the context of transfer learning (Kistler et al., 1997; Parisotto et al., 2015; Rusu et al., 2016; 2019; Nichol et al., 2018) and meta-critic learning across tasks (Sung et al., 2017). In contrast to this work, the approaches that have shown to be successful in this domain rely entirely on human-engineered learning algorithms.
|
| 122 |
+
|
| 123 |
+
# 5 EXPERIMENTS
|
| 124 |
+
|
| 125 |
+
We investigate the learning and generalization capabilities of MetaGenRL on several continuous control benchmarks including HalfCheetah (Cheetah) and Hopper from MuJoCo (Todorov et al., 2012), and LunarLanderContinuous (Lunar) from OpenAI gym (Brockman et al., 2016). These environments differ significantly in terms of the properties of the underlying system that is to be controlled, and in terms of the dynamics that have to be learned to complete the environment. Hence, by training meta-RL algorithms on one environment and testing on other environments they provide a reasonable measure of out-of-distribution generalization.
|
| 126 |
+
|
| 127 |
+
Table 1: Mean return across multiple seeds (MetaGenRL: 6 meta-train $\times ~ 2$ meta-test seeds, $\mathtt { R L } ^ { 2 }$ : 6 meta-train $\times ~ 2$ meta-test seeds, EPG: 3 meta-train $\times ~ 2$ meta-test seeds) obtained by training randomly initialized agents during meta-test time on previously seen environments (cyan) and on unseen environments (brown). Boldface highlights best meta-learned algorithm. Mean returns (6 seeds) of several human-engineered algorithms are also listed.
|
| 128 |
+
|
| 129 |
+
<table><tr><td colspan="2">Training \Testing</td><td>Cheetah</td><td>Hopper</td><td>Lunar</td></tr><tr><td>Cheetah & Hopper</td><td>MetaGenRL EPG RL²</td><td>2185 -571 5180</td><td>2439 20 289</td><td>18 -540 -479</td></tr><tr><td>Lunar& Cheetah</td><td>MetaGenRL EPG RL² MetaGenRL (40 agents)</td><td>2552 -701 2218 3106</td><td>2363 8 5 2869</td><td>258 -707 283</td></tr><tr><td>Lunar & Hopper & Walker & Ant Cheetah & Lunar & Walker& Ant Cheetah& Hopper& Walker&Ant</td><td></td><td>3331 2541</td><td>2452 2345</td><td>201 -71 -148</td></tr><tr><td>on-policy REINFORCE (GAE)</td><td>PPO DDPG /TD3 off-policy REINFORCE (GAE)</td><td>1455 8315 -88</td><td>1894 2718 1804</td><td>187 288 168</td></tr></table>
|
| 130 |
+
|
| 131 |
+
In our experiments, we will mainly compare to EPG and to $\mathrm { { R L ^ { 2 } } }$ to evaluate the efficacy of our approach. We will also compare to several fixed model-free RL algorithms to measure how well the algorithms meta-learned by MetaGenRL compare to these handcrafted alternatives. Unless otherwise mentioned, we will meta-train MetaGenRL using 20 agents that are distributed equally over the indicated training environments5. Meta-learning uses clipped double-Q learning, delayed policy $\&$ objective updates, and target policy smoothing from TD3 (Fujimoto et al., 2018). We will allow for $6 0 0 K$ environment interactions per agent during meta-training and then meta-test the objective function for $1 M$ interactions. Further details are available in Appendix B.
|
| 132 |
+
|
| 133 |
+
# 5.1 COMPARISON TO PRIOR WORK
|
| 134 |
+
|
| 135 |
+
Evaluating on previously seen environments We meta-train MetaGenRL on Lunar and compare its ability to train a randomly initialized agent at test-time (i.e. using the learned objective function and keeping it fixed) to DDPG, PPO, and on- and off-policy REINFORCE (both using GAE) across multiple seeds. Figure 3a shows that MetaGenRL markedly outperforms both the REINFORCE baselines and PPO. Compared to DDPG, which finds the optimal policy, MetaGenRL performs only slightly worse on average although the presence of outliers increases its variance. In particular, we find that some meta-test agents get ‘stuck’ for some time before reaching the optimal policy (see Section A.2 for additional analysis). Indeed, when evaluating only the best meta-learned objective function that was obtained during meta-training (MetaGenRL (best objective func) in Figure 3a) we are able to observe a strong reduction in variance and even better performance.
|
| 136 |
+
|
| 137 |
+
We also report results (Figure 3a) when meta-training MetaGenRL on both Lunar and Cheetah, and compare to EPG and $\Dot { \mathrm { R L ^ { 2 } } }$ that were meta-trained on these same environments6. For MetaGenRL we were able to obtain similar performance to meta-training on only Lunar in this case. In contrast, for EPG it can be observed that even one billion environment interactions is insufficient to find a good objective function (in Figure 3a quickly dropping below -300). Finally, we find that $\mathtt { R L } ^ { 2 }$ reaches the optimal policy after 100 million meta-training iterations, and that its performance is unaffected by additional steps during testing on Lunar. We note that $\mathtt { R L } ^ { 2 }$ does not separate the policy and the learning rule and indeed in a similar ‘within distribution’ evaluation, $\mathtt { R L } ^ { 2 }$ was found successful (Wang et al., 2016; Duan et al., 2016).
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: Comparing the test-time training behavior of the meta-learned objective functions by MetaGenRL to other (meta) reinforcement learning algorithms. We train randomly initialized agents on (a) environments that were encountered during training, and (b) on significantly different environments that were unseen. Training environments are denoted by $\dagger$ in the legend. All runs are shown with mean and standard deviation computed over multiple random seeds (MetaGenRL: 6 meta-train $\times 2$ meta-test seeds, $\mathrm { { R L ^ { 2 } } }$ : 6 meta-train $\times 2$ meta-test seeds, EPG: 3 meta-train $\times 2$ meta-test seeds, and 6 seeds for all others).
|
| 141 |
+
|
| 142 |
+
Table 1 provides a similar comparison for two other environments. Here we find that in general MetaGenRL is able to outperform the REINFORCE baselines and PPO, and in most cases (except for Cheetah) performs similar to $\mathrm { D D P G } ^ { 7 }$ . We also find that MetaGenRL consistently outperforms EPG, and often $\mathtt { R L } ^ { 2 }$ . For an analysis of meta-training on more than two environments we refer to Appendix A.
|
| 143 |
+
|
| 144 |
+
Generalization to vastly different environments We evaluate the same objective functions learned by MetaGenRL, EPG and the recurrent dynamics by $\mathrm { { R L ^ { 2 } } }$ on Hopper, which is significantly different compared to the meta-training environments. Figure 3b shows that the learned objective function by MetaGenRL continues to outperform both PPO and our implementations of REINFORCE, while the best performing configuration is even able to outperform DDPG.
|
| 145 |
+
|
| 146 |
+
When comparing to related meta-RL approaches, we find that MetaGenRL is significantly better in this case. The performance of EPG remains poor, which was expected given what was observed on previously seen environments. On the other hand, we now find that the $\mathtt { R L } ^ { 2 }$ baseline fails completely (resulting in a flat low-reward evaluation), suggesting that the learned learning rule that was previously found to be successful is in fact entirely overfitted to the environments that were seen during meta-training. We were able to observe similar results when using different train and test environment splits as reported in Table 1, and in Appendix A.
|
| 147 |
+
|
| 148 |
+
# 5.2 ANALYSIS
|
| 149 |
+
|
| 150 |
+
# 5.2.1 META-TRAINING PROGRESSION OF OBJECTIVE FUNCTIONS
|
| 151 |
+
|
| 152 |
+
Previously we focused on test-time training randomly initialized agents using an objective function that was meta-trained for a total of $6 0 0 K$ steps (corresponding to a total of $1 2 M$ environment interactions across the entire population). We will now investigate the quality of the objective functions during meta-training.
|
| 153 |
+
|
| 154 |
+
Figure 4 displays the result of evaluating an objective function on Hopper at different intervals during meta-training on Cheetah and Lunar. Initially ( $2 8 K$ steps) it can be seen that due to lack of meta-training there is only a marginal improvement in the return obtained during test time. However, after only meta-training for $8 6 K$ steps we find (perhaps surprisingly) that the meta-trained objective function is already able to make consistent progress in optimizing a randomly initialized agent during test-time. On the other hand, we observe large variances at test-time during this phase of meta-training. Throughout the remaining stages of meta-training we then observe an increase in convergence speed, more stable updates, and a lower variance across seeds.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: Meta-training with 20 agents on Cheetah and Lunar. We test the objective function at five stages of meta-training by using it to train three randomly initialized agents on Hopper.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 5: We meta-train MetaGenRL using several alternative parametrizations of $L _ { \alpha }$ on a) Lunar and Cheetah, and b) present results of testing on Cheetah. During meta-training a representative example of a single agent population is shown with shaded regions denoting standard deviation across the population. Meta-test results are reported as per usual across 6 meta-train $\times 2$ meta-test seeds.
|
| 161 |
+
|
| 162 |
+
# 5.2.2 ABLATION STUDY
|
| 163 |
+
|
| 164 |
+
We conduct an ablation study of the neural objective function that was described in Section 3.2. In particular, we assess the dependence of $L _ { \alpha }$ on the value estimates $V _ { t } , V _ { t + 1 }$ and on the time component that could to some extent be learned. Other ablations, including limiting access to the action chosen or to the received reward, are expected to be disastrous for generalization to any other environment (or reward function) and therefore not explored.
|
| 165 |
+
|
| 166 |
+
Dependence on $t$ We use a parameterized objective function of the form $L _ { \alpha } ( a _ { t } , r _ { t } , V _ { t } , \pi _ { \phi } ( s _ { t } ) | t \in$ $0 , . . . , T - 1 )$ as in Figure 2 except that it does not receive information about the time-step $t$ at each step. Although information about the current time-step is required in order to learn (for example) a generalized advantage estimate (Schulman et al., 2015b), the LSTM could in principle learn such time tracking on it own, and we expect only minor effects on meta-training and during meta-testing. Indeed in Figure 5b it can be seen that the neural objective function performs well without access to $t$ , although it converges slower on Cheetah during meta-training (Figure 5a).
|
| 167 |
+
|
| 168 |
+
Dependence on $V$ We use a parameterized objective function of the form $L _ { \alpha } ( a _ { t } , r _ { t } , t , \pi _ { \phi } ( s _ { t } ) | t \in$ $0 , . . . , T - 1 )$ as in Figure 2 except that it does not receive any information about the value estimates at time-step $t$ . There exist reinforcement learning algorithms that work without value function estimates (eg. Williams (1992); Schmidhuber & Zhao (1998)), although in the absence of an alternative baseline these often have a large variance. Similar results are observed for this ablation in Figure 5a during meta-training where a possibly large variance appears to affect meta-training. Correspondingly during test-time (Figure 5b) we do not find any meaningful training progress to take place. In contrast, we find that we can remove the dependence on one of the value function estimates, i.e. remove $V _ { t + 1 }$ but keep $V _ { t }$ , which during some runs even increases performance.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 6: We meta-train MetaGenRL on the LunarLander and HalfCheetah environments using one, three, and five inner gradient steps on $\phi$ . Meta-test results are reported across 3 meta-train $\times 2$ meta-test seeds.
|
| 172 |
+
|
| 173 |
+
# 5.2.3 MULTIPLE GRADIENT STEPS
|
| 174 |
+
|
| 175 |
+
We analyze the effect of making multiple gradient updates to the policy using $L _ { \alpha }$ before applying the critic to compute second-order gradients with respect to the objective function parameters as in Equation 6. While in previous experiments we have only considered applying a single update, multiple gradient updates might better capture long term effects of the objective function. At the same time, moving further away from the current policy parameters could reduce the overall quality of the second-order gradients. Indeed, in Figure 6 it can be observed that using 3 gradient steps already slightly increases the variance during test-time training on Hopper and Cheetah after metatraining on LunarLander and Cheetah. Similarly, we find that further increasing the number of gradient steps to 5 harms performance.
|
| 176 |
+
|
| 177 |
+
# 6 CONCLUSION
|
| 178 |
+
|
| 179 |
+
We have presented MetaGenRL, a novel off-policy gradient-based meta reinforcement learning algorithm that leverages a population of DDPG-like agents to meta-learn general objective functions. Unlike related methods the meta-learned objective functions do not only generalize in narrow task distributions but show similar performance on entirely different tasks while markedly outperforming REINFORCE and PPO. We have argued that this generality is due to MetaGenRL’s explicit separation of the policy and learning rule, the functional form of the latter, and training across multiple agents and environments. Furthermore, the use of second order gradients increases MetaGenRL’s sample efficiency by several orders of magnitude compared to EPG (Houthooft et al., 2018).
|
| 180 |
+
|
| 181 |
+
In future work, we aim to further improve the learning capabilities of the meta-learned objective functions, including better leveraging knowledge from prior experiences. Indeed, in our current implementation, the objective function is unable to observe the environment or the hidden state of the (recurrent) policy. These extensions are especially interesting as they may allow more complicated curiosity-based (Schmidhuber, 1991b; 1990; Houthooft et al., 2016; Pathak et al., 2017) or model-based (Schmidhuber, 1990; Weber et al., 2017; Ha & Schmidhuber, 2018) algorithms to be learned. To this extent, it will be important to develop introspection methods that analyze the learned objective function and to scale MetaGenRL to make use of many more environments and agents.
|
| 182 |
+
|
| 183 |
+
# ACKNOWLEDGEMENTS
|
| 184 |
+
|
| 185 |
+
We thank Paulo Rauber, Imanol Schlag, and the anonymous reviewers for their feedback. This work was supported by the ERC Advanced Grant (no: 742870) and computational resources by the Swiss National Supercomputing Centre (CSCS, project: s978). We also thank NVIDIA Corporation for donating a DGX-1 as part of the Pioneers of AI Research Award and to IBM for donating a Minsky machine.
|
| 186 |
+
|
| 187 |
+
# REFERENCES
|
| 188 |
+
|
| 189 |
+
Ferran Alet, Martin F Schneider, Tomas Lozano-Perez, and Leslie Pack Kaelbling. Meta-learning curiosity algorithms. In International Conference on Learning Representations, 2020.
|
| 190 |
+
|
| 191 |
+
Marcin Andrychowicz, Misha Denil, Sergio Gomez Colmenarejo, Matthew W. Hoffman, David ´ Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, pp. 3988– 3996, 6 2016.
|
| 192 |
+
|
| 193 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer Normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 194 |
+
|
| 195 |
+
Sarah Bechtle, Artem Molchanov, Yevgen Chebotar, Edward Grefenstette, Ludovic Righetti, Gaurav Sukhatme, and Franziska Meier. Meta-learning via learned loss. arXiv preprint arXiv:1906.05374, 2019.
|
| 196 |
+
|
| 197 |
+
Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a synaptic learning rule. Universite´ de Montreal, 1990. ´
|
| 198 |
+
|
| 199 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 200 |
+
|
| 201 |
+
Jeff Clune. AI-GAs: AI-generating algorithms, an alternate paradigm for producing general artificial intelligence. arXiv preprint arXiv:1905.10985, 2019.
|
| 202 |
+
|
| 203 |
+
P Dayan and G Hinton. Feudal Reinforcement Learning. In D S Lippman, J E Moody, and D S Touretzky (eds.), Advances in Neural Information Processing Systems (NIPS) 5, pp. 271–278. Morgan Kaufmann, 1993.
|
| 204 |
+
|
| 205 |
+
Yan Duan, John Schulman, Xi Chen, Peter L. Bartlett, Ilya Sutskever, and Pieter Abbeel. RLˆ2: Fast Reinforcement Learning via Slow Reinforcement Learning. arXiv preprint arXiv:1611.02779, 2016.
|
| 206 |
+
|
| 207 |
+
Chelsea Finn and Sergey Levine. Meta-Learning and Universality: Deep Representations and Gradient Descent can Approximate any Learning Algorithm. In International Conference on Learning Representations, 2018.
|
| 208 |
+
|
| 209 |
+
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, 2017.
|
| 210 |
+
|
| 211 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. Proceedings of Machine Learning Research, 80:1587–1596, 2018.
|
| 212 |
+
|
| 213 |
+
Felix A Gers, Jurgen Schmidhuber, and Fred Cummins. Learning to Forget: Continual Prediction ¨ with LSTM. Neural Computation, 12(10):2451–2471, 2000.
|
| 214 |
+
|
| 215 |
+
Erin Grant, Chelsea Finn, Sergey Levine, Trevor Darrell, and Thomas Griffiths. Recasting GradientBased Meta-Learning as Hierarchical Bayes. In International Conference on Learning Representations, 2018.
|
| 216 |
+
|
| 217 |
+
David Ha and Jurgen Schmidhuber. Recurrent world models facilitate policy evolution. In ¨ Advances in Neural Information Processing Systems, pp. 2450–2462, 2018.
|
| 218 |
+
|
| 219 |
+
S Hochreiter and J Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735–1780, 1997.
|
| 220 |
+
|
| 221 |
+
Sepp Hochreiter, A. Steven Younger, and Peter R. Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, 2001.
|
| 222 |
+
|
| 223 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. VIME: Variational Information Maximizing Exploration. In Advances in Neural Information Processing Systems, pp. 1109–1117, 2016.
|
| 224 |
+
|
| 225 |
+
Rein Houthooft, Richard Y. Chen, Phillip Isola, Bradly C. Stadie, Filip Wolski, Jonathan Ho, and Pieter Abbeel. Evolved Policy Gradients. In Advances in Neural Information Processing Systems, pp. 5400–5409, 2018.
|
| 226 |
+
|
| 227 |
+
Max Jaderberg, Wojciech M Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia Castaneda, Charles Beattie, Neil C Rabinowitz, Ari S Morcos, Avraham Ruderman, Nico- ˜ las Sonnerat, Tim Green, Louise Deason, Joel Z Leibo, David Silver, Demis Hassabis, Koray Kavukcuoglu, and Thore Graepel. Human-level performance in 3D multiplayer games with population-based reinforcement learning. Science (New York, N.Y.), 364(6443):859–865, 5 2019.
|
| 228 |
+
|
| 229 |
+
Diederik P Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In International Conference on Learning Representations, 2015.
|
| 230 |
+
|
| 231 |
+
Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. In International Conference on Learning Representations, 12 2014.
|
| 232 |
+
|
| 233 |
+
Werner M Kistler, Wulfram Gerstner, and J Leo van Hemmen. Reduction of the Hodgkin-Huxley equations to a single-variable threshold model. Neural Computation, 9(5):1015–1045, 1997.
|
| 234 |
+
|
| 235 |
+
Ke Li and Jitendra Malik. Learning to Optimize. arXiv preprint arXiv:1606.01885, 2016.
|
| 236 |
+
|
| 237 |
+
Ke Li and Jitendra Malik. Learning to Optimize Neural Nets. arXiv preprint arXiv:1703.00441, 2017.
|
| 238 |
+
|
| 239 |
+
Eric Liang, Richard Liaw, Philipp Moritz, Robert Nishihara, Roy Fox, Ken Goldberg, Joseph E Gonzalez, Michael I Jordan, and Ion Stoica. Rllib: Abstractions for distributed reinforcement learning. In International Conference on Machine Learning, pp. 3053–3062, 2018.
|
| 240 |
+
|
| 241 |
+
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. In International Conference on Learning Representations, 2016.
|
| 242 |
+
|
| 243 |
+
Luke Metz, Niru Maheswaranathan, Brian Cheung, and Jascha Sohl-Dickstein. Learning Unsupervised Learning Rules. In International Conference on Learning Representations, 3 2019.
|
| 244 |
+
|
| 245 |
+
Nikhil Mishra, Mostafa Rohaninejad, and Xi UC Chen Pieter Abbeel Berkeley. A Simple Neural Attentive Meta-Learner. In International Conference on Learning Representations, 2018.
|
| 246 |
+
|
| 247 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing Atari with Deep Reinforcement Learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 248 |
+
|
| 249 |
+
Alex Nichol, Vicki Pfau, Christopher Hesse, Oleg Klimov, and John Schulman Openai. Gotta Learn Fast: A New Benchmark for Generalization in RL. arXiv preprint arXiv:1804.03720, 2018.
|
| 250 |
+
|
| 251 |
+
Scott Niekum, Lee Spector, and Andrew Barto. Evolution of reward functions for reinforcement learning. In Proceedings of the 13th annual conference companion on Genetic and evolutionary computation, pp. 177–178, 2011.
|
| 252 |
+
|
| 253 |
+
Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-Mimic: Deep Multitask and Transfer Reinforcement Learning. arXiv preprint arXiv:1511.06342, 2015.
|
| 254 |
+
|
| 255 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In 34th International Conference on Machine Learning, ICML 2017, volume 6, pp. 4261–4270, 2017. ISBN 9781510855144. doi: 10.1109/CVPRW.2017.70.
|
| 256 |
+
|
| 257 |
+
Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, and others. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018.
|
| 258 |
+
|
| 259 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic Backpropagation and Approximate Inference in Deep Generative Models. In International Conference on Machine Learning, pp. 1278–1286, 2014. ISBN 9781634393973. doi: 10.1051/0004-6361/201527329.
|
| 260 |
+
|
| 261 |
+
Andrei A. Rusu, Sergio Gomez Colmenarejo, Caglar Gulcehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy Distillation. In International Conference on Learning Representations, 2016.
|
| 262 |
+
|
| 263 |
+
Andrei A. Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-Learning with Latent Embedding Optimization. In International Conference on Learning Representations, 7 2019.
|
| 264 |
+
|
| 265 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. MetaLearning with Memory-Augmented Neural Networks. In International conference on machine learning, pp. 1842–1850, 2016.
|
| 266 |
+
|
| 267 |
+
J Schmidhuber. Learning to Generate Sub-Goals for Action Sequences. In T Kohonen, K Makisara, ¨ O Simula, and J Kangas (eds.), Artificial Neural Networks, pp. 967–972. Elsevier Science Publishers B.V., North-Holland, 1991a.
|
| 268 |
+
|
| 269 |
+
J Schmidhuber. On learning how to learn learning strategies. Technical Report FKI-198-94, Fakultat¨ fur Informatik, Technische Universit ¨ at M¨ unchen, 1994. ¨
|
| 270 |
+
|
| 271 |
+
J Schmidhuber and J Zhao. Direct policy search and uncertain policy evaluation. Technical Report IDSIA-50-98, IDSIA, Lugano, Switzerland, 1998.
|
| 272 |
+
|
| 273 |
+
Jurgen Schmidhuber. Evolutionary principles in self-referential learning. Diploma thesis, Institut ¨ fur Informatik, Technische Universit¨ at M¨ unchen, 1987.¨
|
| 274 |
+
|
| 275 |
+
Jurgen Schmidhuber. Making the world differentiable: On Using Fully Recurrent Self-Supervised ¨ Neural Networks for Dynamic Reinforcement Learning and Planning in Non-Stationary Environments. Technical Report FKI-126-90 (revised), Institut fur Informatik, Technische Universit ¨ at¨ Munchen, 11 1990.¨
|
| 276 |
+
|
| 277 |
+
Jurgen Schmidhuber. A Possibility for Implementing Curiosity and Boredom in Model-Building ¨ Neural Controllers. In J A Meyer and S W Wilson (eds.), Proc. of the International Conference on Simulation of Adaptive Behavior: From Animals to Animats, pp. 222–227. MIT Press/Bradford Books, 1991b.
|
| 278 |
+
|
| 279 |
+
Jurgen Schmidhuber. A self-referential weight matrix. In ¨ Proceedings of the International Conference on Artificial Neural Networks, Amsterdam, pp. 446–451. Springer, 1993.
|
| 280 |
+
|
| 281 |
+
John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust Region Policy Optimization. In International conference on machine learning, pp. 1889–1897, 2015a. doi: 10.1063/1.4927398.
|
| 282 |
+
|
| 283 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. HighDimensional Continuous Control Using Generalized Advantage Estimation. arXiv preprint arXiv:1506.02438, 2015b.
|
| 284 |
+
|
| 285 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal Policy Optimization Algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 286 |
+
|
| 287 |
+
David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In 31st International Conference on Machine Learning, ICML 2014, volume 1, pp. 605–619, 1 2014. ISBN 9781634393973.
|
| 288 |
+
|
| 289 |
+
Satinder Singh, Satinder Singh, A.G. Barto, A.G. Barto, Nuttapong Chentanez, and Nuttapong Chentanez. Intrinsically motivated reinforcement learning. 18th Annual Conference on Neural Information Processing Systems (NIPS), 17:1281–1288, 2004. ISSN 1943-0604. doi: 10.1109/TAMD.2010.2051031.
|
| 290 |
+
|
| 291 |
+
Flood Sung, Li Zhang, Tao Xiang, Timothy Hospedales, and Yongxin Yang. Learning to learn: Meta-critic networks for sample efficient learning. arXiv preprint arXiv:1706.09529, 2017.
|
| 292 |
+
|
| 293 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 294 |
+
|
| 295 |
+
Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016.
|
| 296 |
+
|
| 297 |
+
Theophane Weber, S ´ ebastien Racani ´ ere, David P. Reichert, Lars Buesing, Arthur Guez, \` Danilo Jimenez Rezende, Adria Puigdomenech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, \` Razvan Pascanu, Peter Battaglia, David Silver, and Daan Wierstra. Imagination-Augmented Agents for Deep Reinforcement Learning. In Advances in neural information processing systems, pp. 5690–5701, 2017.
|
| 298 |
+
|
| 299 |
+
M Wiering and J Schmidhuber. HQ-Learning: Discovering Markovian Subgoals for Non-Markovian Reinforcement Learning. Technical Report IDSIA-95-96, IDSIA, 1996.
|
| 300 |
+
|
| 301 |
+
Daan Wierstra, Tom Schaul, Jan Peters, and Jurgen Schmidhuber. Natural Evolution Strategies. ¨ In 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), pp. 3381–3387, 2008.
|
| 302 |
+
|
| 303 |
+
R J Williams. On the Use of Backpropagation in Associative Reinforcement Learning. In IEEE International Conference on Neural Networks, San Diego, volume 2, pp. 263–270, 1988.
|
| 304 |
+
|
| 305 |
+
Ronald J Williams. Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning. Machine Learning, 8:229–256, 1992.
|
| 306 |
+
|
| 307 |
+
Zhongwen Xu, Hado Van Hasselt, and David Silver. Meta-gradient reinforcement learning. In Advances in Neural Information Processing Systems, volume 2018-Decem, pp. 2396–2407, 5 2018.
|
| 308 |
+
|
| 309 |
+
Jaesik Yoon, Taesup Kim, Ousmane Dia, Sungwoong Kim, Yoshua Bengio, and Sungjin Ahn. Bayesian Model-Agnostic Meta-Learning. In Advances in Neural Information Processing Systems, pp. 7332–7342, 2018.
|
| 310 |
+
|
| 311 |
+
Tianhe Yu, Chelsea Finn, Annie Xie, Sudeep Dasari, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot imitation from observing humans via domain-adaptive meta-learning. International Conference on Learning Representations, Workshop Track, 2018.
|
| 312 |
+
|
| 313 |
+
Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On learning intrinsic rewards for policy gradient methods. In Advances in Neural Information Processing Systems, pp. 4644–4654, 2018.
|
| 314 |
+
|
| 315 |
+
# A ADDITIONAL RESULTS
|
| 316 |
+
|
| 317 |
+
# A.1 ALL TRAINING AND TEST REGIMES
|
| 318 |
+
|
| 319 |
+
In the main text, we have shown several combinations of meta-training, and testing environments.
|
| 320 |
+
We will now show results for all combinations, including the respective human engineered baselines.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 7: Comparing the test-time training behavior of the meta-learned objective functions by MetaGenRL to other (meta) reinforcement learning algorithms on Hopper. We consider within distribution testing (a), and out of distribution testing (b) by varying the meta-training environments (denoted by $\dagger .$ ) for the meta-RL approaches. All runs are shown with mean and standard deviation computed over multiple random seeds (MetaGenRL: 6 meta-train $\times 2$ meta-test seeds, $\mathtt { R L } ^ { 2 }$ : 6 metatrain $\times 2$ meta-test seeds, EPG: 3 meta-train $\times 2$ meta-test seeds, and 6 seeds for all others).
|
| 324 |
+
|
| 325 |
+
Hopper On Hopper (Figure 7) we find that MetaGenRL works well, both in terms of generalization to previously seen environments, and to unseen environments. The PPO, REINFORCE, $\mathrm { { R L ^ { 2 } } }$ , and EPG baselines are outperformed significantly. Regarding $\mathrm { { R L ^ { 2 } } }$ we observe that it is only able to obtain reward when Hopper was included during meta-training, although its performance is generally poor. Regarding EPG, we observe some learning progress during meta-testing on Hopper after meta-training on Cheetah and Hopper (Figure 7a), although it drops back down quickly as test-time training proceeds. In contrast, when meta-testing on Hopper after meta-training on Cheetah and Lunar (Figure 7b) no test-time training progress is observed at all.
|
| 326 |
+
|
| 327 |
+
Cheetah Similar results are observed in Figure 8 for Cheetah, where MetaGenRL outperforms PPO and REINFORCE significantly. On the other hand, it can be seen that DDPG notably outperforms MetaGenRL on this environment. It will be interesting to further study these differences in the future to improve the expressibility of our approach. Regarding $\mathrm { { R L ^ { 2 } } }$ and EPG only within distribution generalization results are available due to Cheetah having larger observations and / or action spaces compared to Hopper and Lunar. We observe that $\mathtt { R L } ^ { 2 }$ performs similar to our earlier findings on Hopper but significantly improves in terms of within-distribution generalization (likely due to greater overfitting, as was consistently observed for other splits). EPG shows initially more promise on within distribution generalization (Figure 8a), but ends up like before.
|
| 328 |
+
|
| 329 |
+
Lunar On Lunar (Figure 9) we find that MetaGenRL is only marginally better compared to the REINFORCE and PPO baselines in terms of within distribution generalization and worse in terms of out of distribution generalization. Analyzing this result reveals that although many of the runs train rather well, some get stuck during the early stages of training without or only delayed recovering. These outliers lead to a seemingly very large variance for MetaGenRL in Figure 9b. We will provide a more detailed analysis of this result in Section A.2. If we focus on the best performing objective function then we observe competitive performance to DDPG (Figure 9a). Nonetheless, we notice that the objective function trained on Hopper generalizes worse to Lunar, despite our earlier result that objective functions trained on Lunar do in fact generalize well to Hopper. MetaGenRL is still able to outperform both $\mathrm { { R L ^ { 2 } } }$ and EPG in terms of out of distribution generalization. We do note that EPG is able to meta-learn objective functions that are able to improve to some extent during test time.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 8: Comparing the test-time training behavior of the meta-learned objective functions by MetaGenRL to other (meta) reinforcement learning algorithms on Cheetah. We consider within distribution testing (a), and out of distribution testing (b) by varying the meta-training environments (denoted by $\dagger .$ ) for the meta-RL approaches. All runs are shown with mean and standard deviation computed over multiple random seeds (MetaGenRL: 6 meta-train $\times 2$ meta-test seeds, $\mathtt { R L } ^ { 2 }$ : 6 metatrain $\times 2$ meta-test seeds, EPG: 3 meta-train $\times 2$ meta-test seeds, and 6 seeds for all others).
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 9: Comparing the test-time training behavior of the meta-learned objective functions by MetaGenRL to other (meta) reinforcement learning algorithms on Lunar. We consider within distribution testing (a), and out of distribution testing (b) by varying the meta-training environments (denoted by $\dagger .$ ) for the meta-RL approaches. All runs are shown with mean and standard deviation computed over multiple random seeds (MetaGenRL: 6 meta-train $\times 2$ meta-test seeds, $\mathrm { { R L ^ { 2 } } }$ : 6 meta-train $\times 2$ meta-test seeds, EPG: 3 meta-train $\times 2$ meta-test seeds, and 6 seeds for all others).
|
| 336 |
+
|
| 337 |
+
Comparing final scores An overview of the final scores that were obtained for MetaGenRL in comparison to the human engineered baselines is shown in Table 2. It can be seen that MetaGenRL outperforms PPO and off-/on-policy REINFORCE in most configurations while DDPG with TD3 tricks remains stronger on two of the three environments. Note that DDPG is currently not among the representable algorithms by MetaGenRL.
|
| 338 |
+
|
| 339 |
+
# A.2 STABILITY OF LEARNED OBJECTIVE FUNCTIONS
|
| 340 |
+
|
| 341 |
+
In the results presented in Figure 9 on Lunar we observed a seemingly large variance for MetaGenRL that was due to outliers. Indeed, when analyzing the individual runs meta-trained on Lunar and tested on Lunar we found that that one of the runs converged to a local optimum early on during training and was unable to recover from this afterwards. On the other hand, we also observed that runs can be ‘stuck’ for a long time to then make very fast learning progress. It suggests that the objective function may sometimes experience difficulties in providing meaningful updates to the policy parameters during the early stages of training.
|
| 342 |
+
|
| 343 |
+
Table 2: Agent mean return across multiple seeds (MetaGenRL: 6 meta-train $\times 2$ meta-test seeds, and 6 seeds for all others) for meta-test training on previously seen environments (cyan) and on unseen (different) environments (brown) compared to human engineered baselines.
|
| 344 |
+
|
| 345 |
+
<table><tr><td></td><td>Training (below)/Test (right)</td><td>Cheetah</td><td>Hopper</td><td>Lunar</td></tr><tr><td>MetaGenRL (20 agents)</td><td>Cheetah & Hopper</td><td>2185</td><td>2433</td><td>18</td></tr><tr><td></td><td>Cheetah & Lunar</td><td>2551</td><td>2363</td><td>258</td></tr><tr><td></td><td>Hopper & Lunar</td><td>4160</td><td>2966</td><td>146</td></tr><tr><td></td><td>Hopper</td><td>3646</td><td>2937</td><td>-62</td></tr><tr><td>MetaGenRL (40 agents)</td><td>Lunar</td><td>4366</td><td> 2717</td><td>244</td></tr><tr><td></td><td>Lunar & Hopper & Walker & Ant</td><td>3106</td><td>2869</td><td>201</td></tr><tr><td></td><td>Cheetah&Lunar&Walker&Ant</td><td>3331</td><td>2452</td><td>-71</td></tr><tr><td></td><td>Cheetah& Hopper& Walker&Ant</td><td>2541</td><td>2345</td><td>-148</td></tr><tr><td>PPO</td><td></td><td>1455</td><td>1894</td><td>187</td></tr><tr><td>DDPG/TD3</td><td></td><td>8315</td><td>2718</td><td>288</td></tr><tr><td>off-policyREINFORCE(GAE)</td><td></td><td>-88</td><td>1804</td><td>168</td></tr><tr><td>on-policy REINFORCE (GAE)</td><td></td><td>38</td><td>565</td><td>120</td></tr></table>
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 10: Meta-training with 20 agents on LunarLander. We meta-test the objective function at different stages in training on the same environment.
|
| 349 |
+
|
| 350 |
+
We have further analyzed this issue by evaluating one of the objective functions at several intervals throughout meta-training in Figure 10. From the meta-training curve (bottom) it can be seen that meta-training in Lunar converges very early. This means that from then on, updates to the objective function will be based on mostly converged policies. As the test-time plots show, these additional updates appear to negatively affect test-time performance. We hypothesize that the objective function essentially ‘forgets’ about the early stages of training a randomly initialized agent, by only incorporating information about good performing agents. A possible solution to this problem would be to keep older policies in the meta-training agent population or use early stopping.
|
| 351 |
+
|
| 352 |
+
Finally, if we exclude four random seeds (of 12), we indeed find a significant reduction in the variance (and increase in the mean) of the results observed for MetaGenRL (see Figure 11).
|
| 353 |
+
|
| 354 |
+
# A.3 ABLATION OF AGENT POPULATION SIZE AND UNIQUE ENVIRONMENTS
|
| 355 |
+
|
| 356 |
+
In our experiments we have used a population of 20 agents during meta-training to ensure diversity in the conditions under which the objective function needs to optimize. The size of this population is a crucial parameter for a stable meta-optimization. Indeed, in Figure 12 it can be seen that metatraining becomes increasingly unstable as the number of agents in the population decreases.
|
| 357 |
+
|
| 358 |
+
Using a similar argument, one would expect to gain from increasing the number of distinct environments (or agents) during meta-training. In order to verify this, we have evaluated two additional settings: Meta-training on Cheetah & Lunar & Walker & Ant with 20 and 40 agents respectively. Figure 13 shows the result of meta-testing on Hopper for these experiments (also see the final results reported for 40 agents in Table 2). Unexpectedly, we find that increasing the number of distinct environments does not yield a significant improvement and, in fact, sometimes even decrease performance. One possibility is that this is due to the simple form of the objective function under consideration, which has no access to the environment observations to efficiently distinguish between them. Another possibility is that MetaGenRL’s hyperparameters require additional tuning in order to be compatible with these setups.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 11: The left plot shows all 12 random seeds on the meta-test environment Lunar while the right has the 4 worst random seeds removed. The variance is now reduced significantly.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 12: Stable meta-training requires a large population size of at least 20 agents. Metatraining performance is shown for a single run with the mean and standard deviation across the agent population.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 13: Meta-training on Cheetah, Lunar, Walker, and Ant with 20 or 40 agents; metatesting on the out-of-distribution Hopper environment. We compare to previous MetaGenRL configurations.
|
| 368 |
+
|
| 369 |
+
# B EXPERIMENT DETAILS
|
| 370 |
+
|
| 371 |
+
In the following we describe all experimental details regarding the architectures used, meta-training, hyperparameters, and baselines. The code to reproduce our experiments is available at http: //louiskirsch.com/code/metagenrl.
|
| 372 |
+
|
| 373 |
+
# B.1 NEURAL OBJECTIVE FUNCTION ARCHITECTURE
|
| 374 |
+
|
| 375 |
+
Neural Architecture In this work we use an LSTM to implement the objective function (Figure 2). The LSTM runs backwards in time over the state, action, and reward tuples that were encountered during the trajectory $\tau$ under consideration. At each step $t$ the LSTM receives as input the reward $r _ { t }$ , value estimates of the current and previous state $V _ { t } , V _ { t + 1 }$ , the current timestep $t$ and finally the action that was taken at the current timestep $a _ { t }$ in addition to the action as determined by the current policy $\pi _ { \phi } ( s _ { t } )$ . The actions are first processed by one dimensional convolutional layers striding over the action dimension followed by a reduction to the mean. This allows for different action sizes between environments. Let $A ^ { ( B ) } \in \mathbb { R } ^ { 1 \times D }$ be the action from the replay buffer, $A ^ { ( \pi ) } \in \mathbb { R } ^ { 1 \times D }$ be the action predicted by the policy, and $W \in \mathbb { R } ^ { 2 \times N }$ a learnable matrix corresponding to $N$ outgoing units, then the actions are transformed by
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\frac { 1 } { D } \sum _ { i = 1 } ^ { D } ( [ A ^ { ( B ) } , A ^ { ( \pi ) } ] ^ { T } W ) _ { i } ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
where $[ a , b ]$ is a concatenation of $a$ and $b$ along the first axis. This corresponds to a convolution with kernel size 1 and stride 1. Further transformations with non-linearities can be added after applying $W$ , if necessary. We found it helpful (but not strictly necessary) to use ReLU activations for half of the units and square activations for the other half.
|
| 382 |
+
|
| 383 |
+
At each time-step the LSTM outputs a scalar value $l _ { t }$ (bounded between $- \eta$ and $\eta$ using a scaled tanh activation), which are summed to obtain the value of the neural objective function. Differentiating this value with respect to the policy parameters $\phi$ then yields gradients that can be used to improve $\pi _ { \phi }$ . We only allow gradients to flow backwards through $\pi _ { \phi } ( s _ { t } )$ to $\phi$ . This implementation is closely related to the functional form of a REINFORCE (Williams, 1992) estimator using the generalized advantage estimation (Schulman et al., 2015b).
|
| 384 |
+
|
| 385 |
+
All feed-forward networks (critic and policy) use ReLU activations and layer normalization (Ba et al., 2016). The LSTM uses tanh activations for cell and hidden state transformations, sigmoid activations for the gates. The input time $t$ is normalized between 0 at the beginning of the episode and 1 at the final transition. Any other hyper-parameters can be seen in Table 3.
|
| 386 |
+
|
| 387 |
+
Extensibility The expressability of the objective function can be further increased through several means. One possibility is to add the entire sequence of state observations $O 1 { : } T$ to its inputs, or by introducing a bi-directional LSTM. Secondly, additional information about the policy (such as the hidden state of a recurrent policy) can be provided to $L$ . Although not explored in this work, this would in principle allow one to learn an objective that encourages certain representations to emerge, e.g. a predictive representation about future observations, akin to a world model (Schmidhuber, 1990; Ha & Schmidhuber, 2018; Weber et al., 2017). In turn, these could create pressure to adapt the policy’s actions to explore unknown dynamics in the environment (Schmidhuber, 1991b; 1990; Houthooft et al., 2016; Pathak et al., 2017).
|
| 388 |
+
|
| 389 |
+
# B.2 META-TRAINING
|
| 390 |
+
|
| 391 |
+
Annealing with DDPG At the beginning of meta-training (learning $L _ { \alpha . }$ ), the objective function is randomly initialized and thus does not make sensible updates to the policies. This can lead to irreversibly breaking the policies early during training. Our current implementation circumvents this issue by linearly annealing $\nabla _ { \phi } L _ { \alpha }$ the first 10k timesteps $\sim 2 \%$ of all timesteps) with DDPG $\nabla _ { \phi } Q _ { \theta } \big ( s _ { t } , \pi _ { \phi } \big ( s _ { t } \big ) \big )$ . Preliminary experiments suggested that an exponential learning rate schedule on the gradient of $\nabla _ { \phi } L _ { \alpha }$ for the first 10k steps can replace the annealing with DDPG. The learning rate anneals exponentially between a learning rate of zero and 1e-3. However, in some rare cases this may still lead to unsuccessful training runs, and thus we have omitted this approach from the present work.
|
| 392 |
+
|
| 393 |
+
Standard training During training, the critic is updated twice as many times as the policy and objective function, similar to TD3 (Fujimoto et al., 2018). One gradient update with data sampled from the replay buffer is applied for every timestep collected from the environment. The gradient with respect to $\phi$ in Equation 6 is combined with $\phi$ using a fixed learning rate in the standard way, all other parameter updates use Adam (Kingma & Ba, 2015) with the default parameters. Any other hyper-parameters can be seen in Table 3 and Table 4.
|
| 394 |
+
|
| 395 |
+
Using additional gradient steps In our experiments (Section 5.2.3) we analyzed the effect of applying multiple gradient updates to the policy using $L _ { \alpha }$ before applying the critic to compute second-order gradients with respect to the objective function parameters. For two updates, this gives
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\begin{array} { r l } { \nabla _ { \alpha } Q _ { \theta } ( s _ { t } , \pi _ { \phi ^ { \dagger } } ( s _ { t } ) ) \mathrm { ~ w i t h ~ } \phi ^ { \dagger } = \phi ^ { \prime } - \nabla _ { \phi ^ { \prime } } L _ { \alpha } ( \tau _ { 1 } , x ( \phi ^ { \prime } ) , V ) } & { } \\ { \mathrm { ~ a n d ~ } \phi ^ { \prime } = \phi - \nabla _ { \phi } L _ { \alpha } ( \tau _ { 2 } , x ( \phi ) , V ) } & { } \end{array}
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
and can be extended to more than two correspondingly. Additionally, we use disjoint mini batches of data $\tau { : } ~ \tau _ { 1 } , \tau _ { 2 }$ . When updating the policy using $\nabla _ { \phi } L _ { \alpha }$ we continue to use only a single gradient step.
|
| 402 |
+
|
| 403 |
+
# B.3 BASELINES
|
| 404 |
+
|
| 405 |
+
$\mathbf { R L } ^ { 2 }$ The implementation for $\mathtt { R L } ^ { 2 }$ mimics the paper by Duan et al. (Duan et al., 2016). However, we were unable to achieve good results with TRPO (Schulman et al., 2015a) on the MuJoCo environments and thus used PPO (Schulman et al., 2017) instead. The PPO hyperparameters and implementation are taken from rllib (Liang et al., 2018). Our implementation uses an LSTM with 64 units and does not reset the state of the LSTM for two episodes in sequence. Resetting after additional episodes were given did not improve training results. Different action and observation dimensionalities across environments were handled by using an environment wrapper that pads both with zeros appropriately.
|
| 406 |
+
|
| 407 |
+
EPG We use the official EPG code base https://github.com/openai/EPG from the original paper (Houthooft et al., 2018). The hyperparameters are taken from the paper, $V = 6 4$ noise vectors, an update frequency of $M = 6 4$ , and 128 updates for every inner loop, resulting in an inner loop length of 8196 steps. During meta-test training, we run with the same update frequency for a total of 1 million steps.
|
| 408 |
+
|
| 409 |
+
PPO & On-Policy REINFORCE with GAE We use the tuned implementations from https: //spinningup.openai.com/en/latest/spinningup/bench.html which include a GAE (Schulman et al., 2015b) baseline.
|
| 410 |
+
|
| 411 |
+
Off-Policy Reinforce with GAE The implementation is equivalent to MetaGenRL except that the objective function is fixed to be the REINFORCE estimator with a GAE (Schulman et al., 2015b) baseline. Thus, experience is sampled from a replay buffer. We have also experimented with an importance weighted unbiased estimator but this resulted in poor performance.
|
| 412 |
+
|
| 413 |
+
DDPG Our implementation is based on https://spinningup.openai.com/en/ latest/spinningup/bench.html and uses the same TD3 tricks (Fujimoto et al., 2018) and hyperparameters (where applicable) that MetaGenRL uses.
|
| 414 |
+
|
| 415 |
+
Table 3: Architecture hyperparameters
|
| 416 |
+
|
| 417 |
+
<table><tr><td>Parameter</td><td> Value</td></tr><tr><td>Critic number of layers</td><td>3</td></tr><tr><td>Critic number of units</td><td>350</td></tr><tr><td>Policy number of layers</td><td>3</td></tr><tr><td>Policy number of units</td><td>350</td></tr><tr><td>Objective function LSTMunits</td><td>32</td></tr><tr><td>Objective function action conv layers</td><td>3</td></tr><tr><td>Objective function action conv filters Error bound n</td><td>32 1000</td></tr></table>
|
| 418 |
+
|
| 419 |
+
Table 4: Training hyperparameters
|
| 420 |
+
|
| 421 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Truncated episode length Global norm gradient clipping</td><td>20</td></tr><tr><td>Critic learning rate 入1</td><td>1.0 1e-3</td></tr><tr><td>Policy learning rate 入2 Second order learning rate 入3</td><td>1e-3</td></tr><tr><td>Obj. func. learning rate 入4</td><td>1e-3 1e-3</td></tr><tr><td>Critic noise Critic noise clip</td><td>0.2</td></tr><tr><td>Target network update speed Discount factor</td><td>0.5 0.005</td></tr><tr><td>Batch size Random exploration timesteps Policy gaussian noise std Timesteps per agent</td><td>0.99 100 10000 0.1</td></tr></table>
|
md/train/S1xNEhR9KX/S1xNEhR9KX.md
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE SENSITIVITY OF ADVERSARIAL ROBUSTNESS TO INPUT DATA DISTRIBUTIONS
|
| 2 |
+
|
| 3 |
+
Gavin Weiguang Ding, Kry Yik Chau Lui, Xiaomeng Jin, Luyu Wang, Ruitong Huang Borealis AI Canada
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Neural networks are vulnerable to small adversarial perturbations. Existing literature largely focused on understanding and mitigating the vulnerability of learned models. In this paper, we demonstrate an intriguing phenomenon about the most popular robust training method in the literature, adversarial training: Adversarial robustness, unlike clean accuracy, is sensitive to the input data distribution. Even a semantics-preserving transformations on the input data distribution can cause a significantly different robustness for the adversarial trained model that is both trained and evaluated on the new distribution. Our discovery of such sensitivity on data distribution is based on a study which disentangles the behaviors of clean accuracy and robust accuracy of the Bayes classifier. Empirical investigations further confirm our finding. We construct semantically-identical variants for MNIST and CIFAR10 respectively, and show that standardly trained models achieve comparable clean accuracies on them, but adversarially trained models achieve significantly different robustness accuracies. This counter-intuitive phenomenon indicates that input data distribution alone can affect the adversarial robustness of trained neural networks, not necessarily the tasks themselves. Lastly, we discuss the practical implications on evaluating adversarial robustness, and make initial attempts to understand this complex phenomenon.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural networks have been demonstrated to be vulnerable to adversarial examples (Szegedy et al., 2013; Biggio et al., 2013). Since the first discovery of adversarial examples, great progress has been made in constructing stronger adversarial attacks (Goodfellow et al., 2014; Moosavi-Dezfooli et al., 2016; Madry et al., 2017; Carlini and Wagner, 2017). In contrast, defenses fell behind in the arms race (Carlini and Wagner, 2016; Athalye et al., 2017; 2018). Recently a line of works have been focusing on understanding the difficulty in achieving adversarial robustness from the perspective of data distribution. In particular, Tsipras et al. (2019) demonstrated the inevitable tradeoff between robustness and clean accuracy in some particular examples. Schmidt et al. (2018) showed that the sample complexity of “learning to be robust” learning could be significantly higher than that of “learning to be accurate”.
|
| 12 |
+
|
| 13 |
+
In this paper, we contribute to this growing literature from a new angle, by studying the relationship between adversarial robustness and the input data distribution. We focus on the adversarial training method, arguably the most popular defense method so far due to its simplicity, effectiveness and scalability (Goodfellow et al., 2014; Huang et al., 2015; Kurakin et al., 2016; Madry et al., 2017; Erraqabi et al., 2018). Our main contribution is the finding that adversarial robustness is highly sensitive to the input data distribution:
|
| 14 |
+
|
| 15 |
+
# A semantically-lossless shift on the data distribution could result in a drastically different robustness for adversarially trained models.
|
| 16 |
+
|
| 17 |
+
Note that this is different from the transferability of a fixed model that is trained on one data distribution but tested on another distribution. Even retraining the model on the new data distribution may give us a completely different adversarial robustness on the same new distribution. This is also in sharp contrast to the clean accuracy of standard training, which, as we show in later sections, is insensitive to such shifts. To our best knowledge, our paper is the first work in the literature that demonstrates such sensitivity.
|
| 18 |
+
|
| 19 |
+
Our investigation is motivated by the empirical observations on the MNIST dataset and the CIFAR10 dataset. In particular, while comparable SOTA clean accuracies (the difference is less than $3 \%$ ) are achieved by MNIST and CIFAR10 (Gastaldi, 2017), CIFAR10 suffers from much lower achievable robustness than MNIST in practice.1 Results of this paper consist of two parts. First in theory, we start with analyzing the difference between the regular Bayes error and the robust error, and show that the regular Bayes error is invariant to invertible transformations of the data distribution, but the robust error is not. We further prove that if the input data is uniformly distributed, then the perfect decision boundary cannot be robust. However, we also manage to find a robust model for the binarized MNIST dataset (semantically almost identical to MNIST, later described in Section 3). The certification method by Wong and Kolter (2018) guarantees that this model achieves at most $3 \%$ robust error. Such a sharp contrast suggests the important role of the data distribution in adversarial robustness, and leads to our second contribution on the empirical side: we design a series of augmented MNIST and CIFAR10 datasets to demonstrate the sensitivity of adversarial robustness to the input data distribution.
|
| 20 |
+
|
| 21 |
+
Our finding of such sensitivity raises the question of how to properly evaluate adversarial robustness. In particular, the sensitivity of adversarial robustness suggests that certain datasets may not be sufficiently representative when benchmarking different robust learning algorithms. It also raises serious concerns about the deployment of believed-to-be-robust training algorithm in a real product. In a standard development procedure, various models (for example different network architectures) would be prototyped and measured on the existing data. However, the sensitivity of adversarial robustness makes the truthfulness of the performance estimations questionable, as one would expect future data to be slightly shifted. We illustrate the practical implications in Section 4 with two practical examples: 1) the robust accuracy of PGD trained model is sensitive to gamma values of gamma-corrected CIFAR10 images. This indicates that image datasets collected under different light conditions may have different robustness properties; 2) both as a “harder” version of MNIST, the fashion-MNIST (Xiao et al., 2017) and edge-fashion-MNIST (an edge detection variant described in Section 4.2) exhibit completely different robustness characteristics. This demonstrates that different datasets may give completely different evaluations for the same algorithm.
|
| 22 |
+
|
| 23 |
+
Finally, our finding opens up a new angle and provides novel insights to the adversarial vulnerability problem, complementing several recent works on the issue of data distributions’ influences on robustness. Tsipras et al. (2019) hypothesize that there is an intrinsic tradeoff between clean accuracy and adversarial robustness. Our studies complement this result, showing that there are different levels of tradeoffs depending on the characteristics of input data distribution, under the same learning settings (training algorithm, model and training set size). Schmidt et al. (2018) show that different data distributions could have drastically different properties of adversarially robust generalization, theoretically on Bernoulli vs mixtures of Gaussians, and empirically on standard benchmark datasets. From the sensitivity perspective, we demonstrate that being from completely different distributions (e.g. binary vs Gaussian or MNIST vs CIFAR10) may not be the essential reason for having large robustness difference. Gradual semantics-preserving transformations of data distribution can also cause large changes to datasets’ achievable robustness. We make initial attempts in Section 5 to further understand this sensitivity. We investigated perturbable volume and inter-class distance as the natural causes of the sensitivity; model capacity and sample complexity as the natural remedies. However, the complexity of the problem has so far defied our efforts to give a definitive answer.
|
| 24 |
+
|
| 25 |
+
# 1.1 NOTATION AND PROBLEM SETUP
|
| 26 |
+
|
| 27 |
+
We specifically consider the image classification problem where the input data is inside a high dimensional unit cube. We denote the data distribution as a joint distribution $\mathbb { P } ( x , y )$ , where $x \in [ 0 , 1 ] ^ { d }$ , $d$ is the number of pixels, and $y _ { \cdot } \in \ \{ 1 , 2 , \ldots , k \}$ is the discrete label. We assume the support of $x$ is the whole pixel space $[ 0 , 1 ] ^ { d }$ . When $x$ is a random noise (or human perceptually unclassifiable image), one can think of $\mathbb { P } ( y \mid x )$ being closed to uniform distribution on labels. In the standard setting, the samples $( x _ { i } , y _ { i } )$ can be interpreted as $x _ { i }$ is independently sampled from the marginal distribution $\mathbb { P } ( x )$ , and then $y _ { i }$ is sampled from $\mathbb { P } ( x | x _ { i } )$ . In this paper, we discuss $\mathbb { P } ( x )$ ’s influences on adversarial robustness, given a fixed $\mathbb { P } ( y | x )$ .
|
| 28 |
+
|
| 29 |
+
In our experiments, we only discuss the whitebox robustness, as it represents the “intrinsic” robustness. We use models learned by adversarially augmented training (Madry et al., 2017) (PGD training), which has the SOTA whitebox robustness. We consider bounded $\ell _ { \infty }$ attack as the attack for evaluating robustness for 2 reasons: 1) PGD training can defend against $\ell _ { \infty }$ relatively well, while for other attacks, how to train a robust model is still an open question; 2) in the image domain $\ell _ { \infty }$ attack is the mostly widely researched attack.
|
| 30 |
+
|
| 31 |
+
Let $\mathcal { H }$ denote the universal set of all the measurable functions. Given a joint distribution $\mathbb { P } ( x , y )$ on the space $\mathcal { X } \times \mathcal { V }$ , we define the Bayes error $\begin{array} { r } { R ^ { * } = \operatorname* { i n f } _ { h \in \mathcal { H } } \mathbb { E } _ { \mathbb { P } ( x , y ) } L ( \mathcal { \bar { y } } ; h ( x ) ) = R ^ { * } ( \mathbb { P } ( x , y ) ) . } \end{array}$ , where $L$ is the objective function. In other words, Bayes error is the error of the best possible classifier we can have, $h ^ { * }$ , without restriction on the function space of classifiers. We further define (adversarial) robust error $\begin{array} { r } { R R ( h ) = \mathbb { E } _ { \mathbb { P } ( x , y ) } \operatorname* { m a x } _ { \| \delta \| _ { \infty } < \epsilon } L ( y ; h ( x + \delta ) ) = R R ( \mathbb { P } ( x , y ) ) } \end{array}$ . We denote $R R ^ { * } = R R ( h ^ { * } )$ to be the robust error achieved by the Bayes classifier $h ^ { * }$ . For simplicity, we assume our algorithm can always learn $h ^ { * }$ , which reduces clean accuracy to be (1 − Bayes error), and robust accuracy of the Bayes classifier to be $\left( 1 - R R ^ { * } \right)$ .
|
| 32 |
+
|
| 33 |
+
# 2 THEORETICAL ANALYSES AND PROVABLE CASES
|
| 34 |
+
|
| 35 |
+
As mentioned in the introduction, although the SOTA clean accuracies are similar for MNIST and CIFAR10, the robust accuracy on CIFAR10 is much more difficult to achieve, which indicates the different behaviors of the clean accuracy and robust accuracy. The first result in this section is to further confirm this indication in a simple setting, where the clean accuracy remains the same but the robust accuracy completely changes under a distribution shift. Based on results from the concentration of measure literature, we further show that under uniform distribution, no algorithm can achieve good robustness, as long as they have high clean accuracy. On the other hand, we examine the performance of a verifiable defense method on binarized MNIST (pixels values rounded to 0 and 1), and the result suggests the exact opposite: provable adversarial robustness on a MNISTlike dataset is achievable. Such contrast thus suggests the important role of the data distribution in achieving adversarial robustness.
|
| 36 |
+
|
| 37 |
+
# 2.1 DISENTANGLE CLEAN ACCURACY AND ROBUST ACCURACY
|
| 38 |
+
|
| 39 |
+
One immediate result is that Bayes error remains the same under any distribution shift induced by an injective map $T : \mathcal { X } \mathcal { X }$ . To see that, simply note that $T ^ { - 1 }$ exists and $h ^ { \ast } \circ T ^ { - 1 }$ gives the same Bayes error for the shifted distribution. However, such invariance property does not hold for the robust error of the Bayes classifier. Furthermore, the following two examples show that Bayes error can have completely different behavior from its robust error. Although both examples have 0 Bayes error, they have completely different robust errors.
|
| 40 |
+
|
| 41 |
+
Example 1. Assume $x$ is uniformly distributed in $[ 0 , 1 ] ^ { d }$ and $y = 1$ , for all $x$ with $x ^ { \top } e _ { 1 } > 1 / 2$ and $y = 0$ , for $x ^ { \top } e _ { 1 } \leq 1 / 2$ , where $e _ { 1 }$ is the one-hot vector. We use the 0-1 loss here. Note that the Bayes error decision boundaries are given by the following hyperplane: $H P _ { 1 } = \{ x \in [ 0 , 1 ] ^ { d } : x _ { 1 } = \operatorname { \bar { 0 } } \}$ , and thus
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
R ^ { * } = 0 ; \qquad R R ^ { * } = 2 \epsilon ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
under the budget $\| \delta \| _ { \infty } < \epsilon .$ . In this case, the robust error is tolerable and relatively robust measured by the fraction of points that are successfully attacked, 2.
|
| 48 |
+
|
| 49 |
+
Moreover, consider an injective map $T$ which maps $\{ x : x ^ { \top } e _ { 1 } > 1 / 2 \}$ to $\{ x : x ^ { \top } I > \textstyle { \frac { d } { 2 } } \}$ , and $\{ x : x ^ { \top } e _ { 1 } \leq 1 / 2 \}$ to $\{ x : x ^ { \top } I \leq \textstyle { \frac { d } { 2 } } \} ^ { 2 }$ . The Bayes error on the new distribution remains 0, as $T$ is invertible. In contrast, the robust error is much worse. In fact,
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
R R ^ { * } \geq 1 - \frac { 1 } { 4 d \epsilon ^ { 2 } } .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Remark 2.1. Note that here the robust error of the Bayes classifier will grow to 1 as the dimensionality increases, for a fixed budget .
|
| 56 |
+
|
| 57 |
+
# 2.2 DIFFICULTY IN ACHIEVING ROBUSTNESS
|
| 58 |
+
|
| 59 |
+
Example 1 shows that good clean accuracy does not necessary lead to good robust accuracy. In contrast, we will show in this section that achieving a good robust accuracy is impossible given uniformly distributed data, as long as we ask for good clean accuracies. Our tool are classical results from the concentration of measure (Ledoux, 2005).
|
| 60 |
+
|
| 61 |
+
Let $A _ { \epsilon } : = \{ x \in \mathbb { R } ^ { N } | \mathbf { d } ( x , A ) < \epsilon \}$ denote the $\epsilon$ -neighborhood of the nonempty set $A$ , where $\operatorname { d } ( x , A )$ is the distance from $x$ to the set $A$ . Theorem 2.1 provides a lower bound on the mass in $A _ { \epsilon }$ .
|
| 62 |
+
|
| 63 |
+
Theorem 2.1 (Concentration of Measure on the Unit Cube and the Unit Ball). Let $[ 0 , 1 ] ^ { d }$ denote the unit $d$ -cube and $B ^ { d }$ denote the Euclidean unit $d$ -ball, both equipped with uniform probability distributions. Let $\epsilon > 0$ . Then for any $A \subset [ 0 , 1 ] ^ { d }$ with $\mathbb { P } ( A ) \geq 1 / 2$ , we have:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \mathbb { P } ( A _ { \epsilon } ) \geq \Phi ( \epsilon \sqrt { 2 \pi } + \Phi ^ { - 1 } ( \mathbb { P } ( A ) ) ) \geq 1 - e ^ { - \pi \epsilon ^ { 2 } } } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
For any $B \subset B ^ { d }$ , with $\mathbb { P } ( B ) \ge 1 / 2$ ,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathbb { P } ( B _ { \epsilon } ) \geq 1 - \frac { 1 } { \mathbb { P } ( B ) } ( 1 - \delta _ { \ell _ { 2 } } ( \epsilon ) ) ^ { 2 d } \geq 1 - \frac { 1 } { \mathbb { P } ( B ) } e ^ { - 2 d ( \frac { 2 - \sqrt { 3 } } { 3 } ) \epsilon ^ { 2 } }
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\begin{array} { r } { \delta _ { \ell _ { 2 } } ( \epsilon ) = 1 - \sqrt { 1 - \frac { \epsilon ^ { 2 } } { 4 } } } \end{array}$ and $\Phi$ is the standard normal cumulative distribution function.
|
| 76 |
+
|
| 77 |
+
Based on Theorem 2.1 we can now show that under some circumstances, no algorithm that achieves can perfect clean accuracy can also achieve a good robust accuracy.
|
| 78 |
+
|
| 79 |
+
Example 2 (Vulnerability Guarantee). Consider the joint distribution $\mathbb { P } ( x , y )$ , where the input data $x$ is uniformly distributed on $[ 0 , 1 ] ^ { d }$ and label $y$ has $I O$ classes. Further assume the marginal distribution of $y$ is also uniform3. Theorem 2.1 implies that under $\ell _ { 2 }$ adversarial attack with $\epsilon = 0 . 5$ , at least $94 \%$ of the samples are ether wrongly classified or can be successfully attacked for a classifier with perfect clean accuracy.
|
| 80 |
+
|
| 81 |
+
Furthermore, if $d = 3 \times 3 2 \times 3 2$ , A parallel calculation for $\mathbb { P } ( x , y )$ on the $B ^ { d }$ domain gives: under $\ell _ { 2 }$ adversarial attack with $\epsilon = 0 . 0 9$ , at least $97 \%$ of the the samples are ether wrongly classified or can be successfully attacked for a classifier with perfect clean accuracy.
|
| 82 |
+
|
| 83 |
+
On the one hand, Theorem 2.1 and Example 2 suggest that the uniform distribution on $[ 0 , 1 ] ^ { d }$ enjoys more robustness than the uniform distribution on ${ \bar { B } } ^ { d }$ , and it is not affected by the high dimensionality. This may partially explain why MNIST is more adversarially robust than CIFAR10, as the distribution of $x$ in CIFAR10 is “closer” to $B ^ { d }$ than to $[ 0 , 1 ] ^ { d }$ . On the other hand, while not completely sharp, they also suggest the intrinsic difficulty in achieving good robust accuracy.
|
| 84 |
+
|
| 85 |
+
Note that one limit of Theorem 2.1 and Example 2 is the uniform distribution assumption, which is surely not true for natural images. Indeed, although rigorously developed, Theorem 2.1 and Example 2 do not explain certain empirical observations. Following Wong and Kolter (2018), we train a provably4 robust model on a binarized MNIST dataset (bMNIST) 5. Our experiments shows that the learned model achieves $3 . 0 0 \%$ provably robust error on bMNIST test data, while maintaining $9 7 . 6 5 \%$ clean accuracy. Details of this experiment in described in Appendix B.2.
|
| 86 |
+
|
| 87 |
+
The above MNIST experiment and Example 2 suggest the essential role of the data distribution in achieving good robust and clean accuracies. While it is hard to completely answer the question what geometric properties differentiate the concentration rates between the ball/cube in high dimension and the distribution of bMNIST, we remark that one obvious difference is the distance distributions in both spaces. Could the distance distributions explain the differences in clean and robust accuracies? Note that the same method can only achieve $3 7 . 7 0 \%$ robust error on original MNIST data, and even higher error on CIFAR10, which further supports this hypothesis. In the rest of this paper, we further investigate the dependence of robust accuracy on the distribution of real data.
|
| 88 |
+
|
| 89 |
+
# 3 ROBUSTNESS ON DATASETS VARIANTS WITH DIFFERENT INPUT DISTRIBUTIONS
|
| 90 |
+
|
| 91 |
+
Section 2.2 clearly suggests that the data distribution plays an essential role in the achievable robust accuracy. In this section we carefully design a series of datasets and experiments to further study its influence. One important property of our new datasets is that they have different $\mathbb { P } ( x )$ ’s while keep $\mathbb { P } ( y | x )$ reasonably fixed, thus these datasets are only different in a “semantic-lossless” shift. Our experiments reveal an unexpected phenomenon that while standard learning methods manage to achieve stable clean accuracies across different data distributions under “semantic-lossless” shifts, however, adversarial training, arguably the most popular method to achieve robust models, loses this desirable property, in that its robust accuracy becomes unstable even under a “semantic-lossless” shift on the data distribution.
|
| 92 |
+
|
| 93 |
+
We emphasize that different from preprocessing steps or transfer learning, here we treat the shifted data distribution as a new underlying distribution. We both train the models and test the robust accuracies on the same new distribution.
|
| 94 |
+
|
| 95 |
+
# 3.1 SMOOTHING AND SATURATION
|
| 96 |
+
|
| 97 |
+
We now explain how the new datasets are generated under “semantic-lossless” shifts. In general, MNIST has a more binary distribution of pixels, while CIFAR10 has a more continuous spectrum of pixel values, as shown in Figure 1a and 1b. To bridge the gap between these two datasets that have completely different robust accuracies, we propose two operations to modify their distribution on $x$ : smoothing and saturation, as described below. We apply different levels of “smoothing” on MNIST to create more CIFAR-like datasets, and different levels of “saturation” on CIFAR10 to create more “binary” ones. Note that we would like to maintain the semantic information of the original data, which means that such operations should be semantics-lossless and not arbitrarily wide.
|
| 98 |
+
|
| 99 |
+
Smoothing is applied on MNIST images, to make images “less binary”. Given an image $x _ { i }$ , its smoothed version $\tilde { x _ { i } } ^ { ( s ) }$ is generated by first applying average filter of kernel size $s$ to $x _ { i }$ to generate an intermediate smooth image, and then take pixel-wise maximum between $x _ { i }$ and the intermediate smooth image. Our MNIST variants include the binarized MNIST and smoothed MNIST with different kernel sizes. As shown in Figure 1c, all MNIST variants still maintain the semantic information in MNIST, which indicates that $\mathbb { P } ( y | \tilde { x } ^ { ( s ) } )$ should be similar to $\mathbb { P } ( y \mid x )$ . It is thus reasonable to assume that $y _ { i }$ is approximately sampled from $\mathbb { P } ( y | \tilde { x } ^ { ( s ) } )$ , and as such we assign $y _ { i }$ as the label of $\tilde { x } ^ { ( s ) }$ . Note that all the data points in the binarized MNIST are on the corners of the unit cube. For the smoothed versions, pixels on the digit boundaries are pushed off the corner of the unit cube.
|
| 100 |
+
|
| 101 |
+
Saturation of the image $x$ is denoted by ${ \widehat x } ^ { ( p ) }$ , and the procedure is defined as below:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\widehat { x } ^ { ( p ) } = \mathrm { s i g n } ( 2 x - 1 ) \frac { | 2 x - 1 | ^ { \frac { 2 } { p } } } { 2 } + \frac { 1 } { 2 } ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where all the operations are pixel-wise and each element of ${ \widehat { x } } ^ { ( p ) }$ is guaranteed to be in $[ 0 , 1 ]$ . Saturabtion is used to generate variants of the CIFAR10 dataset with less centered pixel values. For different saturation level $p$ ’s, one can see from Figure 1d that ${ \widehat { x } } ^ { ( p ) }$ is still semantically similar to $x$ in the same classification task. Similarly we assign $y _ { i }$ bas the label of $\widehat { x } _ { i } ^ { \left( p \right) }$ . One immediate property about ${ \widehat { x } } ^ { ( p ) }$ is that it pushes $x$ b b to the corners of the data domain where the pixel values are either 0 or 1 when $p \geq 2$ , and pull the data to the center of 0.5 when $p \leq 2$ . When $p = 2$ it does not change the image, and when $p = \infty$ it becomes binarization.
|
| 108 |
+
|
| 109 |
+
# 3.2 EXPERIMENTAL SETUPS
|
| 110 |
+
|
| 111 |
+
In this section we use the smoothing and saturation operations to manipulate the data distributions of MNIST and CIFAR10, and show empirical results on how data distributions affects robust accuracies of neural networks trained on them. Since we are only concerned with the intrinsic robustness of neural networks models, we do not consider methods like preprocessing that tries to remove perturbations or randomizing inputs. We perform standard neural network training on clean data to measure the difficulty of the classification task, and projected gradient descent (PGD) based adversarial training (Madry et al., 2017) to measure the difficulty to achieve robustness.
|
| 112 |
+
|
| 113 |
+
By default, we use LeNet5 on all the MNIST variants, and use wide residual networks (Zagoruyko and Komodakis, 2016) with widen factor 4 for all the CIFAR10 variants. Unless otherwise specified, PGD training on MNIST variants and CIFAR10 variants all follows the settings in Madry et al. (2017). Details of network structures and training hyperparameters can be found in Appendix B.
|
| 114 |
+
|
| 115 |
+
We evaluate the classification performance using the test accuracy of standardly trained models on clean unperturbed examples, and the robustness using the robust accuracy of PGD trained model, which is the accuracy on adversarially perturbed examples. Although not directly indicating robustness, we report the clean accuracy on PGD trained models to indicate the tradeoff between being accurate and robust. To understand whether low robust accuracy is due to low clean accuracy or vulnerability of model, we also report robustness w.r.t. predictions, where the attack is used to perturb against the model’s clean prediction, instead of the true label. We use $\ell _ { \infty }$ untargeted PGD attacks (Madry et al., 2017) as our adversary, since it is the strongest attack in general based on our
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
|
| 121 |
+
(a) Pixel value histogram (log scale in y) of MNIST variants, from left to right: original, smoothed with kernel size 2, 3, 4, 5
|
| 122 |
+
|
| 123 |
+
(b) Pixel value histogram (log scale in y) of CIFAR10 variants, from left to right: original, saturation level 4, 8, 16, 64
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
|
| 129 |
+
(c) MNIST variants, from left to right: binarized, original, smoothed with kernel size 2, 3, 4, 5
|
| 130 |
+
|
| 131 |
+
(d) CIFAR10 variants, from left to right, original, saturation level 4, 8, 16, 64, ∞
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 1: Variants of smoothed MNIST and saturated CIFAR10 datasets.
|
| 135 |
+
Figure 2: Accuracy, Robust Accuracy and Robustness w.r.t. Predictions on different data variants
|
| 136 |
+
|
| 137 |
+
experiments. Unless otherwise specified, PGD attacks on MNIST variants run with $\epsilon = 0 . 3$ , step size of 0.01 and 40 iterations, and runs with $\epsilon = 8 / 2 5 5$ , step size of $2 / 2 5 5$ and 10 iterations on CIFAR10 variants , same as in Madry et al. (2017). We use the PGD attack implementation from the AdverTorch toolbox (Ding et al., 2019).
|
| 138 |
+
|
| 139 |
+
# 3.3 SENSITIVITY OF ROBUST ACCURACY TO DATA TRANSFORMATIONS
|
| 140 |
+
|
| 141 |
+
Results on MNIST variants are presented in Figure $\cdot$ . The clean accuracy of standard training is very stable across different MNIST variants. This indicates that their classification tasks have similar difficulties, if the training has no robust considerations. When performing PGD adversarial training, clean accuracy drops only slightly. However, both robust accuracy and robustness w.r.t. predictions drop significantly. This indicates that as smooth level goes up, it is significantly harder to achieve robustness. Note that for binarized MNIST with adversarial training, the clean accuracy and the robust accuracy are almost the same. Indicating that getting high robust accuracy on binarized MNIST does not conflict with achieving high clean accuracy. This result conforms with results of provably robust model having high robustness on binarized MNIST described in Section 2.
|
| 142 |
+
|
| 143 |
+
CIFAR10 result tell a similar story, as reported in Figure $\cdot$ . For standard training, the clean accuracy maintains almost at the original level until saturation level 16, despite that it is already perceptually very saturated. In contrast, PGD training has a different trend. Before level 16, the robust accuracy significantly increases from $4 3 . 2 \%$ until $7 9 . 7 \%$ , while the clean test accuracy drops only in a comparatively small range, from $8 5 . 4 \%$ to $8 0 . 0 \%$ . After level 16, PGD training has almost the same clean accuracy and robust accuracy. However, robustness w.r.t. predictions still keeps increasing, which again indicates the instability of the robustness. On the other hand, if the saturation level is smaller than 2, we get worse robust accuracy after PGD training, e.g. at saturation level 1 the robust accuracy is $3 3 . 0 \%$ . Simultaneously, the clean accuracy maintains almost the same.
|
| 144 |
+
|
| 145 |
+
Note that after saturation level 64 the standard training accuracies starts to drop significantly. This is likely due to that high degree of saturation has caused “information loss” of the images. Models trained on highly saturated CIFAR10 are quite robust and the gap between robust accuracy and robustness w.r.t. predictions is due to lower clean accuracy. In contrast, In MNIST variants, the robustness w.r.t. predictions is always almost the same as robust accuracy, indicating that drops in robust accuracy is due to adversarial vulnerability.
|
| 146 |
+
|
| 147 |
+
From these results, we can conclude that robust accuracy under PGD training is much more sensitive than clean accuracy under standard training to the differences in input data distribution. More importantly, a semantically-lossless shift on the data transformation, while not introducing any unexpected risk for the clean accuracy of standard training, can lead to large variations in robust accuracy. Such previously unnoticed sensitivity raised serious concerns in practice, as discussed in the next section.
|
| 148 |
+
|
| 149 |
+
# 4 PRACTICAL IMPLICATIONS
|
| 150 |
+
|
| 151 |
+
Given adversarial robustness’ sensitivity to input distribution, we further demonstrate two practical implications: 1) Robust accuracy could be sensitive to image acquisition condition and preprocessing. This leads to unreliable benchmarks in practice; 2) When introducing new dataset for benchmarking adversarial robustness, we need to carefully choose datasets with the right characteristics.
|
| 152 |
+
|
| 153 |
+
# 4.1 ROBUST ACCURACY IS SENSITIVE TO GAMMA CORRECTION
|
| 154 |
+
|
| 155 |
+
The natural images are acquired under different lighting conditions, with different cameras and different camera settings. They are usually preprocessed in different ways. All these factors could lead to mild shifts on the input distribution. Therefore, we might get very different performance measures when performing adversarial training on images taken under different conditions. In this section, we demonstrate this phenomenon on variants of CIFAR10 images under different gamma mappings. These variants are then used to represent image dataset acquired under different conditions. Gamma mapping is a simple element-wise operation that takes the original image $x$ , and output the gamma mapped image $\tilde { x } ^ { ( \gamma ) }$ by performing $\tilde { x } ^ { ( \gamma ) } = x ^ { \gamma }$ . Gamma mapping is commonly used to adjust the exposure of an images. We refer the readers to Szeliski (2010) on more details about gamma mappings. Figure 3a shows variants of the same image processed with different gamma values. Lower gamma value leads to brighter images and higher gamma values gives darker images, since pixel values range from 0 to 1. Despite the changes in brightness, the semantic information is preserved.
|
| 156 |
+
|
| 157 |
+
We perform the same experiments as in the saturated CIFAR10 variants experiment in Section 3. The results are displayed in Figure 3a. Accuracies on clean data almost remain the same across different gamma values. However, under PGD training, both accuracy and robust accuracy varies largely following different gamma values.
|
| 158 |
+
|
| 159 |
+
These results should raise practitioners’ attention on how to interpret robustness benchmark “values”. For the same adversarial training setting, the robustness measure might change drastically between image datasets with different “exposures”. In other words, if a training algorithm achieves good robustness on one image dataset, it doesn’t necessarily achieve similar robustness on another semantically-identical but slightly varied datasets. Therefore, the actual robustness could either be significantly underestimated or overestimated.
|
| 160 |
+
|
| 161 |
+
This raises the questions on whether we are evaluating image classifier robustness in a reliable way, and how we choose benchmark settings that can match the real robustness requirements in practice. This is an important open question and we defer it to future research.
|
| 162 |
+
|
| 163 |
+
# 4.2 CHOICE OF DATASETS FOR EVALUATING ROBUSTNESS
|
| 164 |
+
|
| 165 |
+
As discussed, evaluating robustness on a suitable dataset is important. Here we use fashion-MNIST (fMNIST) (Xiao et al., 2017) and edge-fashion-MNIST (efMNIST) as examples to analyze characteristics of “harder” datasets. The edge-fashion MNIST is generated by running Canny edge detector (Canny, 1986) with $\sigma = 1$ on the fashion MNIST images. Figure 3b shows examples of fMNIST and efMNIST. We performed the same standard training and PGD training experiments on both fMNIST and efMNIST as we did on MNIST. Figure 3b shows the results. We can see that fMNIST exhibit similar behavior to CIFAR10, where the test accuracy is significantly affected by PGD training and the gap between robust accuracy and accuracy is large. On the other hand, efMNIST is closer to the binarized MNIST: the accuracy is affected very little by PGD training, along with an insignificant difference between robust accuracy and accuracy.
|
| 166 |
+
|
| 167 |
+
Both fMNIST and efMNIST can be seen as a “harder” MNIST, but they are harder in different ways. One one hand, since efMNIST results from the edge detection run on fMNIST, it contains less information. It is therefore harder to achieve higher accuracy on efMNIST than on fMNIST, where richer semantics is accessible. However, fMNIST’s richer semantics makes it better resembles natural images’ pixel value distribution, which could lead to increased difficulty in achieving
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 3: Illustrations on Practical Implications
|
| 173 |
+
|
| 174 |
+
fMNIST: accuracy, standard training, $9 2 . 7 \%$ accuracy, PGD training, $8 1 . 2 \%$ robust accuracy, PGD training, $6 5 . 3 \%$
|
| 175 |
+
efMNIST: accuracy, standard training, $8 8 . 3 \%$ accuracy, PGD training, $8 7 . 2 \%$ robust accuracy, PGD training, $8 6 . 6 \%$
|
| 176 |
+
|
| 177 |
+
(a) Top: Gamma mapped images from left to right 0.6, 0.8, 1.0 (original image), 1.2 , 1.4; Bottom: Robustness results on gamma mapped CIFAR10 variant
|
| 178 |
+
|
| 179 |
+
(b) Top: Examples of fashion-MNIST images and edge-fashion-MNIST; bottom: Robustness results on fMNIST and efMNIST
|
| 180 |
+
|
| 181 |
+
adversarial robustness. efMNIST, on the other hand, can be viewed as a set of “more complex binary symbols” compared to MNIST or binarized MNIST. It is harder to classify these more complex symbols. However, it is easy to achieve high robustness due to the binary pixel value distribution.
|
| 182 |
+
|
| 183 |
+
To sum up, when introducing new dataset for adversarial robustness, we should not only look for a “harder” one, but we also need to consider whether the dataset is “harder in the right way”.
|
| 184 |
+
|
| 185 |
+
# 5 ATTEMPTS TO UNDERSTAND THE PHENOMENON
|
| 186 |
+
|
| 187 |
+
In this section, we make initial attempts to understand the sensitivity of adversarial robustness. We use CIFAR10 variants as the running example, but these analyses apply to MNIST variants as well. Saturation pushes pixel values towards 0 or 1, i.e. towards the corner of unit cube, which naturally suggests two potential factors for the change in robustness. 1) the “perturbable volume” decreases; 2) distances between data examples increases. Intuitively, both could be related to the increasd robustness. We analyze them and show that although they are correlated with robustness change, none of them can fully explain the observed phenomena. We then further examine the possibility of increasing robust accuracy on less robust datasets by having larger models and more data.
|
| 188 |
+
|
| 189 |
+
# 5.1 ON THE INFLUENCE OF PERTURBABLE VOLUME
|
| 190 |
+
|
| 191 |
+
Saturation moves the pixel values towards 0 and 1, therefore pushing the data points to the corners of the unit cube input domain. This makes the valid perturbation space to be smaller, since the space of perturbation is the intersection between the $\epsilon \mathrm { - } \ell _ { \infty }$ ball and the input domain. Due to high dimensionality, the volume of “perturbable region” changes drastically across different saturation levels. For example, the average log perturbable volume 7 of original CIFAR10 images are -12354, and the average log perturbable volume of $\infty$ -saturated CIFAR10 is -15342, which means that the perturbable volume differs by a factor of $2 ^ { 2 9 9 0 } = 2 ^ { ( - 1 2 3 5 2 - ( - 1 5 3 4 2 ) ) }$ . If the differences in perturbable volume is a key factor on the robustness’ sensitivity, then by allowing the attack to go beyond the domain boundary 8, the robust accuracies across different saturation levels should behave similarly again, or at least significantly differ from the case of box constrained attacks. We performed PGD attack allowing the perturbation to be outside of the data domain boundary, and compare the robust accuracy to what we get for normal PGD attack within domain boundary. We found that the expected difference is not observed, which serves as evidence that differences in perturbable volume are not causing the differences in robustness on the tested MNIST and CIFAR10 variants.
|
| 192 |
+
|
| 193 |
+
# 5.2 ON THE INFLUENCE OF INTER-CLASS DISTANCE
|
| 194 |
+
|
| 195 |
+
When saturation pushes data points towards data domain boundaries, the distances between data points increase too. Therefore, the margin, the distance from data point to the decision boundary, could also increase. We use the “inter-class distance” as an approximation. Inter-class distance 9 characterizes the distances between each class to rest of classes in each dataset. Intuitively, if the distances between classes are larger, then it should be easier to achieve robustness. We also observed (in Appendix D.2.1 Figure 5) that inter-class distances are positively correlated with robust accuracy. However, we also find counter examples where datasets having the same inter-class distance exhibit different robust accuracies. Specifically, We construct scaled variants of original MNIST and binarized MNIST, such that their inter-class distances are the same as smooth-3, smooth-4, smooth-5 MNIST. The scaling operation is defined as $\tilde { x } ^ { ( \alpha ) } = \alpha ( x - 0 . 5 ) + 0 . 5$ , where $\alpha$ is the scaling coefficient. When $\alpha < 1$ . each dimension of $x$ is pushed towards the center with the same rate. Table 1 shows the results. We can see that although having the same interclass distances, the smoothed MNIST is still less robust than the their correspondents of scaled binarized MNIST and original MNIST. This indicates the complexity of the problem, such that a simple measure like inter-class distance cannot fully characterize robustness property of datasets, at least on the variants of MNIST.
|
| 196 |
+
|
| 197 |
+
Table 1: Different robust accuracies on datasets with same inter-class distances
|
| 198 |
+
|
| 199 |
+
<table><tr><td>INTER-CLASS DISTANCES</td><td>SMOOTH LEVEL OF SMOOTHED MNIST</td><td>RESILIENCE OF SMOOTHED MNIST</td><td>SCALE FACTOR OF SCALED ORIGINAL MNIST</td><td>RESILIENCE OF SCALED ORIGINAL MNIST</td><td>SCALE FACTOR OF SCALED BINARIZED MNIST</td><td>RESILIENCE OF SCALED BINARIZED MNIST</td></tr><tr><td>7.12</td><td>3</td><td>91.3 %</td><td>0.970</td><td>94.6 %</td><td>0.821</td><td>98.6%</td></tr><tr><td>7.01</td><td>4</td><td>90.3 %</td><td>0.955</td><td>95.5%</td><td>0.809</td><td>98.6%</td></tr><tr><td>6.85</td><td>5</td><td>89.6%</td><td>0.932</td><td>94.9 %</td><td>0.790</td><td>98.5%</td></tr></table>
|
| 200 |
+
|
| 201 |
+
# 5.3 ON THE REQUIRED MODEL CAPACITY AND SAMPLE COMPLEXITY
|
| 202 |
+
|
| 203 |
+
In practice, it is unclear how far robust accuracy of PGD trained model is from adversarial Bayes error $R R ^ { * }$ for the given data distribution. In the case $R R ^ { * }$ is not yet achieved, there is a nonexhaustive list that we can improve upon: 1) use better training/learning algorithms; 2) increase the model capacity; 3) train on more data. Finding a better learning algorithm is beyond the scope of this paper. Here we inspect 2) and 3) to see if it is possible to improve robustness by having larger model and more data. For model capacity, we use differently sized LeNet5 by multiplying the number of channels at each layer with different widen factors. These factors include 0.125, 0.25, 0.5, 1, 2, 4. On CIFAR10 variants, we use WideResNet with widen factors 0.25, 1 and 4. For sample complexity, we follow the practice in Section 3 except that we use a weight decay value of 0.002 to prevent overfitting. For both MNIST and CIFAR10, we test on 1000, 3000, 9000, 27000 and entire training set. Both model capacity and sample complexity results are shown in Figure 4.
|
| 204 |
+
|
| 205 |
+
For MNIST, both training and test accuracies of clean training are invariant to model sizes, even we only use a model with widen factor 0.125. In slight contrast, both the training and test accuracy of PGD training increase as the model capacity increases, but it plateaus after widen factor 1 at an almost $100 \%$ accuracy. For robust accuracy, training robust accuracy kept increasing as model gets larger until the value is close to $100 \%$ . However, test robust accuracy stops increasing after widen factor 1, additional model capacity leads to larger (robust) generalization gap. When we vary the size of training set, the model can always fit the training set well to almost $100 \%$ clean training accuracy under standard training. The clean test accuracy grows as the training set size get larger. Training set size has more significant impact on robust accuracies of PGD trained models. For most MNIST variants except for binarized MNIST, training robust accuracy gradually drops, and test robust accuracy gradually increases as the training set size increases. This shows that when training set size is small, PGD training overfits to the training set. As training set gets larger, the generalization gap becomes smaller. Both training and test robust accuracies plateau after training set size reaches 27000. Indicating that increasing the training set size might not help in this setting. In conclusion, for MNIST variants, increasing training set size and model capacity does not seem to help beyond a certain point. Therefore, it is not obvious on how to improve robustness on MNIST variants with higher smoothing levels.
|
| 206 |
+
|
| 207 |
+
CIFAR10 variants exhibit similar trends in general. One notable difference is that for PGD training, the training robust accuracy does not plateau as model size increases. However the test robust accuracy plateaus after widen factor 1. Also when training set size increases, the training robust accuracy drops and test robust accuracy increases with no plateau present. These together suggest that having more training data and training a larger model could potentially improve the robust accuracies on CIFAR10 variants. One interesting phenomenon is that binarized MNIST and $\infty$ -saturated CIFAR10 has different sample complexity property, despite both being “cornered” datasets. This indicates that the although binarization can largely influence robustness, it does not decide every aspect of it, such as sample complexity. This complex interaction between the classification task and input data distribution is still to be understood further.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 4: Model capacity and training set size’s influences on accuracy and robust accuracy. In each subfigure, the top row contains accuracy and robust accuracy measured on training set, the bottom row contains results measured on test set.
|
| 211 |
+
|
| 212 |
+
# 6 CONCLUSION
|
| 213 |
+
|
| 214 |
+
In this paper we provided theoretical analyses to show the significance of input data distribution in adversarial robustness, which further motivated our systematic experiments on MNIST and CIFAR10 variants. We discovered that, counter-intuitively, robustness of adversarial trained models are sensitive to semantically-preserving transformations on data. We demonstrated the practical implications of our finding that the existence of such sensitivity questions the reliability in evaluating robust learning algorithms on particular datasets. Finally, we made initial attempts to understand this sensitivity.
|
| 215 |
+
|
| 216 |
+
Acknowledgement We thank Marcus Brubaker for many helpful discussions. We also thank Junfeng Wen and Avishek (Joey) Bose for useful feedbacks on early drafts of the paper.
|
| 217 |
+
|
| 218 |
+
REFERENCES
|
| 219 |
+
Athalye, A., Carlini, N., and Wagner, D. (2018). Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning, pages 274–283.
|
| 220 |
+
Athalye, A., Engstrom, L., Ilyas, A., and Kwok, K. (2017). Synthesizing robust adversarial examples. arXiv preprint arXiv:1707.07397.
|
| 221 |
+
Ball, K. (1997). An elementary introduction to modern convex geometry. Flavors of geometry, 31:1–58.
|
| 222 |
+
Biggio, B., Corona, I., Maiorca, D., Nelson, B., Šrndic, N., Laskov, P., Giacinto, G., and Roli, F. ´ (2013). Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pages 387–402. Springer.
|
| 223 |
+
Canny, J. (1986). A computational approach to edge detection. IEEE Transactions on pattern analysis and machine intelligence, (6):679–698.
|
| 224 |
+
Carlini, N. and Wagner, D. (2016). Defensive distillation is not robust to adversarial examples. arXiv preprint arXiv:1607.04311.
|
| 225 |
+
Carlini, N. and Wagner, D. (2017). Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pages 39–57. IEEE.
|
| 226 |
+
Ding, G. W., Wang, L., and Jin, X. (2019). AdverTorch v0.1: An adversarial robustness toolbox based on pytorch. arXiv preprint arXiv:1902.07623.
|
| 227 |
+
Erraqabi, A., Baratin, A., Bengio, Y., and Lacoste-Julien, S. (2018). A3t: Adversarially augmented adversarial training. arXiv preprint arXiv:1801.04055.
|
| 228 |
+
Fawzi, A., Fawzi, O., and Frossard, P. (2015). Analysis of classifiers’ robustness to adversarial perturbations. arXiv preprint arXiv:1502.02590.
|
| 229 |
+
Gastaldi, X. (2017). Shake-shake regularization. arXiv preprint arXiv:1705.07485.
|
| 230 |
+
Gilmer, J., Metz, L., Faghri, F., Schoenholz, S. S., Raghu, M., Wattenberg, M., and Goodfellow, I. (2018). Adversarial spheres. arXiv preprint arXiv:1801.02774.
|
| 231 |
+
Goodfellow, I. J., Shlens, J., and Szegedy, C. (2014). Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572.
|
| 232 |
+
Huang, R., Xu, B., Schuurmans, D., and Szepesvári, C. (2015). Learning with a strong adversary. arXiv preprint arXiv:1511.03034.
|
| 233 |
+
Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.
|
| 234 |
+
Kurakin, A., Goodfellow, I., and Bengio, S. (2016). Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236.
|
| 235 |
+
Ledoux, M. (2005). The concentration of measure phenomenon. Number 89. American Mathematical Soc.
|
| 236 |
+
Madry, A., Makelov, A., Schmidt, L., Tsipras, D., and Vladu, A. (2017). Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083.
|
| 237 |
+
Moosavi-Dezfooli, S.-M., Fawzi, A., and Frossard, P. (2016). Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2574–2582.
|
| 238 |
+
Raghunathan, A., Steinhardt, J., and Liang, P. (2018). Certified defenses against adversarial examples. arXiv preprint arXiv:1801.09344.
|
| 239 |
+
Schmidt, L., Santurkar, S., Tsipras, D., Talwar, K., and M ˛adry, A. (2018). Adversarially robust generalization requires more data. arXiv preprint arXiv:1804.11285.
|
| 240 |
+
Sinha, A., Namkoong, H., and Duchi, J. (2017). Certifiable distributional robustness with principled adversarial training. arXiv preprint arXiv:1710.10571.
|
| 241 |
+
Szegedy, C., Zaremba, W., Sutskever, I., Bruna, J., Erhan, D., Goodfellow, I., and Fergus, R. (2013). Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199.
|
| 242 |
+
Szeliski, R. (2010). Computer vision: algorithms and applications. Springer Science & Business Media.
|
| 243 |
+
Tsipras, D., Santurkar, S., Engstrom, L., Turner, A., and Madry, A. (2019). Robustness may be at odds with accuracy. In International Conference on Learning Representations.
|
| 244 |
+
Warde-Farley, D. and Goodfellow, I. (2016). 11 adversarial perturbations of deep neural networks. page 311.
|
| 245 |
+
Wong, E. and Kolter, Z. (2018). Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning, pages 5283–5292.
|
| 246 |
+
Xiao, H., Rasul, K., and Vollgraf, R. (2017). Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747.
|
| 247 |
+
Xu, H., Caramanis, C., and Mannor, S. (2009). Robustness and regularization of support vector machines. Journal of Machine Learning Research, 10(Jul):1485–1510.
|
| 248 |
+
Zagoruyko, S. and Komodakis, N. (2016). Wide residual networks. arXiv preprint arXiv:1605.07146.
|
| 249 |
+
|
| 250 |
+
# Appendix
|
| 251 |
+
|
| 252 |
+
A PROOFS
|
| 253 |
+
|
| 254 |
+
A.1 PROOF FOR EXAMPLE 1
|
| 255 |
+
|
| 256 |
+
Proposition A.1 (Existence of Non-Adversarially Robust Decision Boundary). Let x be uniformly distributed on $[ 0 , 1 ] ^ { d }$ and $y = 1$ , for all $x$ such that $x ^ { \top } I > \frac { d } { 2 }$ and $y = 0$ otherwise. Consider adversarial attack under budget $\| \delta \| _ { \infty } < \epsilon$ . Then for zero-one loss $L$ :
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
R R ^ { * } = \mathbb { E } _ { \mathbb { P } ( x , y ) } \operatorname* { m a x } _ { \| \delta \| _ { \infty } < \epsilon } L ( Y ; h ^ { * } ( x + \delta ) ) \ge 1 - \frac { 1 } { 4 d \epsilon ^ { 2 } }
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
Proof. The argument is well-known in concentration of measure. We provide here for the sake of completeness and adapt it to the context. The hyperplane $\begin{array} { r } { H P _ { 2 } = \{ x \in [ 0 , 1 ] ^ { d } : X ^ { \top } \mathbf { 1 } = \frac { d } { 2 } \} } \end{array}$ defines the decision boundary. We first compute the orthogonal distance of a given point $y =$ $( y _ { 1 } , y _ { 2 } , \cdot \cdot \cdot , y _ { d } ) = ( x _ { 1 } + \delta _ { 1 } , x _ { 2 } + \delta _ { 2 } , \cdot \cdot \cdot , x _ { d } + \delta _ { d } )$ to $H P _ { 2 }$ . The point $y$ is the perturbed point within budget $\| \delta \| _ { \infty } < \epsilon$ . The vector 1 is orthogonal to $H P _ { 2 }$ . Pick any point $x \ \in \ H P _ { 2 }$ , the orthogonal distance from $y$ to $H P _ { 2 }$ is:
|
| 263 |
+
|
| 264 |
+
$$
|
| 265 |
+
\begin{array} { r l } & { \ell _ { 2 } ( y , H P _ { 2 } ) = \| P r o j _ { \mathbf { 1 } } ( y - x ) \| = \| \mathbf { 1 } \frac { \left( y - x \right) ^ { \top } \mathbf { 1 } } { \mathbf { 1 } ^ { \top } \mathbf { 1 } } \| } \\ & { \qquad = | \frac { y ^ { \top } \mathbf { 1 } - x ^ { \top } \mathbf { 1 } } { \| \mathbf { 1 } \| } | } \\ & { \qquad = | \frac { \delta ^ { \top } \mathbf { 1 } } { \| \mathbf { 1 } \| } | } \\ & { \qquad = | \frac { y ^ { \top } \mathbf { 1 } } { \| \mathbf { 1 } \| } | } \\ & { \qquad = | \frac { y ^ { \top } \mathbf { 1 } - \frac { d } { 2 } } { \sqrt { d } } | } \end{array}
|
| 266 |
+
$$
|
| 267 |
+
|
| 268 |
+
The last two equations show that the $\ell _ { 2 }$ distance under an $\ell _ { \infty }$ attack can grow at the rate of $\epsilon \sqrt { d }$ , for this particular hyperplane $H P _ { 2 }$ .
|
| 269 |
+
|
| 270 |
+
Now we take the expectation over $[ 0 , 1 ] ^ { d }$ , and note that expectation of the uniform distribution over a product space $[ 0 , \dot { 1 } ] ^ { d }$ is the same as taking expectation on each dimension (Fubini’s theorem), picking each random variable coordinatewise uniformly from $[ 0 , 1 ]$ .
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\begin{array} { r l } & { \mathbb { E } [ \ell _ { 2 } ^ { 2 } ( y , H P _ { 2 } ) ] = \mathbb { E } [ ( \frac { y ^ { \top } \mathbf { 1 } - \frac { d } { 2 } } { d } ) ^ { 2 } ] = \frac { 1 } { d } \mathbb { E } [ ( \sum _ { i = 1 } ^ { d } y _ { i } - \frac { d } { 2 } ) ^ { 2 } ] } \\ & { \qquad = \frac { 1 } { d } \mathbb { V } [ \sum _ { i = 1 } ^ { d } y _ { i } ] = \frac { 1 } { d } \sum _ { i = 1 } ^ { d } \mathbb { V } [ y _ { i } ] = \frac { 1 } { 4 } } \end{array}
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
Then we apply Markov’s inequality, for all real number $t > 0$ :
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\mathbb { P } ( \ell _ { 2 } ( x , H ) \geq \sqrt { t } ) = \mathbb { P } ( \ell _ { 2 } ( x , H ) ^ { 2 } \geq t ) \leq \frac { 1 } { 4 t }
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
Finally, we observe that the longest (in terms of $\ell _ { 2 }$ norm) such √ $\epsilon \ell _ { \infty }$ attacks vector to $H P _ { 2 }$ are parallel to the normal vector 1 to $H P _ { 2 }$ . They have $\ell _ { 2 }$ distance $\epsilon \sqrt { d }$ . The set these attacks cover is characterized by $\{ x \in [ 0 , 1 ] ^ { d } : \ell _ { \infty } ( x , H ) \leq \epsilon \} = \{ x \in [ 0 , 1 ] ^ { d } : \ell _ { 2 } ( x , H ) \leq \epsilon { \sqrt { d } } \} .$
|
| 283 |
+
|
| 284 |
+
Let $t = \epsilon ^ { 2 } d$ , we have:
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathbb { P } ( \ell _ { 2 } ( x , H ) \ge \sqrt { t } ) = \mathbb { P } ( \ell _ { 2 } ( x , H ) ^ { 2 } \ge t ) \le \frac { 1 } { 4 t } = \frac { 1 } { 4 \epsilon ^ { 2 } d }
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
In the case of zero-one loss, $\begin{array} { r } { R R ^ { * } = \mathbb { P } ( \ell _ { 2 } ( x , H ) \le \epsilon \sqrt { d } ) \ge 1 - \frac { 1 } { 4 \epsilon ^ { 2 } d } . } \end{array}$
|
| 291 |
+
|
| 292 |
+
# A.2 PROOF FOR THEOREM 2.1
|
| 293 |
+
|
| 294 |
+
Proof. (First Inequality for Cube) The proof here follows that of Ledoux (2005), but we track of the tight constants so as to give tighter adversarial robustness calculations.
|
| 295 |
+
|
| 296 |
+
Let $\Phi$ be one dimensional standard normal cumulative distribution function and let $\mu _ { d }$ denote $d$ dimensional Gaussian measures. Consider the map $T : \mathbb { R } ^ { d } \longrightarrow ( 0 , 1 ) ^ { d }$ :
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
T ( x _ { 1 } , \cdot \cdot \cdot , x _ { d } ) = ( \Phi ( x _ { 1 } ) , \cdot \cdot \cdot , \Phi ( x _ { d } ) )
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
$T$ pushes forward $\mu _ { d }$ defined on $\mathbb { R } ^ { d }$ into a probability measure $\mathbb { P }$ on $( 0 , 1 ) ^ { d }$ :
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\mathbb { P } ( A ) = \mu _ { d } ( T ^ { - 1 } ( A ) )
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
for $A \ \subset \ ( 0 , 1 ) ^ { d }$ . Next we have the following Gaussian isoperimetric/concentration inequality (Ledoux, 2005):
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\mu _ { d } ( B _ { \epsilon } ) \geq \Phi ( \Phi ^ { - 1 } ( \mu _ { d } ( B ) ) + \epsilon )
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
for all $B \subset \mathbb { R } ^ { d }$ measureable.
|
| 315 |
+
|
| 316 |
+
Now for $A \subset ( 0 , 1 ) ^ { d }$ , we have:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\begin{array} { r } { \mathbb { P } ( A _ { \epsilon } ) = \mu _ { d } ( T ^ { - 1 } ( A _ { \epsilon } ) ) \geq \mu _ { d } ( T ^ { - 1 } ( A ) _ { \epsilon \sqrt { 2 \pi } } ) \geq \Phi ( \Phi ^ { - 1 } ( \mu _ { d } ( T ^ { - 1 } ( A ) ) + \sqrt { 2 \pi } \epsilon ) ) } \end{array}
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
where the first inequality follows from that $T$ has Lipschitz constant √12π , and thus T −1 has Lipschitz constant $\sqrt { 2 \pi }$ ; and the second one follows from Gaussian isoperimetric inequality.
|
| 323 |
+
|
| 324 |
+
When $\mathbb { P } ( A ) \geq 1 / 2$ ,
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\Phi ( \Phi ^ { - 1 } ( \mu _ { d } ( T ^ { - 1 } ( A ) ) + { \sqrt { 2 \pi } } \epsilon ) ) \geq \Phi ( \Phi ^ { - 1 } ( { \sqrt { 2 \pi } } \epsilon ) )
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
Additionally, the inequality $\Phi ( x ) \geq 1 - e ^ { \frac { x ^ { 2 } } { 2 } }$ implies the last inequality in the theorem.
|
| 331 |
+
|
| 332 |
+
# (Second Inequality for Ball)
|
| 333 |
+
|
| 334 |
+
We first define the notion of modulus of convexity for a normed space, in this case $\ell _ { 2 }$ :
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { l } { \displaystyle \delta _ { \ell _ { 2 } } ( \epsilon ) = \operatorname* { i n f } \{ 1 - \| \frac { x + y } { 2 } \| : \| x \| = \| y \| = 1 , \| x - y \| \ge \epsilon \} } \\ { \displaystyle = 1 - \sqrt { 1 - \frac { \epsilon ^ { 2 } } { 4 } } } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
The important property about $\delta _ { \ell _ { 2 } } ( \epsilon )$ is that there is a constant $C$ such that:
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\delta _ { \ell _ { 2 } } ( \epsilon ) \geq C \epsilon ^ { 2 }
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
By elementary algebraic calculuation, We can take C = 2− 33 .
|
| 347 |
+
|
| 348 |
+
By Equation (2.25) in (Ledoux, 2005),
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\mathbb { P } ( A _ { \epsilon } ) \geq 1 - \frac { 1 } { \mathbb { P } ( B ) } ( 1 - \delta _ { \ell _ { 2 } } ( \epsilon ) ) ^ { 2 d } \geq 1 - \frac { 1 } { \mathbb { P } ( A ) } e ^ { - 2 d \delta _ { \ell _ { 2 } } ( \epsilon ) } = 1 - \frac { 1 } { \mathbb { P } ( A ) } e ^ { - 2 d ( \frac { 2 - \sqrt { 3 } } { 3 } ) \epsilon ^ { 2 } }
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
# B DETAILED SETTINGS FOR TRAINING
|
| 355 |
+
|
| 356 |
+
# B.1 DETAILED SETTINGS OF ADVERSARIAL TRAINING
|
| 357 |
+
|
| 358 |
+
The LeNet5 (widen factor 1) is composed of 32-channel conv filter $\mathbf { \Sigma } + \operatorname { R e L U } + \operatorname { s i z e } 2 \operatorname* { m a x } { \mathrm { p o o l i n g } } +$ 64-channel conv filter $^ +$ ReLU $^ +$ size 2 max pooling $^ +$ fc layer with 1024 units $+ { \mathrm { R e L U } } +$ fc layer with 10 output classes. We do not preprocess MNIST images before feeding into the model.
|
| 359 |
+
|
| 360 |
+
For training LeNet5 on MNIST variants, we use the Adam optimizer with an initial learning rate of 0.0001 and train for 100000 steps with batch size 50.
|
| 361 |
+
|
| 362 |
+
Table 2: Performance and Robustness of models trained on MNIST variants.
|
| 363 |
+
|
| 364 |
+
<table><tr><td></td><td>STANDARD TRAINING</td><td colspan="3">PGD TRAINING</td></tr><tr><td>MNIST VARIANTS</td><td>TEST ACC</td><td>TEST ACC</td><td>ROBUST ACCURACY ∈=0.3</td><td>ROBUSTNESS W.R.T. PREDICTIONS ∈=0.3</td></tr><tr><td></td><td></td><td></td><td>98.1%</td><td></td></tr><tr><td>BINARIZED ORIGINAL</td><td>98.5% 99.3%</td><td>98.9 % 99.2 %</td><td>95.1%</td><td>98.5% 95.1%</td></tr><tr><td>SMOOTH 2</td><td></td><td></td><td>93.0%</td><td></td></tr><tr><td>SMOOTH3</td><td>99.3% 99.2%</td><td>98.9% 99.0%</td><td>91.3 %</td><td>93.1%</td></tr><tr><td>SMOOTH 4</td><td>99.1 %</td><td>98.8%</td><td>90.3%</td><td>91.4 %</td></tr><tr><td></td><td></td><td>98.7%</td><td>89.6%</td><td>90.4 %</td></tr><tr><td>SMOOTH5 SMOOTH 6</td><td>99.0% 99.1%</td><td>98.5%</td><td>87.6%</td><td>89.7%</td></tr><tr><td>SMOOTH7</td><td>99.0%</td><td>98.3%</td><td>85.4 %</td><td>87.7% 85.5%</td></tr><tr><td>SMOOTH8</td><td>99.0%</td><td>97.9%</td><td>83.1%</td><td>83.3%</td></tr></table>
|
| 365 |
+
|
| 366 |
+
Table 3: Performance and Robustness of models trained on CIFAR10 variants.
|
| 367 |
+
|
| 368 |
+
<table><tr><td></td><td>STANDARD TRAINING</td><td colspan="3">PGD TRAINING</td></tr><tr><td>CIFAR10 VARIANTS</td><td>TEST ACC</td><td>TEST ACC</td><td>ROBUST ACCURACY ∈=8/255</td><td>ROBUSTNESS W.R.T. PREDICTIONS e=8/255</td></tr><tr><td>SATURATE 1</td><td>93.8%</td><td>77.5%</td><td>33.0%</td><td>33.6%</td></tr><tr><td>SATURATE 1.5</td><td>94.7 %</td><td>83.7%</td><td>38.7%</td><td>39.1%</td></tr><tr><td>SATURATE 1.75</td><td>95.2%</td><td>84.9%</td><td>41.1 %</td><td>41.5 %</td></tr><tr><td>ORIGINAL</td><td>95.0%</td><td>85.4%</td><td>43.2 %</td><td>43.6%</td></tr><tr><td>SATURATE 2.25</td><td>94.8 %</td><td>85.4%</td><td>44.4 %</td><td>44.9 %</td></tr><tr><td>SATURATE 2.5</td><td>94.8%</td><td>84.8 %</td><td>46.4 %</td><td>47.0 %</td></tr><tr><td>SATURATE3</td><td>94.5%</td><td>82.9%</td><td>51.7%</td><td>52.9 %</td></tr><tr><td>SATURATE 4</td><td>93.8%</td><td>80.4%</td><td>64.0%</td><td>68.7%</td></tr><tr><td>SATURATE8</td><td>93.3%</td><td>80.4%</td><td>78.1%</td><td>93.8%</td></tr><tr><td>SATURATE 16</td><td>92.9 %</td><td>79.9 %</td><td>79.4 %</td><td>98.4%</td></tr><tr><td>SATURATE 64</td><td>89.6%</td><td>79.5 %</td><td>79.3%</td><td>99.1 %</td></tr><tr><td>SATURATE 128</td><td>85.3%</td><td>80.2%</td><td>79.9%</td><td>99.1%</td></tr><tr><td>SATURATE 256</td><td>83.0%</td><td>80.0%</td><td>79.7%</td><td>99.2 %</td></tr><tr><td>SATURATE INF</td><td>80.3%</td><td>80.0%</td><td>79.7%</td><td>99.2%</td></tr></table>
|
| 369 |
+
|
| 370 |
+
We use the WideResNet-28-4 as described in Zagoruyko and Komodakis (2016) for our experiments, where 28 is the depth and 4 is the widen factor. We use “per image standardization” 10 to preprocess CIFAR10 images, following Madry et al. (2017).
|
| 371 |
+
|
| 372 |
+
For training WideResNet on CIFAR10 variants, we use stochastic gradient descent with momentum 0.9 and weight decay 0.0002. We train 80000 steps in total with batch size 128. The learning rate is set to 0.1 at step 0, 0.01 at step 40000, and 0.001 at step 60000.
|
| 373 |
+
|
| 374 |
+
We performed manual hyperparameter search for our initial experiment and do not observe improvements over the above settings. Therefore we used these settings throughout the all the experiments in the paper unless otherwise indicated.
|
| 375 |
+
|
| 376 |
+
# B.2 LP ROBUST MODEL DESCRIBED IN SECTION 2
|
| 377 |
+
|
| 378 |
+
For the linear programming based provably robust model (Wong and Kolter, 2018) (LP-robust model). We trained a ConvNet identical to the one in the original paper. It has 2 convolutional layers, with 16 and 32 channels, each with a stride of 2; and 2 fully connected layers, the first one maps the flattened convolution features to hidden dimension 100, the second maps to 10 logit units. We use ReLUs as the nonlinear activation and there is no max pooling in the network.
|
| 379 |
+
|
| 380 |
+
We train for 100 epochs with batch size 50. The first 50 epochs are warm start epochs where epsilon increases from 0.01 to 0.3 linearly. We use Adam optimizer (Kingma and Ba, 2014) with a constant learning rate of 0.001.
|
| 381 |
+
|
| 382 |
+
# C DETAILED EXPERIMENTAL RESULTS
|
| 383 |
+
|
| 384 |
+
We listed exact numbers of experiments involved in the main body in Table 2, 3, 4 and 5.
|
| 385 |
+
|
| 386 |
+
Table 4: Performance and robustness of different sized LeNet5 models on MNIST variants
|
| 387 |
+
|
| 388 |
+
<table><tr><td colspan="10">STANDARD TRAINING,ACCURACY</td><td colspan="3">TEST SET</td></tr><tr><td>WIDEN FACTOR 0.125</td><td>0.25</td><td></td><td>0.5</td><td>1</td><td>2</td><td>4</td><td>0.125</td><td>0.25</td><td>0.5</td><td>1</td><td>2</td><td>4</td></tr><tr><td></td><td>99.9%</td><td>100.0%</td><td>100.0%</td><td>99.6%</td><td>100.0%</td><td>100.0%</td><td>98.7%</td><td>99.0%</td><td>99.2%</td><td>98.5%</td><td>99.4%</td><td>99.2%</td></tr><tr><td>BINARIZED ORIGINAL</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.8%</td><td>99.2%</td><td>99.2%</td><td>99.3%</td><td>99.4%</td><td>99.3%</td></tr><tr><td>SMOOTH 2</td><td>99.9%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.8%</td><td>99.0%</td><td>99.1%</td><td>99.3%</td><td>99.3%</td><td>99.4%</td></tr><tr><td>SMOOTH 3</td><td>99.9%</td><td>99.9%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.8%</td><td>98.8%</td><td>99.2%</td><td>99.2%</td><td>99.1%</td><td>99.3%</td></tr><tr><td>SMOOTH 4</td><td>99.9%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.7%</td><td>99.0%</td><td>99.0%</td><td>99.1%</td><td>99.4%</td><td>99.4%</td></tr><tr><td>SMOOTH 5</td><td>99.8%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.5%</td><td>99.0%</td><td>99.2%</td><td>99.0%</td><td>99.3%</td><td>99.3%</td></tr><tr><td>SMOOTH 6</td><td>99.8%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.4%</td><td>98.9%</td><td>99.0%</td><td>99.1%</td><td>99.2%</td><td>99.3%</td></tr><tr><td>SMOOTH7</td><td>99.8%</td><td>99.9%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.5%</td><td>98.8%</td><td>99.0%</td><td>99.0%</td><td>99.3%</td><td>99.3%</td></tr><tr><td>SMOOTH8</td><td>99.7%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>98.4%</td><td>98.9%</td><td>98.9%</td><td>99.0%</td><td>99.2%</td><td>99.0%</td></tr><tr><td></td><td></td><td colspan="9"></td><td></td></tr><tr><td>TRAINING SET</td><td colspan="4"></td><td colspan="3">PGD TRAINING,ACCURACY</td><td colspan="4">TEST SET</td></tr><tr><td>WIDEN FACTOR</td><td>0.125</td><td>0.25</td><td>0.5</td><td>1</td><td>2</td><td>4</td><td>0.125</td><td>0.25</td><td>0.5</td><td>1</td><td>2</td><td>4</td></tr><tr><td>BINARIZED</td><td>97.8%</td><td>99.6%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>97.4%</td><td>98.3%</td><td>98.8%</td><td>98.9%</td><td>99.0%</td><td>99.2%</td></tr><tr><td>ORIGINAL</td><td>97.0%</td><td>98.4%</td><td>99.8%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>97.0%</td><td>98.2%</td><td>98.9%</td><td>99.2%</td><td>99.1%</td><td>99.2%</td></tr><tr><td>SMOOTH 2</td><td>96.1%</td><td>98.1%</td><td>99.0%</td><td>99.9%</td><td>100.0%</td><td>100.0%</td><td>96.1%</td><td>97.8%</td><td>98.5%</td><td>98.9%</td><td>99.0%</td><td>99.0%</td></tr><tr><td>SMOOTH 3</td><td>96.3%</td><td>97.8%</td><td>98.9%</td><td>99.7%</td><td>99.9%</td><td>100.0%</td><td>96.5%</td><td>97.6%</td><td>98.6%</td><td>99.0%</td><td>99.1%</td><td>99.1%</td></tr><tr><td>SMOOTH 4</td><td>95.3%</td><td>97.3%</td><td>98.5%</td><td>99.5%</td><td>99.8%</td><td>99.9%</td><td>95.4%</td><td>97.2%</td><td>98.1%</td><td>98.8%</td><td>99.0%</td><td>99.0%</td></tr><tr><td>SMOOTH 5</td><td>94.9%</td><td>96.5%</td><td>98.0%</td><td>99.3%</td><td>99.6%</td><td>99.8%</td><td>95.0%</td><td>96.5%</td><td>97.9%</td><td>98.7%</td><td>98.9%</td><td>98.9%</td></tr><tr><td>SMOOTH 6</td><td>93.2% 91.9%</td><td>95.6%</td><td>97.4%</td><td>99.0%</td><td>99.5%</td><td>99.7%</td><td>93.5%</td><td>95.7%</td><td>97.1%</td><td>98.5%</td><td>98.7%</td><td>98.7%</td></tr><tr><td>SMOOTH 7 SMOOTH8</td><td>89.4%</td><td>95.0% 94.2%</td><td>97.5%</td><td>98.7% 98.4%</td><td>99.2%</td><td>99.4%</td><td>92.4%</td><td>95.2% 94.4%</td><td>97.2%</td><td>98.3% 97.9%</td><td>98.5% 98.2%</td><td>98.7% 98.4%</td></tr><tr><td></td><td></td><td>96.5%</td><td></td><td>99.0%</td><td>99.3%</td><td>89.7%</td><td></td><td>96.4%</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="9">PGD TRAINING,ROBUST ACCURACY TRAINING SET</td><td colspan="4"></td></tr><tr><td>WIDEN FACTOR 0.125</td><td></td><td>0.25</td><td>0.5</td><td>1</td><td>2</td><td>4</td><td>0.125</td><td>0.25</td><td>0.5</td><td>1</td><td>2</td><td>4</td></tr><tr><td>BINARIZED</td><td>95.2%</td><td>98.5%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>100.0%</td><td>94.5%</td><td>96.5%</td><td>98.0%</td><td>98.1%</td><td>98.0%</td><td>98.0%</td></tr><tr><td>ORIGINAL</td><td>86.9%</td><td>90.8%</td><td>97.9%</td><td>99.3%</td><td>99.6%</td><td>99.8%</td><td>87.1%</td><td>89.9%</td><td>95.2%</td><td>95.1%</td><td>94.8%</td><td>94.9%</td></tr><tr><td>SMOOTH 2</td><td>80.5%</td><td>87.6%</td><td>90.9%</td><td>98.0%</td><td>99.1%</td><td>99.5%</td><td>81.2%</td><td>87.0%</td><td>88.7%</td><td>93.0%</td><td>92.3%</td><td>92.1%</td></tr><tr><td>SMOOTH 3</td><td>75.2%</td><td>82.0%</td><td>90.3%</td><td>95.5%</td><td>97.8%</td><td>98.7%</td><td>75.7%</td><td>81.5%</td><td>88.5%</td><td>91.3%</td><td>91.6%</td><td>90.8%</td></tr><tr><td>SMOOTH 4</td><td>71.9%</td><td>77.6%</td><td>87.5%</td><td>93.9%</td><td>96.8%</td><td>97.9%</td><td>72.7%</td><td>77.7%</td><td>86.3%</td><td>90.3%</td><td>90.6%</td><td>90.0%</td></tr><tr><td>SMOOTH5</td><td>65.7%</td><td>77.1%</td><td>85.7%</td><td>92.5%</td><td>94.6%</td><td>95.0%</td><td>66.2%</td><td>77.1%</td><td>85.1%</td><td>89.6%</td><td>89.8%</td><td>88.4%</td></tr><tr><td>SMOOTH 6</td><td>58.0%</td><td>71.5%</td><td>80.5%</td><td>90.6%</td><td>93.1%</td><td>93.8%</td><td>59.3%</td><td>72.0%</td><td>80.2%</td><td>87.6%</td><td>88.0%</td><td>87.2%</td></tr><tr><td>SMOOTH7</td><td>61.7%</td><td>74.2%</td><td>83.3%</td><td>87.6%</td><td>90.5%</td><td>92.6%</td><td>62.8%</td><td>75.3%</td><td>83.0%</td><td>85.4%</td><td>86.7%</td><td>87.8%</td></tr><tr><td>SMOOTH 8</td><td>70.3%</td><td>72.4%</td><td>80.3%</td><td>85.3%</td><td>90.5%</td><td>88.7%</td><td>71.7%</td><td>73.2%</td><td>80.3%</td><td>83.1%</td><td>86.9%</td><td>83.8%</td></tr></table>
|
| 389 |
+
|
| 390 |
+
# D DETAILED ANALYSES
|
| 391 |
+
|
| 392 |
+
# D.1 DETAILED ANALYSIS OF EFFECTS OF DATA DOMAIN BOUNDARY
|
| 393 |
+
|
| 394 |
+
One natural hypothesis about the reason of achieving better robustness could be that it is the effect of the boundaries. Indeed, if the data distribution is closer to the data domain boundary, the valid perturbation space, the $\epsilon \mathrm { - } \ell _ { \infty }$ ball may be restricted since it will intersect with the boundary. We then test the correlation between “how close the data distribution is to the boundary” and its achievable robustness, by examining the volume of the allowed perturbed box across different datasets.
|
| 395 |
+
|
| 396 |
+
The intersection of the data domain, unit cube $[ 0 , 1 ] ^ { d }$ , with the allowed perturbation space, $\epsilon \mathrm { - } \ell _ { \infty }$ ball $[ x _ { i } - \epsilon , x _ { i } + \epsilon ] ^ { d }$ , is the hyperrectangle $[ \operatorname* { m a x } \{ \bar { x } _ { i } - \epsilon , 0 \} , \operatorname* { m i n } \{ x _ { i } + \epsilon , 1 \} ] ^ { d }$ , where $i = 1 , \cdots , d$ are the indexes over input dimensions. The size of the available perturbation space at $x$ and $\epsilon$ is defined by the volume of this hyperrectangle:
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\mathrm { V o l } ( x , \epsilon ) = \prod _ { i = 1 } ^ { d } ( \operatorname* { m i n } \{ x _ { i } + \epsilon _ { i } , 1 \} - \operatorname* { m a x } \{ x _ { i } - \epsilon _ { i } , 0 \} )
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
In high dimensional space, when $\epsilon$ is fixed, this volume varies greatly based on the location of $x$ . For example, if $x$ is on one of the corners of the unit cube, $\mathrm { V o } \bar { \mathrm { l } } ( x _ { c o r n e r } , \epsilon ) = \epsilon ^ { d }$ . If each dimension of $x$ is at least $\epsilon$ away from all the data boundaries, then the volume of the hyperrectangle is $\mathrm { V o l } ( x _ { i n s i d e } , \epsilon ) = ( 2 \epsilon ) ^ { d }$ . Therefore there can be $2 ^ { d }$ times difference of perturbable space between different data points. As shown in the average log perturbable volumes Table 6, we can see that different variations of datasets has significantly different perturbable volumes, with the same trend with previously described. It is notable that for the original CIFAR10 datasets has log volume -12354, which is very close to the -12270. The different of 84 bits indicates on average, the perturbation space is $2 ^ { 8 4 }$ smaller than the full $\epsilon \mathrm { - } \ell _ { \infty }$ ball if there is no intersection with the data domain boundary. Volume differences between different saturation or smooth level can be interpreted in the similar way. Note that for CIFAR10 images with large saturation, although they appear similar to human, they actually have very large differences in terms of perturbable volumes.
|
| 403 |
+
|
| 404 |
+
Table 5: Performance and robustness of different sized Wide ResNet models on CIFAR10 variants
|
| 405 |
+
|
| 406 |
+
<table><tr><td>TEST SET</td><td colspan="6">STANDARD TRAINING,ACCURACY TRAINING SET</td></tr><tr><td></td><td>0.25</td><td>1</td><td>4</td><td>0.25</td><td>1</td><td>4</td></tr><tr><td>WIDEN FACTOR</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SATURATE1 SATURATE1.5</td><td>85.5% 87.0%</td><td>99.9% 99.9%</td><td>100.0% 100.0%</td><td>82.4% 84.2%</td><td>91.1% 92.1%</td><td>93.8% 94.7%</td></tr><tr><td></td><td>87.4%</td><td>99.9%</td><td>100.0%</td><td>84.5%</td><td>93.0%</td><td>95.2%</td></tr><tr><td>SATURATE 1.75 ORIGINAL</td><td>87.2%</td><td>99.9%</td><td>100.0%</td><td>84.4%</td><td>92.5%</td><td>95.0%</td></tr><tr><td>SATURATE 2.25</td><td>87.3%</td><td>99.9%</td><td>100.0%</td><td>84.5%</td><td>92.5%</td><td>94.8%</td></tr><tr><td>SATURATE 2.5</td><td>86.4%</td><td>99.9%</td><td>100.0%</td><td>83.7%</td><td>92.3%</td><td>94.8%</td></tr><tr><td>SATURATE 3</td><td>86.2%</td><td>99.9%</td><td>100.0%</td><td>84.0%</td><td>92.2%</td><td>94.5%</td></tr><tr><td>SATURATE 4</td><td>85.8%</td><td>99.9%</td><td>100.0%</td><td>83.1%</td><td>91.1%</td><td>93.8%</td></tr><tr><td>SATURATE8</td><td>84.6%</td><td>99.8%</td><td>100.0%</td><td>81.2%</td><td>90.1%</td><td>93.3%</td></tr><tr><td>SATURATE 16</td><td>83.5%</td><td>99.7%</td><td>100.0%</td><td>81.0%</td><td>89.4%</td><td>92.9%</td></tr><tr><td>SATURATE 64</td><td>80.5%</td><td>99.4%</td><td>100.0%</td><td>79.2%</td><td>86.9%</td><td>89.6%</td></tr><tr><td>SATURATE 128</td><td>77.1%</td><td>98.7%</td><td>100.0%</td><td>74.6%</td><td>83.0%</td><td>85.3%</td></tr><tr><td>SATURATE 256</td><td>73.7%</td><td>97.6%</td><td>100.0%</td><td>70.7%</td><td>76.5%</td><td>83.0%</td></tr><tr><td>SATURATE INF</td><td>73.2%</td><td>97.3%</td><td>99.9%</td><td>70.6%</td><td>76.3%</td><td>80.3%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="7">PGD TRAINING,ACCURACY</td></tr><tr><td>WIDEN FACTOR</td><td></td><td>TRAINING SET 1</td><td>4</td><td>0.25</td><td>TEST SET</td><td>4</td></tr><tr><td></td><td>0.25</td><td></td><td></td><td></td><td>1</td><td></td></tr><tr><td>SATURATE 1</td><td>45.4% 52.1%</td><td>68.3% 76.5%</td><td>93.1% 98.0%</td><td>46.8% 53.3%</td><td>66.9% 74.1%</td><td>77.5% 83.7%</td></tr><tr><td>SATURATE 1.5 SATURATE 1.75</td><td>53.8%</td><td>79.5%</td><td>99.2%</td><td>55.3%</td><td>77.0%</td><td>84.9%</td></tr><tr><td>ORIGINAL</td><td>56.1%</td><td>81.4%</td><td>99.7%</td><td>57.1%</td><td>78.4%</td><td>85.4%</td></tr><tr><td>SATURATE 2.25</td><td>56.8%</td><td>82.7%</td><td>99.9%</td><td>58.1%</td><td>78.8%</td><td>85.4%</td></tr><tr><td>SATURATE 2.5</td><td>57.6%</td><td>83.9%</td><td>100.0%</td><td>58.3%</td><td>79.1%</td><td>84.8%</td></tr><tr><td>SATURATE 3</td><td>60.0%</td><td>86.3%</td><td>100.0%</td><td>60.8%</td><td>79.5%</td><td>82.9%</td></tr><tr><td>SATURATE 4</td><td>62.8%</td><td>91.3%</td><td>100.0%</td><td>63.7%</td><td>77.9%</td><td>80.4%</td></tr><tr><td>SATURATE8</td><td>67.7%</td><td>96.1%</td><td>100.0%</td><td>67.0%</td><td>76.6%</td><td>80.4%</td></tr><tr><td>SATURATE 16</td><td>67.2%</td><td>96.1%</td><td>99.9%</td><td>66.0%</td><td>76.4%</td><td>79.9%</td></tr><tr><td>SATURATE 64</td><td>70.0%</td><td>96.5%</td><td>99.9%</td><td>68.6%</td><td>75.8%</td><td>79.5%</td></tr><tr><td></td><td>71.4%</td><td>96.4%</td><td>99.9%</td><td>68.9%</td><td>76.6%</td><td>80.2%</td></tr><tr><td>SATURATE 128</td><td>68.6%</td><td>96.9%</td><td>99.9%</td><td></td><td></td><td></td></tr><tr><td>SATURATE 256 SATURATE INF</td><td>71.5%</td><td>96.9%</td><td></td><td>65.7%</td><td>76.6%</td><td>80.0%</td></tr><tr><td></td><td></td><td></td><td>99.9%</td><td>69.7%</td><td>76.1%</td><td>80.0%</td></tr><tr><td colspan="7">PGD TRAINING,ROBUST ACCURACY</td></tr><tr><td></td><td></td><td>TRAINING SET</td><td></td><td></td><td>TEST SET</td><td></td></tr><tr><td>WIDEN FACTOR</td><td>0.25</td><td>1</td><td>4</td><td>0.25</td><td>1</td><td>4</td></tr><tr><td>SATURATE1</td><td>24.0% 29.0%</td><td>36.9%</td><td>71.1%</td><td>25.6%</td><td>34.4%</td><td>33.0% 38.7%</td></tr><tr><td>SATURATE 1.5</td><td>30.9%</td><td>44.4% 47.8%</td><td>81.3% 86.0%</td><td>31.6% 32.7%</td><td>40.7% 44.0%</td><td>41.1%</td></tr><tr><td>SATURATE 1.75</td><td>32.4%</td><td>50.4%</td><td>90.3%</td><td>35.0%</td><td>45.5%</td><td>43.2%</td></tr><tr><td>ORIGINAL SATURATE2.25</td><td>33.9%</td><td>52.9%</td><td>93.4%</td><td>36.1%</td><td>47.3%</td><td>44.4%</td></tr><tr><td>SATURATE 2.5</td><td>35.5%</td><td>55.4%</td><td>96.0%</td><td>37.5%</td><td>49.1%</td><td>46.4%</td></tr><tr><td>SATURATE 3</td><td>38.4%</td><td>61.5%</td><td>98.9%</td><td>40.6%</td><td>52.5%</td><td>51.7%</td></tr><tr><td>SATURATE 4</td><td>44.9%</td><td>77.4%</td><td>99.7%</td><td>46.1%</td><td>60.4%</td><td>64.0%</td></tr><tr><td>SATURATE8</td><td>62.3%</td><td>95.0%</td><td>99.8%</td><td>61.9%</td><td>74.9%</td><td>78.1%</td></tr><tr><td>SATURATE 16</td><td>66.0%</td><td>95.5%</td><td>99.9%</td><td>65.0%</td><td>75.5%</td><td>79.4%</td></tr><tr><td>SATURATE 64</td><td>69.1%</td><td>96.3%</td><td>99.9%</td><td>67.6%</td><td>75.5%</td><td>79.3%</td></tr><tr><td>SATURATE 128</td><td>70.7%</td><td>96.2%</td><td>99.9%</td><td>68.2%</td><td>76.2%</td><td>79.9%</td></tr><tr><td>SATURATE 256</td><td>68.0%</td><td>96.7%</td><td>99.9%</td><td>65.2%</td><td>76.3%</td><td>79.7%</td></tr><tr><td>SATURATE INF</td><td>70.9%</td><td>96.7%</td><td>99.9%</td><td>69.2%</td><td>75.8%</td><td>79.7%</td></tr></table>
|
| 407 |
+
|
| 408 |
+
Table 6: Perturbable volumes of different variants of MNIST and CIFAR10. Values shown in table are the average log value (in bits) of volumes of test data. For MNIST, $\epsilon = 0 . 3$ , for CIFAR10 $\epsilon = 8 / 2 5 5$ .
|
| 409 |
+
|
| 410 |
+
<table><tr><td colspan="5">MNIST(VALID RANGE -1361 TO -577)</td><td colspan="8">CIFAR10 (VALID RANGE -15342 TO -12270)</td></tr><tr><td>BINARY</td><td>ORIGINAL</td><td>3</td><td>5</td><td>ORIGINAL</td><td>4</td><td>8</td><td>16</td><td>64</td><td>256</td><td>512</td><td>INF</td></tr><tr><td>-1361</td><td>-1297</td><td>-1265</td><td>-1234</td><td>-12354</td><td>-12394</td><td>-12477</td><td>-12657</td><td>-13620</td><td>-14747</td><td>-15028</td><td>-15342</td></tr></table>
|
| 411 |
+
|
| 412 |
+
If the perturbable volume hypothesis holds, then we should observe significantly lower accuracy under PGD attack if we allow perturbation outside of data domain boundary. Since this greatly increases the perturbable volume. We measure the accuracy under PGD attack with and without considering data domain boundary for both MNIST and CIFAR10 variants. The results are shown in Table 7. “With considering boundary” corresponds to regular PGD attacks. We can see that allowing PGD to perturb out of bound do not reduce accuracy under attack. This means that PGD is not able to use the significantly larger additional volumes even for binarized MNIST or highly saturated CIFAR10, whose data points are on or very close to the corner. In some cases, allowing perturbation outside of domain boundary makes the attack slightly less effective. This might be due to that data domain boundary constrained the perturbation to be in an “easier” region. This might seem surprising considering the huge difference in perturbable volumes, these results conform with empirical results in previous research (Goodfellow et al., 2014; Warde-Farley and Goodfellow, 2016) that adversarial examples appears in certain directions instead of being distributed in small pockets across space. Therefore, the perturbable volume hypothesis is rejected.
|
| 413 |
+
|
| 414 |
+
Table 7: PGD attack results with and without domain boundary constraints on MNIST and CIFAR10
|
| 415 |
+
|
| 416 |
+
<table><tr><td colspan="3">MNIST</td><td colspan="3">CIFAR10</td></tr><tr><td>MNIST VARIANTS</td><td>ROBUST ACCURACY W/BOUND</td><td>ROBUST ACCURACY W/O BOUND</td><td>CIFAR10 VARIANTS</td><td>ROBUST ACCURACY W/BOUND</td><td>ROBUST ACCURACY W/O BOUND</td></tr><tr><td>BINARIZED</td><td>98.1%</td><td>96.1 %</td><td>SATURATE 1</td><td>33.0%</td><td>32.7%</td></tr><tr><td>ORIGINAL</td><td>95.1 %</td><td>95.1 %</td><td>ORIGINAL</td><td>43.2 %</td><td>43.0 %</td></tr><tr><td>SMOOTH2</td><td>93.0%</td><td>92.9%</td><td>SATURATE 4</td><td>64.0 %</td><td>64.0 %</td></tr><tr><td>SMOOTH 3</td><td>91.3 %</td><td>91.5%</td><td>SATURATE8</td><td>78.1%</td><td>78.1%</td></tr><tr><td>SMOOTH4</td><td>90.3%</td><td>90.6 %</td><td>SATURATE 16</td><td>79.4 %</td><td>79.4 %</td></tr><tr><td>SMOOTH5</td><td>89.6%</td><td>89.9%</td><td>SATURATE INF</td><td>79.7%</td><td>79.4%</td></tr></table>
|
| 417 |
+
|
| 418 |
+
# D.2 DETAILED ANALYSES OF INTER-CLASS DISTANCE
|
| 419 |
+
|
| 420 |
+
# D.2.1 CALCULATION OF INTER-CLASS DISTANCE
|
| 421 |
+
|
| 422 |
+
We calculate the inter-class distance as follows. Let $D = \{ x _ { i } \}$ denote the set of all the input data points, $D _ { c } = \{ x _ { i } | y _ { i } = c \}$ denote the set of all the data points in class $c$ , and $D _ { \neg c } = \{ x _ { i } \bar { | y _ { i } \neq c \} }$ denote all the data points not in class $c$ . Our goal is to calculate $d ( D _ { c } , D _ { \neg c } )$ for all the classes, where $d ( D _ { c } , D _ { \neg c } )$ approximates the margin between class $c$ and the rest. To estimate $d ( D _ { c } , D _ { \neg c } )$ , we first compute the margin for each data point $x$ in class $c$ . To do that, we calculate the average $\| x - x _ { j } \| _ { 2 }$ , where $x _ { j } \in D _ { \neg c }$ is one of $x$ ’s $10 \%$ nearest neighbors in $D _ { \neg c }$ . Lastly, the inter-class distance of class c, $d ( D _ { c } , \bar { D } _ { \lnot c } )$ , is then calculated as the average of smallest $1 0 \% d \dot { ( } x , D _ { \neg c } )$ for $x \in D _ { c }$ .
|
| 423 |
+
|
| 424 |
+
Note that we choose $\ell _ { 2 }$ distance for inter-class distance, instead of using the $\ell _ { \infty }$ which measures the robustness. This is because $\ell _ { \infty }$ -distance between data examples is essentially the max over the per pixel differences, which is always very close to 1. Therefore the $\ell _ { \infty }$ -distance between data examples is not really representative / distinguishable.
|
| 425 |
+
|
| 426 |
+
Figure 5 shows the inter-class distances (averaged over all classes) calculated on MNIST and CIFAR10 variants. The binarized MNIST has a significantly larger inter-class distance. As smoothing kernel size increases, the distance also decrease slightly. On CIFAR10 variants, as the saturation level gets higher, the inter-class distance increases monotonically. We also directly plot inter-class distance vs robust accuracy on MNIST and CIFAR10 variants. In general, inter-class distance shows a strong positive correlation with robust accuracy under these transformations. With one exception that original MNIST has smaller inter-class distance, but is sightly more robust than smooth-2 MNIST. This, together with the counter examples we gave in Table 1, suggests that inter-class distance cannot fully explain the robust variation across different dataset variants.
|
| 427 |
+
|
| 428 |
+
# D.2.2 INTER-CLASS DISTANCE COULD POTENTIALLY INFLUENCE REQUIRED MODEL CAPACITY
|
| 429 |
+
|
| 430 |
+
We attempt to understand the relation between the inter-class distance of a dataset and its achievable robustness in this section. We first illustrate our intuition in a synthetic experiment, where a ReLU network is trained to perfectly separate 2 concentric spheres (Gilmer et al., 2018), as shown in Figure 6. Here the inter-class distance is the width of the ring between two spheres. In such example, adversarial training is actually closely related to the inter-class distance of the data. In fact, in the simple setting where the classifier is linear, it has been shown in $\mathrm { X u }$ et al. (2009) that adversarial training, as a particular form of robust optimization, is equivalent to maximizing the classification margins. Following this intuition, one can easily see that the effect of adversarial training is to push two spheres close to each other, and requires the network to perfectly separate the new spheres with much smaller inter-class.
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 5: Inter-class distance’s influence on robust accuracy on different MNIST and CIFAR10 variants
|
| 434 |
+
|
| 435 |
+
Intuitively, when the inter-class distance is large, i.e. the gap between two spheres are large, a reasonable model should be able to achieve good standard accuracy. We have also observed such phenomenon on original MNIST and saturated CIFAR10 (say level 16). As the inter-class distance gets smaller, although the model capacity could still be enough for the standard training, it may no longer be enough for adversarial training, upon which we would observe that although the test accuracies stay similar, accuracies under adversarial attack significantly would drop. We have also seen similar behavior on smooth MNIST data and smaller level of saturated CIFAR10 data. Finally, when the inter-class distance is so small such that even a high clean test accuracy may be difficult to achieve.
|
| 436 |
+
|
| 437 |
+
Considering robust accuracy as the clean accuracy with a smaller gap between the spheres, the next theorem provides a theoretical guarantee in relating together the difficulty of attaining good accuracy under attack and the model capacity (Ball, 1997), verifying our intuition above. Note that one way to measure the capacity of a ReLU network is by counting the number of its induced piece-wise linear region, which is closely related to the number of facets of its decision boundary.
|
| 438 |
+
|
| 439 |
+
Theorem D.1. Let $d ( K , L )$ between symmetric convex bodies $K$ and $L$ denote the least positive $d$ for which there is a linear image $\tilde { L }$ of $L$ such that $\tilde { L } \subset K \subset d \tilde { L }$ . Let $K$ be a (symmetric) polytope in $\mathbb { R } ^ { n }$ with $d ( K , B _ { 2 } ^ { n } ) = d$ . Then $K$ has at least $e ^ { n / ( 2 d ^ { 2 } ) }$ facets. On the other hand, for each n, there is a polytope with $4 n$ facets whose distance from the ball is at most 2.
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Figure 6: Illustration of the relationship between the inter-class distance and the required model capacity. Left: when distance is small, a small capacity polytope classifier could separate original data; middle: when distance is small, the small capacity polytope classifier is not able to separate data points “robustly”, but a more complex nonlinear classifier could; right:when distance is large, the small capacity polytope classifier can separate data points “robustly”.
|
| 443 |
+
|
| 444 |
+
The above analysis is partially supported by our experiments on model capacity in Section 5.3. However, as we’ve shown in Section 5.2, the nature of the problem is complex and more conclusive statements requires further research.
|
md/train/S1xq3oR5tQ/S1xq3oR5tQ.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A UNIFIED THEORY OF EARLY VISUAL REPRESENTATIONS FROM RETINA TO CORTEX THROUGH ANATOMICALLY CONSTRAINED DEEP CNNS
|
| 2 |
+
|
| 3 |
+
Jack Lindsey∗ †, Samuel A. Ocko∗, Surya Ganguli1, Stephane Deny† Department of Applied Physics, Stanford and 1Google Brain, Mountain View, CA
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The vertebrate visual system is hierarchically organized to process visual information in successive stages. Neural representations vary drastically across the first stages of visual processing: at the output of the retina, ganglion cell receptive fields (RFs) exhibit a clear antagonistic center-surround structure, whereas in the primary visual cortex (V1), typical RFs are sharply tuned to a precise orientation. There is currently no unified theory explaining these differences in representations across layers. Here, using a deep convolutional neural network trained on image recognition as a model of the visual system, we show that such differences in representation can emerge as a direct consequence of different neural resource constraints on the retinal and cortical networks, and for the first time we find a single model from which both geometries spontaneously emerge at the appropriate stages of visual processing. The key constraint is a reduced number of neurons at the retinal output, consistent with the anatomy of the optic nerve as a stringent bottleneck. Second, we find that, for simple downstream cortical networks, visual representations at the retinal output emerge as nonlinear and lossy feature detectors, whereas they emerge as linear and faithful encoders of the visual scene for more complex cortical networks. This result predicts that the retinas of small vertebrates (e.g. salamander, frog) should perform sophisticated nonlinear computations, extracting features directly relevant to behavior, whereas retinas of large animals such as primates should mostly encode the visual scene linearly and respond to a much broader range of stimuli. These predictions could reconcile the two seemingly incompatible views of the retina as either performing feature extraction or efficient coding of natural scenes, by suggesting that all vertebrates lie on a spectrum between these two objectives, depending on the degree of neural resources allocated to their visual system.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Why did natural selection shape our visual representations to be the way they are? Traditionally, the properties of the early visual system have been explained with theories of efficient coding, which are based on the premise that the neural representations are optimal at preserving information about the visual scene, under a set of metabolic constraints such as total firing rate or total number of synapses. These theories can successfully account for the antagonistic center-surround structure of receptive fields (RFs) found in the retina (Atick & Redlich, 1990; 1992; Vincent & Baddeley, 2003; Karklin & Simoncelli, 2011; Doi et al., 2012), as well as for the oriented structure of RFs found in the primary visual cortex V1 (Olshausen & Field, 1996; 1997; Bell & Sejnowski, 1997).
|
| 12 |
+
|
| 13 |
+
However, a number of properties of the early visual system remain unexplained. First, it is unclear why RF geometries would be so different in the retina and V1. A study (Vincent et al., 2005) has proposed that both representations are optimal at preserving visual information under different metabolic constraints: a constraint on total number of synapses for the retina, and one on total firing rate in V1. However, it is unclear why the two systems would be optimized for these two different objectives. Second, there is a great diversity of ganglion cell types at the output the retina (Gollisch & Meister, 2010), with each cell type tiling the entire visual field and performing a specific computation. Interestingly, some of these types perform a highly nonlinear computation, extracting specific, behaviorally-relevant cues from the visual scene (e.g. direction-selective cells, objectmotion-selective cells), whereas other types are better approximated by a quasi-linear model, and respond to a broad range of stimuli (e.g. midget cells in the primate (Roska & Meister, 2014) and quasi-linear pixel-encoders in the mouse (Johnson et al., 2018)). Intriguingly, although quasi-linear and more nonlinear types exist in species of all sizes (e.g. primate parasol cells are nonlinear (Crook et al., 2008)), the proportion of cells performing a rather linear encoding versus a nonlinear feature detection seems to vary across species. For example, the most common ganglion cell type in the primate retina is fairly well approximated by a quasi-linear pixel-encoder (midget cells, $50 \%$ of all cells and ${ > } 9 5 \%$ in the central retina (Roska & Meister, 2014; Dacey, 2004)), whereas the most common cell type in mouse acts as a specific feature detector, thought to serve as an alarm system for overhead predators (W3 cells, $13 \%$ of all ganglion cells (Zhang et al., 2012)). Again, theories of efficient coding have not been able to account for this diversity of computations found across cell types and across species.
|
| 14 |
+
|
| 15 |
+
The limitations of current efficient coding theories might reside in the simplistic assumption that the objective is to simply relay indiscriminately all visual information to the next stages of processing. Indeed, the ultimate goal of the visual system is to extract meaningful features from the visual scene in order to produce an adequate behavioral response, not necessarily to faithfully encode it. A recent line of work has proposed using the information bottleneck framework as a way to move beyond the simplistic objective of information preservation towards more realistic objectives (Chalk et al., 2016; 2018). Another study has shown that by changing the objective from efficiently encoding the present to efficiently encoding the future (predictive coding), one could better account for the spatio-temporal RFs of V1 cells (Singer et al., 2018). Although promising, these approaches were limited to the study of a single layer of neurons, and they did not answer the aforementioned questions about cross-layer or cross-species differences. On the other hand, deep convolutional networks have proven to be accurate models of the visual system, whether they are trained directly on reproducing neural activity (McIntosh et al., 2016; Cadena et al., 2017), or on a behaviorally relevant task (Yamins et al., 2014; Eberhardt et al., 2016; Cadena et al., 2017), but they have not yet been used to study the visual system through the lens of efficient coding theories.
|
| 16 |
+
|
| 17 |
+
In this study, we trained deep convolutional neural networks on image recognition (CIFAR-10, Krizhevsky (2009)) and varied their architectures to explore the sets of constraints that could have shaped vertebrates’ early visual representations through natural selection. We modeled the visual system with a series of two convolutional networks, one corresponding to the retina and one downstream network corresponding to the ventral visual system in the brain. By varying the architecture of these networks, we first found that a reduction in the number of neurons at the retinal output – corresponding to a realistic physical constraint on the number of fibers in the optic nerve – accounted simultaneously for the emergence of center-surround RFs in our model of the retina, and for the emergence of oriented receptive fields in the primary visual relay of the brain. Second, we found that the degree of neural resources allocated to visual cortices in our model drastically reshaped retinal representations. Given a deep visual cortex, the retinal processing emerged as quasi-linear and retained substantial information about the visual scene. In contrast, for a shallow cortex, the retinal processing emerged as nonlinear and more information-lossy, but was better at extracting features relevant to the object classification task. These observations make testable predictions on the qualitative differences that should be found in retinal representations across species, and could reconcile the seemingly incompatible theories of retinal processing as either performing efficient encoding or feature detection.
|
| 18 |
+
|
| 19 |
+
# 2 FRAMEWORK: A DEEP CONVOLUTIONAL NEURAL NETWORK MODEL OF THE VISUAL SYSTEM
|
| 20 |
+
|
| 21 |
+
The retinal architecture is strongly conserved across species (Masland, 2001), and consists of three layers of feed-forward convolutional neurons (photoreceptors, bipolar cells, ganglion cells) and two layers of inhibitory interneurons (horizontal, amacrine cells). However, we chose to model the retina as a convolutional neural network (LeCun et al., 2015) with only two layers (fig. 1A). Indeed the retinal response of many species to complex stimuli has been modeled successfully with only one or two-layer models (Deny et al., 2017; Maheswaranathan et al., 2018; Gollisch & Meister, 2010), with some rare exceptions of models requiring more layers (McIntosh et al., 2016). We refer to this network as the retina-net. In our simulations, we varied the number of neurons in the second layer of the retina-net, which is the output of the retina, corresponding to the physical bottleneck of the optic nerve conveying all the visual information to the brain (fig. 1B).
|
| 22 |
+
|
| 23 |
+
We modeled the ventral visual system – the system associated with object recognition in the brain (Hubel, 1995) – as a convolutional neural network taking its inputs from the retina-net (fig. 1A). We varied the neural resources allocated to the ventral visual system network (VVS-net) by changing the number of layers it is composed of (fig. 1B).
|
| 24 |
+
|
| 25 |
+
We trained the neural network composed of the retina-net and VVS-net end-to-end on an object classification task (CIFAR-10, fig. 1A-B-C). Even though the visual system does much more than just classify objects in natural images, this objective is already much more complex and biologically realistic than the one used in previous studies of efficient coding, namely preserving all information about the visual scene. Moreover, we are encouraged by the fact that previous studies using this objective have found a good agreement between neural activity in artificial and biological visual networks (Yamins et al., 2014; Cadena et al., 2017).
|
| 26 |
+
|
| 27 |
+
More specifically, we trained a convolutional neural network on a grayscale version of the standard CIFAR-10 dataset for image classification. The retina-net consisted of two convolutional layers with 32 channels and $N _ { B N }$ channels respectively, and with ReLU nonlinearities at each layer. The VVSnet consisted of a varying number $D _ { V V S }$ of convolutional layers with 32 channels followed by two fully connected layers (the first one with 1024 neurons and the second one with 10 neurons mapping to the 10 object categories), with ReLU nonlinearities at each layer and a softmax nonlinearity at the last layer. The full system encompassing the retina-net and VVS-net thus had $3 2 N _ { B N } $ $3 2 3 2 . . .$ channels respectively, where we varied the retinal bottleneck width, $N _ { B N }$ , as well as the number $D _ { V V S }$ of convolutional brain layers (not counting the fully connected layers). In each convolutional layer, we used $9 \mathrm { x } 9$ convolutional filters with a stride of 1 at each step. The large filter size was chosen to give the network flexibility in determining the optimal filter arrangement. We trained our network with the RMSProp optimizer for 20 epochs on the training set with batches of size 32. All optimizations were performed using Keras and TensorFlow. For all results presented, we tested statistical significance by training 10 identical networks with different random initializations of weights and biases taken from a Glorot-uniform distribution (Glorot & Bengio, 2010).
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Illustration of the framework we used to model early visual representations. A: We trained convolutional neural networks on an image recognition task (CIFAR-10). The networks were composed of two parts, a retina-net and a ventral-visual-system-net (VVS-net), which receives input from the retina-net. B: We varied the number of layers in the VVS-net (white boxes) and the number of channels at the output of the retina-net (blue box). C: Key results: (1) A bottleneck at the output of the retina yielded center-surround retinal RFs. (2) A shallow VVS-net yielded more nonlinear retinal responses (linearity is schematized by the red arrow), which better disentangled image classes (represented as bent manifolds). D: Test-set accuracy of all model architectures on CIFAR-10, averaged over ten networks with random initial weights for each architecture. Performance increases with VVS-net depth and retinal channel, indicating that both factors are meaningful constraints on the network in the regime tested.
|
| 31 |
+
|
| 32 |
+
After training, we determined the linear approximation of RFs of each convolutional channel of the network in each layer. This was achieved by computing the gradient of the activation of that channel with respect to a blank image. This gradient map gives a first-order approximation of the image pattern that maximally activates the cells in the channel of interest. In the limit of small noise variance, this computation is mathematically equivalent to measuring the cell’s spike-triggered average in response to a perturbative white-noise stimulus (Koelling & Nykamp, 2008; Schwartz et al., 2006), a commonly used method for determining receptive fields in experimental biology (Chichilnisky, 2001). This equivalence allowed us to compare directly the geometries of RFs experimentally measured in biological networks with the ones found in our models.
|
| 33 |
+
|
| 34 |
+
The test accuracy of our neural network model of the visual system at the recognition task increased both with the number of channels in the retinal bottleneck, and with the number of layers in the VVS-net (fig. 1D), confirming that we were in a regime where the restrictions on neural resources in the VVS-net and at the output of the retina were critical to the ability of the network to perform the task.
|
| 35 |
+
|
| 36 |
+
# 3 A UNIFIED MODEL FOR CENTER-SURROUND RFS IN THE RETINA AND ORIENTED RFS IN V1
|
| 37 |
+
|
| 38 |
+
Here we investigate the effects of a dimensionality bottleneck at the retinal output on early visual representations in our model of the visual system.
|
| 39 |
+
|
| 40 |
+
# 3.1 A DIMENSIONALITY BOTTLENECK AT THE RETINAL OUTPUT YIELDS THE EXPECTED REPRESENTATIONS IN RETINA AND V1
|
| 41 |
+
|
| 42 |
+
When reducing the number of neurons at the output of the retina we found that RFs with antagonistic center and surround emerged. For $N _ { B N } = 3 2$ , our control setting with no bottleneck at the retinal output, we observed mostly oriented receptive fields in the second layer of the network (fig. 2A). For $N _ { B N } = 4 , 2$ , and 1, we observed center-surround receptive fields in the second layer of the network and mostly oriented receptive fields in the third layer, which is the first layer of the ventral visual system in our model (fig. 2B). We quantified these results in App. A. The RF geometries did not depend qualitatively on the VVS-net depth $D _ { V V S }$ (results shown for $D _ { V V S } = 2 $ ), except for the shallowest VVS-net tested ${ \cal D } _ { V V S } = 0$ , no convolutional layer, and thus no dimensionality expansion), for which the shape of emergent retinal RFs were variable across trials and difficult to interpret. These results are in good agreement with the organization of the biological visual system, where retinal RFs are center-surround and most downstream RFs in primary visual cortex (V1) are sharply oriented (Hubel, 1995), suggesting that the dimensionality bottleneck at the output of the retina is sufficient to explain these differences in representations. It is worth noting that for both conditions (bottleneck and no bottleneck), the RFs of downstream layers in the VVS-net after the first layer exhibited complex shapes that were neither clearly oriented, nor circular, and the RFs in the first layer of the retina did not appear to have any well-defined structure (data not shown).
|
| 43 |
+
|
| 44 |
+
We then tested in our model the hypothesis of Hubel and Wiesel concerning how center-surround cells are pooled to give rise to oriented RFs in V1 (Hubel, 1995). We found that orientation-selective neurons in the VVS-net typically draw primarily from center-surround neurons in the retina-net that are aligned with the direction of the edge, with positive or negative weights corresponding to whether the polarity (light-selective / dark-selective) of the two neurons are consistent or inconsistent (fig. 2C, and App. A for a quantification). These qualitative results are in good agreement with Hubel and Wiesel’s hypothesis. Of course, this hypothesis remains to be tested in the real brain, since there is no evidence that the micro-circuitry of the brain matches that of our simulation.
|
| 45 |
+
|
| 46 |
+
In the visual system of mammals, the main relay of visual information taking its input from the retina is the LGN (thalamus), which has center-surround RFs and a similar total number of neurons as the retinal output (Hubel, 1995). We created a network reflecting this architecture by having two lowdimensionality layers in a row instead of just one (fig. 2C). After training, we found center-surround RFs in the two layers with a bottleneck (retinal output and LGN), and oriented RFs in the next layer, corresponding to the primary visual cortex (V1). These results suggest that center-surround representations remain advantageous as long as the dimensionality of the representation remains low, and hence dimensionality expansion seems to be the crucial factor explaining the qualitative change of RFs found between LGN and V1.
|
| 47 |
+
|
| 48 |
+
It is an interesting question to ask whether neurons in our model of the VVS are more similar to simple or complex cells (Hubel, 1995). To test this, we performed a one-step gradient ascent on the neural activity of VVS neurons with respect to the image, starting from several random initial images (App. B). If the neurons were acting as simple cells (i.e. are approximately linear in the stimulus), we would expect all optimized stimuli to converge to the same preferred stimulus. On the other hand, if the cells were complex (i.e. OR function between several preferred stimuli), we would expect the emergent preferred stimuli to depend on the exact initialization. Interestingly, we found that most neurons in the first layer of the VVS-net behaved as simple cells, whereas most neurons in the second layer of the VVS-net behaved as complex cells. Note that in biology, both simple and complex cells are found in V1. These results expose the fact that anatomical regions of visual cortex involve multiple nonlinearities and hence may map onto more than one layer of our simple model. Indeed, V1 itself is a multilayered cortical column, with LGN inputs coming in to layer 4, and layer 4 projecting to layers 2 and 3 (Hubel, 1995). Simple cells are predominantly found in layer 4 and complex cells are predominantly found in layers 2 and 3. These observations bolster the interpretation that biological V1 may correspond to multiple layers in our model.
|
| 49 |
+
|
| 50 |
+
Local divisive normalization (i.e. local gain control) is an ubiquitous source of nonlinearity in the visual system (Geisler & Albrecht, 1992; Heeger, 1992; Deny et al., 2017). We thus tested the robustness of our main result to a more realistic model of the visual system with local normalization, by adding it at every layer of the network (App. C). We found that receptive fields still emerged as center-surround in the retina-net, and as oriented in our model of V1. We note that the local normalization slightly degraded the performance of the network on the task for all parameter settings we tried.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Effects of a bottleneck constraint on receptive fields (RFs). All results are shown for $D _ { V V S } = 2$ . A: Examples of RFs of cells at selected layers (layers 2 and 3) of a control network with no bottleneck. No center-surround RFs appear. B: Center-surround RFs emerge at the output of the retina-net (layer 2) and oriented RFs emerge in the first layer of the VVS-net when we impose a bottleneck constraint at the output of the retina $N _ { B N } = 1$ ) C: Top: Hubel and Wiesel’s hypothesis on oriented cell formation in V1 (Hubel, 1995). Bottom: A representative example of an orientationselective neuron (bottom RF) drawing from center-surround channels (top RFs) in the previous layer with weight matrices (center) according to their polarity. Light / dark-selective regions of a receptive field, and positive / negative weights, are represented with red / blue, respectively. D: Examples of RFs in a network with an extra bottleneck layer corresponding to mammalian LGN. Center-surround RFs appear at both the retinal output and LGN layer. E: Examples of ON and OFF center-surround RFs in the untied network $( N _ { B N } = 4 )$ ). F: t-SNE clustering of the retinal neurons of the untied network (see text). Two distinct cell type clusters form corresponding to ON and OFF center-surround receptive fields.
|
| 54 |
+
|
| 55 |
+
3.2 EMERGENCE OF ON AND OFF POPULATIONS OF CENTER-SURROUND CELLS IN THERETINA
|
| 56 |
+
|
| 57 |
+
We then verified that the emergence of center-surround RFs in the retina-net is a consequence of reducing the number of neurons at the retinal output, not of reducing the number of channels, our model’s equivalent of biological retinal cell types. In the retina, there exist 20-30 types of ganglion cells (Roska & Meister, 2014), each with a different and stereotyped receptive field, density, polarity (i.e. ON or OFF), and nonlinearities. Cells of each type tile the entire visual field like a convolutional channel in our model, so there is a direct analogy between channels in our model and ganglion cell types in the retina. In order to test whether the emergence of center-surround RFs depends on the number of types that we allow, or just on the number of neurons that we allow at the output of the retina (i.e. dimensionality bottleneck), we employed locally connected layers – equivalent to convolutional layers, but without parameter-tying between artificial neurons within a channel at different spatial locations. In this manner, we can limit the number of neurons at the retinal output without imposing a constraint on the number of cell types. Such a network contains too many parameters to be trained from scratch by gradient descent; to work around this, we trained the model stage-wise by first training our convolutional control network $N _ { B N } = 3 2$ with parameter tying) and then we trained a three-layers untied network (with bottleneck dimension $N _ { B N } = 4$ in the second layer) to reproduce the edge-like activations of the second layer of the control network. Even in the untied retina-net, in which each neuron is effectively its own channel, we found that centersurround RFs emerged (fig. 2E), indicating that center-surround RFs are the network’s preferred strategy for passing information through a dimensionality bottleneck even when no constraint on the number of cell types is imposed. We then found that the cells cluster in two distinct populations. To demonstrate this, we measured their activations in response to 10000 natural images, computed the first 20 principal components of this 10000-dimensional space, and ran t-SNE to visualize the clustering of neuron types. We found that two distinct clusters emerged, that corresponded visually to ON and OFF center-surround RFs (fig. 2F). We thus observe in our model the emergence of one of the most prominent axes of dichotomy of biological ganglion cell types, namely the classification of cells in ON and OFF populations with RFs of opposite polarity.
|
| 58 |
+
|
| 59 |
+
# 4 RETINAL REPRESENTATIONS ARE A FUNCTION OF THE NEURAL RESOURCES ALLOCATED TO THE VENTRAL VISUAL STREAM
|
| 60 |
+
|
| 61 |
+
To what extent are retinal representations in our model shaped by the degree of neural resources allocated to downstream processing? To investigate this question, we studied the effects of varying the degree of neural resources in the VVS-net, on emergent visual representations in the retina-net.
|
| 62 |
+
|
| 63 |
+
# 4.1 THE RETINA BECOMES MORE LINEAR AS BRAIN COMPLEXITY INCREASES
|
| 64 |
+
|
| 65 |
+
As we increased the number of layers in the VVS-net, the retinal computation became more linear (fig. 3A), as measured by the ability of the raw image to linearly map onto the neural representation at the retinal output (see methods, and App. F for a visualization of retinal representation as VVS-net depth increases). This observation is consistent with the current state of knowledge of the differences found in retinal representations across vertebrate species with different brain sizes. The linearization of the retinal response with increased brain complexity was true for different values of bottleneck $N _ { B N }$ . However, when we did not use any bottleneck ( $N _ { B N } = 3 2$ ), the trend became non-monotonic, with a peak in linearity of the response when the VVS-net had 1 conv layer (data not shown). Another interesting phenomenon to note is that linearity of the retinal response decreased as we increased the number of channels in the bottleneck, at any fixed brain depth (fig. 3A).
|
| 66 |
+
|
| 67 |
+
The two main sources of nonlinearity in the retina are thought to be the inner retinal rectifications (bipolar and amacrine cells, corresponding to the first rectified layer in our model) and the ganglion cell rectification (corresponding to the second rectified layer in our model). As we decreased VVSnet depth, we observed that the retinal response became more nonlinear. Is this increase in response nonlinearity due to the first or second stage of nonlinearity in our retina-net? To test this, we plotted the real response against the response predicted by a purely linear model for the most shallow and for the deepest VVS-nets tested (fig. 3B). If the linear prediction were inaccurate because of the first stage of nonlinear processing in the retina-net, we would expect the points on the scatter plot to be scattered around the unit line. If the prediction error were due to the second-stage of nonlinearity, we would expect the linear approximation to make incorrect negative predictions for inactive neurons. In practice, we found that the prediction error of the linear model was partly explained by both stages of nonlinearity in the retina-net model, predicting that both inner retinal nonlinear processing and ganglion cell rectifications should be more pronounced in animals with fewer neural resources in their visual cortices.
|
| 68 |
+
|
| 69 |
+
# 4.2 THE RETINAL REPRESENTATION IS THE RESULT OF A TRADE-OFF BETWEEN INFORMATION TRANSMISSION AND FEATURE EXTRACTION
|
| 70 |
+
|
| 71 |
+
Why would retinal representations be more linear when the subsequent ventral visual stream has more resources? One hypothesis is that with a restricted number of neurons, the retina must trade-off between the two incentives of (1) compressing visual information in order to transmit it to down-1 Channel 1 Channel stream layers and (2) extracting nonlinear features from the scene to start disentangling the manifolds4 ChannelsRaw Pixels 4 ChannelsRaw Pixels corresponding to different classes of objects (Chung et al., 2018a;b). According to this hypothesis,VVS-net depth VVS-net depth VVS-net depth when the VVS is shallow, the priority of the retina should be to work toward extracting relevantB CE F D E features. When the VVS is deep, the priority of the retina should be to transmit as much visual information as possible for downstream processing. We validated this hypothesis in two ways in our1 Channel model.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3: Emergent retinal representations are function of the depth of downstream visual cortices. All error bars represent the $9 5 \%$ confidence interval about the mean (all simulations were repeated over 10 networks trained from random initial conditions). Three stars indicate t-test significance $\scriptstyle ( \mathbf { p } < 0 . 0 0 1$ ). A: Linearity of the retinal response increases with the number of layers in the VVSnet. Note that it also decreases with the number of cells at the retinal output (different lines). B: Responses of example retina-net output cell to natural images, vs. best linear fit prediction from 1 Channel \*\*\*raw image, for most (top) and least (bottom) deep VVS-nets. Nonlinearity arises from two sources: 2 Channels Raw Pixelsrectification within the retina-net (corresponds to the spread of the bulk of the point cloud) and rectification at the retina-net output (corresponds to inactive neurons being incorrectly predicted to have negative activations). C: Quality of image reconstruction from the retinal representation as a function of VVS-net depth. The retinal representation retains more information about the raw image for deep VVS-nets. D: Linear separability of classes of objects at the retinal output, as a function of VVS-net depth. Dashed line indicates separability of classes of images from the raw image pixels. Classes are less separable at the retinal output for deeper VVS-nets. E: Performance on CIFAR-10 for a two-layer densely connected network taking its input from the retina-net or from a raw image. Class information is more accessible from retinal representation. F: Class separability at all layers of network for a deep VVS-net $D _ { V V S } = 4 $ ) with and without bottleneck $\boldsymbol { N } _ { B N } = 1$ and $N _ { B N } = 3 2$ ). Retinal representation of bottleneck network has low separability. However, the first layer of the VVS-net has high separability (see text).
|
| 75 |
+
|
| 76 |
+
First we showed that the retinal representation retained more information about the image as VVSnet complexity increased (fig. 3C). To estimate information retention, we trained a linear decoder (see methods) from the output of the retina to reconstruct the image and we measured the reconstruction error. The reconstruction error provided a lower bound on the information that the retina retained about the stimulus (note that more information for reconstruction might be accessible by a nonlinear decoder). This result corroborated our hypothesis that, as the VVS-net becomes more complex, the retinal representation gets better at retaining visual information for further processing by the VVS-net.
|
| 77 |
+
|
| 78 |
+
Second, we found that different classes of objects of CIFAR-10 (e.g. trucks, frogs) were more linearly separable from the retina-net representation when the VVS-net was shallow than when it was deep (fig. 3D). To measure linear separability of manifolds, we trained a linear SVM decoder to separate all pairs of classes and evaluated the performance of the SVM classifier on held-out images (see methods). Moreover, we showed that a VVS-net consisting of two fully connected layers only (no convolutional layers) equipped and trained end-to-end with a retina with a tight bottleneck $N _ { B N } = 1$ (dimensionality of retinal output matches dimensionality of the input image) performed better at image recognition than the same VVS-net trained without a retina-net, taking raw images as input (fig. 3E). Both these results corroborate our hypothesis that retinas followed by a simple cortex performs meaningful feature extraction, whereas retinas followed by more complex visual cortices prioritize non-lossy encoding, postponing feature extraction to downstream layers that are better equipped to do it.
|
| 79 |
+
|
| 80 |
+
Next, we show that within a single network, each retinal channel is trading-off between (1) linearly transmitting visual information to the brain, and (2) extracting relevant features for the object classification task. For 10 instantiations of a network with a retinal bottleneck containing 4 channels, we represented the linearity of each of these 4 channels against the linear separability of object categories obtained from each of these representations. We found, across all networks, a systematic negative correlation between linearity and linear separability across all 4 channels (App. D). Again, this result strongly suggests that extracting features and transmitting visual information are indeed two competing goals shaping representations in our model of the retina.
|
| 81 |
+
|
| 82 |
+
In the case of the deepest VVS-nets tested, the retinal processing was quasi-linear for the tightest bottleneck (var.expl. $= 0 . 9$ , $N _ { B N } = 1$ , fig. 3A). One might take this result to suggest that the retinanet in such models does little more than copy image information. However the very first layer of the VVS-net after the retina disentangled classes (as measured by linear separability) almost as well as the second layer of a VVS-net without a retina (fig. 3F), suggesting that the retinal representation, while only moderately linearly separable itself, is especially transformable into a representation with a high linear separability. This result suggests that even when the retina-net is quasi-linear, it can still participate in extracting relevant features for downstream processing by the brain. The increased separability allowed by the retinal pre-processing for this deep VVS-net could be due to (1) the linear processing or (2) the slightly nonlinear part of the retinal processing (3) a combination of both linear and nonlinear processing. To distinguish between these hypotheses, we replaced the true retinal processing by its best linear approximation, retrained the VVS-net on the output of this linearized retina, and tested whether separability was as high as with the true retinal processing (App. E). We found that the first layer trained on the output of the linearized retinal representation was indeed much more separable than the first layer of the control network (trained directly on natural images) at separating classes of objects, suggesting that the linear operation done by the retina does indeed play a crucial role in making the representation especially separable for subsequent layers.
|
| 83 |
+
|
| 84 |
+
# 5 METHODS
|
| 85 |
+
|
| 86 |
+
To estimate the linearity of the response of retinal neurons, we fit a linear model to predict the neural response from the image on 8,000 images. In order to prevent overfitting, we regularized the linear weights with an L2 penalty and optimized the weights using ridge regression. The value of the penalty term was chosen by 10-fold cross-validation on the training set. We then measured the Pearson correlation between the linearized responses and original model responses on a testing set of 2,000 images.
|
| 87 |
+
|
| 88 |
+
To estimate the information about the input image retained by the retinal output representation, we fit a linear model to reconstruct the image from the (fixed) outputs of the trained retina-net of interest. All numerical figures given are variance-explained results on the held-out test set.
|
| 89 |
+
|
| 90 |
+
To estimate the linear separability of classes of objects from the neural representation, we trained an SVM classifier between all pairs of classes on half of the testing set of CIFAR-10 (1,000 images that were not used to train the network), and we tested the performance of the SVM classifier on 1,000 held-out images from the testing set, as measured by the percentage of images classified correctly. We then averaged the performance of the SVM across all pairs of classes to obtain the linear separability score.
|
| 91 |
+
|
| 92 |
+
# 6 DISCUSSION
|
| 93 |
+
|
| 94 |
+
A unified theoretical account for the structural differences between the receptive field shapes of retinal neurons and V1 neurons has until now been beyond the reach of efficient coding theories. Karklin & Simoncelli (2011) found that efficient encoding of images with added noise and a cost on firing rate produce center-surround RFs, whereas the same task without noise produces edge detectors. However, this observation (as they note) does not explain the discrepancy between retinal and cortical representations. Vincent et al. (2005) propose a different set of constraints for the retina and V1, in which the retina optimizes for a metabolic constraint on total number of synapses, whereas V1 optimizes for a constraint on total firing rate. It is not clear why each of these constraints would predominate in each respective system. Here we show that these two representations can emerge from the requirement to perform a biologically relevant task (extracting object identity from an image) with a bottleneck constraint on the dimensionality of the retinal output. Interestingly, this constraint differs from the ones used previously to account for center-surround RFs (number of synapses or total firing rate). It is worth noting that we unsuccessfully tried to reproduce the result of Karklin & Simoncelli (2011) in our network, by adding noise to the image and applying an L1 regularization to the retina-net activations. In our framework (different than the one of Karklin & Simoncelli (2011) in many ways), the receptive fields of the retina-net without bottleneck remained oriented across the full range of orders of magnitude of noise and L1 regularization that permitted successful task performance.
|
| 95 |
+
|
| 96 |
+
There is a long-standing debate on whether the role of the retina is to extract relevant features from the environment (Lettvin et al., 1959; Gollisch & Meister, 2010; Roska & Meister, 2014), or to efficiently encode all visual information indistinctly (Barlow, 1961; Atick & Redlich, 1990; 1992). In this work, we show that our model of the visual system, trained on the same task and with the same input statistics, can exhibit different retinal representations depending on the degree of neural resources allocated to downstream processing by the ventral visual stream. These results suggest the hypothesis that, despite its conserved structure across evolution, the retina could prioritize different computations in different species. In species with fewer brain resources devoted to visual processing, the retina should nonlinearly extract relevant features from the environment for object recognition, and in species with a more complex ventral visual stream, the retina should prioritize a linear and efficient transmission of visual information for further processing by the brain. Although all species contain a mix of quasi-linear and nonlinear cell types, the proportion of quasi-linear cells seems to vary across species. In the mouse, the most numerous cell type is a two-stage nonlinear feature detector, thought to detect overhead predators (Zhang et al., 2012). In contrast, the most common ganglion cell type in the primate retina is fairly well approximated by a linear filter (midget cells, $50 \%$ of all cells and ${ > } 9 5 \%$ in the central retina (Roska & Meister, 2014; Dacey, 2004)). Note however that two-stage nonlinear models are also present in larger species, such as cat Y-type cells and primate parasol cells (Crook et al., 2008), making it difficult to make definitive statements about inter-species differences in retinal coding. To gain a better understanding of these differences, it would be useful to collect a dataset consisting of recordings of complete populations of ganglion cells of different species in response to a common bank of natural scenes.
|
| 97 |
+
|
| 98 |
+
A related question is the role of the parcellation of visual information in many ganglion cell types at the retinal output. A recent theory of efficient coding has shown that properties of midget and parasol cells in the primate retina can emerge from the objective of faithfully encoding natural movies with a cost on the total firing rate traversing the optic nerve (Ocko et al., 2018). On the other hand, many cell types seem exquisitely sensitive to behaviorally relevant features, such as potential prey or predators (Gollisch & Meister, 2010). For example, some cell types in the frog are tuned to detect moving flies or looming predators (Lettvin et al., 1959). It is an intriguing possibility that different cell types could subserve different functions within a single species, namely efficient coding of natural scenes for some types and extraction of behaviorally-relevant features for others. In this study we allowed only a limited number of cell types (i.e. convolutional channels) at the retinal output (1 to 4), in order to have a dimensionality expansion between the retinal representation and the representation in the ventral visual stream (32 channels), an important condition to see the retinal center-surround representation emerge. By using larger networks with more channels in the retina-net and the VVS-net, we could study the emergence of a greater diversity of neuron types in our retina-net and compare their properties to real retinal cell types. It would also be interesting to extend our model to natural movies. Indeed, most feature detectors identified to date seem to process some form of image motion: wide-field, local or differential (Roska & Meister, 2014). Adding a temporal dimension to the model would be necessary to study their emergence.
|
| 99 |
+
|
| 100 |
+
In conclusion, by studying emergent representations learned by a deep network trained on a biologically relevant task, we found that striking differences in retinal and cortical representations of visual information could be a consequence of the anatomical constraint of transmitting visual information through a low-dimensional communication channel, the optic nerve. Moreover, our computational explorations suggest that the rich diversity of retinal representations found across species could have adaptively co-evolved with the varying sophistication of subsequent processing performed by the ventral visual stream. These insights illustrate how deep neural networks, whose creation was once inspired by the visual system, can now be used to shed light on the constraints and objectives that have driven the evolution of our visual system.
|
| 101 |
+
|
| 102 |
+
# ACKNOWLEDGMENTS
|
| 103 |
+
|
| 104 |
+
We would like to thank Lane McIntosh, Niru Maheswaranathan, Aran Nayebi, SueYeon Chung, Vardan Papyan, Nora Brackbill, E.J. Chichilnisky for useful discussions and Stephen Baccus for his comments that greatly improved the manuscript. S.G. thanks the Burroughs-Wellcome, McKnight, James S. McDonnell and Simons foundations for support.
|
| 105 |
+
|
| 106 |
+
# REFERENCES
|
| 107 |
+
|
| 108 |
+
Joseph J. Atick and A. Norman Redlich. Towards a theory of early visual processing. Neural Computation, 2(3):308–320, 1990.
|
| 109 |
+
Joseph J. Atick and A. Norman Redlich. What does the retina know about natural scenes? Neural computation, 4(2):196–210, 1992.
|
| 110 |
+
HB Barlow. Possible principles underlying the transformations of sensory messages. In WA Rosenblith (ed.), Sensory Communication, pp. 217–234. MIT Press, 1961.
|
| 111 |
+
A. J. Bell and T. J. Sejnowski. The ”independent components” of natural scenes are edge filters. Vision Research, 37(23):3327–3338, December 1997. ISSN 0042-6989.
|
| 112 |
+
Santiago A. Cadena, George H. Denfield, Edgar Y. Walker, Leon A. Gatys, Andreas S. Tolias, Matthias Bethge, and Alexander S. Ecker. Deep convolutional models improve predictions of macaque V1 responses to natural images. bioRxiv, pp. 201764, October 2017. doi: 10.1101/ 201764.
|
| 113 |
+
Matthew Chalk, Olivier Marre, and Gasper Tkacik. Relevant sparse codes with variational information bottleneck. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 1957–1965. Curran Associates, Inc., 2016.
|
| 114 |
+
Matthew Chalk, Olivier Marre, and Gaper Tkaik. Toward a unified theory of efficient, predictive, and sparse coding. Proceedings of the National Academy of Sciences of the United States of America, 115(1):186–191, 2018. ISSN 1091-6490. doi: 10.1073/pnas.1711114115.
|
| 115 |
+
E. J. Chichilnisky. A simple white noise analysis of neuronal light responses. Network (Bristol, England), 12(2):199–213, May 2001. ISSN 0954-898X.
|
| 116 |
+
|
| 117 |
+
SueYeon Chung, Uri Cohen, Haim Sompolinsky, and Daniel D. Lee. Learning Data Manifolds with a Cutting Plane Method. Neural Computation, 30(10):2593–2615, October 2018a. ISSN 0899-7667, 1530-888X. doi: 10.1162/neco a 01119.
|
| 118 |
+
|
| 119 |
+
SueYeon Chung, Daniel D. Lee, and Haim Sompolinsky. Classification and Geometry of General Perceptual Manifolds. Physical Review X, 8(3), July 2018b. ISSN 2160-3308. doi: 10.1103/ PhysRevX.8.031003.
|
| 120 |
+
|
| 121 |
+
Joanna D. Crook, Beth B. Peterson, Orin S. Packer, Farrel R. Robinson, John B. Troy, and Dennis M. Dacey. Y-cell receptive field and collicular projection of parasol ganglion cells in macaque monkey retina. The Journal of Neuroscience: The Official Journal of the Society for Neuroscience, 28 (44):11277–11291, October 2008. ISSN 1529-2401. doi: 10.1523/JNEUROSCI.2982-08.2008.
|
| 122 |
+
|
| 123 |
+
Dennis Dacey. Origins of perception: retinal ganglion cell diversity and the creation of parallel visual pathways. In The cognitive neuroscience (2004), pp. 281–301, 2004.
|
| 124 |
+
|
| 125 |
+
Stephane Deny, Ulisse Ferrari, Emilie Mace, Pierre Yger, Romain Caplette, Serge Picaud, Gaper Tkaik, and Olivier Marre. Multiplexed computations in retinal ganglion cells of a single type. Nature communications, 8(1):1964, 2017.
|
| 126 |
+
|
| 127 |
+
Eizaburo Doi, Jeffrey L. Gauthier, Greg D. Field, Jonathon Shlens, Alexander Sher, Martin Greschner, Timothy A. Machado, Lauren H. Jepson, Keith Mathieson, Deborah E. Gunning, Alan M. Litke, Liam Paninski, E. J. Chichilnisky, and Eero P. Simoncelli. Efficient coding of spatial information in the primate retina. The Journal of Neuroscience, 32(46):16256–16264, November 2012.
|
| 128 |
+
|
| 129 |
+
Sven Eberhardt, Jonah G Cader, and Thomas Serre. How Deep is the Feature Analysis underlying Rapid Visual Categorization? pp. 9, 2016.
|
| 130 |
+
|
| 131 |
+
Wilson S. Geisler and Duane G. Albrecht. Cortical neurons: isolation of contrast gain control. Vision research, 32(8):1409–1410, 1992.
|
| 132 |
+
|
| 133 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249–256, 2010.
|
| 134 |
+
|
| 135 |
+
Tim Gollisch and Markus Meister. Eye smarter than scientists believed: neural computations in circuits of the retina. Neuron, 65(2):150–164, January 2010. ISSN 1097-4199. doi: 10.1016/j. neuron.2009.12.009.
|
| 136 |
+
|
| 137 |
+
D. J. Heeger. Normalization of cell responses in cat striate cortex. Visual Neuroscience, 9(2):181– 197, August 1992. ISSN 0952-5238.
|
| 138 |
+
|
| 139 |
+
David H. Hubel. Eye, brain, and vision. Scientific American Library/Scientific American Books, 1995.
|
| 140 |
+
|
| 141 |
+
Keith P. Johnson, Lei Zhao, and Daniel Kerschensteiner. A Pixel-Encoder Retinal Ganglion Cell with Spatially Offset Excitatory and Inhibitory Receptive Fields. Cell Reports, 22(6):1462–1472, February 2018. ISSN 22111247. doi: 10.1016/j.celrep.2018.01.037.
|
| 142 |
+
|
| 143 |
+
Yan Karklin and Eero P. Simoncelli. Efficient coding of natural images with a population of noisy Linear-Nonlinear neurons. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 24, pp. 999–1007. Curran Associates, Inc., 2011.
|
| 144 |
+
|
| 145 |
+
Melinda E. Koelling and Duane Q. Nykamp. Computing linear approximations to nonlinear neuronal response. Network (Bristol, England), 19(4):286–313, 2008. ISSN 1361-6536. doi: 10.1080/09548980802503139.
|
| 146 |
+
|
| 147 |
+
Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images. pp. 60, 2009.
|
| 148 |
+
|
| 149 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, May 2015. ISSN 1476-4687. doi: 10.1038/nature14539.
|
| 150 |
+
|
| 151 |
+
J. Y. Lettvin, H. R. Maturana, W. S. McCulloch, and W. H. Pitts. What the Frog’s Eye Tells the Frog’s Brain. Proceedings of the IRE, 47(11):1940–1951, November 1959. ISSN 0096-8390. doi: 10.1109/JRPROC.1959.287207.
|
| 152 |
+
|
| 153 |
+
Niru Maheswaranathan, David B. Kastner, Stephen A. Baccus, and Surya Ganguli. Inferring hidden structure in multilayered neural circuits. PLoS computational biology, 14(8):e1006291, August 2018. ISSN 1553-7358. doi: 10.1371/journal.pcbi.1006291.
|
| 154 |
+
|
| 155 |
+
Richard H. Masland. The fundamental plan of the retina. Nature Neuroscience, 4(9):877–886, September 2001. ISSN 1546-1726. doi: 10.1038/nn0901-877.
|
| 156 |
+
|
| 157 |
+
Lane McIntosh, Niru Maheswaranathan, Aran Nayebi, Surya Ganguli, and Stephen Baccus. Deep Learning Models of the Retinal Response to Natural Scenes. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 1369–1377. Curran Associates, Inc., 2016.
|
| 158 |
+
|
| 159 |
+
Samuel A. Ocko, Jack Lindsey, Surya Ganguli, and Stephane Deny. The emergence of multiple retinal cell types through efficient coding of natural movies. bioRxiv, pp. 458737, October 2018. doi: 10.1101/458737. URL https://www.biorxiv.org/content/early/2018/10/ 31/458737.
|
| 160 |
+
|
| 161 |
+
B. A. Olshausen and D. J. Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381(6583):607–609, June 1996. ISSN 0028-0836. doi: 10.1038/381607a0.
|
| 162 |
+
|
| 163 |
+
B. A. Olshausen and D. J. Field. Sparse coding with an overcomplete basis set: a strategy employed by V1? Vision Research, 37(23):3311–3325, December 1997. ISSN 0042-6989.
|
| 164 |
+
|
| 165 |
+
Botond Roska and Markus Meister. The Retina Dissects the Visual Scene into Distinct Features. In The New Visual Neurosciences (Werner, JS, Chalupa, LM, eds), pp 163182., pp. 20. Cambridge, MA: MIT Press, 2014.
|
| 166 |
+
|
| 167 |
+
Odelia Schwartz, Jonathan W. Pillow, Nicole C. Rust, and Eero P. Simoncelli. Spike-triggered neural characterization. Journal of Vision, 6(4):13, July 2006. ISSN 1534-7362. doi: 10.1167/6.4.13.
|
| 168 |
+
|
| 169 |
+
Yosef Singer, Yayoi Teramoto, Ben DB Willmore, Jan WH Schnupp, Andrew J. King, and Nicol S. Harper. Sensory cortex is optimized for prediction of future input, June 2018.
|
| 170 |
+
|
| 171 |
+
Benjamin T. Vincent and Roland J. Baddeley. Synaptic energy efficiency in retinal processing. Vision Research, 43(11):1283–1290, May 2003. ISSN 0042-6989.
|
| 172 |
+
|
| 173 |
+
Benjamin T. Vincent, Roland J. Baddeley, Tom Troscianko, and Iain D. Gilchrist. Is the early visual system optimised to be energy efficient? Network: Computation in Neural Systems, 16(2-3): 175–190, January 2005. ISSN 0954-898X. doi: 10.1080/09548980500290047.
|
| 174 |
+
|
| 175 |
+
Daniel L. K. Yamins, Ha Hong, Charles F. Cadieu, Ethan A. Solomon, Darren Seibert, and James J. DiCarlo. Performance-optimized hierarchical models predict neural responses in higher visual cortex. Proceedings of the National Academy of Sciences of the United States of America, 111 (23):8619–8624, June 2014. ISSN 1091-6490. doi: 10.1073/pnas.1403112111.
|
| 176 |
+
|
| 177 |
+
Yifeng Zhang, In-Jung Kim, Joshua R. Sanes, and Markus Meister. The most numerous ganglion cell type of the mouse retina is a selective feature detector. Proceedings of the National Academy of Sciences, pp. 201211547, August 2012. ISSN 0027-8424, 1091-6490. doi: 10.1073/pnas. 1211547109.
|
| 178 |
+
|
| 179 |
+
APPENDIX
|
| 180 |
+
|
| 181 |
+
# A QUANTIFICATION OF RECEPTIVE FIELD ISOTROPY IN RETINA AND V1
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 4: A: Left: Schematic re-illustrating the architecture of a vanilla (no bottleneck) network and showing examples oriented RFs in its second layer. Center: Visualization of average RF isotropy for cells in the second layer of a vanilla convolutional network $( N _ { B N } = 1$ , $D _ { V V S } = 2$ ). Orange error bars indicate $9 5 \%$ confidence intervals. Right: Visualization of RF isotropy for ten example RFs from the same network architecture. B: Left: Schematic re-illustrating the architecture of the retina-net $+ \mathrm { \Delta V V S }$ -net model $( N _ { B N } = 1 , D _ { V V S } = 2 )$ and showing example center-surround RFs at the retina-net output and oriented RFs in the following layer (V1). Center and right: Same RF isotropy visualizations as in part A. C: Left: re-illustration of V1 RFs pooling in oriented fashion from center-surround retinal RFs $( N _ { B N } = 1 , D _ { V V S } = 2 )$ . Right: Same isotropy visualizations as in panel A carried on the weight matrix from retina to V1.
|
| 185 |
+
|
| 186 |
+
The following analysis corroborates our qualitative observation that a dimensionality bottleneck in the retina-net yields center-surround retinal receptive fields and oriented, edge-detecting receptive fields in the first layer of the VVS-net (V1). For a given receptive field, we quantified its orientedness as follows: we displayed rectangular bar stimuli of all possible combinations of width, orientations and spatial translations that fit in the input image window. Among all these combinations, we selected the bar stimulus width, orientation, and translation that yielded the strongest response from the RF. Bars with the same width as the best stimuli were presented at all orientations and translations, and for each orientation, we select the strongest response it produced (across all translations). In this manner we obtained a measure of the strength of a receptive field’s preference for all orientations.
|
| 187 |
+
|
| 188 |
+
We measured the strength of each RF preference (maximum strength of response) for its preferred orientation and for the orthogonal orientation, and computed the ratio of these strengths. Completely isotropic filters would be expected to give a ratio of 1, while oriented filters should give higher ratios. Note however that some deviation from 1 may indicate noise in the filter rather than true orientedness. For each network layer, we averaged this ratio across filters (for convolutional layers with multiple layers) and trials (re-training of the same neural network architecture with different random initializations). We found that the average ratios were $1 . 5 6 ( \pm 0 . 2 2 )$ for the retinal output, $3 . 0 5 ( \pm 0 . 3 0 ) $ for the first VVS-net layer, and $2 . 5 7 ( \pm 0 . 2 7 )$ for the second VVS-net layer, where error margins given are $9 5 \%$ confidence intervals. To help assess whether retinal RFs were more isotropic than expected by chance, we compared them to receptive fields composed of random Gaussian noise as a baseline. These give an average ratio (as computed above) of $\bar { 1 . 9 7 } ( \pm 0 . 0 8 )$ , significantly higher than that for retinal RFs. Furthermore, the standard deviation of RF preference across orientations was significantly lower for the retinal RFs $( 0 . 1 1 8 \pm 0 . 0 3 6 )$ than for random RFs $( 0 . 1 7 7 \pm 0 . 0 0 7 )$ , also indicating that retinal RFs were more isotropic than expected by chance.
|
| 189 |
+
|
| 190 |
+
We also plot the average RF preference for different orientations at each layer to more comprehensively assess the isotropy of RFs at each network layer. To aggregate results across multiple trials and filters, we rotated the coordinates of each receptive field such that its preferred orientation was vertical, and averaged our results across filters and trials. (See Figure 4).
|
| 191 |
+
|
| 192 |
+
The results confirm our qualitative observations that (1) RFs in the second layer of a vanilla network $( N _ { B N } = 3 2 )$ ) are highly oriented (Figure 4A) (2) RFs in the second layer (retina output) of a bottleneck network $N _ { B N } = 1 \textgreater$ ) are much more isotropic, consistent with center-surround RFs (Figure 4B top), and (3) RFs in the layer immediately following the retina-net in the bottleneck network are oriented (Figure 4B bottom).
|
| 193 |
+
|
| 194 |
+
We also quantitatively corroborate our observation that oriented receptive fields in the V1 layer pool input from oriented arrays of center-surround filters in the retina-net output layer. We apply our method of isotropy quantification described above to the weight matrix for each input-output filter combination in the V1 convolutional layer. We find that this weight matrix itself exhibits orientedness across filters and trials, confirming our observation (Figure 4C).
|
| 195 |
+
|
| 196 |
+
# B SIMPLE AND COMPLEX CELLS
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 5: A: Visualizations of retina-net output RFs for an example network $( N _ { B N } = 1 , D _ { V V S } = 2 )$ using different random initialization, as described in the text. B: Same as A, for the first layer of the VVS-net, and showing 5 of the layer’s 32 channels on the x axis. C: Same as B, for the second layer of the VVS-net. In contrast to the first layer, the emergent preferred stimuli are always different across different initializations, indicative of a complex-cell like behavior.
|
| 200 |
+
|
| 201 |
+
To investigate whether neurons in our model’s early layers more closely resembled simple or complex cells, we performed the following analysis. As before, we obtained local linear approximations of receptive fields by computing the gradient in input space with respect to the response of a given neuron. Rather than beginning with a blank input, we ran multiple trials with different randomly initialized inputs. A purely linear cell would give the same result no matter the initialization; a somewhat nonlinear but still “simple” cell is expected to give similar results across initializations. A “complex” cell is expected to give different RF visualizations for different random inputs, reflecting multiple peaks in its response as a function of input. In Figure 5 we show examples of receptive fields at different layers of our retina-net $+ \mathrm { \Delta V V S }$ -net model (with $N _ { B N } = 1 , D _ { V V S } = 2 )$ for different random intializations of the image (uniform random in [0, 1]). The retina-net output and first VVS-net layer exhibit “simple” behavior, but the second VVS-net layer exhibits observably “complex” behavior. To quantify this effect, we measure the average (across filters within each layer and re-trainings of the same network architecture) standard deviation of computed RFs (normalized to the range [0, 1]) for each network layer. We found that the average standard deviations were $7 . 9 ( \pm 1 . 1 ) \times 1 0 ^ { - 3 }$ , $1 5 . 4 ( \pm 0 . 8 ) \times 1 0 ^ { - 3 }$ , and $3 5 . 9 ( \pm 0 . 8 ) \times 1 0 ^ { - 3 }$ for the retina-net output, first VVS-net layer, and second VVS-net layer, respectively, where the margins of error given are $9 5 \%$ confidence intervals. These results corroborate the observation of significantly more complex behavior in the second VVS-net layer, mirroring the biological phenomenon in which complex cells pool from simple cells in $\mathrm { V } 1$ .
|
| 202 |
+
|
| 203 |
+
# C EFFECTS OF LOCAL RESPONSE NORMALIZATION ON EARLY VISUAL malization FigurREPRESENTATIONS
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 6: Example RFs from the bottleneck network $( N _ { B N } = 1 , D _ { V V S } = 2$ without (A) and with (B) local response normalization (i.e. local gain control).
|
| 207 |
+
|
| 208 |
+
We tested the robustness of our first main finding – that a bottlenecked retina-net $+ \mathrm { \nabla { V V S } }$ -net model yields center-surround receptive fields in the retina and oriented receptive felds in $\mathrm { { V } 1 - }$ to the use of biologically realistic local response normalization at every layer of the network. In particular, we normalized the output $x$ of each channel (row $r$ , column $c$ ) of each layer as follows (during training and testing):
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
x _ { r , c } \gets \frac { x _ { r , c } } { \Big ( k + \alpha \sum _ { r ^ { \prime } \in [ r - \frac { n } { 2 } , r + \frac { n } { 2 } ] , c ^ { \prime } \in [ c - \frac { n } { 2 } , c + \frac { n } { 2 } ] } x _ { r ^ { \prime } , c ^ { \prime } } \Big ) ^ { \beta } }
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
where the subscripts of $x$ indicate the spatial location (row/column), and $k , \alpha _ { \mathrm { { ; } } }$ , ad $\beta$ are constants. We used $k = 2$ , $\beta = 0 . 5$ and $\beta = 0 . 7 5$ , and $\alpha = 5 \times 1 0 ^ { - 4 }$ and $\alpha = 5 . 0$ . All parameter settings tested yielded RFs with the same qualitative properties as in the model without normalization. Figure 6 shows example RFs from the no-normalzation model next to example RFs from the normalization model with $k = 2 , \beta = 0 . 5 , \alpha = 5 . 0$ .
|
| 215 |
+
|
| 216 |
+
# D RETINAL CELL TYPES TRADE OFF BETWEEN LINEAR INFORMATION TRANSMISSION AND NONLINEAR FEATURE EXTRACTION
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
Fig XX Linearity vs. separability of retina-net output channels (as in XX), Figure 7: Linearity vs. Class separability for each retina-net output channels (i.e. bottleneck layer). network has a VVS-Net depth of 4 and a bottleneck size of 4. VVS-Net depth is equal to 4. Each network has a bottleneck size of 4 channels (i.e. $N _ { B N } { = } 4 )$ . DisDistributions are plotted across 8 network instances; each point represents a single channel, colored according to its network. Here, we tributions are plotted across 10 network instances; each point represents a single channel, colored can see that the tradeoff between efficient coding and feature extraction also happens within the retina-nets of individual networks.according to its network. The negative slope suggests that there is trade-off between linearly transmitting visual information for downstream processing (i.e. efficient coding) and extracting useful features for the object recognition task.
|
| 220 |
+
|
| 221 |
+
# E LINEARIZED RETINA ALSO INCREASES SEPARABILITY IN SUBSEQUENT LAYERS
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
representation of bottleneck network has low separability. However, the Figure 8: Class separability at all layers of network for a deep VVS-net $( D _ { V V S } = 4 )$ ) with and without bottleneck $\boldsymbol { N } _ { B N } = 1$ t layer oarability and $N _ { B N } = 3 2$ h separability. We additionally plot the leneck (NBN = 1) network (see test) as a ). Retinal representation of bottleneck network has low function of layer. That the jump in linear separability between layers 2,3 survives linearization suggests that the main effect of retinal processing separability. However, the first layer of the VVS-net has high separability. We additionally plot the in this network is whseparability of the linearized bottleneck $N _ { B N } = 1$ on-linear processing.) network (see test) as a function of layer. That the jump in linear separability between layers 2,3 survives linearization suggests that the main effect of retinal processing in this network is whitening (see Fig. 9) rather than nonlinear processing.
|
| 225 |
+
|
| 226 |
+
In the case of the deepest VVS-nets tested, the retinal processing was quasi-linear for the tightest bottleneck (var.expl. $= 0 . 9$ , $N _ { B N } = 1$ , fig. 3A). However the very first layer of the VVS-net after the retina disentangled classes (as measured by linear separability) almost as well as the second layer of a VVS-net without retina (fig. 3F), suggesting that the retinal representation, while only moderately linearly separable itself, is especially transformable into a representation with a high linear separability. To determine to what degree this increased separability was due to (1) the linear processing or (2) the slightly nonlinear part of the retinal processing, we performed an ablation experiment to eliminate factor (2). We first replaced the true retinal processing by its best approximation by a onelayer linear convolution (of sufficient filter width to correspond to two convolutional layers with 9 by 9 filters). After this linearization process, we retrained the VVS-net using the linearized retinal representation as input, keeping the linearized retina weights frozen. We found that the first layer trained on the output of the linearized retinal representation was indeed much better than the first layer of the control network (trained directly on natural images) at separating classes of objects (Fig.
|
| 227 |
+
|
| 228 |
+
8), suggesting that the linear operation done by the retina does indeed play a crucial role in making the representation especially separable for subsequent layers. Visualization of retinal processing in App. F suggest that whitening is an important part of this linear processing.
|
| 229 |
+
|
| 230 |
+
# F RETINAL REPRESENTATION VISUALIZATION AS A FUNCTION OF VVS-NET DEPTH FOR BOTTLENECK $N _ { B N } = 1$
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
examples (x axis) as a function of VVS-Net depth (y axis)Figure 9: Visualization of the output of the retina-net (one-channel-bottleneck, i.e. $N _ { B N } = 1$ ) for different images from the testing set (x-axis) as a function of VVS-net depth (y-axis). Each pixel intensity of the retinal image is proportional to the activation of the corresponding neuron of the retina, where light shades indicate high activities and dark shades low activities. While retinas for every VVS-net depth appear to whiten the input, we can see that the retinal image is more and more processed and less and less recognizable as VVS-net depth decreases.
|
md/train/SJcKhk-Ab/SJcKhk-Ab.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAN RECURRENT NEURAL NETWORKS WARP TIME?
|
| 2 |
+
|
| 3 |
+
# Corentin Tallec
|
| 4 |
+
|
| 5 |
+
# Yann Ollivier
|
| 6 |
+
|
| 7 |
+
Laboratoire de Recherche en Informatique Université Paris Sud Gif-sur-Yvette, 91190, France corentin.tallec@u-psud.fr
|
| 8 |
+
|
| 9 |
+
Facebook Articial Intelligence Research
|
| 10 |
+
Paris, France
|
| 11 |
+
yol@fb.com
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Successful recurrent models such as long short-term memories (LSTMs) and gated recurrent units (GRUs) use ad hoc gating mechanisms. Empirically these models have been found to improve the learning of medium to long term temporal dependencies and to help with vanishing gradient issues.
|
| 16 |
+
|
| 17 |
+
We prove that learnable gates in a recurrent model formally provide quasiinvariance to general time transformations in the input data. We recover part of the LSTM architecture from a simple axiomatic approach.
|
| 18 |
+
|
| 19 |
+
This result leads to a new way of initializing gate biases in LSTMs and GRUs. Experimentally, this new chrono initialization is shown to greatly improve learning of long term dependencies, with minimal implementation effort.
|
| 20 |
+
|
| 21 |
+
Recurrent neural networks (e.g. (Jaeger, 2002)) are a standard machine learning tool to model and represent temporal data; mathematically they amount to learning the parameters of a parameterized dynamical system so that its behavior optimizes some criterion, such as the prediction of the next data in a sequence.
|
| 22 |
+
|
| 23 |
+
Handling long term dependencies in temporal data has been a classical issue in the learning of recurrent networks. Indeed, stability of a dynamical system comes at the price of exponential decay of the gradient signals used for learning, a dilemma known as the vanishing gradient problem (Pascanu et al., 2012; Hochreiter, 1991; Bengio et al., 1994). This has led to the introduction of recurrent models specifically engineered to help with such phenomena.
|
| 24 |
+
|
| 25 |
+
Use of feedback connections (Hochreiter & Schmidhuber, 1997) and control of feedback weights through gating mechanisms (Gers et al., 1999) partly alleviate the vanishing gradient problem. The resulting architectures, namely long short-term memories (LSTMs (Hochreiter & Schmidhuber, 1997; Gers et al., 1999)) and gated recurrent units (GRUs (Chung et al., 2014)) have become a standard for treating sequential data.
|
| 26 |
+
|
| 27 |
+
Using orthogonal weight matrices is another proposed solution to the vanishing gradient problem, thoroughly studied in (Saxe et al., 2013; Le et al., 2015; Arjovsky et al., 2016; Wisdom et al., 2016; Henaff et al., 2016). This comes with either computational overhead, or limitation in representational power. Furthermore, restricting the weight matrices to the set of orthogonal matrices makes forgetting of useless information difficult.
|
| 28 |
+
|
| 29 |
+
The contribution of this paper is threefold:
|
| 30 |
+
|
| 31 |
+
∙ We show that postulating invariance to time transformations in the data (taking invariance to time warping as an axiom) necessarily leads to a gate-like mechanism in recurrent models (Section 1). This provides a clean derivation of part of the popular LSTM and GRU architectures from first principles. In this framework, gate values appear as time contraction or time dilation coefficients, similar in spirit to the notion of time constant introduced in (Mozer, 1992). ∙ From these insights, we provide precise prescriptions on how to initialize gate biases (Section 2) depending on the range of time dependencies to be captured. It has previously been advocated that setting the bias of the forget gate of LSTMs to 1 or 2 provides overall good performance (Gers & Schmidhuber, 2000; Jozefowicz et al., 2015). The viewpoint here explains why this is reasonable in most cases, when facing medium term dependencies, but fails when facing long to very long term dependencies.
|
| 32 |
+
|
| 33 |
+
∙ We test the empirical benefits of the new initialization on both synthetic and real world data (Section 3). We observe substantial improvement with long-term dependencies, and slight gains or no change when short-term dependencies dominate.
|
| 34 |
+
|
| 35 |
+
# 1 FROM TIME WARPING INVARIANCE TO GATING
|
| 36 |
+
|
| 37 |
+
When tackling sequential learning problems, being resilient to a change in time scale is crucial. Lack of resilience to time rescaling implies that we can make a problem arbitrarily difficult simply by changing the unit of measurement of time. Ordinary recurrent neural networks are highly nonresilient to time rescaling: a task can be rendered impossible for an ordinary recurrent neural network to learn, simply by inserting a fixed, small number of zeros or whitespaces between all elements of the input sequence. An explanation is that, with a given number of recurrent units, the class of functions representable by an ordinary recurrent network is not invariant to time rescaling.
|
| 38 |
+
|
| 39 |
+
Ideally, one would like a recurrent model to be able to learn from time-warped input data $x ( c ( t ) )$ as easily as it learns from data $x ( t )$ , at least if the time warping $c ( t )$ is not overly complex. The change of time $c$ may represent not only time rescalings, but, for instance, accelerations or decelerations of the phenomena in the input data.
|
| 40 |
+
|
| 41 |
+
We call a class of models invariant to time warping, if for any model in the class with input data $x ( t )$ , and for any time warping $c ( t )$ , there is another (or the same) model in the class that behaves on data $x ( c ( t ) )$ in the same way the original model behaves on $x ( t )$ . (In practice, this will only be possible if the warping $c$ is not too complex.) We will show that this is deeply linked to having gating mechanisms in the model.
|
| 42 |
+
|
| 43 |
+
# Invariance to time rescaling
|
| 44 |
+
|
| 45 |
+
Let us first discuss the simpler case of a linear time rescaling. Formally, this is a linear transformation of time, that is
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r c c c c } { c } & { : } & { \mathbb { R } _ { + } } & { \longrightarrow } & { \mathbb { R } _ { + } } \\ & & { \ t } & { \longmapsto } & { \alpha t } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
with $\alpha > 0$ . For instance, receiving a new input character every 10 time steps only, would correspond to $\alpha = 0 . 1$ .
|
| 52 |
+
|
| 53 |
+
Studying time transformations is easier in the continuous-time setting. The discrete time equation of a basic recurrent network with hidden state $h _ { t }$ ,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
h _ { t + 1 } = \operatorname { t a n h } \left( W _ { x } x _ { t } + W _ { h } h _ { t } + b \right)
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
can be seen as a time-discretized version of the continuous-time equation1
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\frac { \mathrm { d } h ( t ) } { \mathrm { d } t } = \operatorname { t a n h } { \left( W _ { x } x ( t ) + W _ { h } h ( t ) + b \right) } - h ( t )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
namely, (2) is the Taylor expansion $\begin{array} { r } { h ( t + \delta t ) \approx h ( t ) + \delta t \frac { \mathrm { d } h ( t ) } { \mathrm { d } t } } \end{array}$ ?? dℎ(??)d?? with discretization step ???? = 1.
|
| 66 |
+
|
| 67 |
+
Now imagine that we want to describe time-rescaled data $x ( \alpha t )$ with a model from the same class. Substituting $t \gets c ( t ) = \alpha t$ , $x ( t ) \gets x ( \alpha t )$ and $h ( t ) \gets h ( \alpha t )$ and rewriting (3) in terms of the new variables, the time-rescaled model satisfies2
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\frac { \mathrm { d } h ( t ) } { \mathrm { d } t } = \alpha \operatorname { t a n h } { \left( W _ { x } x ( t ) + W _ { h } h ( t ) + b \right) } - \alpha h ( t ) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
However, when translated back to a discrete-time model, this no longer describes an ordinary RNN but a leaky RNN (Jaeger, 2002, $\ S 8 . 1 \AA$ ). Indeed, taking the Taylor expansion of $h ( t + \delta t )$ with $\delta t = 1$ in (4) yields the recurrent model
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
h _ { t + 1 } = \alpha \operatorname { t a n h } { \left( W _ { x } x _ { t } + W _ { h } h _ { t } + b \right) } + ( 1 - \alpha ) h _ { t }
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Thus, a straightforward way to ensure that a class of (continuous-time) models is able to represent input data $x ( \alpha t )$ in the same way that it can represent input data $x ( t )$ , is to take a leaky model in which $\alpha > 0$ is a learnable parameter, corresponding to the coefficient of the time rescaling. Namely, the class of ordinary recurrent networks is not invariant to time rescaling, while the class of leaky RNNs (5) is.
|
| 80 |
+
|
| 81 |
+
Learning $\alpha$ amounts to learning the global characteristic timescale of the problem at hand. More precisely, $1 / \alpha$ ought to be interpreted as the characteristic forgetting time of the neural network.3
|
| 82 |
+
|
| 83 |
+
# Invariance to time warpings
|
| 84 |
+
|
| 85 |
+
In all generality, we would like recurrent networks to be resilient not only to time rescaling, but to all sorts of time transformations of the inputs, such as variable accelerations or decelerations.
|
| 86 |
+
|
| 87 |
+
An eligible time transformation, or time warping, is any increasing differentiable function $c$ from $\mathbb { R } _ { + }$ to $\mathbb { R } _ { + }$ . This amounts to facing input data $x ( c ( t ) )$ instead of $x ( t )$ . Applying a time warping $t \gets c ( t )$ to the model and data in equation (3) and reasoning as above yields
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\frac { \mathrm { d } h ( t ) } { \mathrm { d } t } = \frac { \mathrm { d } c ( t ) } { \mathrm { d } t } \operatorname { t a n h } { \left( W _ { x } x ( t ) + W _ { h } h ( t ) + b \right) } - \frac { \mathrm { d } c ( t ) } { \mathrm { d } t } h ( t ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Ideally, one would like a model to be able to learn from input data $x ( c ( t ) )$ as easily as it learns from data $x ( t )$ , at least if the time warping $c ( t )$ is not overly complex.
|
| 94 |
+
|
| 95 |
+
To be invariant to time warpings, a class of (continuous-time) models has to be able to represent Equation (6) for any time warping $c ( t )$ . Moreover, the time warping is unknown a priori, so would have to be learned.
|
| 96 |
+
|
| 97 |
+
Ordinary recurrent networks do not constitute a model class that is invariant to time rescalings, as seen above. A fortiori, this model class is not invariant to time warpings either.
|
| 98 |
+
|
| 99 |
+
For time warping invariance, one has to introduce a learnable function $g$ that will represent the derivative4 of the time warping, d??(??)d?? in (6). For instance ?? may be a recurrent neural network taking the $x$ ’s as input.5 Thus we get a class of recurrent networks defined by the equation
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\frac { \mathrm { d } h ( t ) } { \mathrm { d } t } = g ( t ) \operatorname { t a n h } { \left( W _ { x } x ( t ) + W _ { h } h ( t ) + b \right) } - g ( t ) h ( t )
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $g$ belongs to a large class (universal approximator) of functions of the inputs.
|
| 106 |
+
|
| 107 |
+
The class of recurrent models (7) is quasi-invariant to time warpings. The quality of the invariance will depend on the learning power of the learnable function $g$ : a function $g$ that can represent any function of the data would define a class of recurrent models that is perfectly invariant to time warpings; however, a specific model for $g$ (e.g., neural networks of a given size) can only represent a specific, albeit large, class of time warpings, and so will only provide quasi-invariance.
|
| 108 |
+
|
| 109 |
+
Heuristically, $g ( t )$ acts as a time-dependent version of the fixed $\alpha$ in (4). Just like $1 / \alpha$ above, $1 / g ( t _ { 0 } )$ represents the local forgetting time of the network at time $t _ { 0 }$ : the network will effectively retain information about the inputs at $t _ { 0 }$ for a duration of the order of magnitude of $1 / g ( t _ { 0 } )$ (assuming $g ( t )$ does not change too much around $t _ { 0 }$ ).
|
| 110 |
+
|
| 111 |
+
Let us translate back this equation to the more computationally realistic case of discrete time, using a Taylor expansion with step size $\delta t = 1$ , so that $\begin{array} { r } { \frac { \mathrm { d } \bar { h } ( t ) } { \mathrm { d } t } = \cdots } \end{array}$ becomes $h _ { t + 1 } = h _ { t } + \cdots .$ Then the model (7) becomes
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
h _ { t + 1 } = g _ { t } \operatorname { t a n h } \left( W _ { x } x _ { t } + W _ { h } h _ { t } + b \right) + \left( 1 - g _ { t } \right) h _ { t } .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $g _ { t }$ itself is a function of the inputs.
|
| 118 |
+
|
| 119 |
+
This model is the simplest extension of the RNN model that provides invariance to time warpings.6 It is a basic gated recurrent network, with input gating $g _ { t }$ and forget gating $( 1 - g _ { t } )$ .
|
| 120 |
+
|
| 121 |
+
Here $g _ { t }$ has to be able to learn an arbitrary function of the past inputs $x$ ; for instance, take for $g _ { t }$ the output of a recurrent network with hidden state $h ^ { g }$ :
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
g _ { t } = \sigma ( W _ { g x } x _ { t } + W _ { g h } h _ { t } ^ { g } + b _ { g } )
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
with sigmoid activation function $\sigma$ (more on the choice of sigmoid below). Current architectures just reuse for $h ^ { g }$ the states $h$ of the main network (or, equivalently, relabel $h \gets ( h , h ^ { g } )$ to be the union of both recurrent networks and do not make the distinction).
|
| 128 |
+
|
| 129 |
+
The model (8) provides invariance to global time warpings, making all units face the same dilation/contraction of time. One might, instead, endow every unit $i$ with its own local contraction/dilation function $g ^ { i }$ . This offers more flexibility (gates have been introduced for several reasons beyond time warpings (Hochreiter, 1991)), especially if several unknown timescales coexist in the signal: for instance, in a multilayer model, each layer may have its own characteristic timescales corresponding to different levels of abstraction from the signal. This yields a model
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
h _ { t + 1 } ^ { i } = g _ { t } ^ { i } \operatorname { t a n h } { \left( W _ { x } ^ { i } x _ { t } + W _ { h } ^ { i } h _ { t } + b ^ { i } \right) } + \left( 1 - g _ { t } ^ { i } \right) h _ { t } ^ { i }
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
with $h ^ { i }$ and $( W _ { x } ^ { i } , W _ { h } ^ { i } , b ^ { i } )$ being respectively the activation and the incoming parameters of unit $i$ , and with each $g ^ { i }$ a function of both inputs and units.
|
| 136 |
+
|
| 137 |
+
Equation 10 defines a simple form of gated recurrent network, that closely resembles the evolution equation of cell units in LSTMs, and of hidden units in GRUs.
|
| 138 |
+
|
| 139 |
+
In (10), the forget gate is tied to the input gate $( g _ { t } ^ { i }$ and $1 - g _ { t } ^ { i } )$ . Such a setting has been successfully used before (e.g. (Lample et al., 2016)) and saves some parameters, but we are not aware of systematic comparisons. Below, we initialize LSTMs this way but do not enforce the constraint throughout training.
|
| 140 |
+
|
| 141 |
+
# Continuous time versus discrete time
|
| 142 |
+
|
| 143 |
+
Of course, the analogy between continuous and discrete time breaks down if the Taylor expansion is not valid. The Taylor expansion is valid when the derivative of the time warping is not too large, say, when $\alpha \lesssim 1$ or $g _ { t } \lesssim 1$ (then (8) and (7) are close). Intuitively, for continuous-time data, the physical time increment corresponding to each time step $t t + 1$ of the discrete-time recurrent model should be smaller than the speed at which the data changes, otherwise the situation is hopeless. So discrete-time gated models are invariant to time warpings that stretch time (such as interspersing the data with blanks or having long-term dependencies), but obviously not to those that make things happen too fast for the model.
|
| 144 |
+
|
| 145 |
+
Besides, since time warpings are monotonous, we hav e d??(??)d?? > 0, i.e., ???? > 0. The two constraints $g _ { t } > 0$ and $g _ { t } < 1$ square nicely with the use of a sigmoid for the gate function $g$ .
|
| 146 |
+
|
| 147 |
+
# 2 TIME WARPINGS AND GATE INITIALIZATION
|
| 148 |
+
|
| 149 |
+
If we happen to know that the sequential data we are facing have temporal dependencies in an approximate range $[ T _ { \mathrm { m i n } } , T _ { \mathrm { m a x } } ]$ , it seems reasonable to use a model with memory (forgetting time) lying approximately in the same temporal range. As mentioned in Section 1, this amounts to having values of $g$ in the range $\left[ \frac { 1 } { T _ { \mathrm { m a x } } } , \frac { 1 } { T _ { \mathrm { m i n } } } \right] ^ { }$
|
| 150 |
+
|
| 151 |
+
The biases $b _ { g }$ of the gates $g$ greatly impact the order of magnitude of the values of $g ( t )$ over time. If the values of both inputs and hidden layers are centered over time, $g ( t )$ will typically take values centered around $\sigma ( b _ { g } )$ . Values of $\sigma ( b _ { g } )$ in the desired range $\left[ \frac { 1 } { T _ { \mathrm { m a x } } } , \frac { 1 } { T _ { \mathrm { m i n } } } \right]$ are obtained by choosing the biases $b _ { g }$ between $- \log ( T _ { \mathrm { m a x } } - 1 )$ and $- \log ( T _ { \mathrm { m i n } } - 1 )$ . This is a loose prescription: we only want to control the order of magnitude of the memory range of the neural networks. Furthermore, we don’t want to bound $g ( t )$ too tightly to some value forever: if rare events occur, abruplty changing the time scale can be useful. Therefore we suggest to use these values as initial values only.
|
| 152 |
+
|
| 153 |
+
This suggests a practical initialization for the bias of the gates of recurrent networks such as (10): when characteristic timescales of the sequential data at hand are expected to lie between $T _ { \mathrm { m i n } }$ and $T _ { \mathrm { m a x } }$ , initialize the biases of $g$ a $\mathrm { ~ : ~ } \log ( \bar { \mathcal { U } } ( [ T _ { \operatorname* { m i n } } , T _ { \operatorname* { m a x } } ] ) - 1 )$ where $\mathcal { U }$ is the uniform distribution7.
|
| 154 |
+
|
| 155 |
+
For LSTMs, using a variant of (Graves et al., 2013):
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\begin{array} { r l } & { i _ { t } = \sigma ( W _ { x i } x _ { t } + W _ { h i } h _ { t - 1 } + b _ { i } ) } \\ & { f _ { t } = \sigma ( W _ { x f } x _ { t } + W _ { h f } h _ { t - 1 } + b _ { f } ) } \\ & { c _ { t } = f _ { t } c _ { t - 1 } + i _ { t } \operatorname { t a n h } ( W _ { x c } x _ { t } + W _ { h c } h _ { t - 1 } + b _ { c } ) } \\ & { o _ { t } = \sigma ( W _ { x o } x _ { t } + W _ { h o } h _ { t - 1 } + b _ { o } ) } \\ & { h _ { t } = o _ { t } \operatorname { t a n h } ( c _ { t } ) , } \end{array}
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
the correspondence between between the gates in (10) and those in (13) is as follows: $1 - g _ { t }$ corresponds to $f _ { t }$ , and $g _ { t }$ to $i _ { t }$ . To obtain a time range around $T$ for unit $i$ , we must both ensure that $f _ { t } ^ { i }$ lies around $1 - 1 / T$ , and that $i _ { t }$ lies around $1 / \bar { T }$ . When facing time dependencies with largest time range $T _ { \mathrm { m a x } }$ , this suggests to initialize LSTM gate biases to
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\begin{array} { r } { b _ { f } \sim \log ( \mathcal { U } ( [ 1 , T _ { \operatorname* { m a x } } - 1 ] ) ) } \\ { b _ { i } = - b _ { f } } \end{array}
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
with $\mathcal { U }$ the uniform distribution and $T _ { \mathrm { m a x } }$ the expected range of long-term dependencies to be captured.
|
| 168 |
+
|
| 169 |
+
Hereafter, we refer to this as the chrono initialization.
|
| 170 |
+
|
| 171 |
+
# 3 EXPERIMENTS
|
| 172 |
+
|
| 173 |
+
First, we test the theoretical arguments by explicitly introducing random time warpings in some data, and comparing the robustness of gated and ungated architectures.
|
| 174 |
+
|
| 175 |
+
Next, the chrono LSTM initialization is tested against the standard initialization on a variety of both synthetic and real world problems. It heavily outperforms standard LSTM initialization on all synthetic tasks, and outperforms or competes with it on real world problems.
|
| 176 |
+
|
| 177 |
+
The synthetic tasks are taken from previous test suites for RNNs, specifically designed to test the efficiency of learning when faced with long term dependencies (Hochreiter & Schmidhuber, 1997; Le et al., 2015; Graves et al., 2014; Martens & Sutskever, 2011; Arjovsky et al., 2016).
|
| 178 |
+
|
| 179 |
+
In addition (Appendix A), we test the chrono initialization on next character prediction on the Text8 (Mahoney, 2011) dataset, and on next word prediction on the Penn Treebank dataset (Mikolov et al., 2012). Single layer LSTMs with various layer sizes are used for all experiments, except for the word level prediction, where we use the best model from (Zilly et al., 2016), a 10 layer deep recurrent highway network (RHN).
|
| 180 |
+
|
| 181 |
+
Pure warpings and paddings. To test the theoretical relationship between gating and robustness to time warpings, various recurrent architectures are compared on a task where the only challenge comes from warping.
|
| 182 |
+
|
| 183 |
+
The unwarped task is simple: remember the previous character of a random sequence of characters. Without time warping or padding, this is an extremely easy task and all recurrent architectures are successful. The only difficulty will come from warping; this way, we explicitly test the robustness of various architectures to time warping and nothing else.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 1: Performance of different recurrent architectures on warped and padded sequences sequences. From top left to bottom right: uniform time warping of length maximum_warping, uniform padding of length maximum_warping, variable time warping and variable time padding, from 1 to maximum_warping. (For uniform padding/warpings, the leaky RNN and gated RNN curves overlap, with loss 0.) Lower is better.
|
| 187 |
+
Figure 2: A task involving pure warping.
|
| 188 |
+
|
| 189 |
+
Unwarped task example:
|
| 190 |
+
|
| 191 |
+
Input: All human beings are born free and equal Output: All human beings are born free and equa Uniform warping example (warping $\times 4 _ { , }$ ): Input: AAAAllllllll hhhhuuuummmmaaaannnn Output: AAAAllllllll hhhhuuuummmmaaaa Variable warping example (random warping $\times 1 \mathrm { - } \times 4 )$ ): Input: Allllll hhhummmmaannn bbbbeeiiingssss Output: AAAlllll huuuummaaan bbeeeingggg
|
| 192 |
+
|
| 193 |
+
Uniformly time-warped tasks are produced by repeating each character maximum_warping times both in the input and output sequence, for some fixed number maximum_warping.
|
| 194 |
+
|
| 195 |
+
Variably time-warped tasks are produced similarly, but each character is repeated a random number of times uniformly drawn between 1 and maximum_warping. The same warping is used for the input and output sequence (so that the desired output is indeed a function of the input). This exactly corresponds to transforming input $x ( t )$ into $x ( c ( t ) )$ with $c$ a random, piecewise affine time warping. Fig. 2 gives an illustration.
|
| 196 |
+
|
| 197 |
+
For each value of maximum_warping, the train dataset consists of 50, 000 length-500 randomly warped random sequences, with either uniform or variable time warpings. The alphabet is of size 10 (including a dummy symbol). Contiguous characters are enforced to be different. After warping, each sequence is truncated to length 500. Test datasets of 10, 000 sequences are generated similarily. The criterion to be minimized is the cross entropy in predicting the next character of the output sequence.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 3: Standard initialization (blue) vs. chrono initialization (red) on the copy and variable copy task. From left to right, top to bottom, standard copy $T \ = \ 5 0 0$ and $T \ : = \ : 2 0 0 0$ , variable copy $T = 5 0 0$ and $T = 1 0 0 0$ . Chrono initialization heavily outperforms standard initialization, except for variable length copy with the smaller $T$ where both perform well.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 4: Standard initialization (blue) vs. chrono initialization (red) on the adding task. From left to right, $T = 2 0 0$ , and $T = 7 5 0$ . Chrono initialization heavily outperforms standard initialization.
|
| 204 |
+
|
| 205 |
+
Note that each sample in the dataset uses a new random sequence from a fixed alphabet, and (for variable warpings) a new random warping.
|
| 206 |
+
|
| 207 |
+
A similar, slightly more difficult task uses padded sequences instead of warped sequences, obtained by padding each element in the input sequence with a fixed or variable number of 0’s (in continuoustime, this amounts to a time warping of a continuous-time input sequence that is nonzero at certain points in time only). Each time the input is nonzero, the network has to output the previous nonzero character seen.
|
| 208 |
+
|
| 209 |
+
We compare three recurrent architectures: RNNs (Eq. (2), a simple, ungated recurrent network), leaky RNNs (Eq. (5), where each unit has a constant learnable “gate” between 0 and 1) and gated RNNs, with one gate per unit, described by (10). All networks contain 64 recurrent units.
|
| 210 |
+
|
| 211 |
+
The point of using gated RNNs (10) (“LSTM-lite” with tied input and forget gates), rather than full LSTMs, is to explicitly test the relevance of the arguments in Section 1 for time warpings. Indeed these LSTM-lite already exhibit perfect robustness to warpings in these tasks.
|
| 212 |
+
|
| 213 |
+
RMSprop with an $\alpha$ parameter of 0.9 and a batch size of 32 is used. For faster convergence, learning rates are divided by 2 each time the evaluation loss has not decreased after 100 batches. All architectures are trained for 3 full passes through the dataset, and their evaluation losses are compared. Each setup is run 5 times, and mean, maximum and minimum results among the five trials are reported. Results on the test set are summarized in Fig. 1.
|
| 214 |
+
|
| 215 |
+
Gated architectures significantly outperform RNNs as soon as moderate warping coefficients are involved. As expected from theory, leaky RNNs perfectly solve uniform time warpings, but fail to achieve optimal behavior with variable warpings, to which they are not invariant. Gated RNNs, which are quasi invariant to general time warpings, achieve perfect performance in both setups for all values of maximum_warping.
|
| 216 |
+
|
| 217 |
+
Synthetic tasks. For synthetic tasks, optimization is performed using RMSprop (Tieleman & Hinton, 2012) with a learning rate of $1 0 ^ { - 3 }$ and a moving average parameter of 0.9. No gradient clipping is performed; this results in a few short-lived spikes in the plots below, which do not affect final performance.
|
| 218 |
+
|
| 219 |
+
COPY TASKS. The copy task checks whether a model is able to remember information for arbitrarily long durations. We use the setup from (Hochreiter & Schmidhuber, 1997; Arjovsky et al., 2016), which we summarize here. Consider an alphabet of 10 characters. The ninth character is a dummy character and the tenth character is a signal character. For a given $T$ , input sequences consist of $T + 2 0$ characters. The first 10 characters are drawn uniformly randomly from the first 8 letters of the alphabet. These first characters are followed by $T - 1$ dummy characters, a signal character, whose aim is to signal the network that it has to provide its outputs, and the last 10 characters are dummy characters. The target sequence consists of $T + 1 0$ dummy characters, followed by the first 10 characters of the input. This dataset is thus about remembering an input sequence for exactly $T$ timesteps. We also provide results for the variable copy task setup presented in (Henaff et al., 2016), where the number of characters between the end of the sequence to copy and the signal character is drawn at random between 1 and $T$ .
|
| 220 |
+
|
| 221 |
+
The best that a memoryless model can do on the copy task is to predict at random from among possible characters, yielding a loss of $\frac { 1 0 \log ( 8 ) } { T + 2 0 }$ (Arjovsky et al., 2016).
|
| 222 |
+
|
| 223 |
+
On those tasks we use LSTMs with 128 units. For the standard initialization (baseline), the forget gate biases are set to 1. For the new initialization, the forget gate and input gate biases are chosen according to the chrono initialization (16), with $\begin{array} { r } { T _ { \mathrm { m a x } } = \frac { 3 \breve { T } } { 2 } } \end{array}$ for the copy task, thus a bit larger than input length, and $T _ { \mathrm { m a x } } = T$ for the variable copy task. The results are provided in Figure 3.
|
| 224 |
+
|
| 225 |
+
Importantly, our LSTM baseline (with standard initialization) already performs better than the LSTM baseline of (Arjovsky et al., 2016), which did not outperform random prediction. This is presumably due to slightly larger network size, increased training time, and our using the bias initialization from (Gers & Schmidhuber, 2000).
|
| 226 |
+
|
| 227 |
+
On the copy task, for all the selected $T$ ’s, chrono initialization largely outperforms the standard initialization. Notably, it does not plateau at the memoryless optimum. On the variable copy task, chrono initialization is even with standard initialization for $T = 5 0 0$ , but largely outperforms it for $T = 1 0 0 0$ .
|
| 228 |
+
|
| 229 |
+
ADDING TASK. The adding task also follows a setup from (Hochreiter & Schmidhuber, 1997; Arjovsky et al., 2016). Each training example consists of two input sequences of length $T$ . The first one is a sequence of numbers drawn from $\mathcal { U } ( [ 0 , 1 ] )$ , the second is a sequence containing zeros everywhere, except for two locations, one in the first half and another in the second half of the sequence. The target is a single number, which is the sum of the numbers contained in the first sequence at the positions marked in the second sequence.
|
| 230 |
+
|
| 231 |
+
The best a memoryless model can do on this task is to predict the mean of $2 \times \mathcal { U } ( [ 0 , 1 ] )$ , namely 1 (Arjovsky et al., 2016). Such a model reaches a mean squared error of 0.167.
|
| 232 |
+
|
| 233 |
+
LSTMs with 128 hidden units are used. The baseline (standard initialization) initializes the forget biases to 1. The chrono initialization uses $T _ { \mathrm { m a x } } = T$ . Results are provided in Figure 4. For all $T$ ’s, chrono initialization significantly speeds up learning. Notably it converges 7 times faster for $T = 7 5 0$ .
|
| 234 |
+
|
| 235 |
+
# CONCLUSION
|
| 236 |
+
|
| 237 |
+
The self loop feedback gating mechanism of recurrent networks has been derived from first principles via a postulate of invariance to time warpings. Gated connections appear to regulate the local time constants in recurrent models. With this in mind, the chrono initialization, a principled way of initializing gate biases in LSTMs, has been introduced. Experimentally, chrono initialization is shown to bring notable benefits when facing long term dependencies.
|
| 238 |
+
|
| 239 |
+
# REFERENCES
|
| 240 |
+
|
| 241 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on Machine Learning, pp. 1120–1128, 2016.
|
| 242 |
+
|
| 243 |
+
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. doi: 10.1109/72. 279181. URL http://dx.doi.org/10.1109/72.279181.
|
| 244 |
+
|
| 245 |
+
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.
|
| 246 |
+
|
| 247 |
+
Tim Cooijmans, Nicolas Ballas, César Laurent, Çaglar Gülçehre, and Aaron Courville. Recurrent ˘ batch normalization. arXiv preprint arXiv:1603.09025, 2016.
|
| 248 |
+
|
| 249 |
+
Felix A Gers and Jürgen Schmidhuber. Recurrent nets that time and count. In Neural Networks, 2000. IJCNN 2000, Proceedings of the IEEE-INNS-ENNS International Joint Conference on, volume 3, pp. 189–194. IEEE, 2000.
|
| 250 |
+
|
| 251 |
+
Felix A Gers, Jürgen Schmidhuber, and Fred Cummins. Learning to forget: Continual prediction with lstm. 1999.
|
| 252 |
+
|
| 253 |
+
Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In Acoustics, speech and signal processing (icassp), 2013 ieee international conference on, pp. 6645–6649. IEEE, 2013.
|
| 254 |
+
|
| 255 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 256 |
+
|
| 257 |
+
Mikael Henaff, Arthur Szlam, and Yann LeCun. Recurrent orthogonal networks and long-memory tasks. In International Conference on Machine Learning, pp. 2034–2042, 2016.
|
| 258 |
+
|
| 259 |
+
S. Hochreiter. Untersuchungen zu dynamischen neuronalen Netzen. Diploma thesis, Institut für Informatik, Lehrstuhl Prof. Brauer, Technische Universität München, 1991.
|
| 260 |
+
|
| 261 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735– 1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx. doi.org/10.1162/neco.1997.9.8.1735.
|
| 262 |
+
|
| 263 |
+
Herbert Jaeger. Tutorial on training recurrent neural networks, covering BPPT, RTRL, EKF and the “echo state network” approach, 2002.
|
| 264 |
+
|
| 265 |
+
Rafal Jozefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 2342–2350, 2015.
|
| 266 |
+
|
| 267 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 268 |
+
|
| 269 |
+
Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recognition. arXiv preprint arXiv:1603.01360, 2016.
|
| 270 |
+
|
| 271 |
+
Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015.
|
| 272 |
+
|
| 273 |
+
Yann LeCun, Patrick Haffner, Léon Bottou, and Yoshua Bengio. Object recognition with gradientbased learning. Shape, contour and grouping in computer vision, pp. 823–823, 1999.
|
| 274 |
+
|
| 275 |
+
Matt Mahoney. Large text compression benchmark, 2011.
|
| 276 |
+
|
| 277 |
+
James Martens and Ilya Sutskever. Learning recurrent neural networks with hessian-free optimization. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 1033–1040, 2011.
|
| 278 |
+
|
| 279 |
+
Tomáš Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, Stefan Kombrink, and Jan Cernocky. Subword language modeling with neural networks. preprint (http://www. fit. vutbr. cz/imikolov/rnnlm/char. pdf), 2012.
|
| 280 |
+
|
| 281 |
+
Michael C Mozer. Induction of multiscale temporal structure. In Advances in neural information processing systems, pp. 275–282, 1992.
|
| 282 |
+
|
| 283 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. Understanding the exploding gradient problem. CoRR, abs/1211.5063, 2012. URL http://arxiv.org/abs/1211.5063.
|
| 284 |
+
|
| 285 |
+
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.
|
| 286 |
+
|
| 287 |
+
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.
|
| 288 |
+
|
| 289 |
+
Scott Wisdom, Thomas Powers, John Hershey, Jonathan Le Roux, and Les Atlas. Full-capacity unitary recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 4880–4888, 2016.
|
| 290 |
+
|
| 291 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. arXiv preprint arXiv:1607.03474, 2016.
|
| 292 |
+
|
| 293 |
+
# A ADDITIONAL EXPERIMENTS
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 5: Generalization performances of different recurrent architectures on the warping problem. Networks are trained with uniform warps between 1 and 50 and evaluated on uniform warps between 100 and a variable maximum warp.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 6: Standard initialization (blue) vs. chrono initialization (red) on pixel level classification tasks. From left to right, MNIST and pMNIST.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 7: Standard initialization (blue) vs. chrono initialization (red) on the word level PTB (left) and on the character level text8 (right) validation sets.
|
| 303 |
+
|
| 304 |
+
On the generalization capacity of recurrent architectures. We proceeded to test the generalization properties of RNNs, leaky RNNs and chrono RNNs on the pure warping experiments presented in Section 3. For each of the architectures, a recurrent network with 64 recurrent units is trained for 3 epochs on a variable warping task with warps between 1 and 50. Each network is then tested on warped sequences, with warps between 100 and an increasingly big maximum warping. Results are summarized in Figure 5.
|
| 305 |
+
|
| 306 |
+
All networks display reasonably good, but not perfect, generalization. Even with warps 10 times longer than the training set warps, the networks still have decent accuracy, decreasing from $1 0 0 \%$ to around $7 5 \%$ .
|
| 307 |
+
|
| 308 |
+
Interestingly, plain RNNs and gated RNNs display a different pattern: overall, gated RNNs perform better but their generalization performance decreases faster with warps eight to ten times longer than those seen during training, while plain RNN never have perfect accuracy, below $8 0 \%$ even within the training set range, but have a flatter performance when going beyond the training set warp range.
|
| 309 |
+
|
| 310 |
+
Pixel level classification: MNIST and pMNIST. This task, introduced in (Le et al., 2015), consists in classifying images using a recurrent model. The model is fed pixels one by one, from top to bottom, left to right, and has to output a probability distribution for the class of the object in the image.
|
| 311 |
+
|
| 312 |
+
We evaluate standard and chrono initialization on two image datasets: MNIST (LeCun et al., 1999) and permuted MNIST, that is, MNIST where all images have undergone the same pixel permutation.
|
| 313 |
+
|
| 314 |
+
LSTMs with 512 hidden units are used. Once again, standard initialization sets forget biases to 1, and the chrono initialization parameter is set to the length of the input sequences, $T _ { \mathrm { m a x } } = 7 8 4$ . Results on the validation set are provided in Figure 6. On non-permuted MNIST, there is no clear difference, even though the best validation error is obtained with chrono initialization. On permuted MNIST, chrono initialization performs better, with a best validation result of $9 6 . 3 \%$ , while standard initialization obtains a best validation result of $9 5 . 4 \%$ .
|
| 315 |
+
|
| 316 |
+
Next character prediction on text8. Chrono initialization is benchmarked against standard initialization on the character level text8 dataset (Mahoney, 2011). Text8 is a 100M character formatted text sample from Wikipedia. (Mikolov et al., 2012)’s train-valid-test split is used: the first 90M characters are used as training set, the next 5M as validation set and the last 5M as test set.
|
| 317 |
+
|
| 318 |
+
The exact same setup as in (Cooijmans et al., 2016) is used, with the code directly taken from there. Namely: LSTMs with 2000 units, trained with Adam (Kingma & Ba, 2014) with learning rate $1 0 ^ { - 3 }$ , batches of size 128 made of non-overlapping sequences of length 180, and gradient clipping at 1.0. Weights are orthogonally initialized, and recurrent batch normalization (Cooijmans et al., 2016) is used.
|
| 319 |
+
|
| 320 |
+
Chrono initialization with $T _ { \mathrm { m a x } } = 8$ is compared to standard $b _ { f } = 1$ initialization. Results are presented in Figure 7. On the validation set, chrono initialization uniformly outperforms standard initialization by a small margin. On the test set, the compression rate is 1.37 with chrono initialization, versus 1.38 for standard initialization.8 This same slight difference is observed on two independent runs.
|
| 321 |
+
|
| 322 |
+
Our guess is that, on next character prediction, with moderately sized networks, short term dependencies dominate, making the difference between standard and chrono initialization relatively small.
|
| 323 |
+
|
| 324 |
+
Next word prediction on Penn Treebank. To attest for the resilience of chrono initialization to more complex models than simple LSTMs, we train on word level Penn Treebank (Mikolov et al., 2012) using the best deep RHN network from (Zilly et al., 2016). All hyperparameters are taken from of (Zilly et al., 2016). For the chrono bias initialization, a single bias vector $b$ is sampled according to $b \sim \log ( \mathcal { U } ( 1 , T _ { \operatorname* { m a x } } ) )$ , the carry gate bias vectors of all layers are initialized to $- b$ , and the transform gate biases to $b$ . $T _ { \mathrm { m a x } }$ is chosen to be 11 (because this gives an average bias initialization close to the value 2 from (Zilly et al., 2016)).9. Without further hyperparameter search and with a single run, we obtain test results similar to (Zilly et al., 2016), with a test perplexity of 6.54.
|
md/train/SJxIm0VtwH/SJxIm0VtwH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SkYibHlRb/SkYibHlRb.md
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SQLNet: GENERATING STRUCTURED QUERIES FROM NATURAL LANGUAGE WITHOUT REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Synthesizing SQL queries from natural language is a long-standing open problem and has been attracting considerable interest recently. Toward solving the problem, the de facto approach is to employ a sequence-to-sequence-style model. Such an approach will necessarily require the SQL queries to be serialized. Since the same SQL query may have multiple equivalent serializations, training a sequenceto-sequence-style model is sensitive to the choice from one of them. This phenomenon is documented as the “order-matters” problem. Existing state-of-the-art approaches rely on reinforcement learning to reward the decoder when it generates any of the equivalent serializations. However, we observe that the improvement from reinforcement learning is limited.
|
| 8 |
+
|
| 9 |
+
In this paper, we propose a novel approach, i.e., SQLNet, to fundamentally solve this problem by avoiding the sequence-to-sequence structure when the order does not matter. In particular, we employ a sketch-based approach where the sketch contains a dependency graph so that one prediction can be done by taking into consideration only the previous predictions that it depends on. In addition, we propose a sequence-to-set model as well as the column attention mechanism to synthesize the query based on the sketch. By combining all these novel techniques, we show that SQLNet can outperform the prior art by $9 \%$ to $1 3 \%$ on the WikiSQL task.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Semantic parsing is a long-standing open question and has many applications. In particular, parsing natural language descriptions into SQL queries recently attracts much interest from both academia (Yaghmazadeh et al., 2017) and industry (Zhong et al., 2017). We refer to this problem as the natural-language-to-SQL problem (NL2SQL). The de facto standard approach to solve this problem is to treat both the natural language description and SQL query as sequences and train a sequence-to-sequence model (Vinyals et al., 2015b) or its variants (Dong & Lapata, 2016) which can be used as the parser. One issue of such an approach is that different SQL queries may be equivalent to each other due to commutativity and associativity. For example, consider the following two queries:
|
| 14 |
+
|
| 15 |
+
<table><tr><td>SELECT result</td><td></td><td>SELECT result</td></tr><tr><td>WHERE score=`1-0' AND goal=16</td><td>WHERE goal=16 5AND score='1-0'</td></tr></table>
|
| 16 |
+
|
| 17 |
+
The order of the two constraints in the WHERE clause does not affect the execution results of the query, but syntactically, these two are considered as different queries. It is well-known that the order of these constraints affects the performance of a sequence-to-sequence-style model (Vinyals et al., 2016), and it is typically hard to find the best ordering. To mitigate this ordering issue, a typical approach that has been applied in many scenarios is to employ reinforcement learning (Zhong et al., 2017; Hu et al., 2017). The basic idea is that, after a standard supervised training procedure, the model is further trained using a policy gradient algorithm. In particular, given an input sequence, the decoder of a sequence-to-sequence model samples an output sequence following the output distribution and computes the reward based on whether the output is a well-formed query and whether the query will compute the correct results. This reward can be used by the policy gradient algorithm to fine-tune the model. However, the improvement that can be achieved through reinforcement learning is often limited. For example, on a NL2SQL task called WikiSQL (Zhong et al., 2017), the state-of-the-art work (Zhong et al., 2017) reports an improvement of only $2 \%$ by employing reinforcement learning.
|
| 18 |
+
|
| 19 |
+
In this work, we propose SQLNet to fundamentally solve this issue by avoiding the sequence-tosequence structure when the order does not matter. In particular, we employ a sketch-based approach to generate a SQL query from a sketch. The sketch aligns naturally to the syntactical structure of a SQL query. A neural network, called SQLNet, is then used to predict the content for each slot in the sketch. Our approach can be viewed as a neural network alternative to the traditional sketchbased program synthesis approaches (Alur et al., 2013; Solar-Lezama et al., 2006; Bornholt et al., 2016; Rabinovich et al., 2017; Parisotto et al., 2017). Note that the-state-of-the-art neural network SQL synthesis approach (Zhong et al., 2017) also employs a sketch-based approach, although their sketch is more coarse-grained and they employ a sequence-to-sequence structure to fill in the most challenging slot in the sketch.
|
| 20 |
+
|
| 21 |
+
As discussed above, the most challenging part is to generate the WHERE clause. Essentially, the issue with a sequence-to-sequence decoder is that the prediction of the next token depends on all previously generated tokens. However, different constraints may not have a dependency on each other. In our approach, SQLNet employs the sketch to provide the dependency relationship of different slots so that the prediction for each slot is only based on the predictions of other slots that it depends on. To implement this idea, the design of SQLNet introduces two novel constructions: sequence-to-set and column attention. The first is designed to predict an unordered set of constraints instead of an ordered sequence, and the second is designed to capture the dependency relationship defined in the sketch when predicting.
|
| 22 |
+
|
| 23 |
+
We evaluate our approach on the WikiSQL dataset (Zhong et al., 2017), which is, to the best of our knowledge, the only large scale NL2SQL dataset, and compare with the state-of-the-art approach, Seq2SQL (Zhong et al., 2017). Our approach results in the exact query-match accuracy of $6 1 . 5 \%$ and the result-match accuracy of $6 8 . 3 \%$ on the WikiSQL testset. In other words, SQLNet can achieve exact query-match and query-result-match accuracy of 7.5 points and 8.9 points higher than the corresponding metrics of Seq2SQL respectively, yielding the new state-of-the-art on the WikiSQL dataset.
|
| 24 |
+
|
| 25 |
+
The WikiSQL dataset was originally proposed to ensure that the training set and test set have a disjoint set of tables. In the practical setting, it is more likely that such an NL2SQL solution is deployed where there exists at least one query observed in the training set for the majority of tables. We re-organize the WikiSQL dataset to simulate this case and evaluate our approach and the baseline approach, Seq2SQL. We observe that in such a case the advantage of SQLNet over Seq2SQL enlarges by 2 points, and the SQLNet model can achieve an execution accuracy of $7 0 . 1 \%$ .
|
| 26 |
+
|
| 27 |
+
To summarize, our main contributions in this work are three-fold. First, we propose a novel principled approach to handle the sequence-to-set generation problem. Our approach avoids the “order-matters” problems in a sequence-to-sequence model and thus avoids the necessity to employ a reinforcement learning algorithm, and achieves a better performance than existing sequence-tosequence-based approach. Second, we propose a novel attention structure called column attention, and show that this helps to further boost the performance over a raw sequence-to-set model. Last, we design SQLNet which bypasses the previous state-of-the-art approach by 9 to 13 points on the WikiSQL dataset, and yield the new state-of-the-art on an NL2SQL task.
|
| 28 |
+
|
| 29 |
+
# 2 SQL QUERY SYNTHESIS FROM NATURAL LANGUAGE QUESTIONS AND TABLE SCHEMA
|
| 30 |
+
|
| 31 |
+
In this work, we consider the WikiSQL task proposed in (Zhong et al., 2017). In particular, the input contains two parts: a natural language question stating the query for a table, and the schema of the table being queried. The schema of a table contains both the name and the type (i.e., real numbers or strings) of each column. The output is a SQL query which reflects the natural language question with respect to the queried table.
|
| 32 |
+
|
| 33 |
+
Table
|
| 34 |
+
Question:
|
| 35 |
+
|
| 36 |
+
<table><tr><td rowspan=1 colspan=1>Player</td><td rowspan=1 colspan=1>No.</td><td rowspan=1 colspan=1>Nationality</td><td rowspan=1 colspan=1>Position</td><td rowspan=1 colspan=1>Years forJazz</td><td rowspan=1 colspan=1>School/ClubTeam</td></tr><tr><td rowspan=1 colspan=1>Stu Lantz</td><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>United States</td><td rowspan=1 colspan=1>Guard</td><td rowspan=1 colspan=1>1974-75</td><td rowspan=1 colspan=1>Nebraska</td></tr><tr><td rowspan=1 colspan=1>Rusty LaRue</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>United States</td><td rowspan=1 colspan=1>Guard</td><td rowspan=1 colspan=1>2001-02</td><td rowspan=1 colspan=1>Wake Forest</td></tr><tr><td rowspan=1 colspan=1>Eric Leckner</td><td rowspan=1 colspan=1>45</td><td rowspan=1 colspan=1>United States</td><td rowspan=1 colspan=1>Forward-Center</td><td rowspan=1 colspan=1>1988-90</td><td rowspan=1 colspan=1>Wyoming</td></tr><tr><td rowspan=1 colspan=1>Ron Lee</td><td rowspan=1 colspan=1>18</td><td rowspan=1 colspan=1>United States</td><td rowspan=1 colspan=1>Guard</td><td rowspan=1 colspan=1>1979-80</td><td rowspan=1 colspan=1>Oregon</td></tr><tr><td rowspan=1 colspan=1>Jim Les</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>United States</td><td rowspan=1 colspan=1>Guard</td><td rowspan=1 colspan=1>1988-89</td><td rowspan=1 colspan=1>Bradley</td></tr></table>
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 1: An example of the WikiSQL task.
|
| 40 |
+
|
| 41 |
+
Note that the WikiSQL task considers synthesizing a SQL query with respect to only one table. Thus, in an output SQL query, only the SELECT clause and the WHERE clause need to be predicted, and the FROM clause can be omitted. We present an example in Figure 1.
|
| 42 |
+
|
| 43 |
+
The WikiSQL task makes further assumptions to make it tractable. First, it assumes that each column name is a meaningful natural language description so that the synthesis task is tractable from only the natural language question and column names. Second, any token in the output SQL query is either a SQL keyword or a sub-string of the natural language question. For example, when generating a constraint in the WHERE clause, e.g., name $= \cdot _ { \mathrm { B O b } ^ { \prime } }$ , the token $\because \mathrm { \Delta } \mathrm { \Omega } \mathrm { \sim } \mathrm { \Delta } \mathrm { \Omega }$ must appear in the natural language question as a sub-string. This assumption is necessary when the content in a database table is not given as an input. Third, each constraint in the WHERE clause has the form of COLUMN OP VALUE, where COLUMN is a column name, OP is one of $^ { \mathrm { \tiny ~ * } } < , = , > , \geq , \leq ^ { \mathrm { \tiny ~ \qquad } }$ , and VALUE is a substring of the natural language question as explained above.
|
| 44 |
+
|
| 45 |
+
Although these constraints seem to overly simplify the problem, we argue that such a subset of SQL queries still has a significant impact in practice. In fact, Johnson et al. (2017) studied 8.1 million real-world SQL queries written by Uber’s data analysts, and found that at least $3 7 \%$ of them involve only one table and all constraints in the WHERE clause involve only one column. Thus, solving this problem can significantly reduce the burden of data analysts by reducing more than 1/3 of the workload in practice.
|
| 46 |
+
|
| 47 |
+
More importantly, different from most previous NL2SQL datasets (Tang & Mooney, 2001; Price, 1990; Dahl et al., 1994; Li & Jagadish, 2014; Pasupat & Liang, 2015; Yin et al., 2015), the WikiSQL task has several properties that we would like. First, it provides a large-scale dataset so that a neural network can be effectively trained. Note, previously famous data sets such as (Dahl et al., 1994) contain less than 10,000 examples; but modern deep learning models, e.g., a sequence-tosequence model, typically require much more data. WikiSQL mitigates this issue by providing a larger dataset. Second, it employs crowd-sourcing to collect the natural language questions created by human beings, so that it can help to overcome the issue that a well-trained model may overfit to template-synthesized descriptions.
|
| 48 |
+
|
| 49 |
+
Third, we are interested in the SQL synthesis problem in an enterprise setting. In such a setting, the database may contain billions of users’ sensitive information, and thus how to handle the scalability of the data and how to ensure privacy are important problems. Therefore, we prefer a solution that synthesizes SQL queries from only the natural language description and the table schema. Such requirements make many existing studies on question-answering (e.g., Sun et al. (2016)) and table content-based SQL synthesis approaches (e.g., Yin et al. (2015)) unsuitable. In this sense, the WikiSQL task perfectly fits our requirement to mitigate the scalability and privacy issues.
|
| 50 |
+
|
| 51 |
+
Fourth, the data is split so that the training, dev, and test set do not share tables. This helps to evaluate an approach’s capability to generalize to an unseen schema. Previous datasets may have one or more of such four properties, but to the best of our knowledge, we are not aware of any NL2SQL dataset having all these properties except WikiSQL.
|
| 52 |
+
|
| 53 |
+
Besides these benefits, WikiSQL is still a challenging task. Zhong et al. (2017) report that the stateof-the-art task-agnostic semantic parsing model (Dong & Lapata, 2016) can achieve an execution accuracy of merely $3 7 \%$ , while the prevous state-of-the-art model for this task can achieve an execution accuracy of around $6 0 \%$ . Therefore, we believe tackling the WikiSQL task is a meaningful and challenging first step toward eventually solving the NL2SQL problem. We consider building and tackling the SQL synthesis task of more complex queries as important future work.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 2: Sketch syntax and the dependency in a sketch
|
| 57 |
+
|
| 58 |
+
# 3 SQLNet
|
| 59 |
+
|
| 60 |
+
In this section, we present our SQLNet solution to tackle the WikiSQL task. Different from existing semantic parsing models (Dong & Lapata, 2016) which are designed to be agnostic to the output grammar, our basic idea is to employ a sketch, which highly aligns with the SQL grammar. Therefore, SQLNet only needs to fill in the slots in the sketch rather than to predict both the output grammar and the content.
|
| 61 |
+
|
| 62 |
+
The sketch is designed to be generic enough so that all SQL queries of interest can be expressed by the sketch. Therefore, using the sketch does not hinder our approach’s generalizability. We will explain the details of a sketch in Section 3.1.
|
| 63 |
+
|
| 64 |
+
The sketch captures the dependency of the predictions to make. By doing so, the prediction of the value of one slot is only conditioned on the values of those slots that it depends on. This avoids the “order matters” problem in a sequence-to-sequence model, in which one prediction is conditioned on all previous predictions (Vinyals et al., 2016). To make predictions based on a sketch, we develop two techniques, sequence-to-set and column attention. We will explain the details of these techniques in Section 3.2.
|
| 65 |
+
|
| 66 |
+
We combine all techniques to design a SQLNet neural network to synthesize a SQL query from a natural language question and a table schema. In Section 3.3, we present the details of SQLNet and training details to surpass previous state-of-the-art approach without using reinforcement learning.
|
| 67 |
+
|
| 68 |
+
# 3.1 SKETCH-BASED QUERY SYNTHESIS
|
| 69 |
+
|
| 70 |
+
The SQL sketch that we employ is formally stated in Figure 2a. The tokens in bold (i.e., SELECT, WHERE, and AND) indicate the SQL keywords. The tokens starting with $\mathbf { \hat { \Sigma } } ^ { 6 6 } \mathbf { \hat { S } } ^ { 7 }$ indicate the slot to be filled. The name following the $\mathit { \Omega } ^ { \bullet } \$ 3$ indicates the type of the prediction. For example, the $\$ 106$ slot can be filled with either an empty token or one of the aggregation operators, such as SUM and MAX. The $\$ 0$ and the $\$ 123,45$ slots need be filled with a column name and a sub-string of the question respectively. The $\$ 02$ slot can take a value from $\{ = , < , > \}$ . The notion $( \ldots ) *$ employ a regular expression to indicate zero or more AND clauses.
|
| 71 |
+
|
| 72 |
+
The dependency graph of the sketch is illustrated in Figure 2b. All slots whose values are to be predicted are illustrated as boxes, and each dependency is depicted as a directed edge. For example, the box of $\mathrm { O P _ { 1 } }$ has two incoming edges from $\mathsf { C o l u m n } _ { 1 }$ and the natural language question respectively. These edges indicate that the prediction of the value for $\mathrm { O P _ { 1 } }$ depends on both the values of $\mathsf { C o l u m n } _ { 1 }$ and the natural language question. We can view our model as a graphical model based on this dependency graph, and the query synthesis problem as an inference problem on the graph. From this perspective, we can see that the prediction of one constraint is independent with another, and thus our approach can fundamentally avoid the “order-matters” problem in a sequence-to-sequence model.
|
| 73 |
+
|
| 74 |
+
Note that although it is simple, this sketch is expressive enough to represent all queries in the WikiSQL task. Our SQLNet approach is not limited to this sketch only. To synthesize more complex SQL queries, we can simply employ a sketch that supports a richer syntax. In fact, the state-ofthe-art approach on the WikiSQL task, i.e., Seq2SQL (Zhong et al., 2017), can also be viewed as a sketch-based approach. In particular, Seq2SQL predicts for $\$ 106$ and $\$ 0$ LUMN separately from the WHERE clause. However, Seq2SQL generates the WHERE clause using a sequence-to-sequence model. Thus it still suffers the “order-matters” problem.
|
| 75 |
+
|
| 76 |
+
# 3.2 SEQUENCE-TO-SET PREDICTION USING COLUMN ATTENTION
|
| 77 |
+
|
| 78 |
+
In this section, we use the prediction of a column name in the WHERE clause as an example to explain the ideas of a sequence-to-set model and column attention. We will explain the full SQLNet model in Section 3.3.
|
| 79 |
+
|
| 80 |
+
Sequence-to-set. Intuitively, the column names appearing in the WHERE clause constitute a subset of the full set of all column names. Therefore, instead of generating a sequence of column names, we can simply predict which column names appear in this subset of interest. We refer to this idea as sequence-to-set prediction.
|
| 81 |
+
|
| 82 |
+
In particular, we compute the probability $P _ { \mathbf { w h e r e c o l } } ( c o l | Q )$ , where $c o l$ is a column name and $Q$ is the natural language question. To this aim, one idea is to compute $P _ { \mathbf { w h e r e c o l } } ( c o l | Q )$ as
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
P _ { \mathbf { w h e r e c o l } } ( c o l | Q ) = \sigma ( u _ { c } ^ { T } E _ { c o l } + u _ { q } ^ { T } E _ { Q } )
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\sigma$ is the sigmoid function, $E _ { c o l }$ and $E _ { Q }$ are the embeddings of the column name and the natural language question respectively, and $u _ { c }$ and $u _ { q }$ are two column vectors of trainable variables. Here, the embeddings $E _ { c o l }$ and $E _ { Q }$ can be computed as the hidden states of a bi-directional LSTM running on top of the sequences of col and $Q$ respectively. Note the two LSTMs to encode the column names and the question do not share their weights. The dimensions of $u _ { c } , u _ { q } , E _ { c o l } , E _ { Q }$ are all $d$ , which is the dimension of the hidden states of the LSTM.
|
| 89 |
+
|
| 90 |
+
In doing so, the decision of whether or not to include a particular column in the WHERE clause can be made independently to other columns by examining $\bar { P } _ { \mathbf { w h e r e c o l } } ( c o l | Q )$ .
|
| 91 |
+
|
| 92 |
+
Column attention. Equation (1) has a problem of using $E _ { Q }$ . Since it is computed as the hidden states of the natural language question only, it may not be able to remember the particular information useful in predicting a particular column name. For example, in the question in Figure 1, the token “number” is more relevant to predicting the column “No.” in the WHERE clause. However, the token “player” is more relevant to predicting the “player” column in the SELECT clause. The embedding should reflect the most relevant information in the natural language question when predicting on a particular column.
|
| 93 |
+
|
| 94 |
+
To incorporate this intuition, we design the column attention mechanism to compute $E _ { Q | c o l }$ instead of $E _ { Q }$ . In particular, we assume $H _ { Q }$ is a matrix of $d { \times } L$ , where $L$ is the length of the natural language question. The $i$ -th column of $H _ { Q }$ represents the hidden states output of the LSTM corresponding to the $i$ -th token of the question.
|
| 95 |
+
|
| 96 |
+
We compute the attention weights $w$ for each token in the question. In particular, $w$ is a $L$ -dimension column vector, which is computed as
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { c c c } { w = \mathbf { s o f t m a x } ( v ) } & { } & { \qquad v _ { i } = ( E _ { c o l } ) ^ { T } W H _ { Q } ^ { i } \quad \forall i \in \{ 1 , . . . , L \} } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $v _ { i }$ indicates the $i$ -th dimension of $v$ , $H _ { Q } ^ { i }$ indicates the $i$ -th column of $H _ { Q }$ , and $W$ is a trainable matrix of size $d \times d$ .
|
| 103 |
+
|
| 104 |
+
After the attention weights $w$ are computed, we can compute $E _ { Q | c o l }$ as the weighted sum of each token’s LSTM hidden output based on $w$ :
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
E _ { Q | c o l } = H _ { Q } w
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
We can replace $E _ { Q }$ with $E _ { Q | c o l }$ in Equation (1) to get the column attention model:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
P _ { \mathbf { w h e r e c o l } } ( c o l | Q ) = \sigma ( u _ { c } ^ { T } E _ { c o l } + u _ { q } ^ { T } E _ { Q | c o l } )
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
In fact, we find that adding one more layer of affine transformation before the $\sigma$ operator can improve the prediction performance by around $1 . 5 \%$ . Thus, we get the final model for predicting column names in the WHERE clause:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
P _ { \mathbf { w h e r e c o l } } ( c o l | Q ) = \sigma ( ( u _ { a } ^ { c o l } ) ^ { T } \mathbf { t a n h } ( U _ { c } ^ { c o l } E _ { c o l } + U _ { q } ^ { c o l } E _ { Q | c o l } ) )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $U _ { c } ^ { c o l }$ and $U _ { q } ^ { c o l }$ are trainable matrices of size $d \times d$ , and $u _ { a } ^ { c o l }$ is a $d$ -dimensional trainable vector.
|
| 123 |
+
|
| 124 |
+
We want to highlight that column attention is a special instance of the generic attention mechanism to compute the attention map on a question conditioned on the column names. We will show in our evaluation that this mechanism can improve upon a sequence-to-set model by around 3 points.
|
| 125 |
+
|
| 126 |
+
# 3.3 SQLNet MODEL AND TRAINING DETAILS
|
| 127 |
+
|
| 128 |
+
In this section, we present the full SQLNet model and training details. As illustrated in Figure 2b, the predictions of the SELECT clause and WHERE clause are separated. In the following, we first present the model for generating the WHERE clause and then the SELECT clause. In the end, we describe more training details which significantly help to improve the prediction accuracy.
|
| 129 |
+
|
| 130 |
+
# 3.3.1 PREDICTING THE WHERE CLAUSE
|
| 131 |
+
|
| 132 |
+
The WHERE clause is the most complex structure to predict in the WikiSQL task. Our SQLNet model first predicts the set of columns that appear in the WHERE clause based on Section 3.2, and then for each column it generates the constraint by predicting the OP and VALUE slots. We describe them below.
|
| 133 |
+
|
| 134 |
+
Column slots. After $P _ { \mathbf { w h e r e c o l } } ( c o l | Q )$ is computed based on Equation (3), SQLNet needs to decide which columns to include in the WHERE. One approach is to set a threshold $\tau \in ( 0 , 1 )$ , so that all columns with $P _ { \mathbf { w h e r e c o l } } ( c o l | Q ) \geq \tau$ are chosen.
|
| 135 |
+
|
| 136 |
+
However, we find that an alternative approach can typically give a better performance. We now explain this approach. In particular, we use a network to predict the total number $K$ of columns to be included in the subset, and choose the top- $K$ columns with the highest $P _ { \mathbf { w h e r e c o l } } ( c o l | Q )$ to form the column names in the WHERE clause.
|
| 137 |
+
|
| 138 |
+
We observe that most queries have a limited number of columns in their WHERE clauses. Therefore, we set an upper-bound $N$ on the number of columns to choose, and thus we cast the problem to predict the number of columns as a $( N + 1 )$ -way classification problem (from 0 to $N$ ). In particular, we have
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r } { P _ { \# \mathbf { c o l } } ( K | Q ) = \mathbf { s o f t m a x } ( U _ { 1 } ^ { \# \mathrm { c o l } } \mathbf { t a n h } ( U _ { 2 } ^ { \# \mathrm { c o l } } E _ { Q | Q } ) ) _ { i } } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where U#c ol and U #col2 a re trainable matrices of size $( N + 1 ) \times d$ and $d \times d$ respectively. The notion softmax $( \ldots ) _ { i }$ indicates the $i$ -th dimension of the softmax output, and we will use this notion throughout the rest of the description. SQLNet chooses the number of columns $K$ that maximizes $P _ { \# \mathbf { c o l } } ( K | Q )$ .
|
| 145 |
+
|
| 146 |
+
In our evaluation, we simply choose $N = 4$ to simplify our evaluation setup. But note that we can get rid of the hyper-parameter $N$ by employing a variant-length prediction model, such as the one for the SELECT column prediction model that will be discussed in Section 3.3.2.
|
| 147 |
+
|
| 148 |
+
OP slot. For each column in the WHERE clause, predicting the value of its OP slot is a 3-way classifications: the model needs to choose from $\{ = , > , < \}$ . Therefore, we compute
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
P _ { \mathrm { o p } } ( i | Q , c o l ) = \mathbf { s o f t m a x } ( U _ { 1 } ^ { \mathrm { o p } } \mathbf { t a n h } ( U _ { c } ^ { o p } E _ { c o l } + U _ { q } ^ { o p } E _ { Q | c o l } ) ) _ { i }
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
, $c o l$ id olumn under consideratirespectively. Note that $U _ { 1 } ^ { \mathrm { o p } } , U _ { c } ^ { o p } , U _ { q } ^ { o p }$ are trainable matrices of size the right-hand side. This mea $3 \times d$ $d \times d$ $d \times d$ $E _ { Q | c o l }$ SQLNet uses column attention for OP prediction to capture the dependency in Figure 2b.
|
| 155 |
+
|
| 156 |
+
VALUE slot. For the VALUE slot, we need to predict a substring from the natural language question. To this end, SQLNet employs a sequence-to-sequence structure to generate the sub-string. Note that, here the order of the tokens in the VALUE slot indeed matters. Therefore, using a sequence-to-sequence structure is reasonable.
|
| 157 |
+
|
| 158 |
+
The encoder phase still employs a bi-directional LSTM. The decoder phase computes the distribution of the next token using a pointer network (Vinyals et al., $2 0 1 5 \mathrm { a }$ ; Yang et al., 2016) with the column attention mechanism. In particular, consider the hidden state of the previously generated sequence is $h$ , and the LSTM output for each token in the natural language question is $H _ { Q } ^ { i }$ . Then the probability of the next token in VALUE can be computed as
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
P _ { \mathrm { v a l } } ( i | Q , c o l , h ) = \mathbf { s o f t m a x } ( a ( h ) )
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
a ( h ) _ { i } = ( u ^ { \mathrm { v a l } } ) ^ { T } \mathbf t \mathbf a \mathbf n \mathbf h ( U _ { 1 } ^ { \mathrm { v a l } } H _ { Q } ^ { i } + U _ { 2 } ^ { \mathrm { v a l } } E _ { c o l } + U _ { 3 } ^ { \mathrm { v a l } } h ) \quad \forall i \in \{ 1 , . . . , L \}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where $u _ { a } ^ { \mathrm { v a l } }$ is a $d$ -dimensional trainable vector, $U _ { h } ^ { \mathrm { v a l } } , U _ { c } ^ { \mathrm { v a l } } , U _ { q } ^ { \mathrm { v a l } }$ are three trainable matrices of size $d \times d$ , and $L$ is the length of the natural language question. Note that the computation of the $a ( h ) _ { i }$ is using the column attention mechanism, which is similar in the computation of $E _ { Q | c o l }$ .
|
| 169 |
+
|
| 170 |
+
Note that $P _ { \mathrm { v a l } } ( i | Q , c o l , h )$ represents the probability that the next token to generate is the $i$ -th token in the natural language question.SQLNet simply chooses the most probable one for each step to generate the sequence. Note that the $\langle \mathtt { E N D } \rangle$ token also appears in the question. The SQLNet model stops generating for VALUE when the $\langle \mathtt { E N D } \rangle$ token is predicted.
|
| 171 |
+
|
| 172 |
+
# 3.3.2 PREDICTING THE SELECT CLAUSE
|
| 173 |
+
|
| 174 |
+
The SELECT clause has an aggregator and a column name. The prediction of the column name in the SELECT clause is quite similar to the WHERE clause. The main difference is that for the SELECT clause, we only need to select one column among all. Therefore, we compute
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
P _ { \mathbf { s e l c o l } } ( i | Q ) = \mathbf { s o f t m a x } ( s e l ) _ { i }
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
s e l _ { i } = ( u _ { a } ^ { \mathrm { s e l } } ) ^ { T } \mathbf { t a n h } ( U _ { c } ^ { \mathrm { s e l } } E _ { c o l _ { i } } + U _ { q } ^ { \mathrm { s e l } } E _ { Q | c o l _ { i } } ) \quad \forall i \in \{ 1 , . . . , C \}
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
Here, Notic $u _ { a } ^ { \mathrm { s e l } } , U _ { c } ^ { \mathrm { s e l } } , U _ { q } ^ { \mathrm { s e l } }$ are similar to rent dimension $u _ { a } ^ { \mathrm { c o l } } , U _ { c } ^ { \mathrm { c o l } } , U _ { q } ^ { \mathrm { c o l } }$ in (3), and l is compute $C$ is the total number of columns.based on a corresponding column $c o l _ { i }$ . The model will predict the column $c o l _ { i }$ that maximizes $P _ { \mathbf { s e l c o l } } ( i | Q )$ .
|
| 185 |
+
|
| 186 |
+
For the aggregator, assuming the predicted column name for the SELECT clause is $c o l$ , we can simply compute
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
P _ { \mathbf { a g g } } ( i | Q , c o l ) = \mathbf { s o f t m a x } ( U ^ { \mathrm { a g g } } \mathbf { t a n h } ( U _ { a } E _ { Q | c o l } ) ) _ { i }
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
where $U _ { a }$ is a trainable matrix of size $6 \times d$ . Notice that the prediction of the aggregator shares a similar structure as OP.
|
| 193 |
+
|
| 194 |
+
# 3.3.3 TRAINING DETAILS
|
| 195 |
+
|
| 196 |
+
In this section, we present more details to make our experiments reproducible. We also emphasize on the details that can improve our model’s performance.
|
| 197 |
+
|
| 198 |
+
Input encoding model details. Both natural language descriptions and column names are treated as a sequence of tokens. We use the Stanford CoreNLP tokenizer (Manning et al., 2014) to parse the sentence. Each token is represented as a one-hot vector and fed into a word embedding vector before feeding them into the bi-directional LSTM. To this end, we use the GloVe word embedding (Pennington et al., 2014).
|
| 199 |
+
|
| 200 |
+
Training details. We need a special loss to train the sequence-to-set model. Intuitively, we design the loss to reward the correct prediction while penalizing the wrong prediction. In particular, given a question $Q$ and a set of $C$ columns $c o l$ , assume $y$ is a $C$ -dimensional vector where $y _ { j } = 1$ indicates that the $j$ -th column appears in the ground truth of the WHERE clause; and $y _ { j } ~ = ~ 0$ otherwise. Then we minimize the following weighted negative log-likelihood loss to train the sub-model for $P -$ wherecol:
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
l o s s ( c o l , Q , y ) = - \bigg ( \sum _ { j = 1 } ^ { C } ( \alpha y _ { j } \log P _ { \mathbf w \mathbf h \mathbf e r e c o l } ( c o l _ { j } | Q ) + ( 1 - y _ { j } ) \log ( 1 - P _ { \mathbf w \mathbf h \mathbf e r e c o l } ( c o l _ { j } | Q ) ) \bigg )
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
In this function, the weight $\alpha$ is hyper-parameter to balance the positive data versus negative data. In our evaluation, we choose $\alpha = 3$ . For all other sub-module besides Pwherecol, we minimize the standard cross-entropy loss.
|
| 207 |
+
|
| 208 |
+
We choose the size of the hidden states to be 100. We use the Adam optimizer (Kingma & Ba, 2014) with a learning rate 0.001. We train the model for 200 epochs and the batch size is 64. We randomly re-shuffle the training data in each epoch.
|
| 209 |
+
|
| 210 |
+
Weight sharing details. The model contains multiple LSTMs for predicting different slots in the sketch. In our evaluation, we find that using different LSTM weights for predicting different slots yield better performance than making them share the weights. However, we find that sharing the same word embedding vector helps to improve the performance. Therefore, different components in SQLNet only share the word embedding.
|
| 211 |
+
|
| 212 |
+
Training the word embedding. In Seq2SQL, Zhong et al. (2017) suggest that the word embedding for tokens appearing in GloVe should be fixed during training. However, we observe that the performance can be boosted by 2 points when we allow the word embedding to be updated during training. Therefore, we initialize the word embedding with GloVe as discussed above, and allow them to be trained during the Adam updates after 100 epochs.
|
| 213 |
+
|
| 214 |
+
# 4 EVALUATION
|
| 215 |
+
|
| 216 |
+
In this section, we evaluate SQLNet versus the state-of-the-art approach, i.e., Seq2SQL (Zhong et al., 2017), on the WikiSQL dataset.
|
| 217 |
+
|
| 218 |
+
In the following, we first present the evaluation setup. Then we present the comparison between our approach and Seq2SQL on the query synthesis accuracy, as well as a break-down comparison on different sub-tasks. In the end, we propose another variant of the WikiSQL dataset to reflect another application scenario of the SQL query synthesis task and present our evaluation results of our approach versus Seq2SQL.
|
| 219 |
+
|
| 220 |
+
# 4.1 EVALUATION SETUP
|
| 221 |
+
|
| 222 |
+
In this work, we focus on the WikiSQL dataset (Zhong et al., 2017). The dataset was updated on October 16, 2017. In our evaluation, we use the updated version.
|
| 223 |
+
|
| 224 |
+
We compare our work with Seq2SQL, the state-of-the-art approach on the WikiSQL task. We compare SQLNet with Seq2SQL using three metrics to evaluate the query synthesis accuracy:
|
| 225 |
+
|
| 226 |
+
1. Logical-form accuracy. We directly compare the synthesized SQL query with the ground truth to check whether they match each other. This metric is used in (Zhong et al., 2017).
|
| 227 |
+
2. Query-match accuracy. We convert the synthesized SQL query and the ground truth into a canonical representation and compare whether two SQL queries match exactly. This metric can eliminate the false negatives due to only the ordering issue.
|
| 228 |
+
3. Execution accuracy. We execute both the synthesized query and the ground truth query and compare whether the results match to each other. This metric is used in (Zhong et al., 2017).
|
| 229 |
+
|
| 230 |
+
We are also interested in the break-down results on different sub-tasks: (1) the aggregator in the SELECT clause; (2) the column in the SELECT clause; and (3) the WHERE clause. Due to the different structure, it is hard to make a further fine-grained comparison.
|
| 231 |
+
|
| 232 |
+
We implement SQLNet using PyTorch (Facebook, 2017). For the baseline approach in our comparison, i.e., Seq2SQL, we compare our results with the numbers reported by Zhong et al. (2017).
|
| 233 |
+
|
| 234 |
+
However, Zhong et al. (2017) do not include the break-down results for different sub-tasks, and the source code is not available. To solve this issue, we re-implement Seq2SQL by ourselves. For evaluations whose results are not reported in (Zhong et al., 2017), we report the results from our re-implementation and compare SQLNet against those as the baseline.
|
| 235 |
+
|
| 236 |
+
Table 1: Overall result on the WikiSQL task. $\operatorname { A c c } _ { \operatorname { l f } }$ , $\operatorname { A c c } _ { \mathrm { q m } }$ , and $\operatorname { A c c } _ { \mathrm { e x } }$ indicate the logical form, query-match and the execution accuracy respectively.
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=3>dev</td><td rowspan=1 colspan=3>test</td></tr><tr><td rowspan=1 colspan=1>Acc1f</td><td rowspan=1 colspan=1>AcCqm</td><td rowspan=1 colspan=1>Accex</td><td rowspan=1 colspan=1>Acclf</td><td rowspan=1 colspan=1>Accqm</td><td rowspan=1 colspan=1>Accex</td></tr><tr><td rowspan=1 colspan=1>Seq2SQL (Zhong et al. (2017))</td><td rowspan=1 colspan=1>49.5%</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>60.8%</td><td rowspan=1 colspan=1>48.3%</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>59.4%</td></tr><tr><td rowspan=1 colspan=1>Seq2SQL (ours)</td><td rowspan=1 colspan=1>52.5%</td><td rowspan=1 colspan=1>53.5%</td><td rowspan=1 colspan=1>62.1%</td><td rowspan=1 colspan=1>50.8%</td><td rowspan=1 colspan=1>51.6%</td><td rowspan=1 colspan=1>60.4%</td></tr><tr><td rowspan=1 colspan=1>SQLNet</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>63.2%</td><td rowspan=1 colspan=1>69.8%</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>61.3%</td><td rowspan=1 colspan=1>68.0%</td></tr></table>
|
| 239 |
+
|
| 240 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=3>dev</td><td rowspan=1 colspan=3>test</td></tr><tr><td rowspan=1 colspan=1>AcCagg</td><td rowspan=1 colspan=1>AcCsel</td><td rowspan=1 colspan=1>AcCwhere</td><td rowspan=1 colspan=1>AcCagg</td><td rowspan=1 colspan=1>AcCsel</td><td rowspan=1 colspan=1>AcCwhere</td></tr><tr><td rowspan=1 colspan=1>Seq2SQL (ours)</td><td rowspan=1 colspan=1>90.0%</td><td rowspan=1 colspan=1>89.6%</td><td rowspan=1 colspan=1>62.1%</td><td rowspan=1 colspan=1>90.1%</td><td rowspan=1 colspan=1>88.9%</td><td rowspan=1 colspan=1>60.2%</td></tr><tr><td rowspan=1 colspan=1>Seq2SQL (ours, C-order)</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>63.3%</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>61.2%</td></tr><tr><td rowspan=1 colspan=1>SQLNet (Seq2set)</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>69.1%</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>67.1%</td></tr><tr><td rowspan=1 colspan=1>SQLNet (Seq2set+CA)</td><td rowspan=1 colspan=1>90.1%</td><td rowspan=1 colspan=1>91.1%</td><td rowspan=1 colspan=1>72.1%</td><td rowspan=1 colspan=1>90.3%</td><td rowspan=1 colspan=1>90.4%</td><td rowspan=1 colspan=1>70.0%</td></tr><tr><td rowspan=1 colspan=1>SQLNet (Seq2set+CA+WE)</td><td rowspan=1 colspan=1>90.1%</td><td rowspan=1 colspan=1>91.5%</td><td rowspan=1 colspan=1>74.1%</td><td rowspan=1 colspan=1>90.3%</td><td rowspan=1 colspan=1>90.9%</td><td rowspan=1 colspan=1>71.9%</td></tr></table>
|
| 241 |
+
|
| 242 |
+
Table 2: Break down result on the WikiSQL dataset. $\mathrm { S e q } 2 \mathrm { S Q L }$ (C-order) indicates that after Seq2SQL generates the WHERE clause, we convert both the prediction and the ground truth into a canonical order when being compared. Seq2set indicates that the sequence-to-set technique is employed. $+ \mathrm { C A }$ indicates that column attention is used. $+ \mathbf { W } \mathbf { E }$ indicates that the word embedding is allowed to be trained. $\operatorname { A c c } _ { \mathrm { a g g } }$ and $\operatorname { A c c } _ { \mathrm { s e l } }$ indicate the accuracy on the aggregator and column prediction accuracy on the SELECT clause, and $\mathbf { A c c _ { w h e r e } }$ indicates the accuracy to generate the WHERE clause.
|
| 243 |
+
|
| 244 |
+
# 4.2 EVALUATION ON THE WIKISQL TASK
|
| 245 |
+
|
| 246 |
+
Table 1 presents the results for query synthesis accuracy of our approach and Seq2SQL. We first observe that our re-implementation of Seq2SQL yields better result than that reported in (Zhong et al., 2017). Since we do not have access to the source code of the original implementation, we cannot analyze the reason.
|
| 247 |
+
|
| 248 |
+
We observe that SQLNet outperforms Seq2SQL (even our version) by a large margin. On the logical-form metric, SQLNet outperforms our re-implementation of Seq2SQL by 10.7 points on the dev set and by 10.5 points on the test set. These advancements are even larger to reach 13.7 points and 13.0 points respectively if we compare with the original results reported in (Zhong et al., 2017). Note that even if we eliminate the false negatives of Seq2SQL by considering the querymatch accuracy, the gap is only closed by 1 point, and still remains as large as 9.7 points. We attribute the reason to that Seq2SQL employs a sequence-to-sequence model and thus suffers the “order-matters” problem, while our sequence-to-set-based approach can entirely solve this issue.
|
| 249 |
+
|
| 250 |
+
On the execution accuracy metric, SQLNet is better than $\mathrm { S e q } 2 \mathrm { S Q L }$ (reported in Zhong et al. (2017)) by 9.0 points and 8.6 points respectively on the dev and test sets. Although they are still large, the advancements are not as large as those on the query-match metric. This phenomenon shows that, for some of the queries that Seq2SQL cannot predict exactly correct, (e.g., maybe due to the lack of one constraint in the WHERE clause), the execution results are still correct. We want to highlight that the execution accuracy is sensitive to the data in the table, which contributes to the difference between query-match accuracy and execution accuracy.
|
| 251 |
+
|
| 252 |
+
# 4.3 A BREAK-DOWN ANALYSIS ON THE WIKISQL TASK
|
| 253 |
+
|
| 254 |
+
We would like to further analyze SQLNet’s and Seq2SQL’s performance on different sub-tasks as well as the improvement provided by different techniques in SQLNet. The results are presented in Table 2.
|
| 255 |
+
|
| 256 |
+
We observe that on the SELECT clause prediction, the accuracy is around $9 0 \%$ . This shows that the SELECT clause is less challenging to predict than the WHERE clause. SQLNet’s accuracy on the
|
| 257 |
+
|
| 258 |
+
# Question:
|
| 259 |
+
|
| 260 |
+
When twente came in third place and ajax was the winner what are the seasons?
|
| 261 |
+
|
| 262 |
+
SQL:
|
| 263 |
+
SELECT season
|
| 264 |
+
WHERE winner $=$ ajax AND third place $=$ twente
|
| 265 |
+
|
| 266 |
+
SELECT column prediction better than Seq2SQL. We attribute this improvement to the reason that SQLNet employs column attention.
|
| 267 |
+
|
| 268 |
+
We observe that the biggest advantage of SQLNet over Seq2SQL is on the WHERE clause’s prediction accuracy. The improvement on the WHERE clause prediction is around 11 points to 12 points. Notice that the order of the constraints generated by Seq2SQL matters. To eliminate this effect, we evaluate the accuracy based on a canonical order, i.e., Seq2SQL (ours, C-order), in a similar way as the query-match accuracy. This metric will improve Seq2SQL’s accuracy by 1 point, which obeys our observation on the overall query-match accuracy of Seq2SQL. However, we still observe that the SQLNet can outperform $\mathrm { S e q } 2 \mathrm { S Q L }$ by a large margin. From the break-down analysis, we can observe that the improvement from the usage of a sequence-to-set architecture is the largest to achieve around 6 points. The column attention further improves a sequence-to-set only model by 3 points, while allowing training word embedding gives another 2 points’ improvement.
|
| 269 |
+
|
| 270 |
+
Note that the improvement on the SELECT prediction is around 2 points. The improvements from two clauses add up to the 13 points to 14 points improvements in total.
|
| 271 |
+
|
| 272 |
+
# 4.4 THE “ORDER-MATTERS” EFFECT
|
| 273 |
+
|
| 274 |
+
In this section, we document the “order-matters” phenomenon in the WikiSQL dataset, and study its impact on the Seq2SQL model. In WikiSQL, the constraints in the WHERE clause are listed in the ascending order of the column ID. We say a description-query pair is disordered if a clause in the description corresponding to a larger column ID appears earlier than another one corresponding to a smaller column ID. One example is shown in Figure 3. Note, in this example, a user is also likely to ask “When ajax was the winner and twente came in third place what are the seasons?”. Thus, no matter how we assign column IDs, one of the two descriptions is disordered with respect to the SQL query.
|
| 275 |
+
|
| 276 |
+
We calculate the number of disordered pairs as follows. In fact, for each clause col op val, since val must appear in the description as a substring, we can locate its first appearance in the description. By examining these locations for different constraints matches the order of the column IDs, we can examine whether a the description-query pair is disordered or not. From the WikiSQL dataset, we can calculate the percentage of disordered pairs as follows:
|
| 277 |
+
|
| 278 |
+
<table><tr><td>% of disordered samples</td><td>training 6.2%</td><td>dev 6.5%</td><td>test 6.2%</td></tr><tr><td>% of non-disordered samples (≥ 2 columns)</td><td>23.7%</td><td>24.4%</td><td>24.7%</td></tr><tr><td>% of samples with zero or one column</td><td>70.1%</td><td>69.1%</td><td>69.1%</td></tr></table>
|
| 279 |
+
|
| 280 |
+
In this table, we split all samples into three parts: (1) disordered samples; (2) non-disordered samples involving at least 2 columns in the WHERE clause; and (3) the rest containing at most one column in the WHERE clause. In fact, the second third does not cause the “order-matters” problem at all. Although we observe non-disordered samples are majority, the disordered ones constitute a nonnegligible portion, i.e., $> 6 \%$ . Therefore, this portion may likely cause the “order-matters” problem.
|
| 281 |
+
|
| 282 |
+
We then examine whether the disordered samples indeed contributes to the “order-matters” phenomenon, and whether our proposed seq2set technique helps to mitigate the issue. To do this, we evaluate the effectiveness of Seq2SQL (our implementation) and the SQLNet (using sequence-toset only) on the three parts. We train both models on the entire dataset. Then we split the dev set and the test set into three parts in the same way as above.
|
| 283 |
+
|
| 284 |
+
We report the results in Table 3. We observe that our sequence-to-set technique improves the performance on the disordered subset by a larger margin (i.e., $9 . 5 \%$ to $1 6 . 5 \%$ ) on both the dev set and the test set than on the other two parts. This observation clearly shows that our sequence-to-set technique can mitigate the “order-matters” effect.
|
| 285 |
+
|
| 286 |
+
Table 3: Evaluation results on disordered set versus non-disordered set. $\mathrm { A c c } _ { \mathrm { q m } }$ , and $\operatorname { A c c } _ { \mathrm { e x } }$ indicate the query-match and the execution accuracy respectively.
|
| 287 |
+
|
| 288 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1></td><td rowspan=1 colspan=2>disordered</td><td rowspan=1 colspan=2>non-disordered (≥ 2 col)</td><td rowspan=1 colspan=2>rest</td></tr><tr><td rowspan=1 colspan=1>Accqm</td><td rowspan=1 colspan=1>Accex</td><td rowspan=1 colspan=1>AcCqm</td><td rowspan=1 colspan=1>Accex</td><td rowspan=1 colspan=1>Accqm</td><td rowspan=1 colspan=1>Accex</td></tr><tr><td rowspan=3 colspan=1>dev</td><td rowspan=1 colspan=1>Seq2SQL (ours)</td><td rowspan=1 colspan=1>19.5%</td><td rowspan=1 colspan=1>33.6%</td><td rowspan=1 colspan=1>35.9%</td><td rowspan=1 colspan=1>53.9%</td><td rowspan=1 colspan=1>62.8%</td><td rowspan=1 colspan=1>67.5%</td></tr><tr><td rowspan=1 colspan=1>SQLNet (Seq2set)</td><td rowspan=1 colspan=1>33.1%</td><td rowspan=1 colspan=1>43.1%</td><td rowspan=1 colspan=1>44.0%</td><td rowspan=1 colspan=1>55.4%</td><td rowspan=1 colspan=1>65.3%</td><td rowspan=1 colspan=1>69.7%</td></tr><tr><td rowspan=1 colspan=1>Improvement</td><td rowspan=1 colspan=1>13.6%</td><td rowspan=1 colspan=1>9.5%</td><td rowspan=1 colspan=1>8.1%</td><td rowspan=1 colspan=1>1.5%</td><td rowspan=1 colspan=1>2.5%</td><td rowspan=1 colspan=1>2.2%</td></tr><tr><td rowspan=3 colspan=1>test</td><td rowspan=1 colspan=1>Seq2SQL (ours)</td><td rowspan=1 colspan=1>18.8%</td><td rowspan=1 colspan=1>34.5%</td><td rowspan=1 colspan=1>33.4%</td><td rowspan=1 colspan=1>50.1%</td><td rowspan=1 colspan=1>61.1%</td><td rowspan=1 colspan=1>66.5%</td></tr><tr><td rowspan=1 colspan=1>SQLNet (Seq2set)</td><td rowspan=1 colspan=1>35.3%</td><td rowspan=1 colspan=1>46.2%</td><td rowspan=1 colspan=1>43.1%</td><td rowspan=1 colspan=1>54.0%</td><td rowspan=1 colspan=1>63.7%</td><td rowspan=1 colspan=1>68.9%</td></tr><tr><td rowspan=1 colspan=1> Improvement</td><td rowspan=1 colspan=1>16.5%</td><td rowspan=1 colspan=1>11.7%</td><td rowspan=1 colspan=1>9.7%</td><td rowspan=1 colspan=1>3.9%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>2.4%</td></tr></table>
|
| 289 |
+
|
| 290 |
+
Table 4: Overall result on the WikiSQL variant dataset.
|
| 291 |
+
|
| 292 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>dev</td><td rowspan=1 colspan=3>test</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Acc1f</td><td rowspan=1 colspan=1>Accqm</td><td rowspan=1 colspan=1>Accex</td><td rowspan=1 colspan=1>Acc1f</td><td rowspan=1 colspan=1>Accqm</td><td rowspan=1 colspan=1>Accex</td></tr><tr><td rowspan=1 colspan=1>Seq2SQL (ours)</td><td rowspan=1 colspan=1>54.5%</td><td rowspan=1 colspan=1>55.6%</td><td rowspan=1 colspan=1>63.8%</td><td rowspan=1 colspan=1>54.8%</td><td rowspan=1 colspan=1>55.6%</td><td rowspan=1 colspan=1>63.9%</td></tr><tr><td rowspan=1 colspan=1>SQLNet</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>65.5%</td><td rowspan=1 colspan=1>71.5%</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>64.4%</td><td rowspan=1 colspan=1>70.3%</td></tr></table>
|
| 293 |
+
|
| 294 |
+
On the other hand, we observe that on the non-disordered set with two or more columns in the WHERE constraints, the $\mathsf { A c c } _ { \mathrm { q m } }$ scores are also boosted by more than 8 percentage points. We also attribute this to the “order-matters” effect: the disordered samples in the training set actually hurt the performance of a Seq2SQL model on the non-disordered samples; and since the sequence-toset technique does not suffer from the “order-matters” issue at all, its advantage over $\mathrm { S e q } 2 \mathrm { S Q L }$ is large. The $\operatorname { A c c } _ { \mathrm { e x } }$ is relatively small, i.e., $1 . 5 \%$ to $3 . 9 \%$ . We observe that for some descriptions the Seq2SQL model actually generates some queries with fewer constraints in the WHERE clause than the ground truth; but since both queries produce the same results, they are counted as correct when computing $\operatorname { A c c } _ { \mathrm { e x } }$ .
|
| 295 |
+
|
| 296 |
+
Finally, on all samples with one or less constraints in the WHERE clause, the improvements of SQLNet over Seq2SQL is not significant. Such samples do not have the “order-matters” issue at all. We attribute the improvement to the fact that SQLNet generates the constraint following the sketch, which leverages more grammar information than a sequence-to-sequence model used in Seq2SQL. This result provides further evidence to show that the improvement on the other two parts are mainly related to the “order-matters” issue.
|
| 297 |
+
|
| 298 |
+
# 4.5 EVALUATION ON A VARIANT OF THE WIKISQL TASK
|
| 299 |
+
|
| 300 |
+
In practice, a machine learning model is frequently retrained periodically to reflect the latest dataset. Therefore, it is more often that when a model is trained, the table in the test set is already seen in the training set. The original WikiSQL dataset is split so that the training, dev, and test sets are disjoint in their sets of tables, and thus it does not approximate this application scenario very well.
|
| 301 |
+
|
| 302 |
+
To better understand different model’s performance in this alternative application scenario, we reshuffle the data, so that all the tables appear at least once in the training set.
|
| 303 |
+
|
| 304 |
+
On this new dataset, we evaluate both SQLNet and $\mathrm { S e q } 2 \mathrm { S Q L }$ , and the results are presented in Table 4. We observe that all metrics of both approaches are improved. We attribute this to that all tables in the test set are observed by the models in the training set. This observation meets our expectation. The improvement of SQLNet over Seq2SQL (our implementation) remains the same across different metrics.
|
| 305 |
+
|
| 306 |
+
# 5 RELATED WORK
|
| 307 |
+
|
| 308 |
+
The study of translating natural language into SQL queries has a long history (Warren & Pereira, 1982; Androutsopoulos et al., 1993; 1995; Popescu et al., 2003; 2004; Li et al., 2006; Giordani & Moschitti, 2012; Zhang & Sun, 2013; Li & Jagadish, 2014; Wang et al., 2017). Earlier work focuses on specific databases and requires additional customization to generalize to each new database.
|
| 309 |
+
|
| 310 |
+
Recent work considers mitigating this issue by incorporating users’ guidance (Li & Jagadish, 2014; Iyer et al., 2017). In contrast, SQLNet does not rely on human in the loop. Another direction incorporates the data in the table as an additional input (Pasupat & Liang, 2015; Mou et al., 2016). We argue that such an approach may suffer scalability and privacy issues when handling large scale user databases.
|
| 311 |
+
|
| 312 |
+
SQLizer (Yaghmazadeh et al., 2017) is a related work handling the same application scenario. SQLizer is also a sketch-based approach so that it is not restricted to any specific database. Different from our work, SQLizer (Yaghmazadeh et al., 2017) relies on an off-the-shelf semantic parser (Berant et al., 2013; Manning et al., 2014) to translate a natural language question into a sketch, and then employs programming language techniques such as type-directed sketch completion and automatic repairing to iteratively refine the sketch into the final query. Since SQLizer does not require database-specific training and its code is not available, it is unclear how SQLizer will perform on the WikiSQL task. In this work, we focus on neural network approaches to handle the NL2SQL tasks.
|
| 313 |
+
|
| 314 |
+
Seq2SQL (Zhong et al., 2017) is the most relevant work and achieves the state-of-the-art on the WikiSQL task. We use Seq2SQL as the baseline in our work. Our SQLNet approach enjoys all the benefits of Seq2SQL, such as generalizability to an unseen schema and overcoming the inefficiency of a sequence-to-sequence model. Our approach improves over Seq2SQL in that by proposing a sequence-to-set-based approach, we eliminate the sequence-to-sequence structure when the order does not matter, so that we do not require reinforcement learning at all. These techniques enable SQLNet to outperform Seq2SQL by 9 points to 13 points.
|
| 315 |
+
|
| 316 |
+
The problem to parse a natural language to SQL queries can be considered as a special instance to the more generic semantic parsing problem. There have been many works considering parsing a natural language description into a logical form (Zelle & Mooney, 1996; Wong & Mooney, 2007; Zettlemoyer & Collins, 2007; 2012; Artzi & Zettlemoyer, 2011; 2013; Cai & Yates, 2013; Reddy et al., 2014; Liang et al., 2011; Quirk et al., 2015; Chen et al., 2016). Although they are not handling the SQL generation problem, we observe that most of them need to be fine-tuned to the specific domain of interest, and may not generalize.
|
| 317 |
+
|
| 318 |
+
Dong & Lapata (2016) provide a generic approach, i.e., a sequence-to-tree model, to handle the semantic parsing problem, which yields the state-of-the-art results on many tasks. This approach is evaluated in (Zhong et al., 2017), and it has been demonstrated less effective than the Seq2SQL approach. Thus, we do not include it in our comparison.
|
| 319 |
+
|
| 320 |
+
Some earlier approaches Wong & Mooney (2007) propose using Synchronous Context-Free Grammars (SCFG) to construct a semantic parser. However, a production rule in a SCFG is essentially a translation rule from the source language (e.g., English) to the target (e.g., SQL). Therefore, such an approach requires much more efforts to construct a SCFG and is less robust. On the other hand, our sketch is only a subset of SQL, which is simple to derive from the full SQL specification. Thus, our approach is more practical than previous SCFG-based approaches. Some recent works Rabinovich et al. (2017) propose incorporation grammar information during program generation. These approaches are similar to the Seq2SQL baseline that we have compared in our paper. In fact, we consider Seq2SQL as a special version of Rabinovich et al. (2017) that incorporates pointer networks for WHERE clause generation and reinforcement learning to boost the performance.
|
| 321 |
+
|
| 322 |
+
# 6 CONCLUSION
|
| 323 |
+
|
| 324 |
+
In this paper, we propose an approach, SQLNet, to handle an NL2SQL task. We observe that all existing approaches employing a sequence-to-sequence model suffer from the “order-matters” problem when the order does not matter. Previous attempts using reinforcement learning to solve this issue bring only a small improvement, e.g., by around 2 points. In our work, SQLNet fundamentally solves the “order-matters” problem by employing a sequence-to-set model to generate SQL queries when order does not matter. We further introduce the column attention mechanism, which can further boost a sequence-to-set model’s performance. In total, we observe that our SQLNet system can improve over the prior art, i.e., Seq2SQL, by a large margin ranging from 9 points to 13 points on various metrics. This demonstrates that our approach can effectively solve the “order-matters” problem, and shed new light on novel solutions to structural generation problems when order does not matter.
|
| 325 |
+
|
| 326 |
+
# REFERENCES
|
| 327 |
+
|
| 328 |
+
Rajeev Alur, Rastislav Bodik, Garvit Juniwal, Milo MK Martin, Mukund Raghothaman, Sanjit A Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. Syntaxguided synthesis. In Formal Methods in Computer-Aided Design (FMCAD), 2013, pp. 1–8. IEEE, 2013.
|
| 329 |
+
|
| 330 |
+
I Androutsopoulos, G Ritchie, and P Thanisch. Masque/sql an efficient and portable natural language query interface for relational databases. Database technical paper, Department of AI, University of Edinburgh, 1993.
|
| 331 |
+
|
| 332 |
+
Ion Androutsopoulos, Graeme D Ritchie, and Peter Thanisch. Natural language interfaces to databases–an introduction. Natural language engineering, 1(1):29–81, 1995.
|
| 333 |
+
|
| 334 |
+
Yoav Artzi and Luke Zettlemoyer. Bootstrapping semantic parsers from conversations. In Proceedings of the conference on empirical methods in natural language processing, pp. 421–432. Association for Computational Linguistics, 2011.
|
| 335 |
+
|
| 336 |
+
Yoav Artzi and Luke Zettlemoyer. Weakly supervised learning of semantic parsers for mapping instructions to actions. Transactions of the Association for Computational Linguistics, 1:49–62, 2013. ISSN 2307-387X.
|
| 337 |
+
|
| 338 |
+
Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. In EMNLP, 2013.
|
| 339 |
+
|
| 340 |
+
James Bornholt, Emina Torlak, Dan Grossman, and Luis Ceze. Optimizing synthesis with metasketches. 51(1):775–788, 2016.
|
| 341 |
+
|
| 342 |
+
Qingqing Cai and Alexander Yates. Large-scale semantic parsing via schema matching and lexicon extension. In ACL, 2013.
|
| 343 |
+
|
| 344 |
+
Xinyun Chen, Chang Liu, Richard Shin, Dawn Song, and Mingcheng Chen. Latent attention for if-then program synthesis. arXiv preprint arXiv:1611.01867, 2016.
|
| 345 |
+
|
| 346 |
+
Deborah A Dahl, Madeleine Bates, Michael Brown, William Fisher, Kate Hunicke-Smith, David Pallett, Christine Pao, Alexander Rudnicky, and Elizabeth Shriberg. Expanding the scope of the atis task: The atis-3 corpus. In Proceedings of the workshop on Human Language Technology, pp. 43–48. Association for Computational Linguistics, 1994.
|
| 347 |
+
|
| 348 |
+
Li Dong and Mirella Lapata. Language to logical form with neural attention. In ACL, 2016.
|
| 349 |
+
|
| 350 |
+
Facebook. Pytorch, 2017. URL http://pytorch.org/.
|
| 351 |
+
|
| 352 |
+
Alessandra Giordani and Alessandro Moschitti. Translating questions to SQL queries with generative parsers discriminatively reranked. In COLING, 2012.
|
| 353 |
+
|
| 354 |
+
Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. arXiv preprint arXiv:1704.05526, 2017.
|
| 355 |
+
|
| 356 |
+
Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke Zettlemoyer. Learning a neural semantic parser from user feedback. CoRR, abs/1704.08760, 2017.
|
| 357 |
+
|
| 358 |
+
Noah Johnson, Joseph P Near, and Dawn Song. Practical differential privacy for sql queries using elastic sensitivity. arXiv preprint arXiv:1706.09479, 2017.
|
| 359 |
+
|
| 360 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
|
| 361 |
+
Fei Li and HV Jagadish. Constructing an interactive natural language interface for relational databases. Proceedings of the VLDB Endowment, 8(1):73–84, 2014.
|
| 362 |
+
Yunyao Li, Huahai Yang, and HV Jagadish. Constructing a generic natural language interface for an xml database. In EDBT, volume 3896, pp. 737–754. Springer, 2006.
|
| 363 |
+
Percy Liang, Michael I Jordan, and Dan Klein. Learning dependency-based compositional semantics. pp. 590–599, 2011.
|
| 364 |
+
Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pp. 55–60, 2014.
|
| 365 |
+
Lili Mou, Zhengdong Lu, Hang Li, and Zhi Jin. Coupling distributed and symbolic execution for natural language queries. arXiv preprint arXiv:1612.02741, 2016.
|
| 366 |
+
Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. In ICLR, 2017.
|
| 367 |
+
Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. CoRR, abs/1508.00305, 2015.
|
| 368 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 369 |
+
Ana-Maria Popescu, Oren Etzioni, and Henry Kautz. Towards a theory of natural language interfaces to databases. In Proceedings of the 8th international conference on Intelligent user interfaces, pp. 149–157. ACM, 2003.
|
| 370 |
+
Ana-Maria Popescu, Alex Armanasu, Oren Etzioni, David Ko, and Alexander Yates. Modern natural language interfaces to databases: Composing statistical parsing with semantic tractability. In Proceedings of the 20th international conference on Computational Linguistics, pp. 141. Association for Computational Linguistics, 2004.
|
| 371 |
+
P. J. Price. Evaluation of spoken language systems: the atis domain. In Speech and Natural Language: Proceedings of a Workshop Held at Hidden Valley, Pennsylvania, June 24-27,1990, pp. 91–95, 1990.
|
| 372 |
+
Chris Quirk, Raymond J Mooney, and Michel Galley. Language to code: Learning semantic parsers for if-this-then-that recipes. In ACL (1), pp. 878–888, 2015.
|
| 373 |
+
Maxim Rabinovich, Mitchell Stern, and Dan Klein. Abstract syntax networks for code generation and semantic parsing. arXiv preprint arXiv:1704.07535, 2017.
|
| 374 |
+
Siva Reddy, Mirella Lapata, and Mark Steedman. Large-scale semantic parsing without questionanswer pairs. Transactions of the Association for Computational Linguistics, 2:377–392, 2014.
|
| 375 |
+
Armando Solar-Lezama, Liviu Tancau, Rastislav Bodik, Sanjit Seshia, and Vijay Saraswat. Combinatorial sketching for finite programs. ACM SIGOPS Operating Systems Review, 40(5):404–415, 2006.
|
| 376 |
+
Huan Sun, Hao Ma, Xiaodong He, Wen-tau Yih, Yu Su, and Xifeng Yan. Table cell search for question answering. In Proceedings of the 25th International Conference on World Wide Web, pp. 771–782. International World Wide Web Conferences Steering Committee, 2016.
|
| 377 |
+
Lappoon R. Tang and Raymond J. Mooney. Using multiple clause constructors in inductive logic programming for semantic parsing. In Proceedings of the 12th European Conference on Machine Learning, pp. 466–477, Freiburg, Germany, 2001.
|
| 378 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015a.
|
| 379 |
+
|
| 380 |
+
Oriol Vinyals, Łukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In NIPS, 2015b.
|
| 381 |
+
|
| 382 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In ICLR, 2016.
|
| 383 |
+
|
| 384 |
+
Chenglong Wang, Alvin Cheung, and Rastislav Bodik. Synthesizing highly expressive sql queries from input-output examples. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 452–466. ACM, 2017.
|
| 385 |
+
|
| 386 |
+
David HD Warren and Fernando CN Pereira. An efficient easily adaptable system for interpreting natural language queries. Computational Linguistics, 8(3-4):110–122, 1982.
|
| 387 |
+
|
| 388 |
+
Yuk Wah Wong and Raymond Mooney. Learning synchronous grammars for semantic parsing with lambda calculus. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics, pp. 960–967, Prague, Czech Republic, June 2007. Association for Computational Linguistics.
|
| 389 |
+
|
| 390 |
+
Navid Yaghmazadeh, Yuepeng Wang, Isil Dillig, and Thomas Dillig. Sqlizer: Query synthesis from natural language. In OOPSLA, 2017.
|
| 391 |
+
|
| 392 |
+
Zichao Yang, Phil Blunsom, Chris Dyer, and Wang Ling. Reference-aware language models. arXiv preprint arXiv:1611.01628, 2016.
|
| 393 |
+
|
| 394 |
+
Pengcheng Yin, Zhengdong Lu, Hang Li, and Ben Kao. Neural enquirer: Learning to query tables with natural language. arXiv preprint arXiv:1512.00965, 2015.
|
| 395 |
+
|
| 396 |
+
John M Zelle and Raymond J Mooney. Learning to parse database queries using inductive logic programming. In Proceedings of the national conference on artificial intelligence, pp. 1050– 1055, 1996.
|
| 397 |
+
|
| 398 |
+
Luke S. Zettlemoyer and Michael Collins. Online learning of relaxed ccg grammars for parsing to logical form. In In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL-2007, pp. 678–687, 2007.
|
| 399 |
+
|
| 400 |
+
Luke S Zettlemoyer and Michael Collins. Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. arXiv preprint arXiv:1207.1420, 2012.
|
| 401 |
+
|
| 402 |
+
Sai Zhang and Yuyin Sun. Automatically synthesizing sql queries from input-output examples. In Automated Software Engineering (ASE), 2013 IEEE/ACM 28th International Conference on, pp. 224–234. IEEE, 2013.
|
| 403 |
+
|
| 404 |
+
Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103, 2017.
|
md/train/SkxgnnNFvH/SkxgnnNFvH.md
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Poly-encoders: architectures and pre-training STRATEGIES FOR FAST AND ACCURATE MULTI-SENTENCE SCORING
|
| 2 |
+
|
| 3 |
+
Samuel Humeau∗, Kurt Shuster∗, Marie-Anne Lachaux, Jason Weston Facebook AI Research {samuelhumeau,kshuster,malachaux,jase}@fb.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
The use of deep pre-trained transformers has led to remarkable progress in a number of applications (Devlin et al., 2019). For tasks that make pairwise comparisons between sequences, matching a given input with a corresponding label, two approaches are common: Cross-encoders performing full self-attention over the pair and $B i$ -encoders encoding the pair separately. The former often performs better, but is too slow for practical use. In this work, we develop a new transformer architecture, the Poly-encoder, that learns global rather than token level self-attention features. We perform a detailed comparison of all three approaches, including what pre-training and fine-tuning strategies work best. We show our models achieve state-of-the-art results on four tasks; that Poly-encoders are faster than Cross-encoders and more accurate than Bi-encoders; and that the best results are obtained by pre-training on large datasets similar to the downstream tasks.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Recently, substantial improvements to state-of-the-art benchmarks on a variety of language understanding tasks have been achieved through the use of deep pre-trained language models followed by fine-tuning (Devlin et al., 2019). In this work we explore improvements to this approach for the class of tasks that require multi-sentence scoring: given an input context, score a set of candidate labels, a setup common in retrieval and dialogue tasks, amongst others. Performance in such tasks has to be measured via two axes: prediction quality and prediction speed, as scoring many candidates can be prohibitively slow.
|
| 12 |
+
|
| 13 |
+
The current state-of-the-art focuses on using BERT models for pre-training (Devlin et al., 2019), which employ large text corpora on general subjects: Wikipedia and the Toronto Books Corpus (Zhu et al., 2015). Two classes of fine-tuned architecture are typically built on top: Bi-encoders and Cross-encoders. Cross-encoders (Wolf et al., 2019; Vig & Ramea, 2019), which perform full (cross) self-attention over a given input and label candidate, tend to attain much higher accuracies than their counterparts, Bi-encoders (Mazare et al., 2018; Dinan et al., 2019), which perform self-attention ´ over the input and candidate label separately and combine them at the end for a final representation. As the representations are separate, Bi-encoders are able to cache the encoded candidates, and reuse these representations for each input resulting in fast prediction times. Cross-encoders must recompute the encoding for each input and label; as a result, they are prohibitively slow at test time.
|
| 14 |
+
|
| 15 |
+
In this work, we provide novel contributions that improve both the quality and speed axes over the current state-of-the-art. We introduce the Poly-encoder, an architecture with an additional learnt attention mechanism that represents more global features from which to perform self-attention, resulting in performance gains over Bi-encoders and large speed gains over Cross-Encoders. To pre-train our architectures, we show that choosing abundant data more similar to our downstream task also brings significant gains over BERT pre-training. This is true across all different architecture choices and downstream tasks we try.
|
| 16 |
+
|
| 17 |
+
We conduct experiments comparing the new approaches, in addition to analysis of what works best for various setups of existing methods, on four existing datasets in the domains of dialogue and information retrieval (IR), with pre-training strategies based on Reddit (Mazare et al., 2018) compared ´ to Wikipedia/Toronto Books (i.e., BERT). We obtain a new state-of-the-art on all four datasets with our best architectures and pre-training strategies, as well as providing practical implementations for real-time use. Our code and models will be released open-source.
|
| 18 |
+
|
| 19 |
+
# 2 Related Work
|
| 20 |
+
|
| 21 |
+
The task of scoring candidate labels given an input context is a classical problem in machine learning. While multi-class classification is a special case, the more general task involves candidates as structured objects rather than discrete classes; in this work we consider the inputs and the candidate labels to be sequences of text.
|
| 22 |
+
|
| 23 |
+
There is a broad class of models that map the input and a candidate label separately into a common feature space wherein typically a dot product, cosine or (parameterized) non-linearity is used to measure their similarity. We refer to these models as $B i$ -encoders. Such methods include vector space models (Salton et al., 1975), LSI (Deerwester et al., 1990), supervised embeddings (Bai et al., 2009; Wu et al., 2018) and classical siamese networks (Bromley et al., 1994). For the next utterance prediction tasks we consider in this work, several Bi-encoder neural approaches have been considered, in particular Memory Networks (Zhang et al., 2018a) and Transformer Memory networks (Dinan et al., 2019) as well as LSTMs (Lowe et al., 2015) and CNNs (Kadlec et al., 2015) which encode input and candidate label separately. A major advantage of Bi-encoder methods is their ability to cache the representations of a large, fixed candidate set. Since the candidate encodings are independent of the input, Bi-encoders are very efficient during evaluation.
|
| 24 |
+
|
| 25 |
+
Researchers have also studied a more rich class of models we refer to as Cross-encoders, which make no assumptions on the similarity scoring function between input and candidate label. Instead, the concatenation of the input and a candidate serve as a new input to a nonlinear function that scores their match based on any dependencies it wants. This has been explored with Sequential Matching Network CNN-based architectures (Wu et al., 2017), Deep Matching Networks (Yang et al., 2018), Gated Self-Attention (Zhang et al., 2018b), and most recently transformers (Wolf et al., 2019; Vig & Ramea, 2019; Urbanek et al., 2019). For the latter, concatenating the two sequences of text results in applying self-attention at every layer. This yields rich interactions between the input context and the candidate, as every word in the candidate label can attend to every word in the input context, and vice-versa. Urbanek et al. (2019) employed pre-trained BERT models, and fine-tuned both Bi- and Cross-encoders, explicitly comparing them on dialogue and action tasks, and finding that Cross-encoders perform better. However, the performance gains come at a steep computational cost. Cross-encoder representations are much slower to compute, rendering some applications infeasible.
|
| 26 |
+
|
| 27 |
+
# 3 Tasks
|
| 28 |
+
|
| 29 |
+
We consider the tasks of sentence selection in dialogue and article search in IR. The former is a task extensively studied and recently featured in two competitions: the Neurips ConvAI2 competition (Dinan et al., 2020), and the DSTC7 challenge, Track 1 (Yoshino et al., 2019; Jonathan K. Kummerfeld & Lasecki, 2018; Chulaka Gunasekara & Lasecki, 2019). We compare on those two tasks and in addition, we also test on the popular Ubuntu V2 corpus (Lowe et al., 2015). For IR, we use the Wikipedia Article Search task of Wu et al. (2018).
|
| 30 |
+
|
| 31 |
+
The ConvAI2 task is based on the Persona-Chat dataset (Zhang et al., 2018a) which involves dialogues between pairs of speakers. Each speaker is given a persona, which is a few sentences that describe a character they will imitate, e.g. “I love romantic movies”, and is instructed to get to know the other. Models should then condition their chosen response on the dialogue history and the lines of persona. As an automatic metric in the competition, for each response, the model has to pick the correct annotated utterance from a set of 20 choices, where the remaining 19 were other randomly chosen utterances from the evaluation set. Note that in a final system however, one would retrieve from the entire training set of over 100k utterances, but this is avoided for speed reasons in common evaluation setups. The best performing competitor out of 23 entrants in this task achieved $8 0 . 7 \%$ accuracy on the test set utilizing a pre-trained Transformer fine-tuned for this task (Wolf et al., 2019).
|
| 32 |
+
|
| 33 |
+
The DSTC7 challenge (Track 1) consists of conversations extracted from Ubuntu chat logs, where one partner receives technical support for various Ubuntu-related problems from the other. The best performing competitor (with 20 entrants in Track 1) in this task achieved $6 4 . 5 \%$ R@1 (Chen & Wang, 2019). Ubuntu V2 is a similar but larger popular corpus, created before the competition (Lowe et al., 2015); we report results for this dataset as well, as there are many existing results on it.
|
| 34 |
+
|
| 35 |
+
Finally, we evaluate on Wikipedia Article Search (Wu et al., 2018). Using the 2016-12-21 dump of English Wikipedia ( $\mathbf { \sigma } \sim 5 \mathbf { M }$ articles), the task is given a sentence from an article as a search query, find the article it came from. Evaluation ranks the true article (minus the sentence) against 10,000 other articles using retrieval metrics. This mimics a web search like scenario where one would like to search for the most relevant articles (web documents). The best reported method is the learningto-rank embedding model, StarSpace, which outperforms fastText, SVMs, and other baselines.
|
| 36 |
+
|
| 37 |
+
We summarize all four datasets and their statistics in Table 1.
|
| 38 |
+
|
| 39 |
+
Table 1: Datasets used in this paper.
|
| 40 |
+
|
| 41 |
+
<table><tr><td></td><td>ConvAI2</td><td>DTSC7</td><td>Ubuntu V2</td><td>WikiArticleSearch</td></tr><tr><td>Train Ex.</td><td>131,438</td><td>100,000</td><td>1,000.000</td><td>5,035,182</td></tr><tr><td>Valid Ex.</td><td>7,801</td><td>10,000</td><td>19,560</td><td>9,921</td></tr><tr><td>Test Ex.</td><td>6634</td><td>5.000</td><td>18,920</td><td>9,925</td></tr><tr><td>Eval Cands per Ex.</td><td>20</td><td>100</td><td>10</td><td>10,001</td></tr></table>
|
| 42 |
+
|
| 43 |
+
# 4 Methods
|
| 44 |
+
|
| 45 |
+
In this section we describe the various models and methods that we explored.
|
| 46 |
+
|
| 47 |
+
# 4.1 Transformers and Pre-training Strategies
|
| 48 |
+
|
| 49 |
+
Transformers Our Bi-, Cross-, and Poly-encoders, described in sections 4.2, 4.3 and 4.4 respectively, are based on large pre-trained transformer models with the same architecture and dimension as BERT-base (Devlin et al., 2019), which has 12 layers, 12 attention heads, and a hidden size of 768. As well as considering the BERT pre-trained weights, we also explore our own pre-training schemes. Specifically, we pre-train two more transformers from scratch using the exact same architecture as BERT-base. One uses a similar training setup as in BERT-base, training on 150 million of examples of [INPUT, LABEL] extracted from Wikipedia and the Toronto Books Corpus, while the other is trained on 174 million examples of [INPUT, LABEL] extracted from the online platform Reddit (Mazare et al., 2018), which is a dataset more adapted to dialogue. The former is performed ´ to verify that reproducing a BERT-like setting gives us the same results as reported previously, while the latter tests whether pre-training on data more similar to the downstream tasks of interest helps. For training both new setups we used XLM (Lample & Conneau, 2019).
|
| 50 |
+
|
| 51 |
+
Input Representation Our pre-training input is the concatenation of input and label [INPUT,LABEL], where both are surrounded with the special token [S], following Lample & Conneau (2019). When pre-training on Reddit, the input is the context, and the label is the next utterance. When pre-training on Wikipedia and Toronto Books, as in Devlin et al. (2019), the input is one sentence and the label the next sentence in the text. Each input token is represented as the sum of three embeddings: the token embedding, the position (in the sequence) embedding and the segment embedding. Segments for input tokens are 0, and for label tokens are 1.
|
| 52 |
+
|
| 53 |
+
Pre-training Procedure Our pre-training strategy involves training with a masked language model (MLM) task identical to the one in Devlin et al. (2019). In the pre-training on Wikipedia and Toronto Books we add a next-sentence prediction task identical to BERT training. In the pre-training on Reddit, we add a next-utterance prediction task, which is slightly different from the previous one as an utterance can be composed of several sentences. During training $50 \%$ of the time the candidate is the actual next sentence/utterance and $50 \%$ of the time it is a sentence/utterance randomly taken from the dataset. We alternate between batches of the MLM task and the next-sentence/nextutterance prediction task. Like in Lample & Conneau (2019) we use the Adam optimizer with learning rate of 2e-4, $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 8$ , no L2 weight decay, linear learning rate warmup, and β . β .inverse square root decay of the learning rate. We use a dropout probability of 0.1 on all layers, and a batch of 32000 tokens composed of concatenations [INPUT, LABEL] with similar lengths. We train the model on 32 GPUs for 14 days.
|
| 54 |
+
|
| 55 |
+
Fine-tuning After pre-training, one can then fine-tune for the multi-sentence selection task of choice, in our case one of the four tasks from Section 3. We consider three architectures with which we fine-tune the transformer: the Bi-encoder, Cross-encoder and newly proposed Poly-encoder.
|
| 56 |
+
|
| 57 |
+
# 4.2 Bi-encoder
|
| 58 |
+
|
| 59 |
+
In a Bi-encoder, both the input context and the candidate label are encoded into vectors:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
y _ { c t x t } = r e d ( T _ { 1 } ( c t x t ) ) \qquad y _ { c a n d } = r e d ( T _ { 2 } ( c a n d ) )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $T _ { 1 }$ and $T _ { 2 }$ are two transformers that have been pre-trained following the procedure described in 4.1; they initially start with the same weights, but are allowed to update separately during finetuning. $T ( x ) = h _ { 1 } , . . , h _ { N }$ is the output of a transformer $\mathrm { T }$ and $r e d ( \cdot )$ is a function that reduces that , ..,sequence of vectors into one vector. As the input and the label are encoded separately, segment tokens are 0 for both. To resemble what is done during our pre-training, both the input and label are surrounded by the special token [S] and therefore $h _ { 1 }$ corresponds to [S].
|
| 66 |
+
|
| 67 |
+
We considered three ways of reducing the output into one representation via red(·): choose the first output of the transformer (corresponding to the special token [S]), compute the average over all outputs or the average over the first $m \leq N$ outputs. We compare them in Table 7 in the Appendix. We use the first output of the transformer in our experiments as it gives slightly better results.
|
| 68 |
+
|
| 69 |
+
Scoring The score of a candidate candi is given by the dot-product $s ( c t x t , c a n d _ { i } ) = y _ { c t x t } \cdot y _ { c a n d _ { i } } ,$ . The network is trained to minimize a cross-entropy loss in which the logits are $y _ { c t x t } \cdot y _ { c a n d _ { 1 } } , . . . , y _ { c t x t } \cdot y _ { c a n d _ { n } }$ , where cand $_ 1$ , ...,is the correct label and the others are chosen from the training set. Similar to Mazare´ et al. (2018), during training we consider the other labels in the batch as negatives. This allows for much faster training, as we can reuse the embeddings computed for each candidate, and also use a larger batch size; e.g., in our experiments on ConvAI2, we were able to use batches of 512 elements.
|
| 70 |
+
|
| 71 |
+
Inference speed In the setting of retrieval over known candidates, a Bi-encoder allows for the precomputation of the embeddings of all possible candidates of the system. After the context embedding $y _ { c t x t }$ is computed, the only operation remaining is a dot product between $y _ { c t x t }$ and every candidate embedding, which can scale to millions of candidates on a modern GPU, and potentially billions using nearest-neighbor libraries such as FAISS (Johnson et al., 2019).
|
| 72 |
+
|
| 73 |
+
# 4.3 Cross-encoder
|
| 74 |
+
|
| 75 |
+
The Cross-encoder allows for rich interactions between the input context and candidate label, as they are jointly encoded to obtain a final representation. Similar to the procedure in pre-training, the context and candidate are surrounded by the special token [S] and concatenated into a single vector, which is encoded using one transformer. We consider the first output of the transformer as the context-candidate embedding:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
y _ { c t x t , c a n d } = h _ { 1 } = f i r s t ( T ( c t x t , c a n d ) )
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where f irst is the function that takes the first vector of the sequence of vectors produced by the transformer. By using a single transformer, the Cross-encoder is able to perform self-attention between the context and candidate, resulting in a richer extraction mechanism than the Bi-encoder. As the candidate label can attend to the input context during the layers of the transformer, the Crossencoder can produce a candidate-sensitive input representation, which the Bi-encoder cannot. For example, this allows it to select useful input features per candidate.
|
| 82 |
+
|
| 83 |
+
Scoring To score one candidate, a linear layer $W$ is applied to the embedding $y _ { c t x t , c a n d }$ to reduce it from a vector to a scalar:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
s ( c t x t , c a n d _ { i } ) = y _ { c t x t , c a n d _ { i } } W
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Similarly to what is done for the Bi-encoder, the network is trained to minimize a cross entropy loss where the logits are $s ( c t x t , c a n d _ { 1 } ) , . . . , s ( c t x t , c a n d _ { n } )$ , where can $l _ { 1 }$ is the correct candidate and the others are negatives taken from the training set. Unlike in the Bi-encoder, we cannot recycle the other labels of the batch as negatives, so we use external negatives provided in the training set. The Cross-encoder uses much more memory than the Bi-encoder, resulting in a much smaller batch size.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 1: Diagrams of the three model architectures we consider. (a) The Bi-encoder encodes the context and candidate separately, allowing for the caching of candidate representations during inference. (b) The Cross-encoder jointly encodes the context and candidate in a single transformer, yielding richer interactions between context and candidate at the cost of slower computation. (c) The Poly-encoder combines the strengths of the Bi-encoder and Cross-encoder by both allowing for caching of candidate representations and adding a final attention mechanism between global features of the input and a given candidate to give richer interactions before computing a final score.
|
| 93 |
+
|
| 94 |
+
Inference speed Unfortunately, the Cross-encoder does not allow for precomputation of the candidate embeddings. At inference time, every candidate must be concatenated with the input context and must go through a forward pass of the entire model. Thus, this method cannot scale to a large amount of candidates. We discuss this bottleneck further in Section 5.4.
|
| 95 |
+
|
| 96 |
+
# 4.4 Poly-encoder
|
| 97 |
+
|
| 98 |
+
The Poly-encoder architecture aims to get the best of both worlds from the Bi- and Cross-encoder. A given candidate label is represented by one vector as in the Bi-encoder, which allows for caching candidates for fast inference time, while the input context is jointly encoded with the candidate, as in the Cross-encoder, allowing the extraction of more information.
|
| 99 |
+
|
| 100 |
+
The Poly-encoder uses two separate transformers for the context and label like a Bi-encoder, and the candidate is encoded into a single vector $y _ { c a n d _ { i } }$ . As such, the Poly-encoder method can be implemented using a precomputed cache of encoded responses. However, the input context, which is typically much longer than a candidate, is represented with $m$ vectors $( y _ { c t x t } ^ { 1 } . . . y _ { c t x t } ^ { m } )$ instead of just one as in the Bi-encoder, where $m$ ..will influence the inference speed. To obtain these $m$ global features that represent the input, we learn $m$ context codes $( c _ { 1 } , . . . , c _ { m } )$ , where $c _ { i }$ extracts representation $y _ { c t x t } ^ { i }$ , ...,by attending over all the outputs of the previous layer. That is, we obtain $y _ { c t x t } ^ { i }$ using:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
y _ { c t x t } ^ { i } = \sum _ { j } w _ { j } ^ { c _ { i } } h _ { j } ~ \mathrm { w h e r e } ~ ( w _ { 1 } ^ { c _ { i } } , . . , w _ { N } ^ { c _ { i } } ) = \mathrm { s o f t m a x } ( c _ { i } \cdot h _ { 1 } , . . , c _ { i } \cdot h _ { N } )
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
The $m$ context codes are randomly initialized, and learnt during finetuning.
|
| 107 |
+
|
| 108 |
+
Finally, given our $m$ global context features, we attend over them using $y _ { c a n d _ { i } }$ as the query:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
y _ { c t x t } = \sum _ { i } w _ { i } y _ { c t x t } ^ { i } ~ \mathrm { w h e r e } ~ ( w _ { 1 } , . . , w _ { m } ) = \mathrm { s o f t m a x } ( y _ { c a n d _ { i } } \cdot y _ { c t x t } ^ { 1 } , . . , y _ { c a n d _ { i } } \cdot y _ { c t x t } ^ { m } )
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
The final score for that candidate label is then $y _ { c t x t } \cdot y _ { c a n d _ { i } }$ as in a Bi-encoder. As $m < N$ , where $N$ is <the number of tokens, and the context-candidate attention is only performed at the top layer, this is far faster than the Cross-encoder’s full self-attention.
|
| 115 |
+
|
| 116 |
+
# 5 Experiments
|
| 117 |
+
|
| 118 |
+
We perform a variety of experiments to test our model architectures and training strategies over four tasks. For metrics, we measure Recall $@ k$ where each test example has $C$ possible candidates to select from, abbreviated to $\operatorname { R @ } k / C$ , as well as mean reciprocal rank (MRR).
|
| 119 |
+
|
| 120 |
+
# 5.1 Bi-encoders and Cross-encoders
|
| 121 |
+
|
| 122 |
+
We first investigate fine-tuning the Bi- and Cross-encoder architectures initialized with the weights provided by Devlin et al. (2019), studying the choice of other hyperparameters (we explore our own pre-training schemes in section 5.3). In the case of the Bi-encoder, we can use a large number of negatives by considering the other batch elements as negative training samples, avoiding recomputation of their embeddings. On 8 Nvidia Volta v100 GPUs and using half-precision operations (i.e. float16 operations), we can reach batches of 512 elements on ConvAI2. Table 2 shows that in this setting, we obtain higher performance with a larger batch size, i.e. more negatives, where 511 negatives yields the best results. For the other tasks, we keep the batch size at 256, as the longer sequences in those datasets uses more memory. The Cross-encoder is more computationally intensive, as the embeddings for the (context, candidate) pair must be recomputed each time. We thus limit its batch size to 16 and provide negatives random samples from the training set. For DSTC7 and Ubuntu V2, we choose 15 such negatives; For ConvAI2, the dataset provides 19 negatives.
|
| 123 |
+
|
| 124 |
+
<table><tr><td rowspan=1 colspan=1>Negatives</td><td rowspan=1 colspan=1>31</td><td rowspan=1 colspan=1>63</td><td rowspan=1 colspan=1>127</td><td rowspan=1 colspan=1>255</td><td rowspan=1 colspan=1>511</td></tr><tr><td rowspan=1 colspan=1>R@1/20</td><td rowspan=1 colspan=1>81.0</td><td rowspan=1 colspan=1>81.7</td><td rowspan=1 colspan=1>82.3</td><td rowspan=1 colspan=1>83.0</td><td rowspan=1 colspan=1>83.3</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Table 2: Validation performance on ConvAI2 after fine-tuning a Bi-encoder pre-trained with BERT, averaged over 5 runs. The batch size is the number of training negatives $^ { + 1 }$ as we use the other elements of the batch as negatives during training.
|
| 127 |
+
|
| 128 |
+
The above results are reported with Bi-encoder aggregation based on the first output. Choosing the average over all outputs instead is very similar but slightly worse (83.1, averaged over 5 runs). We also tried to add further non-linearities instead of the inner product of the two representations, but could not obtain improved results over the simpler architecture (results not shown).
|
| 129 |
+
|
| 130 |
+
We tried two optimizers: Adam (Kingma & Ba, 2015) with weight decay of 0.01 (as recommended by (Devlin et al., 2019)) and Adamax (Kingma & Ba, 2015) without weight decay; based on validation set performance, we choose to fine-tune with Adam when using the BERT weights. The learning rate is initialized to 5e-5 with a warmup of 100 iterations for Bi- and Poly-encoders, and 1000 iterations for the Cross-encoder. The learning rate decays by a factor of 0.4 upon plateau of the loss evaluated on the valid set every half epoch. In Table 3 we show validation performance when fine-tuning various layers of the weights provided by (Devlin et al., 2019), using Adam with decay optimizer. Fine-tuning the entire network is important, with the exception of the word embeddings.
|
| 131 |
+
|
| 132 |
+
With the setups described above, we fine-tune the Bi- and Cross-encoders on the datasets, and report the results in Table 4. On the first three tasks, our Bi-encoders and Cross-encoders outperform the best existing approaches in the literature when we fine-tune from BERT weights. E.g., the Biencoder reaches $8 1 . 7 \%$ $\mathbb { R } \ @ 1$ on ConvAI2 and $6 6 . 8 \%$ $\mathbb { R } \ @ 1$ on DSTC7, while the Cross-encoder achieves higher scores of $8 4 . 8 \%$ $\mathbb { R } \ @ 1$ on ConvAI2 and $6 7 . 4 \%$ $\mathbf { R } \ @ 1$ on DSTC7. Overall, Crossencoders outperform all previous approaches on the three dialogue tasks, including our Bi-encoders (as expected). We do not report fine-tuning of BERT for Wikipedia IR as we cannot guarantee the test set is not part of the pre-training for that dataset. In addition, Cross-encoders are also too slow to evaluate on the evaluation setup of that task, which has 10k candidates.
|
| 133 |
+
|
| 134 |
+
Table 3: Validation performance $( \mathbf { R } @ 1 / 2 0 )$ on ConvAI2 using pre-trained weights of BERT-base with different parameters fine-tuned. Average over 5 runs (Bi-encoders) or 3 runs (Cross-encoders).
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Fine-tuned parameters</td><td>Bi-encoder</td><td>Cross-encoder</td></tr><tr><td>Top layer</td><td>74.2</td><td>80.6</td></tr><tr><td>Top 4 layers</td><td>82.0</td><td>86.3</td></tr><tr><td>All but Embeddings</td><td>83.3</td><td>87.3</td></tr><tr><td>Every Layer</td><td>83.0</td><td>86.6</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 4: Test performance of Bi-, Poly- and Cross-encoders on our selected tasks.
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>ConvAI2</td><td rowspan=1 colspan=2>DSTC7</td><td rowspan=1 colspan=2>Ubuntu v2</td><td rowspan=1 colspan=1>Wikipedia IR</td></tr><tr><td rowspan=1 colspan=1>split</td><td rowspan=1 colspan=1>test</td><td rowspan=1 colspan=2>test</td><td rowspan=1 colspan=2>test</td><td rowspan=1 colspan=1>test</td></tr><tr><td rowspan=1 colspan=1>metric</td><td rowspan=1 colspan=1>R@1/20</td><td rowspan=1 colspan=1>R@1/100</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>R@1/10</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>R@1/10001</td></tr><tr><td rowspan=1 colspan=1>(Wolf et al., 2019)</td><td rowspan=1 colspan=1>80.7</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><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>(Gu et al., 2018)</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>60.8</td><td rowspan=1 colspan=1>69.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>(Chen &Wang,2019)</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>64.5</td><td rowspan=1 colspan=1>73.5</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>(Yoon et al.,2018)</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>65.2</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>(Dong& Huang,2018)</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>75.9</td><td rowspan=1 colspan=1>84.8</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>(Wu et al.,2018)</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>56.8</td></tr><tr><td rowspan=1 colspan=1>pre-trainedBERTweigh</td><td rowspan=1 colspan=1>tsfrom (De</td><td rowspan=1 colspan=1>linetal.,20</td><td rowspan=1 colspan=1>19)-Toron</td><td rowspan=1 colspan=1>oBooks+</td><td rowspan=1 colspan=1>Vikipedia</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>81.7 ± 0.2</td><td rowspan=1 colspan=1>66.8 ± 0.7</td><td rowspan=1 colspan=1>74.6 ± 0.5</td><td rowspan=1 colspan=1>80.6 ± 0.4</td><td rowspan=1 colspan=1>88.0±0.3</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder16</td><td rowspan=1 colspan=1>83.2 ± 0.1</td><td rowspan=1 colspan=1>67.8 ± 0.3</td><td rowspan=1 colspan=1>75.1 ± 0.2</td><td rowspan=1 colspan=1>81.2 ± 0.2</td><td rowspan=1 colspan=1>88.3± 0.1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 64</td><td rowspan=1 colspan=1>83.7 ± 0.2</td><td rowspan=1 colspan=1>67.0 ± 0.9</td><td rowspan=1 colspan=1>74.7 ± 0.6</td><td rowspan=1 colspan=1>81.3 ± 0.2</td><td rowspan=1 colspan=1>88.4 ± 0.1</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 360</td><td rowspan=1 colspan=1>83.7 ± 0.2</td><td rowspan=1 colspan=1>68.9± 0.4</td><td rowspan=1 colspan=1>76.2 ± 0.2</td><td rowspan=1 colspan=1>80.9± 0.0</td><td rowspan=1 colspan=1>88.1 ± 0.1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>84.8 ± 0.3</td><td rowspan=1 colspan=1>67.4 ± 0.7</td><td rowspan=1 colspan=1>75.6 ± 0.4</td><td rowspan=1 colspan=1>82.8 ± 0.3</td><td rowspan=1 colspan=1>89.4 ± 0.2</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Our pre-training on Toronto Books + </td><td rowspan=1 colspan=1>ntoBooks-</td><td rowspan=1 colspan=1>Wikipedia</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>Bi-encoder</td><td rowspan=1 colspan=1>82.0 ± 0.1</td><td rowspan=1 colspan=1>64.5 ± 0.5</td><td rowspan=1 colspan=1>72.6 ± 0.4</td><td rowspan=1 colspan=1>80.8± 0.5</td><td rowspan=1 colspan=1>88.2 ± 0.4</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 16</td><td rowspan=1 colspan=1>82.7 ± 0.1</td><td rowspan=1 colspan=1>65.3 ± 0.9</td><td rowspan=1 colspan=1>73.2 ± 0.7</td><td rowspan=1 colspan=1>83.4± 0.2</td><td rowspan=1 colspan=1>89.9 ± 0.1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 64</td><td rowspan=1 colspan=1>83.3 ± 0.1</td><td rowspan=1 colspan=1>65.8 ± 0.7</td><td rowspan=1 colspan=1>73.5 ± 0.5</td><td rowspan=1 colspan=1>83.4± 0.1</td><td rowspan=1 colspan=1>89.9± 0.0</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 360</td><td rowspan=1 colspan=1>83.8 ± 0.1</td><td rowspan=1 colspan=1>65.8 ± 0.7</td><td rowspan=1 colspan=1>73.6 ± 0.6</td><td rowspan=1 colspan=1>83.7±0.0</td><td rowspan=1 colspan=1>90.1 ± 0.0</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>84.9 ± 0.3</td><td rowspan=1 colspan=1>65.3 ± 1.0</td><td rowspan=1 colspan=1>73.8± 0.6</td><td rowspan=1 colspan=1>83.1 ± 0.7</td><td rowspan=1 colspan=1>89.7 ± 0.5</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Our pre-training on Reddit</td><td rowspan=1 colspan=1>dit</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><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>84.8± 0.1</td><td rowspan=1 colspan=1>70.9 ± 0.5</td><td rowspan=1 colspan=1>78.1 ± 0.3</td><td rowspan=1 colspan=1>83.6± 0.7</td><td rowspan=1 colspan=1>90.1 ± 0.4</td><td rowspan=1 colspan=1>71.0</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 16</td><td rowspan=1 colspan=1>86.3 ± 0.3</td><td rowspan=1 colspan=1>71.6 ± 0.6</td><td rowspan=1 colspan=1>78.4± 0.4</td><td rowspan=1 colspan=1>86.0± 0.1</td><td rowspan=1 colspan=1>91.5 ± 0.1</td><td rowspan=1 colspan=1>71.5</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 64</td><td rowspan=1 colspan=1>86.5± 0.2</td><td rowspan=1 colspan=1>71.2 ± 0.8</td><td rowspan=1 colspan=1>78.2 ± 0.7</td><td rowspan=1 colspan=1>85.9± 0.1</td><td rowspan=1 colspan=1>91.5 ± 0.1</td><td rowspan=1 colspan=1>71.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 360</td><td rowspan=1 colspan=1>86.8 ± 0.1</td><td rowspan=1 colspan=1>71.4 ± 1.0</td><td rowspan=1 colspan=1>78.3 ± 0.7</td><td rowspan=1 colspan=1>85.9 ± 0.1</td><td rowspan=1 colspan=1>91.5 ± 0.0</td><td rowspan=1 colspan=1>71.8</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>87.9 ± 0.2</td><td rowspan=1 colspan=1>71.7 ± 0.3</td><td rowspan=1 colspan=1>79.0 ± 0.2</td><td rowspan=1 colspan=1>86.5 ± 0.1</td><td rowspan=1 colspan=1>91.9 ± 0.0</td><td rowspan=1 colspan=1>-</td></tr></table>
|
| 141 |
+
|
| 142 |
+
# 5.2 Poly-encoders
|
| 143 |
+
|
| 144 |
+
We train the Poly-encoder using the same batch sizes and optimizer choices as in the Bi-encoder experiments. Results are reported in Table 4 for various values of $m$ context vectors.
|
| 145 |
+
|
| 146 |
+
The Poly-encoder outperforms the Bi-encoder on all the tasks, with more codes generally yielding larger improvements. Our recommendation is thus to use as large a code size as compute time allows (see Sec. 5.4). On DSTC7, the Poly-encoder architecture with BERT pretraining reaches $6 8 . 9 \%$ R1 with 360 intermediate context codes; this actually outperforms the Cross-encoder result $( 6 7 . 4 \% )$ and is noticeably better than our Bi-encoder result $( 6 6 . 8 \% )$ . Similar conclusions are found on Ubuntu V2 and ConvAI2, although in the latter Cross-encoders give slightly better results.
|
| 147 |
+
|
| 148 |
+
We note that since reporting our results, the authors of Li et al. (2019) have conducted a human evaluation study on ConvAI2, in which our Poly-encoder architecture outperformed all other models compared against, both generative and retrieval based, including the winners of the competition.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4>Scoring time (ms)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>CPU</td><td rowspan=1 colspan=2>GPU</td></tr><tr><td rowspan=1 colspan=1>Candidates</td><td rowspan=1 colspan=1>1k</td><td rowspan=1 colspan=1>100k</td><td rowspan=1 colspan=1>1k</td><td rowspan=1 colspan=1>100k</td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>115</td><td rowspan=1 colspan=1>160</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>22</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 16</td><td rowspan=1 colspan=1>122</td><td rowspan=1 colspan=1>678</td><td rowspan=1 colspan=1>18</td><td rowspan=1 colspan=1>38</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 64</td><td rowspan=1 colspan=1>126</td><td rowspan=1 colspan=1>692</td><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>46</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 360</td><td rowspan=1 colspan=1>160</td><td rowspan=1 colspan=1>837</td><td rowspan=1 colspan=1>57</td><td rowspan=1 colspan=1>88</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>21.7k</td><td rowspan=1 colspan=1>2.2M*</td><td rowspan=1 colspan=1>2.6k</td><td rowspan=1 colspan=1>266k*</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 5: Average time in milliseconds to predict the next dialogue utterance from $C$ possible candidates on ConvAI2. \* are inferred.
|
| 153 |
+
|
| 154 |
+
# 5.3 Domain-specific Pre-training
|
| 155 |
+
|
| 156 |
+
We fine-tune our Reddit-pre-trained transformer on all four tasks; we additionally fine-tune a transformer that was pre-trained on the same datasets as BERT, specifically Toronto Books $^ +$ Wikipedia. When using our pre-trained weights, we use the Adamax optimizer and optimize all the layers of the transformer including the embeddings. As we do not use weight decay, the weights of the final layer are much larger than those in the final layer of BERT; to avoid saturation of the attention layer in the Poly-encoder, we re-scaled the last linear layer so that the standard deviation of its output matched that of BERT, which we found necessary to achieve good results. We report results of fine-tuning with our pre-trained weights in Table 4. We show that pre-training on Reddit gives further state-ofthe-art performance over our previous results with BERT, a finding that we see for all three dialogue tasks, and all three architectures.
|
| 157 |
+
|
| 158 |
+
The results obtained with fine-tuning on our own transformers pre-trained on Toronto Books $^ +$ Wikipedia are very similar to those obtained with the original BERT weights, indicating that the choice of dataset used to pre-train the models impacts the final results, not some other detail in our training. Indeed, as the two settings pre-train with datasets of similar size, we can conclude that choosing a pre-training task (e.g. dialogue data) that is similar to the downstream tasks of interest (e.g. dialogue) is a likely explanation for these performance gains, in line with previous results showing multi-tasking with similar tasks is more useful than with dissimilar ones (Caruana, 1997).
|
| 159 |
+
|
| 160 |
+
# 5.4 Inference Speed
|
| 161 |
+
|
| 162 |
+
An important motivation for the Poly-encoder architecture is to achieve better results than the Biencoder while also performing at a reasonable speed. Though the Cross-encoder generally yields strong results, it is prohibitively slow. We perform speed experiments to determine the trade-off of improved performance from the Poly-encoder. Specifically, we predict the next utterance for 100 dialogue examples in the ConvAI2 validation set, where the model scores $C$ candidates (in this case, chosen from the training set). We perform these experiments on both CPU-only and GPU setups. CPU computations were run on an 80 core Intel Xeon processor CPU E5-2698. GPU computations were run on a single Nvidia Quadro GP100 using cuda 10.0 and cudnn 7.4.
|
| 163 |
+
|
| 164 |
+
We show the average time per example for each architecture in Table 5. The difference in timing between the Bi-encoder and the Poly-encoder architectures is rather minimal when there are only 1000 candidates for the model to consider. The difference is more pronounced when considering 100k candidates, a more realistic setup, as we see a 5-6x slowdown for the Poly-encoder variants. Nevertheless, both models are still tractable. The Cross-encoder, however, is 2 orders of magnitude slower than the Bi-encoder and Poly-encoder, rendering it intractable for real-time inference, e.g. when interacting with a dialogue agent, or retrieving from a large set of documents. Thus, Polyencoders, given their desirable performance and speed trade-off, are the preferred method.
|
| 165 |
+
|
| 166 |
+
We additionally report training times in the Appendix, Table 6. Poly-encoders also have the benefit of being $3 { - } 4 \mathbf { x }$ faster to train than Cross-encoders (and are similar in training time to Bi-encoders).
|
| 167 |
+
|
| 168 |
+
# 6 Conclusion
|
| 169 |
+
|
| 170 |
+
In this paper we present new architectures and pre-training strategies for deep bidirectional transformers in candidate selection tasks. We introduced the Poly-encoder method, which provides a mechanism for attending over the context using the label candidate, while maintaining the ability to precompute each candidate’s representation, which allows for fast real-time inference in a production setup, giving an improved trade off between accuracy and speed. We provided an experimental analysis of those trade-offs for Bi-, Poly- and Cross-encoders, showing that Poly-encoders are more accurate than Bi-encoders, while being far faster than Cross-encoders, which are impractical for real-time use. In terms of training these architectures, we showed that pre-training strategies more closely related to the downstream task bring strong improvements. In particular, pre-training from scratch on Reddit allows us to outperform the results we obtain with BERT, a result that holds for all three model architectures and all three dialogue datasets we tried. However, the methods introduced in this work are not specific to dialogue, and can be used for any task where one is scoring a set of candidates, which we showed for an information retrieval task as well.
|
| 171 |
+
|
| 172 |
+
# References
|
| 173 |
+
|
| 174 |
+
Bing Bai, Jason Weston, David Grangier, Ronan Collobert, Kunihiko Sadamasa, Yanjun Qi, Olivier Chapelle, and Kilian Weinberger. Supervised semantic indexing. In Proceedings of the 18th ACM conference on Information and knowledge management, pp. 187–196. ACM, 2009.
|
| 175 |
+
|
| 176 |
+
Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Sackinger, and Roopak Shah. Signature verifi- ¨ cation using a” siamese” time delay neural network. In Advances in neural information processing systems, pp. 737–744, 1994.
|
| 177 |
+
|
| 178 |
+
Rich Caruana. Multitask learning. Machine learning, 28(1):41–75, 1997.
|
| 179 |
+
|
| 180 |
+
Qian Chen and Wen Wang. Sequential attention-based network for noetic end-to-end response selection. CoRR, abs/1901.02609, 2019. URL http://arxiv.org/abs/1901.02609.
|
| 181 |
+
|
| 182 |
+
Lazaros Polymenakos Chulaka Gunasekara, Jonathan K. Kummerfeld and Walter S. Lasecki. Dstc7 task 1: Noetic end-to-end response selection. In 7th Edition of the Dialog System Technology Challenges at AAAI 2019, January 2019. URL http://workshop.colips.org/dstc7/ papers/dstc7_task1_final_report.pdf.
|
| 183 |
+
|
| 184 |
+
Scott Deerwester, Susan T Dumais, George W Furnas, Thomas K Landauer, and Richard Harshman. Indexing by latent semantic analysis. Journal of the American society for information science, 41 (6):391–407, 1990.
|
| 185 |
+
|
| 186 |
+
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), pp. 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423.
|
| 187 |
+
|
| 188 |
+
Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. Wizard of Wikipedia: Knowledge-powered conversational agents. In Proceedings of the International Conference on Learning Representations (ICLR), 2019.
|
| 189 |
+
|
| 190 |
+
Emily Dinan, Varvara Logacheva, Valentin Malykh, Alexander Miller, Kurt Shuster, Jack Urbanek, Douwe Kiela, Arthur Szlam, Iulian Serban, Ryan Lowe, Shrimai Prabhumoye, Alan W. Black, Alexander Rudnicky, Jason Williams, Joelle Pineau, Mikhail Burtsev, and Jason Weston. The second conversational intelligence challenge (convai2). In Sergio Escalera and Ralf Herbrich (eds.), The NeurIPS ’18 Competition, pp. 187–208, Cham, 2020. Springer International Publishing. ISBN 978-3-030-29135-8.
|
| 191 |
+
|
| 192 |
+
Jianxiong Dong and Jim Huang. Enhance word representation for out-of-vocabulary on ubuntu dialogue corpus. CoRR, abs/1802.02614, 2018. URL http://arxiv.org/abs/1802.02614.
|
| 193 |
+
|
| 194 |
+
Jia-Chen Gu, Zhen-Hua Ling, Yu-Ping Ruan, and Quan Liu. Building sequential inference models for end-to-end response selection. CoRR, abs/1812.00686, 2018. URL http://arxiv.org/ abs/1812.00686.
|
| 195 |
+
|
| 196 |
+
J. Johnson, M. Douze, and H. Jgou. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, pp. 1–1, 2019. ISSN 2372-2096. doi: 10.1109/TBDATA.2019.2921572.
|
| 197 |
+
|
| 198 |
+
Joseph Peper Vignesh Athreya Chulaka Gunasekara Jatin Ganhotra Siva Sankalp Patel Lazaros Polymenakos Jonathan K. Kummerfeld, Sai R. Gouravajhala and Walter S. Lasecki. Analyzing assumptions in conversation disentanglement research through the lens of a new dataset and model. ArXiv e-prints, October 2018. URL https://arxiv.org/pdf/1810.11118.pdf.
|
| 199 |
+
|
| 200 |
+
Rudolf Kadlec, Martin Schmid, and Jan Kleindienst. Improved deep learning baselines for ubuntu corpus dialogs. CoRR, abs/1510.03753, 2015. URL http://arxiv.org/abs/1510.03753.
|
| 201 |
+
|
| 202 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 203 |
+
|
| 204 |
+
Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 205 |
+
|
| 206 |
+
Margaret Li, Jason Weston, and Stephen Roller. Acute-eval: Improved dialogue evaluation with optimized questions and multi-turn comparisons. arXiv preprint arXiv:1909.03087, 2019.
|
| 207 |
+
|
| 208 |
+
Ryan Lowe, Nissan Pow, Iulian Serban, and Joelle Pineau. The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. In SIGDIAL Conference, 2015.
|
| 209 |
+
|
| 210 |
+
Pierre-Emmanuel Mazare, Samuel Humeau, Martin Raison, and Antoine Bordes. Training millions ´ of personalized dialogue agents. In EMNLP, 2018.
|
| 211 |
+
|
| 212 |
+
Gerard Salton, Anita Wong, and Chung-Shu Yang. A vector space model for automatic indexing. Communications of the ACM, 18(11):613–620, 1975.
|
| 213 |
+
|
| 214 |
+
Jack Urbanek, Angela Fan, Siddharth Karamcheti, Saachi Jain, Samuel Humeau, Emily Dinan, Tim Rocktaschel, Douwe Kiela, Arthur Szlam, and Jason Weston. Learning to speak and act in a ¨ fantasy text adventure game. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 673–683, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1062.
|
| 215 |
+
|
| 216 |
+
Jesse Vig and Kalai Ramea. Comparison of transfer-learning approaches for response selection in multi-turn conversations. Workshop on DSTC7, 2019.
|
| 217 |
+
|
| 218 |
+
Thomas Wolf, Victor Sanh, Julien Chaumond, and Clement Delangue. Transfertransfo: A transfer learning approach for neural network based conversational agents. arXiv preprint arXiv:1901.08149, 2019.
|
| 219 |
+
|
| 220 |
+
Ledell Yu Wu, Adam Fisch, Sumit Chopra, Keith Adams, Antoine Bordes, and Jason Weston. Starspace: Embed all the things! In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 221 |
+
|
| 222 |
+
Yu Ping Wu, Wei Chung Wu, Chen Xing, Ming Zhou, and Zhoujun Li. Sequential matching network: A new architecture for multi-turn response selection in retrieval-based chatbots. In ACL, 2017.
|
| 223 |
+
|
| 224 |
+
Liu Yang, Minghui Qiu, Chen Qu, Jiafeng Guo, Yongfeng Zhang, W Bruce Croft, Jun Huang, and Haiqing Chen. Response ranking with deep matching networks and external knowledge in information-seeking conversation systems. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pp. 245–254. ACM, 2018.
|
| 225 |
+
|
| 226 |
+
Seunghyun Yoon, Joongbo Shin, and Kyomin Jung. Learning to rank question-answer pairs using hierarchical recurrent encoder with latent topic clustering. 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. 1575–1584, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1142.
|
| 227 |
+
|
| 228 |
+
Koichiro Yoshino, Chiori Hori, Julien Perez, Luis Fernando D’Haro, Lazaros Polymenakos, R. Chulaka Gunasekara, Walter S. Lasecki, Jonathan K. Kummerfeld, Michel Galley, Chris Brockett, Jianfeng Gao, William B. Dolan, Xiang Gao, Huda AlAmri, Tim K. Marks, Devi Parikh, and Dhruv Batra. Dialog system technology challenge 7. CoRR, abs/1901.03461, 2019.
|
| 229 |
+
|
| 230 |
+
Saizheng Zhang, Emily Dinan, Jack Urbanek, Arthur Szlam, Douwe Kiela, and Jason Weston. Personalizing dialogue agents: I have a dog, do you have pets too? In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, pp. 2204–2213, Melbourne, Australia, July 2018a. Association for Computational Linguistics.
|
| 231 |
+
|
| 232 |
+
Zhuosheng Zhang, Jiangtong Li, Pengfei Zhu, Hai Zhao, and Gongshen Liu. Modeling multi-turn conversation with deep utterance aggregation. In COLING, 2018b.
|
| 233 |
+
|
| 234 |
+
Yukun Zhu, Ryan Kiros, Richard S. Zemel, Ruslan R. Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. 2015 IEEE International Conference on Computer Vision (ICCV), pp. 19–27, 2015.
|
| 235 |
+
|
| 236 |
+
# A Training Time
|
| 237 |
+
|
| 238 |
+
We report the training time on 8 GPU Volta 100 for the 3 datasets considered and for 4 types of models in Table 6.
|
| 239 |
+
|
| 240 |
+
Table 6: Training time in hours.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>ConvAI2</td><td rowspan=1 colspan=1>DSTC7</td><td rowspan=1 colspan=1>UbuntuV2</td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>2.0</td><td rowspan=1 colspan=1>4.9</td><td rowspan=1 colspan=1>7.9</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 16</td><td rowspan=1 colspan=1>2.7</td><td rowspan=1 colspan=1>5.5</td><td rowspan=1 colspan=1>8.0</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder 64</td><td rowspan=1 colspan=1>2.8</td><td rowspan=1 colspan=1>5.7</td><td rowspan=1 colspan=1>8.0</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder64</td><td rowspan=1 colspan=1>9.4</td><td rowspan=1 colspan=1>13.5</td><td rowspan=1 colspan=1>39.9</td></tr></table>
|
| 243 |
+
|
| 244 |
+
# B Reduction layer in Bi-encoder
|
| 245 |
+
|
| 246 |
+
We provide in Table 7 the results obtained for different types of reductions on top of the Bi-encoder. Specifically we compare the Recall $@$ 1/20 on the ConvAI2 validation set when taking the first output of BERT, the average of the first 16 outputs, the average of the first 64 outputs and all of them except the first one ([S]).
|
| 247 |
+
|
| 248 |
+
<table><tr><td rowspan=1 colspan=1>Setup</td><td rowspan=1 colspan=1>ConvAI2 valid Recall@1/20</td></tr><tr><td rowspan=1 colspan=1>First output</td><td rowspan=1 colspan=1>83.3</td></tr><tr><td rowspan=1 colspan=1>Avg first 16 outputs</td><td rowspan=1 colspan=1>82.9</td></tr><tr><td rowspan=1 colspan=1>Avg first 64 outputs</td><td rowspan=1 colspan=1>82.7</td></tr><tr><td rowspan=1 colspan=1>Avg all outputs</td><td rowspan=1 colspan=1>83.1</td></tr></table>
|
| 249 |
+
|
| 250 |
+
Table 7: Bi-encoder results on the ConvAI2 valid set for different choices of function red(·).
|
| 251 |
+
|
| 252 |
+
# C Alternative Choices for Context Vectors
|
| 253 |
+
|
| 254 |
+
We considered a few other ways to derive the context vectors $( y _ { c t x t } ^ { 1 } , . . . , y _ { c t x t } ^ { m } )$ of the Poly-encoder from the output $( h _ { c t x t } ^ { 1 } , . . . , h _ { c t x t } ^ { N } )$ of the underlying transformer:
|
| 255 |
+
|
| 256 |
+
• Learn $m$ codes $( c _ { 1 } , . . . , c _ { m } )$ , where $c _ { i }$ extracts representation $y _ { c t x t } ^ { i }$ by attending over all the outputs $( h _ { c t x t } ^ { 1 } , . . . , h _ { c t x t } ^ { N } )$ , . This method is denoted “Poly-encoder (Learnt-codes)” or “Poly, ...,encoder (Learnt-m)”, and is the method described in section 4.4
|
| 257 |
+
• Consider the first $m$ outputs $( h _ { c t x t } ^ { 1 } , . . . , h _ { c t x t } ^ { m } )$ . This method is denoted “Poly-encoder (First $m$ , ..., outputs)” or “Poly-encoder (First-m)”. Note that when $N \ < \ m$ , only $m$ vectors are considered.
|
| 258 |
+
• Consider the last $m$ outputs.
|
| 259 |
+
• Consider the last $m$ outputs concatenated with the first one, $h _ { c t x t } ^ { 1 }$ which plays a particular role in BERT as it corresponds to the special token [S].
|
| 260 |
+
|
| 261 |
+
The performance of those four methods is evaluated on the validation set of Convai2 and DSTC7 and reported on Table 8. The first two methods are shown in Figure 2. We additionally provide the inference time for a given number of candidates coming from the Convai2 dataset on Table 9.
|
| 262 |
+
|
| 263 |
+
Table 8: Validation and test performance of Poly-encoder variants, with weights initialized from (Devlin et al., 2019). Scores are shown for ConvAI2 and DSTC 7 Track 1. Bold numbers indicate the highest performing variant within that number of codes.
|
| 264 |
+
|
| 265 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=3>ConvAI2</td><td rowspan=1 colspan=1>DS</td><td rowspan=1 colspan=1>TC7</td></tr><tr><td rowspan=1 colspan=1>split</td><td rowspan=1 colspan=2>dev</td><td rowspan=1 colspan=1>test</td><td rowspan=1 colspan=1>dev</td><td rowspan=1 colspan=1>test</td></tr><tr><td rowspan=1 colspan=1>metric</td><td rowspan=1 colspan=2>R@1/20</td><td rowspan=1 colspan=1>R@1/20</td><td rowspan=1 colspan=1>R@1/100</td><td rowspan=1 colspan=1>R@1/100</td></tr><tr><td rowspan=1 colspan=1>(Wolf et al., 2019)</td><td rowspan=1 colspan=2>82.1</td><td rowspan=1 colspan=1>80.7</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>(Chen & Wang,2019)</td><td rowspan=1 colspan=2>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>57.3</td><td rowspan=1 colspan=1>64.5</td></tr><tr><td rowspan=1 colspan=3>1 Attention Code</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>Learnt-codesFirst m outputsLast m outputsLast m outputs and hctxt</td><td rowspan=1 colspan=2>81.9 ± 0.383.2 ± 0.282.9 ± 0.1</td><td rowspan=1 colspan=1>81.0 ± 0.181.5 ± 0.181.0 ± 0.11</td><td rowspan=1 colspan=1>56.2 ± 0.156.4 ± 0.356.1 ± 0.41</td><td rowspan=1 colspan=1>66.9 ± 0.766.8 ± 0.767.2 ± 1.11</td></tr><tr><td rowspan=1 colspan=1>4 Attention Codes</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>Learnt-codesFirst m outputsLast m outputsLast m outputs and hctxt</td><td rowspan=2 colspan=2>83.8 ± 0.283.4 ± 0.282.8 ± 0.282.9 ± 0.1</td><td rowspan=2 colspan=1>82.2 ± 0.581.6 ± 0.181.3 ± 0.481.4 ± 0.2</td><td rowspan=1 colspan=1>56.5 ± 0.556.9 ± 0.556.0 ± 0.5</td><td rowspan=2 colspan=1>66.8 ± 0.767.2 ± 1.365.8 ± 0.566.1 ± 0.8</td></tr><tr><td rowspan=1 colspan=1>55.8 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>16 Attention Codes</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=3 colspan=1>Learnt-codesFirst m outputsLast m outputsLast m outputs and hctxt</td><td rowspan=3 colspan=2>84.4 ± 0.185.2 ± 0.183.9 ± 0.283.8 ± 0.3</td><td rowspan=2 colspan=1>83.2 ± 0.183.9 ± 0.282.0 ± 0.4</td><td rowspan=1 colspan=1>57.7 ± 0.2</td><td rowspan=1 colspan=1>67.8 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>56.1 ± 1.756.1 ± 0.3</td><td rowspan=1 colspan=1>66</td></tr><tr><td rowspan=1 colspan=1>81.7 ± 0.3</td><td rowspan=1 colspan=1>56.1 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>64 Attention Codes</td><td rowspan=1 colspan=2></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>Learnt-codesFirst m outputsLast m outputsLast m outputs and hetxt</td><td rowspan=1 colspan=2>84.9 ± 0.186.0 ± 0.284.9 ± 0.385.0 ± 0.2</td><td rowspan=1 colspan=1>83.7 ± 0.284.2 ± 0.282.9 ± 0.283.2 ± 0.2</td><td rowspan=1 colspan=1>58.3 ± 0.457.7 ± 0.657.0 ± 0.257.3 ± 0.3</td><td rowspan=1 colspan=1>67.0± 0.967.1 ± 0.166.5 ± 0.567.1 ± 0.5</td></tr><tr><td rowspan=1 colspan=1>360 Attention Codes</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=4 colspan=1>Learnt-codesFirst m outputsLast m outputsLast m outputs and hctxt</td><td rowspan=1 colspan=2>85.3 ± 0.3</td><td rowspan=1 colspan=1>83.7 ± 0.2</td><td rowspan=1 colspan=1>57.7 ± 0.3</td><td rowspan=1 colspan=1>68.9 ± 0.4</td></tr><tr><td rowspan=2 colspan=2>86.3 ± 0.186.3 ± 0.1</td><td rowspan=2 colspan=1>84.6 ± 0.384.7 ± 0.3</td><td rowspan=1 colspan=1>58.1 ± 0.4</td><td rowspan=2 colspan=1>66.8 ± 0.768.1 ± 0.5</td></tr><tr><td rowspan=2 colspan=2>86.3 ± 0.186.2 ± 0.3</td><td rowspan=1 colspan=1>86.3 ± 0.1</td><td rowspan=2 colspan=1>84.7 ± 0.384.5 ± 0.4</td><td rowspan=1 colspan=1>58.0 ± 0.4</td></tr><tr><td rowspan=1 colspan=1>58.3 ± 0.4</td><td rowspan=1 colspan=1>68.0 ± 0.8</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 9: Average time in milliseconds to predict the next dialogue utterance from $N$ possible candidates. \* are inferred.
|
| 268 |
+
|
| 269 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4>Scoring time (ms)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>CPU</td><td rowspan=1 colspan=2>GPU</td></tr><tr><td rowspan=1 colspan=1>Candidates</td><td rowspan=1 colspan=1>1k</td><td rowspan=1 colspan=1>100k</td><td rowspan=1 colspan=1>1k</td><td rowspan=1 colspan=1>100k</td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>115</td><td rowspan=1 colspan=1>160</td><td rowspan=1 colspan=1>19</td><td rowspan=1 colspan=1>22</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First m outputs) 16</td><td rowspan=1 colspan=1>119</td><td rowspan=1 colspan=1>551</td><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>37</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First m outputs) 64</td><td rowspan=1 colspan=1>124</td><td rowspan=1 colspan=1>570</td><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>39</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First m outputs) 360</td><td rowspan=1 colspan=1>120</td><td rowspan=1 colspan=1>619</td><td rowspan=1 colspan=1>17</td><td rowspan=1 colspan=1>45</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-codes) 16</td><td rowspan=1 colspan=1>122</td><td rowspan=1 colspan=1>678</td><td rowspan=1 colspan=1>18</td><td rowspan=1 colspan=1>38</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-codes) 64</td><td rowspan=1 colspan=1>126</td><td rowspan=1 colspan=1>692</td><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>46</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-codes) 360</td><td rowspan=1 colspan=1>160</td><td rowspan=1 colspan=1>837</td><td rowspan=1 colspan=1>57</td><td rowspan=1 colspan=1>88</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>21.7k</td><td rowspan=1 colspan=1>2.2M*</td><td rowspan=1 colspan=1>2.6k</td><td rowspan=1 colspan=1>266k*</td></tr></table>
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 2: (a) The Bi-encoder (b) The Cross-encoder (c) The Poly-encoder with first m vectors. (d) The Poly-encoder with $m$ learnt codes.
|
| 273 |
+
|
| 274 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=2>ConvAI2</td><td rowspan=1 colspan=4>DSTC7</td><td rowspan=1 colspan=4>Ubuntu v2</td></tr><tr><td rowspan=1 colspan=1>split</td><td rowspan=1 colspan=1>dev</td><td rowspan=1 colspan=1>test</td><td rowspan=1 colspan=1>dev</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>test</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>dev</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>test</td></tr><tr><td rowspan=1 colspan=1>metric</td><td rowspan=1 colspan=1>R@1/20</td><td rowspan=1 colspan=1>R@1/20</td><td rowspan=1 colspan=1>R@1/100</td><td rowspan=1 colspan=1>R@1/100</td><td rowspan=1 colspan=1>R@10/100</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>R@1/10</td><td rowspan=1 colspan=1>R@1/10</td><td rowspan=1 colspan=1>R@5/10</td><td rowspan=1 colspan=1>MRR</td></tr><tr><td rowspan=1 colspan=1>HuggingFace(Wolf et al.,2019)</td><td rowspan=1 colspan=1>82.1</td><td rowspan=1 colspan=1>80.7</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><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>(Chen&Wang,2019)</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>57.3</td><td rowspan=1 colspan=1>64.5</td><td rowspan=1 colspan=1>90.2</td><td rowspan=1 colspan=1>73.5</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>(Dong&Huang,2018)</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><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>75.9</td><td rowspan=1 colspan=1>97.3</td><td rowspan=1 colspan=1>84.8</td></tr><tr><td rowspan=1 colspan=1>pre-trained weights from(Dev</td><td rowspan=1 colspan=1>inetal.,201</td><td rowspan=1 colspan=1>9)-Toronto</td><td rowspan=1 colspan=1>Books+Wi</td><td rowspan=1 colspan=1>tipedia</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>83.3 ± 0.2</td><td rowspan=1 colspan=1>81.7 ± 0.2</td><td rowspan=1 colspan=1>56.5 ± 0.4</td><td rowspan=1 colspan=1>66.8 ± 0.7</td><td rowspan=1 colspan=1>89.0 ± 1.0</td><td rowspan=1 colspan=1>74.6 ± 0.5</td><td rowspan=1 colspan=1>80.9± 0.6</td><td rowspan=1 colspan=1>80.6 ± 0.4</td><td rowspan=1 colspan=1>98.2 ± 0.1</td><td rowspan=1 colspan=1>88.0 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First-m) 16</td><td rowspan=1 colspan=1>85.2 ± 0.1</td><td rowspan=1 colspan=1>83.9 ± 0.2</td><td rowspan=1 colspan=1>56.7 ± 0.2</td><td rowspan=1 colspan=1>67.0± 0.9</td><td rowspan=1 colspan=1>88.8±0.3</td><td rowspan=1 colspan=1>74.6± 0.6</td><td rowspan=1 colspan=1>81.7 ± 0.5</td><td rowspan=1 colspan=1>81.4 ± 0.6</td><td rowspan=1 colspan=1>98.2 ± 0.1</td><td rowspan=1 colspan=1>88.5 ± 0.4</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder(Learnt-m) 16</td><td rowspan=1 colspan=1>84.4 ± 0.1</td><td rowspan=1 colspan=1>83.2 ± 0.1</td><td rowspan=1 colspan=1>57.7 ± 0.2</td><td rowspan=1 colspan=1>67.8± 0.3</td><td rowspan=1 colspan=1>88.6± 0.2</td><td rowspan=1 colspan=1>75.1 ± 0.2</td><td rowspan=1 colspan=1>81.5±0.1</td><td rowspan=1 colspan=1>81.2 ±0.2</td><td rowspan=1 colspan=1>98.2 ±0.0</td><td rowspan=1 colspan=1>88.3 ± 0.1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder(First-m) 64</td><td rowspan=1 colspan=1>86.0 ± 0.2</td><td rowspan=1 colspan=1>84.2 ± 0.2</td><td rowspan=1 colspan=1>57.1 ± 0.2</td><td rowspan=1 colspan=1>66.9 ± 0.7</td><td rowspan=1 colspan=1>89.1 ± 0.2</td><td rowspan=1 colspan=1>74.7 ± 0.4</td><td rowspan=1 colspan=1>82.2 ± 0.6</td><td rowspan=1 colspan=1>81.9 ± 0.5</td><td rowspan=1 colspan=1>98.4 ±0.0</td><td rowspan=1 colspan=1>88.8± 0.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 64</td><td rowspan=1 colspan=1>84.9 ± 0.1</td><td rowspan=1 colspan=1>83.7 ± 0.2</td><td rowspan=1 colspan=1>58.3 ± 0.4</td><td rowspan=1 colspan=1>67.0± 0.9</td><td rowspan=1 colspan=1>89.2 ± 0.2</td><td rowspan=1 colspan=1>74.7 ± 0.6</td><td rowspan=1 colspan=1>81.8 ± 0.1</td><td rowspan=1 colspan=1>81.3 ± 0.2</td><td rowspan=1 colspan=1>98.2 ± 0.1</td><td rowspan=1 colspan=1>88.4 ± 0.1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First-m) 360</td><td rowspan=1 colspan=1>86.3 ± 0.1</td><td rowspan=1 colspan=1>84.6 ± 0.3</td><td rowspan=1 colspan=1>57.8 ± 0.5</td><td rowspan=1 colspan=1>67.0± 0.5</td><td rowspan=1 colspan=1>89.6± 0.9</td><td rowspan=1 colspan=1>75.0± 0.6</td><td rowspan=1 colspan=1>82.7 ± 0.4</td><td rowspan=1 colspan=1>82.2 ± 0.6</td><td rowspan=1 colspan=1>98.4±0.1</td><td rowspan=1 colspan=1>89.0 ± 0.4</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 360</td><td rowspan=1 colspan=1>85.3 ± 0.3</td><td rowspan=1 colspan=1>83.7 ±0.2</td><td rowspan=1 colspan=1>57.7 ± 0.3</td><td rowspan=1 colspan=1>68.9 ± 0.4</td><td rowspan=1 colspan=1>89.9 ± 0.5</td><td rowspan=1 colspan=1>76.2 ± 0.2</td><td rowspan=1 colspan=1>81.5 ± 0.1</td><td rowspan=1 colspan=1>80.9 ± 0.1</td><td rowspan=1 colspan=1>98.1 ± 0.0</td><td rowspan=1 colspan=1>88.1 ± 0.1</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>87.1 ± 0.1</td><td rowspan=1 colspan=1>84.8± 0.3</td><td rowspan=1 colspan=1>59.4 ± 0.4</td><td rowspan=1 colspan=1>67.4± 0.7</td><td rowspan=1 colspan=1>90.5 ± 0.3</td><td rowspan=1 colspan=1>75.6 ± 0.4</td><td rowspan=1 colspan=1>83.3 ± 0.4</td><td rowspan=1 colspan=1>82.8±0.3</td><td rowspan=1 colspan=1>98.4 ± 0.1</td><td rowspan=1 colspan=1>89.4 ± 0.2</td></tr><tr><td rowspan=1 colspan=1>Our pre-training on Toronto Books + Wikipedia</td><td rowspan=1 colspan=1>oks+Wiki</td><td rowspan=1 colspan=1>edia</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><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>Bi-encoder</td><td rowspan=1 colspan=1>84.6 ± 0.1</td><td rowspan=1 colspan=1>82.0 ± 0.1</td><td rowspan=1 colspan=1>54.9 ± 0.5</td><td rowspan=1 colspan=1>64.5 ± 0.5</td><td rowspan=1 colspan=1>88.1 ± 0.2</td><td rowspan=1 colspan=1>72.6 ± 0.4</td><td rowspan=1 colspan=1>80.9 ± 0.5</td><td rowspan=1 colspan=1>80.8 ± 0.5</td><td rowspan=1 colspan=1>98.4 ± 0.1</td><td rowspan=1 colspan=1>88.2 ± 0.4</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First-m) 16</td><td rowspan=1 colspan=1>84.1 ± 0.2</td><td rowspan=1 colspan=1>81.4 ± 0.2</td><td rowspan=1 colspan=1>53.9 ± 2.7</td><td rowspan=1 colspan=1>63.3 ± 2.9</td><td rowspan=1 colspan=1>87.2 ± 1.5</td><td rowspan=1 colspan=1>71.6 ± 2.4</td><td rowspan=1 colspan=1>80.8 ± 0.5</td><td rowspan=1 colspan=1>80.6 ±0.4</td><td rowspan=1 colspan=1>98.4 ± 0.1</td><td rowspan=1 colspan=1>88.1 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 16</td><td rowspan=1 colspan=1>85.4± 0.2</td><td rowspan=1 colspan=1>82.7 ±0.1</td><td rowspan=1 colspan=1>56.0± 0.4</td><td rowspan=1 colspan=1>65.3± 0.9</td><td rowspan=1 colspan=1>88.2± 0.7</td><td rowspan=1 colspan=1>73.2 ± 0.7</td><td rowspan=1 colspan=1>84.0± 0.1</td><td rowspan=1 colspan=1>83.4 ±0.2</td><td rowspan=1 colspan=1>98.7±0.0</td><td rowspan=1 colspan=1>89.9 ± 0.1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder(First-m) 64</td><td rowspan=1 colspan=1>86.1 ±0.4</td><td rowspan=1 colspan=1>83.9± 0.3</td><td rowspan=1 colspan=1>55.6 ± 0.9</td><td rowspan=1 colspan=1>64.3 ± 1.5</td><td rowspan=1 colspan=1>87.8 ± 0.4</td><td rowspan=1 colspan=1>72.5 ± 1.0</td><td rowspan=1 colspan=1>80.9 ± 0.6</td><td rowspan=1 colspan=1>80.7 ± 0.6</td><td rowspan=1 colspan=1>98.4± 0.0</td><td rowspan=1 colspan=1>88.2 ± 0.4</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 64</td><td rowspan=1 colspan=1>85.6 ± 0.1</td><td rowspan=1 colspan=1>83.3 ± 0.1</td><td rowspan=1 colspan=1>56.2 ± 0.4</td><td rowspan=1 colspan=1>65.8 ± 0.7</td><td rowspan=1 colspan=1>88.4 ± 0.3</td><td rowspan=1 colspan=1>73.5 ± 0.5</td><td rowspan=1 colspan=1>84.0 ± 0.1</td><td rowspan=1 colspan=1>83.4 ± 0.1</td><td rowspan=1 colspan=1>98.7 ±0.0</td><td rowspan=1 colspan=1>89.9 ± 0.0</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First-m) 360</td><td rowspan=1 colspan=1>86.6± 0.3</td><td rowspan=1 colspan=1>84.4 ± 0.2</td><td rowspan=1 colspan=1>57.5 ± 0.4</td><td rowspan=1 colspan=1>66.5 ± 1.2</td><td rowspan=1 colspan=1>89.0 ± 0.5</td><td rowspan=1 colspan=1>74.4 ± 0.7</td><td rowspan=1 colspan=1>81.3±0.6</td><td rowspan=1 colspan=1>81.1 ±0.4</td><td rowspan=1 colspan=1>98.4 ± 0.2</td><td rowspan=1 colspan=1>88.4 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder(Learnt-m) 360</td><td rowspan=1 colspan=1>86.1 ± 0.1</td><td rowspan=1 colspan=1>83.8 ± 0.1</td><td rowspan=1 colspan=1>56.5 ± 0.8</td><td rowspan=1 colspan=1>65.8 ± 0.7</td><td rowspan=1 colspan=1>88.5 ± 0.6</td><td rowspan=1 colspan=1>73.6 ± 0.6</td><td rowspan=1 colspan=1>84.2 ± 0.2</td><td rowspan=1 colspan=1>83.7 ±0.0</td><td rowspan=1 colspan=1>98.7 ± 0.1</td><td rowspan=1 colspan=1>90.1 ± 0.0</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>87.3 ± 0.5</td><td rowspan=1 colspan=1>84.9 ± 0.3</td><td rowspan=1 colspan=1>57.7 ± 0.5</td><td rowspan=1 colspan=1>65.3 ± 1.0</td><td rowspan=1 colspan=1>89.7 ± 0.5</td><td rowspan=1 colspan=1>73.8 ± 0.6</td><td rowspan=1 colspan=1>83.2 ±0.8</td><td rowspan=1 colspan=1>83.1 ± 0.7</td><td rowspan=1 colspan=1>98.7 ± 0.1</td><td rowspan=1 colspan=1>89.7 ± 0.5</td></tr><tr><td rowspan=1 colspan=1>Our pre-training on Reddit</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><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Bi-encoder</td><td rowspan=1 colspan=1>86.9 ± 0.1</td><td rowspan=1 colspan=1>84.8 ± 0.1</td><td rowspan=1 colspan=1>60.1 ± 0.4</td><td rowspan=1 colspan=1>70.9 ± 0.5</td><td rowspan=1 colspan=1>90.6 ± 0.3</td><td rowspan=1 colspan=1>78.1 ± 0.3</td><td rowspan=1 colspan=1>83.7±0.7</td><td rowspan=1 colspan=1>83.6 ±0.7</td><td rowspan=1 colspan=1>98.8±0.1</td><td rowspan=1 colspan=1>90.1 ± 0.4</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder(First-m) 16</td><td rowspan=1 colspan=1>89.0± 0.1</td><td rowspan=1 colspan=1>86.4± 0.3</td><td rowspan=1 colspan=1>60.4± 0.3</td><td rowspan=1 colspan=1>70.7 ± 0.7</td><td rowspan=1 colspan=1>91.0± 0.4</td><td rowspan=1 colspan=1>78.0± 0.5</td><td rowspan=1 colspan=1>84.3 ± 0.3</td><td rowspan=1 colspan=1>84.3± 0.2</td><td rowspan=1 colspan=1>98.9± 0.0</td><td rowspan=1 colspan=1>90.5 ±0.1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 16</td><td rowspan=1 colspan=1>88.6 ± 0.3</td><td rowspan=1 colspan=1>86.3 ± 0.3</td><td rowspan=1 colspan=1>61.1 ± 0.4</td><td rowspan=1 colspan=1>71.6 ± 0.6</td><td rowspan=1 colspan=1>91.3 ± 0.3</td><td rowspan=1 colspan=1>78.4 ± 0.4</td><td rowspan=1 colspan=1>86.1 ± 0.1</td><td rowspan=1 colspan=1>86.0 ± 0.1</td><td rowspan=1 colspan=1>99.0 ± 0.1</td><td rowspan=1 colspan=1>91.5 ± 0.1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First-m) 64</td><td rowspan=1 colspan=1>89.5 ± 0.1</td><td rowspan=1 colspan=1>87.3 ± 0.2</td><td rowspan=1 colspan=1>61.0 ± 0.4</td><td rowspan=1 colspan=1>70.9 ± 0.6</td><td rowspan=1 colspan=1>91.5 ± 0.5</td><td rowspan=1 colspan=1>78.0± 0.3</td><td rowspan=1 colspan=1>84.0 ± 0.4</td><td rowspan=1 colspan=1>83.9 ± 0.4</td><td rowspan=1 colspan=1>98.8±0.0</td><td rowspan=1 colspan=1>90.3 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 64</td><td rowspan=1 colspan=1>89.0± 0.1</td><td rowspan=1 colspan=1>86.5 ± 0.2</td><td rowspan=1 colspan=1>60.9± 0.6</td><td rowspan=1 colspan=1>71.2 ± 0.8</td><td rowspan=1 colspan=1>91.3± 0.4</td><td rowspan=1 colspan=1>78.2± 0.7</td><td rowspan=1 colspan=1>86.2 ± 0.1</td><td rowspan=1 colspan=1>85.9 ± 0.1</td><td rowspan=1 colspan=1>99.1 ± 0.0</td><td rowspan=1 colspan=1>91.5 ± 0.1</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (First-m) 360</td><td rowspan=1 colspan=1>90.0 ± 0.1</td><td rowspan=1 colspan=1>87.3 ± 0.1</td><td rowspan=1 colspan=1>61.1 ± 1.9</td><td rowspan=1 colspan=1>70.9 ± 2.1</td><td rowspan=1 colspan=1>91.5 ± 0.9</td><td rowspan=1 colspan=1>77.9 ± 1.6</td><td rowspan=1 colspan=1>84.8 ± 0.5</td><td rowspan=1 colspan=1>84.6 ± 0.5</td><td rowspan=1 colspan=1>98.9 ± 0.1</td><td rowspan=1 colspan=1>90.7 ± 0.3</td></tr><tr><td rowspan=1 colspan=1>Poly-encoder (Learnt-m) 360</td><td rowspan=1 colspan=1>89.2 ± 0.1</td><td rowspan=1 colspan=1>86.8± 0.1</td><td rowspan=1 colspan=1>61.2 ± 0.2</td><td rowspan=1 colspan=1>71.4 ± 1.0</td><td rowspan=1 colspan=1>91.1 ± 0.3</td><td rowspan=1 colspan=1>78.3± 0.7</td><td rowspan=1 colspan=1>86.3 ± 0.1</td><td rowspan=1 colspan=1>85.9 ± 0.1</td><td rowspan=1 colspan=1>99.1 ±0.0</td><td rowspan=1 colspan=1>91.5 ± 0.0</td></tr><tr><td rowspan=1 colspan=1>Cross-encoder</td><td rowspan=1 colspan=1>90.3± 0.2</td><td rowspan=1 colspan=1>87.9 ± 0.2</td><td rowspan=1 colspan=1>63.9 ± 0.3</td><td rowspan=1 colspan=1>71.7 ± 0.3</td><td rowspan=1 colspan=1>92.4 ± 0.5</td><td rowspan=1 colspan=1>79.0 ± 0.2</td><td rowspan=1 colspan=1>86.7±0.1</td><td rowspan=1 colspan=1>86.5 ± 0.1</td><td rowspan=1 colspan=1>99.1 ± 0.0</td><td rowspan=1 colspan=1>91.9 ± 0.0</td></tr></table>
|
| 275 |
+
|
| 276 |
+
Table 10: Validation and test performances of Bi-, Poly- and Cross-encoders. Scores are shown for ConvAI2, DSTC7 Track 1 and Ubuntu v2, and the previous state-of-the-art models in the literature.
|
md/train/Syx4wnEtvH/Syx4wnEtvH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/Tt1s9Oi1kCS/Tt1s9Oi1kCS.md
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONTINUAL PROTOTYPE EVOLUTION: LEARNING ONLINE FROM NON-STATIONARY DATA STREAMS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Attaining prototypical features to represent class distributions is well established in representation learning. However, learning prototypes online from streams of data proves a challenging endeavor as they rapidly become outdated, caused by an ever-changing parameter space in the learning process. Additionally, continual learning does not assume the data stream to be stationary, typically resulting in catastrophic forgetting of previous knowledge. As a first, we introduce a system addressing both problems, where prototypes evolve continually in a shared latent space, enabling learning and prediction at any point in time. In contrast to the major body of work in continual learning, data streams are processed in an online fashion, without additional task-information, and an efficient memory scheme provides robustness to imbalanced data streams. Besides nearest neighbor based prediction, learning is facilitated by a novel objective function, encouraging cluster density about the class prototype and increased inter-class variance. Furthermore, the latent space quality is elevated by pseudo-prototypes in each batch, constituted by replay of exemplars from memory. We generalize the existing paradigms in continual learning to incorporate data incremental learning from data streams by formalizing a two-agent learner-evaluator framework, and obtain state-of-the-art performance by a significant margin on eight benchmarks, including three highly imbalanced data streams.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The prevalence of data streams in contemporary applications urges systems to learn in a continual fashion. Autonomous vehicles, sensory robot data, and video streaming yield never-ending streams of data, with abrupt changes in the observed environment behind every vehicle turn, robot entering a new room, or camera cut to a subsequent scene. Alas, learning from streaming data is far from trivial due to these changes, as neural networks tend to forget the knowledge they previously acquired. The data stream presented to the network is not identically and independently distributed (iid), emanating a trade-off between neural stability to retain the current state of knowledge and neural plasticity to swiftly adopt the new knowledge (Grossberg, 1982). Finding the balance in this stability-plasticity dilemma addresses the catastrophic forgetting (French, 1999) induced by the non-iid intrinsics of the data stream, and is considered the main hurdle for continually learning systems.
|
| 12 |
+
|
| 13 |
+
Although a lot of progress has been established in the literature, often strong assumptions apply, impeding applicability for real-world systems. The static training and testing paradigms prevail, whereas a true continual learner should enable both simultaneously and independently. Therefore, we propose the two-agent learner-evaluator framework to redefine perspective on existing paradigms in the field. Within this framework, we introduce data incremental learning, enabling completely task-free learning and evaluation.
|
| 14 |
+
|
| 15 |
+
Furthermore, we introduce Continual Prototype Evolution (CoPE), a new online data incremental learner wherein prototypes perpetually represent the most salient features of the class population, shifting the catastrophic forgetting problem from the full network parameter space to the lowerdimensional latent space. As a first, our prototypes evolve continually with the data stream, enabling learning and evaluation at any point in time. Similar to representativeness heuristics in human cognition (Kahneman & Tversky, 1972), the class prototypes are the cornerstone for nearest neighbor classification. Additionally, the system is robust to highly imbalanced data streams by the combination of replay with a balancing memory population scheme. We find batch information in the latent space to have a significant advantage in the challenging non-stationary and online processing regime, which we incorporate in the novel pseudo-prototypical proxy loss.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Overview of the learner-evaluator framework, overcoming the static training and testing paradigms by explicitly modelling continual optimization and evaluation from data streams in the learner and evaluator agents. The framework generalizes to both continual learning and concept drift with resources transparently defined as the horizon $\mathcal { D }$ and operational memory $\mathcal { M }$ .
|
| 19 |
+
|
| 20 |
+
# 2 THE LEARNER-EVALUATOR FRAMEWORK
|
| 21 |
+
|
| 22 |
+
To date, the paradigms of task, class, and domain incremental learning (van de Ven & Tolias, 2018) dominate the continual learning literature. However, strong and differing assumptions often lead to confusion and overlap between implementations of these definitions. Furthermore, the concept of a static training and testing phase is still ubiquitous, whereas continual learning systems should enable both phases continually and independently. Therefore, we propose a generalizing framework which disentangles the continually learning system into two agents: the learner and the evaluator. Figure 1 presents an overview of the framework.
|
| 23 |
+
|
| 24 |
+
The learning agent learns predicting function $f _ { \theta } : \mathcal { X } \mathcal { V }$ parameterized by $\theta$ , mapping the input space $\mathcal { X }$ to the target output space $\mathcal { V }$ . The learner receives data samples $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ from stream $S$ and has simultaneous access to the horizon $\mathcal { D }$ , i.e. the observable subset of stream $S$ which can be processed for multiple iterations. Data sample $i$ is constituted by input feature $\mathbf { x } _ { i } \in \mathcal { X }$ and corresponding (self-)supervision signal $\mathbf { y } _ { i }$ for which the output space for classification is defined as a discrete set of observed classes $\mathcal { V } _ { i } \mathcal { V } _ { i - 1 } \cup \{ \mathbf { y } _ { i } \}$ . To manage memory usage and to enable multiple updates and stochasticity in the optimization process, updates for $\theta$ are typically performed based on a small-scale processing batch $B \subseteq { \mathcal { D } }$ . The data and size of the horizon $\mathcal { D }$ are determined by the specific setup or application, ranging from standard offline learning with $\mathcal { D } = S$ to online continual learning with $\mathcal { D } = B$ . Furthermore, the learner might need additional resources after observing data from $B \subseteq { \mathcal { D } }$ , such as stored samples or model copies, confined by the operational memory $\mathcal { M }$ .
|
| 25 |
+
|
| 26 |
+
The evaluating agent acts independently from the learner by evaluating $f _ { \theta }$ with horizon $\mathcal { D } _ { e v a l }$ from the evaluation stream $S _ { e v a l }$ , with small-scale processing batches $B _ { e v a l } \ \subseteq \ D _ { e v a l }$ . This stream can contain yet unobserved concepts by the learner in $S$ to measure zero-shot performance. The framework provides leeway for the concept distributions in $S _ { e v a l }$ being either static or dynamically evolving, determining how performance of the learner is measured. On the one hand, static concept distributions can measure the degree to which the knowledge of learned concepts is preserved, as commonly used in continual learning. On the other hand, evolving concept distributions measure performance for the current distribution in horizon $\mathcal { D } _ { e v a l }$ only, where concepts might drift from their original representation, also known as concept drift (Schlimmer $\&$ Granger, 1986). Evaluation can occur asynchronously on-demand or periodically with periodicity $\rho$ determining the resolution of the evaluation samples.
|
| 27 |
+
|
| 28 |
+
Task, class, and domain incremental learning are based on the composition in the learner for the observable stream subset in horizon $\mathcal { D } _ { t }$ , which is incrementally replaced by a new subset of data for the new task, set of classes, or domain, with $t$ the identifier of the present data subset. Task incremental learning assumes both learner and evaluator to get data $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } , t _ { i } \right)$ with $t _ { i + 1 } \geq t _ { i }$ and the horizon spanning all data of a given task with ${ \mathcal { D } } _ { t } = \{ ( \mathbf { x } _ { i } , \mathbf { y } _ { i } , t _ { i } ) \in S \mid t _ { i } = t \}$ (De Lange et al., 2019; van de Ven & Tolias, 2019). Having explicit access to $t _ { i }$ confines prediction to an isolated output space. Similarly, in class incremental learning the learner implicitly requires $t _ { i }$ to identify the transitions of $\mathcal { D }$ , when observing new batches of classes (Rebuffi et al., 2017; Castro et al., 2018; Shmelkov et al., 2017; Wu et al., 2018). However, the evaluator considers the entire output space without the need for identifier $t$ . Domain incremental learning holds the same assumptions as class incremental learning, with concepts drifting from one domain to the other for a typically fixed output space, exemplified by the widely used permuted-MNIST setup (Goodfellow et al., 2013).
|
| 29 |
+
|
| 30 |
+
Data incremental learning is a more general paradigm we introduce to facilitate learning from any data stream, with no assumption but to observe data incrementally. In contrast to existing paradigms, when the learner observes horizon $\mathcal { D }$ of data stream $S$ , data incremental learning does not disclose an identifier $t$ . Consequently, there is no explicit indication to which subset of the stream is being observed in the horizon $\mathcal { D }$ . Therefore, the learner either processes observed data directly in an online fashion with processing batch $B = \mathcal { D }$ , or infers an implicit identifier $t$ from statistics in stream $S$ Similar to class and domain incremental learning, the evaluator operates without $t$ on the full output space. This paradigm endows continually learning systems with increased practical use, as real-world streaming applications often lack supervision signal $t$ . Moreover, even if $t$ is provided, this would introduce a bias in the fixed choice of the supervisor, rather than dynamically determined based on the needs of the system.
|
| 31 |
+
|
| 32 |
+
# 3 PRIOR WORK
|
| 33 |
+
|
| 34 |
+
Continually learning systems are able to learn with limited resources from data streams prone to severe distribution shifts. The main body of works presumes the presence of tasks, which divide the data streams into large discrete batches, and are indicated to the learner with a task identifier (Kirkpatrick et al., 2017; Li & Hoiem, 2017; Zenke et al., 2017; Aljundi et al., 2018; De Lange et al., 2020). Replay methods retain representative data for observed data distributions, currently unavailable in the learner’s horizon $\mathcal { D }$ . The replay data is either obtained directly from operational memory $\mathcal { M }$ with stored samples (Rebuffi et al., 2017; Lopez-Paz & Ranzato, 2017) or generated using generative models (Shin et al., 2017; Kamra et al., 2017; Seff et al., 2017; Wu et al., 2018). GEM (Lopez-Paz & Ranzato, 2017) uses replay in a constraint optimization perspective to project gradients towards a local joint task optimum. iCaRL (Rebuffi et al., 2017) employs exemplars to distill knowledge (Hinton et al., 2015) to the learner from a previous model version, with new class exemplars stored in a queue to optimally represent the class mean in feature space. The prototypes are then used for nearest neighbor prediction by the evaluator, in the same vein as concurrent work to ours (Han et al., 2020). Nonetheless, all three works strongly rely on task identifier $t$ for the learner, mostly unavailable for real-world data streams. Moreover, in both prototypical approaches the prototypes remain static between the given task transitions and become outdated. Consequently, before using the evaluator they have to exhaustively recalculate the prototypes based on all exemplars in memory. In contrast, our prototypes evolve in an online fashion with the data stream and remain representative for the continual learner and evaluator at all times.
|
| 35 |
+
|
| 36 |
+
Recent works focus on online data incremental learning (Section 2) in which the learner operates completely task-free. Reservoir (Vitter, 1985) is a replay baseline with strong potential to outperform continual learning methods (Chaudhry et al., 2019). Samples are stored in memory $\mathcal { M }$ with probability $M / n$ , with $n$ the number of observed samples and buffer size $M$ . MIR (Aljundi et al., 2019a) extends Reservoir sampling with a loss-based retrieval strategy, with the cost of additional forward passes and a model copy to attain the losses for a subset of samples. The Reservoir buffer population approximately follows the data stream distribution, severely deteriorating the performance of underrepresented tasks in imbalanced data streams, as shown in Section 6.2. An alternative memory population scheme is used in GSS (Aljundi et al., 2019b) by extending the GEM constraint optimization perspective to an instance-based level. GSS adds samples to the buffer based on their gradients, whereas GEM requires the number of tasks and the task transitions to divide memory equally over all tasks a priori. In contrast, iCaRL’s memory population is incrementally subdivided over all classes after learning a task, by iteratively adding observed samples from $\mathcal { D }$ to optimally approximate the class mean in feature space. As this is computationally expensive, concurrent works to ours explore other balancing schemes (Kim et al., 2020; Chrysakis & Moens, 2020), where we propose a simple but effective class-based Reservoir scheme with uniform retrieval.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Main setup. The learner updates network $f _ { \theta }$ and prototypes $\mathbf { p } ^ { y }$ $, \forall y \in \mathcal { V }$ continually. The PPP-loss encourages inter-class variance (red arrows) and reduces intra-class variance (green arrows).
|
| 40 |
+
|
| 41 |
+
Another branch of parameter isolation methods (De Lange et al., 2019) allocates parameters to subsets of the data. Several task incremental works assign parameters based on the task identifier (Mallya & Lazebnik, 2018; Serra et al., 2018). A new line of work instead focuses on task-free model expansion. CURL (Rao et al., 2019) enables task-free and unsupervised adaptation using a multi-component variational auto-encoder, with generative replay from a model copy avoiding forgetting in the current model. CN-DPM (Lee et al., 2020) allocates data subsets to expert networks following a Dirichlet process mixture. In contrast to these capacity expansion based methods, CoPE evades unbound allocation of resources, as the memory and network capacity are fixed with the replay memory dynamically subdivided over categories occurring in the data stream. Note that new categories require an additional prototype, but these are only $d$ -dimensional and therefore insignificant in size, and the set of categories is typically limited as well.
|
| 42 |
+
|
| 43 |
+
Besides the focus on continual learning in this work, our learner-evaluator framework generalizes to concept drift as well (Schlimmer & Granger, 1986), for which we refer to an overview in (Tsymbal, 2004; Gama et al., 2014). Further, in deep embedding learning most commonly pairs (Hadsell et al., 2006) and triplets (Harwood et al., 2017) of samples are considered in contrastive losses, whereas other works use batch information in lifted structure embeddings (Oh Song et al., 2016), or instancewise softmax embeddings (Ye et al., 2019). These approaches fully depend on the batch size, whereas our pseudo-prototypical proxy loss aggregates both decoupled prototypes and the additional batch pseudo-prototypes to defy class interference in the latent space. Learning prototypical representations also shows promising results in few-shot learning (Snell et al., 2017).
|
| 44 |
+
|
| 45 |
+
# 4 CONTINUAL PROTOTYPE EVOLUTION
|
| 46 |
+
|
| 47 |
+
The online data incremental learning setup of the learner is described in Figure 2. Embedding network $f _ { \theta }$ maps processing batch $B$ , composed of samples in horizon $\mathcal { D }$ from the non-iid data stream $S$ and operational memory $\mathcal { M }$ , to low-dimensional $\mathbb { R } ^ { d }$ latent space, followed by a nearest neighbor classifier. We enforce $| | f _ { \theta } ( \mathbf { \bar { x } } _ { i } ) | | = 1$ with an L2 normalization layer. $\mathcal { M }$ is subdivided in a replay memory $\mathcal { M } _ { r }$ and prototypical memory $\mathcal { M } _ { p }$ . CoPE comprises three main components: continually evolving representations, balanced replay and the pseudo-prototypical proxy (PPP) loss. In the following, we discuss these components and formalize the optimal choice of prototype, with $\mathbf { f } _ { i } ^ { c }$ denoting latent space projection $f _ { \theta } ( \mathbf { x } _ { i } ^ { c } )$ for an instance $\mathbf { x } _ { i }$ of class $c$ . For the full algorithm, we refer to Appendix A.
|
| 48 |
+
|
| 49 |
+
# 4.1 EVOLVING REPRESENTATIONS
|
| 50 |
+
|
| 51 |
+
Each observed class $c \in \mathcal { V }$ is represented by a slowly progressing prototype $\mathbf { p ^ { c } }$ in operational memory $\mathcal { M } _ { p }$ . The nearest neighbor classifier finds the most similar prototype for the given query $\mathbf { x } _ { i }$ , predicting $c ^ { * } = \arg \operatorname* { m a x } _ { c \in \mathcal { Y } } \mathbf { f _ { i } ^ { T } } \mathbf { p ^ { c } }$ . Similar to (Mensink et al., 2013; Rebuffi et al., 2017), the class-prototype approximates the center of mass in the latent space, which we formally justify in Section 4.4. The main crux with storing representations is to prevent them from becoming obsolete as the embedding network evolves. Additionally, this is further complicated by the shifting data distributions in the non-stationary regime, incurring catastrophic forgetting. Experience replay from a buffer $\mathcal { M } _ { r }$ is a well known approach to address this forgetting. Nonetheless, in our setup the replayed exemplars gain additional information about the current state of the embedding space, enabling rehearsal to rectify approximation $\mathbf { p } ^ { c }$ to the true center of mass. Concretely, the sampled batch
|
| 52 |
+
|
| 53 |
+
$B _ { n }$ equals the horizon $\mathcal { D }$ from data stream $S$ and joins batch $B _ { \mathcal { M } }$ of equal size from memory $\mathcal { M } _ { r }$ , constituting $B$ as $B _ { n } \cup B _ { { \cal M } }$ . However, updating the prototypes by fully relying on features extracted from $B$ incurs an unstable optimization process as the representative prototypes depend on stochastic sampling of the class distributions. Therefore, we design the prototypes to evolve continually with a high momentum based update for each observed batch, aiming to stabilize the impetuous changes in the data stream:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { p } ^ { c } \alpha \mathbf { p } ^ { c } + ( 1 - \alpha ) \bar { \mathbf { p } } ^ { c } , \mathrm { s . t . } \bar { \mathbf { p } } ^ { c } = \frac { 1 } { | B ^ { c } | } \sum _ { \mathbf { x } ^ { c } \in B ^ { c } } f _ { \boldsymbol \theta } ( \mathbf { x } ^ { c } ) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
with momentum parameter $\alpha \in [ 0 , 1 ]$ , the batch subset $B ^ { c } = \{ ( \mathbf { x } _ { i } , y _ { i } = c ) \in B \}$ of class $c$ , and $\bar { \mathbf { p } } ^ { c }$ the corresponding center of mass in latent space for the current batch. Due to triangle inequality $\mathbf { p } ^ { c }$ is no longer unit length and requires to be L2-normalized after the update in Eq. 1. We empirically validate the effectiveness of high momentum with $\alpha \approx 1$ in the ablation study in Appendix D.
|
| 60 |
+
|
| 61 |
+
# 4.2 BALANCED REPLAY
|
| 62 |
+
|
| 63 |
+
Similar to Rebuffi et al. (2017); Chrysakis & Moens (2020), the total buffer size $M$ is equally divided over the number of observed classes $| \mathcal { V } |$ in a dynamic fashion. This scheme ensures consistent buffer capacity for all classes, making memory allocation independent of the data stream characteristics. As $S$ is typically highly imbalanced in real-world scenarios, this memory scheme prevents classes to be eradicated from the buffer and assumes equal importance to represent each class at all times. Consequently, random retrieval from the buffer resembles sampling an iid replay batch. Furthermore, each class-specific replay memory $\mathcal { M } _ { r } ^ { c }$ can simply capture a random subset of its parent class distribution to approximate its center of mass. This avoids computationally expensive herding techniques as in iCaRL (Rebuffi et al., 2017), which would require recalculation of the feature means on each change of the memory size or network parameters.
|
| 64 |
+
|
| 65 |
+
# 4.3 PSEUDO-PROTOTYPICAL PROXY LOSS
|
| 66 |
+
|
| 67 |
+
The learner optimizes $f _ { \theta }$ to project an instance $\mathbf { f } _ { i } ^ { c } \in \mathbb { R } ^ { d }$ of class $c$ close to its corresponding prototype $\mathbf { p } ^ { c }$ in the latent space. As the prototype acts as a surrogate for the class mean in latent space, the cluster population has a common reference point to reduce intra-class variance, and enforce inter-class variance by remaining distant from the other class prototypes. Additionally, due to the embedding architecture we can use intrinsic information of the batch samples in the latent space. Therefore, we exploit the supervision signal $\mathbf { y } _ { i }$ in a sample $( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \in B$ not only to indicate which class $\mathbf { x } _ { i }$ belongs to, but also to make the distinction between positive and negative pairs in $B$ . Consequently, we can define one-against-all subsets for an instance of class $c$ , with positives from the same class in $B ^ { c } = \{ ( \mathbf { x } _ { i } , y _ { i } \stackrel { - } { = } c ) \in B \}$ and negatives in $B ^ { k }$ . Starting from these sets, the prototypical attractor and repellor sets for an instance $\mathbf { x } _ { i } ^ { c }$ are constituted with the class prototype $\mathbf { p } ^ { c }$ and the other instances in $B$ . First, the other instances of class $c$ act as pseudo-prototypes $\hat { \mathbf { p } } ^ { c }$ in attractor set $\mathbb { P } _ { i } ^ { c } = \{ \mathbf { p } ^ { c } \} \cup \{ \hat { \mathbf { p } } _ { j } ^ { c } = f _ { \theta } ( \mathbf { x } _ { j } ^ { c } ) \mid \forall \mathbf { x } _ { j } ^ { c } \in B ^ { c } , i \neq j \} _ { }$ . Second, the samples of other classes $\mathbf { x } _ { j } ^ { k } \in B ^ { k }$ should instead avoid both $\mathbf { x } _ { i } ^ { c }$ in latent space and the class representative $\mathbf { p } ^ { c }$ , defined by repellor set $\mathbb { U } _ { i } ^ { c } = \{ \mathbf { p } ^ { c } , \hat { \mathbf { p } } _ { i } ^ { c } = f _ { \theta } \big ( \mathbf { x } _ { i } ^ { c } \big ) \}$ . The attractor set for $\mathbf { x } _ { i } ^ { c }$ facilitates a decrease in intra-class variance with $\mathbf { p } ^ { c }$ safeguarding the absence of positive batch pairs with $1 \leq | \mathbb { P } _ { i } ^ { c } | \leq | B ^ { c } |$ , whereas the repellor exploits $\mathbf { x } _ { i } ^ { c }$ and corresponding prototype as a reference point to increase inter-class variance. To incorporate the attractor and repellor sets, we formulate a binary classification problem similar to Ye et al. (2019), with the joint probability that instance $\mathbf { x } _ { i } ^ { c }$ is predicted as class $c$ and instances $\mathbf { x } _ { j } ^ { k } \in B ^ { k }$ not being predicted as class $c$
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
P _ { i } = P ( c | \mathbf { x } _ { i } ^ { c } ) \prod _ { \mathbf { x } _ { j } ^ { k } } ( 1 - P _ { i } ( c | \mathbf { x } _ { j } ^ { k } ) )
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
with the assumption of independence between $\mathbf { x } _ { i } ^ { c }$ and $\mathbf { x } _ { j } ^ { k }$ being recognized as $c$ . We define the expected posterior probabilities for the attractor and repellor sets of instance $\mathbf { x } _ { i } ^ { c }$ respectively as
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { P ( c | \mathbf { x } _ { i } ^ { c } ) = \underset { \tilde { \mathbf { p } } ^ { c } \in \mathbb { P } _ { i } ^ { c } } { \mathbb { E } } \left[ P ( c | \mathbf { f } _ { i } ^ { c } , \tilde { \mathbf { p } } ^ { c } ) \right] , \quad P _ { i } ( c | \mathbf { x } _ { j } ^ { k } ) = \underset { \tilde { \mathbf { p } } ^ { c } \in \mathbb { U } _ { i } ^ { c } } { \mathbb { E } } \left[ P ( c | \mathbf { f } _ { j } ^ { k } , \tilde { \mathbf { p } } ^ { c } ) \right] , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
with $\tilde { \mathbf { p } } ^ { c }$ a proxy for the latent mean of class $c$ in
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
P ( c | \mathbf { f } , \tilde { \mathbf { p } } ^ { c } ) = \frac { \exp ( \mathbf { f } ^ { T } \tilde { \mathbf { p } } ^ { c } / \tau ) } { \exp ( \mathbf { f } ^ { T } \tilde { \mathbf { p } } ^ { c } / \tau ) + \sum _ { k \neq c } \exp ( \mathbf { f } ^ { T } \mathbf { p } ^ { k } / \tau ) } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where temperature $\tau$ controls the concentration level of the distribution (Hinton et al., 2015), assuming a cosine similarity metric $\mathbf { f } _ { i } ^ { T } \mathbf { f } _ { j }$ with vectors normalized to unit length. We reformulate the objective in Eq.(2) as loss function $\mathcal { L }$ by negative log-likelihood and summation over all the instances in $B$ which approximates the true joint probability with assumed independent pairs in the batch:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathcal { L } = - \frac { 1 } { | B | } \left[ \sum _ { i } \log P ( c | \mathbf { x } _ { i } ^ { c } ) + \sum _ { i } \sum _ { \mathbf { x } _ { j } ^ { k } } \log ( 1 - P _ { i } ( c | \mathbf { x } _ { j } ^ { k } ) ) \right] .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
# 4.4 OPTIMAL PROTOTYPES
|
| 92 |
+
|
| 93 |
+
We update prototypes to approximate the mean of the parent distribution in Eq.(1). This assumption is optimal for Bregman divergences for which the cluster mean is shown to have minimal distance to its population (Banerjee et al., 2005). This Bregman divergence is defined for a differentiable, strictly convex function $\varphi$ as
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
d _ { \varphi } ( \mathbf { f } _ { i } , \mathbf { f } _ { j } ) = \varphi ( \mathbf { f } _ { i } ) - \varphi ( \mathbf { f } _ { j } ) - ( \mathbf { f } _ { i } - \mathbf { f } _ { j } ) ^ { T } \nabla \varphi ( \mathbf { f } _ { j } ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
for which the squared Euclidean distance with $\varphi ( \mathbf { f } ) = | | \mathbf { f } | | ^ { 2 }$ is a canonical example. The squared Euclidean distance is proportional to the cosine distance with vectors normalized to unit length: $\begin{array} { r } { \frac { 1 } { 2 } | | { \bf f } _ { i } - { \bf f } _ { j } | | ^ { 2 } = 1 - \cos \angle ( { \bf \hat { f } } _ { i } , { \bf f } _ { j } ) } \end{array}$ . As the PPP-loss in Eq.(4) requires a similarity measure instead of a distance measure, we employ the complementary normalized cosine similarity $\cos \angle ( { \bf f } _ { i } , { \bf f } _ { j } ) = { \bf f } _ { i } ^ { T } { \bf f } _ { j }$ with $| | \mathbf { f } _ { i } | | = | | \mathbf { f } _ { j } | | = 1$ . Besides the desirable cluster-mean property of its complement, this metric is also efficient for calculating the full batch similarity matrix using matrix multiplication libraries.
|
| 100 |
+
|
| 101 |
+
# 5 EXPERIMENTS
|
| 102 |
+
|
| 103 |
+
This work examines five balanced data streams and 15 highly imbalanced variants based on SplitMNIST, Split-CIFAR10 and Split-CIFAR100, from which two low-capacity balanced setups are discussed in Appendix E. The learner is presented a data stream $S$ , constituted by a sequence of tasks, each delineated by a subset of classes from the original dataset. Although the learner in CoPE is completely ignorant to the notion of task, this setup enables comparing to methods requiring task boundaries such as GEM and iCaRL. The evaluator uses a held-out dataset of static concepts in $S _ { e v a l }$ , evaluating with the subset of seen concepts $\mathcal { V }$ in $\mathcal { D } _ { e v a l }$ using the accuracy metric. The CoPE learner processes data online with $B _ { n } = \mathcal { D }$ in the data incremental setup, allowing per-task processing of 1 epoch for methods requiring task boundaries with $B \subset \mathcal { D }$ . We use vanilla stochastic gradient descent with a limited processing batch size $| B _ { n } |$ of 10 as in in (Lopez-Paz & Ranzato, 2017; Aljundi et al., 2019b; Lee et al., 2020). All results are averaged over 5 different network initializations.1
|
| 104 |
+
|
| 105 |
+
Balanced data streams contain a similar amount of data per task. We consider three benchmarks. First, Split-MNIST constitutes the MNIST (LeCun et al., 1998) handwritten digit recognition dataset with 60k training samples, split into 5 tasks according to pairs of incrementing digits. Second, Split-CIFAR10 considers the CIFAR10 (Krizhevsky et al., 2009) dataset, subdivided into 5 tasks with 2 labels each, where each task entails 10k training samples. Third, Split-CIFAR100 is a variant of the CIFAR dataset with 100 different classes. The 50k training samples are subdivided in 20 tasks of $2 . 5 \mathrm { k }$ samples as in (Lopez-Paz & Ranzato, 2017; Lee et al., 2020). For all datasets the evaluator considers the entire original test subset for $S _ { e v a l }$ .
|
| 106 |
+
|
| 107 |
+
Imbalanced data streams introduce a more realistic scenario without equality assumptions on the task durations in $S$ and address the literature mostly balancing the data streams artificially. Besides the imbalanced Split-MNIST setup (Aljundi et al., 2019b), we introduce two novel and more challenging benchmarks based on Split-CIFAR10 and Split-CIFAR100, where data stream $S$ comprises significantly more data in task $T _ { i }$ , denoted by $S ( T _ { i } )$ . Split-MNIST and Split-CIFAR10 have respectively $2 \mathrm { k }$ and 4k samples in $T _ { i }$ , whereas tasks $T _ { j }$ for $j \neq i$ contain factor 10 less data for five variants $S ( T _ { i } )$ , $\forall i \in \{ 1 , . . . , 5 \}$ . Split-CIFAR100 defines $T _ { i }$ with $2 . 5 \mathrm { k }$ samples and 1k for the remaining tasks, with variants $i \in \{ 1 , 5 , . . . , 2 0 \}$ .
|
| 108 |
+
|
| 109 |
+
Architectures. MNIST setups use an MLP with 2 hidden layers of 400 units with $2 \mathrm { k }$ memories for the balanced setup as in (Hsu et al., 2018; Lee et al., 2020; van de Ven & Tolias, 2019), and 100 units with $| \mathcal { M } | = 0 . 3 \mathrm { k }$ for the imbalanced setup as in (Aljundi et al., 2019b). CIFAR setups use a slim version of Resnet18 (He et al., 2016) with a 1k memory size for CIFAR10 (Aljundi et al., 2019b; Lee et al., 2020), and $5 \mathrm { k }$ for CIFAR100 (Lopez-Paz & Ranzato, 2017).
|
| 110 |
+
|
| 111 |
+
Methods compared to CoPE entail 11 baselines, with details on prior work discussed in Section 3. The upper reference point for performance when relaxing the challenging non-iid feature in continual learning is set by iid-online & iid-offline. The learner shuffles the full data stream $S$ to ensure the iid property, for which iid-online trains a single epoch and iid-offline multiple epochs. In contrast, the finetune learner considers non-iid data stream $S$ sequentially, but optimizes solely for the new batch which typically results in worst-case catastrophic forgetting. CoPE-CE is a reference point for the merits of a prototypical approach by solely using the CoPE memory and sampling scheme, but with a typical cross-entropy loss and softmax classifier. GEM and iCaRL are standard replay methods considered in a class incremental setup, with the learner requiring task boundaries. For online data incremental learning, we consider the reservoir, MIR and greedy GSS replay baselines, with CURL and CN-DPM instead relying on model expansion.
|
| 112 |
+
|
| 113 |
+
Table 1: The three balanced data stream accuracies $( \% )$ with standard deviation over 5 initializations. Expansion-based methods CURL and DN-CPM report results from their original work.
|
| 114 |
+
|
| 115 |
+
<table><tr><td></td><td>Split-MNIST</td><td>Split-CIFAR10</td><td>Split-CIFAR100</td></tr><tr><td>iid-offline</td><td>98.44 ± 0.02</td><td>83.02 ±0.60</td><td>50.28±0.66</td></tr><tr><td>iid-online</td><td>96.57 ± 0.14</td><td>62.31 ± 1.67</td><td>20.10 ±0.90</td></tr><tr><td>finetune</td><td>19.75 ± 0.05</td><td>18.55 ± 0.34</td><td>3.53± 0.04</td></tr><tr><td>GEM</td><td>93.25 ±0.36</td><td>24.13 ± 2.46</td><td>11.12 ± 2.48</td></tr><tr><td>iCARL</td><td>83.95 ±0.21</td><td>37.32 ± 2.66</td><td>10.80 ± 0.37</td></tr><tr><td>CURL (Rao et al., 2019)</td><td>92.59 ±0.66</td><td>1</td><td>1</td></tr><tr><td>DN-CPM (Lee et al.,2020)</td><td>93.23±0.09</td><td>45.21 ± 0.18</td><td>20.10 ±0.12</td></tr><tr><td>reservoir</td><td>92.16 ±0.75</td><td>42.48 ± 3.04</td><td>19.57 ± 1.79</td></tr><tr><td>MIR</td><td>93.20±0.36</td><td>42.80 ± 2.22</td><td>20.00±0.57</td></tr><tr><td>GSS</td><td>92.47 ± 0.92</td><td>38.45 ± 1.41</td><td>13.10 ± 0.94</td></tr><tr><td>CoPE-CE</td><td>91.77 ± 0.87</td><td>39.73 ± 2.26</td><td>18.33 ± 1.52</td></tr><tr><td>CoPE (ours)</td><td>93.94± 0.20</td><td>48.92 ± 1.32</td><td>21.62±0.69</td></tr></table>
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Balanced SplitMNIST first seed $S _ { e v a l }$ t-SNE (Maaten & Hinton, 2008).
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Accuracies over buffer sizes $| { \mathcal { M } } |$ for balanced Split-MNIST and Split-CIFAR10 sequences. The legend reports averages over all observed buffer sizes. $\ast ^ { \ast }$ indicates learner with task information.
|
| 122 |
+
|
| 123 |
+
# 6 RESULTS AND DISCUSSION
|
| 124 |
+
|
| 125 |
+
# 6.1 BALANCED DATA STREAMS
|
| 126 |
+
|
| 127 |
+
The results for the three balanced data streams in Table 1 consistently report state-of-the-art for CoPE. The difficulty for learning online is reflected in the discrepancy of performance between iid-offline and iid-online, indicating increasing difficulty for a minimal $2 \%$ for Split-MNIST, raising by factor 10 for Split-CIFAR10, and culminating to $3 0 \%$ in Split-CIFAR100. For Split-MNIST the gap with iid-online performance is closed by $0 . 7 \%$ compared to main competitors GEM and DN-CPM, with our representations visualized in Figure 3. Furthermore, in the more challenging Split-CIFAR10 setup we significantly increase the gained margin by $3 . 7 \%$ . In the most challenging Split-CIFAR100, CN-DPM, Reservoir and MIR are able to perform on par with the iid-online baseline, however, CoPE establishes an improvement of at least $1 . { \bar { 5 } } \%$ over all four baselines.
|
| 128 |
+
|
| 129 |
+
Compared to balanced replay with standard cross-entropy (CoPE-CE), the prototypical approach (CoPE) proves effective with significant gains of $2 . 2 \%$ , $9 . 2 \%$ and $3 . 3 \%$ respectively over the three benchmarks. Except for GEM in Split-MNIST, class incremental learning methods GEM and iCaRL are not competing in the online setting and additionally require from the setup to reveal an identifier $t$ to the learner. From the expansion-based methods DN-CPM is competitive, whereas CURL is more suited for unsupervised learning and lacks behind. Although Reservoir and extension MIR perform on par with iid-online for Split-CIFAR100, the imbalanced experiments in Section 6.2 show that full reservoir-based population of the buffer strongly relies on this assumption of equally sized tasks, which is unlikely to occur in real-world data streams.
|
| 130 |
+
|
| 131 |
+
Buffer size ablation study in Figure 4 shows CoPE to prevail over all sizes of replay buffer $\mathcal { M } _ { r }$ compared to other replay methods, extending robustness to low capacity regimes. Although iCaRL shows competitive results for low capacity, CoPE scales with growing capacity leading to significantly outperforming iCaRL with $1 1 \%$ in Split-MNIST $( 2 k )$ and Split-CIFAR100 $( 5 k )$ , and $1 7 \%$ in SplitCIFAR10 $( 2 k )$ . We refer to Appendix E for the Split-CIFAR100 results.
|
| 132 |
+
|
| 133 |
+
# 6.2 IMBALANCED DATA STREAMS
|
| 134 |
+
|
| 135 |
+
Results for the highly imbalanced data stream benchmarks are reported in Figure 4. CoPE significantly outperforms all baselines in the three scenarios, with low standard deviation for the 15 variants indicating robustness over a wide spectrum of imbalanced sequences. Gradient-based sample selection (GSS) outperforms Reservoir and MIR for Split-MNIST, in correspondence with results in Aljundi et al. (2019b), whereas loss-based retrieval in MIR has significant gains for the challenging SplitCIFAR100 setting. However, CoPE surpasses both GSS and MIR for all three benchmarks, and on top of that operates profusely more resource efficient as discussed in Appendix C. The balancing memory scheme in CoPE-CE highly improves Reservoir over imbalanced Split-MNIST and Split-CIFAR10 variants with $1 0 . 8 \%$ and $3 . 4 \%$ respectively, and performs on par for Split-CIFAR100 where balancing over 100 classes with limited batch size proves more difficult. Although CoPE and CoPE-CE share memory and retrieval schemes, the prototypical CoPE surpasses the cross-entropy based CoPE-CE with $4 . 0 \%$ , $2 . 9 \%$ and $6 . 7 \%$ respectively on the three benchmarks, indicating the merits of the PPP-loss and continually evolving prototypes. Figure 6 compares the CoPE and CoPE-CE confusion matrices at the end of learning, showing that CoPE better preserves the recall over early learned classes. CoPE-CE exhibits high plasticity as classes 8 and 9 of the last task have high recall compared to the earlier learned classes. Hence, CoPE seems to better preserve stability, effectively alleviating catastrophic forgetting.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: Accuracy $( \% )$ for imbalanced Split-MNIST (left), Split-CIFAR10 (center) and SplitCIFAR100 (right) sequences. The legend reports average accuracies over all the sequence variations.
|
| 139 |
+
|
| 140 |
+
# 6.3 PPP-LOSS ANALYSIS
|
| 141 |
+
|
| 142 |
+
In the challenging setting for online processing of non-iid data streams, the PPP-loss exploits information in the small processing batch $B$ , introducing pseudo-prototypes $\hat { \bf p }$ on top of the prototypes. This leads to questioning to what extent the pseudo-prototypes actually contribute to the quality of the embedding, and how this relates to the batch size. We examine both inquiries in Table 2 for the three balanced data streams by comparing inclusion and exclusion of the pseudo-prototypes $\hat { \bf p }$ in the PPP-loss, and extending the batch size $\left| B _ { n } \right|$ . First, including the pseudo-prototypes significantly improves overall performance, and especially for the harder CIFAR-based data streams. Although both setups use batch information to update the prototypes following Eq.(1), it seems crucial to use additional pseudo-prototypes in the PPP-loss to improve latent space quality. Second, results for smaller batch sizes of 10 and 20 are very similar, and deteriorate towards increasing sizes. The PPP-loss implements the expectation over the prototype and the pseudo-prototypes, assuming uniform distribution in Eq.(3). Although this assumption impedes significance of the prototype for increasingly higher batch sizes, it results in ideal robustness for small online processing batches, ideally suited for data incremental learning. Small batches maintain the additional benefit of more frequent prototype updates for the same amount of processed data.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: CoPE and CoPE-CE confusion matrices at the end of learning averaged over all variations $S ( T _ { i } )$ for the imbalanced Split-MNIST setup in (a) and (b), and Split-CIFAR10 in (c) and (d).
|
| 146 |
+
|
| 147 |
+
Table 2: Accuracies $( \% )$ for ablating pseudo-prototypes $\hat { \bf p }$ in the PPP-loss and varying batch size.
|
| 148 |
+
|
| 149 |
+
<table><tr><td></td><td colspan="2">PPP-loss</td><td colspan="5">Batch Size |Bnl</td></tr><tr><td></td><td>incl. p</td><td>excl. p</td><td>10 (Online)</td><td>20</td><td>50</td><td>100</td><td>200</td></tr><tr><td>Split-MNIST</td><td>93.9± 0.2</td><td>92.4±0.6</td><td>93.9±0.2</td><td>93.9± 0.6</td><td>93.7± 0.3</td><td>93.1±0.6</td><td>89.3± 0.5</td></tr><tr><td>Split-CIFAR10</td><td>48.9 ± 1.3</td><td>41.3 ± 2.0</td><td>48.9 ± 1.3</td><td>48.4± 1.9</td><td>43.4 ± 2.7</td><td>37.4 ± 3.0</td><td>37.0 ± 1.3</td></tr><tr><td>Split-CIFAR100</td><td>21.6 ±0.7</td><td>16.3 ± 0.7</td><td>21.6 ±0.7</td><td>21.7±0.7</td><td>16.5 ± 0.4</td><td>13.8± 0.5</td><td>11.2 ± 0.4</td></tr></table>
|
| 150 |
+
|
| 151 |
+
# 7 CONCLUSION
|
| 152 |
+
|
| 153 |
+
In this work, we introduced a new perspective on current paradigms in continual learning with a novel two-agent learner-evaluator framework. To overcome the standard paradigm of static training and testing phases, we explicitly model continual optimization and evaluation in the learner and evaluator agents respectively. We formalized the required resources as the horizon $\mathcal { D }$ , containing the simultaneously available data of the data stream, and the operational memory $\mathcal { M }$ for operation of the learning algorithm. Transitions in the horizon $\mathcal { D } _ { t } \to \mathcal { D } _ { t + 1 }$ enable a uniform differentiation between existing paradigms of task, class and domain incremental learning, and the horizon size encloses the range from online $\mathcal { D } = B$ ) to offline ( $\mathcal { D } = S$ ) learning.
|
| 154 |
+
|
| 155 |
+
Using the framework, we defined the task-free data incremental learning paradigm, requiring no additional information on the identifier $t$ of the horizon for both the learner and evaluator. In this challenging setup, we proposed Continual Prototype Evolution (CoPE) as a prototypical solution to learn online from non-stationary data streams. As a first, CoPE prevents the prototypes becoming obsolete in an ever evolving representation space, while using the prototypes to combat catastrophic forgetting. The three main components, continually evolving prototypes, a novel Pseudo-Prototypical Proxy loss (PPP-loss), and an efficient balancing replay scheme are proven remarkably effective over 11 baselines in both balanced and highly imbalanced benchmarks. We hope to encourage research in the direction of data incremental learning with online processing of data streams and applications beyond classification.
|
| 156 |
+
|
| 157 |
+
# REFERENCES
|
| 158 |
+
|
| 159 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 139–154, 2018.
|
| 160 |
+
|
| 161 |
+
Rahaf Aljundi, Eugene Belilovsky, Tinne Tuytelaars, Laurent Charlin, Massimo Caccia, Min Lin, and Lucas Page-Caccia. Online continual learning with maximal interfered retrieval. In Advances in Neural Information Processing Systems, pp. 11849–11860, 2019a.
|
| 162 |
+
|
| 163 |
+
Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In Advances in Neural Information Processing Systems, pp. 11816– 11825, 2019b.
|
| 164 |
+
|
| 165 |
+
Arindam Banerjee, Srujana Merugu, Inderjit S Dhillon, and Joydeep Ghosh. Clustering with bregman divergences. Journal of machine learning research, 6(Oct):1705–1749, 2005.
|
| 166 |
+
|
| 167 |
+
Francisco M Castro, Manuel J Marín-Jiménez, Nicolás Guil, Cordelia Schmid, and Karteek Alahari. End-to-end incremental learning. In Proceedings of the European conference on computer vision (ECCV), pp. 233–248, 2018.
|
| 168 |
+
|
| 169 |
+
Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K Dokania, Philip HS Torr, and Marc’Aurelio Ranzato. Continual learning with tiny episodic memories. arXiv preprint arXiv:1902.10486, 2019.
|
| 170 |
+
|
| 171 |
+
Aristotelis Chrysakis and Marie-Francine Moens. Online continual learning from imbalanced data. Proceedings of Machine Learning Research, 2020.
|
| 172 |
+
|
| 173 |
+
Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. arXiv preprint arXiv:1909.08383, 2019.
|
| 174 |
+
|
| 175 |
+
Matthias De Lange, Xu Jia, Sarah Parisot, Ales Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. Unsupervised model personalization while preserving privacy and scalability: An open problem. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14463–14472, 2020.
|
| 176 |
+
|
| 177 |
+
Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3 (4):128–135, 1999.
|
| 178 |
+
|
| 179 |
+
João Gama, Indre Žliobait ˙ e, Albert Bifet, Mykola Pechenizkiy, and Abdelhamid Bouchachia. A ˙ survey on concept drift adaptation. ACM computing surveys (CSUR), 46(4):1–37, 2014.
|
| 180 |
+
|
| 181 |
+
Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013.
|
| 182 |
+
|
| 183 |
+
Stephen Grossberg. Studies of mind and brain : neural principles of learning, perception, development, cognition, and motor control. Boston studies in the philosophy of science 70. Reidel, Dordrecht, 1982. ISBN 9027713596.
|
| 184 |
+
|
| 185 |
+
Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), volume 2, pp. 1735–1742. IEEE, 2006.
|
| 186 |
+
|
| 187 |
+
Xu Han, Yi Dai, Tianyu Gao, Yankai Lin, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. Continual relation learning via episodic memory activation and reconsolidation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 6429–6440, 2020.
|
| 188 |
+
|
| 189 |
+
Ben Harwood, BG Kumar, Gustavo Carneiro, Ian Reid, Tom Drummond, et al. Smart mining for deep metric learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2821–2829, 2017.
|
| 190 |
+
|
| 191 |
+
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.
|
| 192 |
+
|
| 193 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 194 |
+
|
| 195 |
+
Yen-Chang Hsu, Yen-Cheng Liu, Anita Ramasamy, and Zsolt Kira. Re-evaluating continual learning scenarios: A categorization and case for strong baselines. arXiv preprint arXiv:1810.12488, 2018.
|
| 196 |
+
|
| 197 |
+
Daniel Kahneman and Amos Tversky. Subjective probability: A judgment of representativeness. Cognitive psychology, 3(3):430–454, 1972.
|
| 198 |
+
|
| 199 |
+
Nitin Kamra, Umang Gupta, and Yan Liu. Deep generative dual memory network for continual learning. arXiv preprint arXiv:1710.10368, 2017.
|
| 200 |
+
|
| 201 |
+
Chris Dongjoo Kim, Jinseo Jeong, and Gunhee Kim. Imbalanced continual learning with partitioning reservoir sampling. arXiv preprint arXiv:2009.03632, 2020.
|
| 202 |
+
|
| 203 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114 (13):3521–3526, 2017.
|
| 204 |
+
|
| 205 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 206 |
+
|
| 207 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 208 |
+
|
| 209 |
+
Soochan Lee, Junsoo Ha, Dongsu Zhang, and Gunhee Kim. A neural dirichlet process mixture model for task-free continual learning. arXiv preprint arXiv:2001.00689, 2020.
|
| 210 |
+
|
| 211 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947, 2017.
|
| 212 |
+
|
| 213 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6467–6476, 2017.
|
| 214 |
+
|
| 215 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 216 |
+
|
| 217 |
+
Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7765–7773, 2018.
|
| 218 |
+
|
| 219 |
+
Thomas Mensink, Jakob Verbeek, Florent Perronnin, and Gabriela Csurka. Distance-based image classification: Generalizing to new classes at near-zero cost. IEEE transactions on pattern analysis and machine intelligence, 35(11):2624–2637, 2013.
|
| 220 |
+
|
| 221 |
+
Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4004–4012, 2016.
|
| 222 |
+
|
| 223 |
+
Dushyant Rao, Francesco Visin, Andrei Rusu, Razvan Pascanu, Yee Whye Teh, and Raia Hadsell. Continual unsupervised representation learning. In Advances in Neural Information Processing Systems, pp. 7645–7655, 2019.
|
| 224 |
+
|
| 225 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2001–2010, 2017.
|
| 226 |
+
|
| 227 |
+
Jeffrey C Schlimmer and Richard H Granger. Beyond incremental processing: Tracking concept drift. In AAAI, pp. 502–507, 1986.
|
| 228 |
+
|
| 229 |
+
Ari Seff, Alex Beatson, Daniel Suo, and Han Liu. Continual learning in generative adversarial nets. arXiv preprint arXiv:1705.08395, 2017.
|
| 230 |
+
Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. arXiv preprint arXiv:1801.01423, 2018.
|
| 231 |
+
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Advances in Neural Information Processing Systems, pp. 2990–2999, 2017.
|
| 232 |
+
Konstantin Shmelkov, Cordelia Schmid, and Karteek Alahari. Incremental learning of object detectors without catastrophic forgetting. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3400–3409, 2017.
|
| 233 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pp. 4077–4087, 2017.
|
| 234 |
+
Alexey Tsymbal. The problem of concept drift: definitions and related work. Computer Science Department, Trinity College Dublin, 106(2):58, 2004.
|
| 235 |
+
Gido M van de Ven and Andreas S Tolias. Generative replay with feedback connections as a general strategy for continual learning. arXiv preprint arXiv:1809.10635, 2018.
|
| 236 |
+
Gido M van de Ven and Andreas S Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019.
|
| 237 |
+
Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37–57, 1985.
|
| 238 |
+
Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, Zhengyou Zhang, and Yun Fu. Incremental classifier learning with generative adversarial networks. arXiv preprint arXiv:1802.00853, 2018.
|
| 239 |
+
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 Conference on Computer Vision and Pattern Recognition, pp. 6210–6219, 2019.
|
| 240 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3987– 3995. JMLR. org, 2017.
|
| 241 |
+
|
| 242 |
+
# APPENDIX
|
| 243 |
+
|
| 244 |
+
# A ALGORITHM
|
| 245 |
+
|
| 246 |
+
Our proposed algorithm is fully formalized in this section, as well as in our code that will be made publicly available on acceptance of this paper. Algorithm 1 and Algorithm 2 describe the learner for CoPE, whereas the evaluator uses $c ^ { * } = { \arg \operatorname* { m a x } _ { c \in \mathcal { Y } } \mathbf { f } _ { i } ^ { T } \ \mathbf { p } ^ { c } }$ , classifying $\mathbf { x } _ { i }$ as category $c ^ { * }$ with the most similar prototype $\mathbf { p } ^ { c ^ { * } }$ . As for a true continually progressing system, the evaluator can urge prediction at any point in time, while the learner keeps acquiring knowledge from the data stream.
|
| 247 |
+
|
| 248 |
+
Algorithm 1 The CoPE learner in the data incremental learning setup.
|
| 249 |
+
Require: data stream $S$ , prototype momentum $\alpha$ , memory capacity $M$ , learning rate $\eta$
|
| 250 |
+
Initialize operational memory $\mathcal { M } = \emptyset$ , observed classes $\mathscr { y } = \emptyset$ , sample count per class $N = \emptyset$ ,
|
| 251 |
+
model parameters $\theta$
|
| 252 |
+
1: for $\bar { B _ { n } } \overset { \cdot } { = } \{ ( \mathbf { x } _ { 1 } , \mathbf { y } _ { 1 } ) , . . . , ( \mathbf { x } _ { | B _ { n } | } , \mathbf { y } _ { | B _ { n } | } ) \} \sim S$ do $\triangleright$ Data stream batch w/o task information
|
| 253 |
+
2: $B _ { \mathcal { M } } \gets \mathrm { R A N D O M S A M P L E } ( \mathcal { M } _ { r } , | B _ { n } | )$ $\triangleright$ Randomly sample $\left| B _ { n } \right|$ exemplars from $\mathcal { M } _ { r }$
|
| 254 |
+
3: $B = \varnothing$
|
| 255 |
+
4: for $( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \in B _ { n } \cup B _ { \mathcal { M } }$ do
|
| 256 |
+
5: if $y _ { i } \notin \mathcal { V }$ then
|
| 257 |
+
6: INITCLASS $( \mathcal { M } , N , \mathcal { V } , y _ { i } )$ . Initialize memory and prototype
|
| 258 |
+
7: end if
|
| 259 |
+
8: $B B \cup f _ { \theta } ( \mathbf { x } _ { i } )$ . Collect features
|
| 260 |
+
9: end for
|
| 261 |
+
10: $\mathcal { L } 0$ . Initialize loss
|
| 262 |
+
11: for $\mathbf { f } _ { i } ^ { c } \in \mathcal { B }$ do
|
| 263 |
+
12: $\begin{array} { r l r } { \dot { \mathcal { L } } \gets \mathcal { L } - \frac { 1 } { | \mathcal { B } | } \left[ \log P ( c | { \bf x } _ { i } ^ { c } ) + \sum _ { { \bf x } _ { j } ^ { k } } \log ( 1 - P ( c | { \bf x } _ { j } ^ { k } ) ) \right] } & { } & { \mathrm { s } \operatorname { s u m } \mathrm { a l } \mathrm { i n s t a n c e s } \mathrm { P P P - l o s s } } \end{array}$
|
| 264 |
+
13: end for
|
| 265 |
+
14: θ θ + η . Optimize objective with SGD
|
| 266 |
+
15: $\mathbf { P R O T O T Y P E U P D A T E } ( \mathcal { M } _ { p } , \ B , N , \alpha )$ . Update prototypes in $\mathcal { M } _ { p }$
|
| 267 |
+
16: MEMORYUPDATE $( \mathcal { M } _ { r } , B _ { n } , N )$ . Update memory $\mathcal { M } _ { r }$ with new input samples
|
| 268 |
+
17: end for
|
| 269 |
+
|
| 270 |
+
Algorithm 2 Memory Management of the replay memory and prototypes. UNIFORMRd( samples elements in a $d$ -dimensional vector with uniform probability in range $[ s _ { 1 } , s _ { 2 } ] \in \mathbb { R }$ .
|
| 271 |
+
|
| 272 |
+
<table><tr><td colspan="3">sampies elements ina a-dimensional VectorWitn unilormprobabiityinrange[Si,S2]∈R. Require: memory capacity M 1: function PROTOTYPEUPDATE(Mp, B, N, α)</td></tr><tr><td>1: function INITCLAss(M,N,V, y)</td><td></td><td>2: for pc ∈ Mp do</td></tr><tr><td>2:</td><td>N ← NU{Ny =O} Sample counts</td><td>3: Nc ← Nc+|Bc</td></tr><tr><td>3: y↑yu{}</td><td>Observed classes</td><td>p =Bq∑feeBe fc 4:</td></tr><tr><td>4: m = M/||</td><td>Capacity per class 5:</td><td>p←ap+(1-a)pc</td></tr><tr><td>5:</td><td>for M= (x1,., X|M|) ∈Mr do 6:</td><td>p←p/pll2 Normalize</td></tr><tr><td>6: end for</td><td>M ←(x1,., Xm)> Keep first m 7:</td><td>end for</td></tr><tr><td>7:</td><td></td><td>8: end function</td></tr><tr><td>8:</td><td>M←MU{My =0}</td><td>9: function MEMORYUPDATE(Mr,Bn, N)</td></tr><tr><td>9:</td><td>p ←UNIFORMd(0,1) 10:</td><td>for x ∈ Bn do Class Reservoir</td></tr><tr><td>10: 11:</td><td>My←{p²/|p|l2} Init prototype 11:</td><td>j = UNIFORMN1 (1, Nc)</td></tr><tr><td>end function</td><td>12:</td><td>if j≤|M| then</td></tr><tr><td></td><td>13:</td><td>M [j] ← x Replace exemplar</td></tr><tr><td></td><td>14:</td><td>end if</td></tr><tr><td></td><td>15:</td><td>end for</td></tr><tr><td></td><td>16:</td><td></td></tr><tr><td></td><td></td><td>end function</td></tr></table>
|
| 273 |
+
|
| 274 |
+
# B SETUP
|
| 275 |
+
|
| 276 |
+
A gridsearch in the online continual learning setup was adopted, selecting the setup with highest performance, similar to (Lopez-Paz & Ranzato, 2017). All methods are prone to learning rate gridsearch $[ 0 . 0 5 , 0 . 0 1 , 0 . 0 0 5 , 0 . 0 0 1 ]$ . iCaRL knowledge distillation strength is set to 1, and GEM bias is set to 0.5, following (Lopez-Paz & Ranzato, 2017; Rebuffi et al., 2017; Aljundi et al., 2019b). GSS and MIR follow their original setup from their codebase in (Aljundi et al., 2019b) and (Aljundi et al., 2019a), with our additional learning rate gridsearch. CURL (Rao et al., 2019) and DN-CPM (Lee et al., 2020) results, and the best imbalanced Split-MNIST results out of the greedy/IQP versions for GSS (Aljundi et al., 2019b) are reported from their original works. CoPE searched for a suitable temperature $\tau = [ 0 . 1 , 0 . 2 , . . . , 1 , 2 ]$ which was set to 0.1 for all balanced and imbalanced SplitMNIST and Split-CIFAR10 experiments, similar to (Ye et al., 2019). Based on the ablation study in Appendix D, we set the prototypical momentum fixed to 0.99. For the challenging Split-CIFAR100 setting methods are allowed multiple iterations per batch as in (Lopez-Paz & Ranzato, 2017), from which the best results are selected (baselines, reservoir, CN-DPM perform 1 iteration, others 5). The CIFAR100 temperature required higher concentration with $\tau = 0 . 0 5$ and prototypical momentum 0.9. For the balanced setups, the latent dimensionality $d$ is fixed to 100 for Split-MNIST as in (Rao et al., 2019), and selected 256 in a gridsearch [128, 256] and [128, 256, 512] for Split-CIFAR10 and Split-CIFAR100 respectively. The imbalanced benchmarks follow the low capacity setup in Appendix E.1, with $d \in [ 1 6 , 3 2 , 6 4 ]$ set to 64 for Split-MNIST and $d \in [ 1 2 8 , 2 5 6 ]$ set to 128 for Split-CIFAR10 and 256 for Split-CIFAR100. Results are obtained without L2 normalization of the prototypes as we found it to have insignificant effect. The CIFAR10 labels in the confusion matrices from 0 to 10 stand for the indices in the following list: [airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck]. We will make our code publicly available upon acceptance of this paper to ensure reproducibility.
|
| 277 |
+
|
| 278 |
+
# C RESOURCE ANALYSIS TASK-FREE REPLAY METHODS
|
| 279 |
+
|
| 280 |
+
In this section we compare usage of computational and memory resources for the replay methods fitted for the online data incremental learning paradigm.
|
| 281 |
+
|
| 282 |
+
Reservoir is a powerful baseline for balanced data streams (Chaudhry et al., 2019), with only minimal computational cost by keeping count $n$ of how many samples have been observed. This count is then used relative to the buffer size $M$ to define the probability $M / n$ to store the new sample. As shown in the imbalanced data stream experiments, Reservoir is not fit for more real-world scenarios with typically varying frequency of occurrence per class. Improving this simple experience replay has led to research focusing on more complex strategies, discussed in the following.
|
| 283 |
+
|
| 284 |
+
MIR (Aljundi et al., 2019a) replaces the random retrieval from the buffer in Reservoir with a lossbased approach. They store a momentary update of the network optimized for the new incoming batch and calculate the change in loss for a random subset of replay memories $\tilde { B }$ , which is larger than the batch size (ideally five times the batch size for their experiments (Aljundi et al., 2019a)). Besides a copy of the full model, this also requires calculating the loss twice in a sequential manner for the full subset $\tilde { B }$ and an extra temporary model update using only the new batch $B _ { n }$ , both significantly increasing processing time for the learner.
|
| 285 |
+
|
| 286 |
+
GSS (Aljundi et al., 2019b) resides with Reservoir to use random retrieval of the buffer, but proposes a gradient-based population strategy. They introduce two variants, in which the first solves an Integer Quadratic Problem (IQP) with polynomial complexity w.r.t. the replay memory. As this is not scalable, they also propose a stochastic GSS-greedy variant. This more efficient GSS-greedy approach requires an additional forward pass, loss calculation, and backwards pass to obtain the gradients for the full considered subset $\tilde { B }$ in the memory. Additionally, it uses similarities of the gradients for stochastic sample selection in the replay memory $\mathcal { M } _ { r }$ , straining memory requirements as batch $B _ { n }$ requires for each sample $| \tilde { B } | + 1$ gradients to be accessed simultaneously to calculate $| \tilde { B } |$ cosine similarities in the high-dimensional gradient-space.
|
| 287 |
+
|
| 288 |
+
CoPE (ours) resembles Reservoir’s memory population by keeping count of the samples per classspecific replay memory subset. The PPP-loss requires calculation of a similarity matrix with all the $d$ -dimensional representations in the batch $B$ . Using a normalized cosine similarity, this implies efficient matrix multiplication with the low-dimensional vectors. This is in high contrast to GSS, which calculates cosine similarity in the full high-dimensional gradient space for additional samples that are not present in current batch $B$ , and therefore requires additional costly forward and backward passes. Furthermore, in our prototypical approach the prototype momentum updates also rely solely on samples that are in the current batch $B$ , hence requiring only minimal additional computation. Comparing to both MIR and GSS, we don’t require storing model copies or additional gradients, but merely store low-dimensional prototypes for each class, saving a significant amount of required storage space. For example, a Resnet18 model requires 11.7 million parameters to enable model copies or gradients, whereas our method even for 1000-way classification with $d = 1 0 2 4$ would require only $9 \%$ of the model capacity in memory for the prototypes.
|
| 289 |
+
|
| 290 |
+
# D EXTENDED ABLATION STUDY
|
| 291 |
+
|
| 292 |
+
# D.1 ABLATION PROTOTYPE MOMENTUM
|
| 293 |
+
|
| 294 |
+
In all experiments, a high momentum is employed to update prototypes with the latent mean of the batch. Table 3 illustrates the influence of higher momentum $( \geq 0 . 9 )$ . Compared to low momentum of 0.1, Split-MNIST only gains a small margin of $0 . 4 5 \%$ , whereas Split-CIFAR10 and Split-CIFAR100 significantly improve with at least $3 . 0 \%$ and $4 . 2 \%$ respectively. Using momentum prevents the prototype to rely solely on the current batch instances, and higher momentum values attain a more gradual change of the prototypes by stabilizing its trajectory in the ever-evolving latent space.
|
| 295 |
+
|
| 296 |
+
Table 3: Ablation study changing momentum strength for prototype updates, reported in average accuracy $( \% )$ over 5 runs. Higher momentum values $( \geq 0 . 9 )$ obtain better performance, especially for the CIFAR sequences, compared to low momentum (0.1).
|
| 297 |
+
|
| 298 |
+
<table><tr><td></td><td colspan="4">Prototype Momentum</td></tr><tr><td></td><td>0.1</td><td>0.9</td><td>0.95</td><td>0.99</td></tr><tr><td>Split-MNIST</td><td>93.49 ± 0.70</td><td>94.11 ± 0.34</td><td>93.96 ± 0.30</td><td>93.94 ± 0.20</td></tr><tr><td>Split-CIFAR10</td><td>44.48 ± 3.19</td><td>48.02 ± 2.49</td><td>47.98 ± 3.14</td><td>48.92 ± 1.32</td></tr><tr><td>Split-CIFAR100</td><td>15.79 ± 1.16</td><td>21.62 ± 0.69</td><td>21.56 ± 0.58</td><td>20.01 ± 1.81</td></tr></table>
|
| 299 |
+
|
| 300 |
+
# D.2 ABLATION INTER AND INTRA-CLASS VARIANCE TERMS PPP-LOSS
|
| 301 |
+
|
| 302 |
+
In this section, the importance is scrutinized of the two loss components to enhance inter and intraclass variance in the PPP-loss. Table 4 compares using only positive pairs from the batch in the attractor $( \mathcal { L } _ { p o s } )$ or only negative pairs in the repellor $( \mathcal { L } _ { n e g } )$ to the full-fledged PPP-loss $( \mathcal { L } )$ . The attractor term shows competitive performance to the full PPP-loss for Split-MNIST, but deteriorates as the data streams become harder for the CIFAR setups. The repellor term is on par with the full PPP-loss for Split-MNIST and Split-CIFAR10, but collapses for Split-CIFAR100. The latter is challenging due to the high number of classes with only a batch size of 10, which impedes having pseudo-prototypes of all classes in the same batch. The PPP-loss incorporates both reduction of intra-class variance with the attractor term and increases inter-class variance with the repellor term, attaining state-of-the-art performance.
|
| 303 |
+
|
| 304 |
+
Besides isolating the attractor and repellor terms of the PPP-loss in the ablation study, we further investigate the weighing of the two terms during the lifetime of the learner in Figure 7. We average results over 5 runs for balanced Split-MNIST, finding the repellor to dominate. This trend is to be expected as the repellor term in Eq.(5) has per instance a summation over all other class instances. The attractor term has minimal influence especially for data presented for the first task. This indicates the samples in the binary latent space (having observed only two classes) majorly repelling rather than attracting samples. The embedding network is still learning the initial features, and overlap in the two latent class distributions summed over the other class samples results in a prevailing repellor term.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 7: Weighing $( \% )$ between the positive loss term $\mathcal { L } _ { p o s }$ compared to the full PPP-loss $\mathcal { L }$ averaged over 5 runs of balanced Split-MNIST with standard deviation in blue.
|
| 308 |
+
|
| 309 |
+
# D.3 PSEUDO-PROTOTYPE ABLATION VISUALIZATION
|
| 310 |
+
|
| 311 |
+
In the main paper we find in an ablation study that using pseudo-prototypes $\hat { \bf p }$ as proxy for the class-mean has significant improvements for the PPP-loss. Additionally, Figure 8 shows this in a 2-dimensional t-SNE space for the first seed of the balanced Split-MNIST experiment. Including the pseudo-prototypes (incl. pˆ) illustrates a striking degree of inter-class variance in Figure 8a, whereas more interference occurs when excluding the pseudo-prototypes in Figure 8b. This is reflected in the performance, as including prototypes results in $9 4 . 5 2 \%$ accuracy, whereas excluding them has only $\bar { 9 0 . 8 6 \% }$ for the first seed.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 8: Split-MNIST first seed t-SNE representation of the test data $S _ { e v a l }$ , including (a) and excluding (b) the pseudo-prototypes $\hat { \bf p }$ in the PPP-loss.
|
| 315 |
+
|
| 316 |
+
# E ADDITIONAL EXPERIMENTS
|
| 317 |
+
|
| 318 |
+
# E.1 BALANCED DATA STREAMS WITH LOW CAPACITY
|
| 319 |
+
|
| 320 |
+
In these experiments we scrutinize performance of CoPE with less capacity in the memory and model, and with shorter data streams. All methods are allowed multiple iterations (maximal 5) as in (Aljundi et al., 2019b). Results are averaged over 5 seeds. Similar to the setup of GSS (Aljundi et al., 2019b), we adopt two data sequences with truncated data per task:
|
| 321 |
+
|
| 322 |
+
• Split-MNIST-mini is similar to the Split-MNIST data stream with 5 tasks, but each task is confined to 1k training samples. Evaluation considers the full test subset. The network is an MLP with two hidden layers of 100 units, with total memory size of $0 . 3 \mathrm { k }$ exemplars. Latent dimensionality $d$ is selected 32 from [16, 32, 64].
|
| 323 |
+
Split-CIFAR10-mini is similar to the Split-CIFAR10 data stream with 5 tasks, but each task comprises $2 \mathrm { k }$ training samples, with a total subset of 10k samples out of the $5 0 \mathrm { k }$ available. The full test subset is used for evaluation. The network used is the same ResNet18 as in the main paper, with total memory size of 1k exemplars. Latent dimensionality $d$ is selected 128 from [128, 256].
|
| 324 |
+
|
| 325 |
+
Analysis. Table 5 shows the results for Split-MNIST-mini and Split-CIFAR10-mini, with GSS and DN-CPM results reported from their original works in a corresponding setup. In Split-MNIST-mini our method approaches the iid-online baseline up to $1 \%$ , and outperforms its closest competitors GEM and MIR with at least $1 . 4 5 \%$ . In Split-CIFAR10-mini CoPE saliently surpasses the iid-online baseline with $2 . 2 5 \%$ , hence outperforming online training over an iid datastream. Moreover, CoPE surpasses CN-DPM by $3 \%$ . Reservoir proves a strong baseline, with in this case the additional MIR loss-based retrieval decreasing performance. Similar to our findings in the main paper and Aljundi et al. (2019a;b), GEM encounters difficulties in a CIFAR10 based setup, for which we find the bias hyperparameter $\gamma \geq 0$ in the gradient projection to have insignificant influence. These results confirm CoPE outperforming both GSS and CN-DPM in this low capacity setting established in their original work.
|
| 326 |
+
|
| 327 |
+
Table 5: Split-MNIST-mini and Split-CIFAR10-mini results, with respectively only 1k and 2k samples per task. GSS and DN-CPM results reported from original work in these setups.
|
| 328 |
+
|
| 329 |
+
<table><tr><td></td><td>Split-MNIST-mini</td><td>Split-CIFAR10-mini</td></tr><tr><td>iid-offline</td><td>94.58 ± 0.17</td><td>67.41 ± 1.37</td></tr><tr><td>iid-online</td><td>87.57 ± 3.54</td><td>42.50 ± 2.15</td></tr><tr><td>finetune</td><td>21.74 ± 3.38</td><td>16.65 ± 0.24</td></tr><tr><td>GEM</td><td>85.09 ± 0.52</td><td>22.31 ± 1.37</td></tr><tr><td>iCaRL</td><td>83.23 ± 0.92</td><td>26.54 ± 2.73</td></tr><tr><td>DN-CPM (Lee et al., 2020)</td><td></td><td>41.78</td></tr><tr><td>reservoir</td><td>82.73 ± 2.39</td><td>38.21 ± 3.39</td></tr><tr><td>MIR</td><td>84.40 ± 0.91</td><td>37.20 ± 2.74</td></tr><tr><td>GSS (Aljundi et al., 2019b)</td><td>82.60 ± 2.90</td><td>33.56 ± 1.70</td></tr><tr><td>CoPE</td><td>86.54± 1.41</td><td>44.75 ± 2.68</td></tr></table>
|
| 330 |
+
|
| 331 |
+
# E.2 BUFFER SIZE ANALYSIS: SPLIT-CIFAR100
|
| 332 |
+
|
| 333 |
+
The results for Split-CIFAR10 and Split-MNIST are reported in the main paper, whereas SplitCIFAR100 results are added here in Figure 9 due to lack of space. We observe the same trend, where CoPE prevails over other replay methods by high margin from low to high-capacity regimes. The performance of the learner in CoPE scales with the size of $\mathcal { M } _ { r }$ .
|
| 334 |
+
|
| 335 |
+
# E.3 UNABALANCED BENCHMARK RESULTS
|
| 336 |
+
|
| 337 |
+
The graphs in the main paper visualize the numbers in Table 6, which we fully report here as a reference for future work. Each $S ( T _ { i } )$ data stream performance is averaged over five different initial seeds. The ’Avg.’ results average over all mean performances of the dataset variants $S ( T _ { i } )$ .
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 9: Accuracies over buffer sizes $| { \mathcal { M } } |$ for balanced Split-CIFAR100 sequence.
|
| 341 |
+
|
| 342 |
+
Table 6: Numeric results for imbalanced Split-MNIST, Split-CIFAR10 and Split-CIFAR100 sequences.
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Dataset</td><td>Imbalanced Sequence</td><td>CoPE</td><td>CoPE-CE</td><td>GSS</td><td>MIR</td><td>Reservoir</td></tr><tr><td>Split-MNIST</td><td>S(Ti)</td><td>83.4± 2.0</td><td>81.8 ± 1.2</td><td>75.9 ± 3.2</td><td>64.8± 5.1</td><td>64.2 ± 2.3</td></tr><tr><td></td><td>S(T)</td><td>84.5 ± 1.6</td><td>80.1 ± 1.9</td><td>78.5± 2.7</td><td>67.4 ± 3.2</td><td>65.5 ± 4.6</td></tr><tr><td></td><td>S(T)</td><td>85.1± 0.6</td><td>79.6 ± 2.0</td><td>81.5 ± 2.3</td><td>72.4 ± 3.0</td><td>72.1± 4.0</td></tr><tr><td></td><td>S(T4)</td><td>84.8± 1.0</td><td>80.0 ± 3.1</td><td>79.5 ± 0.6</td><td>72.6 ± 3.1</td><td>73.6 ± 2.4</td></tr><tr><td></td><td>S(T)</td><td>84.0 ± 1.3</td><td>80.7 ± 1.8</td><td>79.1± 0.7</td><td>77.2 ± 3.4</td><td>73.2 ± 4.0</td></tr><tr><td></td><td>Avg.</td><td>84.4±0.7</td><td>80.4± 0.9</td><td>78.9 ± 2.0</td><td>70.9 ± 4.9</td><td>69.7 ± 4.5</td></tr><tr><td>Split-CIFAR10</td><td>S(T1)</td><td>39.0 ± 1.3</td><td>36.4 ± 3.0</td><td>32.3 ± 3.0</td><td>32.6 ± 3.6</td><td>35.5 ± 3.4</td></tr><tr><td></td><td>S(T)</td><td>35.3 ± 2.6</td><td>34.1 ± 2.8</td><td>28.3 ± 0.4</td><td>27.2 ± 1.8</td><td>29.3± 2.8</td></tr><tr><td></td><td>S(T)</td><td>36.2 ± 2.5</td><td>34.6 ± 2.5</td><td>29.5 ± 1.5</td><td>29.6 ± 2.1</td><td>31.4± 2.1</td></tr><tr><td></td><td>S(T4)</td><td>39.1 ± 2.4</td><td>33.5 ± 4.2</td><td>34.6 ± 1.3</td><td>31.0 ± 2.3</td><td>32.1± 0.6</td></tr><tr><td></td><td>S(T)</td><td>37.3 ± 3.3</td><td>33.9 ± 2.9</td><td>28.3±2.4</td><td>27.6 ± 2.7</td><td>28.8± 1.9</td></tr><tr><td></td><td>Avg.</td><td>37.4 ± 1.7</td><td>34.5 ± 1.1</td><td>30.6 ± 2.8</td><td>29.6 ± 2.3</td><td>31.4 ± 2.7</td></tr><tr><td>Split-CIFAR100</td><td>S(Ti)</td><td>18.2 ± 0.6</td><td>11.7 ± 0.6</td><td>10.2 ± 0.8</td><td>18.4± 0.9</td><td>11.1± 0.6</td></tr><tr><td></td><td>S(T)</td><td>18.5 ± 1.3</td><td>12.6 ± 1.2</td><td>10.7 ± 0.5</td><td>17.6 ± 0.9</td><td>11.5 ± 1.4</td></tr><tr><td></td><td>S(Ti0)</td><td>19.2 ± 0.9</td><td>11.1 ± 0.7</td><td>11.1 ± 0.3</td><td>17.8 ± 0.7</td><td>11.9 ± 0.7</td></tr><tr><td></td><td>S(T15)</td><td>18.7 ± 0.6</td><td>11.2 ± 0.8</td><td>11.1 ± 0.9</td><td>17.8 ± 0.9</td><td>12.1 ± 0.8</td></tr><tr><td></td><td>S(T20)</td><td>18.5 ± 1.5</td><td>12.8 ± 1.3</td><td>11.1 ± 0.4</td><td>17.6 ± 0.4</td><td>12.5 ± 1.1</td></tr><tr><td></td><td>Avg.</td><td>18.6 ± 0.4</td><td>11.9 ± 0.8</td><td>10.8± 0.4</td><td>17.8 ± 0.3</td><td>11.8 ± 0.5</td></tr></table>
|
md/train/V1N4GEWki_E/V1N4GEWki_E.md
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRADIENT FLOW IN SPARSE NEURAL NETWORKS AND HOW LOTTERY TICKETS WIN
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Sparse Neural Networks (NNs) can match the generalization of dense NNs using a fraction of the compute/storage for inference, and have the potential to enable efficient training. However, naively training unstructured sparse NNs from random initialization results in significantly worse generalization, with the notable exceptions of Lottery Tickets (LTs) and Dynamic Sparse Training (DST). In this work, we attempt to answer: (1) why training unstructured sparse networks from random initialization performs poorly and; and (2) what makes LTs and DST the exceptions? We show that sparse NNs have poor gradient flow at initialization and propose a modified initialization for unstructured connectivity. Furthermore, we find that DST methods significantly improve gradient flow during training over traditional sparse training methods. Finally, we show that LTs do not improve gradient flow, rather their success lies in re-learning the pruning solution they are derived from — however, this comes at the cost of learning novel solutions.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep Neural Networks (DNNs) are the state-of-the-art method for solving problems in computer vision, speech recognition, and many other fields. While early research in deep learning focused on application to new problems, or pushing state-of-the-art performance with ever larger/more computationally expensive models, a broader focus has emerged towards their efficient real-world application. One such focus is on the observation that only a sparse subset of this dense connectivity is required for inference, as apparent in the success of pruning (Han et al., 2015; Mozer et al., 1989b).
|
| 12 |
+
|
| 13 |
+
Pruning has a long history in Neural Network (NN) literature, and remains the most popular approach for finding sparse NNs. Sparse NNs found by pruning algorithms (Han et al., 2015; Louizos et al., 2017; Molchanov et al., 2017; Zhu et al., 2018) (i.e. pruning solutions) can match dense NN generalization with much better efficiency at inference time. However, naively training an (unstructured) sparse NN from a random initialization (i.e. from scratch), typically leads to significantly worse generalization.
|
| 14 |
+
|
| 15 |
+
Two methods in particular have shown some success at addressing this problem — Lottery Tickets (LTs) and Dynamic Sparse Training (DST). The mechanism behind the success of both of these methods is not well understood however, e.g. we don’t know how to find Lottery Tickets (LTs) efficiently; while RigL (Evci et al., 2020), a recent DST method, requires $5 \times$ the training steps to match dense NN generalization. Only in understanding how these methods overcome the difficulty of sparse training can we improve upon them.
|
| 16 |
+
|
| 17 |
+
A significant breakthrough in training DNNs — addressing vanishing and exploding gradients — arose from understanding gradient flow both at initialization, and during training. In this work we investigate the role of gradient flow in the difficulty of training unstructured sparse NNs from random initializations and from LT initializations. Our experimental investigation results in the following insights:
|
| 18 |
+
|
| 19 |
+
1. Sparse NNs have poor gradient flow at initialization. In $\ S 3 . 1$ , $\ S 4 . 1$ we show that existing methods for initializing sparse NNs are incorrect in not considering heterogeneous connectivity. We believe we are the first to show that sparsity-aware initialization methods improve gradient flow and training. 2. Sparse NNs have poor gradient flow during training. In $\ S 3 . 2$ , $\ S 4 . 2$ , we observe that even in sparse NN architectures less sensitive to incorrect initialization, the gradient flow during training is poor. We show that DST methods achieving the best generalization have improved gradient flow. 3. Lottery Tickets don’t improve upon (1) or (2), instead they re-learn the pruning solution. In $\ S 3 . 3$ , $\ S 4 . 3$ we show that a LT initialization resides within the same basin of attraction as the original pruning solution it is derived of, and a LT solution is highly similar to the pruning solution in function space.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
Pruning Pruning is used commonly in Neural Network (NN) literature to obtain sparse networks (Castellano et al., 1997; Hanson et al., 1988; Kusupati et al., 2020; Mozer et al., 1989a,b; Setiono, 1997; Sietsma et al., 1988; Wortsman et al., 2019). Pruning algorithms remove connections of a trained dense network using various criteria including weight magnitude (Han et al., 2016, 2015; Zhu et al., 2018), gradient-based measures (Molchanov et al., 2016), and $2 ^ { \mathrm { n d } }$ -order terms based on the Hessian (Hassibi et al., 1993; LeCun et al., 1990). While the majority of pruning algorithms focus on pruning after training, a subset focuses on pruning NNs before training (Lee et al., 2019; Tanaka et al., 2020; Wang et al., 2020). Gradient Signal Preservation (GRaSP) (Wang et al., 2020) is particularly relevant to our study, since their pruning criteria aims to preserve gradient flow, and they observe a positive correlation between initial gradient flow and final generalization. However, recent work of Frankle et al., 2020b suggests that the reported gains are due to sparsity distributions discovered rather than the particular sub-network. Another limitation of these algorithms is that they don’t scale to large scale tasks like Resnet-50 training on ImageNet-2012.
|
| 24 |
+
|
| 25 |
+
Lottery Tickets Frankle et al. (2019a) showed the existence of sparse sub-networks at initialization — known as Lottery Tickets — which can be trained to match the generalization of the corresponding dense Deep Neural Network (DNN). The initial work of Frankle et al. (2019a) inspired much follow-up work. Gale et al. (2019) and Liu et al. (2019) observed that the initial formulation was not applicable to larger networks with higher learning rates. Frankle et al. (2019b, 2020a) proposed late rewinding as a solution. Morcos et al. (2019) and Sabatelli et al. (2020) showed that Lottery Tickets (LTs) trained on large datasets transfer to smaller ones, but not vice versa. Frankle et al. (2020c), Ramanujan et al. (2019), and Zhou et al. (2019) focused on further understanding LTs, and finding sparse sub-networks at initialization. As one might expect, sufficiently large networks would have smaller solutions hidden in them. Malach et al. (2020) studied this and proved the existence of solutions in sufficiently large networks. However, it is an open question whether finding such networks at initialization could be done more efficiently than with existing pruning algorithms.
|
| 26 |
+
|
| 27 |
+
Dynamic Sparse Training Most training algorithms work on pre-determined architectures and optimize parameters using fixed learning schedules. Dynamic Sparse Training (DST), on the other hand, aims to optimize the sparse NN connectivity jointly with model parameters. Mocanu et al. (2018) and Mostafa et al. (2019) propose replacing low magnitude parameters with random connections and report improved generalization. Dettmers et al. (2019) proposed using momentum values, whereas Evci et al. (2020) used gradient estimates directly to guide the selection of new connections, reporting results that are on par with pruning algorithms. In $\ S 4 . 2$ we study these algorithms and try to understand the role of gradient flow in their success.
|
| 28 |
+
|
| 29 |
+
Random Initialization of Sparse NN In training sparse NN from scratch, the vast majority of pre-exisiting work on training sparse NN has used the common initialization methods (Glorot et al., 2010; He et al., 2015) derived for dense NNs, with only a few notable exceptions. Gale et al. (2019), Liu et al. (2019), and Ramanujan et al. (2019) scaled the variance (fan-in/fan-out) of a sparse NN layer according to the layer’s sparsity, effectively using the standard initialization for a small dense layer of equivalent number of weights as in the sparse model.
|
| 30 |
+
|
| 31 |
+
# 3 Analyzing Gradient Flow in Sparse Neural Networks
|
| 32 |
+
|
| 33 |
+
A significant breakthrough in training very deep NNs arose in addressing the vanishing and exploding gradient problem, both at initialization, and during training. This problem was understood by analyzing the signal propagation within a DNN, and addressed in improved initialization methods (Glorot et al., 2010; He et al., 2015; Xiao et al., 2018) alongside normalization methods, such as Batch Normalization (BatchNorm) (Ioffe et al., 2015). In our work, following Wang et al. (2020), we study these problems using the gradient flow, $\nabla L ( \theta ) ^ { T } \nabla L ( \theta )$ which is the first order approximation\* of the decrease in the loss expected after a gradient step. We observe poor gradient flow for the predominant sparse NN initialization strategy and propose a solution in $\ S 3 . 1$ . Then in $\ S 3 . 2$ and $\ S 3 . 3$ we summarize Dynamic Sparse Training (DST) methods and LT hypothesis respectively.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Glorot/He Initialization for a Sparse NN. All neurons in a dense NN layer (a) have the same fan-in, whereas in a sparse NN (b) the fan-in can differ for every neuron, potentially requiring sampling from a different distribution for every neuron. The initialization derivation/fan-out variant are explained further in Appendix A.1. (c) Std. dev. of the pre-softmax output of LeNet5 with input sampled from a normal distribution, over 5 different randomly-initialized sparse NN for a range of sparsities.
|
| 37 |
+
|
| 38 |
+
# 3.1 The Initialization Problem in Sparse Networks
|
| 39 |
+
|
| 40 |
+
Here we analyze the gradient flow at initialization for random sparse NNs, motivating the derivation of a more general initialization for NN with heterogeneous connectivity, such as in sparse NNs. In practice, without a method such as BatchNorm (Ioffe et al., 2015), using the correct initialization can be the difference between being able to train a DNN, or not — as observed for VGG16 in our results (§4.1, Table 1). The initializations proposed by Glorot et al. (2010) and He et al. (2015) ensure that the output distribution of every neuron in a layer is of zero-mean and unit variance, and do this by sampling a Gaussian distribution with a variance based on the number of incoming/outgoing connections for all the neurons in a dense layer, as illustrated in Fig. 1a, which is assumed to be identical for all neurons in the layer.
|
| 41 |
+
|
| 42 |
+
In an unstructured sparse NN however, the number of incoming/outgoing connections is not identical for all neurons in a layer, as illustrated in Fig. 1b. In Appendix A.2 we derive the initialization for this more general case. In Appendix A.1 we explain in full the generalized Glorot et al. (2010) and He et al. (2015) initialization, in the forward, backward and average use cases. Here we will focus only on explaining the generalized He et al. (2015) initialization for forward propagation, which we used in our experiments.
|
| 43 |
+
|
| 44 |
+
For every weight $w _ { i j } ^ { \left[ \ell \right] } \in W ^ { n ^ { \left[ \ell \right] } \times n ^ { \left[ \ell - 1 \right] } }$ in a layer $\ell$ with $n ^ { \left[ \ell \right] }$ neurons, and mask $[ m _ { i j } ^ { [ \ell ] } ] { = } M ^ { \ell } \in [ 0 , 1 ] ^ { n ^ { [ \ell ] } \times n ^ { [ \ell - 1 ] } }$
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
w _ { i j } ^ { \left[ \ell \right] } \sim \mathcal { N } \Bigg ( 0 , \frac { 2 } { f a n - i n _ { i } ^ { \left[ \ell \right] } } \Bigg ) , \qquad \mathrm { w h e r e } f a n - i n _ { i } ^ { \left[ \ell \right] } = \sum _ { j = 1 } ^ { n ^ { \left[ \ell - 1 \right] } } m _ { i j } ^ { \left[ \ell \right] } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
is the number of incoming connections for neuron $i$ in layer $\ell$ .
|
| 51 |
+
|
| 52 |
+
In the special case of a dense layer where $m _ { i j } ^ { [ \ell ] } = 1 , \forall i , j$ , Eq. (1) reduces to the initialization proposed by (He et al., 2015) since fan- $i n _ { i } ^ { [ \ell ] } { = } n ^ { [ \ell - 1 ] } , \forall i$ . Using the dense initialization in a sparse DNN causes signal to vanish, as empirically observed in Fig. 1c), whereas our initialization keeps the variance of the signal constant. The initialization proposed by Liu et al. (2019) is a special case of ours where it is assumed fan- $i n _ { i } ^ { [ \ell ] } \equiv f a n \ - i n ^ { [ \ell ] } , \forall i ,$ , i.e. all neurons have the same number of unmasked incoming connections in a layer. Surprisingly the initialization of Liu et al. (2019) also preserves the signal in Fig. 1c (discussed in $\ S 4 . 1 \ r _ { , }$ .
|
| 53 |
+
|
| 54 |
+
# 3.2 Gradient Flow during Training and Dynamic Sparse Training
|
| 55 |
+
|
| 56 |
+
While initialization is important for the first training step, the gradient flow during the early stages of training is not well addressed by initialization alone, as shown by normalization methods (Ioffe et al., 2015). Our findings show that even with BatchNorm, the gradient flow during training in unstructured sparse NNs is poor.
|
| 57 |
+
|
| 58 |
+
Recently, a promising new approach to training sparse NNs has emerged — Dynamic Sparse Training (DST) — that learns connectivity adaptively during training, showing significant improvements over baseline methods that use a fixed mask. These methods perform periodic updates on the sparse connectivity of each layer: commonly replacing least magnitude connections with new connections selected using various criteria. We consider two of these methods: Sparse Evolutionary Training (SET) (Mocanu et al.,
|
| 59 |
+
|
| 60 |
+
2018), which chooses new connections randomly and Rigged Lottery (RigL) (Evci et al., 2019), which chooses connections with high gradient magnitude. RigL improves over SET and matches pruning performance with sufficient training time. Since these methods have only recently been proposed, there is a lack of understanding of why and how these methods achieve better results.
|
| 61 |
+
|
| 62 |
+
# 3.3 Lottery Ticket Hypothesis
|
| 63 |
+
|
| 64 |
+
A recent approach for training unstructured sparse NNs while achieving similar generalization to the original dense solution is the Lottery Ticket Hypothesis (LTH) (Frankle et al., 2019a). Notably, rather than training a pruned NN structure from random initialization, the LTH uses the dense initialization from which the pruning solution was trained/derived from.
|
| 65 |
+
|
| 66 |
+
Definition [Lottery Ticket Hypothesis]: Given a NN $f$ with a parameter vector $\theta$ and an optimization function $O ^ { N } ( f , \theta ) \dot { = } \theta ^ { N }$ , which gives the optimized parameters of $f$ after $N$ training steps, there exists a sparse sub-network characterized by the binary mask $M$ such that for some iteration $K$ , $\mathbf { \partial } ^ { \circ ^ { N } } ( f , \theta ^ { K } { * } M )$ performs as well as $O ^ { N } ( f , \theta ) * M$ , whereas the model trained from another random initialization $\theta _ { S }$ , using the same mask $O ^ { N } ( f , \theta _ { S } { * } \dot { M } )$ , typically does not\*. Frankle et al. (2019a) initially claimed the LTH held for $K = 0$ , but later revised this to $N { \gg } K { \ge } 0$ (Frankle et al., 2019b; Liu et al., 2019).
|
| 67 |
+
|
| 68 |
+
LTs enjoy significantly faster convergence compared to regular NN training but require the connectivity mask as found by the pruning solution (Frankle et al., 2019a) along with values from early training (Frankle et al., 2019b). Given the importance of the early phase of training (Frankle et al., $2 0 2 0 \mathrm { c }$ ; Lewkowycz et al., n.d.), it is natural to ask about the difference between lottery tickets and the solution they are derived from (i.e. pruning solutions). Answering this question can help us understand if the success of LTs is primarily due to its relation to the solution, or if we can identify generalizable characteristics that help with sparse NNs training.
|
| 69 |
+
|
| 70 |
+
# 4 Experiments
|
| 71 |
+
|
| 72 |
+
Here we show empirically that (1) sparsity-aware initialization improves gradient flow at initialization for all methods, and achieves higher generalization for networks without BatchNorm, (2) the mask updates of DST methods increase gradient flow and create new negative eigenvalues in the Hessian; which we believe to be the main factor for improved generalization, (3) lottery tickets have poor gradient flow, however they achieve good performance by effectively re-learning the pruning solution, meaning they do not address the problem of training sparse NNs in general. Our experiments include the following settings: LeNet5 on MNIST, VGG16 on ImageNet-2012 and ResNet-50 on ImageNet-2012. Experimental details can be found in Appendix $\mathbf { B } ^ { \dagger }$ .
|
| 73 |
+
|
| 74 |
+
# 4.1 Gradient Flow at Initialization
|
| 75 |
+
|
| 76 |
+
In this section, we measure the gradient flow over the course of the training (Fig. 2) and evaluate the performance of our generalized He initialization method (Table 1), and that proposed by Liu et al. (2019), over the commonly used masked dense initialization. Additional gradient flow plots for the remaining methods are shared in Appendix C. Sparse NN initialized using the initialization distribution of a dense model (Scratch in Fig. 2) start in a flat region where gradient flow is very small and don’t make any early progress. Learning starts after 1000 iterations for LeNet5 and 5000 for VGG-16, however, their generalization is sub-optimal. Liu et al. (2019) claim their proposed initialization has no empirical effect as compared to the masked dense initialization‡. Although technically incorrect (see $\ S 3 . 1 \ r _ { , }$ ), our results show their method to be largely as effective as our proposed initialization. This indicates that the assumption of a mask having roughly uniform mask sparsity is sufficient for the masks we considered. Both of these initializations remedy the vanishing gradient problem at initialization (Scratch+ in Fig. 2) and result in better generalization for all methods. For instance, improved initialization results in an $11 \%$ improvement in Top-1 accuracy for VGG16 (62.52 vs 51.81). While initialization is extremely important for NNs without BatchNorm and skip connections, its effect on modern architectures, such as Resnet-50, is limited (Evci et al., 2019; Frankle et al., 2020b; Zhang et al., 2019). We confirm these observations in our ResNet-50 experiments in which, despite some initial improvement in gradient flow, our initialization seems to have no effect on final generalization. We observe significant increases in gradient norm after each learning rate drop (due to increased variance in gradients), which suggests studying gradient norm in the later part of the training might not be helpful. On the other hand, we observe a significant difference in gradient flow during training between sparse networks and small dense models of a similar parameter count. Can the performance gap between static-sparse and dense models be explained by this difference?
|
| 77 |
+
|
| 78 |
+
Table 1: Results of Trained Sparse/Dense Models from Different Initializations. The initializations proposed in Eq. (1) (Ours) and Liu et al. (2019) improve generalization consistently over masked dense (Original) except for in ResNet50. Note that VGG16 trained without a sparsity-aware initialization fails to converge in some instances. Baseline corresponds to the original dense architecture, whereas Small Dense corresponds to a smaller dense model with approximately the same parameter count as the sparse models.
|
| 79 |
+
|
| 80 |
+
<table><tr><td></td><td colspan="3">MNIST</td><td colspan="6">ImageNet-2012</td></tr><tr><td></td><td colspan="3">LeNet5 (95% sparse)</td><td colspan="3">VGG16 (80% sparse)</td><td colspan="3">ResNet50 (80% sparse)</td></tr><tr><td>Baseline Lottery</td><td colspan="3">99.21±0.07</td><td colspan="3">69.25±0.13</td><td colspan="3">76.75±0.12</td></tr><tr><td>Small</td><td colspan="3">98.26±0.27 98.21±0.46</td><td colspan="3">0.10±0.01</td><td colspan="3">75.75±0.12*</td></tr><tr><td>Dense</td><td colspan="3"></td><td colspan="3">61.75±0.09</td><td colspan="3">71.95±0.24</td></tr><tr><td></td><td>Original</td><td>Liu et al.</td><td>Ours</td><td>Original</td><td>Liu et al.</td><td>Ours</td><td>Original</td><td>Liu et al.</td><td>Ours</td></tr><tr><td>Scratch</td><td>62.99±42.16</td><td>96.64±0.83</td><td>97.70±0.09</td><td>51.81±3.02</td><td>62.71±0.05</td><td>62.52±0.10</td><td>70.58±0.18</td><td>70.72±0.16</td><td>70.63±0.22</td></tr><tr><td>SET</td><td>63.33±42.44</td><td>97.77±0.31</td><td>98.16±0.06</td><td>53.55±1.03</td><td>63.19��0.26</td><td>63.13±0.15</td><td>72.93±0.27</td><td>72.77±0.27</td><td>72.56±0.14</td></tr><tr><td>RigL</td><td>80.82±34.74</td><td>98.14±0.17</td><td>98.13±0.09</td><td>37.15±26.20</td><td>63.69±0.02</td><td>63.56±0.06</td><td>74.41±0.05</td><td>74.38±0.10</td><td>74.38±0.01</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Used late-rewinding (i.e. $K = 5 0 0 0$ ).
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: Gradient Flow of Sparse Models during Training. Gradient flow during training averaged over multiple runs, $^ \bullet + ^ { \bullet }$ indicates training runs with our proposed sparse initialization and Small Dense corresponds to training of a dense network with same number of parameters as the sparse networks. Lottery ticket runs for ResNet-50 include late-rewinding.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 3: Effect of Mask Updates in Dynamic Sparse Training. Effect of mask updates on the gradient norm. RigL Inverted chooses connections with least magnitude. We measure the gradient norm before and after the mask updates and plot the $\Delta$ . $^ { \bullet } + ^ { \bullet }$ indicates proposed initialization and used in MNIST experiments.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 4: Lottery Tickets Are Biased Towards the Pruning Solution, Unlike Random Initialization. A cartoon illustration of the loss landscape of a sparse model, after it is pruned from a dense solution to create a LT sub-network. A lottery ticket initialization is within the basin of attraction of the pruned model’s solution. In contrast a random initialization is unlikely to be close to the dense solution’s basin.
|
| 92 |
+
|
| 93 |
+
# 4.2 Gradient Flow during Training and Dynamic Sparse Training
|
| 94 |
+
|
| 95 |
+
In Fig. 2 we observed improved gradient flow for RigL. In this section we focus on those iterations in which the sparse connectivity is updated, and measure the change in gradient flow along with the Hessian spectrum. We also run the inverted baseline for RigL (RigL Inverted), in which the growing criteria is reversed and connections with least gradient magnitudes are activated.
|
| 96 |
+
|
| 97 |
+
DST methods such as RigL replace low saliency connections during training. Assuming the pruned connections indeed have a low impact on the loss, we might expect to see increased gradient norm after new connections are activated, especially in the case of RigL, which picks new connections with high magnitude gradients. In Fig. 3 we confirm that RigL updates increase the norm of the gradient significantly, especially in the first half of training, whereas SET, which picks new connections randomly, seems to be less effective at this. Using the inverted RigL criteria doesn’t improve the gradient flow, as expected, and without this RigL’s performance degrades ( $7 3 . 8 3 { \pm } 0 . 1 2$ for ResNet-50 and $9 2 . 7 1 { \pm } 7 . 6 7$ for LeNet5). These results suggest that improving gradient flow early in training might be the key for training sparse networks and that is what RigL appears to be doing. Additional plots for different initialization methods are shared in Appendix C.
|
| 98 |
+
|
| 99 |
+
RigL falls short of matching Small-Dense performance while constantly having higher gradient flow during the training, which highlights a limitation of looking solely at gradient flow. When the gradient is zero, or uninformative due to the error term of the approximation, analyzing the Hessian could provide additional insights (Ghorbani et al., 2019; Papyan, 2019; Sagun et al., 2017). In Appendix E, we show the Hessian spectrum before and after sparse connectivity updates. After RigL updates we observe more negative eigenvalues with significantly larger magnitudes as compared to SET. On the other hand, small dense models have smaller positive outlier eigenvalues while having significantly larger negative ones; which is again a sign of better conditioned optimization. We leave investigating the relationship between gradient flow and the Hessian further as a future work.
|
| 100 |
+
|
| 101 |
+
# 4.3 Why Lottery Tickets are Successful
|
| 102 |
+
|
| 103 |
+
We found that LTs do not improve gradient flow, either at initialization, or early in training, as shown in Fig. 2. This may be surprising given the apparent success of LTs, however the questions posed in $\ S 3 . 3$ present an alternative hypothesis for the ease of training from a LT initialization. Here we present results showing that indeed (1) LTs initializations are consistently closer to the pruning solution than a random initialization, (2) trained LTs (i.e. LT solutions) consistently end up in the same basin as the pruning solution and (3), LT solutions are highly similar to pruning solutions under various function similarity measures. Our resulting understanding of LTs in the context of the pruning solution and the loss landscape is illustrated in Fig. 4.
|
| 104 |
+
|
| 105 |
+
Experimental Setup To investigate the relationship between the pruned and LT solutions we perform experiments on two models/datasets: a $9 5 \%$ sparse $\mathrm { L e N e t } 5 ^ { \ S }$ architecture (LeCun et al., 1989) trained on MNIST (where the original LT formulation works, i.e. $K { = } 0$ ), and an $80 \%$ sparse ResNet-50 (Wu et al., 2018) on ImageNet-2012 (Russakovsky et al., 2015) (where $K = 0$ doesn’t work (Frankle et al., 2019b)), for which we use values from $K = 2 0 0 0$ ${ \approx } 6 ^ { \mathrm { t h } }$ epoch). In both cases, we find a LT initialization by pruning each layer of a dense NN separately using magnitude-based iterative pruning (Zhu et al., 2018). Further details about our experiments can be found in Appendix B.
|
| 106 |
+
|
| 107 |
+
Lottery Tickets Are Close to the Pruning Solution We train 5 different models using different seeds from both scratch (random) and LT initializations, the results of which are in Figs. 5b and 5e. These networks share the same pruning mask and therefore lie in the same solution space. We visualize distances between initial and final points of these experiments in Figs. 5a and 5d using 2D Multi-dimensional Scaling (MDS) (Kruskal, 1964) embeddings. LeNet5/MNIST: In Fig. 5b, we provide the average L2 distance to the pruning solution at initialization $( d _ { i n i t } )$ , and after training $( d _ { f i n a l } )$ . We observe that LT initializations start significantly closer to the pruning solution on average $( d _ { i n i t } = 1 3 . 6 1$ v.s. 17.46). After training, LTs end up more than $3 \times$ closer to the pruning solution compared to scratch. Resnet-50/ImageNet-2012: We observe similar results for Resnet-50/ImageNet-2012. LTs, again, start closer to the pruning solution, and solutions are $5 \times$ closer $( d _ { f i n a l } = 3 9 . 3 5 $ v.s. 215.98). With these observations, non-random initial loss values for LT initialization reported first by (Zhou et al., 2019) seem reasonable. LTs are biased towards the pruning solution they are derived from, but are they in the same basin?
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 5: MDS Embeddings/L2 Distances: (a, d): 2D Multi-dimensional Scaling (MDS) embedding of sparse NNs with the same connectivity/mask; (b, e): the average L2-distance between a pruning solution and other derived sparse networks; (c, f): linear path between the pruning solution $\alpha { = } 1 . 0$ ) and LT/scratch at both initialization, and solution (end of training). Top and bottom rows are for MNIST/LeNet5 and ImageNet-2012/ResNet-50 respectively.
|
| 111 |
+
|
| 112 |
+
Lottery Tickets are in the Pruning Solution Basin Investigating paths between different solutions is a popular tool for understanding how various points in parameter space relate to each other in the loss landscape (Draxler et al., 2018; Evci et al., 2019; Fort et al., 2020; Frankle et al., 2020a; Garipov et al., 2018; Goodfellow et al., 2015). For example, Frankle et al. (2019b) use linear interpolations to show that LTs always go to the same basin¶ when trained in different data orders. In Figs. 5c and 5f we look at the linear paths between pruning solution and 4 other points: LT initialization/solution and random (scratch) initialization/solution. Each experiment is repeated 5 times with different random seeds, and mean values are provided with $80 \%$ confidence intervals. In both experiments we observe that the linear path between LT initialization and the pruning solution decreases faster compared to the path that originates from scratch initialization. After training, the linear paths towards the pruning solution change drastically. The path from the scratch solution depicts a loss barrier; the scratch solution seems to be in a different basin than the pruning solution||. In contrast, LTs are linearly connected to the pruning solution in both small and large-scale experiments indicating that LTs have the same basin of attraction as the pruning solutions they are derived from. While it seems likely, these results do not however explicitly show that the LT and pruning solutions have learned similar functions.
|
| 113 |
+
|
| 114 |
+
Table 2: Ensemble & Prediction Disagreement. We compare the function similarity (Fort et al., 2020) with the original pruning solution and ensemble generalization over 5 sparse models, trained from random initializations and LTs. As a baseline, we also show results for 5 pruned models trained from different random initializations. See Appendix F for the complete results.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>LT</td><td>Initialization</td><td>(Top-1) Test Acc.</td><td>Ensemble</td><td>Disagree.</td><td>Disagree. w/ Pruned</td></tr><tr><td rowspan="6">LeNet5 MNIST</td><td></td><td>98.52±0.02</td><td>98.58</td><td>0.0043±0.0006</td><td>0.0089±0.0002</td></tr><tr><td>Scratch</td><td>97.04±0.15</td><td>98.00</td><td>0.0316±0.0023</td><td>0.0278±0.0020</td></tr><tr><td>Scratch (Diff. Init.)</td><td>97.19±0.33</td><td>98.43</td><td>0.0352±0.0037</td><td>0.0278±0.0032</td></tr><tr><td>Prune Restart</td><td>98.60±0.01</td><td>98.63</td><td>0.0027±0.0003</td><td>0.0077±0.0003</td></tr><tr><td>Pruned Soln.</td><td>98.53</td><td>1</td><td></td><td></td></tr><tr><td>5 Diff. Pruned</td><td>98.30±0.23</td><td>99.07</td><td>0.0214±0.0023</td><td>0.0197��0.0019*</td></tr><tr><td rowspan="5">ResNet50 ImageNet</td><td>LT</td><td>75.73±0.08</td><td>76.27</td><td>0.0894±0.0009</td><td>0.0941±0.0009</td></tr><tr><td>Scratch</td><td>71.16±0.13</td><td>74.05</td><td>0.2039±0.0013</td><td>0.2033±0.0012</td></tr><tr><td>Pruned Soln.</td><td>75.60</td><td></td><td></td><td></td></tr><tr><td>5 Diff. Pruned</td><td></td><td>1</td><td></td><td></td></tr><tr><td></td><td>75.65±0.13</td><td>77.80</td><td>0.1620±0.0008</td><td>0.1623±0.0011*</td></tr></table>
|
| 117 |
+
|
| 118 |
+
\* Here we compare 4 different pruned models with the pruning solution LT/Scratch are derived from.
|
| 119 |
+
|
| 120 |
+
Lottery Tickets Learn Similar Functions to the Pruning Solution Fort et al. (2020) motivate deep ensembles by empirically showing that models starting from different random initializations typically learn different solutions, as compared to models trained from similar initializations. Here we adopt the analysis of (Fort et al., 2020), but in comparing LT initializations and random initializations using fractional disagreement. The fractional disagreement with the pruning solution is the fraction of class predictions over which the LT and scratch models disagree with the pruning solution they were derived from. In Table 2 we show the mean fractional disagreement over all pairs of models. We run two versions of scratch training: (1) Scratch (Diff. Init. different weight initialization and different data order (2) Scratch same weight initialization and different data order for 5 different seeds the experiments are ran. Finally, we restart training starting from the pruning solution (Prune Restart) using, again, 5 different data orders.
|
| 121 |
+
|
| 122 |
+
The results presented in Table 2 suggest that all 5 LTs models converge on a solution almost identical to the pruning solution. Interestingly, the 5 LT models are even more similar to each other (Disagree. column) than the pruning solution, possibly because they share an initialization and training is stable (Frankle et al., 2019b). The disagreement of Prune Restart solutions with the original pruning solution matches the disagreement of lottery solutions; showing the extent of similarity between LT and pruning solutions.
|
| 123 |
+
|
| 124 |
+
Our results show that having a fixed initialization alone can not explain the low disagreement observed for LT experiments as Scratch solutions obtain an average disagreement of 0.0316 despite using the same initialization, which is almost 10 times more than the LT solutions (0.0043). Finding different LT initialization is costly, however using a different initialization in Scratch (Diff. Init.) training is free as the initializations are random. Using different initializations we can obtain more diverse solutions and thus achieve higher ensemble accuracy. As suggested by the analysis of Fort et al. (2020), ensembles of different solutions are more robust, and generalize better, than ensembles of similar solutions. An ensemble of $5 \mathrm { L T }$ models with low disagreement doesn’t significantly improve generalization as compared to an ensemble of 5 different pruning solutions with similar individual test accuracy. We further demonstrate these results by comparing the output probability distributions using the Kullback–Leibler Divergence (KL), and Jensen–Shannon Divergence (JSD) in Appendix F.
|
| 125 |
+
|
| 126 |
+
Implications: (a) Rewinding of LTs. Frankle et al. (2019b, 2020a) argued that LTs work when the training is stable, and thus converges to the same basin when trained with different data sampling orders. In $\ S 4 . 3$ , we show that this basin is the same one found by pruning, and since the training converges to the same basin as before, we expect to see limited gains from rewinding if any. This is partially confirmed by Renda et al. (2020) which shows that restarting the learning rate schedule from the pruning solution performs better than rewinding the weights. (b) Transfer of LTs. Given the close relationship between LTs and pruning solutions, the observation that LTs trained on large datasets transfer to smaller ones, but not vice versa (Morcos et al., 2019; Sabatelli et al., 2020) can be explained by a common observation in transfer learning: networks trained in large datasets transfer to smaller ones. (c) LT’s Robustness to Perturbations. Frankle et al. (2020c) and Zhou et al. (2019) found that certain perturbations, like only using the signs of weights at initialization, do not impact LT generalization, while others, like shuffling the weights, do. Our results bring further insights to these observations: As long as the perturbation is small enough such that a LT stays in the same basin of attraction, results will be as good as the pruning solution. (d) Success of LTs. While it is exciting to see widespread applicability of LTs in different domains (Brix et al., 2020; Li et al., 2020; Venkatesh et al., 2020), the results presented in this paper suggest this success may be due to the underlying pruning algorithm (and transfer learning) rather than LT initializations themselves.
|
| 127 |
+
|
| 128 |
+
# 5 Conclusion
|
| 129 |
+
|
| 130 |
+
We attempted to answer the questions of (1) why training unstructured sparse networks from random initialization performs poorly and; (2) what makes Lottery Tickets (LTs) and Dynamic Sparse Training (DST) the exceptions? We identified that randomly initialized unstructured sparse Neural Networks (NNs) exhibit poor gradient flow when initialized naively and proposed an alternative initialization that scales the initial variance for each neuron separately. Furthermore we showed that modern sparse NN architectures are more sensitive to poor gradient flow during early training rather than initialization alone. We observed that this is somewhat addressed by state-of-the-art DST methods, such as Rigged Lottery (RigL), which significantly improves gradient flow during early training over traditional sparse training methods. Finally, we show that LTs do not improve gradient flow at either initialization or during training, but rather their success lies in effectively re-learning the original pruning solution they are derived from. We showed that a LTs initialization resides within the same basin of attraction as the pruning solution and, furthermore, when trained the LT solution learns a highly similar solution to the pruning solution. These findings suggest that LTs are fundamentally limited in their potential for improving the training of sparse NNs more generally.
|
| 131 |
+
|
| 132 |
+
# References
|
| 133 |
+
|
| 134 |
+
Brix, Christopher, Parnia Bahar, and Hermann Ney (2020). “Successfully Applying the Stabilized Lottery Ticket Hypothesis to the Transformer Architecture”. In: ArXiv. URL: https://arxiv.org/abs/ 2005.03454.
|
| 135 |
+
Castellano, Giovanna, Anna Maria Fanelli, and Marcello Pelillo (1997). “An iterative pruning algorithm for feedforward neural networks”. In: IEEE Transactions on Neural Networks. ISSN: 1045-9227. DOI: 10.1109/72.572092.
|
| 136 |
+
Dettmers, Tim and Luke Zettlemoyer (2019). “Sparse Networks from Scratch: Faster Training without Losing Performance”. In: ArXiv. URL: http://arxiv.org/abs/1907.04840.
|
| 137 |
+
Draxler, Felix, Kambis Veschgini, Manfred Salmhofer, and Fred A Hamprecht (2018). “Essentially No Barriers in Neural Network Energy Landscape”. In: International Conference on Machine Learning.
|
| 138 |
+
Evci, Utku, Trevor Gale, Jacob Menick, Pablo Samuel Castro, and Erich Elsen (2020). “Rigging the Lottery: Making All Tickets Winners”. In: Proceedings of Machine Learning and Systems 2020.
|
| 139 |
+
Evci, Utku, Fabian Pedregosa, Aidan N. Gomez, and Erich Elsen (2019). “The Difficulty of Training Sparse Neural Networks”. In: ArXiv. URL: http://arxiv.org/abs/1906.10732.
|
| 140 |
+
Fort, Stanislav, Huiyi Hu, and Balaji Lakshminarayanan (2020). “Deep Ensembles: A Loss Landscape Perspective”. In: International Conference on Learning Representations.
|
| 141 |
+
Frankle, Jonathan and Michael Carbin (2019a). “The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks”. In: 7th International Conference on Learning Representations (ICLR).
|
| 142 |
+
Frankle, Jonathan, Gintare Karolina Dziugaite, Daniel M. Roy, and Michael Carbin (2019b). “Stabilizing the Lottery Ticket Hypothesis”. In: ArXiv. URL: https://arxiv.org/abs/1903.01611. (2020a). “Linear Mode Connectivity and the Lottery Ticket Hypothesis”. In: Proceedings of the International Conference on Machine Learning. (2020b). “Pruning Neural Networks at Initialization: Why are We Missing the Mark?” In: ArXiv. URL: https://arxiv.org/abs/2009.08576.
|
| 143 |
+
Frankle, Jonathan, David J. Schwab, and Ari S. Morcos (2020c). “The Early Phase of Neural Network Training”. In: International Conference on Learning Representations.
|
| 144 |
+
Gale, Trevor, Erich Elsen, and Sara Hooker (2019). “The State of Sparsity in Deep Neural Networks”. In: ArXiv. URL: http://arxiv.org/abs/1902.09574.
|
| 145 |
+
Garipov, Timur, Pavel Izmailov, Dmitrii Podoprikhin, Dmitry P Vetrov, and Andrew Gordon Wilson (2018). “Loss Surfaces, M Connectivity, and Fast Ensembling of DNNs”. In: Advances in Neural Information Processing Systems.
|
| 146 |
+
Ghorbani, Behrooz, Shankar Krishnan, and Ying Xiao (2019). “An Investigation into Neural Net Optimization via Hessian Eigenvalue Density”. In: Proceedings of the 36th International Conference on Machine Learning. URL: http://proceedings.mlr.press/v97/ghorbani19b.html.
|
| 147 |
+
Glorot, Xavier and Yoshua Bengio (2010). “Understanding the difficulty of training deep feedforward neural networks”. In: Proceedings of the 13th International Conference on Artificial Intelligence and Statistics (AISTATS).
|
| 148 |
+
Goodfellow, Ian J., Oriol Vinyals, and Andrew M. Saxe (2015). “Qualitatively characterizing neural network optimization problems”. In: International Conference on Learning Representations.
|
| 149 |
+
Han, Song, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A. Horowitz, and William J. Dally (2016). “EIE: Efficient Inference Engine on Compressed Deep Neural Network”. In: Proceedings of the 43rd International Symposium on Computer Architecture.
|
| 150 |
+
Han, Song, Jeff Pool, John Tran, and William Dally (2015). “Learning both weights and connections for efficient neural network”. In: Advances in neural information processing systems.
|
| 151 |
+
Hanson, Stephen Jose and Lorien Y. Pratt (1988). “Comparing biases for minimal network construction ´ with back-propagation”. In: Proceedings of the 1st International Conference on Neural Information Processing Systems (NIPS). Morgan Kaufmann.
|
| 152 |
+
Hassibi, B. and D. Stork (1993). “Second order derivatives for network pruning: Optimal Brain Surgeon”. In: Advances in Neural Information Processing Systems.
|
| 153 |
+
He, Kaiming, Xiangyu Zhang, Shaoqing Ren, and Jian Sun (2015). “Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification”. In: IEEE International Conference on Computer Vision (ICCV).
|
| 154 |
+
Ioffe, Sergey and Christian Szegedy (2015). “Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift”. In: Proceedings of the 32Nd International Conference on International Conference on Machine Learning.
|
| 155 |
+
Kruskal, J. (1964). “Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis”. In: Psychometrika. DOI: 10.1007/BF02289565.
|
| 156 |
+
Kusupati, Aditya, Vivek Ramanujan, Ragha Somani, Mitchell Wortsman, Prateek Jain, Sham Kakade, and Ali Farhadi (2020). “Soft Threshold Weight Reparameterization for Learnable Sparsity”. In: Proceedings of the International Conference on Machine Learning.
|
| 157 |
+
LeCun, Yann, Bernhard Boser, John S. Denker, Donnie Henderson, Richard E. Howard, Wayne Hubbard, and Lawrence D. Jackel (1989). “Backpropagation applied to handwritten zip code recognition”. In: Neural Computation. ISSN: 0899-7667. DOI: 10.1162/neco.1989.1.4.541.
|
| 158 |
+
LeCun, Yann, John S. Denker, and Sara A. Solla (1990). “Optimal Brain Damage”. In: Advances in Neural Information Processing Systems.
|
| 159 |
+
Lee, Namhoon, Thalaiyasingam Ajanthan, and Philip H. S. Torr (2019). “SNIP: Single-shot Network Pruning based on Connection Sensitivity”. In: International Conference on Learning Representations (ICLR), 2019.
|
| 160 |
+
Lewkowycz, Aitor, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari (n.d.). “The large learning rate phase of deep learning: the catapult mechanism”. In: Arxiv (). URL: https : //arxiv.org/pdf/2003.02218.
|
| 161 |
+
Li, Bai, Shiqi Wang, Yunhan Jia, Yantao Lu, Zhenyu Zhong, Lawrence Carin, and Suman Jana (2020). “Towards Practical Lottery Ticket Hypothesis for Adversarial Training”. In: ArXiv. URL: https: //arxiv.org/abs/2003.05733.
|
| 162 |
+
Liu, Zhuang, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell (2019). “Rethinking the Value of Network Pruning”. In: International Conference on Learning Representations.
|
| 163 |
+
Louizos, Christos, Karen Ullrich, and Max Welling (2017). “Bayesian compression for deep learning”. In: Advances in Neural Information Processing Systems.
|
| 164 |
+
Malach, Eran, Gilad Yehudai, Shai Shalev-Shwartz, and Ohad Shamir (2020). “Proving the Lottery Ticket Hypothesis: Pruning is All You Need”. In: ArXiv. URL: http://arxiv.org/abs/2002.00585.
|
| 165 |
+
Mocanu, Decebal Constantin, Elena Mocanu, Peter Stone, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta (2018). “Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science”. In: Nature Communications.
|
| 166 |
+
Molchanov, Dmitry, Arsenii Ashukha, and Dmitry Vetrov (2017). “Variational Dropout Sparsifies Deep Neural Networks”. In: Proceedings of the 34th International Conference on Machine Learning. Proceedings of Machine Learning Research. International Convention Centre, Sydney, Australia: PMLR. URL: http://proceedings.mlr.press/v70/molchanov17a.html.
|
| 167 |
+
Molchanov, Pavlo, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz (2016). “Pruning Convolutional Neural Networks for Resource Efficient Inference”. In: ArXiv. URL: http://arxiv.org/abs/ 1611.06440.
|
| 168 |
+
Morcos, Ari, Haonan Yu, Michela Paganini, and Yuandong Tian (2019). “One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers”. In: Advances in Neural Information Processing Systems 32.
|
| 169 |
+
Mostafa, Hesham and Xin Wang (2019). “Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization”. In: Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA. URL: http: //proceedings.mlr.press/v97/mostafa19a.html.
|
| 170 |
+
Mozer, Michael C. and Paul Smolensky (1989a). “Using Relevance to Reduce Network Size Automatically”. In: Connection Science. DOI: 10.1080/09540098908915626.
|
| 171 |
+
– (1989b). “Skeletonization: A Technique for Trimming the Fat from a Network via Relevance Assessment”. In: Advances in Neural Information Processing Systems 1.
|
| 172 |
+
Papyan, Vardan (2019). “Measurements of Three-Level Hierarchical Structure in the Outliers in the Spectrum of Deepnet Hessians”. In: ArXiv. URL: https://arxiv.org/abs/1901.08244.
|
| 173 |
+
Ramanujan, Vivek, Mitchell Wortsman, Aniruddha Kembhavi, Ali Farhadi, and Mohammad Rastegari (2019). “What’s Hidden in a Randomly Weighted Neural Network?” In: ArXiv. URL: http://arxiv. org/abs/1911.13299.
|
| 174 |
+
Renda, Alex, Jonathan Frankle, and Michael Carbin (2020). “Comparing Rewinding and Fine-tuning in Neural Network Pruning”. In: International Conference on Learning Representations. URL: https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ S1gSj0NKvB.
|
| 175 |
+
Russakovsky, Olga, 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 (2015). “ImageNet Large Scale Visual Recognition Challenge”. In: International Journal of Computer Vision (IJCV).
|
| 176 |
+
Sabatelli, Matthia, Mike Kestemont, and Pierre Geurts (2020). “On the Transferability of Winning Tickets in Non-Natural Image Datasets”. In: ArXiv. URL: https://arxiv.org/abs/2005.05232.
|
| 177 |
+
Sagun, Levent, Utku Evci, V. Ugur Guney, Yann Dauphin, and L ¨ eon Bottou (2017). “Empirical Analysis ´ of the Hessian of Over-Parametrized Neural Networks”. In: International Conference on Learning Representations.
|
| 178 |
+
Setiono, Rudy (1997). “A Penalty-Function Approach for Pruning Feedforward Neural Networks”. In: Neural Computation. DOI: 10.1162/neco.1997.9.1.185.
|
| 179 |
+
Sietsma, Jocelyn and Robert J.F. Dow (1988). “Neural net pruning-why and how”. In: IEEE International Conference on Neural Networks. DOI: 10.1109/ICNN.1988.23864.
|
| 180 |
+
Tanaka, Hidenori, Daniel Kunin, Daniel L. K. Yamins, and Surya Ganguli (2020). “Pruning neural networks without any data by iteratively conserving synaptic flow”. In: ArXiv. URL: https://arxiv.org/ abs/2006.05467.
|
| 181 |
+
van der Walt, S., S. C. Colbert, and G. Varoquaux (2011). “The NumPy Array: A Structure for Efficient Numerical Computation”. In: Computing in Science Engineering.
|
| 182 |
+
Venkatesh, Bindya, Jayaraman J. Thiagarajan, Kowshik Thopalli, and Prasanna Sattigeri (2020). “Calibrate and Prune: Improving Reliability of Lottery Tickets Through Prediction Calibration”. In: ArXiv. URL: http://arxiv.org/abs/2002.03875.
|
| 183 |
+
Wang, Chaoqi, Guodong Zhang, and Roger Grosse (2020). “Picking Winning Tickets Before Training by Preserving Gradient Flow”. In: International Conference on Learning Representations. URL: https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ SkgsACVKPH.
|
| 184 |
+
Wortsman, Mitchell, Ali Farhadi, and Mohammad Rastegari (2019). “Discovering Neural Wirings”. In: Advances in Neural Information Processing Systems.
|
| 185 |
+
Wu, Songtao, Shenghua Zhong, and Yan Liu (2018). “Deep residual learning for image steganalysis”. In: Multimedia Tools and Applications.
|
| 186 |
+
Xiao, Lechao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel S Schoenholz, and Jeffrey Pennington (2018). “Dynamical isometry and a mean field theory of cnns: How to train 10,000-layer vanilla convolutional neural networks”. In: International Conference on Machine Learning (ICML).
|
| 187 |
+
Zhang, Hongyi, Yann N. Dauphin, and Tengyu Ma (2019). “Fixup Initialization: Residual Learning Without Normalization”. In: International Conference on Learning Representations.
|
| 188 |
+
Zhou, Hattie, Janice Lan, Rosanne Liu, and Jason Yosinski (2019). “Deconstructing lottery tickets: Zeros, signs, and the supermask”. In: Advances in Neural Information Processing Systems.
|
| 189 |
+
Zhu, Michael and Suyog Gupta (2018). “To Prune, or Not to Prune: Exploring the Efficacy of Pruning for Model Compression”. In: International Conference on Learning Representations Workshop.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 6: Glorot/He Initialization for a Sparse NN. (Glorot et al., 2010; He et al., 2015) restrict the outputs of all neurons to be zero-mean and of unit variance. All neurons in a dense NN layer (a) have the same fan-in/fan-out, whereas in a sparse NN (b) the fan-in/fan-out can differ for every neuron, potentially requiring sampling from a different distribution for every neuron. The fan-in matrix contains the values used in Eq. (1) for each neuron.
|
| 193 |
+
|
| 194 |
+
# A Glorot/He Initialization Generalized to Neural Networks with Heterogeneous Connectivity: Full Explanation/Derivation
|
| 195 |
+
|
| 196 |
+
Here we derive the full generalized initialization for both the forwards/backwards cases (i.e. fan-in/fan-out), refer to Fig. 6 for an illustration of how the connectivity for the fan-in/fan-out cases are determined for each neuron.
|
| 197 |
+
|
| 198 |
+
# A.1 Generalized Glorot/He Initialization: Backwards, Forwards and Average Cases
|
| 199 |
+
|
| 200 |
+
For every weight $w _ { i j } ^ { \left[ \ell \right] } \in W ^ { n ^ { \left[ \ell \right] } \times n ^ { \left[ \ell - 1 \right] } }$ in a layer $\ell$ with $n ^ { \left[ \ell \right] }$ neurons, connecting neuron $i$ in layer $\ell$ to neuron j in layer (\`−1) with n[\`−1] neurons, and weight mask [m[\`]ij ] = M \` ∈ [0,1]n[\`]×n[\`−1],
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\begin{array}{c} \begin{array} { r l } & { \mathrm { G l o r o t ~ e t ~ a l . ~ } ( 2 0 1 0 ) : \ w _ { i j } ^ { [ \ell ] } \sim \mathcal { N } \big ( 0 , \frac { 1 } { u } \big ) } \\ & { \mathrm { H e ~ e t ~ a l . ~ } ( 2 0 1 5 ) : \quad w _ { i j } ^ { [ \ell ] } \sim \mathcal { N } \big ( 0 , \frac { 2 } { u } \big ) } \end{array} \mathrm { w h e r e ~ } u = \left\{ \begin{array} { l l } { f a n \cdot i n _ { i } ^ { [ \ell ] } } & { ( \mathrm { f o r w a r d } ) } \\ { f a n - o u l _ { j } ^ { [ \ell ] } } & { ( \mathrm { b a c k w a r d } ) } \\ { \left( f a n \cdot i n _ { i } ^ { [ \ell ] } + f a n - o u l _ { j } ^ { [ \ell ] } \right) / 2 } & { ( \mathrm { a v e r a g e } ) } \end{array} \right. \end{array}
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
where,
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
f a n { - } i n _ { i } ^ { [ \ell ] } { = } \sum _ { j = 1 } ^ { n ^ { [ \ell - 1 ] } } m _ { i j } ^ { [ \ell ] } , \qquad f a n { - } o u t _ { j } ^ { [ \ell ] } { = } \sum _ { i = 1 } ^ { n ^ { [ \ell ] } } m _ { i j } ^ { [ \ell ] } ,
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
are the number of incoming and outgoing connections respectively. In the special case of a dense layer where $m _ { i j } ^ { [ \ell ] } = 1 , \forall i , j$ , Eq. (1) reduces to the initializations proposed by (Glorot et al., 2010; He et al., 2015) since fan- $i n _ { i } ^ { [ \ell ] } = n ^ { [ \ell - 1 ] } , \forall i$ , and fan- ${ \cdot o u t _ { j } ^ { [ \ell ] } } = n ^ { [ \ell ] } , \forall j$ .
|
| 213 |
+
|
| 214 |
+
# A.2 Derivation: Fixed Mask, Forward Propagation
|
| 215 |
+
|
| 216 |
+
Given a sparse NN, where the output of a neuron $a _ { i }$ is given by, $\begin{array} { r } { a _ { i } ^ { [ \ell ] } ~ = ~ f ~ \left( z _ { i } ^ { [ \ell ] } \right) } \end{array}$ , where $\begin{array} { r } { z _ { i } ^ { [ \ell ] } = \sum _ { j } ^ { n ^ { [ \ell - 1 ] } } m _ { i j } ^ { [ \ell ] } w _ { i j } ^ { [ \ell ] } a _ { j } ^ { [ \ell - 1 ] } } \end{array}$ = Pn[\`−1]j m[i where the ou $m _ { i j } ^ { [ \ell ] } \in M ^ { [ \ell ] }$ and eviou $w _ { i j } ^ { \left[ \ell \right] } \in W ^ { \left[ \ell \right] }$ are the mame the mask - $\ell$ $a _ { j } ^ { [ \ell - 1 ] }$ $M ^ { [ \ell ] } \in \mathbb { 1 } ^ { n ^ { [ \ell ] } \times n ^ { [ \ell - 1 ] } }$ is constant, where 1n[\`]×n[\`−1] is an indicator matrix.
|
| 217 |
+
|
| 218 |
+
As in Glorot et al. (2010) we want to ensure $\mathrm { V a r } ( a _ { i } ^ { [ \ell ] } ) { = } \mathrm { V a r } ( a _ { i } ^ { [ \ell - 1 ] } )$ , and ${ \mathrm { m e a n } } ( a _ { i } ^ { [ \ell ] } ) = 0$ . Assume that $f ( x ) { \approx } x$ for $x$ close to 0, e.g. in the case of $f ( x ) = \mathrm { t a n h } ( x )$ , and that $w _ { i j } ^ { \left[ \ell \right] }$ and $a _ { j } ^ { [ \ell - 1 ] }$ are independent,
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\begin{array} { r l r } { { \operatorname { V a r } ( a _ { \varepsilon } ^ { ( t - 1 ) } ) _ { \varepsilon \in \mathcal { N } _ { \varepsilon } } ( z _ { \varepsilon } ^ { ( t ) } ) } } \\ & { = \operatorname { V a r } ( ( \sum _ { j = 1 } ^ { \infty } \operatorname { V a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } a _ { j } ^ { ( t ) } a _ { j } ^ { ( t - 1 ) } ) } \\ & { } & \\ & { } & { = \operatorname { V a r } ( \sum _ { j = 1 } ^ { \infty } \operatorname { V a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } a _ { j } ^ { ( t ) } a _ { j } ^ { ( t - 1 ) } ) } \\ & { = \sum _ { j = 1 } ^ { \infty } \operatorname { V a r } ( \operatorname* { V a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } a _ { j } ^ { ( t ) } a _ { j } ^ { ( t - 1 ) } ) } \\ & { = \frac { \operatorname { V a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } } { \beta _ { j = 1 } } ( \operatorname* { W a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } a _ { j } ^ { ( t ) } a _ { j } ^ { ( t - 1 ) } ) } \\ & { = \frac { \operatorname { V a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } } { \beta _ { j = 1 } } ( \operatorname* { W a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } ) ^ { 2 } \operatorname { V a r } ( \operatorname* { W } _ { \varepsilon } ^ { ( t ) } a _ { j } ^ { ( t - 1 ) } ) } & { \quad \cdot \cdot \operatorname* { W i r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } \operatorname { V a r } ( \operatorname* { W a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } ) - \operatorname* { W i r } _ { j \in \mathcal { N } _ { \varepsilon } } ( \mathcal { K } ) } \\ & { = \frac { \operatorname { V a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } } { \beta _ { j = 1 } } \operatorname { V a r } ( \operatorname* { W a r } _ { j \in \mathcal { N } _ { \varepsilon } } ^ { ( t ) } a _ { j } ^ { ( t ) } a _ { j } ^ { ( t - 1 ) } ) } \end{array}
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
Assume $\mathrm { V a r } ( w _ { i m } ^ { [ \ell ] } ) = \mathrm { V a r } ( w _ { i n } ^ { [ \ell ] } ) , \forall n , m$ , i.e. the variance of all weights for a given neuron are the same, and $\operatorname { V a r } ( a _ { n } ^ { [ \ell - 1 ] } ) { = } \operatorname { V a r } ( a _ { m } ^ { [ \ell - 1 ] } )$ , i.e. the variance of any of the outputs of the previous layer are the same. Therefore we can simplify Eq. (8),
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\begin{array} { r } { \mathrm { V a r } ( a _ { i } ^ { [ \ell - 1 ] } ) = \displaystyle \sum _ { j = 1 } ^ { n ^ { [ \ell - 1 ] } } m _ { i j } ^ { [ \ell ] } \mathrm { V a r } ( w _ { i j } ^ { [ \ell ] } ) \mathrm { V a r } ( a _ { j } ^ { [ \ell - 1 ] } ) } \\ { = \mathrm { V a r } ( w _ { i j } ^ { [ \ell ] } ) \mathrm { V a r } ( a _ { j } ^ { [ \ell - 1 ] } ) \displaystyle \sum _ { j = 1 } ^ { n ^ { [ \ell - 1 ] } } m _ { i j } ^ { [ \ell ] } . } \end{array}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
$i$ $i n _ { i } ^ { \left[ \ell \right] }$ $\begin{array} { r } { i n _ { i } ^ { [ \ell ] } { = } \sum _ { j = 1 } ^ { n ^ { [ \ell - 1 ] } } m _ { i j } ^ { [ \ell ] } } \end{array}$ , then
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
\begin{array} { r l r } { \mathrm { V a r } ( a _ { i } ^ { [ \ell - 1 ] } ) { = } f a n { - } i n _ { i } ^ { [ \ell ] } \mathrm { V a r } ( w _ { i j } ^ { [ \ell ] } ) \mathrm { V a r } ( a _ { j } ^ { [ \ell - 1 ] } ) } & { { } } & { } \\ { \mathrm { R e c a l l , V a r } ( a _ { i } ^ { [ \ell - 1 ] } ) { = } \mathrm { V a r } ( a _ { j } ^ { [ \ell - 1 ] } ) } & { { } } & { } \\ { { \Rightarrow } \mathrm { V a r } ( w _ { i j } ^ { [ \ell ] } ) { = } \displaystyle \frac { 1 } { f a n { - } i n _ { i } ^ { [ \ell ] } } . } & { { } } & { } \end{array}
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
Therefore, in order to have the output of each neuron $a _ { i } ^ { [ \ell ] }$ in layer $\ell$ to have unit variance, and mean 0, we need to sample the weights for each neuron from the normal distribution,
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
[ w _ { i j } ^ { [ \ell ] } ] \sim { \cal N } \left( 0 , \frac { 1 } { f a n { - } i n _ { i } ^ { [ \ell ] } } \right) ,
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
where $s _ { i } ^ { \ell }$ is the sparsity of weights of the neuron with output $a _ { i }$ . For the ReLU activation function, following the derivation in He et al. (2015),
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
[ w _ { i j } ^ { [ \ell ] } ] \sim { \cal N } \left( 0 , \frac { 2 } { f a n { - } i n _ { i } ^ { [ \ell ] } } \right) .
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
# A.3 Fixed Mask: Backward Pass
|
| 249 |
+
|
| 250 |
+
Given a sparse NN, where the output of a neuron $a _ { i }$ is given by, $a _ { i } ^ { [ \ell ] } ~ = ~ f ~ \left( z _ { i } ^ { [ \ell ] } \right)$ , where $\begin{array} { r } { z _ { i } ^ { [ \ell ] } = \sum _ { j } ^ { n ^ { [ \ell - 1 ] } } m _ { i j } ^ { [ \ell ] } w _ { i j } ^ { [ \ell ] } a _ { j } ^ { [ \ell - 1 ] } } \end{array}$ , where $m _ { i j } ^ { [ \ell ] } \in M ^ { [ \ell ] }$ and $w _ { i j } ^ { \left[ \ell \right] } \in W ^ { \left[ \ell \right] }$ are the mask and weights respectively for layer \`, and a[\`−1]j the output of the previous layer. Assume the mask $M ^ { [ \ell ] } \in \mathbb { I } ^ { n ^ { [ \ell ] } \times n ^ { [ \ell - 1 ] } }$ is constant, where 1n[\`]×n[\`−1] is an indicator matrix, and let $L \left( \theta = \{ W ^ { [ \ell ] } , \ell = 0 . . . N \} \right)$ be the loss we are optimizing. As in Glorot et al. (2010), from the backward-propagation standpoint, we want to ensure $\begin{array} { r } { \mathrm { V a r } ( { \frac { \partial L } { \partial z _ { i } ^ { [ \ell ] } } } ) { = } \mathrm { V a r } ( { \frac { \partial L } { \partial z _ { i } ^ { [ \ell - 1 ] } } } ) ) } \end{array}$ r( ∂L∂z[\`−1] )), and mean( ∂ $\mathrm { m e a n } ( \frac { \partial L } { \partial z _ { i } ^ { [ \ell ] } } ) = 0$ . Assume that $f ^ { \prime } ( 0 ) { = } 1$ ,
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\begin{array} { r l r } { \nabla _ { \mathbf x \in \mathcal { Q } } \frac { \partial L } { \partial \mathbf x } \Biggr ( \frac { \partial L } { \partial \mathbf x } \Biggr ) \times \nabla _ { \mathbf x \in \mathcal { W } _ { \varepsilon } ^ { 0 } } \Biggr \} } & { } & \\ & { = \nabla _ { \mathbf x } \Biggl ( \int _ { \mathbf x } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \nabla _ { \mathbf x } \frac { \partial L } { \partial \mathbf x ^ { \varepsilon } } \frac { \partial L } { \partial \mathbf x ^ { \varepsilon } } \Biggr ) } & \\ & { = \frac { \partial ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } } { \partial \mathbf x } \Biggr ( \mathrm { r a n } _ { \mathcal { W } _ { \varepsilon } ^ { 0 } } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \frac { \partial L } { \partial \mathbf x ^ { \varepsilon } } \Biggr ) } & \\ & { = \frac { \partial ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } } { \partial \mathbf x } \mathrm { t a n } \left( \mathrm { r a n } _ { \mathcal { W } _ { \varepsilon } ^ { 0 } } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \frac { \partial L } { \partial \mathbf x ^ { \varepsilon } } \right) } & { \qquad \mathrm { ( i n d i g e r e n u i n ~ s t a n ~ u n i n ) } } \\ & { = \frac { \partial ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } } { \partial \mathbf x } \mathrm { t a n } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \mathrm { y s t a n } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \Biggr ) } & { \qquad \times \mathrm { r a n } _ { \mathcal { W } _ { \varepsilon } ^ { 0 } } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \mathrm { s t a n } \mathrm { m a n } \mathrm { m a n } \mathrm { W a } \mathrm { W a } \mathrm { W a } \mathrm { W a } \mathrm { W a } \mathrm { W a } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } } \\ & = \sum _ { m _ { 0 } } ^ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \mathrm { r a n } _ { \mathcal { W } _ { \varepsilon } ^ { 0 } } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \mathrm { W } \end{array}
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
Assume $\mathrm { V a r } ( w _ { m j } ^ { [ \ell ] } ) { = } \mathrm { V a r } ( w _ { n j } ^ { [ \ell ] } ) , \forall n , m$ , i.e. the variance of all weights for a given neuron are the same, and $\scriptstyle \mathrm { V a r } ( { \frac { \partial L } { \partial z _ { n } ^ { [ \ell ] } } } ) = \mathrm { V a r } ( { \frac { \partial L } { \partial z _ { m } ^ { [ \ell ] } } } )$ $l$ Then we can simplify Eq. (20),
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\begin{array} { r } { \mathrm { V a r } ( \displaystyle \frac { \partial L } { \partial z _ { j } ^ { \left[ \ell \right] } } ) = \displaystyle \sum _ { i = 1 } ^ { n ^ { \left[ \ell \right] } } m _ { i j } ^ { \left[ \ell \right] } \mathrm { V a r } ( w _ { i j } ^ { \left[ \ell \right] } ) \mathrm { V a r } ( \displaystyle \frac { \partial L } { \partial z _ { i } ^ { \left[ \ell \right] } } ) } \\ { = \mathrm { V a r } ( w _ { i j } ^ { \left[ \ell \right] } ) \mathrm { V a r } ( \displaystyle \frac { \partial L } { \partial z _ { i } ^ { \left[ \ell \right] } } ) \displaystyle \sum _ { i = 1 } ^ { n ^ { \left[ \ell \right] } } m _ { i j } ^ { \left[ \ell \right] } . } \end{array}
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
$i$ $o u t _ { j } ^ { [ \ell ] }$ $\begin{array} { r } { { \bf { \Lambda } } _ { \cdot o u t _ { j } ^ { [ \ell ] } } = \sum _ { i = 1 } ^ { n ^ { [ \ell ] } } m _ { i j } ^ { [ \ell ] } } \end{array}$
|
| 263 |
+
|
| 264 |
+
$$
|
| 265 |
+
\begin{array} { r l } & { \quad \mathrm { V a r } ( \displaystyle \frac { \partial L } { \partial z _ { j } ^ { [ \ell ] } } ) { = } f a n { \ - } o u _ { j } ^ { [ \ell ] } \mathrm { V a r } ( w _ { i j } ^ { [ \ell ] } ) \mathrm { V a r } ( \displaystyle \frac { \partial L } { \partial z _ { i } ^ { [ \ell ] } } ) } \\ & { \quad \mathrm { R e c a l l , V a r } ( \displaystyle \frac { \partial L } { \partial z _ { j } ^ { [ \ell ] } } ) { = } \mathrm { V a r } ( \displaystyle \frac { \partial L } { \partial z _ { i } ^ { [ \ell ] } } ) } \\ & { \quad \quad \quad \quad \Rightarrow \mathrm { V a r } ( w _ { i j } ^ { [ \ell ] } ) { = } \displaystyle \frac { 1 } { f a n { - } o u _ { j } ^ { [ \ell ] } } . } \end{array}
|
| 266 |
+
$$
|
| 267 |
+
|
| 268 |
+
Therefore, in order to have the output of each neuron $a _ { i } ^ { [ \ell ] }$ in layer $\ell$ to have unit variance, and mean 0, we need to sample the weights for each neuron from the normal distribution,
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
[ w _ { i j } ^ { [ \ell ] } ] \sim { \cal N } \left( 0 , \frac { 1 } { f a n { - } i n _ { i } ^ { [ \ell ] } } \right) ,
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
where $s _ { i } ^ { \ell }$ is the sparsity of weights of the neuron with output $a _ { i }$ . For the ReLU activation function, following the derivation in $\mathrm { H e }$ et al. (2015),
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
[ w _ { i j } ^ { [ \ell ] } ] \sim { \cal N } \left( 0 , \frac { 2 } { f a n { - } i n _ { i } ^ { [ \ell ] } } \right) .
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
Table 3: §4.3: Experiment Details/Hyperparameters. Initial Learning Rate (LR), LR Schedule (Sched.), Batchsize (Batch.), Momentum $( m )$ , Weight Decay (WD), $t _ { \mathrm { s t a r t } }$ , $t _ { \mathrm { e n d } }$ and $f$ are the pruning starting iteration, end iteration, and mask update frequency respectively.
|
| 281 |
+
|
| 282 |
+
<table><tr><td>Dataset</td><td>Model</td><td>total</td><td>Epochs</td><td>Batch.</td><td>LR</td><td>Sched.</td><td>m</td><td>WD</td><td>Sparsity</td><td colspan="3">Pruning</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>tstart</td><td>tend</td><td>f</td></tr><tr><td>MNIST</td><td>LeNet5</td><td>11719</td><td>30</td><td>128</td><td>0.05</td><td>Cosine</td><td>0.9</td><td>0</td><td>95%</td><td>3000</td><td>7000</td><td>100</td></tr><tr><td>ImageNet</td><td>ResNet50</td><td>32000</td><td>~102</td><td>4096</td><td>1.6</td><td>Step</td><td>0.9</td><td></td><td>1×10-4 80%</td><td>5000</td><td>8000</td><td>2000</td></tr></table>
|
| 283 |
+
|
| 284 |
+
\* Step schedule has a linear warm-up in first 5 epochs and decreases the learning rate by a factor of 10 at epochs 30,70 and 90.
|
| 285 |
+
|
| 286 |
+
Table 4: $\ S 4 . 1$ : Experiment Details/Hyperparameters. Initial Learning Rate (LR), LR Schedule (Sched.), Batchsize (Batch.), Momentum $( m )$ , Weight Decay (WD), Initial Drop Fraction (Drop.), $t _ { \mathrm { e n d } }$ and $f$ are the pruning mask update frequency and end iteration respectively. $L e N e t 5 +$ row corresponds the LeNet5 experiments with our sparse initialization, whereas LeNet5 is the regular masked initialization.
|
| 287 |
+
|
| 288 |
+
<table><tr><td>Dataset</td><td>Model</td><td>total</td><td>Epochs</td><td>Batch.</td><td>LR</td><td>Sched.</td><td>m</td><td>WD</td><td>Sparsity</td><td>DST Drop.</td><td>f</td><td>tend</td></tr><tr><td>MNIST</td><td>LeNet5</td><td>11719</td><td>30</td><td>128</td><td>0.05</td><td>Cosine 0.9</td><td></td><td></td><td>5×10-4 95%</td><td>0.3</td><td>500</td><td>11719</td></tr><tr><td></td><td>ResNet50</td><td>)32000</td><td></td><td>4096</td><td>1.6</td><td></td><td></td><td></td><td></td><td>0.3</td><td>100</td><td></td></tr><tr><td>ImageNet</td><td>VGG16</td><td>128000</td><td>~102</td><td>1024</td><td>0.04</td><td>Step</td><td>0.9</td><td></td><td>1×10-4 80%</td><td>0.1</td><td>500</td><td>25000</td></tr></table>
|
| 289 |
+
|
| 290 |
+
\* Step schedule has a linear warm-up in first 5 epochs and decreases the learning rate by a factor of 10 at epochs 30,70 and 90.
|
| 291 |
+
|
| 292 |
+
# B Experimental Details
|
| 293 |
+
|
| 294 |
+
# B.1 Details of Experiments in Section 4.3
|
| 295 |
+
|
| 296 |
+
The training hyper-parameters used in $\ S 4 . 3$ are shared in Table 3. All experiments in this section start with a pruning experiment, after which the sparsity masks found by pruning are used to perform LT experiments. We use iterative magnitude pruning (Zhu et al., 2018) in our experiments, which is a well studied and more efficient pruning method as compared to the one used by Frankle et al. (2019a). Our pruning algorithm performs iterative pruning without rewinding the weights between intermediate steps and requires significantly less iterations. We expect our results would be even more pronounced with additional rewinding steps.
|
| 297 |
+
|
| 298 |
+
We use SGD with momentum in all of our experiments. Scratch and Lottery experiments use the same hyper-parameters. Additional specific details of our experiments are shared below.
|
| 299 |
+
|
| 300 |
+
LeNet5 We prune all layers of LeNet5, so that they reach $9 5 \%$ final sparsity (i.e. $9 5 \%$ of the parameters are zeros). We choose this sparsity, since at this sparsity, we start observing stark differences between Lottery and Scratch in terms of performance. We set the weight decay to zero, similar to the MNIST experiments done in the original LT paper (Frankle et al., 2019a) and do a grid search over learning-rates={0.1,0.2,0.05,0.02,0.01}. Loss values for the linear interpolation experiments are calculated on the entire training set.
|
| 301 |
+
|
| 302 |
+
ResNet50 We prune all layers of ResNet50, except the first layer, so that they reach $80 \%$ final sparsity. In this setting rewinding to the original initialization doesn’t work, hence we use values from $6 ^ { \mathrm { { t h } } }$ epoch. Loss values for the linear interpolation experiments are calculated using 500,000 images from the ImageNet-2012 training set.
|
| 303 |
+
|
| 304 |
+
# B.2 Details of Experiments in Section 4.1 and 4.2
|
| 305 |
+
|
| 306 |
+
Training hyper-parameters used for these experiments are shared in Table 4.
|
| 307 |
+
|
| 308 |
+
MNIST In this setting, the hyper-parameters are almost same as in $\ S 4 . 3$ , except we enable weight decay as it brings better generalization. We do a grid search over weightdecays={0.001,0.0001,0.00005,0.00001,0.0005} and learning-rates $= \{ 0 . \bar { 1 } , 0 . 2 , 0 . 0 5 , 0 . 0 2 , 0 . 0 1 \}$ and pick the values with top test accuracy. We use the masks found by pruning experiments in all of our MNIST experiments in this section to isolate the effect of the initialization. We simplify the update schedule of Dynamic Sparse Training (DST) methods such that they decay with learning rate. This approach fits well, since the original decay function used in these experiments is the cosine decay which is the same as our learning rate schedule. We scale learning rate such that it matches the initial drop fraction provided. Mask update frequency and initial drop fraction are chosen from a grid search o $\left\{ 5 0 , 1 0 0 , 5 0 0 \right\}$ and $\{ 0 . 0 1 , 0 . 1 , 0 . 3 \}$ respectively. To allow fair comparison, we use Glorot scaling in all of our initializations (i.e. scal $^ { \mathrm { { = 1 } } }$ and we average fan-in fan-out values) as it is the default initialization for Tensorflow layers and our results shows that it out-performs He initialization by a small margin with the hyper-parameters used. Using He initialization brings similar results.
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 7: Gradient Flow of Sparse LeNet-5s during Training. Gradient flow during training averaged over multiple runs, $\cdot _ { + } \cdot$ indicates training runs with our proposed sparse initialization. $\cdot _ { \mathrm { + L i u } } \cdot$ indicates initialization proposed by Liu et al., 2019. ‘He‘ suffix refers to He initilization where ‘scale $= 2 ^ { \circ }$ and ‘fanin‘ options are used for the variance scaling initialization.
|
| 312 |
+
|
| 313 |
+
Hessian calculation The Hessian is calculated on full training set using Hessian-vector products. We mask our network after each gradient call and calculate only non-zero rows. After calculating the full Hessian, we use numpy.eigh (van der Walt et al., 2011) to calculate eigenvalues of the Hessian.
|
| 314 |
+
|
| 315 |
+
ImageNet-2012 In this setting, hyper-parameters are almost the same as in $\ S 4 . 3$ except for VGG16 architecture, where we use a smaller batch size and learning rate. For all DST methods, we use a cosine drop schedule Dettmers et al., 2019 and hyper-parameters proposed by Evci et al. (2019). For VGG, we reduce the mask update frequency and the initial drop fraction, as we observe better performance after doing a grid search over $\{ 5 0 , 1 0 0 , 5 0 0 \}$ and $\{ 0 . 1 , 0 . 3 , 0 . 5 \}$ respectively. We also use a non-uniform (ERK) sparsity distribution among layers as described in Evci et al. (2020), since we observed that it brings better performance.
|
| 316 |
+
|
| 317 |
+
# C Additional Gradient Flow Plots
|
| 318 |
+
|
| 319 |
+
Here we share additional gradient flow figures for method/initialization combinations presented in 3 and 2.
|
| 320 |
+
|
| 321 |
+
In Fig. 7b, we show the gradient flow for DST methods and scratch training. Using RigL helps improves gradient flow with both initialization; helping learning to start earlier than regular Scratch training. Sparse Evolutionary Training (SET) seem to have limited effect on the gradient flow.
|
| 322 |
+
|
| 323 |
+
In Fig. 7b, we share gradient flow when the scaled initialization of Liu et al., 2019 is used. Similar to the proposed initialization, we observe improved gradient flow for all cases. Different than our initialization however, RigL doesn’t improve gradient flow in this setting; highlighting an interesting future research direction on the relationship between initialization and the DST methods.
|
| 324 |
+
|
| 325 |
+
In Fig. 7c, we share gradient flow when He initialization is used instead of Glorot initialization. We observe that Scratch training starts learning faster in this case. Gradient flow seems to be similar for other sparse initialization methods.
|
| 326 |
+
|
| 327 |
+
In Fig. 8, we share gradient flow improvements after DST updates on connectivity for different initialization methods. ResNet-50 curves match the results in Fig. 3. LeNet5 curves however seem to be adversely affected by poor initialization at the beginning of the training. We start observing improvements with RigL when the learning starts (around the $4 0 0 ^ { \mathrm { { t h } } }$ iteration).
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 8: Effect of Mask Updates in Dynamic Sparse Training. Effect of mask updates on the gradient norm. We measure the gradient norm before and after the mask updates and plot the $\Delta$ . $^ \bullet + ^ { \bullet }$ indicates proposed initialization and used in MNIST experiments.
|
| 331 |
+
|
| 332 |
+
Table 5: Results of Trained Fully-Connected MNIST Model from Different Initializations.
|
| 333 |
+
|
| 334 |
+
<table><tr><td rowspan="5">Baseline Lottery Small Dense</td><td colspan="3">MNIST</td></tr><tr><td colspan="3">Fully-Connected NN (98% sparse)</td></tr><tr><td colspan="3">98.55±0.04 97.73±0.11 91.69±1.85</td></tr><tr><td colspan="3">Original Liu et al.</td></tr><tr><td>94.40±4.00</td><td></td><td>Ours</td></tr><tr><td>Scratch</td><td></td><td>96.66±0.18</td><td>96.70±0.12</td></tr><tr><td>SET</td><td>96.49±0.36</td><td>96.56±0.22</td><td>96.48±0.10</td></tr><tr><td>RigL</td><td>96.82±0.25</td><td>96.76±0.19</td><td>96.94±0.12</td></tr></table>
|
| 335 |
+
|
| 336 |
+
# D Fully Connected Neural Network Experiments on MNIST
|
| 337 |
+
|
| 338 |
+
In this section we repeat our experiments from $\ S 4 . 1$ using different sparse initialization methods, and analyzing gradient flow, for a standard 2-layer fully-connected NN with 2 hidden layers of size 300 and 100 units. We use the same grid used in LeNet5 experiments for hyper-parameter selection. Best results were obtained with a learning rate of 0.2, a weight decay coefficient of 0.0001 and an mask update frequency of 500 (used in DST methods). The rest of the hyperparameters remained unchanged from the LeNet5 experiments.
|
| 339 |
+
|
| 340 |
+
The results of training with various initialization methods is shown in Table 5. Although the results are not as drastic as with LeNet5, we see that here too sparsity aware initialization (the proposed initialization, and that of Liu (Liu et al., 2019)) shows a significant improvement in the test accuracy of Scratch, and RigL or our proposed initialization, although not quite reaching lottery or RigL accuracy. Finally, we see no significant effect on SET training, with none of the initialization variants having a significant increase over any of the others, although the Liu (Liu et al., 2019) initialization does marginally better.
|
| 341 |
+
|
| 342 |
+
The gradient flow of this model is shown in Fig. 9. While we see moderate improvements to Scratch gradient flow early on in training with our proposed initialization (a), RigL shows significantly higher gradient flow throughout training, in particular after mask updates (b), mirroring the results of LeNet5. The interpolation graphs in (c) only differ slightly from that of LeNet5, again showing that our results for LeNet5 broadly hold for the fully-connected model.
|
| 343 |
+
|
| 344 |
+
# E Hessian Spectrum of LeNet5
|
| 345 |
+
|
| 346 |
+
Given a loss function $L$ and parameters $\theta$ , we can write the first order Taylor approximation of the change in loss $\Delta { \cal L } = { \cal L } ( \theta ^ { t + 1 } ) - { \cal L } ( \theta ^ { \hat { t } } )$ after a single training step with the learning rate $\epsilon > 0$ as :
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\Delta L { \approx } - \epsilon { \boldsymbol { \nabla } } L ( { \boldsymbol { \theta } } ) ^ { T } { \boldsymbol { \nabla } } L ( { \boldsymbol { \theta } } ) .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Note that as long as the error is small, gradient descent is guaranteed to decrease the loss by an amount proportional to $\check { \nabla } L ( \theta ) ^ { T } \nabla L ( \theta )$ , which we refer as the gradient flow. In practice large learning rates are used, and the first order approximation might not be accurate. Instead we can look at the second order
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 9: Sparse 300-100 MLP experiments. Gradient flow during training averaged over multiple runs, $^ { \bullet } + ^ { \bullet }$ indicates training runs with our proposed sparse initialization.
|
| 356 |
+
|
| 357 |
+
approximation of $\Delta L$
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\Delta L \approx - \alpha \boldsymbol { \nabla } L ( \theta ) ^ { T } \boldsymbol { \nabla } L ( \theta ) + \frac { \alpha ^ { 2 } } { 2 } \boldsymbol { \nabla } L ( \theta ) ^ { T } \boldsymbol { H } ( \theta ) \boldsymbol { \nabla } L ( \theta ) ,
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
where $H ( \theta )$ is the Hessian of the loss function. The eigenvalue spectrum of Hessian can help us understand the local landscape (Sagun et al., 2017), and help us identify optimization difficulties (Ghorbani et al., 2019). For example, if and when the gradient is aligned with large magnitude eigenvalues, the second term of Eq. (28) can have a significant effect on the optimization of $L$ . If the gradient is aligned with large positive eigenvalues, it can prevent gradient descent from decreasing the loss and harm the optimization. Similarly, if it is aligned with negative eigenvalues it can help to accelerate optimization.
|
| 364 |
+
|
| 365 |
+
We show the Hessian spectrum before and after the topology updates in Fig. 10. After RigL updates we observe new negative eigenvalues with significantly larger magnitudes. We also see larger positive eigenvalues, which disappear after few iterations\*\*. In comparison, the effect of SET updates on the Hessian spectrum seems limited.
|
| 366 |
+
|
| 367 |
+
We also evaluate the Hessian spectrum of LeNet5 during the training. In Fig. 11b, we observe similar shapes for each method on the positive side of the spectrum, however, on the negative side dense models seem to have more mass. We plot the magnitude of the largest negative eigenvalue to characterize this behaviour in Fig. 11a. We observe a significant difference between sparse and dense models and observe that sparse networks trained with RigL have larger negative eigenvalues.
|
| 368 |
+
|
| 369 |
+
# F Comparing Function Similarity
|
| 370 |
+
|
| 371 |
+
Table 6 gives a full list of comparison metrics of the predictions on the test set for LeNet5 on MNIST and ResNet50 on ImageNet-2012, in particular here we also compare the output probability distributions using relevant metrics.
|
| 372 |
+
|
| 373 |
+
<table><tr><td rowspan="11">JPsur/mmnr Sps ppo- PITn ud / r TTr rrllrpriir/i lirtsr Tarr tsrtetritetrr-itrr rittts Piiernr</td><td>000.53333.0 010.107007.0 100.1717</td><td>000.0--/7.0.0 100.007:10.1</td><td rowspan="11">3:0033.83</td><td rowspan="11">pJun ud /m gsr P1n.dd / a P iiiTitr prrnrr/ aertegg Pirialing</td><td rowspan="3">3331.355 171211222 555357174</td><td rowspan="3">3733.2558 33333.7311 222441 111211155</td></tr><tr><td>1770:009.5545 1000.001010'0</td><td>0013.1077153 1sf ppoa-s</td></tr><tr><td>0000.0010010 000530 55500</td></tr><tr><td>8000.353335. 8000.007555.5 0000.503575.1</td><td>0000'0F6111.7 0007.3031151 0000:0-5101'0</td><td rowspan="2">572537731 60000-1/77.0 0005.333330.5</td></tr><tr><td>0000.-03005.4 900.001-71.7 0715.5535555</td><td>0010:001111.0 **6100026100 00000-/2.0.0</td></tr><tr><td>7000'0F6800'0 9000.-01500.0 0010.157515.5 00:3.355703.3</td><td>0070007100.0 0000177105.5 0000.70720.0 002.105515.5</td></tr><tr><td>89.86 00'86 85</td><td>Prrrsr ssersee Jrreeteg £9'86 ∠0'66</td></tr><tr><td>70:3257.86 1:00 40:27 130035.33 10'0干 09'86 685 uos piunnm</td><td>Jr-1I) 'eSt 1Ss 171.5330100 50154 ThrErNe</td></tr><tr><td>u H/M pend er Jia niers Prrereeere Sitett I</td><td>111 7511 11315751 Ja/M pand Shteett</td></tr></table>
|
| 374 |
+
|
| 375 |
+
|
| 376 |
+
g . runinsolutionthattheLTandscratchmodelsared
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 10: Hessian spectrum before and after mask updates: (left) SET (right) RigL. Similar to Ghorbani et al., 2019, we estimate the spectral density of Hessian using Gaussian kernels.
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 11: MNIST Hessian spectrum experiments.
|
md/train/WH0taVJii5_/WH0taVJii5_.md
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Trading Complexity for Sparsity in Random Forest Explanations
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Random forests have long been considered as powerful model ensembles in ma
|
| 11 |
+
2 chine learning. By training multiple decision trees, whose diversity is fostered
|
| 12 |
+
3 through data and feature subsampling, the resulting random forest can lead to
|
| 13 |
+
4 more stable and reliable predictions than a single decision tree. This however
|
| 14 |
+
5 comes at the cost of decreased interpretability: while decision trees are often easily
|
| 15 |
+
6 interpretable, the predictions made by random forests are much more difficult to
|
| 16 |
+
7 understand, as they involve a majority vote over hundreds of decision trees. In
|
| 17 |
+
8 this paper, we examine different types of reasons that explain “why” an input
|
| 18 |
+
9 instance is classified as positive or negative by a Boolean random forest. Notably,
|
| 19 |
+
10 as an alternative to sufficient reasons taking the form of prime implicants of the
|
| 20 |
+
11 random forest, we introduce majoritary reasons which are prime implicants of a
|
| 21 |
+
12 strict majority of decision trees. For these different abductive explanations, the
|
| 22 |
+
13 tractability of the generation problem (finding one reason) and the minimization
|
| 23 |
+
14 problem (finding one shortest reason) are investigated. Experiments conducted on
|
| 24 |
+
15 various datasets reveal the existence of a trade-off between runtime complexity and
|
| 25 |
+
16 sparsity. Sufficient reasons - for which the identification problem is DP-complete
|
| 26 |
+
17 - are slightly larger than majoritary reasons that can be generated using a simple
|
| 27 |
+
18 linear-time greedy algorithm, and significantly larger than minimal majoritary
|
| 28 |
+
19 reasons that can be approached using an anytime PARTIAL MAXSAT algorithm.
|
| 29 |
+
|
| 30 |
+
# 20 1 Introduction
|
| 31 |
+
|
| 32 |
+
21 Over the past two decades, rapid progress in statistical machine learning has led to the deployment
|
| 33 |
+
22 of models endowed with remarkable predictive capabilities. Yet, as the spectrum of applications
|
| 34 |
+
23 using statistical learning models becomes increasingly large, explanations for why a model is making
|
| 35 |
+
24 certain predictions are ever more critical. For example, in medical diagnosis, if some model predicts
|
| 36 |
+
25 that an image is malignant, then the doctor may need to know which features in the image have led to
|
| 37 |
+
26 this classification. Similarly, in the banking sector, if some model predicts that a customer is a fraud,
|
| 38 |
+
27 then the banker might want to know why. Therefore, having explanations for why certain predictions
|
| 39 |
+
28 are made is essential for securing user confidence in machine learning technologies [21, 22].
|
| 40 |
+
29 This paper focuses on classifications made by random forests, a popular ensemble learning method
|
| 41 |
+
30 that constructs multiple randomized decision trees during the training phase, and predicts by taking a
|
| 42 |
+
31 majority vote over the base classifiers [8]. Since decision tree randomization is achieved by essentially
|
| 43 |
+
32 coupling data subsampling (or bagging) and feature subsampling, random forests are fast and easy to
|
| 44 |
+
33 implement, with few tuning parameters. Furthermore, they often make accurate and robust predictions
|
| 45 |
+
34 in practice, even for small data samples and high-dimensional feature spaces [6]. For these reasons,
|
| 46 |
+
35 random forests have been used in various applications including, among others, computer vision [11],
|
| 47 |
+
36 crime prediction [7], ecology [12], genomics [9], and medical diagnosis [3].
|
| 48 |
+
37 Despite their success, random forests are much less interpretable than decision trees. Indeed, the
|
| 49 |
+
38 prediction made by a decision tree on a given data instance can be easily interpreted by reading the
|
| 50 |
+
39 unique root-to-leaf path that covers the instance. Contrastingly, there is no such direct reason in a
|
| 51 |
+
40 random forest, since the prediction is derived from a majority vote over multiple decision trees. So, a
|
| 52 |
+
41 key issue in random forests is to infer abductive explanations, that is, to explain in concise terms why
|
| 53 |
+
42 a data instance is classified as positive or negative by the model ensemble.
|
| 54 |
+
43 Related Work. Explaining random forest predictions has received increasing attention in recent
|
| 55 |
+
44 years [5, 10, 18]. Notably, in the classification setting, [10, 18] have focused on sufficient reasons,
|
| 56 |
+
45 which are abductive explanations involving only relevant features [13]. More specifically, if we view
|
| 57 |
+
46 any random forest classifier as a Boolean function $f$ , then a sufficient reason for classifying a data
|
| 58 |
+
47 instance $_ { \textbf { \em x } }$ as positive by $f$ is a prime implicant $t$ of $f$ covering $_ { \textbf { \em x } }$ . By construction, removing any
|
| 59 |
+
48 feature from a sufficient reason $t$ would question the fact that $t$ explains the way $_ { \textbf { \em x } }$ is classified by $f$
|
| 60 |
+
49 Interestingly, if $f$ is described by a single decision tree, then generating a sufficient reason for any
|
| 61 |
+
50 input instance $_ { \textbf { \em x } }$ can be done in linear time. Yet, in the general case where $f$ is represented by an
|
| 62 |
+
51 arbitrary number of decision trees, the problem of identifying a sufficient reason is DP-complete.
|
| 63 |
+
52 Despite this intractability statement, the empirical results reported in [18] show that a MUS-based
|
| 64 |
+
53 algorithm for computing sufficient reasons proves quite efficient in practice.
|
| 65 |
+
54 In addition to “model-based” explanations investigated in [10, 18], “model-agnostic” explanations
|
| 66 |
+
55 can be applied to random forests. Notably, the LIME method [27] extrapolates a linear threshold
|
| 67 |
+
56 function $g$ from the behavior of the random forest $f$ around an input instance $_ { \textbf { \em x } }$ . Yet, even if a prime
|
| 68 |
+
57 implicant of the linear threshold function can be easily computed, this explanation is not guaranteed
|
| 69 |
+
58 abductive since $g$ is only an approximation of $f$ .
|
| 70 |
+
59 Contributions. In this paper, we introduce several new notions of abductive explanations: direct
|
| 71 |
+
60 reasons extend to the case of random forests the corresponding notion defined primarily for decision
|
| 72 |
+
61 trees, and majority reasons are weak forms of abductive explanations which take into account the
|
| 73 |
+
62 averaging rule of random forests. Informally, a majoritary reason for classifying a instance $_ { \textbf { \em x } }$ as
|
| 74 |
+
63 positive by some random forest $f$ is a prime implicant $t$ of a majority of decision trees in $f$ that
|
| 75 |
+
64 covers $_ { \textbf { \em x } }$ . Thus, any sufficient reason is a majoritary reason, but the converse is not true. For these
|
| 76 |
+
65 different reasons, we examine the tractability of both the generation (finding one explanation) and
|
| 77 |
+
66 the minimization (finding one shortest explanation) problems. To the best of our knowledge, all
|
| 78 |
+
67 complexity results related to random forest explanations are new, if we make an exception for the
|
| 79 |
+
68 intractability of generating sufficient reasons, which was recently established in [18]. Notably, direct
|
| 80 |
+
69 reasons and majoritary reasons can be derived in time polynomial in the size of the input (the instance
|
| 81 |
+
70 and the random forest used to classify it). By contrast, the identification of minimal majoritary
|
| 82 |
+
71 reasons is NP-complete, and the identification of minimal sufficient reasons is $\Sigma _ { 2 } ^ { p }$ -complete.
|
| 83 |
+
72 Based on these results, we provide algorithms for deriving random forest explanations, which open the
|
| 84 |
+
73 way for an empirical comparison. Our experiments made on standard benchmarks show the existence
|
| 85 |
+
74 of a trade-off between the runtime complexity of finding (possibly minimal) abductive explanations
|
| 86 |
+
75 and the sparsity of such explanations. In a nutshell, majoritary reasons and minimal majoritary
|
| 87 |
+
76 reasons offer interesting compromises in comparison to, respectively, sufficient reasons and minimal
|
| 88 |
+
77 sufficient reasons. Indeed, the size of majoritary reasons and the computational effort required to
|
| 89 |
+
78 generate them are generally smaller than those obtained for sufficient reasons. Furthermore, minimal
|
| 90 |
+
79 majoritary reasons outperform minimal sufficient reasons, since the latter are too computationally
|
| 91 |
+
80 demanding. In fact, using an anytime PARTIAL MAXSAT solver for minimizing majoritary reasons,
|
| 92 |
+
81 we derive sparse explanations which are typically much shorter than all other forms of abductive
|
| 93 |
+
82 explanations. Proofs and additional empirical results are provided as supplementary material.
|
| 94 |
+
|
| 95 |
+
# 83 2 Preliminaries
|
| 96 |
+
|
| 97 |
+
For an integer $n$ , let $[ n ] = \{ 1 , \cdots , n \}$ . By $\mathcal { F } _ { n }$ we denote the class of all Boolean functions from $\{ 0 , 1 \} ^ { n }$ to $\{ 0 , 1 \}$ , and we use $X _ { n } = \{ x _ { 1 } , \cdot \cdot \cdot , x _ { n } \}$ to denote the set of input Boolean variables. Any Boolean vector $\mathbf { \bar { x } } \in \{ 0 , 1 \} ^ { n }$ is called an instance. For any function $f \in \mathcal { F } _ { n }$ , an instance $\pmb { x } \in \{ 0 , 1 \} ^ { \bar { n } }$ is called a positive example of $f$ if $f ( { \pmb x } ) = 1$ , and a negative example otherwise.
|
| 98 |
+
|
| 99 |
+
88 We refer to $f$ as a propositional formula when it is described using the Boolean connectives $\wedge$
|
| 100 |
+
89 (conjunction), $\vee$ (disjunction) and $\neg$ (negation), together with the constants 1 (true) and 0 (false). As
|
| 101 |
+
90 usual, a literal $l _ { i }$ is a variable $x _ { i }$ or its negation $\neg x _ { i }$ , also denoted $\overline { { x } } _ { i }$ . A term (or monomial) $t$ is a
|
| 102 |
+
91 conjunction of literals, and a clause $c$ is a disjunction of literals. A DNF formula is a disjunction of
|
| 103 |
+
92 terms and a CNF formula is a conjunction of clauses. The set of variables occurring in a formula $f$ is
|
| 104 |
+
93 denoted $V a r ( f )$ . In the rest of the paper, we shall often treat instances as terms, and terms as sets of
|
| 105 |
+
94 literals. Given an assignment $z \in \bar { \{ 0 , 1 \} ^ { n } }$ , the corresponding term is defined as
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 1: A random forest $F = \{ T _ { 1 } , T _ { 2 } , T _ { 3 } \}$ for recognizing Cattleya orchids. The left (resp. right) child of any decision node labelled by $x _ { i }$ corresponds to the assignment of $x _ { i }$ to 0 (resp. 1).
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
t _ { z } = \bigwedge _ { i = 1 } ^ { n } x _ { i } ^ { z _ { i } } { \mathrm { ~ w h e r e ~ } } x _ { i } ^ { 0 } = { \overline { { x } } } _ { i } { \mathrm { ~ a n d ~ } } x _ { i } ^ { 1 } = x _ { i }
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
95 A term $t$ covers an assignment $_ z$ if $t \subseteq t _ { z }$ . An implicant of a Boolean function $f$ is a term that
|
| 115 |
+
96 implies $f$ , that is, a term $t$ such that $f ( z ) = 1$ for every assignment $_ z$ covered by $t$ . A prime implicant
|
| 116 |
+
97 of $f$ is an implicant $t$ of $f$ such that no proper subset of $t$ is an implicant of $f$ .
|
| 117 |
+
98 With these basic notions in hand, a (Boolean) decision tree on $X _ { n }$ is a binary tree $T$ , each of whose
|
| 118 |
+
99 internal nodes is labeled with one of $n$ input variables, and whose leaves are labeled 0 or 1. Every
|
| 119 |
+
100 variable is supposed (w.l.o.g.) to occur at most once on any root-to-leaf path (read-once property).
|
| 120 |
+
101 The value $T ( \pmb { x } ) \in \{ 0 , 1 \}$ of $T$ on an input instance $_ { \textbf { \em x } }$ is given by the label of the leaf reached from
|
| 121 |
+
102 the root as follows: at each node go to the left or right child depending on whether the input value of
|
| 122 |
+
103 the corresponding variable is 0 or 1, respectively. A (Boolean) random forest on $X _ { n }$ is an ensemble
|
| 123 |
+
104 $F = \{ T _ { 1 } , \cdots , T _ { m } \}$ , where each $T _ { i }$ $( i \in [ m ] )$ ) is a decision tree on $X _ { n }$ , and such that the value
|
| 124 |
+
105 $F ( \pmb { x } ) \in \{ 0 , 1 \}$ on an input instance $_ { \textbf { \em x } }$ is given by
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
F ( \pmb { x } ) = \left\{ \begin{array} { l l } { 1 } & { \mathrm { ~ i f ~ } \frac { 1 } { m } \sum _ { i = 1 } ^ { m } T _ { i } ( \pmb { x } ) > \frac { 1 } { 2 } } \\ { 0 } & { \mathrm { ~ o t h e r w i s e . } } \end{array} \right.
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
The size of 106 $F$ is given by $\textstyle | F | = \sum _ { i = 1 } ^ { m } | T _ { i } |$ , where $\left| T _ { i } \right|$ is the number of nodes occurring in $T _ { i }$ . The 107 class of decision trees on $X _ { n }$ is denoted $\mathbb { D } \mathbb { T } _ { n }$ , and the class of random forests with at most $m$ decision 108 trees (with $m \geq 1$ ) over $ { \mathbb { D } } { \mathrm { T } } _ { n }$ is denoted $\mathtt { R F } _ { n , m }$ . $\mathbb { R } \mathbb { F } _ { n }$ is the union of all $\mathtt { R F } _ { n , m }$ for $m \in \mathbb { N }$ .
|
| 131 |
+
|
| 132 |
+
109 Example 1. The random forest $F = \{ T _ { 1 } , T _ { 2 } , T _ { 3 } \}$ in Figure $^ { l }$ is composed of three decision trees.
|
| 133 |
+
110 It separates Cattleya orchids from other orchids using the following features: $x _ { 1 }$ : “has fragrant
|
| 134 |
+
111 flowers”, $x _ { 2 }$ : “has one or two leaves”, $x _ { 3 }$ : “has large flowers”, and $x _ { 4 }$ : “is sympodial”.
|
| 135 |
+
112 It is well-known that any decision tree $T$ can be transformed into its negation $\lnot T \in \mathbb { D } \mathbb { T } _ { n }$ , by simply
|
| 136 |
+
113 reverting the label of leaves. Negating a random forest can also be achieved in polynomial time:
|
| 137 |
+
114 Proposition 1. There exists a linear-time algorithm that computes a random forest $\lnot F \in \mathbb { R } \mathbb { F } _ { n , m }$
|
| 138 |
+
115 equivalent to the negation of a given random forest $F \in \mathbb { R } \mathbb { F } _ { n , m }$ .
|
| 139 |
+
116 Another important property of decision trees is that any $T \in \mathsf { D T } _ { n }$ can be transformed in linear time
|
| 140 |
+
117 into an equivalent disjunction of terms $\tt D N F ( T )$ , where each term coincides with a 1-path (i.e., a path
|
| 141 |
+
118 from the root to a leaf labeled with 1), or a conjunction of clauses $\mathrm { C N F } ( T )$ , where each clause is the
|
| 142 |
+
119 negation of term describing a 0-path. When switching to random forests, the picture is quite different:
|
| 143 |
+
120 Proposition 2. Any CNF or DNF formula can be converted in linear time into an equivalent random
|
| 144 |
+
121 forest, but there is no polynomial-space translation from RF to CNF or to DNF.
|
| 145 |
+
123 The key focus of this study is to explain why a given (Boolean) random forest classifies some incoming
|
| 146 |
+
124 data instance as positive or negative. This calls for a notion of abductive explanation1. Formally,
|
| 147 |
+
125 given a Boolean function $f \in \mathcal { F } _ { n }$ and an instance $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ , an abductive explanation for $_ { \textbf { \em x } }$
|
| 148 |
+
126 given $f$ is an implicant $t$ of $f$ (resp. $\neg f$ ) if $f ( { \pmb x } ) = 1$ (resp. $f ( \pmb { x } ) = 0 ,$ ) that covers $_ { \textbf { \em x } }$ . An abductive
|
| 149 |
+
127 explanation $t$ for $_ { \textbf { \em x } }$ given $f$ always exists, since $t = t _ { x }$ is such a (trivial) explanation. So, in the rest
|
| 150 |
+
128 of this section, we shall mainly concentrate on sparse forms of abductive explanations.
|
| 151 |
+
129 Before delving into details, it is worth mentioning that if $f$ is represented by a random forest then,
|
| 152 |
+
130 without loss of generality, we can focus on the case where $_ { \textbf { \em x } }$ is a positive example of $f$ , because $\neg f$
|
| 153 |
+
131 can be computed in linear time (by Proposition 1). Nevertheless, for the sake of clarity, we shall
|
| 154 |
+
132 consider both cases $f ( { \pmb x } ) = 1$ and ${ \dot { f } } ( { \pmb x } ) = 0$ in our definitions.
|
| 155 |
+
|
| 156 |
+
# 3.1 Direct Reasons
|
| 157 |
+
|
| 158 |
+
134 For a decision tree $T \in { \mathbb { D } } \mathbb { T } _ { n }$ and a data instance $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ , the direct reason of $_ { \textbf { \em x } }$ given $T$ is the
|
| 159 |
+
135 term $t _ { x } ^ { T }$ corresponding to the unique root-to-leaf path of $T$ that covers $_ { \textbf { \em x } }$ . We can extend this simple
|
| 160 |
+
136 form of abductive explanation to random forests as follows:
|
| 161 |
+
|
| 162 |
+
Definition 1. Let 137 $F = \{ T _ { 1 } , \dots , T _ { m } \}$ be a random forest in $\mathtt { R F } _ { n , m }$ , and $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ be an instance. Then, the direct reason for 138 $_ { \textbf { \em x } }$ given $F$ is the term $t _ { x } ^ { F }$ defined by
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
t _ { \pmb { x } } ^ { F } = \left\{ \begin{array} { l l } { \bigwedge _ { T _ { i } \in F : T _ { i } ( \pmb { x } ) = 1 } t _ { \pmb { x } } ^ { T _ { i } } } & { \mathrm { ~ } i f F ( \pmb { x } ) = 1 } \\ { \bigwedge _ { T _ { i } \in F : T _ { i } ( \pmb { x } ) = 0 } t _ { \pmb { x } } ^ { T _ { i } } } & { \mathrm { ~ } i f F ( \pmb { x } ) = 0 } \end{array} \right.
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
By construction, 139 $t _ { x } ^ { F }$ is an abductive explanation which can be computed in $\mathcal { O } ( | F | )$ time.
|
| 169 |
+
|
| 170 |
+
140 Example 2. Considering Example $I$ again, the instance $\pmb { x } = ( 1 , 1 , 1 , 1 )$ is recognized as a Cattleya
|
| 171 |
+
141 orchid, since $F ( { \pmb x } ) = 1$ . The direct reason for $_ { \textbf { \em x } }$ given $F$ is $t _ { \pmb { x } } ^ { F } = x _ { 1 } \wedge x _ { 2 } \wedge x _ { 3 } \wedge x _ { 4 }$ . It coincides
|
| 172 |
+
142 with $t _ { x }$ . Consider now the instance $\pmb { x } ^ { \prime } = ( 0 , 1 , 0 , 0 )$ ; it is not recognized as a Cattleya orchid, since
|
| 173 |
+
143 $F ( { \pmb x } ) = 0$ . The direct reason for $\mathbf { x } ^ { \prime }$ given $F$ is $t _ { { \pmb x } ^ { \prime } } ^ { F } = x _ { 2 } \wedge \overline { { x } } _ { 3 } \wedge \overline { { x } } _ { 4 }$ . It is a better abductive explanation
|
| 174 |
+
144 than $t _ { { \pmb x } ^ { \prime } }$ itself since it does not contain $\overline { { x } } _ { 1 }$ , which is locally irrelevant.
|
| 175 |
+
|
| 176 |
+
# 3.2 Sufficient Reasons
|
| 177 |
+
|
| 178 |
+
Another valuable notion of abductive explanation is the one of sufficient reason2, defined for any Boolean classifier [13]. In the setting of random forests, such explanations can be defined as follows:
|
| 179 |
+
|
| 180 |
+
Definition 2. Let $F \in \mathrm { { R F } } _ { n }$ be a random forest and $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ be an instance. A sufficient reason for $_ { \textbf { \em x } }$ given $F$ is a prime implicant $t$ of $F$ (resp. $\neg F$ ) if $F ( { \pmb x } ) = 1$ (resp. $F ( { \pmb x } ) = 0 .$ ) that covers $_ { \textbf { \em x } }$ .
|
| 181 |
+
|
| 182 |
+
Example 3. For our running example, $x _ { 1 } \wedge x _ { 2 } \wedge x _ { 4 }$ and $x _ { 3 } \wedge x _ { 4 }$ are the sufficient reasons for $_ { \textbf { \em x } }$ given $F$ . $\overline { { x } } _ { 4 }$ and $\overline { { x } } _ { 1 } \wedge x _ { 2 } \wedge \overline { { x } } _ { 3 }$ are the sufficient reasons for $\mathbf { x } ^ { \prime }$ given $F$ .
|
| 183 |
+
|
| 184 |
+
Unlike arbitrary abductive explanations, all features occurring in a sufficient reason $t$ are relevant. Indeed, removing any literal from $t$ would question the fact that $t$ implies $F$ . To this point, the direct reason $t _ { x } ^ { F }$ for $_ { \textbf { \em x } }$ given $F$ may contain arbitrarily many more features than a sufficient reason for $_ { \textbf { \em x } }$ given $F$ , since this was already shown in the case where $F$ consists in a single decision tree [17].
|
| 185 |
+
|
| 186 |
+
The problem of finding a sufficient reason $t$ for an input instance $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ with respect to a given random forest $F \in \mathbb { R } { \mathbb { F } } _ { n }$ , has recently been shown DP-complete [18]. In fact, even the apparently simple task of checking whether $t$ is an implicant of $F$ is already hard:
|
| 187 |
+
|
| 188 |
+
Proposition 3. Let $F$ be a random forest in $\mathbb { R } \mathbb { F } _ { n }$ and $t$ be a term over $X _ { n }$ . Then, deciding whether $t$ is an implicant of $F$ is coNP-complete.
|
| 189 |
+
|
| 190 |
+
The above result is in stark contrast with the computational complexity of checking whether a term $t$ is an implicant of a decision tree $T$ . This task can be solved in polynomial time, using the fact that
|
| 191 |
+
|
| 192 |
+
163 $T$ can be converted (in linear time) into its clausal form $\tt C N F ( T )$ , together with the fact that testing
|
| 193 |
+
164 whether $t$ implies $\mathrm { C N F } ( T )$ can be done in $\mathcal { O } ( \vert T \vert )$ time. That mentioned, in the case of random forests,
|
| 194 |
+
165 the implicant test can be achieved via a call to a SAT oracle:
|
| 195 |
+
166 Proposition 4. Let $F = \{ T _ { 1 } , \dots , T _ { m } \}$ be a random forest of $\mathtt { R F } _ { n , m }$ , and $t$ be a (satisfiable) term
|
| 196 |
+
167 over $X _ { n }$ . Let $H$ be the CNF formula
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\{ ( { \overline { { y } } } _ { i } \lor c ) : i \in [ m ] , c \in \operatorname { C N F } ( \neg T _ { i } ) \} \cup \operatorname { C N F } \left( \sum _ { i = 1 } ^ { m } y _ { i } > { \frac { m } { 2 } } \right)
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
where 168 $\{ y _ { 1 } , \dots , y _ { m } \}$ are fresh variables and CNF $\textstyle \left( \sum _ { i = 1 } ^ { m } y _ { i } > { \frac { m } { 2 } } \right)$ is a CNF encoding of the cardinality contraint 169 $\textstyle \sum _ { i = 1 } ^ { m } y _ { i } > { \frac { m } { 2 } }$ . Then, $t$ is an implicant of $F$ if and only if $H \wedge t$ is unsatisfiable.
|
| 203 |
+
|
| 204 |
+
170 Based on such an encoding, the sufficient reasons for an instance $_ { \textbf { \em x } }$ given a random forest $F$ can
|
| 205 |
+
171 be characterized in terms of MUS (minimal unsatisfiable subsets), as suggested in [18]. This
|
| 206 |
+
172 characterization is useful because many SAT-based algorithms for computing a MUS (or even all
|
| 207 |
+
173 MUSes) of a CNF formula have been pointed out for the past decade [2, 19, 20], and hence, one can
|
| 208 |
+
174 take advantage of them for computing sufficient reasons.
|
| 209 |
+
175 Going one step further, a natural way for improving the clarity of sufficient reasons is to focus on
|
| 210 |
+
176 those of minimal size. Specifically, given $F \in \mathbb { R } { \mathbb { F } } _ { n }$ and $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ , a minimal sufficient reason for
|
| 211 |
+
177 $_ { \textbf { \em x } }$ with respect to $F$ is a sufficient reason for $_ { \textbf { \em x } }$ given $F$ of minimal size.3
|
| 212 |
+
|
| 213 |
+
78 Example 4. For our running example, $x _ { 3 } \wedge x _ { 4 }$ is the unique minimal sufficient reason for $_ { \textbf { \em x } }$ given $F$ and 79 $\overline { { x } } _ { 4 }$ is the unique minimal reason for $\mathbf { x } ^ { \prime }$ given $F$ .
|
| 214 |
+
|
| 215 |
+
180 As a by-product of the characterization of a sufficient reason in terms of MUS [18], a minimal
|
| 216 |
+
181 sufficient reason for $_ { \textbf { \em x } }$ given $f$ can be viewed as a minimal MUS. Thus, we can exploit algorithms for
|
| 217 |
+
182 computing minimal MUSes (see e.g., [16]) in order to derive minimal sufficient reasons. However,
|
| 218 |
+
183 deriving a minimal sufficient reason is computationally harder than deriving a sufficient reason:
|
| 219 |
+
|
| 220 |
+
Proposition 5. Let $F \in \mathbb { R F } _ { n }$ , $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ , and $k \in \mathbb N$ . Then, deciding whether there exists a minimal sufficient reason $t$ for $_ { \textbf { \em x } }$ given $F$ containing at most $k$ features is $\Sigma _ { 2 } ^ { p }$ -complete.
|
| 221 |
+
|
| 222 |
+
# 3.3 Majoritary Reasons
|
| 223 |
+
|
| 224 |
+
Based on the above considerations, a natural question arises: does there exist a middle ground between direct reasons, which main contain many irrelevant features but are easy to calculate, and sufficient reasons, which only contain relevant features but are potentially much harder to generate? Inspired by the way prime implicants can be computed when dealing with decision trees, we can reply in the affirmative using the notion of majoritary reasons, defined as follows.
|
| 225 |
+
|
| 226 |
+
Definition 3. Let $F = \{ T _ { 1 } , \dots , T _ { m } \}$ be a random forest in $\mathtt { R F } _ { n , m }$ and $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ be an instance. Then, a majoritary reason for $_ { \textbf { \em x } }$ given $F$ is a term $t$ covering $_ { \textbf { \em x } }$ , such that t is an implicant of at least $\lfloor { \frac { m } { 2 } } \rfloor + 1$ decision trees $T _ { i }$ (resp. $\neg T _ { i }$ ) if $F ( { \pmb x } ) = 1$ (resp. $\begin{array} { r } { F ( { \pmb x } ) = 0 , } \end{array}$ ), and for every $l \in t$ , $t \setminus \{ l \}$ does not satisfy this last condition.
|
| 227 |
+
|
| 228 |
+
Example 5. For our running example, $_ { \textbf { \em x } }$ has three majoritary reasons given $F$ : $x _ { 1 } \wedge x _ { 2 } \wedge x _ { 4 }$ ,
|
| 229 |
+
$x _ { 1 } \wedge x _ { 3 } \wedge x _ { 4 }$ , and $x _ { 2 } \wedge x _ { 3 } \wedge x _ { 4 }$ . Those reasons are better than $\dot { t } _ { x } ^ { F }$ in the sense that they are shorter s dire, and ntrastingly, . Each of t $\mathbf { x } ^ { \prime }$ has four major two majoritary ry reaasons e, $F$ $\overline { { x } } _ { 1 } \wedge \overline { { x } } _ { 4 }$ , w $x _ { 2 } \wedge \overline { { x } } _ { 4 }$
|
| 230 |
+
$\overline { { x } } _ { 3 } \wedge \overline { { x } } _ { 4 }$ $\overline { { x } } _ { 1 } \wedge x _ { 2 } \wedge \overline { { x } } _ { 3 }$ $x _ { 2 } \wedge \overline { { x } } _ { 4 }$ $\overline { { x } } _ { 3 } \wedge \overline { { x } } _ { 4 }$ $t _ { x ^ { \prime } } ^ { F }$ $\mathbf { x } ^ { \prime }$ $F$
|
| 231 |
+
|
| 232 |
+
In general, the notions of majoritary reasons and of sufficient reasons do not coincide. Indeed, a sufficient reason $t$ is a prime implicant (covering ${ \pmb x }$ ) of the forest $F$ , while a majoritary reason $t ^ { \prime }$ is an implicant (covering ${ \pmb x }$ ) of a strict majority of decision trees in the forest $F$ satisfying the additional condition that $t ^ { \prime }$ is a prime implicant of at least one of these decision trees. Viewing majoritary reasons as “weak” forms of sufficient reasons, they can include irrelevant features:
|
| 233 |
+
|
| 234 |
+
Proposition 6. Let $F = \{ T _ { 1 } , \dots , T _ { m } \}$ be a random forest of $\mathtt { R F } _ { n , m }$ and $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ such that $F ( { \pmb x } ) = 1$ . Unless $m < 3$ , it can be the case that every majoritary reason for $_ { \textbf { \em x } }$ given $F$ contains arbitrarily many more features than any sufficient reason for $_ { \textbf { \em x } }$ given $F$ .
|
| 235 |
+
|
| 236 |
+
209 What makes majoritary reasons valuable is that they are abductive and can be generated in linear time.
|
| 237 |
+
210 The evidence that any majoritary reason $t$ for $_ { \textbf { \em x } }$ given $F$ is an abductive explanation for $_ { \textbf { \em x } }$ given $F$
|
| 238 |
+
211 comes directly from the fact that if $t$ implies a majority of decision trees in $F$ , then it is an implicant
|
| 239 |
+
212 of $F$ (note that the converse implication does not hold in general).
|
| 240 |
+
213 The tractability of generating majoritary reasons lies in the fact that they can be found using a simple
|
| 241 |
+
214 greedy algorithm. For the case where $\dot { \boldsymbol F } ( { \pmb x } ) = 1$ , start with $t = t _ { x }$ , and iterate over the literals $l$ of $t$
|
| 242 |
+
215 by checking whether $t$ deprived of $l$ is an implicant of at least $\lfloor { \frac { m } { 2 } } \rfloor + 1$ decision trees of $F$ . If so,
|
| 243 |
+
216 remove $l$ from $t$ and proceed to the next literal. Once all literals in $t _ { x }$ have been examined, the final
|
| 244 |
+
217 term $t$ is by construction an implicant of a strict majority of decision trees in $F$ , such that removing
|
| 245 |
+
218 any literal from it would lead to a term that is no longer an implicant of this majority. So, $t$ is by
|
| 246 |
+
219 construction a majoritary reason. The case where $F ( { \bar { \mathbf { x } } } ) = 0$ is similar, by simply replacing each
|
| 247 |
+
220 $T _ { i }$ with its negation in $F$ . This greedy algorithm runs in $\mathcal { O } ( n | F | )$ time, using the fact that, on each
|
| 248 |
+
221 iteration, checking whether $t$ is an implicant of $T _ { i }$ (for each $i \in [ m ] ,$ ) can be done in $\mathcal { O } ( \left| T _ { i } \right| )$ time.
|
| 249 |
+
22 By analogy with minimal sufficient reasons, a natural way of improving the quality of majoritary
|
| 250 |
+
23 reasons is to seek for shortest ones. Let $F \in \mathrm { { R F } } _ { n }$ be a random forest and $\bar { \pmb { x } } \in \{ \bar { 0 } , 1 \} ^ { n }$ be an instance.
|
| 251 |
+
224 Then, a minimal majoritary reason for $_ { \textbf { \em x } }$ given $F$ is a minimal-size majoritary reason for $_ { \textbf { \em x } }$ given $F$ .
|
| 252 |
+
|
| 253 |
+
Example 6. For our running example, the three majoritary reasons for $_ { \textbf { \em x } }$ given $F$ are its minimal majoritary reasons. Contrastingly, among the majoritary reasons for $\mathbf { x } ^ { \prime }$ given $F$ , only $\overline { { x } } _ { 1 } \wedge \overline { { x } } _ { 4 }$ , $x _ { 2 } \wedge \overline { { x } } _ { 4 }$ , and $\overline { { x } } _ { 3 } \wedge \overline { { x } } _ { 4 }$ are minimal majoritary reasons.
|
| 254 |
+
|
| 255 |
+
Unsurprisingly, the optimization task for majoritary reasons is more demanding than the generation task. Yet, minimal majoritary reasons are easier to find than minimal sufficient reasons. Specifically:
|
| 256 |
+
|
| 257 |
+
Proposition 7. Let $F \in \mathbb { R F } _ { n }$ , $\pmb { x } \in \{ 0 , 1 \} ^ { n }$ , and $k \in \mathbb N$ . Then, deciding whether there exists $a$ minimal majoritary reason $t$ for $_ { \textbf { \em x } }$ given $F$ containing at most $k$ features is NP-complete.
|
| 258 |
+
|
| 259 |
+
A common approach for handling NP-optimization problems is to rely on modern constraint solvers. From this perspective, recall that a PARTIAL MAXSAT problem consists of a pair $( C _ { \mathrm { s o f t } } , C _ { \mathrm { h a r d } } )$ where $C _ { \mathrm { s o f t } }$ and $C _ { \mathrm { h a r d } }$ are (finite) sets of clauses. The goal is to find a Boolean assignment that maximizes the number of clauses $c$ in $C _ { \mathrm { s o f t } }$ that are satisfied, while satisfying all clauses in $C _ { \mathrm { h a r d } }$ .
|
| 260 |
+
|
| 261 |
+
236 Proposition 8. Let $F ~ \in ~ \mathbb { R } \mathbb { F } _ { n , m }$ and $x \in \{ 0 , 1 \} ^ { n }$ be an instance such that $F ( { \pmb x } ) = 1$ . Let
|
| 262 |
+
237 $( C _ { \mathrm { s o f t } } , C _ { \mathrm { h a r d } } )$ be an instance of the PARTIAL MAXSAT problem such that:
|
| 263 |
+
|
| 264 |
+
$$
|
| 265 |
+
{ \begin{array} { r l } & { C _ { \mathrm { s o f t } } = \{ { \overline { { x } } } _ { i } : x _ { i } \in t _ { \pmb { x } } \} \cup \{ x _ { i } : { \overline { { x } } } _ { i } \in t _ { \pmb { x } } \} } \\ & { C _ { \mathrm { h a r d } } = \{ ( { \overline { { y } } } _ { i } \lor c _ { | \pmb { x } } ) : i \in [ m ] , c \in \operatorname { C N F } ( T _ { i } ) \} \cup \operatorname { C N F } \left( \sum _ { i = 1 } ^ { m } y _ { i } > { \frac { m } { 2 } } \right) } \end{array} }
|
| 266 |
+
$$
|
| 267 |
+
|
| 268 |
+
where $\begin{array} { r } { \mathtt { C N F } ( \sum _ { i = 1 } ^ { m } y _ { i } > \frac { m } { 2 } ) } \end{array}$ $c _ { | x } = c \cap t _ { x }$ is the restriction of c to the literals in is a CNF encoding of the contraint $\textstyle \sum _ { i = 1 } ^ { m } y _ { i } > { \frac { m } { 2 } }$ $t _ { x }$ , $\{ y _ { 1 } , \dots , y _ { m } \}$ . The intersection of are fresh variables and $t _ { x }$ with $t _ { z ^ { * } }$ , where $z ^ { * }$ is an optimal solution of $( C _ { \mathrm { s o f t } } , C _ { \mathrm { h a r d } } )$ , is a minimal majoritary reason for $_ { \textbf { \em x } }$ given $F$
|
| 269 |
+
|
| 270 |
+
241 Clearly, in the case was above, except that 242 $F ( { \pmb x } ) = 0$ MAXSAT. $\begin{array} { r } { C _ { \mathrm { h a r d } } = \{ ( \overline { y } _ { i } \vee c _ { | \pmb { x } } ) : i \in [ m ] , c \in \mathbb { C } \mathtt { N F } ( \neg T _ { i } ) \} \cup \mathbb { C } \mathtt { N F } ( \sum _ { i = 1 } ^ { m } y _ { i } > \frac { m } { 2 } ) } \end{array}$
|
| 271 |
+
|
| 272 |
+
Thanks to this characterization result, one can leverage the numerous algorithms that have been developed so far for PARTIAL MAXSAT (see e.g. [1, 23, 24, 28]) in order to compute minimal majoritary reasons. We took advantage of it to achieve some of the experiments reported in Section 4.
|
| 273 |
+
|
| 274 |
+
# 246 4 Experiments
|
| 275 |
+
|
| 276 |
+
Empirical setting. The empirical protocol was as follows. We have considered 15 datasets, which are standard benchmarks from the well-known repositories Kaggle (www.kaggle.com), OpenML (www.openml.org), and UCI (archive.ics.uci.edu/ml/). These datasets are compas, placement, recidivism, adult, ad_data, mnist38, mnist49, gisette, dexter, dorothea, farm-ads, higgs_boson, christine, gina, and bank. mnist38 and mnist49 are subsets of the mnist dataset, restricted to the instances of 3 and 8 (resp. 4 and 9) digits. Due to space constraints, additional information about the datasets (especially the numbers and types of features, the number of instances), and about the random forests that have been trained (especially, the number of Boolean features used, the number
|
| 277 |
+
|
| 278 |
+
255 of trees, the depth of the trees, the mean accuracy) are reported as a supplementary material. We
|
| 279 |
+
256 used only datasets for binary classification, which is a very common kind of dataset. Categorical
|
| 280 |
+
257 features have been treated as arbitrary numbers (the scale is nominal). As to numeric features, no data
|
| 281 |
+
258 preprocessing has taken place: these features have been binarized on-the-fly by the random forest
|
| 282 |
+
259 learning algorithm that has been used.
|
| 283 |
+
|
| 284 |
+
For every benchmark $b$ , a 10-fold cross validation process has been achieved. Namely, a set of 10 random forest $F _ { b }$ have been computed and evaluated from the labelled instances of $b$ , partitioned into 10 parts. One part was used as the test set and the remaining 9 parts as the training set for generating a random forest. The classification performance for $b$ was measured as the mean accuracy obtained over the 10 random forests generated from $b$ . As to the random forest learner, we have used the implementation provided by the Scikit-Learn [26] library in his version 0.23.2. The maximal depth of any decision tree in a forest has been bounded at 8. All other hyper-parameters of the learning algorithm have been set to their default value except the number of trees. We made some preliminary tests for tuning this parameter in order to ensure that the accuracy is good enough. For each benchmark $b$ , each random forest $F$ , and a subset of 25 instances $_ { \textbf { \em x } }$ picked up at random in the corresponding test set (leading to 250 instances per dataset) we have run the algorithms described in Section 3 for deriving the direct reason for $_ { \textbf { \em x } }$ given $F$ , a sufficient reason for $_ { \textbf { \em x } }$ given $F$ , a majoritary reason $_ { \textbf { \em x } }$ given $F$ , a minimal majoritary reason for $_ { \textbf { \em x } }$ given $F$ , and a minimal sufficient reason for $_ { \textbf { \em x } }$ given $F$ .
|
| 285 |
+
|
| 286 |
+
274 For computing sufficient reasons and minimal majoritary reasons, we took advantage of the Pysat
|
| 287 |
+
275 library [14] (version 0.1.6.dev15) which provides the implementation of the RC2 PARTIAL MAXSAT
|
| 288 |
+
276 solver and an interface to MUSER [4]. When deriving majoritary reasons, we picked up uniformly at
|
| 289 |
+
277 random 50 permutations of the literals describing the instance and tried to eliminate those literals
|
| 290 |
+
278 (within the greedy algorithm) following the ordering corresponding to the permutation. As a majori
|
| 291 |
+
279 tary reason for the instance, we kept a smallest reason among those that have been derived (of course,
|
| 292 |
+
280 the corresponding computation time that has been measured is the cumulated time over the 50 tries).
|
| 293 |
+
281 Sufficient reasons have been computed as MUSes, as explained before.
|
| 294 |
+
282 We also derived a “LIME explanation” for each instance. Such an explanation has been generated
|
| 295 |
+
283 thanks to the following approach. For any $_ { \textbf { \em x } }$ under consideration, one first used LIME [27] to generate
|
| 296 |
+
284 an associated linear model ${ \pmb w } _ { \pmb x }$ where $\pmb { w _ { x } } \in \mathbb { R } ^ { n }$ . This linear model ${ \pmb w } _ { \pmb x }$ classifies any instance $\mathbf { x } ^ { \prime }$ as a
|
| 297 |
+
285 positive instance if and only if ${ \pmb w } _ { \pmb x } \cdot { \pmb x } ^ { \prime } > 0$ . Furthermore, ${ \pmb w } _ { \pmb x }$ classifies the instance to be explained $_ { \textbf { \em x } }$
|
| 298 |
+
286 in the same way as the black box model considered at start (in our case, the random forest $F$ ). We ran
|
| 299 |
+
287 the LIME implementation linked to [27] in its latest version. Interestingly, a minimal sufficient reason
|
| 300 |
+
288 $t$ for $_ { \textbf { \em x } }$ given ${ \pmb w } _ { \pmb x }$ can be generated in polynomial time from ${ \pmb w } _ { \pmb x }$ . We call it a LIME explanation for $_ { \textbf { \em x } }$
|
| 301 |
+
289 The computation of $t$ is as follows. If $_ { \textbf { \em x } }$ is classified positively by ${ \pmb w } _ { \pmb x }$ , in order to derive $t$ , it is enough
|
| 302 |
+
290 to sum in a decreasing way the positive weights $w _ { i }$ occurring in ${ \pmb w } _ { \pmb x }$ until this sum exceeds the sum
|
| 303 |
+
291 of the opposites of all the negative weights occurring in ${ \pmb w } _ { \pmb x }$ . The term $t$ composed of the variables $x _ { i }$
|
| 304 |
+
292 corresponding to the positive weights that have been selected is by construction a minimal sufficient
|
| 305 |
+
293 reason for $_ { \textbf { \em x } }$ given ${ \pmb w } _ { \pmb x }$ since for every $\mathbf { x } ^ { \prime }$ covered by $t$ , the inequation ${ \pmb w } _ { \pmb x } \cdot { \pmb x } ^ { \prime } > 0$ necessarily holds;
|
| 306 |
+
294 indeed, it holds in the worst situation where all the variables associated with a positive weight in ${ \pmb w } _ { \pmb x }$
|
| 307 |
+
295 and not belonging to $t$ are set to 0, whilst all the variables associated with a negative weight in ${ \pmb w } _ { \pmb x }$
|
| 308 |
+
296 are set to 1. Similarly, if $_ { \textbf { \em x } }$ is classified negatively by ${ \pmb w } _ { \pmb x }$ , in order to derive $t$ , it is enough to sum in
|
| 309 |
+
297 an increasing way the negative weights $w _ { i }$ occurring in ${ \pmb w } _ { \pmb x }$ until this sum is lower than or equal to
|
| 310 |
+
298 the opposite of the sum of all the positive weights occurring in ${ \pmb w } _ { \pmb x }$ . This time, the term $t$ composed
|
| 311 |
+
299 of the variables $x _ { i }$ corresponding to the negative weights that have been selected is by construction a
|
| 312 |
+
300 minimal sufficient reason for $_ { \textbf { \em x } }$ given ${ \pmb w } _ { \pmb x }$ .
|
| 313 |
+
|
| 314 |
+
All the experiments have been conducted on a computer equipped with Intel(R) XEON E5-2637 CPU $\textcircled { a } 3 . 5 \mathrm { G H z }$ and 128 Gib of memory. A time-out (TO) of 600s has been considered for each instance and each type of explanation, except LIME explanations.
|
| 315 |
+
|
| 316 |
+
Results. A first conclusion that can be drawn from our experiments is the intractability of computing in practice minimal sufficient reasons (this is not surprising, since this coheres with the complexity result given by Proposition 5). Indeed, we have been able to compute within the time limit of 600s a minimal reason for only 10 instances and a single dataset (compas).
|
| 317 |
+
|
| 318 |
+
308 Due to space limitations, we report hereafter empirical results about two datasets only, namely
|
| 319 |
+
309 placement and gisette (the results obtained on the other datasets are similar and available as a
|
| 320 |
+
310 supplementary material). The placement data set is about the placement of students in a campus. It
|
| 321 |
+
311 consists of 215 labelled instances. Students are described using 13 features, related to their curricula,
|
| 322 |
+
312 the type and work experience and the salary. An instance is labelled as positive when the student
|
| 323 |
+
313 gets a job. The random forest that has been generated consists of 25 trees, and its mean accuracy
|
| 324 |
+
314 is $9 7 . 6 \%$ . gisette is a much larger dataset, based on 5000 features and containing 7000 labelled
|
| 325 |
+
315 instances. Features correspond to pixels. The problem is to separate the highly confusible digits 4
|
| 326 |
+
316 and 9. An instance is labelled as positive whenever the picture represents a 9. The random forest that
|
| 327 |
+
317 has been generated consists of 85 trees, and its mean accuracy is $96 \%$ .
|
| 328 |
+
318 Figure 2 provides the results obtained for placement, using four plots. Each dot represents an instance.
|
| 329 |
+
319 The first plot shows the time needed to compute a reason on the $\mathbf { X }$ -axis, and the size of this reason on
|
| 330 |
+
320 the y-axis. On this plot, no dot corresponds to a minimal sufficient reason because their computation
|
| 331 |
+
321 did not terminate before the time-out. The plot also highlights that all the other reasons have been
|
| 332 |
+
322 computed within the time limit, and in general using a small amount of time. In particular, it shows
|
| 333 |
+
323 that the direct reason can be quite large, that the computation of LIME explanations is usually more
|
| 334 |
+
324 expensive than the ones of the other explanations, and that LIME explanations can be very short (but
|
| 335 |
+
325 one must keep in mind that they are not abductive explanations in general4). A box plot about the
|
| 336 |
+
326 sizes of all the explanations is reported (the LIME ones and the direct reasons are not presented for
|
| 337 |
+
327 the sake of readibility). The figure also provides two scatter plots, aiming to compare the size of
|
| 338 |
+
328 majoritary reasons with the size of sufficient reasons, as well as the size of the minimal majoritary
|
| 339 |
+
329 reasons with the size of sufficient reasons. These plots clearly show the benefits that can be offered
|
| 340 |
+
330 by considering majoritary reasons and minimal majoritary reasons instead of sufficient reasons.
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 2: Empirical results for the placement dataset.
|
| 344 |
+
|
| 345 |
+
Figure 3 synthesizes the results obtained for gisette, using four plots again. Three of them are of the same kind as the plots used for placement. Conclusions similar to those drawn for placement can be derived for gisette, with some exceptions. First of all, this time, no dot corresponds to a minimal majoritary reason because their computation did not terminate before the time-out. Furthermore, LIME explanations are very long here. This can be explained by the fact that the computation achieved by LIME relies on a binary representation of the instance that is quite different (and possibly much larger) than the one considered in the representation of the random forest. Indeed, each decision tree of the forest focuses only on a subset of most important features (in the sense of Gini criterion) found during the learning phase. In our experiments, the size of LIME explanations was typically high for datasets based on many features.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 3: Empirical results for the gisette dataset.
|
| 349 |
+
|
| 350 |
+
341 When minimal majoritary reasons are hard to be computed (as it is the case for gisette), an approach
|
| 351 |
+
342 consists in approximating them. Interestingly, one can take advantage of an incremental PARTIAL
|
| 352 |
+
343 MAXSAT ALGORITHM, like LMHS [28], to do the job. Specifically, the result given in Proposition
|
| 353 |
+
344 8 provides a way to derive abductive explanations for an instance $_ { \textbf { \em x } }$ given a random forest $F$ in an
|
| 354 |
+
345 anytime fashion. Basically, using LMHS, a Boolean assignment $_ { z }$ satisfying all the hard constraints of
|
| 355 |
+
346 $C _ { \mathrm { h a r d } }$ and a given number, say $k$ , of soft constraints from $C _ { \mathrm { s o f t } }$ is looked for $k$ is set to 0 at start).
|
| 356 |
+
347 If such an assignment is found, then one looks for an assignment satisfying $k + 1$ soft constraint,
|
| 357 |
+
348 and so on, until an optimal solution is found or a preset time bound is reached. In many cases, the
|
| 358 |
+
349 most demanding step from a computational standpoint is the one for which $k$ is the optimal value
|
| 359 |
+
350 (but one ignores it) and one looks for an assignment that satisfies $k + 1$ soft constraint (and such an
|
| 360 |
+
351 assignment does not exist). By construction, every $_ z$ that is generated that way is such that $t _ { x } \cap t _ { z }$
|
| 361 |
+
352 is an implicant of $F$ that covers $_ { \textbf { \em x } }$ (and hence, an abductive explanation). The approximation $_ z$ of
|
| 362 |
+
353 a minimal majoritary reason for $_ { \textbf { \em x } }$ given $F$ , which is obtained when the time limit is met, can be
|
| 363 |
+
354 significantly shorter than the sufficient reason for $_ { \textbf { \em x } }$ given $F$ that has been derived. In our experiments,
|
| 364 |
+
355 we used three time limits: 10s, 60s, 600s. As the box plot and the dedicated scatter plot given in
|
| 365 |
+
356 Figure 3 show it, the sizes of the approximations $_ z$ which are derived gently decrease with time.
|
| 366 |
+
357 Interestingly, the size savings that are achieved in comparison to sufficient reasons are significant,
|
| 367 |
+
358 even for the smallest time bound of 10s that has been considered.
|
| 368 |
+
|
| 369 |
+
# 5 Conclusion
|
| 370 |
+
|
| 371 |
+
360 In this paper, we have introduced, analyzed and evaluated some new notions of abductive explanations
|
| 372 |
+
361 suited to random forest classifiers, namely majoritary reasons and minimal majoritary reasons.
|
| 373 |
+
362 Our investigation reveals the existence of a trade-off between runtime complexity and sparsity for
|
| 374 |
+
363 abductive explanations. Unlike sufficient reasons, majoritary reasons and minimal majoritary reasons
|
| 375 |
+
364 may contain irrelevant features. Despite this evidence, majoritary reasons and minimal majoritary
|
| 376 |
+
365 reasons appear as valuable alternative to sufficient reasons. Indeed, majoritary reasons can be
|
| 377 |
+
366 computed in polynomial time while sufficient reasons cannot (unless ${ \mathsf { P } } = { \mathsf { N P } }$ ). In addition, most of
|
| 378 |
+
367 the time in our experiments, majoritary reasons appear as slightly smaller than sufficient reasons.
|
| 379 |
+
368 Minimal majoritary reasons can be looked for when majoritary reasons are too large, but this is at
|
| 380 |
+
369 the cost of an extra computation time that can be important, and even prohibitive in some cases.
|
| 381 |
+
370 However, minimal majoritary reasons can be approximated using an anytime PARTIAL MAXSAT
|
| 382 |
+
371 algorithm. Empirically, approximations can be derived within a small amount of time and their sizes
|
| 383 |
+
372 are significantly smaller than the ones of sufficient reasons.
|
| 384 |
+
|
| 385 |
+
373 References [1] C. Ansótegui, M. L. Bonet, and J. Levy. SAT-based MaxSAT algorithms. Artificial Intelligence, 196:77–105, 2013. [2] G. Audemard, J-M. Lagniez, and L. Simon. Improving glucose for incremental SAT solving with assumptions: Application to MUS extraction. In Proceedings of the 16th International Conference on Theory and Applications of Satisfiability Testing (SAT’13), pages 309–317, 2013. [3] A. T. Azar, H. I. Elshazly, A. E. Hassanien, and A. M. Elkorany. A random forest classifier for lymph diseases. Computer Methods and Programs in Biomedicine, 113(2):465–473, 2014. [4] Anton Belov and João Marques-Silva. Muser2: An efficient MUS extractor. J. Satisf. Boolean Model. Comput., 8(3/4):123–128, 2012. [5] C. Bénard, G. Biau, S. Da Veiga, and E. Scornet. Interpretable random forests via rule extraction. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics, AISTATS’21, pages 937–945, 2021. [6] G. Biau. Analysis of a random forests model. Journal of Machine Learning Research, 13:1063– 1095, 2012. [7] A. Bogomolov, B. Lepri, J. Staiano, N. Oliver, F. Pianesi, and A. Pentland. Once upon a crime: Towards crime prediction from demographics and mobile data. In Proceedings of the 16th International Conference on Multimodal Interaction, ICMI’14, pages 427–434. ACM, 2014. [8] L. Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. [9] X. Chen and H. Ishwaran. Random forests for genomic data analysis. Genomics, 99(6):323–329, 2012. [10] A. Choi, A. Shih, A. Goyanka, and A. Darwiche. On symbolically encoding the behavior of random forests. In Proceedings of the 3rd Workshop on Formal Methods for ML-Enabled Autonomous Systems (FoMLAS), 2020. [11] A. Criminisi and J. Shotton. Decision Forests for Computer Vision and Medical Image Analysis. Advances in Computer Vision and Pattern Recognition. Springer, 2013. [12] R. Cutler, C. E. Jr. Thomas, K. H. Beard, A. Cutler, K. T. Hess, J. Gibson, and J. J. Lawler. Random forests for classification in ecology. Ecology, 88(11):2783–2792, 2007. [13] A. Darwiche and A. Hirth. On the reasons behind decisions. In Proceedings of the 24th European Conference on Artificial Intelligence (ECAI’20), pages 712–720, 2020. [14] A. Ignatiev, A. Morgado, and J. Marques-Silva. PySAT: A python toolkit for prototyping with SAT oracles. In Proceedings of the 21st International Conference on Theory and Applications of Satisfiability Testing (SAT’2018), pages 428–437, 2018. [15] A. Ignatiev, N. Narodytska, and J. Marques-Silva. Abduction-based explanations for machine learning models. In Proceedings of the 23rd AAAI Conference on Artificial Intelligence (AAAI’19), pages 1511–1519, 2019. [16] A. Ignatiev, A. Previti, M. Liffiton, and J. Marques-Silva. Smallest MUS extraction with minimal hitting set dualization. In Proceedings of the 21st International Conference on Principles and Practice of Constraint Programming $( C P ^ { \prime } I 5 )$ , pages 173–182, 2015. [17] Y. Izza, A. Ignatiev, and J. Marques-Silva. On explaining decision trees. CoRR, abs/2010.11034, 2020. [18] Y. Izza and J. Marques-Silva. On explaining random forests with SAT. In Proceedings of the 30th International Joint Conference on Artificial Intelligence (IJCAI’21), page to appear, 2021. [19] M. Liffiton, A. Previti, A. Malik, and J. Marques-Silva. Fast, flexible MUS enumeration. Constraints An Int. J., 21(2):223–250, 2016. [20] J. Marques-Silva, M. Janota, and C. Mencía. Minimal sets on propositional formulae. Problems and reductions. Artificial Intelligence, 252:22–50, 2017. [21] T. Miller. Explanation in artificial intelligence: Insights from the social sciences. Artificial Intelligence, 267:1–38, 2019. [22] Ch. Molnar. Interpretable Machine Learning - A Guide for Making Black Box Models Explainable. Leanpub, 2019.
|
| 386 |
+
|
| 387 |
+
424 [23] A. Morgado, A. Ignatiev, and J. Marques-Silva. MSCG: robust core-guided MaxSAT solving. J.
|
| 388 |
+
425 Satisf. Boolean Model. Comput., 9(1):129–134, 2014.
|
| 389 |
+
426 [24] N. Narodytska and F. Bacchus. Maximum satisfiability using core-guided MaxSAT resolution.
|
| 390 |
+
427 In Proceedings of the 28th AAAI Conference on Artificial Intelligence, pages 2717–2723, 2014.
|
| 391 |
+
428 [25] N. Narodytska, A. Shrotri, K. Meel, A. Ignatiev, and J. Marques-Silva. Assessing heuristic
|
| 392 |
+
429 machine learning explanations with model counting. In Proceedings of 22nd International
|
| 393 |
+
430 Conference on the Theory and Applications of Satisfiability Testing (SAT’19), pages 267–278,
|
| 394 |
+
431 2019.
|
| 395 |
+
432 [26] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel,
|
| 396 |
+
433 P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher,
|
| 397 |
+
434 M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine
|
| 398 |
+
435 Learning Research, 12:2825–2830, 2011.
|
| 399 |
+
436 [27] M. T. Ribeiro, S. Singh, and C. Guestrin. "why should I trust you?": Explaining the predictions
|
| 400 |
+
437 of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on
|
| 401 |
+
438 Knowledge Discovery and Data Mining, pages 1135–1144. ACM, 2016.
|
| 402 |
+
439 [28] P. Saikko, J. Berg, and M. Järvisalo. LMHS: A SAT-IP hybrid MaxSAT solver. In Proceedings of
|
| 403 |
+
440 the 19th International Conference of Theory and Applications of Satisfiability Testing (SAT’16),
|
| 404 |
+
441 pages 539–546, 2016.
|
| 405 |
+
442 [29] A. Shih, A. Choi, and A. Darwiche. A symbolic approach to explaining bayesian network
|
| 406 |
+
443 classifiers. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial
|
| 407 |
+
444 Intelligence (IJCAI’18), pages 5103–5111, 2018.
|
| 408 |
+
|
| 409 |
+
1. For all authors...
|
| 410 |
+
|
| 411 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 412 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 413 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] One cannot expect any negative impact (the paper is about explaining predictions).
|
| 414 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 415 |
+
|
| 416 |
+
2. If you are including theoretical results...
|
| 417 |
+
|
| 418 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] As a supplementary material.
|
| 419 |
+
|
| 420 |
+
3. If you ran experiments...
|
| 421 |
+
|
| 422 |
+
(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]
|
| 423 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 424 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] But the results we obtained have been averaged over a number of trials.
|
| 425 |
+
(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]
|
| 426 |
+
|
| 427 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 428 |
+
|
| 429 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 430 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 431 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] The pieces of software we used are furnished as a supplementary material.
|
| 432 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] This issue is irrelevant for this paper.
|
| 433 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] The datasets we used are anonymized and do not contain personally identifiable information or offensive content.
|
| 434 |
+
|
| 435 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 436 |
+
|
| 437 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [No] We did not use crowdsourcing or conducted research with human subjects.
|
| 438 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [No] We did not use crowdsourcing or conducted research with human subjects.
|
| 439 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [No] We did not use crowdsourcing or conducted research with human subjects.
|
md/train/_WnwtieRHxM/_WnwtieRHxM.md
ADDED
|
@@ -0,0 +1,715 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING THE ROLE OF IMPORTANCE WEIGHT-ING FOR DEEP LEARNING
|
| 2 |
+
|
| 3 |
+
Da Xu
|
| 4 |
+
Walmart Labs
|
| 5 |
+
Sunnyvale, CA 94086, USA DaXu5180@gmail.com
|
| 6 |
+
|
| 7 |
+
Yuting Ye Division of Biostatistics University of California, Berkeley Berkeley, CA 94720, USA yeyt@berkeley.edu
|
| 8 |
+
|
| 9 |
+
Chuanwei Ruan ∗
|
| 10 |
+
Instacart
|
| 11 |
+
San Francisco, CA 94107, USA Ruanchuanwei@gmail.com
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
The recent paper by Byrd & Lipton (2019), based on empirical observations, raises a major concern on the impact of importance weighting for the over-parameterized deep learning models. They observe that as long as the model can separate the training data, the impact of importance weighting diminishes as the training proceeds. Nevertheless, there lacks a rigorous characterization of this phenomenon. In this paper, we provide formal characterizations and theoretical justifications on the role of importance weighting with respect to the implicit bias of gradient descent and margin-based learning theory. We reveal both the optimization dynamics and generalization performance under deep learning models. Our work not only explains the various novel phenomenons observed for importance weighting in deep learning, but also extends to the studies where the weights are being optimized as part of the model, which applies to a number of topics under active research.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Importance weighting is a standard tool for estimating a quantity under a target distribution while only the samples from some source distribution is accessible. It has been drawing extensive attention in the communities of statistics and machine learning. Causal inference for deep learning investigates heavily on the propensity score weighting method that applies the off-policy optimization with counterfactual estimator (Gilotte et al., 2018; Jiang & Li, 2016), modelling with observational feedback (Schnabel et al., 2016; Xu et al., 2020) and learning from controlled intervention (Swaminathan & Joachims, 2015). The importance weighting methods are also applied to characterize distribution shifts for deep learning models (Fang et al., 2020), with modern applications in such as the domain adaptation (Azizzadenesheli et al., 2019; Lipton et al., 2018) and learning from noisy labels (Song et al., 2020). Other usages include curriculum learning (Bengio et al., 2009) and knowledge distillation (Hinton et al., 2015), where the weights characterize the model confidence on each sample.
|
| 20 |
+
|
| 21 |
+
To reduce the discrepancy between the source and target distribution for model training, a standard routine is to minimize a weighted risk (Rubinstein & Kroese, 2016). Many techniques have been developed to this end, and the common strategy is re-weighting the classes proportionally to the inverse of their frequencies (Huang et al., 2016; 2019; Wang et al., 2017). For example, Cui et al.
|
| 22 |
+
|
| 23 |
+
(2019) proposes re-weighting by the inverse of effective number of samples. The focal loss (Lin et al., 2017) down-weights the well-classified examples, and the work by Li et al. (2019) suggests an improved technique which down-weights examples based on the magnitude of the gradients.
|
| 24 |
+
|
| 25 |
+
Despite the empirical successes of various re-weighting methods, it is ultimately not clear how importance weighting lays influence from the theoretical standpoint. The recent study of Byrd & Lipton (2019) observes from experiments that there is little impact of importance weights on the converged deep neural network, if the data can be separated by the model using gradient descent. They connect this phenomenon to the implicit bias of gradient descent (Soudry et al., 2018) - a novel topic that studies why over-parameterized models trained on separable data is biased toward solutions that generalize well. Implicit bias of gradient descent has been observed and studied for linear model (Soudry et al., 2018; Ji & Telgarsky, 2018b), linear neural network (Ji & Telgarsky, 2018a; Gunasekar et al., 2018), two-layer neural network with homogeneous activation (Chizat & Bach, 2020) and smooth neural networks (Nacson et al., 2019; Lyu & Li, 2019). To summarize, those work reveals that the direction of the parameters (for linear predictor) and the normalized margin (for nonlinear predictor), regardless of the initialization, respectively converge to those of a max-margin solution. The pivotal role of margin for deep learning models has been explored actively after the long journey of understanding the generalization of over-parameterized neural networks (Bartlett et al., 2017; Golowich et al., 2018; Neyshabur et al., 2018). For instance, Wei et al. (2019) studies the margin of the neural networks for separable data under weak regularization. They show that the normalized margin also converges to the max-margin solution, and provide a generalization bound for a neural network that hinges on its margin.
|
| 26 |
+
|
| 27 |
+
Although there are rich understandings for the implicit bias of gradient descent and the margin-based generalization, very few efforts are dedicated to studying how they adjust to the weighted empiricalrisk minimization (ERM) setting. The established results do not directly transfer since importance weighting can change both the optimization geometry and how the generalization is measured. In this paper, we fill in the gap by showing the impact of importance weighting on the implicit bias of gradient descent as well as the generalization performance. By studying the optimization dynamics of linear models, we first reveal the effect of importance weighting on the convergence speed under linearly separable data. When the data is not linearly separable, we characterize the unique role of importance weighting on defining the intercept term upon the implicit bias. We then investigate the non-linear neural network under a weak regularization as Wei et al. (2019). We provide a novel generalization bound that reflects how importance weighting leads to the interplay between the empirical risk and a compounding term that consists of the model complexity as well as the deviation between the source target distribution. Based on our theoretical results, we discuss several exploratory developments on importance weighting that are worthy of further investigations.
|
| 28 |
+
|
| 29 |
+
• A good set of weights for learning can be inversely proportional to the hard-to-classify extent. For example, a sample that is close to (far from) the oracle decision boundary should have a large (small) weight.
|
| 30 |
+
• If the importance weights are jointly trained according to a weighting model, the impact of the weighting model eventually diminishes after showing strong correlation with the hard-to-classify extent such as margin.
|
| 31 |
+
• The usefulness of explicit regularization on weighted ERM can be studied, via their impact on the margin, on balancing the empirical loss and the distribution divergence.
|
| 32 |
+
|
| 33 |
+
In summary, our contribution are three folds.
|
| 34 |
+
|
| 35 |
+
• We characterize the impact of importance weighting on the implicit bias of gradient descent. • We find a generalization bound that hinges on the importance weights. For finite-step training, the role of importance weighting on the generalization bound is reflected in how the margin is affected, and how it balances the source and target distribution. • We propose several exploratory topics for importance weighting that worth further investigating from both the application and theoretical perspective.
|
| 36 |
+
|
| 37 |
+
The rest of the paper is organized as follows. In Section 2, we introduce the background, preliminary results and the experimental setup. In Section 3 and 4, we demonstrate the influence of the importance weighting for linear and non-linear models in terms of the implicit bias of gradient descent and the generalization performance. We then discuss the extended investigations in Section 5.
|
| 38 |
+
|
| 39 |
+
# 2 PRELIMINARIES
|
| 40 |
+
|
| 41 |
+
We use bold-font letters for vectors and matrices, uppercase letters for random variables and distributions, and $\| \cdot \|$ to denote $\ell _ { 2 }$ norm when no confusion arises. We denote the training data by $\mathbf { \mathcal { D } } = \{ w _ { i } , \mathbf { x } _ { i } , y _ { i } \} _ { i = 1 } ^ { n }$ where $\mathbf { x } _ { i } \in \mathcal { X }$ denotes the features, $y _ { i }$ is binary or categorical, and the importance weight is bounded such that: $w _ { i } \in [ 1 / M , M ]$ for some $M > 1$ . We mention that the importance weights are often defined with respect to the source distribution $P _ { s }$ from which the training data is drawn, and the target distribution $P _ { t }$ . We do not make this assumption here because importance weighting is often applied for more general purposes. Therefore, $w _ { i }$ can be defined arbitrarily.
|
| 42 |
+
|
| 43 |
+
We use $f ( { \pmb \theta } , { \bf x } )$ to denote the predictor and define $\mathcal { F } = \{ f ( \pmb \theta , \cdot ) | \theta \in \Theta \subset \mathbb { R } ^ { d } \}$ . For the sake of notation, we focus on the binary setting: $y _ { i } \in \{ - 1 , + 1 \}$ with $f ( { \pmb \theta } , { \mathbf x } ) \in \mathbb { R }$ . However, it will become clear later that our results can be easily extended to the multi-class setting. Consider the weighted empirical risk minimization (ERM) task with the risk given by $\begin{array} { r } { L ( \pmb { \theta } ; \mathbf { w } ) = 1 \bar { / } n \sum _ { i = 1 } ^ { n } w _ { i } \ell \big ( y _ { i } f ( \pmb { \theta } , \mathbf { \bar { x } } _ { i } ) \big ) } \end{array}$ for some non-negative loss function $\ell ( \cdot )$ . The weight-agnostic counterpart is denoted by: $L ( \pmb \theta ) =$ $\begin{array} { r } { 1 / n \sum _ { i = 1 } ^ { n } \ell \big ( y _ { i } f ( \pmb { \theta } , \mathbf { x } _ { i } ) \big ) . } \end{array}$ . We focus particularly on the exponential loss $\bar { \ell ( u ) } = \exp ( - u )$ and log loss $\ell ( u ) = \log ( 1 + \exp ( - u ) )$ . For the multi-class problem where $y _ { i } \in [ k ]$ , we extend our setup using the softmax function where the logits are now given by $\{ f _ { j } ( \pmb { \theta } , \mathbf { x } ) \} _ { j = 1 } ^ { k }$ . For optimization, we consider using gradient descent to minimize the total loss: $\pmb { \theta } ^ { ( t + 1 ) } ( \mathbf { w } ) = \mathcal { \bar { \pmb { \theta } } } ^ { ( t ) } ( \mathbf { w } ) - \eta _ { t } \nabla L ( \pmb { \theta } ; \mathbf { w } ) \big | _ { \pmb { \theta } = \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) } .$ where the learning rate $\eta _ { t }$ can be constant or step-dependent.
|
| 44 |
+
|
| 45 |
+
# From parameter norm divergence to support vectors.
|
| 46 |
+
|
| 47 |
+
Suppose $\mathcal { D }$ is separated by $f ( { \pmb \theta } ^ { ( t ) } , { \bf x } )$ after some point during training. The key factor that contributes to the implicit bias for both linear and non-linear predictor under a weak regularization 1 is that the norm of the parameters diverges after separation, i.e. $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \| \pmb { \theta } ^ { ( t ) } \| _ { 2 } = \infty } \end{array}$ , as a consequence of using gradient descent. Now we examine $\big \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 }$ . The heuristic is that if $\ell ( \cdot )$ is exponential-like, multiplying by $w _ { i }$ only changes its tail property up to a constant while the asymptotic behavior is not affected. In particular, the necessary conditions for norm divergence under gradient descent can be summarized by:
|
| 48 |
+
|
| 49 |
+
• C1. The loss function $\ell ( \cdot )$ has a exponential tail behavior (that we formalize in Appendix A.1) such that $\begin{array} { r } { \operatorname* { l i m } _ { u \infty } \ell ( - u ) = \operatorname* { l i m } _ { u \infty } \nabla \ell ( - u ) = 0 } \end{array}$ ; • C2. The predictor $f ( { \pmb \theta } , { \bf x } )$ is $\alpha$ -homogeneous such that $f ( c \cdot \theta , { \bf x } ) = c ^ { \alpha } f ( \theta , { \bf x } ) , \forall c > 0 .$
|
| 50 |
+
|
| 51 |
+
In addition, we need certain regularities from $f ( { \pmb \theta } , { \bf x } )$ to ensure the existence of critical points and the convergence of gradient descent:
|
| 52 |
+
|
| 53 |
+
• C3. for any $\mathbf { x } \in \mathcal { X }$ , $f ( \cdot , \mathbf { x } )$ is $\beta$ -smooth and $l$ -Lipschitz on $\mathbb { R } ^ { d }$
|
| 54 |
+
|
| 55 |
+
C1 can be satisfied by the exponential loss, log loss and cross entropy loss under the multi-class setting. For standard deep learning models such as multilayer perceptron (MLP), C2 implies that the activation functions are homogeneous such as ReLU and LeakyReLU, and bias terms are disallowed. C3 is a common technical assumptions whose practical implications are discussed in Appendix A.1. Among the three necessary conditions, importance weighting only affects C1 up to a constant, so its impact on the norm divergence diminishes in the asymptotic regime. The formal statement is provided as below.
|
| 56 |
+
|
| 57 |
+
Claim 1. There exists a constant learning rate for gradient descent, such that for any w $\in$ $[ 1 / M , M ] ^ { n }$ , with a weak regularization, $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \| \dot { \pmb { \theta } } ^ { ( t ) } ( \mathbf { \check { w } } ) \| = \infty } \end{array}$ under C1-C3.
|
| 58 |
+
|
| 59 |
+
Compared with the previous work, we extend the norm divergence result not only to weighted ERM but a more general setting where a weak regularization is considered. We defer the proof to Appendix A.1. A direct consequence of parameter norm divergence is that both the risk and the gradient are dominated by the terms with the smallest margin, i.e. $\mathrm { a r g m i n } _ { i } y _ { i } f ( \pmb \theta , \mathbf x _ { i } )$ , which are also referred to as the "support vectors". To make sense of this point, notice that both the risk and the gradient have the form of: $\begin{array} { r } { \sum _ { i } C _ { i } \exp \big ( - y _ { i } f ( \pmb { \theta } , \mathbf { x } _ { i } ) \big ) } \end{array}$ , where $C _ { i }$ are low-order terms. Since $f ( \pmb \theta , \mathbf x _ { i } ) = \| \pmb \theta \| _ { 2 } ^ { \alpha } f \big ( \pmb \theta / \| \pmb \theta \| _ { 2 } , \mathbf x _ { i } \big )$ due to the homogeneous assumption in C2, it holds that:
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 1: (a). Linearly separable data; (b). Non-separable data; (c): Balanced moon-shaped nonlinear separable data; (d). Unbalance moon-shaped data after down-sampling both classes $20 \%$ for the blue class, and $80 \%$ for the orange class). We use solid line to denote the separating hyperplane of the trained linear model and shades to represent the decision boundary of trained nonlinear model.
|
| 63 |
+
|
| 64 |
+
$\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \exp \big ( - y _ { i } f ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) , \mathbf { x } _ { i } ) \big ) \ \ 0 } \end{array}$ . Therefore, the decision boundaries may share certain characteristics with the support vector machine (SVM) since they rely on the same support vectors. As a matter of fact, the current understandings on the implicit bias of gradient descent are mostly established on the connection with hard-margin SVM:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\operatorname* { m i n } _ { \pmb { \theta } \in \mathbb { R } ^ { d } } \| \pmb { \theta } \| _ { 2 } \quad \mathrm { s . t . } \quad y _ { i } f ( \pmb { \theta } , \mathbf { x } _ { i } ) \geq 1 \quad \forall i = 1 , 2 , \ldots , n ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
whose optimization path coincides with the max-margin problem: $\begin{array} { r } { \operatorname* { m a x } _ { \| \pmb { \theta } \| _ { 2 } \leq 1 } \operatorname* { m i n } _ { i = 1 , \dots , n } y _ { i } f ( \pmb { \theta } , \mathbf { x } _ { i } ) } \end{array}$ as shown by Nacson et al. (2019). Define $\gamma ( \pmb \theta ) : = \operatorname* { m i n } _ { i } y _ { i } f ( \pmb \theta , \mathbf x _ { i } )$ . We use $\pmb { \theta } ^ { * }$ to denote the optimal solution and $\begin{array} { r } { \gamma ^ { * } = \gamma ( \pmb { \theta } ^ { * } ) : = \operatorname* { m i n } _ { i } y _ { i } f ( \pmb { \theta } ^ { * } , \mathbf { x } _ { i } ) } \end{array}$ to denote the corresponding margin.
|
| 71 |
+
|
| 72 |
+
# Implicit bias of gradient descent.
|
| 73 |
+
|
| 74 |
+
We start by considering the weight-agnostic setting. When $\mathcal { D }$ is linear separable, it is reasonable to conjecture that the separating hyperplane under a linear $f ( \pmb \theta , \cdot )$ overlaps with the solution of hard-margin SVM. Soudry et al. (2018) and Ji & Telgarsky (2018b) first show that $\| \pmb \theta ^ { ( t ) } \|$ converges in direction to $\pmb { \theta } ^ { * }$ , i.e. $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \pmb { \theta } ^ { ( t ) } / \| \pmb { \theta } ^ { ( t ) } \| _ { 2 } = \pmb { \theta } ^ { * } } \end{array}$ . For nonlinear predictors, however, the parameter direction is less meaningful. Instead, it has been pointed out that neural networks often achieve perfect separation of the training data (Zhang et al., 2016). Therefore, we are more interested in the margin whose pivoting role for the generalization of neural networks is studied extensively (Neyshabur et al., 2017; Bartlett et al., 2017; Golowich et al., 2018). Specifically, it has been show in Nacson et al. (2019) and Lyu & Li (2019) that the normalized margin, defined by $\tilde { \gamma } ( \pmb { \theta } ^ { ( t ) } ) : = \gamma \big ( \pmb { \theta } ^ { ( t ) } / \lVert \pmb { \theta } ^ { ( t ) } \rVert _ { 2 } \big )$ , converges to the maximum margin $\gamma ^ { * }$ without regularization.
|
| 75 |
+
|
| 76 |
+
It becomes clear at this point that to understand the role of importance weighting for deep learning, we must characterize the impact of weights on the implicit bias since they reveal the optimization geometry and generalization performance. Formally, we address the following critical questions.
|
| 77 |
+
|
| 78 |
+
• Q1. Does importance weighting modify the convergence results (convergence in direction for linear predictor and in normalized margin for nonlinear predictor)?
|
| 79 |
+
• If the convergence results remain unchanged, then: – Q2. in what way is importance weighting affecting the optimization process; – Q3. how does importance weighting influence the generalization from the source distribution to the target distribution?
|
| 80 |
+
|
| 81 |
+
# Experiment setup.
|
| 82 |
+
|
| 83 |
+
Throughout this paper, we use the regular regression model as linear predictor. The nonlinear predictor is a two-layer MLP with five hidden units and ReLU as the activation function. All the models are trained with gradient descent using 0.1 as learning rate. We use the exponential loss and the standard normal initialization. The generated datasets for our illustrative experiments are shown in Figure 1, which correspond to the different settings of our major topics.
|
| 84 |
+
|
| 85 |
+
We begin with the linear predictors which allows more refined analysis on the gradient dynamics. Without loss of generality, we assume using the exponential loss. Also, we do not consider the weak regularization here since its practical impact on linear model is trivial when $\lambda 0$ (Rosset et al., $2 0 0 4 \mathrm { a } ; \mathrm { b } )$ , but it is not the case for nonlinear predictors. One sophistication with linear predictor is that the data may not be perfectly separated, as opposed to the nonlinear case where neural networks can in theory separate any non-degenerate data. With this kept in mind, we first assume $\mathcal { D }$ is linear separable and characterize the new convergence result in the following proposition.
|
| 86 |
+
|
| 87 |
+
Proposition 1. With a constant learning rate $\eta _ { t } ~ \lesssim ~ \beta ^ { - 1 }$ , we consider normalizing the weights $\mathbf { w } \in [ \frac { 1 } { M } , M ] ^ { n }$ such that $\begin{array} { r } { \sum _ { i } \mathbf { w } _ { i } = 1 } \end{array}$ without loss of generality, it holds that:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\Big | \frac { \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) } { \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } - \pmb { \theta } ^ { * } \Big | \lesssim \frac { \log n + D _ { K L } ( \pmb { p } ^ { * } \| \mathbf { w } ) + M } { \log t \cdot \gamma ^ { * } } ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\pmb { p } ^ { * } = [ p _ { 1 } ^ { * } , \ldots , p _ { n } ^ { * } ]$ characterizes the dual optimal for the hard-margin SVM such that $\pmb { \theta } ^ { * } =$ $\textstyle \sum _ { i = 1 } ^ { n } y _ { i } \mathbf { x } _ { i } \cdot p _ { i } ^ { * }$ and satisfies: $p _ { i } ^ { * } \geq 0$ and $\textstyle \sum _ { i = 1 } ^ { n } p _ { i } ^ { * } = 1$ . Here, $D _ { K L }$ is the Kullback-Leibler divergence.
|
| 94 |
+
|
| 95 |
+
We leave the proof to Appendix A.2. We find that importance weighting does not change the convergence result as well as the $1 / \log t$ convergence rate. However, it does affect the convergence speed under the finite-step optimization. In particular, we show that the extra constant term induced by importance weighting is given by the KL-divergence between the (normalized) weights and the dual optimal of the hard-margin SVM, where samples with smaller margins usually have larger values. Therefore, importance weighting may accelerate gradient descent in finite-step optimization by matching weights with the inverse margin. As we show in Figure 2a and 2b, this type of "inversemargin weighted" design is able to accelerate the convergence and bring better performance under finite-step optimization.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 2: (a): Epoch-wise training performances measured by the angle between the decision boundary (at that epoch) and the max-margin solution, using linear predictor on the linear separable data of Figure 1a; (b): Epoch-wise training performances measured by the average margin in the same setting as (a); (c). The generalization error on testing data (the remaining $80 \%$ of the orange class and $20 \%$ of the blue class that are not part of the down-sampling in Figure 1d) when the nonlinear model is trained under different class weights, as the training progresses; (d). The average margin for the nonlinear model on the non-linearly separable training data shown in Figure 1c, under different class weights, as the training progresses.
|
| 99 |
+
|
| 100 |
+
When $\mathcal { D }$ is not linearly separable, the key insight is that we can always partition $\mathcal { D }$ into $\mathcal { D } _ { \mathrm { s e p } } \cup \mathcal { D } _ { \mathrm { n o n - s e p } }$ , where $\mathcal { D } _ { \mathrm { s e p } }$ is the maximal linear separable subset defined in Ji & Telgarsky (2018b). Let $\Pi _ { \mathrm { n o n - s e p } }$ be the (orthogonal) projection onto the subspace $S$ spanned by the $\mathbf { x } _ { i }$ ’s in $\mathcal { D } _ { \mathrm { n o n - s e p } }$ , and let $\Pi _ { \mathrm { s e p } }$ be the projection onto the orthogonal complement $S ^ { \perp }$ . The partition allows us to study the two projected parts independently since by the construction, we have $\begin{array} { r } { \mathbf { \tilde { \theta } } ^ { ( t ) } ( \mathbf { w } ) = \Pi _ { \mathrm { n o n - s e p } } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) + \Pi _ { \mathrm { s e p } } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) } \end{array}$ . It is intuitive that the optimization path of $\Pi _ { \mathrm { s e p } } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } )$ behaves similarly to the linear separable case as in Proposition 1, so we can focus on the properties of $\Pi _ { \mathrm { n o n - s e p } } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } )$ , which we summarize in the follow proposition.
|
| 101 |
+
|
| 102 |
+
Proposition 2 (Informal). Let ${ \cal L } _ { n o n - s e p } ( \pmb \theta , \mathbf w )$ be the weighted risk defined on the non-separable subset, then with the constant learning rate:
|
| 103 |
+
|
| 104 |
+
• $\begin{array} { r } { \tilde { \pmb \theta } ( \mathbf w ) = \arg \operatorname* { m i n } _ { \pmb \theta } L _ { n o n - s e p } ( \pmb \theta , \mathbf w ) } \end{array}$ is uniquely defined and $\left\| \tilde { \pmb { \theta } } ( \mathbf { w } ) \right\| _ { 2 } = \mathcal { O } ( 1 )$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { r } { \bullet \left| \Pi _ { n o n - s e p } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) - \widetilde { \pmb { \theta } } ( \mathbf { w } ) \right| \lesssim \frac { C \left( \left\| \widetilde { \pmb { \theta } } ( \mathbf { w } ) \right\| _ { 2 } \right) + \log ^ { 2 } t / \gamma _ { s e p } } { t } } \\ { o n \mathcal { D } _ { s e p } a n d C \left( \left\| \widetilde { \pmb { \theta } } ( \mathbf { w } ) \right) \right\| _ { 2 } ) = \mathcal { O } ( 1 ) . \qquad } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
The formal statement, which involves how $\mathcal { D } _ { \mathrm { s e p } }$ is defined, is deferred to Appendix A.2 together with the proof. Proposition 2 informs that importance weighting uniquely defines the solution $\tilde { \pmb { \theta } } ( \mathbf { w } )$ on the non-separable subset of the data, to which $\Pi _ { \mathrm { n o n - s e p } } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } )$ converges. Hence, we expect $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) = \tilde { \pmb { \theta } } ( \mathbf { w } ) + \pmb { \theta } _ { \mathrm { s e p } } ^ { * } } \end{array}$ , where $\theta _ { \mathrm { s e p } } ^ { * }$ is the solution on the separable subset $\mathcal { D } _ { \mathrm { s e p } }$ and thus its direction does not depend on w as implied by Proposition 1. We can therefore think of $\tilde { \pmb { \theta } } ( \mathbf { w } )$ as the intercept term where the weight controls how the intercept shifts on the subspace of the non-separable data. We also illustrate this finding in Figure 3. By far, we provide an in-depth understanding and our theoretical results fully explain the observations made in Byrd & Lipton (2019) on how importance weighting affects the implicit bias of gradient descent using linear predictors.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 3: The role of importance weighting on defining the intercept term in addition to the implicit bias for the linearly separable case, where the hyperplane shifts in the non-separable subspace depending on the class weights.
|
| 114 |
+
|
| 115 |
+
# 4 IMPORTANCE WEIGHTING FOR NONLINEAR PREDICTOR
|
| 116 |
+
|
| 117 |
+
Now we investigate the influence of importance weighting on non-linear predictors, e.g, the neural network. Here we are more interested in the regularized setting:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\operatorname* { m i n } _ { \pmb { \theta } } L _ { \lambda } ( \pmb { \theta } ; \mathbf { w } ) : = L ( \pmb { \theta } , \mathbf { w } ) + \lambda \| \pmb { \theta } \| ^ { r } ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $r \ > \ 0$ is fixed, $\lambda$ is the regularization coefficient. We use the notation: $\theta _ { \lambda } ( \mathbf { w } ) \ \in$ arg min $L _ { \lambda } ( \pmb { \theta } , \mathbf { w } )$ . Recall that $\begin{array} { r } { \gamma ^ { * } : = \operatorname* { m a x } _ { \| \pmb { \theta } \| \leq 1 } \operatorname* { m i n } _ { i } y _ { i } f ( \pmb { \theta } , \mathbf { x } _ { i } ) } \end{array}$ . Unlike the linear case, characterizing the gradient dynamics for nonlinear predictor is often insurmountable. Therefore, we mainly consider the asymptotic regime or the regime with sufficiently large $t$ . We omit the superscript in ${ \pmb \theta } ^ { ( i ) }$ when there is no confusion. The only assumption we need to make is that:
|
| 124 |
+
|
| 125 |
+
A1. the data is separated by $f$ at some point during gradient descent, i.e. $\exists t \ > \ 0$ s.t. $y _ { i } f ( \pmb \theta ^ { ( t ) } , \mathbf x _ { i } ) > 0 , \forall i = 1 , \ldots , n$ . In addition, $y _ { i } f ( \pmb { \theta } ^ { * } , \mathbf x _ { i } ) \geq \gamma ^ { * } > 0$ for each $i$ .
|
| 126 |
+
|
| 127 |
+
In Section 4.1, we show that by solving the equation 3 with an infinitesimal (weak) regularizer, gradient descent leads to the optimal margin $\gamma ^ { * }$ , regardless of the choice of the importance weights. In Section 4.2, we show that the the importance weighting affects the generalization bound via a multiplication factor as well as the margin in the finite-sample scenario.
|
| 128 |
+
|
| 129 |
+
# 4.1 MARGIN IS INVARIANT TO IMPORTANCE WEIGHTING UNDER WEAK REGULARIZATION
|
| 130 |
+
|
| 131 |
+
We show that for any bounded w, $\widetilde \gamma ( \pmb \theta _ { \lambda } ( \mathbf { w } ) ) : = \gamma ( \pmb \theta _ { \lambda } ( \mathbf { w } ) / \lVert \pmb \theta _ { \lambda } ( \mathbf { w } ) \rVert )$ converges to $\gamma ^ { * }$ as $\lambda$ decreases to zero. In practice, however, we might not obtain $\pmb { \theta } _ { \lambda } ( \mathbf { w } )$ in limited time. It is shown that as long as equation 3 is close enough to its optimum, the normalized margin of the associated $\pmb { \theta } ^ { \prime } ( \mathbf { w } )$ (under finite-step optimization) is lower bounded by $\gamma ^ { * }$ multiplied by a non-trivial factor. Formally,
|
| 132 |
+
|
| 133 |
+
Proposition 3. Suppose C1-C3, A1 hold. For any $\pmb { w } \in [ 1 / M , M ] ^ { n }$ , it follows that • (Finite steps) There exists a $\begin{array} { r c l } { \lambda } & { : = } & { \lambda ( r , \alpha , \gamma ^ { * } , \mathbf { w } , c ) } \end{array}$ such that for $\pmb { \theta } ^ { \prime } ( \mathbf { w } )$ with $L _ { \lambda } ( \pmb \theta ^ { \prime } ( \mathbf { w } ) ; \mathbf { w } ) \leq \tau L _ { \lambda } ( \pmb \theta _ { \lambda } ( \mathbf { w } ) ; \mathbf { w } )$ and $\tau \leq 2$ , the associated normalized margin $\tilde { \gamma } ( \pmb { \theta } ^ { \prime } ( \mathbf { w } ) )$ satisfies $\begin{array} { r } { \tilde { \gamma } ( \pmb { \theta } ^ { \prime } ( \mathbf { w } ) ) \geq c \cdot \frac { \gamma ^ { * } } { \tau ^ { \alpha / r } } } \end{array}$ , where $\textstyle { \frac { 1 } { 1 0 } } \leq c < 1$ .
|
| 134 |
+
|
| 135 |
+
This result is adapted from Wei et al. (2019), which relies on Claim 1. The proof is relegated to Appendix A.4.1. We see that importance weighting does not affect the asymptotic margin when $\lambda$ is sufficiently small. To get the intuition, note that when $\left| \left| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \right| \right|$ is large enough and $\lambda$ is small enough to be ignored, $L _ { \lambda } ( \pmb \theta _ { \lambda } ( \mathbf { w } ) , \mathbf { w } ) \approx \exp \big ( - \| \pmb \theta _ { \lambda } ( \mathbf { w } ) \| ^ { \alpha } \gamma _ { \lambda } \big )$ , which favors a large margin. In addition, even if $L _ { \lambda } ( \pmb { \theta } ^ { \prime } ( \mathbf { w } ) , \mathbf { w } )$ has not yet converged but close enough to its optimum, the corresponding normalized margin has a reasonable lower bound. We point out that this result does not rely on the choice of $\lambda$ . The assumption $L _ { \lambda } ( \pmb \theta ^ { \prime } ( \mathbf { w } ) ; \mathbf { w } ) \leq \tau L _ { \lambda } \big ( \pmb \theta _ { \lambda } ( \mathbf { w } ) ; \mathbf { w } \big )$ has already accounted for the major influence of importance weighting in terms of the optimization. That is, with a "good" set of importance weights, we can achieve this criteria (by approaching global optimum) faster. We leave detailed discussions to Section 5. Figure 2d also demonstrates that the choice of the importance weights has a significant influence on the convergence speed for the non-linear predictor.
|
| 136 |
+
|
| 137 |
+
# 4.2 IMPORTANCE WEIGHTING AFFECTS THE GENERALIZATION BOUND
|
| 138 |
+
|
| 139 |
+
Proposition 3 conjectures on the behavior of the margin corresponding to the optimum of $L _ { \lambda } ( \pmb { \theta } ; \mathbf { w } )$ , which does not rely on the sample size. To bridge the connection between importance weighting and the behavior of $f ( \pmb \theta , \cdot )$ in the finite-sample setting, we investigate the generalization bound of $f$ when the training sample distribution deviates from the testing sample distribution.
|
| 140 |
+
|
| 141 |
+
Let $P _ { s }$ be the source distribution and $P _ { t }$ be the target distribution with the corresponding densities $p _ { s } ( \cdot )$ and $p _ { t } ( \cdot )$ . Assume that $P _ { s }$ and $P _ { t }$ have the same support. We consider the Pearson $\chi ^ { 2 }$ -divergence to measure the difference between $P _ { s }$ and $P _ { t }$ , i.e., $\begin{array} { r } { D _ { \chi ^ { 2 } } ( P _ { t } \| P _ { t } ) = \int \big [ ( d P _ { s } / d P _ { t } ) ^ { 2 } - 1 \big ] d P _ { s } } \end{array}$ . The training covariates $\mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n }$ are generated from $P _ { s }$ , and the testing covariates are generated from $P _ { t }$ . Denote by $p _ { \mathrm { t r a i n } }$ and $p _ { \mathrm { t e s t } }$ the joint distribution of $\left( \mathbf { x } , y \right)$ for the training data and the testing data, respectively.
|
| 142 |
+
|
| 143 |
+
We minimize equation 3 over the $H$ -layer feedforward neural network given by $f ^ { \mathrm { N N } } ( \pmb { \theta } , \mathbf { x } ) : =$ $W _ { H } \sigma ( W _ { H - 1 } \sigma ( \bar { \dots } \cdot \cdot \sigma ( W _ { 1 } \mathbf { x } ) \cdot \cdot \cdot ) )$ , where $\pmb \theta = [ W _ { 1 } , \cdots , W _ { H } ]$ are the parameter matrices and $\sigma ( \cdot )$ is the element-wise activation function such as ReLU. Denote by $\eta ( \mathbf { x } ) = p _ { t } ( \mathbf { x } ) / p _ { s } ( \mathbf { x } )$ . We show that the generalization performance is affected by importance weighting via the interplay between the empirical risk that hinges on $\eta$ , as well as a term that depends on the model complexity and the deviation of the target distribution from the source distribution.
|
| 144 |
+
|
| 145 |
+
Theorem 1 (1). Assume $\sigma$ is 1-Lipschitz and 1-positive homogeneous. Then with probability at least $1 - \delta$ , we have
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\begin{array} { r l } & { \displaystyle _ { ( \mathbf { x } , y ) \sim p _ { \mathrm { r e r } } } ^ { \mathfrak { L } } \Big ( y f ^ { N N } ( \pmb { \theta } ( \mathbf { w } ) , \mathbf { x } ) \leq 0 \Big ) \leq } \\ & { \quad \underbrace { \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) \mathbf { I } \Big ( y _ { i } f ^ { N N } ( \pmb { \theta } ( \mathbf { w } ) / \| \pmb { \theta } ( \mathbf { w } ) \| , \mathbf { x } _ { i } ) < \gamma \Big ) } _ { ( I ) } + \underbrace { C \cdot \sqrt { D _ { X ^ { 2 } } ( P _ { t } | | P _ { s } ) + 1 } } _ { ( I I ) } + \epsilon ( \gamma , n , \delta ) , } \end{array}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where $( I )$ is the empirical risk, $( I I )$ reflects the compounding effect of the model complexity of the class of $H$ -layer neural networks and the deviation between target distribution and source distribution , $\begin{array} { r } { \epsilon ( \gamma , n , \delta ) = \sqrt { \frac { \log \log _ { 2 } \frac { 4 C } { \gamma } } { n } } + \sqrt { \frac { \log ( 1 / \delta ) } { n } } } \end{array}$ is a small quantity compared to $( I )$ and $( I I )$ . Here, $C : = \operatorname* { s u p } _ { \mathbf { x } } \| \mathbf { x } \|$ and $\gamma$ can take any positive value.
|
| 152 |
+
|
| 153 |
+
The proof is deferred to Appendix A.4.2. Compared to Wei et al. (2019), the empirical risk (I) hinges on $\eta$ and there is an additional multiplier factor $\sqrt { D _ { \chi ^ { 2 } } ( P _ { t } | | P _ { s } ) + 1 }$ on (II). In the two discussions below, we argue that the role of importance weighting on the generalization bound in Theorem 1 is not only reflected in how the margin is affected, but also how it balances source and target distribution:
|
| 154 |
+
|
| 155 |
+
1. Suppose $\pmb \theta ( \mathbf w )$ enables $f ^ { \mathrm { N N } }$ to separate the data. Let $\begin{array} { r } { \gamma _ { \pmb { \theta } ( \mathbf { w } ) } : = \operatorname* { m i n } _ { i } y _ { i } f ^ { \mathrm { N N } } \big ( \pmb { \theta } ( \mathbf { w } ) / \| \pmb { \theta } ( \mathbf { w } ) \| , \mathbf { x } _ { i } \big ) } \end{array}$ . In the generalization bound of Theorem 1, if we let $\gamma = \gamma _ { \pmb \theta ( \mathbf { w } ) }$ , then (I) vanishes and only (II) remains. In this case, the importance weights affects the generalization bound via $\gamma _ { \pmb \theta ( \mathbf w ) }$ in finite steps as discussed in Section 4.1. That is, within finite training steps, a good set of weights w can approach closer to $\gamma _ { \pmb \theta ( \mathbf w ) }$ than a bad set, and thus giving a better generalization performance. Also note that Theorem 1 holds for the non-separable cases as well.
|
| 156 |
+
|
| 157 |
+
2. We point out that (II) is a strictly decreasing function, while (I) is a non-decreasing step function with respect to $\gamma$ . Therefore, there must exists a trade-off $\gamma$ that minimizes the sum of (I) and (II), which is usually attained at some $\gamma > \gamma _ { \pmb \theta ( \mathbf { w } ) }$ . When $\gamma$ grows, certain samples will activate $\mathbf { I } ( y _ { i } f ^ { \mathrm { N N } } ( \pmb \theta ( \mathbf { w } ) / \lVert \pmb \theta ( \mathbf { w } ) \rVert , \mathbf { x } _ { i } ) < \gamma )$ and inflate (I). The hope is that an initially activated sample (indicator term) in (I) corresponds to a small $\eta ( \mathbf { x } _ { i } )$ , while one with a large $\eta ( \mathbf { x } _ { i ^ { \prime } } )$ has a large value of $y _ { i ^ { \prime } } f ^ { \mathrm { N N } } ( \pmb { \theta } ( \mathbf { w } ) / \| \pmb { \theta } ( \mathbf { w } ) \| , \mathbf { x } _ { i ^ { \prime } } )$ and thus will be activated later. This can be achieved by aligning w with $\eta$ because a large weight on sample $i$ forces the decision boundary to drift away from this data point and gives a larger value of $y _ { i } f ^ { \mathrm { N N } } ( \pmb { \theta } ( \mathbf { w } ) / \Vert \pmb { \theta } ( \mathbf { w } ) \Vert , \mathbf { x } _ { i } )$ . Therefore, the generalization bound with w aligning with $\eta$ can be smaller than that with w deviating from $\eta$ .
|
| 158 |
+
|
| 159 |
+
The empirical results in Figure 2c provides the numerical evidence that reflects the strong effects of importance weighting on the generalization behavior.
|
| 160 |
+
|
| 161 |
+
# 5 EXTENSION
|
| 162 |
+
|
| 163 |
+
# What makes a good set of weights for learning?
|
| 164 |
+
|
| 165 |
+
We show in both Section 3 and 4 that importance weighting can affect how fast the classifier separates the data and converges to the max-margin solution. We also justify how the small-margin support vectors, who can think of as the hard-to-classify data points, are of significant importance. Imagine that we have access to an oracle that outputs the distance of each sample to the max-margin decision boundary. It is intuitive that by putting more weights on the small-margin samples, we "inform" gradient descent of their importance from the beginning and therefore accelerates the optimization. We also provide a rigorous result for linear predictor in Proposition 1. Our high-level intuition justifies a number of methodologies where people use various methods to measure the hardness of classifying a sample and use that as the weight, explicitly or implicitly. Examples include the curriculum learning (Bengio et al., 2009), mentor net (Jiang et al., 2018), co-teaching (Han et al., 2018) and knowledge distillation (Li et al., 2017; Hinton et al., 2015), where auxiliary models are employed (replacing the oracle) to represent the hardness of each data point.
|
| 166 |
+
|
| 167 |
+
# The effect of jointly optimizing a weighting model
|
| 168 |
+
|
| 169 |
+
It is not unusual that the importance weights, when depending on another model, is jointly trained with the classifier to achieve an better overall performance, such as the counterfactual modelling (Schnabel et al., 2016; Xu et al., 2020) and learning from noisy labels (Song et al., 2020). For the illustration purpose, we consider the following setup:
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\operatorname* { m i n i m i z e } _ { \psi , \theta } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } g ( \psi , \mathbf { x } _ { i } ) \cdot \ell \big ( y _ { i } f ( \pmb { \theta } , \mathbf { x } _ { i } ) \big ) , \quad \mathrm { s . t . } \quad \frac { 1 } { M } < g ( \psi , \mathbf { x } _ { i } ) < M ,
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $g ( \psi , \mathbf { x } _ { i } )$ is the weighting model. By our main results, it is not difficult to conjecture that if the data is separable by $f$ , the convergence of $f$ to the max-margin solution will still hold and the weighting model $g ( \psi , \mathbf { x } _ { i } )$ will concentrate to a constant for all $i = 1 , \ldots , n$ . This is because the general convergence results are agnostic to the weights, so the weighting model will eventually be nullified. Also, during the beginning phase of training, the learned weights may correlate negatively to the margin (as it helps to speed up the convergence), and the correlation will diminish eventually as the weights converge to the same constant. The above conjectures are supported by the empirical evidence that we discuss in Figure 4. Therefore, jointly optimizing the weighting model may not change the convergence result but the speed of convergence is affected.
|
| 176 |
+
|
| 177 |
+
# Interaction with explicit regularizations
|
| 178 |
+
|
| 179 |
+
Deep learning models are often trained with explicit regularization. To see how they interact with importance weighting, we first check weather they alter the norm divergence in Claim 1. It is obvious that both the early stopping and strong regularization on $\lVert \pmb \theta \rVert$ prohibits the norm divergence, so $f ( \pmb \theta , \cdot )$ will not achieve the max-margin solution or even separate the training data. In such cases, as it has been observed by Byrd & Lipton (2019), the impact of importance weighting on $\theta _ { \lambda } ( \mathbf { w } )$ and $\tilde { \gamma } ( \pmb \theta _ { \lambda } ( \mathbf { w } ) )$ will be significant. However, this may not help generalization according to our arguments in Section 4.2, since the margins will be altered as well. Indeed, Zhang et al. (2016) shows that explicit regularizations may not lead to better generalization for neural networks. For the weighted ERM, Theorem 1 provides a powerful tool to characterize the trade-off induced by explicit regularizations via the margin size. Dropout, as an counter example, does not prohibit norm divergence and may not interfere with our main conclusions.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 4: The left-five figures show that the distribution of the learned weights concentrates to a constant as the training progresses. The rightmost figure indicates the correlation pattern between margin and the learned weights: the correlation increases rapidly in the beginning, and then slowly decreases to zero (the process is much slower for nonlinear predictor so we only show the first part). Here, $g ( \mathbf { x } _ { i } ) = \sigma ( \psi ^ { \mathsf { T } } \mathbf { x } _ { i } + b ) + 1$ , where $\sigma ( \cdot )$ is the sigmoid function, the constant one is added to avoid numerical issues.
|
| 183 |
+
|
| 184 |
+
# 6 DISCUSSION
|
| 185 |
+
|
| 186 |
+
In this paper, we study the impact of importance weighting on the implicit bias of gradient descent as well as the generalization performance. Based on our theoretical findings, we propose the following future directions that are worth investigating from both the application and theoretical perspective: 1) Is there an optimal way to construct importance weights using such as the oracle margin? 2) How to correctly understand and utilize the role of a jointly-trained weighting model? 3) What is the combined effect of importance weighting and explicit regularizations for deep learning models?
|
| 187 |
+
|
| 188 |
+
# REFERENCES
|
| 189 |
+
|
| 190 |
+
Kamyar Azizzadenesheli, Anqi Liu, Fanny Yang, and Animashree Anandkumar. Regularized learning for domain adaptation under label shifts. arXiv preprint arXiv:1903.09734, 2019.
|
| 191 |
+
|
| 192 |
+
Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pp. 6240–6249, 2017.
|
| 193 |
+
|
| 194 |
+
Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41–48, 2009.
|
| 195 |
+
|
| 196 |
+
Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration inequalities: A nonasymptotic theory of independence. Oxford university press, 2013.
|
| 197 |
+
|
| 198 |
+
Sébastien Bubeck. Convex optimization: Algorithms and complexity. arXiv preprint arXiv:1405.4980, 2014.
|
| 199 |
+
|
| 200 |
+
Jonathon Byrd and Zachary Lipton. What is the effect of importance weighting in deep learning? In International Conference on Machine Learning, pp. 872–881, 2019.
|
| 201 |
+
|
| 202 |
+
Lenaic Chizat and Francis Bach. Implicit bias of gradient descent for wide two-layer neural networks trained with the logistic loss. arXiv preprint arXiv:2002.04486, 2020.
|
| 203 |
+
|
| 204 |
+
Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9268–9277, 2019.
|
| 205 |
+
|
| 206 |
+
Tongtong Fang, Nan Lu, Gang Niu, and Masashi Sugiyama. Rethinking importance weighting for deep learning under distribution shift. Advances in Neural Information Processing Systems, 33, 2020.
|
| 207 |
+
|
| 208 |
+
Mahyar Fazlyab, Alexander Robey, Hamed Hassani, Manfred Morari, and George Pappas. Efficient and accurate estimation of lipschitz constants for deep neural networks. In Advances in Neural Information Processing Systems, pp. 11427–11438, 2019.
|
| 209 |
+
|
| 210 |
+
Alexandre Gilotte, Clément Calauzènes, Thomas Nedelec, Alexandre Abraham, and Simon Dollé. Offline a/b testing for recommender systems. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pp. 198–206, 2018.
|
| 211 |
+
|
| 212 |
+
Noah Golowich, Alexander Rakhlin, and Ohad Shamir. Size-independent sample complexity of neural networks. In Conference On Learning Theory, pp. 297–299. PMLR, 2018.
|
| 213 |
+
|
| 214 |
+
Suriya Gunasekar, Jason D Lee, Daniel Soudry, and Nati Srebro. Implicit bias of gradient descent on linear convolutional networks. In Advances in Neural Information Processing Systems, pp. 9461–9471, 2018.
|
| 215 |
+
|
| 216 |
+
Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in neural information processing systems, pp. 8527–8537, 2018.
|
| 217 |
+
|
| 218 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 219 |
+
|
| 220 |
+
Chen Huang, Yining Li, Chen Change Loy, and Xiaoou Tang. Learning deep representation for imbalanced classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5375–5384, 2016.
|
| 221 |
+
|
| 222 |
+
Chen Huang, Yining Li, Change Loy Chen, and Xiaoou Tang. Deep imbalanced learning for face recognition and attribute prediction. IEEE transactions on pattern analysis and machine intelligence, 2019.
|
| 223 |
+
|
| 224 |
+
Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. arXiv preprint arXiv:1810.02032, 2018a.
|
| 225 |
+
|
| 226 |
+
Ziwei Ji and Matus Telgarsky. Risk and parameter convergence of logistic regression. arXiv preprint arXiv:1803.07300, 2018b.
|
| 227 |
+
|
| 228 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning, pp. 2304–2313, 2018.
|
| 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 M Kakade, Karthik Sridharan, and Ambuj Tewari. On the complexity of linear prediction: Risk bounds, margin bounds, and regularization. In Advances in neural information processing systems, pp. 793–800, 2009.
|
| 233 |
+
|
| 234 |
+
Vladimir Koltchinskii, Dmitry Panchenko, et al. Empirical margin distributions and bounding the generalization error of combined classifiers. The Annals of Statistics, 30(1):1–50, 2002.
|
| 235 |
+
|
| 236 |
+
Buyu Li, Yu Liu, and Xiaogang Wang. Gradient harmonized single-stage detector. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 8577–8584, 2019.
|
| 237 |
+
|
| 238 |
+
Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1910–1918, 2017.
|
| 239 |
+
|
| 240 |
+
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, pp. 2980–2988, 2017.
|
| 241 |
+
|
| 242 |
+
Zachary Lipton, Yu-Xiang Wang, and Alexander Smola. Detecting and correcting for label shift with black box predictors. In International Conference on Machine Learning, pp. 3122–3130, 2018.
|
| 243 |
+
|
| 244 |
+
Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. arXiv preprint arXiv:1906.05890, 2019.
|
| 245 |
+
|
| 246 |
+
Mor Shpigel Nacson, Suriya Gunasekar, Jason D Lee, Nathan Srebro, and Daniel Soudry. Lexicographic and depth-sensitive margins in homogeneous and non-homogeneous deep models. arXiv preprint arXiv:1905.07325, 2019.
|
| 247 |
+
|
| 248 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, and Nathan Srebro. A pac-bayesian approach to spectrallynormalized margin bounds for neural networks. arXiv preprint arXiv:1707.09564, 2017.
|
| 249 |
+
|
| 250 |
+
Behnam Neyshabur, Zhiyuan Li, Srinadh Bhojanapalli, Yann LeCun, and Nathan Srebro. Towards understanding the role of over-parametrization in generalization of neural networks. arXiv preprint arXiv:1805.12076, 2018.
|
| 251 |
+
|
| 252 |
+
Saharon Rosset, Ji Zhu, and Trevor Hastie. Boosting as a regularized path to a maximum margin classifier. Journal of Machine Learning Research, 5(Aug):941–973, 2004a.
|
| 253 |
+
|
| 254 |
+
Saharon Rosset, Ji Zhu, and Trevor J Hastie. Margin maximizing loss functions. In Advances in neural information processing systems, pp. 1237–1244, 2004b.
|
| 255 |
+
|
| 256 |
+
Reuven Y. Rubinstein and Dirk P. Kroese. Simulation and the Monte Carlo Method. Wiley Publishing, 3rd edition, 2016. ISBN 1118632168.
|
| 257 |
+
|
| 258 |
+
Robert E Schapire and Yoav Freund. Boosting: Foundations and algorithms. Kybernetes, 2013.
|
| 259 |
+
|
| 260 |
+
Tobias Schnabel, Adith Swaminathan, Ashudeep Singh, Navin Chandak, and Thorsten Joachims. Recommendations as treatments: Debiasing learning and evaluation. arXiv preprint arXiv:1602.05352, 2016.
|
| 261 |
+
|
| 262 |
+
Hwanjun Song, Minseok Kim, Dongmin Park, and Jae-Gil Lee. Learning from noisy labels with deep neural networks: A survey. arXiv preprint arXiv:2007.08199, 2020.
|
| 263 |
+
|
| 264 |
+
Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1): 2822–2878, 2018.
|
| 265 |
+
|
| 266 |
+
Adith Swaminathan and Thorsten Joachims. Counterfactual risk minimization: Learning from logged bandit feedback. In International Conference on Machine Learning, pp. 814–823, 2015.
|
| 267 |
+
|
| 268 |
+
Aladin Virmaux and Kevin Scaman. Lipschitz regularity of deep neural networks: analysis and efficient estimation. In Advances in Neural Information Processing Systems, pp. 3835–3844, 2018.
|
| 269 |
+
|
| 270 |
+
Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Learning to model the tail. In Advances in Neural Information Processing Systems, pp. 7029–7039, 2017.
|
| 271 |
+
|
| 272 |
+
Colin Wei, Jason D Lee, Qiang Liu, and Tengyu Ma. Regularization matters: Generalization and optimization of neural nets vs their induced kernel. In Advances in Neural Information Processing Systems, pp. 9712–9724, 2019.
|
| 273 |
+
|
| 274 |
+
Da Xu, Chuanwei Ruan, Evren Korpeoglu, Sushant Kumar, and Kannan Achan. Adversarial counterfactual learning and evaluation for recommender system. Advances in Neural Information Processing Systems, 33, 2020.
|
| 275 |
+
|
| 276 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 277 |
+
|
| 278 |
+
# A APPENDIX
|
| 279 |
+
|
| 280 |
+
We provide the omitted discussions, proofs, and extra numerical results in the appendix.
|
| 281 |
+
|
| 282 |
+
# A.1 SUPPLEMENTARY MATERIAL FOR SECTION 2
|
| 283 |
+
|
| 284 |
+
We discuss the exponential-tail behavior for loss functions, the piratical implication of condition C3 and the proof of Claim 1.
|
| 285 |
+
|
| 286 |
+
# A.1.1 LOSS FUNCTION WITH EXPONENTIAL-TAIL BEHAVIOR
|
| 287 |
+
|
| 288 |
+
Having a exponential decay on the tail of the loss function is essential for realizing the implicit bias of gradient descent, since we need $\ell ( u )$ behave like $\exp ( - u )$ as $u \to \infty$ . Soudry et al. (2018) first propose the notion of tight exponential tail, where the negative loss derivative $- \ell ^ { \prime } ( u )$ behave like:
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
- \ell ^ { \prime } ( u ) \lesssim \big ( 1 + \exp ( - c _ { 1 } u ) \big ) e ^ { - u } \mathrm { ~ a n d ~ } - \ell ^ { \prime } ( u ) \gtrsim \big ( 1 - \exp ( - c _ { 2 } u ) \big ) e ^ { - u } ,
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
for sufficiently large $u$ , where $c _ { 1 }$ and $c _ { 2 }$ are positive constants. There is also a smoothness assumption on $\ell ( \cdot )$ . It is obvious that under this definition, the tail behavior of the loss function is constraint from both sides by exponential-type functions.
|
| 295 |
+
|
| 296 |
+
There is a more general (and perhaps more direct) definition of exponential-tail loss function Lyu & Li (2019), where $\ell ( u ) = \exp ( - f ( u ) )$ , such that:
|
| 297 |
+
|
| 298 |
+
• $f$ is smooth and $f ^ { \prime } ( u ) \geq 0 , \forall u$ ;
|
| 299 |
+
• there exists $c > 0$ such that $f ^ { \prime } ( u ) u$ is non-decreasing for $u > c$ and $f ^ { \prime } ( u ) u \infty$ as $u \to \infty$ .
|
| 300 |
+
|
| 301 |
+
It is easy to verify that the exponential loss, log loss and cross-entropy loss satisfy both definitions. Since our focus is not to study the implicit bias of gradient descent, it suffice to work with the above loss functions.
|
| 302 |
+
|
| 303 |
+
# A.1.2 PRACTICAL IMPLICATIONS OF CONDITION C3
|
| 304 |
+
|
| 305 |
+
C3 asserts the Lipschitz and smoothness properties. The Lipschitz condition is rather mild assumption for neural networks, and several recent paper are dedicated to obtaining the Lipschitz constant of certain deep learning models (Fazlyab et al., 2019; Virmaux & Scaman, 2018).
|
| 306 |
+
|
| 307 |
+
The $\beta$ -smooth condition, on the other hand, is more technical-driven such that we can analyze the gradient descent. In practice, neural networks with ReLU activation do not satisfy the smoothness condition. However, there are smooth homogeneous activation functions, such as the quadratic activation $\sigma ( x ) = x ^ { 2 }$ and higher-order ReLU activation $\sigma ( x ) = \mathrm { R e L U } ( x ) ^ { c }$ for $c > 2$ . Still, in our experiments, we use ReLU as the activation function for its convenience.
|
| 308 |
+
|
| 309 |
+
# A.1.3 PROOF FOR CLAIM 1
|
| 310 |
+
|
| 311 |
+
Soudry et al. (2018) and Ji & Telgarsky (2018b) show norm divergence for linear predictors, and the follow-up work by Ji & Telgarsky (2018a); Gunasekar et al. (2018) extend the result to linear neural networks. For nonlinear predictors such as multi-layer neural network with homogeneous activation, Nacson et al. (2019) and Lyu & Li (2019) prove the norm divergence for gradient descent in the absence of explicit regularization. Rosset et al. (2004a) and Wei et al. (2019) considers the weak regularization for linear and nonlinear predictors, however, they only study the property of the critical points instead of the gradient descent sequence.
|
| 312 |
+
|
| 313 |
+
Proof. We first state a technical lemma that characterizes the dynamics of gradient descent.
|
| 314 |
+
|
| 315 |
+
Lemma A.1 (Theorem E.10 of Lyu & Li (2019)). Under the conditions that:
|
| 316 |
+
|
| 317 |
+
• $\ell ( \cdot )$ is given by the exponential loss, and $\ell \circ f ( \cdot , \mathbf { x } )$ is a smooth function on $\mathbb { R } ^ { d }$ for all $\mathbf { x } \in \mathcal { X }$ ;
|
| 318 |
+
|
| 319 |
+
• $f ( { \pmb \theta } , { \bf x } )$ is $\alpha$ -homogeneous as in $^ { c 2 }$ ; • the data is separated by $f$ during gradient descent at some point $t _ { 0 }$ ; • the learning rate satisfy $\eta _ { t } : = \eta _ { 0 } \lesssim \Big ( L \big ( \pmb { \theta } ^ { ( t ) } ; \mathbf { w } \big ) \log \big ( 1 / L \big ( \pmb { \theta } ^ { ( t ) } ; \mathbf { w } \big ) \big ) ^ { 3 - 2 / \alpha } \Big ) ^ { - 1 } f ($ r all t,
|
| 320 |
+
|
| 321 |
+
then under exponential loss we have:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\frac { 1 } { L ( \pmb { \theta } ^ { ( t ) } ; \mathbf { w } ) ^ { 2 } \big ( \log \frac { 1 } { L ( \pmb { \theta } ^ { ( t ) } ; \mathbf { w } ) } \big ) ^ { 2 - 2 / \alpha } } \geq \frac { 1 } { 2 } \alpha ^ { 2 } \widetilde { \gamma } \big ( \pmb { \theta } ^ { ( t _ { 0 } ) } ( \mathbf { w } ) \big ) ^ { 2 / \alpha } \sum _ { i = t _ { 0 } } ^ { ( t ) } \eta _ { i } .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
To use the results of Lemma A.1, we simply need to show two things for weak regularization:
|
| 328 |
+
|
| 329 |
+
• the total risk is still smooth and we still can achieve zero risk; • there exists a critical (stationary) point such that $\begin{array} { r } { \operatorname* { l i m } _ { \lambda \to 0 } L _ { \lambda } ( \pmb { \theta } ^ { * } ; \mathbf { w } ) = 0 . } \end{array}$
|
| 330 |
+
|
| 331 |
+
Notice that the risk without regularization is a smooth function in terms of $\pmb \theta$ for all $\mathbf { x }$ , since the composition of smooth functions is still smooth. It is easy to see that adding a weak regularization, e.g. $\mathbf { \bar { \boldsymbol { \lambda } } } \mathbf { \| } \pmb { \theta } \| _ { 2 } ^ { r }$ for $r > 1$ , does not alter the smoothness condition as $\lambda 0$ . However, the weak $\ell _ { 1 }$ regularization will make the total risk non-smooth, and therefore we have excluded it from our discussion.
|
| 332 |
+
|
| 333 |
+
For the second point, it is obvious that $\| \pmb \theta \| _ { 2 } \infty$ is a critical point under exponential loss when $\lambda 0$ . Recall that:
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
L _ { \lambda } ( \boldsymbol { \theta } ; \mathbf { w } ) = \frac { 1 } { n } \sum _ { i } w _ { i } \exp \big ( - y _ { i } f \big ( \boldsymbol { \theta } / \| \boldsymbol { \theta } \| _ { 2 } , \mathbf { x } _ { i } \big ) \cdot \| \boldsymbol { \theta } \| _ { 2 } \big ) \big ) + \lambda \| \boldsymbol { \theta } \| _ { 2 } ^ { r } ,
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
and
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\nabla L _ { \lambda } ( \theta ; \mathbf { w } ) = \frac { 1 } { n } \sum _ { i } - w _ { i } \exp \Big ( - y _ { i } f \big ( \theta / \| \theta \| _ { 2 } , \mathbf { x } _ { i } \big ) \cdot \| \theta \| _ { 2 } \Big ) \cdot y _ { i } \nabla f \big ( \theta , \mathbf { x } _ { i } \big ) + \lambda \nabla \| \theta \| _ { 2 } ^ { r } .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Therefore, for both the loss function and gradient, the main term decreases exponentially fast as $\lVert \pmb \theta \rVert _ { 2 }$ increases, while the remainder terms are only polynomial in $\lVert \pmb { \theta } \rVert _ { 2 }$ , so we can always find a small enough $\lambda$ that satisfy: $\begin{array} { r } { \operatorname* { l i m } _ { \lambda \to 0 } \operatorname* { l i m } _ { \| \pmb { \theta } \| \infty } L _ { \lambda } ( \pmb { \theta } ; \mathbf { w } ) = 0 } \end{array}$ and $\begin{array} { r } { \operatorname* { l i m } _ { \lambda \to 0 } \operatorname* { l i m } _ { \parallel \theta \parallel \to \infty } \nabla L _ { \lambda } ( \theta ; \mathbf { w } ) = 0 } \end{array}$ , in the same fashion as we show in the (A.1) below.
|
| 346 |
+
|
| 347 |
+
From a standard result of gradient descent on smooth function, which we summarize in Lemma A.2, gradient descent will always converge to a critical (stationary) point for the weighted ERM problem.
|
| 348 |
+
|
| 349 |
+
Lemma A.2 (Lemma 10 of Soudry et al. (2018)). Let $L _ { \lambda } ( \pmb { \theta } ; \mathbf { w } )$ be a $B ( \mathbf { w } )$ -smooth non-negative objective. With a constant learning rate $\eta _ { 0 } \lesssim B ( \mathbf { w } ) ^ { - 1 }$ , the gradient descent sequence satisfies:
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\begin{array} { r l } & { \bullet \operatorname* { l i m } _ { t \infty } \sum _ { i = 1 } ^ { t } \| \nabla L _ { \lambda } ( \pmb { \theta } ^ { ( t ) } ; \mathbf { w } ) \| < \infty ; } \\ & { \bullet \operatorname* { l i m } _ { t \infty } \nabla L _ { \lambda } ( \pmb { \theta } ^ { ( t ) } ; \mathbf { w } ) = 0 . } \end{array}
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Now we need to show that under appropriate learning rate, which is specified in Lemma A.1, gradient descent converges to the stationary point that corresponds to the zero risk under weak regularization. Using the result from Lemma A.1, notice that if $L _ { \lambda } ( \pmb \theta ^ { ( t ) } ; \mathbf { w } )$ does not decrease to 0, then the denominator Lλ(θ(t); w)2 log 1L (θ(t);w) is bounded from below.
|
| 356 |
+
|
| 357 |
+
However, there exists a constant learning rate such that $\textstyle \sum _ { i = t _ { 0 } } ^ { t } \eta _ { i } \to \infty$ as $t \to \infty$ , which leads to contradiction. Therefore, for weighted ERM with weak regularization, gradient descent converges to the stationary point where $L _ { \lambda } ( \pmb \theta ^ { ( \bar { t } ) } ; \mathbf { w } ) = 0$ .
|
| 358 |
+
|
| 359 |
+
Finally, we show to make $L _ { \lambda } ( \pmb \theta ^ { ( t ) } ; \mathbf { w } ) 0$ , we must have $\| \pmb \theta ^ { ( t ) } ( \mathbf { w } ) \| \infty$ . We show by contradiction. Suppose $\left\| \pmb { \theta } ^ { ( t ) } ; \mathbf { w } ) \right\|$ is bounded from above by some constant $C > 0$ , for all $\lambda < \tilde { \lambda }$ that we choose later. So the loss function for each sample $i$ is bounded below by a positive value that depends on $\mathcal { O } \colon w _ { i } \exp \bigl ( - y _ { i } f \bigl ( \pmb \theta ^ { ( t ) } , \mathbf x \bigr ) \bigr ) \geq l ( C ) > 0 .$ . Hence, let $K : = \tilde { \lambda } ^ { - 1 / ( r + 1 ) }$ , then
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { l } { l ( C ) \leq L _ { \lambda } ( \pmb \theta _ { \lambda } ( \mathbf w ) ; \mathbf w ) \leq L _ { \lambda } ( K \pmb \theta ^ { * } ; \mathbf w ) } \\ { \leq M \exp \big ( - \tilde { \lambda } ^ { - \alpha / ( r + 1 ) } \cdot \gamma ^ { * } \big ) + \tilde { \lambda } ^ { 1 / ( 1 + r ) } ; } \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
and it easy obvious that $\mathrm { R H S } \to 0$ for a sufficiently small $\tilde { \lambda }$ , which contradicts $l ( C ) > 0$ . Hence, we have $\| \pmb \theta ^ { ( t ) } ( \mathbf { w } ) \| \infty$ for all all $\lambda < \widetilde { \lambda }$ , which completes the proof.
|
| 366 |
+
|
| 367 |
+
# A.2 SUPPLEMENTARY MATERIAL FOR SECTION 3
|
| 368 |
+
|
| 369 |
+
We provide the proofs for Proposition 1 and 2 in this part of the appendix.
|
| 370 |
+
|
| 371 |
+
# A.2.1 PROOF FOR PROPOSITION 1
|
| 372 |
+
|
| 373 |
+
Proof. We first characterize the $1 / \log t$ rate using asymptotic arguments similar to that of Soudry et al. (2018). The key purpose here is to rigorously show that importance weighting plays a negligible role in the asymptotic regime. Let $\delta ( t )$ be the residual term at step $t$ :
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
\pmb { \delta } ( t , \mathbf { w } ) : = \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) - \pmb { \theta } ^ { * } \log t .
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
To show the $1 / \log t$ rate, we simply need to prove that $\| \delta ( t , \mathbf { w } ) \|$ is bounded for any $\mathbf { w } \in [ 1 / M , M ] ^ { n }$ . Notice that
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\| \delta ( t + 1 , \mathbf { w } ) \| ^ { 2 } = \left\| \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \right\| ^ { 2 } + 2 \big ( \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \big ) ^ { \mathsf { T } } \delta ( t , \mathbf { w } ) + \left\| \delta ( t , \mathbf { w } ) \right\| ^ { 2 } .
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
For the first term, we have:
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\begin{array} { r l } & { \left\| \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \right\| ^ { 2 } } \\ & { = \left\| \mathbf { \nabla } - \eta \nabla L \big ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } \big ) - \theta ^ { * } \big ( \log ( t + 1 ) - \log ( t ) \big ) \right\| ^ { 2 } } \\ & { = \eta ^ { 2 } \| - \eta \nabla L \big ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } \big ) \| + \| \theta ^ { * } \| ^ { 2 } \log ^ { 2 } ( 1 + 1 / t ) + 2 \eta \big ( \pmb { \theta } ^ { * } ) ^ { \top } \nabla L \big ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } \big ) \log ( 1 + 1 / t ) } \\ & { \leq \eta ^ { 2 } \big \| \nabla L \big ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } \big ) \big \| + \| \theta ^ { * } \| ^ { 2 } t ^ { - 2 } ; } \end{array}
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
where in the last line we use:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { r l } & { \bullet ( \pmb { \theta } ^ { * } ) ^ { \top } \nabla L \big ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } \big ) \ = \ \sum _ { i } - w _ { i } \exp ( - y _ { i } \pmb { \theta } ^ { * } \mathbf { x } _ { i } ) y _ { i } \pmb { \theta } ^ { * } \mathbf { x } _ { i } \ \leq \ 0 } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Also, from the first conclusion of Lemma A.2, we see that $\left\| \nabla L \big ( \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } \big ) \right\| \ = \ o ( 1 / t )$ , so $\left\| \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \right\| ^ { 2 } = o ( 1 / t )$ and the running sum converges to some finite number:
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\sum _ { t = 1 } ^ { \infty } \left\| \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \right\| ^ { 2 } = C _ { 0 } < \infty .
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
We see that the role of the weights is totally negligible because $\pmb { \theta } ^ { * }$ separates the data (the second bullet point above). The same argument applies to the second term $2 \big ( \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \big ) ^ { \sf T } \delta ( t , \mathbf { w } )$ , where w plays no part as long as $\pmb { \theta } ^ { * }$ separates the data. The detailed proof is technical, and we refer to Lemma 6 of Soudry et al. (2018), which states that:
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\big ( \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \big ) ^ { \top } \delta ( t , \mathbf { w } ) = o ( 1 / t ) .
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
Therefore, by applying tensorization, it holds that:
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\left\| \delta ( t , \mathbf { w } ) \right\| ^ { 2 } - \left\| \delta ( t = 0 , \mathbf { w } ) \right\| ^ { 2 } \leq C _ { 0 } + \sum _ { i = 1 } ^ { t } \left( \delta ( t + 1 , \mathbf { w } ) - \delta ( t , \mathbf { w } ) \right) ^ { \top } \delta ( t , \mathbf { w } ) < \infty ,
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
hence $\left\| \delta ( t , \mathbf { w } ) \right\|$ is bounded and
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\| \delta ( t , \mathbf { w } ) \| / \log t = \mathcal { O } ( 1 / \log t ) , \quad \Big | \frac { \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) } { \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } - \pmb { \theta } ^ { * } \Big | = \mathcal { O } ( \frac { 1 } { \log t } ) .
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
It is now obvious that under the asymptotic characterization of (A.2), the weights only play a negligible role since $\pmb { \theta } ^ { * }$ separate the data. However, the definition of $\delta$ under (A.2) also prohibits us from studying the finite-step behavior since it absorbs all the constant factors.
|
| 422 |
+
|
| 423 |
+
Now we use the Fenchel-Young inequality to give a more precise characterization of the convergence speed. First of all, recall the max-margin problem for linear predictor has a dual representation for separable data according to the KKT condition for separable problem:
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\pmb { \theta } ^ { * } = y _ { i } \mathbf { X } _ { i } \cdot p _ { i } ^ { * } / \gamma ^ { * } ,
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
where $p _ { i } ^ { * }$ is the dual optimal such that
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\gamma ^ { * } = - \operatorname* { m i n } \Big \{ \operatorname* { m a x } _ { i } - y _ { i } \mathbf { x } _ { i } ^ { \top } \pmb \theta \mathrm { \ s . t . } \ \lVert \pmb \theta \rVert = 1 \Big \} \equiv \operatorname* { m i n } \Big \{ \lVert y _ { i } \mathbf { X } _ { i } \cdot p _ { i } \rVert \mathrm { \ s . t . } \ p _ { i } \ge 0 , \sum _ { i } p _ { i } = 1 \Big \} .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
Now, we directly work with θ ( t ) ( w )( t ) − θ ∗ :
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\left| \frac { \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) } { \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } - \pmb { \theta } ^ { \ast } \right| ^ { 2 } = 2 - \frac { 2 \big \langle \pmb { \theta } ^ { \ast } , \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \big \rangle } { \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } ,
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
and from (A.4) and Fenchel-Young inequality we have:
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
- \frac { \left. \theta ^ { * } , \theta ^ { ( t ) } ( \mathbf { w } ) \right. } { \| \theta ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } = \frac { \left. p ^ { * } , - y _ { i } \mathbf { x } _ { i } ^ { ( \top ) } \theta ^ { ( t ) } ( \mathbf { w } ) \right. } { \gamma ^ { * } \| \theta ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } \leq \frac { g ^ { * } \big ( p ^ { * } \big ) + g \big ( - y _ { i } \mathbf { x } _ { i } ^ { ( \top ) } \theta ^ { ( t ) } ( \mathbf { w } ) \big ) } { \gamma ^ { * } \| \theta ^ { ( t ) } ( \mathbf { w } ) \| _ { 2 } } ,
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
where $g$ is a convex function with it conjugate function given by $g ^ { * }$ . To build the connections with the loss function and risk, we choose $g$ such that $\begin{array} { r } { g ( \pmb { u } ) \stackrel { = } { = } \log \frac { 1 } { n } \sum _ { i } w _ { i } \exp ( u _ { i } ) } \end{array}$ . As a consequence, by letting $u _ { i } = - y _ { i } \mathbf { x } _ { i } ^ { ( \top ) } \pmb \theta ^ { ( t ) }$ and $\pmb { u } = [ u _ { 1 } , \dots , u _ { n } ]$ , we have $g ( \pmb { u } ) = L ( \pmb \theta ^ { ( t ) } ; \mathbf w )$ .
|
| 448 |
+
|
| 449 |
+
With simple algebraic computations, the conjugate function $g ^ { * } ( \pmb { p } )$ is given by:
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
g ^ { \ast } ( \pmb { p } ) = \log n + \sum _ { i } p _ { i } \log \frac { p _ { i } } { w _ { i } } = D _ { K L } ( \pmb { p } | | \mathbf { w } ) + \log n .
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Plugging the above results to (A.5):
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\frac { 1 } { 2 } \Big | \frac { \theta ^ { ( t ) } ( \mathbf { w } ) } { \big \| \theta ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } } - \theta ^ { * } \Big | ^ { 2 } \leq 1 + \frac { \log L ( \theta ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } ) } { \big \| \theta ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } \gamma ^ { * } } + \frac { \log n + D _ { K L } ( p \| \mathbf { w } ) } { \big \| \theta ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } \gamma ^ { * } }
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
According the convergence analysis of Adaboost, we have the following technical lemma.
|
| 462 |
+
|
| 463 |
+
Lemma A.3 (Schapire & Freund (2013)). Suppose $\ell$ is convex, $\ell ^ { \prime } \leq \ell _ { \mathrm { { : } } }$ , and $\ell ^ { \prime \prime } \leq \ell ,$ , with a linear predictor and a sufficiently small learning rate such that $\eta _ { t } L ( \pmb \theta ^ { ( t ) } ) \leq 1$ , then:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
L ( \pmb { \theta } ^ { ( t + 1 ) } ) \leq L ( \pmb { \theta } ^ { ( t ) } ) \Big ( 1 - \eta _ { t } L ( \pmb { \theta } ^ { ( t ) } ) \big ( 1 - \eta _ { t } L ( \pmb { \theta } ^ { ( t ) } ) / 2 \big ) \Big ( \frac { \| \nabla L ( \pmb { \theta } ^ { ( t ) } ) \| _ { 2 } } { L \big ( \pmb { \theta } ^ { ( t ) } \big ) } \Big ) ^ { 2 } \Big ) ,
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
and thus
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\begin{array} { r l } & { L ( \pmb \theta ^ { ( t + 1 ) } ) \leq L ( \pmb \theta ^ { ( 0 ) } ) \exp \Big ( - \displaystyle \sum _ { j < t } \eta _ { t } L ( \pmb \theta ^ { ( j ) } ) \big ( 1 - \eta _ { j } L ( \pmb \theta ^ { ( j ) } ) / 2 \big ) \Big ( \frac { \| \nabla L ( \pmb \theta ^ { ( j ) } ) \| _ { 2 } } { L ( \pmb \theta ^ { ( j ) } ) } \Big ) ^ { 2 } \Big ) . } \\ & { } \\ & { \| \pmb \theta ^ { ( t + 1 ) } \| \leq \sum _ { j < t } \eta _ { t } L ( \pmb \theta ^ { ( j ) } ) \frac { \| \nabla L ( \pmb \theta ^ { ( j ) } ) \| _ { 2 } } { L ( \pmb \theta ^ { ( j ) } ) } . } \end{array}
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
To use the results in Lemma A.3, we define the following shorthand notations. Let $a _ { t } ( \mathbf { w } ) : =$ ηtL(θ(t); w) and bt(w) := $b _ { t } ( \mathbf { w } ) : = \frac { \| \nabla L ( \pmb \theta ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } ) \| _ { 2 } } { L ( \pmb \theta ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } ) }$ k∇L(θ(t)(w); w)k2 . Now, (A.6) can be further given by:
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { r l } { \displaystyle \frac { 1 } { 2 } \Big | \frac { \theta ^ { ( t ) } ( \mathbf { w } ) } { \big \| \theta ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } } - \theta ^ { * } \Big | ^ { 2 } \leq 1 + \frac { \log L ( \theta ^ { ( 0 ) } ; \mathbf { w } ) } { \| \theta ^ { ( t ) } \| \gamma ^ { * } } - } & { } \\ { \displaystyle \qquad } & { \leq \frac { \sum _ { i = 0 } ^ { t - 1 } a _ { i } ( \mathbf { w } ) \big ( 1 - a _ { i } ( \mathbf { w } ) / 2 \big ) b _ { i } ( \mathbf { w } ) ^ { 2 } } { \big \| \theta ^ { ( i ) } \big \| \gamma ^ { * } } + \frac { \log n + D _ { K L } ( p \| \mathbf { w } ) } { \big \| \theta ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } \gamma ^ { * } } } \\ { \leq 1 - \frac { \sum _ { i = 1 } ^ { t - 1 } a _ { i } ( \mathbf { w } ) b _ { i } ^ { 2 } ( \mathbf { w } ) } { \| \theta ^ { ( i ) } \| \gamma ^ { * } } + \frac { 2 \sum _ { i = 1 } ^ { t - 1 } a _ { i } ^ { 2 } ( \mathbf { w } ) b _ { i } ^ { 2 } ( \mathbf { w } ) } { \| \theta ^ { ( i ) } \| \gamma ^ { * } } + \frac { \log n + D _ { K L } ( p \| \mathbf { w } ) } { \big \| \theta ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } \gamma ^ { * } } . } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
Notice that Lemma A.3 also imply:
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\sum _ { i = 1 } ^ { t - 1 } a _ { i } ^ { 2 } ( \mathbf w ) b _ { i } ^ { 2 } ( \mathbf w ) = \sum _ { i = 1 } ^ { t - 1 } \eta _ { i } \| \nabla L ( \pmb \theta ^ { ( i ) } ( \mathbf w ) ; \mathbf w ) \| \leq 2 \sum _ { i = 1 } ^ { t - 1 } \Big ( L ( \pmb \theta ^ { ( i ) } ( \mathbf w ) ; \mathbf w ) - L ( \pmb \theta ^ { ( i + 1 ) } ( \mathbf w ) ; \mathbf w ) \Big ) ,
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
which is bounded from above by $2 M$ . Finally, it is easy to verify that $b _ { t } ( \mathbf { w } ) \geq \gamma ^ { * }$ , and Lemma A.3 also implies that $\begin{array} { r } { \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \| \leq \sum _ { i < t } a _ { i } ( \mathbf { w } ) b _ { i } ( \mathbf { w } ) } \end{array}$ . Finally, we simplify (A.9) to:
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\Big | \frac { \theta ^ { ( t ) } ( \mathbf { w } ) } { \big \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } } - \pmb { \theta } ^ { * } \Big | ^ { 2 } \leq 2 \cdot \frac { \log n + D _ { K L } ( \pmb { p } \| \mathbf { w } ) + M } { \big \| \pmb { \theta } ^ { ( t ) } ( \mathbf { w } ) \big \| _ { 2 } \gamma ^ { * } } ,
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
and obtain the desired result.
|
| 494 |
+
|
| 495 |
+
# A.3 PROOF FOR PROPOSITION 2
|
| 496 |
+
|
| 497 |
+
We first present a greedy approach for the construction of the maximal separable subset $\mathcal { D } _ { \mathrm { s e p } }$ , which is proposed by Ji & Telgarsky (2018b).
|
| 498 |
+
|
| 499 |
+
For each sample $\left( \mathbf { x } _ { i } , y _ { i } \right)$ , if there exists a $\theta _ { i }$ such that $y _ { i } \pmb { \theta } _ { i } ^ { \top } \mathbf { x } _ { i } > 0$ and $\begin{array} { r } { \operatorname* { m i n } _ { j = 1 , \dots , n } y _ { j } \pmb { \theta } _ { i } ^ { \intercal } \mathbf { x } _ { j } \ge 0 } \end{array}$ , we add it to $\mathcal { D } _ { \mathrm { s e p } }$ . Otherwise, we add it to ${ \mathcal { D } } _ { \mathrm { n o n - s e p } }$ . To see why this approach work, first notice that by choosing $\begin{array} { r } { \pmb { \theta } _ { s e p } ^ { * ^ { \star } } = \sum _ { i \in \mathcal { D } } \pmb { \theta } _ { i } , \pmb { \theta } _ { s e p } ^ { * } } \end{array}$ separates the data in $\mathcal { D } _ { \mathrm { s e p } }$ . Then we check it is indeed maximal: for any $\pmb \theta$ that is correct on any $\left( \mathbf { x } _ { i } , y _ { i } \right)$ in $\mathcal { D } _ { \mathrm { n o n - s e p } }$ , there must also exist another $\left( \mathbf { x } _ { j } , y _ { j } \right)$ in $\mathcal { D } _ { \mathrm { n o n - s e p } }$ so $y _ { i } \pmb { \theta } _ { i } ^ { \top } \mathbf { x } _ { i } < 0$ , or otherwise $\left( \mathbf { x } _ { i } , y _ { i } \right)$ would have been in $\mathcal { D } _ { \mathrm { s e p } }$ .
|
| 500 |
+
|
| 501 |
+
It has been shown in Ji & Telgarsky (2018b) that the risk is strongly convex on $\mathcal { D } _ { \mathrm { n o n - s e p } }$ under conditions that are satisfied by our setting.
|
| 502 |
+
|
| 503 |
+
Lemma A.4 (Theorem 2.1 of Ji & Telgarsky (2018b)). If $\ell$ is twice differentiable, $\ell ^ { \prime \prime } > 0$ , $l \geq 0$ and $\begin{array} { r } { \operatorname* { l i m } _ { u \infty } \ell ( u ) = 0 } \end{array}$ , then $\begin{array} { r } { L ( \pmb { \theta } ) = \sum _ { i } \frac { 1 } { n } \ell \big ( y _ { i } \mathbf { \dot { \theta } } ^ { \top } \mathbf { x } _ { i } \big ) } \end{array}$ is strongly convex on $\mathcal { D } _ { n o n - s e p }$ .
|
| 504 |
+
|
| 505 |
+
Now we provide the proof for Proposition 2.
|
| 506 |
+
|
| 507 |
+
Proof. The first part is a direct consequence of Lemma A.4, that $\begin{array} { r } { L ( \pmb \theta ; \mathbf w ) = \frac { 1 } { n } \sum _ { i } w _ { i } \exp ( - y _ { i } \pmb \theta ^ { \top } \mathbf x _ { i } ) } \end{array}$ is strongly convex on ${ \mathcal { D } } _ { \mathrm { n o n - s e p } }$ . Therefore, the optimum $\tilde { \pmb { \theta } } ( \mathbf { w } )$ is uniquely defined and $\lVert \tilde { \pmb { \theta } } ( \mathbf { w } ) \rVert = \mathcal { O } ( 1 )$ . To show the second part, we leverage a standard argument for gradient descent with smoothness condition.
|
| 508 |
+
|
| 509 |
+
Lemma A.5 (Bubeck (2014)). Suppose $L ( \theta )$ is convex and $\beta$ -smooth. Then with learning rate $\eta _ { t } \leq \beta / 2$ , the sequence of gradient descent satisfies:
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
L ( \pmb { \theta } ^ { ( t + 1 ) } ) \leq L ( \pmb { \theta } ^ { ( t ) } ) - \eta _ { t } \big ( 1 - \eta _ { t } \beta / 2 \big ) \lVert \pmb { \theta } ^ { ( t ) } ) \rVert ^ { 2 } .
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
Then for any $\mathbf { z } \in \mathbb { R } ^ { d }$ :
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
2 \sum _ { i = 0 } ^ { t - 1 } \eta _ { i } \left( L ( \pmb { \theta } ^ { ( i ) } ) - L ( \mathbf { z } ) \right) \leq \| \pmb { \theta } ^ { ( 0 ) } - \mathbf { z } \| ^ { 2 } - \| \pmb { \theta } ^ { ( t ) } - \mathbf { z } \| ^ { 2 } + \sum _ { i = 0 } ^ { t - 1 } \frac { \eta _ { i } } { 1 - \beta \eta _ { i } / 2 } \big ( L ( \pmb { \theta } ^ { ( i ) } ) - L ( \mathbf { z } ) \big ) .
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
It is immediately clear that we may choose the $\mathbf { z }$ in Lemma A.5 such that it combines the optimal from $\mathcal { D } _ { \mathrm { s e p } }$ and $\mathcal { D } _ { \mathrm { n o n - s e p } }$ . In particular, we have shown that the optimal on ${ \mathcal { D } } _ { \mathrm { n o n - s e p } }$ is uniquely given by $\tilde { \pmb { \theta } } ( \mathbf { w } )$ . For $\mathcal { D } _ { \mathrm { s e p } }$ we assume the max-margin linear predictor is given by $\theta _ { s e p } ^ { * }$ (so $\| \pmb { \theta } _ { s e p } ^ { * } \| = 1 ,$ ). Therefore, according to Proposition 1, the optimum is given by $\log t \cdot \theta _ { s e p } ^ { * }$ .
|
| 522 |
+
|
| 523 |
+
Now define
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\begin{array} { r } { \mathbf { z } : = \tilde { \pmb { \theta } } ( \mathbf { w } ) + \pmb { \theta } _ { s e p } ^ { * } \cdot \log t / \gamma _ { s e p } , } \end{array}
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
where we add the extra constant $\gamma _ { s e p }$ , which is the maximum margin on the separable subset of the data, to simplify the following bound. Without loss of generality, we assume the features are bounded in $\| \cdot \| _ { 2 }$ norm such that $\| \mathbf { x } _ { i } \| _ { 2 } \leq 1$ . As a consequence:
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
L ( \pmb \theta ; \mathbf w ) = L _ { \mathrm { n o n } \lnot \mathrm { e p } } ( \tilde { \pmb \theta } ( \mathbf w ) ; \mathbf w ) + L _ { \mathrm { s e p } } ( \mathbf z ) \le \operatorname* { i n f } _ { \pmb \theta } L ( \pmb \theta ; \mathbf w ) + n \exp ( \| \tilde { \pmb \theta } ( \mathbf w ) \| ) / t ,
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
where we use $L _ { \mathrm { { n o n - s e p } } }$ and $L _ { \mathrm { s e p } }$ to denote the risk associated with $\mathcal { D } _ { \mathrm { n o n - s e p } }$ and $\mathcal { D } _ { \mathrm { s e p } }$ . To invoke Lemma A.5, first note that the required smoothness condition is guaranteed by Lemma A.3, i.e. in each step, the risk is $\eta _ { t } L ( \pmb \theta ^ { ( t ) } )$ -smooth. Without loss of generality, we assume $\eta _ { t } L ( \pmb \theta ^ { ( t ) } ) \leq \eta _ { t }$ . Therefore, according to Lemma A.5, we have:
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\begin{array} { r l } & { 2 \big ( \displaystyle \sum _ { i < t } \eta _ { j } \big ) \big ( L ( \pmb \theta ^ { ( i ) } ; \mathbf { w } ) - L ( \mathbf z ; \mathbf { w } ) \big ) } \\ & { \leq 2 \displaystyle \sum _ { i < t } \eta _ { j } \big ( L ( \pmb \theta ^ { ( i ) } ; \mathbf { w } ) - L ( \mathbf z ; \mathbf { w } ) \big ) + 2 \big ( L ( \pmb \theta ^ { ( i + 1 ) } ; \mathbf { w } ) - L ( \pmb \theta ^ { ( i ) } ; \mathbf { w } ) \big ) } \\ & { \leq 2 \displaystyle \sum _ { i < t } \eta _ { j } \big ( L ( \pmb \theta ^ { ( i ) } ; \mathbf { w } ) - L ( \mathbf z ; \mathbf { w } ) \big ) - \displaystyle \sum _ { i < t } \frac { \eta _ { i } } { 1 - \eta _ { i } / 2 } \big ( L ( \pmb \theta ^ { ( i ) } ; \mathbf { w } ) - L ( \pmb \theta ^ { ( i + 1 ) } ; \mathbf { w } ) \big ) } \\ & { \leq \| \pmb \theta ^ { ( 0 ) } - \mathbf z \| ^ { 2 } - \| \pmb \theta ^ { ( t ) } - \mathbf z \| ^ { 2 } \leq \| \mathbf { z } \| ^ { 2 } . } \end{array}
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
Therefore, by our choice of $\mathbf { z }$ as well as the result in (A.10), we obtain the bound in terms of the risk:
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
L ( \pmb \theta ^ { ( t ) } ; \mathbf w ) \le \operatorname* { i n f } _ { \pmb \theta } L ( \pmb \theta ; \mathbf w ) + \frac { \exp ( \tilde { \pmb \theta } ( \mathbf w ) ) } { t } + \frac { \| \tilde { \pmb \theta } ( \mathbf w ) \| ^ { 2 } + \log ^ { 2 } t / \gamma _ { \mathrm { s e p } } ^ { 2 } } { 2 \sum _ { i < t } \eta _ { i } } .
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
Since we assume a constant learning rate, when $\textstyle \sum _ { i < t } \eta _ { i } = { \mathcal { O } } ( t )$ we can simplify the above result to:
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
L ( \pmb \theta ^ { ( t ) } ; \mathbf w ) \le \operatorname* { i n f } _ { \pmb \theta } L ( \pmb \theta ; \mathbf w ) + \frac { C \big ( \| \tilde { \pmb \theta } ( \mathbf w ) \| \big ) + \log ^ { 2 } t / \gamma _ { \mathrm { s e p } } ^ { 2 } } { t } .
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
Finally, from Lemma A.4 we known $L ( \pmb \theta ; \mathbf { w } )$ is strongly convex (which we assume to be $\omega$ -stronglyconvex). So the convergence in terms of the risk can be transformed to parameters:
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\begin{array} { l } { \displaystyle \big | \Pi _ { \mathrm { n o n - s e p } } \theta ^ { ( t ) } ( \mathbf { w } ) - \tilde { \theta } ( \mathbf { w } ) \big | \leq \frac { 2 } { \omega } \Big ( L _ { \mathrm { n o n - s e p } } ( \theta ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } ) - L _ { \mathrm { n o n - s e p } } ( \tilde { \theta } ( \mathbf { w } ) ; \mathbf { w } ) \Big ) } \\ { \displaystyle \qquad \leq \frac { 2 } { \omega } \Big ( L ( \theta ^ { ( t ) } ( \mathbf { w } ) ; \mathbf { w } ) - \operatorname* { i n f } _ { \theta } L ( \theta ; \mathbf { w } ) \Big ) , } \end{array}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
which leads to our desired results.
|
| 560 |
+
|
| 561 |
+
# A.4 SUPPLEMENTARY MATERIAL FOR SECTION 4
|
| 562 |
+
|
| 563 |
+
In this section, we establish the detailed proofs of Proposition 3 and Theorem 1. Recall that the loss function we are interested in is:
|
| 564 |
+
|
| 565 |
+
$$
|
| 566 |
+
\operatorname* { m i n } _ { \pmb { \theta } } L _ { \lambda } ( \pmb { \theta } ; \mathbf { w } ) : = L ( \pmb { \theta } , \mathbf { w } ) + \lambda \| \pmb { \theta } \| ^ { r } ,
|
| 567 |
+
$$
|
| 568 |
+
|
| 569 |
+
Denote ${ \pmb \theta } _ { \lambda } ( { \bf w } ) \ \in \ \mathrm { a r g } \operatorname * { m i n } L _ { \lambda } ( { \pmb \theta } , { \bf w } ) , \ { \pmb \theta }$ $\theta ^ { * } \ = \ \arg \operatorname* { m a x } _ { \theta : \| \theta \| \leq 1 } \operatorname* { m a x } _ { i } y _ { i } f ( \theta , \mathbf { x } _ { i } ) )$ . Let $\gamma _ { \lambda } ( \mathbf { w } ) \ =$ $\mathrm { m a x } _ { i } y _ { i } f ( \pmb { \theta } _ { \lambda } ( \mathbf { w } ) / \Vert \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \Vert , \mathbf { x } _ { i } )$ , $\gamma ^ { * } = \operatorname* { m a x } _ { i } y _ { i } f ( \pmb { \theta } ^ { * } , \mathbf { x } _ { i } )$ .
|
| 570 |
+
|
| 571 |
+
A.4.1 PROOF OF PROPOSITION 3.
|
| 572 |
+
|
| 573 |
+
We first restate the proposition.
|
| 574 |
+
|
| 575 |
+
Proposition A.1. Suppose C1, C2, A1 hold. For any $\boldsymbol { \mathsf { \Sigma } } ^ { \prime } \in [ 1 / M , M ] ^ { n }$ , it follows that
|
| 576 |
+
|
| 577 |
+
• (Asymptotic) $\mathrm { l i m } _ { \lambda \to 0 } \gamma _ { \lambda } ( \mathbf { w } ) \gamma ^ { * }$ .
|
| 578 |
+
|
| 579 |
+
• (Finite steps) There exists $\begin{array} { r c l } { { a } } & { { \lambda } } & { { : = } } & { { \lambda ( r , \alpha , \gamma ^ { * } , \mathbf { w } , c ) } } \end{array}$ such that for $\pmb { \theta } ^ { \prime } ( \mathbf { w } )$ with $L _ { \lambda } ( \pmb \theta ^ { \prime } ( \mathbf w ) ; \mathbf w ) \leq \tau L _ { \lambda } ( \pmb \theta _ { \lambda } ( \mathbf { w } ) ; \mathbf { w } )$ and $\tau \leq 2$ , the associated margin $\tilde { \gamma } ( \pmb { \theta } ^ { \prime } ( \mathbf { w } ) )$ satisfies $\begin{array} { r } { \tilde { \gamma } ( \pmb { \theta } ^ { \prime } ( \mathbf { w } ) ) \geq c \cdot \frac { \gamma ^ { * } } { \tau ^ { \alpha / r } } } \end{array}$ , where $\textstyle { \frac { 1 } { 1 0 } } \leq c < 1$
|
| 580 |
+
|
| 581 |
+
# Proof of the Asymptotic part:
|
| 582 |
+
|
| 583 |
+
Proof. We first take consider the exponential loss $\ell ( u ) = \exp ( - u )$ . The log loss $\ell ( u ) = \log ( 1 +$ $\exp ( - u ) )$ can be shown in a similar fashion. Suppose the weights $\mathbf { w } = ( w _ { 1 } , \dots w _ { n } )$ are normalized so that $\textstyle \sum _ { i = 1 } ^ { n } w _ { i } = 1$ and $w _ { i } \geq 0$ . Consider
|
| 584 |
+
|
| 585 |
+
$$
|
| 586 |
+
\begin{array} { r c l } { L _ { \lambda } ( A \pmb \theta ; \mathbf { w } ) } & { = } & { \displaystyle \sum _ { i = 1 } ^ { n } w _ { i } \exp ( - A ^ { \alpha } \cdot y _ { i } f ( \pmb \theta ; \mathbf { x } _ { i } ) ) + \lambda A ^ { r } \| \pmb \theta \| ^ { r } } \\ & { \leq } & { \displaystyle \exp ( - A ^ { \alpha } \cdot \operatorname* { m a x } _ { i } ( y _ { i } f ( \pmb \theta ; \mathbf { x } _ { i } ) ) ) + \lambda A ^ { r } \| \pmb \theta \| ^ { r } , } \end{array}
|
| 587 |
+
$$
|
| 588 |
+
|
| 589 |
+
where $A > 0$ , and we disregard the $1 / n$ term in $L _ { \lambda }$ for the sake of notation. In addition, we have the lower bound
|
| 590 |
+
|
| 591 |
+
$$
|
| 592 |
+
\begin{array} { r l r } { L _ { \lambda } ( A \pmb \theta ; \mathbf { w } ) } & { \geq } & { w _ { i ^ { \prime } } \cdot \mathrm { e x p } ( - A ^ { \alpha } \cdot \underset { i } { \mathrm { m a x } } ( y _ { i } f ( \pmb \theta ; \mathbf { x } _ { i } ) ) ) + \lambda A ^ { r } \| \pmb \theta \| ^ { r } } \\ & { \geq } & { w _ { [ n ] } \cdot \mathrm { e x p } ( - A ^ { \alpha } \cdot \underset { i } { \mathrm { m a x } } ( y _ { i } f ( \pmb \theta ; \mathbf { x } _ { i } ) ) ) + \lambda A ^ { r } \| \pmb \theta \| ^ { r } , } \end{array}
|
| 593 |
+
$$
|
| 594 |
+
|
| 595 |
+
where $i ^ { \prime } = \arg \operatorname* { m i n } _ { i } y _ { i } f ( \pmb { \theta } ; \mathbf { x } _ { i } ) )$ , $w _ { [ n ] } = \operatorname* { m i n } _ { i } w _ { i }$ . By taking $A = \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \|$ , $\pmb { \theta } = \pmb { \theta } ^ { * }$ in the upper bound and $A = 1$ , $\pmb \theta = \pmb \theta _ { \lambda } ( \mathbf { w } )$ in the lower bound , it follows that
|
| 596 |
+
|
| 597 |
+
$$
|
| 598 |
+
\begin{array} { r l } & { w _ { [ n ] } \cdot \exp ( - \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \| ^ { \alpha } \gamma _ { \lambda } ( \mathbf { w } ) ) + \lambda \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \| ^ { r } } \\ { \leq } & { L _ { \lambda } ( \mathbf { w } ) ( \pmb { \theta } _ { \lambda } ( \mathbf { w } ) ) } \\ { \leq } & { L _ { \lambda } ( \mathbf { w } ) ( \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \| \pmb { \theta } ^ { * } ) } \\ { \leq } & { \exp ( - \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \| ^ { \alpha } \cdot \gamma ^ { * } ) + \lambda \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \| ^ { r } . } \end{array}
|
| 599 |
+
$$
|
| 600 |
+
|
| 601 |
+
It implies that
|
| 602 |
+
|
| 603 |
+
$$
|
| 604 |
+
w _ { [ n ] } \cdot \exp ( - \| \pmb \theta _ { \lambda } ( \mathbf w ) \| ^ { \alpha } \gamma _ { \lambda } ( \mathbf w ) ) \leq \exp ( - \| \pmb \theta _ { \lambda } ( \mathbf w ) \| ^ { \alpha } \cdot \gamma ^ { * } ) ,
|
| 605 |
+
$$
|
| 606 |
+
|
| 607 |
+
or
|
| 608 |
+
|
| 609 |
+
$$
|
| 610 |
+
w _ { [ n ] } \cdot \exp ( - \| \pmb { \theta } _ { \lambda } ( \mathbf { w } ) \| ^ { \alpha } ( \gamma ^ { * } - \gamma _ { \lambda } ( \mathbf { w } ) ) ) \leq 1 .
|
| 611 |
+
$$
|
| 612 |
+
|
| 613 |
+
By Claim 1 that $\| \pmb \theta _ { \lambda } ( \mathbf { w } ) \| \infty$ as $\lambda 0$ (or Lemma C.4 in Wei et al. (2019)), the above inequality implies that $\gamma _ { \lambda } ( \mathbf { w } ) \to \gamma ^ { * }$ as $\lambda 0$ . □
|
| 614 |
+
|
| 615 |
+
# Proof of the Finite steps part
|
| 616 |
+
|
| 617 |
+
Proof. Consider $A = [ \textstyle { \frac { 1 } { \gamma ^ { * } } } \log ( ( \gamma ^ { * } ) ^ { r / \alpha } / \lambda ) ] ^ { 1 / \alpha }$ , it follows that
|
| 618 |
+
|
| 619 |
+
$$
|
| 620 |
+
\begin{array} { r c l } { { { \cal L } _ { \lambda } ( \pmb { \theta } ^ { \prime } ( { \bf w } ) , { \bf w } ) } } & { { \leq } } & { { \tau { \cal L } _ { \lambda } ( A \pmb { \theta } ^ { * } ) } } \\ { { } } & { { \leq } } & { { \tau \exp ( - A ^ { \alpha } \cdot \gamma ^ { * } ) + \tau \lambda A ^ { r } \qquad [ \mathrm { U p p e r ~ B o u n d ~ A . 4 . 1 } ] } } \\ { { } } & { { = } } & { { \displaystyle \frac { \lambda \tau } { ( \gamma ^ { * } ) ^ { r / \alpha } } \left( 1 + ( \log ( ( \gamma ^ { * } ) ^ { r / \alpha } / \lambda ) ) ^ { r / \alpha } \right) } } \end{array}
|
| 621 |
+
$$
|
| 622 |
+
|
| 623 |
+
Then by the lower bound A.4.1, it follows that
|
| 624 |
+
|
| 625 |
+
$$
|
| 626 |
+
w _ { [ n ] } \cdot \exp ( - \| \pmb \theta ^ { \prime } ( \mathbf w ) \| ^ { \alpha } \gamma ^ { \prime } ( \mathbf w ) ) \leq L _ { \lambda } ( \pmb \theta ^ { \prime } ( \mathbf w ) , \mathbf w ) \leq A . 1 5 ,
|
| 627 |
+
$$
|
| 628 |
+
|
| 629 |
+
where $\begin{array} { r } { \gamma ^ { \prime } ( \mathbf { w } ) = \operatorname* { m a x } _ { i } y _ { i } f ( \mathbf { w } ^ { \prime } / \Vert \mathbf { w } ^ { \prime } \Vert , \mathbf { x } _ { i } ) } \end{array}$ . Note $\lambda \| \pmb \theta ^ { \prime } ( \mathbf { w } ) \| ^ { r } \leq A . 1 5$ . It implies that
|
| 630 |
+
|
| 631 |
+
$$
|
| 632 |
+
\begin{array} { r l r } { \gamma ^ { \prime } ( \mathbf { w } ) } & { \geq } & { \frac { - \log ( A . 1 5 / w _ { [ n ] } ) } { \| \pmb { \theta } ^ { \prime } ( \mathbf { w } ) \| ^ { \alpha } } } \\ & { \geq } & { \frac { - \log ( \frac { \lambda \tau } { w _ { [ n ] } ( \gamma ^ { * } ) ^ { r / \alpha } } ( 1 + ( \log ( ( \gamma ^ { * } ) ^ { r / \alpha } / \lambda ) ) ^ { r / \alpha } ) ) } { \frac { \tau ^ { \alpha / r } } { \gamma ^ { * } } ( 1 + ( \log ( ( \gamma ^ { * } ) ^ { r / \alpha } / \lambda ) ) ^ { r / \alpha } ) ^ { \alpha / r } } } \end{array}
|
| 633 |
+
$$
|
| 634 |
+
|
| 635 |
+
Note that the numerator is at the scale $\log ( { \frac { 1 } { \lambda } } / \log { \frac { 1 } { \lambda } } )$ and the denominator is at the scale $\log { \frac { 1 } { \lambda } }$ . So for sufficiently small $\lambda = \lambda ( r , \alpha , \gamma ^ { * } , \mathbf { w } , c )$ , we have $\begin{array} { r } { \gamma ^ { \prime } ( \mathbf { w } ) \geq c \cdot \frac { \gamma ^ { * } } { \tau ^ { \alpha / r } } } \end{array}$ , where $\textstyle { \frac { 1 } { 1 0 } } \leq c < 1$ . We leave the details of finding out the dependency of $\lambda ( r , \alpha , \gamma ^ { * } , \mathbf { w } , c )$ on c to the readers, which is simply the basic analysis. □
|
| 636 |
+
|
| 637 |
+
# A.4.2 PROOF OF THEOREM 1
|
| 638 |
+
|
| 639 |
+
When the training distribution $p _ { \mathrm { t r a i n } }$ deviates from the testing distribution $p _ { \mathrm { t e s t } }$ , we develop the geof ralization bound that characterizes this deviation.from the training data and the testing data. Let $p _ { s }$ $p _ { t }$ ities and $\mathbf { x }$ $\begin{array} { r } { D ( P _ { t } \| P _ { s } ) = \int \big ( ( \frac { p _ { t } ( x ) } { p _ { s } ( x ) } ) ^ { 2 } - 1 \big ) p _ { s } ( x ) d x } \end{array}$ $\begin{array} { r } { \eta ( \mathbf { x } _ { i } ) = \frac { p _ { t } ( \mathbf { x } _ { i } ) } { p _ { s } ( \mathbf { x } _ { i } ) } } \end{array}$ . We first restate Theorem 1:
|
| 640 |
+
|
| 641 |
+
Theorem A.1. Assume $\sigma$ is 1-Lipschitz and 1-positive homogeneous. Then with probability at least $1 - \delta$ , we have
|
| 642 |
+
|
| 643 |
+
$$
|
| 644 |
+
\begin{array} { r l } { \mathbf { \widetilde { \mathbf { \Gamma } } } _ { ( \mathbf { x } , y ) \sim p _ { t e r t } } ^ { \mathfrak { p } } \left( y f ^ { N N } ( \pmb { \theta } ( \mathbf { w } ) , \mathbf { x } ) \leq 0 \right) \leq } & { } \\ { \underbrace { \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) \mathbf { I } \big ( y _ { i } f ^ { N N } ( \pmb { \theta } ( \mathbf { w } ) / \| \pmb { \theta } ( \mathbf { w } ) \| , \mathbf { x } _ { i } ) < \gamma \big ) } _ { ( I ) } + \underbrace { \frac { C \cdot \sqrt { D ( P _ { t } | | P _ { s } ) + 1 } } { \gamma \cdot H ^ { ( H - 1 ) / 2 } \sqrt { n } } } _ { ( I I ) } + \epsilon ( \gamma , n , \delta ) , } \end{array}
|
| 645 |
+
$$
|
| 646 |
+
|
| 647 |
+
where $( I )$ is the empirical risk, $( I I )$ reflects the compounding effect of the model complexity of the class of $H$ -layer neural networks and the deviation of the target distribution from the source distribution , $\begin{array} { r } { \epsilon ( \gamma , n , \delta ) = \sqrt { \frac { \log \log _ { 2 } \frac { 4 C } { \gamma } } { n } } + \sqrt { \frac { \log ( 1 / \delta ) } { n } } } \end{array}$ is a small quantity compared to $( I )$ and $( I I )$ . Here $C : = \operatorname* { s u p } _ { \mathbf { x } } \left\| \mathbf { x } \right\|$ ; $\gamma$ is any positive value.
|
| 648 |
+
|
| 649 |
+
To prove Theorem A.1, we first establish a few lemmas.
|
| 650 |
+
|
| 651 |
+
Lemma A.6. Consider an arbitrary function class $\mathcal { F }$ such that $\forall f \in { \mathcal { F } }$ we have $\begin{array} { r } { \sum _ { \mathbf { x } \in \mathcal { X } } | f ( \mathbf { x } ) | \le C } \end{array}$ Then, with probability at least $1 - \delta$ over the sample, for all margins $\gamma > 0$ and all $\bar { f } \in \mathcal { F }$ we have,
|
| 652 |
+
|
| 653 |
+
$$
|
| 654 |
+
\begin{array} { r l } & { \displaystyle \mathbb { P } _ { p _ { ( \mathbf { x } , y ) \sim p _ { t e t } } } \Big ( y f ( \mathbf { x } ) \le 0 \Big ) } \\ & { \le \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) \mathbf { I } \big ( y _ { i } f ( \mathbf { x } _ { i } ) < \gamma \big ) + 4 \frac { \mathcal { R } _ { n , \eta } ( \mathcal { F } ) } { \gamma } + \sqrt { \frac { \log ( \log _ { 2 } \frac { 4 C } { \gamma } ) } { n } } + \sqrt { \frac { \log ( 1 / \delta ) } { 2 n } } , } \end{array}
|
| 655 |
+
$$
|
| 656 |
+
|
| 657 |
+
where $\begin{array} { r } { \mathcal { R } _ { n , \eta } ( \mathcal { F } ) = \mathbb { E } \Big [ \operatorname* { s u p } _ { f \in \mathcal { F } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) f ( \mathbf { x } _ { i } ) \epsilon _ { i } \Big ] } \end{array}$ is the weighted Rademacher complexity $( \epsilon _ { i } ^ { \phantom { } } s$ are i.i.d Rademacher variables).
|
| 658 |
+
|
| 659 |
+
Proof. This lemma is adapted from Theorem 1 of Koltchinskii et al. (2002) by considering the deviation of the testing distribution from the training distribution. Then it is obtained following Theorem 5 of Kakade et al. (2009). □
|
| 660 |
+
|
| 661 |
+
Lemma A.7. Let $\mathcal { F } _ { H }$ be the class of real-valued networks of depth $H$ over the domain $\mathcal { X }$ , where each parameter matrix $W _ { h }$ has Frobenius norm at most $M _ { F } ( h )$ , and with an activation that is 1-Lipschitz, positive-homogeneous. Then,
|
| 662 |
+
|
| 663 |
+
$$
|
| 664 |
+
\mathcal { R } _ { n , \eta } ( \mathcal { F } _ { H } ) \leq \frac { C \cdot \sqrt { D ( P _ { t } | | P _ { s } ) + 1 + o ( \frac { 1 } { \sqrt { n } } ) } \cdot ( \sqrt { 2 \log { 2 H } } + 1 ) } { \sqrt { n } } \prod _ { h = 1 } ^ { H } M _ { F } ( h ) ,
|
| 665 |
+
$$
|
| 666 |
+
|
| 667 |
+
where $C : = \operatorname* { s u p } _ { x \in { \mathcal { X } } } \| \mathbf { x } \|$
|
| 668 |
+
|
| 669 |
+
Proof. From Theorem 1 of Golowich et al. (2018), we arrive at
|
| 670 |
+
|
| 671 |
+
$$
|
| 672 |
+
n \mathcal { R } ( n , \eta ) ( \mathcal { F } _ { H } ) \leq \frac { 1 } { \lambda } \log \Big ( 2 ^ { H } \cdot \mathbb { E } _ { \epsilon } \Big ( M \lambda \| \sum _ { i = 1 } ^ { n } \epsilon _ { i } \eta ( \mathbf { x } _ { i } ) \mathbf { x } _ { i } \| \Big ) \Big ) ,
|
| 673 |
+
$$
|
| 674 |
+
|
| 675 |
+
where $\begin{array} { r } { M = \prod _ { h = 1 } ^ { H } M _ { F } ( h ) } \end{array}$ . Consider $\begin{array} { r } { Z : = M \cdot \| \sum _ { i = 1 } ^ { n } \epsilon _ { i } \eta ( \mathbf { x } _ { i } ) \mathbf { x } _ { i } \| } \end{array}$ that is a random function of the $n$ Rademacher variables. Then
|
| 676 |
+
|
| 677 |
+
$$
|
| 678 |
+
{ \frac { 1 } { \lambda } } \log \left\{ 2 ^ { H } \mathbb { E } \exp ( \lambda Z ) \right\} = { \frac { H \log ( 2 ) } { \lambda } } + { \frac { 1 } { \lambda } } \log \left\{ \mathbb { E } \exp \lambda ( Z - \mathbb { E } Z ) \right\} + \mathbb { E } Z .
|
| 679 |
+
$$
|
| 680 |
+
|
| 681 |
+
By Jensen’s inequality, we have
|
| 682 |
+
|
| 683 |
+
$$
|
| 684 |
+
\mathbb { E } [ Z ] \leq M \sqrt { \mathbb { E } _ { \epsilon } \| \sum _ { i = 1 } ^ { n } \epsilon _ { i } \eta ( \mathbf { x } _ { i } ) \mathbf { x } _ { i } \| ^ { 2 } } = M \sqrt { \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) ^ { 2 } \| \mathbf { x } _ { i } \| ^ { 2 } } .
|
| 685 |
+
$$
|
| 686 |
+
|
| 687 |
+
In addition, we note that
|
| 688 |
+
|
| 689 |
+
$$
|
| 690 |
+
Z ( \epsilon _ { 1 } , \dots , \epsilon _ { i } , \dots , \epsilon _ { n } ) - Z ( \epsilon _ { 1 } , \dots , - \epsilon _ { i } , \dots , \epsilon _ { n } ) \leq 2 M \eta ( \mathbf { x } _ { i } ) \| \mathbf { x } _ { i } \| .
|
| 691 |
+
$$
|
| 692 |
+
|
| 693 |
+
By the bounded-difference condition (Boucheron et al., 2013), $Z$ is a sub-Gaussian with variance factor $\begin{array} { r } { v = \frac { 1 } { 4 } \sum _ { i = 1 } ^ { n } ( 2 M \eta ( \mathbf { x } _ { i } ) \| \mathbf { x } _ { i } \| ) ^ { 2 } = M ^ { 2 } \sum _ { i = 1 } ^ { n } \eta ( x _ { i } ) ^ { 2 } \| \mathbf { x } _ { i } \| ^ { 2 } } \end{array}$ . So
|
| 694 |
+
|
| 695 |
+
$$
|
| 696 |
+
\frac { 1 } { \lambda } \{ \mathbb { E } \exp \lambda ( Z - \mathbb { E } Z ) \} \leq \frac { \lambda M ^ { 2 } \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) ^ { 2 } \| \mathbf { x } _ { i } \| ^ { 2 } } { 2 } .
|
| 697 |
+
$$
|
| 698 |
+
|
| 699 |
+
Taking $\begin{array} { r } { \lambda = \frac { \sqrt { 2 \log ( 2 ) H } } { M \sqrt { \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) ^ { 2 } \| \mathbf { x } _ { i } \| ^ { 2 } } } } \end{array}$ , it follows that
|
| 700 |
+
|
| 701 |
+
$$
|
| 702 |
+
\begin{array} { r l } & { \frac { 1 } { \lambda } \{ 2 ^ { H } \mathbb { E } \exp \lambda Z \} } \\ & { \leq M ( \sqrt { 2 \log ( 2 ) H } + 1 ) \sqrt { \displaystyle \sum _ { i = 1 } ^ { n } \eta ( { \mathbf x } _ { i } ) ^ { 2 } \| { \mathbf x } _ { i } \| ^ { 2 } } \leq \sqrt { n } C M ( \sqrt { 2 \log ( 2 ) H } + 1 ) \sqrt { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \eta ( { \mathbf x } _ { i } ) ^ { 2 } } . } \end{array}
|
| 703 |
+
$$
|
| 704 |
+
|
| 705 |
+
By law of large number, $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \eta ( \mathbf { x } _ { i } ) ^ { 2 } = D ( P _ { t } \| P _ { s } ) + 1 + o \big ( \frac { 1 } { \sqrt { n } } \big ) } \end{array}$ . The desired result follows.
|
| 706 |
+
|
| 707 |
+
Lemma A.8. Suppose $f ^ { N N } ( \pmb { \theta } , \cdot )$ is a $H$ -layer neural network and $C = \operatorname* { s u p } _ { x \in { \mathcal { X } } } \| x \| _ { 2 }$ . Then, There exists another parameter $\tilde { \pmb { \theta } }$ s.t. $f ^ { N N } ( \pmb { \theta } / \| \pmb { \theta } \| , \mathbf { x } ) = f ^ { N N } ( \tilde { \pmb { \theta } } , \mathbf { x } )$ , for any $x \in \mathcal { X }$ and that
|
| 708 |
+
|
| 709 |
+
• the parameter matrix of each layer of $f ^ { N N } ( \tilde { \pmb { \theta } } , \cdot )$ has a Frobenius norm no larger than $1 / { \sqrt { H } }$ . $\bullet \ \operatorname* { s u p } _ { x \in { \mathcal { X } } } f ^ { N N } ( \widetilde { \pmb { \theta } } , \cdot ) \leq C .$
|
| 710 |
+
|
| 711 |
+
Proof. This lemma are obtained by reorganizing the proof of Lemma D3 and the proof of Proposition D.1 of Wei et al. (2019). □
|
| 712 |
+
|
| 713 |
+
# Proof of Theorem A.1
|
| 714 |
+
|
| 715 |
+
Proof. Theorem A.1 follows by Lemma A.6, A.7 and A.8.
|
md/train/cR91FAodFMe/cR91FAodFMe.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO SET WAYPOINTS FOR AUDIO-VISUAL NAVIGATION
|
| 2 |
+
|
| 3 |
+
Changan Chen1,2 Sagnik Majumder1 Ziad Al-Halah1 Ruohan Gao1,2
|
| 4 |
+
Santhosh K. Ramakrishnan1,2 Kristen Grauman1,2
|
| 5 |
+
1UT Austin 2Facebook AI Research
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In audio-visual navigation, an agent intelligently travels through a complex, unmapped 3D environment using both sights and sounds to find a sound source (e.g., a phone ringing in another room). Existing models learn to act at a fixed granularity of agent motion and rely on simple recurrent aggregations of the audio observations. We introduce a reinforcement learning approach to audio-visual navigation with two key novel elements: 1) waypoints that are dynamically set and learned end-to-end within the navigation policy, and 2) an acoustic memory that provides a structured, spatially grounded record of what the agent has heard as it moves. Both new ideas capitalize on the synergy of audio and visual data for revealing the geometry of an unmapped space. We demonstrate our approach on two challenging datasets of real-world 3D scenes, Replica and Matterport3D. Our model improves the state of the art by a substantial margin, and our experiments reveal that learning the links between sights, sounds, and space is essential for audio-visual navigation. Project: http://vision.cs.utexas.edu/ projects/audio_visual_waypoints.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Intelligent robots must be able to move around efficiently in the physical world. In addition to geometric maps and planning, work in embodied AI shows the promise of agents that learn to map and navigate. Sensing directly from egocentric images, they jointly learn a spatial memory and navigation policy in order to quickly reach target locations in novel, unmapped 3D environments (Gupta et al., 2017b;a; Savinov et al., 2018; Mishkin et al., 2019). High quality simulators have accelerated this research direction to the point where policies learned in simulation can (in some cases) successfully translate to robotic agents deployed in the real world (Gupta et al., 2017a; Müller et al., 2018; Chaplot et al., 2020b; Stein et al., 2018).
|
| 14 |
+
|
| 15 |
+
Much current work centers around visual navigation by a PointGoal agent that has been told where to find the target (Gupta et al., 2017a; Sax et al., 2018; Mishkin et al., 2019; Savva et al., 2019; Chaplot et al., 2020b). However, in the recently introduced AudioGoal task, the agent must use both visual and auditory sensing to travel through an unmapped 3D environment to find a sound-emitting object, without being told where it is (Chen et al., 2020; Gan et al., 2020). As a learning problem, AudioGoal not only has strong motivation from cognitive and neuroscience (Gougoux et al., 2005; Lessard et al., 1998), it also has compelling real-world significance: a phone is ringing somewhere upstairs; a person is calling for help from another room; a dog is scratching at the door to go out.
|
| 16 |
+
|
| 17 |
+
What role should audio-visual inputs play in learning to navigate? There are two existing strategies. One employs deep reinforcement learning to learn a navigation policy that generates step-by-step actions (TurnRight, MoveForward, etc.) based on both modalities (Chen et al., 2020). This has the advantage of unifying the sensing modalities, but can be inefficient when learning to make long sequences of individual local actions. The alternative approach separates the modalities—treating the audio stream as a beacon that signals the goal location, then planning a path to that location using a visual mapper (Gan et al., 2020). This strategy has the advantage of modularity, but the disadvantage of restricting audio’s role to localizing the target. Furthermore, both existing methods make strong assumptions about the granularity at which actions should be predicted, either myopically for each step (0.5 to $1 \mathrm { m }$ ) (Chen et al., 2020) or globally for the final goal location (Gan et al., 2020).
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Waypoints for audio-visual navigation: Given egocentric audio-visual sensor inputs (depth and binaural sound), the proposed agent builds up both geometric and acoustic maps (top right) as it moves in the unmapped environment. The agent learns encodings for the multi-modal inputs together with a modular navigation policy to find the sounding goal (e.g., phone ringing in top left corner room) via a series of dynamically generated audio-visual waypoints. For example, the agent in the bedroom may hear the phone ringing, identify that it is in another room, and decide to first exit the bedroom. It may then narrow down the phone location to the dining room, decide to enter it, and subsequently find it. Whereas existing hierarchical navigation methods rely on heuristics to determine subgoals, our model learns a policy to set waypoints jointly with the navigation task.
|
| 21 |
+
|
| 22 |
+
We introduce a new approach for AudioGoal navigation where the agent instead predicts non-myopic actions with self-adaptive granularity. Our key insight is to learn to set audio-visual waypoints: the agent dynamically sets intermediate goal locations based on its audio-visual observations and partial map—and does so in an end-to-end manner with learning the navigation task. Intuitively, it is often hard to directly localize a distant sound source from afar, but it can be easier to identify the general direction (and hence navigable path) along which one could move closer to that source. See Figure 1.
|
| 23 |
+
|
| 24 |
+
Both the audio and visual modalities are critical to identifying waypoints in an unmapped environment. Audio input suggests the general goal direction; visual input reveals intermediate obstacles and free spaces; and their interplay indicates how the geometry of the 3D environment is warping the sounds received by the agent, such that it can learn to trace back to the hidden goal. In contrast, subgoals selected using only visual input are limited to mapped locations or clear line-of-sight paths.
|
| 25 |
+
|
| 26 |
+
To realize our idea, our first contribution is a novel deep reinforcement learning approach for AudioGoal navigation with audio-visual waypoints. The model is hierarchical, with an outer policy that generates waypoints and an inner module that plans to reach each waypoint. Hierarchical policies for 3D navigation are not new, e.g., (Chaplot et al., 2020b; Stein et al., 2018; Bansal et al., 2019; Caley et al., 2016). However, whereas existing visual navigation methods employ heuristics to define subgoals, the proposed agent learns to set useful subgoals in an end-to-end fashion for the navigation task. This is a new idea for 3D visual navigation subgoals in general, not specific to audio goals (cf. Sec. 2). As a second technical contribution, we introduce an acoustic memory to record what the agent hears as it moves, complementing its visual spatial memory. Whereas existing models aggregate audio evidence purely based on an unstructured memory (GRU), our proposed acoustic map is structured, interpretable, and integrates audio observations throughout the reinforcement learning pipeline.
|
| 27 |
+
|
| 28 |
+
We demonstrate our approach on the complex 3D environments of Replica and Matterport3D using SoundSpaces audio (Chen et al., 2020). It outperforms the state of the art for AudioGoal navigation by a substantial margin (8 to 49 points in SPL on heard sounds), and generalizes much better to the challenging cases of unheard sounds, noisy audio, and distractor sounds. Our results show learning to set waypoints in an end-to-end fashion outperforms current subgoal approaches, while the proposed acoustic memory helps the agent set goals more intelligently.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Learning to navigate in 3D environments Robots can navigate complex real-world environments by mapping the space with 3D reconstruction algorithms (i.e., SfM) and then planning their movements (Thrun, 2002; Fuentes-Pacheco et al., 2012). While many important advances follow this line of work, ongoing work also shows the promise of learning map encodings and navigation policies directly from egocentric RGB-(D) observations (Gupta et al., 2017a;b; Savinov et al., 2018; Mishkin et al., 2019). Current methods focus on the so-called PointGoal task: the agent is given a 2D displacement vector pointing to the goal location and must navigate through free space to get there.
|
| 33 |
+
|
| 34 |
+
The agent relies on visual input and (typically) GPS odometry (Gupta et al., 2017a; Mishkin et al., 2019; Savva et al., 2019; Sax et al., 2018; Chaplot et al., 2020b).
|
| 35 |
+
|
| 36 |
+
In contrast, the recently introduced AudioGoal task requires the agent to navigate to a sound source goal using vision and audio (Chen et al., 2020; Gan et al., 2020). Importantly, unlike PointGoal, AudioGoal does not provide a displacement vector indicating the goal. Existing AudioGoal methods either learn a policy to select the best immediate next action using the multi-modal inputs (Chen et al., 2020), or predict the final goal location from the audio input and then follow a planned path to it based on visual inputs (Gan et al., 2020). Our ideas for audio-visual waypoints and an acoustic map are entirely novel, and lead to a significant improvement in performance.
|
| 37 |
+
|
| 38 |
+
Navigation with intermediate goals Current methods often learn policies that reward moving to the final goal location using a step-by-step action space (e.g., TurnRight, MoveForward, Stop) (Gupta et al., 2017a; Mirowski et al., 2016; Mishkin et al., 2019; Savva et al., 2019). However, recent work explores ways to incorporate subgoals or waypoints for PointGoal navigation. Taking inspiration from hierarchical learning (Bacon et al., 2017; Nachum et al., 2018), the general idea is to select a subgoal, use planning (or a local policy) to navigate to the current subgoal, and repeat (Stein et al., 2018; Bansal et al., 2019; Chaplot et al., 2020b; Nair & Finn, 2020; Wu et al., 2020; Caley et al., 2016). For example, Bansal et al. (2019) apply a CNN to the RGB input to predict the next waypoint—the ground truth of which is collected using trajectory optimization—then apply model-based planning. Active Neural SLAM (ANS) (Chaplot et al., 2020b) plans a path to the point goal (or a predicted long-term exploration goal) using a partial map of the environment, generating each subgoal to be within $0 . 2 5 \mathrm { m }$ of the agent using an analytic shortest path planner. We stress that for navigation ANS does no global policy prediction; the PointGoal coordinates are simply fed in as the global goal.
|
| 39 |
+
|
| 40 |
+
The modular nature of these methods resonates with the proposed model. However, there are several important differences. First, we tackle AudioGoal, not PointGoal, which means our top-level module is not given the goal location and must instead learn how to direct the agent based on the audio inputs. Second, we introduce audio-visual subgoals; whereas visual subgoals focus on visible obstacle avoidance, audio-visual waypoints benefit from the wide reach of audio. For example, a visual subgoal may consider either of two exit doors as equally good, whereas an audio-visual subgoal prefers the one from which greater sound appears to be emerging. Third, a key novel element of our approach is to learn to generate navigation subgoals in an end-to-end fashion. In contrast, prior work relies on heuristics like selecting frontiers (Caley et al., 2016; Stein et al., 2018) or points along the shortest collision-free path (Bansal et al., 2019; Chaplot et al., 2020b) to define subgoals. Rather than use heuristics, our waypoints are directly predicted by the policy. This is a novel technical contribution to visual navigation independent of the audio-visual setting, as it frees the agent to dynamically identify subgoals driven by the ultimate navigation goal. Some recent work in hierarchical reinforcement learning (HRL) (Nachum et al., 2018; Li et al., 2019; Levy et al., 2019) explores ways to predict subgoals with a high-level policy end-to-end, but they train and test policies in the same environments with artificial low-dimensional state inputs, whereas we train our agent to generalize to unseen realistic 3D environments with visual and auditory sensory inputs.
|
| 41 |
+
|
| 42 |
+
Visual semantic memory and mapping Learning-based visual mapping algorithms (Henriques & Vedaldi, 2018; Savinov et al., 2018; Gupta et al., 2017b;a) show exciting promise to overcome the limits of purely geometric maps. A learned map can encode semantic information beyond 3D points while being trained with the agent’s ultimate task (like navigation). Recent work explores memories that spatially index learned RGB-D features (Tung et al., 2019; Henriques & Vedaldi, 2018; Gupta et al., 2017a), build a topological memory with visually distinct nodes (Savinov et al., 2018; Nagarajan et al., 2020; Chaplot et al., 2020a), or use attention models over stored visual embeddings (Fang et al., 2019). Expanding this line of work, we introduce the first multi-modal spatial memory. It encodes both visual and acoustic observations registered with the agent’s movement along the ground plane. We show that the multi-modal memory is essential for the agent to produce good action sequences.
|
| 43 |
+
|
| 44 |
+
Sound localization Robotics systems localize sound sources with microphone arrays (Nakadai & Nakamura, 1999; Rascon & Meza, 2017), and active control can improve localization (Nakadai et al., 2000; Wang et al., 2014). The geometry of a room can be in part sensed by audio, as explored with ideas for echolocation (Dokmanic et al., 2013; Christensen et al., 2020; Gao et al., 2020). In 2D video frames, methods learn to localize sounds based on their consistent audio-visual association (Hershey & Movellan, 2000; Tian et al., 2018; Senocak et al., 2018; Arandjelovic & Zisserman, 2018). Unlike any of the above, we investigate the audio-visual navigation problem, where an agent learns to move efficiently towards a sound source in a 3D environment based on both audio and visual cues.
|
| 45 |
+
|
| 46 |
+
# 3 APPROACH
|
| 47 |
+
|
| 48 |
+
We consider the task of AudioGoal navigation (Chen et al., 2020; Gan et al., 2020). In this task the agent moves within a 3D environment and receives a sensor observation $O _ { t }$ at each time step $t$ from its camera (depth) and binaural microphones. The environment is unmapped at the beginning of the navigation episode; the agent has to accumulate observations to understand the scene geometry while navigating. Unlike the common PointGoal task, for AudioGoal the agent does not know the location of the goal (i.e., no GPS signal or displacement vector pointing to the goal is available). The agent must use the sound emitted by the audio source to locate and navigate successfully to the goal.
|
| 49 |
+
|
| 50 |
+
We introduce a novel navigation approach that predicts intermediate waypoints to reach the goal efficiently. Our approach is composed of three main modules (Fig. 2). Given visual and audio inputs, our model 1) encodes these cues using a perception and mapping module, then 2) predicts a waypoint, and finally 3) plans and executes a sequence of actions that bring the agent to the predicted waypoint. The agent repeats this process until it predicts the goal has been reached and executes the Stop action.
|
| 51 |
+
|
| 52 |
+
# 3.1 3D ENVIRONMENTS AND AUDIO-VISUAL SIMULATOR
|
| 53 |
+
|
| 54 |
+
We use the AI-Habitat simulator (Savva et al., 2019) with the publicly available Replica (Straub et al., 2019) and Matterport3D (Chang et al., 2017) environments together with the public SoundSpaces audio simulations (Chen et al., 2020). The 18 Replica environments are meshes constructed from real-world scans of apartments, offices, hotels, and rooms. The 85 Matterport3D environments are real-world homes and other indoor environments with 3D meshes and image scans.1 The agent can travel through the spaces while receiving real-time egocentric visual and audio observations. Using SoundSpaces’s room impulse responses (RIR), we can place an audio source in the 3D environment, then simulate realistic sounds at each location in the scene at a spatial resolution of $0 . 5 \mathrm { m }$ for Replica and $1 \mathrm { m }$ for Matterport3D. These state-of-the-art renderings capture how sound propagates and interacts with the surrounding geometry and surface materials, modeling all of the major features of the RIR: direct sound, early specular/diffuse reflections, reverberation, binaural spatialization, and frequency dependent effects from materials and air absorption (see Chen et al. (2020) for details). We experiment with 102 everyday sounds (details in Supp).
|
| 55 |
+
|
| 56 |
+
The simulator maintains a navigability graph of the environment (unknown to the agent). The agent can only move from one node to another if there is an edge connecting them and the agent is facing that direction. The action space $\mathcal { A }$ has four actions: MoveForward, TurnLeft, TurnRight and Stop.
|
| 57 |
+
|
| 58 |
+
We use these real-world image scans and highly realistic audio simulations to test our ideas in a reproducible evaluation setting. Please see the Supp video to gauge their realism. Our experiments further push the realism by considering distractor sounds and noisy sensors (cf. Sec. 4). We leave as future work to translate policies to a real-world robot, for which we are encouraged by recent sim2real attempts (Gupta et al., 2017a; Müller et al., 2018; Chaplot et al., 2020b; Stein et al., 2018).
|
| 59 |
+
|
| 60 |
+
# 3.2 PERCEPTION AND MAPPING
|
| 61 |
+
|
| 62 |
+
Visual perception At each time step $t$ , we extract visual cues from the agent’s first-person depth view, which is more effective for map construction than RGB (Chaplot et al., 2020b; Chen et al., 2019). First, we backproject the depth image into the world coordinates using the camera’s intrinsic parameters to compute the local scene’s 3D point cloud. Then, we project these points to a 2D top-down egocentric local occupancy map $L _ { t }$ of size $3 \times 3$ meters in front of the agent, corresponding to the typical distance at which the real-world sensor is reliable. The map has two channels, one for the occupied/free space and one for explored/unexplored areas. A map cell is deemed occupied if it has a 3D point that is higher than $0 . 2 \mathrm { m }$ and lower than $1 . 5 \mathrm { m }$ , and it is deemed explored if any 3D point is projected into that cell (results are tolerant to noisy depth; see Supp). We update an allocentric geometric map $G _ { t }$ by transforming $L _ { t }$ with respect to the agent’s last pose change and then averaging it with the corresponding values of $G _ { t - 1 }$ . Cells with a value above 0.5 are considered occupied or explored. See top branch in Figure 2.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Model architecture. Our audio-visual navigation model uses the egocentric stream of depth images and binaural audio $( B _ { t } )$ to learn geometric $( G _ { t } )$ and acoustic $\left( A _ { t } \right)$ maps for the 3D environment. The multi-modal cues and partial maps (left) inform the RL policy’s prediction of intermediate waypoints (center). For each waypoint, the agent plans the shortest navigable path (right). From this sequence of waypoints, the agent reaches the final AudioGoal efficiently.
|
| 66 |
+
|
| 67 |
+
Acoustic perception At each time step the agent receives binaural sound $B _ { t }$ represented by spectrograms for the right and left ear, a matrix representation of frequencies of audio signals as a function of time (second branch in Figure 2; see Supp for spectrogram details). Beyond encoding the current sounds, we also introduce an acoustic memory. The acoustic memory is a map $A _ { t }$ indexed on the ground plane like $G _ { t }$ that aggregates the audio intensity over time in a structured manner. It records a moving average of direct sound intensity solely at positions visited by the agent. See the third branch in Figure 2. Note that a map of audio intensities reveals both distance and directional information about the sound source, since the gradient in audio intensity helps indicate the goal direction. The acoustic map and $B _ { t }$ provide spatially grounded information about both the environment and the goal: the walls and other major surfaces influence the sound received by the agent at any given location, while the sound source at the goal gives a coarse sense of direction when the agent is far away. This directional cue gets increasingly precise as the agent approaches the goal.
|
| 68 |
+
|
| 69 |
+
# 3.3 AUDIO-VISUAL WAYPOINT PREDICTOR
|
| 70 |
+
|
| 71 |
+
Both the audio and visual inputs carry complementary information to set good waypoints en route to the audio goal. While the audio signals $B _ { t }$ (binaural inputs) and $A _ { t }$ (acoustic memory) inform the agent of the general direction of the goal and hint at the room geometry, the visual signal in the form of the occupancy map $G _ { t }$ allows spatial localization of the waypoint and helps to avoid obstacles. Recall Figure 1, where the agent in the bedroom needs to reach a phone ringing in another room.
|
| 72 |
+
|
| 73 |
+
We learn three encoders to represent the inputs: $g _ { t } \ = \ f _ { g } ( G _ { t } )$ , $b _ { t } = f _ { b } ( B _ { t } )$ and $a _ { t } = f _ { a } ( A _ { t } ) $ . Functions $f _ { g }$ and $f _ { a }$ first transform the geometric and acoustic maps $G _ { t }$ and $A _ { t }$ ) such that the agent is located at the center of the map facing upwards and then crop them to size $s _ { g } \times s _ { g }$ and $s _ { a } \times s _ { a }$ , respectively. Each function has a convolutional neural network (CNN) in the end to extract features (details in Supp). We concatenate the three vectors $g _ { t }$ , $b _ { t }$ and $a _ { t }$ to obtain the full audio-visual feature, and pass it into a gated recurrent neural network (GRU) (Chung et al., 2015). See Figure 2.
|
| 74 |
+
|
| 75 |
+
Our reinforcement learning waypoint predictor has an actor-critic architecture. It takes the hidden state $h _ { t }$ of the GRU and predicts a probability distribution $\pi ( W _ { t } | h _ { t } )$ over possible waypoints. $W _ { t }$ is the action map of size $s _ { w } \times s _ { w }$ and represents the candidate waypoints in the area centered around the agent.2 We mask the output of the policy with the local occupancy map to ensure that the model selects waypoints that are in free spaces. We sample a waypoint $w _ { t } = ( \Delta x , \Delta y )$ from $W _ { t }$ according to the policy’s predicted probability distribution. The waypoint is relative to the agent’s current position and is passed to the planner (see Sec. 3.4).
|
| 76 |
+
|
| 77 |
+
This waypoint policy is an important element in our method design. It allows the agent to dynamically adjust its intermediate goals according to what it currently sees and hears. Unlike existing AV navigation methods, our waypoints guide the agent at a variable granularity, as opposed to fixing its actions to myopic next steps (Chen et al., 2020) or a final goal prediction (Gan et al., 2020). Unlike existing visual subgoal approaches, which rely on frontier-based heuristics or points along the shortest path (Chaplot et al., 2020b; Stein et al., 2018; Bansal et al., 2019; Caley et al., 2016), our waypoints are inferred in tight integration with the navigation task. Our results demonstrate the advantages.
|
| 78 |
+
|
| 79 |
+
# 3.4 PATH PLANNER
|
| 80 |
+
|
| 81 |
+
Given the generated waypoint $w _ { t }$ , a shortest-path planner tries to generate a sequence of low-level actuation commands chosen from $\mathcal { A }$ to move the agent to that waypoint. The planner maintains a graph of the scene based on the geometric map $G _ { t }$ and estimates a path from the agent’s current location to $w _ { t }$ using Dijkstra’s algorithm. Unexplored areas in the map are considered free space during planning (Chaplot et al., 2020b). Based on the shortest path, a low-level actuation command is analytically computed. The agent executes the action, gets a new observation $O _ { t }$ , updates both $G _ { t }$ and $A _ { t }$ , and repeats the above procedure until it exits the planning loop.
|
| 82 |
+
|
| 83 |
+
The planning loop breaks under three conditions: 1) the agent reaches the waypoint, 2) the planner could not find a path to the waypoint (in this case the agent executes a random action before breaking the loop), or 3) the agent reaches a planning step limit. The planning step limit is set to mitigate bad waypoint prediction (due to noisy occupancy estimates) or hard-to-reach waypoints (like behind the wall of another room) from derailing the agent from the goal. If the model selects $w _ { t } = ( 0 , 0 )$ (i.e., the agent’s current location), this means that the agent believes it has reached the final goal; the Stop action is then executed and the episode terminates.
|
| 84 |
+
|
| 85 |
+
# 3.5 REWARD AND TRAINING
|
| 86 |
+
|
| 87 |
+
Following typical navigation rewards (Savva et al., 2019; Chen et al., 2020), we reward the agent with $+ 1 0$ if it succeeds in reaching the goal and executing the Stop action there, plus an additional reward of $+ 0 . 2 5$ for reducing the geodesic distance to the goal and an equivalent penalty for increasing it. Finally, we issue a time penalty of $- 0 . 0 1$ per executed action to encourage efficiency. For each waypoint prediction step, the agent is rewarded with the cumulative reward value collected during the last round of planner execution. Altogether, the reward encourages the model to select waypoints that are reachable, far from the current agent position, and on the route to the goal—or to choose the goal itself if it is within reach.
|
| 88 |
+
|
| 89 |
+
All learnable modules are jointly trained and updated every 150 waypoint prediction steps with Proximal Policy Optimization (PPO) (Schulman et al., 2017). The PPO loss consists of a value network loss, policy network loss, and an entropy loss to encourage exploration. Please see Supp for all implementation details.
|
| 90 |
+
|
| 91 |
+
# 4 EXPERIMENTS
|
| 92 |
+
|
| 93 |
+
Environments We test with SoundSpaces for Replica and Matterport environments in the Habitat simulator (Sec. 3.1). We follow the protocol of the SoundSpaces AudioGoal benchmark (Chen et al., 2020), with train/val/test splits of 9/4/5 scenes on Replica and 73/11/18 scenes on Matterport3D. We stress that the test and train/val environments are disjoint, requiring the agent to learn generalizable behaviors. Furthermore, for the same scene splits, we experiment with training and testing on disjoint sounds, requiring the agent to generalize to unheard sounds. For heard-sound experiments, the telephone ringing is the sound source; for unheard, we draw from 102 unique sounds (see Supp).
|
| 94 |
+
|
| 95 |
+
Metrics We evaluate the following navigation metrics: 1) success rate (SR), the fraction of successful episodes, i.e., episodes in which the agent stops exactly at the audio goal location on the grid; 2) success weighted by path length (SPL), the standard metric (Anderson et al., 2018) that weighs successes by their adherence to the shortest path; 3) success weighted by number of actions (SNA), which penalizes rotation in place actions, which do not lead to path changes. Please see Supp for more details on these comprehensive metrics.
|
| 96 |
+
|
| 97 |
+
Table 1: AudioGoal navigation results. Our audio-visual waypoints navigation model (AV-WaN) reaches the goal faster (higher SPL) and it is more efficient (higher SNA) compared to the state-of-the-art. SPL, SR, SNA are shown as percentages. For all metrics, higher is better. (H) denotes a hierarchical model.
|
| 98 |
+
|
| 99 |
+
<table><tr><td></td><td colspan="6">Replica</td><td colspan="6">Matterport3D</td></tr><tr><td></td><td colspan="3">Heard</td><td colspan="3">Unheard</td><td colspan="3">Heard</td><td colspan="3">Unheard</td></tr><tr><td>Model</td><td>SPL</td><td>SR</td><td>SNA</td><td>SPL</td><td>SR</td><td>SNA</td><td>SPL</td><td>SR</td><td>SNA</td><td>SPL</td><td>SR</td><td>SNA</td></tr><tr><td>Random Agent</td><td>4.9</td><td>18.5</td><td>1.8</td><td>4.9</td><td>18.5</td><td>1.8</td><td>2.1</td><td>9.1</td><td>0.8</td><td>2.1</td><td>9.1</td><td>0.8</td></tr><tr><td>Direction Follower (H)</td><td>54.7</td><td>72.0</td><td>41.1</td><td>11.1</td><td>17.2</td><td>8.4</td><td>32.3</td><td>41.2</td><td>23.8</td><td>13.9</td><td>18.0</td><td>10.7</td></tr><tr><td>Frontier Waypoints (H)</td><td>44.0</td><td>63.9</td><td>35.2</td><td>6.5</td><td>14.8</td><td>5.1</td><td>30.6</td><td>42.8</td><td>22.2</td><td>10.9</td><td>16.4</td><td>8.1</td></tr><tr><td>Supervised Waypoints (H)</td><td>59.1</td><td>88.1</td><td>48.5</td><td>14.1</td><td>43.1</td><td>10.1</td><td>21.0</td><td>36.2</td><td>16.2</td><td>4.1</td><td>8.8</td><td>2.9</td></tr><tr><td>Gan et al.</td><td>57.6</td><td>83.1</td><td>47.9</td><td>7.5</td><td>15.7</td><td>5.7</td><td>22.8</td><td>37.9</td><td>17.1</td><td>5.0</td><td>10.2</td><td>3.6</td></tr><tr><td>Chen et al.</td><td>78.2</td><td>94.5</td><td>52.7</td><td>34.7</td><td>50.9</td><td>16.7</td><td>55.1</td><td>71.3</td><td>32.6</td><td>25.9</td><td>40.1</td><td>12.8</td></tr><tr><td>AV-WaN (Ours) (H)</td><td>86.6</td><td>98.7</td><td>70.7</td><td>34.7</td><td>52.8</td><td>27.1</td><td>72.3</td><td>93.6</td><td>54.8</td><td>40.9</td><td>56.7</td><td>30.6</td></tr></table>
|
| 100 |
+
|
| 101 |
+
Existing methods and baselines We compare the following methods (detailed in Supp; see Tab. 3):
|
| 102 |
+
|
| 103 |
+
– Random: an agent that randomly selects each action and signals Stop when it reaches the goal.
|
| 104 |
+
|
| 105 |
+
– Direction Follower: a hierarchical model that sets intermediate goals $K$ meters away in the audio’s predicted direction of arrival (DoA), and repeats. $K$ is estimated through a hyperparameter search on the validation split, which yields $K = 2$ in Replica and $K = 4$ in Matterport. We train a separate classifier based on audio input to predict when this agent should stop.
|
| 106 |
+
|
| 107 |
+
– Frontier Waypoints: a hierarchical model that intersects the predicted DoA with the frontiers of the explored area and selects that point as the next waypoint. Frontier waypoints are commonly used in the visual navigation literature, e.g., (Caley et al., 2016; Stein et al., 2018; Chaplot et al., 2020b), making this a broadly representative baseline for standard practice.
|
| 108 |
+
|
| 109 |
+
– Supervised Waypoints: a hierarchical model that uses the RGB frame and audio spectrogram to predict waypoints in its field of view (FoV) with supervised (non-end-to-end) learning. This model is inspired by Bansal et al. (2019), which learns to predict waypoints in a supervised fashion.
|
| 110 |
+
|
| 111 |
+
– Chen et al. (2020): a state-of-the-art end-to-end AudioGoal RL agent that selects actions using audio-visual observations. It lacks any geometric or acoustic maps. We run the authors’ code.
|
| 112 |
+
|
| 113 |
+
– Gan et al. (2020): a state-of-the-art AudioGoal agent that predicts the audio goal location from binaural spectrograms alone and then navigates with an analytical path planner on an occupancy map it progressively builds by projecting depth images. It uses a separate audio classifier to stop. We adapt the model to improve its performance on Replica and Matterport, since the authors originally tested on a game engine simulator (see Supp).
|
| 114 |
+
|
| 115 |
+
Navigation results We consider two settings: 1) heard sound—train and test on the telephone sound, following (Chen et al., 2020; Gan et al., 2020), and 2) unheard sounds—train and test with disjoint sounds, following (Chen et al., 2020). In both cases, the test environment is always unseen, hence both settings require generalization.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Navigation trajectories on top-down maps vs. all existing AudioGoal methods. Agent path fades from dark blue to light blue as time goes by. Green is the shortest geodesic path in continuous space. All agents have reached the goal. Our waypoint model navigates to the goal more efficiently. The agent’s inputs are egocentric views (Fig. 1); figures show the top-down view for ease of viewing the full trajectories.
|
| 119 |
+
|
| 120 |
+
Table 2: Ablation study for AV-WaN. Results are averaged over 5 test runs; all standard deviations are $\leq 0 . 5$
|
| 121 |
+
|
| 122 |
+
<table><tr><td></td><td colspan="6">Replica</td><td colspan="6">Matterport3D</td></tr><tr><td></td><td colspan="3">Heard</td><td colspan="3">Unheard</td><td colspan="3">Heard</td><td colspan="3">Unheard</td></tr><tr><td>Model</td><td>SPL</td><td>SR</td><td>SNA</td><td>SPL</td><td>SR</td><td>SNA</td><td>SPL</td><td>SR</td><td>SNA</td><td>SPL</td><td>SR</td><td>SNA</td></tr><tr><td>AV-WaN w/o At and Gt</td><td>84.3</td><td>97.8</td><td>69.1</td><td>34.0</td><td>48.6</td><td>25.4</td><td>68.8</td><td>92.1</td><td>52.1</td><td></td><td>20.5 30.4</td><td>15.5</td></tr><tr><td>AV-WaN w/o Gt</td><td>85.1</td><td>97.5</td><td>69.0</td><td>27.0</td><td>45.6</td><td>20.3</td><td>70.2</td><td></td><td>94.0</td><td>52.4</td><td>25.4 45.0</td><td>19.2</td></tr><tr><td>AV-WaN w/o At</td><td>85.7</td><td>98.7</td><td>70.2</td><td>34.5</td><td>63.3</td><td>24.8</td><td>70.2</td><td></td><td>93.6</td><td>53.2</td><td>36.7 53.8</td><td>28.6</td></tr><tr><td>AV-WaN w/o waypoints</td><td>79.8</td><td>95.5</td><td>48.4</td><td>25.5</td><td>38.2</td><td>10.6</td><td>44.3</td><td></td><td>63.2</td><td>20.3</td><td>25.5 40.0</td><td>11.0</td></tr><tr><td>AV-WaN</td><td>86.6</td><td>98.7</td><td>70.7</td><td>34.7</td><td>52.8</td><td>27.1</td><td>72.3</td><td></td><td>93.6</td><td>54.8</td><td>40.9 56.7</td><td>30.6</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Table 1 shows the results. We refer to our model as AV-WaN (Audio-Visual Waypoint Navigation). Random does poorly due to the challenging nature of the AudioGoal task and the complex 3D environments. For the heard sound, AV-WaN strongly outperforms all the other methods—with $8 . 4 \%$ and $2 9 \%$ SPL gains on Replica compared to Chen et al. and Gan et al., and $1 7 . 2 \%$ and $4 9 . 5 \%$ gains on Matterport. This result shows the advantage of our dynamic audio-visual waypoints and structured acoustic map, compared to the myopic action selection in Chen et al. and the final-goal prediction in Gan et al. We find that the RL model of Chen et al. fails when it oscillates around an obstacle. Meanwhile, predicting the final audio goal location, as done by Gan et al., is prone to errors and leads the agent to backtrack or change course often to redirect itself towards the goal. This result emphasizes the difficulty of the audio-visual navigation task itself; simply reducing the task to PointGoal after predicting the goal location from audio (as done in Gan et al.) is much less effective than the proposed model. See Figure 3.
|
| 125 |
+
|
| 126 |
+
Our method also surpasses all three other hierarchical models. This highlights our advantage of directly learning to set waypoints, versus the heuristics used in current hierarchical visual navigation models. Even the Supervised Waypoints model does not generalize as well to unseen environments as AV-WaN. We expect this is due to the narrow definition of the optimal waypoint posed by supervision compared to our model, which learns from its own experience what is the best waypoint for the given navigation task in an end-to-end fashion.
|
| 127 |
+
|
| 128 |
+
In the unheard sounds setting covering 102 sounds (Table 1, right), our method again strongly outperforms all existing methods on both datasets and in almost every metric. The only exception is our $2 . 8 \%$ lower SPL vs. Chen et al. on Replica, though our model still surpasses Chen et al. in terms of SNA on that dataset, meaning we have better accuracy when normalizing for total action count. Absolute performance declines for all methods, though, due to the unfamiliar audio spectrogram patterns. The acoustic memory is critical for this important setting; it successfully abstracts away the specific content of the training sounds to better generalize.
|
| 129 |
+
|
| 130 |
+
Ablations Table 2 shows ablations of the input modalities and the audio-visual waypoint component of our model.3 Removing both the geometric and acoustic maps causes a reduction in performance. This is expected since without $A _ { t }$ and $G _ { t }$ , the model has only the current audio observation $B _ { t }$ to predict the next waypoint. Notably, even this heavily ablated version of our model outperforms the best existing model (Chen et al., 2020) (see Table 1). This shows that our waypoint-based navigation framework itself is more effective than the simpler RL model (Chen et al., 2020), as well as the existing subgoal approaches. Removing just $A _ { t }$ also leads to a drop in performance, which demonstrates the importance of the proposed structured acoustic memory for efficient navigation. Both $A _ { t }$ and $G _ { t }$ are complementary and critical for our model to reach its best performance. Finally, we evaluate the impact of our idea of audio-visual waypoint prediction. We replace the actor network in our model (see Fig. 2 middle) with a linear layer that outputs the action distribution over the four primitive actions in $\mathcal { A }$ . An action sampler directly samples an action from this distribution and executes it in the environment. In this case, there is no need for a planner. Our gains over that ablation confirm the value of the waypoints to our model, even when all other components are fixed.
|
| 131 |
+
|
| 132 |
+
Failure cases We next analyze the unsuccessful episodes for our model (see Supp video for examples). We identify two repeating types of failures among these episodes. The first is where the audio goal is cornered among obstacles or lies right next to a wall. In this case, while AV-WaN reaches the goal quickly, it keeps oscillating around it and fails to pinpoint the location of the goal due to strong audio reflections from the obstacles around the goal or due to mapping errors. In the second case, we notice that sometimes the agent prematurely executes a stop action next to the audio goal. We expect that the differences in the audio intensity in the immediate neighborhood of the goal where the sound is the loudest are harder to detect, which may lead to this behavior.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 4: Analysis of selected waypoints (a,c) and accuracy vs. microphone noise (b). See text.
|
| 136 |
+
|
| 137 |
+
Noisy audio and distractor sounds To understand the robustness of our model under noisy audio perception, we consider two sources of audio noise: environment noise and microphone noise. For environment noise, we add distractor sounds (e.g. human speaking, fan spinning) to interfere with the agent’s audio perception. The agent is always tasked to find the telephone, and the distractor is an unheard sound placed at a random location. At each time step, the agent receives the combined waveforms of two sounds and needs to pick up on the telephone signal and find its source location. We use the same episodes from the Heard experiment (Table 1) to train and evaluate the agent. With distractors, the best performing baseline, Chen et al., obtains $7 1 . 7 \%$ and $5 3 . 3 \%$ test SPL on Replica and Matterport respectively, while our model achieves $8 3 . 1 \%$ and $7 0 . 9 \%$ . For microphone noise, we add increasing Gaussian noise to the received audio waveforms. Fig. 4b shows the results. AV-WaN is quite robust to audio noise, especially with $A _ { t }$ , while the existing AudioGoal methods suffer significantly. Hence our model’s advantages persist in noisier settings common in the real world, and the acoustic memory is essential in this noisy setting.
|
| 138 |
+
|
| 139 |
+
Dynamic waypoint selection Fig. 4a plots the distribution of euclidean distances to waypoints as a function of the agent’s geodesic distance to the goal. We see that our agent selects waypoints that are further away when it is far from the goal, then predicts closer ones when converging on the goal. Please see Supp for details and analysis.
|
| 140 |
+
|
| 141 |
+
Placement of waypoints To examine how waypoints are selected based on surrounding geometry, Fig. 4c plots the distribution of waypoints on a top-down map for a test Replica environment. The waypoints are accumulated over trajectories with start or end points in room $a$ or room $c$ , and goal locations are excluded. We see waypoints are mostly selected around obstacles and doors, which are the decision states that lie at critical junctions in the state spaces from which the agent can gather the most new information and transition to new, potentially unexplored regions (Goyal et al., 2019). The most frequent waypoints are usually $2 { \cdot } 3 \mathrm { m }$ apart, close to the maximum distance the agent can choose.
|
| 142 |
+
|
| 143 |
+
# 5 CONCLUSION
|
| 144 |
+
|
| 145 |
+
We introduced a reinforcement learning framework that learns to set waypoints for audio-visual navigation with an acoustic memory. Our method improves the state of the art on the challenging AudioGoal problem, and our analysis shows the direct impact of the new technical contributions. In future work we plan to consider AV-navigation tasks of increasing complexity, such as semantic sounds, moving sound sources, and real-world transfer.
|
| 146 |
+
|
| 147 |
+
# ACKNOWLEDGEMENTS
|
| 148 |
+
|
| 149 |
+
UT Austin is supported in part by DARPA Lifelong Learning Machines and ONR PECASE N00014- 15-1-2291.
|
| 150 |
+
|
| 151 |
+
# REFERENCES
|
| 152 |
+
|
| 153 |
+
Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On evaluation of embodied navigation agents. arXiv preprint arXiv:1807.06757, 2018.
|
| 154 |
+
|
| 155 |
+
Relja Arandjelovic and Andrew Zisserman. Objects that sound. In ECCV, 2018.
|
| 156 |
+
|
| 157 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In AAAI, 2017.
|
| 158 |
+
|
| 159 |
+
Somil Bansal, Varun Tolani, Saurabh Gupta, Jitendra Malik, and Claire Tomlin. Combining optimal control and learning for visual navigation in novel environments. In Conference on Robot Learning (CoRL), 2019.
|
| 160 |
+
|
| 161 |
+
J. A. Caley, N. R. J. Lawrance, and G. A. Hollinger. Deep learning of structured environments for robot search. In IROS, 2016.
|
| 162 |
+
|
| 163 |
+
Angel Chang, Angela Dai, Thomas Funkhouser, Maciej Halber, Matthias Niessner, Manolis Savva, Shuran Song, Andy Zeng, and Yinda Zhang. Matterport3d: Learning from rgb-d data in indoor environments. International Conference on 3D Vision (3DV), 2017. MatterPort3D dataset license available at: http://kaldir.vc.in.tum.de/matterport/MP_TOS.pdf.
|
| 164 |
+
|
| 165 |
+
Devendra Chaplot, Ruslan Salakhutdinov, Abhinav Gupta, and Saurabh Gupta. Neural topological slam for visual navigation. In CVPR, 2020a.
|
| 166 |
+
|
| 167 |
+
Devendra Singh Chaplot, Dhiraj Gandhi, Saurabh Gupta, Abhinav Gupta, and Ruslan Salakhutdinov. Learning to explore using active neural slam. In ICLR, 2020b.
|
| 168 |
+
|
| 169 |
+
Changan Chen, Unnat Jain, Carl Schissler, Sebastia Vicenc Amengual Gari, Ziad Al-Halah, Vamsi Krishna Ithapu, Philip Robinson, and Kristen Grauman. SoundSpaces: Audio-visual navigation in 3D environments. In ECCV, 2020.
|
| 170 |
+
|
| 171 |
+
Tao Chen, Saurabh Gupta, and Abhinav Gupta. Learning exploration policies for navigation. In International Conference on Learning Representations, 2019. URL https://openreview. net/pdf?id $=$ SyMWn05F7.
|
| 172 |
+
|
| 173 |
+
Sungjoon Choi, Qian-Yi Zhou, and Vladlen Koltun. Robust reconstruction of indoor scenes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 174 |
+
|
| 175 |
+
Jesper Christensen, Sascha Hornauer, and Stella Yu. Batvision: Learning to see 3d spatial layout with two ears. arXiv:1912.07011, 2020.
|
| 176 |
+
|
| 177 |
+
Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In NeurIPS, 2015.
|
| 178 |
+
|
| 179 |
+
I. Dokmanic, R. Parhizkar, A. Walther, Y. Lu, and M. Vetterli. Acoustic echoes reveal room shape. PNAS, 2013.
|
| 180 |
+
|
| 181 |
+
Kuan Fang, Alexander Toshev, Li Fei-Fei, and Silvio Savarese. Scene memory transformer for embodied agents in long-horizon tasks. In CVPR, 2019.
|
| 182 |
+
|
| 183 |
+
Jorge Fuentes-Pacheco, José Ruíz Ascencio, and Juan M. Rendón-Mancha. Visual simultaneous localization and mapping: a survey. Artificial Intelligence Review, 43:55–81, 2012.
|
| 184 |
+
|
| 185 |
+
Chuang Gan, Yiwei Zhang, Jiajun Wu, Boqing Gong, and Joshua B Tenenbaum. Look, listen, and act: Towards audio-visual embodied navigation. In ICRA, 2020.
|
| 186 |
+
|
| 187 |
+
Ruohan Gao, Changan Chen, Ziad Al-Halah, Carl Schissler, and Kristen Grauman. VisualEchoes: Spatial image representation learning through echolocation. In ECCV, 2020.
|
| 188 |
+
|
| 189 |
+
Frédéric Gougoux, Robert J Zatorre, Maryse Lassonde, Patrice Voss, and Franco Lepore. A functional neuroimaging study of sound localization: visual cortex activity predicts performance in early-blind individuals. PLoS biology, 2005.
|
| 190 |
+
|
| 191 |
+
Anirudh Goyal, Riashat Islam, Daniel Strouse, Zafarali Ahmed, Matthew Botvinick, Hugo Larochelle, Yoshua Bengio, and Sergey Levine. Infobot: Transfer and exploration via the information bottleneck. In ICLR, 2019.
|
| 192 |
+
|
| 193 |
+
Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In CVPR, 2017a.
|
| 194 |
+
|
| 195 |
+
Saurabh Gupta, David Fouhey, Sergey Levine, and Jitendra Malik. Unifying map and landmark based representations for visual navigation. arXiv preprint arXiv:1712.08125, 2017b.
|
| 196 |
+
|
| 197 |
+
Joao F Henriques and Andrea Vedaldi. Mapnet: An allocentric spatial memory for mapping environments. In CVPR, 2018.
|
| 198 |
+
|
| 199 |
+
John R Hershey and Javier R Movellan. Audio vision: Using audio-visual synchrony to locate sounds. In NeurIPS, 2000.
|
| 200 |
+
|
| 201 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 448–456, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings. mlr.press/v37/ioffe15.html.
|
| 202 |
+
|
| 203 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 204 |
+
|
| 205 |
+
Nadia Lessard, Michael Paré, Franco Lepore, and Maryse Lassonde. Early-blind human subjects localize sound sources better than sighted subjects. Nature, 1998.
|
| 206 |
+
|
| 207 |
+
Andrew Levy, George Konidaris, Robert Platt, and Kate Saenko. Learning multi-level hierarchies with hindsight. In ICLR, 2019.
|
| 208 |
+
|
| 209 |
+
Chengshu Li, Fei Xia, Roberto Martin-Martin, and Silvio Savarese. Hrl4in: Hierarchical reinforcement learning for interactive navigation with mobile manipulators. In CoRL, 2019.
|
| 210 |
+
|
| 211 |
+
Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016.
|
| 212 |
+
|
| 213 |
+
Dmytro Mishkin, Alexey Dosovitskiy, and Vladlen Koltun. Benchmarking classic and learned navigation in complex 3d environments. arXiv preprint arXiv:1901.10915, 2019.
|
| 214 |
+
|
| 215 |
+
Matthias Müller, Alexey Dosovitskiy, Bernard Ghanem, and Vladlen Koltun. Driving policy transfer via modularity and abstraction. CoRR, abs/1804.09364, 2018. URL http://arxiv.org/ abs/1804.09364.
|
| 216 |
+
|
| 217 |
+
Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In NeurIPS, 2018.
|
| 218 |
+
|
| 219 |
+
Tushar Nagarajan, Yanghao Li, Christoph Feichtenhofer, and Kristen Grauman. Ego-topo: Environment affordances from egocentric video. In CVPR, 2020.
|
| 220 |
+
|
| 221 |
+
Suraj Nair and Chelsea Finn. Hierarchical foresight: Self-supervised learning of long-horizon tasks via visual subgoal generation. In ICLR, 2020.
|
| 222 |
+
|
| 223 |
+
Kazuhiro Nakadai and Keisuke Nakamura. Sound source localization and separation. Wiley Encyclopedia of Electrical and Electronics Engineering, 1999.
|
| 224 |
+
|
| 225 |
+
Kazuhiro Nakadai, Tino Lourens, Hiroshi G Okuno, and Hiroaki Kitano. Active audition for humanoid. In AAAI, 2000.
|
| 226 |
+
|
| 227 |
+
Caleb Rascon and Ivan Meza. Localization of sound sources in robotics: A review. Robotics and Autonomous Systems, 2017.
|
| 228 |
+
|
| 229 |
+
Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. arXiv preprint arXiv:1803.00653, 2018.
|
| 230 |
+
|
| 231 |
+
Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, Devi Parikh, and Dhruv Batra. Habitat: A Platform for Embodied AI Research. In ICCV, 2019.
|
| 232 |
+
|
| 233 |
+
Alexander Sax, Bradley Emi, Amir R Zamir, Leonidas Guibas, Silvio Savarese, and Jitendra Malik. Mid-level visual representations improve generalization and sample efficiency for learning visuomotor policies. arXiv preprint arXiv:1812.11971, 2018.
|
| 234 |
+
|
| 235 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 236 |
+
|
| 237 |
+
Arda Senocak, Tae-Hyun Oh, Junsik Kim, Ming-Hsuan Yang, and In So Kweon. Learning to localize sound source in visual scenes. In CVPR, 2018.
|
| 238 |
+
|
| 239 |
+
Gregory J. Stein, Christopher Bradley, and Nicholas Roy. Learning over subgoals for efficient navigation of structured, unknown environments. In Aude Billard, Anca Dragan, Jan Peters, and Jun Morimoto (eds.), Proceedings of The 2nd Conference on Robot Learning, volume 87 of Proceedings of Machine Learning Research, pp. 213–222. PMLR, 29–31 Oct 2018.
|
| 240 |
+
|
| 241 |
+
Julian Straub, Thomas Whelan, Lingni Ma, Yufan Chen, Erik Wijmans, Simon Green, Jakob J Engel, Raul Mur-Artal, Carl Ren, Shobhit Verma, et al. The replica dataset: A digital replica of indoor spaces. arXiv preprint arXiv:1906.05797, 2019.
|
| 242 |
+
|
| 243 |
+
Sebastian Thrun. Probabilistic robotics. Communications of the ACM, 45(3):52–57, 2002.
|
| 244 |
+
|
| 245 |
+
Yapeng Tian, Jing Shi, Bochen Li, Zhiyao Duan, and Chenliang Xu. Audio-visual event localization in unconstrained videos. In ECCV, 2018.
|
| 246 |
+
|
| 247 |
+
Hsiao-Yu Fish Tung, Ricson Cheng, and Katerina Fragkiadaki. Learning spatial common sense with geometry-aware recurrent networks. In CVPR, 2019.
|
| 248 |
+
|
| 249 |
+
Y. Wang, M. Kapadia, P. Huang, L. Kavan, and N. Badler. Sound localization and multi-modal steering for autonomous virtual agents. In Interactive 3D Graphics and Games (I3D), 2014.
|
| 250 |
+
|
| 251 |
+
Jimmy Wu, Xingyuan Sun, Andy Zeng, Shuran Song, Johnny Lee, Szymon Rusinkiewicz, and Thomas Funkhouser. Spatial action maps for mobile manipulation. In RSS, 2020.
|
| 252 |
+
|
| 253 |
+
# 6 SUPPLEMENTARY MATERIAL
|
| 254 |
+
|
| 255 |
+
In this supplementary material we provide additional details about:
|
| 256 |
+
|
| 257 |
+
• Video (with audio) for qualitative assessment of our agent’s performance.
|
| 258 |
+
• Implementation details (Sec. 6.2)
|
| 259 |
+
• Noisy depth experiment (Sec. 6.3)
|
| 260 |
+
• Binaural spectrogram calculation details (Sec. 6.4).
|
| 261 |
+
• Details of the CNN encoders from the perception and mapping component of our AV-WaN (Sec. 6.5).
|
| 262 |
+
• Details on the navigation metric definitions (Sec. 6.6).
|
| 263 |
+
• Baseline implementation details (Sec. 6.7).
|
| 264 |
+
• Details on the dynamic waypoint selection analysis (Sec. 6.8).
|
| 265 |
+
• Details on the unheard sounds data splits (Sec. 6.9).
|
| 266 |
+
|
| 267 |
+
# 6.1 QUALITATIVE VIDEO
|
| 268 |
+
|
| 269 |
+
The supplementary video demonstrates the audio simulation platform that we use and shows the comparison between our proposed model and the baselines as well as qualitative results from the unheard and time-varying sound experiments. Please listen with headphones to hear the binaural audio correctly.
|
| 270 |
+
|
| 271 |
+
# 6.2 IMPLEMENTATION DETAILS
|
| 272 |
+
|
| 273 |
+
We train our model with Adam (Kingma & Ba, 2014) with a learning rate of $2 . 5 \times 1 0 ^ { - 4 }$ . The output of the three encoders $g _ { t }$ , $b _ { t }$ and $a _ { t }$ are all of dimension 512. We use a one-layer bidirectional GRU (Chung et al., 2015) with 512 hidden units that takes $[ g _ { t } , b _ { t } , a _ { t } ]$ as input. The geometric map size $s _ { g }$ is 200 at a resolution of $0 . 1 \mathrm { m }$ . The acoustic map size $s _ { a }$ and the action map size $s _ { w }$ are 20 and 9 respectively, at the same resolution as the environment. We use an entropy loss on the policy distribution with coefficient 0.02. We train for 7.5 million policy prediction steps, and we set the upper limit of planning steps to 10.
|
| 274 |
+
|
| 275 |
+
# 6.3 NOISY DEPTH PERCEPTION
|
| 276 |
+
|
| 277 |
+
Similar to our experiments on the model robustness against noisy audio perception, we test here the impact of noise on depth, the other input modality used by the agents. We use the standard Redwood depth noise model from Choi et al. (2015). To imitate a Sim2Real scenario, we do not retrain the models with the noisy depth sensor; we use noisy depth at inference time only. We find that all models are robust to this type of noise, with SPL performance varying by less than $1 \%$ and SR by less than $0 . 5 \%$ . These mild reductions for all methods are smaller than the margins separating the different baselines, meaning the conclusions from the main results hold with noisy depth at test time.
|
| 278 |
+
|
| 279 |
+
# 6.4 SPECTROGRAM DETAILS
|
| 280 |
+
|
| 281 |
+
Following Chen et al. (2020), we first compute the Short-Time Fourier Transform (STFT) with a hop length of 160 samples and a windowed signal length of 512 samples, which corresponds to a physical duration of 12 and 32 milliseconds at a sample rate of $4 4 1 0 0 \mathrm { H z }$ (Replica) and $1 6 0 0 0 \mathrm { H z }$ (Matterport). STFT gives a $2 5 7 \times 2 5 7$ and a $2 5 7 \times 1 0 1$ complex-valued matrix respectively for one second audio clip; we take its magnitude, downsample both axes by a factor of 4 and take the logarithm. Finally, we stack the left and right audio channel matrices to obtain a $6 5 \times 6 5 \times 2$ and a $6 5 \times 2 6 \times 2$ tensor.
|
| 282 |
+
|
| 283 |
+
A room impulse response (RIR) is characterized by three stages: direct sound, early reflections, and reverberation. Direct sound is a strong signal of agent’s distance to goal. We compute the intensity of the direct sound part of the audio signal by taking the root-mean-square (RMS) value of the first $3 \mathrm { m s }$ non-zero audio waveform averaged between the left and right channels.
|
| 284 |
+
|
| 285 |
+
Table 3: Summary of methods. I(A, B) denotes the intersection of A and B. The DoA predictor and the stopping function in the Direction Follower and Frontier waypoints are trained but their waypoints are computed analytically. In constrast, Supervised Waypoints trains its waypoint predictor with supervised learning (SL).
|
| 286 |
+
|
| 287 |
+
<table><tr><td></td><td colspan="3">Model</td><td colspan="3">Waypoints</td></tr><tr><td>Model</td><td>Hierarchical</td><td>Granularity</td><td>Learned</td><td>Definition</td><td>Learning</td><td>Dynamic</td></tr><tr><td>Random</td><td>×</td><td>Primitive action</td><td>X</td><td></td><td></td><td>=</td></tr><tr><td>Chen et al.</td><td>×</td><td>Primitive action</td><td>√</td><td></td><td></td><td></td></tr><tr><td>Gan et al.</td><td>×</td><td>Final goal</td><td></td><td></td><td></td><td>=</td></tr><tr><td>Direction Follower</td><td>√</td><td>Waypoint</td><td></td><td>K steps in DoA</td><td></td><td>X</td></tr><tr><td>Frontier Waypoints</td><td></td><td>Waypoint</td><td></td><td>(frontier, DoA)</td><td></td><td>X</td></tr><tr><td>Supervised Waypoints</td><td></td><td>Waypoint</td><td></td><td>I(shortest path,FoV)</td><td>SL</td><td>X</td></tr><tr><td>AV-WaN (Ours)</td><td>√</td><td>Waypoint</td><td></td><td>Learned end-to-end</td><td>RL</td><td>√</td></tr></table>
|
| 288 |
+
|
| 289 |
+
# 6.5 CNN ARCHITECTURE DETAILS
|
| 290 |
+
|
| 291 |
+
The CNN component of the $f _ { g }$ and $f _ { b }$ encoders has three convolution layers each, with kernel sizes of [8, 4, 3] and strides of [4, 2, 1] respectively. Similarly, the CNN component of $f _ { a }$ has three convolution layers with kernel sizes of [5, 3, 3] and strides of [2, 1, 1]. For all CNNs, the channel size doubles after each convolution layer starting from 32 and each convolution layer is followed by a ReLU activation function. We use a fully connected layer at the end of each CNN to transform the CNN features into an embedding of size 512.
|
| 292 |
+
|
| 293 |
+
# 6.6 METRIC DEFINITIONS
|
| 294 |
+
|
| 295 |
+
Next we elaborate on the navigation metrics defined in Sec. 4 of the main paper.
|
| 296 |
+
|
| 297 |
+
1. Success Rate (SR): the fraction of successfully completed episodes, i.e., the agent reaches the goal within the time limit of 500 steps and selects the stop action exactly at the goal location.
|
| 298 |
+
2. Success weighted by path length (SPL) (Anderson et al., 2018): weighs the successful episodes with the ratio of the shortest path li to the executed path pi, SPL = 1N PNi=1 Si limax(pi,li) .
|
| 299 |
+
3. Success weighted by number of actions (SNA): weighs the successful episodes by the ratio of the number of actions taken for the shortest path $l _ { i } ^ { a }$ to the number of executed actions by the agent’s $p _ { i } ^ { a }$ , $\begin{array} { r } { \mathrm { S N A } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } S _ { i } \frac { l _ { i } ^ { a } } { \operatorname* { m a x } \left( p _ { i } ^ { a } , l _ { i } ^ { a } \right) } } \end{array}$ . This metric captures the agent’s efficiency in reaching the goal. Two agents may have different number of actions but the same SPL score for an episode since the number of actions also accounts for actions that do not lead to path changes, like rotation in place.
|
| 300 |
+
|
| 301 |
+
# 6.7 BASELINE IMPLEMENTATION DETAILS
|
| 302 |
+
|
| 303 |
+
Table 3 summarizes the properties of the methods we compare to our AV-WaN model. Note that three of the compared methods are also hierarchical navigation models that modularly combine subgoal setting with low-level planning or navigation (left). As noted in the text, the key distinction is in how the waypoints are set (right). In particular, our model is the only hierarchical navigation model that learns a policy to set the waypoints with reinforcement learning, end-to-end with the navigation task.
|
| 304 |
+
|
| 305 |
+
Next we provide further implementation details about the baselines and existing methods. Note that all hierarchical models and Gan et al. (2020) share the same mapping and planning modules.
|
| 306 |
+
|
| 307 |
+
# 6.7.1 GAN ET AL. (2020)
|
| 308 |
+
|
| 309 |
+
Since code for (Gan et al., 2020) was not available at the time of our submission, we implemented this method ourselves. We followed instructions given by the authors, and also implemented our own enhancements to improve its performance on the the Replica and Matterport (MP3D) datasets.
|
| 310 |
+
|
| 311 |
+
We use a VGG-like CNN to predict the relative location $( \Delta x , \Delta y )$ of the audio goal given the binaural audio spectrograms as input. The CNN has 5 convolutional (conv.) layers interleaved with 5 max pooling layers and followed by 3 fully-connected (FC) layers. Each of the conv. and FC layers has a batch-normalization (Ioffe & Szegedy, 2015) of $1 0 ^ { - 5 }$ and a ReLU activation function except for the last FC layer which outputs the prediction. The conv. layers have the following configuration - a square kernel of size 3, a stride of 1 in both directions, and a symmetric zero-padding of 1. The number of output channels of the 5 conv. layers are $\{ 6 4 , 1 2 8 , 2 5 6 , 5 1 2 , 5 1 2 \}$ in order. The max pooling layers have a square kernel of size 2 with a stride of 2 in each direction except for a stride of 1 in the last max pooling layer for MP3D experiments. The FC layers have sizes {128, 128, 2} in order. We train the network until convergence to lower the minimum squared error (MSE) loss using Adam (Kingma & Ba, 2014) with an initial learning rate of $3 \times 1 0 ^ { - 3 }$ and a batch size of 128 and 1024 for Replica and MP3D respectively. The model from (Gan et al., 2020) has a separate audio classifier for stopping. This classifier has the same architecture as the goal prediction model except for last FC layer which just has 1 output unit and a sigmoid activation. The stopping classifier is trained to minimize the binary cross entropy (BCE) loss with an initial learning rate of $3 \times 1 0 ^ { - 5 }$ .
|
| 312 |
+
|
| 313 |
+
During navigation, the agent predicts the AudioGoal location after every $N$ time steps if the predicted location is not reached before that. The agent stops if the episode times out after 500 time steps or the stopping classifier predicts the stop action. The original paper sets $N = 1$ but we found that 1-step predictions are very reactive in nature, i.e., the agent keeps going back and forth or keeps turning while standing at the same location. This leads to a very low performance in the realistic Replica and MP3D test environments (Chen et al., 2020). We improve the prediction stability and the navigation performance by predicting after every $N$ steps where $N$ is chosen through a hyperparameter search on the validation split. For Replica, $N$ is set to 20 for both heard and unheard sounds, while for MP3D, $N$ is set to 50 and 60 for heard and unheard sounds respectively.
|
| 314 |
+
|
| 315 |
+
# 6.7.2 DIRECTION FOLLOWER
|
| 316 |
+
|
| 317 |
+
For this baseline, we train a CNN model to predict the direction of arrival (DoA) of the sound with the binaural spectrograms as input. We collect the ground truth DoAs by using the ambisonic room impulse responses (RIR) sampled at $4 4 . 1 \ \mathrm { k H z }$ for Replica and $1 6 . 0 \mathrm { k H z }$ for MP3D from (Chen et al., 2020). The first sound samples from the RIRs that correspond to the direct sound are used to build a circular intensity map around the agent at the height of the agent’s ears. The circular map is discretized into 36 bins where each bin is equal to $3 6 0 ^ { \circ } / 3 6 = 1 0 ^ { \circ }$ . We select the bin with the maximum intensity in this map to approximate the DoA of the direct sound.
|
| 318 |
+
|
| 319 |
+
We use the exact same VGG-like architecture from the (Gan et al., 2020) re-implementation except for replacing the output layer with a single fully-connected layer with 36 output units for classifying a binaural spectogram pair into one of the 36 classes where each class corresponds to a $1 0 ^ { \circ }$ DoA bin. The network is trained until convergence to lower the negative log-likelihood (NLL) loss with Adam (Kingma & Ba, 2014), a batch size of 128 and for 1024 for Replica and MP3D respectively, and an initial learning rate of $3 \times 1 0 ^ { - 4 }$ for both heard and unheard sounds for both the environments.
|
| 320 |
+
|
| 321 |
+
During navigation in both Replica and MP3D environments, the agent predicts the DoA using the previous model and moves to an intermediate goal that is 4 steps away (2 meters) in that direction. The value of 4 is chosen through a hyperparameter search using the validation split. The intermediate goal is recomputed after every 4 time steps as long as the agent has not reached the audio goal. If the predicted intermediate goal does not lie at a navigable location in the agent’s geometric map $( G _ { t } )$ , it executes a random action. The agent uses the same audio classifier as the Gan et al. (2020) baseline for stopping.
|
| 322 |
+
|
| 323 |
+
# 6.7.3 FRONTIER WAYPOINTS
|
| 324 |
+
|
| 325 |
+
Similar to the Direction Follower baseline, this agent also predicts the DoA of the direct sound but moves to the nearest frontier (Caley et al., 2016; Stein et al., 2018) in that direction instead of an intermediate goal that is four steps away. To improve this baseline, we enforce an additional constraint so that the frontier point is always at least 3 steps (1.5 meters) away to ensure that the agent does not make reactive predictions and keep going back and forth between the same two points in the environment. If there is no frontier point along the predicted DoA (a common case when the agent starts off), then the agent simply moves 3 steps in that direction. If the agent finds the next frontier to be $N$ steps away, then the agent does not predict another frontier waypoint until it reaches the current one or $2 N$ time steps have passed. For stopping, the agent uses the same stopping classifier as the previous baselines.
|
| 326 |
+
|
| 327 |
+
# 6.7.4 SUPERVISED WAYPOINTS
|
| 328 |
+
|
| 329 |
+
This baseline is a hierarchical model that predicts waypoints in its field of view (FOV) with supervised (non-end-to-end) learning. This model is inspired by Bansal et al. (2019) where they use an expert policy to generate ground truth waypoints and train a visual waypoint predictor based on RGB inputs and point goal information. Similarly, in this baseline we use RGB observations with the audio goal spectrograms to train a model to predict waypoints where the ground truth for these waypoints is generated using a shortest path planner.
|
| 330 |
+
|
| 331 |
+
Specifically, in this implementation, we use a similar audio encoder as in the other baselines. For encoding the RGB images, we use the exact same architecture from $f _ { g }$ other than modifying the first convolution layer to accommodate for the three RGB channels. We do a mid-level fusion of the outputs of these two convolutional encoders and the fused output is fed to FC layers which have the same sizes as the FC layers in the (Gan et al., 2020) model. The ground truth target for the model is the relative location $( \Delta x , \Delta y )$ of the point of intersection of the shortest path to the audiogoal location and a local field of view (FoV) around the agent. For all our experiments, we choose a $\mathrm { 8 m } \times 8 \mathrm { m }$ square with the agent at the center as the FoV. We train this model using the same hyperparameters as the (Gan et al., 2020) baseline. For stable prediction and better navigation performance, the navigation agent repredicts after every 15 and 25 steps for heard and unheard sounds in Replica, and after every 30 steps for both sound types in MP3D. This hyperparameter is again estimated through a hyperparameter search on the validation split.
|
| 332 |
+
|
| 333 |
+
# 6.8 DYNAMIC WAYPOINT SELECTION DETAILS
|
| 334 |
+
|
| 335 |
+
To analyze the behavior of dynamic waypoint selection, Fig. 4a plots the distribution of euclidean distances to waypoints as a function of the agent’s geodesic distance to the goal collected from all prediction steps across all episodes on Replica. The existing methods do not set waypoints. For Chen et al. (2020), we say the “waypoint" distance is $_ { 0 \mathrm { m } }$ if the agent chooses to stop and $0 . 5 \mathrm { m }$ otherwise. For Gan et al. (2020), we say “waypoints“ are the intersection of the predicted vector to the final goal and the explored area.
|
| 336 |
+
|
| 337 |
+
We see that our agent selects waypoints that are further away when it is far from the goal, then predicts closer ones when converging on the goal. In contrast, the step-by-step model (Chen et al., 2020) effectively has a fixed radius waypoint, while the final-goal model (Gan et al., 2020) has a high variance even when close to the goal, indicative of the redirection and backtracking behavior described above. The large waypoint distances for (Gan et al., 2020) are a symptom of its backtracking due to misprediction and lack of temporal modeling; since depth projections are limited to $3 \mathrm { m }$ , an ideal agent should always pick a waypoint up to $3 \mathrm { m }$ away and push forward to the goal.
|
| 338 |
+
|
| 339 |
+
# 6.9 UNHEARD SOUNDS DATA SPLITS
|
| 340 |
+
|
| 341 |
+
Following Chen et al. (2020), we utilize 102 copyright-free natural sounds across a wide variety of categories: air conditioner, bell, door opening, music, computer beeps, fan, people speaking, telephone, and etc. These 102 sounds are divided into non-overlapping 73/11/18 splits for train, validation and test.
|
| 342 |
+
|
| 343 |
+
In Table 1, for the Heard sound experiment, we use the sound source of ’telephone’. For the Unheard sound experiment, we use the 78 sounds for training scenes, and generalize to unseen scenes as well as unheard sounds. Particularly, we utilize the 11 sounds for validation scenes, and the remaining 18 sounds for test scenes.
|
md/train/dUk5Foj5CLf/dUk5Foj5CLf.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CoAtNet: Marrying Convolution and Attention for All Data Sizes
|
| 2 |
+
|
| 3 |
+
Zihang Dai, Hanxiao Liu, Quoc V. Le, Mingxing Tan Google Research, Brain Team {zihangd,hanxiaol,qvl,tanmingxing}@google.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Transformers have attracted increasing interests in computer vision, but they still fall behind state-of-the-art convolutional networks. In this work, we show that while Transformers tend to have larger model capacity, their generalization can be worse than convolutional networks due to the lack of the right inductive bias. To effectively combine the strengths from both architectures, we present CoAtNets (pronounced “coat” nets), a family of hybrid models built from two key insights: (1) depthwise Convolution and self-Attention can be naturally unified via simple relative attention; (2) vertically stacking convolution layers and attention layers in a principled way is surprisingly effective in improving generalization, capacity and efficiency. Experiments show that our CoAtNets achieve state-of-the-art performance under different resource constraints across various datasets: Without extra data, CoAtNet achieves $8 6 . 0 \%$ ImageNet top-1 accuracy; When pre-trained with 13M images from ImageNet-21K, our CoAtNet achieves $8 8 . 5 6 \%$ top-1 accuracy, matching ViT-huge pre-trained with 300M images from JFT-300M while using $2 3 \mathrm { x }$ less data; Notably, when we further scale up CoAtNet with JFT-3B, it achieves $9 0 . 8 8 \%$ top-1 accuracy on ImageNet, establishing a new state-of-the-art result.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Since the breakthrough of AlexNet [1], Convolutional Neural Networks (ConvNets) have been the dominating model architecture for computer vision [2, 3, 4, 5]. Meanwhile, with the success of self-attention models like Transformers [6] in natural language processing [7, 8], many previous works have attempted to bring in the power of attention into computer vision [9, 10, 11, 12]. More recently, Vision Transformer (ViT) [13] has shown that with almost1 only vanilla Transformer layers, one could obtain reasonable performance on ImageNet-1K [14] alone. More importantly, when pre-trained on large-scale weakly labeled JFT-300M dataset [15], ViT achieves comparable results to state-of-the-art (SOTA) ConvNets, indicating that Transformer models potentially have higher capacity at scale than ConvNets.
|
| 12 |
+
|
| 13 |
+
While ViT has shown impressive results with enormous JFT 300M training images, its performance still falls behind ConvNets in the low data regime. For example, without extra JFT-300M pre-training, the ImageNet accuracy of ViT is still significantly lower than ConvNets with comparable model size [5] (see Table 13). Subsequent works use special regularization and stronger data augmentation to improve the vanilla ViT [16, 17, 18], yet none of these ViT variants could outperform the SOTA convolution-only models on ImageNet classification given the same amount of data and computation [19, 20]. This suggests that vanilla Transformer layers may lack certain desirable inductive biases possessed by ConvNets, and thus require significant amount of data and computational resource to compensate. Not surprisingly, many recent works have been trying to incorporate the inductive biases of ConvNets into Transformer models, by imposing local receptive fields for attention layers [21, 22] or augmenting the attention and FFN layers with implicit or explicit convolutional operations [23, 24, 25]. However, these approaches are either ad-hoc or focused on injecting a particular property, lacking a systematic understanding of the respective roles of convolution and attention when combined.
|
| 14 |
+
|
| 15 |
+
In this work, we systematically study the problem of hybridizing convolution and attention from two fundamental aspects in machine learning – generalization and model capacity. Our study shows that convolutional layers tend to have better generalization with faster converging speed thanks to their strong prior of inductive bias, while attention layers have higher model capacity that can benefit from larger datasets. Combining convolutional and attention layers can achieve better generalization and capacity; however, a key challenge here is how to effectively combine them to achieve better trade-offs between accuracy and efficiency. In this paper, we investigate two key insights: First, we observe that the commonly used depthwise convolution can be effectively merged into attention layers with simple relative attention; Second, simply stacking convolutional and attention layers, in a proper way, could be surprisingly effective to achieve better generalization and capacity. Based on these insights, we propose a simple yet effective network architecture named CoAtNet, which enjoys the strengths from both ConvNets and Transformers.
|
| 16 |
+
|
| 17 |
+
Our CoAtNet achieves SOTA performances under comparable resource constraints across different data sizes. Specifically, under the low-data regime, CoAtNet inherits the great generalization property of ConvNets thanks to the favorable inductive biases. Moreover, given abundant data, CoAtNet not only enjoys the superior scalability of Transformer models, but also achieves faster convergence and thus improved efficiency. When only ImageNet-1K is used for training, CoAtNet achieves $8 6 . 0 \%$ top-1 accuracy, matching the prior art NFNet [20] under similar computation resource and training conditions. Further, when pre-trained on ImageNet-21K with about 10M images, CoAtNet reaches $8 8 . 5 6 \%$ top-1 accuracy when finetuned on ImageNet-1K, matching the ViT-Huge pre-trained on JFT-300M, a $2 3 \times$ larger dataset. Finally, when JFT-3B is used for pre-training, CoAtNet exhibits better efficiency compared to ViT, and pushes the ImageNet-1K top-1 accuracy to $9 0 . 8 8 \%$ while using $1 . 5 \mathrm { x }$ less computation of the prior art set by ViT-G/14 [26].
|
| 18 |
+
|
| 19 |
+
# 2 Model
|
| 20 |
+
|
| 21 |
+
In the section, we focus on the question of how to “optimally” combine the convolution and transformer. Roughly speaking, we decompose the question into two parts:
|
| 22 |
+
|
| 23 |
+
1. How to combine the convolution and self-attention within one basic computational block? 2. How to vertically stack different types of computational blocks together to form a complete network?
|
| 24 |
+
|
| 25 |
+
The rationale of the decomposition will become clearer as we gradually reveal our design choices.
|
| 26 |
+
|
| 27 |
+
# 2.1 Merging Convolution and Self-Attention
|
| 28 |
+
|
| 29 |
+
For convolution, we mainly focus on the MBConv block [27] which employs depthwise convolution [28] to capture the spatial interaction. A key reason of this choice is that both the FFN module in Transformer and MBConv employ the design of “inverted bottleneck”, which first expands the channel size of the input by $4 \mathbf { x }$ and later project the the $4 \mathbf { x }$ -wide hidden state back to the original channel size to enable residual connection.
|
| 30 |
+
|
| 31 |
+
Besides the similarity of inverted bottleneck, we also notice that both depthwise convolution and self-attention can be expressed as a per-dimension weighted sum of values in a pre-defined receptive field. Specifically, convolution relies on a fixed kernel to gather information from a local receptive field
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
y _ { i } = \sum _ { j \in \mathcal { L } ( i ) } w _ { i - j } \odot x _ { j } \quad \mathrm { ( d e p t h w i s e c o n v o l u t i o n ) } ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $x _ { i } , y _ { i } \in \mathbb { R } ^ { D }$ are the input and output at position $i$ respectively, and $\mathcal { L } ( i )$ denotes a local neighborhood of $i$ , e.g., a 3x3 grid centered at $i$ in image processing.
|
| 38 |
+
|
| 39 |
+
In comparison, self-attention allows the receptive field to be the entire spatial locations and computes the weights based on the re-normalized pairwise similarity between the pair $( x _ { i } , x _ { j } )$ : 2
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
y _ { i } = \sum _ { j \in \mathcal { G } } \underbrace { \frac { \exp { \left( x _ { i } ^ { \top } x _ { j } \right) } } { \sum _ { k \in \mathcal { G } } \exp { \left( x _ { i } ^ { \top } x _ { k } \right) } } } _ { A _ { i , j } } x _ { j } \quad \mathrm { ( s e l f - a t t e n t i o n ) } ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathcal { G }$ indicates the global spatial space. Before getting into the question of how to best combine them, it is worthwhile to compare their relative strengths and weaknesses, which helps to figure out the good properties we hope to retain.
|
| 46 |
+
|
| 47 |
+
• First of all, the depthwise convolution kernel $w _ { i - j }$ is an input-independent parameter of static value, while the attention weight $A _ { i , j }$ dynamically depends on the representation of the input. Hence, it is much easier for the self-attention to capture complicated relational interactions between different spatial positions, a property that we desire most when processing high-level concepts. However, the flexibility comes with a risk of easier overfitting, especially when data is limited. • Secondly, notice that given any position pair $( i , j )$ , the corresponding convolution weight $w _ { i - j }$ only cares about the relative shift between them, i.e. $i - j$ , rather than the specific values of $i$ or $j$ . This property is often referred to translation equivalence, which has been found to improve generalization under datasets of limited size [29]. Due to the usage of absolution positional embeddings, standard Transformer (ViT) lacks this property. This partially explains why ConvNets are usually better than Transformers when the dataset is not enormously large. • Finally, the size of the receptive field is one of the most crucial differences between self-attention and convolution. Generally speaking, a larger receptive field provides more contextual information, which could lead to higher model capacity. Hence, the global receptive field has been a key motivation to employ self-attention in vision. However, a large receptive field requires significantly more computation. In the case of global attention, the complexity is quadratic w.r.t. spatial size, which has been a fundamental trade-off in applying self-attention models.
|
| 48 |
+
|
| 49 |
+
Table 1: Desirable properties found in convolution or self-attention.
|
| 50 |
+
|
| 51 |
+
<table><tr><td>Properties</td><td>Convolution</td><td>Self-Attention</td></tr><tr><td>Translation Equivariance</td><td>√</td><td></td></tr><tr><td>Input-adaptive Weighting</td><td></td><td>√</td></tr><tr><td>Global Receptive Field</td><td></td><td></td></tr></table>
|
| 52 |
+
|
| 53 |
+
Given the comparison above, an ideal model should be able to combine the 3 desirable properties in Table 1. With the similar form of depthwise convolution in Eqn. (1) and self-attention in Eqn. (2), a straightforward idea that could achieve this is simply to sum a global static convolution kernel with the adaptive attention matrix, either after or before the Softmax normalization, i.e.,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
y _ { i } ^ { \mathrm { p o s t } } = \sum _ { j \in \mathcal { G } } \left( \frac { \exp \left( x _ { i } ^ { \top } x _ { j } \right) } { \sum _ { k \in \mathcal { G } } \exp \left( x _ { i } ^ { \top } x _ { k } \right) } + w _ { i - j } \right) x _ { j } \ \mathrm { ~ o r ~ } \ y _ { i } ^ { \mathrm { p e } } = \sum _ { j \in \mathcal { G } } \frac { \exp \left( x _ { i } ^ { \top } x _ { j } + w _ { i - j } \right) } { \sum _ { k \in \mathcal { G } } \exp \left( x _ { i } ^ { \top } x _ { k } + w _ { i - k } \right) } x _ { j } .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Interestingly, while the idea seems overly simplified, the pre-normalization version $y ^ { \mathrm { p r e } }$ corresponds to a particular variant of relative self-attention [30, 31]. In this case, the attention weight $A _ { i , j }$ is decided jointly by the $w _ { i - j }$ of translation equivariance and the input-adaptive $x _ { i } ^ { \top } x _ { j }$ , which can enjoy both effects depending on their relative magnitudes. Importantly, note that in order to enable the global convolution kernel without blowing up the number of parameters, we have reloaded the notation of $w _ { i - j }$ as a scalar (i.e., $w \in \mathbb { R } ^ { O ( | \mathcal { G } | ) }$ ) rather than a vector in Eqn. (1). Another advantage of the scalar formulation of $w$ is that retrieving $w _ { i - j }$ for all $( i , j )$ is clearly subsumed by computing the pairwise dot-product attention, hence resulting in minimum additional cost (see Appendix A.1). Given the benefits, we will use the Transformer block with the pre-normalization relative attention variant in Eqn. (3) as the key component of the proposed CoAtNet model.
|
| 60 |
+
|
| 61 |
+
# 2.2 Vertical Layout Design
|
| 62 |
+
|
| 63 |
+
After figuring out a neat way to combine convolution and attention, we next consider how to utilize it to stack an entire network.
|
| 64 |
+
|
| 65 |
+
As we have discuss above, the global context has a quadratic complexity w.r.t. the spatial size. Hence, if we directly apply the relative attention in Eqn. (3) to the raw image input, the computation will be excessively slow due to the large number of pixels in any image of common sizes. Hence, to construct a network that is feasible in practice, we have mainly three options:
|
| 66 |
+
|
| 67 |
+
(A) Perform some down-sampling to reduce the spatial size and employ the global relative attention after the feature map reaches manageable level.
|
| 68 |
+
(B) Enforce local attention, which restricts the global receptive field $\mathcal { G }$ in attention to a local field $\mathcal { L }$ just like in convolution [22, 21].
|
| 69 |
+
(C) Replace the quadratic Softmax attention with certain linear attention variant which only has a linear complexity w.r.t. the spatial size [12, 32, 33].
|
| 70 |
+
|
| 71 |
+
We briefly experimented with option (C) without getting a reasonably good result. For option (B), we found that implementing local attention involves many non-trivial shape formatting operations that requires intensive memory access. On our accelerator of choice (TPU), such operation turns out to be extremely slow [34], which not only defeats the original purpose of speeding up global attention, but also hurts the model capacity. Hence, as some recent work has studied this variant [22, 21], we will focus on option (A) and compare our results with theirs in our empirical study (Section 4).
|
| 72 |
+
|
| 73 |
+
For option (A), the down-sampling can be achieved by either (1) a convolution stem with aggressive stride (e.g., stride 16x16) as in ViT or (2) a multi-stage network with gradual pooling as in ConvNets. With these choices, we derive a search space of 5 variants and compare them in controlled experiments.
|
| 74 |
+
|
| 75 |
+
• When the ViT Stem is used, we directly stack $L$ Transformer blocks with relative attention, which we denote as $\mathrm { V I T } _ { \mathrm { R E L } }$ .
|
| 76 |
+
• When the multi-stage layout is used, we mimic ConvNets to construct a network of 5 stages (S0, S1, S2, S3 & S4), with spatial resolution gradually decreased from S0 to S4. At the beginning of each stage, we always reduce the spatial size by $2 \mathbf { x }$ and increase the number of channels (see Appendix A.1 for the detailed down-sampling implementation). The first stage S0 is a simple 2-layer convolutional Stem and S1 always employs MBConv blocks with squeeze-excitation (SE), as the spatial size is too large for global attention. Starting from S2 through S4, we consider either the MBConv or the Transformer block, with a constraint that convolution stages must appear before Transformer stages. The constraint is based on the prior that convolution is better at processing local patterns that are more common in early stages. This leads to 4 variants with increasingly more Transformer stages, C-C-C-C, C-C-C-T, C-C-T-T and C-T-T-T, where C and T denote Convolution and Transformer respectively.
|
| 77 |
+
|
| 78 |
+
To systematically study the design choices, we consider two fundamental aspects generalization capability and model capacity: For generalization, we are interested in the gap between the training loss and the evaluation accuracy. If two models have the same training loss, then the model with higher evaluation accuracy has better generalization capability, since it can generalize better to unseen evaluation dataset. Generalization capability is particularly important to data efficiency when training data size is limited. For model capacity, we measure the ability to fit large training datasets. When training data is abundant and overfitting is not an issue, the model with higher capacity will achieve better final performance after reasonable training steps. Note that, since simply increasing the model size can lead to higher model capacity, to perform a meaningful comparison, we make sure the model sizes of the 5 variants are comparable.
|
| 79 |
+
|
| 80 |
+
To compare the generalization and model capacity, we train different variants of hybrid models on ImageNet-1K (1.3M) and JFT $\left( > 3 0 0 \mathbf { M } \right)$ dataset for 300 and 3 epochs respectively, both without any regularization or augmentation. The training loss and evaluation accuracy on both datasets are summarized in Figure 1.
|
| 81 |
+
|
| 82 |
+
• From the ImageNet-1K results, a key observation is that, in terms of generalization capability (i.e., gap between train and evaluation metrics), we have
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathrm { C \mathrm { - } C \mathrm { - } C \mathrm { - } C \approx C \mathrm { - } C \mathrm { - } C \mathrm { - } T \ge C \mathrm { - } C \mathrm { - } T \mathrm { - } T > C \mathrm { - } T \mathrm { - } T \mathrm { - } T \gg V \mathrm { I } \mathrm { T } _ { \mathrm { R E L } } . }
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 1: Comparison for model generalization and capacity under different data size. For fair comparison, all models have similar parameter size and computational cost.
|
| 90 |
+
|
| 91 |
+
Particularly, $\mathrm { V I T } _ { \mathrm { R E L } }$ is significantly worse than variants by a large margin, which we conjecture is related to the lack of proper low-level information processing in its aggressive down-sampling Stem. Among the multi-stage variants, the overall trend is that the more convolution stages the model has, the smaller the generalization gap is.
|
| 92 |
+
|
| 93 |
+
• As for model capacity, from the JFT comparison, both the train and evaluation metrics at the end of the training suggest the following ranking:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathrm { C - C \mathrm { - } T \mathrm { - } T \approx C \mathrm { - } T \mathrm { - } T \mathrm { - } T > V I T _ { R E L } > C \mathrm { - } C \mathrm { - } C \mathrm { - } T > C \mathrm { - } C \mathrm { - } C \mathrm { - } C \mathrm { - } C \mathrm { . } }
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Importantly, this suggests that simply having more Transformer blocks does NOT necessarily mean higher capacity for visual processing. On one hand, while initially worse, $\mathrm { V I T } _ { \mathrm { R E L } }$ ultimately catch up with the two variants with more MBConv stages, indicating the capacity advantage of Transformer blocks. On the other hand, both C-C-T-T and C-T-T-T clearly outperforming $\mathrm { V I T } _ { \mathrm { R E L } }$ suggest that the ViT stem with an aggressive stride may have lost too much information and hence limit the model capacity. More interestingly, the fact that C-C-T-T $\approx \mathbf { C }$ -T-T-T indicates the for processing low-level information, static local operations like convolution could be as capable as adaptive global attention mechanism, while saving computation and memory usage substantially.
|
| 100 |
+
|
| 101 |
+
Finally, to decide between C-C-T-T and C-T-T-T, we conduct another transferability test3 — we finetune the two JFT pre-trained models above on ImageNet-1K for 30 epochs and compare their transfer performances. From Table 2, it turns out that C-C-T-T achieves a clearly better transfer accuracy than C-T-T-T, despite the same pre-training performance.
|
| 102 |
+
|
| 103 |
+
Table 2: Transferability test results.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Metric</td><td>C-C-T-T</td><td>C-T-T-T</td></tr><tr><td>Pre-training Precision@1 (JFT)</td><td>34.40</td><td>34.36</td></tr><tr><td>Transfer Accuracy 224x224</td><td>82.39</td><td>81.78</td></tr><tr><td>Transfer Accuracy 384x384</td><td>84.23</td><td>84.02</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Taking generalization, model capacity, transferability and efficiency into consideration, we adapt the C-C-T-T multi-stage layout for CoAtNet. More model details are included in Appendix A.1.
|
| 108 |
+
|
| 109 |
+
# 3 Related Work
|
| 110 |
+
|
| 111 |
+
Convolutional network building blocks. Convolutional Networks (ConvNets) have been the dominating neural architectures for many computer vision tasks. Traditionally, regular convolutions, such as ResNet blocks [3], are popular in large-scale ConvNets; in contrast, depthwise convolutions [28] are popular in mobile platforms due to its lower computational cost and smaller parameter size [27]. Recent works show that an improved inverted residual bottlenecks (MBConv [27, 35]), which is built upon depthwise convolutions, can achieve both high accuracy and better efficiency [5, 19]. As discussed in Section 2, due to the strong connection between MBConv and Transformer blocks , this paper mostly employs MBConv as convolution building blocks.
|
| 112 |
+
|
| 113 |
+
Self-attention and Transformers. With the key ingredients of self-attention, Transformers have been widely adopted for neural language processing and speech understanding. As an early work, stand-alone self-attention network [34] shows self-attention alone can work well for different vision tasks, though with some practical difficulties. Recently, ViT [13] applies a vanilla Transformer to ImageNet classification, and achieves impressive results after pre-training on a large-scale JFT dataset. However, ViT still largely lags behind state-of-the-art ConvNets when training data is limited. Following that, many recent works have been focused on improving vision Transformers for data efficiency and model efficiency. For a more comprehensive review of vision Transformers, we refer readers to the dedicated surveys [36, 37].
|
| 114 |
+
|
| 115 |
+
Relative attention. Under the general name of relative attention, there have been various variants in literature [30, 38, 39, 34, 40, 31]. Generally speaking, we can separate them into two categories: (a) the input-dependent version where the extra relative attention score is a function of the input states $f ( \bar { x } _ { i } , x _ { j } , \bar { i } - j )$ , and (b) the input-independent version $f ( i - j )$ . The variant in CoAtNet belongs to the input-independent version, and is similar to the one used in T5 [31], but unlike T5, we neither share the relative attention parameters across layers nor use the bucketing mechanism. As a benefit of the input independence, obtaining $f ( i - j )$ for all $( i , j )$ pairs is computationally much cheaper than the input-dependent version on TPU. In addition, at inference time, this only needs to be computed once and cached for future use. A recent work [22] also utilizes such an input-independent parameterization, but it restricts the receptive field to a local window.
|
| 116 |
+
|
| 117 |
+
Combining convolution and self-attention. The idea of combining convolution and self-attention for vision recognition is not new. A common approach is to augment the ConvNet backbone with explicit self-attention or non-local modules [9, 10, 11, 12], or to replace certain convolution layers with standard self-attention [11] or a more flexible mix of linear attention and convolution [41]. While self-attention usually improves the accuracy, they often come with extra computational cost and hence are often regarded as an add-on to the ConvNets, similar to squeeze-and-excitation [42] module. In comparison, after the success of ViT and ResNet-ViT [13], another popular line of research starts with a Transformer backbone and tries to incorporate explicit convolution or some desirable properties of convolution into the Transformer backbone [25, 24, 23, 22, 21, 43, 44].
|
| 118 |
+
|
| 119 |
+
While our work also belongs to this category, we show that our relative attention instantiation is a natural mixture of depthwise convolution and content-based attention with minimum additional cost. More importantly, starting from the perspectives of generalization and model capacity, we take a systematic approach to the vertical layout design and show how and why different network stages prefer different types of layers. Therefore, compared to models that simply use an off-the-shelf ConvNet as the stem layer, such as ResNet-ViT [13], CoAtNet also scales the Convolution stage (S2) when the overall size increases. On the other hand, compared to models employing local attention [22, 21], CoAtNet consistently uses full attention for S3 & S4 to ensure the model capacity, as S3 occupies the majority of the computation and parameters.
|
| 120 |
+
|
| 121 |
+
# 4 Experiments
|
| 122 |
+
|
| 123 |
+
In this section, we compare CoAtNet with previous results under comparable settings. For completeness, all the hyper-parameters not mentioned here are included in Appendix A.2.
|
| 124 |
+
|
| 125 |
+
# 4.1 Experiment Setting
|
| 126 |
+
|
| 127 |
+
CoAtNet model family. To compare with existing models of different sizes, we also design a family of CoAtNet models as summarized in Table 3. Overall, we always double the number of channels from S1 to S4, while ensuring the width of the Stem S0 to be smaller or equal to that of S1. Also, for simplicity, when increasing the depth of the network, we only scale the number of blocks in S2 and S3.
|
| 128 |
+
|
| 129 |
+
Evaluation Protocol. Our experiments focus on image classification. To evaluate the performance of the model across different data sizes, we utilize three datasets of increasingly larger sizes, namely ImageNet-1K (1.28M images), ImageNet-21K (12.7M images) and JFT (300M images). Following previous works, we first pre-train our models on each of the three datasets at resolution 224 for 300, 90 and 14 epochs respectively. Then, we finetune the pre-trained models on ImageNet-1K at the desired resolutions for 30 epochs and obtain the corresponding evaluation accuracy. One exception is the ImageNet-1K performance at resolution 224, which can be directly obtained at the end of pre-training. Note that similar to other models utilizing Transformer blocks, directly evaluating models pre-trained on ImageNet-1K at a larger resolution without finetuning usually leads to performance drop. Hence, finetuning is always employed whenever input resolution changes.
|
| 130 |
+
|
| 131 |
+
Table 3: L denotes the number of blocks and D denotes the hidden dimension (#channels). For all Conv and MBConv blocks, we always use the kernel size 3. For all Transformer blocks, we set the size of each attention head to 32, following [22]. The expansion rate for the inverted bottleneck is always 4 and the expansion (shrink) rate for the SE is always 0.25.
|
| 132 |
+
|
| 133 |
+
<table><tr><td> Stages</td><td>Size</td><td>CoAtNet-0</td><td></td><td>CoAtNet-1</td><td>CoAtNet-2</td><td></td><td>CoAtNet-3</td><td>CoAtNet-4</td></tr><tr><td>S0-Conv</td><td>1/2</td><td>L=2 D=64</td><td>L=2</td><td>D=64</td><td>L=2</td><td>D=128 L=2</td><td>D=192</td><td>L=2 D=192</td></tr><tr><td>S1-MbConv</td><td>1/4</td><td>L=2 D=96</td><td>L=2</td><td>D=96</td><td>L=2 D=128</td><td>L=2</td><td>D=192</td><td>L=2 D=192</td></tr><tr><td>S2-MBConv</td><td>1/8</td><td>L=3 D=192</td><td>L=6</td><td>D=192</td><td>L=6 D=256</td><td>L=6</td><td>D=384</td><td>L=12 D=384</td></tr><tr><td>S3-TFMRel</td><td>1/16</td><td>L=5 D=384</td><td>L=14</td><td>D=384</td><td>L=14 D=512</td><td>L=14</td><td>D=768</td><td>L=28 D=768</td></tr><tr><td>S4-TFMRel</td><td>1/32</td><td>L=2 D=768</td><td>L=2</td><td>D=768</td><td>L=2 D=1024</td><td>L=2</td><td>D=1536</td><td>L=2 D=1536</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Data Augmentation & Regularization. In this work, we only consider two widely used data augmentations, namely RandAugment [45] and MixUp [46], and three common techniques, including stochastic depth [47], label smoothing [48] and weight decay [49], to regularize the model. Intuitively, the specific hyper-parameters of the augmentation and regularization methods depend on model size and data scale, where strong regularization is usually applied for larger models and smaller dataset.
|
| 136 |
+
|
| 137 |
+
Under the general principle, a complication under the current paradigm is how to adjust the regularization for pre-training and finetuning as data size can change. Specifically, we have an interesting observation that if a certain type of augmentation is entirely disabled during pre-training, simply turning it on during fine-tuning would most likely harm the performance rather than improving. We conjecture this could be related to data distribution shift. As a result, for certain runs of the proposed model, we deliberately apply RandAugment and stochastic depth of a small degree when pre-training on the two larger datasets, ImageNet21-K and JFT. Although such regularization can harm the pre-training metrics, this allows more versatile regularization and augmentation during finetuning, leading to improved down-stream performances.
|
| 138 |
+
|
| 139 |
+
# 4.2 Main Results
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Accuracy-to-FLOPs scaling curve under ImageNet-1K only setting at $2 2 4 \mathbf { x } 2 2 4$ .
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 3: Accuracy-to-Params scaling curve under ImageNet- $2 1 \mathrm { K } \Rightarrow$ ImageNet-1K setting.
|
| 146 |
+
|
| 147 |
+
ImageNet-1K The experiment results with only the ImageNet-1K dataset are shown in Table 4. Under similar conditions, the proposed CoAtNet models not only outperform ViT variants, but also match the best convolution-only architectures, i.e., EfficientNet-V2 and NFNets. Additionally, we also visualize the all results at resolution $2 2 4 \mathbf { x } 2 2 4$ in Fig. 2. As we can see, CoAtNet scales much better than previous model with attention modules.
|
| 148 |
+
|
| 149 |
+
Table 4: Model performance on ImageNet. 1K only denotes training on ImageNet-1K only; $2 1 \mathtt { K } + 1 \mathtt { K }$ denotes pre-training on ImageNet-21K and finetuning on ImageNet-1K; PT-RA denotes applying RandAugment during 21K pre-training, and E150 means 150 epochs of 21K pre-training, which is longer than the standard 90 epochs. More results are in Appendix A.3.
|
| 150 |
+
|
| 151 |
+
<table><tr><td colspan="2">Models</td><td>Eval Size</td><td>#Params</td><td>#FLOPs</td><td colspan="2">ImageNet Top-1 Accuracy</td></tr><tr><td rowspan="5">Conv Only</td><td></td><td></td><td></td><td></td><td>1K only</td><td>21K+1K</td></tr><tr><td>EfficientNet-B7</td><td>600²</td><td>66M</td><td>37B</td><td>84.7</td><td>-</td></tr><tr><td>EfficientNetV2-L</td><td>480²</td><td>121M</td><td>53B</td><td>85.7</td><td>86.8</td></tr><tr><td>NFNet-F3</td><td>4162²</td><td>255M</td><td>114.8B</td><td>85.7</td><td>=</td></tr><tr><td>NFNet-F5</td><td>5442</td><td>377M</td><td>289.8B</td><td>86.0</td><td>1</td></tr><tr><td rowspan="4">ViT-Stem TFM</td><td>DeiT-B</td><td>3842</td><td>86M</td><td>55.4B</td><td>83.1</td><td>-</td></tr><tr><td>ViT-L/16</td><td>384²</td><td>304M</td><td>190.7B</td><td>-</td><td>85.3</td></tr><tr><td>CaiT-S-36</td><td>384²</td><td>68M</td><td>48.0B</td><td>85.0</td><td></td></tr><tr><td>DeepViT-L</td><td>224²</td><td>55M</td><td>12.5B</td><td>83.1</td><td>-</td></tr><tr><td rowspan="2">Multi-stage TFM</td><td>Swin-B</td><td>384²</td><td>88M</td><td>47.0B</td><td>84.2</td><td>86.0</td></tr><tr><td>Swin-L</td><td>384²</td><td>197M</td><td>103.9B</td><td>-</td><td>86.4</td></tr><tr><td rowspan="5">Conv+TFM</td><td>BotNet-T7</td><td>3842</td><td>75.1M</td><td>45.8B</td><td>84.7</td><td>-</td></tr><tr><td>LambdaResNet-420</td><td>320²</td><td>-</td><td>=</td><td>84.8</td><td></td></tr><tr><td>T2T-ViT-24</td><td>224²</td><td>64.1M</td><td>15.0B</td><td>82.6</td><td>=</td></tr><tr><td>CvT-21</td><td>384²</td><td>32M</td><td>24.9B</td><td>83.3</td><td>-</td></tr><tr><td>CvT-W24</td><td>3842</td><td>277M</td><td>193.2B</td><td>-</td><td>87.7</td></tr><tr><td rowspan="19">Conv+TFM (ours)</td><td>CoAtNet-0 CoAtNet-1</td><td>224²</td><td>25M</td><td>4.2B</td><td>81.6</td><td>=</td></tr><tr><td></td><td>224²</td><td>42M</td><td>8.4B</td><td>83.3</td><td>-</td></tr><tr><td>CoAtNet-2 CoAtNet-3</td><td>224²</td><td>75M</td><td>15.7B</td><td>84.1</td><td>87.1</td></tr><tr><td></td><td>2242</td><td>168M</td><td>34.7B</td><td>84.5</td><td>87.6</td></tr><tr><td>CoAtNet-0</td><td>384²</td><td>25M</td><td>13.4B</td><td>83.9</td><td>-</td></tr><tr><td>CoAtNet-1</td><td>3842</td><td>42M</td><td>27.4B</td><td>85.1</td><td>-</td></tr><tr><td>CoAtNet-2</td><td>384²</td><td>75M</td><td>49.8B</td><td>85.7</td><td>87.1</td></tr><tr><td>CoAtNet-3</td><td>384²</td><td>168M</td><td>107.4B</td><td>85.8</td><td>87.6</td></tr><tr><td>CoAtNet-4</td><td>384²</td><td>275M</td><td>189.5B</td><td>-</td><td>87.9</td></tr><tr><td>+ PT-RA</td><td>384²</td><td>275M</td><td>189.5B</td><td></td><td>88.3</td></tr><tr><td>+ PT-RA-E150</td><td>3842</td><td>275M</td><td>189.5B</td><td></td><td>88.4</td></tr><tr><td>CoAtNet-2</td><td>5122</td><td>75M</td><td>96.7B</td><td>85.9</td><td>87.3</td></tr><tr><td>CoAtNet-3</td><td>512²</td><td>168M</td><td>203.1B</td><td>86.0</td><td>87.9</td></tr><tr><td>CoAtNet-4</td><td>512²</td><td>275M</td><td>360.9B</td><td>-</td><td>88.1</td></tr><tr><td>+ PT-RA</td><td>512²</td><td>275M</td><td>360.9B</td><td>=</td><td>88.4</td></tr><tr><td>+ PT-RA-E150</td><td>5122</td><td>275M</td><td>360.9B</td><td>=</td><td>88.56</td></tr></table>
|
| 152 |
+
|
| 153 |
+
ImageNet-21K As we can see from Table 4 and Fig. 3, when ImageNet-21K is used for pretraining, the advantage of CoAtNet becomes more obvious, substantially outperforming all previous models. Notably, the best CoAtNet variant achieves a top-1 accuracy of $8 8 . 5 6 \%$ , matching the ViTH/14 performance of $8 8 . 5 5 \%$ , which requires pre-training the $2 . 3 \mathbf { x }$ larger ViT model on a $2 3 \mathrm { x }$ larger proprietary weakly labeled dataset (JFT) for $2 . 2 \mathbf { x }$ more steps. This marks a dramatic improvement in both data efficiency and computation efficiency.
|
| 154 |
+
|
| 155 |
+
JFT Finally, in Table 5, we further evaluate CoAtNet under the large-scale data regime with JFT300M and JFT-3B. Encouragingly, our CoAtNet-4 can almost match the best previous performance with JFT-300M set by NFNet- $\mathrm { F 4 + }$ , while being $2 \mathbf { x }$ more efficient in terms of both TPU training time and parameter count. When we scale up the model to consume similar training resource as NFNet- $. \mathrm { F 4 + }$ , CoAtNet-5 reaches $8 9 . 7 7 \%$ on top-1 accuracy, outperforming previous results under comparable settings.
|
| 156 |
+
|
| 157 |
+
Moreover, as we further push the training resource towards the level used by ViT-G/14 and utilize the same JFT-3B dataset of an even larger size [26], with over $4 \mathbf { x }$ less computation, CoAtNet-6 is able to match the performance of $\mathrm { V i T - G } / 1 4$ of $9 0 . 4 5 \%$ , and with $1 . 5 \mathrm { x }$ less computation, CoAtNet-7 achieves $8 9 . 7 7 \%$ on top-1 accuracy $9 0 . 8 8 \%$ , achieving the new state-of-the-art performance.
|
| 158 |
+
|
| 159 |
+
Table 5: Performance Comparison on large-scale JFT dataset. TPUv3-core-days denotes the pretraining time, Top-1 Accuracy denotes the finetuned accuracy on ImageNet. Note that the last 3 rows use a larger dataset JFT-3B [26] for pre-training, while others use JFT-300M [15]. See Appendix A.2 for the size details of CoAtNet-5/6/7. †: Down-sampling in the MBConv block is achieved by stride-2 Depthwise Convolution. ⇧: ViT-G/14 computation consumption is read from Fig. 1 of the paper [26].
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Models</td><td>Eval Size</td><td>#Params</td><td>#FLOPs</td><td>TPUv3-core-days</td><td>Top-1 Accuracy</td></tr><tr><td>ResNet + ViT-L/16</td><td>3842</td><td>330M</td><td>=</td><td>1</td><td>87.12</td></tr><tr><td>ViT-L/16</td><td>5122</td><td>307M</td><td>364B</td><td>0.68K</td><td>87.76</td></tr><tr><td>ViT-H/14</td><td>5182</td><td>632M</td><td>1021B</td><td>2.5K</td><td>88.55</td></tr><tr><td>NFNet-F4+</td><td>5122</td><td>527M</td><td>367B</td><td>1.86K</td><td>89.2</td></tr><tr><td>CoAtNet-3t</td><td>3842</td><td>168M</td><td>114B</td><td>0.58K</td><td>88.52</td></tr><tr><td>CoAtNet-3t</td><td>5122</td><td>168M</td><td>214B</td><td>0.58K</td><td>88.81</td></tr><tr><td>CoAtNet-4</td><td>5122</td><td>275M</td><td>361B</td><td>0.95K</td><td>89.11</td></tr><tr><td>CoAtNet-5</td><td>5122</td><td>688M</td><td>812B</td><td>1.82K</td><td>89.77</td></tr><tr><td>ViT-G/14</td><td>5182</td><td>1.84B</td><td>5160B</td><td>>30K</td><td>90.45</td></tr><tr><td>CoAtNet-6</td><td>5122</td><td>1.47B</td><td>1521B</td><td>6.6K</td><td>90.45</td></tr><tr><td>CoAtNet-7</td><td>5122</td><td>2.44B</td><td>2586B</td><td>20.1K</td><td>90.88</td></tr></table>
|
| 162 |
+
|
| 163 |
+
# 4.3 Ablation Studies
|
| 164 |
+
|
| 165 |
+
In this section, we will ablate our design choices for CoAtNet.
|
| 166 |
+
|
| 167 |
+
Firstly, we study the importance of the relative attention from combining convolution and attention into a single computation unit. Specifically, we compare two models, one with the relative attention and the other without, under both the ImageNet-1K alone and ImageNet-21K transfer setting. As we can see from Table 6, when only the ImageNet-1K is used, relative attention clearly outperforms the standard attention, indicating a better generalization. In addition, under the ImageNet-21K transfer setting, the relative attention variant achieves a substantially better transfer accuracy, despite their very close pre-training performances. This suggests the main advantage of relative attention in visual processing is not in higher capacity but in better generalization.
|
| 168 |
+
|
| 169 |
+
Table 6: Ablation on relative attention.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Seting</td><td>Metric</td><td>With Rel-Attn</td><td>Without Rel-Attn</td></tr><tr><td rowspan="2">ImageNet-1K</td><td>Accuracy (2242)</td><td>84.1</td><td>83.8</td></tr><tr><td>Accuracy (3842)</td><td>85.7</td><td>85.3</td></tr><tr><td rowspan="2">ImageNet-21K →ImageNet-1K</td><td>Pre-train Precision@1 (224²)</td><td>53.0</td><td>52.8</td></tr><tr><td>Finetune Accuracy (384²)</td><td>87.9</td><td>87.4</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 7: Ablation on architecture layout.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Setting</td><td>Models</td><td>Layout</td><td>Top-1 Accuracy</td></tr><tr><td rowspan="3">ImageNet-1K</td><td>VO: CoAtNet-2</td><td>[2,2,6,14,2]</td><td>84.1</td></tr><tr><td>V1: S2← S3</td><td>[2,2, 2,18,2]</td><td>83.4</td></tr><tr><td>V2: S2→ S3</td><td>[2,2,8,12,2]</td><td>84.0</td></tr><tr><td>ImageNet-21K</td><td>VO: CoAtNet-3</td><td>[2,2,6,14,2]</td><td>53.0 -→87.6</td></tr><tr><td>⇒ImageNet-1K</td><td>V1: S2 ← S3</td><td>[2,2,2,18,2]</td><td>53.0 -→87.4</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Secondly, as S2 with MBConv blocks and S3 with relative Transformer blocks occupy most of the computation of the CoAtNet, a question to ask is how to split the computation between S2 (MBConv) and S3 (Transformer) to achieve a good performance. In practice, it boils down to deciding the number of blocks to have in each stage, which we will refer to as “layout” design. For this purpose, we compare a few different layouts that we experimented with in Table 7.
|
| 178 |
+
|
| 179 |
+
Table 8: Ablation on head size and normalization type.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Setting</td><td>Models</td><td>Image Size</td><td>Top-1 Accuracy</td></tr><tr><td rowspan="3">ImageNet-1K</td><td>CoAtNet-2</td><td>2242</td><td>84.1</td></tr><tr><td>Head size: 32 → 64</td><td>2242</td><td>83.9</td></tr><tr><td>Norm type: 1 BN →LN</td><td>2242</td><td>84.1</td></tr><tr><td rowspan="2">ImageNet-21K ⇒ ImageNet-1K</td><td>CoAtNet-3</td><td>3842</td><td>87.9</td></tr><tr><td>Norm type: BN →→ LN</td><td>384²</td><td>87.8</td></tr></table>
|
| 182 |
+
|
| 183 |
+
• If we keep the total number of blocks in S2 and S3 fixed and vary the number in each stage, we observe that V0 is a sweet spot between V1 and V2. Basically, having more Transformer blocks in S3 generally leads to better performance until the number of MBConv blocks in S2 is too small to generalize well.
|
| 184 |
+
|
| 185 |
+
• To further evaluate whether the sweet spot also holds in the transfer setting, where a higher capacity is often regarded more important, we further compare V0 and V1 under the ImageNet21K transferring to ImageNet-1K setup. Interestingly, despite that V1 and V0 have the same performance during ImageNet-21K pre-training, the transfer accuracy of V1 clearly falls behind V0. Again, this suggests the importance of convolution in achieving good transferability and generalization.
|
| 186 |
+
|
| 187 |
+
Lastly, we study two choices of model details, namely the dimension of each attention (default to 32) head as well as the type of normalization (default to BatchNorm) used in MBConv blocks. From Table 8, we can see increasing head size from 32 to 64 can slightly hurt performance, though it actually improves the TPU speed by a significant amount. In practice, this will be a quality-speed trade-off one can make. On the other hand, BatchNorm and LayerNorm have almost the same performance, while BatchNorm is $10 - 2 0 \%$ faster on TPU depending on the per-core batch size.
|
| 188 |
+
|
| 189 |
+
# 5 Conclusion
|
| 190 |
+
|
| 191 |
+
In this paper, we systematically study the properties of convolutions and Transformers, which leads to a principled way to combine them into a new family of models named CoAtNet. Extensive experiments show that CoAtNet enjoys both good generalization like ConvNets and superior model capacity like Transformers, achieving state-of-the-art performances under different data sizes and computation budgets.
|
| 192 |
+
|
| 193 |
+
Note that this paper currently focuses on ImageNet classification for model development. However, we believe our approach is applicable to broader applications like object detection and semantic segmentation. We will leave them for future work.
|
| 194 |
+
|
| 195 |
+
# References
|
| 196 |
+
|
| 197 |
+
[1] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012.
|
| 198 |
+
[2] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 199 |
+
[3] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 200 |
+
[4] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015.
|
| 201 |
+
[5] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. ICML, 2019.
|
| 202 |
+
[6] 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.
|
| 203 |
+
[7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 204 |
+
[8] 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.
|
| 205 |
+
[9] 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.
|
| 206 |
+
[10] 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.
|
| 207 |
+
[11] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
|
| 208 |
+
[12] Zhuoran Shen, Mingyuan Zhang, Haiyu Zhao, Shuai Yi, and Hongsheng Li. Efficient attention: Attention with linear complexities. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 3531–3539, 2021.
|
| 209 |
+
[13] 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.
|
| 210 |
+
[14] 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.
|
| 211 |
+
[15] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017.
|
| 212 |
+
[16] 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.
|
| 213 |
+
[17] Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
|
| 214 |
+
[18] Daquan Zhou, Bingyi Kang, Xiaojie Jin, Linjie Yang, Xiaochen Lian, Qibin Hou, and Jiashi Feng. Deepvit: Towards deeper vision transformer. arXiv preprint arXiv:2103.11886, 2021.
|
| 215 |
+
[19] Mingxing Tan and Quoc V Le. Efficientnetv2: Smaller models and faster training. ICML, 2021.
|
| 216 |
+
[20] Andrew Brock, Soham De, Samuel L Smith, and Karen Simonyan. High-performance largescale image recognition without normalization. arXiv preprint arXiv:2102.06171, 2021.
|
| 217 |
+
[21] Ashish Vaswani, Prajit Ramachandran, Aravind Srinivas, Niki Parmar, Blake Hechtman, and Jonathon Shlens. Scaling local self-attention for parameter efficient visual backbones. arXiv preprint arXiv:2103.12731, 2021.
|
| 218 |
+
[22] 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.
|
| 219 |
+
[23] 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.
|
| 220 |
+
[24] Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. Levit: a vision transformer in convnet’s clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021.
|
| 221 |
+
[25] 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.
|
| 222 |
+
[26] Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. arXiv preprint arXiv:2106.04560, 2021.
|
| 223 |
+
[27] 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, pages 4510–4520, 2018.
|
| 224 |
+
[28] Laurent Sifre. Rigid-motion scattering for image classification. Ph.D. thesis section 6.2, 2014.
|
| 225 |
+
[29] Mirgahney Mohamed, Gabriele Cesa, Taco S Cohen, and Max Welling. A data and compute efficient design for limited-resources deep learning. arXiv preprint arXiv:2004.09691, 2020.
|
| 226 |
+
[30] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
|
| 227 |
+
[31] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
|
| 228 |
+
[32] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pages 5156–5165. PMLR, 2020.
|
| 229 |
+
[33] Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020.
|
| 230 |
+
[34] 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.
|
| 231 |
+
[35] Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V Le. Mnasnet: Platform-aware neural architecture search for mobile. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2820–2828, 2019.
|
| 232 |
+
[36] 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.
|
| 233 |
+
[37] 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.
|
| 234 |
+
[38] Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Noam Shazeer, Ian Simon, Curtis Hawthorne, Andrew M Dai, Matthew D Hoffman, Monica Dinculescu, and Douglas Eck. Music transformer. arXiv preprint arXiv:1809.04281, 2018.
|
| 235 |
+
[39] Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 236 |
+
[40] Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov. Transformer dissection: A unified understanding of transformer’s attention via the lens of kernel. arXiv preprint arXiv:1908.11775, 2019.
|
| 237 |
+
[41] Irwan Bello. Lambdanetworks: Modeling long-range interactions without attention. arXiv preprint arXiv:2102.08602, 2021.
|
| 238 |
+
[42] 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.
|
| 239 |
+
[43] 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.
|
| 240 |
+
[44] 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.
|
| 241 |
+
[45] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 702–703, 2020.
|
| 242 |
+
[46] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 243 |
+
[47] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European conference on computer vision, pages 646–661. Springer, 2016.
|
| 244 |
+
[48] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 245 |
+
[49] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 246 |
+
[50] 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.
|
| 247 |
+
[51] Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 248 |
+
[52] Zihang Dai, Guokun Lai, Yiming Yang, and Quoc V Le. Funnel-transformer: Filtering out sequential redundancy for efficient language processing. arXiv preprint arXiv:2006.03236, 2020.
|
md/train/eVuMspr9cu5/eVuMspr9cu5.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CATs: Cost Aggregation Transformers for Visual Correspondence
|
| 2 |
+
|
| 3 |
+
Seokju Cho∗ Yonsei University
|
| 4 |
+
|
| 5 |
+
Sunghwan Hong∗ Korea University
|
| 6 |
+
|
| 7 |
+
Sangryul Jeon Yonsei University
|
| 8 |
+
|
| 9 |
+
Yunsung Lee Korea University
|
| 10 |
+
|
| 11 |
+
Kwanghoon Sohn Yonsei University
|
| 12 |
+
|
| 13 |
+
Seungryong Kim† Korea University
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
We propose a novel cost aggregation network, called Cost Aggregation Transformers (CATs), to find dense correspondences between semantically similar images with additional challenges posed by large intra-class appearance and geometric variations. Cost aggregation is a highly important process in matching tasks, which the matching accuracy depends on the quality of its output. Compared to handcrafted or CNN-based methods addressing the cost aggregation, in that either lacks robustness to severe deformations or inherit the limitation of CNNs that fail to discriminate incorrect matches due to limited receptive fields, CATs explore global consensus among initial correlation map with the help of some architectural designs that allow us to fully leverage self-attention mechanism. Specifically, we include appearance affinity modeling to aid the cost aggregation process in order to disambiguate the noisy initial correlation maps and propose multi-level aggregation to efficiently capture different semantics from hierarchical feature representations. We then combine with swapping self-attention technique and residual connections not only to enforce consistent matching, but also to ease the learning process, which we find that these result in an apparent performance boost. We conduct experiments to demonstrate the effectiveness of the proposed model over the latest methods and provide extensive ablation studies. Code and trained models are available at https://sunghwanhong.github.io/CATs/.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Establishing dense correspondences across semantically similar images can facilitate many Computer Vision applications, including semantic segmentation [46, 54, 36], object detection [29], and image editing [53, 30, 28, 25]. Unlike classical dense correspondence problems that consider visually similar images taken under the geometrically constrained settings [16, 19, 50, 18], semantic correspondence poses additional challenges from large intra-class appearance and geometric variations caused by the unconstrained settings of given image pair.
|
| 22 |
+
|
| 23 |
+
Recent approaches [42, 43, 45, 34, 37, 39, 31, 58, 47, 57, 51, 35] addressed these challenges by carefully designing deep convolutional neural networks (CNNs)-based models analogously to the classical matching pipeline [48, 41], feature extraction, cost aggregation, and flow estimation. Several works [24, 9, 37, 39, 47, 51] focused on the feature extraction stage, as it has been proven that the more powerful feature representation the model learns, the more robust matching is obtained [24, 9, 51]. However, solely relying on the matching similarity between features without any prior often suffers from the challenges due to ambiguities generated by repetitive patterns or background clutters [42, 24, 26]. On the other hand, some methods [42, 49, 43, 23, 26, 58] focused on flow estimation stage either by designing additional CNN as an ad-hoc regressor that predicts the parameters of a single global transformation [42, 43], finding confident matches from correlation maps [20, 26], or directly feeding the correlation maps into the decoder to infer dense correspondences [58]. However, these methods highly rely on the quality of the initial correlation maps.
|
| 24 |
+
|
| 25 |
+
The latest methods [45, 37, 44, 21, 31, 27, 35] have focused on the second stage, highlighting the importance of cost aggregation. Since the quality of correlation maps is of prime importance, they proposed to refine the matching scores by formulating the task as optimal transport problem [47, 31], re-weighting matching scores by Hough space voting for geometric consistency [37, 39], or utilizing high-dimensional 4D or 6D convolutions to find locally consistent matches [45, 44, 27, 35]. Although formulated variously, these methods either use hand-crafted techniques that are neither learnable nor robust to severe deformations, or inherit the limitation of CNNs, e.g., limited receptive fields, failing to discriminate incorrect matches that are locally consistent.
|
| 26 |
+
|
| 27 |
+
In this work, we focus on the cost aggregation stage, and propose a novel cost aggregation network to tackle aforementioned issues. Our network, called Cost Aggregation with Transformers (CATs), is based on Transformer [61, 10], which is renowned for its global receptive field. By considering all the matching scores computed between features of input images globally, our aggregation networks explore global consensus and thus refine the ambiguous or noisy matching scores effectively.
|
| 28 |
+
|
| 29 |
+
Specifically, based on the observation that desired correspondence should be aligned at discontinuities with appearance of images, we concatenate an appearance embedding with the correlation map, which helps to disambiguate the correlation map within the Transformer. To benefit from hierarchical feature representations, following [26, 39, 58], we use a stack of correlation maps constructed from multilevel features, and propose to effectively aggregate the scores across the multi-level correlation maps. Furthermore, we consider bidirectional nature of correlation map, and leverage the correlation map from both directions, obtaining reciprocal scores by swapping the pair of dimensions of correlation map in order to allow global consensus in both perspective. In addition to all these combined, we provide residual connections around aggregation networks in order to ease the learning process.
|
| 30 |
+
|
| 31 |
+
We demonstrate our method on several benchmarks [38, 11, 12]. Experimental results on various benchmarks prove the effectiveness of the proposed model over the latest methods for semantic correspondence. We also provide an extensive ablation study to validate and analyze components in CATs.
|
| 32 |
+
|
| 33 |
+
# 2 Related Work
|
| 34 |
+
|
| 35 |
+
Semantic Correspondence. Methods for semantic correspondence generally follow the classical matching pipeline [48, 41], including feature extraction, cost aggregation, and flow estimation. Most early efforts [7, 30, 11] leveraged the hand-crafted features which are inherently limited in capturing high-level semantics. Though using deep CNN-based features [5, 24, 42, 43, 23, 49, 26] has become increasingly popular thanks to their invariance to deformations, without a means to refine the matching scores independently computed between the features, the performance would be rather limited.
|
| 36 |
+
|
| 37 |
+
To alleviate this, several methods focused on flow estimation stage. Rocco et al. [42, 43] proposed an end-to-end network to predict global transformation parameters from the matching scores, and their success inspired many variants [49, 23, 25]. RTNs [23] obtain semantic correspondences through an iterative process of estimating spatial transformations. DGC-Net [34], Semantic-GLU-Net [58] and DMP [15] utilize a CNN-based decoder to directly find correspondence fields. PDC-Net [59] proposed a flexible probabilistic model that jointly learns the flow estimation and its uncertainty. Arguably, directly regressing correspondences from the initial matching scores highly relies on the quality of them.
|
| 38 |
+
|
| 39 |
+
Recent numerous methods [45, 37, 39, 31, 47, 51, 35] thus have focused on cost aggregation stage to refine the initial matching scores. Among hand-crafted methods, SCOT [31] formulates semantic correspondence as an optimal transport problem and attempts to solve two issues, namely many to one matching and background matching. HPF [37] first computes appearance matching confidence using hyperpixel features and then uses Regularized Hough Matching (RHM) algorithm for cost aggregation to enforce geometric consistency. DHPF [39], that replaces feature selection algorithm of HPF [37] with trainable networks, also uses RHM. However, these hand-crafted techniques for refining the matching scores are neither learnable nor robust to severe deformations. As learningbased approaches, NC-Net [45] utilizes 4D convolution to achieve local neighborhood consensus by finding locally consistent matches, and its variants [44, 27] proposed more efficient methods. GOCor [57] proposed aggregation module that directly improves the correlation maps. GSF [21] formulated pruning module to suppress false positives of correspondences in order to refine the initial correlation maps. CHM [35] goes one step further, proposing a learnable geometric matching algorithm which utilizes 6D convolution. However, they are all limited in the sense that they inherit limitation of CNN-based architectures, which is local receptive fields.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: Overall network architecture. Our networks consist of feature extraction, cost aggregation, and flow estimation modules. We first extract multi-level dense features and construct a stack of correlation maps. We then concatenate with embedded features and feed into the Transformer-based cost aggregator to obtain a refined correlation map. The flow is then inferred from the refined map.
|
| 43 |
+
|
| 44 |
+
Transformers in Vision. Transformer [61], the de facto standard for Natural Language Processing (NLP) tasks, has recently imposed significant impact on various tasks in Computer Vision fields such as image classification [10, 55], object detection [3, 62], tracking and matching [52, 51]. ViT [10], the first work to propose an end-to-end Transformer-based architecture for the image classification task, successfully extended the receptive field, owing to its self-attention nature that can capture global relationship between features. For visual correspondence, LoFTR [51] uses cross and self-attention module to refine the feature maps conditioned on both input images, and formulate the hand-crafted aggregation layer with dual-softmax [45, 60] and optimal transport [47] to infer correspondences. COTR [22] takes coordinates as an input and addresses dense correspondence task without the use of correlation map. Unlike these, for the first time, we propose a Transformer-based cost aggregation module.
|
| 45 |
+
|
| 46 |
+
# 3 Methodology
|
| 47 |
+
|
| 48 |
+
# 3.1 Motivation and Overview
|
| 49 |
+
|
| 50 |
+
Let us denote a pair of images, i.e., source and target, as $I _ { s }$ and $I _ { t }$ , which represent semantically similar images, and features extracted from $I _ { s }$ and $I _ { t }$ as $D _ { s }$ and $D _ { t }$ , respectively. Here, our goal is to establish a dense correspondence field $F ( i )$ between two images that is defined for each pixel $i$ , which warps $I _ { t }$ towards $I _ { s }$ .
|
| 51 |
+
|
| 52 |
+
Estimating the correspondence with sole reliance on matching similarities between $D _ { s }$ and $D _ { t }$ is often challenged by the ambiguous matches due to the repetitive patterns or background clutters [42, 24, 26]. To address this, numerous methods proposed cost aggregation techniques that focus on refining the initial matching similarities either by formulating the task as optimal transport problem [47, 31], using regularized Hough matching to re-weight the costs [37, 39], or 4D or 6D convolutions [45, 27, 44, 35]. However, these methods either use hand-crafted techniques that are weak to severe deformations, or fail to discriminate incorrect matches due to limited receptive fields.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Visualization of correlation map and self-attention: (a) source image, (b) target image, (c) raw correlation map, (d) self-attention, (e) refined correlation map, and (f) ground-truth, which are bilinearly upsampled. The visualization proves that CATs successfully aggregates the costs by integrating the surrounding information of the query, represented as green circle in the source.
|
| 56 |
+
|
| 57 |
+
To overcome these, we present Transformer-based cost aggregation networks that effectively integrate information present in all pairwise matching costs, dubbed CATs, as illustrated in Fig. 1. As done widely in other works [42, 45, 50, 34, 37], we follow the common practice for feature extraction and cost computation. In the following, we first explain feature extraction and cost computation, and then describe several critical design choices we made for effective aggregation of the matching costs.
|
| 58 |
+
|
| 59 |
+
# 3.2 Feature Extraction and Cost Computation
|
| 60 |
+
|
| 61 |
+
To extract dense feature maps from images, we follow [26, 37, 39] that use multi-level features for construction of correlation maps. We use CNNs that produce a sequence of $L$ feature maps, and $D ^ { l }$ represents a feature map at $l$ -th level. As done in [37], we use different combination of multi-level features depending on the dataset trained on, e.g., PF-PASCAL [12] or SPair-71k [38]. Given a sequence of feature maps, we resize all the selected feature maps to $\mathbb { R } ^ { h \times w \times c }$ , with height $h$ , width $w$ and $c$ channels. The resized features then undergo $l$ -2 normalization.
|
| 62 |
+
|
| 63 |
+
Given resized dense features $D _ { s }$ and $D _ { t }$ , we compute a correlation map $\mathcal { C } \in \mathbb { R } ^ { h w \times h w }$ using the inner product between features: $\mathcal { C } ( i , j ) = D _ { t } ( i ) \cdot D _ { s } ( j )$ with points $i$ and $j$ in the target and source features, respectively. In this way, all pairwise feature matches are computed and stored. However, raw matching scores contain numerous ambiguous matching points as exemplified in Fig. 2, which results inaccurate correspondences. To remedy this, we propose cost aggregation networks in the following that aim to refine the ambiguous or noisy matching scores.
|
| 64 |
+
|
| 65 |
+
# 3.3 Transformer Aggregator
|
| 66 |
+
|
| 67 |
+
Renowned for its global receptive fields, one of the key elements of Transformer [61] is the selfattention mechanism, which enables finding the correlated input tokens by first feeding into scaled dot product attention function, normalizing with Layer Normalization (LN) [1], and passing the normalized values to a MLP. Several works [10, 3, 62, 51] have shown that given images or features as input, Transformers [61] integrate the global information in a flexible manner by learning to find the attention scores for all pairs of tokens.
|
| 68 |
+
|
| 69 |
+
In this paper, we leverage the Transformers to integrate the matching scores to discover global consensus by considering global context information. Specifically, we obtain a refined cost $\scriptstyle { \mathcal { C } } ^ { \prime }$ by feeding the raw cost $\mathcal { C }$ to the Transformer $\tau$ , consisting of self-attention, LN, and MLP modules:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r } { \mathcal { C } ^ { \prime } = \mathcal { T } ( \mathcal { C } + E _ { \mathrm { p o s } } ) , } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $E _ { \mathrm { p o s } }$ denotes positional embedding. The standard Transformer receives as input a 1D sequence of token embeddings. In our context, we reshape the correlation map $\mathcal { C }$ into a sequence of vectors $\mathcal { C } ( k ) \in \mathbb { R } ^ { 1 \times h w }$ for $k \in \{ 1 , . . . , h w \}$ . We visualize the refined correlation map with self-attention in Fig. 2, where the ambiguities are significantly resolved.
|
| 76 |
+
|
| 77 |
+
Appearance Affinity Modeling. When only matching costs are considered for aggregation, selfattention layer processes the correlation map itself disregarding the noise involved in the correlation map, which may lead to inaccurate correspondences. Rather than solely relying on raw correlation map, we additionally provide an appearance embedding from input features to disambiguate the correlation map aided by appearance affinity within the Transformer. Intuition behind is that visually similar points in an image, e.g., color or feature, have similar correspondences, as proven in stereo matching literature, e.g., Cost Volume Filtering (CVF) [16, 50].
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: Illustration of Transformer aggregator. Given correlation maps $\mathcal { C }$ with projected features, Transformer aggregation consisting of intra- and inter-correlation self-attention with LN and MLP refines the inputs not only across spatial domains but across levels.
|
| 81 |
+
|
| 82 |
+
To provide appearance affinity, we propose to concatenate embedded features projected from input features with the correlation map. We first feed the features $D$ into linear projection networks, and then concatenate the output along corresponding dimension, so that the correlation map is augmented such that $[ \mathcal { C } , \mathcal { P } ( D ) ] \in \bar { \mathbb { R } } ^ { h w \times ( h \bar { w } + p ) }$ , where $[ \cdot ]$ denotes concatenation, $\mathcal { P }$ denotes linear projection networks, and $p$ is channel dimension of embedded feature. Within the Transformer, self-attention layer aggregates the correlation map and passes the output to the linear projection networks to retain the size of original correlation $\mathcal { C }$ .
|
| 83 |
+
|
| 84 |
+
Multi-Level Aggregation. As shown in [37, 34, 39, 58, 31], leveraging multi-level features allows capturing hierarchical semantic feature representations. Thus we also use multi-level features from different levels of convolutional layers to construct a stack of correlation maps. Each correlation map $\mathcal { C } ^ { l }$ computed between $D _ { s } ^ { l }$ and $D _ { \mathrm { \it t } } ^ { l }$ is concatenated with corresponding embedded features and fed into the aggregation networks. The aggregation networks now consider multiple correlations, aiming to effectively aggregates the matches by the hierarchical semantic representations.
|
| 85 |
+
|
| 86 |
+
As shown in Fig. 3, a stack of $L$ augmented correlation maps, $[ \mathcal { C } ^ { l } , \mathcal { P } ( D ^ { l } ) ] _ { l = 1 } ^ { L } \in \mathbb { R } ^ { h w \times ( h w + p ) \times L }$ , undergo the Transformer aggregator. For each $l$ -th augmented correlation map, we aggregate with self-attention layer across all the points in the augmented correlation map, and we refer this as intra-correlation self-attention. In addition, subsequent to this, the correlation map undergoes intercorrelation self-attention across multi-level dimensions. Contrary to HPF [37] that concatenates all the multi-level features and compute a correlation map, which disregards the level-wise similarities, within the inter-correlation layer of the proposed model, the similar matching scores are explored across multi-level dimensions. In this way, we can embrace richer semantics in different levels of feature maps, as shown in Fig. 4.
|
| 87 |
+
|
| 88 |
+
# 3.4 Cost Aggregation with Transformers
|
| 89 |
+
|
| 90 |
+
By leveraging the Transformer aggregator, we present cost aggregation framework with following additional techniques to improve the performance.
|
| 91 |
+
|
| 92 |
+
Swapping Self-Attention. To obtain a refined correlation map invariant to order of the input images and impose consistent matching scores, we argue that reciprocal scores should be used as aids to infer confident correspondences. As correlation map contains bidirectional matching scores, from both target and source perspective, we can leverage matching similarities from both directions in order to obtain more reciprocal scores as done similarly in other works [45, 26].
|
| 93 |
+
|
| 94 |
+
As shown in Fig. 1, we first feed the augmented correlation map to the aforementioned Transformer aggregator. Then we transpose the output, swapping the pair of dimensions in order to concatenate with the embedded feature from the other image, and feed into the subsequent another aggregator. Note that we share the parameters of the Transformer aggregators to obtain reciprocal scores. Formally, we define the whole process as following:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r l } & { \boldsymbol { \mathcal { S } } = \mathcal { T } ( [ \mathcal { C } ^ { l } , \mathcal { P } ( D _ { t } ^ { l } ) ] _ { l = 1 } ^ { L } + E _ { \mathrm { p o s } } ) , } \\ & { \boldsymbol { \mathcal { C } } ^ { \prime } = \mathcal { T } ( [ ( \boldsymbol { \mathcal { S } } ^ { l } ) ^ { \mathrm { T } } , \mathcal { P } ( D _ { s } ^ { l } ) ] _ { l = 1 } ^ { L } + E _ { \mathrm { p o s } } ) , } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\begin{array} { r } { \mathcal { C } ^ { \mathrm { T } } ( i , j ) = \mathcal { C } ( j , i ) } \end{array}$ denotes swapping the pair of dimensions corresponding to the source and target images; $s$ denotes the intermediate correlation map before swapping the axis. Note that NC-Net [45] proposed a similar procedure, but instead of processing serially, they separately process the correlation map and its transposed version and add the outputs, which is designed to produce a correlation map invariant to the particular order of the input images. Unlike this, we process the correlation map serially, first aggregating one pair of dimensions and then further aggregating with respect to the other pair. In this way, the subsequent attention layer is given more consistent matching scores as an input, allowing further reduction of inconsistent matching scores. We include an ablation study to justify our choice in Section 4.4
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 4: Visualization of multi-level aggregation: (a) source, (b) target images, (c), (d) multi-level correlation maps (e.g., $l = 1$ and $l = 3$ ), respectively, and final correlation maps by (e) HPF [37] and (f) CATs. Note that HPF and CATs utilize the same feature maps. Compared to HPF, CATs successfully embrace richer semantics in different levels of feature map.
|
| 104 |
+
|
| 105 |
+
Residual Connection. At the initial phase when the correlation map is fed into the Transformers, noisy score maps are inferred due to randomly-initialized parameters, which could complicate the learning process. To stabilize the learning process and provide a better initialization for the matching, we employ the residual connection. Specifically, we enforce the cost aggregation networks to estimate the residual correlation by adding residual connection around aggregation networks.
|
| 106 |
+
|
| 107 |
+
# 3.5 Training
|
| 108 |
+
|
| 109 |
+
Data Augmentation. Transformer is well known for lacking some of inductive bias and its datahungry nature thus necessitates a large quantity of training data to be fed [61, 10]. Recent methods [55, 56, 32] that employ the Transformer to address Computer Vision tasks have empirically shown that data augmentation techniques have positive impact on performance. However, in correspondence task, the question of to what extent can data augmentation affect the performance has not yet been properly addressed. From the experiments, we empirically find that data augmentation has positive impacts on performance in semantic correspondence with Transformers as reported in Section 4.4. To apply data augmentation [6, 2] with predetermined probabilities to input images at random. Specifically, $5 0 \%$ of the time, we randomly crop the input image, and independently for each augmentation function used in [6], we set the probability for applying the augmentation as $2 0 \%$ . More details can be found in supplementary material.
|
| 110 |
+
|
| 111 |
+
Training Objective. As in [37, 39, 35], we assume that the ground-truth keypoints are given for each pair of images. We first average the stack of refined correlation maps $\mathcal { C } ^ { \prime } \in \overline { { \mathbb { R } } } ^ { h w \times h w \times L }$ to obtain $\mathcal { C } ^ { \prime \prime } \in \overset { \cdot } { \mathbb { R } } ^ { h w \times h w }$ and then transform it into a dense flow field $F _ { \mathrm { p r e d } }$ using soft-argmax operator [26]. Subsequently, we compare the predicted dense flow field with the ground-truth flow field $F _ { \mathrm { G T } }$ obtained by following the protocol of [37] using input keypoints. For the training objective, we utilize Average End-Point Error (AEPE) [34], computed by averaging the Euclidean distance between the ground-truth and estimated flow. We thus formulate the objective function as $\mathcal { L } = \| F _ { \mathrm { G T } } - F _ { \mathrm { p r e d } } \| _ { 2 }$ .
|
| 112 |
+
|
| 113 |
+
# 4 Experiments
|
| 114 |
+
|
| 115 |
+
# 4.1 Implementation Details
|
| 116 |
+
|
| 117 |
+
For backbone feature extractor, we use ResNet-101 [14] pre-trained on ImageNet [8], and following [37], extract the features from the best subset layers. Other backbone features can also be used, which we analyze the effect of various backbone features in the following ablation study. For the hyper-parameters for Transformer encoder, we set the depth as 1 and the number of heads as 6. We resize the spatial size of the input image pairs to $2 5 6 \times 2 5 6$ and a sequence of selected features are resized to $1 6 \times 1 6$ . We use a learnable positional embedding [10], instead of fixed [61]. We implemented our network using PyTorch [40], and AdamW [33] optimizer with an initial learning rate of 3e−5 for the CATs layers and 3e−6 for the backbone features are used, which we gradually decrease during training.
|
| 118 |
+
|
| 119 |
+
Table 1: Quantitative evaluation on standard benchmarks [38, 11, 12]. Higher PCK is better. The best results are in bold, and the second best results are underlined. CATs† means CATs without fine-tuning feature backbone. Feat.-level: Feature-level, FT. feat.: Fine-tune feature.
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Methods</td><td rowspan="2">Feat.-level</td><td rowspan="2">FT. feat.</td><td rowspan="2">Aggregation</td><td rowspan="2">SPair-71k [38] PCK @ αbbox 0.1</td><td colspan="2">PF-PASCAL [12] PCK @ Qimg</td><td rowspan="2"></td><td colspan="2">PF-WILLOW[11]</td></tr><tr><td>0.05</td><td>0.1 0.15</td><td>PCK @ αbbox 0.05</td><td>0.1 0.15</td></tr><tr><td>WTA</td><td>Single</td><td>X</td><td>■</td><td>25.7</td><td>35.2</td><td>53.3</td><td>62.8</td><td>24.7 46.9</td><td>59.0</td></tr><tr><td>CNNGeo [42]</td><td>Single</td><td>X</td><td></td><td>20.6</td><td>41.0</td><td>69.5</td><td>80.4</td><td>36.9 69.2</td><td>77.8</td></tr><tr><td>A2Net [49]</td><td>Single</td><td>X</td><td></td><td>22.3</td><td>42.8</td><td>70.8</td><td>83.3</td><td>36.3 68.8</td><td>84.4</td></tr><tr><td>WeakAlign [43]</td><td>Single</td><td>X</td><td></td><td>20.9</td><td>49.0</td><td>74.8</td><td>84.0</td><td>37.0 70.2</td><td>79.9</td></tr><tr><td>RTNs [23]</td><td>Single</td><td>X</td><td></td><td>25.7</td><td>55.2</td><td>75.9</td><td>85.2</td><td>41.3 71.9</td><td>86.2</td></tr><tr><td>SFNet [26]</td><td>Multi</td><td>X</td><td></td><td>-</td><td>53.6</td><td>81.9</td><td>90.6</td><td>46.3 74.0</td><td>84.2</td></tr><tr><td>NC-Net [45]</td><td>Single</td><td>√</td><td>4D Conv.</td><td>20.1</td><td>54.3</td><td>78.9</td><td>86.0</td><td>33.8 67.0</td><td>83.7</td></tr><tr><td>DCC-Net[17]</td><td>Single</td><td>X</td><td>4D Conv.</td><td>=</td><td>55.6</td><td>82.3</td><td>90.5</td><td>43.6 73.8</td><td>86.5</td></tr><tr><td>HPF[37]</td><td>Multi</td><td>-</td><td>RHM</td><td>28.2</td><td>60.1</td><td>84.8</td><td>92.7</td><td>45.9 74.4</td><td>85.6</td></tr><tr><td>GSF [21]</td><td>Multi</td><td>X</td><td>2D Conv.</td><td>36.1</td><td>65.6</td><td>87.8</td><td>95.9</td><td>49.1 78.7</td><td>90.2</td></tr><tr><td>ANC-Net [27]</td><td>Single</td><td>X</td><td>4D Conv.</td><td>-</td><td>-</td><td>86.1</td><td></td><td>=</td><td>=</td></tr><tr><td>DHPF [39]</td><td>Multi</td><td>X</td><td>RHM</td><td>37.3</td><td>75.7</td><td>90.7</td><td>95.0</td><td>49.5 77.6</td><td>89.1</td></tr><tr><td>SCOT[31]</td><td>Multi</td><td>-</td><td>OT-RHM</td><td>35.6</td><td>63.1</td><td>85.4</td><td>92.7</td><td>47.8 76.0</td><td>87.1</td></tr><tr><td>CHM[35]</td><td>Single</td><td>√</td><td>6D Conv.</td><td>46.3</td><td>80.1</td><td>91.6</td><td>94.9</td><td>52.7 79.4</td><td>87.5</td></tr><tr><td>CATst</td><td>Multi</td><td>X</td><td>Transformer</td><td>42.4</td><td>67.5</td><td>89.1</td><td>94.9</td><td>46.6 75.6</td><td>87.5</td></tr><tr><td>CATs</td><td>Multi</td><td></td><td>Transformer</td><td>49.9</td><td>75.4</td><td>92.6</td><td>96.4</td><td>50.3 79.2</td><td>90.3</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 2: Per-class quantitative evaluation on SPair-71k [38] benchmark.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Methods</td><td>aero.</td><td>bike</td><td>bird</td><td>boat</td><td>bott.</td><td>bus</td><td>car</td><td>cat</td><td>chai.</td><td>cow</td><td>dog</td><td>hors.</td><td>mbik.</td><td>pers.</td><td>plan.</td><td>shee.</td><td>trai.</td><td>tv</td><td>all</td></tr><tr><td>CNNGeo [42]</td><td>23.4</td><td>16.7</td><td>40.2</td><td>14.3</td><td>36.4</td><td>27.7</td><td>26.0</td><td>32.7</td><td>12.7</td><td>27.4</td><td>22.8</td><td>13.7</td><td>20.9</td><td>21.0</td><td>17.5</td><td>10.2</td><td>30.8</td><td>34.1</td><td>20.6</td></tr><tr><td>A2Net[49]</td><td>22.6</td><td>18.5</td><td>42.0</td><td>16.4</td><td>37.9</td><td>30.8</td><td>26.5</td><td>35.6</td><td>13.3</td><td>29.6</td><td>24.3</td><td>16.0</td><td>21.6</td><td>22.8</td><td>20.5</td><td>13.5</td><td>31.4</td><td>36.5</td><td>22.3</td></tr><tr><td>WeakAlign [43]</td><td>22.2</td><td>17.6</td><td>41.9</td><td>15.1</td><td>38.1</td><td>27.4</td><td>27.2</td><td>31.8</td><td>12.8</td><td>26.8</td><td>22.6</td><td>14.2</td><td>20.0</td><td>22.2</td><td>17.9</td><td>10.4</td><td>32.2</td><td>35.1</td><td>20.9</td></tr><tr><td>NC-Net [45]</td><td>17.9</td><td>12.2</td><td>32.1</td><td>11.7</td><td>29.0</td><td>19.9</td><td>16.1</td><td>39.2</td><td>9.9</td><td>23.9</td><td>18.8</td><td>15.7</td><td>17.4</td><td>15.9</td><td>14.8</td><td>9.6</td><td>24.2</td><td>31.1</td><td>20.1</td></tr><tr><td>HPF[37]</td><td>25.2</td><td>18.9</td><td>52.1</td><td>15.7</td><td>38.0</td><td>22.8</td><td>19.1</td><td>52.9</td><td>17.9</td><td>33.0</td><td>32.8</td><td>20.6</td><td>24.4</td><td>27.9</td><td>21.1</td><td>15.9</td><td>31.5</td><td>35.6</td><td>28.2</td></tr><tr><td>SCOT[31]</td><td>34.9</td><td>20.7</td><td>63.8</td><td>21.1</td><td>43.5</td><td>27.3</td><td>21.3</td><td>63.1</td><td>20.0</td><td>42.9</td><td>42.5</td><td>31.1</td><td>29.8</td><td>35.0</td><td>27.7</td><td>24.4</td><td>48.4</td><td>40.8</td><td>35.6</td></tr><tr><td>DHPF[39]</td><td>38.4</td><td>23.8</td><td>68.3</td><td>18.9</td><td>42.6</td><td>27.9</td><td>20.1</td><td>61.6</td><td>22.0</td><td>46.9</td><td>46.1</td><td>33.5</td><td>27.6</td><td>40.1</td><td>27.6</td><td>28.1</td><td>49.5</td><td>46.5</td><td>37.3</td></tr><tr><td>CHM [35]</td><td>49.6</td><td>29.3</td><td>68.7</td><td>29.7</td><td>45.3</td><td>48.4</td><td>39.5</td><td>64.9</td><td>20.3</td><td>60.5</td><td>56.1</td><td>46.0</td><td>33.8</td><td>44.3</td><td>38.9</td><td>314</td><td>72.2</td><td>55.5</td><td>46.3</td></tr><tr><td>CATst</td><td>46.5</td><td>26.9</td><td>69.1</td><td>24.3</td><td>44.3</td><td>38.5</td><td>30.2</td><td>65.7</td><td>15.9</td><td>53.7</td><td>52.2</td><td>46.7</td><td>32.7</td><td>35.2</td><td>32.2</td><td>31.2</td><td>68.0</td><td>49.1</td><td>42.4</td></tr><tr><td>CATs</td><td>52.0</td><td>34.7</td><td>72.2</td><td>34.3</td><td>49.9</td><td>57.5</td><td>43.6</td><td>66.5</td><td>24.4</td><td>63.2</td><td>56.5</td><td>52.0</td><td>42.6</td><td>41.7</td><td>43.0</td><td>33.6</td><td>72.6</td><td>58.0</td><td>49.9</td></tr></table>
|
| 126 |
+
|
| 127 |
+
# 4.2 Experimental Settings
|
| 128 |
+
|
| 129 |
+
In this section, we conduct comprehensive experiments for semantic correspondence, by evaluating our approach through comparisons to state-of-the-art methods including CNNGeo [42], A2Net [49], WeakAlign [43], NC-Net [45], RTNs [23], SFNet [26], HPF [37], DCC-Net [17], ANC-Net [27], DHPF [39], SCOT [31], GSF [21], and CHMNet [35]. In Section 4.3, we first evaluate matching results on several benchmarks with quantitative measures, and then provide an analysis of each component in our framework in Section 4.4. For more implementation details, please refer to our implementation available at https://github.com/SunghwanHong/CATs.
|
| 130 |
+
|
| 131 |
+
Datasets. SPair-71k [38] provides total 70,958 image pairs with extreme and diverse viewpoint, scale variations, and rich annotations for each image pair, e.g., keypoints, scale difference, truncation and occlusion difference, and clear data split. Previously, for semantic matching, most of the datasets are limited to a small quantity with similar viewpoints and scales [11, 12]. As our network relies on Transformer which requires a large number of data for training, SPair-71k [38] makes the use of Transformer in our model feasible. we also consider PF-PASCAL [12] containing 1,351 image pairs from 20 categories and PF-WILLOW [11] containing 900 image pairs from 4 categories, each dataset providing corresponding ground-truth annotations.
|
| 132 |
+
|
| 133 |
+
Evaluation Metric. For evaluation on SPair-71k [38], PF-WILLOW [11], and PF-PASCAL [12], we employ a percentage of correct keypoints (PCK), computed as the ratio of estimated keypoints within the threshold from ground-truths to the total number of keypoints. Given predicted keypoint $k _ { \mathrm { p r e d } }$ and ground-truth keypoint $k _ { \mathrm { G T } }$ , we count the number of predicted keypoints that satisfy following condition: $d ( k _ { \mathrm { p r e d } } , k _ { \mathrm { G T } } ) \leq \alpha \cdot \operatorname* { m a x } ( H , W )$ , where $d ( \cdot )$ denotes Euclidean distance; $\alpha$ denotes a threshold which we evaluate on PF-PASCAL with $\alpha _ { \mathrm { i m g } }$ , SPair-71k and PF-WILLOW with $\alpha _ { \mathrm { b b o x } }$ ; $H$ and $W$ denote height and width of the object bounding box or entire image, respectively.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 5: Qualitative results on SPair-71k [38]: (from top to bottom) keypoints transfer results by SCOT [31], DHPF [39], and CATs. Note that green and red line denotes correct and wrong prediction, respectively, with respect to the ground-truth.
|
| 137 |
+
|
| 138 |
+
# 4.3 Matching Results
|
| 139 |
+
|
| 140 |
+
For a fair comparison, we follow the evaluation protocol of [37] for SPair-71k, which our network is trained on the training split and evaluated on the test split. Similarly, for PF-PASCAL and PFWILLOW, following the common evaluation protocol of [13, 23, 17, 37, 39], we train our network on the training split of PF-PASCAL [12] and then evaluate on the test split of PF-PASCAL [12] and PF-WILLOW [11]. All the results of other methods are reported under identical setting.
|
| 141 |
+
|
| 142 |
+
Table 1 summarizes quantitative results on SPair-71k [38], PF-PASCAL [12] and PF-WILLOW [11]. We note whether each method leverages multi-level features and fine-tunes the backbone features in order to ensure a fair comparison. We additionally denote the types of cost aggregation. Generally, our CATs outperform other methods over all the benchmarks. This is also confirmed by the results on SPair-71k, as shown in Table 2, where the proposed method outperforms other methods by large margin. Note that CATs† reports lower PCK than that of CHM, and this is because CHM fine-tunes its backbone networks while CATs† does not. Fig. 5 visualizes qualitative results for extremely challenging image pairs. We observe that compared to current state-of-the-art methods [31, 39], our method is capable of suppressing noisy scores and find accurate correspondences in cases with large scale and geometric variations.
|
| 143 |
+
|
| 144 |
+
It is notable that CATs generally report lower PCK on PF-WILLOW [11] compared to other stateof-the-art methods. This is because the Transformer is well known for lacking some of inductive bias. When we evaluate on PF-WILLOW, we infer with the model trained on the training split of PFPASCAL, which only contains 1,351 image pairs, and as only relatively small quantity of image pairs is available within the PF-PASCAL training split, the Transformer shows low generalization power. This demonstrates that the Transformer-based architecture indeed requires a means to compensate for the lack of inductive bias, e.g., data augmentation.
|
| 145 |
+
|
| 146 |
+
# 4.4 Ablation Study
|
| 147 |
+
|
| 148 |
+
In this section we show an ablation analysis to validate critical components we made to design our architecture, and provide an analysis on use of different backbone features, and data augmentation. We train all the variants on the training split of SPair-71k [38] when evaluating on SPair-71k, and train on PF-PASCAL [12] for evaluating on PF-PASCAL. We measure the PCK, and each ablation experiment is conducted under same experimental setting for a fair comparison.
|
| 149 |
+
|
| 150 |
+
Network Architecture. Table 3 shows the analysis on key components in our architecture. There are four key components we analyze for the ablation study, including appearance modelling, multilevel aggregation, swapping self-attention, and residual connection.
|
| 151 |
+
|
| 152 |
+
We first define the model without any of these as baseline, which simply feeds the correlation map into the selfattention layer. We evaluate on SPair-71k benchmark by progressively adding the each key component. From I to $\mathbf { V }$ , we observe consistent increase in performance when each component is added. II shows a large improvement in performance, which demonstrates that the appearance modelling enabled the model to refine the ambiguous or noisy matching scores. Although relatively small increase in PCK for III, it proves that the proposed model successfully aggregates the multi-level correlation maps. Furthermore, $\mathbf { I V }$ and $\mathbf { V }$ show apparent increase, proving the significance of both components.
|
| 153 |
+
|
| 154 |
+
Table 3: Ablation study of CATs.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Components</td><td>SPair-71k Qbbox =0.1</td></tr><tr><td>(I) Baseline</td><td>26.8</td></tr><tr><td>(II) + Appearance Modelling</td><td>33.5</td></tr><tr><td>(IⅢI) + Multi-level Aggregation</td><td>35.9</td></tr><tr><td>(IV) + Swapping Self-Attention</td><td>38.8</td></tr><tr><td>(V + Residual Connection</td><td>42.4</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Feature Backbone. As shown in Table 4, we explore the impact of different feature backbones on the performance on SPair-71k [38] and PF-PASCAL [12]. We report the results of models with backbone networks frozen. The top two rows are models with DeiT-B [55], next two rows use DINO [4], and the rest use ResNet101 [14] as backbone. Specifically, subscript single for DeiT-B and DINO, we use the feature map extracted at the last layer for the singlelevel, while for subscript all, every feature map
|
| 159 |
+
|
| 160 |
+
Table 4: Ablation study of feature backbone.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Feature Backbone</td><td>SPair-71k @bbox = 0.1</td><td>PF-PASCAL Qimg= 0.1</td></tr><tr><td>DeiT-Bgingle[55]</td><td>32.1</td><td>76.5</td></tr><tr><td>DeiT-Bal1 [55]</td><td>38.2</td><td>87.5</td></tr><tr><td>DINO w/ ViT-B/16sing1e [4] DINO w/ViT-B/16a11 [4]</td><td>39.5</td><td>88.9</td></tr><tr><td></td><td>42.0</td><td>88.9</td></tr><tr><td>ResNet-101sing1e [14]</td><td>37.4</td><td>87.3</td></tr><tr><td>ResNet-101mu1ti[14]</td><td>42.4</td><td>89.1</td></tr></table>
|
| 163 |
+
|
| 164 |
+
from 12 layers is used for cost construction. For ResNet-101 subscript single, we use a single-level feature cropped at $\mathrm { c o n v 4 - 2 3 }$ , while for multi, we use the best layer subset provided by [37]. Summarizing the results, we observed that leveraging multi-level features showed apparent improvements in performance, proving effectiveness of multi-level aggregation introduced by our method. It is worth noting that DINO, which is more excel at dense tasks than DeiT-B, outperforms DeiT-B when applied to semantic matching. This indicates that fine-tuning the feature could enhance the performance. To best of our knowledge, we are the first to employ Transformer-based features for semantic matching. It would be an interesting setup to train an end-to-end Transformer-based networks, and we hope this work draws attention from community and made useful for future works.
|
| 165 |
+
|
| 166 |
+
Data Augmentation. In Table 5, we compared the PCK performance between our variants and DHPF [39]. We note if the model is trained with augmentation. For a fair comparison, we evaluate both DHPF [39] and CATs trained on SPair-71k [38] using strong supervision, which assumes that the ground-truth keypoints are given. The results show that compared to DHPF, a CNN-based method, data augmentation has a larger influence on CATs in terms of performance. This demonstrates that not only we eased the data-hunger problem inherent in Transformers, but also found that applying augmentations for matching has positive effects. Augmentation technique would bring a highly likely improvements in performance, and we hope that the future works benefit from this.
|
| 167 |
+
|
| 168 |
+
Table 5: Effects of augmentation.
|
| 169 |
+
|
| 170 |
+
<table><tr><td></td><td>Augment.</td><td>SPair-71k αbbox = 0.1</td></tr><tr><td>DHPF[39]</td><td></td><td>37.3</td></tr><tr><td>DHPF [39]</td><td>X</td><td>39.4</td></tr><tr><td>CATs</td><td>A</td><td>43.5</td></tr><tr><td>CATs</td><td></td><td>49.9</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Serial swapping. It is apparent that Equation 2 is not designed for an order-invariant output. Different from NC-Net [45], we let the correlation map undergo the self-attention module in a serial manner. We conducted a simple experiment to compare the difference between each approach. From experiments, we obtained the results of parallel and serial processing on SPair-71k with $\alpha _ { \mathrm { b b o x } } = 0 . 1$ , which are PCK of 40.8 and 42.4, respectively. In light of this, although CATs may not support order invariance, adopting serial processing can obtain higher PCK as it has a better capability to reduce inconsistent matching scores by additionally processing the already processed cost map, which we finalize the architecture to include serial processing.
|
| 173 |
+
|
| 174 |
+
# 4.5 Analysis
|
| 175 |
+
|
| 176 |
+
Visualizing Self-Attention. We visualize the multi-level attention maps obtained from the Transformer aggregator. As shown in Fig. 6, the learned self-attention map at each level exhibits different aspect. With these self-attentions, our networks can leverage multi-level correlations to capture hierarchical semantic feature representations effectively.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 6: Visualization of self-attention: (from left to right) source and target images, and multilevel self-attentions. Note that each attention map attends different aspects, and CATs aggregates the cost leveraging hierarchical semantic representations.
|
| 180 |
+
|
| 181 |
+
Memory and run-time. In Table 6, we show the memory and run-time comparison to NCNet [45], SCOT [31], DHPF [39] and CHM [35] with CATs. For a fair comparison, the results are obtained using a single NVIDIA GeForce RTX 2080 Ti GPU and Intel Core i7-10700 CPU. We measure the inference time for both the process without counting feature extraction, and the whole process. Thanks to Transformers’ fast com
|
| 182 |
+
|
| 183 |
+
Table 6: Memory and run-time comparison. Inference time for aggregator is denoted by (·).
|
| 184 |
+
|
| 185 |
+
<table><tr><td></td><td>Aggregation</td><td>Memory [GB]</td><td>Run-time [ms]</td></tr><tr><td>NC-Net [45]</td><td>4D Conv.</td><td>1.2</td><td>193.3 (166.1)</td></tr><tr><td>SCOT [31]</td><td>OT-RHM</td><td>4.6</td><td>146.5 (81.6)</td></tr><tr><td>DHPF [39]</td><td>RHM</td><td>1.6</td><td>57.7 (29.5)</td></tr><tr><td>CHM [35]</td><td>6D Conv</td><td>1.6</td><td>47.2 (38.3)</td></tr><tr><td>CATs</td><td>Transformer</td><td>1.9</td><td>34.5 (7.4)</td></tr></table>
|
| 186 |
+
|
| 187 |
+
putation nature, compared to other methods, our method is beyond compare. We also find that compared to other cost aggregation methods including 4D, 6D convolutons, OT-RHM and RHM, ours show comparable efficiency in terms of computational cost. Note that NC-Net utilizes a single feature map while other methods utilize multi-level feature maps. We used the standard self-attention module for implementation, but more advanced and efficient transformer [32] architectures could reduce the overall memory consumption.
|
| 188 |
+
|
| 189 |
+
# 4.6 Limitations
|
| 190 |
+
|
| 191 |
+
One obvious limitation that CATs possess is that when applying the method to non-corresponding images, the proposed method would still deliver correspondences as it lacks power to ignore pixels that do not have correspondence at all. A straightforward solution would be to consider including a module to account for pixel-wise matching confidence. Another limitation of CATs would be its inability to address a task of finding accurate correspondences given multi-objects or non-corresponding objects. Addressing such challenges would be a promising direction for future work.
|
| 192 |
+
|
| 193 |
+
# 5 Conclusion
|
| 194 |
+
|
| 195 |
+
In this paper, we have proposed, for the first time, Transformer-based cost aggregation networks for semantic correspondence which enables aggregating the matching scores computed between input features, dubbed CATs. We have made several architectural designs in the network architecture, including appearance affinity modelling, multi-level aggregation, swapping self-attention, and residual correlation. We have shown that our method surpasses the current state-of-the-art in several benchmarks. Moreover, we have conducted extensive ablation studies to validate our choices and explore its capacity. A natural next step, which we leave for future work, is to examine how CATs could extend its domain to tasks including 3-D reconstruction, semantic segmentation and stitching, and to explore self-supervised learning.
|
| 196 |
+
|
| 197 |
+
# Acknowledgements
|
| 198 |
+
|
| 199 |
+
This research was supported by the MSIT, Korea, under the ICT Creative Consilience program (IITP-2021-2020-0-01819) and (No. 2020-0-00368, A Neural-Symbolic Model for Knowledge Acquisition and Inference Techniques) supervised by the IITP and National Research Foundation of Korea (NRF-2021R1C1C1006897).
|
| 200 |
+
|
| 201 |
+
References
|
| 202 |
+
[1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 203 |
+
[2] Alexander Buslaev, Vladimir I Iglovikov, Eugene Khvedchenya, Alex Parinov, Mikhail Druzhinin, and Alexandr A Kalinin. Albumentations: fast and flexible image augmentations. Information, 2020.
|
| 204 |
+
[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV. Springer, 2020.
|
| 205 |
+
[4] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021.
|
| 206 |
+
[5] Christopher B Choy, JunYoung Gwak, Silvio Savarese, and Manmohan Chandraker. Universal correspondence network. NeurIPS, 29:2414–2422, 2016.
|
| 207 |
+
[6] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, 2020.
|
| 208 |
+
[7] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In CVPR Workshops), 2005.
|
| 209 |
+
[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 210 |
+
[9] Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superpoint: Self-supervised interest point detection and description. In CVPR, 2018.
|
| 211 |
+
[10] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 212 |
+
[11] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow. In CVPR, 2016.
|
| 213 |
+
[12] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow: Semantic correspondences from object proposals. IEEE transactions on pattern analysis and machine intelligence, 2017.
|
| 214 |
+
[13] Kai Han, Rafael S Rezende, Bumsub Ham, Kwan-Yee K Wong, Minsu Cho, Cordelia Schmid, and Jean Ponce. Scnet: Learning semantic correspondence. In ICCV, 2017.
|
| 215 |
+
[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 216 |
+
[15] Sunghwan Hong and Seungryong Kim. Deep matching prior: Test-time optimization for dense correspondence. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
|
| 217 |
+
[16] Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. PAMI, 2012.
|
| 218 |
+
[17] Shuaiyi Huang, Qiuyue Wang, Songyang Zhang, Shipeng Yan, and Xuming He. Dynamic context correspondence network for semantic alignment. In ICCV, 2019.
|
| 219 |
+
[18] Tak-Wai Hui, Xiaoou Tang, and Chen Change Loy. Liteflownet: A lightweight convolutional neural network for optical flow estimation. In CVPR, 2018.
|
| 220 |
+
[19] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, 2017.
|
| 221 |
+
[20] Sangryul Jeon, Seungryong Kim, Dongbo Min, and Kwanghoon Sohn. Parn: Pyramidal affine regression networks for dense semantic correspondence. In ECCV, 2018.
|
| 222 |
+
[21] Sangryul Jeon, Dongbo Min, Seungryong Kim, Jihwan Choe, and Kwanghoon Sohn. Guided semantic flow. In ECCV. Springer, 2020.
|
| 223 |
+
[22] Wei Jiang, Eduard Trulls, Jan Hosang, Andrea Tagliasacchi, and Kwang Moo Yi. Cotr: Correspondence transformer for matching across images. arXiv preprint arXiv:2103.14167, 2021.
|
| 224 |
+
[23] Seungryong Kim, Stephen Lin, Sang Ryul Jeon, Dongbo Min, and Kwanghoon Sohn. Recurrent transformer networks for semantic correspondence. In NeurIPS, 2018.
|
| 225 |
+
[24] Seungryong Kim, Dongbo Min, Bumsub Ham, Sangryul Jeon, Stephen Lin, and Kwanghoon Sohn. Fcss: Fully convolutional self-similarity for dense semantic correspondence. In CVPR, 2017.
|
| 226 |
+
[25] Seungryong Kim, Dongbo Min, Somi Jeong, Sunok Kim, Sangryul Jeon, and Kwanghoon Sohn. Semantic attribute matching networks. In CVPR, 2019.
|
| 227 |
+
[26] Junghyup Lee, Dohyung Kim, Jean Ponce, and Bumsub Ham. Sfnet: Learning object-aware semantic correspondence. In CVPR, 2019.
|
| 228 |
+
[27] Shuda Li, Kai Han, Theo W Costain, Henry Howard-Jenkins, and Victor Prisacariu. Correspondence networks with adaptive neighbourhood consensus. In CVPR, 2020.
|
| 229 |
+
[28] Jing Liao, Yuan Yao, Lu Yuan, Gang Hua, and Sing Bing Kang. Visual attribute transfer through deep image analogy. arXiv:1705.01088, 2017.
|
| 230 |
+
[29] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017.
|
| 231 |
+
[30] Ce Liu, Jenny Yuen, and Antonio Torralba. Sift flow: Dense correspondence across scenes and its applications. IEEE transactions on pattern analysis and machine intelligence, 33(5):978–994, 2010.
|
| 232 |
+
[31] Yanbin Liu, Linchao Zhu, Makoto Yamada, and Yi Yang. Semantic correspondence as an optimal transport problem. In CVPR, 2020.
|
| 233 |
+
[32] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
|
| 234 |
+
[33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv:1711.05101, 2017.
|
| 235 |
+
[34] Iaroslav Melekhov, Aleksei Tiulpin, Torsten Sattler, Marc Pollefeys, Esa Rahtu, and Juho Kannala. Dgc-net: Dense geometric correspondence network. In WACV, 2019.
|
| 236 |
+
[35] Juhong Min and Minsu Cho. Convolutional hough matching networks. arXiv preprint arXiv:2103.16831, 2021.
|
| 237 |
+
[36] Juhong Min, Dahyun Kang, and Minsu Cho. Hypercorrelation squeeze for few-shot segmentation. arXiv preprint arXiv:2104.01538, 2021.
|
| 238 |
+
[37] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Hyperpixel flow: Semantic correspondence with multi-layer neural features. In ICCV, 2019.
|
| 239 |
+
[38] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Spair-71k: A large-scale benchmark for semantic correspondence. arXiv preprint arXiv:1908.10543, 2019.
|
| 240 |
+
[39] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Learning to compose hypercolumns for visual correspondence. In ECCV, 2020.
|
| 241 |
+
[40] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
|
| 242 |
+
[41] James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Object retrieval with large vocabularies and fast spatial matching. In CVPR. IEEE, 2007.
|
| 243 |
+
[42] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Convolutional neural network architecture for geometric matching. In CVPR, 2017.
|
| 244 |
+
[43] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. End-to-end weakly-supervised semantic alignment. In ´ CVPR, 2018.
|
| 245 |
+
[44] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Efficient neighbourhood consensus networks via ´ submanifold sparse convolutions. In ECCV, 2020.
|
| 246 |
+
[45] Ignacio Rocco, Mircea Cimpoi, Relja Arandjelovic, Akihiko Torii, Tomas Pajdla, and Josef Sivic. Neigh- ´ bourhood consensus networks. In NeurIPS, 2018.
|
| 247 |
+
[46] Michael Rubinstein, Armand Joulin, Johannes Kopf, and Ce Liu. Unsupervised joint object discovery and segmentation in internet images. In CVPR, 2013.
|
| 248 |
+
[47] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In CVPR, 2020.
|
| 249 |
+
[48] Daniel Scharstein and Richard Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International journal of computer vision, 2002.
|
| 250 |
+
[49] Paul Hongsuck Seo, Jongmin Lee, Deunsol Jung, Bohyung Han, and Minsu Cho. Attentive semantic alignment with offset-aware correlation kernels. In ECCV, 2018.
|
| 251 |
+
[50] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In CVPR, 2018.
|
| 252 |
+
[51] Jiaming Sun, Zehong Shen, Yuang Wang, Hujun Bao, and Xiaowei Zhou. Loftr: Detector-free local feature matching with transformers. arXiv preprint arXiv:2104.00680, 2021.
|
| 253 |
+
[52] Peize Sun, Yi Jiang, Rufeng Zhang, Enze Xie, Jinkun Cao, Xinting Hu, Tao Kong, Zehuan Yuan, Changhu Wang, and Ping Luo. Transtrack: Multiple-object tracking with transformer. arXiv preprint arXiv:2012.15460, 2020.
|
| 254 |
+
[53] Richard Szeliski. Image alignment and stitching: A tutorial. Foundations and Trends® in Computer Graphics and Vision, 2006.
|
| 255 |
+
[54] Tatsunori Taniai, Sudipta N Sinha, and Yoichi Sato. Joint recovery of dense correspondence and cosegmentation in two images. In CVPR, 2016.
|
| 256 |
+
[55] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers and distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
|
| 257 |
+
[56] Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
|
| 258 |
+
[57] Prune Truong, Martin Danelljan, Luc V Gool, and Radu Timofte. Gocor: Bringing globally optimized correspondence volumes into your neural network. In NeurIPS, 2020.
|
| 259 |
+
[58] Prune Truong, Martin Danelljan, and Radu Timofte. Glu-net: Global-local universal network for dense flow and correspondences. In CVPR, 2020.
|
| 260 |
+
[59] Prune Truong, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning accurate dense correspondences and when to trust them. arXiv preprint arXiv:2101.01710, 2021.
|
| 261 |
+
[60] Michał J Tyszkiewicz, Pascal Fua, and Eduard Trulls. Disk: Learning local features with policy gradient. arXiv preprint arXiv:2006.13566, 2020.
|
| 262 |
+
[61] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 263 |
+
[62] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
|
md/train/hJmtwocEqzc/hJmtwocEqzc.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LOWKEY: LEVERAGING ADVERSARIAL ATTACKS TO PROTECT SOCIAL MEDIA USERS FROM FACIAL RECOGNITION
|
| 2 |
+
|
| 3 |
+
Valeriia Cherepanova Department of Mathematics University of Maryland vcherepa@umd.edu
|
| 4 |
+
|
| 5 |
+
Micah Goldblum Department of Computer Science University of Maryland goldblum@umd.edu
|
| 6 |
+
|
| 7 |
+
Harrison Foley∗
|
| 8 |
+
Department of Computer Science
|
| 9 |
+
US Naval Academy
|
| 10 |
+
m211926@usna.edu
|
| 11 |
+
Shiyuan Duan∗
|
| 12 |
+
Department of Computer Science
|
| 13 |
+
University of Maryland
|
| 14 |
+
sduan1@umd.edu
|
| 15 |
+
|
| 16 |
+
John Dickerson Department of Computer Science University of Maryland john@cs.umd.edu
|
| 17 |
+
|
| 18 |
+
Gavin Taylor
|
| 19 |
+
Department of Computer Science
|
| 20 |
+
US Naval Academy
|
| 21 |
+
taylor@usna.edu
|
| 22 |
+
|
| 23 |
+
Tom Goldstein Department of Computer Science University of Maryland tomg@cs.umd.edu
|
| 24 |
+
|
| 25 |
+
# ABSTRACT
|
| 26 |
+
|
| 27 |
+
Facial recognition systems are increasingly deployed by private corporations, government agencies, and contractors for consumer services and mass surveillance programs alike. These systems are typically built by scraping social media profiles for user images. Adversarial perturbations have been proposed for bypassing facial recognition systems. However, existing methods fail on full-scale systems and commercial APIs. We develop our own adversarial filter that accounts for the entire image processing pipeline and is demonstrably effective against industrial-grade pipelines that include face detection and large scale databases. Additionally, we release an easy-to-use webtool that significantly degrades the accuracy of Amazon Rekognition and the Microsoft Azure Face Recognition API, reducing the accuracy of each to below $1 \%$ .
|
| 28 |
+
|
| 29 |
+
# 1 INTRODUCTION
|
| 30 |
+
|
| 31 |
+
Facial recognition systems (FR) are widely deployed for mass surveillance by government agencies, government contractors, and private companies alike on massive databases of images belonging to private individuals (Hartzog, 2020; Derringer, 2019; Weise & Singer, 2020). Recently, these systems have been thrust into the limelight in the midst of outrage over invasion into personal life and concerns regarding fairness (Singer, 2018; Lohr, 2018; Cherepanova et al., 2021). Practitioners populate their databases by hoarding publicly available images from social media outlets, and so users are forced to choose between keeping their images outside of public view or taking their chances with mass surveillance.
|
| 32 |
+
|
| 33 |
+
We develop a tool, LowKey, for protecting users from unauthorized surveillance by leveraging methods from the adversarial attack literature, and make it available to the public as a webtool.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Top: original images, Bottom: protected by LowKey.
|
| 37 |
+
|
| 38 |
+
LowKey is the first such evasion tool that is effective against commercial facial recognition APIs. Our system pre-processes user images before they are made publicly available on social media outlets so they cannot be used by a third party for facial recognition purposes. We establish the effectiveness of LowKey throughout this work.
|
| 39 |
+
|
| 40 |
+
Our contributions can be summarized as follows:
|
| 41 |
+
|
| 42 |
+
• We design a black-box adversarial attack on facial recognition models. Our algorithm moves the feature space representations of gallery faces so that they do not match corresponding probe images while preserving image quality.
|
| 43 |
+
• We interrogate the performance of our method on commercial black-box APIs, including Amazon Rekognition and Microsoft Azure Face, whose inner workings are not publicly known. We provide comprehensive comparisons with the existing data poisoning alternative, Fawkes (Shan et al., 2020), and we find that while Fawkes is ineffective in every experiment, our method consistently prevents facial recognition.
|
| 44 |
+
• We release an easy-to-use webtool, LowKey, so that social media users are no longer confronted with a choice between withdrawing their social media presence from public view and risking the repercussions of being surveilled.
|
| 45 |
+
|
| 46 |
+
# 2 RELATED WORK
|
| 47 |
+
|
| 48 |
+
Neural networks are known to be vulnerable to adversarial attacks, small perturbations to inputs that do not change semantic content, and yet cause the network to misbehave (Goodfellow et al., 2014). The adversarial attack literature has largely focused on developing new algorithms that, in simulations, are able to fool neural networks (Carlini & Wagner, 2017; Chiang et al., 2020). Most works to date focus on the idea of physical world attacks, in which the attacker places adversarial patterns on an object in hopes that the adversarial properties transfer to an image of the object. Such attacks do not succeed reliably because the adversarial perturbation must survive imaging under various lighting conditions, object orientations, and occlusions (Kurakin et al., 2016). While researchers have succeeded in crafting such attacks against realistic systems, these attacks do not work consistently across environments (Wu et al., 2019; Xu et al., 2019; Goldblum et al., 2020). In facial recognition, attacks have largely focused on physical backdoor threat models, evasion attacks on verification (Wenger et al., 2020; Zhong & Deng, 2020) and attacks on face detection (Pedraza et al., 2018). Unlike these physical threat models, the setting in which we operate is purely digital, meaning that we can manipulate the contents of digital media at the bit level, and then hand manipulated data directly to a machine learning system. The ability to digitally manipulate media greatly simplifies the task of attacking a system, and has been shown to enhance transferability to black box industrial systems for applications like copyright detection (Saadatpanah et al., 2020) and financial time series analysis (Goldblum et al., 2020).
|
| 49 |
+
|
| 50 |
+
Recently, the Fawkes algorithm was developed for preventing social media images from being used by unauthorized facial recognition systems (Shan et al., 2020). However, Fawkes, along with the experimental setup on which it is evaluated in the original work, suffers from critical problems. First, Fawkes assumes that facial recognition practitioners train their models on each individual’s data.
|
| 51 |
+
|
| 52 |
+
However, high-performance FR systems instead harness large pre-trained Siamese networks (Liu et al., 2017; Deng et al., 2019). Second, the authors primarily use image classifiers. In contrast, commercial systems are trained with FR-specific heads and loss functions, as opposed to the standard cross-entropy loss used by classifiers. Third, the authors perform evaluations on very small datasets. Specifically, they test Fawkes against commercial APIs with a gallery containing only 50 images. Fourth, the system was only evaluated using top-1 accuracy, but FR users such as police departments often compile a list of suspects rather than a single individual. As a result, other metrics like top-50 accuracy are often used in facial recognition, and are a more realistic metric for when a system has been successfully suppressed. Fifth, while the original work portrays Fawkes’ perturbations are undetectable by the human eye, experience with the codebase suggests the opposite (indeed, a New York Times journalist likewise noted that the Fawkes images she was shown during a demonstration were visibly heavily distorted). Finally, Fawkes has not yet released an app or a webtool, and regular social media users are unlikely to make use of git repositories. Our attack avoids the aforementioned limitations, and we perform thorough evaluations on a large collection of images and identities. When comparing with Fawkes, we use the authors’ own implementation in order to make sure that all evaluations are fair. Furthermore, we use Fawkes’ highest protection setting to make sure that LowKey performs better than Fawkes’ best attack. Another work uses targeted adversarial attack on probe images for facial recognition systems so that they cannot be matched with images in a database (Yang et al., 2020).
|
| 53 |
+
|
| 54 |
+
# 3 THE LOWKEY ATTACK ON MASS SURVEILLANCE
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: The LowKey pipeline. When users protect their publicly available images with LowKey, facial recognition systems cannot match these harvested images with new images of the user, for example from surveillance cameras.
|
| 58 |
+
|
| 59 |
+
# 3.1 PROBLEM SETUP
|
| 60 |
+
|
| 61 |
+
To help make our work more widely accessible, we begin by introducing common facial recognition terms.
|
| 62 |
+
|
| 63 |
+
Gallery images are database images with known identities. These often originate from such sources as passport photos and social media profiles. The gallery is used as a reference for comparing new images.
|
| 64 |
+
|
| 65 |
+
Probe images are new photos whose subject the FR system user wants to identify. For example, probe images may be extracted from video surveillance footage. The extracted images are then fed into the FR system, and matches to gallery images with known identities.
|
| 66 |
+
|
| 67 |
+
Identification is the task of answering the question, “who is this person?” Identification entails comparing a probe image to gallery images in order to find potential matches. In contrast, verification answers the question, “is this person who they say they are?”, or equivalently “are these two photos of the same person?” Verification is used, for example, to unlock phones.
|
| 68 |
+
|
| 69 |
+
In our work, we focus on identification, which can be used for mass surveillance. State-of-the-art facial recognition systems first detect and align faces before extracting facial features from the probe image using a neural network. These systems then find gallery images with the closest feature vectors using a $k$ -nearest neighbors search. The matched gallery images are then considered as likely identities corresponding to the person in the probe photo. LowKey applies a filter to user images which may end up in an organization’s database of gallery images. The result is to corrupt the gallery feature vectors so that they will not match feature vectors corresponding to the user’s probe images. A visual depiction of the LowKey pipeline can be found in Figure 2.
|
| 70 |
+
|
| 71 |
+
# 3.2 THE LOWKEY ATTACK
|
| 72 |
+
|
| 73 |
+
LowKey manipulates potential gallery images so that they do not match probe images of the same person. LowKey does this by generating a perturbed image whose feature vector lies far away from the original image, while simultaneously minimizing a perceptual similarity loss between the original and perturbed image. Maximizing the distance in feature space prevents the image from matching other images of the individual, while the perceptual similarity loss prevents the image quality from degrading. In this section, we formulate the optimization problem, and describe a number of important details.
|
| 74 |
+
|
| 75 |
+
LowKey is designed to evade proprietary FR systems that contain pre-processing steps and neural network backbones that are not publicly known. In order to improve the transferability of our attack to unknown facial recognition systems, LowKey simultaneously attacks an ensemble of models with various backbone architectures that are produced using different training algorithms. Additionally, for each model in the ensemble, the objective function considers the locations of feature vectors of the attacked image both with and without a Gaussian blur. We find that this technique improves both the appearance and transferability of attacked images. Experiments and ablations concerning ensembling and Gaussian smoothing can be found in Section 6. For perceptual similarity loss, we use LPIPS, a metric based on $\ell _ { 2 }$ distance in the feature space of an ImageNet-trained feature extractor (Zhang et al., 2018). LPIPS has been used effectively in the image classification setting to improve the image quality of adversarial examples (Laidlaw et al., 2020).
|
| 76 |
+
|
| 77 |
+
Formally, the optimization problem we solve is
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\operatorname* { m a x } _ { x ^ { \prime } } \frac { 1 } { 2 n } \sum _ { i = 1 } ^ { n } \widetilde { \frac { \| f _ { i } ( A ( x ) ) - f _ { i } ( A ( x ^ { \prime } ) ) \| _ { 2 } ^ { 2 } } { \| f _ { i } ( A ( x ) ) \| _ { 2 } } } + \widetilde { \| f _ { i } ( A ( x ) ) - f _ { i } ( A ( G ( x ^ { \prime } ) ) ) \| _ { 2 } ^ { 2 } } - \alpha \underbrace { \mathrm { L P I P S } ( x , x ^ { \prime } ) } _ { \mathrm { n e c e a n n a l 1 o s } } ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $x$ is the original image, $x ^ { \prime }$ is the perturbed image, $f _ { i }$ denotes the $i ^ { t h }$ model in our ensemble, $G$ is the Gaussian smoothing function with fixed parameters, and $A$ denotes face detection and extraction followed by $1 1 2 \times 1 1 2$ resizing and alignment. The face detection step is an important part of the LowKey objective function, as commercial systems rely on face detection and extraction because probe images often contain a scene much larger than a face, or else contain a face who’s alignment is not compatible with the face recognition system.
|
| 84 |
+
|
| 85 |
+
We solve this maximization problem iteratively with signed gradient ascent, which is known to be highly effective for breaking common image classification systems (Madry et al., 2017). Namely, we iteratively update $x ^ { \prime }$ by adding the sign of the gradient of the maximization objective (1) with respect to $x ^ { \prime }$ . By doing this, we move $x ^ { \prime }$ and $G ( x ^ { \prime } )$ far away from the original image $x$ in the feature spaces of models $f _ { i }$ used in the LowKey ensemble. The ensemble contains four feature extractors, IR-152 and ResNet-152 backbones trained with ArcFace and CosFace heads. More details can be found in the next section.
|
| 86 |
+
|
| 87 |
+
Additional details concerning attack hyperparameters can be found in Appendix 8.1.
|
| 88 |
+
|
| 89 |
+
# 4 EXPERIMENTAL DESIGN
|
| 90 |
+
|
| 91 |
+
Our ensemble of models contains ArcFace and CosFace facial recognition systems (Deng et al., 2019; Wang et al., 2018). For each of these systems, we train ResNet-50, ResNet-152, IR-50, and IR-152 backbones on the MS-Celeb-1M dataset, which contains over five million images from over 85,000 identities (He et al., 2016; Deng et al., 2019; Guo et al., 2016). We use these models both in our ensemble to generate attacks and to perform controlled experiments in Section 6. Additional details on our models and their training routines can be found in Appendix 8.1.
|
| 92 |
+
|
| 93 |
+
We primarily test our attacks on the FaceScrub dataset, a standard identification benchmark from the MegaFace challenge, which contains over 100,000 images from 530 known identities as well as one million distractor images (Kemelmacher-Shlizerman et al., 2016). We discard near-duplicate images from the dataset as is common practice in the facial recognition literature (Zhang et al., 2020). We also perform experiments on the UMDFaces dataset, which can be found in Appendix 8.3 (Bansal et al., 2017). We treat one tenth of each identity’s images as probe images, and we insert the remaining images into the gallery. We randomly select 100 identities and apply LowKey to each of their gallery images. This setting simulates a small pool of LowKey users among a larger population of non-users. Then, in order to perform a single evaluation trial of identification, we randomly sample one probe image from a known identity and find its closest matches within the remainder of the FaceScrub dataset, according to the facial recognition model. Distance is measured in feature space of the model. If the FR model selects a match from the same identity, then the trial is a success.
|
| 94 |
+
|
| 95 |
+
Note 1 (Rank- $k$ Accuracy). For each probe image, we consider the model successful in the rank- $k$ setting if the correct identity appears among the k closest gallery images in the model’s feature space. To test the transferability of our attack we compute rank-1 and rank-50 accuracy for attack, and test feature extractors from our set of trained FR models.
|
| 96 |
+
|
| 97 |
+
# 5 BREAKING COMMERCIAL BLACK-BOX APIS
|
| 98 |
+
|
| 99 |
+
The ultimate test for our protection tool is against commercial systems. These systems are proprietary, and their exact specifications are not publicly available. We test LowKey in the black-box setting using two commercial facial recognition APIs: Amazon Rekognition and Microsoft Azure Face. We also compare against Fawkes. We generate Fawkes images using the authors’ own code and hyperparameters to ensure a fair comparison, and we use the highest protection setting their code offers.
|
| 100 |
+
|
| 101 |
+
Amazon Rekognition Amazon Rekognition is a commercial tool for detecting and recognizing faces in photos. Rekognition works by matching probe images with uploaded gallery images that have known labels. Amazon does not describe how their algorithm works, but their approach seemingly does not involve training a model on uploaded images (at least not in a supervised manner). We test the Rekognition API using the FaceScrub dataset (including distractors) where 100 randomly selected identities have their images attacked as described in Section 4. We observe that LowKey is highly effective, and even in the setting of rank-50 accuracy, Rekognition can only recognize $2 . 4 \%$ of probe images belonging to users protected with LowKey. In contrast, Fawkes fails, with $7 7 . 5 \%$ of probe images belonging to its users recognized correctly in the rank-1 setting and $9 4 . 9 \%$ of these images recognized correctly when the 50 closest matches are considered. This is close to the performance of Amazon Rekognition on clean images.
|
| 102 |
+
|
| 103 |
+
<table><tr><td colspan="2">Amazon rank-1</td><td>Amazon rank-50</td><td>Microsoft rank-1</td></tr><tr><td>Clean -</td><td>93.7%</td><td>95.4%</td><td>90.5%</td></tr><tr><td>Fawkes -</td><td>77.5%</td><td>94.9%</td><td>74.2%</td></tr><tr><td>LowKey-</td><td>0.6%</td><td>2.4%</td><td>0.1%</td></tr></table>
|
| 104 |
+
|
| 105 |
+
Table 1: An evaluation of Amazon Rekognition and Microsoft Azure Face on FaceScrub data with LowKey and Fawkes protection (a small number, and lighter color, indicates a successful attack). LowKey consistently achieves virtually flawless protection, while Fawkes provides little protection.
|
| 106 |
+
|
| 107 |
+
Microsoft Azure Face We repeat a similar experiment on the Microsoft Azure Facial Recognition API. In contrast to Amazon’s API, Microsoft updates their model on the uploaded gallery of images. Therefore, only known identities can be used, so we only include images corresponding to the 530 known identities from FaceScrub and no distractors. The Azure system recognizes only $0 . 1 \%$ of probe images whose gallery images are under the protection of LowKey. Even though Fawkes is designed to perform data poisoning, and authors claim it is especially well suited to Microsoft Azure Face, in our experiments, Azure is still able to recognize more than $74 \%$ of probe images uploaded by users who employ Fawkes.
|
| 108 |
+
|
| 109 |
+
We conclude from these experiments that LowKey is both highly effective and transferable to even state-of-the-art industrial facial recognition systems. In the next section, we explore several components of our attack in order to uncover the tools of its success.
|
| 110 |
+
|
| 111 |
+
# 6 ADDITIONAL EXPERIMENTS
|
| 112 |
+
|
| 113 |
+
The effectiveness of our protection tool hinges on several properties:
|
| 114 |
+
|
| 115 |
+
1. The attack must transfer effectively to unseen models.
|
| 116 |
+
2. Images must look acceptable to users.
|
| 117 |
+
3. LowKey must run sufficiently fast so that run-time does not outweigh its protective benefits.
|
| 118 |
+
4. Attacked images must remain effective after being saved in PNG and JPG formats.
|
| 119 |
+
5. The algorithm must scale to images of any size.
|
| 120 |
+
|
| 121 |
+
We conduct extensive experiments in this section with a variety of facial recognition systems to interrogate these properties of LowKey.
|
| 122 |
+
|
| 123 |
+
# 6.1 ENSEMBLES AND TRANSFERABILITY
|
| 124 |
+
|
| 125 |
+
In developing the ensemble of models used to compute our attack, we examine the extent to which attacks generated by one model are effective against another. By including an eclectic mix of models in our ensemble, we are able to ensure that LowKey produces images that fool a wide variety of facial recognition systems. To this end, we evaluate attacks on all pairs of source and victim models with ResNet-50, ResNet-152, IR-50, and IR-152 backbones, and both ArcFace and CosFace heads. For each victim model, we additionally measure performance on clean images, our ensembled attack, and Fawkes. See Table 2 for a comparison of the rank-50 performance of these combinations. Additional evaluations in the rank-1 setting and on the UMDFaces dataset can be found in Appendix 8.2 and 8.3 respectively. Note that entries for which the attacker and defender models are identical depict white-box performance, while entries for which these model differ depict black-box transferability.
|
| 126 |
+
|
| 127 |
+
We observe in these experiments that adversarial attacks generated by IR architectures transfer better to IR-based facial recognition systems, while attacks generated by ResNet architectures transfer better to other ResNet systems. In general, attacks computed on 152-layer backbones are more effective than attacks computed on 50-layer backbones, and deeper networks are also more difficult to fool. Moreover, attacks transfer better between models trained with the same head. An ensemble of models of all combinations of ResNet-152 and IR-152 backbones as well as ArcFace and CosFace heads generates attacks that transfer effectively to all models and fool models at only a slightly lower rate than white-box attacks.
|
| 128 |
+
|
| 129 |
+
# 6.2 GAUSSIAN SMOOTHING
|
| 130 |
+
|
| 131 |
+
We incorporate Gaussian smoothing as a pre-processing step in our objective function (1) to make our perturbations smoother and more robust. Intuitively, this promotes the effectiveness of the attacked image even when a denoising filter is applied. The presence of blur forces the adversarial perturbation to rely on smoother/low-frequency image modifications rather than adversarial “noise.” Empirically, we find that attacks computed with this procedure produce slightly smoother and more aesthetically pleasing perturbations without sharp lines and high-frequency oscillations. See Figure 3 for a visual comparison of images produced with and without Gaussian smoothing in the LowKey pipeline.
|
| 132 |
+
|
| 133 |
+
<table><tr><td></td><td rowspan=1 colspan=1>96.8%</td><td rowspan=1 colspan=1>96.8%</td><td rowspan=1 colspan=1>96.7%</td><td rowspan=1 colspan=4>96.8% 96.8% 96.8% 96.7%</td><td rowspan=1 colspan=1>96.7%</td></tr><tr><td></td><td rowspan=1 colspan=1>96.6%</td><td rowspan=1 colspan=1>96.7%</td><td rowspan=1 colspan=1>96.7%</td><td rowspan=1 colspan=1>96.7%</td><td rowspan=1 colspan=1>96.7%</td><td rowspan=1 colspan=1>96.5%</td><td rowspan=1 colspan=1>96.6%</td><td rowspan=1 colspan=1>96.6%</td></tr><tr><td></td><td rowspan=1 colspan=1>0.4%</td><td rowspan=1 colspan=1>22.2%</td><td rowspan=1 colspan=1>11.9%</td><td rowspan=1 colspan=1>35.2%</td><td rowspan=1 colspan=1>33.6%</td><td rowspan=1 colspan=1>46.4%</td><td rowspan=1 colspan=1>45.7%</td><td rowspan=1 colspan=1>53.0%</td></tr><tr><td></td><td rowspan=1 colspan=1>4.9%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>4.1%</td><td rowspan=1 colspan=1>8.0%</td><td rowspan=1 colspan=1>23.1%</td><td rowspan=1 colspan=1>25.9%</td><td rowspan=1 colspan=1>31.4%</td><td rowspan=1 colspan=1>28.6%</td></tr><tr><td></td><td rowspan=1 colspan=1>9.9%</td><td rowspan=1 colspan=1>18.3%</td><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>26.1%</td><td rowspan=1 colspan=1>41.6%</td><td rowspan=1 colspan=1>46.2%</td><td rowspan=1 colspan=1>49.6%</td><td rowspan=1 colspan=1>48.9%</td></tr><tr><td></td><td rowspan=1 colspan=1>2.8%</td><td rowspan=1 colspan=1>1.6%</td><td rowspan=1 colspan=1>1.5%</td><td rowspan=1 colspan=1>0.5%</td><td rowspan=1 colspan=1>11.9%</td><td rowspan=1 colspan=1>13.9%</td><td rowspan=1 colspan=1>18.8%</td><td rowspan=1 colspan=1>16.3%</td></tr><tr><td></td><td rowspan=1 colspan=1>26.4%</td><td rowspan=1 colspan=1>35.7%</td><td rowspan=1 colspan=1>36.3%</td><td rowspan=1 colspan=1>43.0%</td><td rowspan=1 colspan=1>0.9%</td><td rowspan=1 colspan=1>13.3%</td><td rowspan=1 colspan=1>17.4%</td><td rowspan=1 colspan=1>24.2%</td></tr><tr><td></td><td rowspan=1 colspan=1>33.8%</td><td rowspan=1 colspan=1>36.5%</td><td rowspan=1 colspan=1>41.1%</td><td rowspan=1 colspan=1>42.9%</td><td rowspan=1 colspan=1>9.9%</td><td rowspan=1 colspan=1>0.2%</td><td rowspan=1 colspan=1>17.9%</td><td rowspan=1 colspan=1>21.1%</td></tr><tr><td></td><td rowspan=1 colspan=1>16.8%</td><td rowspan=1 colspan=1>22.0%</td><td rowspan=1 colspan=1>21.1%</td><td rowspan=1 colspan=1>28.2%</td><td rowspan=1 colspan=1>5.2%</td><td rowspan=1 colspan=1>8.8%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>7.6%</td></tr><tr><td rowspan=2 colspan=1>RN-152C-Ensemble</td><td rowspan=1 colspan=1>14.8%</td><td rowspan=1 colspan=1>19.2%</td><td rowspan=1 colspan=1>19.9%</td><td rowspan=1 colspan=1>24.3%</td><td rowspan=1 colspan=1>6.7%</td><td rowspan=1 colspan=1>6.9%</td><td rowspan=1 colspan=1>7.1%</td><td rowspan=1 colspan=1>0.5%</td></tr><tr><td rowspan=1 colspan=1> 3.0%</td><td rowspan=1 colspan=1>2.4%</td><td rowspan=1 colspan=1>2.1%</td><td rowspan=1 colspan=1>0.6%</td><td rowspan=1 colspan=1> 3.1%</td><td rowspan=1 colspan=1> 4.2%</td><td rowspan=1 colspan=1> 5.5%</td><td rowspan=1 colspan=1>0.9%</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 2: Rank-50 accuracy of the LowKey and Fawkes attacks. After the first two rows, each row represents LowKey attacks generated from the same model. Each column represents inference on a single model. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
| 136 |
+
|
| 137 |
+
We additionally produce images both with and without smoothing in the attack pipeline. Before feeding them into facial recognition systems, we defend the system against our attacks by applying a Gaussian smoothing pre-processing step just before inference.
|
| 138 |
+
|
| 139 |
+
We find that facial recognition systems which use this pre-processing step perform equally well on rank-50 (but not rank-1) accuracy compared to performance without smoothing, and they are also able to defeat attacks which are not computed with Gaussian smoothing. On the other hand, attacks computed using Gaussian smoothing are able to counteract this defense and fool the facial recognition system (see Table 3). This suggests that attacks that use Gaussian smoothing in their pipeline are more robust and harder to defend against. See Appendix 8.6 for details regarding Gaussian smoothing hyperparameters.
|
| 140 |
+
|
| 141 |
+
# 6.3 RUN-TIME
|
| 142 |
+
|
| 143 |
+
In order for users to be willing to use our tool, LowKey must run fast enough that it is not an inconvenience to use. Computing adversarial attacks is a computationally expensive task. We compare run-time to Fawkes as a baseline and test both attacks on a single NVIDIA GeForce RTX 2080 TI GPU. We attack one image at a time with no batching for fair comparison, and we average over runs on every full-size gallery image from each of five randomly selected identities from FaceScrub. While Fawkes averages 54 seconds per image, LowKey only averages 32 seconds per image. In addition to providing far superior protection, LowKey runs significantly faster than the existing method, providing users a smoother and more convenient experience.
|
| 144 |
+
|
| 145 |
+
<table><tr><td colspan="10">Defender IR-50A IR-50C</td></tr><tr><td></td><td>Clean</td><td>96.7% 96.8%</td><td>IR-152A 96.6%</td><td></td><td>IR-152C 96.9%</td><td>RN-50A 96.7%</td><td>96.7%</td><td>RN-50C RN-152A RN-152C 96.7%</td><td>96.7%</td></tr><tr><td>AAreeet Without GS </td><td>78.6%</td><td>74.0%</td><td>74.4%</td><td>64.6%</td><td>75.5%</td><td>76.0%</td><td>77.8%</td><td>74.2%</td></tr><tr><td>With GS</td><td>4.2%</td><td>4.8%</td><td>4.4%</td><td>2.8%</td><td>7.9%</td><td>7.1%</td><td>9.6%</td><td>3.2%</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 3: Rank-50 accuracy of FR models tested on blurred LowKey images computed with/without Gaussian smoothing.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 3: LowKey attacked images computed without (above) and with (below) Gaussian smoothing.
|
| 151 |
+
|
| 152 |
+
# 6.4 ROBUSTNESS TO IMAGE COMPRESSION
|
| 153 |
+
|
| 154 |
+
Since users may save their images in various formats after passing them through LowKey, the images we produce must provide protection even after being saved in common formats. Our baseline tests are conducted with images saved in uncompressed PNG format. To test performance under compression, we convert protected images to JPEG format and repeat our experiments on commercial APIs. While compression very slightly decreases performance, the attack is still very effective: Microsoft Azure Face is now able to recognize $0 . 2 \%$ of images compared to $0 . 1 \%$ when saved in the PNG format. Likewise, Amazon Rekognition now recognizes $3 . 8 \%$ of probe images compared to $2 . 4 \%$ previously.
|
| 155 |
+
|
| 156 |
+
# 6.5 SCALABILITY TO ALL IMAGE SIZES (DISCLAIMER)
|
| 157 |
+
|
| 158 |
+
Many tools in deep learning require that inputs be of particular dimensions, but user images on social media sites come in all shapes and sizes. Therefore, LowKey must be flexible. Since the detection and alignment pipeline in our attack resizes images in a differentiable fashion, we can attack images of any size and aspect ratio. Additionally, we apply the LPIPS penalty to the entire original image, which prevents box-shaped artifacts from developing on the boundaries of the rectangle containing the face. Since LowKey does not have a fixed attack budget, perturbations may have different magnitudes on different images. Figure 4 shows the variability of LowKey perturbations on very large images; the image of Tom Hanks (first column) is one of the best looking examples of LowKey on large images, while the image of Tina Fey (last column) is one of the worst looking examples. Protecting very large images is a more challenging task than protecting small images because of the black-box detection, alignment, and re-scaling used in APIs which affect large images more significantly. These experiments indicate that users will receive stronger protection if they use LowKey on smaller images.
|
| 159 |
+
|
| 160 |
+
We test the effectiveness of LowKey on large images by protecting gallery images of 10 identities from Facescrub (with 17 images in the gallery on average) and using 20 probe images per person. We also vary the magnitude of the perturbation to find the smallest perturbation that is sufficient to protect images (Table 4). In this way, we find that users may trade off some protection in exchange for better looking images at their own discretion. Additionally, we find that LowKey works much better with smaller gallery sizes; when only 5 gallery images are used, the performance of Amazon Rekognition drops from $3 2 . 5 \%$ to $11 \%$ in the rank-50 setting. This observation suggests that users can upload new profile pictures less frequently in order to decrease the number of gallery images corresponding to their identity and thus enhance their protection. Finally, the quality of probe images is also important; when small probe images are used, like those which would occur in low resolution security camera footage, the accuracy of Amazon Rekognition drops from $3 2 . 5 \%$ to $19 \%$ .
|
| 161 |
+
|
| 162 |
+
# 7 DISCUSSION
|
| 163 |
+
|
| 164 |
+
In this work, we develop a tool for protecting users from unauthorized facial recognition. Our tool adversarially pre-processes user images before they are uploaded to social media. These pre-processed images are useless for third-party organizations who collect them for facial recognition. While we have shown that LowKey is highly effective against commercial black-box APIs, it does not protect users $100 \%$ of the time and may be circumvented by specially engineered robust systems. Thus, we hope that users will still remain cautious about publicly revealing personal information. One interesting future direction is to produce adversarial filters that are more aesthetically pleasing in order to promote wider use of this tool. However, it may be that there is no free lunch, and one cannot fool state-of-the-art facial recognition systems without visible perturbations. Facial recognition systems are not fragile, and other attacks that have attempted to break them have failed. Finally, we note that one of our goals in making this tool widely available is to promote broader awareness of facial recognition and the ethical issues it raises. Our webtool can be found at lowkey.umiacs.umd.edu.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: First row: Original large images, Second row: Images protected with LowKey (medium magnitude), Third row: Images protected with LowKey (large magnitude).
|
| 168 |
+
|
| 169 |
+
Table 4: Evaluation of LowKey on full-size images. Rows indicate levels of magnitude of LowKey (denoted by the number of attack steps).
|
| 170 |
+
|
| 171 |
+
<table><tr><td colspan="2">Amazon rank-1</td><td>Amazon rank-50</td><td>Microsoft rank-1</td></tr><tr><td>Clean </td><td>89.0%</td><td>98.5%</td><td>86.0%</td></tr><tr><td>LowKey 10</td><td>63.0%</td><td>94.5%</td><td>75.5%</td></tr><tr><td>LowKey 20-</td><td>34.0%</td><td>59.5%</td><td>30.5%</td></tr><tr><td>LowKey 30 -</td><td>20.5%</td><td>36.5%</td><td>12.7%</td></tr><tr><td>LowKey 40 -</td><td>14.5%</td><td>36.0%</td><td>3.0%</td></tr><tr><td>LowKey 50</td><td>11.0%</td><td>32.5%</td><td>0.0%</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# ACKNOWLEDGMENTS
|
| 174 |
+
|
| 175 |
+
This work was supported by the DARPA GARD and DARPA QED programs. Further support was provided by the AFOSR MURI program, and the National Science Foundation’s DMS division. Computation resources were funded by the Sloan Foundation.
|
| 176 |
+
|
| 177 |
+
# REFERENCES
|
| 178 |
+
|
| 179 |
+
Ankan Bansal, Anirudh Nanduri, Carlos D Castillo, Rajeev Ranjan, and Rama Chellappa. Umdfaces: An annotated face dataset for training deep networks. In 2017 IEEE International Joint Conference on Biometrics (IJCB), pp. 464–473. IEEE, 2017.
|
| 180 |
+
|
| 181 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 ieee symposium on security and privacy (sp), pp. 39–57. IEEE, 2017.
|
| 182 |
+
|
| 183 |
+
Valeriia Cherepanova, Vedant Nanda, Micah Goldblum, John P Dickerson, and Tom Goldstein. Technical challenges for training fair neural networks. arXiv preprint arXiv:2102.06764, 2021.
|
| 184 |
+
|
| 185 |
+
Ping-Yeh Chiang, Jonas Geiping, Micah Goldblum, Tom Goldstein, Renkun Ni, Steven Reich, and Ali Shafahi. Witchcraft: Efficient pgd attacks with random step size. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3747–3751. IEEE, 2020.
|
| 186 |
+
|
| 187 |
+
Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4690–4699, 2019.
|
| 188 |
+
|
| 189 |
+
William Derringer. A surveillance net blankets china’s cities, giving police vast powers. The New York Times, Dec. 17 2019. URL https://www.nytimes.com/2019/12/17/technology/ china-surveillance.html.
|
| 190 |
+
|
| 191 |
+
Micah Goldblum, Avi Schwarzschild, Naftali Cohen, Tucker Balch, Ankit B Patel, and Tom Goldstein. Adversarial attacks on machine learning systems for high-frequency trading. arXiv preprint arXiv:2002.09565, 2020.
|
| 192 |
+
|
| 193 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 194 |
+
|
| 195 |
+
Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In European conference on computer vision, pp. 87–102. Springer, 2016.
|
| 196 |
+
|
| 197 |
+
Woodrow Hartzog. The secretive company that might end privacy as we know it. The New York Times, Jan. 18 2020. URL https://www.nytimes.com/2020/01/18/technology/ clearview-privacy-facial-recognition.html.
|
| 198 |
+
|
| 199 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 200 |
+
|
| 201 |
+
Ira Kemelmacher-Shlizerman, Steven M Seitz, Daniel Miller, and Evan Brossard. The megaface benchmark: 1 million faces for recognition at scale. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4873–4882, 2016.
|
| 202 |
+
|
| 203 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 204 |
+
|
| 205 |
+
Cassidy Laidlaw, Sahil Singla, and Soheil Feizi. Perceptual adversarial robustness: Defense against unseen threat models. arXiv preprint arXiv:2006.12655, 2020.
|
| 206 |
+
|
| 207 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object ´ detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017.
|
| 208 |
+
|
| 209 |
+
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.
|
| 210 |
+
|
| 211 |
+
Steve Lohr. Facial recognition is accurate, if you’re a white guy. New York Times, 9, 2018.
|
| 212 |
+
|
| 213 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 214 |
+
|
| 215 |
+
Daniel Pedraza, Dhaval Adjodah, Gretchen Greene, Josh Joseph, Thom Miano, and Francisco. Equalais. https://equalais.media.mit.edu/, 2018.
|
| 216 |
+
|
| 217 |
+
Parsa Saadatpanah, Ali Shafahi, and Tom Goldstein. Adversarial attacks on copyright detection systems. In International Conference on Machine Learning, pp. 8307–8315. PMLR, 2020.
|
| 218 |
+
|
| 219 |
+
Shawn Shan, Emily Wenger, Jiayun Zhang, Huiying Li, Haitao Zheng, and Ben Y Zhao. Fawkes: Protecting privacy against unauthorized deep learning models. In 29th {USENIX} Security Symposium ({USENIX} Security 20), pp. 1589–1604, 2020.
|
| 220 |
+
|
| 221 |
+
Natasha Singer. Microsoft urges congress to regulate use of facial recognition. The New York Times, 2018.
|
| 222 |
+
|
| 223 |
+
Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5265–5274, 2018.
|
| 224 |
+
|
| 225 |
+
Karen Weise and Natasha Singer. Amazon pauses police use of its facial recognition software. The New York Times, Jul. 10 2020. URL https://www.nytimes.com/2020/06/10/ technology/amazon-facial-recognition-backlash.html.
|
| 226 |
+
|
| 227 |
+
Emily Wenger, Josephine Passananti, Yuanshun Yao, Haitao Zheng, and Ben Y Zhao. Backdoor attacks on facial recognition in the physical world. arXiv preprint arXiv:2006.14580, 2020.
|
| 228 |
+
|
| 229 |
+
Zuxuan Wu, Ser-Nam Lim, Larry Davis, and Tom Goldstein. Making an invisibility cloak: Real world adversarial attacks on object detectors. arXiv preprint arXiv:1910.14667, 2019.
|
| 230 |
+
|
| 231 |
+
Kaidi Xu, Gaoyuan Zhang, Sijia Liu, Quanfu Fan, Mengshu Sun, Hongge Chen, Pin-Yu Chen, Yanzhi Wang, and Xue Lin. Adversarial t-shirt! evading person detectors in a physical world. arXiv, pp. arXiv–1910, 2019.
|
| 232 |
+
|
| 233 |
+
Xiao Yang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Hang Su. Towards privacy protection by generating adversarial identity masks. arXiv preprint arXiv:2003.06814, 2020.
|
| 234 |
+
|
| 235 |
+
Kai Zhang, V´ıtor Albiero, and Kevin W Bowyer. A method for curation of web-scraped face image datasets. In 2020 8th International Workshop on Biometrics and Forensics (IWBF), pp. 1–6. IEEE, 2020.
|
| 236 |
+
|
| 237 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 586–595, 2018.
|
| 238 |
+
|
| 239 |
+
Jian Zhao. face.evolve: High-performance face recognition library based on pytorch. https: //github.com/ZhaoJ9014/face.evoLVe.PyTorch, 2020.
|
| 240 |
+
|
| 241 |
+
Yaoyao Zhong and Weihong Deng. Towards transferable adversarial attack against deep face recognition. arXiv preprint arXiv:2004.05790, 2020.
|
| 242 |
+
|
| 243 |
+
# 8 APPENDIX
|
| 244 |
+
|
| 245 |
+
# 8.1 IMPLEMENTATION DETAILS
|
| 246 |
+
|
| 247 |
+
We train all of our feature extractors using focal loss (Lin et al., 2017) with a batch size of 512 for 120 epochs. We use an initial learning rate of 0.1 and decrease it by a factor of 10 at epochs 35, 65 and 95. For the optimizer, we use SGD with a momentum of 0.9 and weight decay of 5e-4.
|
| 248 |
+
|
| 249 |
+
For our adversarial attacks, we use 0.05 for the perceptual similarity penalty, $\sigma = 3$ and window size 7 for the Gaussian smoothing term. Attacks are computed using signed SGD for 50 epochs with a learning rate of 0.0025.
|
| 250 |
+
|
| 251 |
+
For face detection and aligning models as well as for training routines, we use the face.evoLVe.PyTorch github repository (Zhao, 2020).
|
| 252 |
+
|
| 253 |
+
# 8.2 RANK-1 ACCURACY ON FACESCRUB DATA
|
| 254 |
+
|
| 255 |
+
See Table 5.
|
| 256 |
+
|
| 257 |
+
<table><tr><td rowspan=2 colspan=9>DefenderIR-50A IR-50CIR-152AIR-152C RN-50ARN-50C RN-152A RN-152CClean 95.6% 96.1% 96.0% 96.2% 95.8% 95.9% 95.9% 96.0%</td></tr><tr><td rowspan=1 colspan=1>95.6%</td><td rowspan=1 colspan=2>96.1% 96.0%</td><td rowspan=1 colspan=1>96.2%</td><td rowspan=1 colspan=1>95.8%</td><td rowspan=1 colspan=2>95.9% 95.9%</td><td rowspan=1 colspan=1>96.0%</td></tr><tr><td rowspan=5 colspan=1>Fawkes IR-50AIR-50CAAreeet IR-152AIR-152C-</td><td rowspan=1 colspan=1>71.2%</td><td rowspan=1 colspan=1>76.2%</td><td rowspan=1 colspan=1>74.4%</td><td rowspan=1 colspan=1>78.2%</td><td rowspan=1 colspan=1>73.9%</td><td rowspan=1 colspan=2>76.0% 76.0%</td><td rowspan=1 colspan=1>71.2%</td></tr><tr><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>3.5%</td><td rowspan=1 colspan=1>0.5%</td><td rowspan=1 colspan=1>6.4%</td><td rowspan=1 colspan=1>5.0%</td><td rowspan=1 colspan=2>8.2% 8.7%</td><td rowspan=1 colspan=1>12.4%</td></tr><tr><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>9.0%</td><td rowspan=1 colspan=1>3.3%</td><td rowspan=1 colspan=2>3.3% 3.6%</td><td rowspan=1 colspan=1> 5.3%</td></tr><tr><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>1.8%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>4.2%</td><td rowspan=1 colspan=1>6.8%</td><td rowspan=1 colspan=1>8.9%</td><td rowspan=1 colspan=1>9.4%</td><td rowspan=1 colspan=1>10.8%</td></tr><tr><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>1.0%</td><td rowspan=1 colspan=1>1.4%</td><td rowspan=1 colspan=1>2.2%</td><td rowspan=1 colspan=1>2.9%</td></tr><tr><td rowspan=1 colspan=1>RN-50A-</td><td rowspan=1 colspan=1>3.8%</td><td rowspan=1 colspan=1>7.0%</td><td rowspan=1 colspan=1>6.8%</td><td rowspan=1 colspan=1>8.3%</td><td rowspan=1 colspan=1>0.9%</td><td rowspan=1 colspan=1>2.0%</td><td rowspan=1 colspan=1>2.8%</td><td rowspan=1 colspan=1>4.6%</td></tr><tr><td rowspan=1 colspan=1>RN-50C-</td><td rowspan=1 colspan=1>3.1%</td><td rowspan=1 colspan=1> 5.7%</td><td rowspan=1 colspan=1>5.6%</td><td rowspan=1 colspan=1>7.9%</td><td rowspan=1 colspan=1>1.2%</td><td rowspan=1 colspan=1>0.1%</td><td rowspan=1 colspan=1>2.0%</td><td rowspan=1 colspan=1> 3.5%</td></tr><tr><td rowspan=1 colspan=1>RN-152A</td><td rowspan=1 colspan=1>1.5%</td><td rowspan=1 colspan=1>3.1%</td><td rowspan=1 colspan=1>2.7%</td><td rowspan=1 colspan=1>4.9%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>0.5%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>0.4%</td></tr><tr><td rowspan=2 colspan=1>RN-152CEnsemble</td><td rowspan=1 colspan=1>1.7%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>3.1%</td><td rowspan=1 colspan=1>3.9%</td><td rowspan=1 colspan=1>0.8%</td><td rowspan=1 colspan=1>0.8%</td><td rowspan=1 colspan=1>0.5%</td><td rowspan=1 colspan=1>0.0%</td></tr><tr><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=2>0.0% 0.1%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>0.2%</td><td rowspan=1 colspan=2>0.4% 0.6%</td><td rowspan=1 colspan=1>0.1%</td></tr></table>
|
| 258 |
+
|
| 259 |
+
Table 5: Rank-1 accuracy of the LowKey and Fawkes attacks on the FaceScrub dataset. After the first two rows, each row represents LowKey attacks generated from the same model. Each column represents inference on a single model. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
| 260 |
+
|
| 261 |
+
# 8.3 RESULTS ON UMDFACES DATASET
|
| 262 |
+
|
| 263 |
+
We repeat controlled experiments on the UMDFaces dataset which contains over 367,000 photos of 8,277 identities. For UMDFaces, we also choose 100 identities at random and attack their gallery images while keeping one-tenth of each identity’s photos as probe images. Experimental results are reported in Tables 6 and 7. It can be seen that the effectiveness of LowKey attacks on the UMDFaces dataset is slightly lower, which is likely a result of the much smaller gallery.
|
| 264 |
+
|
| 265 |
+
# 8.4 CAN WE REDUCE THE SIZE OF OUR ATTACK?
|
| 266 |
+
|
| 267 |
+
In order to make our attacks more aesthetically pleasing, we try to reduce the size of perturbation by increasing the perceptual similarity penalty from 0.05 to 0.08. This attack is depicted in Figure 5 as a ”LowKey small attack”. Unfortunately, even a small decrease in the perturbation size results in a huge decrease in efficiency of the attack. In the rank-50 setting Amazon Rekognition is able to recognize $1 7 . 2 \%$ of probe images belonging to users protected with a LowKey small attack. Similarly, Microsoft
|
| 268 |
+
|
| 269 |
+
<table><tr><td></td><td rowspan=1 colspan=1>98.6%</td><td rowspan=1 colspan=1>98.3%</td><td rowspan=1 colspan=1>98.6%</td><td rowspan=1 colspan=2>98.6% 98.3%</td><td rowspan=1 colspan=2>98.3% 98.6%</td><td rowspan=1 colspan=1>98.6%</td></tr><tr><td></td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>38.9%</td><td rowspan=1 colspan=1>25.9%</td><td rowspan=1 colspan=1>48.6%</td><td rowspan=1 colspan=1>47.7%</td><td rowspan=1 colspan=1>55.7%</td><td rowspan=1 colspan=1>57.1%</td><td rowspan=1 colspan=1>62.2%</td></tr><tr><td></td><td rowspan=1 colspan=1>13.6%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>16.5%</td><td rowspan=1 colspan=1>17.6%</td><td rowspan=1 colspan=1>37.5%</td><td rowspan=1 colspan=1>39.2%</td><td rowspan=1 colspan=1>51.4%</td><td rowspan=1 colspan=1>46.3%</td></tr><tr><td></td><td rowspan=1 colspan=1>23.0%</td><td rowspan=1 colspan=1>32.1%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>36.4%</td><td rowspan=1 colspan=1>52.8%</td><td rowspan=1 colspan=1>56.5%</td><td rowspan=1 colspan=1>58.2%</td><td rowspan=1 colspan=1>58.5%</td></tr><tr><td></td><td rowspan=1 colspan=1>8.8%</td><td rowspan=1 colspan=1>8.8%</td><td rowspan=1 colspan=1>9.1%</td><td rowspan=1 colspan=1>1.1%</td><td rowspan=1 colspan=1>26.7%</td><td rowspan=1 colspan=1>28.1%</td><td rowspan=1 colspan=1>34.9%</td><td rowspan=1 colspan=1>31.8%</td></tr><tr><td rowspan=5 colspan=1>Aareeet RN-50A-RN-50C-RN-152A -RN-152C-Ensemble-</td><td rowspan=1 colspan=1>51.4%</td><td rowspan=1 colspan=1>56.3%</td><td rowspan=1 colspan=1>47.2%</td><td rowspan=1 colspan=1>53.1%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>30.7%</td><td rowspan=1 colspan=1>38.4%</td><td rowspan=1 colspan=1>43.2%</td></tr><tr><td rowspan=1 colspan=1>49.4%</td><td rowspan=1 colspan=1>48.3%</td><td rowspan=1 colspan=1>55.1%</td><td rowspan=1 colspan=1>54.0%</td><td rowspan=1 colspan=1>23.0%</td><td rowspan=1 colspan=1>1.1%</td><td rowspan=1 colspan=1>37.2%</td><td rowspan=1 colspan=1>36.4%</td></tr><tr><td rowspan=1 colspan=1>30.4%</td><td rowspan=1 colspan=1>38.1%</td><td rowspan=1 colspan=1>39.8%</td><td rowspan=1 colspan=1>43.8%</td><td rowspan=1 colspan=1>18.8%</td><td rowspan=1 colspan=1>22.2%</td><td rowspan=1 colspan=1>3.4%</td><td rowspan=1 colspan=1>25.9%</td></tr><tr><td rowspan=1 colspan=1>26.4%</td><td rowspan=1 colspan=1>33.8%</td><td rowspan=1 colspan=1>35.5%</td><td rowspan=1 colspan=1>37.8%</td><td rowspan=1 colspan=1>17.3%</td><td rowspan=1 colspan=1>18.2%</td><td rowspan=1 colspan=1>16.8%</td><td rowspan=1 colspan=1> 3.4%</td></tr><tr><td rowspan=1 colspan=1>10.5%</td><td rowspan=1 colspan=1>4.5%</td><td rowspan=1 colspan=1>9.7%</td><td rowspan=1 colspan=1>8.8%</td><td rowspan=1 colspan=1>15.1%</td><td rowspan=1 colspan=1> 6.5%</td><td rowspan=1 colspan=1>12.8%</td><td rowspan=1 colspan=1>13.6%</td></tr></table>
|
| 270 |
+
|
| 271 |
+
Table 6: Rank-50 accuracy of LowKey attacks on the UMDFaces dataset. After the first row, each row represents LowKey attacks generated from the same model. Each column represents inference on a single model. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
| 272 |
+
|
| 273 |
+
<table><tr><td></td><td rowspan=1 colspan=1>96.0%</td><td rowspan=1 colspan=1>97.2%</td><td rowspan=1 colspan=1>96.9%</td><td rowspan=1 colspan=2>96.9% 96.3%</td><td rowspan=1 colspan=2>96.6% 97.2%</td><td rowspan=1 colspan=1>96.3%</td></tr><tr><td></td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>12.2%</td><td rowspan=1 colspan=1>6.3%</td><td rowspan=1 colspan=1>18.2%</td><td rowspan=1 colspan=1>17.6%</td><td rowspan=1 colspan=1>25.9%</td><td rowspan=1 colspan=1>28.1%</td><td rowspan=1 colspan=1>31.3%</td></tr><tr><td></td><td rowspan=1 colspan=1>1.7%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>4.3%</td><td rowspan=1 colspan=1>11.6%</td><td rowspan=1 colspan=1>13.9%</td><td rowspan=1 colspan=1>17.3%</td><td rowspan=1 colspan=1>21.0%</td></tr><tr><td></td><td rowspan=1 colspan=1>4.3%</td><td rowspan=1 colspan=1>12.8%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>14.5%</td><td rowspan=1 colspan=1>22.4%</td><td rowspan=1 colspan=1>25.6%</td><td rowspan=1 colspan=1>29.5%</td><td rowspan=1 colspan=1>30.1%</td></tr><tr><td></td><td rowspan=1 colspan=1>1.7%</td><td rowspan=1 colspan=1>2.0%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>6.8%</td><td rowspan=1 colspan=1>9.7%</td><td rowspan=1 colspan=1>13.6%</td><td rowspan=1 colspan=1>11.4%</td></tr><tr><td></td><td rowspan=1 colspan=1>26.4%</td><td rowspan=1 colspan=1>31.0%</td><td rowspan=1 colspan=1>13.9%</td><td rowspan=1 colspan=1>26.4%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>9.4%</td><td rowspan=1 colspan=1>15.1%</td><td rowspan=1 colspan=1>19.0%</td></tr><tr><td rowspan=4 colspan=1>RN-50C-RN-152A -RN-152C-Ensemble </td><td rowspan=1 colspan=1>14.5%</td><td rowspan=1 colspan=1>21.3%</td><td rowspan=1 colspan=1>20.7%</td><td rowspan=1 colspan=1>25.3%</td><td rowspan=1 colspan=1>6.5%</td><td rowspan=1 colspan=1>0.6%</td><td rowspan=1 colspan=1>12.8%</td><td rowspan=1 colspan=1>14.8%</td></tr><tr><td rowspan=1 colspan=1>9.7%</td><td rowspan=1 colspan=1>16.2%</td><td rowspan=1 colspan=1>16.8%</td><td rowspan=1 colspan=1>17.9%</td><td rowspan=1 colspan=1> 5.1%</td><td rowspan=1 colspan=1>7.1%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1> 7.4%</td></tr><tr><td rowspan=1 colspan=1>7.4%</td><td rowspan=1 colspan=1>10.2%</td><td rowspan=1 colspan=1>11.9%</td><td rowspan=1 colspan=1>13.1%</td><td rowspan=1 colspan=1>3.1%</td><td rowspan=1 colspan=1> 4.5%</td><td rowspan=1 colspan=1> 5.4%</td><td rowspan=1 colspan=1>0.9%</td></tr><tr><td rowspan=1 colspan=1>2.8%</td><td rowspan=1 colspan=1>1.7%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>3.1%</td><td rowspan=1 colspan=1> 5.1%</td><td rowspan=1 colspan=1>2.0%</td><td rowspan=1 colspan=1>3.1%</td><td rowspan=1 colspan=1>4.0%</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 7: Rank-1 accuracy of LowKey attack attacks on the UMDFaces dataset. After the first row, each row represents LowKey attacks generated from the same model. Each column represents inference on a single model. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
| 276 |
+
|
| 277 |
+
Azure Face recognizes $5 . 5 \%$ of probe images. Results of controlled experiments are reported in Tables 8 and 9.
|
| 278 |
+
|
| 279 |
+
# 8.5 COMPARISON WITH FAWKES
|
| 280 |
+
|
| 281 |
+
By comparing a set of images protected with LowKey and Fawkes tools, we can see that both attacks are noticeable, but distort images in different ways. While Fawkes adds conspicuous artifacts on the face (such as mustaches or lines on the nose), LowKey attack mostly changes the textures and adds spots on a person’s skin. See Figure 5 for a visual comparison.
|
| 282 |
+
|
| 283 |
+
<table><tr><td></td><td rowspan=1 colspan=1>96.8%</td><td rowspan=1 colspan=1>96.8%</td><td rowspan=1 colspan=1>96.7%</td><td rowspan=1 colspan=1>96.8%</td><td rowspan=1 colspan=1>96.8%</td><td rowspan=1 colspan=2>96.8% 96.7%</td><td rowspan=1 colspan=1>96.7%</td></tr><tr><td></td><td rowspan=1 colspan=1>1.0%</td><td rowspan=1 colspan=1>41.1%</td><td rowspan=1 colspan=1>24.7%</td><td rowspan=1 colspan=1>55.2%</td><td rowspan=1 colspan=1>49.7%</td><td rowspan=1 colspan=1>65.0%</td><td rowspan=1 colspan=1>64.2%</td><td rowspan=1 colspan=1>68.8%</td></tr><tr><td></td><td rowspan=1 colspan=1>17.4%</td><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>20.4%</td><td rowspan=1 colspan=1>30.2%</td><td rowspan=1 colspan=1>47.0%</td><td rowspan=1 colspan=1>49.0%</td><td rowspan=1 colspan=1>56.2%</td><td rowspan=1 colspan=1>55.6%</td></tr><tr><td></td><td rowspan=1 colspan=1>28.8%</td><td rowspan=1 colspan=1>38.6%</td><td rowspan=1 colspan=1>0.3%</td><td rowspan=1 colspan=1>49.8%</td><td rowspan=1 colspan=1>61.2%</td><td rowspan=1 colspan=1>66.6%</td><td rowspan=1 colspan=1>69.8%</td><td rowspan=1 colspan=1>70.7%</td></tr><tr><td></td><td rowspan=1 colspan=1>14.2%</td><td rowspan=1 colspan=1>14.0%</td><td rowspan=1 colspan=1>16.2%</td><td rowspan=1 colspan=1>2.7%</td><td rowspan=1 colspan=1>37.0%</td><td rowspan=1 colspan=1>38.6%</td><td rowspan=1 colspan=1>44.4%</td><td rowspan=1 colspan=1>42.9%</td></tr><tr><td rowspan=5 colspan=1>Aareeet RN-50A-RN-50C-RN-152A -RN-152C-Ensemble -</td><td rowspan=1 colspan=1>49.3%</td><td rowspan=1 colspan=1>62.3%</td><td rowspan=1 colspan=1>64.1%</td><td rowspan=1 colspan=1>68.0%</td><td rowspan=1 colspan=1>1.5%</td><td rowspan=1 colspan=1>35.9%</td><td rowspan=1 colspan=1>41.8%</td><td rowspan=1 colspan=1>49.3%</td></tr><tr><td rowspan=1 colspan=1> 57.4%</td><td rowspan=1 colspan=1>59.9%</td><td rowspan=1 colspan=1>62.1%</td><td rowspan=1 colspan=1>64.4%</td><td rowspan=1 colspan=1>31.1%</td><td rowspan=1 colspan=1>3.6%</td><td rowspan=1 colspan=1>46.8%</td><td rowspan=1 colspan=1>48.6%</td></tr><tr><td rowspan=1 colspan=1>42.9%</td><td rowspan=1 colspan=1>51.3%</td><td rowspan=1 colspan=1>52.3%</td><td rowspan=1 colspan=1>55.0%</td><td rowspan=1 colspan=1>25.6%</td><td rowspan=1 colspan=1>32.9%</td><td rowspan=1 colspan=1>5.6%</td><td rowspan=1 colspan=1>35.0%</td></tr><tr><td rowspan=1 colspan=1>41.8%</td><td rowspan=1 colspan=1>48.9%</td><td rowspan=1 colspan=1>47.9%</td><td rowspan=1 colspan=1>52.7%</td><td rowspan=1 colspan=1>28.2%</td><td rowspan=1 colspan=1>29.2%</td><td rowspan=1 colspan=1>30.4%</td><td rowspan=1 colspan=1>8.5%</td></tr><tr><td rowspan=1 colspan=1>18.0%</td><td rowspan=1 colspan=1>21.8%</td><td rowspan=1 colspan=1>19.4%</td><td rowspan=1 colspan=1>12.2%</td><td rowspan=1 colspan=1>23.1%</td><td rowspan=1 colspan=1>24.3%</td><td rowspan=1 colspan=1>27.0%</td><td rowspan=1 colspan=1>14.1%</td></tr></table>
|
| 284 |
+
|
| 285 |
+
Table 8: Rank-50 accuracy of LowKey small attacks on the UMDFaces dataset. After the first row, each row represents LowKey small attacks generated from the same model. Each column represents inference on a single model. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
| 286 |
+
|
| 287 |
+
<table><tr><td></td><td rowspan=1 colspan=1>95.6%</td><td rowspan=1 colspan=1>96.1%</td><td rowspan=1 colspan=1>96.0%</td><td rowspan=1 colspan=1>96.2%</td><td rowspan=1 colspan=4>95.8% 95.9% 95.9% 96.0%</td></tr><tr><td></td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>6.1%</td><td rowspan=1 colspan=1>2.2%</td><td rowspan=1 colspan=1>10.5%</td><td rowspan=1 colspan=1>9.7%</td><td rowspan=1 colspan=1>14.4%</td><td rowspan=1 colspan=1>16.9%</td><td rowspan=1 colspan=1>19.5%</td></tr><tr><td></td><td rowspan=1 colspan=1>1.6%</td><td rowspan=1 colspan=1>0.2%</td><td rowspan=1 colspan=1>2.5%</td><td rowspan=1 colspan=1>5.8%</td><td rowspan=1 colspan=1>9.3%</td><td rowspan=1 colspan=1>11.1%</td><td rowspan=1 colspan=1>14.0%</td><td rowspan=1 colspan=1>14.5%</td></tr><tr><td></td><td rowspan=1 colspan=1>2.2%</td><td rowspan=1 colspan=1>5.6%</td><td rowspan=1 colspan=1>0.0%</td><td rowspan=1 colspan=1>9.6%</td><td rowspan=1 colspan=1>14.0%</td><td rowspan=1 colspan=1>17.4%</td><td rowspan=1 colspan=1>19.2%</td><td rowspan=1 colspan=1>20.7%</td></tr><tr><td></td><td rowspan=1 colspan=1>1.3%</td><td rowspan=1 colspan=1>1.7%</td><td rowspan=1 colspan=1>2.2%</td><td rowspan=1 colspan=1>0.4%</td><td rowspan=1 colspan=1> 5.1%</td><td rowspan=1 colspan=1> 7.5%</td><td rowspan=1 colspan=1>9.6%</td><td rowspan=1 colspan=1> 9.7%</td></tr><tr><td rowspan=5 colspan=1>AAraret RN-50ARN-50CRN-152A-RN-152C-Ensemble</td><td rowspan=1 colspan=1>8.7%</td><td rowspan=1 colspan=1>14.9%</td><td rowspan=1 colspan=1>14.8%</td><td rowspan=1 colspan=1>17.1%</td><td rowspan=1 colspan=1>0.2%</td><td rowspan=1 colspan=1>7.6%</td><td rowspan=1 colspan=1>7.8%</td><td rowspan=1 colspan=1>12.5%</td></tr><tr><td rowspan=1 colspan=1>9.9%</td><td rowspan=1 colspan=1>14.6%</td><td rowspan=1 colspan=1>15.6%</td><td rowspan=1 colspan=1>17.2%</td><td rowspan=1 colspan=1>5.6%</td><td rowspan=1 colspan=1>0.6%</td><td rowspan=1 colspan=1>8.8%</td><td rowspan=1 colspan=1>11.6%</td></tr><tr><td rowspan=1 colspan=1>9.2%</td><td rowspan=1 colspan=1>13.5%</td><td rowspan=1 colspan=1>12.2%</td><td rowspan=1 colspan=1>14.8%</td><td rowspan=1 colspan=1>5.7%</td><td rowspan=1 colspan=1>7.9%</td><td rowspan=1 colspan=1>0.8%</td><td rowspan=1 colspan=1>8.5%</td></tr><tr><td rowspan=1 colspan=1>6.9%</td><td rowspan=1 colspan=1>11.3%</td><td rowspan=1 colspan=1>11.8%</td><td rowspan=1 colspan=1>12.2%</td><td rowspan=1 colspan=1>4.8%</td><td rowspan=1 colspan=1> 5.3%</td><td rowspan=1 colspan=1>6.0%</td><td rowspan=1 colspan=1>1.3%</td></tr><tr><td rowspan=1 colspan=1>2.6%</td><td rowspan=1 colspan=1>3.6%</td><td rowspan=1 colspan=1>3.5%</td><td rowspan=1 colspan=1>2.9%</td><td rowspan=1 colspan=1>4.0%</td><td rowspan=1 colspan=1>4.7%</td><td rowspan=1 colspan=1> 5.4%</td><td rowspan=1 colspan=1>3.9%</td></tr></table>
|
| 288 |
+
|
| 289 |
+
Table 9: Rank-1 accuracy of LowKey small attacks on the UMDFaces dataset. After the first row, each row represents LowKey small attacks generated from the same model. Each column represents inference on a single model. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
| 290 |
+
|
| 291 |
+
# 8.6 GAUSSIAN SMOOTHING IN LOWKEY
|
| 292 |
+
|
| 293 |
+
For the parameters of the Gaussian smoothing term in the optimization problem (1), we use 3 for $\sigma$ and 7 for window size. For the defensive Gaussian blur, we use $\sigma = 2$ and no window size.
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 5: Panel of different attacks. First row: original images, second row: Fawkes attack, third row: LowKey small attack, last row: LowKey attack.
|
| 297 |
+
|
| 298 |
+
Defender IR-50A IR-50C IR-152A IR-152C RN-50A RN-50C RN-152A RN-152C
|
| 299 |
+
|
| 300 |
+
<table><tr><td rowspan="2">Clean </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>84.4%</td><td>85.3%</td><td>84.7%</td><td>86.1%</td><td>86.7%</td><td>87.9%</td><td>88.5%</td><td>89.6%</td></tr><tr><td>Aareeet Without GS</td><td>13.3%</td><td>17.9%</td><td>15.8%</td><td>13.7%</td><td>18.9%</td><td>20.4%</td><td>23.2%</td><td>20.6%</td></tr><tr><td>With GS</td><td>0.3%</td><td>0.3%</td><td>0.1%</td><td>0.0%</td><td>1.0%</td><td>0.9%</td><td>0.6%</td><td>0.6%</td></tr></table>
|
| 301 |
+
|
| 302 |
+
Table 10: Rank-1 accuracy of FR models tested on blurred images attacked without and with the Gaussian smoothing term. The first two letters in the model’s name denote the type of backbone: IR or ResNet (RN). The last letter in the model’s name indicates the type of head; “A” denotes ArcFace, and “C” denotes CosFace. Smaller numbers, and lighter colors, indicate more successful attacks.
|
md/train/iorEu783qJ5/iorEu783qJ5.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Particle Cloud Generation with Message Passing Generative Adversarial Networks
|
| 2 |
+
|
| 3 |
+
Raghav Kansal, Javier Duarte, Hao Su University of California San Diego La Jolla, CA 92093, USA
|
| 4 |
+
|
| 5 |
+
Breno Orzari, Thiago Tomei Universidade Estadual Paulista São Paulo/SP - CEP 01049-010, Brazil
|
| 6 |
+
|
| 7 |
+
Maurizio Pierini, Mary Touranakou⇤ European Organization for Nuclear Research (CERN) CH-1211 Geneva 23, Switzerland
|
| 8 |
+
|
| 9 |
+
Jean-Roch Vlimant California Institute of Technology Pasadena, CA 91125, USA
|
| 10 |
+
|
| 11 |
+
Dimitrios Gunopulos National and Kapodistrian University of Athens Athens 15772, Greece
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
In high energy physics (HEP), jets are collections of correlated particles produced ubiquitously in particle collisions such as those at the CERN Large Hadron Collider (LHC). Machine learning (ML)-based generative models, such as generative adversarial networks (GANs), have the potential to significantly accelerate LHC jet simulations. However, despite jets having a natural representation as a set of particles in momentum-space, a.k.a. a particle cloud, there exist no generative models applied to such a dataset. In this work, we introduce a new particle cloud dataset (JetNet), and apply to it existing point cloud GANs. Results are evaluated using (1) 1-Wasserstein distances between high- and low-level feature distributions, (2) a newly developed Fréchet ParticleNet Distance, and (3) the coverage and (4) minimum matching distance metrics. Existing GANs are found to be inadequate for physics applications, hence we develop a new message passing GAN (MPGAN), which outperforms existing point cloud GANs on virtually every metric and shows promise for use in HEP. We propose JetNet as a novel point-cloud-style dataset for the ML community to experiment with, and set MPGAN as a benchmark to improve upon for future generative models. Additionally, to facilitate research and improve accessibility and reproducibility in this area, we release the open-source JETNET Python package with interfaces for particle cloud datasets, implementations for evaluation and loss metrics, and more tools for ML in HEP development.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Over the past decade, machine learning (ML) has become the de facto way to analyze jets, collimated high-energy sprays of particles [1] produced at the CERN Large Hadron Collider (LHC). To apply ML to jets, the most natural representation is a particle cloud, a variable-sized set of points in momentum space, whose radiation pattern contains rich information about the underlying physics known as quantum chromodynamics (QCD). A fundamental question is whether ML algorithms can model this underlying physics and successfully reproduce the rich high- and low-level structure in jets.
|
| 20 |
+
|
| 21 |
+
Answering this question affirmatively has important practical applications. At the LHC, large simulated data samples of collision events2 are generated using Monte Carlo (MC) methods in order to translate theoretical predictions into observable distributions, and ultimately perform physics analyses3. These samples, numbering in the billions of events, require computationally expensive modeling of the interaction of particles traversing the detector material. Recently developed generative frameworks in ML such as generative adversarial networks (GANs), if accurate enough, can be used to accelerate this simulation by potentially five orders of magnitude [2].
|
| 22 |
+
|
| 23 |
+
In this work, we advocate for a benchmark jet dataset (JetNet) and propose several physics- and computer-vision-inspired metrics with which the ML community can improve and evaluate generative models in high energy physics (HEP). To facilitate and encourage research in this area, as well as to make such research more accessible and reproducible, we release interfaces for public particle cloud datasets such as JetNet, implementations for our proposed metrics, and various tools for ML in HEP development in the JETNET library [3]. We next apply existing point cloud GANs on JetNet and find the results to be inadequate for physics applications. Finally, we develop our own message passing GAN (MPGAN), which dramatically improves results on virtually every metric, and propose it as a benchmark on JetNet.
|
| 24 |
+
|
| 25 |
+
# 2 Jets
|
| 26 |
+
|
| 27 |
+
High-energy proton-proton collisions at the LHC produce elementary particles like quarks and gluons, which cannot be isolated due to the QCD property of color confinement [4]. These particles continuously radiate or “split” into a set of particles, known as a parton shower. Eventually they cool to an energy at which they undergo the process of hadronization, where the fundamental particles combine to form more stable hadrons, such as pions and protons. The final set of collimated hadrons produced after such a process is referred to as a jet.
|
| 28 |
+
|
| 29 |
+
The task of simulating a single jet can be algorithmically defined as inputting an initial particle, which produces the jet, and outputting the final set of particles a.k.a. the jet constituents. Typically in HEP the parton shower and hadronization are steps that are simulated sequentially using MC event generators such as PYTHIA [5] or HERWIG [6]. Simulating either process exactly is not possible because of the complex underlying physics (QCD), and instead these event generators fit simplified physics-inspired stochastic models, such as the Lund string model for hadronization [7], to existing data using MC methods. The present work can be seen as an extension of this idea, using a simpler, ML-based model, also fitted to data, for generating the jet in one shot, where we are effectively trading the interpretability of the MC methods for the speed of GPU-accelerated ML generators.
|
| 30 |
+
|
| 31 |
+
Representations. As common for collider physics, we use a Cartesian coordinate system with the $z$ axis oriented along the beam axis, the $x$ axis on the horizontal plane, and the $y$ axis oriented upward. The $x$ and $y$ axes define the transverse plane, while the $z$ axis identifies the longitudinal direction. The azimuthal angle $\phi$ is computed with respect to the $x$ axis. The polar angle $\theta$ is used to compute the pseudorapidity $\eta = - \log ( \tan ( \theta / 2 ) )$ . The transverse momentum $( p _ { \mathrm { T } } )$ is the projection of the particle momentum on the $( x , y )$ plane. As is customary, we transform the particle momenta from Cartesian coordinates $\left( p _ { x } , p _ { y } , p _ { z } \right)$ to longitudinal-boost-invariant pseudo-angular coordinates $( p _ { \mathrm { T } } , \eta , \phi )$ , as shown in Fig. 1.
|
| 32 |
+
|
| 33 |
+
In the context of ML, jets can be represented in multiple ways. One popular representation is as images [8, 9], created by projecting each jet’s particle constituents onto a discretized angular $\eta { - } \phi$ plane, and taking the intensity of each “pixel” in this grid to be a monotonically increasing function of the corresponding particle $p _ { \mathrm { T } }$ . These tend to be extremely sparse, with typically fewer than $10 \%$ of pixels nonempty [10], and the discretization process can furthemore lower the resolution.
|
| 34 |
+
|
| 35 |
+
Two more spatially efficient representations are as ordered lists or unordered sets [11, 12] of the jet constituents and their features. The difficulty with the former is that there is no particular preferred ordering of the particles—one would have to impose an arbitrary ordering such as by transverse momentum [13]. The more natural representation is the unordered set of particles in momentum space, which we refer to as a “particle cloud.” This is in analogy to point cloud representations of 3D objects in position-space prevalent in computer vision created, for example, by sampling from 3D ShapeNet models [14].
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: The collider physics coordinate system defining $( p _ { \mathrm { T } } , \eta , \phi )$ (left). The three jet classes in our dataset (right). Gluon (g) and light quark (q) jets have simple topologies, with q jets generally containing fewer particles. Top quark (t) jets have a complex three-pronged structure. Shown also are the relative angular coordinates $\bar { \boldsymbol { \eta } } ^ { \mathrm { r e l } }$ h→and $\dot { \phi } ^ { \mathrm { r e l } }$ t→Wb→q, measured from the jet axis.
|
| 39 |
+
|
| 40 |
+
Apart from how the samples are produced, significant differences between jets and ShapeNet-based point clouds are that, firstly, jets have physically meaningful low- and high-level features such as particle momentum, total mass of the jet, the number of sub-jets, and $n$ -particle energy correlations. These physical observables are how we characterize jets, and hence are important to reproduce correctly for physics analysis applications. Secondly, unlike the conditional distributions of points given a particular ShapeNet object, which are identical and independent, particle distributions within jets are highly correlated, as the particles each originate from a single source. The independence of their constituents also means that ShapeNet-sampled point clouds can be chosen to be of a fixed cardinality, whereas this is not possible for jets, which inherently contain varying numbers of particles due to the stochastic nature of particle production.
|
| 41 |
+
|
| 42 |
+
JetNet. We publish JetNet [15] under the CC-BY 4.0 license, to facilitate and advance ML research in HEP, and to offer a new point-cloud-style dataset to experiment with. Derived from Ref. $[ 1 6 ] ^ { 4 }$ , it consists of simulated particle jets with transverse momenta $p _ { \mathrm { T } } ^ { \mathrm { j e t } } \approx 1 \mathrm { T e V }$ , originating from gluons, light quarks, and top quarks produced in $1 3 \mathrm { T e V }$ proton-proton collisions in a simplified detector. Technical details of the generation process are given in App. B. We limit the number of constituents to the 30 highest $p _ { \mathrm { T } }$ particles per jet, allowing for jets with potentially fewer than 30 by zeropadding. For each particle we provide the following four features: the relative angular coordinates $\bar { \eta } ^ { \mathrm { r e l } } = \bar { \eta } ^ { \mathrm { p a r t i c l e } } - \bar { \eta } ^ { \mathrm { j e t } }$ and $\phi ^ { \mathrm { r e l } } { \bar { = } } \phi ^ { \mathrm { p a r t i c l e } } - \phi ^ { \mathrm { j e t } }$ (mod $2 \pi$ ), relative transverse momentum $p _ { \mathrm { T } } ^ { \mathrm { r e l } } =$ $p _ { \mathrm { T } } ^ { \mathrm { p a r t i c l e } } / p _ { \mathrm { T } } ^ { \mathrm { j e t } }$ , and a binary mask feature classifying the particle as genuine or zero-padded.
|
| 43 |
+
|
| 44 |
+
We choose three jet classes, depicted in Fig. 1, to individually target the unique and challenging properties of jets. Gluons provide a useful baseline test, as they typically radiate into a large number of particles before hadronization, largely avoiding the variable-sized cloud issue—at least with a 30 particle maximum, and have a relatively simple topology. Light quarks share the simple topology, but produce fewer final-state particles, resulting in a larger fraction of zero-padded particles in the dataset. They allow evaluation of a model’s ability to handle variable-sized clouds. Finally, top quarks decay into three lighter quarks through an intermediate particle, the W boson, which each may produce their own sub-jets, leading to a complex two- or three-pronged topology—depending on whether the jet clustering algorithm captures all three or just two of these sub-jets. This results in bimodal jet feature distributions (one peak corresponding to fully merged top quark jets and the other to semi-merged, as seen in Fig. 3). Thus, top quark jets test models’ ability to learn the rich global structure and clustering history of a particle cloud.
|
| 45 |
+
|
| 46 |
+
# 3 Related Work
|
| 47 |
+
|
| 48 |
+
Generative models in HEP. Past work in this area has exclusively used image-based representations for HEP data. One benefit of this is the ability to employ convolutional neural network (CNN) based generative models, which have been highly successful on computer vision tasks.
|
| 49 |
+
|
| 50 |
+
Refs. [2, 17–20], for example, build upon CNN-based GANs, and Ref. [21] uses an auto-regressive model, to output jet- and detector-data-images.
|
| 51 |
+
|
| 52 |
+
In addition to the issues with such representations outlined in Sec. 2, the high sparsity of the images can lead to training difficulties in GANs, and the irregular geometry of the data — a single LHC detector can typically have multiple sections with differing pixel sizes and shapes — poses a challenge for CNN GANs which output uniform matrices. While these can be mitigated to an extent with techniques such as batch normalization [22] and using larger/more regular pixels [18], our approach avoids both issues by generating particle-cloud-representations of the data, as these are inherently sparse data structures and are completely flexible to the underlying geometry.
|
| 53 |
+
|
| 54 |
+
GANs for point clouds. There are several published generative models in this area, however the majority exploit inductive biases specific to their respective datasets, such as ShapeNet-based [23–26] and molecular [27–29] point clouds, which are not appropriate for jets. A more detailed discussion, including some experimental results, can be found in App. C.
|
| 55 |
+
|
| 56 |
+
There do exist some more general-purpose GAN models, namely r-GAN [30], GraphCNN-GAN [31], and TreeGAN [32], and we test these on JetNet. r-GAN uses a fully-connected (FC) network, GraphCNN-GAN uses graph convolutions based on dynamic $k$ -nn graphs in intermediate feature spaces, and TreeGAN iteratively up-samples the graphs with information passing from ancestor to descendant nodes. In terms of discriminators, past work has used either a FC or a PointNet [33]-style network. Ref. [34] is the first work to study point cloud discriminator design in detail and finds amongst a number of PointNet and graph convolutional models that PointNet-Mix, which uses both max- and average-pooled features, is the most performant.
|
| 57 |
+
|
| 58 |
+
We apply the three aforementioned generators and FC and PointNet-Mix discriminators as baselines to our dataset, but find jet structure is not adequately reproduced. GraphCNN’s local convolutions make learning global structure difficult, and while the TreeGAN and FC generator $^ +$ PointNet discriminator combinations are improvements, they are not able to learn multi-particle correlations, particularly for the complex top quark jets, nor deal with the variable-sized light quark jets to the extent necessary for physics applications.
|
| 59 |
+
|
| 60 |
+
Message Passing Neural Networks. We attempt to overcome limitations of existing GANs by designing a novel generator and discriminator which can learn such correlations and handle variablesized particle clouds. Both networks build upon the generic message-passing neural network (MPNN) [35] framework with physics-conscious design choices, and collectively we refer to them as message-passing GAN (MPGAN). We find MPGAN outperforms existing models on virtually all evaluation metrics.
|
| 61 |
+
|
| 62 |
+
# 3.1 Evaluating generative models.
|
| 63 |
+
|
| 64 |
+
Evaluating generative models is a difficult task, however there has been extensive work in this area in both the physics and computer-vision communities.
|
| 65 |
+
|
| 66 |
+
Physics-inspired metrics. An accurate jet simulation algorithm should reproduce both low-level and high-level features (such as those described in Sec. 2), hence a standard method of validating generative models, which we employ, is to compare the distributions of such features between the real and generated samples5 [2, 17–20, 36].
|
| 67 |
+
|
| 68 |
+
For application in HEP, a generative model needs to produce jets with physical features indistinguishable from real. Therefore, we propose the validation criteria that differences between real and generated sample features may not exceed those between sets of randomly chosen real samples. To verify this, we use bootstrapping to compare between random samples of only real jets as a baseline.
|
| 69 |
+
|
| 70 |
+
A practically useful set of features to validate against are the so-called “energy-flow polynomials” (EFPs) [37], which are a set of multi-particle correlation functions. Importantly, the set of all EFPs forms a linear basis for all useful jet-level features6. Therefore, we claim that if we observe all EFP distributions to be reproduced with high fidelity and to match the above criteria, we can conclude with strong confidence that our model is outputting accurate particle clouds.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Top: The MP generator uses message passing to generate a particle cloud. In blue is the initial latent vector and FC layer part of the MP-LFC variant. Bottom: The MP discriminator uses message passing to classify an input particle cloud as real or generated.
|
| 74 |
+
|
| 75 |
+
Computer-vision-inspired metrics A popular metric for evaluating images which has shown to be sensitive to output quality and mode-collapse, though it has its limitations [38], is the Fréchet Inception Distance [39] (FID). FID is defined as the Fréchet distance between Gaussian distributions fitted to the activations of a fully-connected layer of the Inception-v3 image classifier in response to real and generated samples. We develop a particle-cloud-analogue of this metric, which we call Fréchet ParticleNet Distance (FPND), using the state-of-the-art (SOTA) ParticleNet graph convolutional jet classifier [10] in lieu of the Inception network. We note that the FPND and comparing distributions as above is conceptually equivalent, except here instead of physically meaningful and easily interpretable features, we are comparing those found to be statistically optimum for distinguishing jets.
|
| 76 |
+
|
| 77 |
+
Two common metrics for evaluating point cloud generators are coverage (COV) and minimum matching distance (MMD) [30]. Both involve finding the closest point cloud in a sample $X$ to each cloud in another sample $Y$ , based on a metric such as the Chamfer distance or the earth mover’s distance. Coverage is defined as the fraction of samples in $X$ which were matched to one in $Y$ , measuring thus the diversity of the samples in $Y$ relative to $X$ , and MMD is the average distance between matched samples, measuring the quality of samples. We use both, and due to drawbacks of the Chamfer distance pointed out in Ref. [30], for our distance metric choose only the analogue of the earth mover’s distance for particle clouds a.k.a. the energy mover’s distance (EMD) [40]. We discuss the effectiveness and complementarity of all four metrics in evaluating clouds in Sec. 5.
|
| 78 |
+
|
| 79 |
+
# 4 MPGAN Architecture
|
| 80 |
+
|
| 81 |
+
We describe now the architecture of our MPGAN model (Fig. 2), noting particle cloud-motivated aspects compared to its r-GAN and GraphCNN-GAN predecessors.
|
| 82 |
+
|
| 83 |
+
Message passing. Jets originate from a single source particle decaying and hadronizing, hence they end up with important high-level jet features and a rich global structure, known as the jet substructure [1], stemming from the input particle. Indeed any high-level feature useful for analyzing jets, such as jet mass or multi-particle correlations, is necessarily global [37]. Because of this, while past work in learning on point clouds [10, 41, 42], including GraphCNN-GAN, has used a locally connected graph structure and convolutions for message passing, we choose a fully connected graph, equally weighting messages from all particles in the clouds. Rather than subtracting particle features for messages between particles, useful in graph convolutions to capture local differences within a neighborhood, the respective features are concatenated to preserve the global structure (the difference between particle features is also only physically meaningful if they are in the 4-vector representation of the Lorentz group). During the update step in the message passing we find it empirically beneficial to incorporate a residual connection to previous particle features.
|
| 84 |
+
|
| 85 |
+
The operation can be described as follows. For an $N$ -particle cloud $J ^ { t } = \{ p _ { 1 } ^ { t } , \cdot \cdot \cdot , p _ { N } ^ { t } \}$ after $t$ iterations of message passing, with $t = 0$ corresponding to the original input cloud, each particle $p _ { i } ^ { t }$ is represented by features $\mathbf { h } _ { i } ^ { t }$ . One iteration of message passing is then defined as
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r l } { { } } & { { \mathbf { m } _ { i j } ^ { t + 1 } = f _ { e } ^ { t + 1 } ( \mathbf { h } _ { i } ^ { t } \oplus \mathbf { h } _ { j } ^ { t } ) , } } \\ { { } } & { { \mathbf { h } _ { i } ^ { t + 1 } = f _ { n } ^ { t + 1 } ( \mathbf { h } _ { i } ^ { t } \oplus \displaystyle \sum _ { j \in J } \mathbf { m } _ { i j } ^ { t + 1 } ) , } } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where particl $\mathbf { m } _ { i j } ^ { t + 1 }$ id mesand vector sent from particle are arbitrary functions w $j$ to particle ich, in our $i$ , $\mathbf { h } _ { i } ^ { t + 1 }$ are the updated features of implemented as multilayer $i$ $f _ { e } ^ { t + 1 }$ $f _ { n } ^ { t + 1 }$
|
| 92 |
+
perceptrons (MLPs) with 3 FC layers.
|
| 93 |
+
|
| 94 |
+
Generator. We test two initializations of a particle cloud for the MPGAN generator: (1) directly initializing the cloud with $N$ particles with $L$ randomly sampled features, which we refer to as the MP generator, and (2) inputting a single $Z$ -dimensional latent noise vector and transforming it via an FC layer into an $N \times L$ -dimensional matrix, which we refer to as the MP-Latent-FC (MP-LFC) generator. The MP-LFC uses a latent space which can intuitively be understood as representing the initial source particle’s features along with parameters to capture the stochasticity of the jet production process. Due to the complex nature of this process, however, we posit that this global, flattened latent space cannot capture the full phase space of individual particle features. Hence, we introduce the MP generator, which samples noise directly per particle, and find that it outperforms MP-LFC (Table 2).
|
| 95 |
+
|
| 96 |
+
Discriminator. We find the MP generator, in conjunction with a PointNet discriminator, to be a significant improvement on every metric compared to FC and GraphCNN generators. However, the jet-level features are not yet reproduced to a high enough accuracy (Sec. 5). While PointNet is able to capture global structural information, it can miss the complex interparticle correlations in real particle clouds. We find we can overcome this limitation by incorporating message passing in the discriminator as well as in the generator. Concretely, our MP discriminator receives the real or generated cloud and applies MP layers to produce intermediate features for each particle, which are then aggregated via a feature-wise average-pooling operation and passed through an FC layer to output the final scalar feature. We choose 2 MP layers for both networks.
|
| 97 |
+
|
| 98 |
+
Variable-sized clouds. In order to handle clouds with varying numbers of particles, as typical of jets, we introduce an additional binary “masking” particle feature classifying the particle as genuine or zero-padded. Particles in the zero-padded class are ignored entirely in the message passing and pooling operations. The MP generator adds mask features to the initial particle cloud, using an additional input of the size of the jet $N$ , sampled from the real distribution, before the message passing layers based on sorting in particle feature space. Ablation studies with alternative (as well as no) masking strategies are discussed in App. E.
|
| 99 |
+
|
| 100 |
+
# 5 Experiments
|
| 101 |
+
|
| 102 |
+
Evaluation. We use four techniques discussed in Sec. 3.1 for evaluating and comparing models. Distributions of physical particle and jet features are compared visually and quantitatively using the Wasserstein-1 $( W _ { 1 } )$ distance between them. For ease of evaluation, we report (1) the average scores of the three particle features $( W _ { 1 } ^ { \mathrm { P } } ) \eta ^ { \mathrm { r e l } }$ , $\phi ^ { \mathrm { r e l } }$ , and $p _ { \mathrm { T } } ^ { \mathrm { r e l } }$ , (2) the jet mass $( W _ { 1 } ^ { \mathrm { M } } )$ , and (3) the average of a subset of the $\mathrm { E F P s } ^ { 7 } ( W _ { 1 } ^ { \mathrm { E F P } } )$ , which together provide a holistic picture of the low- and high-level aspects of a jet. The $W _ { 1 }$ distances are calculated for each feature between random samples of 10,000 real and generated jets, and averaged over 5 batches. Baseline $W _ { 1 }$ distances are calculated between two sets of randomly sampled real jets with 10,000 samples each, and are listed for each feature in Table 1. The real samples are split 70/30 for training/evaluation. We train ParticleNet for classification on our dataset to develop the FPND metric. FPND is calculated between 50,000 random real and generated samples, based on the activations of the first FC layer in our trained model8. Coverage and MMD are calculated between 100 real and 100 generated samples, and averaged over 10 such batches. Implementations for all metrics are provided in the JETNET package [3].
|
| 103 |
+
|
| 104 |
+
Table 1: $W _ { 1 }$ distances between real jet mass $( W _ { 1 } ^ { \mathrm { M } } )$ , averaged particle features $( W _ { 1 } ^ { \mathrm { P } } )$ , and averaged jet EFPs $( W _ { 1 } ^ { \mathrm { E F P } } )$ distributions calculated as a baseline, for three classes of jets.
|
| 105 |
+
|
| 106 |
+
<table><tr><td>Jet class</td><td>WM (x10-3)</td><td>WP (×10-3)</td><td>WEFP (×10-5)</td></tr><tr><td>Gluon</td><td>0.7 ± 0.2</td><td>0.44± 0.09</td><td>0.62 ± 0.07</td></tr><tr><td>Light quark</td><td>0.5 ± 0.1</td><td>0.5 ± 0.1</td><td>0.46 ± 0.04</td></tr><tr><td>Top quark</td><td>0.51 ± 0.07</td><td>0.55 ± 0.07</td><td>1.1 ± 0.1</td></tr></table>
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 3: Comparison of real and generated distributions for a subset of jet and particle features. We use the best performing model for each of the FC, GraphCNN, TreeGAN, and MP generators, as per Table 2. Top: gluon jet features, Middle: light quark jets, Bottom: top quark jets.
|
| 110 |
+
|
| 111 |
+
Results. On each of JetNet’s three classes, we test r-GAN’s FC, GraphCNN, and TreeGAN generators with rGAN’s FC and the PointNet-Mix discriminators, and compare them to MPGAN’s MP generator and discriminator models, including both MP and MP-LFC generator variations. Training and implementation details for each can be found in App. D, and all code in Ref. [43].
|
| 112 |
+
|
| 113 |
+
We choose model parameters which, during training, yield the lowest $W _ { 1 } ^ { \mathrm { M } }$ score. This is because (1) $W _ { 1 }$ scores between physical features are more relevant for physics applications than the other three metrics, and (2) qualitatively we find it be a better discriminator of model quality than particle features or EFP scores. Table 2 lists the scores for each model and class, and Fig. 3 shows plots of selected feature distributions of real and generated jets, for the best performing FC, GraphCNN, TreeGAN, and MP generators. We also provide in App. F discretized images in the angular-coordinates-plane a.k.a “jet images”, however, we note that it is in general not easy to visually evaluate the quality of individual particle clouds, hence we focus on metrics and visualizations aggregated over batches of clouds. Overall we find that MPGAN is a significant improvement over the best FC, GraphCNN, and TreeGAN models, particularly for top and light quark jets. This is evident both visually and quantitatively in every metric, especially jet $W _ { 1 } s$ and FPND, with the exception of $W _ { 1 } ^ { \mathrm { P } }$ where only the FC generator and PointNet discriminator $\mathrm { F C } +$ PointNet) combination is more performant.
|
| 114 |
+
|
| 115 |
+
Table 2: Six evaluation scores on different generator and discriminator combinations. Lower is better for all metrics except COV.
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Jet class</td><td rowspan="2">Generator</td><td rowspan="2">Discriminator</td><td rowspan="2">WM (x10-3)</td><td rowspan="2">WP (×10-3)</td><td rowspan="2">WEFP (×10-5)</td><td rowspan="2">FPND</td><td rowspan="2">MMD</td></tr><tr><td>COV ↑</td></tr><tr><td rowspan="12">Gluon</td><td>FC</td><td>FC</td><td>18.3± 0.2</td><td>9.6± 0.4</td><td>8.5±0.5</td><td>176</td><td>0.24</td><td>0.045</td></tr><tr><td>GraphCNN</td><td>FC</td><td>2.6± 0.2</td><td>9.6 ±0.3</td><td>12±8</td><td>61</td><td>0.39</td><td>0.046</td></tr><tr><td>TreeGAN</td><td>FC</td><td>41.9 ± 0.3</td><td>69.3 ± 0.3</td><td>14.2 ± 0.8</td><td>355</td><td>0.19</td><td>0.130</td></tr><tr><td>FC</td><td>PointNet</td><td>1.3 ± 0.4</td><td>1.3± 0.2</td><td>1.5 ± 0.9</td><td>5.0</td><td>0.49</td><td>0.039</td></tr><tr><td>GraphCNN</td><td>PointNet</td><td>1.9 ±0.2</td><td>16±6</td><td>200 ±1000</td><td>7k</td><td>0.46</td><td>0.040</td></tr><tr><td>TreeGAN</td><td>PointNet</td><td>1.7 ± 0.1</td><td>4.0± 0.4</td><td>4±1</td><td>84</td><td>0.37</td><td>0.042</td></tr><tr><td>MP</td><td>MP</td><td>0.7± 0.2</td><td>0.9 ± 0.3</td><td>0.7±0.2</td><td>0.12</td><td>0.56</td><td>0.037</td></tr><tr><td>MP-LFC</td><td>MP</td><td>0.69 ± 0.07</td><td>1.8± 0.2</td><td>0.9 ±0.6</td><td>0.20</td><td>0.54</td><td>0.037</td></tr><tr><td>FC</td><td>MP</td><td>4.3 ± 0.3</td><td>21.1 ±0.2</td><td>9±1</td><td>368</td><td>0.11</td><td>0.085</td></tr><tr><td>GraphCNN</td><td>MP</td><td>2.5 ± 0.1</td><td>9.8± 0.2</td><td>13±8</td><td>61</td><td>0.38</td><td>0.048</td></tr><tr><td>TreeGAN</td><td>MP</td><td>2.4± 0.2</td><td>12±7</td><td>18±9</td><td>69</td><td>0.34</td><td>0.048</td></tr><tr><td>MP</td><td>FC</td><td>1.2 ± 0.2</td><td>3.7 ± 0.5</td><td>1.6 ± 0.8</td><td>39</td><td>0.44</td><td>0.040</td></tr><tr><td>MP</td><td>PointNet</td><td>1.3± 0.4</td><td>1.2 ± 0.4</td><td>4±2</td><td>18</td><td>0.53</td><td>0.036</td></tr><tr><td rowspan="14">Light quark</td><td>FC</td><td>FC</td><td>6.0±0.2</td><td>16.3 ± 0.9</td><td>3.9 ±0.6</td><td>395</td><td>0.18</td><td>0.053</td></tr><tr><td>GraphCNN</td><td>FC</td><td>3.5± 0.2</td><td>15.1 ± 0.4</td><td>10±50</td><td>100</td><td>0.25</td><td>0.038</td></tr><tr><td>TreeGAN</td><td>FC</td><td>31.5 ± 0.3</td><td>22.3±0.4</td><td>9.3 ± 0.4</td><td>176</td><td>0.06</td><td>0.055</td></tr><tr><td>FC</td><td>PointNet</td><td>3.1 ± 0.2</td><td>4.5± 0.4</td><td>2.3 ± 0.6</td><td>17</td><td>0.37</td><td>0.028</td></tr><tr><td>GraphCNN</td><td>PointNet</td><td>4±1</td><td>5.2±0.5</td><td>50k±100k</td><td>316</td><td>0.37</td><td>0.031</td></tr><tr><td>TreeGAN</td><td>PointNet</td><td>10.1 ± 0.1</td><td>5.7±0.5</td><td>4.1 ± 0.3</td><td>11</td><td>0.47</td><td>0.031</td></tr><tr><td>MP</td><td>MP</td><td>0.6±0.2</td><td>4.9 ± 0.5</td><td>0.7± 0.4</td><td>0.35</td><td>0.50</td><td>0.026</td></tr><tr><td>MP-LFC</td><td>MP</td><td>0.7±0.2</td><td>2.6 ± 0.4</td><td>0.9 ± 0.9</td><td>0.08</td><td>0.52</td><td>0.024</td></tr><tr><td>FC</td><td>MP</td><td>6.3± 0.2</td><td>16.5 ± 0.2</td><td>4.0±0.8</td><td>212</td><td>0.11</td><td>0.070</td></tr><tr><td>GraphCNN</td><td>MP</td><td>3.5± 0.4</td><td>15.0 ± 0.3</td><td>10±10</td><td>99</td><td>0.26</td><td>0.038</td></tr><tr><td>TreeGAN</td><td>MP</td><td>4.8±0.2</td><td>33±6</td><td>10±2</td><td>148</td><td>0.22</td><td>0.041</td></tr><tr><td>MP</td><td>FC</td><td>1.3± 0.1</td><td>4.5± 0.4</td><td>2.2 ±0.6</td><td>41</td><td>0.37</td><td>0.030</td></tr><tr><td>MP</td><td>PointNet</td><td>6.5± 0.3</td><td>23.2±0.6</td><td>6±1</td><td>850</td><td>0.18</td><td>0.034</td></tr><tr><td></td><td>FC</td><td></td><td></td><td></td><td></td><td>0.28</td><td>0.103</td></tr><tr><td rowspan="14">Top quark</td><td>FC GraphCNN</td><td></td><td>4.8±0.3</td><td>14.5 ± 0.6</td><td>23±3</td><td>160</td><td></td><td>0.081</td></tr><tr><td>TreeGAN</td><td>FC</td><td>7.0±0.3</td><td>8.0±0.5</td><td>1k ±6k</td><td>15</td><td>0.48</td><td></td></tr><tr><td></td><td>FC</td><td>17.0 ± 0.2</td><td>19.6± 0.6</td><td>33±2</td><td>77</td><td>0.39</td><td>0.083</td></tr><tr><td>FC GraphCNN</td><td>PointNet PointNet</td><td>2.7± 0.1</td><td>1.6 ± 0.4</td><td>7.7 ±0.5</td><td>3.9</td><td>0.56</td><td>0.075 0.085</td></tr><tr><td>TreeGAN</td><td>PointNet</td><td>11.3 ± 0.9 5.19 ± 0.08</td><td>30±10 9.1 ± 0.3</td><td>37±2</td><td>30k 17</td><td>0.39 0.53</td><td>0.079</td></tr><tr><td>MP</td><td></td><td></td><td></td><td>16±2</td><td></td><td></td><td></td></tr><tr><td>MP-LFC</td><td>MP</td><td>0.6±0.2</td><td>2.3±0.3</td><td>2±1</td><td>0.37</td><td>0.57</td><td>0.071</td></tr><tr><td></td><td>MP</td><td>0.9±0.3</td><td>2.2±0.7</td><td>2±1</td><td>0.93</td><td>0.56</td><td>0.073</td></tr><tr><td>FC</td><td>MP</td><td>6.9 ± 0.1</td><td>39.1± 0.3</td><td>15±1</td><td>81</td><td>0.26</td><td>0.120</td></tr><tr><td>GraphCNN</td><td>MP</td><td>6.7±0.1</td><td>8.2±0.5</td><td>40±10</td><td>15</td><td>0.49</td><td>0.081</td></tr><tr><td>TreeGAN</td><td>MP</td><td>13.4 ± 0.4</td><td>45±7</td><td>50±30</td><td>66</td><td>0.29</td><td>0.101</td></tr><tr><td>MP</td><td>FC</td><td>12.9 ± 0.3</td><td>26.3± 0.4</td><td>46±3</td><td>58</td><td>0.27</td><td>0.103</td></tr><tr><td>MP</td><td>PointNet</td><td>0.76±0.08</td><td>1.6 ± 0.4</td><td>4±1</td><td>3.7</td><td>0.59</td><td>0.072</td></tr></table>
|
| 118 |
+
|
| 119 |
+
We additionally perform a latency measurement and find, using an NVIDIA A100 GPU, that MPGAN generation requires $3 5 . 7 \mu \mathrm { s }$ per jet. In comparison, the traditional generation process for JetNet is measured on an 8-CPU machine as requiring 46ms per jet, meaning MPGAN provides a three-ordersof-magnitude speed-up. Furthermore, as noted in App. B, the generation of JetNet is significantly simpler than full simulation and reconstruction used at the LHC, which has been measured to require 12.3s [44] and 4s [45] respectively per top quark jet. Hence in practical applications we anticipate MPGAN’s improvement to potentially rise to five-orders-of-magnitude.
|
| 120 |
+
|
| 121 |
+
Real baseline comparison. We find that MPGAN’s jet-level $W _ { 1 }$ scores all fall within error of the baselines in Table 1, while those of alternative generators are several standard deviations away. This is particularly an issue with complex top quark particle clouds, where we can see in Fig. 3 none of the existing generators are able to learn the bimodal jet feature distributions, and smaller light quark clouds, where we see distortion of jet features due to difficulty reproducing the zero-padded particle features. No model is able to achieve particle-level scores close to the baseline, and only those of the $\mathrm { F C } +$ PointNet combination and MPGAN are of the same order of magnitude. We conclude that MPGAN reproduces the physical observable distributions to the highest degree of accuracy, but note, however, that it requires further improvement in particle feature reconstruction before it is ready for practical application in HEP.
|
| 122 |
+
|
| 123 |
+
Architecture discussion. To disentangle the effectiveness of the MP generator and discriminator, we train each individually with alternative counterparts (Table 2). With the same PointNet discriminator, the GraphCNN and TreeGAN generators perform worse than the simple FC generator for every metric on all three datasets. The physics-motivated MP generator on the other hand outperforms all on the gluon and top quark datasets, and significantly so on the jet-level $W _ { 1 }$ scores and the FPND. We note, however, that the MP generator is not a significant improvement over the other generators with an FC discriminator. Holding the generator fixed, the PointNet discriminator performs significantly better over the FC for all metrics. With the FC, GraphCNN, and TreeGAN generators, PointNet is also an improvement over the MP discriminator. With an MP generator, the MP discrimimator is more performant on jet-level $W _ { 1 }$ and FPND scores but, on the top quark dataset, degrades $W _ { 1 } ^ { \mathrm { P } }$ relative to PointNet.
|
| 124 |
+
|
| 125 |
+
We learn from these three things: (1) a generator or discriminator architecture is only as effective as its counterpart—even though the MPGAN combination is the best overall, when paired with a network which is not able to learn complex substructure, or which breaks the permutation symmetry, neither the generator or discriminator is performant, (2) for high-fidelity jet feature reconstruction, both networks must be able to learn complex multi-particle correlations—however, this can come at the cost of low-level feature accuracy, and (3) MPGAN’s masking strategy is highly effective as both MP networks are improvements all around on light quark jets.
|
| 126 |
+
|
| 127 |
+
Particle cloud evaluation metrics. We now discuss the merits of each evaluation metrics and provide suggestions for their use in future work. Fig. 4 shows correlation plots between chosen pairs of our evaluation metrics. As expected, we find W1-M and W1-EFP to be highly correlated, as they both measure learning of global jet features. For rigorous validation we suggest measuring both but for time-sensitive use-cases, such as quick evaluations during model training, W1-M should be sufficient. W1-M, FPND, and W1-P are all measuring different aspects of the generation and are relatively uncorrelated. We expect FPND overall to be the best and most discriminatory metric for evaluation, as it compares features found by a SOTA classifier to be statistically optimum for characterizing jets, while the W1 scores are valuable for their interpretability. Out of these, W1-M/W1-EFP are the most important from a physics-standpoint, as we generally characterize collisions by the high-level features of the output jets, rather than the individual particle features.
|
| 128 |
+
|
| 129 |
+
MMD and coverage are both valuable for specifically evaluating the quality and diversity of samples respectively, however we see from Fig. 4 that they saturate after a certain point, after which FPND and $W _ { 1 }$ scores are necessary for stronger discrimination. We also note that in Table 2, models with low $W _ { 1 }$ scores relative to the baseline have the best coverage and MMD scores as well. This indicates that the $W _ { 1 }$ metrics are sensitive to both mode collapse (measured by coverage), which is expected as in terms of feature distributions mode collapse manifests as differing supports, to which the $W _ { 1 }$ distance is sensitive, as well as to individual sample quality (measured by MMD), which supports our claim that recovering jet feature distributions implies accurate learning of individual cloud structure. Together this suggests that low $W _ { 1 }$ scores are able validate sample quality and against mode collapse, and justifies our criteria that a practical ML simulation alternative have $W _ { 1 }$ scores close to the baselines in Table 2. In conclusion, for thorough validation of generated particle clouds, we recommend considering all three W-1 scores in conjunction with FPND, while MMD and coverage, being focused tests of these aspects of generation, may be useful for understanding failure modes during model development.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 4: Correlation plots between pairs of evaluation metrics, evaluated on 400 separate batches of 50,000 MPGAN generated top quark jets.
|
| 133 |
+
|
| 134 |
+
# 6 Summary
|
| 135 |
+
|
| 136 |
+
In this work, we publish JetNet: a novel particle cloud dataset to advance machine learning (ML) research in high energy physics (HEP), and provide a novel point-cloud-style dataset containing rich underlying physics for the ML community to experiment with. We apply existing state-of-the-art point cloud generative models to JetNet, and propose several physics- and computer-vision-inspired metrics to rigorously evaluate generated clouds. We find that existing models are not performant on a number of metrics, and fail to reproduce high-level jet features—arguably the most significant aspect for HEP. Our new message-passing generative adversarial network (MPGAN) model, designed to capture complex global structure and handle variable-sized clouds significantly improves performance in this area, as well as other metrics. We propose MPGAN as a new baseline model on JetNet and invite others to improve upon it.
|
| 137 |
+
|
| 138 |
+
Impact With our JetNet dataset and library, we hope to lower the barrier to entry, improve reproducibility, and encourage development in HEP and ML. Particularly so in the area of simulation, where an accurate and fast ML particle cloud generator will have significant impact in (1) lowering the computational and energy cost of HEP research, as well as (2) increasing precision and sensitivity to new physics at the Large Hadron Collider and future colliders by providing more high-quality simulated data samples. One negative consequence of this, however, may be a loss of interpretability, and hence trustability, of the particle production generative model, which may ultimately increase uncertainties—though the metrics we propose should mitigate against this. More broadly, further advancements in the field of ML point cloud generation may result in fake visual data generation for proliferation of misinformation and impersonation/identity theft.
|
| 139 |
+
|
| 140 |
+
# Acknowledgments and Disclosure of Funding
|
| 141 |
+
|
| 142 |
+
This work was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (Grant Agreement No. 772369). R. K. was partially supported by an IRIS-HEP fellowship through the U.S. National Science Foundation (NSF) under Cooperative Agreement OAC-1836650, and by the LHC Physics Center at Fermi National Accelerator Laboratory, managed and operated by Fermi Research Alliance, LLC under Contract No. DE-AC02- 07CH11359 with the U.S. Department of Energy (DOE). J. D. is supported by the DOE, Office of Science, Office of High Energy Physics Early Career Research program under Award No. DESC0021187 and by the DOE, Office of Advanced Scientific Computing Research under Award No. DE-SC0021396 (FAIR4HEP). B. O and T. T are supported by grant 2018/25225-9, São Paulo Research Foundation (FAPESP). B. O was also partially supported by grants #2018/01398-1 and #2019/16401-0, São Paulo Research Foundation (FAPESP). J-R. V. is partially supported by the ERC under the European Union’s Horizon 2020 research and innovation program (Grant Agreement No. 772369) and by the DOE, Office of Science, Office of High Energy Physics under Award No. DE-SC0011925, DE-SC0019227, and DE-AC02-07CH11359. D. G. is partially supported by the EU ICT-48 2020 project TAILOR (No. 952215). This work was performed using the Pacific Research Platform Nautilus HyperCluster supported by NSF awards CNS-1730158, ACI1540112, ACI-1541349, OAC-1826967, the University of California Office of the President, and the University of California San Diego’s California Institute for Telecommunications and Information Technology/Qualcomm Institute. Thanks to CENIC for the 100 Gpbs networks. Funding for cloud credits was supported by NSF Award #1904444 Internet2 supported E-CAS Exploring Clouds to Accelerate Science.
|
| 143 |
+
|
| 144 |
+
# References
|
| 145 |
+
|
| 146 |
+
[1] A. J. Larkoski, I. Moult, and B. Nachman, “Jet Substructure at the Large Hadron Collider: A Review of Recent Advances in Theory and Machine Learning”, Phys. Rept. 841 (2020) 1, doi:10.1016/j.physrep.2019.11.001, arXiv:1709.04464.
|
| 147 |
+
[2] L. de Oliveira, M. Paganini, and B. Nachman, “Learning particle physics by example: Location-aware generative adversarial networks for physics synthesis”, Comput. Softw. Big Sci. 1 (2017) 4, doi:10.1007/s41781-017-0004-6, arXiv:1701.05927.
|
| 148 |
+
[3] R. Kansal, “JETNET Library”. doi:10.5281/zenodo.5597893, https://github.com/jet-net/JetNet.
|
| 149 |
+
[4] R. K. Ellis, W. J. Stirling, and B. R. Webber, “QCD and collider physics”. Cambridge monographs on particle physics, nuclear physics, and cosmology. Cambridge University Press, Cambridge, 2003. Photography by S. Vascotto. doi:10.1017/CBO9780511628788.
|
| 150 |
+
[5] T. Sjöstrand et al., “An introduction to PYTHIA 8.2”, Comput. Phys. Commun. 191 (2015) 159, doi:10.1016/j.cpc.2015.01.024, arXiv:1410.3012.
|
| 151 |
+
[6] J. Bellm et al., “HERWIG 7.0/HERWIG $+ + 3 . 0$ release note”, Eur. Phys. J. C 76 (2016), no. 4, 196, doi:10.1140/epjc/s10052-016-4018-8, arXiv:1512.01178.
|
| 152 |
+
[7] B. Andersson, G. Gustafson, G. Ingelman, and T. Sjostrand, “Parton Fragmentation and String Dynamics”, Phys. Rept. 97 (1983) 31, doi:10.1016/0370-1573(83)90080-7.
|
| 153 |
+
[8] J. Cogan, M. Kagan, E. Strauss, and A. Schwarztman, “Jet-Images: Computer Vision Inspired Techniques for Jet Tagging”, JHEP 02 (2015) 118, doi:10.1007/JHEP02(2015)118, arXiv:1407.5675.
|
| 154 |
+
[9] L. de Oliveira et al., “Jet-images — deep learning edition”, JHEP 07 (2016) 069, doi:10.1007/JHEP07(2016)069, arXiv:1511.05190.
|
| 155 |
+
[10] H. Qu and L. Gouskos, “ParticleNet: Jet Tagging via Particle Clouds”, Phys. Rev. D 101 (2020), no. 5, 056019, doi:10.1103/PhysRevD.101.056019, arXiv:1902.08570.
|
| 156 |
+
[11] J. Shlomi, P. Battaglia, and J.-R. Vlimant, “Graph neural networks in particle physics”, Mach. Learn.: Sci. Technol. 2 (2021) 021001, doi:10.1088/2632-2153/abbf9a, arXiv:2007.13681.
|
| 157 |
+
[12] J. Duarte and J.-R. Vlimant, “Graph neural networks for particle tracking and reconstruction”, in Artificial Intelligence for High Energy Physics, P. Calafiura, D. Rousseau, and K. Terao, eds. World Scientific Publishing, 12, 2020. arXiv:2012.01249. Submitted to Int. J. Mod. Phys. A. doi:10.1142/12200.
|
| 158 |
+
[13] CMS Collaboration, “Identification of heavy, energetic, hadronically decaying particles using machine-learning techniques”, JINST 15 (2020) P06005, doi:10.1088/1748-0221/15/06/P06005, arXiv:2004.08262.
|
| 159 |
+
[14] A. X. Chang et al., “ShapeNet: An information-rich 3D model repository”, Technical Report, 2015. arXiv:1512.03012.
|
| 160 |
+
[15] R. Kansal et al., “JetNet”, 05, 2021. doi:10.5281/zenodo.4834876.
|
| 161 |
+
[16] M. Pierini, J. M. Duarte, N. Tran, and M. Freytsis, “hls4ml LHC jet dataset (30 particles)”, 01, 2020. doi:10.5281/zenodo.3601436.
|
| 162 |
+
[17] M. Paganini, L. de Oliveira, and B. Nachman, “CaloGAN $:$ Simulating 3D high energy particle showers in multilayer electromagnetic calorimeters with generative adversarial networks”, Phys. Rev. D 97 (2018), no. 1, 014021, doi:10.1103/PhysRevD.97.014021, arXiv:1712.10321.
|
| 163 |
+
[18] ATLAS Collaboration, “Fast simulation of the ATLAS calorimeter system with generative adversarial networks”, ATLAS Software Public Note ATL-SOFT-PUB-2020-006, 2020.
|
| 164 |
+
[19] M. Erdmann, J. Glombitza, and T. Quast, “Precise simulation of electromagnetic calorimeter showers using a Wasserstein generative adversarial network”, Comput. Softw. Big Sci. 3 (2019) 4, doi:10.1007/s41781-018-0019-7, arXiv:1807.01954.
|
| 165 |
+
[20] F. Carminati et al., “Generative adversarial networks for fast simulation”, J. Phys. Conf. Ser. 1525 (2020) 012064, doi:10.1088/1742-6596/1525/1/012064.
|
| 166 |
+
[21] Y. Lu, J. Collado, D. Whiteson, and P. Baldi, “Sparse autoregressive models for scalable generation of sparse images in particle physics”, Phys. Rev. D 103 (2021), no. 3, 036012, doi:10.1103/PhysRevD.103.036012, arXiv:2009.14017.
|
| 167 |
+
[22] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift”, in Proceedings of the 32nd International Conference on Machine Learning, F. Bach and D. Blei, eds., volume 37, p. 448. PMLR, 2015. arXiv:1502.03167.
|
| 168 |
+
[23] C.-L. Liet al., “Point cloud GAN”, in 2019 ICLR Workshop Deep Generative Models for Highly Structured Data. 2018. arXiv:1810.05795.
|
| 169 |
+
[24] G. Yang et al., “PointFlow: 3D point cloud generation with continuous normalizing flows”, in 2019 IEEE/CVF International Conference on Computer Vision (ICCV), p. 4540. 2019. arXiv:1906.12320. doi:10.1109/ICCV.2019.00464.
|
| 170 |
+
[25] R. Klokov, E. Boyer, and J. Verbeek, “Discrete point flow networks for efficient point cloud generation”, in 2020 European Conference on Computer Vision (ECCV), A. Vedaldi, H. Bischof, T. Brox, and J.-M. Frahm, eds., p. 694. Springer International Publishing, Cham, 2020. arXiv:2007.10170.
|
| 171 |
+
[26] R. Cai et al., “Learning gradient fields for shape generation”, in 2020 European Conference on Computer Vision (ECCV), A. Vedaldi, H. Bischof, T. Brox, and J.-M. Frahm, eds., p. 364. Cham, 2020. arXiv:2008.06520.
|
| 172 |
+
[27] J. Köhler, L. Klein, and F. Noe, “Equivariant flows: Exact likelihood generative learning for symmetric densities”, in Proceedings of the 37th International Conference on Machine Learning, H. D. III and A. Singh, eds., volume 119 of Proceedings of Machine Learning Research, p. 5361. PMLR, 2020. arXiv:2006.02425.
|
| 173 |
+
[28] G. N. C. Simm, R. Pinsler, G. Csányi, and J. M. Hernández-Lobato, “Symmetry-aware actor-critic for 3d molecular design”, in International Conference on Learning Representations. 2021.
|
| 174 |
+
[29] N. Gebauer, M. Gastegger, and K. Schütt, “Symmetry-adapted generation of 3D point sets for the targeted discovery of molecules”, in Advances in Neural Information Processing Systems 32, H. Wallach et al., eds., p. 7566. Curran Associates, Inc., 2019. arXiv:1906.00957.
|
| 175 |
+
[30] P. Achlioptas, O. Diamanti, I. Mitliagkas, and L. Guibas, “Learning representations and generative models for 3D point clouds”, in Proceedings of the 35th International Conference on Machine Learning, J. Dy and A. Krause, eds., volume 80, p. 40. PMLR, 2018.
|
| 176 |
+
[31] D. Valsesia, G. Fracastoro, and E. Magli, “Learning localized generative models for 3D point clouds via graph convolution”, in International Conference on Learning Representations (ICLR) 2019. 2019.
|
| 177 |
+
[32] D. W. Shu, S. W. Park, and J. Kwon, “3D point cloud generative adversarial network based on tree structured graph convolutions”, in 2019 IEEE/CVF International Conference on Computer Vision (ICCV), p. 3858. 2019. arXiv:1905.06292. doi:10.1109/ICCV.2019.00396.
|
| 178 |
+
[33] C. R. Qi, H. Su, K. Mo, and L. 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 (CVPR). July, 2017.
|
| 179 |
+
[34] H. Wang et al., “Rethinking sampling in 3D point cloud generative adversarial networks”, 2020. arXiv:2006.07029.
|
| 180 |
+
[35] J. Gilmeret al., “Neural message passing for quantum chemistry”, in Proceedings of the 34th International Conference on Machine Learning, D. Precup and Y. W. Teh, eds., volume 70, p. 1263. PMLR, 2017. arXiv:1704.01212.
|
| 181 |
+
[36] CMS Collaboration, “Recent Developments in CMS Fast Simulation”, PoS ICHEP2016 (2016) 181, doi:10.22323/1.282.0181, arXiv:1701.03850.
|
| 182 |
+
[37] P. T. Komiske, E. M. Metodiev, and J. Thaler, “Energy flow polynomials: A complete linear basis for jet substructure”, JHEP 04 (2018) 013, doi:10.1007/JHEP04(2018)013, arXiv:1712.07124.
|
| 183 |
+
[38] A. Borji, “Pros and cons of GAN evaluation measures: New developments”, 2021. arXiv:2103.09396.
|
| 184 |
+
[39] M. Heuselet al., “GANs trained by a two time-scale update rule converge to a local nash equilibrium”, in Advances in Neural Information Processing Systems, I. Guyon et al., eds., volume 30, p. 6626. Curran Associates, Inc., 2017. arXiv:1706.08500.
|
| 185 |
+
[40] P. T. Komiske, E. M. Metodiev, and J. Thaler, “Metric Space of Collider Events”, Phys. Rev. Lett. 123 (2019), no. 4, 041801, doi:10.1103/PhysRevLett.123.041801, arXiv:1902.02346.
|
| 186 |
+
[41] Y. Wang et al., “Dynamic graph CNN for learning on point clouds”, ACM Trans. Graph. 38 (2019) doi:10.1145/3326362, arXiv:1801.07829.
|
| 187 |
+
[42] F. Monti et al., “Geometric deep learning on graphs and manifolds using mixture model CNNs”, in 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), p. 5425. 2017. arXiv:1611.08402. doi:10.1109/CVPR.2017.576.
|
| 188 |
+
[43] R. Kansal, “MPGAN Code”. doi:10.5281/zenodo.5598407, https://github.com/rkansal47/MPGAN/tree/neurips21.
|
| 189 |
+
[44] Pedro, Kevin, “Current and future performance of the cms simulation”, EPJ Web Conf. 214 (2019) 02036, doi:10.1051/epjconf/201921402036.
|
| 190 |
+
[45] C. Chen et al., “Data augmentation at the LHC through analysis-specific fast simulation with deep learning”, 2020. arXiv:2010.01835.
|
| 191 |
+
[46] K. Cranmer, J. Brehmer, and G. Louppe, “The frontier of simulation-based inference”, PNAS 117 (2020) 30055, doi:10.1073/pnas.1912789117, arXiv:1911.01429.
|
| 192 |
+
[47] G. Cowan, “Statistics”, Ch. 40 in Particle Data Group, P. A. Zyla et al., “Review of Particle Physics”, PTEP 2020 (2020) 083C01, doi:10.1093/ptep/ptaa104.
|
| 193 |
+
[48] CMS Collaboration, “Precise determination of the mass of the Higgs boson and tests of compatibility of its couplings with the standard model predictions using proton collisions at 7 and 8 TeV”, Eur. Phys. J. C 75 (2015) 212, doi:10.1140/epjc/s10052-015-3351-7, arXiv:1412.8662.
|
| 194 |
+
[49] R. J. Barlow and C. Beeston, “Fitting using finite Monte Carlo samples”, Comput. Phys. Commun. 77 (1993) 219, doi:10.1016/0010-4655(93)90005-W.
|
| 195 |
+
[50] J. Brehmer and K. Cranmer, “Simulation-based inference methods for particle physics”, in Artificial Intelligence for High Energy Physics, P. Calafiura, D. Rousseau, and K. Terao, eds. World Scientific Publishing, 10, 2020. arXiv:2010.06439. Submitted to Int. J. Mod. Phys. A. doi:10.1142/12200.
|
| 196 |
+
[51] J. Alwall et al., “The automated computation of tree-level and next-to-leading order differential cross sections, and their matching to parton shower simulations”, JHEP 07 (2014) 079, doi:10.1007/JHEP07(2014)079, arXiv:1405.0301.
|
| 197 |
+
[52] R. D. Ball et al., “Parton distributions with LHC data”, Nucl. Phys. B 867 (2013) 244–289, doi:10.1016/j.nuclphysb.2012.10.003, arXiv:1207.1303.
|
| 198 |
+
[53] P. Skands, S. Carrazza, and J. Rojo, “Tuning PYTHIA 8.1: The Monash 2013 Tune”, Eur. Phys. J. C 74 (2014), no. 8, 3024, doi:10.1140/epjc/s10052-014-3024-y, arXiv:1404.5630.
|
| 199 |
+
[54] M. Cacciari, G. P. Salam, and G. Soyez, “The anti- $\cdot k _ { \mathrm { T } }$ jet clustering algorithm”, JHEP 04 (2008) 063, doi:10.1088/1126-6708/2008/04/063, arXiv:0802.1189.
|
| 200 |
+
[55] M. Cacciari, G. P. Salam, and G. Soyez, “FastJet user manual”, Eur. Phys. J. C 72 (2012) 1896, doi:10.1140/epjc/s10052-012-1896-2, arXiv:1111.6097.
|
| 201 |
+
[56] M. Cacciari and G. P. Salam, “Dispelling the $n ^ { 3 }$ myth for the $k _ { \mathrm { T } }$ jet-finder”, Phys. Lett. B 641 (2006) 57, doi:10.1016/j.physletb.2006.08.037, arXiv:hep-ph/0512210.
|
| 202 |
+
[57] X. Mao et al., “Multi-class generative adversarial networks with the L2 loss function”, 2016. arXiv:1611.04076.
|
| 203 |
+
[58] N. Srivastavaet al., “Dropout: A simple way to prevent neural networks from overfitting”, J. Mach. Learn. Res. 15 (2014) 1929.
|
| 204 |
+
[59] I. Gulrajaniet al., “Improved training of Wasserstein GANs”, in Advances in Neural Information Processing Systems, I. Guyon et al., eds., volume 30, p. 5767. Curran Associates, Inc., 2017. arXiv:1704.00028.
|
| 205 |
+
[60] T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida, “Spectral normalization for generative adversarial networks”, in 6th International Conference on Learning Representations. 2018. arXiv:1802.05957.
|
| 206 |
+
[61] F. Schäfer, H. Zheng, and A. Anandkumar, “Implicit competitive regularization in GANs”, 2019. arXiv:1910.05852.
|
| 207 |
+
[62] T. Karraset al., “Training generative adversarial networks with limited data”, in Advances in Neural Information Processing Systems, H. Larochelle et al., eds., volume 33, p. 12104. Curran Associates, Inc., 2020. arXiv:2006.06676.
|
| 208 |
+
[63] N.-T. Tran et al., “On data augmentation for GAN training”, IEEE Trans. Image Process. 30 (2021) 1882, doi:10.1109/tip.2021.3049346, arXiv:2006.05338.
|
| 209 |
+
[64] Z. Zhao et al., “Image augmentations for GAN training”, 2020. arXiv:2006.02595.
|
| 210 |
+
[65] M. Arjovsky, S. Chintala, and L. Bottou, “Wasserstein GAN”, 2017. arXiv:1701.07875.
|
md/train/lmTWnm3coJJ/lmTWnm3coJJ.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ROBUST CURRICULUM LEARNING: FROM CLEAN LABEL DETECTION TO NOISY LABEL SELF-CORRECTION
|
| 2 |
+
|
| 3 |
+
Tianyi $\mathbf { Z } \mathbf { h } \mathbf { o } \mathbf { u } ^ { * }$ , Shengjie Wang∗, Jeff A. Bilmes University of Washington, Seattle {tianyizh,wangsj,bilmes}@uw.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Neural network training can easily overfit noisy labels resulting in poor generalization performance. Existing methods address this problem by (1) filtering out the noisy data and only using the clean data for training or (2) relabeling the noisy data by the model during training or by another model trained only on a clean dataset. However, the former does not leverage the features’ information of wrongly-labeled data, while the latter may produce wrong pseudo-labels for some data and introduce extra noises. In this paper, we propose a smooth transition and interplay between these two strategies as a curriculum that selects training samples dynamically. In particular, we start with learning from clean data and then gradually move to learn noisy-labeled data with pseudo labels produced by a time-ensemble of the model and data augmentations. Instead of using the instantaneous loss computed at the current step, our data selection is based on the dynamics of both the loss and output consistency for each sample across historical steps and different data augmentations, resulting in more precise detection of both clean labels and correct pseudo labels. On multiple benchmarks of noisy labels, we show that our curriculum learning strategy can significantly improve the test accuracy without any auxiliary model or extra clean data.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The expressive power and high capacity of deep neural networks (DNNs) result in accurate modeling and promising generalization if provided with sufficient data and clean(correct) labels. However, recent studies show that the training process is fragile and can easily overfit on noisy labels (Zhang et al., 2017), which commonly appear in real-world data since precise annotation is not always available or affordable. Hence, it is important to study the training dynamics affected by imperfect labels and develop robust learning strategies that ideally eliminate the negative impact of noisy labels while fully exploiting the information from all the available data.
|
| 12 |
+
|
| 13 |
+
Numerous approaches have been developed to address this challenge from various perspectives, e.g., loss correction (Xiao et al., 2015; Vahdat, 2017; Lee et al., 2018; Veit et al., 2017; Li et al., 2017b), robust loss functions (Ghosh et al., 2017; Zhang & Sabuncu, 2018; Wang et al., 2019; Ma et al., 2020) with provable noise tolerance, sample re-weighting (Patrini et al., 2017), curriculum learning (Kumar et al., 2010; Jiang et al., 2018; Guo et al., 2018), model co-teaching (Han et al., 2018), etc. A principal methodology behind a variety of methods is to detect clean labels while discard/downweigh the data with wrong labels, so the model mainly learns from correct labels. A broadly applied criterion is to select the samples with small losses and treat them as clean data. It is inspired by empirical observations that DNNs learn simple patterns first before overfitting on the noisy labels (Zhang et al., 2017; Arpit et al., 2017). Several curriculum learning methods utilize this criterion (Kumar et al., 2010; Jiang et al., 2014), and in each step, select/upweigh samples with small losses. Robust loss functions also suppress the large losses associated with the possibly wrong labels. More recent approaches use mixture models (Arazo et al., 2019) to estimate the distribution of losses for clean and noisy data.
|
| 14 |
+
|
| 15 |
+
However, the instantaneous loss (i.e., the loss evaluated at the current step) of an individual sample is an unstable signal that can rapidly fluctuate due to DNN training’s randomness. The error generated by such an unstable metric accumulates when the selected samples are used to train the model producing the losses. Co-teaching methods alleviate this problem by training two DNNs and using the loss computed on one model to guild the other. Also, as the model changes during training, each sample’s loss needs to be re-evaluated even when it is not selected, which requires extra inference cost. MentorNet (Jiang et al., 2018) and Data Parameters (Saxena et al., 2019) train an extra model to produce the sample weights or selection results without computing the loss. Furthermore, it may not be efficient to repeatedly train the model only on clean data that consistently have small losses, since the model have already learned, well memorized or overfitted to them.
|
| 16 |
+
|
| 17 |
+
A primary drawback of training only on clean labels detected is that discarding the whole data pairs $( x , y )$ with wrong labels $y$ removes potentially useful information about the data distribution $p ( x )$ (Arazo et al., 2019). Hence, there has been growing interest in leveraging noisy data. Loss correction methods aim to correct the predicted class probabilities based on an estimated mislabeling probability between classes. Some other methods seek to relabel them by using the model itself (e.g., bootstrapping loss (Reed et al., 2014)) or another model/mechanism (e.g., directed graphical models, conditional random fields, or CNNs) trained on an additional set of clean data, which, however, is not always available. Self-training and unsupervised learning techniques (Rasmus et al., 2015; Berthelot et al., 2019) have also been employed to generate pseudo labels to replace noisy labels (Arazo et al., 2019). The pseudo labels are optimized together with the model or generated by the model with data augmentations to encourage the output consistency on the same sample’s augmentations. Unfortunately, the pseudo labels’ quality may vary across different samples and significantly degenerate when the noise ratio is high, or the model fails to produce stable and correct predictions. In such a case, the relabeling error on some samples can be accumulated during training.
|
| 18 |
+
|
| 19 |
+
In this paper, we address the aforementioned problems of noise-label learning by developing a curriculum learning strategy called Robust Curriculum Learning (RoCL) that smoothly transitions between two phases: (1) detection and supervised training on clean data; and (2) relabeling and self-supervision on noisy data. Specifically, we train the model for multiple episodes, each starting from phase(1) and gradually moving to phase(2). Unlike existing approaches, we only select samples with accurate given/pseudo labels that are most informative to the current model training. Our data selection criterion takes both the dynamics of per-sample loss and output consistency (across multiple data augmentations) into account. Using an exponential moving average of the loss and consistency over training history, it overcomes the instability of instantaneous losses and does not incur any additional inference cost. In addition, by adjusting a temperature parameter, the criterion can interpolate between the two phases and keep the training focusing on the data that the model mostly needs to improve on, e.g., clean data with unsatisfying output consistency or wrongly-labeled data with accurate pseudo labels. Thus, we can fully exploit both clean and noisy data more efficiently with less risk of introducing extra noise or error accumulation. We further show that our data selection can be derived from a novel optimization formulation for robust curriculum learning. We evaluate our method on multiple noisy learning benchmarks and show that our method outperforms a diverse set of recent noisy-label learning approaches.
|
| 20 |
+
|
| 21 |
+
# 1.1 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Early curriculum learning (CL) (Khan et al., 2011; Basu & Christensen, 2013; Spitkovsky et al., 2009; Zhou et al., 2021) seeks an optimized sequence of training samples (i.e., a curriculum, which can be designed by human experts) to improve model performance. Self-paced learning (SPL)(Kumar et al., 2010; Tang et al., 2012a; Supancic III & Ramanan, 2013; Tang et al., 2012b) selects easy samples with smaller losses. It starts with selecting a few samples of small loss and gradually increases the selection size to cover all the training data. Self-paced curriculum learning (Jiang et al., 2015) combines the human expert in CL and loss-adaptation in SPL. SPL with diversity (SPLD) (Jiang et al., 2014) applies a negative group sparse regularization to SPL to promote the diversity of selected samples. Minimax curriculum learning Zhou & Bilmes (2018) promotes the diversity of samples during early learning to encourage exploration and focus on hard samples in later stages.
|
| 24 |
+
|
| 25 |
+
In the context of robust learning with noisy labels, label correction methods aim to identify the wrong labels and possibly correct them to get more consistent labels for training. Previous work often apply an extra noise model (directed graphical model (Xiao et al., 2015), conditional random fields (Vahdat, 2017), neural network (Lee et al., 2018; Veit et al., 2017), knowledge graph (Li et al., 2017b)) to correct the noisy labels, which often require extra clean data and as well as training/inference of the noise model. Another line of research focuses on loss correction, which modifies the loss or prediction probabilities during training to correct the misinformation from the noisy labels. Patrini et al. (2017) uses two noise transition (backward and forward) matrices to correct the prediction probabilities. Label Smoothing Regularization (Szegedy et al., 2016; Pereyra et al., 2017) alleviates the overfitting to noisy labels by using soft labels instead of one-hot labels. Reed et al. (2014) augments the loss with a notion of perceptual consistency. Jiang et al. (2018) trains a mentor network to reweigh samples duri‘ng the training of a student network. Guo et al. (2018) designs a curriculum by ranking the complexity of data using its distribution density in a feature space. Ren et al. (2018) proposes a meta-learning algorithm that learns to assign weights to samples based on their gradients in training compared to those of validation data, which requires extra clean data. Co-teaching (Han et al., 2018) feeds in the network with the most confident samples of another network to reduce confirmation bias. Amid et al. (2019) generalizes the logistic loss and the exponents in the softmax by applying a temperature to each of them and makes the training more robust to noise. Hu et al. (2019) trains a network on noisy labels in the weakly supervised setting and uses it as a regularization term to improve the training on clean data.
|
| 26 |
+
|
| 27 |
+
Some approaches focus on designing loss functions that have robust behaviors and provable tolerance to label noise. Ghosh et al. (2017) theoretically proves that the Mean Absolute Error(MAE) is a robust loss. The Generalized Cross Entropy (Zhang & Sabuncu, 2018) uses a negative Box-Cox transformation to obtain a loss function that generalizes MAE and Cross Entropy loss. Wang et al. (2019) proposes a Symmetric Cross Entropy that combines Cross Entropy loss and Reverse Cross Entropy loss. Ma et al. (2020) proposes a loss normalization method and shows that any loss can be made robust to noisy labels.
|
| 28 |
+
|
| 29 |
+
RoCL shares similar ideas with some CL methods in that RoCL starts with learning easy and clean samples and gradually moves to hard and noisy ones. RoCL is more related to the loss correction approach in noisy-label learning literature as RoCL generates a curriculum dynamically assigning weight (probability) to each sample. RoCL differs from existing methods in: (1) it only selects a subset of informative and reliable labels for training in each epoch; (2) it is a smooth transition not only from clean data to noisy data but also from supervised learning to self-supervision; (3) it runs multiple episodes of the curriculum to avoid getting in a local minimum dominated by a small set of clean/noisy data or a specific type of loss; (4) it does not assume the availability of an extra set of clean data; (5) it does not require extra computation or any modification to the model.
|
| 30 |
+
|
| 31 |
+
# 2 DYNAMIC PATTERNS OF CLEAN/NOISY LABELS IN TRAINING 2.1 LOSS DYNAMICS AND CLEAN LABEL DETECTION
|
| 32 |
+
|
| 33 |
+
A key challenge for most noise-label learning methods is to design a reliable criterion to select/reweigh clean data and distinguish them from the noisy data, so all the clean data can be fully exploited while most noisy labels are filtered out of the training process. Loss computed at an instantaneous step have been widely used for this purpose according to the observation that the loss on clean data is usually smaller than noisy data. One important reason is that the clean labels are mutually consistent with each other in producing gradient updates, and therefore, the model can fit them better and faster. On the other hand, the noisy labels may contain mutually inconsistent information, creating a form of long-lasting “tug of war” amongst themselves. For example, it can be hard for the model to find consistent visual patterns from images with noisy labels to make the desired predictions. However, instantaneous loss suffers from high variance across training epochs (as shown in the first plot of Figure 1) and is inaccurate for clean data detection under high noise ratio (i.e., the proportion of wrong labels is high) and the randomness of DNN training,
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Dynamic patterns (mean±std) of instantaneous metrics (top) and exponential moving average (EMA) metrics (bottom) when applying Alg. 2 that alternates between supervised learning on given labels and self-supervision on pseudo labels. Larger gap between curves in each plot is better. Symmetric noise is defined in the beginning of Section 4. We use cross entropy for supervised loss $\ell ( \cdot , \cdot )$ in Eq. (1) and 0-1 loss for $\ell ( \cdot , \cdot )$ in consistency loss Eq. (2) with $m = 7$ .
|
| 37 |
+
|
| 38 |
+
e.g., random initialization, random data augmentation, etc. Moreover, it needs to evaluate the instantaneous loss for all samples in each step, resulting in extra inference cost on unselected samples.
|
| 39 |
+
|
| 40 |
+
The dynamic patterns of losses (Zhou et al., 2020b) over the course of training give us a new insight for better clean data detection even when the noise ratio (proportion of wrong labels) is high. In particular, we hypothesize that a sample’s label is more likely to be correct if its losses persistently retain low values over training steps. Given a sample $( x _ { i } , y _ { i } )$ with $x _ { i }$ being the features and $y _ { i }$ being the label, we describe its loss dynamics using a simple exponential moving average (EMA) of the instantaneous loss $\ell ( f ( x _ { i } ; \theta _ { t } ) , \overset { \cdot } { y } _ { i } )$ (where $f ( x _ { i } ; \theta _ { t } )$ denotes the model output and $\theta _ { t }$ is the model parameters at step $t ^ { * }$ along the training history, which is defined and computed recursively as
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
l _ { t + 1 } ( i ) = \left\{ \begin{array} { l l } { \gamma \times \ell ( f ( x _ { i } ; \theta _ { t } ) , y _ { i } ) + ( 1 - \gamma ) \times l _ { t } ( i ) } & { \mathrm { ~ i f ~ } i \in S _ { t } } \\ { l _ { t } ( i ) } & { \mathrm { ~ e l s e ~ , ~ } } \end{array} \right.
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Where $\gamma \in [ 0 , 1 ]$ is a discounting factor, $V$ is the set of all $n$ training samples, and $S _ { t } \subseteq V$ is the set of samples selected (by a certain curriculum) for training at epoch $t$ . We only update the EMA loss for selected samples using the byproduct $l _ { t } ( i )$ of training without requiring extra inference.
|
| 47 |
+
|
| 48 |
+
In the first and the third plots of Figure 1, we show how the losses and EMA losses associated with clean/noisy data change throughout the training process. Specifically, we train a ResNet34 (He et al., 2016) model on CIFAR10 with $6 0 \%$ of the original labels randomly changed to a wrong class. To avoid quick overfitting to the noise, we train the model for multiple episodes (each composed of several epochs over all data with a cosine annealing learning rate) and alternate between the supervised learning episode that minimizes the cross-entropy loss against the given noisy labels and the self-supervision episode that minimizes the consistency loss Eq.(2) against the pseudo labels. Comparing the shaded areas (std) of instantaneous loss and EMA loss and the gap between curves in the two plots, we see that EMA leads to smaller variance within each group and larger gap between the clean and noisy groups, demonstrating the effectiveness of EMA loss for clean data detection.
|
| 49 |
+
|
| 50 |
+
# 2.2 CONSISTENCY DYNAMICS AND PSEUDO LABEL SELECTION
|
| 51 |
+
|
| 52 |
+
Simply removing noisy data $( x , y )$ with wrong label $y$ discards important information about the data distribution $p ( x )$ (Arazo et al., 2019). Including all the noisy data for self-supervision, bootstrapping or relabeling can also harm the training since the pseudo labels’ quality is not equal across samples and much depends on the model generating them, where the model’s predictions may contain errors that can accumulate if adopted for training. Hence, a careful selection of noisy data is necessary. However, without access to a purely clean dataset or a reliable pre-trained model, it is nontrivial to evaluate pseudo labels’ correctness. By analyzing the training dynamics of model outputs in the above experiment, we discover that the model output for a sample tends to be an accurate pseudo label if the output remains consistent over training steps and across different augmentations of the sample.
|
| 53 |
+
|
| 54 |
+
We first define the instantaneous consistency loss of a sample $x _ { i }$ at step $t$ as the discrepancy of the model output $f ( x _ { i } ; \theta )$ between step $t$ and $t - 1$ on $x _ { i }$ and its $m$ data augmentations $\{ x _ { i } ^ { ( j ) } \} _ { j = 1 } ^ { m }$ where the discrepancy can be measured by any loss function $\ell ( \cdot , \cdot )$ . However, the discrepancy can be small if the models of epoch $t$ and $t - 1$ are too similar and make the same errors. Therefore, we use an exponential moving average of the model parameters (according to mean teacher (Tarvainen & Valpola, 2017)) and compute the prediction at step $t - 1$ by averaging over multiple data augmentations (according to MixMatch (Berthelot et al., 2019)): $\begin{array} { r } { \overline { { f } } _ { t } ( x _ { i } ) \triangleq \mathbb { 1 } / m \sum _ { j = 1 } ^ { m } f ( x _ { i } ^ { ( j ) } ; \overline { { \theta } } _ { t } ) , \overline { { \theta } } _ { t } \triangleq \gamma \theta _ { t - 1 } + } \end{array}$ $( 1 - \gamma ) \overline { { \theta } } _ { t - 1 }$ . Computing pseudo labels on augmented data and a time averaging ensemble of models is commonly-adopted for semi-supervised learning (Sajjadi et al., 2016; Laine $\&$ Aila, 2016; Zhou et al., 2020a). The instantaneous consistency loss† $\zeta _ { t } ( i )$ of sample $x _ { i }$ at step $t$ is then defined as
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\zeta _ { t } ( i ) \triangleq \frac { 1 } { m } \sum _ { j = 1 } ^ { m } \ell ( f ( x _ { i } ; \theta _ { t } ) , \overline { { f } } _ { t } ( x _ { i } ^ { ( j ) } ) ) ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
Which can also be minimized as a consistency loss for $x _ { i }$ in self-supervised learning when no label is given. Similar to the EMA loss in Eq. (1), we define the EMA consistency loss over training history
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
c _ { t + 1 } ( i ) = \left\{ \begin{array} { l l } { \gamma \times \zeta _ { t } ( i ) + ( 1 - \gamma ) \times c _ { t } ( i ) } & { \mathrm { ~ i f ~ } i \in S _ { t } } \\ { c _ { t } ( i ) } & { \mathrm { ~ e l s e . ~ } } \end{array} \right.
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Note we use the same $\gamma$ value as in Eq. (1). The EMA consistency loss $c _ { t } ( i )$ measures both the time-consistency (Zhou et al., 2020a) over multiple training steps and the spatial consistency over different augmentations of sample $x _ { i }$ . If the output prediction is wrong and contradicts other samples’ labels, it will be inconsistent over time and across augmentations since it can easily change or flip after the next training step. In the last plot of Figure 1, we report the mean and standard deviation (the middle line and the shaded area) of the EMA consistency loss for two groups of data at each epoch, i.e., the ones with correct pseudo labels and the ones with incorrect pseudo labels. Comparing to the instantaneous consistency loss in the second plot, EMA consistency loss is a more reliable criterion for allocating correct pseudo labels. Thus, we can safely learn the noisy data by using their pseudo labels as training targets and avoid introducing harmful noises.
|
| 67 |
+
|
| 68 |
+
# 3 ROBUST CURRICULUM LEARNING
|
| 69 |
+
|
| 70 |
+
In this section, we first introduce the selection criterion for both the clean label detection and pseudo label selection. By adjusting two temperature parameters $\tau _ { 1 }$ and $\tau _ { 2 }$ , it can smoothly interpolate between the two criteria and control their trade-off. We then show that the criterion is derived from a novel optimization formulation for robust curriculum learning. We finally present the RoCL algorithm.
|
| 71 |
+
|
| 72 |
+
# 3.1 DATA SELECTION CRITERION
|
| 73 |
+
|
| 74 |
+
To combine of clean label detection and pseudo label selection, we use the two criteria from the previous sections and apply a temperature parameter to control the preference for small/large loss or consistency loss and their trade-off. We sample $x _ { i }$ at training step $t$ with probability:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \mathcal { P } _ { t } ( i ) = \lambda \times p _ { t } ( i ) + ( 1 - \lambda ) \times q _ { t } ( i ) , } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $p _ { t } ( i )$ and $q _ { t } ( i )$ are defined as softmax probabilities, i.e.,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
p _ { t } ( i ) \triangleq \frac { \exp [ \tau _ { 1 } l _ { t } ( i ) ] } { \sum _ { j = 1 } ^ { n } \exp [ \tau _ { 1 } l _ { t } ( j ) ] } , q _ { t } ( i ) \triangleq \frac { \exp [ \tau _ { 2 } c _ { t } ( i ) ] } { \sum _ { j = 1 } ^ { n } \exp [ \tau _ { 2 } c _ { t } ( j ) ] } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
and $\lambda \in [ 0 , 1 ]$ controls trade-off between them. Here, $p _ { t } ( i )$ is a softmax probability computed from EMA losses for clean data detection: samples with smaller (larger) EMA losses and thus clean (noisy) labels tend to have high probability $\bar { p } _ { t } ( i )$ when $\tau _ { 1 }$ is negative (positive). Similarly, $q _ { t } ( i )$ is computed from EMA consistency loss for pseudo label selection: samples with smaller (larger) EMA consistency loss and thus correct (wrong) pseudo labels tend to have high probability $q _ { t } ( i )$ when $\tau _ { 2 }$ is negative (positive). When $\tau _ { 1 } , \tau _ { 2 } = 0$ , the probabilities are uniform, and when $\tau _ { 1 } , \tau _ { 2 } + \infty /$ $- \infty$ , the probabilities approximate the max (min) operator.
|
| 87 |
+
|
| 88 |
+
Either $p _ { t } ( i )$ or $q _ { t } ( i )$ can be independently employed to select or reweigh samples for noise-label learning. However, selecting samples with high probabilities $p _ { t } ( i )$ when $\tau _ { 1 } \ll 0$ tends to make the training focus on clean data that the model has already learned, which carries limited new information and prevents exploration. Similarly, selecting samples with high probabilities $q _ { t } ( i )$ when $\tau _ { 2 } \ll 0$ is not informative since the model outputs are consistently correct for those data, and little progress can be made.We can encourage exploration by manipulating the temperature parameters. By setting $\tau _ { 1 }$ and $\tau _ { 2 }$ close to zero, we move towards uniform exploration of all data. A more effective strategy is to couple the values of $\tau _ { 1 }$ and $\tau _ { 2 }$ . For example, a negative $\tau _ { 1 }$ and a positive $\tau _ { 2 }$ strengthen the preference for clean data that have not been fully exploited and learned by the model. Alternatively, a positive $\tau _ { 1 }$ with a negative $\tau _ { 2 }$ emphasizes the noisy data with correct pseudo labels, so relabeling them provides new information in addition to the clean data.
|
| 89 |
+
|
| 90 |
+
We apply the data selection criterion of Eq. (4) in each step and gradually change its parameters $( \tau _ { 1 } , \tau _ { 2 } , \lambda )$ over the course of training according to the properties discussed above. We start from a negative $\tau _ { 1 }$ associated with a positive $\tau _ { 2 }$ and a large $\lambda$ ${ p } _ { t } ( i )$ dominates), then gradually increase $\tau _ { 1 }$ while decrease $\tau _ { 2 }$ and $\lambda$ , and end with a positive $\tau _ { 1 }$ , a negative $\tau _ { 2 }$ and a small $\lambda$ . In this way, we get a curriculum with a smooth transition between supervised learning of clean data using correct given labels and self-supervision of noisy data using reliable pseudo labels (i.e., minimizing Eq. (2). Moreover, the coupling strategy on $\tau _ { 1 }$ and $\tau _ { 2 }$ encourages selecting informative samples that the model mostly needs to improve on, i.e., clean data with inconsistent model outputs or noisy data with correct pseudo labels. In our experiments, we can further reduce the hyperparameters: (1) given the sequence for $\tau _ { 1 }$ in the curriculum as $\tau _ { 1 : T }$ , we can reverse it as the sequence for $\tau _ { 2 }$ , i.e., $\tau _ { T : 1 }$ ; (2) we can make $\lambda$ monotone increase with $\tau _ { 1 }$ , e.g., setting the initial value $\lambda _ { 1 } = a \tau _ { 1 } + b$ and ending value $\lambda _ { T } = a \tau _ { T } + b$ , solving this linear system for $a$ and $b$ , which generate $\lambda _ { 1 : T } = a \tau _ { 1 : T } + b$ .
|
| 91 |
+
|
| 92 |
+
# 3.2 ROBUST CURRICULUM LEARNING AS AN OPTIMIZATION
|
| 93 |
+
|
| 94 |
+
The data selection criterion is derived from an optimization formulation of our robust curriculum learning (RoCL), in which we aim to minimize a combination of supervised loss and
|
| 95 |
+
|
| 96 |
+
consistency(self-supervised) loss in the following form.
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\operatorname* { m i n } _ { \theta } F ( \theta ) \triangleq \frac { \lambda } { \tau _ { 1 } } \log \left( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \exp [ \tau _ { 1 } \ell ( f ( x _ { i } ; \theta ) , y _ { i } ) ] \right) + \frac { 1 - \lambda } { \tau _ { 2 } } \log \left( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \exp [ \tau _ { 2 } \zeta ( i ) ] \right) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where the consistency loss $\zeta ( i )$ is defined in Eq. (2) (with $t$ removed). For the first term of Eq. (6), $\textstyle 1 / n \sum _ { i = 1 } ^ { n } \ell ( f ( x _ { i } ; \theta ) , y _ { i } )$ l empirical risk minimization (ERM) with arithmetic average loss, i.e.,, we use LogSumExp loss with an additional temperature parameter (i.e., $\begin{array} { r l } & { \frac { 1 } { \tau _ { 1 } } \log \left( \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \exp [ \tau _ { 1 } \ell ( f ( x _ { i } ; \theta ) , y _ { i } ) ] \right) } \end{array}$ ), so it can approximate both the min-loss (when $\tau _ { 1 } \to - \infty ,$ max-loss (when $\tau _ { 1 } \to + \infty ,$ ), and any interpolation between them, where the min-loss focuses on the easiest samples with the smallest losses and the max-loss focuses on the hardest ones. Note it reduces to the arithmetic average loss when $\tau 0$ . It is called “tilted loss” in a recent work (Li et al., 2020), which shows several intriguing properties in different learning settings. The second term of Eq. (6) focuses on the consistency loss $\zeta ( i )$ . We use $\lambda$ to control the trade-off between the supervised loss and the consistency loss. By simple algebra, the gradient of $F ( \theta )$ at step $t$ is
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { l } { \displaystyle \nabla _ { \theta } F ( \theta _ { t } ) = \lambda \sum _ { i = 1 } ^ { n } p _ { t } ^ { \prime } ( i ) \nabla _ { \theta } \ell ( f ( x _ { i } ; \theta _ { t } ) , y _ { i } ) + ( 1 - \lambda ) \sum _ { i = 1 } ^ { n } q _ { t } ^ { \prime } ( i ) \nabla _ { \theta } \zeta _ { t } ( i ) } \\ { \displaystyle = \sum _ { i = 1 } ^ { n } \mathcal { P } _ { t } ^ { \prime } ( i ) \left[ \frac { \lambda p _ { t } ^ { \prime } ( i ) } { \mathcal { P } _ { t } ^ { \prime } ( i ) } \nabla _ { \theta } \ell ( f ( x _ { i } ; \theta _ { t } ) , y _ { i } ) + \frac { ( 1 - \lambda ) q _ { t } ^ { \prime } ( i ) } { \mathcal { P } _ { t } ^ { \prime } ( i ) } \nabla _ { \theta } \zeta _ { t } ( i ) \right] = \mathbb { E } _ { i \sim \mathcal { P } _ { t } ^ { \prime } ( i ) } G _ { t } ( i ) , } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
G _ { t } ( i ) \triangleq \frac { \lambda p _ { t } ^ { \prime } ( i ) } { \mathcal { P } _ { t } ^ { \prime } ( i ) } \nabla _ { \theta } \ell ( f ( x _ { i } ; \theta _ { t } ) , y _ { i } ) + \frac { ( 1 - \lambda ) q _ { t } ^ { \prime } ( i ) } { \mathcal { P } _ { t } ^ { \prime } ( i ) } \nabla _ { \theta } \zeta _ { t } ( i ) .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Here, $p _ { t } ^ { \prime } ( i )$ and $q _ { t } ^ { \prime } ( i )$ are similar to $p _ { t } ( i )$ and $q _ { t } ( i )$ defined in Eq. (5) except that the EMA loss and EMA consistency loss are replaced by their instantaneous counterparts respectively, i.e., $p _ { t } ^ { \prime } ( i ) \triangleq$ $\frac { \exp [ \tau _ { 1 } \ell ( f ( x _ { i } ; \theta _ { t } ) , y _ { i } ) ] } { \sum _ { j = 1 } ^ { n } \exp [ \tau _ { 1 } \ell ( f ( x _ { j } ; \theta _ { t } ) , y _ { j } ) ] }$ , P exp[τ2ζt(i)]nj=1 exp[τ2ζt(j)] . Similarly, we also denote P 0t(i) = λ × p0t(i) + $( 1 - \lambda ) \times q _ { t } ^ { \prime } ( i )$ . Note in Section 2, we already discussed that the EMA metrics are better alternatives to the instantaneous metrics when used for data selection in noisy-label learning. In our experiments, we use the EMA metrics $\{ p _ { t } ( i ) , q _ { t } ( i ) , \mathcal { P } _ { t } ( i ) \}$ instead of the instantaneous ones $\{ p _ { t } ^ { \prime } ( i ) , q _ { t } ^ { \prime } ( \dot { i } ) , \mathcal { P } _ { t } ^ { \prime } ( i ) \}$ . For every training step, an unbiased estimator of the gradient in Eq. (7) can be achieved by drawing a subset of samples $S _ { t }$ according to $\mathcal { P } _ { t } ( i )$ and averaging their gradients $G _ { t } ( i )$ in Eq. (8).
|
| 115 |
+
|
| 116 |
+
# 3.3 ROBUST CURRICULUM LEARNING ALGORITHM
|
| 117 |
+
|
| 118 |
+
# Algorithm 1 Robust Curriculum Learning (RoCL)
|
| 119 |
+
|
| 120 |
+
We describe our curriculum learning algorithm RoCL in Alg. 1 based on the data selection criterion in Section 3.1 and the optimization formulation in Section 3.2. We denote the update of $\theta _ { t }$ produced by the adopted optimizer as $\mathsf { \bar { h } } ( \nabla _ { \theta } F ( \theta _ { t } ) , \eta )$ , where $\eta$ contains all hyperparameters of the optimizer at step $t$ , e.g., the learning rate. We denote $\ell _ { t } ( i )$ as a shorthand notation for $\ell ( f ( x _ { i } ; \theta _ { t - 1 } ) , y _ { i } )$ . We apply a warm starting episode of a few epochs (e.g., 5-10) over all the data and given labels with label smoothing to obtain stable EMA metrics. After that, we apply multiple episodes of curriculum learning, each including a sequence of steps following the curriculum at the end of Section 3.1 for data selection per step (Line 6-14). We repeat the transition between clean data learning to noisy data learning for $K$ episodes to avoid getting trapped in a local
|
| 121 |
+
|
| 122 |
+
1: input: $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n } , h ( \cdot ; \eta ) , \ell ( \cdot , \cdot ) , f ( \cdot ; \theta ) , T _ { 0 : K } ; \tau _ { 1 } <$
|
| 123 |
+
$0 , \tau _ { T } > 0 ; \lambda _ { 1 } , \lambda _ { T } \in [ 0 , 1 ] ; \gamma , \gamma _ { b } \in [ 0 , 1 ]$
|
| 124 |
+
2: initialize: $\theta _ { 0 }$ , $b _ { 0 } \in ( 0 , n )$ , $l _ { 0 } ( i ) = \bar { c } _ { 0 } ( i ) \bar { = } 0 \forall i \in [ n ]$
|
| 125 |
+
3: for $k \in \{ 0 , \cdots , K \}$ do
|
| 126 |
+
4: Schedule $\tau _ { 1 : T _ { k } }$ and $\lambda _ { 1 : T _ { k } }$ by Eq. (9)-(10);
|
| 127 |
+
5: for $t ^ { \prime } \in \{ 1 , \cdots , T _ { k } \}$ do
|
| 128 |
+
6: $t \gets t ^ { \prime } + T _ { k - 1 }$ ;
|
| 129 |
+
7: if $k = 0$ then
|
| 130 |
+
8: $\begin{array} { r l } & { { S _ { t } } \gets [ n ] ; } \\ & { \theta _ { t } \gets \theta _ { t - 1 } + h \left( \nabla _ { \theta } \frac { 1 } { n } \sum _ { i = 0 } ^ { n } \ell _ { t } ( i ) ; \eta \right) ; } \end{array}$
|
| 131 |
+
9:
|
| 132 |
+
10: else
|
| 133 |
+
11: Draw a subset $S _ { t } \subseteq [ n ]$ of $b _ { k }$ samples according
|
| 134 |
+
to probability $\mathcal { P } _ { t }$ in Eq. (4) with $\tau _ { 1 } = \tau _ { t ^ { \prime } } , \tau _ { 2 } =$
|
| 135 |
+
$\tau _ { T _ { k } - t ^ { \prime } } , \lambda = \lambda _ { t ^ { \prime } }$ ;
|
| 136 |
+
12: $\begin{array} { r l } & { \theta _ { t } \theta _ { t - 1 } + h ( \frac { 1 } { b _ { k } } \sum _ { i \in S _ { t } } G _ { t } ( i ) ; \eta ) } \end{array}$ (Eq. (8));
|
| 137 |
+
13: end if
|
| 138 |
+
14: Update $l _ { t + 1 } ( i )$ and $c _ { t + 1 } ( i )$ by Eq. (1) and Eq. (3);
|
| 139 |
+
15: end for
|
| 140 |
+
16: $b _ { k + 1 } ( 1 + \gamma _ { b } ) \times b _ { k } ;$
|
| 141 |
+
17: end for
|
| 142 |
+
|
| 143 |
+
the memorization of clean labels and correct pseudo labels learned in previous episodes. Moreover, under the coupling strategy of $\tau _ { 1 }$ and $\tau _ { 2 }$ , each episode is encouraged to explore the clean/noisy data that the previous episode fails to learn. Considering the undertrained model (producing inaccurate pseudo labels) and the relatively high variance of the EMA metrics at the earlier episodes, we start from a small budget for the selected subset size and gradually increase in later episodes.
|
| 144 |
+
|
| 145 |
+
To generate the whole schedule of $\tau _ { 1 : T }$ in each episode, we can apply any monotone interpolation between $\tau _ { 1 }$ and $\tau _ { T }$ whose values are predefined. Let $g : { \mathcal { R } } \mapsto [ - \sigma , \sigma ]$ be an invertible monotone continuous function. We define the interpolation between $\tau _ { 1 }$ and $\tau _ { T }$ as follows, $\forall t \in [ T ]$ ,
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\tau _ { t } = \frac { \tau _ { T } - \tau _ { m } } { \sigma } \times \left[ g ( \sigma _ { t } ) - \frac { g ( - \sigma ) + g ( \sigma ) } { 2 } \right] + \tau _ { m } , \sigma _ { t } = g ^ { - 1 } ( - \sigma ) + \frac { 2 t } { T } g ^ { - 1 } ( \sigma ) , \tau _ { m } = \frac { \tau _ { 1 } + \tau _ { T } } { 2 } .
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
Note the $g ( \sigma _ { t } )$ produces interpolation values between $[ - \sigma , \sigma ]$ that correspond to $T$ evenly spaced input $\sigma _ { t } \in \mathring { [ g ^ { - 1 } ( - \sigma ) , g ^ { - 1 } ( \sigma ) ] }$ . In our curriculum for each episode, we need to keep a high quality of the selected clean (pseudo) labels in earlier (later) stages and make the exploration stages in between shorter since their selected labels contain more noise. Therefore, we choose “s”-shaped functions such as tanh or the logistic function for the interpolation. In this paper, we use $g ( \cdot ) \stackrel { - } { = } \operatorname { t a n h } ( \cdot )$ and pick $\sigma = 0 . 9 5$ . We illustrate Eq. (9) and visualize our choice of $g ( \cdot )$ and the resulting $\tau _ { t }$ in Figure 6 (Appendix). The corresponding schedule for $\lambda$ can then be defined as an affine transformation of $\tau _ { 1 : T }$
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\forall t \in [ T ] , \lambda _ { t } = a _ { \lambda } ( \tau _ { t } - \tau _ { 1 } ) + \lambda _ { 1 } , a _ { \lambda } = \frac { \lambda _ { T } - \lambda _ { 1 } } { \tau _ { T } - \tau _ { 1 } } .
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
# 4 EXPERIMENTS
|
| 158 |
+
|
| 159 |
+
We evaluate RoCL with other approaches for noisylabel learning on three widely used benchmarks, i.e., CIFAR10/100 with two types of synthetic noises (i.e., symmetric and asymmetric), and mini-WebVision (Li et al., 2017a) (the first 50 classes) containing unknown noises from web labels. Symmetric noise flips each label randomly to an incorrect class with probability $\rho$ (i.e., noise rate), and our experiments cover $\rho = \{ 0 . 4 , 0 . 6 , 0 . 8 \}$ . Asymmetric noise flips the labels within a specific set of classes. For CIFAR10, flipping TRUCK AUTOMOBILE, BIRD AIRPLANE, DEER HORSE, $\mathrm { C A T } { } \mathrm { D O G }$ . In CIFAR100, the 100 classes are grouped into 20 super-classes with each has 5 sub-classes, we then flip each class within the same super-class to the next in a circular fashion with probability $\rho$ . Our experiments cover $\rho = \{ 0 . 2 , 0 . 3 , 0 . 4 \}$ .
|
| 160 |
+
|
| 161 |
+
Table 1: Accuracy $( \% )$ evaluated on WebVision and ILSVRC2012 validation sets for DNNs trained by noisy-label learning methods on mini-WebVision training set (first 50 classes), which contains real-world web-label noises.
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Val. set</td><td>WebVision</td><td>ILSVRC2012</td></tr><tr><td> Accuracy</td><td>Top-1 Top-5</td><td>Top-1 Top-5</td></tr><tr><td>F-correct +*</td><td>61.12 82.68</td><td>57.36 82.36</td></tr><tr><td>Decoupling **</td><td>62.54 84.74</td><td>58.26 82.26</td></tr><tr><td>Co-teaching *</td><td>63.58 85.20</td><td>61.48 84.70</td></tr><tr><td>MentorNet **</td><td>63.00 81.40</td><td>57.80 79.92</td></tr><tr><td>MentorMix ***</td><td>76.00 90.20</td><td>72.90 91.10</td></tr><tr><td>D2L *</td><td>62.68 84.00</td><td>57.80 81.36</td></tr><tr><td>INCV *</td><td>65.24 85.34</td><td>61.60 84.98</td></tr><tr><td>RoCL (ours) *†~</td><td>80.04 92.68</td><td>75.81 92.28</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Practical Modifications In the experiments, we follow previous work and apply the techniques below. We will present an ablation study of their effectiveness in Table 5.
|
| 166 |
+
|
| 167 |
+
• We apply the class-balance regularization used in (Tanaka et al., 2018), which prevents the model from predicting the same class for all the samples within a mini-batch $B$ . We add $\textstyle \bigl ( 1 / B \bigr ) \sum _ { i \in B } \ell \bigl ( f ( x _ { i } ; \theta ) , \overline { { 1 } } / C \cdot { \mathbf { 1 } } \bigr )$ (where $C$ is the number of classes) to the objective for a minibatch $B$ with regularization weight of 1. • We apply label smoothing whose effectiveness in noisy-label learning has been studied in (Lukasik et al., 2020). We modify each one-hot label $y _ { i }$ to be $\bar { y _ { i } } ( 1 - \alpha ) y _ { i } \dot { + } \alpha / C$ (e.g., we use $\alpha = 0 . 5$ ). • We apply Mix-Up (Zhang et al., 2018) to all the selected data. However, Mix-Up of two (soft) pseudo labels can significantly increase the entropy of the mixed label if both pseudo labels are under-confident. Hence, we apply a curriculum to the beta distribution’s parameter $\alpha$ of Mix-Up and gradually reduce it (e.g., from 8.0 to 0.2 in our experiments) within each episode.
|
| 168 |
+
|
| 169 |
+
Hyperparameter Setting We apply $\scriptstyle \mathrm { R o C L }$ to train ResNet34 on CIFAR10/100 and ResNet50 on WebVision, which are the most widely used models in other baseline papers. We apply SGD with momentum of 0.9, weight decay of $1 0 ^ { - 4 }$ and cosine annealing learning rate in each training episode. The initial learning rate is set to 0.1 for CIFAR10/100 and 1.0 for WebVision. In all RoCL experiments, we apply $T _ { 0 } = 1 0$ warm starting epochs followed by $K = 1 0$ episodes of curriculum learning, whose lengths start from $T _ { 1 } = 1 0$ and increase by 10 for every episode afterwards. We initialize the subset size $b _ { 0 } = 0 . 2 n$ and set $\gamma = \gamma _ { b } = 0 . 1$ , which are common choices for discounting/augmenting factors. We use Cubuk et al. (2020) for data augmentations. We did not heavily tune $\lambda _ { 1 } , \lambda _ { T }$ and $\tau _ { 1 } , \tau _ { T }$ and followed a principle that the resulting curriculum should have a transition from supervised learning on clean data to self-supervised learning on noisy data with correct pseudo labels.
|
| 170 |
+
|
| 171 |
+
• For $\lambda$ , we start from $\lambda _ { 1 }$ close to 1 and end with $\lambda _ { T }$ close to 0 because our curriculum is a transition from supervised learning $( \lambda = 1 )$ ) to self-supervised learning $\lambda = 0$ ).
|
| 172 |
+
• As explained in Section 3.1, our curriculum requires $\tau _ { 1 }$ for $p _ { t } ( i )$ changing from negative to positive values and an inverse sequence for $\tau _ { 2 }$ in $q _ { t } ( i )$ to gain the above transition and encourage learning on more informative samples. Hence, we set the starting value $\tau _ { 1 }$ to be negative and $\tau _ { T }$ to be positive for the sequence $\tau _ { 1 : T }$ .
|
| 173 |
+
• We set their exact values based on observations in Figure 1: clean data detection is easier but the detection of correct pseudo-labels is harder. So we can be more confident on the former than the latter and set the starting $\tau _ { 1 }$ larger than $\tau _ { T }$ in magnitude. For the same reason, we set the starting value $\lambda _ { 1 }$ to be closer to 1 than the ending value $\lambda _ { T }$ to 0. In experiments, we tried $\tau _ { 1 } = \{ - 4 , - 3 \}$ and $\tau _ { T } = \{ 1 , 2 \}$ and finally chose $\tau _ { 1 } = - 4$ and $\tau _ { T } = 1$ since this choice performs consistently well on all experiments, though it might not be the best choice for all; we set $\lambda _ { 1 } = 0 . 9$ and did not try other values; we tried $\lambda _ { T } = \{ 0 . 1 , \bar { 0 . 2 } , 0 . 3 \}$ and on some experiments the first two choices lead to slightly worse performance, so we chose $\lambda _ { T } = 0 . 3$ .
|
| 174 |
+
|
| 175 |
+
We compare RoCL to the following baselines: Fcorrect (Patrini et al., 2017), Decoupling (Malach & Shalev-Shwartz, 2017), Co-teaching (Han et al., 2018), D2L (Ma et al., 2018), INCV (Chen et al., 2019), MDDYR-SH (Arazo et al., 2019), MentorNet (Jiang et al., 2018), MentorMix (Jiang et al., 2020), O2U-net (Huang et al., 2019), $\mathrm { R o G + D 2 L }$ (Lee et al., 2019), PENCIL (Yi & Wu, 2019), GCE (Zhang & Sabuncu, 2018), SCE (Wang et al., 2019), NFL/NCE variants (Ma et al., 2020), and Bootstrap (Reed et al., 2014). To better compare and categorize different baseline methods, we use the following symbols to denote the techniques used: $^ +$ for additional clean training data; $^ *$ for training additional auxiliary models; $^ \ddag$ for using mixup; $\star$ for using data augmentations; $\dagger$ for class-balance regularization; o for label-smoothing. We report the results and comparisons to baselines in three tables: real-world noise in Table. 1, symmetric noise in Table. 3 and asymmetric noise in Table. 4. RoCL achieves the best performance in every setting, and for most of the cases, improves upon the existing methods by large margins. The closest rival to RoCL is MentorMix, which utilizes MentorNet and Mix-Up to assign weights to each sample. We note that MentorMix requires training of an extra mentor network to generate the sample weights, while RoCL is more flexible and only makes changes to the training process without modifying the model. Table. 2 reports RoCL’s performance when applied with different loss functions on
|
| 176 |
+
|
| 177 |
+
Table 2: Test accuracy $( \% )$ of $\mathbf { R o C L }$ applied with different loss functions on CIFAR10 corrupted by $\{ 6 0 \% , 8 0 \% \}$ symmetric(uniform) noises (CE-cross entropy).
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Noise Rate</td><td>60%</td><td>80%</td></tr><tr><td>CE</td><td>90.22 ± 0.24</td><td>77.47± 0.67</td></tr><tr><td>GCE</td><td>89.30 ± 0.68</td><td>79.84± 1.12</td></tr><tr><td>SCE</td><td>92.06 ±0.23</td><td>74.25 ±0.86</td></tr><tr><td>NFL+MAE</td><td>88.73±0.47</td><td>85.76±0.26</td></tr><tr><td>NFL+RCE</td><td>87.68 ± 0.35</td><td>80.09 ± 0.41</td></tr><tr><td>NCE+MAE</td><td>90.37 ± 0.43</td><td>82.16 ± 0.93</td></tr><tr><td></td><td></td><td></td></tr><tr><td>NCE+RCE</td><td>88.03 ±0.39</td><td>80.33 ± 0.80</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 3: Test accuracy $( \% )$ of noisy-label learning methods on CIFAR10/100 corrupted by symmetric(uniform) label noises of different levels. All the baselines’ results are from the original papers or the following-up works. There are two formats of these reported results: “mean±variance” of 5 trials and single-trial accuracy.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR10</td><td colspan="3">CIFAR100</td></tr><tr><td>Noise Rate</td><td>40%</td><td>60%</td><td>80%</td><td>40%</td><td>60%</td><td>80%</td></tr><tr><td>MD-DYR-SH **†+</td><td>92.3</td><td>86.1</td><td>74.1</td><td>70.1</td><td>59.5</td><td>39.5</td></tr><tr><td>MentorNet **</td><td>91.2</td><td>74.2</td><td>60.0</td><td>68.5</td><td>61.2</td><td>35.5</td></tr><tr><td>MentorMix ***</td><td>94.2</td><td>91.3</td><td>81.0</td><td>71.3</td><td>64.6</td><td>41.2</td></tr><tr><td>O2U-net *</td><td>90.3</td><td>=</td><td>43.4</td><td>69.2</td><td>-</td><td>39.4</td></tr><tr><td>RoG+D2L **</td><td>87.0</td><td>78.0</td><td>=</td><td>64.9</td><td>40.6</td><td>=</td></tr><tr><td>PENCIL *</td><td>=</td><td>=</td><td>=</td><td>69.12 ±0.62</td><td>57.79± 3.86</td><td>fail</td></tr><tr><td>GCE*</td><td>87.62 ±0.26</td><td>82.70±0.23</td><td>67.92 ± 0.60</td><td>62.64± 0.33</td><td>54.04± 0.56</td><td>29.60±0.51</td></tr><tr><td>SCE *</td><td>85.34 ± 0.07</td><td>80.07 ±0.02</td><td>53.81 ± 0.27</td><td>53.69 ±0.07</td><td>41.47 ± 0.04</td><td>15.00 ± 0.04</td></tr><tr><td>NFL+MAE *</td><td>83.81 ±0.06</td><td>76.36 ± 0.31</td><td>45.23 ± 0.52</td><td>58.18 ±0.08</td><td>46.10±0.50</td><td>24.78±0.82</td></tr><tr><td>NCE+RCE *</td><td>86.02 ±0.09</td><td>79.78 ±0.50</td><td>52.71 ±1.90</td><td>59.48 ± 0.56</td><td>47.12 ± 0.62</td><td>25.80±1.12</td></tr><tr><td>RoCL (ours) ‡*†1</td><td>94.55 ±0.12 92.06 ±0.23 85.76 ±0.26</td><td></td><td></td><td></td><td>74.64 ± 0.43 66.79 ± 0.58 53.89 ± 0.62</td><td></td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 4: Test accuracy $( \% )$ of noisy-label learning methods on CIFAR10/100 corrupted by asymmetric(classdependent) noises of 3 levels. All the baselines’ results are from the original papers or the following-up works.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR10</td><td colspan="3">CIFAR100</td></tr><tr><td>Noise Rate</td><td>20%</td><td>30%</td><td>40%</td><td>20%</td><td>30%</td><td>40%</td></tr><tr><td>PENCIL *</td><td>92.43</td><td>91.84</td><td>91.01</td><td>74.70 ±0.56</td><td>72.52 ± 0.38</td><td>63.61 ±0.23</td></tr><tr><td>Bootstrap *</td><td>86.57 ±0.08</td><td>84.86±0.05</td><td>79.76±0.07</td><td>63.44 ± 0.35</td><td>63.18 ±0.35</td><td>62.08 ±0.22</td></tr><tr><td>F-correct +*</td><td>89.09 ±0.47</td><td>86.79±0.36</td><td>83.55 ± 0.58</td><td>42.46± 2.16</td><td>38.13 ± 2.97</td><td>34.44 ± 1.93</td></tr><tr><td>GCE*</td><td>86.07 ± 0.31</td><td>80.78±0.21</td><td>74.98 ± 0.32</td><td>59.99 ± 0.83</td><td>53.99 ± 0.29</td><td>41.49 ± 0.79</td></tr><tr><td>SCE *</td><td>83.92 ± 0.07</td><td>79.70±0.27</td><td>78.20 ± 0.03</td><td>58.22 ± 0.47</td><td>49.85 ± 0.91</td><td>42.19 ±0.19</td></tr><tr><td>NFL+MAE *</td><td>86.81 ± 0.32</td><td>83.91 ± 0.34</td><td>77.16 ± 0.10</td><td>63.10 ± 0.22</td><td>56.19 ± 0.61</td><td>43.51 ± 0.42</td></tr><tr><td>NCE+RCE *</td><td>88.56 ± 0.17</td><td>85.58±0.44</td><td>79.59 ± 0.40</td><td>62.68 ± 0.79</td><td>57.82 ± 0.41</td><td>46.79 ±0.96</td></tr><tr><td>RoCL (ours) t*†</td><td>95.38±0.219</td><td>94.19 ±0.28 92.31±0.35</td><td></td><td></td><td>80.03 ± 0.34 77.59 ± 0.45 73.28 ± 0.83</td><td></td></tr></table>
|
| 188 |
+
|
| 189 |
+
CIFAR10 under high noise rates, i.e., $60 \%$ and $80 \%$ . We observe significant improvements over their performance without using RoCL in Table. 3. It indicates that RoCL is compatible with any loss function and can further enhance their performance.
|
| 190 |
+
|
| 191 |
+
To analyze the effect of each component in RoCL, we conduct a thorough ablation study of 10 variants of RoCL, each removing/changing one component of the original RoCL. In Table 5, we report their test accuracies on CIFAR10/100 with noise rates of $\{ 6 0 \% , 8 0 \% \}$ . In Figure 7-10 in Appendix, we report how their test accuracies change during the training to study their learning efficiency and convergence. Among them, “no ClassBalance” removes the class-balance regularization; “no RandAugment” replaces the strong data augmentation RandAugment Cubuk et al. (2020) with random crop and random horizontal flip; “no RandSampling” replaces the weighted sampling in Line 11 of Algorithm 1 by selecting the top- $\boldsymbol { \cdot } \boldsymbol { b } _ { k }$ samples with the largest $\mathcal { P } _ { t } ( i )$ ; “no EMA metrics” replaces EMA loss and EMA
|
| 192 |
+
|
| 193 |
+
Table 5: Ablation study: Test accuracy $( \% )$ of $\scriptstyle \mathrm { R o C L }$ variants with one part removed/changed when applied to CIFAR10/100 corrupted by symmetric(uniform) label noise.
|
| 194 |
+
|
| 195 |
+
<table><tr><td>Dataset</td><td>CIFAR10</td><td>CIFAR100</td><td></td></tr><tr><td>Noise Rate</td><td>60%</td><td>80%</td><td>60% 80%</td></tr><tr><td>RoCL: no MixUp</td><td>92.98</td><td>88.18</td><td>69.72 58.72</td></tr><tr><td>RoCL:no LabelSmooth</td><td>91.94</td><td>85.05</td><td>62.92 42.95</td></tr><tr><td>RoCL:no ClassBalance</td><td>93.08</td><td>74.91</td><td>62.66 43.94</td></tr><tr><td>RoCL: no RandAugment</td><td>86.59</td><td>72.35</td><td>64.84 44.06</td></tr><tr><td>RoCL: no RandSampling</td><td>92.31</td><td>85.99</td><td>64.09 57.00</td></tr><tr><td>RoCL: no EMA metrics</td><td>92.84</td><td>87.79</td><td>65.99 53.10</td></tr><tr><td>RoCL: pt(i) = 1/n</td><td>92.42</td><td>86.05</td><td>62.69 44.35</td></tr><tr><td>RoCL: qt(i)=1/n</td><td>92.59</td><td>86.93</td><td>64.71 50.79</td></tr><tr><td>RoCL: pt(i)= qt(i) =1/n</td><td>92.07</td><td>85.77</td><td>64.18 47.88</td></tr><tr><td>RoCLBase: no curriculum</td><td>87.83</td><td>66.93</td><td>61.84 41.92</td></tr><tr><td>RoCL: original version</td><td>92.82</td><td>88.00</td><td>66.79 54.22</td></tr><tr><td>MentorMix:+RandAugment</td><td>85.45</td><td>20.68</td><td>52.70 8.02</td></tr><tr><td>MentorMix:+RandAugment-MixUp</td><td>84.31</td><td>38.21</td><td>58.31 8.18</td></tr><tr><td>MentorMix:original version</td><td>91.30</td><td>81.00</td><td>64.60 41.20</td></tr><tr><td></td><td></td><td></td><td></td></tr></table>
|
| 196 |
+
|
| 197 |
+
consistency loss with their instantaneous counterparts; $\dot { \boldsymbol { p } } _ { t } ( i ) = 1 / n ^ { \mathfrak { N } }$ samples the clean data using uniform probabilities; $\mathsf { \bar { q } } _ { t } ( i ) = 1 / n ^ { \prime \prime }$ samples the correct pseudo-labels using uniform probabilities; $\begin{array} { r } { \dot { \mathbf { \sigma } } p _ { t } ( i ) = \mathbf { \bar { { q } } } _ { t } ( i ) = 1 / n ^ { \prime } } \end{array}$ uses uniform probabilities for both. Note for the final three variants, we still have the curriculum of $\lambda$ . We keep the same hyperparameter settings as the original RoCL. We give brief conclusions here and leave a detailed analysis to Appendix: (1) Except $\mathrm { R o C L } _ { B a s e }$ in Algorithm 2, “no RandAugment” and “no ClassBalance”, most variants perform similarly as the original RoCL and outperform the previous SoTA achieved by MentorMix. The removed components are more important under higher noise rates. (2) $\mathrm { R o C L } _ { B a s e }$ removes our proposed curriculum and preserves all other techniques but shows significant degradation on accuracies, indicating that the curriculum is essential to RoCL’s appealing performance. (3) A strong data augmentation is critical to effective self-supervision and accurate EMA consistency loss estimation in RoCL, while a weak one may lead to error accumulation. However, applying RandAugment in MentorMix degrades its original performance. (4) Class-balance regularization is only important under very high noise rates. (5) Removing Mix-Up can improve RoCL’s performance since it damages information when mixing soft pseudo labels. (6) Compared to other variants, “no RandSampling” or “no EMA metrics” causes less degeneration on the final accuracies but can slow down the convergence and learning speed in the early stages when exploration is insufficient. (7) Changing $p _ { t } ( i ) , q _ { t } ( i )$ or both to uniform probabilities reduces the final accuracies in all cases and significantly slows down the learning process.
|
| 198 |
+
|
| 199 |
+
# 5 CONCLUSION
|
| 200 |
+
|
| 201 |
+
We propose a novel curriculum learning method RoCL for robust learning under label noises. RoCL features a smooth transition from learning with clean data to noisy data, and from learning with supervised loss to self-supervised loss. Based on observations of training dynamics, RoCL can select samples with reliable labels/pseudo labels and most informative to training. RoCL does not require availability of extra clean data or training of extra auxiliary models. On multiple benchmarks of noisy label learning, RoCL significantly improves upon existing baselines.
|
| 202 |
+
|
| 203 |
+
# ACKNOWLEDGMENTS
|
| 204 |
+
|
| 205 |
+
This research is based upon work supported by the National Science Foundation under Grant No. IIS1162606, the National Institutes of Health under award R01GM103544, and by a Google, a Microsoft, and an Intel research award. It is also supported by the CONIX Research Center, one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA. Some GPUs used to produce the experimental results are donated by NVIDIA. We would like to thank ICLR area chairs and anonymous reviewers for their efforts in reviewing this paper and their constructive comments! We also thank all the MELODI lab members for their helpful discussions and feedback.
|
| 206 |
+
|
| 207 |
+
# REFERENCES
|
| 208 |
+
|
| 209 |
+
Ehsan Amid, Manfred KK Warmuth, Rohan Anil, and Tomer Koren. Robust bi-tempered logistic loss based on bregman divergences. In Advances in Neural Information Processing Systems, pp. 15013–15022, 2019.
|
| 210 |
+
|
| 211 |
+
Eric Arazo, Diego Ortego, Paul Albert, Noel E O’Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. arXiv preprint arXiv:1904.11238, 2019.
|
| 212 |
+
|
| 213 |
+
Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien. A closer look at memorization in deep networks. In International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 233–242, 2017.
|
| 214 |
+
|
| 215 |
+
Sumit Basu and Janara Christensen. Teaching classification boundaries to humans. In AAAI, pp. 109–115, 2013.
|
| 216 |
+
|
| 217 |
+
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 32 (NeurIPS), pp. 5050–5060. 2019.
|
| 218 |
+
|
| 219 |
+
Pengfei Chen, Benben Liao, Guangyong Chen, and Shengyu Zhang. Understanding and utilizing deep neural networks trained with noisy labels. arXiv preprint arXiv:1905.05040, 2019.
|
| 220 |
+
|
| 221 |
+
Ekin D. Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V. Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, June 2020.
|
| 222 |
+
|
| 223 |
+
Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. arXiv preprint arXiv:1712.09482, 2017.
|
| 224 |
+
|
| 225 |
+
Sheng Guo, Weilin Huang, Haozhi Zhang, Chenfan Zhuang, Dengke Dong, Matthew R Scott, and Dinglong Huang. Curriculumnet: Weakly supervised learning from large-scale web images. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 135–150, 2018.
|
| 226 |
+
|
| 227 |
+
Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in neural information processing systems, pp. 8527–8537, 2018.
|
| 228 |
+
|
| 229 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 230 |
+
|
| 231 |
+
Mengying Hu, Hu Han, Shiguang Shan, and Xilin Chen. Weakly supervised image classification through noise regularization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11517–11525, 2019.
|
| 232 |
+
|
| 233 |
+
Jinchi Huang, Lie Qu, Rongfei Jia, and Binqiang Zhao. O2u-net: A simple noisy label detection approach for deep neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3326–3334, 2019.
|
| 234 |
+
|
| 235 |
+
Lu Jiang, Deyu Meng, Shoou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander G. Hauptmann. Self-paced learning with diversity. In NeurIPS, pp. 2078–2086, 2014.
|
| 236 |
+
|
| 237 |
+
Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander G. Hauptmann. Self-paced curriculum learning. In AAAI, pp. 2694–2700, 2015.
|
| 238 |
+
|
| 239 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning, pp. 2304–2313, 2018.
|
| 240 |
+
|
| 241 |
+
Lu Jiang, Di Huang, Mason Liu, and Weilong Yang. Beyond synthetic noise: Deep learning on controlled noisy labels. ICML, 2020.
|
| 242 |
+
|
| 243 |
+
Faisal Khan, Xiaojin (Jerry) Zhu, and Bilge Mutlu. How do humans teach: On curriculum learning and teaching dimension. In NeurIPS, pp. 1449–1457, 2011.
|
| 244 |
+
|
| 245 |
+
M. Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In NeurIPS, pp. 1189–1197, 2010.
|
| 246 |
+
|
| 247 |
+
Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
|
| 248 |
+
|
| 249 |
+
Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. arXiv preprint arXiv:1901.11300, 2019.
|
| 250 |
+
|
| 251 |
+
Kuang-Huei Lee, Xiaodong He, Lei Zhang, and Linjun Yang. Cleannet: Transfer learning for scalable image classifier training with label noise. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5447–5456, 2018.
|
| 252 |
+
|
| 253 |
+
Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. Tilted empirical risk minimization. arXiv preprint arXiv:2007.01162, 2020.
|
| 254 |
+
|
| 255 |
+
Wen Li, Limin Wang, Wei Li, Eirikur Agustsson, and Luc Van Gool. Webvision database: Visual learning and understanding from web data. arXiv preprint arXiv:1708.02862, 2017a.
|
| 256 |
+
|
| 257 |
+
Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1910–1918, 2017b.
|
| 258 |
+
|
| 259 |
+
Michal Lukasik, Srinadh Bhojanapalli, Aditya Krishna Menon, and Sanjiv Kumar. Does label smoothing mitigate label noise? arXiv preprint arXiv:2003.02819, 2020.
|
| 260 |
+
|
| 261 |
+
Xingjun Ma, Yisen Wang, Michael E Houle, Shuo Zhou, Sarah M Erfani, Shu-Tao Xia, Sudanthi Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. arXiv preprint arXiv:1806.02612, 2018.
|
| 262 |
+
|
| 263 |
+
Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah Erfani, and James Bailey. Normalized loss functions for deep learning with noisy labels. arXiv preprint arXiv:2006.13554, 2020.
|
| 264 |
+
|
| 265 |
+
Eran Malach and Shai Shalev-Shwartz. Decoupling" when to update" from" how to update". In Advances in Neural Information Processing Systems, pp. 960–970, 2017.
|
| 266 |
+
|
| 267 |
+
Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1944–1952, 2017.
|
| 268 |
+
|
| 269 |
+
Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017.
|
| 270 |
+
|
| 271 |
+
Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems 28, pp. 3546–3554. 2015.
|
| 272 |
+
|
| 273 |
+
Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
|
| 274 |
+
|
| 275 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018.
|
| 276 |
+
|
| 277 |
+
Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. Advances in neural information processing systems, 29:1163–1171, 2016.
|
| 278 |
+
|
| 279 |
+
Shreyas Saxena, Oncel Tuzel, and Dennis DeCoste. Data parameters: A new family of parameters for learning a differentiable curriculum. In Advances in Neural Information Processing Systems, pp. 11095–11105, 2019.
|
| 280 |
+
|
| 281 |
+
Valentin I. Spitkovsky, Hiyan Alshawi, and Daniel Jurafsky. Baby Steps: How “Less is More” in unsupervised dependency parsing. In NeurIPS 2009 Workshop on Grammar Induction, Representation of Language and Language Learning, 2009.
|
| 282 |
+
|
| 283 |
+
James Steven Supancic III and Deva Ramanan. Self-paced learning for long-term tracking. In CVPR, pp. 2379–2386, 2013.
|
| 284 |
+
|
| 285 |
+
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.
|
| 286 |
+
|
| 287 |
+
Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5552–5560, 2018.
|
| 288 |
+
|
| 289 |
+
Kevin Tang, Vignesh Ramanathan, Li Fei-fei, and Daphne Koller. Shifting weights: Adapting object detectors from image to video. In NeurIPS, pp. 638–646, 2012a.
|
| 290 |
+
|
| 291 |
+
Ye Tang, Yu-Bin Yang, and Yang Gao. Self-paced dictionary learning for image classification. In MM, pp. 833–836, 2012b.
|
| 292 |
+
|
| 293 |
+
Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in Neural Information Processing Systems 30 (NeurIPS), pp. 1195–1204. 2017.
|
| 294 |
+
|
| 295 |
+
Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In Advances in Neural Information Processing Systems, pp. 5596–5605, 2017.
|
| 296 |
+
|
| 297 |
+
Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 839–847, 2017.
|
| 298 |
+
|
| 299 |
+
Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In Proceedings of the IEEE International Conference on Computer Vision, pp. 322–330, 2019.
|
| 300 |
+
|
| 301 |
+
Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2691–2699, 2015.
|
| 302 |
+
|
| 303 |
+
Kun Yi and Jianxin Wu. Probabilistic end-to-end noise correction for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7017–7025, 2019.
|
| 304 |
+
|
| 305 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017.
|
| 306 |
+
|
| 307 |
+
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
|
| 308 |
+
|
| 309 |
+
Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in neural information processing systems, pp. 8778–8788, 2018.
|
| 310 |
+
|
| 311 |
+
Tianyi Zhou and Jeff Bilmes. Minimax curriculum learning: Machine teaching with desirable difficulties and scheduled diversity. In ICLR, 2018.
|
| 312 |
+
|
| 313 |
+
Tianyi Zhou, Shengjie Wang, and Jeff Bilmes. Time-consistent self-supervision for semi-supervised learning. In International Conference on Machine Learning (ICML), 2020a.
|
| 314 |
+
|
| 315 |
+
Tianyi Zhou, Shengjie Wang, and Jeff A. Bilmes. Curriculum learning by dynamic instance hardness. In NeurIPS, 2020b.
|
| 316 |
+
|
| 317 |
+
Tianyi Zhou, Shengjie Wang, and Jeff A. Bilmes. Curriculum learning by optimizing learning dynamics. In AISTATS, 2021.
|
| 318 |
+
|
| 319 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, 2017.
|
| 320 |
+
|
| 321 |
+
A APPENDIX
|
| 322 |
+
|
| 323 |
+
A.1 ${ \mathrm { R o C L } } _ { B a s e }$ (NO CURRICULUM) IN SECTION 2 AND FIGURE 2-10
|
| 324 |
+
|
| 325 |
+
# Algorithm $2 \mathrm { R o C L } _ { B a s e }$ (no curriculum)
|
| 326 |
+
|
| 327 |
+
1: input: $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n } , h ( \cdot ; \eta ) , \ell ( \cdot , \cdot ) , f ( \cdot ; \theta ) , T _ { 0 : K } ; \gamma \in [ 0 ,$ 1]
|
| 328 |
+
2: initialize: $\theta _ { 0 }$ , $l _ { 0 } ( i ) = c _ { 0 } ( i ) = 0 \forall i \in [ n ] , T _ { - 1 } = 0$
|
| 329 |
+
3: for $k \in \{ 0 , \cdots , K \}$ do
|
| 330 |
+
4: for $t ^ { \prime } \in \{ 1 , \cdots , T _ { k } \}$ do
|
| 331 |
+
5: $t \gets t ^ { \prime } + T _ { k - 1 }$ ;
|
| 332 |
+
6: $S _ { t } \gets [ n ]$ ;
|
| 333 |
+
7: if $k \% 2 = 0$ then
|
| 334 |
+
8: $\begin{array} { r } { \theta _ { t } \gets \theta _ { t - 1 } + h \left( \nabla _ { \theta } \frac { 1 } { n } \sum _ { i = 0 } ^ { n } \ell _ { t } ( i ) ; \eta \right) } \end{array}$ ; {supervised learning using given labels}
|
| 335 |
+
9: Update $l _ { t + 1 } ( i )$ by Eq. (1); {update EMA loss}
|
| 336 |
+
10: else
|
| 337 |
+
11: $\begin{array} { r } { \theta _ { t } \gets \theta _ { t - 1 } + h \left( \nabla _ { \theta } \frac { 1 } { n } \sum _ { i = 0 } ^ { n } \zeta _ { t } ( i ) ; \eta \right) } \end{array}$ ; {self-supervised learning using pseudo labels}
|
| 338 |
+
12: Update $c _ { t + 1 } ( i )$ by Eq. (3); {update EMA consistency loss}
|
| 339 |
+
13: end if
|
| 340 |
+
14: end for
|
| 341 |
+
15 : end for
|
| 342 |
+
|
| 343 |
+
Note the EMA metrics in line 9 and line 12 are not used for training in $\mathrm { R o C L } _ { B a s e }$ . They have been updated and recorded for the purpose of empirical study presented in Section 2.
|
| 344 |
+
|
| 345 |
+
# A.2 ADDITIONAL EXPERIMENTS
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 2: RoCL (Algorithm 1) vs. $\mathrm { R o C L } _ { B a s e }$ without any curriculum (Algorithm 2 in Appendix) during the training of ResNet34 on CIFAR10 containing $60 \%$ symmetric noises on labels.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 3: RoCL (Algorithm 1) vs. $\mathrm { R o C L } _ { B a s e }$ without any curriculum (Algorithm 2 in Appendix) during the training of ResNet34 on CIFAR10 containing $80 \%$ symmetric noises on labels.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 4: RoCL (Algorithm 1) vs. $\mathrm { R o C L } _ { B a s e }$ without any curriculum (Algorithm 2 in Appendix) during the training of ResNet34 on CIFAR100 containing $60 \%$ symmetric noises on labels.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 5: RoCL (Algorithm 1) vs. $\mathrm { R o C L } _ { B a s e }$ without any curriculum (Algorithm 2 in Appendix) during the training of ResNet34 on CIFAR100 containing $80 \%$ symmetric noises on labels.
|
| 358 |
+
|
| 359 |
+
Table 6: Extended version of Table 3 with two more baselines: $\mathrm { N F L + R C E }$ and $\mathbf { N C E { + } M A E }$ .
|
| 360 |
+
|
| 361 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR10</td><td colspan="3">CIFAR100</td></tr><tr><td>Noise Rate</td><td>40%</td><td>60%</td><td>80%</td><td>40%</td><td>60%</td><td>80%</td></tr><tr><td>MD-DYR-SH</td><td>92.3</td><td>86.1</td><td>74.1</td><td>70.1</td><td>59.5</td><td>39.5</td></tr><tr><td>MentorNet</td><td>91.2</td><td>74.2</td><td>60.0</td><td>68.5</td><td>61.2</td><td>35.5</td></tr><tr><td>MentorMix</td><td>94.2</td><td>91.3</td><td>81.0</td><td>71.3</td><td>64.6</td><td>41.2</td></tr><tr><td>O2U-net</td><td>90.3</td><td>=</td><td>43.4</td><td>69.2</td><td>=</td><td>39.4</td></tr><tr><td>RoG+D2L</td><td>87.0</td><td>78.0</td><td>1</td><td>64.9</td><td>40.6</td><td>-</td></tr><tr><td>PENCIL</td><td></td><td></td><td></td><td>69.12 ± 0.62</td><td>57.79 ± 3.86</td><td>fail</td></tr><tr><td>GCE</td><td>87.62 ± 0.26</td><td>82.70± 0.23</td><td>67.92 ±0.60</td><td>62.64± 0.33</td><td>54.04± 0.56</td><td>29.60 ± 0.51</td></tr><tr><td>SCE</td><td>85.34 ± 0.07</td><td>80.07 ±0.02</td><td>53.81 ± 0.27</td><td>53.69 ± 0.07</td><td>41.47 ± 0.04</td><td>15.00 ± 0.04</td></tr><tr><td>NFL+MAE</td><td>83.81±0.06</td><td>76.36 ± 0.31</td><td>45.23 ±0.52</td><td>58.18 ±0.08</td><td>46.10 ±0.50</td><td>24.78 ±0.82</td></tr><tr><td>NFL+RCE</td><td>86.05 ± 0.12</td><td>79.78 ± 0.13</td><td>55.06 ±1.08</td><td>58.20 ± 0.31</td><td>46.30 ± 0.45</td><td>25.16 ± 0.55</td></tr><tr><td>NCE+MAE</td><td>84.19 ± 0.43</td><td>77.61 ± 0.05</td><td>49.62 ±0.72</td><td>59.22 ±0.36</td><td>48.06 ±0.34</td><td>25.50±0.76</td></tr><tr><td>NCE+RCE</td><td>86.02 ±0.09</td><td>79.78 ± 0.50</td><td>52.71 ±1.90</td><td>59.48±0.56</td><td>47.12 ± 0.62</td><td>25.80 ±1.12</td></tr><tr><td>RoCL (ours) t*+</td><td>94.55 ± 0.12</td><td>92.06 ±0.23</td><td>85.76±0.26</td><td>74.64±0.43</td><td>66.79± 0.58</td><td>53.89±0.62</td></tr></table>
|
| 362 |
+
|
| 363 |
+
Table 7: Extended version of Table 4 with two more baselines: $\mathrm { N F L + R C E }$ and $\mathbf { N C E + M A E }$
|
| 364 |
+
|
| 365 |
+
<table><tr><td>Dataset</td><td></td><td>CIFAR10</td><td></td><td></td><td>CIFAR100</td><td></td></tr><tr><td>Noise Rate</td><td>20%</td><td>30%</td><td>40%</td><td>20%</td><td>30%</td><td>40%</td></tr><tr><td>PENCIL</td><td>92.43</td><td>91.84</td><td>91.01</td><td>74.70±0.56</td><td>72.52 ± 0.38</td><td>63.61 ±0.23</td></tr><tr><td>Bootstrap</td><td>86.57 ±0.08</td><td>84.86 ±0.05</td><td>79.76 ± 0.07</td><td>63.44±0.35</td><td>63.18 ±0.35</td><td>62.08 ±0.22</td></tr><tr><td>F-correct</td><td>89.09 ±0.47</td><td>86.79±0.36</td><td>83.55 ± 0.58</td><td>42.46 ±2.16</td><td>38.13 ± 2.97</td><td>34.44 ± 1.93</td></tr><tr><td>GCE</td><td>86.07 ±0.31</td><td>80.78 ±0.21</td><td>74.98 ±0.32</td><td>59.99 ± 0.83</td><td>53.99 ±0.29</td><td>41.49 ± 0.79</td></tr><tr><td>SCE</td><td>83.92 ± 0.07</td><td>79.70±0.27</td><td>78.20± 0.03</td><td>58.22 ± 0.47</td><td>49.85 ± 0.91</td><td>42.19 ±0.19</td></tr><tr><td>NFL+MAE</td><td>86.81±0.32</td><td>83.91 ± 0.34</td><td>77.16 ± 0.10</td><td>63.10±0.22</td><td>56.19 ± 0.61</td><td>43.51±0.42</td></tr><tr><td>NFL+RCE</td><td>88.73± 0.29</td><td>85.74±0.22</td><td>79.27 ± 0.43</td><td>63.12 ± 0.41</td><td>54.72 ± 0.38</td><td>42.97 ±1.03</td></tr><tr><td>NCE+MAE</td><td>86.44 ± 0.23</td><td>83.98 ± 0.52</td><td>78.23 ± 0.42</td><td>62.38 ± 0.60</td><td>58.02 ±0.48</td><td>47.22 ± 0.30</td></tr><tr><td>NCE+RCE</td><td>88.56 ± 0.17</td><td>85.58 ± 0.44</td><td>79.59 ± 0.40</td><td>62.68 ±0.79</td><td>57.82 ± 0.41</td><td>46.79±0.96</td></tr><tr><td>RoCL (ours)</td><td>95.38 ± 0.21</td><td>94.19±0.28</td><td>92.31 ± 0.35</td><td>80.03±0.34</td><td>77.59 ± 0.45</td><td>73.28 ±0.83</td></tr></table>
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 6: Illustration of Eq. (9) and visualization of our choice for $g ( \cdot )$ and the resulted $\tau _ { t }$ when $T = 5 0$ . We use $g ( \cdot ) = \operatorname { t a n h } ( \cdot )$ (which can be other “S”-shape functions) and $\sigma = 0 . 9 5$ in our experiments. Here, we map the points on the black curve in the left plot to the points on the red curve in the right plot. Each gray point on the bottom of the left plot is from the $T$ evenly spaced $\mathbf { X }$ -coordinates between the $\mathbf { X }$ -interval $[ g ^ { - 1 } ( { - } \sigma ) , { \dot { g } ^ { - 1 } } ( \sigma ) ]$ . We scale them to the $T$ t-coordinates in the bottom of the right plot (i.e., $t = 1 , 2 , \cdots , 5 0 )$ , which associates with $T \tau _ { t }$ values represented by the red points between $[ \tau _ { 1 } , \bar { \tau _ { T } } ]$ on the red curve.
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
Figure 7: Ablation study: RoCL vs. its variants during the training of ResNet34 on CIFAR10 containing $60 \%$ symmetric noises on labels.
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
Figure 8: Ablation study: RoCL vs. its variants during the training of ResNet34 on CIFAR10 containing $80 \%$ symmetric noises on labels.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 9: Ablation study: RoCL vs. its variants during the training of ResNet34 on CIFAR100 containing $60 \%$ symmetric noises on labels.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 10: Ablation study: RoCL vs. its variants during the training of ResNet34 on CIFAR100 containing $80 \%$ symmetric noises on labels.
|
| 381 |
+
|
| 382 |
+
We present a more detailed analysis of the ablation study results with explanations of the observed phenomenons below.
|
| 383 |
+
|
| 384 |
+
• Most variants (except $\mathrm { R o C L } _ { B a s e }$ , no RandAugment, and no ClassBalance) have similar performance as the original RoCL and perform better than or competitive with the SoTA results achieved by MentorMix. The differences compared to original RoCL become smaller under the lower noise rate setting $( 6 0 \% )$ . $\mathrm { R o C L } _ { B a s e }$ uses all data for training in each step without applying any curriculum, showing that our proposed curriculum is the most critical component of RoCL in achieving the appealing improvements. Note $\mathrm { R o C L } _ { B a s e }$ already outperforms most methods in Table 3, which verifies the effectiveness of multi-episode training that alternates between supervised learning with the given labels and self-supervision with the pseudo labels.
|
| 385 |
+
|
| 386 |
+
• Removing RandAugment degrades the performance, especially when the noise rate is very high (e.g., $80 \%$ ) because strong data augmentations are required by the self-supervision and the EMA consistency loss in RoCL, while trivial data augmentations can result in error accumulation or over-confidence in pseudo labels and inaccurate EMA consistency loss. The self-supervision aims to encourage the model output consistency over different augmentations of the same sample. Without augmentations with sufficient variations, self-supervision reduces to reinforcing the same outputs on similar samples and thus carries little information and can even magnify/accumulate errors (if any) in the original outputs. Also, the EMA consistency loss cannot generate meaningful consistency measures if computed on the same data or its trivial augmentations. Note a strong data augmentation is not always beneficial in all noisy label learning methods since it can increase the uncertainty in the presence of wrong labels, making the detection of clean data and noise correction more challenging. For example, we tried applying RandAugment to MentorMix (using the official implementations of both) but observed inferior performance compared to the results using its original data augmentations.
|
| 387 |
+
|
| 388 |
+
• Class balance regularization is useful for the very high noise rate setting $( 8 0 \% )$ , in which a wrong label may dominate the learning on a mini-batch by a large chance. However, when the noise rate is not that high (e.g., $60 \%$ on CIFAR10), removing it results in better performance.
|
| 389 |
+
|
| 390 |
+
• Although Mix-Up has been proved effective in previous methods, and for this reason, we followed MentorMix by starting with a relatively strong Mix-Up $( a l p h a = 8 . 0 $ ) and then gradually reducing it to $\alpha = 0 . 2$ . In the ablation study, we find that completely removing Mix-Up significantly improves performance. Mix-Up is helpful when applied to mix a clean label with a noisy label since the latter can be mediated with the former and thus softened. However, this is rarely the case for RoCL since RoCL either mainly learns from clean data or wrongly-labeled data with correct pseudo labels, and the transition between the two phases is short. When applied to two correct labels/pseudo labels, Mix-Up weakens each label’s confidence, and we may lose information from the inter-class probabilities in the soft pseudo labels.
|
| 391 |
+
|
| 392 |
+
• Replacing weighted sampling with top-k selection (“no RandSampling”) or replacing EMA metrics with instantaneous metrics (“no EMA metrics”) causes less degeneration on the final test accuracies. However, they are important to the early-stage exploration and accurate estimation of EMA metrics on less-visited samples. In Figure 7-10, these two variants usually suffer from low accuracy and convergence speed during early stages. The only exception is “no RandSampling” in Figure 10, which performs better than the original RoCL. A possible reason is that the randomness brought by high uniform label noises already bring sufficient randomness for exploration.
|
| 393 |
+
|
| 394 |
+
• Replacing $p _ { t } ( i ) , q _ { t } ( i )$ or both with uniform probabilities over all samples reduces the final test accuracies in all cases, e.g., the degradation is significant on CIFAR100 with $80 \%$ noise. In Figure 7-10, we can see that by setting $q _ { t } ( i ) = 1 / n$ results in less degradation than the other two. This is due to the more accurate pseudo labels generated for more data (even the ones with larger EMA consistency loss) as training proceeds. Moreover, since we are conservative in setting $\lambda _ { T }$ and $\tau _ { T }$ , the performance is not very sensitive to wrong pseudo labels.
|