Datasets:
Add files using upload-large-folder tool
Browse files- md/train/6YEQUn0QICG/6YEQUn0QICG.md +578 -0
- md/train/74RmfBweB60/74RmfBweB60.md +362 -0
- md/train/8dqEeFuhgMG/8dqEeFuhgMG.md +271 -0
- md/train/B1gTShAct7/B1gTShAct7.md +0 -0
- md/train/BJgkbyHKDS/BJgkbyHKDS.md +458 -0
- md/train/BkMiWhR5K7/BkMiWhR5K7.md +605 -0
- md/train/Bkg6RiCqY7/Bkg6RiCqY7.md +342 -0
- md/train/ByxGSsR9FQ/ByxGSsR9FQ.md +463 -0
- md/train/HJxwDiActX/HJxwDiActX.md +318 -0
- md/train/Hke-WTVtwr/Hke-WTVtwr.md +387 -0
- md/train/SJMnG2C9YX/SJMnG2C9YX.md +298 -0
- md/train/WigDnV-_Gq/WigDnV-_Gq.md +303 -0
- md/train/de11dbHzAMF/de11dbHzAMF.md +490 -0
- md/train/fUxqIofPPi/fUxqIofPPi.md +223 -0
- md/train/r1glDpNYwS/r1glDpNYwS.md +260 -0
- md/train/r1ltgp4FwS/r1ltgp4FwS.md +351 -0
- md/train/rJXMpikCZ/rJXMpikCZ.md +278 -0
- md/train/rklklCVYvB/rklklCVYvB.md +350 -0
- md/train/rkxoNnC5FQ/rkxoNnC5FQ.md +303 -0
- md/train/rytstxWAW/rytstxWAW.md +522 -0
md/train/6YEQUn0QICG/6YEQUn0QICG.md
ADDED
|
@@ -0,0 +1,578 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEDBN: FEDERATED LEARNING ON NON-IID FEATURES VIA LOCAL BATCH NORMALIZATION
|
| 2 |
+
|
| 3 |
+
Xiaoxiao Li
|
| 4 |
+
Department of Computer Science Princeton University
|
| 5 |
+
xiaoxiao.li@aya.yale.edu
|
| 6 |
+
|
| 7 |
+
Meirui Jiang Department of Computer Science and Engineering The Chinese University of Hong Kong mrjiang@cse.cuhk.edu.hk
|
| 8 |
+
|
| 9 |
+
Xiaofei Zhang Department of Statistics Iowa State University xfzhang@iastate.edu
|
| 10 |
+
|
| 11 |
+
Michael Kamp
|
| 12 |
+
Dept of Data Science and AI, Faculty of IT
|
| 13 |
+
Monash University
|
| 14 |
+
michael.kamp@monash.edu
|
| 15 |
+
Qi Dou∗
|
| 16 |
+
Department of Computer Science and Engineering
|
| 17 |
+
The Chinese University of Hong Kong
|
| 18 |
+
qdou@cse.cuhk.edu.hk
|
| 19 |
+
|
| 20 |
+
# ABSTRACT
|
| 21 |
+
|
| 22 |
+
The emerging paradigm of federated learning (FL) strives to enable collaborative training of deep models on the network edge without centrally aggregating raw data and hence improving data privacy. In most cases, the assumption of independent and identically distributed samples across local clients does not hold for federated learning setups. Under this setting, neural network training performance may vary significantly according to the data distribution and even hurt training convergence. Most of the previous work has focused on a difference in the distribution of labels or client shifts. Unlike those settings, we address an important problem of FL, e.g., different scanners/sensors in medical imaging, different scenery distribution in autonomous driving (highway vs. city), where local clients store examples with different distributions compared to other clients, which we denote as feature shift non-iid. In this work, we propose an effective method that uses local batch normalization to alleviate the feature shift before averaging models. The resulting scheme, called FedBN, outperforms both classical FedAvg, as well as the state-of-the-art for non-iid data (FedProx) on our extensive experiments. These empirical results are supported by a convergence analysis that shows in a simplified setting that FedBN has a faster convergence rate than FedAvg. Code is available at https://github.com/med-air/FedBN.
|
| 23 |
+
|
| 24 |
+
# 1 INTRODUCTION
|
| 25 |
+
|
| 26 |
+
Federated learning (FL), has gained popularity for various applications involving learning from distributed data. In FL, a cloud server (the “server”) can communicate with distributed data sources (the “clients”), while the clients hold data separately. A major challenge in FL is the training data statistical heterogeneity among the clients (Kairouz et al., 2019; Li et al., 2020b). It has been shown that standard federated methods such as FedAvg (McMahan et al., 2017) which are not designed particularly taking care of non-iid data significantly suffer from performance degradation or even diverge if deployed over non-iid samples (Karimireddy et al., 2019; Li et al., 2018; 2020a).
|
| 27 |
+
|
| 28 |
+
Recent studies have attempted to address the problem of FL on non-iid data. Most variants of FedAvg primarily tackle the issues of stability, client drift and heterogeneous label distribution over clients (Li et al., 2020b; Karimireddy et al., 2019; Zhao et al., 2018). Instead, we focus on the shift in the feature space, which has not yet been explored in the literature. Specifically, we consider that local data deviates in terms of the distribution in feature space, and identify this scenario as feature shift. This type of non-iid data is a critical problem in many real-world scenarios, typically in cases where the local devices are responisble for a heterogeneity in the feature distributions. For example in cancer diagnosis tasks, medical radiology images collected in different hospitals have uniformly distributed labels (i.e., the cancer types treated are quite similar across the hospitals). However, the image appearance can vary a lot due to different imaging machines and protocols used in hospitals, e.g., different intensity and contrast. In this example, each hospital is a client and hospitals aim to collaboratively train a cancer detection model without sharing privacy-sensitive data.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 1: Training error on local datasets for two clients respectively with and w/o BN, where BN harmonizes the loss surface.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 2: Error surface of a client for model parameter $w \in [ 0 . 0 0 1 , 1 2 ]$ and BN parameter $\gamma \in [ 0 . 0 0 1 , 4 ]$ . Averaging model and BN parameters leads to worse solutions.
|
| 35 |
+
|
| 36 |
+
Tackling non-iid data with feature shift has been explored in classical centralized training in the context of domain adaptation. Here, an effective approach in practice is utilizing Batch Normalization (BN) (Ioffe & Szegedy, 2015): recent work has proposed BN as a tool to mitigate domain shifts in domain adaptation tasks with promising results achieved (Li et al., 2016; Liu et al., 2020; Chang et al., 2019). Inspired by this, this paper proposes to apply BN for feature shift FL. To illustrate the idea, we present a toy example that illustrates how BN may help harmonizing local feature distributions.
|
| 37 |
+
|
| 38 |
+
Observation of BN in a FL Toy Example: We consider a simple non-convex learning problem: we generate data $x , y \in \mathbb { R }$ with $y = \cos ( w _ { t r u e } x ) + \epsilon$ , where $x \in \mathbb { R }$ is drawn iid from Gaussian distribution and $\epsilon$ is zero-mean Gaussian noise and consider models of the form $f _ { w } ( x ) = \cos ( w x )$ with model parameter $w \in \mathbb { R }$ . Local data deviates in the variance of $x$ . First, we illustrate that local batch normalization harmonizes local data distributions. We consider a simplified form of BN that normalizes the input by scaling it with $\gamma _ { : }$ , i.e., the local empirical standard deviation, and a setting with 2 clients. As Fig. 1 shows, the local squared loss is very different between the two clients. Thus, averaging the model does not lead to a good model. However when applying local BN, the local training error surfaces become similar and averaging the models can be beneficial. To further illustrate the impact of BN, we plot the error surface for one client with respect to both model parameter $w \in \mathbb { R }$ and BN parameter $\gamma \in \mathbb { R }$ in Fig. 2. The figure shows that for an optimal weight $w _ { 1 } ^ { * }$ , changing $\gamma$ deteriorates the model quality. Similarly, for a given optimal BN parameter $\gamma _ { 1 } ^ { * }$ , changing $w$ deteriorates the quality. In particular, the average model $\overline { { w } } \overset { \cdot } { = } ( w _ { 1 } ^ { * } + \overset { \cdot } { w } _ { 2 } ^ { * } ) / 2$ and average BN parameters $\overline { { \gamma } } = ( \gamma _ { 1 } ^ { * } + \gamma _ { 2 } ^ { * } ) / 2$ has a high generalization error. At the same time, the average model $\overline { { w } }$ with local BN parameter $\gamma _ { 1 } ^ { * }$ performs very well.
|
| 39 |
+
|
| 40 |
+
Motivated by the above insight and observation, this paper proposes a novel federated learning method, called FedBN, for addressing non-iid training data which keeps the client BN layers updated locally, without communicating, and aggregating them at the server. In practice, we can simply update the non-BN layers using FedAvg, without modifying any optimization or aggregation scheme. This approach has zero parameters to tune, requires minimal additional computational resources, and can be easily applied to arbitrary neural network architectures with BN layers in FL. Besides the benefit shown in the toy example, we also show the benefits in accelerating convergence by theoretically analyzing the convergence of FedBN in the over-parameterized regime. In addition, we have conducted extensive experiments on a benchmark and three real-world datasets. Compared to classical FedAvg, as well as the state-of-the-art for non-iid data (FedProx), our novel method, FedBN, demonstrates significant practical improvements on the extensive experiments.
|
| 41 |
+
|
| 42 |
+
# 2 RELATED WORK
|
| 43 |
+
|
| 44 |
+
Techniques for Non-IID Challenges in Federated Learning: The widely known aggregation strategy in FL, FedAvg (McMahan et al., 2017), often suffers when data is heterogeneous over local client. Empirical work addressing non-iid issues, mainly focus on label distribution skew, where a non-iid dataset is formed by partitioning a “flat” existing dataset based on the labels. FedProx (Li et al., 2020b), a recent framework tackled the heterogeneity by allowing partial information aggregation and adding a proximal term to FedAvg. Zhao et al. (2018) assumed a subset of the data is globally shared between all the clients, hence generalizes to the problem at hand. FedMA (Wang et al., 2020) proposed an aggregation strategy for non-iid data partition that shares global model in a layer-wise manner. However, so far there are only limited attempts considering non-iid induced from feature shift, which is common in medical data collecting from different equipment and natural image collected in various noisy environment. Very recently, FedRobust (Reisizadeh et al., 2020) assumes data follows an affine distribution shift and tackles this problem by learning the affine transformation. This hampers the generalization when we cannot estimate the explicit affine transformation. Concurrently to our work, SiloBN Andreux et al. (2020) empirically shows that local clients keeping some untrainable BN parameters could improve robustness to data heterogeneity, but provides no theoretical analysis of the approach. FedBN instead keeps all BN parameters strictly local. Recently, an orthogonal approach to the non-iid problem has been proposed that focuses on improving the optimization mechanism (Reddi et al., 2020; Zhang et al., 2020).
|
| 45 |
+
|
| 46 |
+
Batch Normalization in Deep Neural Networks: Batch Normalization (Ioffe & Szegedy, 2015) is an indispensable component in many deep neural networks and has shown its success in neural network training. Relevant literature has uncovered a number of benefits given by batch normalization. Santurkar et al. (2018) showed that BN makes the optimization landscape significantly smoother. Luo et al. (2018) investigated an explicit regularization form of BN such that improving the robustness of optimization. Morcos et al. (2018) suggested that BN implicitly discourages single direction reliance, thus improving model generalizability. Li et al. (2018) took advantage of BN for tackling the domain adaptation problem. However, what a role BN is playing in the scope of federated learning, especially for non-iid training, still remains unexplored to date.
|
| 47 |
+
|
| 48 |
+
# 3 PRELIMINARY
|
| 49 |
+
|
| 50 |
+
Non-IID Data in Federated Learning: We introduce the concept of feature shift in federated learning as a novel category of client’s non-iid data distribution. So far, the categories of non-iid data considered according to Kairouz et al. (2019); Hsieh et al. (2019) can be described by the joint probability between features $\mathbf { x }$ and labels $y$ on each client. We can rewrite $P _ { i } ( \mathbf { x } , y )$ as $P _ { i } ( y | \mathbf { x } ) P _ { i } ( \mathbf { x } )$ and $P _ { i } ( { \bf x } | y ) P _ { i } ( y )$ . We define feature shift as the case that covers: 1) covariate shift: the marginal distributions $P _ { i } ( { \bf x } )$ varies across clients, even if $P _ { i } ( y | \mathbf { x } )$ is the same for all client; and 2) concept shift: the conditional distribution $P _ { i } ( \mathbf { x } | y )$ varies across clients and $P ( y )$ is the same.
|
| 51 |
+
|
| 52 |
+
Federated Averaging (FedAvg): We establish our algorithm on FedAvg introduced by McMahan et al. (2017) which is the most popular existing and easiest to implement federated learning strategy, where clients collaboratively send updates of locally trained models to a global server. Each client runs a local copy of the global model on its local data. The global model’s weights are then updated with an average of local clients’ updates and deployed back to the clients. This builds upon previous distributed learning work by not only supplying local models but also performing training locally on each device. Hence FedAvg potentially empowers clients (especially clients with small dataset) to collaboratively learn a shared prediction model while keeping all training data locally. Although FedAvg has shown successes in classical Federated Learning tasks, it suffers from slow convergence and low accuracy in most non-iid contents (Li et al., 2020b; 2019).
|
| 53 |
+
|
| 54 |
+
# 4 FEDERATED AVERAGING WITH LOCAL BATCH NORMALIZATION
|
| 55 |
+
|
| 56 |
+
# 4.1 PROPOSED METHOD - FEDBN
|
| 57 |
+
|
| 58 |
+
We propose an efficient and effective learning strategy denoted FedBN. Similar to FedAvg, FedBN performs local updates and averages local models. However, FedBN assumes local models have BN layers and excludes their parameters from the averaging step. We present the full algorithm in Appendix C. This simple modification results in significant empirical improvements in non-iid settings. We provide an explanation for these improvements in a simplified scenario, in which we show that FedBN improves the convergence rate under feature shift.
|
| 59 |
+
|
| 60 |
+
# 4.2 PROBLEM SETUP
|
| 61 |
+
|
| 62 |
+
We assume $N \in \mathbb { N }$ clients to jointly train for $T \in \mathbb { N }$ epochs and to communicate after $E \in \mathbb { N }$ local iterations. Thus, the system has $T / _ { E }$ communication rounds over the $T$ epochs. For simplicity, we assume all clients to have $M \in \mathbb { N }$ training examples (a difference in training examples can be account for by weighted averaging (McMahan et al., 2017)) for a regression task, i.e., each client $i \in [ N ] \left( [ N ] \right) = \{ 1 , \cdot \cdot . . , N \} )$ has training examples $\{ ( \mathbf { x } _ { j } ^ { i } , \boldsymbol { y } _ { j } ^ { i } ) \in \mathbb { R } ^ { d } { \times } \mathbb { R } : j \in [ M ] \}$ . Furthermore, we assume a two-layer neural network with ReLU activations trained by gradient descent. Let $\mathbf { v } _ { k } \in \mathbb { R } ^ { d }$ denote the parameters of the first layer, where $k \in [ m ]$ and $m$ is the width of the hidden layer. Let $\| \mathbf { v } \| \mathbf { s } \triangleq \sqrt { \mathbf { v } ^ { \top } \mathbf { S } \mathbf { v } }$ denote the induced vector norm for a positive definite matrix S.
|
| 63 |
+
|
| 64 |
+
We consider a non-iid setting in FL where local feature distributions differ—not label distribution, as considered, e.g., in McMahan et al. (2017); Li et al. (2019). To be more precise, we make the following assumption.
|
| 65 |
+
|
| 66 |
+
Assumption 4.1 (Data Distribution). For each client $i \in [ N ]$ the inputs $\mathbf { x } _ { j } ^ { i }$ are centered $\left( \mathbb { E } \mathbf { x } ^ { i } = \mathbf { 0 } \right)$ ) with covariance matrix $\mathbf { S } _ { i } = \mathbb { E } \mathbf { x } ^ { i } \mathbf { x } ^ { i \top }$ , where $\mathbf { S } _ { i }$ is independent from the label y and may differ for each $i \in [ N ]$ e.g., $\mathbf { S } _ { i }$ are not all identity matrices, and for each index pair $p \neq q$ , $\mathbf { x } _ { p } \neq \boldsymbol { \kappa } \cdot \mathbf { x } _ { q }$ for all $\kappa \in \mathbb { R } \backslash \{ 0 \}$ .
|
| 67 |
+
|
| 68 |
+
With Assumption 4.1, the normalization of the first layer for client $i$ is $\frac { \mathbf { v } _ { k } ^ { \top } \mathbf { x } ^ { i } } { \| \mathbf { v } _ { k } \| _ { \mathbf { s } _ { i } } }$ . FedBN with clientspecified BN parameters trains a model $f ^ { * } : \mathbb { R } ^ { d } \mathbb { R }$ parameterized by $\mathbf { \bar { \Phi } } ( \mathbf { V } , \gamma , \mathbf { c } ) \ \in \ \mathbb { R } ^ { m \times d } \ \times$ $\mathbf { \varmathbb { R } } ^ { m \times N } \times \mathbf { \varmathbb { R } } ^ { m }$ , i.e.,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
f ^ { * } ( { \bf x } ; { \bf V } , \gamma , { \bf c } ) = \frac { 1 } { \sqrt { m } } \sum _ { k = 1 } ^ { m } c _ { k } \sum _ { i = 1 } ^ { N } \sigma \left( \gamma _ { k , i } \cdot \frac { { \bf v } _ { k } ^ { \top } { \bf x } } { \| { \bf v } _ { k } \| _ { { \bf s } _ { i } } } \right) \cdot \mathbb { 1 } \left\{ { \bf x } \in \mathrm { c l i e n t ~ } i \right\} ~ ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\gamma$ is the scaling parameter of BN and $\sigma ( s ) = \operatorname* { m a x } \{ s , 0 \}$ is the ReLU activation function, $\mathbf { c }$ is the top layer parameters of the network. Here, we omit learning the shift parameter of $\mathbf { B N } ^ { 1 }$ . FedAvg instead trains a function $f : { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ which is a special case of Eq. 1 with $\gamma _ { k , i } = \gamma _ { k }$ for $\forall i \in [ N ]$ . We take a random initialization of the parameters (Salimans $\&$ Kingma, 2016) in our analysis:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \mathbf { v } _ { k } ( 0 ) \sim N \left( 0 , \alpha ^ { 2 } \mathbf { I } \right) , \quad c _ { k } \sim U \{ - 1 , 1 \} , \quad \mathrm { a n d } \quad \gamma _ { k } = \gamma _ { k , i } = \| \mathbf { v } _ { k } ( 0 ) \| _ { 2 } / \alpha , } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\alpha ^ { 2 }$ controls the magnitude of $\mathbf { v } _ { k }$ at initialization. The initialization of the BN parameters $\gamma _ { k }$ and $\gamma _ { k , i }$ are independent of $\alpha$ . The parameters of the network $f ^ { * } ( \mathbf { x } ; \mathbf { V } , \gamma , \mathbf { c } )$ are obtained by minimizing the empirical risk with respect to the squared loss using gradient descent :
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
L ( f ^ { * } ) = \frac { 1 } { N M } \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { M } \left( f ^ { * } ( \mathbf { x } _ { j } ^ { i } ) - y _ { j } ^ { i } \right) ^ { 2 } .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
# 4.3 CONVERGENCE ANALYSIS
|
| 87 |
+
|
| 88 |
+
Here we study the trajectory of networks FedAvg $( f )$ and FedBN $( f ^ { * } )$ ’s prediction through the neural tangent kernel (NTK) introduced by Jacot et al. (2018). Recent machine learning theory
|
| 89 |
+
|
| 90 |
+
studies (Arora et al., 2019; Du et al., 2018; Allen-Zhu et al., 2019; van den Brand et al., 2020; Dukler et al., 2020) have shown that for finite-width over-parameterized networks, the convergence rate is controlled by the least eigenvalue of the induced kernel in the training evolution.
|
| 91 |
+
|
| 92 |
+
To simplify tracing the optimization dynamics, we consider the case that the number of local updates $E$ is 1. We can decompose the NTK into a magnitude component $\mathbf G ( t )$ and direction component $\mathbf { V } ( t ) / \alpha ^ { 2 }$ following Dukler et al. (2020):
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
{ \frac { d \mathbf { f } } { d t } } = - \mathbf { \nabla } \mathbf { A } ( t ) ( \mathbf { f } ( t ) - \mathbf { y } ) , \quad { \mathrm { w h e r e } } \quad \mathbf { \nabla } \mathbf { \mathbf { A } } ( t ) : = { \frac { \mathbf { V } ( t ) } { \alpha ^ { 2 } } } + \mathbf { G } ( t ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
The specific forms of $\mathbf { V } ( t )$ and $\mathbf G ( t )$ are given in Appendix B.1. Let $\lambda _ { m i n } ( A )$ denote the minimal eigenvalue of matrix $A$ . The matrices $\mathbf { V } ( t )$ and $\mathbf G ( t )$ are positive semi-definite, since they can be viewed as covariance matrices. This gives $\lambda _ { \operatorname* { m i n } } ( \mathbf { \boldsymbol { \Lambda } } ( t ) ) \ge \operatorname* { m a x } \left\{ \lambda _ { \operatorname* { m i n } } ( \mathbf { \boldsymbol { V } } ( t ) ) / \alpha ^ { 2 } , \lambda _ { \operatorname* { m i n } } ( \mathbf { \boldsymbol { G } } ( t ) ) \right\}$ . According to NTK, the convergence rate is controlled by $\lambda _ { m i n } ( \pmb { \Lambda } ( t ) \ )$ . Then, for $\alpha > 1$ , convergence is dominated by $\mathbf G ( t )$ . Let $\mathbf { \boldsymbol { \Lambda } } ( t )$ and $\mathbf { \boldsymbol { \Lambda } } ^ { * } ( t )$ denote the evolution dynamics of FedAvg and FedBN and let $\mathbf G ( t )$ and $\mathbf { G } ^ { * } ( t )$ denote the magnitude component in the evolution dynamics of FedAvg and FedBN. For the convergence analysis, we use the auxiliary version of the Gram matrices, which is defined as follows.
|
| 99 |
+
|
| 100 |
+
Definition 4.2. Given sample points $\{ \mathbf { x } _ { p } \} _ { p = 1 } ^ { N M }$ , we define the auxiliary Gram matrices ${ \bf G } ^ { \infty } \in$ $\mathbb { R } ^ { N M \times N M }$ and $\mathbf { G } ^ { \ast \infty } \in \mathbb { R } ^ { N M \times N M }$ as
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r l } & { \mathbf { G } _ { p q } ^ { \infty } : = \mathbb { E } _ { \mathbf { v } \sim N ( 0 , \alpha ^ { 2 } \mathbf { I } ) } \sigma \left( \mathbf { v } ^ { \top } \mathbf { x } _ { p } \right) \sigma \left( \mathbf { v } ^ { \top } \mathbf { x } _ { q } \right) , ~ ( F e d A \nu g ) } \\ & { \mathbf { G } _ { p q } ^ { * \infty } : = \mathbb { E } _ { \mathbf { v } \sim N ( 0 , \alpha ^ { 2 } \mathbf { I } ) } \sigma \left( \mathbf { v } ^ { \top } \mathbf { x } _ { p } \right) \sigma \left( \mathbf { v } ^ { \top } \mathbf { x } _ { q } \right) \mathbb { 1 } \{ i _ { p } = i _ { q } \} , ~ ( F e d B N ) . } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Given Assumption 4.1, we use the key results in Dukler et al. (2020) to show that $\mathbf { G } ^ { \infty }$ is positive definite. Further, we show that $\mathbf { G } ^ { * \infty }$ is positive definite. We use the fact that the distance between $\mathbf G ( t )$ and its auxiliary version is small in over-parameterized neural network, such that $\mathbf G ( t )$ remains positive definite.
|
| 107 |
+
|
| 108 |
+
Lemma 4.3. Fix points $\{ \mathbf { x } _ { p } \} _ { p = 1 } ^ { N M }$ satisfying Assumption 4.1. Then Gram matrices $\mathbf { G } ^ { \infty }$ and $\mathbf { G } ^ { * \infty }$ defined as in (4) and (5) are strictly positive definite. Let the least eigenvalues be $\lambda _ { \operatorname* { m i n } } ( \mathbf G ^ { \infty } ) = : \mu _ { 0 }$ and $\lambda _ { \operatorname* { m i n } } ( \mathbf G ^ { * \infty } ) = : \mu _ { 0 } ^ { * }$ , where $\mu _ { 0 } , \mu _ { 0 } ^ { * } > 0$ .
|
| 109 |
+
|
| 110 |
+
Proof sketch The main idea follows Du et al. (2018); Dukler et al. (2020), that given points $\{ \mathbf { x } _ { p } \} _ { p = 1 } ^ { N M }$ , the matrices . More details $\mathbf { G } ^ { \infty }$ and e pr $\mathbf { G } ^ { * \infty }$ can be shown as covariance matrix of linearly independente given in the Appendix B.2.
|
| 111 |
+
|
| 112 |
+
Based on our formulation, the convergence rate of FedAvg (Theorem 4.4) can be derived from Dukler et al. (2020) by considering non-identical covariance matrices. We derive the convergence rate of FedBN in Corollary 4.5. Our key result of comparing the convergence rates between FedAvg and FedBN is culminated in Corollary 4.6.
|
| 113 |
+
|
| 114 |
+
Theorem 4.4 (G-dominated convergence for FedAvg Dukler et al. (2020)). Suppose network (4) is initialized as in (2) with $\alpha > 1$ , trained using gradient descent and Assumptions 4.1 holds. Given the loss function of training the neural network is the square loss with targets y satisfying $\| \mathbf { y } \| _ { \infty } = O ( 1 )$ . If $m = \Omega$ ma $\mathrm { x } \left\{ \tilde { N ^ { 4 } } M ^ { 4 } \log ( N M / \delta ) / \alpha ^ { 4 } \mu _ { 0 } ^ { 4 } , \hat { N ^ { 2 } } M ^ { 2 } \log ( N M / \delta ) \tilde { / } \mu _ { 0 } ^ { 2 } \right\} \nonumber$ , then with probability $1 - \delta$ ,
|
| 115 |
+
|
| 116 |
+
1. For iterations $t = 0 , 1 , \cdots$ , the evolution matrix $\Lambda ( t )$ satisfies $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { A } ( t ) ) \geq \frac { \mu _ { 0 } } { 2 } } \end{array}$
|
| 117 |
+
|
| 118 |
+
2. Training with gradient descent of step-size $\begin{array} { r } { \eta = O \left( \frac { 1 } { \left. \mathbf { A } \left( t \right) \right. } \right) } \end{array}$ converges linearly as
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\| \mathbf { f } ( t ) - \mathbf { y } \| _ { 2 } ^ { 2 } \leq \Big ( 1 - \frac { \eta \mu _ { 0 } } { 2 } \Big ) ^ { t } \| \mathbf { f } ( 0 ) - \mathbf { y } \| _ { 2 } ^ { 2 } .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Following the key ideas in Dukler et al. (2020), here we further characterize the convergence for FedBN.
|
| 125 |
+
|
| 126 |
+
Corollary 4.5 ( $\mathbf { G }$ -dominated convergence for FedBN). Suppose network (5) and all other conditions in Theorem 4.4. With probability $1 - \delta$ , for iterations $t = 0 , 1 , \cdots$ , the evolution matrix $\mathbf { \boldsymbol { \Lambda } } ^ { * } ( t )$ satisfies $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { A } ^ { * } ( t ) ) \geq \frac { \mu _ { 0 } ^ { * } } { 2 } } \end{array}$ and training with gradient descent of step-size $\begin{array} { r } { \eta = O \left( \frac { 1 } { \left. \mathbf { 1 } ^ { * } \left( t \right) \right. } \right) } \end{array}$ converges linearly as $\begin{array} { r } { \| \mathbf { f } ^ { * } ( t ) - \mathbf { y } \| _ { 2 } ^ { 2 } \leq \left( 1 - \frac { \eta \mu _ { 0 } ^ { * } } { 2 } \right) ^ { t } \| \mathbf { f } ^ { * } ( 0 ) - \mathbf { y } \| _ { 2 } ^ { 2 } . } \end{array}$
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 3: Convergence of the training loss of FedBN and FedAvg on the digits classification datasets. FedBN exhibits faster and more robust convergence.
|
| 130 |
+
|
| 131 |
+
The exponential factor of convergence for FedAvg $( 1 - \eta \mu _ { 0 } / 2 )$ and FedBN $( 1 - \eta \mu _ { 0 } ^ { * } / 2 )$ are controlled by the smallest eigenvalue of $\mathbf G ( t )$ , respectively $\mathbf { G } ^ { * } ( t )$ . Then we can analyze the convergence performance of FedAvg and FedBN by comparing $\lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { \infty } )$ and $\lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { * \infty } )$ .
|
| 132 |
+
|
| 133 |
+
Corollary 4.6 (Convergence rate comparison between FedAvg and FedBN). For the G-dominated convergence, the convergence rate of FedBN is faster than that of FedAvg.
|
| 134 |
+
|
| 135 |
+
Proof sketch The key is to show $\lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { \infty } ) \leq \lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { * \infty } )$ . Comparing equation (4) and (5), $\mathbf { G } ^ { * \infty }$ takes the $M \times M$ block matrices on the diagonal of $\mathbf { G } ^ { \infty }$ . Let $\mathbf { G } _ { i } ^ { \infty }$ be the $i$ -th $M \times M$ block matrices on the diagonal of $\mathbf { G } ^ { \infty }$ . By linear algebra, $\lambda _ { \operatorname* { m i n } } ( \mathbf { G } _ { i } ^ { \infty } ) \geq \lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { \infty } )$ for $i \in [ N ]$ . Since $\mathbf { G } ^ { * \infty } = d i a g ( \mathbf { G } _ { 1 } ^ { \infty } , \cdot \cdot \cdot , \mathbf { G } _ { N } ^ { \infty } )$ , we have $\begin{array} { r } { \lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { * \infty } ) = \operatorname* { m i n } _ { i \in [ N ] } \left\{ \lambda _ { \operatorname* { m i n } } ( \mathbf { G } _ { i } ^ { \infty } ) \right\} } \end{array}$ . Therefore, we have the result $\lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { * \infty } ) \geq \lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { \infty } )$ .
|
| 136 |
+
|
| 137 |
+
# 5 EXPERIMENTS
|
| 138 |
+
|
| 139 |
+
In this section, we demonstrate that using local BN parameters is beneficial in the presence of feature shift across clients with heterogeneity data. Our novel local parameter sharing strategy, FedBN, achieves more robust and faster convergence for feature shift non-iid datasets and obtains better model performance compared to alternative methods. This is shown on both benchmark and large real-world datasets.
|
| 140 |
+
|
| 141 |
+
# 5.1 BENCHMARK EXPERIMENTS
|
| 142 |
+
|
| 143 |
+
Settings: We perform an extensive empirical analysis using a benchmark digits classification task containing different data sources with feature shift where each dataset is from a different domain. Data of different domains have heterogeneous appearance but share the same labels and label distribution. Specifically, we use the following five datasets: SVHN Netzer et al. (2011), USPS Hull (1994), SynthDigits Ganin & Lempitsky (2015), MNIST-M Ganin & Lempitsky (2015) and MNIST LeCun et al. (1998). To match the setup in Section 4, we truncate the sample size of the five datasets to their smallest number with random sampling, resulting in 7438 training samples in each dataset 2. Testing samples are held out and kept the same for all the experiments on this benchmark dataset. Our classification model is a convolutional neural network where BN layers are added following each feature extraction layer (i.e., both convolutional and fully-connected). The architecture is detailed in Appendix D.2. For model training, we use the cross-entropy loss and SGD optimizer with a learning rate of $1 0 ^ { - 2 }$ . If not specified, our default setting for local update epochs is $E = 1$ , and the default setting for the amount of data at each client is $1 0 \%$ 3 of the dataset original size. For the default non-iid setting, the FL system contains five clients. Each client exclusively owns data sampled from one of the five datasets. More details are listed in Appendix D.2.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 4: Analytical experimental results on: (a) Analysis on different local updating epochs. FedBN consistently outperforms FedAvg in testing accuracy. (b) Model performance over varying dataset size on local clients. (c) Testing accuracy on different levels of heterogeneity.
|
| 147 |
+
|
| 148 |
+
Overviews: In the following paragraphs, we present a comprehensive investigation on the properties of the proposed FedBN approach, including: (1) convergence rate; (2) behavior with respect to the choices of local update epochs; (3) performance on various amounts of data at each client; (4) effects at different level of heterogeneity; (5) comparison to state of the art (FedProx (Li et al., 2020b)), and two baselines (FedAvg and SingleSet, i.e., training an individual model within each client). In Appendix G, we also provide empirical results for including a new client with data from an unknown domain into the learning system.
|
| 149 |
+
|
| 150 |
+
Convergence Rate: We analyze the training loss curve of FedBN in comparison with FedAvg, as shown in Fig. 3. The loss of FedBN goes down faster and smoother than FedAvg, indicating that FedBN has a larger convergence rate. Moreover, compared to FedAvg, FedBN presents smoother and more stable loss curves during learning. These experimental observations show consensus with what given by Corollary 4.6. In addition, we present a more comprehensive comparison with different local update epochs $E$ on convergence rate of FedBN and FedAvg (see Appendix E.1). The results show similar patterns as in Fig 3.
|
| 151 |
+
|
| 152 |
+
Analysis of Local Updating Epochs: Aggregating at different frequencies may affect the learning behaviour. Although our theory and the default setting for the other experiment takes $E = 1$ , we demonstrate FedBN is effective for cases when $E > 1$ . In Fig.4 (a), we explore $E = 1 , 4 , 8 , 1 6$ and compare FedBN to baseline FedAvg. As expected, an inverse relationship between the local updating epochs $E$ and testing accuracy implied for both FedBN and FedAvg shown in Fig.4 (a). Zooming into the final testing accuracy, FedBN’s accuracy stably exceeds the accuracy of FedAvg on various $E$ .
|
| 153 |
+
|
| 154 |
+
Analysis of Local Dataset Size: We vary the data amount for each client from $1 0 0 \%$ to $1 \%$ of its original dataset size, in order to observe FedBN behaviour over different data capacities at each client. The results in Fig.4 (b) present the accuracy of FedBN and SingleSet 4. Testing accuracy starts to significantly drop when each of the local client is only attributed $20 \%$ percentage of data from its original data amount. The improvement margin gained from FedBN increases as local dataset sizes decrease. The results indicate that FedBN can effectively benefit from collaborative training on distributed data, especially when each client only holds a small amount of data which are non-iid.
|
| 155 |
+
|
| 156 |
+
Effects of Statistical Heterogeneity: A salient question that arises is: to what degree of heterogeneity on feature shift FedBN is superior to FedAvg. To answer the question, we simulate a federated settings with varying heterogeneity as described below. We parcel each dataset into 10 subsets, one for each clients, with equal number of data samples and the same label distribution. We treat the clients generated from the same dataset as iid clients, while the clients generated from different datasets as non-iid clients.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Caltech-10</td><td colspan="6">DomainNet</td><td colspan="4">ABIDE (medical)</td></tr><tr><td>A</td><td>C</td><td>D</td><td>W</td><td>C</td><td>I</td><td>P</td><td>Q</td><td>R</td><td>S</td><td>NYU</td><td>USM</td><td>UM</td><td>UCLA</td></tr><tr><td>SingleSet</td><td>54.9 (1.5)</td><td>40.2 (1.6)</td><td>78.7 (1.3)</td><td>86.4 (2.4)</td><td>41.0 (0.9)</td><td>23.8 (1.2)</td><td>36.2 (2.7)</td><td>73.1 (0.9)</td><td>48.5 (1.9)</td><td>34.0 (1.1)</td><td>58.0 (3.3)</td><td>73.4 (2.2)</td><td>64.3 (1.4)</td><td>57.3 (2.4)</td></tr><tr><td>FedAvg</td><td>54.1 (1.1)</td><td>44.8 (1.0)</td><td>66.9 (1.5)</td><td>85.1 (2.9)</td><td>48.8 (1.9)</td><td>24.9 (0.7)</td><td>36.5 (1.1)</td><td>56.1 (1.6)</td><td>46.3 (1.4)</td><td>36.6 (2.5)</td><td>62.7 (1.7)</td><td>73.1 (2.4)</td><td>70.7 (0.5)</td><td>64.7 (0.7)</td></tr><tr><td>FedProx</td><td>54.2 (2.5)</td><td>44.5 (0.5)</td><td>65.0 (3.6)</td><td>84.4 (1.7)</td><td>48.9 (0.8)</td><td>24.9 (1.0)</td><td>36.6 (1.8)</td><td>54.4 (3.1)</td><td>47.8 (0.8)</td><td>36.9 (2.1)</td><td>63.3 (1.0)</td><td>73.0 (1.8)</td><td>70.5 (1.1)</td><td>64.5 (1.2)</td></tr><tr><td>FedBN</td><td>63.0 (1.6)</td><td>45.3 (1.5)</td><td>83.1 (2.5)</td><td>90.5 (2.3)</td><td>51.2 (1.4)</td><td>26.8 (0.5)</td><td>41.5 (1.4)</td><td>71.3 (0.7)</td><td>54.8 (0.8)</td><td>42.1 (1.3)</td><td>65.6 (1.1)</td><td>75.1 (1.4)</td><td>68.6 (2.9)</td><td>65.5 (1.0)</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 1: We report results on three different real-world datasets with format mean(std) from 5-trial run. For Office-Caltech $1 0 , A , C , D , H$ are abbreviations for Amazon, Caltech, DSLR and WebCam, for DomainNet, $C , I , P , Q , R , i$ $s$ are abbreviations for Clipart, Infograph, Painting, Quickdraw, Real and Sketch. For ABIDE, we list the abbreviations for the clients (i.e., medical institutions).
|
| 161 |
+
|
| 162 |
+
We start with including one client from each dataset in FL system. Then, we simultaneously add one client from each datasets while keep the existing clients $n$ times, for $n \in \{ 1 , \ldots , 9 \} ^ { 5 }$ . For each setting, we train models from scratch. More clients correspond to less heterogenity. We show the testing accuracy under different level of heterogeneity in Fig. 4 (c) and include a comparison with FedAvg, which is designed for iid FL. Our FedBN achieves substantially higher testing accuracy than FedAvg over all levels of heterogeneity.
|
| 163 |
+
|
| 164 |
+
Comparison with State-of-theart: To further validate our method, we compare FedBN with one of the current state-of-the-art methods for non-iid FL, FedProx Li et al. (2020b), which also shares the benefit of easy adaptation to current FL frameworks in practice. We also include training on SingleSet and FedAvg as baselines. For each strategy, we split an independent testing datasets on clients and report the accuracy on the testing datasets. We perform 5-trial repeating experiment with different random seeds. The mean and standard deviation of the
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 5: Performance on benchmark experiments
|
| 168 |
+
|
| 169 |
+
accuracy on each dataset over trials are shown in Fig. $5 ^ { 6 }$ . From the results, we can make the following observation: (1) FedBN achieves the highest accuracy, consistently outperforming the state-of-the-art and baseline methods; (2) FedBN achieves the most significant improvements on SVHN whose image appearance is very different from others (i.e., presenting more obvious feature shift); (3) FedBN shows a smaller variance in error over multiple runs, indicating its stability.
|
| 170 |
+
|
| 171 |
+
# 5.2 EXPERIMENTS ON REAL-WORLD DATASETS
|
| 172 |
+
|
| 173 |
+
To better understand how our proposed algorithm can be beneficial in real-word feature-shift noniid, we have extensively validated the effectiveness of FedBN in comparison with other methods on three real-world datasets: image classification on Office-Caltech10 (Gong et al., 2012) with images acquired in different cameras or environments; image classification on DomainNet (Peng et al., 2019) with different image styles; and a neurodisorder diagnosis task on ABIDE I (Di Martino et al., 2014) with patients from different medical institutions7.
|
| 174 |
+
|
| 175 |
+
Datasets and Setup: (1) We conduct the classification task on natural images from OfficeCaltech10, which has four data sources composing Office-31 Saenko et al. (2010) (three data sources) and Caltech-256 datasets (one data source) Griffin et al. (2007), which are acquired using different camera devices or in different real environment with various background. Each client joining the FL system is assigned data from one of the four data sources. Thus data is non-iid across the clients. (2) Our second dataset is DomainNet, which contains natural images coming from six different data sources: Clipart, Infograph, Painting, Quickdraw, Real, and Sketch. Similar to (1), each client contains iid data from one of the data sources, but clients with different data sources have different feature distributions. (3) We include four medical institutions (NYU, USM, UM, UCLA; each is viewed as a client) from ABIDE I that collects functional brain images using different imaging equipment and protocols. We validate on a medical application for binary classification between autism spectrum disorders patients and healthy control subjects.
|
| 176 |
+
|
| 177 |
+
The Office-Caltech10 contains ten categories of objects. The DomainNet extensively contains 345 object categories and we use the top ten most common classes to form a sub-dataset for our experiments. Our classification models adopt AlexNet (Krizhevsky et al., 2012) architecture with BN added after each convolution and fully-connected layer. Before feeding into the network, all images are resized to $2 5 6 \times 2 5 6 \times 3$ . For ABIDE I, each instance is represented as a 5995-dimensional vector through brain connectome computation. We use a three-layer fully connected neural network as the classifier with the hidden layers of 16 with two BN layers after the first two fully connected layers. Same as the above benchmark, we perform 5 repeated runs for each experiment.
|
| 178 |
+
|
| 179 |
+
Results and Analysis: The experimental results are shown in Table 1 in the form of mean (std). On Office-Caltech10, FedBN significantly outperforms the state-of-the-art method of FedProx, and improves at least $6 \%$ on mean accuracy compared with all the alternative methods. On DomainNet, FedBN achieved supreme accuracy over most of the datasets. Interestingly, we find the alternative FL methods achieves comparable results with SingleSet except Quickdraw, and FedBN outperforms them over $1 0 \%$ . Surprisingly, for the above two tasks, the alternative FL strategies are ineffective in the feature shift non-iid datasets, even worse than using single client data for training for most of the clients. In ABIDE I, FedBN excell by a non-negligible margin on three clients regarding the mean testing accuracy. The results are inspiring and bring the hope of deploying FedBN to healthcare field, where data are often limited, isolated and heterogeneous on features.
|
| 180 |
+
|
| 181 |
+
# 6 CONCLUSION AND DISCUSSION
|
| 182 |
+
|
| 183 |
+
This work proposes a novel federated learning aggregation method called FedBN that keeps the local Batch Normalization parameters not synchronized with the global model, such that it mitigates feature shifts in non-IID data. We provide convergence guarantees for FedBN in realistic federated settings under the overparameterized neural networks regime, while also accounting for practical issues. In our experiments, our evaluation across a suite of federated datasets has demonstrated that FedBN can significantly improve the convergence behavior and model performance of non-IID datasets. We also demonstrate the effectiveness of FedBN in scenarios that where a new client with an unknown domain joins the FL system (see Appendix G).
|
| 184 |
+
|
| 185 |
+
FedBN is independent of the communication and aggregation strategy and thus can in practice be readily combined with different optimization algorithms, communication schemes, and aggregation techniques. The theoretical analysis of such combinations is an interesting direction for future work. We also note that since FedBN makes only lightweight modifications to FedAvg and has much flexibility to be combined with other strategies, these merits allow us to easily integrate FedBN into existing tool-kits/systems, such as Pysyft (Ryffel et al., 2018), Google TFF (Google, 2020), Flower (Beutel et al., 2020), dlplatform (Kamp & Adilova, 2020) and FedML (He et al., 2020)8.
|
| 186 |
+
|
| 187 |
+
We believe that FedBN can improve a wide range of applications such as healthcare (Rieke et al., 2020) and autonomous driving (Kamp et al., 2018). A few interesting directions for future work include analyzing what types of differences in local data can benefit from FedBN and explore the limits of FedBN. Moreover, privacy is an essential concern in FL. Invisible BN parameters in FedBN should make attacks on local data more challenging. It would be interesting to quantify the privacypreservation improvement in FedBN.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, pp. 242–252. PMLR, 2019.
|
| 192 |
+
|
| 193 |
+
Mathieu Andreux, Jean Ogier du Terrail, Constance Beguier, and Eric W Tramel. Siloed federated learning for multi-centric histopathology datasets. In Domain Adaptation and Representation Transfer, and Distributed and Collaborative Learning, pp. 129–139. Springer, 2020.
|
| 194 |
+
|
| 195 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. arXiv preprint arXiv:1901.08584, 2019.
|
| 196 |
+
|
| 197 |
+
Daniel J Beutel, Taner Topal, Akhil Mathur, Xinchi Qiu, Titouan Parcollet, and Nicholas D Lane. Flower: A friendly federated learning research framework. arXiv preprint arXiv:2007.14390, 2020.
|
| 198 |
+
|
| 199 |
+
Daniel C Castro, Jeremy Tan, Bernhard Kainz, Ender Konukoglu, and Ben Glocker. Morpho-mnist: Quantitative assessment and diagnostics for representation learning. Journal of Machine Learning Research, 20(178):1–29, 2019.
|
| 200 |
+
|
| 201 |
+
Woong-Gi Chang, Tackgeun You, Seonguk Seo, Suha Kwak, and Bohyung Han. Domain-specific batch normalization for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7354–7362, 2019.
|
| 202 |
+
|
| 203 |
+
Adriana Di Martino, Chao-Gan Yan, Qingyang Li, Erin Denio, Francisco X Castellanos, Kaat Alaerts, Jeffrey S Anderson, Michal Assaf, Susan Y Bookheimer, Mirella Dapretto, et al. The autism brain imaging data exchange: towards a large-scale evaluation of the intrinsic brain architecture in autism. Molecular psychiatry, 19(6):659, 2014.
|
| 204 |
+
|
| 205 |
+
Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv preprint arXiv:1810.02054, 2018.
|
| 206 |
+
|
| 207 |
+
Yonatan Dukler, Quanquan Gu, and Guido Montufar. Optimization theory for relu neural networks´ trained with normalization layers, 2020.
|
| 208 |
+
|
| 209 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In International conference on machine learning, pp. 1180–1189. PMLR, 2015.
|
| 210 |
+
|
| 211 |
+
Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pp. 2066–2073. IEEE, 2012.
|
| 212 |
+
|
| 213 |
+
Google. TensorFlow Federated: Machine Learning on Decentralized Data, 2020. https://www. tensorflow.org/federated.
|
| 214 |
+
|
| 215 |
+
Gregory Griffin, Alex Holub, and Pietro Perona. Caltech-256 object category dataset, 2007.
|
| 216 |
+
|
| 217 |
+
Chaoyang He, Songze Li, Jinhyun So, Mi Zhang, Hongyi Wang, Xiaoyang Wang, Praneeth Vepakomma, Abhishek Singh, Hang Qiu, Li Shen, et al. Fedml: A research library and benchmark for federated machine learning. arXiv preprint arXiv:2007.13518, 2020.
|
| 218 |
+
|
| 219 |
+
Kevin Hsieh, Amar Phanishayee, Onur Mutlu, and Phillip B Gibbons. The non-iid data quagmire of decentralized machine learning. arXiv preprint arXiv:1910.00189, 2019.
|
| 220 |
+
|
| 221 |
+
Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019.
|
| 222 |
+
|
| 223 |
+
Jonathan J. Hull. A database for handwritten text recognition research. IEEE Transactions on pattern analysis and machine intelligence, 16(5):550–554, 1994.
|
| 224 |
+
|
| 225 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 226 |
+
|
| 227 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and gen- ´ eralization in neural networks. In Advances in neural information processing systems, pp. 8571– 8580, 2018.
|
| 228 |
+
|
| 229 |
+
Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurelien Bellet, Mehdi Bennis, Arjun Nitin ´ Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
|
| 230 |
+
|
| 231 |
+
Michael Kamp and Linara Adilova. Distributed Learning Platform, 2020. https://github. com/fraunhofer-iais/dlplatform.
|
| 232 |
+
|
| 233 |
+
Michael Kamp, Linara Adilova, Joachim Sicking, Fabian Huger, Peter Schlicht, Tim Wirtz, and ¨ Stefan Wrobel. Efficient decentralized deep learning by dynamic model averaging. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 393– 409. Springer, 2018.
|
| 234 |
+
|
| 235 |
+
Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for on-device federated learning. arXiv preprint arXiv:1910.06378, 2019.
|
| 236 |
+
|
| 237 |
+
Jonas Kohler, Hadi Daneshmand, Aurelien Lucchi, Thomas Hofmann, Ming Zhou, and Klaus Neymeyr. Exponential convergence rates for batch normalization: The power of length-direction decoupling in non-convex optimization. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 806–815. PMLR, 2019.
|
| 238 |
+
|
| 239 |
+
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.
|
| 240 |
+
|
| 241 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 242 |
+
|
| 243 |
+
Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020a.
|
| 244 |
+
|
| 245 |
+
Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. In Conference on Machine Learning and Systems, 2020a, 2020b.
|
| 246 |
+
|
| 247 |
+
Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the convergence of fedavg on non-iid data. arXiv preprint arXiv:1907.02189, 2019.
|
| 248 |
+
|
| 249 |
+
Yanghao Li, Naiyan Wang, Jianping Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normalization for practical domain adaptation. arXiv preprint arXiv:1603.04779, 2016.
|
| 250 |
+
|
| 251 |
+
Yanghao Li, Naiyan Wang, Jianping Shi, Xiaodi Hou, and Jiaying Liu. Adaptive batch normalization for practical domain adaptation. Pattern Recognition, 80:109–117, 2018.
|
| 252 |
+
|
| 253 |
+
Quande Liu, Qi Dou, Lequan Yu, and Pheng Ann Heng. Ms-net: Multi-site network for improving prostate segmentation with heterogeneous mri data. IEEE Transactions on Medical Imaging, 2020.
|
| 254 |
+
|
| 255 |
+
Ping Luo, Xinjiang Wang, Wenqi Shao, and Zhanglin Peng. Towards understanding regularization in batch normalization. arXiv preprint arXiv:1809.00846, 2018.
|
| 256 |
+
|
| 257 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273–1282, 2017.
|
| 258 |
+
|
| 259 |
+
Ari S Morcos, David GT Barrett, Neil C Rabinowitz, and Matthew Botvinick. On the importance of single directions for generalization. arXiv preprint arXiv:1803.06959, 2018.
|
| 260 |
+
|
| 261 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning, 2011.
|
| 262 |
+
|
| 263 |
+
Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1406–1415, 2019.
|
| 264 |
+
|
| 265 |
+
Sashank Reddi, Zachary Charles, Manzil Zaheer, Zachary Garrett, Keith Rush, Jakub Konecnˇ y,\` Sanjiv Kumar, and H Brendan McMahan. Adaptive federated optimization. arXiv preprint arXiv:2003.00295, 2020.
|
| 266 |
+
|
| 267 |
+
Amirhossein Reisizadeh, Farzan Farnia, Ramtin Pedarsani, and Ali Jadbabaie. Robust federated learning: The case of affine distribution shifts. arXiv preprint arXiv:2006.08907, 2020.
|
| 268 |
+
|
| 269 |
+
Nicola Rieke, Jonny Hancox, Wenqi Li, Fausto Milletari, Holger R Roth, Shadi Albarqouni, Spyridon Bakas, Mathieu N Galtier, Bennett A Landman, Klaus Maier-Hein, et al. The future of digital health with federated learning. NPJ digital medicine, 3(1):1–7, 2020.
|
| 270 |
+
|
| 271 |
+
Theo Ryffel, Andrew Trask, Morten Dahl, Bobby Wagner, Jason Mancuso, Daniel Rueckert, and Jonathan Passerat-Palmbach. A generic framework for privacy preserving deep learning. arXiv preprint arXiv:1811.04017, 2018.
|
| 272 |
+
|
| 273 |
+
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In European conference on computer vision, pp. 213–226. Springer, 2010.
|
| 274 |
+
|
| 275 |
+
Tim Salimans and Durk 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.
|
| 276 |
+
|
| 277 |
+
Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization? In Advances in Neural Information Processing Systems, pp. 2483– 2493, 2018.
|
| 278 |
+
|
| 279 |
+
Jan van den Brand, Binghui Peng, Zhao Song, and Omri Weinstein. Training (overparametrized) neural networks in near-linear time. arXiv e-prints, pp. arXiv–2006, 2020.
|
| 280 |
+
|
| 281 |
+
Hongyi Wang, Mikhail Yurochkin, Yuekai Sun, Dimitris Papailiopoulos, and Yasaman Khazaeni. Federated learning with matched averaging. arXiv preprint arXiv:2002.06440, 2020.
|
| 282 |
+
|
| 283 |
+
Xinwei Zhang, Mingyi Hong, Sairaj Dhople, Wotao Yin, and Yang Liu. Fedpd: A federated learning framework with optimal rates and adaptivity to non-iid data. arXiv preprint arXiv:2005.11418, 2020.
|
| 284 |
+
|
| 285 |
+
Yue Zhao, Meng Li, Liangzhen Lai, Naveen Suda, Damon Civin, and Vikas Chandra. Federated learning with non-iid data. arXiv preprint arXiv:1806.00582, 2018.
|
| 286 |
+
|
| 287 |
+
# APPENDIX
|
| 288 |
+
|
| 289 |
+
Roadmap of Appendix The Appendix is organized as follows. We list the notations table in Section A. We provide theoretical proof of convergence in Section B. The algorithm of FedBN is described in Section C. The details of experimental setting are in Section D and additional results on benchmark datasets are in Section E. We show experiment on synthetic data in Section F. We demonstrate the ability of generalizing FedBN to test on a new client in Section G.
|
| 290 |
+
|
| 291 |
+
# A NOTATION TABLE
|
| 292 |
+
|
| 293 |
+
Table 2: Notations occurred in the paper.
|
| 294 |
+
|
| 295 |
+
<table><tr><td>Notations Description</td><td></td></tr><tr><td>X</td><td>features, x ∈ Rd</td></tr><tr><td>d</td><td>dimension of x</td></tr><tr><td>y</td><td></td></tr><tr><td>P()</td><td>labels,y ∈ R</td></tr><tr><td>N</td><td>probability distribution</td></tr><tr><td>T</td><td>total number of clients</td></tr><tr><td>E</td><td>total number of epochs in training</td></tr><tr><td>M</td><td>number of local iteration in FL</td></tr><tr><td>[N]</td><td>number of training samples in each client</td></tr><tr><td>i</td><td>set of numbers,[N] = {1,:..,N}</td></tr><tr><td>j</td><td>indicator for client, i ∈ [N] indicator for sample in each client, j ∈ [M]</td></tr><tr><td>(x,y)</td><td>the j-th training sample in client i</td></tr><tr><td>m</td><td></td></tr><tr><td>k</td><td>number of neurons in the first layer</td></tr><tr><td>Vk</td><td>indicator for neuron, k ∈ [m] parameters for the k-th neuron in the first layer</td></tr><tr><td>=ν |s</td><td>vector norm, Il v lls= √vT Sv, given a matrix S</td></tr><tr><td>Si</td><td>covariance matrix for features in client i, Si = ExixiT</td></tr><tr><td>p,q</td><td>indicator for sample,p,q ∈ [NM]</td></tr><tr><td>f</td><td>two layer ReLU neural network with BN</td></tr><tr><td>f*</td><td>two layer ReLU neural network with BN with client-specified BN parameters</td></tr><tr><td>V</td><td>parameters of the first phase neurons, V ∈ Rm ×d</td></tr><tr><td>Y</td><td></td></tr><tr><td>C</td><td>the scaling parameter of BN</td></tr><tr><td>9()</td><td> top layer parameters of the network</td></tr><tr><td>N(μ,Σ)</td><td>ReLU activation function,σ(·) = max{:, 0}</td></tr><tr><td>U[-1,1]</td><td>Gaussian with mean μ and covariance £</td></tr><tr><td>α</td><td>Rademacher distribution</td></tr><tr><td>L(f)</td><td>variance of Vk at initialization</td></tr><tr><td>A(t)</td><td>empirical risk with square loss for network f</td></tr><tr><td>V(t)</td><td>evolution dynamic for FedAvg at epoch t</td></tr><tr><td></td><td>evolution dynamic with respect to V for FedAvg at epoch t</td></tr><tr><td>G(t)</td><td>evolution dynamic with respect to y for FedAvg at epoch t</td></tr><tr><td>▲*(t)</td><td>evolution dynamic for FedBN at epoch t</td></tr><tr><td>V*(t)</td><td>evolution dynamic with respect to V for FedBN at epoch t</td></tr><tr><td>G*(t)</td><td>evolution dynamic with respect to γy for FedBN at epoch t</td></tr><tr><td>Amin(A)</td><td>the minimal eigenvalue of matrix A</td></tr><tr><td>G8</td><td>expectation of G(t)</td></tr><tr><td>G*80</td><td>expectation of G*(t)</td></tr></table>
|
| 296 |
+
|
| 297 |
+
# B CONVERGENCE PROOF
|
| 298 |
+
|
| 299 |
+
# B.1 EVOLUTION DYNAMICS
|
| 300 |
+
|
| 301 |
+
In this section, we calculate the evolution dynamics $\mathbf { \boldsymbol { \Lambda } } ( t )$ for training with function $f$ and $\mathbf { \boldsymbol { \Lambda } } ^ { * } ( t )$ for training with $f ^ { * }$ . Since the parameters are updated using gradient descent, the optimization dynamics of parameters are
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
{ \frac { d \mathbf { v } _ { k } } { d t } } = - { \frac { \partial L } { \partial \mathbf { v } _ { k } } } , \quad { \frac { d { \boldsymbol { \gamma } } _ { k } } { d t } } = - { \frac { \partial L } { \partial { \boldsymbol { \gamma } } _ { k } } } .
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
Let $f _ { p } = f ( \mathbf { x } _ { p } ^ { i _ { p } } )$ . Then, the dynamics of the prediction of the $p$ -th data point in site $i _ { p }$ is
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
{ \frac { \partial f _ { p } } { \partial t } } = \sum _ { k = 1 } ^ { m } { \frac { \partial f _ { p } } { \partial \mathbf { v } _ { k } } } { \frac { d \mathbf { v } _ { k } } { d t } } + { \frac { \partial f _ { p } } { \partial \gamma _ { k } } } { \frac { d { \boldsymbol { \gamma } } _ { k } } { d t } } = - \underbrace { \sum _ { k = 1 } ^ { m } { \frac { \partial f _ { p } } { \partial \mathbf { v } _ { k } } } { \frac { \partial L } { \partial \mathbf { v } _ { k } } } } _ { T _ { \mathrm { v } } ^ { p } } - \underbrace { \sum _ { k = 1 } ^ { m } { \frac { \partial f _ { p } } { \partial \gamma _ { k } } } { \frac { \partial L } { \partial \gamma _ { k } } } } _ { T _ { \gamma } ^ { p } } .
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
The gradients of $f _ { p }$ and $L$ with respect to $\mathbf { v } _ { k }$ and $\gamma _ { k }$ are computed as
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\begin{array} { r l } & { \frac { \partial f _ { p } } { \partial \mathbf { v } _ { k } } ( t ) = \frac { 1 } { \sqrt { m } } \frac { c _ { k } \cdot \gamma _ { k } ( t ) } { \left. \mathbf { v } _ { k } \right. } _ { \mathbf { s } _ { p } } \cdot \mathbf { x } _ { p } ^ { \mathbf { v } _ { k } ^ { i , p } } ( t ) ^ { \perp } \mathbf { l } _ { p k } ( t ) , } \\ & { \frac { \partial L } { \partial \mathbf { v } _ { k } } ( t ) = \frac { 1 } { \sqrt { m } } \displaystyle \sum _ { q = 1 } ^ { N M } \left( f _ { q } ( t ) - y _ { q } \right) \frac { c _ { k } \cdot \gamma _ { k } ( t ) } { \left. \mathbf { v } _ { k } \right. } _ { \mathbf { l } _ { q } } \mathbf { x } _ { q } ^ { \mathbf { v } _ { k } ^ { i , q } } ( t ) ^ { \perp } \mathbf { l } _ { q k } ( t ) , } \\ & { \frac { \partial f _ { p } } { \partial \gamma _ { k } } ( t ) = \frac { 1 } { \sqrt { m } } \frac { c _ { k } } { \left. \mathbf { v } _ { k } ( t ) \right. _ { \mathbf { s } _ { p } } } \sigma \left( \mathbf { v } _ { k } ( t ) ^ { \top } \mathbf { x } _ { p } \right) , } \\ & { \frac { \partial L } { \partial \gamma _ { k } } ( t ) = \frac { 1 } { \sqrt { m } } \displaystyle \sum _ { q = 1 } ^ { N M } \left( f _ { q } ( t ) - y _ { q } \right) \frac { c _ { k } } { \left. \mathbf { v } _ { k } ( t ) \right. _ { \mathbf { s } _ { q } } } \sigma \left( \mathbf { v } _ { k } ( t ) ^ { \top } \mathbf { x } _ { q } \right) , } \end{array}
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
where $\begin{array} { r } { f _ { p } = f ( \mathbf { x } _ { p } ^ { i _ { p } } ) , \mathbf { x } _ { p } ^ { \mathbf { v } _ { k } ^ { i _ { p } } ( t ) ^ { \perp } } \triangleq ( \mathbf { I } - \frac { \mathbf { S } _ { i _ { p } } \mathbf { u } \mathbf { u } ^ { \intercal } } { \| \mathbf { u } \| _ { \mathbf { S } _ { i _ { p } } } ^ { 2 } } ) \mathbf { x } } \end{array}$ )x, and 1pk(t) , 1{vk(t)>xp≥0}.
|
| 320 |
+
|
| 321 |
+
We define Gram matrix $\mathbf { V } ( t )$ and $\mathbf G ( t )$ as
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { l } { { \displaystyle { \bf V } _ { p q } ( t ) = \frac { 1 } { m } \sum _ { k = 1 } ^ { m } \left( \alpha c _ { k } \cdot \gamma _ { k } ( t ) \right) ^ { 2 } \| { \bf v } _ { k } ( t ) \| _ { { \bf S } _ { i } _ { p } } ^ { - 1 } \left\| { \bf v } _ { k } ( t ) \right\| _ { { \bf S } _ { i } _ { q } } ^ { - 1 } \left. { \bf x } _ { p } ^ { { \bf v } _ { k } ^ { i _ { p } } ( t ) ^ { \perp } } , { \bf x } _ { q } ^ { { \bf v } _ { k } ^ { i _ { q } } ( t ) \perp } \right. \mathbb { 1 } _ { p k } ( t ) \mathbb { 1 } _ { q k } ( t ) } , } \\ { { \displaystyle { \bf G } _ { p q } ( t ) = \frac { 1 } { m } \sum _ { k = 1 } ^ { m } c _ { k } ^ { 2 } \left\| { \bf v } _ { k } ( t ) \right\| _ { { \bf S } _ { i p } } ^ { - 1 } \left\| { \bf v } _ { k } ( t ) \right\| _ { { \bf S } _ { i q } } ^ { - 1 } \sigma \left( { \bf v } _ { k } ( t ) ^ { \top } { \bf x } _ { p } \right) \sigma \left( { \bf v } _ { k } ( t ) ^ { \top } { \bf x } _ { q } \right) . } } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
It follows that
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
T _ { \mathbf { v } } ^ { p } ( t ) = \sum _ { q = 1 } ^ { N M } \frac { \mathbf { V } _ { p q } ( t ) } { \alpha ^ { 2 } } \left( f _ { q } ( t ) - y _ { q } \right) , \quad T _ { \gamma } ^ { p } ( t ) = \sum _ { q = 1 } ^ { N M } \mathbf { G } _ { p q } ( t ) \left( f _ { q } ( t ) - y _ { q } \right) .
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Let $\mathbf { f } = \left( f _ { 1 } , \ldots , f _ { n } \right) ^ { \intercal } = \left( f \left( \mathbf { x } _ { 1 } \right) , \ldots , f \left( \mathbf { x } _ { N M } \right) \right) ^ { \intercal }$ . The full evolution dynamic is given by
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
{ \frac { d \mathbf { f } } { d t } } = - \mathbf { A } ( t ) ( \mathbf { f } ( t ) - \mathbf { y } ) , \quad { \mathrm { w h e r e } } \quad \mathbf { A } ( t ) : = { \frac { \mathbf { V } ( t ) } { \alpha ^ { 2 } } } + \mathbf { G } ( t ) .
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
Similarly, we compute Gram matrix $\mathbf { V } ^ { * } ( t )$ and $\mathbf { G } ^ { * } ( t )$ for FedBN with $f ^ { * }$ as
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
V _ { p q } ^ { * } ( t ) = \frac { 1 } { m } \sum _ { k = 1 } ^ { m } \left( \alpha c _ { k } \right) ^ { 2 } \gamma _ { k , i _ { p } } ( t ) \gamma _ { k , i _ { q } } ( t ) \left. \mathbf { v } _ { k } ( t ) \right. _ { \mathbf { S } _ { i _ { p } } } ^ { - 1 } \left. \mathbf { v } _ { k } ( t ) \right. _ { \mathbf { S } _ { i _ { q } } } ^ { - 1 } \left. \mathbf { x } _ { p } ^ { \mathbf { v } _ { k } ^ { i _ { p } } ( t ) ^ { \perp } } , \mathbf { x } _ { q } ^ { \mathbf { v } _ { k } ^ { i _ { q } } ( t ) ^ { \perp } } \right. \mathbb { 1 } _ { p k } ( t ) \mathbb { 1 } _ { q k } ( t ) ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\mathbf { G } _ { p q } ^ { * } ( t ) = \frac { 1 } { m } \sum _ { k = 1 } ^ { m } c _ { k } ^ { 2 } \left. \mathbf { v } _ { k } ( t ) \right. _ { \mathbf { S } _ { i _ { p } } } ^ { - 1 } \left. \mathbf { v } _ { k } ( t ) \right. _ { \mathbf { S } _ { i _ { q } } } ^ { - 1 } \sigma \left( \mathbf { v } _ { k } ( t ) ^ { \top } \mathbf { x } _ { p } \right) \sigma \left( \mathbf { v } _ { k } ( t ) ^ { \top } \mathbf { x } _ { q } \right) \mathbb { 1 } \{ i _ { p } = i _ { q } \} .
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Thus, the full evolution dynamic of FedBN is
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\frac { d \mathbf { f } ^ { * } } { d t } = - \mathbf { \boldsymbol { \Lambda } } ^ { * } ( t ) ( \mathbf { f } ^ { * } ( t ) - \mathbf { \boldsymbol { y } } ) , \quad \mathrm { w h e r e } \quad \mathbf { \boldsymbol { \Lambda } } ^ { * } ( t ) : = \frac { \mathbf { \boldsymbol { V } } ^ { * } ( t ) } { \alpha ^ { 2 } } + \mathbf { \boldsymbol { G } } ^ { * } ( t ) .
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
# B.2 PROOF OF LEMMA 4.3
|
| 356 |
+
|
| 357 |
+
Dukler et al. (2020) proved that the matrix $\mathbf { G } ^ { \infty }$ is strictly positive definite. In their proof, $\mathbf { G } ^ { \infty }$ is the covariance matrix of the functionals $\phi _ { p }$ define as
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\phi _ { p } ( \mathbf { v } ) : = \sigma \left( \mathbf { v } ^ { \top } \mathbf { x } _ { p } \right)
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
over the Hilbert space $\nu$ of $L ^ { 2 } \left( N \left( 0 , \alpha ^ { 2 } \mathbf { I } \right) \right)$ . $\mathbf { G } ^ { * \infty }$ is strictly positive definite by showing that $\phi _ { 1 } , \cdots , \phi _ { N M }$ are linearly independent, which is equivalent to that
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
c _ { 1 } \phi _ { 1 } + c _ { 2 } \phi _ { 2 } + \cdot \cdot \cdot + c _ { N M } \phi _ { N M } = 0 \mathrm { i n } \mathcal { V }
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
holds only for $c _ { p } = 0$ for all $p$
|
| 370 |
+
|
| 371 |
+
Let $\mathbf { G } _ { i } ^ { \infty }$ denote the $i$ -th $M \times M$ block matrices on the diagonal of $\mathbf { G } ^ { \infty }$ . Then we have
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
{ \bf G } ^ { * \infty } = d i a g ( { \bf G } _ { 1 } ^ { \infty } , \cdot \cdot \cdot , { \bf G } _ { N } ^ { \infty } ) .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
To prove that $\mathbf { G } ^ { * \infty }$ is strictly positive definite, we will show that $\mathbf { G } _ { i } ^ { \infty }$ is positive definite. Let us define
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\phi _ { j , i } ^ { \ast } ( \mathbf { v } ) : = \sigma \left( \mathbf { v } ^ { \top } \mathbf { x } _ { j } \right) \mathbb { 1 } \{ j \in \mathrm { ~ s i t e ~ } i \} , \quad j = 1 , \cdots , M .
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
Then, we are going to show that
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
c _ { 1 } \phi _ { 1 , i } ^ { * } + c _ { 2 } \phi _ { 2 , i } ^ { * } + \cdot \cdot \cdot + c _ { M } \phi _ { M , i } ^ { * } = 0
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
holds only for $c _ { j } = 0 , \forall j \in [ M ]$ . Suppose there exist $c _ { 1 } , \cdots , c _ { M }$ that are not identically 0, satisfying (11). Let the coefficients for client $i$ be $c _ { 1 } , \cdots , c _ { M }$ and let the coefficients for other client be 0. Then, we have a sequence of coefficients satisfying (10), which is a contradiction with that $\mathbf { G } ^ { \infty }$ is strictly positive definite. This implies $\mathbf { G } _ { i } ^ { \infty }$ is strictly positive definite. Namely, $\mathbf { G } _ { i } ^ { \infty }$ ’s eigenvalues are positive. Since the eigenvalues of $\mathbf { G } ^ { * \infty }$ are exactly the union of the eigenvalues of $\mathbf { G } _ { i } ^ { \infty }$ , $\lambda _ { m i n } \bigl ( \mathbf { G } ^ { * \infty } \bigr )$ is positive and thus, $\mathbf { G } ^ { * \infty }$ is strictly positive definite.
|
| 390 |
+
|
| 391 |
+
# B.3 PROOF OF COROLLARY 4.6
|
| 392 |
+
|
| 393 |
+
To compare the convergence rates of FedAvg and FedBN when $E = 1$ , we compare the exponential factor in the convergence rates, which are $\left( 1 - \eta \mu _ { 0 } / 2 \right)$ and $( 1 - \eta \mu _ { 0 } ^ { * } / 2 )$ for FedAvg and FedBN, respectively. Then, it reduces to comparing $\mu _ { 0 } = \lambda _ { \mathrm { m i n } } ( \mathbf G ^ { \infty } )$ and $\mu _ { 0 } ^ { * } = \lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { * \infty } )$ . Comparing equation (7) and (9), $\mathbf { G } ^ { * \infty }$ takes the $M \times M$ block matrices on the diagonal of $\mathbf { G } ^ { \infty }$ :
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\mathbf { G } ^ { \infty } = \left[ \begin{array} { c c c c } { \mathbf { G } _ { 1 } ^ { \infty } } & { \mathbf { G } _ { 1 , 2 } ^ { \infty } } & { \cdots } & { \mathbf { G } _ { 1 , N } ^ { \infty } } \\ { \mathbf { G } _ { 1 , 2 } ^ { \infty } } & { \mathbf { G } _ { 2 } ^ { \infty } } & { \cdots } & { \mathbf { G } _ { 2 , N } ^ { \infty } } \\ { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { \mathbf { G } _ { 1 , N } ^ { \infty } } & { \mathbf { G } _ { 2 , N } ^ { \infty } } & { \cdots } & { \mathbf { G } _ { N } ^ { \infty } } \end{array} \right] , \quad \mathbf { G } ^ { * \infty } = \left[ \begin{array} { c c c c } { \mathbf { G } _ { 1 } ^ { \infty } } & { 0 } & { \cdots } & { 0 } \\ { 0 } & { \mathbf { G } _ { 2 } ^ { \infty } } & { \cdots } & { 0 } \\ { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { 0 } & { \cdots } & { \mathbf { G } _ { N } ^ { \infty } } \end{array} \right] ,
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
where $\mathbf { G } _ { i } ^ { \infty }$ is the $i$ -th $M \times M$ block matrices on the diagonal of $\mathbf { G } ^ { \infty }$ . By linear algebra,
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\lambda _ { \operatorname* { m i n } } ( \mathbf { G } _ { i } ^ { \infty } ) \geq \lambda _ { \operatorname* { m i n } } ( \mathbf { G } ^ { \infty } ) , \quad \forall i \in [ N ] .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Since the eigenvalues of $\mathbf { G } ^ { * \infty }$ are exactly the union of eigenvalues of $\mathbf { G } _ { i } ^ { \infty }$ , we have
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\begin{array} { r l } & { \lambda _ { \operatorname* { m i n } } \bigl ( \mathbf { G } ^ { * \infty } \bigr ) = \underset { i \in [ N ] } { \operatorname* { m i n } } \big \{ \lambda _ { \operatorname* { m i n } } \bigl ( \mathbf { G } _ { i } ^ { \infty } \bigr ) \big \} , } \\ & { \qquad \geq \lambda _ { \operatorname* { m i n } } \bigl ( \mathbf { G } ^ { \infty } \bigr ) . } \end{array}
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Thus, $( 1 - \eta \mu _ { 0 } / 2 ) \ge ( 1 - \eta \mu _ { 0 } ^ { * } / 2 )$ and we can conclude that the convergence rate of FedBN is faster than the convergence of FedAvg.
|
| 412 |
+
|
| 413 |
+
# C FEDBN ALGORITHM
|
| 414 |
+
|
| 415 |
+
We describe the details algorithm of our proposed FedBN as following Algorithm 1:
|
| 416 |
+
|
| 417 |
+
# Algorithm 1 Federated Learning using FedBN
|
| 418 |
+
|
| 419 |
+
Notations: The user indexed by $k$ , neural network layer indexed by $l$ , initialized model parameters: $w _ { 0 , k } ^ { ( l ) }$ , local update pace: $E$ , and total optimization round $T$ .
|
| 420 |
+
|
| 421 |
+
1: for each round $t = 1 , 2 , \dots , T$ do
|
| 422 |
+
2: for each user $k$ and each layer $l$ do
|
| 423 |
+
3: $w _ { t + 1 , k } ^ { ( l ) } S G D ( w _ { t , k } ^ { ( l ) } )$
|
| 424 |
+
4: end for
|
| 425 |
+
5: if $\mod ( t , E ) = 0$ then
|
| 426 |
+
6: for each user $k$ and each layer $l$ do
|
| 427 |
+
7: if layer $l$ is not BatchNorm then
|
| 428 |
+
8: $\begin{array} { r } { w _ { t + 1 , k } ^ { ( l ) } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } w _ { t + 1 , k } ^ { ( l ) } } \end{array}$
|
| 429 |
+
9: end if
|
| 430 |
+
10: end for
|
| 431 |
+
11: end if
|
| 432 |
+
12: end for
|
| 433 |
+
|
| 434 |
+
# D EXPERIMENTAL DETAILS
|
| 435 |
+
|
| 436 |
+
# D.1 VISUALIZATION OF BENCHMARK DATASETS
|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
Figure 6: Data visualization. (a) Examples from each dataset (client). (b) Non-iid feature distributions across the datasets (over random 100 samples for each dataset).
|
| 440 |
+
|
| 441 |
+
We show image examples from the five benchmark datasets and the pixel value histogram. It obviously presents the heterogeneous appearances and shifted distributions. Clients formed from the five benchmark datasets are viewed as non-iid.
|
| 442 |
+
|
| 443 |
+
# D.2 MODEL ARCHITECTURE AND TRAINING DETAILS ON BENCHMARK
|
| 444 |
+
|
| 445 |
+
We illustrate our model architecture and training details of the digits classification experiments in this section.
|
| 446 |
+
|
| 447 |
+
Model Architecture. For our benchmark experiment, we use a six-layer Convolutional Neural Network (CNN) and its details are listed in Table 3.
|
| 448 |
+
|
| 449 |
+
<table><tr><td rowspan=1 colspan=1>Layer</td><td rowspan=1 colspan=1>Details</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>Conv2D(3, 64, 5, 1, 2)BN(64), ReLU, MaxPool2D(2,2)</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>Conv2D(64, 64, 5, 1, 2)BN(64), ReLU, MaxPool2D(2, 2)</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>Conv2D(64, 128,5, 1, 2)BN(128), ReLU</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>Conv2D(64, 128,5,1, 2)BN(128), ReLU</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>FC(6272,2048)BN(2048), ReLU</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>FC(2048, 512)BN(512), ReLU</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>FC(512, 10)</td></tr></table>
|
| 450 |
+
|
| 451 |
+
Table 3: Model architecture of the benchmark experiment. For convolutional layer (Conv2D), we list parameters with sequence of input and output dimension, kernal size, stride and padding. For max pooling layer (MaxPool2D), we list kernal and stride. For fully connected layer (FC), we list input and output dimension. For BatchNormalization layer (BN), we list the channel dimension.
|
| 452 |
+
|
| 453 |
+
Training Details. We give detailed settings for the experiments conducted in 5.1: (1) convergence rate (Table 4), (2) analysis of local update epochs (Table 5), (3) analysis of local dataset size (Table 6), (4) effects of statistical heterogeneity (Table 7) and (5) comparison with state-of-the-art (Table 8). Each table describes the number of clients, samples and the local update epochs.
|
| 454 |
+
|
| 455 |
+
During training process, we use SGD optimizer with learning rate $1 0 ^ { - 2 }$ and cross-entropy loss, we set batch size to 32 and training epochs to 300. For hyper-parameter $\mu$ , we use the best value $\mu = 1 0 ^ { - 2 }$ founded by grid search from the the default settings in FedProx Li et al. (2020b).
|
| 456 |
+
|
| 457 |
+
Table 4: Settings for convergence rate. Each dataset has 1 client with 743 samples, local update epoch is set to 1.
|
| 458 |
+
|
| 459 |
+
<table><tr><td>Datasets</td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Number of clients</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Number of samples</td><td>743</td><td>743</td><td>743</td><td>743</td><td>743</td></tr><tr><td>Local update epochs</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>
|
| 460 |
+
|
| 461 |
+
<table><tr><td>Datasets</td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Number of clients</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Number of samples</td><td>743</td><td>743</td><td>743</td><td>743</td><td>743</td></tr><tr><td>Local update epochs</td><td>1,4,8,16</td><td>1,4,8,16</td><td>1,4,8,16</td><td>1,4,8,16</td><td>1,4,8,16</td></tr></table>
|
| 462 |
+
|
| 463 |
+
Table 5: Settings for local update epochs. Each dataset has 1 client with 743 samples, local update epoch for all datasets is set to 1, 4, 8, 16 successively.
|
| 464 |
+
|
| 465 |
+
<table><tr><td>Datasets</td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Number of clients</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Number of samples</td><td>W</td><td>W</td><td>W</td><td>W</td><td>8</td></tr><tr><td>Local update epochs</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>
|
| 466 |
+
|
| 467 |
+
Table 6: Settings for local dataset size, we set local update epochs to 1 and each dataset has 1 client.
|
| 468 |
+
The number of samples $\omega \in \{ 7 4 , 3 7 1$ , 743, 1487, 2975, 4462, 7438 .
|
| 469 |
+
|
| 470 |
+
<table><tr><td>Datasets</td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Number of clients</td><td>[1,10]</td><td>[1,10]</td><td>[1,10]</td><td>[1,10]</td><td>[1,10]</td></tr><tr><td>Number of samples</td><td>[1,10]×743</td><td>[1,10]×743</td><td>[1,10]×743</td><td>[1,10]×743</td><td>[1,10]×743</td></tr><tr><td>Local update epochs</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>
|
| 471 |
+
|
| 472 |
+
Table 7: Settings for statistical heterogeneity, [1, 10] for the range from 1 to 10. We increase number of clients step by step and number of samples will increase accordingly.
|
| 473 |
+
|
| 474 |
+
<table><tr><td>Datasets</td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Number of clients</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Number of samples</td><td>743</td><td>743</td><td>743</td><td>743</td><td>743</td></tr><tr><td>Local update epochs</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>
|
| 475 |
+
|
| 476 |
+
Table 8: Settings for comparison with SOTA, we use 1 client with 743 samples and 1 local update epoch for comparison experiment.
|
| 477 |
+
|
| 478 |
+
# D.3 MODEL ARCHITECTURE AND TRANING DETAILS OF IMAGE CLASSIFICATION TASK ON OFFICE-CALTECH10 AND DOMAINNET
|
| 479 |
+
|
| 480 |
+
In this section, we provide the details of our model and training process on both Office-Caltech10 Gong et al. (2012) and DomainNet Peng et al. (2019) dataset.
|
| 481 |
+
|
| 482 |
+
Model Architecture. For the image classification tasks on these two real-worlds datasets OfficeCaltech10 and DomainNet data, we use adapted AlexNet added with BN layer after each convolutional layer and fully-connected layer (except the last layer), architecture is shown in Table 9.
|
| 483 |
+
Table 9: Model architecture for Office-Caltech10 and DomainNet experiment. For convolutional layer (Conv2D), we list parameters with sequence of input and output dimension, kernal size, stride and padding. For max pooling layer (MaxPool2D), we list kernal and stride. For fully connected layer (FC), we list input and output dimension. For BatchNormalization layer (BN), we list the channel dimension.
|
| 484 |
+
|
| 485 |
+
<table><tr><td rowspan=1 colspan=1>Layer</td><td rowspan=1 colspan=1>Details</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>Conv2D(3, 64, 11, 4, 2)BN(64), ReLU,MaxPool2D(3, 2)</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>Conv2D(64,192,5,1,2)BN(192), ReLU,MaxPool2D(3,2)</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>Conv2D(64,128,5, 1,2)BN(128), ReLU</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>Conv2D(192, 384, 3, 1, 1)BN(384), ReLU</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>Conv2D(384, 256,3, 1, 1)BN(256), ReLU</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>Conv2D(256, 256, 3, 1, 1)BN(256),ReLU,MaxPoll2D(3,2)</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>AdaptiveAvgPool2D(6, 6)</td></tr><tr><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>FC(9216,4096)BN(4096), ReLU</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>FC(4096, 4096)BN(4096), ReLU</td></tr><tr><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>FC(4096, 10)</td></tr></table>
|
| 486 |
+
|
| 487 |
+
Training Details. Office-Caltech10 selects 10 common objects in Office-31 Saenko et al. (2010) and Caltech-256 datasets Griffin et al. (2007). There are four different data sources, one from Caltech-256 and three from Office-31, namely Amazon(images collected from online shopping website), DSLR and Webcam(images captured in office environment using Digital SLR camera and web camera).
|
| 488 |
+
|
| 489 |
+
We first reshape input images in the two dataset into $2 5 6 \times 2 5 6 \times 3$ , then for training process, we use cross-entropy loss and SGD optimizer with learning rate of $1 0 ^ { - 2 }$ , batch size is set to 32 and training epochs is 300. When comparing with FedProx, we set $\mu$ to $1 0 ^ { - 2 }$ which is tuned from the default settings. The data sample number are kept into the same size according to the smallest dataset, i.e. Office-Caltech10 uses 62 training samples and DomainNet uses 105 training samples on each dataset. In addition, for simplicity, we choose top-10 class based on data amount from DomainNet containing images over 345 categories.
|
| 490 |
+
|
| 491 |
+
# D.4 ABIDE DATASET AND TRAINING DETAILS
|
| 492 |
+
|
| 493 |
+
Here we describe the real-world medical datasets, the preprocessing and training details.
|
| 494 |
+
|
| 495 |
+
Dataset: The study was carried out using resting-state fMRI (rs-fMRI) data from the Autism Brain Imaging Data Exchange dataset (ABIDE I preprocessed, (Di Martino et al., 2014)). ABIDE is a consortium that provides preciously collected rs-fMRI ASD and matched controls data for the purpose of data sharing in the scientific community. We downloaded Regions of Interests (ROIs) fMRI series of the top four largest sites (UM, NYU, USM, UCLA viewed as clients) from the preprocessed ABIDE dataset with Configurable Pipeline for the Analysis of Connectomes (CPAC) and parcellated by Harvard-Oxford (HO) atlas. Skipping subjects lacking filename, resulting in 88, 167, 52, 63 subjects for UM, NYU, USM, UCLA separately. Due to a lack of sufficient data, we used sliding windows (with window size 32 and stride 1) to truncate raw time sequences of fMRI. The compositions of four sites were shown in Table 10. The number of overlapping truncate is the dataset size in a client.
|
| 496 |
+
|
| 497 |
+
Table 10: Data summary of the dataset used in our study.
|
| 498 |
+
|
| 499 |
+
<table><tr><td></td><td>NYU</td><td>UM1</td><td>USM</td><td>UCLA1</td></tr><tr><td>Total Subject</td><td>167</td><td>88</td><td>52</td><td>63</td></tr><tr><td>ASD Subject</td><td>73</td><td>43</td><td>33</td><td>37</td></tr><tr><td>HC Subject</td><td>94</td><td>45</td><td>19</td><td>26</td></tr><tr><td>ASD Percentage</td><td>44%</td><td>49%</td><td>63%</td><td>59%</td></tr><tr><td>fMRIFrames</td><td>176</td><td>296</td><td>236</td><td>116</td></tr><tr><td>Overlapping Trunc</td><td>145</td><td>265</td><td>205</td><td>85</td></tr></table>
|
| 500 |
+
|
| 501 |
+
Training Process : For all the strategies, we set batch size as 100. The total training local epoch is 50 with learning rate $1 0 ^ { - 2 }$ with SGD optimizer. Local update epoch for each client is $E = 1$ . We selected the best parameters $\mu = 0 . 2$ in FedProx through grid search.
|
| 502 |
+
|
| 503 |
+
# E MORE EXPERIMENTAL RESULTS ON BENCHMARK DATASETS
|
| 504 |
+
|
| 505 |
+
# E.1 CONVERGENCE COMPARISON OVER FEDAVG AND FEDBN
|
| 506 |
+
|
| 507 |
+
In this section we conduct an additional convergence analysis experiment over different local update epochs settings: $E = 1 , 4 , 8 , 1 6$ . As shown in Fig. 7, FedBN converges faster than FedAvg under different values of $E$ , which is supportive to our theoretical analysis in Section 4 and experimental results in Section 5.
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
Figure 7: Training loss over epochs with different local update frequency.
|
| 511 |
+
|
| 512 |
+
# E.2 DETAILED STATISTICS OF FIGURE 5
|
| 513 |
+
|
| 514 |
+
In Figure 5, we compare the performance with respect to accuracy of FedBN and alternative methods. We show the detailed accuracy in the following Table 11.
|
| 515 |
+
|
| 516 |
+
<table><tr><td>Methods</td><td>SVHN</td><td>USPS</td><td>Synth</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Single</td><td>65.25 (1.07)</td><td>95.16 (0.12)</td><td>80.31 (0.38)</td><td>77.77 (0.47)</td><td>94.38 (0.07)</td></tr><tr><td>FedAvg</td><td>62.86 (1.49)</td><td>95.56 (0.27)</td><td>82.27 (0.44)</td><td>76.85 (0.54)</td><td>95.87 (0.20)</td></tr><tr><td>FedProx</td><td>63.08 (1.62)</td><td>95.58 (0.31)</td><td>82.34 (0.37)</td><td>76.64 (0.55)</td><td>95.75 (0.21)</td></tr><tr><td>FedBN</td><td>71.04 (0.31)</td><td>96.97 (0.32)</td><td>83.19 (0.42)</td><td>78.33 (0.66)</td><td>96.57 (0.13)</td></tr></table>
|
| 517 |
+
|
| 518 |
+
Table 11: The detailed statistics reported with format mean (std) of accuracy presented on Fig. 5 .
|
| 519 |
+
|
| 520 |
+
# E.3 COMPARE FEDBN WITH CENTRALIZED TRAINING
|
| 521 |
+
|
| 522 |
+
To better understand the significance of the numbers reported in our main context, we compare FedBN with centralized training, that pools all training data in to a center. We present the testing accuracy on each digit dataset in Table 12. FedBN, federated learning with data-specific BN layers, could achieve comparable performance with vanilla centralized training strategy.
|
| 523 |
+
|
| 524 |
+
<table><tr><td></td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>Centralized</td><td>74.18 (0.44)</td><td>96.46 (0.30)</td><td>84.57 (0.38)</td><td>79.65 (0.24)</td><td>96.53 (0.19)</td></tr><tr><td>FedBN</td><td>71.04 (0.31)</td><td>96.97 (0.32)</td><td>83.19 (0.42)</td><td>78.33 (0.66)</td><td>96.57 (0.13)</td></tr></table>
|
| 525 |
+
|
| 526 |
+
Table 12: Testing accuracy on each testing sets with format mean(std) from 5-trial run.
|
| 527 |
+
|
| 528 |
+
# E.4 DIFFERENT COMBINATIONS OF $E$ AND $B$
|
| 529 |
+
|
| 530 |
+
In this section, we show different combinations of local update epochs $E$ and batch size $B$ . Specifically, $E \in \{ 1 , 4 , 1 6 \}$ and $B \in \{ 1 0 , 5 0 , \infty \}$ , $\infty$ denotes full batch learning. Following the setting in original FedAvg paper McMahan et al. (2017), we present the comparisons between FedBN and FedAvg on each combination of $E$ and $B$ in Table 13. The results are in good agreement that FedBN can consistently outperform FedAvg and robust to batch size selection. Further, we depicts the test sets accuracy vs. local epochs under different combination of $E$ and $B$ in Figure 8.
|
| 531 |
+
|
| 532 |
+
Table 13: Test sets accuracy using different combinations of batch size $B$ and local update epoch $E$ on benchmark experiment with the default non-iid setting.
|
| 533 |
+
|
| 534 |
+
<table><tr><td colspan="2">Setting</td><td>SVHN</td><td>USPS</td><td>SynthDigits</td><td>MNIST-M</td><td>MNIST</td></tr><tr><td>B=10,E=1</td><td>FedAvg FedBN</td><td>65.50 76.18</td><td>97.04 97.37</td><td>84.25 86.51</td><td>81.65 82.81</td><td>96.55 97.41</td></tr><tr><td>B=10,E=4</td><td>FedAvg FedBN</td><td>69.80 76.23</td><td>96.67 97.04</td><td>85.63 86.99</td><td>82.54 83.14</td><td>97.21 97.05</td></tr><tr><td>B=10,E=16</td><td>FedAvg FedBN</td><td>65.05 75.56</td><td>95.05 96.13</td><td>83.74 84.78</td><td>80.79 80.29</td><td>96.71 96.44</td></tr><tr><td>B=50,E=1</td><td>FedAvg FedBN</td><td>62.42 70.70</td><td>95.32 97.04</td><td>81.66 82.74</td><td>75.28 78.38</td><td>96.06 96.57</td></tr><tr><td>B=50,E=4</td><td>FedAvg FedBN</td><td>61.67 69.85</td><td>95.16 97.10</td><td>80.69 81.78</td><td>74.44 77.56</td><td>95.71 96.40</td></tr><tr><td>B=50,E=16</td><td>FedAvg FedBN</td><td>60.00 67.67</td><td>94.68 96.94</td><td>79.37 80.39</td><td>73.39 76.54</td><td>95.28 95.66</td></tr><tr><td>B=0,E=1</td><td>FedAvg FedBN</td><td>60.99 65.98</td><td>94.57 96.29</td><td>79.69 79.75</td><td>74.36 76.79</td><td>95.86 96.15</td></tr><tr><td>B=0,E=4</td><td>FedAvg FedBN</td><td>59.07 65.25</td><td>95.38 96.34</td><td>79.88 79.99</td><td>73.97 73.96</td><td>94.51 95.51</td></tr><tr><td>B=0,E=16</td><td>FedAvg FedBN</td><td>61.88 64.39</td><td>94.68 95.16</td><td>78.69 78.22</td><td>74.36 73.96</td><td>95.46 95.57</td></tr></table>
|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
Figure 8: Test set accuracy curve (average of 5 datasets) of using different local updating epochs $E$ and batch size $B$ for FedBN.
|
| 538 |
+
|
| 539 |
+
# E.5 DETAILED STATISTICS OF VARYING LOCAL DATASET SIZE EXPERIMENT
|
| 540 |
+
|
| 541 |
+
Considering putting all results in one figure (15 lines) might affect readability of the figure, we excluded the statistics of FedAvg in our Fig. 4 (b), the ablation study of our method on the effect of local dataset size. Here, we list the full results in Table 14. It is not too surprising that at Singleset can be the best when the a local client gets a lot of data.
|
| 542 |
+
|
| 543 |
+
Table 14: Model performance over varying dataset sizes on local clients
|
| 544 |
+
|
| 545 |
+
<table><tr><td colspan="2">Setting</td><td>100%</td><td>60%</td><td>40%</td><td>20%</td><td>10%</td><td>5%</td><td>1%</td></tr><tr><td rowspan="3">MNIST</td><td>SingleSet</td><td>98.09</td><td>97.84</td><td>97.22</td><td>96.14</td><td>94.35</td><td>90.86</td><td>75.28</td></tr><tr><td>FedAvg</td><td>98.96</td><td>98.54</td><td>98.13</td><td>97.51</td><td>96.22</td><td>93.79</td><td>79.94</td></tr><tr><td>FedBN</td><td>98.91</td><td>98.63</td><td>98.34</td><td>97.78</td><td>96.72</td><td>94.67</td><td>85.22</td></tr><tr><td rowspan="3">SVHN</td><td>SingleSet</td><td>85.74</td><td>84.62</td><td>82.75</td><td>76.42</td><td>66.81</td><td>52.62</td><td>12.06</td></tr><tr><td>FedAvg</td><td>82.08</td><td>79.56</td><td>77.37</td><td>70.84</td><td>63.80</td><td>49.15</td><td>23.67</td></tr><tr><td>FedBN</td><td>86.93</td><td>84.72</td><td>82.87</td><td>78.20</td><td>71.31</td><td>61.53</td><td>31.98</td></tr><tr><td rowspan="3">USPS</td><td>SingleSet</td><td>98.87</td><td>98.49</td><td>97.85</td><td>96.94</td><td>95.11</td><td>93.01</td><td>80.11</td></tr><tr><td>FedAvg</td><td>98.33</td><td>97.85</td><td>97.42</td><td>96.61</td><td>95.59</td><td>93.76</td><td>79.09</td></tr><tr><td>FedBN</td><td>98.82</td><td>98.92</td><td>98.55</td><td>98.17</td><td>97.58</td><td>96.24</td><td>85.05</td></tr><tr><td rowspan="3">Synth</td><td>SingleSet</td><td>94.33</td><td>92.82</td><td>91.02</td><td>86.77</td><td>80.47</td><td>70.61</td><td>14.10</td></tr><tr><td>FedAvg</td><td>93.98</td><td>92.57</td><td>91.04</td><td>87.03</td><td>82.17</td><td>72.76</td><td>42.11</td></tr><tr><td>FedBN</td><td>94.40</td><td>92.81</td><td>91.75</td><td>88.03</td><td>83.06</td><td>74.85</td><td>43.76</td></tr><tr><td rowspan="3">MNISTM</td><td>SingleSet</td><td>93.30</td><td>91.63</td><td>89.41</td><td>84.34</td><td>77.59</td><td>66.02</td><td>17.23</td></tr><tr><td>FedAvg</td><td>90.59</td><td>88.91</td><td>86.21</td><td>82.11</td><td>76.93</td><td>67.97</td><td>41.71</td></tr><tr><td>FedBN</td><td>91.35</td><td>89.95</td><td>87.79</td><td>83.73</td><td>78.80</td><td>70.04</td><td>44.17</td></tr></table>
|
| 546 |
+
|
| 547 |
+
# E.6 TRAINING ON UNEQUAL DATASET SIZE
|
| 548 |
+
|
| 549 |
+
In our benchmark experiment (Section 5.1), we truncate the sample size of the five datasets to their smallest number. This data preprocessing intends to strictly control non-related factors (e.g., imbalanced sample numbers across clients), so that the experimental findings can more clearly reflect the effect of local BN. In this regard, truncating datasets is a reasonable way to make each client have an equal number of data points and local update steps. It is also possible to keep the data sets in their original size (which is unequal), by allowing clients with less data to repeat sampling. In this way, all clients use the same batch size and same local iterations of each epoch. We add results of such a setting with $10 \%$ and full original datasize in Table 15 and Table 16 respectively. It is observed that FedBN still consistently outperforms other methods.
|
| 550 |
+
|
| 551 |
+
Table 15: Testing accuracy of each clients when clients’ training samples are unequal using $10 \%$ of original data. The number of training samples for each client are denoted under their names.
|
| 552 |
+
|
| 553 |
+
<table><tr><td>Method</td><td>SVHN 7943</td><td>USPS 743</td><td>SynthDigits 39116</td><td>MNIST-M 5600</td><td>MNIST 5600</td></tr><tr><td>FedAvg</td><td>87.00</td><td>98.01</td><td>97.55</td><td>88.69</td><td>98.75</td></tr><tr><td>FedProx</td><td>86.75</td><td>97.90</td><td>97.53</td><td>88.86</td><td>98.86</td></tr><tr><td>FedBN</td><td>89.34</td><td>98.28</td><td>97.83</td><td>90.34</td><td>98.89</td></tr></table>
|
| 554 |
+
|
| 555 |
+
<table><tr><td>Method</td><td>SVHN 79430</td><td>USPS 7430</td><td>SynthDigits 391160</td><td>MNIST-M 56000</td><td>MNIST 56000</td></tr><tr><td>FedAvg</td><td>99.59</td><td>92.27</td><td>98.71</td><td>99.30</td><td>95.27</td></tr><tr><td>FedProx</td><td>99.50</td><td>92.12</td><td>98.66</td><td>99.27</td><td>95.44</td></tr><tr><td>FedBN</td><td>99.62</td><td>94.34</td><td>98.92</td><td>99.54</td><td>96.72</td></tr></table>
|
| 556 |
+
|
| 557 |
+
Table 16: Testing accuracy of each clients when clients’ training samples are unequal using full size data. The number of training samples for each client are denoted under their names.
|
| 558 |
+
|
| 559 |
+
# F SYNTHETIC DATA EXPERIMENT
|
| 560 |
+
|
| 561 |
+
Settings We generate data from two-pair of multi-Gaussian distributions. For one pair, samples $( x , 0 )$ and $( x , 1 )$ are sampled from $\mathcal { N } ( \bar { - } 1 , \Sigma _ { 1 } )$ and $\mathcal { N } ( 1 , \ \Sigma _ { 1 } )$ respectively, with coveriance $\Sigma _ { 1 } \in$ $\dot { \mathbb { R } } ^ { 1 0 \times 1 0 }$ . For another pair, samples $( \widetilde { x } , 0 )$ and $( \widetilde { x } , 1 )$ are sampled from $\mathcal { N } ( - 1 , ~ \Sigma _ { 2 } )$ and $\mathcal { N } ( 1 , \ \Sigma _ { 2 } )$ respectively, with coveriance $\bar { \Sigma } _ { 2 } \in \mathrm { ~ \mathbb { R } ^ { 1 0 \times 1 0 } ~ }$ e. Specifically, we design convariance matrix $\Sigma _ { 1 }$ as an identity diagonal matrix and $\Sigma _ { 2 }$ is different from $\Sigma _ { 1 }$ by having non-zero values on off-diagonal entries. We train a two-layer neural network with 100 hidden neurons for 600 steps using crossentropy loss and SGD optimizer with $1 \times 1 0 ^ { - 5 }$ learning rate. Denote $W _ { k }$ and $b _ { k }$ are the in-connection weigths and bias term of neuron $k$ . We initialize the model parameters with $W _ { k } \sim { \mathcal { N } } ( 0 , \alpha ^ { 2 } \mathbf { I } )$ , $b _ { k } \sim$ ${ \mathcal { N } } ( { \bar { 0 } } , \alpha ^ { 2 } )$ , where $\alpha = 1 0$ .
|
| 562 |
+
|
| 563 |
+
Results. The aim of synthetic experiments is to study the behavior of using FedBN with a controlled setup. We achieve $1 0 0 \%$ accuracy on binary classification for FedAvg and FedBN. Fig. 9 shows comparison of training loss curve over steps using FedAvg and FedBN, presenting that FedBN obtains significantly faster convergence than FedAvg.
|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
Figure 9: Training loss on synthetic data. Data in client 1 is generated from Diagonal Gaussian, client 2 is generated from combination of Diagonal Gaussian and Full Gaussian.
|
| 567 |
+
|
| 568 |
+
# G TRANSFER LEARNING AND TESTING ON UNKNOWN DOMAIN CLIENT
|
| 569 |
+
|
| 570 |
+
In this section, we discuss out-of-domain generalization of FedBN and prove the solutions for the following two scenarios: 1) transferring FedBN to a new unknown domain clients during training; 2) testing an unknown domain client.
|
| 571 |
+
|
| 572 |
+
If a new center from another domain joins training, we can transfer the non-BN layer parameters of the global model to this new center. This new center will compute its own mean and variance statistics, and learn the corresponding local BN parameters.
|
| 573 |
+
|
| 574 |
+
Testing the global model on a new client with unknown statistics outside federation requires allowing access to local BN parameters at testing time (though BN layers are not aggregated at the global server during training). In this way, the new client can use the averaged trainable BN parameters learned at existing FL clients, and compute the (mean, variance) on its own data. Such a solution is also in line with what was done in recent literature, e.g., SiloBN (Andreux et al., 2020). We conduct the experiment with this solution for FedBN and compared its performance with FedAvg and FedProx. Specifically, we use the digits classification task and treat the two unseen datasets – Morpho-global and Morpho-local from Morpho-MNIST (Castro et al., 2019) as the two new clients. The new clients contain substantially perturbed digits. Specifically, Morpho-global containing thinning and thickening versions of MNIST digits, while Morpho-local changes MNIST by swelling and fractures. The results are listed in Table 17. It is observed that the obtained results from three methods are generally comparable in such a challenging setting, with FedBN presenting slightly higher performance on overall average accuracy.
|
| 575 |
+
|
| 576 |
+
<table><tr><td></td><td>Morpho-global</td><td>Morpho-local</td></tr><tr><td>FedBN</td><td>92.45</td><td>94.61</td></tr><tr><td>FedProx</td><td>92.35</td><td>94.31</td></tr><tr><td>FedAvg</td><td>91.28</td><td>93.55</td></tr></table>
|
| 577 |
+
|
| 578 |
+
Table 17: Generalizing the global model to unseen-domain clients.
|
md/train/74RmfBweB60/74RmfBweB60.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fast Policy Extragradient Methods for Competitive Games with Entropy Regularization
|
| 2 |
+
|
| 3 |
+
Shicong Cen Carnegie Mellon University shicongc@andrew.cmu.edu
|
| 4 |
+
|
| 5 |
+
Yuting Wei University of Pennsylvania ytwei@wharton.upenn.edu
|
| 6 |
+
|
| 7 |
+
Yuejie Chi Carnegie Mellon University yuejiechi@cmu.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
This paper investigates the problem of computing the equilibrium of competitive games, which is often modeled as a constrained saddle-point optimization problem with probability simplex constraints. Despite recent efforts in understanding the last-iterate convergence of extragradient methods in the unconstrained setting, the theoretical underpinnings of these methods in the constrained settings, especially those using multiplicative updates, remain highly inadequate, even when the objective function is bilinear. Motivated by the algorithmic role of entropy regularization in single-agent reinforcement learning and game theory, we develop provably efficient extragradient methods to find the quantal response equilibrium (QRE)—which are solutions to zero-sum two-player matrix games with entropy regularization—at a linear rate. The proposed algorithms can be implemented in a decentralized manner, where each player executes symmetric and multiplicative updates iteratively using its own payoff without observing the opponent’s actions directly. In addition, by controlling the knob of entropy regularization, the proposed algorithms can locate an approximate Nash equilibrium of the unregularized matrix game at a sublinear rate without assuming the Nash equilibrium to be unique. Our methods also lead to efficient policy extragradient algorithms for solving entropy-regularized zero-sum Markov games at a linear rate. All of our convergence rates are nearly dimension-free, which are independent of the size of the state and action spaces up to logarithm factors, highlighting the positive role of entropy regularization for accelerating convergence.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Finding the equilibrium of competitive games, which can be viewed as constrained saddle-point optimization problems with probability simplex constraints, lies at the heart of modern machine learning and decision making paradigms such as Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), competitive reinforcement learning (RL) (Littman, 1994), game theory (Shapley, 1953), adversarial training (Mertikopoulos et al., 2018b), to name a few.
|
| 16 |
+
|
| 17 |
+
In this paper, we study one of the most basic forms of competitive games, namely two-player zero-sum games, in both the matrix setting and the Markov setting. Our goal is to find the equilibrium policies of both players in an independent and decentralized manner (Daskalakis et al., 2020; Wei et al., 2021a) with guaranteed last-iterate convergence. Namely, each player will execute symmetric and independent updates iteratively using its own payoff without observing the opponent’s actions directly, and the final policies of the iterative process should be a close approximation to the equilibrium up to any prescribed precision. This kind of algorithms is more advantageous and versatile especially in federated environments, as it requires neither prior coordination between the players like twotimescale algorithms, nor a central controller to collect and disseminate the policies of all the players, which are often unavailable due to privacy constraints.
|
| 18 |
+
|
| 19 |
+
# 1.1 Last-iterate convergence in competitive games
|
| 20 |
+
|
| 21 |
+
In recent years, there have been significant progresses in understanding the last-iterate convergence of simple iterative algorithms for unconstrained saddle-point optimization, where one is interested in bounding the sub-optimality of the last iterate of the algorithm, rather than say, the ergodic iterate — which is the average of all the iterations — that are commonly studied in the earlier literature. This shift of focus is motivated, for example, by the infeasibility of averaging large machine learning models in training GANs (Goodfellow et al., 2014). While vanilla Gradient Descent / Ascent (GDA) may diverge or cycle even for bilinear matrix games (Daskalakis et al., 2018), quite remarkably, small modifications lead to guaranteed last-iterate convergence to the equilibrium in a non-asymptotic fashion. A flurry of algorithms is proposed, including Optimistic Gradient Descent Ascent (OGDA) (Rakhlin and Sridharan, 2013; Daskalakis and Panageas, 2018b; Wei et al., 2021b), predictive updates (Yadav et al., 2017), implicit updates (Liang and Stokes, 2019), and more. Several unified analyses of these algorithms have been carried out (see, e.g. Mokhtari et al. (2020a); Liang and Stokes (2019) and references therein), where these methods in principle all make clever extrapolation of the local curvature in a predictive manner to accelerate convergence. With slight abuse of terminology, in this paper, we refer to this ensemble of algorithms as extragradient methods (Korpelevich, 1976; Tseng, 1995; Mertikopoulos et al., 2018a; Harker and Pang, 1990).
|
| 22 |
+
|
| 23 |
+
However, saddle-point optimization in the constrained setting, which includes competitive games as a special case, remains largely under-explored even for bilinear matrix games. While it is possible to reformulate constrained bilinear games to unconstrained ones using softmax parameterization of the probability simplex, this approach falls short of preserving the bilinear structure and convexconcave properties in the original problem, which are crucial to the convergence of gradient methods. Therefore, there is a strong necessity of understanding and developing improved extragradient methods in the constrained setting. Daskalakis and Panageas (2018a) proposed the optimistic variant of the multiplicative weight updates (MWU) method (Arora et al., 2012) – which is extremely natural and popular for optimizing over probability simplexes – called Optimistic Multiplicative Weight Updates (OMWU), and established the asymptotic last-iterate convergence of OMWU for matrix games. Very recently, Wei et al. (2021b) established non-asymptotic last-iterate convergences of OMWU. However, these last-iterate convergence results require the Nash equilibrium to be unique, and cannot be applied to problems with multiple Nash equilibria.
|
| 24 |
+
|
| 25 |
+
# 1.2 Our contributions
|
| 26 |
+
|
| 27 |
+
Motivated by the algorithmic role of entropy regularization in single-agent RL (Neu et al., 2017; Geist et al., 2019; Cen et al., 2020) as well as its wide use in game theory to account for imperfect and noisy information (McKelvey and Palfrey, 1995; Savas et al., 2019), we initiate the design and analysis of extragradient algorithms using multiplicative updates for finding the quantal response equilibrium (QRE), which are solutions to competitive games with entropy regularization (McKelvey and Palfrey, 1995). While finding QRE is of interest in its own right, by controlling the knob of entropy regularization, the QRE provides a close approximation to the Nash equilibrium (NE), and in turn acts as a smoothing scheme for finding the NE. Our contributions are summarized below.
|
| 28 |
+
|
| 29 |
+
• Near dimension-free last-iterate convergence to QRE of entropy-regularized matrix games. We propose two policy extragradient algorithms to solve entropy-regularized matrix games, namely the Predictive Update (PU) and OMWU methods, where both players execute symmetric and multiplicative updates without knowing the entire payoff matrix nor the opponent’s actions. Encouragingly, we show that the last iterate of the proposed algorithms converges to the unique QRE at a linear rate that is almost independent of the size of the action spaces. Roughly speaking, to find an $\epsilon$ -optimal QRE in terms of Kullback-Leibler (KL) divergence, it takes no more than $\begin{array} { r } { \widetilde O \left( \frac { 1 } { \eta \tau } \log \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations, where ${ \widetilde { O } } ( \cdot )$ hides logarithmic dependencies. Here, $\tau$ is the regularization parameter, and $\eta$ is the learning rate of both players. Maximizing the learning rate, the iteration complexity is bounded by $\widetilde { O } \left( ( 1 + \| A \| _ { \infty } / \tau ) \log ( 1 / \epsilon ) \right)$ , where $\left\| A \right\| _ { \infty } = \operatorname* { m a x } _ { i , j } \left| A _ { i , j } \right|$ is the $\ell _ { \infty }$ norm of the payoff matrix $A$ .
|
| 30 |
+
|
| 31 |
+
• Last-iterate convergence to $\epsilon$ -NE of unregularized matrix games without uniqueness assumption. The QRE provides an accurate approximation to the NE by setting the entropy regularization $\tau$ sufficiently small, therefore our result directly translates to finding a NE with last-iterate convergence guarantee. Roughly speaking, to find an $\epsilon$ -NE (Zhang et al., 2020, Definition 2.1), it takes no more than $\begin{array} { r } { \widetilde { O } \left( 1 + \frac { \| A \| _ { \infty } } { \epsilon } \right) } \end{array}$ iterations with optimized learning rates, which is again independent of the size of the action spaces up to logarithmic factors. Unlike prior literature (Daskalakis and Panageas, 2018a; Wei et al., 2021b), our last-iterate convergence guarantee does not require the NE to be unique.
|
| 32 |
+
|
| 33 |
+
Table 1: Comparisons of last-iterate convergence of the proposed entropy-regularized PU and OMWU methods with prior results for finding $\epsilon$ -QRE or $\mathrm { \epsilon - N E }$ of competitive matrix games. We note that the convergence rates of unregularized OMWU established in Wei et al. (2021b) are problemdependent, and scale at least polynomially on the size of the action spaces. Desirable features in the last two columns are highlighted in blue.
|
| 34 |
+
|
| 35 |
+
<table><tr><td rowspan=1 colspan=1>Equilibriumtype</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Convergence rate</td><td rowspan=1 colspan=1>Dimension-free</td><td rowspan=1 colspan=1>Requireunique NE</td></tr><tr><td rowspan=1 colspan=1>E-QRE</td><td rowspan=1 colspan=1>PU&OMWU(this work)</td><td rowspan=1 colspan=1>linear</td><td rowspan=1 colspan=1>yes</td><td rowspan=1 colspan=1>n/a</td></tr><tr><td rowspan=3 colspan=1>e-NE</td><td rowspan=1 colspan=1>OMWU(Daskalakis and Panageas, 2018a)</td><td rowspan=1 colspan=1>asymptotic</td><td rowspan=1 colspan=1>no</td><td rowspan=1 colspan=1>yes</td></tr><tr><td rowspan=1 colspan=1>OMWU(Wei et al., 2021b)</td><td rowspan=1 colspan=1>sublinear + linear</td><td rowspan=1 colspan=1>no</td><td rowspan=1 colspan=1>yes</td></tr><tr><td rowspan=1 colspan=1>PU&OMWU(this work)</td><td rowspan=1 colspan=1>sublinear</td><td rowspan=1 colspan=1>yes</td><td rowspan=1 colspan=1>no</td></tr></table>
|
| 36 |
+
|
| 37 |
+
• Extensions to two-player zero-sum Markov games. By connecting value iteration with matrix games, we propose a policy extragradient method for solving infinite-horizon discounted entropyregularized zero-sum Markov games, which finds an $\epsilon$ -optimal minimax soft Q-function—in terms of $\ell _ { \infty }$ error—in at most $\begin{array} { r } { \widetilde O \left( \frac { 1 } { \tau ( 1 - \gamma ) ^ { 2 } } \log ^ { 2 } \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations, where $\gamma \in ( 0 , 1 )$ is the discount factor.
|
| 38 |
+
|
| 39 |
+
To the best of our knowledge, our paper is the first that develops policy extragradient algorithms for solving entropy-regularized competitive games with multiplicative updates and dimension-free linear last-iterate convergence, and demonstrates entropy regularization as a smoothing technique to find $\mathrm { \epsilon - N E }$ without the uniqueness assumption. Table 1 provides detailed comparisons of the proposed methods with prior arts for solving matrix games. Our results highlight the positive role of entropy regularization for accelerating convergence and safeguarding against imperfect information in competitive games. We defer the complete proof of our results to Cen et al. (2021).
|
| 40 |
+
|
| 41 |
+
# 1.3 Related works
|
| 42 |
+
|
| 43 |
+
Our work lies at the intersection of saddle-point optimization, game theory, and reinforcement learning. In what follows, we discuss a few topics that are closely related to ours.
|
| 44 |
+
|
| 45 |
+
Unregularized matrix game. Freund and Schapire (1999) showed that many standard methods such as GDA and MWU have a converging average duality gap at the rate of $O ( 1 / \sqrt { T } )$ , which is improved to $O ( 1 / T )$ by considering optimistic variants of these methods, such as OGDA and OMWU (Rakhlin and Sridharan, 2013; Daskalakis et al., 2011; Syrgkanis et al., 2015). However, the last-iterate convergence of these methods are less understood until recently (Daskalakis and Panageas, 2018a; Wei et al., 2021b). In particular, under the assumption that the NE is unique for the unregularized matrix game, Daskalakis and Panageas (2018a) showed the asymptotic convergence of the last iterate of OMWU to the unique equilibrium, and Wei et al. (2021b) showed the last iterate of OMWU achieves a linear rate of convergence after an initial phase of sublinear convergence, however the rates therein can be highly pessimistic in terms of the problem dimension, while our rate for entropy-regularized OMWU is dimension-free up to logarithmic factors.
|
| 46 |
+
|
| 47 |
+
Saddle-point optimization. Considerable progress has been made towards understanding OGDA and extragradient (EG) methods in the unconstrained convex-concave saddle-point optimization with general objective functions (Mokhtari et al., 2020a,b; Nemirovski, 2004; Liang and Stokes, 2019). However, the last-iterate convergence of constrained convex-concave saddle-point optimization still lacks theoretical understanding in general and most works fall short of characterizing a finite-time convergence result. In particular, Mertikopoulos et al. (2018a) demonstrated the asymptotic lastiterate convergence of EG, and Hsieh et al. (2019) investigated similar questions for single-call EG algorithms. Lei et al. (2021) showed that OMWU converges to the equilibrium locally without an explicit rate. Wei et al. (2021b) showed that the last-iterate of OGDA converges linearly for strongly-convex strongly-concave constrained saddle-point optimization with an explicit rate.
|
| 48 |
+
|
| 49 |
+
Entropy regularization in RL and games. In single-agent RL, the role of entropy regularization as an algorithmic mechanism to encourage exploration and accelerate convergence has been investigated extensively (Neu et al., 2017; Geist et al., 2019; Mei et al., 2020; Cen et al., 2020; Lan, 2021; Zhan et al., 2021). Turning to the game setting, entropy regularization is used to account for imperfect information in the seminal work of McKelvey and Palfrey (1995) that introduced the QRE, and a few representative works on entropy and more general regularizations in games include Savas et al. (2019); Hofbauer and Sandholm (2002); Mertikopoulos and Sandholm (2016).
|
| 50 |
+
|
| 51 |
+
Zero-sum Markov games. There have been a significant recent interest in developing provably efficient self-play algorithms for Markov games, including model-based algorithms (Perolat et al., 2015; Zhang et al., 2020), value-based algorithms (Bai and Jin, 2020; Xie et al., 2020), and policybased algorithms (Daskalakis et al., 2020; Wei et al., 2021a; Zhao et al., 2021). The iteration complexities in prior works (Perolat et al., 2015; Daskalakis et al., 2020; Wei et al., 2021a; Zhao et al., 2021) depend on various notions of concentrability coefficient and therefore can scale quite pessimistically with the problem dimension. Our approach can be regarded as a policy-based algorithm to approximate value iteration, which can be implemented in a decentralized manner with symmetric and multiplicative updates from both players, and the iteration complexity is almost independent of the size of the state-action space.
|
| 52 |
+
|
| 53 |
+
Notation. We denote by $\Delta ( \mathcal { A } )$ the probability simplex over the set $\mathcal { A }$ . We overload the functions such as $\log ( \cdot )$ and $\exp ( \cdot )$ to take vector inputs with the understanding that the function is applied in an entrywise manner. For instance, given any vector $z = [ z _ { i } ] _ { 1 \leq i \leq n } \in \mathbb { R } ^ { n }$ , the notation $\exp ( z )$ denotes $\exp ( z ) : = [ \exp ( z _ { i } ) ] _ { 1 \leq i \leq n }$ ; other functions are defined analogously. Given two probability distributions $\mu$ and $\mu ^ { \prime }$ over $\mathcal { A }$ , the KL divergence from $\mu ^ { \prime }$ to $\mu$ is defined by $\begin{array} { r } { \mathsf { K L } ( \mu \parallel \mu ^ { \prime } ) : = \sum _ { a \in \mathcal { A } } \mu ( a ) \log \frac { \mu ( a ) } { \mu ^ { \prime } ( a ) } } \end{array}$ . Given a matrix $A$ , $\| A \| _ { \infty }$ is used to denote entrywise maximum norm, namely, $\left\| A \right\| _ { \infty } = \operatorname* { m a x } _ { i , j } \left| A _ { i , j } \right|$ . The all-one vector is denoted as 1.
|
| 54 |
+
|
| 55 |
+
# 2 Zero-sum matrix games with entropy regularization
|
| 56 |
+
|
| 57 |
+
We first consider a two-player zero-sum game with bilinear objective and probability simplex constraints, and demonstrate the positive role of entropy regularization in solving this problem. Throughout this paper, let $\mathcal { A } = \{ 1 , \dotsc , m \}$ and $\boldsymbol { B } = \{ 1 , \ldots , \bar { n } \}$ be the action spaces of each player.
|
| 58 |
+
|
| 59 |
+
# 2.1 Background and problem formulation
|
| 60 |
+
|
| 61 |
+
Zero-sum two-player matrix game. The focal point of this subsection is a constrained two-player zero-sum matrix game, which can be formulated as the following min-max problem (or saddle point optimization problem):
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\operatorname* { m a x } _ { \mu \in \Delta ( \mathcal { A } ) } \operatorname* { m i n } _ { \nu \in \Delta ( \mathcal { B } ) } f ( \mu , \nu ) : = \mu ^ { \top } A \nu ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\textbf { \textit { A } } \in \mathbb { R } ^ { m \times n }$ denotes the payoff matrix, $\mu ~ \in ~ \Delta ( { \mathcal { A } } )$ and $\nu ~ \in ~ \Delta ( B )$ stand for the mixed/randomized policies of each player, defined respectively as distributions over the probability simplex $\Delta ( \mathcal { A } )$ and $\Delta ( B )$ . A pair of policies $( \mu ^ { \star } , \nu ^ { \star } )$ is said to be a Nash equilibrium (NE) of (1) if $f ( \mu ^ { \star } , \nu ) \geq f ( \mu ^ { \star } , \nu ^ { \star } ) \geq f ( \mu , \nu ^ { \star } )$ for all $( \mu , \nu ) \in \Delta ( \mathcal { A } ) \times \Delta ( \mathcal { B } )$ .
|
| 68 |
+
|
| 69 |
+
Entropy-regularized zero-sum two-player matrix game. There is no shortage of scenarios where the payoff matrix $A$ might not be known perfectly. In an attempt to accommodate imperfect knowledge of $A$ , McKelvey and Palfrey (1995) proposed a seminal extension to the Nash equilibrium called the quantal response equilibrium $( Q R E )$ when the payoffs are perturbed by Gumbel-distributed noise. Formally, this amounts to solving the following matrix game with entropy regularization (Mertikopoulos and Sandholm, 2016):
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\operatorname* { m a x } _ { \mu \in \Delta ( \mathcal { A } ) } \operatorname* { m i n } _ { \nu \in \Delta ( \mathcal { B } ) } f _ { \tau } ( \mu , \nu ) : = \mu ^ { \top } A \nu + \tau \mathcal { H } ( \mu ) - \tau \mathcal { H } ( \nu ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\begin{array} { r } { \mathcal { H } ( \pi ) = - \sum _ { i } \pi _ { i } \log ( \pi _ { i } ) } \end{array}$ denotes the Shannon entropy of a distribution $\pi$ , and $\tau \geq 0$ is the regularization parameter. As is well known, the optimal solution $( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } )$ to (2), dubbed as the QRE,
|
| 76 |
+
|
| 77 |
+
is unique whenever $\tau > 0$ (due to the presence of strong concavity/convexity), which satisfies the following fixed point equations:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \biggr \{ \mu _ { \tau } ^ { \star } ( a ) = \frac { \exp ( [ A \nu _ { \tau } ^ { \star } ] a / \tau ) } { \sum _ { a = 1 } ^ { m } \exp ( [ A \nu _ { \tau } ^ { \star } ] a / \tau ) } \propto \exp ( [ A \nu _ { \tau } ^ { \star } ] a / \tau ) , \qquad \mathrm { f o r ~ a l l } \ a \in \mathcal { A } , } \\ { \nu _ { \tau } ^ { \star } ( b ) = \frac { \exp ( - [ A ^ { \top } \mu _ { \tau } ^ { \star } ] b / \tau ) } { \sum _ { b = 1 } ^ { n } \exp ( - [ A ^ { \top } \mu _ { \tau } ^ { \star } ] b / \tau ) } \propto \exp ( - [ A ^ { \top } \mu _ { \tau } ^ { \star } ] b / \tau ) , \quad \mathrm { f o r ~ a l l } \ b \in \mathcal { B } . } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Goal. We aim to efficiently compute the QRE of the entropy-regularized matrix game in a decentralized manner, and investigate how an efficient solver of QRE can be leveraged to find a NE of the unregularized matrix game (1). Namely, we only assume access to “first-order information” as opposed to full knowledge of the payoff matrix $A$ or the actions of the opponent. The information received by each player is formally described in the following sampling oracle.
|
| 84 |
+
|
| 85 |
+
Definition 1 (Sampling oracle for matrix games). For any policy pair $( \mu , \nu )$ and payoff matrix $A$ the sampling oracle returns the exact values of $\mu ^ { \top } A$ and $A \nu$ .
|
| 86 |
+
|
| 87 |
+
Additional notation. For notational convenience, we let $\zeta$ represent the concatenation of $\mu \in \mathbb { R } ^ { | \mathcal { A } | }$ and $\nu \in \mathbb { R } ^ { | B | }$ , namely, $\zeta = ( \mu , \nu )$ . The solution to (2), which is specified in (3), is denoted by $\zeta _ { \tau } ^ { \star } = ( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } )$ . For any $\zeta = ( \mu , \nu )$ and $\zeta ^ { \prime } = ( \mu ^ { \prime } , \nu ^ { \prime } )$ , we shall often abuse the notation and let $\mathsf { K L } \big ( \zeta \| \zeta ^ { \prime } \big ) = \mathsf { K L } \big ( \mu \| \mu ^ { \prime } \big ) + \mathsf { K L } \big ( \nu \| \nu ^ { \prime } \big )$ . The duality gap of the entropy-regularized matrix game (2) at $\zeta = ( \mu , \nu )$ is defined as $\begin{array} { r } { \mathsf { D u a l G a p } _ { \tau } ( \zeta ) = \operatorname* { m a x } _ { \mu ^ { \prime } \in \Delta ( A ) } f _ { \tau } ( \mu ^ { \prime } , \nu ) - \operatorname* { m i n } _ { \nu ^ { \prime } \in \Delta ( B ) } f _ { \tau } ( \mu , \nu ^ { \prime } ) } \end{array}$ which is clearly nonnegative and $\mathsf { D u a l G a p } _ { \tau } ( \boldsymbol { \zeta } _ { \tau } ^ { \star } ) = 0$ . Similarly, let the optimality gap of the entropyregularized matrix game (2) at $\zeta = ( \mu , \nu )$ be $\mathsf { O p t G a p } ( \zeta ) = \left| f _ { \tau } ( \mu , \nu ) - f _ { \tau } ( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } ) \right|$ .
|
| 88 |
+
|
| 89 |
+
# 2.2 Proposed extragradient methods: PU and OMWU
|
| 90 |
+
|
| 91 |
+
To begin, assume we are given a pair of policies $z _ { 1 } \in \Delta ( \mathcal { A } )$ , $z _ { 2 } \in \Delta ( B )$ employed by each player respectively. If we proceed with fictitious play, i.e. player 1 (resp. player 2) aims to optimize its own policy by assuming the opponent’s policy is fixed as $z _ { 2 }$ (resp. $z _ { 1 }$ ), the saddle-point optimization problem (2) is then decoupled into two independent min/max optimization problems:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\operatorname* { m a x } _ { \mu \in \Delta ( A ) } \mu ^ { \top } A z _ { 2 } + \tau \mathcal { H } ( \mu ) - \tau \mathcal { H } ( z _ { 2 } ) \qquad \mathrm { a n d } \qquad \operatorname* { m i n } _ { \nu \in \Delta ( B ) } z _ { 1 } ^ { \top } A \nu + \tau \mathcal { H } ( z _ { 1 } ) - \tau \mathcal { H } ( \nu ) ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
which are naturally solved via mirror descent / ascent with KL divergence. Specifically, one step of mirror descent / ascent takes the form
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A z _ { 2 } ] _ { a } ) , } & { \mathrm { f o r ~ a l l ~ } a \in \mathcal { A } , } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } z _ { 1 } ] _ { b } ) , } & { \mathrm { f o r ~ a l l ~ } b \in \mathcal { B } , } \end{array} \right. } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\eta$ is the learning rate. The above update rule forms the basis of our algorithm design.
|
| 104 |
+
|
| 105 |
+
Motivation: a form of implicit updates with linear convergence. It turns out, if we could select the policy pair $( z _ { 1 } , z _ { 2 } ) = \hat { \zeta } ^ { ( t + 1 ) } : \stackrel { \bullet } { = } ( \mu ^ { ( t + 1 ) } , \nu ^ { ( t + 1 ) } )$ as the ones to be taken in the future, and call the resulting update rule as the Implicit Update (IU) method:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r } { \left\{ \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \nu ^ { ( t + 1 ) } ] _ { a } ) , \right. \left. \mathrm { f o r ~ a l l } \ : a \in \mathcal { A } , \right. } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \mu ^ { ( t + 1 ) } ] _ { b } ) , \left. \mathrm { f o r ~ a l l } \ : b \in \mathcal { B } . \right. } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Though unrealistic — since it uses the future updates — it leads to a one-step convergence to the QRE when $\eta = 1 / \tau$ (see the optimality condition in (3)). Encouragingly, we have the following linear convergence guarantee of IU when adopting a general learning rate.
|
| 112 |
+
|
| 113 |
+
Proposition 1 (Linear convergence of IU). Assume $0 < \eta \leq 1 / \tau$ , then for all $t \geq 0$ , the iterates $\zeta ^ { ( t ) } : = ( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ of the $I U$ method in (5) satisfy $\mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \parallel \zeta ^ { ( t ) } \big ) \leq ( 1 - \eta \tau ) ^ { t } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \parallel \zeta ^ { ( 0 ) } \big )$ .
|
| 114 |
+
|
| 115 |
+
In words, the IU method achieves an appealing linear rate of convergence that is independent of the problem dimension. Motivated by this observation, we seek to design algorithms where the policies $( z _ { 1 } , z _ { 2 } )$ employed in (4) serve as good predictions of $( \mu ^ { ( t + 1 ) } , \nu ^ { ( t + \bar { 1 ) } } )$ , such that the resulting algorithms are both practical and retain the appealing convergence rate of IU.
|
| 116 |
+
|
| 117 |
+
Proposed algorithms. We propose two extragradient algorithms for solving the entropy-regularized matrix game, namely the Predictive Update $( P U )$ method and the Optimistic Multiplicative Weights
|
| 118 |
+
|
| 119 |
+
# Algorithm 1: The PU method
|
| 120 |
+
|
| 121 |
+
# Algorithm 2: The OMWU method
|
| 122 |
+
|
| 123 |
+
1 initialization: $\mu ^ { ( 0 ) }$ , $\nu ^ { ( 0 ) }$
|
| 124 |
+
|
| 125 |
+
2 for $t = 0 , 1 , 2 , \cdots$ do
|
| 126 |
+
|
| 127 |
+
2 for $t = 0 , 1 , 2 , \cdots$ do
|
| 128 |
+
|
| 129 |
+
3 Update $\bar { \mu }$ and $\bar { \nu }$ according to
|
| 130 |
+
|
| 131 |
+
3
|
| 132 |
+
|
| 133 |
+
Update $\bar { \mu }$ and $\bar { \nu }$ according to
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { r } { \left\{ \bar { \mu } ^ { ( t + 1 ) } ( a ) \propto { \mu } ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \nu ^ { ( t ) } ] _ { a } ) , \right. \qquad } \\ { \left. \bar { \nu } ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } { \mu } ^ { ( t ) } ] _ { b } ) . \right. } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r } { \left\{ \bar { \mu } ^ { ( t + 1 ) } ( a ) \propto { \mu } ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \bar { \nu } ^ { ( t ) } ] _ { a } ) , \right. \mathrm { ~ } } \\ { \left. \bar { \nu } ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \bar { \mu } ^ { ( t ) } ] _ { b } ) . \right. } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
4 Update $\mu$ and $\nu$ according to
|
| 144 |
+
|
| 145 |
+
Update $\mu$ and $\nu$ according to
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \bar { \nu } ^ { ( t + 1 ) } ] _ { a } ) , } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \bar { \mu } ^ { ( t + 1 ) } ] _ { b } ) . } \end{array} \right. } \end{array}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \mu ^ { ( t + 1 ) } ( a ) \propto \mu ^ { ( t ) } ( a ) ^ { 1 - \eta \tau } \exp ( \eta [ A \bar { \nu } ^ { ( t + 1 ) } ] _ { a } ) , } \\ { \nu ^ { ( t + 1 ) } ( b ) \propto \nu ^ { ( t ) } ( b ) ^ { 1 - \eta \tau } \exp ( - \eta [ A ^ { \top } \bar { \mu } ^ { ( t + 1 ) } ] _ { b } ) . } \end{array} \right. } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
Update (OMWU) method, the latter adapted from Rakhlin and Sridharan (2013); Daskalakis et al. (2011). Detailed procedures can be found in Algorithm 1 and Algorithm 2, respectively. On a high level, both algorithms maintain two intertwined sequences $\{ ( \mu ^ { ( \bar { t } ) } , \nu ^ { ( t ) } ) \} _ { t \geq 0 }$ and $\{ ( \bar { \mu } ^ { ( \dot { t } ) } , \bar { \nu } ^ { ( t ) } ) \} _ { t \geq 0 }$ , and in each iteration $t = 0 , 1 , \ldots$ , proceed in two steps:
|
| 156 |
+
|
| 157 |
+
• The midpoint $( \bar { \mu } ^ { ( t + 1 ) } , \bar { \nu } ^ { ( t + 1 ) } )$ serves as a prediction of $( \mu ^ { ( t + 1 ) } , \nu ^ { ( t + 1 ) } )$ by running one step of mirror descent / ascent (cf. (4)) from either $( z _ { 1 } , z _ { 2 } ) = ( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ (for PU) or $( z _ { 1 } , z _ { 2 } ) = ( \bar { \mu } ^ { ( t ) } , \bar { \nu } ^ { ( t ) } )$ (for OMWU).
|
| 158 |
+
|
| 159 |
+
• The update of $( \boldsymbol { \mu } ^ { ( t + 1 ) } , \boldsymbol { \nu } ^ { ( t + 1 ) } )$ then mimics the implicit update (5) using the prediction $( \bar { \mu } ^ { ( t + 1 ) } , \bar { \nu } ^ { ( t + 1 ) } )$ obtained above.
|
| 160 |
+
|
| 161 |
+
When the proposed algorithms converge, both $( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ and $( \bar { \mu } ^ { ( t ) } , \bar { \nu } ^ { ( t ) } )$ converge to the same point. The two players are completely symmetric and adopt the same learning rate, and require only first-order information provided by the sampling oracle. While the two algorithms resemble each other in many aspects, a key difference lies in the query and use of the sampling oracle: in each iteration, OMWU makes a single call to the sampling oracle for gradient evaluation, while PU calls the sampling oracle twice. It is worth noting that, when $\tau = 0$ (i.e., no entropy regularization is enforced), the OMWU method in Algorithm 2 reduces to the method analyzed in Rakhlin and Sridharan (2013); Daskalakis and Panageas (2018a); Wei et al. (2021b) without entropy regularization.
|
| 162 |
+
|
| 163 |
+
Remark 1. It is worth highlighting that the proposed algorithms are different from Mertikopoulos et al. (2018a), as the extragradient is only applied to the bilinear term but not the entropy regularization term. This seemingly small, but important, difference leads to a more concise closed-form update rule and a cleaner analysis, as shall be seen momentarily.
|
| 164 |
+
|
| 165 |
+
# 2.3 Performance guarantees
|
| 166 |
+
|
| 167 |
+
We are now positioned to present our main theorem concerning the last-iterate convergence of PU and OMWU for solving (2).
|
| 168 |
+
|
| 169 |
+
Theorem 1 (Last-iterate convergence of PU and OMWU). Suppose that the learning rates $\eta = \eta _ { \mathsf { P U } }$ of $P U$ in Algorithm $I$ and $\eta = \eta$ OMWU of OMWU in Algorithm 2 satisfy
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
0 < \eta _ { \mathsf { P U } } \leq \frac { 1 } { \tau + 2 \left\| A \right\| _ { \infty } } , a n d 0 < \eta _ { \mathsf { O M W U } } \leq \operatorname* { m i n } \left\{ \frac { 1 } { 2 \tau + 2 \left\| A \right\| _ { \infty } } , \frac { 1 } { 4 \left\| A \right\| _ { \infty } } \right\} .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
Then for any $t \geq 0$ , the iterates $\zeta ^ { ( t ) } = ( \mu ^ { ( t ) } , \nu ^ { ( t ) } )$ and $\bar { \zeta } ^ { ( t ) } = ( \bar { \mu } ^ { ( t ) } , \bar { \nu } ^ { ( t ) } )$ of $P U$ and OMWU achieve
|
| 176 |
+
|
| 177 |
+
# • Linear convergence of policies in KL divergence and entrywise log-ratios:
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\begin{array} { r l } & { \operatorname* { m a x } \left\{ \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( t ) } \big ) , \frac { 1 } { 2 } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \bar { \zeta } ^ { ( t + 1 ) } \big ) \right\} \leq ( 1 - \eta \tau ) ^ { t } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) , } \\ & { \left\| \log \frac { \zeta ^ { ( t ) } } { \zeta _ { \tau } ^ { \star } } \right\| _ { \infty } \leq 2 ( 1 - \eta \tau ) ^ { t } \left\| \log \frac { \zeta ^ { ( 0 ) } } { \zeta _ { \tau } ^ { \star } } \right\| _ { \infty } + \frac { 8 \| A \| _ { \infty } } { \tau } ( 1 - \eta \tau ) ^ { t / 2 } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) ^ { 1 / 2 } . } \end{array}
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
# • Linear convergence of values in optimality and duality gaps:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\begin{array} { r l } & { \mathsf { O p t G a p } _ { \tau } ( \bar { \zeta } ^ { ( t ) } ) \leq \eta ^ { - 1 } \cdot \frac { 1 } { 1 - ( \tau + \| A \| _ { \infty } ) \eta } \cdot \frac { ( 1 - \eta \tau ) ^ { t } } { 1 - ( 1 - \eta \tau ) ^ { t } } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) , } \\ & { \mathsf { D u a l G a p } _ { \tau } ( \bar { \zeta } ^ { ( t ) } ) \leq \left( \eta ^ { - 1 } + 2 \tau ^ { - 1 } \| A \| _ { \infty } ^ { 2 } \right) ( 1 - \eta \tau ) ^ { t - 1 } \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) . } \end{array}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
Remark 2. Setting $\mu ^ { ( 0 ) }$ and $\nu ^ { ( 0 ) }$ to be uniform policies leads to a universal bound
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\begin{array} { r } { \mathsf { K L } \big ( \zeta _ { \tau } ^ { \star } \| \zeta ^ { ( 0 ) } \big ) = \log | \mathcal { A } | + \log | \mathcal { B } | - \mathcal { H } ( \mu _ { \tau } ^ { \star } ) - \mathcal { H } ( \nu _ { \tau } ^ { \star } ) \leq \log | \mathcal { A } | + \log | \mathcal { B } | . } \end{array}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
Remark 3. Similar results continue to hold even when the two players use different regularization parameters $\tau _ { \mu } , \tau _ { \nu } > 0$ in (2), as long as the regularization parameter $\tau$ is replaced by max $\{ \tau _ { \mu } , \tau _ { \nu } \}$ in the upper bounds of the learning rate, and the contraction parameter is replaced by $1 - \operatorname* { m i n } \{ \tau _ { \mu } , \tau _ { \nu } \} \eta$ .
|
| 196 |
+
|
| 197 |
+
Theorem 1 characterizes the convergence of the last-iterates $\zeta ^ { ( t ) }$ and $\bar { \zeta } ^ { ( t ) }$ of PU and OMWU as long as the learning rate lies within the specified ranges. While PU doubles the number of calls to the sampling oracle, it also allows roughly as large as twice the learning rate compared with OMWU (cf. (6)). Compared with the vast literature analyzing the average-iterate performance of variants of extragradient methods, our results contribute towards characterizing the last-iterate convergence of multiplicative update methods in the presence of entropy regularization and simplex constraints, which to the best of our knowledge, are the first of its kind. Several remarks are in order.
|
| 198 |
+
|
| 199 |
+
Linear convergence to QRE. To achieve an $\epsilon$ -accurate estimate of the QRE in terms of the KL divergence, the bound (7a) tells that it is sufficient to take
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
\frac { 1 } { \eta \tau } \log \left( \frac { \log | \cal { A } | + \log | \cal { B } | } { \epsilon } \right)
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
iterations using either PU or OMWU. Notably, this iteration complexity does not depend on any hidden constants and only depends double logarithmically on the cardinality of action spaces, which is almost dimension-free. Maximizing the learning rate, the iteration complexity is bounded by $( 1 + \| A \| _ { \infty } / \tau ) \log ( 1 / \epsilon )$ (modulo log factors), which only depends on the ratio $\| A \| _ { \infty } / \tau$ .
|
| 206 |
+
|
| 207 |
+
Entrywise error of the policy log-ratios. Both PU and OMWU enjoy strong entrywise guarantees in the sense we can guarantee the convergence of the $\ell _ { \infty }$ norm of the log-ratios between the learned policy pair and the QRE at the same dimension-free linear rate (cf. (7b)), which suggests the policy pair converges in a somewhat uniform manner across the entire action space.
|
| 208 |
+
|
| 209 |
+
Linear convergence of optimality and duality gaps. Our theorem also establishes the last-iterate convergence of the game values in terms of the optimality gap (cf. (7c)) and the duality gap (cf. (7d)) for both PU and OMWU. In particular, as will be seen, bounding the optimality gap of matrix games turns out to be the key enabler for generalizing our algorithms to Markov games, and bounding the duality gap allows to directly translate our results to finding a NE of unregularized matrix games.
|
| 210 |
+
|
| 211 |
+
Last-iterate convergence to approximate NE. The entropy-regularized matrix game can be thought as a smooth surrogate of the unregularized matrix game (1); in particular, it is possible to find an $\epsilon$ -NE by setting $\tau$ sufficiently small in (2). According to (Zhang et al., 2020, Definition 2.1), a policy pair $\bar { \zeta } = ( \mu , \bar { \nu } )$ is an $\epsilon$ -NE if it satisfies $\begin{array} { r } { \mathsf { D u a l G a p } ( \zeta ) : = \operatorname* { m a x } _ { \mu ^ { \prime } \in \Delta ( A ) } f ( \mu ^ { \prime } , \nu ) - \operatorname* { m i n } _ { \nu ^ { \prime } \in \Delta ( B ) } f ( \mu , \nu ^ { \prime } ) \leq \epsilon } \end{array}$ .
|
| 212 |
+
|
| 213 |
+
Observe that setting $\begin{array} { r } { \tau = \frac { \epsilon / 4 } { \log | \mathcal { A } | + \log | \mathcal { B } | } } \end{array}$ guarantees that $| f _ { \tau } ( \mu , \nu ) - f ( \mu , \nu ) | < \epsilon / 4$ uniformly over $( \mu , \nu ) \in \Delta ( \mathcal { A } ) \times \Delta ( \mathcal { B } )$ in view of the boundedness of the Shannon entropy $\mathcal { H } ( \cdot )$ . Theorem 7 (cf. (7d)) also ensures that our proposed algorithms find an approximate QRE $\bar { \zeta } ^ { ( T ) }$ such that $\mathsf { D u a l G a p } _ { \tau } \bigl ( \bar { \zeta } ^ { ( T ) } \bigr ) \leq$ $\epsilon / 2$ after taking $\begin{array} { r } { T = \widetilde { O } \left( \frac { 1 } { \eta \epsilon } \right) } \end{array}$ iterations, which is no more than $\begin{array} { r } { \widetilde { O } \left( 1 + \frac { \| A \| _ { \infty } } { \epsilon } \right) } \end{array}$ iterations with optimized learning rates. It follows immediately that
|
| 214 |
+
|
| 215 |
+
[ $\mathtt { \mathtt { M a l G a p } } ( \bar { \zeta } ^ { ( T ) } ) \le \mathtt { D u a l G a p } _ { \tau } ( \bar { \zeta } ^ { ( T ) } ) + \operatorname* { m a x } _ { \mu ^ { \prime } , \nu ^ { \prime } } \Big | f _ { \tau } ( \mu ^ { \prime } , \bar { \nu } ^ { ( T ) } ) - f _ { \tau } \big ( \bar { \mu } ^ { ( T ) } , \nu ^ { \prime } \big ) - \big ( f ( \mu ^ { \prime } , \bar { \nu } ^ { ( T ) } ) - f ( \bar { \mu } ^ { ( T ) } , \nu ^ { \prime } ) \big ) \Big | \le \epsilon ,$ and therefore $\bar { \zeta } ^ { ( T ) }$ is an $\mathrm { \epsilon - N E }$ . Intriguingly, unlike prior work (Daskalakis and Panageas, 2018a; Wei et al., 2021b) that analyzed the last-iterate convergence of OMWU in the unregularized setting $\mathit { \Pi } _ { \mathcal { T } } = 0 \mathit { \Pi } _ { \mathcal { c } }$ ), our last-iterate convergence does not require the NE of (1) to be unique.
|
| 216 |
+
|
| 217 |
+
Rationality. Another attractive feature of the algorithms developed above is being rational (as introduced in Bowling and Veloso (2001)) in the sense that the algorithm returns the best-response policy of one player when the opponent takes any fixed stationary policy. More specially, in terms of matrix games, when player 2 sticks to a stationary policy $\nu$ , the update of player 1 reduces to $\mu ^ { ( t + 1 ) } ( a ) \bar { \propto } \mu ^ { ( t ) } ( a ) ^ { 1 - \bar { \eta tau } } \exp ( \eta [ A \nu ] _ { a } )$ . In this case, Theorem 1 can be established in exactly the same fashion by restricting attention only to the updates of $\mu ^ { ( t ) }$ .
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 1: Performance illustration of the PU and OMWU methods for solving entropy-regularized matrix games with $| \mathcal { A } | = | \mathcal { B } | = 1 0 0$ , where the entries of the payoff matrix $A$ is generated independently from the uniform distribution on $[ - 1 , 1 ]$ . The learning rates are fixed as $\eta = 0 . 1$ . The left panel plots various error metrics of convergence w.r.t. the iteration count with $\tau = 0 . 0 1$ , while the right panel plots these error metrics at 1000-th iteration with different choices of $\tau$ .
|
| 221 |
+
|
| 222 |
+
No-regret learning of OMWU. Besides convergence to equilibria, in game-theoretical settings, it is often desirable to design and implement no-regret algorithms, which are capable of providing black-box guarantees over arbitrary sequences played by the opponent (Cesa-Bianchi and Lugosi, 2006; Rakhlin and Sridharan, 2013). Fortunately, it turns out that entropy regularization not only accelerates the convergence, but also enables no-regret learning somewhat “for free”: it encourages exploration by putting a positive mass on every action, therefore guards against adversaries. By using a properly chosen learning rate schedule, the proposed OMWU (Algorithm 2) can be further established as a no-regret algorithm; the details can be found in (Cen et al., 2021).
|
| 223 |
+
|
| 224 |
+
# 3 Zero-sum Markov games with entropy regularization
|
| 225 |
+
|
| 226 |
+
Leveraging the success of PU and OMWU in solving the entropy-regularized matrix games, this section extends our current analysis to solve the zero-sum two-player Markov game with entropy regularization, which is again formulated as finding the equilibrium of a saddle-point optimization problem. We start by introducing its basic setup, which will be followed by the proposed policy extragradient method with its theoretical guarantees.
|
| 227 |
+
|
| 228 |
+
# 3.1 Background and problem formulation
|
| 229 |
+
|
| 230 |
+
We consider a discounted Markov Game (MG) which is defined as $\mathcal { M } = \{ { S , A , B , P , r , \gamma } \}$ , with discrete state space $s$ , action spaces of two players $\mathcal { A }$ and $\boldsymbol { B }$ , transition probability $P$ , reward function $r : \mathcal { S } \times \mathcal { A } \times \mathcal { B } [ 0 , 1 ]$ and discount factor $\gamma \in [ 0 , 1 )$ . A policy $\mu : { \mathcal { S } } \Delta ( { \mathcal { A } } )$ (resp. $\nu : S \to \Delta ( B ) )$ defines how player 1 (resp. player 2) reacts to a given state $s$ , where the probability of taking action $a \in { \mathcal { A } }$ (resp. $b \in B ,$ ) is $\mu ( a | s )$ (resp. $\nu ( b | s ) )$ . The transition probability kernel $P : \mathcal { S } \times \mathcal { A } \times \mathcal { B } \Delta ( \mathcal { S } )$ defines the dynamics of the Markov game, where $P ( s ^ { \prime } | s , a , b )$ specifies the probability of transiting to state $s ^ { \prime }$ from state $s$ when the players take actions $a$ and $b$ respectively.
|
| 231 |
+
|
| 232 |
+
Motivated by entropy regularization in Markov decision processes (MDP) (Geist et al., 2019), we consider an entropy-regularized variant of MG, where the value function is defined as
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
V _ { \tau } ^ { \mu , \nu } ( s ) : = \mathbb { E } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \left( r ( s _ { t } , a _ { t } , b _ { t } ) - \tau \log \mu ( a _ { t } | s _ { t } ) + \tau \log \nu ( b _ { t } | s _ { t } ) \right) ~ \middle | s _ { 0 } = s \right] ,
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
where the quantity $\tau \geq 0$ denotes the regularization parameter, and the expectation is evaluated over the randomness of the transition kernel as well as the policies. The regularized Q-function $Q _ { \tau } ^ { \mu , \nu }$ of a
|
| 239 |
+
|
| 240 |
+
policy pair $( \mu , \nu )$ is related to $V _ { \tau } ^ { \mu , \nu }$ as
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\begin{array} { r } { Q _ { \tau } ^ { \mu , \nu } ( s , a , b ) = r ( s , a , b ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \mid s , a , b ) } \bigl [ V _ { \tau } ^ { \mu , \nu } \bigl ( s ^ { \prime } \bigr ) \bigr ] . } \end{array}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
We will call $V _ { \tau } ^ { \mu , \nu }$ and $Q _ { \tau } ^ { \mu , \nu }$ the soft value function and soft $Q$ -function, respectively. A policy pair $( \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } )$ is said to be the quantal response equilibrium (QRE) of the entropy-regularized MG, if its value attains the minimax value of the entropy-regularized MG over all states $s \in S$ , i.e.
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
V _ { \tau } ^ { \star } ( s ) = \operatorname* { m a x } _ { \mu } \operatorname* { m i n } _ { \nu } V _ { \tau } ^ { \mu , \nu } ( s ) = \operatorname* { m i n } _ { \nu } \operatorname* { m a x } _ { \mu } V _ { \tau } ^ { \mu , \nu } ( s ) : = V _ { \tau } ^ { \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } } ( s ) ,
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
where ${ \cal V } _ { \tau } ^ { \star }$ is called the optimal minimax soft value function, and similarly $Q _ { \tau } ^ { \star } : = Q _ { \tau } ^ { \mu _ { \tau } ^ { \star } , \nu _ { \tau } ^ { \star } }$ is called the optimal minimax soft Q-function.
|
| 253 |
+
|
| 254 |
+
Goal. Our goal is to find the QRE of the entropy-regularized MG in a decentralized manner where the players only observe its own reward without accessing the opponent’s actions. By setting the regularization parameter sufficiently small $\tau$ , this also allows us to find an approximate NE of the unregularized MG.
|
| 255 |
+
|
| 256 |
+
# 3.2 From value iteration to policy extragradient methods
|
| 257 |
+
|
| 258 |
+
Entropy-regularized value iteration. It is known that classical dynamic programming approaches such as value iteration can be extended to solve MG (Perolat et al., 2015), where each iteration amounts to solving a series of matrix games for each state. Similar to the single-agent case (Cen et al., 2020), we can extend these approaches to solve the entropy-regularized MG. Setting the stage, let us introduce the per-state $\mathbf { Q }$ -value matrix $Q ( s ) : = Q ( s , \cdot , \cdot ) \bar { \in \mathbb { R } ^ { | \mathcal { A } | \times | \mathcal { B } | } }$ for every $s \in S$ , where the element indexed by the action pair $( a , b )$ is $Q ( s , a , b )$ . Similarly, we define the per-state policies $\mu ( s ) : = \mu ( \cdot | s ) \in \Delta ( { \dot { A } } )$ and $\nu ( s ) : = \nu ( \cdot | s ) \in \Delta ( B )$ for both players.
|
| 259 |
+
|
| 260 |
+
In parallel to the original Bellman operator, we denote the soft Bellman operator $\mathcal { T } _ { \tau }$ as
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\mathcal { T } _ { \tau } ( Q ) ( s , a , b ) : = r ( s , a , b ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot \vert s , a , b ) } \left[ \operatorname* { m a x } _ { \mu ( s ^ { \prime } ) \in \Delta ( A ) } \operatorname* { m i n } _ { \nu ( s ^ { \prime } ) \in \Delta ( B ) } f _ { \tau } \left( Q ( s ^ { \prime } ) ; \mu ( s ^ { \prime } ) , \nu ( s ^ { \prime } ) \right) \right] ,
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where for each per-state Q-value matrix $Q ( s )$ , we introduce an entropy-regularized matrix game in the form of
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\displaystyle \operatorname* { m a x } _ { \mu \in \Delta ( A ) } \operatorname* { m i n } _ { \nu \in \Delta ( B ) } f _ { \tau } \big ( Q ( s ) ; \mu ( s ) , \nu ( s ) \big ) : = \mu ( s ) ^ { \top } Q ( s ) \nu ( s ) - \tau \mathcal { H } ( \mu ( s ) ) + \tau \mathcal { H } ( \nu ( s ) ) .
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
The entropy-regularized value iteration then proceeds as
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
Q ^ { ( t + 1 ) } = T _ { \tau } ( Q ^ { ( t ) } ) ,
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
where $Q ^ { ( 0 ) }$ is an initialization. By definition, the optimal minimax soft Q-function obeys ${ \cal T } _ { \tau } ( Q _ { \tau } ^ { \star } ) =$ $Q _ { \tau } ^ { \star }$ and therefore corresponds to the fix point of the soft Bellman operator. Given the above entropyregularized value iteration, the following lemma states its iterates contract linearly to the optimal minimax soft Q-function at a rate of the discount factor $\gamma$ .
|
| 279 |
+
|
| 280 |
+
Proposition 2. The entropy-regularized value iteration (10) converges at a linear rate, i.e. $\parallel Q ^ { ( t ) } -$
|
| 281 |
+
$Q _ { \tau } ^ { \star } \| _ { \infty } \leq \gamma ^ { t } \| Q ^ { ( 0 ) } - Q _ { \tau } ^ { \star } \| _ { \infty }$ .
|
| 282 |
+
|
| 283 |
+
Approximate value iteration via policy extragradient methods. Proposition 2 suggests that the optimal minimax soft Q-function of the entropy-regularized MG can be found by solving a series of entropy-regularized matrix games induced by $\bar { \{ Q ^ { ( t ) } \} } _ { t \geq 0 }$ in (10), a task that can be accomplished by adopting the fast extragradient methods developed earlier. To proceed, we first define the following sampling oracle, which makes it rigorous that the proposed algorithm does not require access to the Q-function of the entire MG, but only its own single-agent Q-function when playing against the opponent’s policy.
|
| 284 |
+
|
| 285 |
+
Definition 2 (Sampling oracle for Markov games). Given any policy pair $\mu ( s ) , \nu ( s )$ and $Q$ -value matrix $Q ( s )$ for any $s \in S$ , the sampling oracle returns
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
[ Q ( s ) \nu ( s ) ] _ { a } = \mathbb { E } _ { b \sim \nu ( s ) } \left[ Q ( s , a , b ) \right] , \qquad a n d \qquad [ Q ( s ) ^ { \top } \mu ( s ) ] _ { b } = \mathbb { E } _ { a \sim \mu ( s ) } \left[ Q ( s , a , b ) \right]
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
for any $a \in { \mathcal { A } }$ and $b \in B$ .
|
| 292 |
+
|
| 293 |
+
# Algorithm 3: Policy Extragradient Method for Entropy-regularized Markov Game
|
| 294 |
+
|
| 295 |
+
1 initialization: $Q ^ { ( 0 ) } = 0$ .
|
| 296 |
+
2 for $t = 0 , 1 , 2 , \cdots , T _ { \mathrm { m a i n } } \mathrm { { \bf d o } }$
|
| 297 |
+
3 Let $Q ^ { ( t ) }$ denote $\begin{array} { r } { Q ^ { ( t ) } ( s , a , b ) = r ( s , a , b ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot | s , a , b ) } V ^ { ( t ) } ( s ^ { \prime } ) . } \end{array}$ (11)
|
| 298 |
+
4 Invoke PU (Algorithm 1) or OMWU (Algorithm 2) for $T _ { \mathrm { s u b } }$ iterations to solve the following entropy-regularized matrix game for every state $s$ , where the initialization is set as uniform distributions: $\operatorname* { m a x } _ { \mu ( s ) \in \Delta ( A ) } \operatorname* { m i n } _ { \nu ( s ) \in \Delta ( B ) } f _ { \tau } \big ( Q ^ { ( t ) } ( s ) ; \mu ( s ) , \nu ( s ) \big ) .$ Return the last iterate $\bar { \mu } ^ { ( t , T _ { \mathrm { s u b } } ) } ( s ) , \bar { \nu } ^ { ( t , T _ { \mathrm { s u b } } ) } ( s )$ .
|
| 299 |
+
5 Set $V ^ { ( t + 1 ) } ( s ) = f _ { \tau } \left( Q ^ { ( t ) } ( s ) ; \bar { \mu } ^ { ( t , \bar { T } _ { \mathrm { s u b } } ) } ( s ) , \bar { \nu } ^ { ( t , \bar { T } _ { \mathrm { s u b } } ) } ( s ) \right)$ .
|
| 300 |
+
|
| 301 |
+
Encouragingly, by judiciously setting the number of iterations in both the outer loop (for updating the Q-value matrices) and the inner loop (for updating the QRE of the corresponding Q-value matrix), we are guaranteed to find the QRE of the entropy-regularized MG in a small number of iterations without solving the iteration-varying matrix games exactly, as dictated by the following theorem.
|
| 302 |
+
|
| 303 |
+
Theorem 2. Assume $| { \mathcal { A } } | \geq | { \mathcal { B } } |$ and $\tau \leq 1$ . Setting $\begin{array} { r } { \eta = \frac { 1 - \gamma } { 2 ( 1 + \tau ( \log | \mathcal { A } | + 1 - \gamma ) ) } } \end{array}$ , the total iterations (namely, the product $T _ { \mathrm { m a i n } } \cdot T _ { \mathrm { s u b , } }$ ) required for Algorithm 3 to achieve $\left\| Q ^ { ( { \vec { T } _ { \operatorname* { m i n } } } ) } - Q _ { \tau } ^ { \star } \right\| _ { \infty } \leq \epsilon$ is at most $\begin{array} { r } { O \left( \frac { ( \log | \cal { A } | + 1 / \tau ) } { ( 1 - \gamma ) ^ { 2 } } \left( \log \frac { \log | \cal { A } | } { ( 1 - \gamma ) \epsilon } \right) ^ { 2 } \right) } \end{array}$ .
|
| 304 |
+
|
| 305 |
+
Theorem 2 ensures that within $\begin{array} { r } { \widetilde O \left( \frac { 1 } { \tau ( 1 - \gamma ) ^ { 2 } } \log ^ { 2 } \left( \frac { 1 } { \epsilon } \right) \right) } \end{array}$ iterations, Algorithm 3 finds a pair of policies whose value is close to the optimal minimax soft Q-function $Q _ { \tau } ^ { \star }$ in an entrywise manner to a prescribed accuracy $\epsilon$ . Remarkably, the iteration complexity is independent of the dimensions of the state space and the action space (up to log factors).
|
| 306 |
+
|
| 307 |
+
Remark 4 (Duality gap and solving the unregularized MG). Solving the entropy-regularized MG provides a viable strategy to find an $\epsilon$ -approximate NE of the unregularized MG, where the optimality of a policy pair is typically gauged by the duality gap. Fortunately, this can be achieved similar to the case of matrix games, and we refer interested readers to Cen et al. (2021) for details.
|
| 308 |
+
|
| 309 |
+
# 4 Conclusions
|
| 310 |
+
|
| 311 |
+
This paper develops provably efficient policy extragradient methods (PU and OMWU) for entropyregularized matrix games and Markov games, whose last iterates are guaranteed to converge linearly to the quantal response equilibrium at a linear rate. Encouragingly, the rate of convergence is independent of the dimension of the problem, i.e. the sizes of the space space and the action space. In addition, the last iterates of the proposed algorithms can also be used to locate Nash equilibria for the unregularized competitive games without assuming the uniqueness of the Nash equilibria by judiciously tuning the amount of regularization. This work opens up interesting opportunities for further investigations of policy extragradient methods for solving competitive games. For example, can we develop a two-time-scale policy extragradient algorithms for Markov games where the Qfunction is updated simultaneously with the policy but potentially at a different time scale, using samples, such as in an actor-critic algorithm (Konda and Tsitsiklis, 2000)?
|
| 312 |
+
|
| 313 |
+
# Acknowledgments and Disclosure of Funding
|
| 314 |
+
|
| 315 |
+
S. Cen and Y. Chi are supported in part by the grants ONR N00014-18-1-2142 and N00014-19-1- 2404, ARO W911NF-18-1-0303, NSF CCF-1901199, CCF-2007911 and CCF-2106778. Y. Wei is supported in part by the NSF grants CCF-2007911, DMS-2147546/2015447 and CCF-2106778.
|
| 316 |
+
|
| 317 |
+
References
|
| 318 |
+
Arora, S., Hazan, E., and Kale, S. (2012). The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121–164.
|
| 319 |
+
Bai, Y. and Jin, C. (2020). Provable self-play algorithms for competitive reinforcement learning. In International Conference on Machine Learning, pages 551–560. PMLR.
|
| 320 |
+
Bowling, M. and Veloso, M. (2001). Rational and convergent learning in stochastic games. In Proceedings of the 17th international joint conference on Artificial intelligence-Volume 2, pages 1021–1026.
|
| 321 |
+
Cen, S., Cheng, C., Chen, Y., Wei, Y., and Chi, Y. (2020). Fast global convergence of natural policy gradient methods with entropy regularization. arXiv preprint arXiv:2007.06558.
|
| 322 |
+
Cen, S., Wei, Y., and Chi, Y. (2021). Fast policy extragradient methods for competitive games with entropy regularization. arXiv preprint arXiv:2105.15186.
|
| 323 |
+
Cesa-Bianchi, N. and Lugosi, G. (2006). Prediction, learning, and games. Cambridge university press.
|
| 324 |
+
Daskalakis, C., Deckelbaum, A., and Kim, A. (2011). Near-optimal no-regret algorithms for zero-sum games. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms, pages 235–254. SIAM.
|
| 325 |
+
Daskalakis, C., Foster, D. J., and Golowich, N. (2020). Independent policy gradient methods for competitive reinforcement learning. In Advances in Neural Information Processing Systems, volume 33, pages 5527–5540.
|
| 326 |
+
Daskalakis, C., Ilyas, A., Syrgkanis, V., and Zeng, H. (2018). Training GANs with optimism. In International Conference on Learning Representations (ICLR 2018).
|
| 327 |
+
Daskalakis, C. and Panageas, I. (2018a). Last-iterate convergence: Zero-sum games and constrained min-max optimization. arXiv preprint arXiv:1807.04252.
|
| 328 |
+
Daskalakis, C. and Panageas, I. (2018b). The limit points of (optimistic) gradient descent in minmax optimization. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 9256–9266.
|
| 329 |
+
Freund, Y. and Schapire, R. E. (1999). Adaptive game playing using multiplicative weights. Games and Economic Behavior, 29(1-2):79–103.
|
| 330 |
+
Geist, M., Scherrer, B., and Pietquin, O. (2019). A theory of regularized Markov decision processes. In International Conference on Machine Learning, pages 2160–2169.
|
| 331 |
+
Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial networks. arXiv preprint arXiv:1406.2661.
|
| 332 |
+
Harker, P. T. and Pang, J.-S. (1990). Finite-dimensional variational inequality and nonlinear complementarity problems: a survey of theory, algorithms and applications. Mathematical programming, 48(1):161–220.
|
| 333 |
+
Hofbauer, J. and Sandholm, W. H. (2002). On the global convergence of stochastic fictitious play. Econometrica, 70(6):2265–2294.
|
| 334 |
+
Hsieh, Y.-G., Iutzeler, F., Malick, J., and Mertikopoulos, P. (2019). On the convergence of single-call stochastic extra-gradient methods. arXiv preprint arXiv:1908.08465.
|
| 335 |
+
Konda, V. R. and Tsitsiklis, J. N. (2000). Actor-critic algorithms. In Advances in neural information processing systems, pages 1008–1014. Citeseer.
|
| 336 |
+
Korpelevich, G. M. (1976). The extragradient method for finding saddle points and other problems. Matecon, 12:747–756.
|
| 337 |
+
Lan, G. (2021). Policy mirror descent for reinforcement learning: Linear convergence, new sampling complexity, and generalized problem classes. arXiv preprint arXiv:2102.00135.
|
| 338 |
+
Lei, Q., Nagarajan, S. G., Panageas, I., and Wang, X. (2021). Last iterate convergence in no-regret learning: constrained min-max optimization for convex-concave landscapes. In International Conference on Artificial Intelligence and Statistics, pages 1441–1449. PMLR.
|
| 339 |
+
Liang, T. and Stokes, J. (2019). Interaction matters: A note on non-asymptotic local convergence of generative adversarial networks. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 907–915. PMLR.
|
| 340 |
+
Littman, M. L. (1994). Markov games as a framework for multi-agent reinforcement learning. In Machine Learning Proceedings, pages 157–163. Elsevier.
|
| 341 |
+
McKelvey, R. D. and Palfrey, T. R. (1995). Quantal response equilibria for normal form games. Games and economic behavior, 10(1):6–38.
|
| 342 |
+
Mei, J., Xiao, C., Szepesvari, C., and Schuurmans, D. (2020). On the global convergence rates of softmax policy gradient methods. arXiv preprint arXiv:2005.06392.
|
| 343 |
+
Mertikopoulos, P., Lecouat, B., Zenati, H., Foo, C.-S., Chandrasekhar, V., and Piliouras, G. (2018a). Optimistic mirror descent in saddle-point problems: Going the extra (gradient) mile. In International Conference on Learning Representations.
|
| 344 |
+
Mertikopoulos, P., Papadimitriou, C., and Piliouras, G. (2018b). Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2703–2717. SIAM.
|
| 345 |
+
Mertikopoulos, P. and Sandholm, W. H. (2016). Learning in games via reinforcement and regularization. Mathematics of Operations Research, 41(4):1297–1324.
|
| 346 |
+
Mokhtari, A., Ozdaglar, A., and Pattathil, S. (2020a). A unified analysis of extra-gradient and optimistic gradient methods for saddle point problems: Proximal point approach. In International Conference on Artificial Intelligence and Statistics, pages 1497–1507. PMLR.
|
| 347 |
+
Mokhtari, A., Ozdaglar, A. E., and Pattathil, S. (2020b). Convergence rate of $O ( 1 / k )$ for optimistic gradient and extragradient methods in smooth convex-concave saddle point problems. SIAM Journal on Optimization, 30(4):3230–3251.
|
| 348 |
+
Nemirovski, A. (2004). Prox-method with rate of convergence $O ( 1 / t )$ for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization, 15(1):229–251.
|
| 349 |
+
Neu, G., Jonsson, A., and Gómez, V. (2017). A unified view of entropy-regularized Markov decision processes. arXiv preprint arXiv:1705.07798.
|
| 350 |
+
Perolat, J., Scherrer, B., Piot, B., and Pietquin, O. (2015). Approximate dynamic programming for two-player zero-sum Markov games. In International Conference on Machine Learning, pages 1321–1329. PMLR.
|
| 351 |
+
Rakhlin, A. and Sridharan, K. (2013). Optimization, learning, and games with predictable sequences. arXiv preprint arXiv:1311.1869.
|
| 352 |
+
Savas, Y., Ahmadi, M., Tanaka, T., and Topcu, U. (2019). Entropy-regularized stochastic games. In 2019 IEEE 58th Conference on Decision and Control (CDC), pages 5955–5962. IEEE.
|
| 353 |
+
Shapley, L. S. (1953). Stochastic games. Proceedings of the National Academy of Sciences, 39(10):1095–1100.
|
| 354 |
+
Syrgkanis, V., Agarwal, A., Luo, H., and Schapire, R. E. (2015). Fast convergence of regularized learning in games. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 2, pages 2989–2997.
|
| 355 |
+
Tseng, P. (1995). On linear convergence of iterative methods for the variational inequality problem. Journal of Computational and Applied Mathematics, 60(1-2):237–252.
|
| 356 |
+
Wei, C.-Y., Lee, C.-W., Zhang, M., and Luo, H. (2021a). Last-iterate convergence of decentralized optimistic gradient descent/ascent in infinite-horizon competitive Markov games. arXiv preprint arXiv:2102.04540.
|
| 357 |
+
Wei, C.-Y., Lee, C.-W., Zhang, M., and Luo, H. (2021b). Linear last-iterate convergence in constrained saddle-point optimization. In International Conference on Learning Representations (ICLR).
|
| 358 |
+
Xie, Q., Chen, Y., Wang, Z., and Yang, Z. (2020). Learning zero-sum simultaneous-move Markov games using function approximation and correlated equilibrium. In Conference on Learning Theory, pages 3674–3682. PMLR.
|
| 359 |
+
Yadav, A., Shah, S., Xu, Z., Jacobs, D., and Goldstein, T. (2017). Stabilizing adversarial nets with prediction methods. arXiv preprint arXiv:1705.07364.
|
| 360 |
+
Zhan, W., Cen, S., Huang, B., Chen, Y., Lee, J. D., and Chi, Y. (2021). Policy mirror descent for regularized reinforcement learning: A generalized framework with linear convergence. arXiv preprint arXiv:2105.11066.
|
| 361 |
+
Zhang, K., Kakade, S., Basar, T., and Yang, L. (2020). Model-based multi-agent RL in zero-sum Markov games with near-optimal sample complexity. Advances in Neural Information Processing Systems, 33.
|
| 362 |
+
Zhao, Y., Tian, Y., Lee, J. D., and Du, S. S. (2021). Provably efficient policy gradient methods for two-player zero-sum Markov games. arXiv preprint arXiv:2102.08903.
|
md/train/8dqEeFuhgMG/8dqEeFuhgMG.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Class-Incremental Learning via Dual Augmentation
|
| 2 |
+
|
| 3 |
+
Fei Zhu1,2, Zhen Cheng1,2, Xu-Yao Zhang1,2∗, Cheng-Lin Liu1,2,3 1NLPR, Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China 2University of Chinese Academy of Sciences, Beijing, 100049, China 3Center for Excellence of Brain Science and Intelligence Technology, CAS {zhufei2018, chengzhen2019}@ia.ac.cn, {xyz, liucl}@nlpr.ia.ac.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Deep learning systems typically suffer from catastrophic forgetting of past knowledge when acquiring new skills continually. In this paper, we emphasize two dilemmas, representation bias and classifier bias in class-incremental learning, and present a simple and novel approach that employs explicit class augmentation (classAug) and implicit semantic augmentation (semanAug) to address the two biases, respectively. On the one hand, we propose to address the representation bias by learning transferable and diverse representations. Specifically, we investigate the feature representations in incremental learning based on spectral analysis and present a simple technique called classAug, to let the model see more classes during training for learning representations transferable across classes. On the other hand, to overcome the classifier bias, semanAug implicitly involves the simultaneous generating of an infinite number of instances of old classes in the deep feature space, which poses tighter constraints to maintain the decision boundary of previously learned classes. Without storing any old samples, our method can perform comparably with representative data replay based approaches.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have enabled great success in many machine learning tasks, based on stationary, large-scale, computationally expensive, and memory-intensive training data [1, 2, 3]. Yet the need of the ability to acquire sequential experience in dynamic and open environments [4, 5, 6] poses a serious challenge to modern deep learning systems, which only perform well on homogenized, balanced, and shuffled data [7]. Typically, DNNs suffer from drastic performance degradation of previously learned tasks after learning new knowledge, which is a well-documented phenomenon, known as catastrophic forgetting [8, 9, 10]. Recently, incremental learning (IL), also referred to as lifelong learning or continual learning, has received extensive attention [11, 12, 13, 14] to enable DNNs to preserve and extend knowledge continually.
|
| 12 |
+
|
| 13 |
+
Many earlier studies focus on task-incremental learning, which uses separate output layers for different tasks, and needs the task identity for inference [11, 15, 16]. In this work, we consider a more realistic and challenging setting of class-incremental learning (Class-IL), where the model only has access to data of new classes at each stage and needs to learn a unified classifier that can classify all seen classes [13, 17, 18]. Unfortunately, the learning paradigm of Class-IL will lead to two problems: representation bias and classifier bias, as shown in Figure 1. First, for representation learning, if the feature extractor is fixed after learning old classes, the learned representations could be preserved, but suffer from the lack of transferability for new classes; on the contrary, if we update the feature extractor on new classes, the updated representations would be no longer suitable for old classes. Consequently, the old and new classes would be easily overlapped in the deep feature space. We denote this dilemma as the representation bias. Second, to distinguish new classes from old classes, the training loss is typically calculated on all classes. Without old training data, the class weights of old classes would be ill-updated and mismatched with the updated representation space. We denote this dilemma as the classifier bias. In this work, we investigate the learning of representation and classifier in incremental learning and propose a simple and effective dual augmentation framework to overcome these two biases in Class-IL without storing and replaying training data of old classes.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Two inherent problems in Class-IL: representation bias and classifier bias.
|
| 17 |
+
|
| 18 |
+
Learning Representation for Incremental Learning. Existing works typically regularize network parameters explicitly [11, 15, 16] or implicitly [12] to reduce the representation shift when learning new classes. In this paper, instead of asking how to keep previously learned representations unchanged, we investigate the following question:
|
| 19 |
+
|
| 20 |
+
What properties of learned representations could facilitate incremental learning? We hypothesize that learning transferable and diverse representations is an important requirement for incremental learning. Intuitively, with such representations, it could be easier to find a model to perform well on all tasks and improve both plasticity and stability, since different tasks would be closer in the parameters space. From a spectral analysis viewpoint, we investigate which components of feature representations are more transferable and less forgettable in the incremental learning process. It is found that spectral components with large eigenvalues are less forgettable. Furthermore, we exploit this finding to propose a simple technique named classAug, which can enlarge the spectral components to introduce more diverse and transferable representations for incremental learning.
|
| 21 |
+
|
| 22 |
+
Learning Classifier for Incremental Learning. Recently, several works were proposed to alleviate the classifier bias in data replay based methods [18, 19, 20]. However, in non-exemplar based (i.e., without storing and replaying old data) Class-IL setting, the classifier bias is more serious and the above methods can not be directly used. A straightforward way is storing instances of old classes in the deep feature space. However, this strategy is undesirable due to the limited memory resource and scalability. This work delves into the classifier learning for Class-IL and proposes an implicit semantic augmentation (semanAug) approach to generate an infinite number of instances of old classes in the deep feature space by leveraging the distribution information. SemanAug is inspired by MCF [21] and ISDA [22], which have performed semantic augmentation for linear models and DNNs, respectively. However, both our way to leverage semantic augmentation and the motivation fundamentally differ from them [21, 22].
|
| 23 |
+
|
| 24 |
+
Contributions. (i) We provide new insights into the representation learning in incremental learning by analyzing the structural characteristics of the learned embedding space via spectral decomposition and find that spectral components with large eigenvalues are less forgettable and carry more transferable features. Based on this observation, we propose a simple and effective method of classAug to learn better embedding space for incremental learning. (ii) For classifier learning in incremental learning, we propose semanAug which implicitly involves simultaneous generating an infinite number of instances of old classes in the deep feature space to maintain the decision boundary of previously learned classes. (iii) Extensive experiments on benchmark datasets demonstrate the superior performance of our dual augmentation framework for the challenging scenario of Class-IL.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
Incremental Learning. Diverse approaches have been proposed for incremental learning of DNNs. They can be roughly divided into three categories: regularization based, data replay based, and architecture based approaches. Regularization based methods focus on weight regularization by estimating and preventing the important network weights from changing [11, 15, 16]. The difference among those methods is the way to compute the importance of the parameters. However, it is hard to design a reasonable metric to measure the importance of parameters, and it is known that regularization strategies show poor performance in Class-IL scenario [23, 24]. Data replay based methods address both the representation bias and classifier bias straightforwardly by storing a fraction of old data to jointly train the model with current data. With stored real samples, some works [17, 13, 25] use a distillation loss to prevent forgetting, while others [26, 27, 28] develop gradient-based regularization to make more efficient use of the rehearsal data. To avoid storing real data, another line of works generates pseudo-samples of all previous classes for replay using deep generative models [29, 30, 31, 32]. Nevertheless, storing real data is undesirable for resource-limited or privacy and safety concerning scenarios. Moreover, training big generative models for complex datasets is inefficient. Architecture based methods dynamically extend the network structure during the course of incremental learning [33, 34, 35, 36]. However, growing architecture is unfeasible for large numbers of tasks, and those methods are often impractical for Class-IL.
|
| 29 |
+
|
| 30 |
+
Data Augmentation. Literature is rich on data augmentation for improving the generalization of DNNs. Classical strategies commonly synthesize “positive” new samples in a way that is consistent with the underlying data distribution of the original dataset [3]. Recent works show that label mixing based methods such as Mixup [37] and Cutmix [38] can greatly improve the generalization of DNNs. In complement to the input space augmentations mentioned above, some works have explored feature space augmentations which augment the learned representations in deep embedding space to enhance classifier performance. The intuition behind those works is that certain directions in the deep feature space correspond to meaningful semantic transformations [39, 40]. For instance, deep feature interpolation [40] leverages simple interpolations in the embedding space to achieve semantic augmentation. A recently proposed ISDA [22] performs semantic augmentation by estimating and leveraging the category-wise distribution of deep representations in an online manner. Despite the simplicity, ISDA shows its effectiveness in semi-supervised learning [22], contrastive learning [41], domain adaptation [42] and long-tailed recognition [43].
|
| 31 |
+
|
| 32 |
+
# 3 Dual Augmentation Framework for Class-Incremental Learning
|
| 33 |
+
|
| 34 |
+
We first formalize the problem of Class-IL, and then introduce the proposed classAug for representation learning and semanAug for classifier learning, respectively. Finally, we present the dual augmentation framework for Class-IL by combing the two augmentations.
|
| 35 |
+
|
| 36 |
+
Problem Definition. Typically, a Class-IL problem involves the sequential learning of $\tau$ tasks that consist of disjoint classes sets, and the model has to classify all seen classes at any given point in training. At incremental step $t \in \{ 1 , . . . , T \}$ , $( \pmb { x } , y ) \in \mathcal { D } _ { t }$ denotes a training sample, where $_ { \textbf { \em x } }$ is an sample in the input space $\mathcal { X }$ and $\boldsymbol { y } \in \mathcal { C } _ { t }$ is its corresponding label. $\mathcal { C } _ { t }$ is the class set of task $t$ . To facilitate analysis, we represent the DNN based model with two components: a feature extractor and a unified classifier. Specifically, the feature extractor $f _ { \pmb \theta } : \mathcal { X } \mathcal { Z }$ , parameterized by $\pmb \theta$ , maps the input $_ { \textbf { \em x } }$ into a feature vector $z \doteq f _ { \pmb \theta } ( \pmb x ) \in \mathbb R ^ { d }$ in the deep feature space $\mathcal { Z }$ ; the unified classifier $g _ { \varphi } : \dot { \mathcal { Z } } \mathbb { R } ^ { \mathcal { C } _ { 1 : t } }$ , parameterized by $\varphi$ , produces a probability distribution $g _ { \varphi } ( z )$ as the prediction for $_ { \textbf { \em x } }$ . Denote the overall parameters by $\Theta = ( \theta , \varphi )$ .
|
| 37 |
+
|
| 38 |
+
The general objective is to correctly classify test examples from all seen classes [44]. The key challenge of Class- $\mathrm { . I L }$ is that data from previous tasks are assumed to be unavailable, which means that the best configuration of the model for all seen tasks must be sought by minimizing the predefined loss function $\mathcal { L }$ (e.g., cross-entropy) on current data $\mathcal { D } _ { t }$ :
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\underset { \theta , \varphi } { \mathrm { a r g m i n } } \ \mathbb { E } _ { ( \pmb { x } , \pmb { y } ) \sim \mathcal { D } _ { t } } [ \mathcal { L } ( g _ { \varphi } ( f _ { \theta } ( \pmb { x } ) ) , \pmb { y } ) ] .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
A widely used strategy to preserve old knowledge is knowledge distillation [45], which typically matches the current model with previous model response to current training data using the teacherstudent framework [12, 13, 19].
|
| 45 |
+
|
| 46 |
+
# 3.1 Learning Representation with Class Augmentation
|
| 47 |
+
|
| 48 |
+
As we focus on non-exemplar based Class-IL, we intentionally avoid storing training samples of old classes. To maintain the generalizability of the learned representations for old classes, existing methods typically restrain the feature extractor from changing [11, 15, 16, 12]. However, this would lead to a trade-off between the plasticity and stability [5], and it would be hard to perform long-step incremental learning. Our high-level idea is to learn transferable and diverse representations to bridge the old and new classes in a better feature space. To delve into this problem, we want to answer two questions: (1) Which part of feature representations tends to be forgotten in incremental learning? (2) How to facilitate the representation learning for incremental learning?
|
| 49 |
+
|
| 50 |
+
# 3.1.1 Analyzing Forgetting via Spectral Decomposition
|
| 51 |
+
|
| 52 |
+
In what follows, we explore which part of feature representations tends to be forgotten and may not be transferable across different tasks in incremental learning. To this end, we propose to quantify the sensitivity of the model to different directions in the deep feature space by measuring the similarity of the space before and after learning new tasks.
|
| 53 |
+
|
| 54 |
+
Formally, given a feature extractor $f _ { \pmb { \theta } , o l d }$ trained on dataset $\mathcal { D } _ { o l d } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ . A new dataset $\mathcal { D } _ { n e w }$ that contains disjoint classes with $\mathcal { D } _ { o l d }$ is used to update $f _ { \pmb { \theta } , o l d }$ , and the updated feature extractor is denoted as $f _ { \pmb { \theta } , n e w }$ . For the samples in $\mathcal { D } _ { o l d }$ , we can get two groups of deep features mapped by $f _ { \pmb { \theta } , o l d }$ and $f _ { \pmb { \theta } , n e w }$ , respectively. Using eigenvalue decomposition, we could respectively decompose the features mapped by original feature extractor (i.e., $f _ { \pmb \theta , o l d } ( \pmb x _ { i } ) )$ as well as the features mapped by updated feature extractor (i.e., $f _ { \pmb { \theta } , n e w } ( \pmb { x } _ { i } ) )$ to different directions as following:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\frac { 1 } { n } \sum _ { i = 1 } ^ { n } f _ { \pmb { \theta } } ( \pmb { x } _ { i } ) f _ { \pmb { \theta } } ( \pmb { x } _ { i } ) ^ { \mathrm { T } } = \sum _ { j = 1 } ^ { d } \pmb { u } _ { j } \lambda _ { j } \pmb { u } _ { j } ^ { \mathrm { T } } ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $\lambda _ { j }$ represents the eigenvalue with index $j$ and $\mathbf { \Delta } \mathbf { \em u } _ { j }$ is its eigenvector. $d$ is the dimensionality of the feature space. Through spectral factorization in Eq. (2), we can represent the original and new representations with two groups of eigenvectors: $\{ \pmb { u } _ { o l d , 1 } , . . . , \pmb { u } _ { o l d , d } \}$ and $\{ { \pmb u } _ { n e w , 1 } , . . . , { \pmb u } _ { n e w , d } \}$ .
|
| 61 |
+
|
| 62 |
+
Next, we investigate the forgetting or transferability of each direction. Shonkwiler [46] introduced the principal angles [47] to measure the similarity of two subspaces. However, it is unreasonable to treat all eigenvectors equally to calculate the principal angles, regardless of their relative eigenvalues. Inspired by [48], we use corresponding angles, denoted by $\psi$ , to explore the distance between two subspaces in incremental learning:
|
| 63 |
+
|
| 64 |
+
Definition 1 (Corresponding Angle) Given two groups of eigenvectors: $\{ \pmb { u } _ { o l d , 1 } , . . . , \pmb { u } _ { o l d , d } \}$ and $\{ { \pmb u } _ { n e w , 1 } , . . . , { \pmb u } _ { n e w , d } \}$ , corresponding angle represents the angle between two eigenvectors corresponding to the same eigenvalue value index. The cosine value of the corresponding angle is:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\cos ( \psi _ { j } ) = \frac { \langle { \pmb u } _ { o l d , j } , { \pmb u } _ { n e w , j } \rangle } { \| { \pmb u } _ { o l d , j } \| \cdot \| { \pmb u } _ { n e w , j } \| } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathbf { \Delta } \pmb { u } _ { o l d , j }$ is the $j$ -th eigenvectors with the $j$ -th largest eigenvalue in the old feature space, and similarly for $\mathbf { \Delta } \mathbf { u } _ { n e w , j }$ . Note that $\| \pmb { u } _ { o l d , j } \| = 1$ and $\| \boldsymbol { u } _ { n e w , j } \| = 1$ . For $\mathrm { I L }$ , the meaning of “preserve old knowledge” refers to maintain the previously learned decision boundary among classes. At representation level, for an old class, the shape (i.e., covariance) of the distributions should not be changed too much. If an eigenvector direction only changes slightly after updating the feature extractor, the corresponding angle is small, and vice versa. Intuitively, the corresponding angle could capture the representation shift between the old and updated feature extractor during incremental learning, and reflect the forgetting along certain directions in the deep feature space.
|
| 71 |
+
|
| 72 |
+
Based on the metric defined above, we explore the forgetting of different directions in Class-IL. We use LwF-MC [12, 13] as baseline method and train a ResNet-18 [1] on CIFAR-100 [49] using SGD in a 2-step manner. Concretely, the model is first trained on the first 50 classes and then updated on the other 50 classes. Figure 2 (a) shows the absolute cosine values of corresponding angles between the old and new eigenvectors. We can observe that eigenvectors with larger eigenvalues produce larger similarity (small corresponding angles), which indicates those directions are more transferable and less forgettable across different tasks. On the contrary, the eigenvectors with small eigenvalues prefer to move after updating the model on new tasks, and could be regarded as forgettable directions.
|
| 73 |
+
|
| 74 |
+
Transferable and Diverse Representations. As demonstrated above, the directions with larger eigenvalues transfer better and suffer less forgetting. This thought-provoking observation indicates that our learned representations should have the following properties: (1) Transferability: the eigenvalues of those several significant directions should be enlarged to transfer across tasks (or classes). (2) Diversity: the number of the directions with significant eigenvalues should be increased. Note that those properties are different from that in the common single-task learning scenario. Actually, reducing the number of directions with significant variance has been seen as a form of feature compression [51], which is linked to generalization by information theory [52, 53]. However, the usual concepts of generalization may not entirely be appropriate for IL, since standard learning only aims to learn compact representations within training classes without considering new class generalizability. In IL, those less discriminative directions for the current task could capture useful representations for future tasks. A recent paper [54] has shown that strong compressed representations can actually hurt the generalization ability in the deep metric learning setting. Therefore, to reduce forgetting and enhance the transferability of the representations, it is important to enlarge the eigenvalues and increase the number of eigenvectors with significant variance.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: (a) Absolute cosine values of corresponding angles. (b) Distribution of eigenvalues for baseline, Mixup [37], LS [50], and our classAug training based models.
|
| 78 |
+
|
| 79 |
+
# 3.1.2 Learning Representations via Class Augmentation
|
| 80 |
+
|
| 81 |
+
We now exploit our above analysis to propose a simple method for representation learning in ClassIL. Our key idea is to learn transferable and diverse representations by learning more classes at each incremental stage $t$ . To do so, a direct way is to introduce real classes from other datasets as auxiliary. However, it is unrealistic to always have access to other real classes, and which datasets should be used remains unknown. Therefore, we propose class augmentation (classAug) to augment the original classes by synthesizing auxiliary classes based on $\mathcal { D } _ { t }$ . Concretely, inspired
|
| 82 |
+
|
| 83 |
+
by Mixup [37], classAug randomly interpolates two samples $\scriptstyle { \mathbf { { \mathit { x } } } } _ { a }$ and $\mathbf { \delta } _ { \mathbf { \mathcal { X } } _ { b } }$ from two different classes $a$ and $b$ to generate a new sample $\pmb { x } _ { a b } ^ { \mathrm { n e w } }$ representing a new class:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r } { \pmb { x } _ { a b } ^ { \mathrm { n e w } } = \lambda \pmb { x } _ { a } + ( 1 - \lambda ) \pmb { x } _ { b } , } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\lambda$ is a random number of interpolation coefficient. For a $k$ -class problem, we can generate $k ( k - 1 ) / 2$ new classes using the above method, which can be further merged to $m$ auxiliary classes. As a result, the original $k$ -class
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: Illustration of classAug.
|
| 93 |
+
|
| 94 |
+
problem in the current task is extended to a $( k + m )$ -class problem. Moreover, we restrict the $\lambda$ to be sampled from the interval of [0.4, 0.6], to reduce the overlap between the augmented and original classes. At the end of each $\mathrm { I L }$ stage, the augmented class nodes in the classifier would be removed.
|
| 95 |
+
|
| 96 |
+
Discussion. The proposed classAug is related to Mixup [37] which applies random interpolation on a pair of training samples and the respective one-hot labels. However, the interpolated samples in Mixup are near original data, and the number of classes is not changed, but in our method, it is increased. By learning to classify more classes in each stage $t$ , the model could learn more transferable and diverse representations. Figure 2 (b) displays and compares the eigenvalues 2 of representations learned with different methods on the first 50 classes of CIFAR-100. It is obvious that the proposed classAug can enhance the value of eigenvalues significantly, and produce more directions with significant variance compared with other methods. On the contrary, Mixup and Label-Smoothing (LS) [50] lead to significantly smaller eigenvalues for the several top eigenvectors, which represent more compact representations. Indeed, the compression effect of soft-label based methods has also been demonstrated in [51, 50]. As shown in Section 4.3, classAug can improve the performance of Class-IL significantly, while Mixup and LS have negative effect in our experiments.
|
| 97 |
+
|
| 98 |
+
# 3.2 Learning Classifier with Semantic Augmentation
|
| 99 |
+
|
| 100 |
+
As demonstrated in Section 1, classifier bias is another problem in Class-IL. When learning new classes, the previously learned decision boundary would suffer from catastrophic distortion and thus the test samples from old classes could be easily mapped to wrong classes. To overcome this issue, we propose semantic augmentation (semanAug), which leverages the distribution information (i.e., class mean and covariance) of old classes to regularize the learning of the classifier. Formally, for each old class $k \in \{ 1 , . . . , \mathcal { C } _ { o l d } \}$ , we can generate $M$ instances in the deep feature space from its distribution, i.e., $\widetilde { z } _ { k } \backsim \mathcal { N } ( \mu _ { k } , \gamma \Sigma _ { k } )$ , in which $\gamma$ is a non-negative coefficient. Then the generated einstances of old classes and real instances of new classes in the deep feature space can be jointly fed to the classifier for minimizing cross-entropy loss:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathcal { L } _ { t } = \frac { 1 } { n _ { t } } \sum _ { i = 1 } ^ { n _ { t } } - \log \left( \frac { e ^ { \varphi _ { y _ { i } } ^ { \mathrm { T } } z _ { i } + b _ { y _ { i } } } } { \sum _ { c = 1 } ^ { \mathcal { C } _ { a l l } } e ^ { \varphi _ { c } ^ { \mathrm { T } } z _ { i } + b _ { c } } } \right) + \frac { 1 } { \mathcal { C } _ { o l l } } \sum _ { k = 1 } ^ { \mathcal { C } _ { o l l } } \frac { 1 } { M } \sum _ { m = 1 } ^ { M } - \log \left( \frac { e ^ { \varphi _ { k } ^ { \mathrm { T } } \widetilde z _ { k , m } + b _ { k } } } { \sum _ { c = 1 } ^ { \mathcal { C } _ { a l l } } e ^ { \varphi _ { c } ^ { \mathrm { T } } \widetilde z _ { k , m } + b _ { c } } } \right) _ { \textstyle ; }
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$\mathcal { L } _ { t , o l d }$ {z: loss on generated features of old classes
|
| 107 |
+
|
| 108 |
+
where $n _ { t }$ is the number of training samples in current task dataset $\mathcal { D } _ { t }$ , $\mathcal { C } _ { o l d }$ is the number of total old classes upon stage $t$ , and $\mathcal { C } _ { a l l } = \mathcal { C } _ { o l d } + \mathcal { C } _ { t }$ is the number of all seen classes at stage $t$ . $\varphi =$ $\left[ \varphi _ { 1 } , . . . , \varphi _ { \mathcal { C } _ { a l l } } \right] ^ { \mathrm { T } } \in \mathcal { R } ^ { \check { C } _ { a l l } \times d }$ and $b = [ b _ { 1 } , . . . , b _ { { \mathcal { C } } _ { a l l } } ] ^ { \mathrm { T } } \in { \mathcal { R } } ^ { { \mathcal { C } } _ { a l l } }$ are the weight matrix and bias vector of the last fully connected layer, respectively.
|
| 109 |
+
|
| 110 |
+
In Class-IL, the second term in Eq. (5), $\mathcal { L } _ { t , o l d }$ , is computationally inefficient when $M$ and $\mathcal { C } _ { o l d }$ are large. In the following, we present an easy-to-compute way to implicitly generate infinite instances in the deep feature space for old classes.
|
| 111 |
+
|
| 112 |
+
Upper bound of $\mathcal { L } _ { t , o l d }$ . Concretely, in the case of $M \to \infty$ , the second term in Eq. (5):
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { l } { \displaystyle \mathcal { L } _ { t , o l d } = \frac { 1 } { \tilde { C } _ { o l d } } \sum _ { k = 1 } ^ { \tilde { C } _ { o l d } } \mathbb { E } _ { \Xi _ { k } } \left[ - \log \left( \frac { e ^ { \varphi _ { k } ^ { \mathsf { T } } \bar { \varepsilon } _ { k } + b _ { k } } } { \sum _ { c = 1 } ^ { \tilde { C } _ { o l d } } e ^ { \varphi _ { c } ^ { \Gamma } \bar { \varepsilon } _ { k } + b _ { c } } } \right) \right] = \frac { 1 } { \tilde { C } _ { o l d } } \sum _ { k = 1 } ^ { \tilde { C } _ { o l d } } \mathbb { E } _ { \Xi _ { k } } \left[ \log \left( \displaystyle \sum _ { c = 1 } ^ { \tilde { C } _ { o l l } } e ^ { ( \varphi _ { c } ^ { \mathsf { T } } - \varphi _ { k } ^ { \mathsf { T } } ) \bar { \varepsilon } _ { k } + ( b _ { c } - b _ { k } ) } \right) \right] } \\ { \displaystyle \leqslant \frac { 1 } { \tilde { C } _ { o l d } } \sum _ { k = 1 } ^ { \infty } \log \left( \mathbb { E } _ { \Xi _ { k } } \left[ \displaystyle \sum _ { c = 1 } ^ { \tilde { C } _ { o l l } } e ^ { ( \varphi _ { c } ^ { \mathsf { T } } - \varphi _ { k } ^ { \mathsf { T } } ) \bar { \varepsilon } _ { k } + ( b _ { c } - b _ { k } ) } \right] \right) } \\ { \displaystyle = \frac { 1 } { \tilde { C } _ { o l d } } \sum _ { k = 1 } ^ { \infty } \log \left( \displaystyle \sum _ { c = 1 } ^ { \tilde { C } _ { o l l } } e ^ { \nu _ { c , k } ^ { \mathsf { T } } \mu _ { k } + ( b _ { c } - b _ { k } ) + \frac { \gamma } { 2 } \upsilon _ { c , k } ^ { \mathsf { T } } \Sigma _ { k } \nu _ { c , k } } \right) . } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
In above equation, ${ \pmb v } _ { c , k } = { \pmb \varphi } _ { c } - { \pmb \varphi } _ { k }$ . The inequality is based on Jensen’s inequality $\mathbb { E } [ \log ( X ) ] \leqslant$ $\log \mathbb { E } [ X ]$ , and the last equality is obtained by using the moment-generating function $\mathbb { E } [ e ^ { t X } ] =$ $e ^ { t \mu + { \frac { 1 } { 2 } } \sigma ^ { 2 } t ^ { 2 } }$ , $X \backsim \mathcal N ( \mu , \sigma ^ { 2 } )$ , due to the fact that $( \varphi _ { c } - \varphi _ { k } ) \widetilde { z } _ { k } + ( b _ { c } - b _ { k } )$ is a Gaussian random evariable. As can be seen, Eq. (6) is an upper bound of original $\mathcal { L } _ { t , o l d }$ , which provides an elegant and much efficient way to implicitly generate infinite instances in the deep feature space for old classes. The $\mathcal { L } _ { t , o l d }$ in Eq. (6) can be write in the common cross-entropy loss form:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathcal { L } _ { t , s e m a n A u g } \triangleq \mathcal { L } _ { t , o l d } = \frac { 1 } { \mathcal { C } _ { o l d } } \sum _ { k = 1 } ^ { \mathcal { C } _ { o l d } } - \log \left( \frac { e ^ { \varphi _ { k } ^ { \mathrm { T } } \mu _ { k } + b _ { k } } } { \sum _ { c = 1 } ^ { \mathcal { C } _ { a l l } } e ^ { \varphi _ { c } ^ { \mathrm { T } } \mu _ { k } + b _ { c } + \frac { \gamma } { 2 } \upsilon _ { c , k } ^ { \mathrm { T } } \Sigma _ { k } v _ { c , k } } } \right) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Intuitively, $\mathcal { L } _ { t , o l d }$ implicitly performs semantic transformations for $\mu _ { k }$ based on $\Sigma _ { k }$ . To maintain the decision boundary, $\gamma$ should be smaller if the distribution of a class is near the decision boundary; instead, $\gamma$ should be bigger if the distance is relatively far. We set $\gamma = 2$ in our experiments. In addition, we can observe that when $\gamma = 0$ , only the class means are used for knowledge retention.
|
| 125 |
+
|
| 126 |
+
Discussion. (1) Although the derivation of the upper bound in Eq. (6) is similar with ISDA [22], both our motivation and the way to leverage semanAug are different from ISDA. When learning new classes, we only apply semanAug for the class mean of each old class based on the memorized distribution information. While ISDA applies semanAug on all the training samples to improve generalization in standard supervised learning. In addition, a crucial step in ISDA is to estimate the mean and covariance matrix of each class in an online manner. Differently, semanAug is naturally suitable for Class-IL, since the distribution of old classes can be estimated with all training samples at the end of each learning stage. (2) Using previous class statistics for $\mathrm { I L }$ has also been explored in IL2M [55]. However, our method differs from IL2M in both the statistics information and the way to leverage them. First, The class statistics in IL2M is the prediction score of the classifier, while ours is the class distribution statistics in the deep feature space. Second, IL2M uses the class statistics to calibrate the prediction of a continual learner in a post-processing manner, while our method leverage the statistics to automatically learn a balanced classifier.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 4: Illustration of our dual augmentation framework (IL2A) for Class-IL. On the one hand, the training samples of new classes at current task are augmented via the proposed classAug. On the other hand, the distributions of old classes are retained by semanAug in the deep feature space.
|
| 130 |
+
|
| 131 |
+
# 3.3 The Dual Augmentation Learning Framework
|
| 132 |
+
|
| 133 |
+
With classAug for representation bias and semanAug for classifier bias, Figure 4 describes the learning process of the dual augmentation framework (IL2A). We also use the well-known knowledge distillation (KD) [19] for two reasons. Firstly, classAug and KD are complementary and focus on different aspect of learning representation. Secondly, KD can reduce the change of feature extractor, which is crucial for semanAug because it implicitly generate instances in the deep feature space from old distribution. The total learning objective at each stage $t$ is as following:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\mathcal { L } _ { t } = \mathcal { L } _ { t , n e w } + \alpha \mathcal { L } _ { t , s e m a n A u g } + \beta \mathcal { L } _ { t , k d } ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $\alpha$ and $\beta$ are two hyper-parameters. $\mathcal { L } _ { t , n e w }$ and $\mathcal { L } _ { t , s e m a n A u g }$ are shown in Eq. (5) and Eq. (7), respectively. $\begin{array} { r } { \mathcal { L } _ { t , k d } = \frac { 1 } { n _ { t } } \sum _ { i = 1 } ^ { n _ { t } } \| f _ { \pmb { \theta } _ { t - 1 } } ( \pmb { x } _ { i } ) - f _ { \pmb { \theta } _ { t } } ( \pmb { x } _ { i } ) \| } \end{array}$ . Note that $\mathcal { L } _ { t , n e w }$ and $\mathcal { L } _ { t , s e m a n A u g }$ are applied to both the original and synthesized samples. Algorithm 1 presents the pseudo code of IL2A.
|
| 140 |
+
|
| 141 |
+
# 4 Experiments
|
| 142 |
+
|
| 143 |
+
# 4.1 Evaluation Protocol
|
| 144 |
+
|
| 145 |
+
Datasets. We perform our experiments on CIFAR-100 [49] and Tiny-ImageNet [56]. A common setting is to train the model on half of classes for first task, and equal classes in the remaining incremental steps. Based on this, we split the CIFAR-100 dataset in different settings: $5 0 + 5 \times 1 0$ , $5 0 + \pm 0 \times 5$ , $4 0 + 2 { \pmb \theta } \times 3$ . For instance, $5 0 +$ $I { \pmb \theta } \times 5$ represents that the first task contains 50 classes and there are 5 classes for the following 10 tasks. Similarly, the settings for Tiny-ImageNet are $1 0 0 + { \pmb { 5 } } \times 2 0 $ , $1 0 0 +$ $1 0 \times 1 0$ and $1 0 0 { + } 2 { \pm } 5$ . Intuitively, more classes in each tasks requires the model to learn a harder problem for each task, while increasing the length of the task sequence challenges the model’s retention.
|
| 146 |
+
|
| 147 |
+
# Algorithm 1: IL2A: Dual augmentation algorithm
|
| 148 |
+
|
| 149 |
+
Randomly initialize $\Theta ^ { 0 } = \{ \theta ^ { 0 } , \varphi ^ { 0 } \}$ ; ${ \mathcal { S } } ^ { 0 } = \emptyset$ ;
|
| 150 |
+
foreach incremental stage $t \in \{ 1 , . . . , T \}$ do Input: model $\Theta ^ { t - 1 }$ , data $\mathcal { D } _ { t } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n _ { t } }$ ; Output: model $\Theta ^ { t }$ ; $\Theta ^ { t } \bar { } \Theta ^ { t - 1 }$ ; $\mathcal { D } _ { t , a u g } = \{ ( \boldsymbol { x } _ { i } ^ { \prime } , \boldsymbol { y } _ { i } ^ { \prime } ) \} _ { i = 1 } ^ { n _ { t } ^ { \prime } }$ via classAug; add class nodes for augmented classes; if $t = 1$ then train $\Theta ^ { t }$ by minimizing $\mathcal { L } ( g _ { \varphi } ( f _ { \theta } ( \pmb { x } ^ { \prime } ) ) , y ^ { \prime } )$ ; else train $\Theta ^ { t }$ by minimizing Eq. (8); $s \gets$ compute $\{ \mu , \Sigma \}$ for each class in $\mathcal { D } _ { t }$ ; $S ^ { t } \gets S ^ { t - 1 } \cup s ;$ remove augmented class nodes in classifier;
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 5: Results of top-1 accuracy on CIFAR-100 and Tiny-ImageNet under different settings. Solid lines present methods that do not store old exemplars, dashed lines present data replay based methods.
|
| 154 |
+
|
| 155 |
+
in each experiment. All models are trained using Adam [57] optimizer with an initial learning rate of 0.001 for 100 epochs with the mini-batch size of 64. The learning rate is reduced by a factor of 10 at 45 and 90 epochs. We use the same hyper-parameter value for all experiments. Specifically, we set $\alpha = 1 0$ and $\beta = 1 0$ in Eq. (8). The number of augmented classes (i.e. The number of augmented classes (i.e., $m$ ) depends on the number of (original) classes at current incremental step. Taking CIFAR-100 as an example, the $m$ is 45 for 5 phases setting where each incremental step has 10 classes; and $m$ is 10 for 10 phases setting where each incremental step has 5 classes. At the end of each incremental stage, we evaluate the model on all seen classes after removing the class nodes of the $m$ augmented classes in the classifier. Our code is available at https://github.com/Impression2805/IL2A.
|
| 156 |
+
|
| 157 |
+
Comparison Methods. Our method (IL2A) does not store any old samples for replay when learning new classes. Therefore, we first compare IL2A with several non-exemplar based approaches: MAS [16], LwF-MC [13], MUC [58], LwM [59]. In addition, we also compare with several exemplar based methods such as iCaRL [13], EEIL [18] and LUCIR [19]. Specifically, for the data replay based methods, we follow [13, 19] to store 20 samples for each class using ‘herd’ selection technique [13]. We report the average top-1 accuracy of all previously seen classes up to each incremental step t. For iCaRL, we respectively report its results of CNN predictions and nearest-mean-of-exemplars classification, denoted as iCaRL-CNN and iCaRL-NME.
|
| 158 |
+
|
| 159 |
+
# 4.2 Experimental Results
|
| 160 |
+
|
| 161 |
+
Main Results. Comparative results are shown in Figure 5. Firstly, we observe that our method performs much better than non-exemplar based methods such as LwF-MC and MUC in the trend of accuracy curve under different settings. Particularly, the gap appears unbridgeable in the long-step Class-IL setting, e.g., 10 phases and 20 phases. This suggests that only constraining old parameters does not suffice to prevent forgetting. We argue that this is partly due to the unaddressed classifier bias. When compared to representative data replay based methods such as iCaRL, EEIL and LUCIR, our method remarkably shows strong performance without storing old samples.
|
| 162 |
+
|
| 163 |
+
The success of our method can contribute to the proposed classAug and semanAug. Specifically, classAug is applied to new classes of current task, which enables the model to learn more transferable and diverse representations for future classes and in turn, reduces the forgetting of old parameters when learning new classes. While semanAug is applied to old classes of previous tasks, which leverage the valuable distribution information of old classes to learn a unified classifier to connect the classes from different tasks to each other.
|
| 164 |
+
|
| 165 |
+
Ablation Study. To evaluate the effect of each component in IL2A, we perform the ablation study and show the results of 10 phases setting (CIFAR-100) in Table 1. Specifically, the baseline denotes the method that does not generate pseudo-instance using semanAug, but only replays the class-mean of each old class when training new classes. By doing so, we aim to validate the effectiveness of semanAug compared with only replaying class-mean. In summary, we can observe that: (1) Baseline improves the performance of KD significantly. (2) SemanAug improves the performance of baseline from $3 4 . 7 1 \%$ to $4 2 . 0 9 \%$ . Those results indicate the effect of the distribution information for maintaining old knowledge in Class-IL. (3) ClassAug also has remarkably effect on baseline, and (4) the performance can be further improved by combing with semanAug, which indicates that those two modules are complementary. Similar results are observed in other settings of CIFAR-100 and Tiny-ImageNet datasets. (5) As for the computational complexity, classAug involves input level sample mixing and the augmented samples are fed to feature extractor. Differently, semanAug performs implicit old instance generation in the deep feature space. Therefore, semanAug is cheaper compared with classAug from the computation perspective.
|
| 166 |
+
|
| 167 |
+
Table 1: The effect of each component in IL2A.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan=1 colspan=1>Method\Incremental stage</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><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>Final</td></tr><tr><td rowspan=4 colspan=1>Knowledge Distillationbaseline+ semanAug+ classAug</td><td rowspan=1 colspan=1>78.78</td><td rowspan=1 colspan=1>30.18</td><td rowspan=1 colspan=1>20.71</td><td rowspan=1 colspan=1>14.61</td><td rowspan=1 colspan=1>11.87</td><td rowspan=1 colspan=1>8.80</td><td rowspan=1 colspan=1>7.70</td><td rowspan=1 colspan=1>7.23</td><td rowspan=1 colspan=1>7.10</td><td rowspan=1 colspan=1>6.05</td><td rowspan=1 colspan=1>6.04</td></tr><tr><td rowspan=1 colspan=1>78.86</td><td rowspan=1 colspan=1>62.85</td><td rowspan=1 colspan=1>56.96</td><td rowspan=1 colspan=1>54.66</td><td rowspan=1 colspan=1>51.72</td><td rowspan=1 colspan=1>47.33</td><td rowspan=1 colspan=1>43.61</td><td rowspan=1 colspan=1>40.12</td><td rowspan=1 colspan=1>40.76</td><td rowspan=1 colspan=1>36.55</td><td rowspan=1 colspan=1>34.71</td></tr><tr><td rowspan=1 colspan=1>79.16</td><td rowspan=1 colspan=1>69.14</td><td rowspan=1 colspan=1>60.68</td><td rowspan=1 colspan=1>58.18</td><td rowspan=1 colspan=1>54.77</td><td rowspan=1 colspan=1>50.89</td><td rowspan=1 colspan=1>48.45</td><td rowspan=1 colspan=1>46.29</td><td rowspan=1 colspan=1>46.97</td><td rowspan=1 colspan=1>44.38</td><td rowspan=1 colspan=1>42.09</td></tr><tr><td rowspan=1 colspan=1>79.72</td><td rowspan=1 colspan=1>68.30</td><td rowspan=1 colspan=1>64.15</td><td rowspan=1 colspan=1>60.15</td><td rowspan=1 colspan=1>56.21</td><td rowspan=1 colspan=1>52.61</td><td rowspan=1 colspan=1>51.48</td><td rowspan=1 colspan=1>46.48</td><td rowspan=1 colspan=1>46.36</td><td rowspan=1 colspan=1>43.63</td><td rowspan=1 colspan=1>41.56</td></tr><tr><td rowspan=1 colspan=1> + classAug + semanAug</td><td rowspan=1 colspan=1>81.08</td><td rowspan=1 colspan=1>74.54</td><td rowspan=1 colspan=1>66.28</td><td rowspan=1 colspan=1>63.89</td><td rowspan=1 colspan=1>58.80</td><td rowspan=1 colspan=1>54.97</td><td rowspan=1 colspan=1>51.32</td><td rowspan=1 colspan=1>48.64</td><td rowspan=1 colspan=1>49.74</td><td rowspan=1 colspan=1>47.05</td><td rowspan=1 colspan=1>45.07</td></tr></table>
|
| 170 |
+
|
| 171 |
+
# 4.3 Further Analysis
|
| 172 |
+
|
| 173 |
+
ClassAug Improves both Plasticity and Stability in Class-IL. To analyze the effectiveness of classAug more concretely, we explore how it affects the new tasks accuracy (↑) and average forgetting (↓) (CIFAR-100, 10 phases setting). Average forgetting [60] is defined to estimate the forgetting of previous tasks. The forgetting measure $\bar { f } _ { k } ^ { i }$ of the $i$ -th task after training $k$ -th task is defined as $f _ { k } ^ { i } = \operatorname* { m a x } _ { t \in 1 , \ldots , k - 1 } ( a _ { t , i } - a _ { k , i } ) , \forall i < k$ , in which $a _ { m , n }$ is the accuracy of task $n$ after training task $m$ .
|
| 174 |
+
|
| 175 |
+
The average forgetting measure $F _ { k }$ is then defined as 1k−1 Pk−1i=1 f ik. Intuitively, new task accuracy can be viewed as the plasticity of the incremental learner and the average forgetting can be viewed as the stability of the incremental learner. Figure 6 (a) and (b) report the results, from which we see that classAug simultaneously improves the new task accuracy and reduces the average forgetting. Specifically, the significant improvement on new task accuracy implies that the model training with classAug is a good initialization for the following tasks. Consequently, classAug is effective to improve the trade-off between plasticity and stability of a continual learner.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 6: (a, b) ClassAug can simultaneously improve the new task accuracy and reduce the average forgetting. (c) Compared with classAug, Mixup and LS have negative effect for Class-IL.
|
| 179 |
+
|
| 180 |
+
Compare ClassAug with Other Regularizers. We compare the proposed classAug with Mixup and LS in Figure 6 (c), where the baseline (with semanAug) represents our IL2A without using classAug. As can be seen, Mixup and LS have negative effect on the final accuracy. This phenomenon could be interpreted based on the analysis in Section 3.1.1 and Figure 2 (b). Specifically, those regularizers result in more compressed representations, damaging the transferability of the representations. Besides, the label smoothing strategy also affects the weights of old classes in the classifier, thus increasing the classifier bias. Similar results have also been reported in [61].
|
| 181 |
+
|
| 182 |
+
Discussion of Covariance Matrix. In our main experiments, we use the original covariance matrix for semanAug. However, storing the original covariance matrix might be inefficient when the matrix dimension is large. An alternative way is to only store the elements on the diagonal, which could greatly reduce the cost of memory. Figure 7 also reports the results of using the diagonal covariance matrix. Under different settings, using the original covariance matrix is slightly better than the diagonal form. This is reasonable because the original covariance matrix stores more distribution information of old classes. However, using the diagonal covariance matrix would be more memory-efficient in practice.
|
| 183 |
+
|
| 184 |
+
Table 2: OOD detection results. $\uparrow$ indicates higher is better.
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan="2">0OD</td><td colspan="3">AUROC↑</td><td colspan="3">AUPR-In↑</td><td colspan="3">AUPR-Out个</td></tr><tr><td>baseline</td><td>Mixup</td><td>classAug</td><td>baseline</td><td>Mixup</td><td>classAug</td><td>baseline</td><td>Mixup</td><td>classAug</td></tr><tr><td>MNIST</td><td>87.02</td><td>92.46</td><td>94.99</td><td>79.89</td><td>89.00</td><td>93.05</td><td>92.26</td><td>95.48</td><td>97.20</td></tr><tr><td>Fashion-MNIST</td><td>90.28</td><td>93.37</td><td>94.40</td><td>86.18</td><td>89.11</td><td>92.43</td><td>94.26</td><td>96.19</td><td>96.78</td></tr><tr><td>LSUN</td><td>88.50</td><td>88.80</td><td>93.90</td><td>83.48</td><td>74.71</td><td>91.08</td><td>92.92</td><td>94.09</td><td>96.73</td></tr><tr><td>Tiny-ImageNet</td><td>88.49</td><td>84.96</td><td>93.92</td><td>83.84</td><td>64.02</td><td>91.77</td><td>92.70</td><td>92.19</td><td>96.55</td></tr><tr><td>Mean</td><td>88.57</td><td>89.90</td><td>94.30</td><td>83.35</td><td>79.21</td><td>92.08</td><td>93.04</td><td>94.49</td><td>96.81</td></tr></table>
|
| 187 |
+
|
| 188 |
+
ClassAug Improves Confidence Reliability. During continuous use of a machine learning system in open-world applications, there are mainly three key steps [62]. The first step is out-of-distribution (OOD) detection [63], which requires the system to detect unknown samples from novel classes. The second step is to label the collected unknown samples by humans or automatic algorithms [64]. Finally, the system must scale and adapt incrementally to learn the novel classes, which is the Class-IL problem studied in this paper. Recently studies found that DNNs are overconfident for their predictions [63, 65], lacking the ability to detect samples from unknown classes. In real-world applications, we expect a continual learner has good OOD detection ability.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 7: Original v.s. diagonal covariance matrix. CIFAR-100.
|
| 192 |
+
|
| 193 |
+
We explore the OOD detection ability of the proposed classAug. Concretely, we train a ResNet-18 on CIFAR-10, and the test samples from CIFAR-10 are in-distribution. For OOD examples, we test on MNIST [66], Fashion-MNIST [67], LSUN (resized) [68] and Tiny-ImageNet (resized). As shown in Table 2, classAug noticeably improves the OOD detection performance of baseline [63] on commonly used metrics such as AUROC, AUPR-In and AUPR-Out [63]. By recognizing synthetic samples, DNNs could learn more robust and transferable representations which could be generalized to OOD samples. Moreover, as shown in Table 2, Mixup sometimes damages the performance of OOD detection, which further demonstrates the superiority of classAug.
|
| 194 |
+
|
| 195 |
+
# 5 Conclusion
|
| 196 |
+
|
| 197 |
+
In this paper, we propose a simple and effective dual augmentation framework to address the representation bias and classifier bias in Class-IL. We first investigate the transferability (or forgetting) of representations via spectral decomposition, which motivates us to propose classAug that can learn transferable, diverse and less compact representations for IL. Furthermore, we propose to use semanAug to implicitly generate infinite instances of old classes in the deep feature space during jointly learning of the unified classifier. Experiments show that our method could achieve remarkable performance compared with state-of-the-art Class-IL methods. Future works will consider the dual augmentation framework for more challenging scenarios like Class-IL with distribution shift and OOD data, few-shot Class-IL, and federated incremental learning.
|
| 198 |
+
|
| 199 |
+
# Acknowledgements
|
| 200 |
+
|
| 201 |
+
This work has been supported by the National Key Research and Development Program under Grant No. 2018AAA0100400, the National Natural Science Foundation of China (NSFC) grants U20A20223, 61633021, 62076236, 61721004, the Key Research Program of Frontier Sciences of CAS under Grant ZDBS-LY-7004, and the Youth Innovation Promotion Association of CAS under Grant 2019141.
|
| 202 |
+
|
| 203 |
+
References
|
| 204 |
+
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016. 1, 4, 7
|
| 205 |
+
[2] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, 2009. 1
|
| 206 |
+
[3] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, pages 1097–1105, 2012. 1, 3
|
| 207 |
+
[4] Gregory Ditzler, Manuel Roveri, Cesare Alippi, and Robi Polikar. Learning in nonstationary environments: A survey. IEEE Computational Intelligence Magazine, 10(4):12–25, 2015. 1
|
| 208 |
+
[5] German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019. 1, 4
|
| 209 |
+
[6] Matthias Delange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Greg Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. IEEE Trans. Pattern Anal. Mach. Intell., 2021. 1
|
| 210 |
+
[7] Raia Hadsell, Dushyant Rao, Andrei A Rusu, and Razvan Pascanu. Embracing change: Continual learning in deep neural networks. Trends in Cognitive Sciences, 2020. 1
|
| 211 |
+
[8] Ian J. Goodfellow, M. Mirza, Xia Da, Aaron C. Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgeting in gradient-based neural networks. CoRR, 2014. 1
|
| 212 |
+
[9] M. McCloskey and N. J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of Learning and Motivation, pages 109–165, 1989. 1
|
| 213 |
+
[10] Robert M French. Interactive tandem networks and the sequential learning problem. Citeseer. 1
|
| 214 |
+
[11] J. Kirkpatrick, Razvan Pascanu, Neil C. Rabinowitz, J. Veness, G. Desjardins, Andrei A. Rusu, K. Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, C. Clopath, D. Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, pages 3521 – 3526, 2017. 1, 2, 3, 4
|
| 215 |
+
[12] Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE Trans. Pattern Anal. Mach. Intell., pages 2935–2947, 2018. 1, 2, 3, 4
|
| 216 |
+
[13] Sylvestre-Alvise Rebuffi, A. Kolesnikov, Georg Sperl, and Christoph H. Lampert. icarl: Incremental classifier and representation learning. In CVPR, pages 5533–5542, 2017. 1, 3, 4, 8
|
| 217 |
+
[14] Ameya Prabhu, Philip HS Torr, and Puneet K Dokania. Gdumb: A simple approach that questions our progress in continual learning. In ECCV, pages 524–540, 2020. 1
|
| 218 |
+
[15] Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In ICML, pages 3987–3995, 2017. 1, 2, 3, 4
|
| 219 |
+
[16] Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In ECCV, pages 139–154, 2018. 1, 2, 3, 4, 8
|
| 220 |
+
[17] Y. Wu, Yan-Jia Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. Large scale incremental learning. In CVPR, pages 374–382, 2019. 1, 3
|
| 221 |
+
[18] Francisco M Castro, Manuel J Marín-Jiménez, Nicolás Guil, Cordelia Schmid, and Karteek Alahari. End-to-end incremental learning. In ECCV, pages 233–248, 2018. 1, 2, 8
|
| 222 |
+
[19] Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and D. Lin. Learning a unified classifier incrementally via rebalancing. In CVPR, pages 831–839, 2019. 2, 3, 7, 8
|
| 223 |
+
[20] Bowen Zhao, Xi Xiao, Guojun Gan, Bin Zhang, and Shu-Tao Xia. Maintaining discrimination and fairness in class incremental learning. In CVPR, pages 13205–13214, 2020. 2
|
| 224 |
+
[21] Laurens Maaten, Minmin Chen, Stephen Tyree, and Kilian Weinberger. Learning with marginalized corrupted features. In ICML, pages 410–418, 2013. 2
|
| 225 |
+
[22] Yulin Wang, Gao Huang, Shiji Song, Xuran Pan, Yitong Xia, and Cheng Wu. Regularizing deep networks with semantic data augmentation. IEEE Trans. Pattern Anal. Mach. Intell., 2021. 2, 3, 6
|
| 226 |
+
[23] 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. 3
|
| 227 |
+
[24] Gido M Van de Ven and Andreas S Tolias. Three scenarios for continual learning. arXiv preprint arXiv:1904.07734, 2019. 3
|
| 228 |
+
[25] Arthur Douillard, Matthieu Cord, Charles Ollion, Thomas Robert, and Eduardo Valle. Podnet: Pooled outputs distillation for small-tasks incremental learning. In ECCV, pages 86–102, 2020. 3
|
| 229 |
+
[26] Matthew Riemer, Ignacio Cases, Robert Ajemian, Miao Liu, Irina Rish, Yuhai Tu, and Gerald Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. In ICLR, 2018. 3
|
| 230 |
+
[27] David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In NeurIPS, 2017. 3
|
| 231 |
+
[28] Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. In ICLR, 2019. 3
|
| 232 |
+
[29] Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In NeurIPS, pages 2994–3003, 2017. 3
|
| 233 |
+
[30] Chenshen Wu, L. Herranz, X. Liu, Y. Wang, Joost van de Weijer, and B. Raducanu. Memory replay gans: Learning to generate new categories without forgetting. In NeurIPS, pages 5962–5972, 2018. 3
|
| 234 |
+
[31] Ye Xiang, Ying Fu, Pan Ji, and Hua Huang. Incremental learning using conditional adversarial networks. In ICCV, pages 6618–6627, 2019. 3
|
| 235 |
+
[32] Ronald Kemker and Christopher Kanan. Fearnet: Brain-inspired model for incremental learning. In ICLR, 2018. 3
|
| 236 |
+
[33] Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. 3
|
| 237 |
+
[34] Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In CVPR, pages 7765–7773, 2018. 3
|
| 238 |
+
[35] Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. In ICML, pages 4548–4557, 2018. 3
|
| 239 |
+
[36] Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In ICLR, 2018. 3
|
| 240 |
+
[37] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. Mixup: Beyond empirical risk minimization. In ICLR, 2018. 3, 5
|
| 241 |
+
[38] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In ICCV, pages 6023–6032, 2019. 3
|
| 242 |
+
[39] Yoshua Bengio, Grégoire Mesnil, Yann Dauphin, and Salah Rifai. Better mixing via deep representations. In ICML, pages 552–560, 2013. 3
|
| 243 |
+
[40] Paul Upchurch, Jacob Gardner, Geoff Pleiss, Robert Pless, Noah Snavely, Kavita Bala, and Kilian Weinberger. Deep feature interpolation for image content changes. In CVPR, pages 7064–7073, 2017. 3
|
| 244 |
+
[41] Qi Cai, Yu Wang, Yingwei Pan, Ting Yao, and Tao Mei. Joint contrastive learning with infinite possibilities. In NeurIPS, 2020. 3
|
| 245 |
+
[42] Shuang Li, Mixue Xie, Kaixiong Gong, Chi Harold Liu, Yulin Wang, and Wei Li. Transferable semantic augmentation for domain adaptation. arXiv preprint arXiv:2103.12562, 2021. 3
|
| 246 |
+
[43] Shuang Li, Kaixiong Gong, Chi Harold Liu, Yulin Wang, Feng Qiao, and Xinjing Cheng. Metasaug: Meta semantic augmentation for long-tailed visual recognition. arXiv preprint arXiv:2103.12579, 2021. 3
|
| 247 |
+
[44] Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. In NeurIPS, 2020. 3, 7
|
| 248 |
+
[45] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 3
|
| 249 |
+
[46] Clayton Shonkwiler. Poincaré duality angles for riemannian manifolds with boundary. arXiv preprint arXiv:0909.1967, 2009. 4
|
| 250 |
+
[47] Jianming Miao and Adi Ben-Israel. On principal angles between subspaces in rn. Linear algebra and its applications, 171:81–98, 1992. 4
|
| 251 |
+
[48] Xinyang Chen, Sinan Wang, Mingsheng Long, and Jianmin Wang. Transferability vs. discriminability: Batch spectral penalization for adversarial domain adaptation. In ICML, pages 1081–1090, 2019. 4
|
| 252 |
+
[49] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, 2009. 4, 7
|
| 253 |
+
[50] Rafael Müller, Simon Kornblith, and Geoffrey E. Hinton. When does label smoothing help? In NeurIPS, pages 4696–4705, 2019. 5
|
| 254 |
+
[51] Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In ICML, pages 6438–6447, 2019. 5
|
| 255 |
+
[52] Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pages 1–5, 2015. 5
|
| 256 |
+
[53] Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017. 5
|
| 257 |
+
[54] Karsten Roth, Timo Milbich, Samarth Sinha, Prateek Gupta, Björn Ommer, and Joseph Paul Cohen. Revisiting training strategies and generalization performance in deep metric learning. In ICML, 2020. 5
|
| 258 |
+
[55] Eden Belouadah and Adrian Popescu. Il2m: Class incremental learning with dual memory. In ICCV, pages 583–592, 2019. 6
|
| 259 |
+
[56] Leon Yao and John Miller. Tiny imagenet classification with convolutional neural networks. CS 231N. 7
|
| 260 |
+
[57] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 8
|
| 261 |
+
[58] Yu Liu, Sarah Parisot, Gregory G. Slabaugh, Xu Jia, Ales Leonardis, and Tinne Tuytelaars. More classifiers, less forgetting: A generic multi-classifier paradigm for incremental learning. In ECCV, pages 699–716, 2020. 8
|
| 262 |
+
[59] Prithviraj Dhar, Rajat Vikram Singh, Kuan-Chuan Peng, Ziyan Wu, and Rama Chellappa. Learning without memorizing. In CVPR, pages 5138–5146, 2019. 8
|
| 263 |
+
[60] Arslan Chaudhry, P. Dokania, Thalaiyasingam Ajanthan, and P. Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In ECCV, pages 532–547, 2018. 9
|
| 264 |
+
[61] Sudhanshu Mittal, Silvio Galesso, and Thomas Brox. Essentials for class incremental learning. arXiv preprint arXiv:2102.09517, 2021. 9
|
| 265 |
+
[62] Xu-Yao Zhang, Cheng-Lin Liu, and Ching Y Suen. Towards robust pattern recognition: A review. Proceedings of the IEEE, 108(6):894–922, 2020. 10
|
| 266 |
+
[63] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In ICLR, 2017. 10
|
| 267 |
+
[64] Kai Han, Sylvestre-Alvise Rebuffi, Sébastien Ehrhardt, Andrea Vedaldi, and Andrew Zisserman. Autonovel: Automatically discovering and learning novel visual categories. IEEE Trans. Pattern Anal. Mach. Intell., 2021. 10
|
| 268 |
+
[65] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In ICML, pages 1321–1330, 2017. 10
|
| 269 |
+
[66] Yann LeCun and Corinna Cortes. The mnist database of handwritten digits. 2005. 10
|
| 270 |
+
[67] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. 10
|
| 271 |
+
[68] Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. ArXiv, abs/1506.03365, 2015. 10
|
md/train/B1gTShAct7/B1gTShAct7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BJgkbyHKDS/BJgkbyHKDS.md
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INVERTIBLE GENERATIVE MODELS FOR INVERSE PROBLEMS: MITIGATING REPRESENTATION ERROR AND DATASET BIAS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Trained generative models have shown remarkable performance as priors for inverse problems in imaging. For example, Generative Adversarial Network priors permit recovery of test images from $5 \mathrm { - } 1 0 \mathrm { x }$ fewer measurements than sparsity priors. Unfortunately, these models may be unable to represent any particular image because of architectural choices, mode collapse, and bias in the training dataset. In this paper, we demonstrate that invertible neural networks, which have zero representation error by design, can be effective natural signal priors at inverse problems such as denoising, compressive sensing, and inpainting. Our formulation is an empirical risk minimization that does not directly optimize the likelihood of images, as one would expect. Instead we optimize the likelihood of the latent representation of images as a proxy, as this is empirically easier. For compressive sensing, our formulation can yield higher accuracy than sparsity priors across almost all undersampling ratios. For the same accuracy on test images, they can use 10-20x fewer measurements. We demonstrate that invertible priors can yield better reconstructions than sparsity priors for images that have rare features of variation within the biased training set, including out-of-distribution natural images.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+

|
| 12 |
+
Figure 1: We train an invertible generative model with CelebA images (including those at left). When used as a prior for compressed sensing, it can yield higher quality image reconstructions than Lasso and a trained DCGAN, even on out-of-distribution images. Note that the DCGAN reflects biases of the training set by removing the man’s glasses and beard, whereas our invertible prior does not.
|
| 13 |
+
|
| 14 |
+
Generative deep neural networks have shown remarkable performance as natural signal priors in imaging inverse problems, such as denoising, inpainting, compressed sensing, blind deconvolution, and phase retrieval. These generative models can be trained from datasets consisting of images of particular natural signal classes, such as faces, fingerprints, MRIs, and more (Karras et al., 2017; Minaee and Abdolrashidi, 2018; Shin et al., 2018; Chen et al., 2018). Some such models, including variational autoencoders (VAEs) and generative adversarial networks (GANs), learn an explicit low-dimensional manifold that approximates a natural signal class (Goodfellow et al., 2014; Kingma and Welling, 2013; Rezende et al., 2014). We will refer to such models as GAN priors. With an explicit parameterization of the natural signal manifold by a low dimensional latent representation, these generative models allow for direct optimization over a natural signal class. Consequently, they can obtain significant performance improvements over non-learning based methods. For example, GAN priors have been shown to outperform sparsity priors at compressed sensing with $5 \mathrm { - } 1 0 \mathrm { x }$ fewer measurements. Additionally, GAN priors have led to theory for signal recovery in the linear compressive sensing and nonlinear phase retrieval problems (Bora et al., 2017; Hand and Voroninski, 2017; Hand et al., 2018), and they have also shown promising results for the nonlinear blind image deblurring problem (Asim et al., 2018).
|
| 15 |
+
|
| 16 |
+
A significant drawback of GAN priors for solving inverse problems is that they can have representation error or bias due to architecture and training. This can happen for many reasons, including because the generator only approximates the natural signal manifold, because the natural signal manifold is of higher dimensionality than modeled, because of mode collapse, or because of bias in the training dataset itself. As many aspects of generator architecture and training lack clear principles, representation error of GANs may continue to be a challenge even after substantial hand crafting and engineering. Additionally, learning-based methods are particularly vulnerable to the biases of their training data, and training data, no matter how carefully collected, will always contain degrees of bias. As an example, the CelebA dataset (Liu et al., 2015) is biased toward people who are young, who do not have facial hair or glasses, and who have a light skin tone. As we will see, a GAN prior trained on this dataset learns these biases and exhibits image recovery failures because of them.
|
| 17 |
+
|
| 18 |
+
In contrast, invertible neural networks can be trained as generators with zero representation error. These networks are invertible (one-to-one and onto) by architectural design (Dinh et al., 2016; Gomez et al., 2017; Jacobsen et al., 2018; Kingma and Dhariwal, 2018). Consequently, they are capable of recovering any image, including those significantly out-of-distribution relative to a biased training set; see Figure 1. We call the domain of an invertible generator the latent space, and we call the range of the generator the signal space. These must have equal dimensionality. Flow-based invertible generative models are composed of a sequence of learned invertible transformations. Their strengths include: their architecture allows exact and efficient latent-variable inference, direct loglikelihood evaluation, and efficient image synthesis; they have the potential for significant memory savings in gradient computations; and they can be trained by directly optimizing the likelihood of training images. This paper emphasizes an additional strength: because they lack representation error, invertible models can mitigate dataset bias and improve performance on inverse problems with out-of-distribution data.
|
| 19 |
+
|
| 20 |
+
In this paper, we study generative invertible neural network priors for imaging inverse problems. We will specifically use the Glow architecture, though our framework could be used with other architectures. A Glow-based model is composed of a sequence of invertible affine coupling layers, 1x1 convolutional layers, and normalization layers. Glow models have been successfully trained to generate high resolution photorealistic images of human faces (Kingma and Dhariwal, 2018).
|
| 21 |
+
|
| 22 |
+
We present a method for using pretrained generative invertible neural networks as priors for imaging inverse problems. The invertible generator, once trained, can be used for a wide variety of inverse problems, with no specific knowledge of those problems used during the training process. Our method is an empirical risk formulation based on the following proxy: we penalize the likelihood of an image’s latent representation instead of the image’s likelihood itself. While this may be couterintuitive, it admits optimization problems that are easier to solve empirically. In the case of compressive sensing, our formulation succeeds even without direct penalization of this proxy likelihood, with regularization occuring through initialization of a gradient descent in latent space.
|
| 23 |
+
|
| 24 |
+
We train a generative invertible model using the CelebA dataset. With this fixed model as a signal prior, we study its performance at denoising, compressive sensing, and inpainting. For denoising, it can outperform BM3D (Dabov et al., 2007). For compressive sensing on test images, it can obtain higher quality reconstructions than Lasso across almost all subsampling ratios, and at similar reconstruction errors can succeed with $1 0 { - } 2 0 \mathrm { x }$ fewer measurements than Lasso. It provides an improvement of about $2 \mathbf { x }$ fewer linear measurements when compared to Bora et al. (2017). Despite being trained on the CelebA dataset, our generative invertible prior can give higher quality reconstructions than Lasso on out-of-distribution images of faces, and, to a lesser extent, unrelated natural images. Our invertible prior outperforms a pretrained DCGAN (Radford et al., 2015) at face inpainting and exhibits qualitatively reasonable results on out-of-distribution human faces. We provide additional experiments in the appendix, including for training on other datasets.
|
| 25 |
+
|
| 26 |
+
# 2 METHOD AND MOTIVATION
|
| 27 |
+
|
| 28 |
+
We assume that we have access to a pretrained generative invertible neural network $G : \mathbb { R } ^ { n } \mathbb { R } ^ { n }$ . We write $x = G ( z )$ and $z = G ^ { - 1 } ( \dot { x } )$ , where $x \in \mathbb { R } ^ { n }$ is an image that corresponds to the latent representation $z \in \mathbb { R } ^ { n }$ . We will consider a $G$ that has the Glow architecture introduced in Kingma and Dhariwal (2018). It can be trained by direct optimization of the likelihood of a collection of training images of a natural signal class, under a standard Gaussian distribution over the latent space. We consider recovering an image $x$ from possibly-noisy linear measurements given by $A \in \mathbb { R } ^ { \bar { m } \times n }$ ,
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
y = A x + \eta ,
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $\eta \in \mathbb { R } ^ { m }$ models noise. Given a pretrained invertible generator $G$ , we have access to likelihood estimates for all images $x \in \mathbb { R } ^ { n }$ . Hence, it is natural to attempt to solve the above inverse problem by a maximum likelihood formulation given by
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { n } } \| A x - y \| ^ { 2 } - \gamma \log p _ { G } ( x ) ,
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
where $p _ { G }$ is the likelihood function over $x$ induced by $G$ , and $\gamma$ is a hyperparameter. We have found this formulation to be empirically challenging to optimize; hence we study the following proxy:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\operatorname* { m i n } _ { z \in \mathbb { R } ^ { n } } \| A G ( z ) - y \| ^ { 2 } + \gamma \| z \| .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Unless otherwise stated, we initialize (2) at $z _ { 0 } = 0$ .
|
| 47 |
+
|
| 48 |
+
The motivation for formulation (2) is as follows. As a proxy for the likelihood of an image $x \in \mathbb { R } ^ { n }$ , we will use the likelihood of its latent representation $z \stackrel { - } { = } G ^ { - 1 } ( x )$ . Because the invertible network $G$ was trained to map a standard normal in $\mathbb { R } ^ { n }$ to a distribution over images, the log-likelihood of a point $z$ is proportional to $\| z \| ^ { 2 }$ . Instead of penalizing $\| z \| ^ { 2 }$ , we alternatively penalize the unsquared $\| z \|$ . In Appendix B, we show comparable performance for both the squared and unsquared formulations.
|
| 49 |
+
|
| 50 |
+
In principle, our formulation has an inherent flaw: some high-likelihood latent representations $z$ correspond to low-likelihood images $x$ . Mathematically, this comes from the Jacobian term that relates the likelihood in $z$ to the likelihood in $x$ upon application of the map $G$ . For multimodel distributions, such images must exist, which we will illustrate in the discussion. This proxy formulation relies on the fact that the set of such images has low probability and that they are inconsistent with enough provided measurements. Surprisingly, despite this potential weakness, we will observe image reconstructions that are superior to BM3D and GAN-based methods at denoising, and superior to GAN-based and Lasso-based methods at compressive sensing.
|
| 51 |
+
|
| 52 |
+
In the case of compressive sensing and inpainting, we take $\gamma = 0$ in formulation (2). The motivation for such a formulation initialized at $z _ { 0 } = 0$ is as follows. There is a manifold of images that are consistent with the provided measurements. We want to find the image $x$ of highest likelihood on this manifold. Our proxy turns the likelihood maximization task over an affine space in $x$ into the geometric task of finding the point on a manifold in $z$ -space that is closest to the origin with respect to the Euclidean norm. In order to approximate that point, we run a gradient descent in $z$ down the data misfit term starting at $z _ { 0 } = 0$ .
|
| 53 |
+
|
| 54 |
+
In the case of GAN priors for $G : \mathbb { R } ^ { k } \mathbb { R } ^ { n }$ , we will use the formulation from Bora et al. (2017), which is the formulation above in the case where the optimization is performed over $\mathbb { R } ^ { k }$ , $\gamma = 0$ , and initialization is selected randomly.
|
| 55 |
+
|
| 56 |
+
All the experiments that follow will be for an invertible model we trained on the CelebA dataset of celebrity faces, as in Kingma and Dhariwal (2018). Similar results for models trained on birds and flowers (Wah et al., 2011; Nilsback and Zisserman, 2008) can be found in the appendix. Due to computational considerations, we run experiments on $6 4 \times 6 4$ color images with the pixel values scaled between [0, 1]. The train and test sets contain a total of 27,000 and 3,000 images, respectively. We trained a Glow architecture (Kingma and Dhariwal, 2018); see Appendix A for details. Once trained, the Glow prior is fixed for use in each of the inverse problems below. We also trained a DCGAN for the same dataset. We solve (2) using LBFGS, which was found to outperform Adam (Kingma and Ba, 2014). DCGAN results are reported for an average of 3 runs because we observed some variance due to random initialization.
|
| 57 |
+
|
| 58 |
+
# 3 APPLICATIONS
|
| 59 |
+
|
| 60 |
+
# 3.1 DENOISING
|
| 61 |
+
|
| 62 |
+
We consider the denoising problem with $A = I$ and $\eta \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ , for images $x$ in the CelebA test dataset. We evaluate the performance of a Glow prior, a DCGAN prior, and BM3D for two different noise levels. Figure 2 shows the recovered PSNR values as a function of $\gamma$ for denoising by the Glow and DCGAN priors, along with the PSNR by BM3D. The figure shows that the performance of the regularized Glow prior increases with $\gamma$ , and then decreases. If $\gamma$ is too low, then the network fits to the noise in the image. If $\gamma$ is too high, then data fit is not enforced strongly enough. The left panel reveals that an appropriately regularized Glow prior can outperform BM3D by almost 2 dB. The experiments also reveal that appropriately regularized Glow priors outperform the DCGAN prior, which suffers from representation error and is not aided by the regularization. The right panel confirms that with smaller noise levels, less regularization is needed for optimal performance. A visual comparison of the recoveries at the noise level $\sigma = 0 . 1$ using Glow, DCGAN priors, and BM3D can be seen in Figure 3. Note that the recoveries with Glow are sharper than BM3D. See Appendix B for more quantitative and qualitative results.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Recovered PSNR values as a function of $\gamma$ for denoising by the Glow and DCGAN priors. All the results are averaged over 12 test set images. For reference, we show the average PSNRs of the original noisy images, after applyig BM3D, and under the Glow prior in the noiseless case $( \sigma = 0$ ).
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: Denoising results using the Glow prior, the DCGAN prior, and BM3D at noise level $\sigma = 0 . 1$ . Note that the Glow prior gives a sharper image than BM3D.
|
| 69 |
+
|
| 70 |
+
# 3.2 COMPRESSED SENSING
|
| 71 |
+
|
| 72 |
+
In compressed sensing, one is given undersampled linear measurements of an image, and the goal is to recover the image from those measurements. In our notation, $A \in \mathbb { R } ^ { m \times n }$ with $m < n$ . As the image $x$ is undersampled, there is an affine space of images consistent with the measurements, and an algorithm must select which is most ‘natural.’ A common proxy for naturalness in the literature has been sparsity with respect to the DCT or wavelet bases. With a GAN prior, an image is considered natural if it lies in or near the range of the GAN. For an invertible prior under our proxy for likelihood, we consider an image to be natural if it has a latent representation of small norm.
|
| 73 |
+
|
| 74 |
+
We study compressed sensing in the case that $A$ is an $m \times n$ matrix of i.i.d. $\mathcal { N } ( 0 , 1 / m )$ entries, and $x$ is an image from the CelebA test set. Here, $n = 6 4 \times 6 4 \times 3 = 1 2 2 8 8$ . We consider the case where $\eta$ is standard iid Gaussian random noise normalized such that $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . We compare Glow, DCGAN, and Lasso1 with respect to the DCT and wavelet bases.
|
| 75 |
+
|
| 76 |
+
Our main result is that the Glow prior with $\gamma = 0$ and initialization $z _ { 0 } = 0$ outperforms both DCGAN and Lasso in reconstruction quality over all undersampling ratios, as shown in the left panel of Figure 4. Surprisingly, in the case of extreme undersampling, Glow substantially outperforms these methods even though it does not maintain a direct low-dimensional parameterization of the signal manifold. The Glow prior (1) can result in 15 dB higher PSNRs than DCGAN, and (2) can give comparable recovery errors with $2 { - } 3 \mathbf { x }$ fewer measurements at high undersampling ratios. This difference is explained by the representation error of DCGAN, which has been shown to be the dominant source of error in DCGAN by Bora et al. (2017). Additional plots and visual comparisons, available in Appendix C, show notable improvements in quality of in- and out-of-distribution images using an invertible prior relative to DCGAN and Lasso.
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 4: The left panel shows recovered PSNRs averaged over 12 test set images under the Glow, and DCGAN prior with $\gamma = 0$ ; and the Lasso with respect to the DCT and a Wavelet Transform. We initialize with $z _ { 0 } = 0$ . See Appendix C for a zoom-in of the case of small $m$ . The right panel shows the resulting PSNR when $m = 5 0 0 0$ with a Glow prior after different initialization strategies, as described in the text. The highest PSNR was recovered with initialization $z _ { 0 } = 0$ and $\gamma = 0$ .
|
| 80 |
+
|
| 81 |
+
We conducted several additional experiments to understand the regularizing effects of $\gamma$ and the initialization $z _ { \mathrm { 0 } }$ . The right panel of Figure 4 shows the PSNRs under multiple initialization strategies: $z _ { 0 } = 0$ , $z _ { 0 } \sim \dot { \mathcal { N } } ( 0 , 0 . 1 ^ { \bar { 2 } } I )$ , $z _ { 0 } \sim \mathcal { N } ( \bar { 0 , } 0 . 7 ^ { 2 } I )$ , $z _ { 0 } = G ^ { - 1 } ( x _ { 0 } )$ with $x _ { 0 }$ given by the solution to Lasso with respect to the wavelet basis, and $z _ { 0 } = G ^ { - 1 } ( x _ { 0 } )$ where $x _ { 0 }$ is $x$ perturbed by a random point in the null space of $A$ . The best performance was observed with initialization $z _ { 0 } = 0$ . The hyperparameter $\gamma$ can be taken to be zero, which is surprising because then there is no direct penalization of likelihood for this noisy compressive sensing problem. In the case of $\gamma = 0$ , we observe that larger initializations result in recovered images of lower PSNR. See Appendix C for additional experiments that show this effect. We observe that initialization strategy can have a strong qualitative effect on the recovery formulation. For example, if the optimization is initialized by the solution to the Lasso, then directly penalizing the likelihood of $z$ can improve reconstruction PSNR, though those reconstruction are still worse than with initialization $z _ { 0 } = 0$ and $\gamma = 0$ . Suboptimal initialization procedures apparently benefit from direct penalization of likelihood, whereas the $z _ { 0 } = 0$ initialization apparently does not.
|
| 82 |
+
|
| 83 |
+
Finally, we observe that the Glow prior is much more robust to out-of-distribution examples than the GAN Prior. Figure 5 shows recovered images using (2) for compressive sensing for images not belonging to the CelebA dataset. DCGAN’s performance reveals biases of the underlying dataset and limitations of low-dimensional modeling. For example, projecting onto the CelebA-trained DCGAN can cause incorrect skin tone, gender, and age. It’s performance on out-of-distribution images is poor.
|
| 84 |
+
|
| 85 |
+
In contrast, the Glow prior mitigates this bias, even demonstrating image recovery for natural images that are not representative of the CelebA training set, including people who are older, have darker skin tones, wear glasses, have a beard, or have unusual makeup. The Glow prior’s performance also extends to significantly out-of-distribution images, such as animated characters and natural images unrelated to faces. See Appendix C.2 for additional experiments.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 5: Compressed sensing (CS) with a number $m = 2 , 5 0 0 ( \approx 2 0 \% )$ of measurements of outof-distribution images. Visual comparisons: CS under the Glow prior, DCGAN prior, Lasso-WVT, and Lasso-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance. We use $\gamma = 0$ for both DCGAN and Glow priors and $\gamma = 0 . 0 1$ for Lasso-WVT, and Lasso-DCT, respectively.
|
| 89 |
+
|
| 90 |
+
# 3.3 INPAINTING
|
| 91 |
+
|
| 92 |
+
In inpainting, one is given a masked image of the form $y = M \odot x$ , where $M$ is a masking matrix with binary entries and $x \in \mathbb { R } ^ { n }$ is an n-pixel image. The goal is to find $x$ . We could rewrite (2) with $\gamma = 0$ as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\operatorname* { m i n } _ { z \in \mathbb { R } ^ { n } } \| y - M \odot G ( z ) \| ^ { 2 }
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
There is an affine space of images consistent with the measurements, and an algorithm must select which is most natural. As before, using the minimizer $\hat { z }$ , the estimated image is given by $G ( \hat { z } )$ . Our experiments reveal the same story as for compressed sensing. If initialized at $z _ { 0 } = 0$ , then the empirical risk formulation with $\gamma = 0$ exhibits high PSNRs on test images. Algorithmic regularization is again occurring due to initialization. In contrast, DCGAN is limited by its representation error. See Figure 6, and Appendix D for more results, including visually reasonable face inpainting, even for out-of-distribution human faces.
|
| 99 |
+
|
| 100 |
+
# 4 DISCUSSION
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 6: Inpainting: Recoveries under DCGAN and Glow, both with $\gamma = 0$ .
|
| 104 |
+
|
| 105 |
+
We have demonstrated that pretrained generative invertible models can be used as natural signal priors in imaging inverse problems. Their strength is that every desired image is in the range of an invertible model, and the challenge that they overcome is that every undesired image is also in the range of the model and no explicit low-dimensional representation is kept. We study a regularization for empirical loss minimization that promotes recovery of images that have a high value of a proxy for image likelihood under the generative model. We demonstrate that this formulation can quantitatively and qualitatively outperform BM3D at denoising. Additionally, it has lower recovery errors than Lasso across all levels of undersampling, and it can get comparable errors from 10-20x fewer measurements, which is a $2 \mathbf { x }$ reduction from Bora et al. (2017). The superior recovery performance of the invertible prior at very extreme undersampling ratios is particularly surprising given that invertible nets do not maintain explicit low dimensional representations, as GANs do. Additionally, our trained invertible model yields significantly better reconstructions than Lasso even on out-of-distribution images, including images with rare features of variation, and on unrelated natural images.
|
| 106 |
+
|
| 107 |
+
The idea of analyzing inverse problems with invertible neural networks has appeared in Ardizzone et al. (2018). The authors study estimation of the complete posterior parameter distribution under a forward process, conditioned on observed measurements. Specifically, the authors approximate a particular forward process by training an invertible neural network. The inverse map is then directly available. In order to cope with information loss, the authors augment the measurements with additional variables. This work differs from ours because it involves training a separate net for every particular inverse problem. In contrast, our work studies how to use a pretrained invertible generator for a variety of inverse problems not known at training time. Training invertible networks is challenging and computationally expensive; hence, it is desirable to separate the training of off-the-shelf invertible models from potential applications in a variety of scientific domains.
|
| 108 |
+
|
| 109 |
+
# Why optimize a proxy for image likelihood instead of optimizing image likelihood directly?
|
| 110 |
+
|
| 111 |
+
As noted in Section 2, the immediate formulation one would write down for inverse problems under an invertible prior is to optimize a data misfit term together with an image log-likelihood term. Unfortunately, we found it difficult to get this optimization to converge in practice. The likelihood term can exhibit rapid variation due to the Jacobian of the transformation $z \mapsto x = G ( z )$ ; additionally the likelihood term may in principle even contain local minima or other geometric properties that make gradient descent difficult. Figure 7 compares the loss landscapes in $x$ and $z$ , illustrating that the learned likelihood function in $x$ may lead to difficulty in choosing appropriate step sizes for gradient descent algorithms.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 7: Landscapes of (a) the loss surface in $x$ -space, (b) just the image likelihood in $x$ -space, and (c) the loss surface in $z$ -space, as functions of two random directions in either $x$ or $z$ , as appropriate.
|
| 115 |
+
|
| 116 |
+
In contrast, there are nice geometric properties that appear in latent space from an invertible model. As an illustration, consider the compressive sensing problem with noiseless measurements. Here, the formulation corresponds to a gradient descent down the data misfit term $\| A G ( z ) - y \| ^ { 2 }$ starting at $z _ { 0 } = 0$ . This data misfit term has a favorable geometry for optimization in that all local minima are global minima. This is because the level sets in $z$ of $\| A G ( \bar { z } ) - y \| ^ { 2 }$ are given by $G ^ { - 1 }$ applied to the level sets in $x$ of $\| A x - y \| ^ { 2 }$ , which have a simple structure because of the linearity of the measurements in $x$ . There may be additional benefits due to optimizing in $z$ because the invertible net learns representations that permit interpolation between images and semantically meaningful arithmetic, as reported in Kingma and Dhariwal (2018).
|
| 117 |
+
|
| 118 |
+
# Why is the likelihood of an image’s latent representation a reasonable proxy for the image’s likelihood?
|
| 119 |
+
|
| 120 |
+
The training process for an invertible generative model attempts to learn a target distribution in images space by directly maximizing the likelihood of provided samples from that distribution, given a standard Gaussian prior in latent space. High probability regions in latent space map to regions in image space of equal probability. Hence, broadly speaking, regions of small values of $\lVert z \rVert$ are expected to map to regions of large likelihoods in image space. There will be exceptions to this property. For example, natural image distributions have a multimodal character. The preimage of high probability modes in image space will correspond to high likelihood regions in latent space. Because the generator $G$ is invertible and continuous, interpolation in latent space of these modes will provide images of high likelihood in $z$ but low likelihood in the target distribution. To illustrate this point, we trained a Real-NVP (Dinh et al., 2016) invertible neural network on the two dimensional set of points depicted in Figure 8 (left panel). The middle and right panels show that high likelihood regions in latent space generally correspond to higher likelihood regions in image space, but that there are some regions of high likelihood in latent space that map to points of low likelihood in image space and in the target distribution. We see that the spurious regions are of low total probability and would be unlikely to be the desired outcomes of an inverse problem arising from the target distribution.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 8: An invertible net was trained on the data points in $x$ -space (left), resulting in the given plots of latent $z$ -likelihood versus $x$ (middle), and $x$ -likelihood versus latent representation $z$ (right).
|
| 124 |
+
|
| 125 |
+
How can solving compressive inverse problems be successful without direct penalization of the proxy image likelihood?
|
| 126 |
+
|
| 127 |
+
If there are fewer linear measurements than the dimensionality of the desired signal, an affine space of images is consistent with the measurements. In our formulation, regularization does not occur by direct penalization of our proxy for image likelihood; instead, it occurs implicitly by performing the optimization in $z$ -space with an initialization of $z _ { 0 } = 0$ . The set of latent representations $z$ that are consistent with the compressive measurements define a $m$ -dimensional nonlinear manifold. As per the likelihood proxy mentioned above, the spirit of our formulation is to find the point on this manifold that is closest to the origin with respect to the Euclidean norm. Our specific way of estimating this point is to perform a gradient descent down a data misfit term in $z$ -space, starting at the origin. While a gradient flow typically will not find the closest point on the manifold, it empirically finds a reasonable approximation of that point. In practice, one could further do a local search to refine the output of this gradient flow, but we elect not to do so for the sake of simplicity.
|
| 128 |
+
|
| 129 |
+
Why does the invertible prior do so well, especially on out-of-distribution images?
|
| 130 |
+
|
| 131 |
+
One reason that the invertible prior performs so well is because it has no representation error. The lack of representation error of invertible nets presents a significant opportunity for imaging with a learned prior. Any image is potentially recoverable, even if the image is significantly outside of the training distribution. In contrast, methods based on projecting onto an explicit low-dimensional representation of a natural signal manifold will have representation error, perhaps due to modeling assumptions, mode collapse, or bias in a training set. Such methods will see performance prematurely saturate as the number of measurements increases. In contrast, an invertible prior would not see performance saturate. In the extreme case of having a full set of exact measurements, an invertible prior could in principle recover any image exactly.
|
| 132 |
+
|
| 133 |
+
It is natural to wonder which images can be effectively recovered using an invertible prior trained on a particular signal class. As expected, we see the best reconstruction errors on in-distribution images and performance degrades as images get further out-of-distribution. Nonetheless, we observe that reconstruction errors of unrelated natural images are still of higher quality than with the Lasso. It appears that the invertible generator learns some general attributes of natural images. This leads to several questions: when a generative invertible net is trained, how far out-of-distribution can an image be while maintaining a high likelihood? How do invertible nets learn useful statistics of natural images? Is that due primarily to training, or is there architectural bias toward natural images, as with the Deep Image Prior and Deep Decoder (Ulyanov et al., 2018; Heckel and Hand, 2018)?
|
| 134 |
+
|
| 135 |
+
The results of this paper provide further evidence that reducing representational error of generators can significantly enhance the performance of generative models for inverse problems in imaging. This idea was also recently explored in Athar et al. (2018), where the authors trained a GAN-like prior with a high-dimensional latent space. The high dimensionality of this space lowers representational error, though it is not zero. In their work, the high-dimensional latent space had a structure that was difficult to directly optimize, so the authors successfully modeled latent representations as the output of an untrained convolutional neural network whose parameters are estimated at test time. Their paper and ours raises several questions: Which generator architectures provide a good balance between low representation error, ease of training, and ease of inversion? Should a generative model be capable of producing all images in order to perform well on out-of-distribution images of interest? Are there cheaper architectures that perform comparably? These questions are quite important, as solving equation 2 in our $6 4 \times 6 4$ pixel color images experiments took 15 GPU-minutes. New developments are needed on architectures and frameworks in between low-dimensional generative priors and fully invertible generative priors. Such methods could leverage the strengths of invertible models while being much cheaper to train and use.
|
| 136 |
+
|
| 137 |
+
# REFERENCES
|
| 138 |
+
|
| 139 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017.
|
| 140 |
+
|
| 141 |
+
Shervin Minaee and Amirali Abdolrashidi. Finger-gan: Generating realistic fingerprint images using connectivity imposed gan. arXiv preprint arXiv:1812.10482, 2018.
|
| 142 |
+
|
| 143 |
+
Hoo-Chang Shin, Neil A Tenenholtz, Jameson K Rogers, Christopher G Schwarz, Matthew L Senjem, Jeffrey L Gunter, Katherine P Andriole, and Mark Michalski. Medical image synthesis for data augmentation and anonymization using generative adversarial networks. In International Workshop on Simulation and Synthesis in Medical Imaging, pages 1–11. Springer, 2018.
|
| 144 |
+
|
| 145 |
+
Yuhua Chen, Feng Shi, Anthony G Christodoulou, Yibin Xie, Zhengwei Zhou, and Debiao Li. Efficient and accurate mri super-resolution using a generative adversarial network and 3d multilevel densely connected network. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 91–99. Springer, 2018.
|
| 146 |
+
|
| 147 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, Bing Mirza, Mehdi; Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv:1406.2661, 2014.
|
| 148 |
+
|
| 149 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 150 |
+
|
| 151 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 152 |
+
|
| 153 |
+
Ashish Bora, Ajil Jalal, Eric Price, and Alexandros G Dimakis. Compressed sensing using generative models. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 537–546. JMLR. org, 2017.
|
| 154 |
+
|
| 155 |
+
Paul Hand and Vladislav Voroninski. Global guarantees for enforcing deep generative priors by empirical risk. arXiv preprint arXiv:1705.07576, 2017.
|
| 156 |
+
|
| 157 |
+
Paul Hand, Oscar Leong, and Vlad Voroninski. Phase retrieval under a generative prior. In Advances in Neural Information Processing Systems, pages 9136–9146, 2018.
|
| 158 |
+
|
| 159 |
+
Muhammad Asim, Fahad Shamshad, and Ali Ahmed. Blind image deconvolution using deep generative priors. arXiv preprint arXiv:1802.04073, 2018.
|
| 160 |
+
|
| 161 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pages 3730–3738, 2015.
|
| 162 |
+
|
| 163 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
|
| 164 |
+
|
| 165 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in neural information processing systems, pages 2214–2224, 2017.
|
| 166 |
+
|
| 167 |
+
Jörn-Henrik Jacobsen, Arnold Smeulders, and Edouard Oyallon. i-revnet: Deep invertible networks. arXiv preprint arXiv:1802.07088, 2018.
|
| 168 |
+
|
| 169 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pages 10215–10224, 2018.
|
| 170 |
+
|
| 171 |
+
Kostadin Dabov, Alessandro Foi, and Karen Egiazarian. Video denoising by sparse 3d transformdomain collaborative filtering. In 2007 15th European Signal Processing Conference, pages 145–149. IEEE, 2007.
|
| 172 |
+
|
| 173 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 174 |
+
|
| 175 |
+
C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. (CNS-TR-2011-001), 2011.
|
| 176 |
+
|
| 177 |
+
Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pages 722–729. IEEE, 2008.
|
| 178 |
+
|
| 179 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 180 |
+
|
| 181 |
+
Lynton Ardizzone, Jakob Kruse, Sebastian Wirkert, Daniel Rahner, Eric W Pellegrini, Ralf S Klessen, Lena Maier-Hein, Carsten Rother, and Ullrich Köthe. Analyzing inverse problems with invertible neural networks. arXiv preprint arXiv:1808.04730, 2018.
|
| 182 |
+
|
| 183 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9446–9454, 2018.
|
| 184 |
+
|
| 185 |
+
Reinhard Heckel and Paul Hand. Deep decoder: Concise image representations from untrained non-convolutional networks. arXiv preprint arXiv:1810.03982, 2018.
|
| 186 |
+
|
| 187 |
+
ShahRukh Athar, Evgeniy Burnaev, and Victor Lempitsky. Latent convolutional models. arXiv preprint arXiv:1806.06284, 2018.
|
| 188 |
+
|
| 189 |
+
# A EXPERIMENTAL SETUP
|
| 190 |
+
|
| 191 |
+
Simulations were completed mainly on CelebA-HQ dataset, used in Kingma and Dhariwal (2018); it has 30,000 color images that were resized to $6 4 \times 6 4$ for computational reasons, and were split into 27,000 training and 3000 test images. We also provide some additional experiments on the Flowers Nilsback and Zisserman (2008), and Birds Wah et al. (2011) datasets. Flowers dataset contains 8189 color images resized to $6 4 \times 6 4$ out of which 500 images are spared for testing. Birds dataset contains a total of 11,788 images, which were center aligned and resized to $6 4 \times 6 4$ out of which 5794 images are set aside for testing.
|
| 192 |
+
|
| 193 |
+
We specifically model our invertible networks after the recently proposed Glow Kingma and Dhariwal (2018) architecture, which consists of a multiple flow steps. Each flow step comprises of an activation normalization layer, a $1 \times 1$ convolutional layer, and an affine coupling layer, each of which is invertible. Let $K$ be the number of steps of flow before a splitting layer, and $L$ be the number of times the splitting is performed. To train over CelebA, we choose the network to have $K = 4 8$ , $L = 4$ and affine coupling, and train it with a learning rate 0.0001, and a batch size 6 at resolution $6 4 \times 6 4 \times 3$ The model was trained over 5 bit images with 10,000 warmup iterations as in Kingma and Dhariwal (2018), but when solving inverse problems using Glow original 8−bit images were used. We refer the reader to Kingma and Dhariwal (2018) for specific details on the operations performed in each of the network layer.
|
| 194 |
+
|
| 195 |
+
We use LBFGS to solve the inverse problem. For best performance, we set the number of iterations and learning rate for denoising, compressed sensing, and inpainting to be 20, 1; 30, 0.1; and 20, 1; respectively. we use Pytorch to implement Glow network training and solve the inverse problem. Glow training was conducted on a single Titan Xp GPU using a maximum allowable (under given computational constraints) batch size of 6. In case of CS, recovering a single image on Titan $\mathrm { X p }$ using LBFGS solver with 30 steps takes 889.125 seconds (14.82 minutes). However, we can solve 6 inverse problems in parallel on the given hardware platform.
|
| 196 |
+
|
| 197 |
+
Unless specified otherwise, inverse problem under Glow prior is always initialized with $z _ { 0 } = 0$ Whereas under DCGAN prior, we initialize with $z _ { 0 } \sim \mathcal { N } ( 0 , 0 . 1 ^ { 2 } I )$ and report average over three random restarts. In all the quantitative experiments over, the reported quality metrics such as PSNR, and reconstruction errors are averaged over 12 randomly drawn test set images.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 9: Samples from training set of CelebA downsampled to $6 4 \times 6 4 \times 3$ .
|
| 201 |
+
|
| 202 |
+
B DENOISING: ADDITIONAL EXPERIMENTS
|
| 203 |
+
|
| 204 |
+
We present additional quantitative experiments on image denoising here. Complete set of experiments on average PSNR over 12 CelebA (within distribution2) test set images versus penalization parameter $\gamma$ under noise levels $\sigma = 0 . 0 1$ , 0.05, 0.1, and 0.2 are presented in Figure 10 below. The central message is that Glow prior outperforms DCGAN prior uniformly across all $\gamma$ due to the representation limit of DCGAN. In addition, striking the right balance between the misfit term and the penalization term by appropriately choosing $\gamma$ improves the performance of Glow, and it also approaches stateof-the-art BM3D algorithm at low noise levels, and clearly visible in higher noise, for example, at a noise level of $\sigma = 0 . 2$ , the Glow prior improves upon BM3D by 2dB. Visually the results of Glow prior are clearly even superior to BM3D recoveries that are generally blurry and over smoothed as can be spotted in the qualitative results below. To avoid fitting the noisy image using the Glow model, we force the recoveries to be natural by choosing large enough $\gamma$ .
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 10: Image Denoising — Recovered PSNR values as a function of $\gamma$ under Glow prior, and DCGAN prior on (within-distribution) test set CelebA images. For reference, we show the average PSNRs of the original noisy images, and under the Glow prior in the noiseless case $( \sigma = 0$ ) in both panels. The average PSNR after applying BM3D, and the average PSNR under the Glow prior at noise levels $\sigma = 0 . 0 1 , 0 . 0 5 , 0 . 1 0 , 0 . 2 0$ are reported.
|
| 208 |
+
|
| 209 |
+
Recall that we are solving a regularized empirical risk minimization program
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\operatorname * { a r g m i n } _ { z \in \operatorname { D o m a i n } ( G ) } \| y - A G ( z ) \| ^ { 2 } + \gamma \| z \| .
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
In general, one can instead solve arg min $\| y - A G ( z ) \| ^ { 2 } + H ( \| z \| )$ , where $H ( \cdot )$ is a monotonically $z \in \operatorname { D o m a i n } ( G )$
|
| 216 |
+
increasing function. Figure 11 shows the comparison of most common choices of linear (already used in the rest of the paper), and quadratic $H$ in the context of densoing. We find that the highest achievable PSNR remains the same in both the cases, however, the penalization parameter $\gamma$ has to be adjusted accordingly.
|
| 217 |
+
|
| 218 |
+
We train Glow and DCGAN on CelebA. Additional qualitative image denosing results under higher noise level $\sigma = 0 . 1$ and 0.2 comparing Glow prior against DCGAN prior, and BM3D are presented below in Figure 12, and 13.
|
| 219 |
+
|
| 220 |
+
We also trained Glow model on Flowers dataset. Below we present its qualitative denoising performance against BM3D on the test set Flowers images. We also show the effect of varying $\gamma$ — smaller $\gamma$ leads to overfitting and vice versa.
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure 11: Image Denoising — Recovered PSNR values as a function of $\gamma$ under Glow prior with $\| z \|$ and $\| z \| ^ { 2 }$ penalization on (within-distribution) test set CelebA images. Comparison is provided with BM3D denoising at noise level $\sigma = 0 . 1$
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 12: Image Denoising — Visual comparisons under the Glow prior, the DCGAN prior, and BM3D at a noise level $\sigma = 0 . 1$ on CelebA (within-distribution) test set images. Under DCGAN prior, we only show the case of $\gamma = 0$ as this consistently gave the best performance for DCGAN. Under Glow prior, the best performance over is achieved with $\gamma = 1$ , overfitting of the image occurs with $\gamma = 0$ and underfitting occurs at $\gamma = 5$ . Note that the Glow prior with $\gamma = 1$ also gives a sharper image than BM3D.
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 13: Image Denoising — Visual comparisons under the Glow prior, the DCGAN prior, and BM3D at noise level $\sigma = 0 . 2$ on CelebA (within-distribution) test set images. Under DCGAN prior, we only show the case of $\gamma = 0$ as this consistently gives the best performance. Under Glow prior, the best performance is achieved with $\gamma = 2 . 5$ , overfitting of the image occurs with $\gamma = 0$ and underfitting occurs with $\gamma = 5$ . Note that the Glow prior with $\gamma = 2 . 5$ also gives a sharper image than BM3D.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 14: Image Denoising — Visual comparisons under the Glow prior, and BM3D at noise level $\sigma = 0 . 1$ on (within-distribution) test set Flowers images. Under Glow prior, the best performance is obtained with $\gamma = 1$ . Note that the Glow prior with $\gamma = 1$ also gives a sharper image than BM3D.
|
| 233 |
+
|
| 234 |
+
# C COMPRESSED SENISNG: ADDITIONAL EXPERIMENTS
|
| 235 |
+
|
| 236 |
+
Some additional quantitative image recovery results on test set of CelebA dataset are presented in Figure 15; it depicts the comparison of Glow prior, DCGAN prior, LASSO-DCT, and LASSO-WVT at compresimage and . We plot the reconstruction is the number of pixels in the $\begin{array} { r } { \vdots = \frac { 1 } { n } \| x - \hat { x } \| _ { 2 } ^ { 2 } } \end{array}$ , where A image $\hat { x }$ is the recovered Glow uniformly $n = 1 2 2 8 8$ $6 4 \times 6 4 \stackrel { \because } { \times } 3$
|
| 237 |
+
outperforms DCGAN, and LASSO across entire range of the number of measuremnts. LASSODCT and LASSO-WVT eventually catch up to Glow but only when observed measurements are a significant fraction of the total number of pixels. On the other hand, DCGAN is initially better than LASSO but prematurely saturates due to limited representation capacity.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 15: Compressed sensing — Reconstruction error vs. number of measurements under Glow prior, DCGAN prior, LASSO-DCT and LASSO-WVT on CelebA (within-distribution) test set images. Noise $\eta$ is scaled such that $\mathbb { E } \Vert \eta \Vert ^ { 2 } = 0 . 0 1$ and the penalization parameter $\gamma = 0$ for Glow, and DCGAN; and $\gamma = 0 . 0 1$ for LASSO-DCT, and LASSO-WVT.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 16: Compressed sensing — Zoomed-in version of the left panel of Figure 4 in the main paper in the low measurement regime for CelebA. PSNR vs. number of measurements under Glow prior, DCGAN prior, LASSO-DCT and LASSO-WVT on the CelebA (within distribution) test set images. Noise $\eta$ is scaled such that $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ and the penalization parameter $\gamma = 0$ for Glow and DCGAN; and $\gamma = 0 . 0 1$ for LASSO-DCT, and LASSO-WVT.
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
Figure 17: Compressed sensing under Glow prior. Performance comparison between LBFGS and Adam solver for the inverse problem. For Adam solver, 2000 gradient steps were taken with learning rate chosen to be 0.01. The rest of the parameters were fixed to be the same as with LBFGS.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure 18: Residual error vs. number of iterations. Left panel compares DCGAN and Glow priors. Both converge roughly at the same rate to their respective saturation levels. The right panel compares LBFGS and Adam solvers for compressed sensing under Glow prior. LBFGS tends to converge far more quickly than Adam. We choose $\gamma = 0$ in both the experiments.
|
| 250 |
+
|
| 251 |
+
Surprisingly, we observe that no explicit penalization of likelihood is necessary for compressive sensing with an invertible generative prior under formulation equation 2. That is, we can take $\gamma = 0$ when the optimization is initialized at $z _ { 0 } = 0$ . This indicates that algorithmic regularization is occurring and that initialization plays a role.We performed some additional experiments to study the role of initialization. The left panel in Figure 19 shows that as the norm of the latent initialization increases, the norm of the recovered latent representation increases and the PSNR of the recovered image decreases. Moreover, the right panel in Figure 19 shows the norm of the estimated latent representation at each iteration of the optimization. In all our experiments, it monotonically grows versus iteration number. These experiments provide further evidence that smaller latent initializations lead to outputs that are more natural and have smaller latent representations.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 19: The left panel shows the average PSNR over 12 test set images and norm of the optimizer $\hat { z }$ as a function of the norm of the initialization for the LBFGS solver to equation 2 for Compressed sensing under Glow prior with $\gamma = 0$ . The initialization $z _ { \mathrm { 0 } }$ was chosen randomly and rescaled to the desired norm. The right panel shows the norm of the estimated latent representation as a function of iteration number for multiple initializations. The Adam solver behaves similarly.
|
| 255 |
+
|
| 256 |
+
Recall that the natural face images correspond to smaller $z _ { \mathrm { 0 } }$ . In Figure 20, we plot the norm of the latent codes of the iterates of each algorithm vs. the number of iterations. The central message is that initializing with smaller norm $z _ { 0 }$ tends to yield natural (smaller latent representations) recoveries. This is one explanation as to why in compressed sensing, one is able to obtain the true solution out of the affine space of solutions without penalizing the unnaturalness of the recoveries.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 20: Compressed sensing — Norm of the latent codes with iterations. Left panel shows how the norm of the latent codes evolves over iterations of the LBFGS solver under different size initializations. Right panel shows the same experiment for the Adam solver (although over much larger number of iterations as Adam requires comparatively more iterations to converge). Each point is averaged over 12 test set images under random rescaled initializations $z _ { 0 }$ . We set the penalization parameter $\gamma = 0$ in both experiments.
|
| 260 |
+
|
| 261 |
+
We now present visual recovery results on test images from the CelebA dataset under varying number of measurements in compressed sesing. We compare recoveries under Glow prior, DCGAN prior, LASSO-DCT, and LASSO-WVT.
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 21: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 2 0 0$ $( \approx 1 . 5 \% )$ of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 22: Compressed sensing visual comparisons — Recoveries on the (within-distribution) test set images with a number $m = 3 0 0$ $( \approx 2 \% )$ ) of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 23: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 4 0 0$ $( \approx 3 \% )$ of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 24: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 5 0 0$ $( \approx 4 \% )$ ) of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 25: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 7 5 0$ $( \approx 6 \% )$ of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 26: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 1 0 0 0$ $( \approx 8 \% )$ ) of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 27: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 2 5 0 0$ $( \approx 2 0 \% )$ ) of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 28: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 5 0 0 0$ $( \approx 4 1 \% )$ ) of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 29: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 7 5 0 0$ $( \approx 6 1 \% )$ of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 30: Compressed sensing visual comparisons — Recoveries on (within-distribution) test set images with a number $m = 1 0$ , 000 $( \approx 8 1 \% )$ of measurements under the Glow prior, the DCGAN prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for both DCGAN, and Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 292 |
+
|
| 293 |
+
# C.1 COMPRESSED SENSING ON FLOWER AND BIRD DATASET
|
| 294 |
+
|
| 295 |
+
We also performed compressed sensing experiments similar to those on CelebA dataset above on Birds dataset, and Flowers dataset. We trained a Glow invertible network for each dataset, and present below the quantitative and qualitative recoveries for each dataset.
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 31: PSNR vs. number of measurements $m$ in compressed sensing under Glow prior, LASSODCT and LASSO-WVT on Birds dataset (left panel) and Flowers dataset (right panel). Noise $\eta$ is scaled such that $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ and the penalization parameter $\gamma = 0$ for Glow, and $\gamma = 0 . 0 1$ for LASSO-DCT, and LASSO-WVT.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 32: Compressed sensing — Visual comparisons on (within-distribution) test set images from Birds and Flowers dataset with a number $m = 2 0 0$ $( \approx 1 . 5 \%$ ) of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 33: Compressed sensing — Visual comparisons on (within-distribution) test set images from Birds and Flowers dataset with a number $m = 3 0 0$ $( \approx 2 \% )$ ) of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 34: Compressed sensing — Visual comparisons on (within-distribution) test set images from Birds and Flowers dataset with a number $m = 4 0 0$ $( \approx 3 \% )$ ) of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 35: Compressed sensing — Visual comparisons on (within-distribution) test set images from Birds and Flowers dataset with a number $m = 5 0 0$ $( \approx 4 \%$ ) of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 36: Compressed sensing — Visual comparisons on the test set images from Birds and Flowers dataset with a number $m = 7 5 0$ $( \approx 6 \% )$ ) of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 37: Compressed sensing — Visual comparisons on the test set images from Birds and Flowers dataset with a number $m = 1 , 0 0 0 ( \approx 8 \% )$ of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 38: Compressed sensing — Visual comparisons on the test set images from Birds and Flowers dataset with a number $m = 2 , 5 0 0 ( \approx 2 0 \% )$ of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 39: Compressed sensing — Visual comparisons on the test set images from Birds and Flowers dataset with a number $m = 5 , 0 0 0 ( \approx 4 1 \% )$ of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 40: Visual comparisons of compressed sensing of the test set images from Birds and Flowers dataset with a number $m = 7 , 5 0 0 ( \approx \mathrm { { \bar { 6 } 1 \% } ) }$ of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 41: Visual comparisons of compressed sensing of the test set images from Birds and Flowers dataset with a number $m = 1 0 , 0 0 0 ( \approx 8 1 \% )$ of measurements under the Glow prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance among the tested values. We use $\gamma = 0$ for Glow prior and $\gamma = 0 . 0 1$ for LASSO-WVT, and LASSO-DCT, respectively.
|
| 329 |
+
|
| 330 |
+
# C.2 COMPRESSED SENSING ON OUT OF DISTRIBUTION IMAGES
|
| 331 |
+
|
| 332 |
+
Lack of representation error in invertible nets leads us to an important and interesting question: does the trained network fit related natural images that are underrepresented or even unrepresented in the training dataset? Specifically, can a Glow network trained on CelebA faces be a good prior on other faces; for example, those with dark-skin tone, faces with glasses or facial hair, or even animated faces? In general, our experiments show that Glow prior has an excellent performance on such out-of-distribution images that are semantically similar to celebrity faces but not representative of the CelebA dataset. In particular, we have been able to recover faces of darker skin tone, older people with beards, eastern women, men with hats, and animated characters such as Shrek, from compressed measurements under the Glow prior. Recoveries under the Glow prior convincingly beat the DCGAN prior, which shows a definite bias due to training. Not only that, the Glow prior also outperforms unbiased methods such as LASSO-DCT, and LASSO-WVT.
|
| 333 |
+
|
| 334 |
+
Can we expect the Glow prior to continue to be an effective proxy for arbitrarily out-of-distribution images? To answer this question, we tested arbitrary natural images such as car, house door, and butterfly wings that are semantically unrelated to CelebA images. In general, we found that Glow is an effective prior at compressed sensing of out-of-distribution natural images, which are assigned a high likelihood score (small normed latent representations). On these images, Glow also outperforms LASSO.
|
| 335 |
+
|
| 336 |
+
Recoveries of natural images that are assigned very low-likelihood scores by the Glow model generally run into instability issues. During training, invertible nets learn to assign high likelihood scores to the training images. All the network parameters such as scaling in the coupling layers of Glow network are learned to behave stably with such high likelihood representations. However, on very low-likelihood representations, unseen during the training process, the networks becomes unstable and outputs of network begin to diverge to very large values; this may be due to several reasons, such as normalization (scaling) layers not being tuned to the unseen representations. An LBFGS search for the solution of an inverse problem to recover a low-likelihood image leads the iterates into neighborhoods of low-likelihood representations that may lead the network to instability.
|
| 337 |
+
|
| 338 |
+
We find that Glow network has the tendency to assign higher likelihood scores to arbitrarily outof-distribution natural images. This means that invertible networks have at least partially learned something more general about natural images from CelebA dataset — may be some high level features that face images share with other natural images such as smooth regions followed by discontinuities, etc. This allows Glow prior to extend its effectiveness as a prior to other natural images beyond just the training set.
|
| 339 |
+
|
| 340 |
+
Figure 42, 43 , 44, 45, and 46 compare the performance of LASSO-DCT, LASSO-WVT, DCGAN prior, and Glow prior on the compressed sensing of out-of-distribution images under varying number of measurements.
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 42: Compressed sensing $m = 1 0 0 0 \approx 8 \%$ of $n$ ) visual comparisons on out-of-distribution images. We compare the recoveries under Glow (trained on CelebA) prior, DCGAN (trained on CelebA) prior, LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance. We use $\gamma = 0$ for both DCGAN, and Glow prior and and optimize $\gamma$ for each recovery using LASSO-WVT, and LASSO-DCT.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 43: Compressed sensing $m = 2 5 0 0 \approx 2 0 \%$ of $n$ ) visual comparisons on out-of-distribution images. We compare the recoveries under Glow (trained on CelebA) prior, DCGAN (trained on CelebA) prior, LASSO-WVT, and LASSO-DCT at a noise level $\begin{array} { r } { \sqrt { \mathbb { E } \| \eta \| ^ { 2 } } = 0 . 1 . } \end{array}$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance. We use $\gamma = 0$ for both DCGAN, and Glow prior and and optimize $\gamma$ for each recovery using LASSO-WVT, and LASSO-DCT.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 44: Compressed sensing $m = 5 0 0 0 \approx 4 1 \%$ of $n$ ) visual comparisons on out-of-distribution images. We compare the recoveries under Glow prior (trained on CelebA), DCGAN prior (trained on CelebA), LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance. We use $\gamma = 0$ for both DCGAN, and Glow prior and and optimize $\gamma$ for each recovery using LASSO-WVT, and LASSO-DCT.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 45: Compressed sensing $m = 7 5 0 0 \approx 6 1 \%$ of $n$ ) visual comparisons on out-of-distribution images. We compare the recoveries under Glow prior (trained on CelebA), DCGAN prior (trained on CelebA), LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance. We use $\gamma = 0$ for both DCGAN, and Glow prior and and optimize $\gamma$ for each recovery using LASSO-WVT, and LASSO-DCT.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 46: Compressed sensing $( m = 1 0 , 0 0 0 , \approx 8 1 \%$ of $n$ ) visual comparisons on out-of-distribution images. We compare the recoveries under Glow prior (trained on CelebA), DCGAN prior (trained on CelebA), LASSO-WVT, and LASSO-DCT at a noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ . In each case, we choose values of the penalization parameter $\gamma$ to yield the best performance. We use $\gamma = 0$ for both DCGAN, and Glow prior and and optimize $\gamma$ for each recovery using LASSO-WVT, and LASSO-DCT.
|
| 356 |
+
|
| 357 |
+
# D IMAGE INPAINITING
|
| 358 |
+
|
| 359 |
+
Our experiments with inpainting reveal a similar story as with compressed sensing. Compared to DCGAN, the recovered PSNRs using Glow prior are much higher under appropriate $\gamma$ as depicted in the right panel in Figure 47. If improperly initialized, then performance for $\gamma = 0$ could be poor. Even if improperly initialized, sufficiently large $\gamma$ leads to higher PSNRs.
|
| 360 |
+
|
| 361 |
+
As with compressive sensing, if the initialization is from a small latent variable, then the empirical risk formulation with $\gamma = 0$ exhibits high PSNRs. Algorithmic regularization is again occurring due to the small latent variable initialization.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 47: Inpainiting: PSNR (averaged over 12 test images of CelebA) vs. penalization parameter $\gamma$ under Glow prior and DCGAN prior (left panel) and using different initializations under Glow prior (right panel).
|
| 365 |
+
|
| 366 |
+
We present here qualitative results on image inpainting under the DCGAN prior, and the Glow prior on the CelebA test set. Compared to DCGAN, the reconstructions from Glow are of noticeably higher visual quality.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 48: Image inpainiting results on CelebA test set. Masked images are recovered under DCGAN prior and Glow prior. Recoveries under DCGAN prior are skewed and blurred whereas Glow prior leads to sharper and coherent inpainted images. For both Glow and DCGAN, we set $\gamma = 0$ .
|
| 370 |
+
|
| 371 |
+
# D.1 IMAGE INPAINTING ON OUT OF DISTRIBUTION IMAGES
|
| 372 |
+
|
| 373 |
+
We now perform image inpainiting under Glow prior, and DCGAN prior each trained on CelebA. Figure 49 shows the visuals of out-of-distribution inpainiting. As before, DCGAN continues to suffer due to representation limits and data bias while Glow achieves reasonable reconstructions on out-of-distribution images semantically similar to CelebA faces. As one deviates to other natural images such as houses, doors, and butterfly wings, the inpainting performance deteriorates. At compressed sensing, Glow performed much better on such arbitrarily out-of-distribution images as good recoveries there only require the network only to assign a higher likelihood score to the true image compared to the all the candidate static images given by the null space of the measurement operator.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 49: Image inpainiting results on out-of-distribution images. Masked images are recovered under DCGAN prior and Glow prior. Recoveries under DCGAN prior are skewed and blurred whereas Glow prior leads to sharper and coherent inpainted images. For both Glow and DCGAN, we set $\gamma = 0$ .
|
| 377 |
+
|
| 378 |
+
# E DISCUSSION
|
| 379 |
+
|
| 380 |
+
Figure 50 confirms the intuition brought up in the Discussion Section of the main paper that trained Glow network assigns lower likelihoods (larger latent representations) to noisy images. Histograms show that noisy images are generally occupy the less likelihood regimes or equivalently, the larger norm latent representations.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 50: Histograms of the norm of the latent representation, $z$ , over 3000 test images under additive Gaussian noise with $\sigma = 0 . 1$ (left), $\sigma = 0 . 0 5$ (middle), and $\sigma = 0 . 0 1$ (right).
|
| 384 |
+
|
| 385 |
+
Our experiments verify that natural images have smaller latent representations than unnatural images. Here we also show that adding noise to natural images increases the norm of their latent representations, and that higher noise levels result in larger increases. Additionally we provide evidence that random perturbations in image space induce larger changes in $z$ than comparable natural perturbations in image space. Figure 51 shows a plot of the norm of the change in image space, averaged over 100 test images, as a function of the size of a perturbation in latent space. Natural directions are given by the interpolation between the latent representation of two test images. For the denoising problem, this difference in sensitivity indicates that the optimization algorithm might obtain a larger decrease in $\| z \|$ by an image modification that reduces unnatural image components than by a correspondingly large modification in a natural direction.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
Figure 51: The magnitude of the change in image space as a function of the size of a perturbation in latent space. Solid lines are the mean behavior and shaded region depicts $9 5 \%$ confidence interval.
|
| 389 |
+
|
| 390 |
+
# F LOSS LANDSCAPE: DCGAN VS. GLOW
|
| 391 |
+
|
| 392 |
+
In Figure 52, we plot $\lVert y - A G ( z ^ { * } + \alpha \delta _ { v } + \beta \delta _ { w } ) \rVert ^ { 2 }$ versus $( \alpha , \beta )$ where $\delta _ { v }$ and $\delta _ { w }$ are scaled to have the same norm as $z ^ { * }$ , the latent representation of a fixed test image. For DCGAN, we plot the loss landscape versus two pairs of random directions. For Glow, we plot the loss landscape versus a pair of random directions and a pair of directions that linearly interpolate in latent space between $z ^ { * }$ and another test image.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 52: Loss landscapes for $\| A G ( z ) - y \| _ { 2 } ^ { 2 } + \gamma \| z \| _ { 2 }$ with $\gamma = 0$ around the latent representation of a fixed image and with respect to either random latent directions or latent directions that interpolate between images.
|
| 396 |
+
|
| 397 |
+
# G IMAGE AND LATENT SPACE FORMULATIONS
|
| 398 |
+
|
| 399 |
+
As mentioned in the main paper, a natural formulation of the inverse problem is
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { n } } \| A x - y \| ^ { 2 } - \gamma \log p _ { G } ( x ) ,
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
where $p _ { G } ( x )$ is the target density. We instead formulate the inverse problem as
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\operatorname* { m i n } _ { z \in \mathbb { R } ^ { n } } \| A G ( z ) - y \| _ { 2 } ^ { 2 } + \gamma \| z \| _ { 2 } ;
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
a measurement misfit combined with a Gaussian prior on the latent space.
|
| 412 |
+
|
| 413 |
+
We will denote the target distribution by $p _ { G } ( x )$ and the latent Gaussian distribution by $p ( z )$ . To illustrate the differences between equation 3 and equation 4, we train a Real-NVP model Dinh et al. (2016) on a synthetic two-dimensional dataset, visualize both the $\log p _ { G } ( x )$ and $\log p ( z )$ in latent and image space, and solve a simple compressive sensing recovery problem. Our two dimensional data points are generated by sampling the first coordinate $x _ { 1 }$ from a bimodel Gaussian distribution and the second coordinate $x _ { 2 }$ from a uniform distribution as shown in Figure 53.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 53: A point cloud of the synthetically generated data $\boldsymbol { x } \in \mathbb { R } ^ { 2 }$
|
| 417 |
+
|
| 418 |
+
For comparison, we plot the $x$ -likelihood versus $x$ (left), latent $z$ -likelihood versus $x$ (middle), and $x$ -likelihood versus $z$ (right) in Figure 54. These plots illustrate that generally high-likelihood $x$ points are also given higher latent $z$ -likelihood, however, some low $x$ -likelihood might be assigned a higher Gaussian $z$ -likelihood; these are, for example, the points living on the darker contour spearing through the Gaussian bowl in the right plot. Figure 55 shows some of the points in the $x$ -likelihood (left) that map to this contour in the $z$ -space (right).
|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
Figure 54: $x$ -likelihood versus $x$ (left), $z$ -likelihood versus $x$ (middle), and $x$ -likelihood versus $z$ (right).
|
| 422 |
+
|
| 423 |
+

|
| 424 |
+
Figure 55: Some points (red-crosses) in $x$ -space mapped to $z$ -space. The (unwanted, as it corresponds to low-likelihood points) bridge connecting the models of the learned bimodal distribution is mapped to the contour in the $z$ -space.
|
| 425 |
+
|
| 426 |
+
# G.1 COMPRESSIVE SENSING IN 2D
|
| 427 |
+
|
| 428 |
+
To compare latent-space formulation equation 4 and data-space formulation equation 3, we construct a simple compressive sensing recovery problem for this two-dimensional data and illustrate the difference under both good and bad initializations. Specifically, we want to recover a vector $x =$ $[ x _ { 1 } \ x _ { 2 } ] ^ { \mathrm { T } }$ from a single linear measurement $y = \langle a , x \rangle = x _ { 2 }$ , where $a = [ 0 \ 1 ] ^ { \mathrm { T } }$ . Figure 56 shows the gradient descent path, and final solution, while solving equation 4 (left column), and equation 3 (right column) from a good and a bad initialization. $x$ -likelihood formulation seems more robust to a bad initialization in this case compared to $z$ -likelihood as $z$ -likelihood might not be a good proxy for $x$ -likelihood for some points. This bad case is carefully crafted to illustrate the difference between the two formulations, however, in practice, it seems unlikely that a low $x$ -likelihood points that somehow achieves higher $z$ -likelihood will also obey the measurement constraints.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 56: We show gradient descent path from the initialization to the final estimate along with true solution. In the first row, we initialized from $z = 0$ (good initialization) and in the second row we used low likelihood data points as intializations (bad initialization).
|
| 432 |
+
|
| 433 |
+
# G.2 COMPRESSIVE SENSING FOR CELEBA
|
| 434 |
+
|
| 435 |
+
In case of CelebA images, we found that optimizing over direct likelihood of images proved very hard to tune. To better understand why equation 4 is easier compared to equation 3, we draw the landscape of the loss surfaces of equation 4 versus $z$ and equation 3 versus $x$ under different $\gamma$ in two random directions around an the ground truth in $z$ , or $x$ , as appropriate; see Figure 57. In the $x$ -formulation the loss surfaces (first row) have a sharp dip at the ground truths, which comes from $- \log p _ { G } ( x )$ term. We believe that sharp dip in the loss surface makes it difficult to tune the $\gamma$ parameter, the learning rate, and makes the optimization using equation 3 numerically more challenging as observed in our experiments. On the other hand, the loss surfaces for equation 4 (second row) appear smoother.
|
| 436 |
+
|
| 437 |
+
We now show a quantitative comparison of the $x$ -likelihood formulation in equation 3, and $z$ - likelihood formulation in equation 4 on compressive sensing for CelebA test images versus $m$ for fixed values of $\gamma$ ; see Figure 58. We initialize with $z _ { 0 } = 0$ , and $x _ { 0 } = G ( z _ { 0 } )$ , as appropriate. We simply choose $\gamma = 0$ in equation 4. However, we need to choose $\gamma$ more carefully in equation 3, and different values of $\gamma$ are appropriate across different undersampling ratios. Even if one ignores the difficulty of choosing the hyperparameter $\gamma$ , the formulation in equation 4 generally performs much better than equation 3 as evident from the plots.
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Figure 57: Landscapes of the loss surfaces in the $x$ -space (first row), the loss surfaces of in the $z$ -space (second row) for various values of $\gamma$ , and loss surface of $x$ -likelihood $- \log p ( x )$ (third row).
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Figure 58: We report PSNR against number of measurements $m$ when optimizing in the latent space equation 4 with $\gamma = 0$ and the image space equation 3 with $\gamma$ set to 10, 50 and 100.
|
| 444 |
+
|
| 445 |
+
To show the effect of noise on recovery in compressive sensing under different values of $\gamma$ and noise levels, we plot PSNR of the iterates when solving equation 4 against iterations in Figure 59. This plot shows, perhaps surprisingly, that even under noisy compressed measurements it is a good idea to solve the inverse compressed sensing problem equation 4 with $\gamma = 0$ .
|
| 446 |
+
|
| 447 |
+
# G.3 DENOISING FOR CELEBA
|
| 448 |
+
|
| 449 |
+
For completeness, we also compare denoising using our latent space formulation equation 4, our image space forumation equation 3 under different noise levels $\sigma = 0 . 0 5$ and $\sigma = 0 . 1 0$ ; see Figure 60 and Figure 61 respectively. For both noise levels, we observe equal performance (indicated by the highest PSNR) when optimizing in the latent or image space. We do not report results over $\sigma = 0 . 2 0$ as it was hard to tune hyper paremeters for higher noise levels in equation 3.
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
Figure 59: We plot PSNR against gradient iterations for compressive sensing at $m = 5 0 0 0$ on a single image under the presence and absence of noise with different values of $\gamma$ with noise level $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 0 . 1$ (left) and $\sqrt { \mathbb { E } \lVert \eta \rVert ^ { 2 } } = 1$ (right).
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
Figure 60: Denoising comparision at $\sigma = 0 . 0 5$ when optimizing over latent space (left) versus image space (right).
|
| 456 |
+
|
| 457 |
+

|
| 458 |
+
Figure 61: Denoising comparision at $\sigma = 0 . 1 0$ when optimizing over latent space (left) versus image space (right).
|
md/train/BkMiWhR5K7/BkMiWhR5K7.md
ADDED
|
@@ -0,0 +1,605 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PRIOR CONVICTIONS: BLACK-BOX ADVERSARIAL ATTACKS WITH BANDITS AND PRIORS
|
| 2 |
+
|
| 3 |
+
Andrew Ilyas∗, Logan Engstrom∗, Aleksander M ˛adry {ailyas, engstrom, madry}@mit.edu MIT CSAIL
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We study the problem of generating adversarial examples in a black-box setting in which only loss-oracle access to a model is available. We introduce a framework that conceptually unifies much of the existing work on black-box attacks, and we demonstrate that the current state-of-the-art methods are optimal in a natural sense. Despite this optimality, we show how to improve black-box attacks by bringing a new element into the problem: gradient priors. We give a bandit optimization-based algorithm that allows us to seamlessly integrate any such priors, and we explicitly identify and incorporate two examples. The resulting methods use two to four times fewer queries and fail two to five times less than the current state-of-the-art. 1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent research has shown that neural networks exhibit significant vulnerability to adversarial examples, or slightly perturbed inputs designed to fool the network prediction. This vulnerability is present in a wide range of settings, from situations in which inputs are fed directly to classifiers (Szegedy et al., 2013; Carlini et al., 2016) to highly variable real-world environments (Kurakin et al., 2016; Athalye et al., 2017). Researchers have developed a host of methods to construct such attacks (Goodfellow et al., 2014; Moosavi-Dezfooli et al., 2015; Carlini & Wagner, 2017; Madry et al., 2017), most of which correspond to first order (i.e., gradient based) methods. These attacks turn out to be highly effective: in many cases, only a few gradient steps suffice to construct an adversarial perturbation.
|
| 12 |
+
|
| 13 |
+
A significant shortcoming of many of these attacks, however, is that they fundamentally rely on the white-box threat model. That is, they crucially require direct access to the gradient of the classification loss of the attacked network. In many real-world situations, expecting this kind of complete access is not realistic. In such settings, an attacker can only issue classification queries to the targeted network, which corresponds to a more restrictive black box threat model.
|
| 14 |
+
|
| 15 |
+
Recent work (Chen et al., 2017; Bhagoji et al., 2017; Ilyas et al., 2017) provides a number of attacks for this threat model. Chen et al. (2017) show how to use a basic primitive of zeroth order optimization, the finite difference method, to estimate the gradient from classification queries and then use it (in addition to a number of optimizations) to mount a gradient based attack. The method indeed successfully constructs adversarial perturbations. It comes, however, at the cost of introducing a significant overhead in terms of the number of queries needed. For instance, attacking an ImageNet (Russakovsky et al., 2015) classifier requires hundreds of thousands of queries. Subsequent work (Ilyas et al., 2017) improves this dependence significantly, but still falls short of fully mitigating this issue (see Section 4.1 for a more detailed analysis).
|
| 16 |
+
|
| 17 |
+
# 1.1 OUR CONTRIBUTIONS
|
| 18 |
+
|
| 19 |
+
We revisit zeroth-order optimization in the context of adversarial example generation, both from an empirical and theoretical perspective. We propose a new approach for generating black-box adversarial examples, using bandit optimization in order to exploit prior information about the gradient, which we show is necessary to break through the optimality of current methods. We evaluate our approach on the task of generating black-box adversarial examples, where the methods obtained from integrating two example priors significantly outperform state-of-the-art approaches.
|
| 20 |
+
|
| 21 |
+
Concretely, in this work:
|
| 22 |
+
|
| 23 |
+
1. We formalize the gradient estimation problem as the central problem in the context of query-efficient black-box attacks. We then show how the resulting framework unifies the previous attack methodology. We prove that the least squares method, a classic primitive in signal processing, not only constitutes an optimal solution to the general gradient estimation problem but also is essentially equivalent to the current-best black-box attack methods.
|
| 24 |
+
2. We demonstrate that, despite this seeming optimality of these methods, we can still improve upon them by exploiting an aspect of the problem that has been not considered previously: the priors we have on the distribution of the gradient. We identify two example classes of such priors, and show that they indeed lead to better predictors of the gradient.
|
| 25 |
+
3. Finally, we develop a bandit optimization framework for generating black-box adversarial examples which allows for the seamless integration of priors. To demonstrate its effectiveness, we show that leveraging the two aforementioned priors yields black-box attacks that are 2-5 times more query efficient and less failure-prone than the state of the art.
|
| 26 |
+
|
| 27 |
+
Table 1: Summary of effectiveness of $\ell _ { 2 }$ and $\ell _ { \infty }$ ImageNet attacks on Inception v3 using NES, bandits with time prior (BanditsT ), and bandits with time and data-dependent priors (Bandits $_ { T D }$ ). Note that in the first column, the average number of queries is calculated only over successful attacks, and we enforce a query limit of 10,000 queries. For purposes of direct comparison, the last column calculates the average number of queries used for only the images that NES (previous SOTA) was successful on. Our most powerful attack uses 2-4 times fewer queries, and fails 2-5 times less often.
|
| 28 |
+
|
| 29 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">Avg. Queries</td><td colspan="2">Failure Rate</td><td colspan="2">Queries on NES Success</td></tr><tr><td>l8</td><td>l2</td><td>l8</td><td>l2</td><td>l8</td><td>l2</td></tr><tr><td>NES</td><td>1735</td><td>2938</td><td>22.2%</td><td>34.4%</td><td>1735</td><td>2938</td></tr><tr><td>BanditsT</td><td>1781</td><td>2690</td><td>11.6%</td><td>30.4%</td><td>1214</td><td>2421</td></tr><tr><td>BanditsTD</td><td>1117</td><td>1858</td><td>4.6%</td><td>15.5%</td><td>703</td><td>999</td></tr></table>
|
| 30 |
+
|
| 31 |
+
# 2 BLACK-BOX ATTACKS AND THE GRADIENT ESTIMATION PROBLEM
|
| 32 |
+
|
| 33 |
+
Adversarial examples are natural inputs to a machine learning system that have been carefully perturbed in order to induce misbehaviour of the system, under a constraint on the magnitude of the pertubation (under some metric). For image classifiers, this misbehaviour can be either classification as a specific class other than the original one (the targeted attack) or misclassification (the untargeted attack). For simplicity and to make the presentation of the overarching framework focused, in this paper we restrict our attention to the untargeted case. Both our algorithms and the whole framework can be, however, easily adapted to the targeted setting. Also, we consider the most standard threat model in which adversarial perturbations must have $\ell _ { p }$ -norm, for some fixed $p$ , less than some $\epsilon _ { p }$ .
|
| 34 |
+
|
| 35 |
+
# 2.1 FIRST-ORDER ADVERSARIAL ATTACKS
|
| 36 |
+
|
| 37 |
+
Suppose that we have some classifier $C ( x )$ with a corresponding classification loss function $L ( x , y )$ , where $x$ is some input and $y$ its corresponding label. In order to generate a misclassified input from some input-label pair $( x , y )$ , we want to find an adversarial example $x ^ { \prime }$ which maximizes $L ( x ^ { \prime } , y )$ but still remains $\epsilon _ { p }$ -close to the original input. We can thus formulate our adversarial attack problem as the following constrained optimization task:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
x ^ { \prime } = \underset { x ^ { \prime } : \| x ^ { \prime } - x \| _ { p } \leq \epsilon _ { p } } { \arg \operatorname* { m a x } } L ( x ^ { \prime } , y )
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
First order methods tend to be very successful at solving the problem despite its non-convexity (Goodfellow et al., 2014; Carlini & Wagner, 2017; Madry et al., 2017). A first order method used as the backbone of some of the most powerful white-box adversarial attacks for $\ell _ { p }$ bounded adversaries is
|
| 44 |
+
|
| 45 |
+
projected gradient descent $( P G D )$ . This iterative method, given some input $x$ and its correct label $y$ , computes a perturbed input $x _ { k }$ by applying $k$ steps of the following update (with $x _ { 0 } = x $ )
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r } { x _ { l } = \Pi _ { B _ { p } ( x , \epsilon ) } ( x _ { l - 1 } + \eta s _ { l } ) \qquad \mathrm { w i t h } \ s _ { l } = \Pi _ { \partial B _ { p } ( 0 , 1 ) } \nabla _ { x } L ( x _ { l - 1 } , y ) } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Here, $\Pi _ { S }$ is the projection onto the set $S$ , $B _ { p } ( x ^ { \prime } , \varepsilon ^ { \prime } )$ is the $\ell _ { p }$ ball of radius $\varepsilon ^ { \prime }$ around $x ^ { \prime }$ , $\eta$ is the step size, and $\partial U$ is the boundary of a set $U$ . Also, as is standard in continuous optimization, we make $s _ { l }$ be the projection of the gradient $\nabla _ { x } L ( x _ { l - 1 } , y )$ at $x _ { l - 1 }$ onto the unit $\ell _ { p }$ ball. This way we ensure that $s _ { l }$ corresponds to the unit $\ell _ { p }$ -norm vector that has the largest inner product with $\nabla _ { x } L ( x _ { l - 1 } , y )$ . (Note that, in the case of the $\ell _ { 2 }$ -norm, $s _ { l }$ is simply the normalized gradient but in the case of, e.g., the $\ell _ { \infty }$ -norm, $s _ { l }$ corresponds to the sign vector, $\operatorname { s g n } \left( \nabla _ { \boldsymbol { x } } L ( x _ { l - 1 } , y ) \right)$ of the gradient.)
|
| 52 |
+
|
| 53 |
+
So, intuitively, the PGD update perturbs the input in the direction that (locally) increases the loss the most. Observe that due to the projection in (1), $x _ { k }$ is always a valid perturbation of $x$ , as desired.
|
| 54 |
+
|
| 55 |
+
# 2.2 BLACK-BOX ADVERSARIAL ATTACKS
|
| 56 |
+
|
| 57 |
+
The projected gradient descent (PGD) method described above is designed to be used in the context of so-called white-box attacks. That is, in the setting where the adversary has full access to the gradient $\nabla _ { x } L ( x , y )$ of the loss function of the attacked model. In many practical scenarios, however, this kind of access is not available—in the corresponding, more realistic black-box setting, the adversary has only access to an oracle that returns for a given input $( x , y )$ , only the value of the loss $L ( x , y )$ .
|
| 58 |
+
|
| 59 |
+
One might expect that PGD is thus not useful in such black-box setting. It turns out, however, that this intuition is incorrect. Specifically, one can still estimate the gradient using only such value queries. (In fact, this kind of estimator is the backbone of so-called zeroth-order optimization frameworks (Spall, 2005).) The most canonical primitive in this context is the finite difference method. This method estimates the directional derivative $D _ { v } f ( x ) = \langle \nabla _ { x } f ( x ) , v \rangle$ of some function $f$ at a point $x$ in the direction of a vector $v$ as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
D _ { v } f ( x ) = \langle \nabla _ { x } f ( x ) , v \rangle \approx \left( f ( x + \delta v ) - f ( x ) \right) / \delta .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Here, the step size $\delta > 0$ governs the quality of the gradient estimate. Smaller $\delta$ gives more accurate estimates but also decreases reliability, due to precision and noise issues. Consequently, in practice, $\delta$ is a tunable parameter. Now, we can just use finite differences to construct an estimate of the gradient. To this end, one can find the $d$ components of the gradient by estimating the inner products of the gradient with all the standard basis vectors $e _ { 1 } , \ldots , e _ { d }$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\widehat { \nabla } _ { x } L ( x , y ) = \sum _ { k = 1 } ^ { d } e _ { k } \left( L ( x + \delta e _ { k } , y ) - L ( x , y ) \right) / \delta \approx \sum _ { k = 1 } ^ { d } e _ { k } \langle \nabla _ { x } L ( x , y ) , e _ { k } \rangle
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
We can then easily implement the PGD attack (c.f. (1)) using this estimator:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { x _ { l } = \Pi _ { B _ { p } ( x , \epsilon ) } ( x _ { l - 1 } + \eta \widehat { s _ { l } } ) \qquad \mathrm { w i t h } \quad \widehat { s } _ { l } = \Pi _ { \partial B _ { p } ( 0 , 1 ) } \widehat { \nabla } _ { x } L ( x _ { l - 1 } , y ) } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Indeed, Chen et al. (2017) were the first to use finite differences methods in this basic form to power PGD–based adversarial attack in the black-box setting. This basic attack was shown to be successful but, since its query complexity is proportional to the dimension, its resulting query complexity was prohibitively large. For example, the Inception v3 (Szegedy et al., 2015) classifier on the ImageNet dataset has dimensionality $\mathtt { d } = 2 6 8 , 2 0 3$ and thus this method would require 268,204 queries. (It is worth noting, however, that Chen et al. (2017) developed additional methods to, at least partially, reduce this query complexity.)
|
| 78 |
+
|
| 79 |
+
# 2.3 BLACK-BOX ATTACKS WITH IMPERFECT GRADIENT ESTIMATORS
|
| 80 |
+
|
| 81 |
+
In the light of the above discussion, one can wonder if the algorithm (4) can be made more queryefficient. A natural idea here would be to avoid fully estimating the gradient and rely instead only on its imperfect estimators. This gives rise to the following question: How accurate of an gradient estimate is necessary to execute a successful PGD attack?
|
| 82 |
+
|
| 83 |
+
We examine this question first in the simplest possible setting: one in which we only take a single PGD step (i.e., the case of $k = 1$ ). Previous work (Goodfellow et al., 2014) indicates that such an attack can already be quite powerful. So, we study how the effectiveness of this attack varies with gradient estimator accuracy. Our experiments, shown in Figure 1, suggest that it is feasible to generate adversarial examples without estimating correctly even most of the coordinates of the gradient. For example, in the context of $\ell _ { \infty }$ attacks, setting a randomly selected $20 \%$ of the coordinates in the gradient to match the true gradient (and making the remaining coordinates have random sign) is sufficient to fool the classifier on more than $60 \%$ images with single-step PGD. Our experiments thus demonstrate that an adversary is likely to be able to cause a misclassification by performing the iterated PGD attack, even when driven by a gradient estimate that is largely imperfect.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 1: The fraction of correctly estimated coordinates of $\operatorname { s g n } ( \nabla _ { x } L ( x , y ) )$ required to successfully execute the single-step PGD (also known as FGSM) attack, with $\epsilon = 0 . 0 5$ . In the experiment, for each $k$ , the top $k$ percent – chosen either by magnitude $( \mathrm { t o p - k } )$ or randomly $( \mathtt { r a n d o m - k } )$ ) – of the signs of the coordinates are set correctly, and the rest are set to $+ 1$ or $- 1$ at random. The adversariality rate is the portion of 1,000 random ImageNet images misclassified after one FGSM step. For example, estimating only $20 \%$ of coordinates correctly leads to misclassification for $> 6 0 \%$ of images.
|
| 87 |
+
|
| 88 |
+
# 2.4 THE GRADIENT ESTIMATION PROBLEM
|
| 89 |
+
|
| 90 |
+
The above discussion makes it clear that successful attacks do not require a perfect gradient estimation, provided this estimate is suitably constructed. It is still unclear, however, how to efficiently find this kind of imperfect but helpful estimator. Continuous optimization methodology suggests that the key characteristic needed from our estimator is for it to have a sufficiently large inner product with the actual gradient. We thus capture this challenge as the following gradient estimation problem:
|
| 91 |
+
|
| 92 |
+
Definition 1 (Gradient estimation problem). For an input/label pair $( x , y )$ and a loss function $L _ { i }$ , let $\boldsymbol { g } ^ { * } = \nabla _ { \boldsymbol { x } } L ( \boldsymbol { x } , \boldsymbol { y } )$ be the gradient of $L$ at $( x , y )$ . Then the goal of the gradient estimation problem is to find a unit vector $\widehat g$ maximizing the inner product
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathbb { E } \left[ \widehat { \boldsymbol { g } } ^ { T } \boldsymbol { g } ^ { * } \right] ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
from a limited number of (possibly adaptive) function value queries $L ( x ^ { \prime } , y ^ { \prime } )$ . (The expectation here is taken over the randomness of the estimation algorithm.)
|
| 99 |
+
|
| 100 |
+
One useful perspective on the above gradient estimation problem stems from casting the recovery of $g ^ { * }$ in (5) as an underdetermined vector estimation task. That is, one can view each execution of the finite difference method (see (2)) as computing an inner product query in which we obtain the value of the inner product of $g ^ { * }$ and some chosen direction vector $A _ { i }$ . Now, if we execute $k$ such queries, and $k < d$ (which is the regime we are interested in), the information acquired in this process can be expressed as the following (underdetermined) linear regression problem $A g ^ { * } = y$ , where the rows of the matrix $A$ correspond to the queries $A _ { 1 } , \ldots , A _ { k }$ and the entries of the vector $y$ gives us the corresponding inner product values.
|
| 101 |
+
|
| 102 |
+
Relation to compressive sensing. The view of the gradient estimation problem we developed bears striking similarity to the compressive sensing setting (Foucart & Rauhut, 2013). Thus one might wonder if the toolkit of that area could be applied here. Compressive sensing crucially requires, however, certain sparsity structure in the estimated signal (here, in the gradient $g ^ { * }$ ) and, to our knowledge, the loss gradients do not exhibit such a structure. (We discuss this further in Appendix B.)
|
| 103 |
+
|
| 104 |
+
The least squares method. In light of this, we turn our attention to another classical signal-processing method: norm-minimizing $\ell _ { 2 }$ least squares estimation. This method approaches the estimation problem posed in (5) by casting it as an undetermined linear regression problem of the form $A g ^ { * } = b$ , where we can choose the matrix $A$ (the rows of $A$ correspond to inner product queries with $g ^ { * }$ ). Then, it obtains the solution $\widehat g$ to the regression problem by solving:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\operatorname* { m i n } _ { \widehat { \boldsymbol { g } } } \| \widehat { \boldsymbol { g } } \| _ { 2 } \qquad \mathrm { s . t . ~ } A \widehat { \boldsymbol { g } } = \boldsymbol { y } .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
A reasonable choice for $A$ (via Johnson & Lindenstrauss (1984) and related results) is the distancepreserving random Gaussian projection matrix, i.e. $A _ { i j }$ normally distributed.
|
| 111 |
+
|
| 112 |
+
The resulting algorithm turns out to yield solutions that are approximately those given by Natural Evolution Strategies (NES), which (Ilyas et al., 2017) previously applied to black-box attacks. In particular, in Appendix A, we prove the following theorem.
|
| 113 |
+
|
| 114 |
+
Theorem 1 (NES and Least Squares equivalence). Let $\hat { x } _ { N E S }$ be the Gaussian $k$ -query NES estimator of a $d$ -dimensional gradient $\textbf { { g } }$ and let $\hat { x } _ { L S Q }$ be the minimal-norm $k$ -query least-squares estimator of $\textbf { { g } }$ . For any $p > 0$ , with probability at least $1 - p$ we have that
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r } { \langle \hat { x } _ { L S Q } , \pmb { g } \rangle - \langle \hat { x } _ { N E S } , \pmb { g } \rangle \leq O \left( \sqrt { ( k / d ) \cdot \log ^ { 3 } \left( ( k / p ) \right) } \right) \| \pmb { g } \| ^ { 2 } . } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Note that when we work in the underdetermined setting, i.e., when $k \ll d$ (which is the setting we are interested in), the right hand side bound becomes vanishingly small. Thus, the equivalence indeed holds. In fact, using the precise statement (given and proved in Appendix A), we can show that Theorem 1 provides us with a non-vacuous equivalence bound. Further, it turns out that one can exploit this equivalence to prove that the algorithm proposed in Ilyas et al. (2017) is not only natural but optimal, as the least-squares estimate is an information-theoretically optimal gradient estimate in the regime where $k = d$ , and an error-minimizing estimator in the regime where $k < < d$ .
|
| 121 |
+
|
| 122 |
+
Theorem 2 (Least-squares optimality (Proof in Appendix A)). For a linear regression problem $y = A g$ with known $A$ and $y$ , unknown $\mathbf { \pmb { g } }$ , and isotropic Gaussian errors, the least-squares estimator is finite-sample efficient, i.e. the minimum-variance unbiased (MVU) estimator of the latent vector $\textbf { { g } }$
|
| 123 |
+
|
| 124 |
+
Theorem 3 (Least-squares optimality (Proof in Meir (1994))). In the underdetermined setting, i.e. when $k < < d$ , the minimum-norm least squares estimate (xˆLSQ in Theorem 1) is the minimumvariance (and thus minimum-error, since bias is fixed) estimator with no empirical loss.
|
| 125 |
+
|
| 126 |
+
# 3 BLACK-BOX ADVERSARIAL ATTACKS WITH PRIORS
|
| 127 |
+
|
| 128 |
+
The optimality of least squares strongly suggests that we have reached the limit of query-efficiency of black-box adversarial attacks. But is this really the case? Surprisingly, we show that an improvement is still possible. The key observation is that the optimality we established of least-squares (and by Theorem 1, the NES approach in (Ilyas et al., 2017)) holds only for the most basic setting of the gradient estimation problem, a setting where we assume that the target gradient is a truly arbitrary and completely unknown vector.
|
| 129 |
+
|
| 130 |
+
However, in the context we care about this assumption does not hold – there is actually plenty of prior knowledge about the gradient available. Firstly, the input with respect to which we compute the gradient is not arbitrary and exhibits locally predictable structure which is consequently reflected in the gradient. Secondly, when performing iterative gradient attacks (e.g. PGD), the gradients used in successive iterations are likely to be heavily correlated.
|
| 131 |
+
|
| 132 |
+
The above observations motivate our focus on prior information as an integral element of the gradient estimation problem. Specifically, we enhance Definition 1 by making its objective
|
| 133 |
+
|
| 134 |
+
$\mathbb { E } \left[ \widehat { \boldsymbol { g } } ^ { T } \boldsymbol { g } ^ { * } | \boldsymbol { I } \right]$ , where $I$ is prior information available to us.
|
| 135 |
+
|
| 136 |
+
This change in perspective gives rise to two important questions: does there exist prior information that can be useful to us?, and does there exist an algorithmic way to exploit this information? We show that the answer to both of these questions is affirmative.
|
| 137 |
+
|
| 138 |
+
# 3.1 GRADIENT PRIORS
|
| 139 |
+
|
| 140 |
+
Consider a gradient $\nabla _ { x } L ( x , y )$ of the loss function corresponding to some input $( x , y )$ . Does there exist some kind of prior that can be extracted from the dataset $\{ x _ { i } \}$ , in general, and the input $( x , y )$
|
| 141 |
+
|
| 142 |
+
in particular, that can be used as a predictor of the gradient? We demonstrate that it is indeed the case, and give two example classes of such priors.
|
| 143 |
+
|
| 144 |
+
Time-dependent priors. The first class of priors we consider are time-dependent priors, a standard example of which is what we refer to as the “multi-step prior.” We find that along the trajectory taken by estimated gradients, successive gradients are in fact heavily correlated. We show this empirically by taking steps along the optimization path generated by running the NES estimator at each point, and plotting the normalized inner product (cosine similarity) between successive gradients, given by
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\begin{array} { r l } { \frac { \langle \nabla _ { x } L ( x _ { t } , y ) , \nabla _ { x } L ( x _ { t + 1 } , y ) \rangle } { | | \nabla _ { x } L ( x _ { t } , y ) | | _ { 2 } | | \nabla _ { x } L ( x _ { t + 1 } , y ) | | _ { 2 } } \quad } & { t \in \{ 1 \ldots T - 1 \} . } \end{array}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 2: Cosine similarity between the gradients at the current and previous steps along the optimization trajectory of NES PGD attacks, averaged over 1000 random ImageNet images.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Cosine similarity of “tiled” image gradient with original image gradient versus the length of the square tiles, averaged over 5,000 randomly selected ImageNet images.
|
| 155 |
+
|
| 156 |
+
Figure 2 demonstrates that there indeed is a non-trivial correlation between successive gradients— typically, the gradients of successive steps (using step size from Ilyas et al. (2017)) have a cosine similarity of about 0.9. Successive gradients continue to correlate at higher step sizes: Appendix B shows that the trend continues even at step size 4.0 (a typical value for the total perturbation bound $\varepsilon$ ). This indicates that there indeed is a potential gain from incorporating this correlation into our iterative optimization. To utilize this gain, we intend to use the gradients at time $t - 1$ as a prior for the gradient at time $t$ , where both the prior and the gradient estimate itself evolve over iterations.
|
| 157 |
+
|
| 158 |
+
Data-dependent priors. We find that the time-dependent prior discussed above is not the only type of prior one can exploit here. Namely, we can also use the structure of the inputs themselves to reduce query complexity (in fact, the existence of such data-dependent priors is what makes machine learning successful in the first place).
|
| 159 |
+
|
| 160 |
+
In the case of image classification, a simple and heavily exploited example of such a prior stems from the fact that images tend to exhibit a spatially local similarity (i.e. pixels that are close together tend to be similar). We find that this similarity also extends to the gradients: specifically, whenever two coordinates $( i , j )$ and $( k , l )$ of $\nabla _ { x } L ( x , y )$ are close, we expect $\mathsf { \bar { V } } _ { x } L ( x , y ) _ { i j } \approx \nabla _ { x } \bar { L ( x , y ) } _ { k l }$ too. To corroborate and quantify this phenomenon, we compare $\nabla _ { x } L ( x , y )$ with an average-pooled, or “tiled”, version (with “tile length” $k$ ) of the same signal. An example of such an average-blurred gradient can be seen in Appendix B. More concretely, we apply to the gradient the mean pooling operation with kernel size $( k , k , 1 )$ and stride $( k , k , 1 )$ , then upscale the spatial dimensions by $k$ . We then measure the cosine similarity between the average-blurred gradient and the gradient itself. Our results, shown in Figure 3, demonstrate that the gradients of images are locally similar enough to allow for average-blurred gradients to maintain relatively high cosine similarity with the actual gradients, even when the tiles are large. Our results suggest that we can reduce the dimensionality of our problem by a factor of $k ^ { 2 }$ (for reasonably large $k$ ) and still estimate a vector pointing close to the same direction as the original gradient. This factor, as we show later, leads to significantly improved black-box adversarial attack performance.
|
| 161 |
+
|
| 162 |
+
# 3.2 A FRAMEWORK FOR GRADIENT ESTIMATION WITH PRIORS
|
| 163 |
+
|
| 164 |
+
Given the availability of these informative gradient priors, we now need a framework that enables us to easily incorporate these priors into our construction of black-box adversarial attacks. Our proposed method builds on the framework of bandit optimization, a fundamental tool in online convex optimization Hazan (2016). In the bandit optimization framework, an agent plays a game that consists of a sequence of rounds. In round $t$ , the agent must choose a valid action, and then by playing the action incurs a loss given by a loss function $\ell _ { t } ( \cdot )$ that is unknown to the agent. After playing the action, he/she only learns the loss that the chosen action incurs; the loss function is specific to the round $t$ and may change arbitrarily between rounds. The goal of the agent is to minimize the average loss incurred over all rounds, and the success of the agent is usually quantified by comparing the total loss incurred to that of the best expert in hindsight (the best single-action policy). By the nature of this formulation, the rounds of this game can not be treated as independent — to perform well, the agent needs to keep track of some latent record that aggregates information learned over a sequence of rounds. This latent record usually takes a form of a vector $v _ { t }$ that is constrained to a specified (convex) set $\kappa$ . As we will see, this aspect of the bandit optimization framework will provide us with a convenient way to incorporate prior information into our gradient prediction.
|
| 165 |
+
|
| 166 |
+
An overview of gradient estimation with bandits. We can cast the gradient estimation problem as an bandit optimization problem in a fairly direct manner. Specifically, we let the action at each round $t$ be a gradient estimate $g _ { t }$ (based on our latent vector $v _ { t }$ ), and the loss $\ell _ { t }$ correspond to the (negative) inner product between this prediction and the actual gradient. Note that we will never have a direct access to this loss function $\ell _ { t }$ but we are able to evaluate its value on a particular prediction vector $g _ { t }$ via the finite differences method (2) (which is all that the bandits optimization framework requires us to be able to do).
|
| 167 |
+
|
| 168 |
+
Just as this choice of the loss function $\ell _ { t }$ allows us to quantify performance on the gradient estimation problem, the latent vector $v _ { t }$ will allow us to algorithmically incorporate prior information into our predictions. Looking at the two example priors we consider, the time-dependent prior will be reflected by carrying over the latent vector between the gradient estimations at different points. Data-dependent priors will be captured by enforcing that our latent vector has a particular structure. For the specific prior we quantify in the preceding section (data-dependent prior for images), we will simply reduce the dimensionality of the latent vector via average-pooling (“tiling“), removing the need for extra queries to discern components of the gradient that are spatially close.
|
| 169 |
+
|
| 170 |
+
# 3.3 IMPLEMENTING GRADIENT ESTIMATION IN THE BANDIT FRAMEWORK
|
| 171 |
+
|
| 172 |
+
We now describe our bandit framework for adversarial example generation in more detail. Note that the algorithm is general and can be used to construct black-box adversarial examples where the perturbation is constrained to any convex set $\ell _ { p }$ -norm constraints being a special case). We discuss the algorithm in its general form, and then provide versions explicitly applied to the $\ell _ { 2 }$ and $\ell _ { \infty }$ cases.
|
| 173 |
+
|
| 174 |
+
As previously mentioned, the latent vector $v _ { t } \in \mathcal { K }$ serves as a prior on the gradient for the corresponding round $t - \mathrm { i n }$ fact, we make our prediction $g _ { t }$ be exactly $v _ { t }$ projected onto the appropriate space, and thus we set $\kappa$ to be an extension of the space of valid adversarial perturbations (e.g. $\mathbb { R } ^ { n }$ for $\ell _ { 2 }$ examples, $[ - 1 , 1 ] ^ { n }$ for $\ell _ { \infty }$ examples). Our loss function $\ell _ { t }$ is defined as
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\ell _ { t } ( g ) = - \langle \nabla L ( x , y ) , \frac { g } { | | g | | } \rangle ,
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
for a given gradient estimate $g$ , where we access this inner product via finite differences. Here, $L ( x , y )$ is the classification loss on an image $x$ with true class $y$ .
|
| 181 |
+
|
| 182 |
+
The crucial element of our algorithm will thus be the method of updating the latent vector $v _ { t }$ . We will adapt here the canonical “reduction from bandit information” (Hazan, 2016). Specifically, our update procedure is parametrized by an estimator $\Delta _ { t }$ of the gradient $\nabla _ { \boldsymbol { v } } \ell _ { t } ( { \boldsymbol { v } } )$ , and a first-order update step $\mathcal { A } \left( \mathcal { K } \times \mathbb { R } ^ { \mathrm { d i m } ( \mathcal { K } ) } \to \mathcal { K } \right)$ , which maps the latent vector $v _ { t }$ and the estimated gradient of $\ell _ { t }$ with respect to $v _ { t }$ (which we denote $\Delta _ { t }$ ) to a new latent vector $v _ { t + 1 }$ . The resulting general algorithm is presented as Algorithm 1.
|
| 183 |
+
|
| 184 |
+
In our setting, we make the estimator $\Delta$ of the gradient $- \nabla _ { v } \langle \nabla L ( x , y ) , v \rangle$ of the loss $\ell$ be the standard spherical gradient estimator (see Hazan (2016)). We take a two-query estimate of the expectation, and employ antithetic sampling which results in the estimate being computed as
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\Delta = \frac { \ell ( v + \delta \pmb { u } ) - \ell ( v - \delta \pmb { u } ) } { \delta } \pmb { u } ,
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
# Algorithm 1 Gradient Estimation with Bandit Optimization
|
| 191 |
+
|
| 192 |
+
<table><tr><td colspan="2">1: procedure BANDIT-OPT-LOSS-GRAD-EST(x, yinit)</td></tr><tr><td colspan="2">Uo ↑ A()</td></tr><tr><td>2: 3:</td><td>for each round t =1,...,T do</td></tr><tr><td>4:</td><td>// Our loss in round t is lt(gt)= -(VxL(x,yinit), gt)</td></tr><tr><td>5:</td><td>gt←Ut-1</td></tr><tr><td>6:</td><td>△t ←GRAD-EsT(x,yinit, Ut-1) // Estimated Gradient of lt</td></tr><tr><td>7:</td><td>Ut ←A(Ut-1,△t)</td></tr><tr><td>8:</td><td></td></tr><tr><td>9:</td><td>g↑UT</td></tr><tr><td></td><td>return IIəx [g]</td></tr></table>
|
| 193 |
+
|
| 194 |
+
where $\textbf { \em u }$ is a Gaussian vector sampled from $\mathcal { N } ( 0 , \textstyle \frac { 1 } { d } I )$ . The resulting algorithm for calculating the gradient estimate given the current latent vector $v$ , input $x$ and the initial label $y$ is Algorithm 2.
|
| 195 |
+
|
| 196 |
+
# Algorithm 2 Single-query spherical estimate of $\nabla _ { v } \langle \nabla L ( x , y ) , v \rangle$
|
| 197 |
+
|
| 198 |
+
<table><tr><td colspan="2">1: procedure GRAD-EsT(x,y, U)</td></tr><tr><td colspan="2">2: u ← N(O,¹I) // Query vector</td></tr><tr><td>3:</td><td>{q1,q2} ← {u+δu,u-δu} // Antithetic samples</td></tr><tr><td>4:</td><td>lt(q1)=-(VL(x,y),q1)~ L(x,y)-L(∞+eq1,3) 2// Gradient estimation loss at q1</td></tr><tr><td>5:</td><td>lt(q2)=-(L(x,y),L(e)//raientestitiost</td></tr><tr><td>6:</td><td>△← lt(q1)-lt(q2)u= L(x+cq2,y)-L(x+cq1.y)</td></tr><tr><td>7: 8:</td><td>8 SE // Note that due to cancellations we can actually evaluate △ with only two queries to L</td></tr><tr><td>return △</td><td></td></tr></table>
|
| 199 |
+
|
| 200 |
+
A crucial point here is that the above gradient estimator $\Delta _ { t }$ parameterizing the bandit reduction has no direct relation to the “gradient estimation problem” as defined in Section 2.4. It is simply a general mechanism by which we can update the latent vector $v _ { t }$ in bandit optimization. It is the actions $g _ { t }$ (equal to $\boldsymbol { v } _ { t }$ ) which provide proposed solutions to the gradient estimation problem from Section 2.4.
|
| 201 |
+
|
| 202 |
+
The choice of the update rule $\mathcal { A }$ tends to be natural once the convex set $\kappa$ is known. For $\ b { \mathcal { K } } = \mathbb { R } ^ { n }$ , we can simply use gradient ascent:
|
| 203 |
+
|
| 204 |
+
$$
|
| 205 |
+
v _ { t } = \mathcal { A } ( v _ { t - 1 } , \Delta _ { t } ) : = v _ { t - 1 } + \eta \cdot \Delta _ { t }
|
| 206 |
+
$$
|
| 207 |
+
|
| 208 |
+
and the exponentiated gradients (EG) update when the constraint is an $\ell _ { \infty }$ bound (i.e. $\displaystyle { \mathcal { K } } = [ - 1 , 1 ] ^ { n } )$ :
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
\begin{array} { l } { { p _ { t - 1 } = \displaystyle { \frac { 1 } { 2 } \left( v _ { t - 1 } + 1 \right) } } } \\ { { \mathrm { } } } \\ { { p _ { t } = \displaystyle A ( g _ { t - 1 } , \Delta _ { t } ) : = \displaystyle { \frac { 1 } { Z } p _ { t - 1 } \exp ( \eta \cdot \Delta _ { t } ) } \quad \mathrm { s . t . } Z = p _ { t - 1 } \exp ( \eta \cdot \Delta _ { t } ) + ( 1 - p _ { t - 1 } ) \exp ( - \eta \cdot \Delta _ { t } ) } } \\ { { v _ { t } = 2 p _ { t } - 1 } } \end{array}
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
Finally, in order to translate our gradient estimation algorithm into an efficient method for constructing black-box adversarial examples, we interleave our iterative gradient estimation algorithm with an iterative update of the image itself, using the boundary projection of $g _ { t }$ in place of the gradient (c.f. (1)). This results in a general, efficient, prior-exploiting algorithm for constructing black-box adversarial examples. The resulting algorithm in the $\ell _ { 2 }$ -constrained case is shown in Algorithm 3.
|
| 215 |
+
|
| 216 |
+
# 4 EXPERIMENTS AND EVALUATION
|
| 217 |
+
|
| 218 |
+
We evaluate our bandit approach described in Section 3 and the natural evolutionary strategies (NES) approach of Ilyas et al. (2017) on their effectiveness in generating untargeted adversarial examples. We consider both the $\ell _ { 2 }$ and $\ell _ { \infty }$ threat models on the ImageNet (Russakovsky et al., 2015) dataset, in terms of success rate and query complexity. We further investigate loss and gradient estimate quality over the optimization trajectory in each method. To show the method extends to other datasets,
|
| 219 |
+
|
| 220 |
+
# Algorithm 3 Adversarial Example Generation with Bandit Optimization for $\ell _ { 2 }$ norm perturbations
|
| 221 |
+
|
| 222 |
+
<table><tr><td colspan="2">1: procedure ADVERSARIAL-BANDIT-L2(Xinit, Yinit)</td></tr><tr><td>2: / / C(-) returns top class</td><td></td></tr><tr><td>3:</td><td>vo ← O1xd // If data prior, d < dim(x); Ut (△t) up (down)-sampled before (after) line 8</td></tr><tr><td>4:</td><td>xo ← Xinit // Adversarial image to be constructed</td></tr><tr><td>5:</td><td>while C(x) = yinit do</td></tr><tr><td>6:</td><td>gt←Ut-1</td></tr><tr><td>7:</td><td>xt←xt-1+h· gt //Boundary projection g standard PGD: c.f. (Rigolet, 2015) 11gt1l2 Ilgt1</td></tr><tr><td>8:</td><td>△t ← GRAD-EsT(xt-1, yinit, Ut-1) // Estimated Gradient of lt</td></tr><tr><td>9:</td><td>Ut ←Ut-1+n·△t</td></tr><tr><td>10:</td><td>t↑t+1</td></tr><tr><td>return Xt-1</td><td></td></tr></table>
|
| 223 |
+
|
| 224 |
+
we also compare to NES in the CIFAR- $\ell _ { \infty }$ threat model; in all threat models, we show results on Inception-v3, Resnet-50, and VGG16 classifiers.
|
| 225 |
+
|
| 226 |
+
In evaluating our approach, we test both the bandit approach with time prior (Bandits $_ T$ ), and our bandit approach with the given examples of both the data and time priors $\mathrm { ( B a n d i t s } _ { T D }$ ). We use 10,000 and 1,000 randomly selected images (scaled to $[ 0 , 1 ] )$ to evaluate all approaches on ImageNet and CIFAR-10 respectively. For NES, Bandits $_ T$ , and Bandit $_ { T D }$ we found hyperparameters (given in Appendix C, along with the experimental parameters) via grid search.
|
| 227 |
+
|
| 228 |
+
# 4.1 RESULTS
|
| 229 |
+
|
| 230 |
+
For ImageNet, we record the effectiveness of the different approaches in both threat models in Table 1 $\ell _ { 2 }$ and $\ell _ { \infty }$ perturbation constraints), where we show the attack success rate and the mean number of queries (of the successful attacks) needed to generate an adversarial example for the Inception-v3 classifier (results for other classifiers in Appendix F). For all attacks, we limit the attacker to at most 10,000 oracle queries. As shown in Table 1, our bandits framework with both data-dependent and time prior (Bandits $_ { T D }$ ), is six and three times less failure-prone than the previous state of the art (NES (Ilyas et al., 2017)) in the $\ell _ { \infty }$ and $\ell _ { 2 }$ settings, respectively. Despite the higher success rate, our method actually uses around half as many queries as NES. In particular, when restricted to the inputs on which NES is successful in generating adversarial examples, our attacks are 2.5 and 5 times as query-efficient for the $\ell _ { \infty }$ and $\ell _ { 2 }$ settings, respectively. In Appendix G, we also compare against the AutoZOOM method of Tu et al. (2018), where we show that our Bandits $_ { T D }$ method at a higher $1 0 0 \%$ success rate is over $6$ times as query-efficient. Finally, we also have similar results for CIFAR-10 under the $\ell _ { \infty }$ threat model, which can be found in Appendix E.
|
| 231 |
+
|
| 232 |
+
We also further quantify the performance of our methods in terms of black-box attacks, and gradient estimation. Specifically, we first measure average queries per success after reaching a certain success rate (Figure 4a), which indicates the dependence of the query count on the desired success rate. The data shows that for any fixed success rate, our methods are more query-efficient than NES, and (due to the exponential trend) suggest that the difference may be amplified for higher success rates. We then plot the loss of the classifier over time (averaged over all images), and performance on the gradient estimation problem for both $\ell _ { \infty }$ and $\ell _ { 2 }$ cases (which, crucially, corresponds directly to the expectation we maximize in (7). We show these three plots for $\ell _ { \infty }$ in Figure 4, and show the results for $\ell _ { 2 }$ (which are extremely similar) in Appendix D, along with CDFs showing the success of each method as a function of the query limit. We find that on every metric in both threat models, our methods strictly dominate NES in terms of performance.
|
| 233 |
+
|
| 234 |
+
# 5 RELATED WORK
|
| 235 |
+
|
| 236 |
+
All known techniques for generating adversarial examples in the black-box setting so far rely on either iterative optimization schemes (our focus) or so-called substitute networks and transferability.
|
| 237 |
+
|
| 238 |
+
In the first line of work, algorithms use queries to gradually perturb a given input to maximize a corresponding loss, causing misclassification. Nelson et al. (2012) presented the first such iterative attack on a special class of binary classifiers. Later, Xu et al. (2016) gave an algorithm for fooling a real-world system with black-box attacks. Specifically, they fool PDF document malware classifier by using a genetic algorithms-based attack. Soon after, Narodytska & Kasiviswanathan (2017) described the first black-box attack on deep neural networks; the algorithm uses a greedy search algorithm that selectively changes individual pixel values. Chen et al. (2017) were the first to design black-box attack based on finite-differences and gradient based optimization. The method uses coordinate descent to attack black-box neural networks, and introduces various optimizations to decrease sample complexity. Building on the work of Chen et al. (2017), Ilyas et al. (2017) designed a black-box attack strategy that also uses finite differences but via natural evolution strategies (NES) to estimate the gradients. They then used their algorithm as a primitive in attacks on more restricted threat models.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 4: (left) Average number of queries per successful image as a function of the number of total successful images; at any desired success rate, our methods use significantly less queries per successful image than NES, and the trend suggests that this gap increases with the desired success rate. (center) The loss over time, averaged over all images; (right) The correlation of the latent vector with the true gradient $g$ , which is precisely the gradient estimation objective we define.
|
| 242 |
+
|
| 243 |
+
In a concurrent line of work, Papernot et al. (2017) introduce a method for attacking models with so-called substitute networks. Here, the attacker trains a model – called a substitute network – to mimic the target network’s decisions (obtained with black-box queries) , then uses (white-box) adversarial examples for the substitute network to attack the original model. Adversarial examples generated with these methods Papernot et al. (2017); Liu et al. (2016) tend to transfer to a target MNIST or CIFAR classifier. We note, however, that for attacking single inputs, the overall query efficiency of this type of methods tends to be worse than that of the gradient estimation based ones. Substitute models are also thus far unable to make targeted black-box adversarial examples.
|
| 244 |
+
|
| 245 |
+
# 6 CONCLUSION
|
| 246 |
+
|
| 247 |
+
We develop a new, unifying perspective on black-box adversarial attacks. This perspective casts the construction of such attacks as a gradient estimation problem. We prove that a standard least-squares estimator both captures the existing state-of-the-art approaches to black-box adversarial attacks, and actually is, in a certain natural sense, an optimal solution to the problem.
|
| 248 |
+
|
| 249 |
+
We then break the barrier posed by this optimality by considering a previously unexplored aspect of the problem: the fact that there exists plenty of extra prior information about the gradient that one can exploit to mount a successful adversarial attack. We identify two examples of such priors: a “time-dependent” prior that corresponds to similarity of the gradients evaluated at similar inputs, and a “data-dependent” prior derived from the latent structure present in the input space.
|
| 250 |
+
|
| 251 |
+
Finally, we develop a bandit optimization approach to black-box adversarial attacks that allows for a seamless integration of such priors. The resulting framework significantly outperforms state-of-the-art by a factor of two to six in terms of success rate and query efficiency. Our results thus open a new avenue towards finding priors for construction of even more efficient black-box adversarial attacks.
|
| 252 |
+
|
| 253 |
+
# ACKNOWLEDGMENTS
|
| 254 |
+
|
| 255 |
+
We thank Ludwig Schmidt for suggesting the connection between LSQ and NES. AM supported in part by NSF grants CCF-1553428 and CNS-1815221. LE supported in part by a Siebel Foundation Scholarship and IBM Watson AI grant. AI supported by an Analog Devices Fellowship.
|
| 256 |
+
|
| 257 |
+
# REFERENCES
|
| 258 |
+
|
| 259 |
+
Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples. CoRR, abs/1707.07397, 2017. URL http://arxiv.org/abs/1707.07397.
|
| 260 |
+
|
| 261 |
+
Arjun Nitin Bhagoji, Warren He, Bo Li, and Dawn Song. Exploring the space of black-box attacks on deep neural networks. arXiv preprint arXiv:1712.09491, 2017.
|
| 262 |
+
|
| 263 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017.
|
| 264 |
+
|
| 265 |
+
Nicholas Carlini, Pratyush Mishra, Tavish Vaidya, Yuankai Zhang, Micah Sherr, Clay Shields, David Wagner, and Wenchao Zhou. Hidden voice commands. In USENIX Security Symposium, pp. 513–530, 2016.
|
| 266 |
+
|
| 267 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 15–26. ACM, 2017.
|
| 268 |
+
|
| 269 |
+
Simon Foucart and Holger Rauhut. A mathematical introduction to compressive sensing, volume 1. Birkhäuser Basel, 2013.
|
| 270 |
+
|
| 271 |
+
A. Gittens and J. A. Tropp. Tail bounds for all eigenvalues of a sum of random matrices. ArXiv e-prints, apr 2011.
|
| 272 |
+
|
| 273 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 274 |
+
|
| 275 |
+
Alexander N Gorban, Ivan Yu Tyukin, Danil V Prokhorov, and Konstantin I Sofeikov. Approximation with random bases: Pro et contra. Information Sciences, 364:129–145, 2016.
|
| 276 |
+
|
| 277 |
+
Elad Hazan. Introduction to online convex optimization. Foundations and Trends in Optimization, 2(3-4):157–325, 2016. ISSN 2167-3888. doi: 10.1561/2400000013. URL http://dx.doi. org/10.1561/2400000013.
|
| 278 |
+
|
| 279 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. arXiv preprint arXiv:1712.07113, 2017.
|
| 280 |
+
|
| 281 |
+
William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
|
| 282 |
+
|
| 283 |
+
Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 284 |
+
|
| 285 |
+
B. Laurent and P. Massart. Adaptive estimation of a quadratic functional by model selection. The Annals of Statistics, 28(5):1302–1338, 10 2000. doi: 10.1214/aos/1015957395. URL https: //doi.org/10.1214/aos/1015957395.
|
| 286 |
+
|
| 287 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016.
|
| 288 |
+
|
| 289 |
+
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.
|
| 290 |
+
|
| 291 |
+
Ron Meir. Bias, variance and the combination of least squares estimators. In NIPS, 1994.
|
| 292 |
+
|
| 293 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. CoRR, abs/1511.04599, 2015. URL http: //arxiv.org/abs/1511.04599.
|
| 294 |
+
|
| 295 |
+
Nina Narodytska and Shiva Kasiviswanathan. Simple black-box adversarial attacks on deep neural networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 1310–1318. IEEE, 2017.
|
| 296 |
+
|
| 297 |
+
Blaine Nelson, Benjamin IP Rubinstein, Ling Huang, Anthony D Joseph, Steven J Lee, Satish Rao, and JD Tygar. Query strategies for evading convex-inducing classifiers. Journal of Machine Learning Research, 13(May):1293–1332, 2012.
|
| 298 |
+
|
| 299 |
+
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.
|
| 300 |
+
|
| 301 |
+
Phillipe Rigollet. Mathematics of machine learning course notes: Projected gradient descent, 2015. URL https://ocw.mit.edu/courses/mathematics/ 18-657-mathematics-of-machine-learning-fall-2015/lecture-notes/ MIT18_657F15_L12.pdf.
|
| 302 |
+
|
| 303 |
+
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.
|
| 304 |
+
|
| 305 |
+
James C Spall. Introduction to stochastic search and optimization: estimation, simulation, and control, volume 65. John Wiley & Sons, 2005.
|
| 306 |
+
|
| 307 |
+
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.
|
| 308 |
+
|
| 309 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. corr abs/1512.00567 (2015), 2015.
|
| 310 |
+
|
| 311 |
+
Chun-Chen Tu, Pai-Shun Ting, Pin-Yu Chen, Sijia Liu, Huan Zhang, Jinfeng Yi, Cho-Jui Hsieh, and Shin-Ming Cheng. Autozoom: Autoencoder-based zeroth order optimization method for attacking black-box neural networks. CoRR, abs/1805.11770, 2018.
|
| 312 |
+
|
| 313 |
+
Weilin Xu, Yanjun Qi, and David Evans. Automatically evading classifiers. In Proceedings of the 2016 Network and Distributed Systems Symposium, 2016.
|
| 314 |
+
|
| 315 |
+
# A PROOFS
|
| 316 |
+
|
| 317 |
+
Theorem 1 (NES and Least Squares equivalence). Let $\hat { x } _ { N E S }$ be the Gaussian $k$ -query NES estimator of a $d$ -dimensional gradient $\textbf { { g } }$ and let $\hat { x } _ { L S Q }$ be the minimal-norm $k$ -query least-squares estimator of $\textbf { { g } }$ . For any $p > 0$ , with probability at least $1 - p$ we have that
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\left. \hat { x } _ { L S Q } , \pmb { g } \right. - \left. \hat { x } _ { N E S } , \pmb { g } \right. \leq O \left( \sqrt { \frac { k } { d } \cdot \log ^ { 3 } \left( \frac { k } { p } \right) } \right) \left. \ b { g } \right. ^ { 2 } ,
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
and in particular,
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\left. \hat { x } _ { L S Q } , \pmb { g } \right. - \left. \hat { x } _ { N E S } , \pmb { g } \right. \leq 8 \sqrt { \frac { 2 k } { d } \cdot \log ^ { 3 } \left( \frac { 2 k + 2 } { p } \right) } \left( 1 + \frac { \kappa } { \sqrt { d } } \right) { | | \pmb { g } | | ^ { 2 } }
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
with probability at least $1 - p ,$ , where
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\kappa \leq 2 \sqrt { \log \left( \frac { 2 k ( k + 1 ) } { p } \right) } .
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
Proof. Let us first recall our estimation setup. We have $k$ query vectors $\delta _ { i } \in \mathbb { R } ^ { d }$ drawn from an i.i.d Gaussian distribution whose expected squared norm is one, i.e. $\delta _ { i } \sim \mathcal { N } ( 0 , \frac { 1 } { d } I )$ , for each $1 \leq i \leq k$ . Let the vector $\ b { y } \in \mathbb { R } ^ { k }$ denote the inner products of $\delta _ { i } \mathbf { s }$ with the gradient, i.e.
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
y _ { i } : = \langle \delta _ { i } , \pmb { g } \rangle ,
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
for each $1 \leq i \leq k$ . We define the matrix $A$ to be a $k \times d$ matrix with the $\delta _ { i } \mathrm { s }$ being its rows. That is, we have
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
A g = y .
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Now, recall that the closed forms of the two estimators we are interested in are given by
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { r l } & { \hat { x } _ { N E S } = A ^ { T } \pmb { y } = A ^ { T } A \pmb { g } } \\ & { \hat { x } _ { L S Q } = A ^ { T } ( A A ^ { T } ) ^ { - 1 } \pmb { y } = A ^ { T } ( A A ^ { T } ) ^ { - 1 } A \pmb { g } , } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
which implies that
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { r l } & { \langle \hat { x } _ { N E S } , \pmb { g } \rangle = \pmb { g } ^ { T } A ^ { T } A \pmb { g } } \\ & { \langle \hat { x } _ { L S Q } , \pmb { g } \rangle = \pmb { g } ^ { T } A ^ { T } ( A A ^ { T } ) ^ { - 1 } A \pmb { g } . } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
We can bound the difference between these two inner products as
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { r l } & { \left. \hat { x } _ { L S Q } , g \right. - \left. \hat { x } _ { N E S } , \pmb { g } \right. = \pmb { g } ^ { T } A ^ { T } \left[ ( A A ^ { T } ) ^ { - 1 } - I \right] A \pmb { g } } \\ & { \qquad \leq \left| \left| g ^ { T } A ^ { T } \right| \right| \left| \left| ( A A ^ { T } ) ^ { - 1 } - I \right| \right| \left| | A g | \right| } \\ & { \qquad \leq \left| \left| ( A A ^ { T } ) ^ { - 1 } - I \right| \right| \left| | A g | \right| ^ { 2 } . } \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
Now, to bound the first term in (12), observe that
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
( A A ^ { T } ) ^ { - 1 } = \left( I - ( I - A A ^ { T } ) \right) ^ { - 1 } = \sum _ { l = 0 } ^ { \infty } ( I - A A ^ { T } ) ^ { l }
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
and thus
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
I - ( A A ^ { T } ) ^ { - 1 } = \sum _ { l = 1 } ^ { \infty } ( A A ^ { T } - I ) ^ { l } .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
(Note that the first term in the above sum has been canceled out.) This gives us that
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\big | \big | I - ( A A ^ { T } ) ^ { - 1 } \big | \big | \leq \sum _ { l = 1 } ^ { \infty } \big | \big | A A ^ { T } - I \big | \big | ^ { l }
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { r l } & { \leq \frac { \left| \left| A A ^ { T } - I \right| \right| } { 1 - \left| \left| A A ^ { T } - I \right| \right| } } \\ & { \leq 2 \left| \left| A A ^ { T } - I \right| \right| , } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
as long as $\begin{array} { r } { \left| \left| A A ^ { T } - I \right| \right| \leq \frac { 1 } { 2 } } \end{array}$ (which, as we will see, is indeed the case with high probability).
|
| 388 |
+
|
| 389 |
+
Our goal thus becomes bounding $\left| \left| A A ^ { T } - I \right| \right| = \lambda _ { m a x } ( A A ^ { T } - I )$ , where $\lambda _ { m a x } ( \cdot )$ denotes the largest (in absolute value) eigenvalue. Observe that $A A ^ { T }$ and $- I$ commute and are simultaneously diagonalizable. As a result, for any $1 \leq i \leq k$ , we have that the $i$ -th largest eigenvalue $\lambda _ { i } ( A A ^ { T } - \dot { I } )$ of $\bar { \boldsymbol { A } } \boldsymbol { A } ^ { T } - \boldsymbol { I }$ can be written as
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\lambda _ { i } ( A A ^ { T } - I ) = \lambda _ { i } ( A A ^ { T } ) + \lambda _ { i } ( - I ) _ { i } = \lambda _ { i } ( A A ^ { T } ) - 1 .
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
So, we need to bound
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\lambda _ { m a x } ( A A ^ { T } - I ) = \operatorname* { m a x } \left\{ \lambda _ { 1 } ( A A ^ { T } ) - 1 , 1 - \lambda _ { k } ( A A ^ { T } ) \right\}
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
To this end, recall that $\mathbb { E } [ A A ^ { T } ] = I$ (since the rows of $A$ are sampled from the distribution $\textstyle { \mathcal { N } } ( 0 , { \frac { 1 } { d } } I ) )$ ), and thus, by the covariance estimation theorem of Gittens and Tropp Gittens & Tropp (2011) (see Corollary 7.2) (and union bounding over the two relevant events), we have that
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\begin{array} { r l } & { \operatorname { \mathrm { \mathrm { \Large ~ { \tt ~ { \tt ~ { \tt ~ { \tt ~ { \tt ~ { \tt ~ { \tt ~ { \tt ~ { \tt ~ { \alpha ~ } ~ { \Lambda } ~ } } } } } } } } } } } } ( \lambda A ^ { T } - I ) \geq \varepsilon ) = \operatorname* { P r } } ( \lambda _ { 1 } ( A A ^ { T } ) \geq 1 + \varepsilon \mathrm { \ o r } \lambda _ { k } ( A A ^ { T } ) \geq 1 - \varepsilon ) \\ & { \quad \quad \quad = \operatorname* { P r } ( \lambda _ { 1 } ( A A ^ { T } ) \geq \lambda _ { 1 } ( I ) + \varepsilon \mathrm { \ o r } \lambda _ { k } ( A A ^ { T } ) \geq \lambda _ { k } ( I ) - \varepsilon ) \leq 2 k \cdot \exp \left( - \frac { d } { 3 \lambda _ { 1 } } \right) . } \end{array}
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
Setting
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\varepsilon = \sqrt { \frac { 3 2 k \log ( 2 ( k + 1 ) / p ) } { d } } ,
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
ensuring that $\varepsilon \leq \frac { 1 } { 2 }$ , gives us
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\operatorname* { P r } \left( \lambda _ { m a x } ( A A ^ { T } ) - 1 \geq \sqrt { \frac { 3 2 k \log ( 2 ( k + 1 ) / p ) } { d } } \right) \leq \frac { k } { k + 1 } p .
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
and thus
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\left| \left| ( A A ^ { T } ) ^ { - 1 } - I \right| \right| \leq \sqrt { \frac { 3 2 k \log ( 2 ( k + 1 ) / p ) } { d } } ,
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
with probability at least $\begin{array} { r } { \mathrm { ~ 1 ~ - ~ } \frac { k } { k + 1 } p } \end{array}$
|
| 426 |
+
|
| 427 |
+
To bound the second term in (12), we note that all the vectors $\delta _ { i }$ are chosen independently of the vector $\textbf { { g } }$ and each other. So, if we consider the set $\{ \hat { g } , \hat { \delta _ { 1 } } , \dotsc , \hat { \delta _ { k } } \}$ of $k + 1$ corresponding normalized directions, we have (see, e.g., (Gorban et al., 2016)) that the probability that any two of them have the (absolute value of) their inner product be larger than some $\begin{array} { r } { \varepsilon ^ { \prime } = \sqrt { \frac { 2 \log ( 2 ( k + 1 ) / p ) } { d } } } \end{array}$ is at most
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\exp \left\{ - ( k + 1 ) ^ { 2 } e ^ { - d ( \varepsilon ^ { \prime } ) ^ { 2 } / 2 } \right\} = \exp \left\{ - 2 \frac { k + 1 } { p } \right\} \leq \frac { p } { 2 ( k + 1 ) } .
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
On the other hand, we note that each $\delta _ { i }$ is a random vector sampled from the distribution $\mathcal { N } ( 0 , \textstyle \frac { 1 } { d } \pmb { I } _ { d } )$ , so we have that (see, e.g., Lemma 1 in (Laurent $\&$ Massart, 2000)), for any $1 \leq i \leq k$ and any $\varepsilon ^ { \prime \prime } > 0$ ,
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\operatorname* { P r } \left( | | \delta _ { i } | | ^ { 2 } \geq 1 + \varepsilon ^ { \prime \prime } \right) \leq \exp \left\{ - { \frac { ( \varepsilon ^ { \prime \prime } ) ^ { 2 } d } { 4 } } \right\} .
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Setting
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\varepsilon ^ { \prime \prime } = 2 \sqrt { \frac { \log ( 2 k ( k + 1 ) / p ) } { d } }
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
yields
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
P \left( | | \delta _ { i } | | ^ { 2 } \geq 1 + 2 { \sqrt { \frac { \log ( 2 ( k + 1 ) k / p ) } { d } } } \right) \leq { \frac { p } { 2 k ( k + 1 ) } } .
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Applying these two bounds (and, again, union bounding over all the relevant events), we get that
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\begin{array} { l } { \displaystyle \left. | A g \right. | ^ { 2 } = \sum _ { i = 1 } ^ { k } ( A g ) _ { i } ^ { 2 } } \\ { \displaystyle \quad \leq d \cdot \left( \frac { 2 \log \left( \frac { 2 ( k + 1 ) } { p } \right) } { d } \right) \left( 1 + 2 \sqrt { \frac { \log \left( \frac { 2 k ( k + 1 ) } { p } \right) } { d } } \right) \left. | g \right. | ^ { 2 } } \\ { \displaystyle \qquad \leq 2 \log \left( \frac { 2 ( k + 1 ) } { p } \right) \left( 1 + 2 \sqrt { \frac { 2 \log \left( \frac { 2 ( k + 1 ) } { p } \right) } { d } } \right) \left. | g \right. | ^ { 2 } } \end{array}
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
with probability at most $\frac { p } { k { + } 1 }$
|
| 458 |
+
|
| 459 |
+
Finally, by plugging the above bound and the bound (13) into the bound (12), we obtain that
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\begin{array} { r l } & { g \rangle - \langle \hat { x } _ { N E S } , g \rangle \leq \left( \sqrt { \frac { 3 2 k \log ( 2 ( k + 1 ) / p ) } { d } } \right) \cdot 2 \log \left( \frac { 2 ( k + 1 ) } { p } \right) \left( 1 + 2 \sqrt { \frac { 2 \log \left( \frac { 2 ( k + 1 ) } { p } \right) } { d } } \right) \left. g \right. } \\ & { \qquad \leq 8 \sqrt { \frac { 2 k } { d } \cdot \log ^ { 3 } \left( \frac { 2 k + 2 } { p } \right) } \left( 1 + \frac { \kappa } { \sqrt { d } } \right) \left. g \right. ^ { 2 } , } \end{array}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
with probability $1 - p$ , where
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\kappa = 2 \sqrt { \log \left( \frac { 2 k ( k + 1 ) } { p } \right) } .
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
This completes the proof.
|
| 472 |
+
|
| 473 |
+
Theorem 2 (Least-Squares Optimality). For a fixed projection matrix $A$ and under the following observation model of isotropic Gaussian noise: $\pmb { y } = A \pmb { g } + \vec { \varepsilon }$ where $\varepsilon \sim \mathcal { N } ( 0 , \varepsilon I d )$ , the least-squares estimator as in Theorem 1, $\hat { x } _ { L S Q } = A ^ { T } ( A A ^ { T } ) ^ { - 1 } y$ is a finite-sample efficient (minimum-variance unbiased) estimator of the parameter $\textbf { { g } }$ .
|
| 474 |
+
|
| 475 |
+
Proof. Proving the theorem requires an application of the Cramer-Rao Lower Bound theorem:
|
| 476 |
+
|
| 477 |
+
Theorem 3 (Cramer-Rao Lower Bound). Given a parameter $\theta$ , an observation distribution $p ( x ; \theta )$ , and an unbiased estimator $\hat { \theta }$ that uses only samples from $p ( x ; \theta )$ , then (subject to Fisher regularity conditions trivially satisfied by Gaussian distributions),
|
| 478 |
+
|
| 479 |
+
$C o \nu \left[ \hat { \theta } - \theta \right] = \operatorname { \mathbb { E } } \left[ ( \hat { \theta } - \theta ) ( \hat { \theta } - \theta ) ^ { T } \right] \ge \left[ I ( \theta ) \right] ^ { - 1 }$ where $I ( \theta )$ is the Fisher matrix: $[ I ( \theta ) ] _ { i j } = - \mathbb { E } \left[ \frac { \partial \log p ( x ; \theta ) } { \partial \theta _ { i } \partial \theta _ { j } } \right]$
|
| 480 |
+
|
| 481 |
+
Now, note that the Cramer-Rao bound implies that if the variance of the estimator $\hat { \theta }$ is the inverse of the Fisher matrix, $\hat { \theta }$ must be the minimum-variance unbiased estimator. Recall the following form of the Fisher matrix:
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
I ( \theta ) = \mathbb { E } \left[ \left( \frac { \partial \log p ( x ; \theta ) } { \partial \theta } \right) \left( \frac { \partial \log p ( x ; \theta ) } { \partial \theta } \right) ^ { T } \right]
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Now, suppose we had the following equality, which we can then simplify using the preceding equation:
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\begin{array} { c } { \displaystyle I ( \theta ) \left( \hat { \theta } - \theta \right) = \frac { \partial \log p ( x ; \theta ) } { \partial \theta } } \\ { \displaystyle \left( I ( \theta ) \left( \hat { \theta } - \theta \right) \right) \left( I ( \theta ) \left( \hat { \theta } - \theta \right) \right) ^ { T } = \left( \frac { \partial \log p ( x ; \theta ) } { \partial \theta } \right) \left( \frac { \partial \log p ( x ; \theta ) } { \partial \theta } \right) ^ { T } } \\ { \displaystyle \mathbb { E } \left[ \left( I ( \theta ) \left( \hat { \theta } - \theta \right) \right) \left( I ( \theta ) \left( \hat { \theta } - \theta \right) \right) ^ { T } \right] = \mathbb { E } \left[ \left( \frac { \partial \log p ( x ; \theta ) } { \partial \theta } \right) \left( \frac { \partial \log p ( x ; \theta ) } { \partial \theta } \right) ^ { T } \right] } \\ { \displaystyle I ( \theta ) \mathbb { E } \left[ \left( \hat { \theta } - \theta \right) ( \hat { \theta } - \theta ) ^ { T } \right] I ( \theta ) = I ( \theta ) } \end{array}
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
Multiplying the preceding by $[ I ( \theta ) ] ^ { - 1 }$ on both the left and right sides yields:
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\mathbb { E } \left[ ( \hat { \theta } - \theta ) ( \hat { \theta } - \theta ) ^ { T } \right] = \left[ I ( \theta ) \right] ^ { - 1 } ,
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
which tells us that (15) is a sufficient condition for finite-sample efficiency (minimal variance). We show that this condition is satisfied in our case, where we have $y \sim A g + \varepsilon , \hat { \theta } = \hat { x } _ { L S Q }$ , and $\theta = \pmb { g }$ We begin by computing the Fisher matrix directly, starting from the distribution of the samples $y$ :
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
\begin{array} { c } { { p ( y ; g ) = \displaystyle \frac { 1 } { \sqrt { ( 2 \pi \varepsilon ) ^ { d } } } \exp \left\{ \frac { 1 } { 2 \varepsilon } ( y - A g ) ^ { T } ( y - A g ) \right\} } } \\ { { { \log p ( y ; g ) = \displaystyle \frac { d } { 2 } \log { ( 2 \pi \varepsilon ) } + \frac { 1 } { 2 \varepsilon } ( y - A g ) ^ { T } ( y - A g ) } } } \\ { { { \frac { \partial \log { p ( y ; g ) } } { \partial g } = \displaystyle \frac { 1 } { 2 \varepsilon } \left( 2 A ^ { T } ( y - A g ) \right) } } } \\ { { { { } } } } \\ { { { = \displaystyle \frac { 1 } { \varepsilon } A ^ { T } ( y - A g ) } } } \end{array}
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
Using (14),
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\begin{array} { l } { { \displaystyle I ( { \pmb g } ) = { \mathbb E } \left[ \left( \frac { 1 } { \varepsilon } A ^ { T } ( { \pmb y } - A { \pmb g } ) \right) \left( \frac { 1 } { \varepsilon } A ^ { T } ( { \pmb y } - A { \pmb g } ) \right) ^ { T } \right] } } \\ { { \displaystyle \ = \frac { 1 } { \varepsilon ^ { 2 } } A ^ { T } { \mathbb E } \left[ ( { \pmb y } - A { \pmb g } ) ( { \pmb y } - A { \pmb g } ) ^ { T } \right] A } } \end{array}
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
\begin{array} { l } { { { \bf \Pi } = \displaystyle \frac { 1 } { \varepsilon ^ { 2 } } A ^ { T } ( \varepsilon { \bf I } d ) A } } \\ { { { \bf \Pi } = \displaystyle \frac { 1 } { \varepsilon } A ^ { T } A } } \end{array}
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
Finally, note that we can write:
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
\begin{array} { r l } & { I ( \pmb { g } ) ( \hat { x } _ { L S Q } - \pmb { g } ) = \frac { 1 } { \varepsilon } A ^ { T } A ( A ^ { T } ( A A ^ { T } ) ^ { - 1 } y - \pmb { g } ) } \\ & { \qquad = \frac { 1 } { \varepsilon } ( A ^ { T } y - A ^ { T } A \pmb { g } ) } \\ & { \qquad = \frac { \partial \log p ( y ; \pmb { g } ) } { \partial \pmb { g } } , } \end{array}
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
which concludes the proof, as we have shown that $\hat { x } _ { L S Q }$ satisfies the condition (15), which in turn implies finite-sample efficiency.
|
| 522 |
+
|
| 523 |
+
Claim 1. Applying the precise bound that we can derive from Theorem $^ { l }$ on an ImageNet-sized dataset ( $d = 3 0 0 0 0 0 \mathrm { \Omega }$ ) and using $k = 1 0 0$ queries (what we use in our $\ell _ { \infty }$ threat model and ten times that used for our $\ell _ { 2 }$ threat model),
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\langle \hat { x } _ { L S Q } , \pmb { g } \rangle - \langle \hat { x } _ { N E S } , \pmb { g } \rangle \leq \frac { 5 } { 4 } | | \boldsymbol { g } | | ^ { 2 } .
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
For 10 queries,
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
\langle \hat { x } _ { L S Q } , \pmb { g } \rangle - \langle \hat { x } _ { N E S } , \pmb { g } \rangle \leq \frac { 1 } { 2 } | | \boldsymbol { g } | | ^ { 2 } .
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
# B OMITTED FIGURES
|
| 536 |
+
|
| 537 |
+
# B.1 COMPRESSIVE SENSING
|
| 538 |
+
|
| 539 |
+
Compressed sensing approaches can, in some cases, solve the optimization problem presented in Section 2.4. However, these approaches require sparsity to improve over the least squares method. Here we show the lack of sparsity in gradients through a classifier on a set of canonical bases for images. In Figure 5, we plot the fraction of $\ell _ { 2 }$ weight accounted for by the largest $k$ components in randomly chosen image gradients when using two canonical bases: standard and wavelet (db4). While lack of sparsity in these bases does not strictly preclude the existence of a basis on which gradients are sparse, it suggests the lack of a fundamental structural sparsity in gradients through a convolutional neural network.
|
| 540 |
+
|
| 541 |
+

|
| 542 |
+
Figure 5: Sparsity in standard, wavelet (db4 wavelets), and PCA-constructed bases for the gradients of 5,000 randomly chosen example images in the ImageNet validation set. The y-axis shows the mean fraction of $\ell _ { 2 }$ weight held by the largest $k$ vectors over the set of 5,000 chosen images. The $\mathbf { X }$ -axis varies $k$ . The gradients are taken through a standardly trained Inception v3 network. None of the bases explored induce significant sparsity.
|
| 543 |
+
|
| 544 |
+
# B.2 TILING
|
| 545 |
+
|
| 546 |
+
An example of the tiling procedure applied to a gradient can be seen in Figure 6.
|
| 547 |
+
|
| 548 |
+

|
| 549 |
+
Figure 6: Average blurred gradient with kernel size or “tile length” 5. The original gradient can be seen in 6a, and the “tiled” or average blurred gradient can be seen in 6b
|
| 550 |
+
|
| 551 |
+
# B.3 TIME-DEPENDENT PRIORS AT HIGHER STEP SIZES
|
| 552 |
+
|
| 553 |
+
We show in Figure 7 that the correlation between successive gradients on the NES trajectory are signficantly correlated, even at much higher step sizes (up to $\ell _ { 2 }$ norm of 4.0, which is a typical value for $\varepsilon$ , the total adversarial perturbation bound and thus an absolute bound on step size). This serves as further motivation for the time-dependent prior.
|
| 554 |
+
|
| 555 |
+

|
| 556 |
+
Figure 7: Figure 2 repeated for several step sizes, showing that the successive correlation between gradients continues even at higher step sizes.
|
| 557 |
+
|
| 558 |
+
# C HYPERPARAMETERS
|
| 559 |
+
|
| 560 |
+
Table 2: Hyperparameters for the NES approach.
|
| 561 |
+
|
| 562 |
+
<table><tr><td rowspan="2">Hyperparameter</td><td colspan="3">Value</td></tr><tr><td>ImageNet lo</td><td>ImageNet l2</td><td>CIFAR10 l0</td></tr><tr><td>Samples per step</td><td>100</td><td>10</td><td>50</td></tr><tr><td>Learning Rate</td><td>0.01</td><td>0.3</td><td>0.01</td></tr></table>
|
| 563 |
+
|
| 564 |
+
Table 3: Hyperparameters for the bandits approach (variables names as used in pseudocode).
|
| 565 |
+
|
| 566 |
+
<table><tr><td rowspan="2">Hyperparameter</td><td colspan="3">Value</td></tr><tr><td>ImageNet lo</td><td>ImageNet l2</td><td>CIFAR10 l0</td></tr><tr><td>η (OCO learning rate)</td><td>100</td><td>0.1</td><td>100</td></tr><tr><td>h (Image lp learning rate)</td><td>0.005</td><td>0.5</td><td>0.0001</td></tr><tr><td>δ (Bandit exploration)</td><td>0.01</td><td>0.01</td><td>0.01</td></tr><tr><td>η (Finite difference probe)</td><td>0.01</td><td>0.01</td><td>0.01</td></tr><tr><td>Tile size (Data-dependent prior only)</td><td>(6px)2</td><td>(6px)²</td><td>(10px)²</td></tr></table>
|
| 567 |
+
|
| 568 |
+
Table 4: Experimental setup for comparing Bandits-NES. Setup and results for comparison with Tu et al. (2018) in Appendix G
|
| 569 |
+
|
| 570 |
+
<table><tr><td rowspan="2">Parameter</td><td colspan="3">Value</td></tr><tr><td>ImageNet lo</td><td>ImageNet l2</td><td>CIFAR10 loo</td></tr><tr><td>Max allowed queries</td><td></td><td>10,000</td><td></td></tr><tr><td>Test set size</td><td>10,000</td><td>10,000</td><td>1,000</td></tr><tr><td>Allowed perturbation ε</td><td>0.05</td><td>5.0</td><td>0.05</td></tr></table>
|
| 571 |
+
|
| 572 |
+

|
| 573 |
+
Figure 8: Average loss and cosine distance versus number of queries used over the approaches’ optimization trajectories in the two threat models. We average each cosine distance and loss point at each query number over 100 images from the evaluation set.
|
| 574 |
+
|
| 575 |
+

|
| 576 |
+
Figure 9: Cumulative distribution functions for the number of queries required to create an adversarial example in the $\ell _ { 2 }$ and $\ell _ { \infty }$ settings for the NES, bandits with time prior (BanditsT ), and bandits with time and data-dependent priors (BanditsTD) approaches. Note that the CDFs do not converge to one, as the approaches sometimes cannot find an adversarial example in less than 10,000 queries.
|
| 577 |
+
|
| 578 |
+

|
| 579 |
+
Figure 10: The average number of queries used per successful image for each method when reaching a specified success rate: we compare NES Ilyas et al. (2017), Bandits $T$ (our method with time prior only), and BanditsTD (our method with both data and time priors) and find that our methods strictly dominate NES—that is, for any desired sucess rate, our methods take strictly less queries per successful image than NES.
|
| 580 |
+
|
| 581 |
+
# E RESULTS FOR CIFAR-10
|
| 582 |
+
|
| 583 |
+
Here, we give results for the CIFAR-10 dataset, comparing our best method (Bandits $_ { T D }$ ) and NES. We train Inception-v3, ResNet-50, and VGG16 classifiers by fine-tuning the standard PyTorch ImageNet classifiers. As such, all images are upsampled to $2 2 4 \times 2 2 4$ $( 2 9 9 \times 2 9 9 )$ for ResNet-50 and VGG16 (and Inception-v3). Just as for ImageNet, we use a maximum $\ell _ { \infty }$ perturbation of 0.05, where images are scaled to $[ 0 , 1 ]$ .
|
| 584 |
+
|
| 585 |
+
Table 5: Summary of effectiveness of $\ell _ { \infty }$ CIFAR10 attacks on Inception v3, ResNet-50, and VGG16 (I, R, V) using NES and bandits with time and data-dependent priors (Bandits $_ { T D }$ ). Note that in the first column, the average number of queries is calculated only over successful attacks, and we enforce a query limit of 10,000 queries. For purposes of direct comparison, the last column calculates the average number of queries used for only the images that NES (previous SOTA) was successful on. Our most powerful attack uses 2-4 times fewer queries, and fails 2-22 times less often.
|
| 586 |
+
|
| 587 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="3"> Avg. Queries</td><td colspan="3">Failure Rate</td><td colspan="3">Queries on NES Success</td></tr><tr><td>I</td><td>R</td><td>V</td><td>I</td><td>R</td><td>V</td><td>I</td><td>R</td><td>V</td></tr><tr><td>NES</td><td>1202</td><td>1317</td><td>879</td><td>22%</td><td>31%</td><td>27%</td><td>1202</td><td>1317</td><td>879</td></tr><tr><td>BanditsTD</td><td>602</td><td>554</td><td>509</td><td>0.6%</td><td>12%</td><td>18%</td><td>439</td><td>399</td><td>388</td></tr></table>
|
| 588 |
+
|
| 589 |
+
# F RESULTS FOR OTHER CLASSIFIERS
|
| 590 |
+
|
| 591 |
+
Here, we give results for the ImageNet dataset, comparing our best method (Bandits $_ { T D }$ ) and NES for Inception-v3 (also shown in Table 1), VGG16, and ResNet50 classifiers. Note that we do not fine-tune the hyperparameters to the new classifiers, but simply use the hyperparameters found for Inception-v3. Nevertheless, our best method consistently outperforms NES on black-box attacks.
|
| 592 |
+
|
| 593 |
+
Table 6: Summary of effectiveness of $\ell _ { \infty }$ and $\ell _ { 2 }$ ImageNet attacks on Inception v3, ResNet-50, and VGG16 (I, R, V) using NES and bandits with time and data-dependent priors (Bandit $_ { T D }$ ). Note that in the first column, the average number of queries is calculated only over successful attacks, and we enforce a query limit of 10,000 queries. For purposes of direct comparison, the last column calculates the average number of queries used for only the images that NES (previous SOTA) was successful on. Our most powerful attack uses 2-4 times fewer queries, and fails 2-5 times less often.
|
| 594 |
+
|
| 595 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Attack</td><td colspan="3">Avg. Queries</td><td colspan="3">Failure Rate</td><td colspan="3">#Q on NES Success</td></tr><tr><td>I</td><td>R</td><td>V</td><td>I</td><td>R</td><td>V</td><td>I</td><td>R</td><td>V</td></tr><tr><td rowspan="2">l2</td><td>NES</td><td>2938</td><td>2193</td><td>1244</td><td>34.4%</td><td>10.1%</td><td>11.6%</td><td>2938</td><td>2193</td><td>1244</td></tr><tr><td>BanditsTD</td><td>1858</td><td>993</td><td>594</td><td>15.5%</td><td>9.7%</td><td>17.2%</td><td>999</td><td>1195</td><td>1219</td></tr><tr><td rowspan="2">l</td><td>NES</td><td>1735</td><td>1397</td><td>764</td><td>22.2%</td><td>10.4%</td><td>10.5%</td><td>1735</td><td>1397</td><td>764</td></tr><tr><td>BanditsTD</td><td>1117</td><td>722</td><td>370</td><td>4.6%</td><td>3.4%</td><td>8.4%</td><td>703</td><td>594</td><td>339</td></tr></table>
|
| 596 |
+
|
| 597 |
+
# G COMPARISON TO (TU ET AL, 2018)
|
| 598 |
+
|
| 599 |
+
To compare with the method of Tu et al. (2018), we consider the same classifier and dataset (Inceptionv3 and Imagenet) under the same $\ell _ { 2 }$ threat model. Note that Tu et al. (2018) use mean rather than maximum $\ell _ { 2 }$ perturbation to evaluate their attacks (since the method is based on a Lagrangian relaxation). To ensure a fair comparison we compare against the average number of queries to reach the adversarial examples bounded within a pertubation budget of $2 \cdot 1 0 ^ { - 4 }$ , which is explicitly reported byTu et al. (2018).
|
| 600 |
+
|
| 601 |
+
For the bandits approach, we used Bandits $_ T$ , (the bandits method with the time prior) and Bandits $_ { T D }$ (the bandits method with both time and data prior) and run the methods until $100 \%$ success is reached. We use the same hyperparameters from the untargeted ImageNet experiments (given in Appendix C). Our findings, given in Table 7 show that our best method achieves an $100 \%$ success rate, and an over 6-fold reduction in queries. Note that the method of Tu et al. (2018) achieves $100 \%$ success rate in general, but only constrains the mean $\ell _ { 2 }$ perturbation, and thus actually achieves a strictly less than $1 0 0 \%$ success rate with this perturbation threshold.
|
| 602 |
+
|
| 603 |
+
Table 7: Comparison against coordinate-based query efficient finite differences attacks from Tu et al. (2018), using the ImageNet dataset, with a maximum $\ell _ { 2 }$ constraint of 0.0002 per-pixel normalized (which is equal to a max- $\cdot \ell _ { 2 }$ threshold reported by Tu et al. (2018)). For our methods (Bandits $_ T$ and Bandits $_ { T D }$ ) we use the same hyperparameters as in our comparison to NES, which are given in Appendix C.
|
| 604 |
+
|
| 605 |
+
<table><tr><td>Attack</td><td>Avg. Queries</td><td>Success Rate</td></tr><tr><td>AutoZOOM-BiLin (Tu et al., 2018)</td><td>15,064</td><td><100%</td></tr><tr><td>AutoZOOM-AE (Tu et al., 2018)</td><td>14,914</td><td><100%</td></tr><tr><td>BanditsT (Ours)</td><td>4455</td><td>100%</td></tr><tr><td>BanditsTD (Ours)</td><td>2297</td><td>100%</td></tr></table>
|
md/train/Bkg6RiCqY7/Bkg6RiCqY7.md
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DECOUPLED WEIGHT DECAY REGULARIZATION
|
| 2 |
+
|
| 3 |
+
Ilya Loshchilov & Frank Hutter
|
| 4 |
+
|
| 5 |
+
University of Freiburg
|
| 6 |
+
Freiburg, Germany,
|
| 7 |
+
ilya.loshchilov@gmail.com, fh@cs.uni-freiburg.de
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
$\mathrm { L _ { 2 } }$ regularization and weight decay regularization are equivalent for standard stochastic gradient descent (when rescaled by the learning rate), but as we demonstrate this is not the case for adaptive gradient algorithms, such as Adam. While common implementations of these algorithms employ $\mathrm { L _ { 2 } }$ regularization (often calling it “weight decay” in what may be misleading due to the inequivalence we expose), we propose a simple modification to recover the original formulation of weight decay regularization by decoupling the weight decay from the optimization steps taken w.r.t. the loss function. We provide empirical evidence that our proposed modification (i) decouples the optimal choice of weight decay factor from the setting of the learning rate for both standard SGD and Adam and (ii) substantially improves Adam’s generalization performance, allowing it to compete with SGD with momentum on image classification datasets (on which it was previously typically outperformed by the latter). Our proposed decoupled weight decay has already been adopted by many researchers, and the community has implemented it in TensorFlow and PyTorch; the complete source code for our experiments is available at https://github.com/loshchil/AdamW-and-SGDW
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Adaptive gradient methods, such as AdaGrad (Duchi et al., 2011), RMSProp (Tieleman & Hinton, 2012), Adam (Kingma & Ba, 2014) and most recently AMSGrad (Reddi et al., 2018) have become a default method of choice for training feed-forward and recurrent neural networks (Xu et al., 2015; Radford et al., 2015). Nevertheless, state-of-the-art results for popular image classification datasets, such as CIFAR-10 and CIFAR-100 Krizhevsky (2009), are still obtained by applying SGD with momentum (Gastaldi, 2017; Cubuk et al., 2018). Furthermore, Wilson et al. (2017) suggested that adaptive gradient methods do not generalize as well as SGD with momentum when tested on a diverse set of deep learning tasks, such as image classification, character-level language modeling and constituency parsing. Different hypotheses about the origins of this worse generalization have been investigated, such as the presence of sharp local minima (Keskar et al., 2016; Dinh et al., 2017) and inherent problems of adaptive gradient methods (Wilson et al., 2017). In this paper, we investigate whether it is better to use $\mathrm { L _ { 2 } }$ regularization or weight decay regularization to train deep neural networks with SGD and Adam. We show that a major factor of the poor generalization of the most popular adaptive gradient method, Adam, is due to the fact that $\mathrm { L _ { 2 } }$ regularization is not nearly as effective for it as for SGD. Specifically, our analysis of Adam leads to the following observations:
|
| 16 |
+
|
| 17 |
+
$\mathbf { L } _ { 2 }$ regularization and weight decay are not identical. Contrary to a belief which seems popular among some practitioners, the two techniques are not equivalent. For SGD, they can be made equivalent by a reparameterization of the weight decay factor based on the learning rate; this is not the case for Adam. In particular, when combined with adaptive gradients, $\mathrm { L _ { 2 } }$ regularization leads to weights with large parameter and/or gradient amplitudes being regularized less than they would be when using weight decay.
|
| 18 |
+
|
| 19 |
+
$\mathbf { L } _ { 2 }$ regularization is not effective in Adam. One possible explanation why Adam and other adaptive gradient methods might be outperformed by SGD with momentum is that common deep learning libraries only implement $\mathrm { L _ { 2 } }$ regularization, not the original weight decay. Therefore, on tasks/datasets where the use of $\mathrm { L _ { 2 } }$ regularization is beneficial for SGD (e.g., on many popular image classification datasets), Adam leads to worse results than SGD with momentum (for which $\mathrm { L _ { 2 } }$ regularization behaves as expected).
|
| 20 |
+
|
| 21 |
+
Weight decay is equally effective in both SGD and Adam. For SGD, it is equivalent to $\mathrm { L _ { 2 } }$ regularization, while for Adam it is not.
|
| 22 |
+
|
| 23 |
+
Optimal weight decay depends on the total number of batch passes/weight updates. Our empirical analysis of SGD and Adam suggests that the larger the runtime/number of batch passes to be performed, the smaller the optimal weight decay. This effect tends to be neglected because hyperparameters are often tuned for a fixed number of training epochs. As a result, the values of the weight decay found to perform best for short runs do not generalize to much longer runs.
|
| 24 |
+
|
| 25 |
+
The main contribution of this paper is to improve regularization in Adam by decoupling the weight decay from the gradient-based update. In a comprehensive analysis, we show that Adam generalizes substantially better with decoupled weight decay than with $\mathrm { L _ { 2 } }$ regularization, achieving $15 \%$ relative improvement in test error (see Figures 2 and 3); this holds true for various image recognition datasets (CIFAR-10 and ImageNet32x32), training budgets (ranging from 100 to 1800 epochs), and learning rate schedules (fixed, drop-step, and cosine annealing; see Figure 1). We demonstrate that our decoupled weight decay renders the optimal settings of the learning rate and the weight decay factor much more independent, thereby easing hyperparameter optimization (see Figure 2).
|
| 26 |
+
|
| 27 |
+
The main motivation of this paper is to improve Adam to make it competitive w.r.t. SGD with momentum even for those problems where it did not use to be competitive. We hope that as a result, practitioners do not need to switch between Adam and SGD anymore, which in turn should reduce the common issue of selecting dataset/task-specific training algorithms and their hyperparameters.
|
| 28 |
+
|
| 29 |
+
2 DECOUPLING THE WEIGHT DECAY FROM THE GRADIENT-BASED UPDATE
|
| 30 |
+
|
| 31 |
+
In the weight decay described by Hanson & Pratt (1988), the weights $\pmb \theta$ decay exponentially as
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\pmb { \theta } _ { t + 1 } = ( 1 - \lambda ) \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ( \pmb { \theta } _ { t } ) ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\lambda$ defines the rate of the weight decay per step and $\nabla f _ { t } ( \pmb { \theta } _ { t } )$ is the $t$ -th batch gradient to be multiplied by a learning rate $\alpha$ . For standard SGD, it is equivalent to standard $\mathrm { L _ { 2 } }$ regularization:
|
| 38 |
+
|
| 39 |
+
Proposition 1 (Weight decay ${ \bf \tau } = { \bf L } _ { 2 }$ reg for standard SGD). Standard SGD with base learning rate $\alpha$ executes the same steps on batch loss functions $f _ { t } ( \pmb \theta )$ with weight decay $\lambda$ (defined in Equation $I$ ) as it executes without weight decay on $\begin{array} { r } { f _ { t } ^ { r e g } ( { \pmb { \theta } } ) = f _ { t } ( { \pmb { \theta } } ) + \frac { \lambda ^ { \prime } } { 2 } \left\| { \pmb { \theta } } \right\| _ { 2 } ^ { 2 } } \end{array}$ , with $\begin{array} { r } { \lambda ^ { \prime } = \frac { \lambda } { \alpha } } \end{array}$ .
|
| 40 |
+
|
| 41 |
+
The proofs of this well-known fact, as well as our other propositions, are given in the Appendix A.
|
| 42 |
+
|
| 43 |
+
Due to this equivalence, $\mathrm { L _ { 2 } }$ regularization is very frequently referred to as weight decay, including in popular deep learning libraries. However, as we will demonstrate later in this section, this equivalence does not hold for adaptive gradient methods. One fact that is often overlooked already for the simple case of SGD is that in order for the equivalence to hold, the $\mathrm { L _ { 2 } }$ regularizer $\lambda ^ { \prime }$ has to be set to $\frac { \lambda } { \underset { \mathbf { x } } { \alpha } }$ , i.e., if there ie learning rate n overall best weight decay value . In order to decouple the effects $\lambda$ , the best value of these two hyperp $\lambda ^ { \prime }$ is tightly coupled withmeters, we advocate to $\alpha$ decouple the weight decay step as proposed by Hanson & Pratt (1988) (Equation 1).
|
| 44 |
+
|
| 45 |
+
Looking first at the case of SGD, we propose to decay the weights simultaneously with the update of $\theta _ { t }$ based on gradient information in Line 9 of Algorithm 1. This yields our proposed variant of SGD with momentum using decoupled weight decay (SGDW). This simple modification explicitly decouples $\lambda$ and $\alpha$ (although some problem-dependent implicit coupling may of course remain as for any two hyperparameters). In order to account for a possible scheduling of both $\alpha$ and $\lambda$ , we introduce a scaling factor $\eta _ { t }$ delivered by a user-defined procedure SetScheduleMultiplier $( t )$ .
|
| 46 |
+
|
| 47 |
+
Now, let’s turn to adaptive gradient algorithms like the popular optimizer Adam Kingma & Ba (2014), which scale gradients by their historic magnitudes. Intuitively, when Adam is run on a loss function $f$ plus $\mathrm { L _ { 2 } }$ regularization, weights that tend to have large gradients in $f$ do not get regularized as much as they would with decoupled weight decay, since the gradient of the regularizer gets scaled along with the gradient of $f$ . This leads to an inequivalence of $\mathrm { L _ { 2 } }$ and decoupled weight decay regularization for adaptive gradient algorithms:
|
| 48 |
+
|
| 49 |
+
<table><tr><td>Algorithm 1 SGD with L2 regularization</td><td></td><td>SGD with decoupled weight decay (SGDW) both</td></tr><tr><td>with momentum</td><td colspan="2"></td></tr></table>
|
| 50 |
+
|
| 51 |
+
1: given initial learning rate $\alpha \in \mathbb { R }$ , momentum factor $\beta _ { 1 } \in \mathbb { R }$ , weight decay/L2 regularization factor $\overline { { \lambda \in \mathbb { R } } }$
|
| 52 |
+
2: initialize time step $t 0$ , parameter vector $\pmb { \theta } _ { t = 0 } ~ \in ~ \mathbb { R } ^ { n }$ , first moment vector $\pmb { m } _ { t = 0 } \gets \pmb { \theta }$ , schedule
|
| 53 |
+
multiplier $\eta _ { t = 0 } \in \mathbb { R }$
|
| 54 |
+
3: repeat
|
| 55 |
+
4: $t \gets t + 1$
|
| 56 |
+
5: $\nabla f _ { t } \big ( \pmb { \theta } _ { t - 1 } \big ) \gets \mathrm { S e l e c t B a t c h } \big ( \pmb { \theta } _ { t - 1 } \big )$ . select batch and return the corresponding gradient
|
| 57 |
+
6: $\pmb { g } _ { t } \gets \nabla f _ { t } ( \pmb { \theta } _ { t - 1 } ) \ + \lambda \pmb { \theta } _ { t - 1 }$
|
| 58 |
+
7: ηt ← SetScheduleMultiplier(t) . can be fixed, decay, be used for warm restarts
|
| 59 |
+
8: ${ \pmb { m } } _ { t } \gets \beta _ { 1 } { \pmb { m } } _ { t - 1 } + \eta _ { t } \alpha { \pmb { g } } _ { t }$
|
| 60 |
+
9: $\pmb { \theta } _ { t } \gets \pmb { \theta } _ { t - 1 } - \pmb { m } _ { t } - \eta _ { t } \lambda \pmb { \theta } _ { t - 1 }$
|
| 61 |
+
10: until stopping criterion is met
|
| 62 |
+
11: return optimized parameters ${ \pmb \theta } _ { t }$
|
| 63 |
+
1: given $\alpha = 0 . 0 0 1 , \beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 9 , \epsilon = 1 0 ^ { - 8 } , \lambda \in \mathbb { R }$
|
| 64 |
+
2: initialize time step $t \gets 0$ , parameter vector $\pmb { \theta } _ { t = 0 } \in \mathbb { R } ^ { n }$ , first moment vector $\pmb { m } _ { t = 0 } \pmb { \theta }$ , second moment
|
| 65 |
+
vector $\pmb { \nu } _ { t = 0 } \pmb { \theta }$ , schedule multiplier $\eta _ { t = 0 } \in \mathbb { R }$
|
| 66 |
+
3: repeat
|
| 67 |
+
4: $t \gets t + 1$
|
| 68 |
+
5: $\nabla f _ { t } ( { \mathbf { \dot { \theta } } } _ { t - 1 } ^ { \phantom { \dagger } } ) \gets \mathrm { S e l e c t B a t c h } ( { \mathbf { \theta } } _ { t - 1 } )$ . select batch and return the corresponding gradient
|
| 69 |
+
6: $\pmb { \mathscr { g } } _ { t } \gets \nabla f _ { t } ( \pmb { \theta } _ { t - 1 } ) \ + \lambda \pmb { \theta } _ { t - 1 }$
|
| 70 |
+
7: $\pmb { m } _ { t } \gets \beta _ { 1 } \pmb { m } _ { t - 1 } + ( 1 - \beta _ { 1 } ) \pmb { g } _ { t }$ . here and below all operations are element-wise
|
| 71 |
+
8: $\pmb { \nu } _ { t } \gets \beta _ { 2 } \pmb { \nu } _ { t - 1 } + ( 1 - \beta _ { 2 } ) \pmb { g } _ { t } ^ { 2 }$
|
| 72 |
+
9: $\hat { { \pmb { m } } } _ { t } \gets { \pmb { m } } _ { t } / ( 1 - \beta _ { 1 } ^ { t } )$ . $\beta _ { 1 }$ is taken to the power of $t$
|
| 73 |
+
10: ˆvt ← vt/(1 − βt2) . $\beta _ { 2 }$ is taken to the power of $t$
|
| 74 |
+
11: $\eta _ { t } \gets$ SetScheduleMultiplier(t) . can be fixed, decay, or also be used for warm restarts
|
| 75 |
+
12: θt ← θt−1 − ηt αmˆ t/( ˆvt + ) +λθt−1
|
| 76 |
+
13: until stopping criterion is met
|
| 77 |
+
|
| 78 |
+
<table><tr><td>Algorithm 2 Adam with L2 regularization</td><td>and</td></tr></table>
|
| 79 |
+
|
| 80 |
+
14: return optimized parameters ${ \pmb \theta } _ { t }$
|
| 81 |
+
|
| 82 |
+
Proposition 2 (Weight decay $\neq \mathrm { L } _ { 2 }$ reg for adaptive gradients). Let $O$ denote an optimizer that has iterates $\pmb { \theta } _ { t + 1 } \pmb { \theta } _ { t } - \alpha \mathbf { M } _ { t } \nabla f _ { t } ( \pmb { \theta } _ { t } )$ when run on batch loss function $f _ { t } ( \pmb \theta )$ without weight decay, and $\pmb { \theta } _ { t + 1 } \gets ( 1 - \lambda ) \pmb { \theta } _ { t } - \alpha \mathbf { M } _ { t } \nabla f _ { t } ( \pmb { \theta } _ { t } )$ when run on $f _ { t } ( \pmb \theta )$ with weight decay, respectively, with $\mathbf { M } _ { t } \neq k \mathbf { I }$ (where $k \in \mathbb { R } ,$ ). Then, for $O$ there exists no $L _ { 2 }$ coefficient $\lambda ^ { \prime }$ such that running $O$ on batch loss $\begin{array} { r } { f _ { t } ^ { r e g } ( { \pmb \theta } ) = f _ { t } ( { \pmb \theta } ) + \frac { \lambda ^ { \prime } } { 2 } \left. { \pmb \theta } \right. _ { 2 } ^ { 2 } } \end{array}$ without weight decay is equivalent to running $O$ on $f _ { t } ( \pmb \theta )$ with decay $\lambda \in \mathbb { R } ^ { + }$ .
|
| 83 |
+
|
| 84 |
+
We decouple weight decay and loss-based gradient updates in Adam as shown in line 12 of Algorithm 2; this gives rise to our variant of Adam with decoupled weight decay (AdamW).
|
| 85 |
+
|
| 86 |
+
Having shown that $\mathrm { L _ { 2 } }$ regularization and weight decay regularization differ for adaptive gradient algorithms raises the question of how they differ and how to interpret their effects. Their equivalence for standard SGD remains very helpful for intuition: both mechanisms push weights closer to zero, at the same rate. However, for adaptive gradient algorithms they differ: with $\mathrm { L _ { 2 } }$ regularization, the sums of the gradient of the loss function and the gradient of the regularizer (i.e., the $\mathrm { L _ { 2 } }$ norm of the weights) are adapted, whereas with weight decay, only the gradients of the loss function are adapted (with the weight decay step separated from the adaptive gradient mechanism). With $\mathrm { L _ { 2 } }$ regularization both types of gradients are normalized by their typical (summed) magnitudes, and therefore weights $x$ with large typical gradient magnitude $s$ are regularized by a smaller relative amount than other weights. In contrast, weight decay regularizes all weights with the same rate $\lambda$ , effectively regularizing weights $x$ with large $s$ more than standard $\mathrm { L _ { 2 } }$ regularization does. We demonstrate this formally for a simple special case of adaptive gradient algorithm with a fixed preconditioner:
|
| 87 |
+
|
| 88 |
+
Proposition 3 (Weight decay $=$ scale-adjusted $L _ { 2 }$ reg for adaptive gradient algorithm with fixed preconditioner). Let $O$ denote an algorithm with the same characteristics as in Proposition 2, and using a fixed preconditioner matrix ${ \bf \bar { \cal M } } _ { t } = d i a g ( s ) ^ { - 1 }$ (with $s _ { i } > 0$ for all $i _ { , }$ ). Then, $O$ with base learning rate $\alpha$ executes the same steps on batch loss functions $f _ { t } ( \pmb \theta )$ with weight decay $\lambda$ as it executes without weight decay on the scale-adjusted regularized batch loss
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
f _ { t } ^ { s r e g } ( \pmb { \theta } ) = f _ { t } ( \pmb { \theta } ) + \frac { \lambda ^ { \prime } } { 2 \alpha } \left\| \pmb { \theta } \odot \sqrt { \pmb { s } } \right\| _ { 2 } ^ { 2 } ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\odot$ and $\sqrt { \cdot }$ denote element-wise multiplication and square root, respectively, and $\begin{array} { r } { \lambda ^ { \prime } = \frac { \lambda } { \alpha } } \end{array}$
|
| 95 |
+
|
| 96 |
+
# 3 JUSTIFICATION OF DECOUPLED WEIGHT DECAY VIA A VIEW OF ADAPTIVE GRADIENT METHODS AS BAYESIAN FILTERING
|
| 97 |
+
|
| 98 |
+
We now discuss a justification of decoupled weight decay in the framework of Bayesian filtering for a unified theory of adaptive gradient algorithms due to Aitchison (2018). After we posted a preliminary version of our current paper on arXiv, Aitchison noted that his theory “gives us a theoretical framework in which we can understand the superiority of this weight decay over $L _ { 2 }$ regularization, because it is weight decay, rather than $L _ { 2 }$ regularization that emerges through the straightforward application of Bayesian filtering.”(Aitchison, 2018). While full credit for this theory goes to Aitchison, we summarize it here to shed some light on why weight decay may be favored over $L _ { 2 }$ regularization.
|
| 99 |
+
|
| 100 |
+
Aitchison (2018) views stochastic optimization of $n$ parameters $x _ { 1 } , \ldots , x _ { n }$ as a Bayesian filtering problem with the goal of inferring a distribution over the optimal values of each of the parameters $x _ { i }$ given the current values of the other parameters $\pmb \theta _ { - i } ( t )$ at time step $t$ . When the other parameters do not change this is an optimization problem, but when they do change it becomes one of “tracking” the optimizer using Bayesian filtering as follows. One is given a probability distribution $\bar { P ( \pmb \theta _ { t } ) } \ |$ $y _ { 1 : t } )$ of the optimizer at time step $t$ that takes into account the data $\scriptstyle { \boldsymbol { y } } _ { 1 : t }$ from the first $t$ mini batches, a state transition prior $P ( \pmb \theta _ { t + 1 } \mid \pmb \theta _ { t } )$ reflecting a (small) data-independent change in this distribution from one step to the next, and a likelihood $\mathbf { \bar { \ u } } _ { P ( \pmb { y } _ { t + 1 } \mid \mathbf { \theta } _ { t + 1 } ) }$ derived from the mini batch at step $t + 1$ . The posterior distribution $P ( \pmb { \theta } _ { t + 1 } \mid \mathbf { y } _ { 1 : t + 1 } )$ of the optimizer at time step $t + 1$ can then be computed (as usual in Bayesian filtering) by marginalizing over $\theta _ { t }$ to obtain the onestep ahead predictions $P ( \pmb { \theta } _ { t + 1 } \mid \pmb { y } _ { 1 : t } )$ and then applying Bayes’ rule to incorporate the likelihood $\textstyle P ( \mathbf { \bar { y } } _ { t + 1 } \mid \theta _ { t + 1 } )$ . Aitchison (2018) assumes a Gaussian state transition distribution $P ( \pmb \theta _ { t + 1 } \mid \pmb \theta _ { t } )$ and an approximate conjugate likelihood $\textstyle P ( \pmb { y } _ { t + 1 } \mid \pmb { \theta } _ { t + 1 } )$ , leading to the following closed-form update of the filtering distribution’s mean:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r } { \pmb { \mu } _ { p o s t } = \pmb { \mu } _ { p r i o r } + \pmb { \Sigma } _ { p o s t } \times \pmb { g } , } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\textbf { { g } }$ is the gradient of the log likelihood of the mini batch at time $t$ . This result implies a preconditioner of the gradients that is given by the posterior uncertainty $\Sigma _ { p o s t }$ of the filtering distribution: updates are larger for parameters we are more uncertain about and smaller for parameters we are more certain about. Aitchison (2018) goes on to show that popular adaptive gradient methods, such as Adam and RMSprop, as well as Kronecker-factorized methods are special cases of this framework.
|
| 107 |
+
|
| 108 |
+
Decoupled weight decay very naturally fits into this unified framework can express weight decay as part of the state-transition distribution: Aitchison (2018) assumes a slow change of the optimizer according to the following Gaussian:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
P ( \pmb \theta _ { t + 1 } \mid \pmb \theta _ { t } ) = N ( ( \pmb I - \pmb A ) \pmb \theta _ { t } , \pmb Q ) ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $Q$ is the covariance of Gaussian perturbations of the weights, and $\pmb { A }$ is a regularizer to avoid values growing unboundedly over time. When instantiated as $A = \lambda \times I$ , this regularizer $\pmb { A }$ plays exactly the role of decoupled weight decay as described in Equation 1, since this leads to multiplying the current mean estimate $\theta _ { t }$ by $( 1 - \lambda )$ at each step. Notably, this regularization is also directly applied to the prior and does not depend on the uncertainty in each of the parameters (which would be required for $L _ { 2 }$ regularization).
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 1: Adam performs better with decoupled weight decay (bottom row, AdamW) than with $L _ { 2 }$ regularization (top row, Adam). We show the final test error of a $2 6 ~ 2 \mathrm { x } 6 4 \mathrm { d }$ ResNet on CIFAR-10 after 100 epochs of training with fixed learning rate (left column), step-drop learning rate (with drops at epoch indexes 30, 60 and 80, middle column) and cosine annealing (right column). AdamW leads to a more separable hyperparameter search space, especially when a learning rate schedule, such as step-drop and cosine annealing is applied. Cosine annealing yields clearly superior results.
|
| 118 |
+
|
| 119 |
+
# 4 EXPERIMENTAL VALIDATION
|
| 120 |
+
|
| 121 |
+
We now evaluate the performance of decoupled weight decay under various training budgets and learning rate schedules. Our experimental setup follows that of Gastaldi (2017), who proposed, in addition to $\mathrm { L _ { 2 } }$ regularization, to apply the new Shake-Shake regularization to a 3-branch residual DNN that allowed to achieve new state-of-the-art results of $2 . 8 6 \%$ on the CIFAR-10 dataset (Krizhevsky, 2009). We always used a batch size of 128. The regular data augmentation procedure used for the CIFAR datasets was applied. We used the same model/source code based on fb.resnet.torch 1. The base networks are a $2 6 ~ 2 \mathrm { x } 6 4 \mathrm { d }$ ResNet (i.e. the network has a depth of 26, 2 residual branches and the first residual block has a width of 64) and a $2 6 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet with $1 1 . 6 \mathbf { M }$ and $2 5 . 6 \mathbf { M }$ parameters, respectively. For a detailed description of the network and the Shake-Shake method, we refer the interested reader to Gastaldi (2017). We also perform experiments on the ImageNet32x32 dataset (Chrabaszcz et al., 2017), a downsampled version of the original ImageNet dataset with 1.2 million $3 2 \times 3 2$ pixels images.
|
| 122 |
+
|
| 123 |
+
# 4.1 EVALUATING DECOUPLED WEIGHT DECAY WITH DIFFERENT LEARNING RATE SCHEDULES
|
| 124 |
+
|
| 125 |
+
In our first experiment, we compare Adam with $L _ { 2 }$ regularization to Adam with decoupled weight decay (AdamW), using three different learning rate schedules: a fixed learning rate, a drop-step schedule, and a cosine annealing schedule (Loshchilov & Hutter, 2016). For each learning rate schedule and weight decay variant, we trained a 2x64d ResNet for 100 epochs, using different settings of the initial learning rate $\alpha$ and the weight decay factor $\lambda$ . Figure 1 shows that decoupled weight decay outperforms $L _ { 2 }$ regularization for all learning rate schedules, with larger differences for better learning rate schedules. We also note that decoupled weight decay leads to a more separable hyperparameter search space, especially when a learning rate schedule, such as step-drop and cosine annealing is applied. The figure also shows that cosine annealing clearly outperforms the other learning rate schedules; we thus used cosine annealing for the remainder of the experiments.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 2: The Top-1 test error of a 26 2x64d ResNet on CIFAR-10 measured after 100 epochs. The proposed SGDW and AdamW (right column) have a more separable hyperparameter space.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 3: Learning curves (top row) and generalization results (bottom row) obtained by a 26 $2 \mathrm { x } 9 6 \mathrm { d }$ ResNet trained with Adam and AdamW on CIFAR-10. See text for details. SuppFigure 4 in the Appendix shows the same qualitative results for ImageNet $3 2 \mathbf { x } 3 2$ .
|
| 132 |
+
|
| 133 |
+
4.2 DECOUPLING THE WEIGHT DECAY AND INITIAL LEARNING RATE PARAMETERS
|
| 134 |
+
|
| 135 |
+
In order to verify our hypothesis about the coupling of $\alpha$ and $\lambda$ , in Figure 2 we compare the performance of $\mathrm { L _ { 2 } }$ regularization vs. decoupled weight decay in SGD (SGD vs. SGDW, top row) and in Adam (Adam vs. AdamW, bottom row). In SGD (Figure 2, top left), $\mathrm { L _ { 2 } }$ regularization is not decoupled from the learning rate (the common way as described in Algorithm 1), and the figure clearly shows that the basin of best hyperparameter settings (depicted by color and top-10 hyperparameter settings by black circles) is not aligned with the $\mathbf { X }$ -axis or y-axis but lies on the diagonal. This suggests that the two hyperparameters are interdependent and need to be changed simultaneously, while only changing one of them might substantially worsen results. Consider, e.g., the setting at the top left black circle $( \alpha = 1 / 2$ , $\lambda \overset { - } { = } 1 / 8 * 0 . 0 0 1 )$ ; only changing either $\alpha$ or $\lambda$ by itself would worsen results, while changing both of them could still yield clear improvements. We note that this coupling of initial learning rate and $\mathrm { L _ { 2 } }$ regularization factor might have contributed to SGD’s reputation of being very sensitive to its hyperparameter settings.
|
| 136 |
+
|
| 137 |
+
In contrast, the results for SGD with decoupled weight decay (SGDW) in Figure 2 (top right) show that weight decay and initial learning rate are decoupled. The proposed approach renders the two hyperparameters more separable: even if the learning rate is not well tuned yet (e.g., consider the value of 1/1024 in Figure 2, top right), leaving it fixed and only optimizing the weight decay factor would yield a good value (of $1 / 4 ^ { * } 0 . 0 0 1$ ). This is not the case for SGD with $\mathrm { L _ { 2 } }$ regularization (see Figure 2, top left).
|
| 138 |
+
|
| 139 |
+
The results for Adam with $\mathrm { L _ { 2 } }$ regularization are given in Figure 2 (bottom left). Adam’s best hyperparameter settings performed clearly worse than SGD’s best ones (compare Figure 2, top left). While both methods used $\mathrm { L _ { 2 } }$ regularization, Adam did not benefit from it at all: its best results obtained for non-zero $\mathrm { L _ { 2 } }$ regularization factors were comparable to the best ones obtained without the $\mathrm { L _ { 2 } }$ regularization, i.e., when $\lambda = 0$ . Similarly to the original SGD, the shape of the hyperparameter landscape suggests that the two hyperparameters are coupled.
|
| 140 |
+
|
| 141 |
+
In contrast, the results for our new variant of Adam with decoupled weight decay (AdamW) in Figure 2 (bottom right) show that AdamW largely decouples weight decay and learning rate. The results for the best hyperparameter settings were substantially better than the best ones of Adam with $\mathrm { L _ { 2 } }$ regularization and rivaled those of SGD and SGDW.
|
| 142 |
+
|
| 143 |
+
In summary, the results in Figure 2 support our hypothesis that the weight decay and learning rate hyperparameters can be decoupled, and that this in turn simplifies the problem of hyperparameter tuning in SGD and improves Adam’s performance to be competitive w.r.t. SGD with momentum.
|
| 144 |
+
|
| 145 |
+
# 4.3 BETTER GENERALIZATION OF ADAMW
|
| 146 |
+
|
| 147 |
+
While the previous experiment suggested that the basin of optimal hyperparameters of AdamW is broader and deeper than the one of Adam, we next investigated the results for much longer runs of 1800 epochs to compare the generalization capabilities of AdamW and Adam.
|
| 148 |
+
|
| 149 |
+
We fixed the initial learning rate to 0.001 which represents both the default learning rate for Adam and the one which showed reasonably good results in our experiments. Figure 3 shows the results for 12 settings of the $\mathrm { L _ { 2 } }$ regularization of Adam and 7 settings of the normalized weight decay of AdamW (the normalized weight decay represents a rescaling formally defined in the Appendix B.1, it amounts to a multiplicative factor which depends on the number of bath passes). Interestingly, while the dynamics of the learning curves of Adam and AdamW often coincided for the first half of the training run, AdamW often led to lower training loss and test errors (see Figure 3 top left and top right, respectively). Importantly, the use of weight decay in Adam did not yield as good results as in AdamW (see also Figure 3, bottom left). Next, we investigated whether AdamW’s better results were only due to better convergence or due to better generalization. The results in Figure 3 (bottom right) for the best settings of Adam and AdamW suggest that AdamW did not only yield better training loss but also yielded better generalization performance for similar training loss values. The results on ImageNet32x32 (see SuppFigure 4 in the Appendix) lead to the same conclusion of substantially improved generalization performance.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 4: Top-1 test error on CIFAR-10 (left) and Top-5 test error on ImageNet32x32 (right). For a better resolution and with training loss curves, see SuppFigure 5 and SuppFigure 6 in the supplementary material.
|
| 153 |
+
|
| 154 |
+
# 4.4 ADAMWR WITH WARM RESTARTS FOR BETTER ANYTIME PERFORMANCE
|
| 155 |
+
|
| 156 |
+
In order to improve anytime performance of SGDW and AdamW we extended them with warm restarts of (Loshchilov & Hutter, 2016) to obtain SGDWR and AdamWR, respectively (see section B.2 in the Appendix). As Figure 4 shows, AdamWR greatly sped up AdamW on CIFAR-10 and ImageNet32x32, up to a factor of 10 (see the results at the first restart). For the default learning rate of 0.001, AdamW achieved $1 5 \%$ relative improvement in test errors compared to Adam both on CIFAR-10 (also see Figure 3) and ImageNet $3 2 x 3 2$ (also see SuppFigure 5). AdamWR achieved the same improved results but with a much better anytime performance. These improvements closed most of the gap between Adam and SGDWR on CIFAR-10 and yielded comparable performance on ImageNet32x32.
|
| 157 |
+
|
| 158 |
+
# 4.5 USE OF ADAMW ON OTHER DATASETS AND ARCHITECTURES
|
| 159 |
+
|
| 160 |
+
Several other research groups have already successfully applied AdamW in citable works. For example, Wang et al. (2018) used AdamW to train a novel architecture for face detection on the standard WIDER FACE dataset (Yang et al., 2016), obtaining almost 10x faster predictions than the previous state of the art algorithms while achieving comparable performance. Volker et al. (2018) employed ¨ AdamW with cosine annealing to train convolutional neural networks to classify and characterize error-related brain signals measured from intracranial electroencephalography (EEG) recordings. While their paper does not provide a comparison to Adam, they kindly provided us with a direct comparison of the two on their best-performing problem-specific network architecture Deep4Net and a variant of ResNet. AdamW with the same hyperparameter setting as Adam yielded higher test set accuracy on Deep4Net $7 3 . 6 8 \%$ versus $7 1 . 3 7 \%$ ) and statistically significantly higher test set accuracy on ResNet $( 7 2 . 0 4 \%$ versus $6 1 . 3 4 \%$ . Radford et al. (2018) employed AdamW to train Transformer (Vaswani et al., 2017) architectures to obtain new state-of-the-art results on a wide range of benchmarks for natural language understanding. Zhang et al. (2018) compared $\mathrm { L _ { 2 } }$ regularization vs. weight decay for SGD, Adam and the Kronecker-Factored Approximate Curvature (K-FAC) optimizer (Martens & Grosse, 2015) on the CIFAR datasets with ResNet and VGG architectures, reporting that decoupled weight decay consistently outperformed $\mathrm { L _ { 2 } }$ regularization in cases where they differ.
|
| 161 |
+
|
| 162 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 163 |
+
|
| 164 |
+
Following suggestions that adaptive gradient methods such as Adam might lead to worse generalization than SGD with momentum (Wilson et al., 2017), we identified and exposed the inequivalence of $\mathrm { L _ { 2 } }$ regularization and weight decay for Adam. We empirically showed that our version of Adam with decoupled weight decay yields substantially better generalization performance than the common implementation of Adam with $\mathrm { L _ { 2 } }$ regularization. We also proposed to use warm restarts for Adam to improve its anytime performance.
|
| 165 |
+
|
| 166 |
+
Our results obtained on image classification datasets must be verified on a wider range of tasks, especially ones where the use of regularization is expected to be important. It would be interesting to integrate our findings on weight decay into other methods which attempt to improve Adam, e.g, normalized direction-preserving Adam (Zhang et al., 2017). While we focused our experimental analysis on Adam, we believe that similar results also hold for other adaptive gradient methods, such as AdaGrad (Duchi et al., 2011) and AMSGrad (Reddi et al., 2018).
|
| 167 |
+
|
| 168 |
+
# 6 ACKNOWLEDGMENTS
|
| 169 |
+
|
| 170 |
+
This work was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme under grant no. 716721, by the German Research Foundation (DFG), under the BrainLinksBrainTools Cluster of Excellence (grant number EXC 1086) and through grant no. INST 37/935-1 FUGG, and by the German state of BadenWurttemberg through bwHPC. We thank Patryk Chrabaszcz for helping running experiments with ¨ ImageNet32x32. We thank Matthias Feurer and Robin Schirrmeister for providing valuable feedback on this paper in several iterations. We thank Martin Volker, Robin Schirrmeister, and Tonio ¨ Ball for providing us with a comparison of AdamW and Adam on their EEG data.
|
| 171 |
+
|
| 172 |
+
Finally, we thank the following members of the deep learning community for implementing decoupled weight decay in various deep learning libraries:
|
| 173 |
+
|
| 174 |
+
• Jingwei Zhang, Lei Tai, Robin Schirrmeister, and Kashif Rasul for their implementations in PyTorch (see https://github.com/pytorch/pytorch/pull/4429)
|
| 175 |
+
• Phil Jund for his implementation in TensorFlow described at https://www.tensorflow.org/api_docs/python/tf/contrib/opt/ DecoupledWeightDecayExtension Sylvain Gugger, Anand Saha, Jeremy Howard and other members of fast.ai for their implementation available at https://github.com/sgugger/Adam-experiments Guillaume Lambard for his implementation in Keras available at https://github. com/GLambard/AdamW_Keras
|
| 176 |
+
• Yagami Lin for his implementation in Caffe available at https://github.com/ Yagami123/Caffe-AdamW-AdamWR
|
| 177 |
+
|
| 178 |
+
# REFERENCES
|
| 179 |
+
|
| 180 |
+
Laurence Aitchison. A unified theory of adaptive stochastic gradient descent as Bayesian filtering. arXiv:1507.02030, 2018.
|
| 181 |
+
|
| 182 |
+
Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of ImageNet as an alternative to the CIFAR datasets. arXiv:1707.08819, 2017.
|
| 183 |
+
|
| 184 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018.
|
| 185 |
+
|
| 186 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. arXiv:1703.04933, 2017.
|
| 187 |
+
|
| 188 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. The Journal of Machine Learning Research, 12:2121–2159, 2011.
|
| 189 |
+
|
| 190 |
+
Xavier Gastaldi. Shake-Shake regularization. arXiv preprint arXiv:1705.07485, 2017.
|
| 191 |
+
|
| 192 |
+
Stephen Jose Hanson and Lorien Y Pratt. Comparing biases for minimal network construction with ´ back-propagation. In Proceedings of the 1st International Conference on Neural Information Processing Systems, pp. 177–185, 1988.
|
| 193 |
+
|
| 194 |
+
Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E Hopcroft, and Kilian Q Weinberger. Snapshot ensembles: Train 1, get m for free. arXiv:1704.00109, 2017.
|
| 195 |
+
|
| 196 |
+
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:1609.04836, 2016.
|
| 197 |
+
|
| 198 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
|
| 199 |
+
|
| 200 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 201 |
+
|
| 202 |
+
Hao Li, Zheng Xu, Gavin Taylor, and Tom Goldstein. Visualizing the loss landscape of neural nets. arXiv preprint arXiv:1712.09913, 2017.
|
| 203 |
+
|
| 204 |
+
Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. arXiv:1608.03983, 2016.
|
| 205 |
+
|
| 206 |
+
James Martens and Roger Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In International conference on machine learning, pp. 2408–2417, 2015.
|
| 207 |
+
|
| 208 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv:1511.06434, 2015.
|
| 209 |
+
|
| 210 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/research-covers/language-unsupervised/language understanding paper. pdf, 2018.
|
| 211 |
+
|
| 212 |
+
Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. Inter national Conference on Learning Representations, 2018.
|
| 213 |
+
|
| 214 |
+
Leslie N Smith. Cyclical learning rates for training neural networks. arXiv:1506.01186v3, 2016.
|
| 215 |
+
|
| 216 |
+
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.
|
| 217 |
+
|
| 218 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
|
| 219 |
+
|
| 220 |
+
Martin Volker, Ji ¨ ˇr´ı Hammer, Robin T Schirrmeister, Joos Behncke, Lukas DJ Fiederer, Andreas Schulze-Bonhage, Petr Marusic, Wolfram Burgard, and Tonio Ball. Intracranial error detection ˇ via deep learning. arXiv preprint arXiv:1805.01667, 2018.
|
| 221 |
+
|
| 222 |
+
Jianfeng Wang, Ye Yuan, Gang Yu, and Sun Jian. Sface: An efficient network for face detection in large scale variations. arXiv preprint arXiv:1804.06559, 2018.
|
| 223 |
+
|
| 224 |
+
Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nathan Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. arXiv:1705.08292, 2017.
|
| 225 |
+
|
| 226 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, pp. 2048–2057, 2015.
|
| 227 |
+
|
| 228 |
+
Shuo Yang, Ping Luo, Chen-Change Loy, and Xiaoou Tang. Wider face: A face detection benchmark. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5525–5533, 2016.
|
| 229 |
+
|
| 230 |
+
Guodong Zhang, Chaoqi Wang, Bowen Xu, and Roger Grosse. Three mechanisms of weight decay regularization. arXiv preprint arXiv:1810.12281, 2018.
|
| 231 |
+
|
| 232 |
+
Zijun Zhang, Lin Ma, Zongpeng Li, and Chuan Wu. Normalized direction-preserving adam. arXiv:1709.04546, 2017.
|
| 233 |
+
|
| 234 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. In arXiv:1707.07012 [cs.CV], 2017.
|
| 235 |
+
|
| 236 |
+
# Appendix
|
| 237 |
+
|
| 238 |
+
A FORMAL ANALYSIS OF WEIGHT DECAY VS $\mathrm { L _ { 2 } }$ REGULARIZATION
|
| 239 |
+
|
| 240 |
+
# Proof of Proposition 1
|
| 241 |
+
|
| 242 |
+
The proof for this well-known fact is straight-forward. SGD without weight decay has the following iterates on $\begin{array} { r } { f _ { t } ^ { \mathrm { r e g } } ( { \pmb \theta } ) = f _ { t } ( { \pmb \theta } ) + \frac { \lambda ^ { \prime } } { 2 } \left\| { \pmb \theta } \right\| _ { 2 } ^ { 2 } } \end{array}$ :
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
\pmb { \theta } _ { t + 1 } \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ^ { \mathrm { r e g } } ( \pmb { \theta } _ { t } ) = \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ( \pmb { \theta } _ { t } ) - \alpha \lambda ^ { \prime } \pmb { \theta } _ { t } .
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
SGD with weight decay has the following iterates on $f _ { t } ( \pmb \theta )$ :
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\pmb { \theta } _ { t + 1 } ( 1 - \lambda ) \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ( \pmb { \theta } _ { t } ) .
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
These iterates are identical since $\begin{array} { r } { \lambda ^ { \prime } = \frac { \lambda } { \alpha } } \end{array}$
|
| 255 |
+
|
| 256 |
+
# Proof of Proposition 2
|
| 257 |
+
|
| 258 |
+
Similarly to the Proof of Proposition 1, the iterates of $O$ without weight decay on $f _ { t } ^ { \mathrm { r e g } } ( { \pmb \theta } ) = f _ { t } ( { \pmb \theta } ) +$ $\begin{array} { r } { \frac { 1 } { 2 } \lambda ^ { \prime } \left. \pmb { \theta } \right. _ { 2 } ^ { 2 } } \end{array}$ and $O$ with weight decay $\lambda$ on $f _ { t }$ are, respectively:
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { l l l } { \pmb { \theta } _ { t + 1 } } & { } & { \pmb { \theta } _ { t } - \alpha \lambda ^ { \prime } \mathbf { M } _ { t } \pmb { \theta } _ { t } - \alpha \mathbf { M } _ { t } \nabla f _ { t } ( \pmb { \theta } _ { t } ) . } \\ { \pmb { \theta } _ { t + 1 } } & { } & { ( 1 - \lambda ) \pmb { \theta } _ { t } - \alpha \mathbf { M } _ { t } \nabla f _ { t } ( \pmb { \theta } _ { t } ) . } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
The equality of these iterates for all $\theta _ { t }$ would imply $\lambda \pmb { \theta } _ { t } = \alpha \lambda ^ { \prime } \mathbf { M } _ { t } \pmb { \theta } _ { t }$ . This can only hold for all $\theta _ { t }$ if $\mathbf { M } _ { t } = k \mathbf { I }$ , with $k \in \mathbb { R }$ , which is not the case for $O$ . Therefore, no $\mathrm { L _ { 2 } }$ regularizer $\lambda ^ { \prime } \left\| \pmb { \theta } \right\| _ { 2 } ^ { 2 }$ exists that makes the iterates equivalent. □
|
| 265 |
+
|
| 266 |
+
# Proof of Proposition 3
|
| 267 |
+
|
| 268 |
+
$O$ without weight decay has the following iterates on $\begin{array} { r } { f _ { t } ^ { \mathrm { s r e g } } ( \pmb { \theta } ) = f _ { t } ( \pmb { \theta } ) + \frac { \lambda ^ { \prime } } { 2 } \left\| \pmb { \theta } \odot \sqrt { s } \right\| _ { 2 } ^ { 2 } ; } \end{array}$
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\begin{array} { r c l } { \pmb { \theta } _ { t + 1 } } & { } & { \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ^ { \mathrm { s r e g } } ( \pmb { \theta } _ { t } ) / s } \\ & { = } & { \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ( \pmb { \theta } _ { t } ) / s - \alpha \lambda ^ { \prime } \pmb { \theta } _ { t } \odot s / s } \\ & { = } & { \pmb { \theta } _ { t } - \alpha \nabla f _ { t } ( \pmb { \theta } _ { t } ) / s - \alpha \lambda ^ { \prime } \pmb { \theta } _ { t } , } \end{array}
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
where the division by $\pmb { S }$ is element-wise. $O$ with weight decay has the following iterates on $f _ { t } ( \pmb \theta )$ :
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\begin{array} { r l r } { \pmb { \theta } _ { t + 1 } } & { } & { ( 1 - \lambda ) \pmb { \theta } _ { t } - \alpha \nabla f ( \pmb { \theta } _ { t } ) / s } \\ & { = } & { \pmb { \theta } _ { t } - \alpha \nabla f ( \pmb { \theta } _ { t } ) / s - \lambda \pmb { \theta } _ { t } , } \end{array}
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
These iterates are identical since $\begin{array} { r } { \lambda ^ { \prime } = \frac { \lambda } { \alpha } } \end{array}$ .
|
| 281 |
+
|
| 282 |
+
# B ADDITIONAL PRACTICAL IMPROVEMENTS OF ADAM
|
| 283 |
+
|
| 284 |
+
Having discussed decoupled weight decay for improving Adam’s generalization, in this section we introduce two additional components to improve Adam’s performance in practice.
|
| 285 |
+
|
| 286 |
+
# B.1 NORMALIZED WEIGHT DECAY
|
| 287 |
+
|
| 288 |
+
Our preliminary experiments showed that different weight decay factors are optimal for different computational budgets (defined in terms of the number of batch passes). Relatedly, Li et al. (2017) demonstrated that a smaller batch size (for the same total number of epochs) leads to the shrinking effect of weight decay being more pronounced. Here, we propose to reduce this dependence by normalizing the values of weight decay. Specifically, we replace the hyperparameter $\lambda$ by a new (more robust) normalized weight decay hyperparameter $\lambda _ { n o r m }$ , and use this to set $\lambda$ as $\begin{array} { r } { \lambda = \lambda _ { n o r m } \sqrt { \frac { b } { B T } } } \end{array}$ , where $b$ is the batch size, $B$ is the total number of training points and $T$ is the total number of epochs.2 Thus, $\lambda _ { n o r m }$ can be interpreted as the weight decay used if only one batch pass is allowed. We emphasize that our choice of normalization is merely one possibility informed by few experiments; a more lasting conclusion we draw is that using some normalization can substantially improve results.
|
| 289 |
+
|
| 290 |
+
# B.2 ADAM WITH COSINE ANNEALING AND WARM RESTARTS
|
| 291 |
+
|
| 292 |
+
We now apply cosine annealing and warm restarts to Adam, following the recent work of Loshchilov & Hutter (2016). There, the authors proposed Stochastic Gradient Descent with Warm Restarts (SGDR) to improve anytime performance of SGD by quickly cooling down the learning rate according to a cosine schedule and periodically increasing it. SGDR has been successfully adopted to lead to new state-of-the-art results for popular image classification benchmarks (Huang et al., 2017; Gastaldi, 2017; Zoph et al., 2017), and we therefore tried extending it to Adam. However, while our initial version of Adam with warm restarts had better anytime performance than Adam, it was not competitive with SGD with warm restarts, precisely because $\mathrm { L _ { 2 } }$ regularization was not working as well as in SGD. Now, having fixed this issue by means of the original weight decay regularization (Section 2) and also having introduced normalized weight decay (Section B.1), the original work on cosine annealing and warm restarts by Loshchilov & Hutter (2016) directly carries over to Adam.
|
| 293 |
+
|
| 294 |
+
In the interest of keeping the presentation self-contained, we briefly describe how SGDR schedules the change of the effective learning rate in order to accelerate the training of DNNs. Here, we decouple the initial learning rate $\alpha$ and its multiplier $\eta _ { t }$ used to obtain the actual learning rate at iteration $t$ (see, e.g., line 8 in Algorithm 1). In SGDR, we simulate a new warm-started run/restart of SGD once $T _ { i }$ epochs are performed, where $i$ is the index of the run. Importantly, the restarts are not performed from scratch but emulated by increasing $\eta _ { t }$ while the old value of $\theta _ { t }$ is used as an initial solution. The amount by which $\eta _ { t }$ is increased controls to which extent the previously acquired information (e.g., momentum) is used. Within the $i$ -th run, the value of $\eta _ { t }$ decays according to a cosine annealing (Loshchilov & Hutter, 2016) learning rate for each batch as follows:
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\eta _ { t } = \eta _ { m i n } ^ { ( i ) } + 0 . 5 ( \eta _ { m a x } ^ { ( i ) } - \eta _ { m i n } ^ { ( i ) } ) ( 1 + \cos ( \pi T _ { c u r } / T _ { i } ) ) ,
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
where η min and $\eta _ { m a x } ^ { ( i ) }$ are ranges for the multiplier and $T _ { c u r }$ accounts for how many epochs have been performed since the last restart. $T _ { c u r }$ is updated at each batch iteration $t$ and is thus not constrained to integer values. Adjusting (e.g., decreasing) $\eta _ { m i n } ^ { ( i ) }$ and $\eta _ { m a x } ^ { ( i ) }$ at every $i$ -th restart (see also Smith (2016)) could potentially improve performance, but we do not consider that option here because it would involve additional hyperparameters. For $\eta _ { m a x } ^ { ( i ) } = 1$ = 1 and η(i)min $\eta _ { m i n } ^ { ( i ) } = 0$ , one can simplify Eq. (14) to
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\eta _ { t } = 0 . 5 + 0 . 5 \cos ( \pi T _ { c u r } / T _ { i } ) .
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
In order to achieve good anytime performance, one can start with an initially small $T _ { i }$ (e.g., from $1 \%$ to $10 \%$ of the expected total budget) and multiply it by a factor of $T _ { m u l t }$ (e.g., $T _ { m u l t } = 2$ ) at every restart. The $( i + 1 )$ -th restart is triggered when $T _ { c u r } = T _ { i }$ by setting $T _ { c u r }$ to 0. An example setting of the schedule multiplier is given in C.
|
| 307 |
+
|
| 308 |
+
Our proposed AdamWR algorithm represents AdamW (see Algorithm 2) with $\eta _ { t }$ following Eq. (15) and $\lambda$ computed at each iteration using normalized weight decay described in the previous section. We note that normalized weight decay allowed us to use a constant parameter setting across short and long runs performed within AdamWR and SGDWR (SGDW with warm restarts).
|
| 309 |
+
|
| 310 |
+
# C AN EXAMPLE SETTING OF THE SCHEDULE MULTIPLIER
|
| 311 |
+
|
| 312 |
+
An example schedule of the schedule multiplier $\eta _ { t }$ is given in SuppFigure 1 for $T _ { i = 0 } = 1 0 0$ and $T _ { m u l t } = 2$ . After the initial 100 epochs the learning rate will reach 0 because $\eta _ { t = 1 0 0 } = 0$ . Then, since $T _ { c u r } = T _ { i = 0 }$ , we restart by resetting $T _ { c u r } = 0$ , causing the multiplier $\eta _ { t }$ to be reset to 1 due to Eq. (15). This multiplier will then decrease again from 1 to 0, but now over the course of 200 epochs because $T _ { i = 1 } = T _ { i = 0 } T _ { m u l t } = 2 0 0$ . Solutions obtained right before the restarts, when $\eta _ { t } = 0$ (e.g., at epoch indexes 100, 300, 700 and 1500 as shown in SuppFigure 1) are recommended by the optimizer as the solutions, with more recent solutions prioritized.
|
| 313 |
+
|
| 314 |
+
# D ADDITIONAL RESULTS
|
| 315 |
+
|
| 316 |
+
We investigated whether the use of much longer runs (1800 epochs) of “standard Adam” (Adam with $\mathrm { L _ { 2 } }$ regularization and a fixed learning rate) makes the use of cosine annealing unnecessary.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
SuppFigure 1: An example schedule of the learning rate multiplier as a function of epoch index. The first run is scheduled to converge at epoch $T _ { i = 0 } ~ = ~ 1 0 0$ , then the budget for the next run is doubled as $T _ { i = 1 } = T _ { i = 0 } T _ { m u l t } = 2 0 0$ , etc.
|
| 320 |
+
|
| 321 |
+
SuppFigure 2 shows the results of standard Adam for a 4 by 4 logarithmic grid of hyperparameter settings (the coarseness of the grid is due to the high computational expense of runs for 1800 epochs). Even after taking the low resolution of the grid into account, the results appear to be at best comparable to the ones obtained with AdamW with 18 times less epochs and a smaller network (see SuppFigure 3, top row, middle). These results are not very surprising given Figure 2 in the main paper (which demonstrates the effectiveness of AdamW) and SuppFigure 1 (which demonstrates the necessity to use some learning rate schedule such as cosine annealing).
|
| 322 |
+
|
| 323 |
+
Our experimental results with Adam and SGD suggested that the total runtime in terms of the number of epochs affect the basin of optimal hyperparameters (see SuppFigure 3). More specifically, the greater the total number of epochs the smaller the values of the weight decay should be. SuppFigure 4 shows that our remedy for this problem, the normalized weight decay defined in Eq. (15), simplifies hyperparameter selection because the optimal values observed for short runs are similar to the ones for much longer runs. We used our initial experiments on CIFAR-10 to suggest the square root normalization we proposed in Eq. (15) and double-checked that this is not a coincidence on the ImageNet32x32 dataset (Chrabaszcz et al., 2017), a downsampled version of the original ImageNet dataset with 1.2 million $3 2 \times 3 2$ pixels images, where an epoch is 24 times longer than on CIFAR-10. This experiment also supported the square root scaling: the best values of the normalized weight decay observed on CIFAR-10 represented nearly optimal values for ImageNet32x32 (see SuppFigure 3). In contrast, had we used the same raw weight decay values $\lambda$ for ImageNet32x32 as for CIFAR10 and for the same number of epochs, without the proposed normalization, $\lambda$ would have been roughly 5 times too large for ImageNe $3 2 x 3 2$ , leading to much worse performance. The optimal normalized weight decay values were also very similar (e.g., $\lambda _ { n o r m } = 0 . 0 2 5$ and $\lambda _ { n o r m } = 0 . 0 5 )$ ) across SGDW and AdamW.
|
| 324 |
+
|
| 325 |
+
SuppFigure 4 is the equivalent of Figure 3 in the main paper, but for ImageNet32x32 instead of for CIFAR-10. The qualitative results are identical: weight decay leads to better training loss (crossentropy) than $\mathrm { L _ { 2 } }$ regularization, and to an even greater improvement of test error.
|
| 326 |
+
|
| 327 |
+
SuppFigure 5 and SuppFigure 6 are the equivalents of Figure 4 in the main paper but supplemented with training loss curves in its bottom row. The results show that Adam and its variants with decoupled weight decay converge faster (in terms of training loss) on CIFAR-10 than the corresponding SGD variants (the difference for ImageNet32x32 is small). As is discussed in the main paper, when the same values of training loss are considered, AdamW demonstrates better values of test error than Adam. Interestingly, SuppFigure 5 and SuppFigure 6 show that restart variants AdamWR and SGDWR also demonstrate better generalization than AdamW and SGDW, respectively.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
SuppFigure 2: Performance of “standard Adam”: Adam with $\mathrm { L _ { 2 } }$ regularization and a fixed learning rate. We show the final test error of a $2 6 ~ 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet on CIFAR-10 after 1800 epochs of the original Adam for different settings of learning rate and weight decay used for $\mathrm { L _ { 2 } }$ regularization.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
SuppFigure 3: Effect of normalized weight decay. We show the final test Top-1 error on CIFAR10 (first two rows for AdamW without and with normalized weight decay) and Top-5 error on ImageNet32x32 (last two rows for AdamW and SGDW, both with normalized weight decay) of a $2 6 2 \mathrm { x } 6 4 \mathrm { d }$ ResNet after different numbers of epochs (see columns). While the optimal settings of the raw weight decay change significantly for different runtime budgets (see the first row), the values of the normalized weight decay remain very similar for different budgets (see the second row) and different datasets (here, CIFAR-10 and ImageNet32x32), and even across AdamW and SGDW.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
SuppFigure 4: Learning curves (top row) and generalization results (Top-5 errors in bottom row) obtained by a $2 6 2 \mathrm { x } 9 6 \mathrm { d }$ ResNet trained with Adam and AdamW on ImageNet32x32.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
SuppFigure 5: Test error curves (top row) and training loss curves (bottom row) for CIFAR-10.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
SuppFigure 6: Test error curves (top row) and training loss curves (bottom row) for ImageNet32x32.
|
md/train/ByxGSsR9FQ/ByxGSsR9FQ.md
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# $L _ { 2 }$ -NONEXPANSIVE NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Haifeng Qian & Mark N. Wegman
|
| 4 |
+
|
| 5 |
+
IBM Research Yorktown Heights, NY 10598, USA qianhaifeng,wegman@us.ibm.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
This paper proposes a class of well-conditioned neural networks in which a unit amount of change in the inputs causes at most a unit amount of change in the outputs or any of the internal layers. We develop the known methodology of controlling Lipschitz constants to realize its full potential in maximizing robustness, with a new regularization scheme for linear layers, new ways to adapt nonlinearities and a new loss function. With MNIST and CIFAR-10 classifiers, we demonstrate a number of advantages. Without needing any adversarial training, the proposed classifiers exceed the state of the art in robustness against white-box $L _ { 2 }$ -bounded adversarial attacks. They generalize better than ordinary networks from noisy data with partially random labels. Their outputs are quantitatively meaningful and indicate levels of confidence and generalization, among other desirable properties.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Artificial neural networks are often ill-conditioned systems in that a small change in the inputs can cause significant changes in the outputs (Szegedy et al., 2014). This results in poor robustness and vulnerability under adversarial attacks which has been reported on a variety of networks including image classification (Carlini & Wagner, $2 0 1 7 \mathrm { a }$ ; Goodfellow et al., 2014), speech recognition (Kreuk et al., 2018; Alzantot et al., 2018; Carlini & Wagner, 2018), image captioning (Chen et al., 2017) and natural language processing (Gao et al., 2018; Ebrahimi et al., 2017). These issues bring up both theoretical questions of how neural networks generalize (Kawaguchi et al., 2017; Xu & Mannor, 2012) and practical concerns of security in applications (Akhtar & Mian, 2018).
|
| 14 |
+
|
| 15 |
+
A number of remedies have been proposed for these issues and will be discussed in Section 4. Whitebox defense is particularly difficult and many proposals have failed. For example, Athalye et al. (2018) reported that out of eight recent defense works, only Madry et al. (2017) survived strong attacks. So far the mainstream and most successful remedy is that of adversarial training (Madry et al., 2017). However, as will be shown in Tables 1 and 2, the robustness by adversarial training diminishes when a white-box attacker (Carlini & Wagner, 2017a) is allowed to use more iterations.
|
| 16 |
+
|
| 17 |
+
This paper explores a different approach and demonstrates that a combination of the following three conditions results in enhanced robustness: 1) the Lipschitz constant of a network from inputs to logits is no greater than 1 with respect to the $L _ { 2 }$ -norm; 2) the loss function explicitly maximizes confidence gap, which is the difference between the largest and second largest logits of a classifier; 3) the network architecture restricts confidence gaps as little as possible. We will elaborate.
|
| 18 |
+
|
| 19 |
+
There are previous works that achieve the first condition (Cisse et al., 2017; Hein & Andriushchenko, 2017) or bound responses to input perturbations by other means (Kolter & Wong, 2017; Raghunathan et al., 2018; Haber & Ruthotto, 2017). For example, Parseval networks (Cisse et al., 2017) bound the Lipschitz constant by requiring each linear or convolution layer be composed of orthonormal filters. However, the reported robustness and guarantees are often under weak attacks or with low noise magnitude, and none of these works has demonstrated results that are comparable to adversarial training.
|
| 20 |
+
|
| 21 |
+
In contrast, we are able to build MNIST and CIFAR-10 classifiers, without needing any adversarial training, that exceed the state of the art (Madry et al., 2017) in robustness against white-box $L _ { 2 }$ - bounded adversarial attacks. The defense is even stronger if adversarial training is added. We will refer to these networks as $L _ { 2 }$ -nonexpansive neural networks (L2NNNs). Our advantage comes from a set of new techniques: our weight regularization, which is key in enforcing the first condition, allows greater degrees of freedom in parameter training than the scheme in Cisse et al. (2017); a new loss function is specially designed for the second condition; we adapt various layers in new ways for the third condition, for example norm-pooling and two-sided ReLU, which will be presented later.
|
| 22 |
+
|
| 23 |
+
Let us begin with intuitions behind the second and third conditions. Consider a multi-class classifier. Let $g \left( \mathbf { x } \right)$ denote its confidence gap for an input data point $\mathbf { x }$ . If the classifier is a single L2NNN,1 we have a guarantee2 that the classifier will not change its answer as long as the input $\mathbf { x }$ is modified by no more than an $L _ { 2 }$ -norm of $g \left( \mathbf { x } \right) / \sqrt { 2 }$ . Therefore maximizing the average confidence gap directly boosts robustness and this motivates the second condition. To explain the third condition, let us introduce the notion of preserving distance: the distance between any pair of input vectors with two different labels ought to be preserved as much as possible at the outputs, while we do not care about the distance between a pair with the same label. Let $d \left( \mathbf { x _ { 1 } } , \mathbf { x _ { 2 } } \right)$ denote the $L _ { 2 }$ -distance between the output logit-vectors for two input points $\mathbf { x _ { 1 } }$ and $\mathbf { x _ { 2 } }$ that have different labels and that are classified correctly. It is straightforward to verify the condition3 of $g \left( \mathbf { x _ { 1 } } \right) + g \left( \mathbf { x _ { 2 } } \right) \leq { \sqrt { 2 } } \cdot d \left( \mathbf { x _ { 1 } } , \mathbf { x _ { 2 } } \right)$ . Therefore a network that maximizes confidence gaps well must be one that preserves distance well. Ultimately some distances are preserved while others are lost, and ideally the decision of which distance to lose is made by parameter training rather than by artifacts of network architecture. Hence the third condition involves distance-preserving architecture choices that leave the decision to parameter training as much as possible, and this motivates many of our design decisions such as Sections 2.2 and 2.3.
|
| 24 |
+
|
| 25 |
+
In practice we employ the strategy of divide and conquer and build each layer as a nonexpansive map with respect to the $L _ { 2 }$ -norm. It is straightforward to see that a feedforward network composed of nonexpansive layers must implement a nonexpansive map overall. How to adapt subtleties like recursion and splitting-reconvergence is included in the appendix.
|
| 26 |
+
|
| 27 |
+
Besides being robust against adversarial noises, L2NNNs have other desirable properties. They generalize better from noisy training labels than ordinary networks: for example, when $7 5 \%$ of MNIST training labels are randomized, an L2NNN still achieves $9 3 . 1 \%$ accuracy on the test set, in contrast to $7 5 . 2 \%$ from the best ordinary network. The problem of exploding gradients, which is common in training ordinary networks, is avoided because the gradient of any output with respect to any internal signal is bounded between -1 and 1. Unlike ordinary networks, the confidence gap of an L2NNN classifier is a quantitatively meaningful indication of confidence on individual data points, and the average gap is an indication of generalization.
|
| 28 |
+
|
| 29 |
+
# 2 $L _ { 2 }$ -NONEXPANSIVE NEURAL NETWORKS
|
| 30 |
+
|
| 31 |
+
This section describes how to adapt some individual operators in neural networks for L2NNNs.
|
| 32 |
+
Discussions on splitting-reconvergence, recursion and normalization are in the appendix.
|
| 33 |
+
|
| 34 |
+
# 2.1 WEIGHTS
|
| 35 |
+
|
| 36 |
+
This section covers both the matrix-vector multiplication in a fully connected layer and the convolution calculation between input tensor and weight tensor in a convolution layer. The convolution calculation can be viewed as a set of vector-matrix multiplications: we make shifted copies of the input tensor and shuffle the copies into a set of small vectors such that each vector contains input entries in one tile; we reshape the weight tensor into a matrix by flattening all but the dimension of the output filters; then convolution is equivalent to multiplying each of the said small vectors with the flattened weight matrix. Therefore, in both cases, a basic operator is $\mathbf { y } = W \mathbf { x }$ . To be a nonexpansive map with respect to the $L _ { 2 }$ -norm, a necessary and sufficient condition is
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r c l } { \mathbf { y } ^ { \mathrm { T } } \mathbf { y } \leq \mathbf { x } ^ { \mathrm { T } } \mathbf { x } } & { \implies } & { \mathbf { x } ^ { \mathrm { T } } W ^ { \mathrm { T } } W \mathbf { x } \leq \mathbf { x } ^ { \mathrm { T } } \mathbf { x } , \quad \forall \mathbf { x } \in \mathbb { R } ^ { N } } \\ & & { \rho \left( W ^ { \mathrm { T } } W \right) \leq 1 } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $\rho$ denotes the spectral radius of a matrix.
|
| 43 |
+
|
| 44 |
+
The exact condition of (1) is difficult to incorporate into training. Instead we use an upper bound:4
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\rho \left( W ^ { \mathrm { T } } W \right) \leq b \left( W \right) \triangleq \operatorname* { m i n } \left( r ( W ^ { \mathrm { T } } W ) , r ( W W ^ { \mathrm { T } } ) \right) , \quad \mathrm { w h e r e } \ r \left( M \right) = \operatorname* { m a x } _ { i } \sum _ { j } \left| M _ { i , j } \right| \leq r \leq M .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
The above is where our linear and convolution layers differ from those in Cisse et al. (2017): they require $W W ^ { \mathrm { T } }$ to be an identity matrix, and it is straightforward to see that their scheme is only one special case that makes $b \left( W \right)$ equal to 1. Instead of forcing filters to be orthogonal to each other, our bound of $b \left( W \right)$ provides parameter training with greater degrees of freedom.
|
| 51 |
+
|
| 52 |
+
One simple way to use (2) is replacing $W$ with $W ^ { \prime } = W / \sqrt { b \left( W \right) }$ in weight multiplications, and this would enforce that the layer is strictly nonexpansive. Another method is described in the appendix.
|
| 53 |
+
|
| 54 |
+
As mentioned, convolution can be viewed as a first layer of making copies and a second layer of vector-matrix multiplications. With the above regularization, the multiplication layer is nonexpansive. Hence we only need to ensure that the copying layer is nonexpansive. For filter size of $K _ { 1 }$ by $K _ { 2 }$ and strides of $S _ { 1 }$ by $S _ { 2 }$ , we simply divide the input tensor by a factor of $\sqrt { \lceil K _ { 1 } / S _ { 1 } \rceil \cdot \lceil K _ { 2 } / S _ { 2 } \rceil }$ .
|
| 55 |
+
|
| 56 |
+
# 2.2 RELU AND OTHERS
|
| 57 |
+
|
| 58 |
+
Let us turn our attention to the third condition from Section 1. ReLU, tanh and sigmoid are nonexpansive but do not preserve distance well. This section presents a method that improves ReLU and is generalizable to other nonlinearities. A different approach to improve sigmoid is in the appendix.
|
| 59 |
+
|
| 60 |
+
To understand the weakness of ReLU, let us consider two input data points A and B, and suppose that a ReLU in the network receives two different negative values for A and B and outputs zero for both. Comparing the A-B distance before and after this ReLU layer, there is a distance loss and this particular ReLU contributes to it. We use two-sided ReLU which is a function from $\mathbb { R }$ to $\mathbb { R } ^ { 2 }$ and simply computes $\scriptstyle { \mathrm { R e L U } } ( x )$ and $\mathrm { R e L U } ( - x )$ . Two-sided ReLU has been studied in Shang et al. (2016) in convolution layers for accuracy improvement. It is straightforward to verify that two-sided ReLU is nonexpansive with respect to any $L _ { p }$ -norm and that it preserves distance in the above scenario. We will empirically verify its effectiveness in increasing confidence gaps in Section 3.
|
| 61 |
+
|
| 62 |
+
Two-sided ReLU is a special case of the following general technique. Let $f ( x )$ be a nonexpansive and monotonically increasing scalar function, and note that ReLU, tanh and sigmoid all fit these conditions. We can define a function from $\mathbb { R }$ to $\mathbb { R } ^ { 2 }$ that computes $f ( x )$ and ${ \bar { f } } ( x ) - x$ . Such a new function is nonexpansive with respect to any $L _ { p }$ -norm5 and preserves distance better than $f ( x )$ alone.
|
| 63 |
+
|
| 64 |
+
# 2.3 POOLING
|
| 65 |
+
|
| 66 |
+
The popular max-pooling is nonexpansive, but does not preserve distance as much as possible. Consider a scenario where the inputs to pooling are activations that represent edge detection, and consider two images A and B such that A contains an edge that passes a particular pooling window while B does not. Inside this window, A has positive values while B has all zeroes. For this window, the A-B distance before pooling is the $L _ { 2 }$ -norm of A’s values, yet if max-pooling is used, the A-B distance after pooling becomes the largest of A’s values, which can be substantially smaller than the former. Thus we suffer a loss of distance between A and B while passing this pooling layer.
|
| 67 |
+
|
| 68 |
+
We replace max-pooling with norm-pooling, which was reported in Boureau et al. (2010) to occasionally increase accuracy. Instead of taking the max of values inside a pooling window, we take the $L _ { 2 }$ -norm of them. It is straightforward to verify that norm-pooling is nonexpansive6 and would entirely preserve the $L _ { 2 }$ -distance between A and B in the hypothetical scenario above. Other $L _ { p }$ -norms can also be used. We will verify its effectiveness in increasing confidence gaps in Section 3.
|
| 69 |
+
|
| 70 |
+
If pooling windows overlap, we divide the input tensor by $\sqrt { K }$ where $K$ is the maximum number of pooling windows in which an entry can appear, similar to convolution layers discussed earlier.
|
| 71 |
+
|
| 72 |
+
# 2.4 LOSS FUNCTION
|
| 73 |
+
|
| 74 |
+
For a classifier with $K$ labels, we recommend building it as $K$ overlapping L2NNNs, each of which outputs a single logit for one label. In an architecture with no split layers, this simply implies that these $K$ L2NNNs share all but the last linear layer and that the last linear layer is decomposed into $K$ single-output linear filters, one in each L2NNN. For a multi-L2NNN classifier, we have a guarantee7 that the classifier will not change its answer as long as the input $\mathbf { x }$ is modified by no more than an $L _ { 2 }$ -norm of $g \left( \mathbf { x } \right) / 2$ , where again $g \left( \mathbf { x } \right)$ denotes the confidence gap. As mentioned in Section 1, a single-L2NNN classifier has a guarantee of $g \left( \mathbf { x } \right) / \sqrt { 2 }$ . Although this seems better on the surface, it is more difficult to achieve large confidence gaps. We will assume the multi-L2NNN approach.
|
| 75 |
+
|
| 76 |
+
We use a loss function with three terms, with trade-off hyperparameters $\gamma$ and $\omega$
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mathcal { L } = \mathcal { L } _ { a } + \gamma \cdot \mathcal { L } _ { b } + \omega \cdot \mathcal { L } _ { c }
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Let $y _ { 1 } , y _ { 2 } , \cdots , y _ { K }$ be outputs from the L2NNNs. The first loss term is
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathcal { L } _ { a } = \mathrm { s o f t m a x - c r o s s - e n t r o p y } \left( u _ { 1 } y _ { 1 } , u _ { 2 } y _ { 2 } , \cdot \cdot \cdot , u _ { K } y _ { K } , \mathrm { l a b e l } \right)
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $u _ { 1 } , u _ { 2 } , \cdots , u _ { K }$ are trainable parameters. The second loss term is
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathcal { L } _ { b } = \operatorname { s o f t m a x - c r o s s - e n t r o p y } \left( v y _ { 1 } , v y _ { 2 } , \cdot \cdot \cdot , v y _ { K } , \mathrm { l a b e l } \right)
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $v$ can be either a trainable parameter or a hyperparameter. Note that $u _ { 1 } , u _ { 2 } , \cdots , u _ { K }$ and $v$ are not part of the classifier and are not used during inference. The third loss term is
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } _ { c } = \frac { \mathrm { a v e r a g e } \left( \log \left( 1 - \mathrm { s o f t m a x } \left( z y _ { 1 } , z y _ { 2 } , \cdot \cdot \cdot , z y _ { K } \right) _ { \mathrm { l a b e l } } \right) \right) } { z }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $z$ is a hyperparameter.
|
| 101 |
+
|
| 102 |
+
The rationale for the first loss term (4) is that it mimics cross-entropy loss of an ordinary network. If an ordinary network has been converted to L2NNNs by multiplying each layer with a small constant, its original outputs can be recovered by scaling up L2NNN outputs with certain constants, which is enabled by the formula (4). Hence this loss term is meant to guide the training process to discover any feature that an ordinary network can discover. The rationale for the second loss term (5) is that it is directly related to the classification accuracy. Multiplying L2NNN outputs uniformly with $v$ does not change the output label and only adapts to the value range of L2NNN outputs and drive towards better nominal accuracy. The third loss term (6) approximates average confidence gap: the log term is a soft measure of a confidence gap (for a correct prediction), and is asymptotically linear for larger gap values. The hyperparameter $z$ controls the degree of softness, and has relatively low impact on the magnitude of loss due to the division by $z$ ; if we increase $z$ then (6) asymptotically becomes the average of minus confidence gaps for correct predictions and zeroes for incorrect predictions. Therefore loss (6) encourages large confidence gaps and yet is smooth and differentiable.
|
| 103 |
+
|
| 104 |
+
A notable variation of (3) is one that combines with adversarial training. Our implementation applies the technique of Madry et al. (2017) on the first loss term (4): we use distorted inputs in calculating ${ \mathcal { L } } _ { a }$ . The results are reported in Tables 1 and 2 as Model 4. Another possibility is to use distorted inputs in calculating $\mathcal { L } _ { a }$ and $\mathcal { L } _ { b }$ , while $\mathcal { L } _ { c }$ should be based on original inputs.
|
| 105 |
+
|
| 106 |
+
# 3 EXPERIMENTS
|
| 107 |
+
|
| 108 |
+
Experiments are divided into three groups to study different properties of L2NNNs. Our MNIST
|
| 109 |
+
and CIFAR-10 classifiers are available at
|
| 110 |
+
http://researcher.watson.ibm.com/group/9298
|
| 111 |
+
|
| 112 |
+
# 3.1 ROBUSTNESS
|
| 113 |
+
|
| 114 |
+
This section evaluates robustness of L2NNN classifiers for MNIST and CIFAR-10 and compares against the state of the art Madry et al. (2017). The robustness metric is accuracy under whitebox non-targeted $L _ { 2 }$ -bounded attacks. The attack code of Carlini & Wagner (2017a) is used. We downloaded the classifiers8 of Madry et al. (2017) and report their robustness against $L _ { 2 }$ -bounded attacks in Tables 1 and 2.9 Note that their defense diminishes as the attacks are allowed more iterations. Figure 1 illustrates one example of this effect: the first image is an attack on MNIST Model 2 (0 recognized as 5) found after 1K iterations, with noise $L _ { 2 }$ -norm of 4.4, while the second picture is one found after 10K iterations, the same 0 recognized as 5, with noise $L _ { 2 }$ -norm of 2.1. We hypothesize that adversarial training alone provides little absolute defense at the noise levels used in the two tables: adversarial examples still exist and are only more difficult to find. The fact that in Table 2 Model 2 accuracy is lower in the $1 0 0 0 \mathrm { x } 1 0$ row than the 10K row further supports our hypothesis.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 1: Attacks on Model 2 found after 1K and 10K iterations: the same 0 recognized as 5.
|
| 118 |
+
|
| 119 |
+
Table 1: Accuracies of MNIST classifiers under white-box non-targeted attacks with noise $L _ { 2 }$ -norm limit of 3. MaxIter is the max number of iterations the attacker uses. Model 1 is an ordinarily trained model. Model 2 is the model from Madry et al. (2017). Model 3 is L2NNN without adversarial training. Model 4 is L2NNN with adversarial training.
|
| 120 |
+
|
| 121 |
+
<table><tr><td>MaxIter</td><td>Model1</td><td>Model2</td><td>Model3</td><td>Model4</td></tr><tr><td>Natural</td><td>99.1%</td><td>98.5%</td><td>98.7%</td><td>98.2%</td></tr><tr><td>100</td><td>70.2%</td><td>91.7%</td><td>77.6%</td><td>75.6%</td></tr><tr><td>1000</td><td>0.05%</td><td>51.5%</td><td>20.3%</td><td>24.4%</td></tr><tr><td>10K</td><td>0%</td><td>16.0%</td><td>20.1%</td><td>24.4%</td></tr><tr><td>100K</td><td>0%</td><td>9.8%</td><td>20.1%</td><td>24.4%</td></tr><tr><td>1M</td><td>0%</td><td>7.6%</td><td>20.1%</td><td>24.4%</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 2: Accuracies of CIFAR-10 classifiers under white-box non-targeted attacks with noise $L _ { 2 }$ - norm limit of 1.5. MaxIter is the max number of iterations the attacker uses, and $1 0 0 0 \mathrm { x } 1 0$ indicates 10 runs each with 1000 iterations. Model 1 is an ordinarily network. Model 2 is the model from Madry et al. (2017). Model 3 is L2NNN without adversarial training. Model 4 is L2NNN with adversarial training.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>MaxIter</td><td>Model1</td><td>Model2</td><td>Model3</td><td>Model4</td></tr><tr><td>Natural</td><td>95.0%</td><td>87.1%</td><td>79.2%</td><td>77.2%</td></tr><tr><td>100</td><td>0%</td><td>13.9%</td><td>10.2%</td><td>20.8%</td></tr><tr><td>1000</td><td>0%</td><td>9.4%</td><td>10.1%</td><td>20.4%</td></tr><tr><td>10K</td><td>0%</td><td>9.0%</td><td>10.1%</td><td>20.4%</td></tr><tr><td>1000x10</td><td>0%</td><td>8.7%</td><td>10.1%</td><td>20.4%</td></tr><tr><td>100K</td><td>0%</td><td>NA</td><td>10.1%</td><td>20.4%</td></tr></table>
|
| 126 |
+
|
| 127 |
+
In contrast, the defense of the L2NNN models remain constant when the attacks are allowed more iterations, specifically MNIST Models beyond 10K iterations and CIFAR-10 Models beyond 1000 iterations. The reason is that L2NNN classifiers achieve their defense by creating a confidence gap between the largest logit and the rest, and that half of this gap is a lower bound of $L _ { 2 }$ -norm of distortion to the input data in order to change the classification. Hence L2NNN’s defense comes from a minimum-distortion guarantee. Although adversarial training alone may also increase the minimum distortion limit for misclassification, as suggested in Carlini et al. (2017) for a small network, that limit likely does not reach the levels used in Tables 1 and 2 and hence the defense depends on how likely the attacker can reach a lower-distortion misclassification. Consequently when the attacks are allowed to make more attempts the defense with guarantee stands while the other diminishes.
|
| 128 |
+
|
| 129 |
+
For both MNIST and CIFAR-10, adding adversarial training boosts the robustness of Model 4. We hypothesize that adversarial training lowers local Lipschitz constants in certain parts of the input space, specifically around the training images, and therefore makes local robustness guarantees larger (Hein & Andriushchenko, 2017). To test this hypothesis on MNIST Models 3 and 4, we measure the average $L _ { 2 }$ -norm of their Jacobian matrices, averaged over the first 1000 images in the test set, and the results are 1.05 for Model 3 and 0.83 for Model 4. Note that the $L _ { 2 }$ -norm of Jacobian can be greater than 1 for multi-L2NNN classifiers. These measurements are consistent with, albeit does not prove, the hypothesis.
|
| 130 |
+
|
| 131 |
+
Table 3: Ablation studies: MNIST model without weight regularization; one without $\mathcal { L } _ { c }$ loss; one with max-pooling instead of norm-pooling; one without two-sided ReLU; Gap is average confidence gap. R-Accu is under attacks with 1000 iterations and with noise $L _ { 2 }$ -norm limit of 3.
|
| 132 |
+
|
| 133 |
+
<table><tr><td></td><td>Accu.</td><td>Gap</td><td>R-Accu.</td></tr><tr><td> no weight reg.</td><td>99.4%</td><td>68.3</td><td>0%</td></tr><tr><td>no Lc loss</td><td>99.2%</td><td>2.2</td><td>8.9%</td></tr><tr><td>no norm-pooling</td><td>98.8%</td><td>1.3</td><td>9.9%</td></tr><tr><td>no two-sided ReLU</td><td>98.0%</td><td>2.5</td><td>15.1%</td></tr></table>
|
| 134 |
+
|
| 135 |
+
To test the effects of various components of our method, we build models for each of which we disable a different technique during training. The results are reported in Table 3. To put the confidence gap values in context, our MNIST Model 3 has an average gap of 2.8. The first one is without weight regularization of Section 2.1 and it becomes an ordinary network which has little defense against adversarial attacks; its large average confidence gap is meaningless. For the second one we remove the third loss term (6) and for the third one we replace norm-pooling with regular max-pooling, both resulting in smaller average confidence gap and less defense against attacks. For the fourth one, we replace two-sided ReLU with regular ReLU, and this leads to degradation in nominal accuracy, average confidence gap and robustness. Parseval networks (Cisse et al., 2017) can be viewed as models without $\mathcal { L } _ { c }$ term, norm-pooling or two-sided ReLU, and with a more restrictive scheme for weight matrix regularization.
|
| 136 |
+
|
| 137 |
+
Model 3 in Table 1 and the second row of Table 3 are two points along a trade-off curve that are controllable by varying hyperparameter $\omega$ in loss function (3). Other trade-off points have nominal accuracy and under-attack accuracy of $( 9 8 . 8 \% , 1 9 . 1 \% )$ , $( 9 8 . 4 \% , 2 2 . 6 \% )$ ) and $( 9 7 . 9 \% , 2 4 . 7 \% )$ respectively. Similar trade-offs have been reported by other robustness works including adversarial training (Tsipras et al., 2019) and adversarial polytope (Wong et al., 2018). It remains an open question whether such trade-off is a necessary part of life, and please see Section 3.3 for further discussion on the L2NNN trade-off.
|
| 138 |
+
|
| 139 |
+
Table 4: Accuracy of L2NNN classifiers under white-box non-targeted attacks with 1000 iterations and with noise $L _ { \infty }$ -norm limit of $\epsilon$ .
|
| 140 |
+
|
| 141 |
+
<table><tr><td></td><td>E</td><td>Model3</td><td>Model4</td></tr><tr><td>MNIST</td><td>0.1</td><td>90.9%</td><td>92.4%</td></tr><tr><td>MNIST</td><td>0.3</td><td>7.0%</td><td>44.0%</td></tr><tr><td>CIFAR-10</td><td>8/256</td><td>32.3%</td><td>42.5%</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Although we primarily focus on defending against $L _ { 2 }$ -bounded adversarial attacks in this work, we achieve some level of robustness against $L _ { \infty }$ -bounded attacks as a by-product. Table 4 shows our results, again measured with the attack code of Carlini & Wagner (2017a). The $\epsilon$ values match those used in Raghunathan et al. (2018); Kolter & Wong (2017); Madry et al. (2017). Our MNIST $L _ { \infty }$ results are on par with Raghunathan et al. (2018); Kolter & Wong (2017) but not as good as Madry et al. (2017). Our CIFAR-10 Model 4 is on par with Madry et al. (2017) for $L _ { \infty }$ defense.
|
| 144 |
+
|
| 145 |
+
# 3.2 MEANINGFUL OUTPUTS
|
| 146 |
+
|
| 147 |
+
This section discusses how to understand and utilize L2NNNs’ output values. We observe strong correlation between the confidence gap of L2NNN and the magnitude of distortion needed to force it to misclassify, and images are included in appendix.
|
| 148 |
+
|
| 149 |
+
In the next experiment, we sort test data by the confidence gap of a classifier on each image. Then we divide the sorted data into 10 bins and report accuracy separately on each bin in Figure 2. We repeat this experiment for Model 2 (Madry et al., 2017) and our Model 3 of Tables 1 and 2. Note that the L2NNN model shows better correlation between confidence and robustness: for MNIST our first bin is $9 5 \%$ robust and second bin is $6 7 \%$ robust. This indicates that the L2NNN outputs are much more quantitatively meaningful than those of ordinary neural networks.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 2: Accuracy percentages of classifiers on test data bin-sorted by the confidence gap.
|
| 153 |
+
|
| 154 |
+
It is an important property that an L2NNN has an easily accessible measurement on how robust its decisions are. Since robustness is easily measurable, it can be optimized directly, and we believe that this is the primary reason that we can demonstrate the robustness results of Tables 1 and 2. This can also be valuable in real-life applications where we need to quantify how reliable a decision is.
|
| 155 |
+
|
| 156 |
+
One of the other practical implications of this property is that we can form hybrid models which use L2NNN outputs when the confidence is high and a different model when the confidence of the L2NNN is low. This creates another dimension of trade-off between nominal accuracy and robustness that one can take advantage of in an application. We built such a hybrid model for MNIST with the switch threshold of 1.0 and achieved nominal accuracy of $9 9 . 3 \%$ , where only $6 . 9 \%$ of images were delegated to the alternative classifier. We built such a hybrid model for CIFAR-10 with the switch threshold of 0.1 and achieved nominal accuracy of $8 9 . 4 \%$ , where $2 5 \%$ of images were delegated. To put these threshold values in context, MNIST Model 3 has an average gap of 2.8 and CIFAR-10 Model 3 has an average gap of 0.34. In other words, if for a data point the L2NNN confidence gap is substantially below average, the classification is delegated to the alternative classifier, and this way we can recover nominal accuracy at a moderate cost of robustness.
|
| 157 |
+
|
| 158 |
+
# 3.3 GENERALIZATION VERSUS MEMORIZATION
|
| 159 |
+
|
| 160 |
+
This section studies L2NNN’s generalization through a noisy-data experiment where we randomize some or all MNIST training labels. The setup is similar to Zhang et al. (2017), except that we added three scenarios where $2 5 \%$ , $5 0 \%$ and $7 5 \%$ of training labels are scrambled.
|
| 161 |
+
|
| 162 |
+
Table 5 shows the comparison between L2NNNs and ordinary networks. Dropout rate and weightdecay weight are tuned for each WD/DR run, and each $\mathrm { W D + D R + E S }$ run uses the combined hyperparameters from its row. In early-stopping runs, 5000 training images are withheld as validation set and training stops when loss on validation set stops decreasing. The L2NNNs do not use weight decay, dropout or early stopping. L2NNNs achieve the best accuracy in all three partially-scrambled scenarios, and it is remarkable that an L2NNN can deliver $9 3 . 1 \%$ accuracy on test set when three quarters of training labels are random. More detailed data and discussions are in the appendix.
|
| 163 |
+
|
| 164 |
+
Table 5: Accuracy comparison of MNIST classifiers that are trained on noisy data. Rand is the percentage of training labels that are randomized. WD is weight decay. DR is dropout. ES is early stopping. Gap1 is L2NNN’s average confidence gap on training set and Gap2 is that on test set.
|
| 165 |
+
|
| 166 |
+
<table><tr><td rowspan="2">Rand</td><td colspan="5">Ordinary network</td><td colspan="3">L2NNN</td></tr><tr><td>Vanilla</td><td>WD</td><td>DR</td><td>ES</td><td>WD+DR+ES</td><td></td><td>Gap1</td><td>Gap2</td></tr><tr><td>0</td><td>99.4%</td><td>99.0%</td><td>99.2%</td><td>99.0%</td><td>99.3%</td><td>98.7%</td><td>2.84</td><td>2.82</td></tr><tr><td>25%</td><td>90.4%</td><td>91.1%</td><td>91.8%</td><td>96.2%</td><td>98.0%</td><td>98.5%</td><td>0.64</td><td>0.63</td></tr><tr><td>50%</td><td>65.5%</td><td>67.7%</td><td>72.6%</td><td>81.0%</td><td>88.3%</td><td>96.0%</td><td>0.58</td><td>0.60</td></tr><tr><td>75%</td><td>41.5%</td><td>44.9%</td><td>41.8%</td><td>75.2%</td><td>66.4%</td><td>93.1%</td><td>0.86</td><td>0.89</td></tr><tr><td>100%</td><td>9.7%</td><td>9.1%</td><td>9.4%</td><td>NA</td><td>NA</td><td>11.9%</td><td>0.09</td><td>0.01</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 6: Training-accuracy-versus-confidence-gap trade-off points of L2NNNs on $5 0 \%$ -scrambled MNIST training labels.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>on training set Accu.</td><td>Gap</td><td>on test set Accu. Gap</td></tr><tr><td>98.7%</td><td>0.17</td><td>79.0% 0.12</td></tr><tr><td>96.5%</td><td>0.21</td><td>79.3% 0.18</td></tr><tr><td>89.4%</td><td>0.22</td><td>86.3% 0.20</td></tr><tr><td>70.1%</td><td>0.36</td><td>93.4% 0.37</td></tr><tr><td>66.1%</td><td>0.45</td><td>93.7% 0.47</td></tr><tr><td>59.8%</td><td>0.58</td><td>96.0% 0.60</td></tr></table>
|
| 171 |
+
|
| 172 |
+
To illustrate why L2NNNs generalize better than ordinary networks from noisy data, we show in Table 6 trade-off points between accuracy and confidence gap on the $5 0 \%$ -scrambled training set. These trade-off points are achieved by changing hyperparameters $\omega$ in (3) and $v$ in (5). In a noisy training set, there exist data points that are close to each other yet have different labels. For a pair of such points, if an L2NNN is to classify both points correctly, the two confidence gaps must be small. Therefore, in order to achieve large average confidence gap, an L2NNN must misclassify some of the training data. In Table 6, as we adjust the loss function to favor larger average gap, the L2NNNs are forced to make more and more mistakes on the training set. The results suggest that loss is minimized when an L2NNN misclassifies some of the scrambled labels while fitting the $5 0 \%$ original labels with large gaps, and parameter training discovers this trade-off automatically. Hence we see in Table 6 increasing accuracies and gaps on the test set. The above is a trade-off between memorization (training-set accuracy) and generalization (training-set average gap), and we hypothesize that L2NNN’s trade-off between nominal accuracy and robustness, reported in Section 3.1, is due to the same mechanism. To be fair, dropout and early stopping are also able to sacrifice accuracy on a noisy training set, however they do so through different mechanisms that tend to be brittle, and Table 5 suggests that L2NNN’s mechanism is superior. More discussions and the trade-off tables for $2 5 \%$ and $7 5 \%$ scenarios are in the appendix.
|
| 173 |
+
|
| 174 |
+
Another interesting observation is that the average confidence gap dramatically shrinks in the last row of Table 5 where the training is pure memorization. This is not surprising again due to training data points that are close to each other yet have different labels. The practical implication is that after an L2NNN model is trained, one can simply measure its average confidence gap to know whether and how much it has learned to generalize rather than to memorize the training data.
|
| 175 |
+
|
| 176 |
+
# 4 RELATED WORK
|
| 177 |
+
|
| 178 |
+
Adversarial defense is a well-known difficult problem (Szegedy et al., 2014; Goodfellow et al., 2014; Carlini & Wagner, 2017a; Athalye et al., 2018; Gilmer et al., 2018). There are many avenues to defense (Carlini & Wagner, 2017b; Meng & Chen, 2017), and here we will focus on defense works that fortify a neural network itself instead of introducing additional components.
|
| 179 |
+
|
| 180 |
+
The mainstream approach has been adversarial training, where examples of successful attacks on a classifier itself are used in training (Tramer et al., 2017; Zantedeschi et al., 2017). The work of \` Madry et al. (2017) has the best results to date and effectively flattens gradients around training data points, and, prior to our work, it is the only work that achieves sizable white-box defense. It has been reported in Carlini et al. (2017) that, for a small network, adversarial training indeed increases the average minimum $L _ { 1 }$ -norm and $L _ { \infty }$ -norm of noise needed to change its classification. However, in view of results of Tables 1 and 2, adversarial-training results may be susceptible to strong attacks. The works of Drucker & Le Cun (1992); Ross & Doshi-Velez (2017) are similar to adversarial training in aiming to flatten gradients around training data set but use different mechanisms.
|
| 181 |
+
|
| 182 |
+
While the above approaches fortify a network around training data points, others aim to bound a network’s responses to input perturbations over the entire input space. For example, Haber & Ruthotto (2017) models ResNet as an ordinary differential equation and derive stability conditions. Other examples include Kolter & Wong (2017); Raghunathan et al. (2018); Wong et al. (2018) which achieved provable guarantees against $L _ { \infty }$ -bounded attacks. However there exist scalability issues with respect to network depth, and the reported results so far are against relatively weak attacks or low noise magnitude. As shown in Table 4, we can match their measured $L _ { \infty }$ -bounded defense.
|
| 183 |
+
|
| 184 |
+
Controlling Lipschitz constants also regularizes a network over the entire input space. Szegedy et al. (2014) is the seminal work that brings attention to this topic. Bartlett et al. (2017) proposes the notion of spectrally-normalized margins as an indicator of generalization, which are strongly related to our confidence gap. Pascanu et al. (2013) studies the role of the spectral radius of weight matrices in the vanishing and the exploding gradient problems. Yoshida & Miyato (2017) proposes a method to regularize the spectral radius of weight matrices and shows its effect in reducing generalization gap. The work on Parseval networks (Cisse et al., 2017) shows that it is possible to control Lipschitz constants of neural networks through regularization. The core of their work is to constrain linear and convolution layer weights to be composed of Parseval tight frames, i.e., orthonormal filters, and thereby force the Lipschitz constant of these layers to be 1; they also propose to restrict aggregation operations. The reported robustness results of Cisse et al. (2017), however, are much weaker than those by adversarial training in Madry et al. (2017). We differ from Parseval networks in a number of ways. Our linear and convolution layers do not require filters to be orthogonal to each other and subsume Parseval layers as a special case, and therefore provide more freedom to parameter training. We use non-standard techniques, e.g. two-sided ReLU, to modify various network components to maximize confidence gaps while keeping the network nonexpansive, and we propose a new loss function for the same purpose. We are unable to obtain Parseval networks for a direct comparison, however it is possible to get a rough idea of what the comparison might be by looking at Table 3 which shows the impacts of those new techniques. The work of Hein & Andriushchenko (2017) makes an important point regarding guarantees provided by local Lipschitz constants, which helps explain many observations in our results, including why adversarial training on L2NNNs leads to lasting robustness gains. The regularization proposed by Hein & Andriushchenko (2017) however is less practical and again introduces reliance on the coverage of training data points.
|
| 185 |
+
|
| 186 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 187 |
+
|
| 188 |
+
In this work we have presented $L _ { 2 }$ -nonexpansive neural networks which are well-conditioned systems by construction. Practical techniques are developed for building these networks. Their properties are studied through experiments and benefits demonstrated, including that our MNIST and CIFAR-10 classifiers exceed the state of the art in robustness against white-box adversarial attacks, that they are robust against partially random training labels, and that they output confidence gaps which are strongly correlated with robustness and generalization. There are a number of future directions, for example, other applications of L2NNN, L2NNN-friendly neural network architectures, and the relation between L2NNNs and interpretability.
|
| 189 |
+
|
| 190 |
+
# REFERENCES
|
| 191 |
+
|
| 192 |
+
Naveed Akhtar and Ajmal Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. arXiv preprint arXiv:1801.00553, 2018.
|
| 193 |
+
|
| 194 |
+
Moustafa Alzantot, Bharathan Balaji, and Mani Srivastava. Did you hear that? Adversarial examples against automatic speech recognition. arXiv preprint arXiv:1801.00554, 2018.
|
| 195 |
+
|
| 196 |
+
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.
|
| 197 |
+
|
| 198 |
+
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. 6241–6250, 2017.
|
| 199 |
+
|
| 200 |
+
Y-Lan Boureau, Jean Ponce, and Yann LeCun. A theoretical analysis of feature pooling in visual recognition. In International Conference on Machine Learning, pp. 111–118, 2010.
|
| 201 |
+
|
| 202 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Proceedings of the IEEE Symposium on Security and Privacy, pp. 39–57, 2017a.
|
| 203 |
+
|
| 204 |
+
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, 2017b.
|
| 205 |
+
|
| 206 |
+
Nicholas Carlini and David Wagner. Audio adversarial examples: Targeted attacks on speech-totext. arXiv preprint arXiv:1801.01944, 2018.
|
| 207 |
+
|
| 208 |
+
Nicholas Carlini, Guy Katz, Clark Barrett, and David L Dill. Provably minimally-distorted adversarial examples. arXiv preprint arXiv:1709.10207, 2017.
|
| 209 |
+
|
| 210 |
+
Hongge Chen, Huan Zhang, Pin-Yu Chen, Jinfeng Yi, and Cho-Jui Hsieh. Show-and-fool: Crafting adversarial examples for neural image captioning. arXiv preprint arXiv:1712.02051, 2017.
|
| 211 |
+
|
| 212 |
+
Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In International Conference on Machine Learning, pp. 854–863, 2017.
|
| 213 |
+
|
| 214 |
+
Harris Drucker and Yann Le Cun. Improving generalization performance using double backpropagation. IEEE Transactions on Neural Networks, 3(6):991–997, 1992.
|
| 215 |
+
|
| 216 |
+
Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. Hotflip: White-box adversarial examples for nlp. arXiv preprint arXiv:1712.06751, 2017.
|
| 217 |
+
|
| 218 |
+
Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. Black-box generation of adversarial text sequences to evade deep learning classifiers. arXiv preprint arXiv:1801.04354, 2018.
|
| 219 |
+
|
| 220 |
+
Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018.
|
| 221 |
+
|
| 222 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 223 |
+
|
| 224 |
+
Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. Inverse Problems, 34(1):014004, 2017.
|
| 225 |
+
|
| 226 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems, pp. 2263–2273, 2017.
|
| 227 |
+
|
| 228 |
+
Kenji Kawaguchi, Leslie Pack Kaelbling, and Yoshua Bengio. Generalization in deep learning. arXiv preprint arXiv:1710.05468, 2017.
|
| 229 |
+
|
| 230 |
+
J. Zico Kolter and Eric Wong. Provable defenses against adversarial examples via the convex outer adversarial polytope. arXiv preprint arXiv:1711.00851, 2017.
|
| 231 |
+
|
| 232 |
+
Felix Kreuk, Yossi Adi, Moustapha Cisse, and Joseph Keshet. Fooling end-to-end speaker verification by adversarial examples. arXiv preprint arXiv:1801.03339, 2018.
|
| 233 |
+
|
| 234 |
+
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.
|
| 235 |
+
|
| 236 |
+
Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 135–147. ACM, 2017.
|
| 237 |
+
|
| 238 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pp. 1310–1318, 2013.
|
| 239 |
+
|
| 240 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. arXiv preprint arXiv:1801.09344, 2018.
|
| 241 |
+
|
| 242 |
+
Andrew Slavin Ross and Finale Doshi-Velez. Improving the adversarial robustness and interpretability of deep neural networks by regularizing their input gradients. arXiv preprint arXiv:1711.09404, 2017.
|
| 243 |
+
|
| 244 |
+
Wenling Shang, Kihyuk Sohn, Diogo Almeida, and Honglak Lee. Understanding and improving convolutional neural networks via concatenated rectified linear units. In International Conference on Machine Learning, pp. 2217–2225, 2016.
|
| 245 |
+
|
| 246 |
+
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.
|
| 247 |
+
|
| 248 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In Proceedings of International Conference on Learning Representations, 2014.
|
| 249 |
+
|
| 250 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patric \` k McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 251 |
+
|
| 252 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In International Conference on Learning Representations, 2019.
|
| 253 |
+
|
| 254 |
+
Eric Wong, Frank Schmidt, Jan Hendrik Metzen, and J Zico Kolter. Scaling provable adversarial defenses. In Advances in Neural Information Processing Systems, 2018.
|
| 255 |
+
|
| 256 |
+
Huan Xu and Shie Mannor. Robustness and generalization. Machine learning, 86(3):391–423, 2012.
|
| 257 |
+
|
| 258 |
+
Yuichi Yoshida and Takeru Miyato. Spectral norm regularization for improving the generalizability of deep learning. arXiv preprint arXiv:1705.10941, 2017.
|
| 259 |
+
|
| 260 |
+
Valentina Zantedeschi, Maria-Irina Nicolae, and Ambrish Rawat. Efficient defenses against adversarial attacks. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 39–49. ACM, 2017.
|
| 261 |
+
|
| 262 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In Proceedings of International Conference on Learning Representations, 2017.
|
| 263 |
+
|
| 264 |
+
# A $L _ { 2 }$ -NONEXPANSIVE NETWORK COMPONENTS
|
| 265 |
+
|
| 266 |
+
# A.1 ADDITIONAL METHODS FOR WEIGHT REGULARIZATION
|
| 267 |
+
|
| 268 |
+
There are numerous ways to utilize the bound of (2). The main text describes a simple method of using $W ^ { \prime } = W / \sqrt { b \left( W \right) }$ to enforce strict nonexpansiveness. The following is an alternative.
|
| 269 |
+
|
| 270 |
+
Approximate nonexpansiveness can be achieved by adding a penalty to the loss function whenever $b \left( W \right)$ exceeds 1, for example:
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\mathcal { L } _ { W } = \operatorname* { m i n } \left( l ( W ^ { \mathrm { T } } W ) , l ( W W ^ { \mathrm { T } } ) \right) , \mathrm { ~ w h e r e ~ } l \left( M \right) = \sum _ { i } \operatorname* { m a x } \left( \sum _ { j } \left| M _ { i , j } \right| - 1 , 0 \right)
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
The sum of (7) losses over all layers becomes a fourth term in the loss function (3), multiplied with one additional hyperparameter. This would lead to an approximate L2NNN with trade-offs between how much its layers violate (1) with surrogate (2) versus other objectives in the loss function.
|
| 277 |
+
|
| 278 |
+
In practice, we have found that it is beneficial to begin neural network training with the regularization scheme of (7), which allows larger learning rates, and switch to the first scheme of using $W ^ { \prime }$ , which avoids artifacts of an extra hyperparameter, when close to convergence. Of course if the goal is building approximate L2NNNs one can use (7) all the way.
|
| 279 |
+
|
| 280 |
+
# A.2 SIGMOID AND OTHERS
|
| 281 |
+
|
| 282 |
+
Sigmoid is nonexpansive as is, but does not preserve distance as much as possible. A better way is to replace sigmoid with the following operator
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
s \left( x \right) = t \cdot { \mathrm { s i g m o i d } } \left( { \frac { 4 x } { t } } \right)
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
where $t > 0$ is a trainable parameter and each neuron has its own $t$ . In general, the requirement for any scalar nonlinearity is that its derivative is bounded between $^ { - 1 }$ and 1. If a nonlinearity violates this condition, a shrinking multiplier can be applied. If the actual range of derivative is narrower, as in the case of sigmoid, an enlarging multiplier can be applied to preserve distance.
|
| 289 |
+
|
| 290 |
+
For further improvement, (8) can be combined with the general form of the two-sided ReLU of Section 2.2. Then the new nonlinearity is a function from $\mathbb { R }$ to $\mathbb { R } ^ { 2 }$ that computes $s ( x )$ and $s ( x ) - x$
|
| 291 |
+
|
| 292 |
+
# A.3 SPLITTING AND RECONVERGENCE
|
| 293 |
+
|
| 294 |
+
There are different kinds of splitting in neural networks. Some splitting is not followed by reconvergence. For example, a classifier may have common layers followed by split layers for each label, and such an architecture can be viewed as multiple L2NNNs that overlap at the common layers and each contain one stack of split layers. In such cases, no modification is needed because there is no splitting within each individual L2NNN.
|
| 295 |
+
|
| 296 |
+
Some splitting, however, is followed by reconvergence. In fact, convolution and pooling layers discussed earlier can be viewed as splitting, and reconvergence happens at the next layer. Another common example is skip-level connections such as in ResNet. Such splitting should be viewed as making two copies of a certain vector. Let the before-split vector be $\mathbf { x } _ { \mathrm { 0 } }$ , and we make two copies as
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { l } { \mathbf { x } _ { 1 } = t \cdot \mathbf { x } _ { 0 } } \\ { \mathbf { x } _ { 2 } = \sqrt { 1 - t ^ { 2 } } \cdot \mathbf { x } _ { 0 } } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
where $t \in [ 0 , 1 ]$ is a trainable parameter.
|
| 303 |
+
|
| 304 |
+
In the case of ResNet, the reconvergence is an add operator, which should be treated as vectormatrix multiplication as in Section 2.1, but with much simplified forms. Let $\mathbf { x } _ { 1 }$ be the skip-level connections and $f \left( \mathbf { x } _ { 2 } \right)$ be the channels of convolution outputs to be added with $\mathbf { x } _ { 1 }$ , we perform the addition as
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\mathbf { y } = t \cdot \mathbf { x } _ { 1 } + { \sqrt { 1 - t ^ { 2 } } } \cdot f \left( \mathbf { x } _ { 2 } \right)
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
where $t \in [ 0 , 1 ]$ is a trainable parameter and could be a common parameter with (9).
|
| 311 |
+
|
| 312 |
+
ResNet-like reconvergence is referred to as aggregation layers in Cisse et al. (2017) and a different formula was used:
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\mathbf { y } = { \boldsymbol { \alpha } } \cdot \mathbf { x } _ { 1 } + \left( 1 - { \boldsymbol { \alpha } } \right) \cdot f \left( \mathbf { x } _ { 2 } \right)
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
where $\alpha \in [ 0 , 1 ]$ is a trainable parameter. Because splitting is not modified in Cisse et al. (2017), their scheme may seem approximately equivalent to ours if a common $t$ parameter is used for (9) and (10). However, there is a substantial difference: in many ResNet blocks, $f \left( \mathbf { x } _ { 2 } \right)$ is a subset of rather than all of the output channels of convolution layers, and our scheme does not apply the shrinking factor of $\sqrt { 1 - t ^ { 2 } }$ on channels that are not part of $f \left( \mathbf { x } _ { 2 } \right)$ and therefore better preserve distances. In contrast, because splitting is not modified, at reconvergence the scheme of Cisse et al. (2017) must apply the shrinking factor of $1 - \alpha$ on all outputs of convolution layers, regardless of whether a channel is part of the aggregation or not. To state the difference in more general terms, our scheme enables splitting and reconvergence at arbitrary levels of granularity and multiplies shrinking factors to only the necessary components. We can also have a different $t$ per channel or even per entry.
|
| 319 |
+
|
| 320 |
+
To be fair, the scheme of Cisse et al. (2017) has an advantage of being nonexpansive with respect to any $L _ { p }$ -norm. However, for $L _ { 2 }$ -norm, it is inferior to ours in preserving distances and maximizing confidence gaps.
|
| 321 |
+
|
| 322 |
+
# A.4 RECURSION
|
| 323 |
+
|
| 324 |
+
There are multiple ways to interpret recurrent neural networks (RNN) as L2NNNs. One way is to view an unrolled RNN as multiple overlapping L2NNNs where each L2NNN generates the output at one time step. Under this interpretation, nothing special is needed and recurrent inputs to a neuron are simply treated as ordinary inputs.
|
| 325 |
+
|
| 326 |
+
Another way to interpret an RNN is to view unrolled RNN as a single L2NNN that generates outputs at all time steps. Under this interpretation, recurrent connections are treated as splitting at their sources and should be handled as in (9).
|
| 327 |
+
|
| 328 |
+
# A.5 NORMALIZATION
|
| 329 |
+
|
| 330 |
+
Normalization operations are limited in an L2NNN. Subtracting mean is nonexpansive and allowed, and subtract-mean operation can be performed on arbitrary subsets of any layer. Subtracting batch mean is also allowed because it can be viewed as subtracting a bias parameter. However, scaling, e.g., division by standard deviation or batch standard deviation is only allowed if the multiplying factors are between -1 and 1. To satisfy this in practice, one simple method is to divide all multiplying factors in a normalization layer by the largest of their absolute values.
|
| 331 |
+
|
| 332 |
+
# B MNIST IMAGES
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 3: Original and distorted images of MNIST digits in test set with the largest confidence gaps. Mstk denotes the misclassified labels. Dist denotes the $L _ { 2 }$ -norm of the distortion noise.
|
| 336 |
+
|
| 337 |
+
Let us begin by showing MNIST images with the largest confidence gaps in Figure 3 and those with the smallest confidence gaps in Figure 4. They include images before and after attacks as well as Model 3’s confidence gap, the misclassified label and $L _ { 2 }$ -norm of the added noise. The images with large confidence gaps seem to be ones that are most different from other digits, while some of the images with small confidence gaps are genuinely ambiguous. It’s worth noting the strong correlation between the confidence gap of L2NNN and the magnitude of distortion needed to force it to misclassify. Also note that our guarantee states that the minimum $L _ { 2 }$ -norm of noise is half of the confidence gap, but in reality the needed noise is much stronger than the guarantee. The reason is that the true local guarantee is in fact larger due to local Lipschitz constants, as pointed out by Hein & Andriushchenko (2017).
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 4: Original and distorted images of MNIST digits in test set with the smallest confidence gaps. Mstk denotes the misclassified output label. Dist denotes the $L _ { 2 }$ -norm of the distortion noise.
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 5: Original image of 0; attack on Model 2 (Madry et al., 2017) found after 1K iterations; attack on Model 2 found after 10K iterations; attack on Model 3 (L2NNN) found after 1M iterations. The latter three all lead to misclassification as 5.
|
| 344 |
+
|
| 345 |
+
Figure 5 shows additional details regarding the example in Figure 1. The first image is the original image of a zero. The second image is an attack on Model 2 (Madry et al., 2017) found after 1K iterations, with noise $L _ { 2 }$ -norm of 4.4. The third is one found after 10K iterations for Model 2, with noise $L _ { 2 }$ -norm of 2.1. The last image is the best attack on our Model 3 found after one million iterations, with noise $L _ { 2 }$ -norm of 3.5. These illustrates the trend shown in Table 1 that the defense by adversarial training diminishes as the attacks are allowed more iterations, while L2NNNs withstand strong attacks and it requires more noise to fool an L2NNN. It’s worth noting that the slow degradation of Model 2’s accuracy is an artifact of the attacker (Carlini & Wagner, 2017a): when gradients are near zero in some parts of the input space, which is true for MNIST Model 2 due to adversarial training, it takes more iterations to make progress. It is conceivable that, with a more advanced attacker, Model 2 could drop quickly to $7 . 6 \%$ . What truly matter are the robust accuracies where we advance the state of the art from $7 . 6 \%$ to $2 4 . 4 \%$ .
|
| 346 |
+
|
| 347 |
+
# C DETAILS OF SCRAMBLED-LABEL EXPERIMENTS
|
| 348 |
+
|
| 349 |
+
For ordinary networks in Table 5, we use two network architectures. The first has 4 layers and is the architecture used in Madry et al. (2017). The second has 22 layers and is the architecture of Models 3 and 4 in Table 1, which includes norm-pooling and two-sided ReLU. Results of ordinary networks using these two architectures are in Tables 7 and 8 respectively. The ordinary-network section of Table 5 is entry-wise max of Tables 7 and 8.
|
| 350 |
+
|
| 351 |
+
In Tables 7 and 8, dropout rate and weight-decay weight are tuned for each WD/DR run, and each $\mathrm { W D + D R + E S }$ run uses the combined hyperparameters from its row. In early-stopping runs, 5000 training images are withheld as validation set and training stops when loss on validation set stops decreasing. Each ES or $\mathrm { W D + D R + E S }$ entry is an average over ten runs to account for randomness of the validation set. The L2NNNs do not use weight decay, dropout or early stopping.
|
| 352 |
+
|
| 353 |
+
Table 9 shows L2NNN trade-off points between accuracy and confidence gap on the $2 5 \%$ -scrambled training set. Table 10 shows L2NNN trade-off points between accuracy and confidence gap on the $7 5 \%$ -scrambled training set. Like Table 6, they demonstrate the trade-off mechanism between memorization (training-set accuracy) and generalization (training-set average gap).
|
| 354 |
+
|
| 355 |
+
Table 7: Accuracies of non-L2NNN MNIST classifiers that use a 4-layer architecture and that are trained on training data with various amounts of scrambled labels. Rand is the percentage of training labels that are randomized. WD is weight decay. DR is dropout. ES is early stopping.
|
| 356 |
+
|
| 357 |
+
<table><tr><td rowspan="2">Rand</td><td colspan="5">Ordinary network</td></tr><tr><td>Vanilla</td><td>WD</td><td>DR</td><td>ES</td><td>WD+DR+ES</td></tr><tr><td>0</td><td>98.9%</td><td>99.0%</td><td>99.2%</td><td>99.0%</td><td>99.3%</td></tr><tr><td>25%</td><td>82.5%</td><td>91.1%</td><td>91.8%</td><td>79.1%</td><td>98.0%</td></tr><tr><td>50%</td><td>57.7%</td><td>67.7%</td><td>72.6%</td><td>66.4%</td><td>88.3%</td></tr><tr><td>75%</td><td>32.1%</td><td>44.9%</td><td>41.8%</td><td>52.7%</td><td>66.4%</td></tr><tr><td>100%</td><td>9.5%</td><td>8.9%</td><td>9.4%</td><td>NA</td><td>NA</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 8: Accuracies of non-L2NNN MNIST classifiers that use a 22-layer architecture and that are trained on training data with various amounts of scrambled labels. Rand is the percentage of training labels that are randomized. WD is weight decay. DR is dropout. ES is early stopping.
|
| 360 |
+
|
| 361 |
+
<table><tr><td rowspan="2">Rand</td><td colspan="5">Ordinary network</td></tr><tr><td>Vanilla</td><td>WD</td><td>DR</td><td>ES</td><td>WD+DR+ES</td></tr><tr><td>0</td><td>99.4%</td><td>99.0%</td><td>99.0%</td><td>99.0%</td><td>99.0%</td></tr><tr><td>25%</td><td>90.4%</td><td>86.5%</td><td>89.8%</td><td>96.2%</td><td>90.3%</td></tr><tr><td>50%</td><td>65.5%</td><td>62.5%</td><td>63.7%</td><td>81.0%</td><td>83.1%</td></tr><tr><td>75%</td><td>41.5%</td><td>38.2%</td><td>40.2%</td><td>75.2%</td><td>61.9%</td></tr><tr><td>100%</td><td>9.7%</td><td>9.1%</td><td>8.8%</td><td>NA</td><td>NA</td></tr></table>
|
| 362 |
+
|
| 363 |
+
To be fair, dropout and early stopping are also able to sacrifice accuracy on a noisy training set. For example, the DR run in the $5 0 \%$ -scrambled row in Table 7 has $6 7 . 5 \%$ accuracy on the training set and $7 2 . 6 \%$ on the test set. However, the underlying mechanisms are very different from that of L2NNN. Dropout (Srivastava et al., 2014) has an effect of data augmentation, and, with a noisy training set, dropout can create a situation where the effective data complexity exceeds the network capacity. Therefore, the parameter training is stalled at a lowered accuracy on the training set, and we get better performance if the model tends to fit more of original labels and less of the scrambled labels. The mechanism of early stopping is straightforward and simply stops the training when it is mostly memorizing scrambled labels. We get better performance from early stopping if the parameter training tends to fit the original labels early. These mechanisms from dropout and early stopping are both brittle and may not allow parameter training enough opportunity to learn from the useful data points with original labels. The comparison in Table 5 suggests that they are inferior to L2NNN’s trade-off mechanism as discussed in Section 3.3 and illustrated in Tables 6, 9 and 10. The L2NNNs in this paper do not use weight decay, dropout or early stopping, however it is conceivable that dropout may be complementary to L2NNNs.
|
| 364 |
+
|
| 365 |
+
# D PROOFS
|
| 366 |
+
|
| 367 |
+
Lemma 1. Let $g \left( \mathbf { x } \right)$ denote a single-L2NNN classifier’s confidence gap for an input data point x. The classifier will not change its answer as long as the input $\mathbf { x }$ is modified by no more than an $L _ { 2 }$ -norm of $g \left( \mathbf { x } \right) / \sqrt { 2 }$ .
|
| 368 |
+
|
| 369 |
+
Proof. Let $\mathbf { y } \left( \mathbf { x } \right) = \left[ y _ { 1 } \left( \mathbf { x } \right) , y _ { 2 } \left( \mathbf { x } \right) , \cdots , y _ { K } \left( \mathbf { x } \right) \right]$ denote logit vector of a single-L2NNN classifier for an input data point $\mathbf { x }$ . Let $\mathbf { x _ { 1 } }$ and $\mathbf { x _ { 2 } }$ be two input vectors such that the classifier outputs different labels $i$ and $j$ . By definitions, we have the following inequalities:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r l } & { y _ { i } \left( \mathbf { x _ { 1 } } \right) - y _ { j } \left( \mathbf { x _ { 1 } } \right) \geq g \left( \mathbf { x _ { 1 } } \right) } \\ & { y _ { i } \left( \mathbf { x _ { 2 } } \right) - y _ { j } \left( \mathbf { x _ { 2 } } \right) \leq 0 } \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
Table 9: Training-accuracy-versus-confidence-gap trade-off points of L2NNNs on $2 5 \%$ -scrambled MNIST training labels.
|
| 376 |
+
|
| 377 |
+
<table><tr><td>on training set Accu.</td><td>Gap</td><td>on test set Accu. Gap</td></tr><tr><td>99.6%</td><td>0.12</td><td>92.6% 0.10</td></tr><tr><td>97.6%</td><td>0.20</td><td>95.7% 0.17</td></tr><tr><td>78.6%</td><td>0.31</td><td>98.2% 0.30</td></tr><tr><td>77.2%</td><td>0.64</td><td>98.5% 0.63</td></tr></table>
|
| 378 |
+
|
| 379 |
+
Table 10: Training-accuracy-versus-confidence-gap trade-off points of L2NNNs on $7 5 \%$ -scrambled MNIST training labels.
|
| 380 |
+
|
| 381 |
+
<table><tr><td>on training set Accu.</td><td>Gap</td><td>on test set Accu. Gap</td></tr><tr><td>97.9%</td><td>0.07</td><td>49.8% 0.03</td></tr><tr><td>93.0%</td><td>0.09</td><td>59.2% 0.05</td></tr><tr><td>75.9%</td><td>0.10</td><td>70.0% 0.08</td></tr><tr><td>58.0%</td><td>0.18</td><td>80.4% 0.17</td></tr><tr><td>46.2%</td><td>0.29</td><td>86.8% 0.30</td></tr><tr><td>40.1%</td><td>0.44</td><td>89.8% 0.46</td></tr><tr><td>34.7%</td><td>0.86</td><td>93.1% 0.89</td></tr></table>
|
| 382 |
+
|
| 383 |
+
Because the classifier is a single L2NNN, it must be true that:
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } { \| \mathbf { x } _ { 2 } - \mathbf { x } _ { 1 } \| _ { 2 } \geq \| \mathbf { y } \left( \mathbf { x } _ { 2 } \right) - \mathbf { y } \left( \mathbf { x } _ { 1 } \right) \| _ { 2 } } & { } \\ & { \geq \sqrt { \left( g _ { \xi } \left( \mathbf { x } _ { 2 } \right) - g _ { \xi } \left( \mathbf { x } _ { 1 } \right) \right) ^ { 2 } + \left( y _ { \xi } \left( \mathbf { x } _ { 2 } \right) - y _ { \xi } \left( \mathbf { x } _ { 1 } \right) \right) ^ { 2 } } } \\ & { = \sqrt { \left( g _ { \xi } \left( \mathbf { x } _ { 1 } \right) - y _ { \xi } \left( \mathbf { x } _ { 2 } \right) \right) ^ { 2 } + \left( y _ { \xi } \left( \mathbf { x } _ { 2 } \right) - y _ { \xi } \left( \mathbf { x } _ { 1 } \right) \right) ^ { 2 } } } \\ & { \geq \sqrt { \frac { \left( y _ { \xi } \left( \mathbf { x } _ { 1 } \right) - y _ { \xi } \left( \mathbf { x } _ { 2 } \right) + y _ { \xi } \left( \mathbf { x } _ { 2 } \right) - y _ { \xi } \left( \mathbf { x } _ { 1 } \right) \right) ^ { 2 } } { 2 } } } \\ & { = \sqrt { \frac { \left( \left( y _ { \xi } \left( \mathbf { x } _ { 1 } \right) - y _ { \xi } \left( \mathbf { x } _ { 1 } \right) \right) + \left( y _ { \xi } \left( \mathbf { x } _ { 2 } \right) - y _ { \xi } \left( \mathbf { x } _ { 2 } \right) \right) \right) ^ { 2 } } { 2 } } } \\ & { \geq \sqrt { \frac { \left( g _ { \xi } \left( \mathbf { x } _ { 1 } \right) + 0 \right) ^ { 2 } } { 2 } } } \\ & { = g _ { \left( \mathbf { x } _ { 1 } \right) } / \sqrt { 2 } } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
Lemma 2. Let $g \left( \mathbf { x } \right)$ denote a classifier’s confidence gap for an input data point x. Let $d \left( \mathbf { x _ { 1 } } , \mathbf { x _ { 2 } } \right)$ denote the $L _ { 2 }$ -distance between the output logit-vectors for two input points $\mathbf { x _ { 1 } }$ and $\mathbf { x _ { 2 } }$ that have different labels and that are classified correctly. Then this condition holds: $g \left( \mathbf { x _ { 1 } } \right) + g \left( \mathbf { x _ { 2 } } \right) \ \leq$ ${ \sqrt { 2 } } \cdot d \left( \mathbf { x _ { 1 } } , \mathbf { x _ { 2 } } \right)$ .
|
| 390 |
+
|
| 391 |
+
Proof. Let y $\mathbf { \sigma } \left( \mathbf { x } \right) = \left[ y _ { 1 } \left( \mathbf { x } \right) , y _ { 2 } \left( \mathbf { x } \right) , \cdot \cdot \cdot , y _ { K } \left( \mathbf { x } \right) \right]$ denote logit vector of a classifier for an input data point $\mathbf { x }$ . Let $i$ and $j$ be the labels for $\mathbf { x _ { 1 } }$ and $\mathbf { x _ { 2 } }$ . By definitions, we have the following inequalities:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { r } { y _ { i } \left( \mathbf { x _ { 1 } } \right) - y _ { j } \left( \mathbf { x _ { 1 } } \right) \geq g \left( \mathbf { x _ { 1 } } \right) } \\ { y _ { j } \left( \mathbf { x _ { 2 } } \right) - y _ { i } \left( \mathbf { x _ { 2 } } \right) \geq g \left( \mathbf { x _ { 2 } } \right) } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Therefore,
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { r l } { d ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ) \triangleq \mathbf { y } ( \mathbf { x } _ { 2 } ) - \mathbf { y } ( \mathbf { x } _ { 1 } ) _ { 2 } } & { } \\ & { \leq \sqrt { ( ( \mathbf { y } _ { 1 } ( \mathbf { x } _ { 2 } ) ) - y _ { 1 } ( \mathbf { x } _ { 1 } ) ^ { 2 } + ( y _ { 1 } ( \mathbf { x } _ { 2 } ) - y _ { 1 } ( \mathbf { x } _ { 1 } ) ) ^ { 2 } } } \\ & { = \sqrt { ( y _ { 1 } ( \mathbf { x } _ { 1 } ) - y _ { 1 } ( \mathbf { x } _ { 2 } ) ) ^ { 2 } + ( y _ { 2 } ( \mathbf { x } _ { 2 } ) - y _ { 2 } ( \mathbf { x } _ { 1 } ) ) ^ { 2 } } } \\ & { \leq \sqrt { \frac { ( y _ { 1 } ( \mathbf { x } _ { 1 } ) - y _ { 1 } ( \mathbf { x } _ { 2 } ) + y _ { 2 } ( \mathbf { x } _ { 2 } ) - y _ { 1 } ( \mathbf { x } _ { 1 } ) ) ^ { 2 } } { 2 } } } \\ & { = \sqrt { \frac { ( ( y _ { 1 } ( \mathbf { x } _ { 1 } ) - y _ { 2 } ( \mathbf { x } _ { 1 } ) ) + ( y _ { 2 } ( \mathbf { x } _ { 2 } ) - y _ { 1 } ( \mathbf { x } _ { 2 } ) ) ) ^ { 2 } } { 2 } } } \\ & { \geq \sqrt { \frac { ( ( y _ { 1 } ( \mathbf { x } _ { 1 } ) + ( y _ { 2 } ( \mathbf { x } _ { 2 } ) ) ^ { 2 } ) } { 2 } } } \\ & { = \frac { g ( \mathbf { x } _ { 1 } ) + g ( \mathbf { x } _ { 2 } ) } { \sqrt { 2 } } } \\ & { = \frac { g ( \mathbf { x } _ { 1 } ) + g ( \mathbf { x } _ { 2 } ) } { \sqrt { 2 } } } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Lemma 3. For any $a \geq 0$ , $b \geq 0$ , $p \geq 1$ , the following inequality holds: $a ^ { p } + b ^ { p } \leq ( a + b ) ^ { p }$ .
|
| 404 |
+
|
| 405 |
+
Proof. If $a$ and $b$ are both zero, the inequality holds. If at least one of $a$ and $b$ is nonzero:
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\begin{array} { c } { { a ^ { p } + b ^ { p } = ( a + b ) ^ { p } \cdot \displaystyle \left( \frac { a } { a + b } \right) ^ { p } + ( a + b ) ^ { p } \cdot \displaystyle \left( \frac { b } { a + b } \right) ^ { p } } } \\ { { \leq ( a + b ) ^ { p } \cdot \displaystyle \frac { a } { a + b } + ( a + b ) ^ { p } \cdot \displaystyle \frac { b } { a + b } } } \\ { { = ( a + b ) ^ { p } } } \end{array}
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Lemma 4. Let $f ( x )$ be a nonexpansive and monotonically increasing scalar function. Define a function from $\mathbb { R }$ to $\mathbb { R } ^ { 2 }$ : $\mathbf { h } ( x ) = [ f ( x ) , f ( x ) - x ]$ . Then $\mathbf { h } ( x )$ is nonexpansive with respect to any $L _ { p }$ -norm.
|
| 412 |
+
|
| 413 |
+
Proof. For any $x _ { 1 } > x _ { 2 }$ , by definition we have the following inequalities:
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\begin{array} { l } { f ( x _ { 1 } ) - f ( x _ { 2 } ) \geq 0 } \\ { f ( x _ { 1 } ) - f ( x _ { 2 } ) \leq x _ { 1 } - x _ { 2 } } \end{array}
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
For any $p \geq 1$ , invoking Lemma 3 with $a = f ( x _ { 1 } ) - f ( x _ { 2 } )$ and $b = x _ { 1 } - x _ { 2 } - f ( x _ { 1 } ) + f ( x _ { 2 } )$ , we have:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { r l r } & { } & { \left( ( f ( x _ { 1 } ) - f ( x _ { 2 } ) ) ^ { p } + ( x _ { 1 } - x _ { 2 } - f ( x _ { 1 } ) + f ( x _ { 2 } ) ) ^ { p } \leq ( x _ { 1 } - x _ { 2 } ) ^ { p } \right. } \\ & { } & { \left. ( ( ( f ( x _ { 1 } ) - f ( x _ { 2 } ) ) ^ { p } + ( x _ { 1 } - x _ { 2 } - f ( x _ { 1 } ) + f ( x _ { 2 } ) ) ^ { p } ) ^ { 1 / p } \leq x _ { 1 } - x _ { 2 } \right. } \\ & { } & { \left. ( | f ( x _ { 1 } ) - f ( x _ { 2 } ) | ^ { p } + | ( f ( x _ { 1 } ) - x _ { 1 } ) - ( f ( x _ { 2 } ) - x _ { 2 } ) | ^ { p } ) ^ { 1 / p } \leq x _ { 1 } - x _ { 2 } \right. } \\ & { } & { \left. \| \mathbf { h } ( x _ { 1 } ) - \mathbf { h } ( x _ { 2 } ) \| _ { p } \leq x _ { 1 } - x _ { 2 } \right. } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Lemma 5. Norm-pooling within each pooling window is a nonexpansive map with respect to $L _ { 2 }$ - norm.
|
| 426 |
+
|
| 427 |
+
Proof. Let $\mathbf { x _ { 1 } }$ and $\mathbf { x _ { 2 } }$ be two vectors with the size of a pooling window. By triangle inequality, we have
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { r } { \| \mathbf { x _ { 1 } } - \mathbf { x _ { 2 } } \| _ { 2 } + \| \mathbf { x _ { 1 } } \| _ { 2 } \geq \| \mathbf { x _ { 2 } } \| _ { 2 } } \\ { \| \mathbf { x _ { 1 } } - \mathbf { x _ { 2 } } \| _ { 2 } + \| \mathbf { x _ { 2 } } \| _ { 2 } \geq \| \mathbf { x _ { 1 } } \| _ { 2 } } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
Therefore,
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\begin{array} { r } { \| \mathbf { x _ { 1 } } - \mathbf { x _ { 2 } } \| _ { 2 } \geq \| \mathbf { x _ { 2 } } \| _ { 2 } - \| \mathbf { x _ { 1 } } \| _ { 2 } } \\ { \| \mathbf { x _ { 1 } } - \mathbf { x _ { 2 } } \| _ { 2 } \geq \| \mathbf { x _ { 1 } } \| _ { 2 } - \| \mathbf { x _ { 2 } } \| _ { 2 } } \end{array}
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Therefore,
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\| \mathbf { x _ { 1 } } - \mathbf { x _ { 2 } } \| _ { 2 } \geq | \| \mathbf { x _ { 1 } } \| _ { 2 } - \| \mathbf { x _ { 2 } } \| _ { 2 } |
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
Lemma 6. Let $g \left( \mathbf { x } \right)$ denote a multi-L2NNN classifier’s confidence gap for an input data point x. The classifier will not change its answer as long as the input $\mathbf { x }$ is modified by no more than an $L _ { 2 }$ -norm of $g \left( \mathbf { x } \right) / 2$ .
|
| 446 |
+
|
| 447 |
+
Proof. Let $\mathbf { y } \left( \mathbf { x } \right) = \left[ y _ { 1 } \left( \mathbf { x } \right) , y _ { 2 } \left( \mathbf { x } \right) , \cdot \cdot \cdot , y _ { K } \left( \mathbf { x } \right) \right]$ denote logit vector of a multi-L2NNN classifier for an input data point x. Let $\mathbf { x _ { 1 } }$ and $\mathbf { x _ { 2 } }$ be two input vectors such that the classifier outputs different labels $i$ and $j$ . By definitions, we have the following inequalities:
|
| 448 |
+
|
| 449 |
+
$$
|
| 450 |
+
\begin{array} { r l } & { y _ { i } \left( \mathbf { x _ { 1 } } \right) - y _ { j } \left( \mathbf { x _ { 1 } } \right) \geq g \left( \mathbf { x _ { 1 } } \right) } \\ & { y _ { i } \left( \mathbf { x _ { 2 } } \right) - y _ { j } \left( \mathbf { x _ { 2 } } \right) \leq 0 } \end{array}
|
| 451 |
+
$$
|
| 452 |
+
|
| 453 |
+
For a multi-L2NNN classifier, each logit is a nonexpansive function of the input, and it must be true that:
|
| 454 |
+
|
| 455 |
+
$$
|
| 456 |
+
\begin{array} { r } { \| \mathbf { x _ { 2 } } - \mathbf { x _ { 1 } } \| _ { 2 } \geq \left| y _ { i } \left( \mathbf { x _ { 1 } } \right) - y _ { i } \left( \mathbf { x _ { 2 } } \right) \right| } \\ { \| \mathbf { x _ { 2 } } - \mathbf { x _ { 1 } } \| _ { 2 } \geq \left| y _ { j } \left( \mathbf { x _ { 2 } } \right) - y _ { j } \left( \mathbf { x _ { 1 } } \right) \right| } \end{array}
|
| 457 |
+
$$
|
| 458 |
+
|
| 459 |
+
Therefore,
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
{ \begin{array} { r l } & { \left\| \mathbf { x } _ { 2 } - \mathbf { x } _ { 1 } \right\| _ { 2 } \geq { \frac { \left| y _ { i } \left( \mathbf { x } _ { 1 } \right) - y _ { i } \left( \mathbf { x } _ { 2 } \right) \right| + \left| y _ { j } \left( \mathbf { x } _ { 2 } \right) - y _ { j } \left( \mathbf { x } _ { 1 } \right) \right| } { 2 } } } \\ & { \qquad \geq { \frac { \left| y _ { i } \left( \mathbf { x } _ { 1 } \right) - y _ { i } \left( \mathbf { x } _ { 2 } \right) + y _ { j } \left( \mathbf { x } _ { 2 } \right) - y _ { j } \left( \mathbf { x } _ { 1 } \right) \right| } { 2 } } } \\ & { \qquad = { \frac { \left| \left( y _ { i } \left( \mathbf { x } _ { 1 } \right) - y _ { j } \left( \mathbf { x } _ { 1 } \right) \right) + \left( y _ { j } \left( \mathbf { x } _ { 2 } \right) - y _ { i } \left( \mathbf { x } _ { 2 } \right) \right) \right| } { 2 } } } \\ & { \qquad \geq { \frac { \left| g \left( \mathbf { x } _ { 1 } \right) + 0 \right| } { 2 } } } \\ & { \qquad = g \left( \mathbf { x } _ { 1 } \right) / 2 } \end{array} }
|
| 463 |
+
$$
|
md/train/HJxwDiActX/HJxwDiActX.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STROKENET: A NEURAL PAINTING ENVIRONMENT
|
| 2 |
+
|
| 3 |
+
Ningyuan Zheng, Yifan Jiang & Dingjiang Huang School of Data Science and Engineering, East China Normal University {10165101164, 10153903133}@stu.ecnu.edu.cn, djhuang@dase.ecnu.edu.cn
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We’ve seen tremendous success of image generating models these years. Generating images through a neural network is usually pixel-based, which is fundamentally different from how humans create artwork using brushes. To imitate human drawing, interactions between the environment and the agent is required to allow trials. However, the environment is usually non-differentiable, leading to slow convergence and massive computation. In this paper we try to address the discrete nature of software environment with an intermediate, differentiable simulation. We present StrokeNet, a novel model where the agent is trained upon a wellcrafted neural approximation of the painting environment. With this approach, our agent was able to learn to write characters such as MNIST digits faster than reinforcement learning approaches in an unsupervised manner. Our primary contribution is the neural simulation of a real-world environment. Furthermore, the agent trained with the emulated environment is able to directly transfer its skills to real-world software. 1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
To learn drawing or writing, a person first observes (encodes) the target image visually and uses a pen or a brush to scribble (decode), to reconstruct the original image. For an experienced painter, he or she foresees the consequences before taking any move, and could choose the optimal action.
|
| 12 |
+
|
| 13 |
+
Stroke-based image generation is fairly different from traditional image generation problems due to the intermediate rendering program. Raster-based deep learning approaches for image generation allow effective optimization using back-propagation. While for stroke-based approaches, rather than learning to generate the image, it is more of learning to manipulate the painting program.
|
| 14 |
+
|
| 15 |
+
An intuitive yet potentially effective way to tackle the problem is to first learn this mapping from “stroke data” to the resulting image with a neural network, which is analogous to learning painting experience. An advantage of such a mapping over software is that it provides a continuous transformation. For any painting program, the pixel values of an image are calcuated based on the coordinate points along the trajectory of an action. Specific pixels are indexed by the discrete pixel coordinates, which cuts the gradient flow with respect to the action. In our implementation, the indexing is done by an MLP described in Section 3.
|
| 16 |
+
|
| 17 |
+
We further define “drawing” by giving a formal definition of “stroke”. In our context, a “stroke” consists of color, brush radius, and a sequence of tuples containing the coordinate and pressure of each point along the trajectory. We will later describe this in detail in Section 3.
|
| 18 |
+
|
| 19 |
+
Based on these ideas, we train a differentiable approximator of our painting software, which we call a “generator”. We then tested the generator by training a vanilla CNN as an agent that encodes the image into “stroke” data as an input for the environment. Our proposed architecture, StrokeNet, basically comprises the two components, a generator and an agent.
|
| 20 |
+
|
| 21 |
+
Finally, an agent is trained to write and draw pictures of several popular datasets upon the generator. For the MNIST (LeCun & Cortes, 2010) digits, we evaluated the quality of the agent with a classifier trained solely on the original MNIST dataset, and tested the classifier on generated images. We also compared our method with others to show the efficiency. We explored the latent space of the agent as well.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Generative models such as VAEs(Kingma & Welling, 2013; Sohn et al., 2015) and GANs(Goodfellow et al., 2014; Mirza & Osindero, 2014; Radford et al., 2015; Arjovsky et al., 2017) have achieved huge success in image generation in recent years. These models generate images directly to pixel-level and thus could be trained through back-propagation effectively.
|
| 26 |
+
|
| 27 |
+
To mimic human drawing, attempts have been made by both graphics and machine learning communities. Traditionally, trial-and-error algorithms(Hertzmann, 2003) are designed to optimize stroke placement by minimizing an energy function, incorporating heuristics, e.g., constraining the number of strokes. Concept learning is another example tackling this problem using Bayesian program learning (Lake et al., 2015). Recent deep learning based approaches generally falls into two categories: RNN-based approaches and reinforcement learning.
|
| 28 |
+
|
| 29 |
+
For RNN-based approaches such as SketchRNN (Ha & Eck, 2017) and handwriting generation with RNN by Graves (Graves, 2013), they both rely on sequential datasets. Thus for unpaired data, those models cannot be applied.
|
| 30 |
+
|
| 31 |
+
Another popular solution is to adopt reinforcement learning such as “artist agent”(Xie et al., 2012) and SPIRAL (Ganin et al., 2018). These methods train an agent that interact with the painting environment. For reinforcement learning tasks with large, continuous action space like this, the training process can be computationally costly and it could take the agent tens of epochs to converge.
|
| 32 |
+
|
| 33 |
+
To mitigate this situation, we simulate the environment in a differentiable manner much alike the idea in World Models (Ha & Schmidhuber, 2018; Schmidhuber, 1990; 2018), where an agent learns from a neural network simulated environment. Similar approach is also used in character reconstruction for background denoising(Huang et al., 2018). In our scenario, we train our generator (auto-encoder) by parts for flexible stroke sequence length and image resolution, discussed in Section 3 and 4.
|
| 34 |
+
|
| 35 |
+
Differentiable rendering is an extensively researched topic in computer graphics. It is used to solve inverse rendering problems. Some differentiable renderers explicitly model the relationship between the parameters and observations (Loper & Black, 2014), others use neural network to approximate the result (Nguyen-Phuoc et al., 2018) since neural nets are powerful function approximators. While little has been done on simulating 2D rendering process adopted in digital painting software, we used a generator neural network to meet our needs.
|
| 36 |
+
|
| 37 |
+
# 3 STROKENET ARCHITECTURE AND ENVIRONMENT
|
| 38 |
+
|
| 39 |
+
# 3.1 STROKE
|
| 40 |
+
|
| 41 |
+
We define a single stroke as follows,
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
s = \{ ( c , r ) , ( x _ { 1 } , y _ { 1 } , p _ { 1 } ) , \cdots , ( x _ { n } , y _ { n } , p _ { n } ) \} , n = 1 6 ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $c \in \mathbb { R } ^ { 3 }$ stands for RGB color, scalar $r$ for brush radius, and tuple $( x _ { i } , y _ { i } , p _ { i } )$ for an anchor point on the stroke, consisting of $x , y$ coordinate and pressure $p$ , and $n$ is the maximum number of points in a single stroke, in this case, 16. These values are normalized such that the coordinates correspond to the default OpenGL coordinate system.
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
c _ { k } , r , p _ { i } \in [ 0 , 1 ] , x _ { i } , y _ { i } \in [ - 1 , 1 ] ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
for $k = 1 , 2 , 3$ and $i = 1 , 2 , \cdots , n$ . We used absolute coordinates for each point. It is notable that compared to the QuickDraw (Ha & Eck, 2017) dataset which contains longer lines, our strokes consist of much fewer points. We consider many trajectory points redundant since the stroke lines can be fitted by spline curves with fewer anchor points. For example, to fit a straight line, only two end-points are needed regardless of the length, in other words, stroke curves are usually scaleinvariant. However, if we are to sample the data from a user input, we could have dozens of points along the trajectory. Hence we made the assumption of being able to represent curves with a few anchors. We later showed that a single stroke with only 16 anchors is able to fit most MNIST digits and generate twisted lines in Section 5. We further assumed that longer and more complicated lines can be decomposed into simple segments and extended our experiments to include recurrent drawing of multiple strokes to generate more complex drawings.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: StrokeNet architecture. The generator part of the model outputs $2 5 6 \times 2 5 6$ images. The position encoder encodes input coordinate into $6 4 \times 6 4$ spatial feature for each point. The agent decodes different information about the stroke using three parallel FC-decoders.
|
| 57 |
+
|
| 58 |
+
# 3.2 GENERATOR
|
| 59 |
+
|
| 60 |
+
The outline of the StrokeNet architecture is shown in Figure 1. The generator takes $s$ as input, and projects the stroke data with two MLPs. One is the position encoder which encodes $( x _ { i } , y _ { i } , p _ { i } )$ into $6 4 \times 6 4$ feature maps, the other, brush encoder encodes the color and radius of the brush to a single $6 4 \times 6 4$ feature map. The color $c ^ { \prime }$ is a single gray scale scalar whose value equals to $\textstyle { \frac { 1 } { 3 } } \sum _ { k = 1 } ^ { 3 } c _ { k }$ , while color strokes are approximated by channel mixing described in Section 3.4. The features are then concatenated and passed to the (de)convolution layers.
|
| 61 |
+
|
| 62 |
+
To preserve the sequential and pressure information of each point $( x _ { i } , y _ { i } , p _ { i } )$ , the position encoder first maps $( x _ { i } , y _ { i } )$ to the corresponding position onto a $6 4 \times 6 4$ matrix by putting a bright dot on that point. This is modeled by a 2D Gaussian function with its peak scaled to 1, which simplifies to:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
g _ { i } ( x , y ) = \exp [ - \frac { 1 } { 2 } ( ( x - x _ { i } ) ^ { 2 } + ( y - y _ { i } ) ^ { 2 } ) ] ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
for $i = 1 , 2 , \cdots , n$ where the value is calculated for each point $( x , y )$ on the $6 4 \times 6 4$ map. Denote this mapping from $( x _ { i } , y _ { i } )$ to $\mathbb { R } ^ { 6 4 \times 6 4 }$ as pos:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
m _ { i } = p _ { i } \cdot p o s ( x _ { i } , y _ { i } ) , m _ { i } \in \mathbb { R } ^ { 6 4 \times 6 4 } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
By multiplying the corresponding pressure $p _ { i }$ , we now have $n$ position features, in our setup, sixteen. This part of the generator is trained separately with random coordinates until it generates accurate and reliable signals.
|
| 75 |
+
|
| 76 |
+
However, if we directly feed these features into the (de)convolutional layers of the network, the generator fails partly due to the sparsity of the single brightness feature. Instead, we take every two neighbouring feature maps and add them together (denoted by “reduce” in Figure 1.),
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
f _ { i } = m _ { i } + m _ { i + 1 } , i = 1 , 2 , \cdots , n - 1 .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Now, each feature map $f _ { i }$ represents a segment of the stroke. By learning to connect and curve the $n - 1$ “segments”, we are able to reconstruct the stroke. By appending the encoded color and radius data we now have the feature with shape $6 4 \times 6 4 \times n$ . We then feed the features into three (de)convolutional layers with batch-normalization (Ioffe & Szegedy, 2015) activated by LeakyReLU ( $\mathrm { X u }$ et al., 2015). The last layer is activated by tanh.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: Recurrent version of StrokeNet. Two separate CNNs are used as encoders for the agent.
|
| 86 |
+
|
| 87 |
+
# 3.3 AGENT
|
| 88 |
+
|
| 89 |
+
The agent is a VGG (Simonyan & Zisserman, 2014)-like CNN that encodes the target image into its underlying stroke representation $s$ . Three parallel FC-decoders with different activations are used to decode position (tanh), pressure (sigmoid) and brush data (sigmoid) from the feature. We used average-pooling instead of max-pooling to improve gradient flow. For the recurrent version of StrokeNet, two separate CNNs are trained for the target image and the drawing frame, as shown in Figure 2. In practice the target image feature is computed once for all steps.
|
| 90 |
+
|
| 91 |
+
# 3.4 ENVIRONMENT
|
| 92 |
+
|
| 93 |
+
We first built a painting software using JavaScript and WebGL. We later tailored this web application for our experiment. 2 The spline used to fit the anchor points is centripetal CatmullRom (Catmull & Rom, 1974; Barry & Goldman, 1988). A desirable feature about Catmull-Rom spline is that the curve goes through all control points, unlike the more commonly used Bezier curve (Sederberg & Farouki, 1992).
|
| 94 |
+
|
| 95 |
+
We then interpolate through the sampled points and draw circles around each center point as shown in Figure 3. For each pixel inside a circle, its color depends on various factors including attributes of the brush, blending algorithm, etc. Our generator is trained on the naive brush. When it comes to the color blending of two frames, the generator is fed with the mean value of input RGB color as a gray scale scalar, and its output is treated as an alpha map. Normalization and alpha-blending is then performed to yield the next color frame, to simulate real blending algorithm underlying the software. Denote the generator output at time-step $t$ by $q ^ { ( t ) } \in \mathbb { R } ^ { 2 5 6 \times 2 5 6 }$ , the frame image by $\overline { { r ^ { ( t ) } } } \in \mathbb { R } ^ { 3 \times 2 5 6 \times 2 5 6 }$ , RGB color of the brush by $c \in \mathbb { R } ^ { 3 }$ , the blending process is approximated as follows,
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
n ^ { ( t ) } = \frac { q ^ { ( t ) } } { \underset { 1 \leq i , j \leq 2 5 6 } { \operatorname* { m a x } } q _ { i j } ^ { ( t ) } } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
r _ { k } ^ { ( t ) } = ( J - n ^ { ( t ) } ) r _ { k } ^ { ( t - 1 ) } + c _ { k } n ^ { ( t ) }
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
for $k = 1 , 2 , 3$ corresponding to the RGB channels, where J denotes a $2 5 6 \times 2 5 6$ all-one matrix.
|
| 106 |
+
|
| 107 |
+
# 4 TRAINING METHODS
|
| 108 |
+
|
| 109 |
+
# 4.1 DATASET FOR GENERATOR
|
| 110 |
+
|
| 111 |
+
For the generator, we synthesize a large amount of samples, each of length $n$ . We would like to capture both the randomness and the smoothness of human writing, thus it is natural to incorporate chaos, most notably, the motion of three-body (Nielsen et al., 2001).
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Illustration of how a stroke is rendered.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 4: Images from our three-body dataset.
|
| 118 |
+
|
| 119 |
+
There is no closed-form solution to three-body problem, and error accumulates in simulation using numerical methods, leading to unpredictable and chaotic results. We simulate three-body motion in space $\mathbf { Z }$ -component for pressure) with random initial conditions and sample the trajectories as strokes for our dataset. The simulation is done with a set of equations using Newton’s universal law of gravitation:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r } { \left\{ \\begin{array} { l l } { \vec { F _ { 1 } } = \frac { G m _ { 1 } m _ { 2 } } { \| P _ { 2 } - P _ { 1 } \| _ { 2 } ^ { 3 } } ( P _ { 2 } - P _ { 1 } ) + \frac { G m _ { 1 } m _ { 3 } } { \| P _ { 3 } - P _ { 1 } \| _ { 2 } ^ { 3 } } ( P _ { 3 } - P _ { 1 } ) } \\ { \vec { F _ { 2 } } = \frac { G m _ { 1 } m _ { 2 } } { \| P _ { 1 } - P _ { 2 } \| _ { 2 } ^ { 3 } } ( P _ { 1 } - P _ { 2 } ) + \frac { G m _ { 2 } m _ { 3 } } { \| P _ { 3 } - P _ { 2 } \| _ { 2 } ^ { 3 } } ( P _ { 3 } - P _ { 2 } ) , } \\ { \vec { F _ { 3 } } = \frac { G m _ { 1 } m _ { 3 } } { \| P _ { 1 } - P _ { 3 } \| _ { 2 } ^ { 3 } } ( P _ { 1 } - P _ { 3 } ) + \frac { G m _ { 2 } m _ { 3 } } { \| P _ { 2 } - P _ { 3 } \| _ { 2 } ^ { 3 } } ( P _ { 2 } - P _ { 3 } ) } \end{array} \right. } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $P _ { i } ( i = 1 , 2 , 3$ , $\qquad P _ { i } \in \mathbb { R } ^ { 3 } .$ ) denotes the position of the three objects respectively, $\vec { F _ { i } }$ denotes the gravitational force exerted on the $i$ th object. In our simulation we set mass $m _ { 1 } = m _ { 2 } = m _ { 3 } = 1$ and gravitational constant $G = 5 \times 1 0 ^ { - 5 }$ . We also always keep our camera (origin point) at the center of the triangle formed by the three objects to maintain relatively stable “footage”.
|
| 126 |
+
|
| 127 |
+
Using this method we collected about 600K images since there is virtually no cost to generate samples. Samples from the dataset are shown in Figure 4.
|
| 128 |
+
|
| 129 |
+
# 4.2 DATASETS FOR AGENT
|
| 130 |
+
|
| 131 |
+
To prove the effectivess of our neural environment, we trained an agent to perform drawing task on several popular datasets, from characters to drawings, with the generator part frozen. For MNIST and Omniglot, we trained an agent to draw the characters within one stroke. We later trained the recurrent StrokeNet on more complex datasets like QuickDraw and KanjiVG (Ofusa et al., 2017). We resized all the input images to $2 5 6 \times 2 5 6$ with anti-alias and paddings.
|
| 132 |
+
|
| 133 |
+
# 4.3 TRAINING METHODOLOGY
|
| 134 |
+
|
| 135 |
+
At first we train the position encoder guided by function pos that maps a coordinate to a $6 4 \times 6 4$ matrix with $l ^ { 2 }$ distance to measure the loss. Next we freeze the position encoder and train the other parts of the generator, again with $l ^ { 2 }$ loss to measure the performance on the three-body dataset. It can be found that smaller batch size results in more accurate images. We trained the generator with a batch size of 64 until the loss no longer improves. We then set the batch size to 32 to sharpen the neural network.
|
| 136 |
+
|
| 137 |
+
To train the agent, we freeze the generator. Denote the agent loss as $\boldsymbol { l } _ { a g e n t }$ , the generated image and ground-truth image as $i _ { g e n }$ and $i _ { g t }$ respectively, the loss is defined as:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
l _ { a g e n t } = \left\| i _ { g e n } - i _ { g t } \right\| _ { 2 } ^ { 2 } + \frac { \lambda } { n - 1 } \sum _ { k = 1 } ^ { n - 1 } \left\| P _ { k } - P _ { k + 1 } \right\| _ { 2 } ^ { 2 } ,
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
where $P _ { k } = [ x _ { k } , y _ { k } , p _ { k } ] ^ { T }$ is the data describing the $k$ th anchor point on the stroke. Here the summation term constrains the average distance between neighbouring points, where $\lambda$ denotes the penalty strength. If we drop this term, the agent fails to learn the correct order of the points in a stroke because the generator itself is, after all, not robust to all cases of input, and is very likely to produce wrong results for sequences with large gaps between neighbouring points.
|
| 144 |
+
|
| 145 |
+
# 5 EXPERIMENTS
|
| 146 |
+
|
| 147 |
+
All experiments are conducted on a single NVIDIA Tesla P40 GPU. We first experimented with single step StrokeNet on MNIST and Omniglot, then we experimented recurrent StrokeNet with QuickDraw and Kanji. For the MNIST dataset, we later enforced a Gaussian prior to the latent variable and explored the latent space of the agent by linear interpolation. Finally, for a quantitative evaluation of the model, we trained a classifier on MNIST, and tested the classifier with images generated by the agent. The close accuracies indicate the quality of the generated images.
|
| 148 |
+
|
| 149 |
+
# 5.1 SINGLE-STEP STROKENET
|
| 150 |
+
|
| 151 |
+
It can be seen that a single stroke provides rich expressive power for different shapes. The generator generalizes well to unseen stroke patterns other than the synthesized three-body dataset. On the Omniglot dataset, since many characters consist of multiple strokes while the agent can only draw one, the agent tries to capture the contour of the character.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 5: Agent trained on MNIST. MNIST sample (left), generator output (middle), WebApp reconstruction (right). 1.5 epochs.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 6: Agent trained on Omniglot dataset learns to “sketch” the characters. Layout is the same as Figure 5. $1 0 ^ { 4 }$ iterations.
|
| 158 |
+
|
| 159 |
+
# 5.2 RECURRENT-STEP STROKENET
|
| 160 |
+
|
| 161 |
+
For more complex datasets, multiple steps of strokes are needed. Again the agent does pretty well to capture the contour of the given image. However, it seems that the agent has trouble to recover the details of the pictures, and tends to smear inside the boundaries with thick strokes.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 7: Agent trained on QuickDraw. Sample (left), reconstruction (right). 6 recurrent steps. 300K-image subset, 5 epochs, $1 0 ^ { 5 }$ iterations.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 8: Agent trained on KanjiVG dataset. Evaluated on a test-set of simple characters. $1 0 ^ { 5 }$ iterations. 8 recurrent steps.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 9: Latent space interpolation. Leftmost and rightmost columns are images from MNIST dataset. Middles are the rendered images with interpolation factors varying from 0 to 1.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 10: Latent space arithmetics. (a) and (b) demonstrate different attributes of the digits.
|
| 174 |
+
|
| 175 |
+
# 5.3 LATENT SPACE EXPLORATION
|
| 176 |
+
|
| 177 |
+
To convert the agent into a latent space generative model, we experimented with the VAE version of the agent, where the feature obtained from the last layer of CNN is projected into two vectors representing the means $\mu$ and standard deviations (activated by softplus) $\sigma$ , both of 1024 dimensions. A vector noise of i.i.d. Gaussian $U \sim N ( 0 , I )$ is sampled, latent variable $z$ is given by
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
z = \mu + \sigma \odot U .
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
We did latent space interpolation with the agent trained on MNIST. The simple data led to easily interpretable results. Since the images are generated by strokes, the digits transform smoothly to one another. That is to say, the results looked as if we were directly interpolating the stroke data. Results are shown in Figure 9 and 10.
|
| 184 |
+
|
| 185 |
+
# 5.4 PERFORMANCE EVALUATION
|
| 186 |
+
|
| 187 |
+
In order to evaluate the agent, we trained a 5-layer CNN classifier solely on pre-processed MNIST dataset, which is also the input to the MNIST agent. The size of the image is $2 5 6 \times 2 5 6$ , so there is some performance drop to the classification task compared to standard $2 8 \times 2 8$ images. The classifier is then used to evaluate the paired test-set image generated by the agent. The accuracies reflect the quality of the generated images. We also compared the $l ^ { 2 }$ loss with SPIRAL on MNIST to illustrate that our method has the advantage of faster convergence over reinforcement learning approaches, shown in Figure 11.
|
| 188 |
+
|
| 189 |
+
Table 1: MNIST Classification Accuracies
|
| 190 |
+
|
| 191 |
+
<table><tr><td>TESTDATA</td><td>ACCURACY</td></tr><tr><td></td><td></td></tr><tr><td>Pre-processed images</td><td>90.82%</td></tr><tr><td>Agent Output (3 steps)</td><td>88.43%</td></tr><tr><td>Agent Output (1 step)</td><td>79.33%</td></tr><tr><td>Agent Output (1 step, VAE)</td><td>67.21%</td></tr></table>
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 11: Comparison of loss curves between StrokeNet (ours) and SPIRAL.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 12: 16-step color image reconstruction. (a) Mona Lisa. (b) Successful reconstruction includes use of different colors. (c) Fail to use different colors.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 13: Comparison of stroke orders between human and agent. We can see the stroke order is completely chaotic compared to natural order.
|
| 201 |
+
|
| 202 |
+
# 6 DISCUSSION
|
| 203 |
+
|
| 204 |
+
For future work, there are several major improvements we want to make both to the network structure and to the algorithm.
|
| 205 |
+
|
| 206 |
+
The recurrent structure adopted here is of the simplest form. We use this setup because we consider drawing as a Markov process, where the current action only depends on what the agent sees, the target image and the previous frame. More advanced structures like LSTM (Hochreiter & Schmidhuber, 1997) or GRU (Chung et al., 2014) may boost the performance. A stop sign can be also introduced to determine when to stop drawing, which can be useful in character reconstruction. For the agent, various attention mechanism could be incorporated to help the agent focus on undrawn regions, so that smear and blurry scribbles might be prevented.
|
| 207 |
+
|
| 208 |
+
Secondly, The generator and the agent were trained as two separate parts throughout the experiment. We can somehow train them as a whole: during the training of the agent, store all the intermediate stroke data. After a period of training, sample images from the real environment with the stroke data just collected, and train the generator with the data. By doing so in an iterative manner, the generator could fit better to the current agent and provide more reliable reconstructions, while a changing generator may potentially provide more valuable overall gradients.
|
| 209 |
+
|
| 210 |
+
It is also found useful to add a bit of randomness to the learning rate. Since different decoders of the agent learn at different rates, stochasticity results in more appealing results. For example, the agent usually fails to generalize to color images because it always sticks with one global average color (as shown in Figure 12). However, it sometimes generates appealing results with some randomness added during the training. As a result of this immobility, the way agent writes is dull compared to humans and reinforcement learning agents like SPIRAL. For instance, when writing the digit “8”, the agent is simply writing “3” with endpoints closed. Also, the agent avoids to make intersecting strokes over all datasets, although such actions are harmless and should be totally encouraged and explored! Thus, random sampling techniques could be added to the decision making process to encourage bolder moves. Finally, for the evaluation metrics, the naive $l ^ { 2 }$ loss can be combined with adversarial learning. If paired sequential data is available, we believe adding it to training will also improve the results.
|
| 211 |
+
|
| 212 |
+
# 7 CONCLUSION
|
| 213 |
+
|
| 214 |
+
In this paper we bring a proof-of-concept that an agent is able to learn from its neural simulation of an environment. Especially when the environment is deterministic given the action, or contains a huge action space, the proposed approach could be useful. Our primary contribution is that we devised a model-based method to approximate non-differentiable environment with neural network, and the agent trained with our method converges quickly on several datasets. It is able to adapt its skills to real world. Hopefully such approaches can be useful when dealing with more difficult reinforcement learning problems.
|
| 215 |
+
|
| 216 |
+
# ACKNOWLEDGEMENTS
|
| 217 |
+
|
| 218 |
+
This work was partially supported by the National Natural Science Foundation of China (U1711262, U1811264, 11501204). We thank our anonymous reviewers for their valuable feedback and opinions.
|
| 219 |
+
|
| 220 |
+
# REFERENCES
|
| 221 |
+
|
| 222 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 214–223, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR.
|
| 223 |
+
|
| 224 |
+
Phillip J. Barry and Ronald N. Goldman. A recursive evaluation algorithm for a class of catmullrom splines. SIGGRAPH Comput. Graph., 22(4):199–204, June 1988. ISSN 0097-8930. doi: 10.1145/378456.378511.
|
| 225 |
+
|
| 226 |
+
Edwin Catmull and Raphael Rom. A class of local interpolating splines. Computer Aided Geometric Design, pp. 317–326, 1974.
|
| 227 |
+
|
| 228 |
+
Junyoung Chung, C¸ aglar Gulc¸ehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of ¨ gated recurrent neural networks on sequence modeling. CoRR, abs/1412.3555, 2014.
|
| 229 |
+
|
| 230 |
+
Yaroslav Ganin, Tejas Kulkarni, Igor Babuschkin, S. M. Ali Eslami, and Oriol Vinyals. Synthesizing programs for images using reinforced adversarial learning. CoRR, abs/1804.01118, 2018.
|
| 231 |
+
|
| 232 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014.
|
| 233 |
+
|
| 234 |
+
Alex Graves. Generating sequences with recurrent neural networks. CoRR, abs/1308.0850, 2013.
|
| 235 |
+
|
| 236 |
+
David Ha and Douglas Eck. A neural representation of sketch drawings. CoRR, abs/1704.03477, 2017.
|
| 237 |
+
|
| 238 |
+
David Ha and Jurgen Schmidhuber. World models. ¨ CoRR, abs/1803.10122, 2018.
|
| 239 |
+
|
| 240 |
+
Aaron Hertzmann. A survey of stroke-based rendering. IEEE Computer Graphics and Applications, 23:70–81, 2003.
|
| 241 |
+
|
| 242 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 243 |
+
|
| 244 |
+
Zhewei Huang, Wen Heng, Yuanzheng Tao, and Shuchang Zhou. Stroke-based character reconstruction. arXiv preprint arXiv:1806.08990, 2018.
|
| 245 |
+
|
| 246 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, abs/1502.03167, 2015.
|
| 247 |
+
|
| 248 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. CoRR, abs/1312.6114, 2013.
|
| 249 |
+
|
| 250 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 2015.
|
| 251 |
+
|
| 252 |
+
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010.
|
| 253 |
+
|
| 254 |
+
Matthew M. Loper and Michael J. Black. OpenDR: An approximate differentiable renderer. In Computer Vision – ECCV 2014, volume 8695 of Lecture Notes in Computer Science, pp. 154– 169. Springer International Publishing, September 2014.
|
| 255 |
+
|
| 256 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. CoRR, abs/1411.1784, 2014.
|
| 257 |
+
|
| 258 |
+
Thu Nguyen-Phuoc, Chuan Li, Stephen Balaban, and Yong-Liang Yang. Rendernet: A deep convolutional network for differentiable rendering from 3d shapes. arXiv preprint arXiv, abs/1806.06575, 2018.
|
| 259 |
+
|
| 260 |
+
E. Nielsen, D.V. Fedorov, A.S. Jensen, and E. Garrido. The three-body problem with short-range interactions. Physics Reports, 347(5):373 – 459, 2001. ISSN 0370-1573. doi: https://doi.org/10. 1016/S0370-1573(00)00107-1.
|
| 261 |
+
|
| 262 |
+
Kenichiro Ofusa, Tomo Miyazaki, Yoshihiro Sugaya, and Shinichiro Omachi. Glyph-based data augmentation for accurate kanji character recognition. In 14th IAPR International Conference on Document Analysis and Recognition, ICDAR 2017, Kyoto, Japan, November 9-15, 2017, pp. 597–602. IEEE, 2017. ISBN 978-1-5386-3586-5. doi: https://doi.org/10.1109/ICDAR.2017.103.
|
| 263 |
+
|
| 264 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015.
|
| 265 |
+
|
| 266 |
+
Jurgen Schmidhuber. Making the world differentiable: On using self-supervised fully recurrent ¨ neural networks for dynamic reinforcement learning and planning in non-stationary environments. Technical report, 1990.
|
| 267 |
+
|
| 268 |
+
Jurgen Schmidhuber. One big net for everything. ¨ CoRR, abs/1802.08864, 2018.
|
| 269 |
+
|
| 270 |
+
Thomas W. Sederberg and Rida T. Farouki. Approximation by interval bezier curves. IEEE Computer Graphics and Applications, 12(5):87–95, 1992. doi: http://doi.ieeecomputersociety.org/10. 1109/38.156018.
|
| 271 |
+
|
| 272 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014.
|
| 273 |
+
|
| 274 |
+
Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 3483–3491. Curran Associates, Inc., 2015.
|
| 275 |
+
|
| 276 |
+
Ning Xie, Hirotaka Hachiya, and Masashi Sugiyama. Artist agent: A reinforcement learning approach to automatic stroke generation in oriental ink painting. CoRR, abs/1206.4634, 2012.
|
| 277 |
+
|
| 278 |
+
Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. Empirical evaluation of rectified activations in convolutional network. CoRR, abs/1505.00853, 2015.
|
| 279 |
+
|
| 280 |
+
# 8 APPENDIX
|
| 281 |
+
|
| 282 |
+
# 8.1 ENVIRONMENT DETAILS
|
| 283 |
+
|
| 284 |
+
Let $P _ { i } = [ x _ { i } , y _ { i } ] ^ { T }$ denote the coordinate of a sampled point. For a curve defined by points $P _ { 0 } , P _ { 1 } , P _ { 2 } , P _ { 3 }$ , the spline can be produced by:
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
C = \frac { t _ { 2 } - t } { t _ { 2 } - t _ { 1 } } B _ { 1 } + \frac { t - t _ { 1 } } { t _ { 2 } - t _ { 1 } } B _ { 2 } ,
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
where
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
{ \begin{array} { r l } & { B _ { 1 } = { \frac { t _ { 2 } - t } { t _ { 2 } - t _ { 0 } } } A _ { 1 } + { \frac { t - t _ { 0 } } { t _ { 2 } - t _ { 0 } } } A _ { 2 } , \quad B _ { 2 } = { \frac { t _ { 3 } - t } { t _ { 3 } - t _ { 1 } } } A _ { 2 } + { \frac { t - t _ { 1 } } { t _ { 3 } - t _ { 1 } } } A _ { 3 } , } \\ & { A _ { 1 } = { \frac { t _ { 1 } - t } { t _ { 1 } - t _ { 0 } } } P _ { 0 } + { \frac { t - t _ { 0 } } { t _ { 1 } - t _ { 0 } } } P _ { 1 } , \quad A _ { 2 } = { \frac { t _ { 2 } - t } { t _ { 2 } - t _ { 1 } } } P _ { 1 } + { \frac { t - t _ { 1 } } { t _ { 2 } - t _ { 1 } } } P _ { 2 } , } \\ & { A _ { 3 } = { \frac { t _ { 3 } - t } { t _ { 3 } - t _ { 2 } } } P _ { 2 } + { \frac { t - t _ { 2 } } { t _ { 3 } - t _ { 2 } } } P _ { 3 } , \quad t _ { i + 1 } = { \Vert } P _ { i + 1 } - P { i } { \Vert } _ { 2 } ^ { \alpha } + t _ { i } . } \end{array} }
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
with $\alpha = 0 . 5$ , $t _ { 0 } = 0$ and $i = { 0 , 1 , 2 , 3 }$
|
| 297 |
+
|
| 298 |
+
By interpolating $t$ from $t _ { 1 }$ to $t _ { 2 }$ linearly, we generate the curve between $P _ { 1 }$ and $P _ { 2 }$ . The pressure values between neighbouring points are interpolated linearly.
|
| 299 |
+
|
| 300 |
+
# 8.2 LOSSES
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
(a) Loss of encoder when trained separately at first. (b) Loss of generator trained on our 600K dataset.
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 14: Training loss of generator and agent. The agent loss equals to the $l ^ { 2 }$ distance between the generator output and agent input plus the penalty term constraining the average point distance within a stroke. For (c) and (d) the learning rate is set to $1 0 ^ { - 4 }$ , batch size equals to 64.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 15: A trained StrokeNet generates images that resemble the output of painting software. The first row depicts results generated by our model (left) and by the software (right) given the same input. The second row shows the model could produce strokes with color and texture using simple arithmetic operations. The third and fourth row shows the model’s ability to draw MNIST digits (left) on both its own generative model (middle) and real-world painting software (right).
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 16: (a) A trained position encoder maps two $( x _ { i } , y _ { i } , p _ { i } )$ tuples to two feature maps. (b) Each pair of neighbouring features are added together to eliminate sparsity and preserve sequential information. (c) A trained brush encoder encodes color and radius information into a spatial feature which is later concatenated to the end of position features.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 17: The generator tries to predict what the real environment would ouput given the same input stroke data. Software output (left), generator prediction (right).
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 18: Interpolation across four digits. In the corners are the four MNIST samples.
|
md/train/Hke-WTVtwr/Hke-WTVtwr.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ENCODING WORD ORDER IN COMPLEX EMBEDDINGS
|
| 2 |
+
|
| 3 |
+
Benyou Wang ∗ University of Padua wang@dei.unipd.it
|
| 4 |
+
|
| 5 |
+
Donghao Zhao ∗ Tianjin University zhaodh@tju.edu.cn
|
| 6 |
+
|
| 7 |
+
Christina Lioma University of Copenhagen chrh@di.ku.dk
|
| 8 |
+
|
| 9 |
+
Qiuchi Li University of Padua qiuchili@dei.unipd.it
|
| 10 |
+
|
| 11 |
+
Peng Zhang † Tianjin University pzhang@tju.edu.cn
|
| 12 |
+
|
| 13 |
+
Jakob Grue Simonsen University of Copenhagen simonsen@di.ku.dk
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Sequential word order is important when processing text. Currently, neural networks (NNs) address this by modeling word position using position embeddings. The problem is that position embeddings capture the position of individual words, but not the ordered relationship (e.g., adjacency or precedence) between individual word positions. We present a novel and principled solution for modeling both the global absolute positions of words and their order relationships. Our solution generalizes word embeddings, previously defined as independent vectors, to continuous word functions over a variable (position). The benefit of continuous functions over variable positions is that word representations shift smoothly with increasing positions. Hence, word representations in different positions can correlate with each other in a continuous function. The general solution of these functions is extended to complex-valued domain due to richer representations. We extend CNN, RNN and Transformer NNs to complex-valued versions to incorporate our complex embedding (we make all code available). Experiments 1 on text classification, machine translation and language modeling show gains over both classical word embeddings and position-enriched word embeddings. To our knowledge, this is the first work in NLP to link imaginary numbers in complexvalued representations to concrete meanings (i.e., word order).
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
When processing text, the sequential structure of language is important, but can be computationally costly to model with neural networks (NNs) (Socher et al., 2011) due to the difficulty in parallelization. This has been alleviated by modeling word sequence not on the NN architecture level, but by adding position embeddings on the feature level. This has been done by the convolutional sequence model (ConvSeq) (Gehring et al., 2017) and the Transformer model (Vaswani et al., 2017) that replaces recurrent and convolution operations with purely attention mechanisms. More generally, vanilla position embeddings (Gehring et al., 2017) assume that individual word positions are independent and do not consider relations between neighbouring word positions. We posit that both the global absolute positions of words and their inner sequential and adjacent relationships are crucial in language. This is supported by recent empirical findings by Shaw et al. (2018) and Dai et al. (2019) who show the importance of modeling distance between sequential elements, and explicitly use extra relative position encodings to capture the relative-distance relationship of words.
|
| 22 |
+
|
| 23 |
+
We present a novel and principled approach to model both the global absolute positions of words and their inner sequential and adjacent relationships as follows: we extend each word embedding, previously defined as an independent vector, as a continuous function over an independent variable i.e., position. The benefit of continuous functions over variable positions is that word representations shift smoothly with increasing positions. Hence, word representations in different positions can correlate with each other in a continuous function. Fig. 1 illustrates this type of word representation with a three-dimensional complex-valued embedding, where the amplitudes $\{ r _ { 1 } , r _ { 2 } , r _ { 3 } \}$ denote semantic aspects corresponding to classical word vectors, and periods $\{ p _ { 1 } , p _ { 2 } , p _ { 3 } \}$ denote how sensitive the word is to positional information. We further discuss the necessary properties of these functions to model sequential information and obtain a general solution in the form of a complexvalued embedding. Interestingly, there is a direct connection between a specific case of our general embedding and the well-known positional encoding in Vaswani et al. (2017) (see App. A).
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: 3-dimensional complex embedding for a single word in different positions. The three wave functions (setting the initial phases as zero) show the real part of the embedding; the imaginary part has a $\frac { \pi } { 2 }$ phase difference and shows the same curves with its real-valued counterpart. The $\mathbf { X }$ -axis denotes the absolute position of a word and the y-axis denotes the value of each element in its word vector. Colours mark different dimensions of the embedding. The three cross points between the functions and each vertical line (corresponding to a specific position pos) represent the embedding for this word in the pos-th position.
|
| 27 |
+
|
| 28 |
+
We contribute (i) a novel paradigm that extends word vectors as continuous functions over changing variables like word position, and (ii) a general word embedding that models word order in a mathematically-sound manner. We integrate our complex word embeddings in state-of-the-art (SOTA) NN architectures (CNN, RNN, Transformer and experimentally find that it yields gains over both classical word embeddings and position-enriched word embeddings in text classification, machine translation and language modeling. Note that this is the first work in NLP to link imaginary numbers in complex-valued representation to concrete meanings (i.e., word order).
|
| 29 |
+
|
| 30 |
+
# 2 MODELLING WORD ORDER IN EMBEDDING SPACE
|
| 31 |
+
|
| 32 |
+
A Word Embedding (WE) generally defines a map $f _ { w e } : \mathbb { N } \mathbb { R } ^ { D }$ from a discrete word index to a $D$ -dimensional real-valued vector and $\mathbb { N } = \{ 0 , 1 , 2 , \ldots \}$ . Similarly, a Position Embedding (PE) (Gehring et al., 2017; Vaswani et al., 2017) defines another map $f _ { p e } : \mathbb { N } \mathbb { R } ^ { D }$ from a discrete position index to a vector. The final embedding for word $w _ { j }$ $\mathbf { \Phi } _ { w _ { j } } \in \mathbb { W }$ with index $j$ in a given vocabulary W) in the pos-th position in a sentence is usually constructed by the sum
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
f ( j , p o s ) = f _ { w e } ( j ) + f _ { p e } ( p o s ) ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
and $f ( j , p o s ) \in \mathbb { R } ^ { D }$ . Since both the word embedding map $f _ { w }$ and the position embedding map $f _ { p }$ only take integer values as word indexes or position indexes, embedding vectors for individual words or positions are trained independently. The independent training for each word vector is reasonable, since a word index is based on the order of a given arbitrary vocabulary and does not capture any specific sequential relationship with its neighboring words. However, the position index captures an ordered relationship, for instance adjacency or precedence, leading to the problem that position embeddings in individual positions (Gehring et al., 2017) are independent of each other; the ordered relationship between positions is not modelled. We refer to this as the position independence problem. This problem becomes more crucial when position embeddings are used in position-insensitive NNs, e.g., FastText (Mikolov et al., 2013b), ConvSeq (Gehring et al., 2017) and Transformer (Vaswani et al., 2017), because it is hard for such position-insensitive NNs with vanilla position embeddings (Gehring et al., 2017) to infer that $w _ { j _ { 1 } }$ in the pos-th position is close to $w _ { j _ { 2 } }$ in the $p o s + 1$ -th position, or that $w _ { j _ { 1 } }$ precedes $w _ { j _ { 2 } }$ ; instead, it is only inferred that $w _ { j _ { 1 } }$ and $w _ { j _ { 2 } }$ are in different positions, while the relative distance between them is almost unknown. Thus vanilla position embeddings (Gehring et al., 2017) cannot fully capture the sequential aspect of language.
|
| 39 |
+
|
| 40 |
+
Next, we first introduce the necessary properties to model word order in embeddings, and then give a unique solution to meet such properties.
|
| 41 |
+
|
| 42 |
+
# 2.1 EXTENDING VECTORS TO FUNCTIONS
|
| 43 |
+
|
| 44 |
+
In the general definition in Eq. 1, each dimension of the position embedding is obtained based on the discrete position indexes $\{ 0 , 1 , 2 , . . . , \mathrm { p o s } , . . . \}$ . This makes it difficult to model the ordered relationship between the positions. One solution to this problem is to build continuous functions over a variable (i.e., position index) to represent a specific word in an individual dimension. Formally, we define a general embedding as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
f ( j , \mathrm { p o s } ) = \pmb { g } _ { j } ( \mathrm { p o s } ) \in \mathbb { R } ^ { D } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where ${ \pmb g } _ { \mathcal { I } }$ is short for $\pmb { g } _ { w e } ( j ) \in ( \mathcal { F } ) ^ { D }$ , indicating $D$ functions over position index pos, and $g _ { w e } ( \cdot ) :$ : $\mathbb { N } \to ( \mathcal { F } ) ^ { D }$ is a mapping from a word index to $D$ functions. By expanding the $D$ dimension of ${ \pmb g } _ { \mathcal { I } }$ , a word $w _ { j }$ in the pos-th position can be represented as a $D$ -dimensional vector as shown in
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
[ g _ { j , 1 } ( \mathbf { p o s } ) , g _ { j , 2 } ( \mathbf { p o s } ) , . . . , g _ { j , D } ( \mathbf { p o s } ) ] \in \mathbb { R } ^ { D } ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
in which $\forall g _ { j , d } ( \cdot ) \in \mathcal { F } : \mathbb { N } \to \mathbb { R } , d \in \{ 1 , 2 , . . . , D \}$ is a function over the position index pos. To move the word $w _ { j }$ from the current position $p o s$ to another one $p o s ^ { \prime }$ , it needs only replace the variable pos to $p o s ^ { \prime }$ without changing ${ \pmb g } _ { \mathcal { I } }$ .
|
| 57 |
+
|
| 58 |
+
Functions for words, especially continuous functions, are expected to capture smooth transformation from a position to its adjacent position therefore modeling word order. The position-independent position embedding (Gehring et al., 2017) can be considered as a special case of our definition when it only takes independent values for individual positions in the embedding function.
|
| 59 |
+
|
| 60 |
+
# 2.2 PROPERTIES FOR THE FUNCTIONS TO CAPTURE WORD ORDER
|
| 61 |
+
|
| 62 |
+
Relative distance is hard to compute because position indices are not visible in NNs after vector embedding (discrete position indices are necessarily embedded as vectors like words to be backpropagated with the gradient). Hence, we claim that the modeling of relative distance in NNs should be position-free: absolute position indices cannot be directly accessed in intermediate layers. Instead of processing position-free operations in NNs to capture relative distance between words, prior work (Shaw et al., 2018; Dai et al., 2019) first calculates the relative distance between words, and then feeds the relative distance as an additional feature or as embeddings/weights to NNs, instead of directly feeding with the raw position indices.
|
| 63 |
+
|
| 64 |
+
Assume that words are embedded into $\mathbb { R } ^ { D }$ , and let, for $1 \leq d \leq D$ , the function $g _ { j , d } : \mathbb { N } \mathbb { R }$ be the embedding function giving the $d$ -th coordinate of the representation of word $w _ { j }$ (i.e., $g _ { j , d } ( \mathfrak { p o s } )$ is the $d$ -th coordinate of the embedding of $w _ { j }$ if it occurs at position pos. In the following, we simply write $g$ instead of $g _ { j , d }$ when there is no risk of confusion. Ideally, one would like there to exist a function Tran $\operatorname { s f o r m } _ { n } : \mathbb { R } \mathbb { R }$ that transforms the embedding of any word at some position pos to the embedding of a word at position $\boldsymbol { \mathrm { p o s } } + n$ such that Transform $^ { 1 } n$ is only dependent on the embedded value itself, but independent of the position pos, that is $\forall \mathbf { p o s } : g ( \mathbf { p o s } + n ) { \overline { { = \mathrm { T r a n s f o r m } _ { n } ( g ( \mathbf { p o s } ) ) } } }$ .
|
| 65 |
+
|
| 66 |
+
Prior work in NLP (Li et al., 2019), Information Retrieval (Van Rijsbergen, 2004) and Machine Learning (Trabelsi et al., 2017) has shown the usefulness of complex numbers as richer representations. Complex word embeddings (Wang et al., 2019; Li et al., 2019; Li et al., 2018) have been used to model language. To investigate the potential of complex-valued representation, we extend the target domains of $g ( \cdot )$ from $\mathbb { R } ^ { D }$ to $\mathbb { C } ^ { D }$ without losing generality, since real-valued numbers are specific complex numbers with their imaginary part being zero. This property regarding “position-free offset transformation” in complex-valued domains is formally defined in Property 1 below.
|
| 67 |
+
|
| 68 |
+
Property 1. Position-free offset transformation: An embedding function $g : \mathbb { N } \to \mathbb { C }$ is said to be a position-free offset transformation if there exists a function Transform : $\mathbb { N } \times \mathbb { C } \to \mathbb { C }$ (called the witness) such that for all $n \geq 1$ , the function Transfor $\mathfrak { m } _ { n } ( \cdot ) = \mathrm { T r a n s f o r m } ( n , \cdot )$ satisfies $\forall \mathsf { p o s } \in$ $\mathbb { N } : g ( \mathrm { p o s } + n ) = \mathrm { T r a n s f o r m } _ { n } ( g ( \mathrm { p o s } ) )$ . A position-free offset transformation $g$ is said to be linearly witnessed if there is a function $w : \mathbb { N } \mathbb { C }$ such that $g$ has a witness Transform satisfying, for all $n$ , Transform $\operatorname { \mathrm { 1 } } ( n , \operatorname { p o s } ) = \operatorname { T r a n s f o r m } _ { n } ( \operatorname { p o s } ) = w ( n )$ (i.e., each Transform $_ n$ is a linear function).
|
| 69 |
+
|
| 70 |
+
Additionally, a boundedness property is necessary to ensure that the position embedding can deal with text of any length (pos could be large in a long document).
|
| 71 |
+
|
| 72 |
+
Property 2. Boundedness: The function over the variable position should be bounded, i.e. $\exists \delta \in$
|
| 73 |
+
$\overline { { \mathbb { R } ^ { + } , \forall \mathrm { p o s } \in \mathbb { N } } } , | g ( \mathrm { p o s } ) | \leq \delta$ .
|
| 74 |
+
|
| 75 |
+
Formally, we prove the following claim that there is a unique solution that meets Properties 1 and 2 under the condition that the embedding function is linearly witnessed. We use linear functions because they are well-understood and simple with a single floating-point operation in NNs.
|
| 76 |
+
|
| 77 |
+
Claim 1. A function $g : \mathbb { N } \mathbb { C }$ is a bounded and linearly witnessed position-free offset transformation iff it is on the form $g ( p o s ) = z _ { 2 } z _ { 1 } ^ { p o s }$ for $z _ { 1 } , z _ { 2 } \in \mathbb { C }$ with $| z _ { 1 } | \le 1$ .
|
| 78 |
+
|
| 79 |
+
Proof. Assume that $g$ is a bounded and linearly witnessed position-free offset transformation. Then, by linear witnessing, we have for all pos, $n _ { 1 } , n _ { 2 } \in \mathbb { N }$ :
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { w ( n _ { 1 } ) w ( n _ { 2 } ) g ( \mathrm { p o s } ) = w ( n _ { 2 } ) g ( \mathrm { p o s } + n _ { 1 } ) = g ( \mathrm { p o s } + n _ { 1 } + n _ { 2 } ) \qquad } \\ { = \mathrm { T r a n s f o r m } _ { n _ { 1 } + n _ { 2 } } ( g ( \mathrm { p o s } ) ) = w ( n _ { 1 } + n _ { 2 } ) g ( \mathrm { p o s } ) } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
whence $w ( n _ { 1 } + n _ { 2 } ) = w ( n _ { 1 } ) w ( n _ { 2 } )$ . Write $w ( 1 ) = z _ { 1 }$ and $g ( 0 ) = z _ { 2 }$ . As $n _ { 1 } , n _ { 2 } \in \mathbb { N }$ were arbitrary, Furthermore, observe that for we have $w ( n ) = ( w ( 1 ) ) ^ { n } = z _ { 1 } ^ { n }$ $\mathsf { p o s } \geq 1$ for all , we have $n \in \mathbb N$ . But then $g ( \mathrm { p o s } ) = g ( 1 + \mathrm { p o s } - 1 ) = w ( \mathrm { p o s } ) g ( 0 ) = z _ { 1 } ^ { \mathrm { p o s } } z _ { 2 } =$ $g ( \mathrm { p o s } + n ) = w ( n ) g ( \mathrm { p o s } ) = z _ { 1 } ^ { n } g ( \mathrm { p o s } )$ . $z _ { 2 } z _ { 1 } ^ { \mathrm { p o s } }$ . For $\mathrm { p o s } = 0$ , $g ( 0 ) = z _ { 2 } = z _ { 2 } z _ { 1 } ^ { 0 }$ , whence $g ( \mathrm { p o s } ) = z _ { 2 } z _ { 1 } ^ { \mathrm { p o s } }$ 1 2 , as desired. Observe that if $| z _ { 1 } | > 1$ $g ( { \mathfrak { p o s } } )$ unbouwith hence w. Then, $| z _ { 1 } | \le 1$ hat , w $g$ is once $g ( \mathsf { p o s } ) \stackrel { - } { = } z _ { 2 } z _ { 1 } ^ { \mathsf { p o s } }$ $| z _ { 1 } | \le 1$ $| g ( \mathrm { p o s } ) | \stackrel { \cdot } { \leq } | z _ { 2 } z _ { 1 } ^ { \mathrm { p o s } } | \leq | z _ { 2 } | | \dot { z } _ { 1 } ^ { \mathrm { p o s } } | \leq | z _ { 2 } |$ $g$ is bounded. Define, for each $n \in \mathbb N$ , $w ( n ) = z _ { 1 } ^ { n }$ and Transf ${ \mathrm { y r m } } _ { n } ( { \mathrm { p o s } } ) = w ( n ) { \mathrm { p o s } }$ . Then, for all pos, $n \in \mathbb { N }$ ,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
g ( \mathsf { p o s } + n ) = z _ { 2 } z _ { 1 } ^ { \mathsf { p o s } + n } = z _ { 2 } z _ { 1 } ^ { \mathsf { p o s } } z _ { 1 } ^ { n } = g ( \mathsf { p o s } ) z _ { 1 } ^ { n } = \mathrm { T r a n s f o r m } _ { n } ( g ( \mathsf { p o s } ) )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
showing that $g$ is a linearly witnessed position-free offset transformation.
|
| 92 |
+
|
| 93 |
+
For any $z \in \mathbb { C }$ , we may write $z = r e ^ { i \theta } = r ( \cos \theta + i \sin \theta )$ . Thus, for the general form of the embedding $g$ from Theorem 1, we have:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
g ( \mathsf { p o s } ) = z _ { 2 } z _ { 1 } ^ { \mathsf { p o s } } = r _ { 2 } e ^ { i \theta _ { 2 } } ( r _ { 1 } e ^ { i \theta _ { 1 } } ) ^ { \mathsf { p o s } } = r _ { 2 } r _ { 1 } ^ { \mathsf { p o s } } e ^ { i ( \theta _ { 2 } + \theta _ { 1 } \mathsf { p o s } ) } ~ \mathrm { s u b j e c t } ~ \mathsf { t o } ~ | r _ { 1 } | \leq 1
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
In implementations, the above definition of $g$ will lead to an optimization problem due to the constraint $| r _ { 1 } | \le 1$ . A natural and simple way to avoid this is to fix $r _ { 1 } = 1$ ; note that $| e ^ { i x } | \equiv 1$ , thus automatically satisfying the constraint, in contrast to a real-valued embedding where one would need to explicitly devise functions satisfying the constraint. Finally, Eq. 4 can be written in the simplified form: $g ( \mathrm { p o s } ) = r e ^ { i ( \omega \mathrm { p o s } + \theta ) }$ . Thus, one can think of $g$ as embedding positions counterclockwise on a complex circle of radius $r$ with a fixed period $\dot { \boldsymbol { r } }$ is the amplitude term, $\theta$ is the initial phase term, $\frac { \omega } { 2 \pi }$ is the frequency, and $\frac { 2 \pi } { \omega }$ is the period term).
|
| 100 |
+
|
| 101 |
+
# 2.3 COMPLEX-VALUED WORD EMBEDDING
|
| 102 |
+
|
| 103 |
+
We now define our complex-valued word embedding $g$ as a map taking a word index $j$ and position word index pos to $\mathbb { C } ^ { D }$ . For a word $w _ { j }$ in position pos, our general complex-valued embedding is defined as $f ( j , \mathrm { p o s } ) = { { g } _ { j } } ( \mathrm { p o s } ) = { { r } _ { j } } { { e } ^ { i ( \omega _ { j } \mathrm { p o s } + { { \theta } _ { j } } ) } }$ . Therefore, $f ( j , { \mathfrak { p o s } } )$ is defined as:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
[ r _ { j , 1 } e ^ { i ( \omega _ { j , 1 } \mathrm { p o s } + \theta _ { j , 1 } ) } , . . . , r _ { j , 2 } e ^ { i ( \omega _ { j , 2 } \mathrm { p o s } + \theta _ { j , 2 } ) } , \cdot \cdot \cdot , r _ { j , D } e ^ { i ( \omega _ { j , D } \mathrm { p o s } + \theta _ { j , D } ) } ]
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Note that each coordinate $d$ $1 \leq d \leq D )$ has a separate amplitude $\boldsymbol { r } _ { j , d }$ , period $\begin{array} { r } { p _ { j , d } = \frac { 2 \pi } { \omega _ { j , d } } } \end{array}$ , and initial phase $\theta _ { j , d }$ . In Fig. 1 each dimension is represented as a wave which is parameterized by an amplitude, a period/frequency, and an initial phase. The trainable parameters of the embedding are the amplitudes vector $\boldsymbol { r } _ { j } = [ r _ { j , 1 } , . . . , r _ { j , D } ]$ , the period/frequency related weights $\omega _ { j } = [ \omega _ { j , 1 } , . . . , \omega _ { j , D } ] ,$ , and the initial phase vector $\pmb { \theta } _ { j } = [ \theta _ { j , 1 } , . . . , \theta _ { j , D } ]$ . Note that the mean values of $f ( j , \cdot )$ over all positions are linearly dependent on the amplitude. Observe that the period/frequency determines to what degree the word is sensitive to the position. With an extremely long period (i.e., $\omega _ { j }$ very small), the complex-valued embedding is approximately constant for all possible values of pos, and hence approximates a standard word embedding. Conversely, if the period is short, the embedding will be highly sensitive to the position argument.
|
| 110 |
+
|
| 111 |
+
In our embedding, the mean vectors of $f ( j , \cdot )$ taken over all positions are linearly correlated to the amplitude embedding $\pmb { r } _ { j } = [ r _ { j , 1 } , . . . , r _ { j , K } ]$ with a coefficient $\frac { 2 } { \pi }$ . The amplitude $\boldsymbol { r } _ { j , d }$ of our embedding depends only on the word $w _ { j }$ (and coordinate $d$ ), not on the position of the word, whence one can think of the vector $g _ { p e } ( j , \mathrm { p o s } ) = [ e ^ { i ( \omega _ { j , 1 } \mathrm { p o s } + \theta _ { j , 1 } ) } , \cdot \cdot \cdot , e ^ { i ( \omega _ { j , D } \mathrm { p o s } + \theta _ { j , D } ) } ]$ as a “purely” positional embedding. Consequently, our complex embedding can be considered an element-wise multiplication between the word embedding $\bar { g _ { w e } ( j ) } = [ r _ { j , 1 } , . . . , \bar { r _ { j , K } } ]$ and position embedding $g _ { p e }$ .
|
| 112 |
+
|
| 113 |
+
Table 1: Dataset Statistics. CV means 10-fold cross validation. The last 2 datasets come with train/dev/test splits.
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Dataset</td><td>train</td><td>test</td><td>vocab.</td><td>task</td><td>Classes</td></tr><tr><td>CR (Hu & Liu,2014)</td><td>4K</td><td>CV</td><td>6K</td><td>product reviews</td><td>2</td></tr><tr><td>MPQA (Wiebe et al., 2005)</td><td>11k</td><td>CV</td><td>6K</td><td>opinion polarity</td><td>2</td></tr><tr><td>SUBJ (Pang & Lee,2005)</td><td>10k</td><td>CV</td><td>21k</td><td>subjectivity</td><td>2</td></tr><tr><td>MR (Pang & Lee,2005)</td><td>11.9k</td><td>CV</td><td>20k</td><td>moviereviews</td><td>2</td></tr><tr><td>SST (Socher et al.,2013)</td><td>67k</td><td>2.2k</td><td>18k</td><td>movie reviews</td><td>2</td></tr><tr><td>TREC (Li& Roth,2002)</td><td>5.4k</td><td>0.5k</td><td>10k</td><td>Question</td><td>6</td></tr></table>
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
f ( j , \mathrm { p o s } ) = g _ { w e } ( j ) \odot g _ { p e } ( j , \mathrm { p o s } )
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
Prior work (Gehring et al., 2017; Vaswani et al., 2017) uses mean-weight addition between word embeddings $f _ { w e }$ and position embeddings $f _ { p e }$ (all words share the weights). In our work, word embeddings and position embeddings are decoupled to some extent by element-wise multiplication and therefore the frequency/period terms (related to $\omega _ { j , d } )$ ) can adaptively adjust the importance between semantic and position information for each word and each dimension. In particular, with higher frequency (i.e., large $\omega _ { j , d } )$ , the final embedding will change dramatically with the changing positions, while it can be fixed for any positions with an extremely-small frequency (i.e., small $\omega _ { j , d } )$ . Interestingly, the well-known position embedding in Transformer (Vaswani et al., 2017) can be seen as a degraded version of one of our specific complex word embeddings (see the Appendix A).
|
| 122 |
+
|
| 123 |
+
# 3 EXPERIMENTAL EVALUATION
|
| 124 |
+
|
| 125 |
+
We evaluate our embeddings in text classification, machine translation and language modeling.
|
| 126 |
+
|
| 127 |
+
# 3.1 TEXT CLASSIFICATION
|
| 128 |
+
|
| 129 |
+
Experimental Setup. We use six popular text classification datasets: CR, MPQA, SUBJ, MR, SST, and TREC (see Tab. 1). We use accuracy as evaluation measure based on fixed train/dev/test splits or cross validation, as per prior work. We use Fasttext (Joulin et al., 2016), CNN (Kim, 2014), LSTM and Transformer (Vaswani et al., 2017) as NN baselines2. We use each of them: (1) without positional information; (2) with Vanilla Position Embeddings (PE) (randomly initialized and updated during training using the sum between word and position vectors (Gehring et al., 2017); (3) with Trigonometric Position Embeddings (TPE) (defining position embeddings as trigonometric functions as per Eq. 7); (4) with Complex-vanilla word embeddings (where the amplitude embedding is initialized by the pre-trained word vectors, and the phrase embedding is randomly initialized in a range from $- \pi$ to $\pi$ without considering word order (Wang et al., 2019)); and (5) with our order-aware complex-valued word embeddings, Complex-order (which encode position in the phase parts, train the periods, and where the amplitude embedding is also initialized by pretrained word vectors). For more details on the complex-valued extensions of NNs, see App. B and App. C.
|
| 130 |
+
|
| 131 |
+
Our embedding generally has $3 \times D \times | \mathbb { W } |$ parameters with D-dimensional word vectors and $| \mathbb { W } |$ words, while previous work (Mikolov et al., 2013b; Pennington et al., 2014) usually employs only $D \times | \mathbb { W } |$ parameters for embedding lookup tables. To increase efficiency and facilitate fair comparison with previous work we set initial phases $\pmb { \theta } _ { j } = [ \theta _ { j , 1 } , . . . , \theta _ { j , D } ]$ to a shared constant value (such as zero). Furthermore, the period vectors $\omega _ { j , d }$ depend on word index $j$ with length $\lvert \mathbb { W } \rvert$ and the coordinate index $d$ with length $D$ . To decrease the number of parameters, one can either use a word-sharing scheme (i.e., $\omega _ { j , d } = \omega _ { \cdot , d } )$ ), or a dimension-sharing scheme $( \omega _ { j , d } = \omega _ { j , \cdot } )$ , leading to $| \mathbb { W } | * D + | \bar { \mathbb { W } } |$ and $| \mathbb { W } | * D + D$ parameters in total for the embedding layer.
|
| 132 |
+
|
| 133 |
+
Table 2: Text classification accuracy without position embeddings, with random position embeddings (PE), with trigonometric position embeddings (TPE), with complex-valued NNs without position embeddings (complex-vanilla), and with our complex-order embeddings. Superscripts $\ S$ , †, ‡ and ∗ mean a significant improvement over a baseline without position embeddings §, $\mathrm { P } \bar { \mathrm { E } } ^ { \dagger }$ , $\mathrm { \Delta T P E ^ { \ddagger } }$ and Complex-vanilla ∗ using Wilcoxon’s signed-rank test $\mathrm { p } { < } 0 . 0 5$ .
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Method</td><td>MR</td><td>SUBJ</td><td>CR</td><td>MPQA</td><td>SST</td><td>TREC</td></tr><tr><td>Fasttext</td><td>0.765</td><td>0.916</td><td>0.789</td><td>0.874</td><td>0.788</td><td>0.874</td></tr><tr><td>Fasttext-PE</td><td>0.774</td><td>0.922</td><td>0.789</td><td>0.882</td><td>0.791</td><td>0.874</td></tr><tr><td>Fasttext-TPE</td><td>0.776</td><td>0.921</td><td>0.796</td><td>0.884</td><td>0.792</td><td>0.88</td></tr><tr><td>Fasttext-Complex-vanilla</td><td>0.773</td><td>0.918</td><td>0.79</td><td>0.867</td><td>0.803</td><td>0.872</td></tr><tr><td>Fasttext-Complex-order</td><td>0.7878+t*</td><td>0.9298†t*</td><td>0.800$+*</td><td>0.8898†t*</td><td>0.809S十**</td><td>0.8928+**</td></tr><tr><td>LSTM</td><td>0.775</td><td>0.896</td><td>0.813</td><td>0.887</td><td>0.807</td><td>0.858</td></tr><tr><td>LSTM-PE</td><td>0.778</td><td>0.915</td><td>0.822</td><td>0.889</td><td>0.811</td><td>0.858</td></tr><tr><td>LSTM-TPE</td><td>0.776</td><td>0.912</td><td>0.814</td><td>0.888</td><td>0.813</td><td>0.865</td></tr><tr><td>LSTM-Complex-vanilla</td><td>0.765</td><td>0.907</td><td>0.810</td><td>0.823</td><td>0.784</td><td>0.784</td></tr><tr><td>LSTM-Complex-order</td><td>0.7908+t*</td><td>0.9268+*</td><td>0.828S+*</td><td>0.8978†**</td><td>0.8198†**</td><td>0.869$+**</td></tr><tr><td>CNN</td><td>0.809</td><td>0.928</td><td>0.830</td><td>0.894</td><td>0.856</td><td>0.898</td></tr><tr><td>CNN-PE</td><td>0.816</td><td>0.938</td><td>0.831</td><td>0.897</td><td>0.856</td><td>0.890</td></tr><tr><td>CNN-TPE</td><td>0.815</td><td>0.938</td><td>0.836</td><td>0.896</td><td>0.838</td><td>0.918</td></tr><tr><td>CNN-Complex-vanilla</td><td>0.811</td><td>0.937</td><td>0.825</td><td>0.878</td><td>0.823</td><td>0.900</td></tr><tr><td>CNN-Complex-order</td><td>0.8258+t*</td><td>0.9518十**</td><td>0.852$十**</td><td>0.9068†**</td><td>0.8648+*</td><td>0.9398+**</td></tr><tr><td>Transformer w/o position embedding</td><td>0.669</td><td>0.847</td><td>0.735</td><td>0.716</td><td>0.736</td><td>0.802</td></tr><tr><td>Transformer-PE</td><td>0.737</td><td>0.859</td><td>0.751</td><td>0.722</td><td>0.753</td><td>0.820</td></tr><tr><td>Transformer-TPE (Vaswani et al., 2017)</td><td>0.731</td><td>0.863</td><td>0.762</td><td>0.723</td><td>0.761</td><td>0.834</td></tr><tr><td>Transformer-Complex-vanilla</td><td>0.715</td><td>0.848</td><td>0.753</td><td>0.786</td><td>0.742</td><td>0.856</td></tr><tr><td>Transformer-Complex-order</td><td>0.7468+*</td><td>0.895$+*</td><td>0.806$+**</td><td>0.863$+**</td><td>0.813$†*</td><td>0.8968†**</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 3: Text classification accuracy. $\star$ means that scores are reported from other papers.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Method</td><td>MR</td><td>SUBJ</td><td>CR</td><td>MPQA</td><td>SST</td><td>TREC</td></tr><tr><td>Word2vec Bow (Conneau et al.,2017) *</td><td>0.777</td><td>0.909</td><td>0.798</td><td>0.883</td><td>0.797</td><td>0.836</td></tr><tr><td>Sent2Vec (Pagliardini et al., 2017) *</td><td>0.763</td><td>0.912</td><td>0.791</td><td>0.872</td><td>0.802</td><td>0.858</td></tr><tr><td>QuickThoughts (Logeswaran & Lee,2018)*</td><td>0.824</td><td>0.948</td><td>0.860</td><td>0.902</td><td>1</td><td>0.928</td></tr><tr><td>InferSent (Conneau et al., 2017) *</td><td>0.811</td><td>0.924</td><td>0.863</td><td>0.902</td><td>0.846</td><td>0.882</td></tr><tr><td>QPDN (Wang et al., 2019) *</td><td>0.801</td><td>0.927</td><td>0.810</td><td>0.870</td><td>0.839</td><td>0.882</td></tr></table>
|
| 140 |
+
|
| 141 |
+
We search the hyper parameters from a parameter pool, with batch size in $\{ 3 2 , 6 4 , 1 2 8 \}$ , learning rate in $\{ 0 . 0 0 1 , 0 . 0 0 0 1 , 0 . 0 0 0 0 1 \}$ , L2-regularization rate in $\{ 0 , 0 . 0 0 1 , 0 . 0 0 0 1 \}$ , and number of hidden layer units in $\{ 1 2 0 , 1 2 8 \}$ . We use pre-trained 300-dimensional vectors from word2vec (Mikolov et al., 2013a) in all models except for Transformers. The models with trainable trigonometric position embedding produce nearly identical results compared to the non-trainable version, therefore we report the result of fixed position embeddings as per Vaswani et al. (2017). We adopt narrow convolution and max pooling in CNN, with number of filters in $\{ 6 4 , 1 2 8 \}$ , and size of filters in $\{ 3 , 4 , 5 \}$ . In all Transformer models, we only use the encoder layer to extract feature information, where the layer is 1, dimension of word and inner hidden are 256 and 512 respectively, and head number is 8.
|
| 142 |
+
|
| 143 |
+
Results. The results are shown in Tab. 2. Our complex-order embeddings outperform all other variations at all times. This gain in effectiveness comes at a negligible (or non-existent) cost in efficiency (it varies per NN architecture – see Fig. 2). CNNs are the best performing NN as expected following Bai et al. (2018). Tranformer NNs benefit the most from our complex-order embeddings, most likely because they are our weakest baseline. To contextualise these results, Tab. 3 shows classification accuracy of five typical approaches on the same datasets (as reported in the original papers). Our complex-order embeddings outperform all methods, except for the CR dataset, where InferSent is marginally better. Overall, our approach is on a par with the SOTA in embeddings.
|
| 144 |
+
|
| 145 |
+
We perform an ablation test (Tab. 4) on Transformer because it is the most common NN to be used with position embeddings. The two period-sharing schemas (dimension-sharing and word-sharing)
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 2: Computation time (seconds) per epoch in Tensorflow on TITAN X GPU.
|
| 149 |
+
|
| 150 |
+
Table 4: Ablation test for Transformer, showing the effect of (i) the definition of embedding layer $( f _ { d } ( j , \mathsf { p o s } ) )$ , and (ii) whether the real-part and imaginary transition share the weights, i.e., $\Re ( W ^ { Q / K / V } ) = \Im ( W ^ { Q / K / V } )$ .
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Method</td><td colspan="2">Setting</td><td rowspan="2">Params</td><td rowspan="2">Accuracy</td><td rowspan="2">△</td></tr><tr><td></td><td>fa(j,pos)</td><td> share in WQ/K/V</td></tr><tr><td>Transformer-complex-order</td><td>rjde(wjdpos)</td><td>×</td><td>8.33M</td><td>0.813</td><td>=</td></tr><tr><td>adding initial phases</td><td>rj,dei(wj,dpos+0j,d)</td><td>×</td><td>11.89M</td><td>0.785</td><td>-0.028</td></tr><tr><td>dimension-sharing period schema</td><td>Tj,dewj,.pos</td><td>×</td><td>5.82M</td><td>0.797</td><td>-0.016</td></tr><tr><td>word-sharing period schema</td><td>Tj,deiw.,pos</td><td>×</td><td>5.81M</td><td>0.805</td><td>-0.008</td></tr><tr><td>dimension-sharing amplitude schema</td><td>rj,eiwj,.pos</td><td>×</td><td>5.82M</td><td>0.798</td><td>-0.015</td></tr><tr><td>word-sharing amplitude schema</td><td>r.deiw..apos</td><td>×</td><td>5.81M</td><td>0.804</td><td>-0.009</td></tr><tr><td>w/t encoding positions (complex-vanilla)</td><td>Tjdewjd</td><td>×</td><td>9.38M</td><td>0.764</td><td>-0.049</td></tr><tr><td>dimension-sharing period schema</td><td>Tj,dewj,.pos</td><td>√</td><td>4.77M</td><td>0.794</td><td>-0.019</td></tr><tr><td>word-sharing period schema</td><td>rj,dew.,apos</td><td>√</td><td>4.76M</td><td>0.797</td><td>-0.016</td></tr><tr><td>dimension-sharing amplitude schema</td><td>rj,eiwj,.pos</td><td>√</td><td>4.77M</td><td>0.792</td><td>-0.021</td></tr><tr><td>word-sharing amplitude schema</td><td>r.,deiw.,apos</td><td>√</td><td>4.76M</td><td>0.801</td><td>-0.012</td></tr><tr><td>w/t encoding positions (complex-vanilla)</td><td>rjdeiwjd</td><td>√</td><td>8.33M</td><td>0.743</td><td>-0.07</td></tr><tr><td>vanilla Transformer (Vaswani et al., 2017)</td><td>WEj,d+PEd</td><td>-</td><td>4.1M</td><td>0.761</td><td>-0.052</td></tr></table>
|
| 153 |
+
|
| 154 |
+
slightly drop performance, because fewer parameters limit the representative power. Adding initial phases also hurts performance, although we observed that the loss could decrease faster in early epochs compared to the setting without offset. The negative effect of initial phases may be due to periodicity, and $\omega$ cannot be directly regularized with L2-norm penalties. The sharing schemes slightly decrease the performance with less parameters. More details of the learned periods/frequencies (e.g. the distributions of periods/frequencies and case studies) are shown in App. D.
|
| 155 |
+
|
| 156 |
+
Note that the word-sharing schema outperform the Vanilla Transformer, (both have a comparable number of parameters). If we choose $\Re ( \mathrm { \dot { W } } ^ { Q / K / V } ) = \Im ( W ^ { Q / K / V } )$ , the additional parameters in the embedding layers will affect much less the whole parameter scale in the multiple-layer Transformer, since a embedding layer is only used in the first layer instead of the following Transformer layers.
|
| 157 |
+
|
| 158 |
+
# 3.2 MACHINE TRANSLATION
|
| 159 |
+
|
| 160 |
+
Experimental Setup. We use the standard WMT 2016 English-German dataset (Sennrich et al., 2016), whose training set consists of 29,000 sentence pairs. We use four baselines: basic Attentional encoder-decoder (AED) (Bahdanau et al., 2014); AED with Byte-pair encoding (BPE) subword segmentation for open-vocabulary translation (Sennrich et al., 2016); AED with extra linguistic features (morphological, part-of-speech, and syntactic dependency labels) (Sennrich & Haddow, 2016); and a 6-layer Transformer. Our approach (Transformer Complex-order) uses a batch size of 64, a head of 8, 6 layers, the rate of dropout is 0.1, and the dimension of the word embedding is 512. The embedding layer does not use initial phases, i.e., following $f ( j , p o s ) = r _ { j } e ^ { i ( \omega _ { j } p o s ) }$ . We evaluate MT performance with the Bilingual Evaluation Understudy (BLEU) measure.
|
| 161 |
+
|
| 162 |
+
Table 6: Language modeling results. $\star$ marks scores reported from other papers.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Method</td><td>BLEU</td></tr><tr><td>AED (Bahdanau et al., 2014) *</td><td>26.8</td></tr><tr><td rowspan="4">AED+Linguistic (Sennrich & Haddow,2016) ★ AED+BPE(Sennrich et al.,2016) * Transformer (Ma et al.,2019) *</td><td>28.4</td></tr><tr><td>34.2</td></tr><tr><td></td></tr><tr><td>34.5</td></tr><tr><td>Transformer complex vanilla Transformer Complex-order</td><td>34.7 35.8</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 5: Machine translation results. $\star$ marks scores reported from other papers.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Method BPC</td></tr><tr><td>BN-LSTM(Cooijmans et al., 2016) * 1.36 LN HM-LSTM(Chung et al., 2016) * 1.29</td></tr><tr><td>RHN (Zilly et al., 2017) * 1.27 Large mLSTM(Krause et al.,2016) * 1.27</td></tr><tr><td>Transformer XL 6L (Dai et al., 2019) 1.29 Transformercomplex vanilla 1.30 Transformer XL Complex-order 6L 1.26</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Results Tab. 5 shows the MT results. Our approach outperforms all baselines. Two things are worth noting: (1) Both the vanilla Transformer and our Transformer Complex-order outperform the three Attentional encoder-decoder baselines which are based on an LSTM encoder and decoder, even when AED uses additional features. (2) Our Transformer Complex-Order outperforms the Vanilla Transformer and complex-vanilla Transformer by 1.3 and 1.1 in absolute BLEU score respectively.
|
| 171 |
+
|
| 172 |
+
# 3.3 LANGUAGE MODELING
|
| 173 |
+
|
| 174 |
+
Experimental Setup. We use the text8 (Mahoney, 2011) dataset, consisting of English Wikipedia articles. The text is lowercased from a to z, and space. The dataset contains 100M characters (90M for training, 5M for dev, and 5M for testing, as per Mikolov et al. (2012)). We use as baselines BN-LSTM, LN HM-LSTM RHN and Large mLSTM, which are typical recurrent NNs for language modeling in this dataset. We evaluate performance with the Bits Per Character (BPC) measure, (the lower, the better). We run the coder in Dai et al. (2019) with 6 layers for Transformer XL 6L; our model, named Transformer XL complex-order, directly replaces the word embedding with our proposed embedding under the same setting. We choose 6 layers due to limitations in computing resources. For Transformer XL Complex-order, all other parameter settings are as for Transformer XL (Dai et al., 2019). Our complex-order model does not use initial phases.
|
| 175 |
+
|
| 176 |
+
Results. We see in Tab. 6 that our method outperforms all baselines. The first four baselines (BNLSTM, LN HM-LSTM, RHN and Large mLSTM) are based on recurrent NNs and rely on different regulation methods to become applicable in multiple-layer recurrent architectures. Transformerbased architectures can easily be stacked with multiple layers due to their advantages in parallelization, however the vanilla Transformer does not outperform the multiple-layer recurrent baselines, most likely due to its limitation of 6 layers. Our Transformer XL Complex-order outperforms its vanilla counterpart under the 6-layer setting (and also strong recurrent network baselines), demonstrating that our embedding also generalizes well in tasks with long-term dependency. With limited resources, slightly increasing the parameters in the feature layer like our proposed embedding could be more beneficial than stacking more layers with linearly increasing parameters.
|
| 177 |
+
|
| 178 |
+
# 4 RELATED WORK
|
| 179 |
+
|
| 180 |
+
Complex-valued NNs are not new (Georgiou & Koutsougeras, 1992; Kim & Adalı, 2003; Hirose, 2003). Complex-valued weights have been used in NNs, motivated by biology (Reichert & Serre, 2013), and also as signal processing in speech recognition (Shi et al., 2006). More recently, Arjovsky et al. (2016) shifted RNNs into the complex domain and Wolter & Yao (2018) proposed a novel complex gated recurrent cell. Trabelsi et al. (2017) also developped a complex-valued NN for computer vision and audio processing.
|
| 181 |
+
|
| 182 |
+
Complex numbers have also been applied to text processing like (Van Rijsbergen, 2004; Melucci, 2015; Blacoe et al., 2013). Trouillon et al. (2016) adopt complex embedding for entities in Knowledge Graph Completion to represent antisymmetric relations with Hermitian dot product. Li et al. (2019); Wang et al. (2019) extend word embeddings to complex-valued fashion in quantum probability driven NNs, seeing the overview in Wang et al. (2019). However, the physical meaning of both the complex-valued entity and word embeddings is unknown, since a complex number was considered as two real numbers in a black-box learning paradigm. Our work first links the phase in complex numbers to word position to define concrete physical meaning in document representations.
|
| 183 |
+
|
| 184 |
+
# 5 CONCLUSIONS
|
| 185 |
+
|
| 186 |
+
We extended word vectors to word functions with a variable i.e. position, to model the smooth shift among sequential word positions and therefore implicitly capture relative distances between words. These functions are well-defined to model the relative distances, therefore we derive a general solution in complex-valued fashion. Interestingly, the position embedding in Vaswani et al. (2017) can be considered a simplified version of our approach. We extend CNN, RNN and Transformer NNs to complex-valued versions to incorporate our complex embedding. Experiments on text classification, machine translation and language modeling show that our embeddings are more effective than vanilla position embeddings (Vaswani et al., 2017).
|
| 187 |
+
|
| 188 |
+
# ACKNOWLEDGMENTS
|
| 189 |
+
|
| 190 |
+
We thank Massimo Melucci and Emanuele Di Buccio for their helpful comments, Xindian Ma for his detailed experimental suggestions.
|
| 191 |
+
|
| 192 |
+
This work is supported by the Quantum Access and Retrieval Theory (QUARTZ) project, which has received funding from the European Union‘s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 721321. Peng Zhang and Donghao Zhang are supported in part by Natural Science Foundation of China (grant No. 61772363, U1636203)
|
| 193 |
+
|
| 194 |
+
# REFERENCES
|
| 195 |
+
|
| 196 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on International Conference on Machine Learning, 2016.
|
| 197 |
+
|
| 198 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 199 |
+
|
| 200 |
+
Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. CoRR, abs/1803.01271, 2018. URL http: //arxiv.org/abs/1803.01271.
|
| 201 |
+
|
| 202 |
+
Daniel Beck, Gholamreza Haffari, and Trevor Cohn. Graph-to-sequence learning using gated graph neural networks. arXiv preprint arXiv:1806.09835, 2018.
|
| 203 |
+
|
| 204 |
+
William Blacoe, Elham Kashefi, and Mirella Lapata. A quantum-theoretic approach to distributional semantics. In NAACL, pp. 847–857, 2013.
|
| 205 |
+
|
| 206 |
+
Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. arXiv preprint arXiv:1609.01704, 2016.
|
| 207 |
+
|
| 208 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. arXiv preprint arXiv:1705.02364, 2017.
|
| 209 |
+
|
| 210 |
+
Tim Cooijmans, Nicolas Ballas, Cesar Laurent, C¸ a ´ glar G ˘ ulc¸ehre, and Aaron Courville. Recurrent ¨ batch normalization. arXiv preprint arXiv:1603.09025, 2016.
|
| 211 |
+
|
| 212 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 213 |
+
|
| 214 |
+
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.
|
| 215 |
+
|
| 216 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1243–1252. JMLR. org, 2017.
|
| 217 |
+
|
| 218 |
+
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.
|
| 219 |
+
|
| 220 |
+
Akira Hirose. Complex-valued neural networks: theories and applications, volume 5. World Scientific, 2003.
|
| 221 |
+
|
| 222 |
+
Minqing Hu and Bing Liu. Mining and Summarizing Customer Reviews. pp. 10, 2014.
|
| 223 |
+
|
| 224 |
+
Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759, 2016.
|
| 225 |
+
|
| 226 |
+
Taehwan Kim and Tulay Adalı. Approximation by fully complex multilayer perceptrons. ¨ Neural computation, 15(7):1641–1666, 2003.
|
| 227 |
+
|
| 228 |
+
Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
|
| 229 |
+
|
| 230 |
+
Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling. arXiv preprint arXiv:1609.07959, 2016.
|
| 231 |
+
|
| 232 |
+
Qiuchi Li, Sagar Uprety, Benyou Wang, and Dawei Song. Quantum-inspired complex word embedding. In Proceedings of The Third Workshop on Representation Learning for NLP, pp. 50–57, 2018.
|
| 233 |
+
|
| 234 |
+
Qiuchi Li, Benyou Wang, and Massimo Melucci. Cnm: An interpretable complex-valued network for matching. In NAACL-HLT (1), pp. 4139–4148, 2019.
|
| 235 |
+
|
| 236 |
+
Xin Li and Dan Roth. Learning Question Classifiers. In COLING. Association for Computational Linguistics, 2002.
|
| 237 |
+
|
| 238 |
+
Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. arXiv preprint arXiv:1803.02893, 2018.
|
| 239 |
+
|
| 240 |
+
Xindian Ma, Peng Zhang, Shuai Zhang, Nan Duan, Yuexian Hou, Dawei Song, and Ming Zhou. A tensorized transformer for language modeling. arXiv preprint arXiv:1906.09777, 2019.
|
| 241 |
+
|
| 242 |
+
Matt Mahoney. Large text compression benchmark. URL: http://www. mattmahoney. net/text/text. html, 2011.
|
| 243 |
+
|
| 244 |
+
Massimo Melucci. Introduction to information retrieval and quantum mechanics, volume 35. Springer, 2015.
|
| 245 |
+
|
| 246 |
+
T. Mikolov, I. Sutskever, K. Chen, G. Corrado, and J. Dean. Distributed representations ofwords and phrases and their compositionality. Advances in Neural Information Processing Systems, 26: 3111–3119, 2013a.
|
| 247 |
+
|
| 248 |
+
Toma´s Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, Stefan Kombrink, and Jan Cer- ˇ nocky. Subword language modeling with neural networks. preprint (http://www. fit. vutbr. cz/imikolov/rnnlm/char. pdf), 8, 2012.
|
| 249 |
+
|
| 250 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013b.
|
| 251 |
+
|
| 252 |
+
Matteo Pagliardini, Prakhar Gupta, and Martin Jaggi. Unsupervised learning of sentence embeddings using compositional n-gram features. arXiv preprint arXiv:1703.02507, 2017.
|
| 253 |
+
|
| 254 |
+
Bo Pang and Lillian Lee. Seeing stars: exploiting class relationships for sentiment categorization with respect to rating scales. pp. 115–124. Association for Computational Linguistics, 2005. doi: 10.3115/1219840.1219855. URL http://portal.acm.org/citation. cfm?doid $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 1219840.1219855.
|
| 255 |
+
|
| 256 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In EMNLP, volume 14, pp. 1532–1543, 2014.
|
| 257 |
+
|
| 258 |
+
David P Reichert and Thomas Serre. Neuronal synchrony in complex-valued deep networks. arXiv preprint arXiv:1312.6115, 2013.
|
| 259 |
+
|
| 260 |
+
Sunil Kumar Sahu, Fenia Christopoulou, Makoto Miwa, and Sophia Ananiadou. Inter-sentence relation extraction with document-level graph convolutional neural network. arXiv preprint arXiv:1906.04684, 2019.
|
| 261 |
+
|
| 262 |
+
Rico Sennrich and Barry Haddow. Linguistic input features improve neural machine translation. arXiv preprint arXiv:1606.02892, 2016.
|
| 263 |
+
|
| 264 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Edinburgh neural machine translation systems for wmt 16. arXiv preprint arXiv:1606.02891, 2016.
|
| 265 |
+
|
| 266 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Richard Socher, Cliff C Lin, Chris Manning, and Andrew Y Ng. Parsing natural scenes and natural language with recursive neural networks. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 129–136, 2011.
|
| 271 |
+
|
| 272 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank. EMNLP, pp. 1631–1642, 2013.
|
| 273 |
+
|
| 274 |
+
Chiheb Trabelsi, Olexa Bilaniuk, Ying Zhang, Dmitriy Serdyuk, Sandeep Subramanian, Joao Fe- ˜ lipe Santos, Soroush Mehri, Negar Rostamzadeh, Yoshua Bengio, and Christopher J Pal. Deep complex networks. arXiv preprint arXiv:1705.09792, 2017.
|
| 275 |
+
|
| 276 |
+
Theo Trouillon, Johannes Welbl, Sebastian Riedel, ´ Eric Gaussier, and Guillaume Bouchard. Com- ´ plex embeddings for simple link prediction. In International Conference on Machine Learning, pp. 2071–2080, 2016.
|
| 277 |
+
|
| 278 |
+
Cornelis Joost Van Rijsbergen. The geometry of information retrieval. Cambridge University Press, 2004.
|
| 279 |
+
|
| 280 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
|
| 281 |
+
|
| 282 |
+
Benyou Wang, Emanuele Di Buccio, and Massimo Melucci. Representing words in vector space and beyond. In Quantum-Like Models for Information Retrieval and Decision-Making, pp. 83–113. Springer, 2019.
|
| 283 |
+
|
| 284 |
+
Benyou Wang, Qiuchi Li, Massimo Melucci, and Dawei Song. Semantic hilbert space for text representation learning. In The World Wide Web Conference on, pp. 3293–3299, 2019.
|
| 285 |
+
|
| 286 |
+
Janyce Wiebe, Theresa Wilson, and Claire Cardie. Annotating Expressions of Opinions and Emotions in Language. Language Resources and Evaluation, 39(2-3):165–210, May 2005. ISSN 1574-020X, 1572-8412. doi: 10.1007/s10579-005-7880-9. URL http://link.springer. com/10.1007/s10579-005-7880-9.
|
| 287 |
+
|
| 288 |
+
Moritz Wolter and Angela Yao. Gated complex recurrent neural networks. arXiv preprint arXiv:1806.08267, 2018.
|
| 289 |
+
|
| 290 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. Recurrent ¨ highway networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 4189–4198. JMLR. org, 2017.
|
| 291 |
+
|
| 292 |
+
# A LINKING TO THE POSITION EMBEDDINGS IN (VASWANI ET AL., 2017)
|
| 293 |
+
|
| 294 |
+
Vaswani et al. (2017) proposed a new initialization for position embedding, resulting in comparable performance with previous one (Gehring et al., 2017) even without fine-tuning. The position embedding is empirically selected as
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array} { r } { P E _ { 2 k } ( \cdot , p o s ) = \sin ( p o s / 1 0 0 0 0 ^ { 2 k / d _ { m o d e l } } ) } \\ { P E _ { 2 k + 1 } ( \cdot , p o s ) = \cos ( p o s / 1 0 0 0 0 ^ { 2 k / d _ { m o d e l } } ) } \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
Where pos is the position index, $2 k$ and $2 k + 1$ is the dimension index and $d _ { m o d e l }$ is the dimension size of embedding. The reason for choosing this position embedding was not well-explained and its general extension is unknown, leading to some difficulties to improve it.
|
| 301 |
+
|
| 302 |
+
We claim that the proposed position embedding in (Vaswani et al., 2017) is a degraded version of one of our specific complex word embedding in word-sharing schema (i.e., $\omega _ { j , d } = \omega _ { \cdot , d } )$ ), in which $p _ { j , k } =$ $2 \pi \times 1 0 0 0 0 ^ { 2 k / d _ { m o d e l } }$ and the initial phases are set as zero. In our complex-valued position embedding, let $f _ { p e , k } ( \cdot , p o s ) = e ^ { i \times 1 0 0 0 ^ { 2 k / d _ { m o d e l } } } = \cos ( 1 0 0 0 0 ^ { 2 k / d _ { m o d e l } } p o s ) + i \sin ( 1 0 0 0 0 ^ { 2 k / d _ { m o d e l } } p o s )$ . Note that there exists a bi-jection between $P E ( \cdot , p o s )$ and $f _ { p e , k } ( \cdot , p o s )$ :
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r } { P E _ { 2 k } ( \cdot , p o s ) = \Im ( f _ { p e , k } ( \cdot , p o s ) ) , } \\ { P E _ { 2 k + 1 } ( \cdot , p o s ) = \Re ( f _ { p e , k } ( \cdot , p o s ) ) } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
where $\mathfrak { R }$ and $\mathfrak { F }$ are the operations to take the real and imaginary part of a complex-valued number. Its inverse transformation is
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
f _ { p e , k } ( \cdot , p o s ) = P E _ { 2 k + 1 } ( \cdot , p o s ) + i P E _ { 2 k } ( \cdot , p o s )
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
In our overall embedding, each dimension $f _ { k } ( j , p o s ) = f _ { w e , k } ( j ) \odot f _ { p e , k } ( \cdot , p o s )$ in our approaches, while it is $E _ { k } ( j , p o s ) \stackrel { \_ } { = } W E _ { k } ( j ) + P E _ { k } ( \cdot , \bar { p o s } )$ in (Gehring et al., 2017; Vaswani et al., 2017). Hence the position embedding in (Vaswani et al., 2017) is equivalent, albeit not identical, to our complex-valued position embedding with $p _ { j , k } = 2 \pi \times 1 0 0 0 0 ^ { 2 k / d _ { m o d e l } }$ . It is therefore a particular case of our complex-valued position embedding, the word-sharing schema in which all words share the same period at a certain dimension, i.e, $p _ { j , k } = p _ { \cdot , k }$ is irrelevant to the choice of $j$ .
|
| 315 |
+
|
| 316 |
+
# B INTEGRATING COMPLEX-VALUED EMBEDDING TO GENERAL NEURAL NETWORKS
|
| 317 |
+
|
| 318 |
+
Neural networks are typically given real numbers as inputs and return real numbers as outputs. To accommodate complex numbers as in- and output, we devise a complex-valued version of various neural network layers i.e. complex-valued FastText with dense layer, CNN, and RNN. Unlike existing complex-valued neural networks (Trabelsi et al., 2017; Wolter & Yao, 2018), our feature layers are also converted into complex-valued layers.
|
| 319 |
+
|
| 320 |
+
Complex-valued FastText FastTest (Joulin et al., 2016) is a simple and efficient neural network architecture using a dense layer over the sum of all word embeddings for general text classification. For a linear dense layer, i.e., $\boldsymbol z = \mathrm { d e n s e } ( \boldsymbol x + i \boldsymbol y )$ , where $\pmb { x } + i \pmb { y }$ and $_ z$ denote the complex-valued in- and output, respectively. Let $\pmb { W } = \pmb { A } + i \pmb { B }$ and $b = c + i d$ be complex-valued linear weights and bias, respectively. Then, the complex-valued dense layer is given by:
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
z = \sigma \left( A x - B y + c \right) + i \sigma ( B x + A y + d )
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
where $\sigma$ is a real-valued activation function such as the sigmoid function. By rewriting (10) in matrix form (Trabelsi et al., 2017), we obtain:
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
{ \biggl [ } \Re ( z ) { \biggr ] } = { \biggl [ } { \sigma } ( A x - B y + c ) { \biggr ] }
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where, for $z = x + i y , \Re ( z ) = x$ and $\Im ( z ) = y$ . To save parameters and fairly compare with our real-valued baselines, the weights for real-part and imaginary-part input can be shared, i.e., $\pmb { A } = \pmb { B } , c = d$ .
|
| 333 |
+
|
| 334 |
+
Complex-valued CNN For the complex-valued version of the convolution operation Trabelsi et al. (2017), we similarly define a complex-valued convolution with separate real and imaginary kernels $\pmb { A }$ and $\textbf { { B } }$ , to compute convolutions on the real and imaginary parts of the input in Eq. 10. A complex-valued CNN network is constructed by stacking the operations based on a complex-valued convolution kernel, adding a complex dense layer in (10), and taking their norm as the final prediction in the last layer.
|
| 335 |
+
|
| 336 |
+
Complex-valued RNN The basic complex RNN formulation is:
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
h _ { t } ^ { C } = f \left( W ^ { h } h _ { t - 1 } + W ^ { z } z _ { t } + b \right)
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
where ${ \boldsymbol { z } } _ { t }$ and $\boldsymbol { h } _ { t }$ represent the complex-valued input and complex-value hidden state vectors at time $t , b$ is a complex-valued bias, $W ^ { h }$ and $W ^ { z }$ are complex-valued weight transitions for hidden state and input state, and $f \left( z \right) = \sigma \left( \Re \left( z \right) \right) + i \sigma \left( \Im \left( z \right) \right)$ is the activation function. The multiplication $W ^ { h } h _ { t - 1 }$ and $W ^ { z } z _ { t }$ is computed as defined in (10) above. Similarly, the complex-valued gates are used in LSTM via operations as in (12). In the final layer, a $l 2$ -norm operation is adopted to obtain a real-valued loss for backpropagation.
|
| 343 |
+
|
| 344 |
+
Complex-valued Transformer The main components in the Transformer are self-attention sublayers and position-wise feed-forward (FFN) sublayers. A self-attention sublayer employs $h$ attention heads and the concatenation of all heads is used as the output followed by a parameterized linear transformation. For a sequence embedded as complex-valued vector $i n p u t = \{ \bar { \pmb { w } } _ { 1 } , \pmb { w } _ { 2 } , . . . , \pmb { w } _ { n } \}$ , the output of each head is computed as a weighted sum of a linear transformation of the input sequence itself, namely
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
o u t p u t _ { i } = \sum _ { j } a _ { i , j } { \pmb w } _ { j } { \pmb W } ^ { V } ,
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
where ${ \pmb w } _ { j }$ is a complex-valued vector and $W ^ { V }$ is a complex linear transformation; therefore outputi is also complex. Hence, output is a sequence of complex-valued vectors with the same shape as input. The weight coefficient, $a _ { i , j }$ , which is defined as in real-valued domain, is calculated as the softmax of the product between complex-valued query vectors and key vectors: $a _ { i , j } = \mathrm { s o f t m a x } \frac { e _ { i , j } } { \sum _ { i = 1 } ^ { n } e _ { i , j } }$ and
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
{ e } _ { i , j } = \sqrt { \frac { \Re ( z ) ^ { 2 } + \Im ( z ) ^ { 2 } } { n } } , z = \left( { w } _ { i } { W } ^ { Q } \right) \left( { w } _ { j } { W } ^ { K } \right) ^ { \dag } ,
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
$\mathbf { Z }$ is a complex number since ${ \pmb w } _ { i }$ and ${ \pmb w } _ { j }$ are complex-valued vectors and $W ^ { Q } , W ^ { K }$ are complexvalued transformation. To extend another variant of Transformer called Transformer XL, we keep its original relative position embedding and additionally replace its word embedding with our proposed embedding.
|
| 357 |
+
|
| 358 |
+
Correspondingly, the FFN sublayer can easily be extended to a complex-valued version by replacing the real-valued layers with complex-valued ones. We use batch-normalization separately for the real and imaginary parts.
|
| 359 |
+
|
| 360 |
+
# C IMPLEMENTATION OF THE PROPOSED EMBEDDING
|
| 361 |
+
|
| 362 |
+
Words functions are implemented in neural networks by storing the function parameters $\{ r , \omega , \theta \}$ and then construct the values based on the arguments. Based on the definition, the implementation of the proposed embedding can easily be implemented with only modifying the embedding layer. We list the basic code to construct our general embedding as below:
|
| 363 |
+
|
| 364 |
+
i m p o r t t o r c h
|
| 365 |
+
impor t math
|
| 366 |
+
c l a s s ComplexNN ( t o r c h . nn . M o d ul e ) : d e f i n i t ( s e l f , o p t ) : s u p e r ( ComplexNN , s e l f ) . i n i t ( ) s e l f . word emb $=$ t o r c h . nn . E m b e d d i n g ( o p t . n t o k e n , o p t . d m o d e l ) s e l f . f r e q u e n c y e m b $=$ t o r c h . nn . E m b e d d i n g ( o p t . n t o k e n , o p t . d m o d e l ) s e l f . i n i t i a l p h a s e e m b $=$ t o r c h . nn . E m b e d d i n g ( o p t . n t o k e n , o p t . d m o d e l )
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 3: The distribution of the $\delta _ { j }$ . Higher values mean that the word representations are more sensitive to the word positions.
|
| 370 |
+
|
| 371 |
+
d e f g e t e m b e d d i n g ( s e l f , x ) :
|
| 372 |
+
|
| 373 |
+
a m p l i t u d e $=$ s e l f . w o r d e m b ( x ) f r e q u e n c y $=$ s e l f . f r e q u e n c y e m b ( x ) s e l f . i n i t i a l p h a s e e m b . w e i g h t $=$ t o r c h . n n . P a r a m e t e r ( s e l f . i n i t i a l p h a s e e m $\%$ ( $^ 2 \ast$ m a t h . p i ) ) s e n t l e $\mathbf { \epsilon } _ { 1 } = \mathbf { X }$ . s i z e $( - 1 )$ p o s s e q $=$ t o r c h . a r a n g e ( 1 , s e n t l e n + 1 , 1 . 0 , d e v i c e $=$ a m p l i t u d e . d e v i c e ) p o s s e q $=$ p o s s e q . u n s q u e e z e ( 0 ) . u n s q u e e z e $( - 1 )$ p o s s e q $=$ p o s s e q . r e p e a t ( [ x . s i z e ( 0 ) , 1 , a m p l i t u d e . s i z e ( − 1 ) ] ) d i m e n s i o n b a i s $=$ s e l f . i n i t i a l p h a s e e m b ( x ) e n c o u t p u t p h a s e $=$ t o r c h . mul ( p o s s e q , f r e q u e n c y ) $^ +$ d i m e n s i o n b a i s e n c o u t p u t r e a l $=$ a m p l i t u d e $^ *$ t o r c h . c o s ( e n c o u t p u t p h a s e ) e n c o u t p u t i m a g e $=$ a m p l i t u d e $^ *$ t o r c h . s i n ( e n c o u t p u t p h a s e ) # r e t u r n t o r c h . c a t ( [ e n c o u t p u t r e a l , e n c o u t p u t i m a g e ] , − 1 ) r e t u r n e n c o u t p u t r e a l , e n c o u t p u t i m a g e d e f f o r w a r d ( s e l f , $\mathbf { X }$ ) : r e t u r n s e l f . g e t e m b e d d i n g ( x )
|
| 374 |
+
|
| 375 |
+
Note that both the frequency vectors $\omega$ and initial-phase vectors $\pmb { \theta }$ can be shared between words or dimensions, to save parameters. The proposed embedding can be also used in real-valued neural networks if one directly concatenates the real-part numbers and imaginary-part numbers as a doublesize real-valued vector; therefore it could easily be extended in any existing networks without any complex-valued components. For instance, it could be a good extension for Transformer based pretrained models like (Devlin et al., 2018) by enriching the feature layer.
|
| 376 |
+
|
| 377 |
+
# D VISUALIZATION OF FREQUENCIES/PERIODS
|
| 378 |
+
|
| 379 |
+
After training, we obtain the frequency vector $\omega$ for each word. For each word, the mean value of the absolute frequency values, i.e., $\begin{array} { r } { \delta _ { j } = \frac { 1 } { | D | } \sum _ { d = 1 } ^ { D } | \omega _ { j , d } | } \end{array}$ is considered as a metric to test the positional sensitivities of the word, since a period value could be negative during training. The density of the $\delta _ { j }$ is shown in Fig. 3.
|
| 380 |
+
|
| 381 |
+
Words with the 50 greatest, and the 50 smallest, frequencies in the SST dataset are shown in Tab. 7. For the words with greatest frequencies, most of them are strong sentiment words like “worst”
|
| 382 |
+
|
| 383 |
+
,“stupid” and “powerful”; a reason for this may be that such words appear in many positions in many documents during training, and thus they are more sensitive to the positions. Conversely, there are fewer words expressing strong sentiment among words with smaller frequencies, as shown in the second row.
|
| 384 |
+
|
| 385 |
+
Table 7: Words with greatest frequencies and frequencies periods (based on $\delta _ { j }$ ) in SST (a sentiment classification task), all words are converted to lower-case. The strong sentiment words are bold based on manual labeling.
|
| 386 |
+
|
| 387 |
+
<table><tr><td>words</td><td></td></tr><tr><td>greatest frequencies in descending order</td><td>worst solid stupid powerful mess wonderful remarkable suffers intoxicating thoughtful rare captures portrait gem frontal terrific unique wannabe witty lousy pointless contrived none worse refreshingly charming inventive amazing junk incoherent refreshing mediocre unfunny thinks enjoyed heartbreaking delightfully crisp brilliant heart</td></tr><tr><td>smallest frequencies in ascending order</td><td>spirit perfectly nowhere mistake engrossing fashioned excellent unexpected wonderfully means slowly proposal schemes roiling juliette titles fabric superstar ah wow choreographed tastelessness beg fabulous muccino jacobi legendary jae rate example code sensation counter deaths hall eun drug mctiernan storylines cellophane wild motion ups trick comedy entertained mission frightening witnesses snoots liners african groan satisfaction calm saturday estranged holm refuses inquisitive</td></tr></table>
|
md/train/SJMnG2C9YX/SJMnG2C9YX.md
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COMPLEMENTARY-LABEL LEARNING FOR ARBITRARY LOSSES AND MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In contrast to the standard classification paradigm where the true (or possibly noisy) class is given to each training pattern, complementary-label learning only uses training patterns each equipped with a complementary label. This only specifies one of the classes that the pattern does not belong to. The seminal paper on complementary-label learning proposed an unbiased estimator of the classification risk that can be computed only from complementarily labeled data. However, it required a restrictive condition on the loss functions, making it impossible to use popular losses such as the softmax cross-entropy loss. Recently, another formulation with the softmax cross-entropy loss was proposed with consistency guarantee. However, this formulation does not explicitly involve a risk estimator. Thus model/hyper-parameter selection is not possible by cross-validation— we may need additional ordinarily labeled data for validation purposes, which is not available in the current setup. In this paper, we give a novel general framework of complementary-label learning, and derive an unbiased risk estimator for arbitrary losses and models. We further improve the risk estimator by non-negative correction and demonstrate its superiority through experiments.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Modern classification methods usually require massive data with high-quality labels, but preparing such datasets is unrealistic in many practical domains. To mitigate the problem, many previous works have investigated ways to learn from weak supervision: semi-supervised learning (Chapelle et al., 2006; Miyato et al., 2016; Kipf & Welling, 2017; Sakai et al., 2017; Tarvainen & Valpola, 2017; Oliver et al., 2018), learning from noisily-labeled data (Natarajan et al., 2013; Patrini et al., 2017; Ma et al., 2018), learning from positive-unlabeled data (Elkan & Noto, 2008; du Plessis et al., 2014; 2015; Kiryo et al., 2017), learning from similar-unlabeled data (Bao et al., 2018), learning from positive-confidence data (Ishida et al., 2018), and others.
|
| 12 |
+
|
| 13 |
+
In this paper, we consider learning from another type of weak but natural supervision called complementary-label learning (Ishida et al., 2017; Yu et al., 2018), where the label only specifies one of the classes that the pattern does not belong to. In contrast to the ordinary case where the true class is given to each pattern (which often needs to be chosen out of many candidate classes precisely), collecting these complementary labels is obviously much easier and less costly. A natural question is, however, is it possible to learn from such complementary labels (without any true labels)?
|
| 14 |
+
|
| 15 |
+
The problem has previously been tackled by Ishida et al. (2017), showing that the classification risk can be recovered only from complementarily labeled data. They also gave consistency gaurantee in theoretical analysis. However, they required strong restrictions on the loss functions, allowing only one-versus-all and pairwise comparison multi-class loss functions (Zhang, 2004) with certain non-convex binary losses. This is a severe limitation when we use deep learning since the softmax cross-entropy loss is often used to boost the classification performance.
|
| 16 |
+
|
| 17 |
+
Later, Yu et al. (2018) proposed a different formulation for complementary labels by employing the forward loss correction technique (Patrini et al., 2017) to adjust the learning objective. Their proposed risk estimator is not necessarily unbiased but the minimizer is theoretically guaranteed to be consistent with the minimizer of the risk for ordinary labels (under an implicit assumption on the model for convergence analysis).
|
| 18 |
+
|
| 19 |
+
Table 1: Comparison of two proposed complementary-label methods with previous works.
|
| 20 |
+
|
| 21 |
+
<table><tr><td>Methods</td><td>loss assump. free</td><td>model assump. free</td><td>unbiased estimator</td><td>explicit risk correction</td></tr><tr><td>Ishida et al. (2017)</td><td>×</td><td>√</td><td>√</td><td>×</td></tr><tr><td>Yu et al. (2018)</td><td>×</td><td>×</td><td>×</td><td>×</td></tr><tr><td>Proposed (General formulation)</td><td></td><td>√</td><td>√</td><td></td></tr><tr><td>Proposed (Non-negative formulation)</td><td>√</td><td></td><td>×</td><td>×</td></tr></table>
|
| 22 |
+
|
| 23 |
+
They also extended the problem setting to where complementary labels are chosen in an uneven (biased) way. This is a realistic problem setting because labelers are more likely to complementarily label a pattern when they feel it is not a certain class which they have more knowledge or experience about.
|
| 24 |
+
|
| 25 |
+
In this paper, we first derive an unbiased risk estimator with a general loss function, making any loss functions available for use: not only the softmax cross-entropy loss function but other convex/nonconvex loss functions can also be applied. We also do not have implicit assumptions on the classifier, allowing both linear and non-linear models.
|
| 26 |
+
|
| 27 |
+
Yu et al. (2018) does not have an unbiased risk estimator, which means users will need clean data with true labels to calculate the error rate during the validation process. On the other hand, our proposed unbiased risk estimator can handle complementarily labeled validation data not only for our learning objective, but also for Yu et al. (2018). This is helpful since collecting clean data is usually much more expensive.
|
| 28 |
+
|
| 29 |
+
Finally, our proposed unbiased risk estimator has an issue that it is unbounded from below and suffers from the classification risk going to negative after learning, leading to overfitting. We further propose a non-negative correction to the original unbiased risk estimator to improve our estimator. We experimentally show that our proposed method is comparable to or better than previous methods (Ishida et al., 2017; Yu et al., 2018) in terms of classification accuracy.
|
| 30 |
+
|
| 31 |
+
# 2 REVIEW OF PREVIOUS WORKS
|
| 32 |
+
|
| 33 |
+
In this section, we explain the notations and review the formulations of learning from ordinary labels, learning from complementary labels, and learning from both ordinary and complementary labels.
|
| 34 |
+
|
| 35 |
+
Learning from ordinary labels Let $\mathcal { X }$ be an instance space and $\mathcal { D }$ be the joint distribution over $\mathcal { X } \times [ K ]$ for class label set $[ K ] : = \{ 1 , 2 , \dots , K \}$ , with random variables $( { \bar { X } } , Y ) \sim { \mathcal { D } }$ . The data at hand is sampled inThe joint distribution pendently and identically from the joint distributiocan be either decomposed into class-conditionals $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n } \stackrel { \mathrm { i . i . d . } } { \sim } \mathcal { D }$ $\mathcal { D }$ $\{ P _ { k } \} _ { k = 1 } ^ { K }$ $\{ \pi _ { k } \} _ { k = 1 } ^ { K }$ , where $P _ { k } : = \mathbb { P } ( X | Y = k )$ and $\pi _ { k } : = \mathbb { P } ( Y = k )$ , or the marginal $M$ and class-probability function $\eta : \mathcal { X } \ : \ : \Delta _ { k }$ , where $M : = \mathbb { P } ( X )$ and $\pmb { \eta } _ { k } ( x ) : = \mathbb { P } ( Y = \pmb { k } | X = x )$ . A loss is any $\ell : [ K ] \times \mathbb { R } ^ { K } \to \mathbb { R } _ { + }$ and the decision function is any $g : \mathcal { X } \overset { } { } \mathbb { R } ^ { K }$ . The risk for the decision function $\textbf { { g } }$ with respect to loss $\ell$ and implicit distribution $\mathcal { D }$ is:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
R ( g ; \ell ) : = \mathbb { E } _ { ( X , Y ) \sim \mathcal { D } } [ \ell ( Y , \pmb { g } ( X ) ) ] ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\mathbb { E }$ denotes the expectation. Two useful equivalent expressions of classification risk (1) used in later sections are
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
R ( g ; \ell ) : = \mathbb { E } _ { X } [ \eta ( x ) ^ { T } \ell ( { \pmb g } ( X ) ) ] = \sum _ { k = 1 } ^ { K } \pi _ { k } \mathbb { E } _ { \mathbb { P } _ { k } } \Big [ \ell ( k , { \pmb g } ( X ) ) \Big ] ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\ell : = [ \ell ( 1 , \pmb { g } ) , \ell ( 2 , \pmb { g } ) , \dots , \ell ( K , \pmb { g } ) ] ^ { T }$ . The goal of classification is to learn the decision function that minimizes the risk. In the usual classification case with ordinarily labeled data at hand, approximating the risk empirically is straightforward: $\begin{array} { r } { \widehat { R } ( g ; \ell ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \ell ( y _ { i } , g ( x _ { i } ) ) } \end{array}$ .
|
| 48 |
+
|
| 49 |
+
Learning from complementary labels Next we consider the problem of learning from complementary labels (Ishida et al., 2017). We observe patterns each equipped with a complementary label $\{ ( x _ { i ^ { \prime } } , \stackrel { \cdot } { y } _ { i ^ { \prime } } ) \} _ { i ^ { \prime } = 1 } ^ { n ^ { \prime } }$ sampled independently and identically from a different joint distribution $\overline { { \mathcal { D } } } \neq \mathcal { D }$ . We denote random variables as $( X , { \overline { { Y } } } ) \sim { \overline { { \mathcal { D } } } }$ . As before, we assume this distribution can be decomposed into either class-conditionals $\{ \overline { { P } } _ { k } \} _ { k = 1 } ^ { K }$ and base rate $\{ \overline { { \pi } } \} _ { k = 1 } ^ { K }$ , or marginal $M$ and classprobability function $\overline { { \eta } } : \mathcal { X } \to \Delta _ { K }$ , where ${ \overline { { P } } } _ { k } : = \mathbb { P } ( X | { \overline { { Y } } } = k )$ , $\overline { { \pi } } _ { k } : = \mathbb { P } ( \overline { { Y } } = k )$ , $M : = \mathbb { P } ( X )$ , $\overline { { \eta } } _ { k } ( x ) : = \mathbb { P } ( \overline { { Y } } = k | X = x )$ , $\overline { { Y } }$ is the complementary label, and $\Delta _ { K }$ is the conditional probability simplex for $K$ classes. Without any assumptions on $\overline { { \mathcal { D } } }$ , it is impossible to design a suitable learning procedure. The assumption for unbiased complementary learning used in Ishida et al. (2017) was
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\overline { { { \eta } } } ( \boldsymbol { x } ) = T \eta ( \boldsymbol { x } ) ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\pmb { T } \in \mathbb { R } ^ { K \times K }$ is a matrix that takes 0 on diagonals and $\frac { 1 } { K - 1 }$ on non-diagonals. Under this assumption, Ishida et al. (2017) proved that they can recover the classification risk (1) from an alternative formulation using only complementarily labeled data when he loss function satisfies certain conditions. More specifically, usable loss functions are pairwise comparison or one-versus-all multi-class loss functions (Zhang, 2004) each with binary loss function $\ell ^ { \bar { \prime } } ( z ) : \mathbb { R } \to \mathbb { R } _ { + }$ that satisfies $\ell ^ { \prime } ( z ) + \ell ^ { \prime } ( - z ) = 1$ , such as ramp loss $\begin{array} { r } { \ell _ { R } ^ { \prime } ( z ) = \frac { 1 } { 2 } \operatorname* { m a x } \left( 0 , \operatorname* { m i n } ( 2 , 1 - z ) \right) } \end{array}$ or sigmoid loss ℓ′S (z ) = 11+ez .
|
| 56 |
+
|
| 57 |
+
Having an unbiased risk estimator is also helpful for the validation process. Since we do not have ordinary labels in our validation set in the complementary-label learning setting, we cannot follow the usual validation procedure that uses zero-one error or accuracy. If we have an unbiased estimator of the original classification risk (which can be interpreted as zero-one error), we can use the empirical risk for (cross)-validated complementary data to select the best hyper-parameter or deploy early stopping.
|
| 58 |
+
|
| 59 |
+
An extension of the above method was considered in Yu et al. (2018) by using a different assumption than the unbiased complementary learning of Ishida et al. (2017): there is some bias amongst the possible complementary labels that can be chosen, thus the non-diagonals of $_ { \mathbf { T } }$ is not restricted to $\frac { 1 } { K - 1 }$ . However, one will need to prepare a separate dataset with ordinary labels in order to estimate $_ { \mathbf { T } }$ beforehand.
|
| 60 |
+
|
| 61 |
+
Unlike Ishida et al. (2017), Yu et al. (2018) did not directly provide a risk estimator, but they showed that the minimizer of their learning objective agrees with the minimizer of the original classification risk (1). Note that, in their formulation, the loss function is restricted to the softmax cross-entropy loss. Furthermore, the use of a highly non-linear model is supposed for consistency guarantee in their theoretical analysis. Since the learning objective of $\mathrm { Y u }$ et al. (2018) does not correspond to the classification risk, one will need clean data with true labels to calculate the error rate during the validation process. On the other hand, our proposed risk estimator can cope with complementarily labeled validation data not only for our own learning objective, but can be used to select hyperparameters for others such as Yu et al. (2018).
|
| 62 |
+
|
| 63 |
+
Learning from both ordinary and complementary labels In many practical situations, we may also have ordinarily labeled data in addition to complementarily labeled data. Ishida et al. (2017) touched on the idea of crowdsourcing for an application with both types of data. For example, we may choose one of the classes randomly by following the uniform distribution, with probability $\frac { 1 } { K - 1 }$ for each class, and ask crowdworkers whether a pattern belongs to the chosen class or not. Then the pattern is treated as ordinarily labeled if the answer is yes; otherwise, the pattern is regarded as complementarily labeled. If the true label was $y$ for a pattern, we can naturally assume that the crowdworker will answer yes by $\mathbb { P } ( Y = y | X = \overset { \cdot } { x } )$ and no by $1 - \mathbb { P } ( Y = y | X \mathbf { \hat { = } } x )$ . This way, ordinarily labeled data can be regarded as samples from $\mathcal { D }$ , and complementarily labeled data from $\overline { { \mathcal { D } } }$ , justifying the assumption of unbiased complementary learning (3). In Ishida et al. (2017), they considered a convex combination of the classification risks derived from ordinarily labeled data and complementarily labeled data: $\alpha R ( g ; \overline { { \ell } } ) + ( 1 - \alpha ) R ( g ; \ell )$ , where $\alpha \in [ 0 , 1 ]$ is a hyper-parameter that interpolates between the two risks. The combined (also unbiased) risk estimator can utilize both kinds of data in order to obtain better classifiers, which was demonstrated to perform well in experiments.
|
| 64 |
+
|
| 65 |
+
# 3 PROPOSED METHOD
|
| 66 |
+
|
| 67 |
+
As discussed in the previous section, the method by Ishida et al. (2017) works well in practice, but it has restriction on the loss functions—the popular softmax cross-entropy loss is not allowed. On the other hand, the method by Yu et al. (2018) allows us to use the softmax cross-entropy loss, but it does not directly provide an estimator of the classification risk and thus model selection is problematic in practice. We first describe our general unbiased risk formulation in Section 3.1. Then we discuss how the estimator can be further improved in Section 3.2. Third, we propose a way for our risk estimator to avoid overfitting by a non-negative risk estimator in Section 3.3. Finally, we show practical implementation of our risk estimator with stochastic optimization methods in Section 3.4.
|
| 68 |
+
|
| 69 |
+
# 3.1 GENERAL RISK FORMULATION
|
| 70 |
+
|
| 71 |
+
First, we describe our general unbiased risk formulation. We give the following theorem, which allows unbiased estimation of the classification risk from complementarily labeled samples:
|
| 72 |
+
|
| 73 |
+
Theorem 1. For any ordinary distribution $\mathcal { D }$ and complementary distribution $\overline { { \mathcal { D } } }$ related by (3) with decision function $\textbf { { g } }$ , and loss $\ell$ , we have
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
R ( \pmb { g } ; \ell ) = R ( \pmb { g } ; \bar { \ell } )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
for the complementary loss
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\overline { { \ell } } ( \pmb { g } ) : = \Big ( - ( K - 1 ) \pmb { I } _ { K } + \frac { 1 } { K - 1 } \pmb { 1 } \pmb { 1 } ^ { \top } \Big ) \cdot \pmb { \ell } ( \pmb { g } ) ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where 1 is a A. The key $K$ -dimensional column vector with 1 in each ela of the proof is to not rely on the condition e found in Appendix used in Ishida et al. $\begin{array} { r } { \sum _ { k = 1 } ^ { K } \overline { { \ell } } ( k , g ) = 1 } \end{array}$ (2017), which is a condition inspired by the property of binary 0-1 loss $\ell _ { 0 - 1 }$ , where if $z < 0$ and 0 otherwise. Note that such a technique was also used when designing unbiased risk estimators for learning from positive and unlabeled data in a binary classification setup (?), but was later shown to be unnecessary (du Plessis et al., 2015).
|
| 86 |
+
|
| 87 |
+
According to Theorem 1, we can derive an equivalent form,
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\boldsymbol { \overline { { \ell } } } ( \boldsymbol { k } , g ) = - ( K - 1 ) \cdot \boldsymbol { \ell } ( \boldsymbol { k } , g ) + \sum _ { j = 1 } ^ { K } \boldsymbol { \ell } ( j , g ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Therefore, the classification risk can be written as
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
R ( g ; \ell ) = \sum _ { k = 1 } ^ { K } \overline { { { \pi } } } _ { k } \mathbb { E } _ { \overline { { { P } } } _ { k } } \Big [ - ( K - 1 ) \cdot \ell ( k , g ) + \sum _ { j = 1 } ^ { K } \ell ( j , g ) \Big ] .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
This expression of the classification risk allows us to naively approximate it in an unbiased fashion using complementarily labeled data as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\widehat { R } ( g ; \ell ) = \sum _ { k = 1 } ^ { K } \frac { \widehat { \pi } _ { k } } { n _ { k } } \sum _ { i = 1 } ^ { n _ { k } } \Big [ - ( K - 1 ) \cdot \ell \big ( k , g ( \pmb { x } _ { i } ) \big ) + \sum _ { j = 1 } ^ { K } \ell ( j , g \big ( \pmb { x } _ { i } \big ) \big ) \Big ] ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $n _ { k }$ is the number of samples complementarily labeled as the $k$ th class. It is worth noting that, in the above derivation, there are no constraints on the loss function and classifier. Thus, we can use any convex/non-convex loss and any linear/non-linear parametric/non-parametric model for complementary learning.
|
| 106 |
+
|
| 107 |
+
# 3.2 NECESSITY OF RISK CORRECTION
|
| 108 |
+
|
| 109 |
+
The original expression of the classification risk (1) includes an expectation over non-negative loss $\ell : [ K ] \times \mathbb { R } ^ { K } \overset { \cdot } { } \mathbb { R } _ { + }$ , so the risk and its empirical approximator are both lower-bounded by zero. On the other hand, the expression (7) derived above contains an negative element. Although (7) is still non-negative by definition, due to the negative term, its empirical estimator can go negative, leading to over-fitting.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 1: The left and middle graphs shows the total risk (8) (in black color) and the risk decomposed into each ordinary class term (9) (in other colors) for training data with linear and MLP models, respectively. As an MLP model, a one-hidden-layer neural network with 500 units was used, with $R e L U$ (Nair & Hinton, 2010) as the activation function, Adam (Kingma & Ba, 2015) for optimization with learning rate $5 e - 5$ and weight decay of $1 e - 4$ . The right graph shows the corresponding test accuracy for both models.
|
| 113 |
+
|
| 114 |
+
We elaborate on this issue with an illustrative numerical example. In the left graph of Figure 1, we show an example of training a linear model trained on the handwritten digits dataset $\mathrm { \bf M N I S T ^ { 1 } }$ , with complementary labels generated to satisfy (3). We used Adam (Kingma & Ba, 2015) for optimization with learning rate $5 e - 5$ , and weight decay of $1 e - 4$ with 300 epochs. The empirical classification risk (8) is shown in black. We can see that the empirical classification risk continues decreasing and can go below zero at around 100 epochs. The test accuracy on the right graph hits the peak also at around epoch 100 and then the accuracy gradually deteriorates.
|
| 115 |
+
|
| 116 |
+
This issue stands out even more significantly when we use a flexible model. The middle graph shows the empirical classification risk for a multilayer perceptron (MLP) with one hidden layer (500 units), where ReLU (Nair & Hinton, 2010) was used as the activation function. The optimization setup was the same as the case of the linear model above. We can see the empirical risk decreasing much more quickly and going negative. Correspondingly, as the right graph shows, the test accuracy drops significantly after the empirical risk goes negative.
|
| 117 |
+
|
| 118 |
+
In fact, a similar issue has already been conceivable in the original paper by Ishida et al. (2017): According to Theorem 1 in Ishida et al. (2017), the unbiased risk estimator includes subtraction of a positive constant term which increases with respect to the number of classes. This means that the learning objective of Ishida et al. (2017) has a (negative) lower bound. Our objective, however, is unbounded from below and thus can end up in even heavier overfitting.
|
| 119 |
+
|
| 120 |
+
# 3.3 NON-NEGATIVE RISK ESTIMATOR
|
| 121 |
+
|
| 122 |
+
As we saw in Section 3.2, our risk estimator can suffer from overfitting due to the non-negative issue. Here, we propose a correction to the risk estimator to overcome this problem.
|
| 123 |
+
|
| 124 |
+
Each term in the risk with ordinary labels (right-hand side of (2)), which corresponds to each class, is non-negative. We can reformulate (7) in order to show the counterpart for each non-negative term in right-hand side of (2) for complementarily labeled data as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
R ( g ; \ell ) = \sum _ { k = 1 } ^ { K } \overline { { \pi } } _ { k } \Big [ - ( K - 1 ) \cdot \mathbb { E } _ { \overline { { P } } _ { k } } [ \ell ( k , g ) ] + \sum _ { j = 1 } ^ { K } \mathbb { E } _ { \overline { { P } } _ { j } } [ \ell ( k , g ) ] \Big ] .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
These counterparts (9) were originally non-negative when ordinary labels were used. In the left and middle graphs of Figure 1, we plot the decomposed risk with respect to each ordinary class (9) (shown in different colors). We can see that the decomposed risks for all classes become negative eventually. Based on this observation, our basic idea for correction is to enforce non-negativity for each ordinary class, with the expression based on complementary labels. More specifically, we propose a non-negative (nn) version by
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
R _ { \mathrm { n n } } ( g ; \ell ) = \sum _ { k = 1 } ^ { K } \operatorname* { m a x } \Big \{ 0 , \overline { { \pi } } _ { k } \Big [ - ( K - 1 ) \cdot \mathbb { E } _ { \overline { { P } } _ { k } } [ \ell ( k , g ) ] + \sum _ { j = 1 } ^ { K } \mathbb { E } _ { \overline { { P } } _ { j } } [ \ell ( k , g ) ] \Big ] \Big \} .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
This non-negative risk can be naively approximated by the sample average as
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\widehat { R } _ { \mathrm { n n } } ( g ; \ell ) = \sum _ { k = 1 } ^ { K } \operatorname* { m a x } \Big \{ 0 , \pi \Big [ - \frac { K - 1 } { n _ { k } } \sum _ { i = 1 } ^ { n _ { k } } \ell ( k , g ( x _ { i } ) ) + \sum _ { j = 1 } ^ { K } \frac { 1 } { n _ { i ^ { \prime } } } \sum _ { i ^ { \prime } = 1 } ^ { n _ { i ^ { \prime } } } \ell ( j , g ( x _ { i ^ { \prime } } ) ) \Big ] \Big \} .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Enforcing the reformulated risk to become non-negative was previously explored in Kiryo et al. (2017), in the context of binary classification from positive and unlabeled data. The positive class risk is already bounded below by zero in their case (because they have true positive labels), so there was a max operator only on the negative class risk. We basically follow their footsteps, but since our setting is a multi-class scenario and also differs by not having any true labels, we put a max operator on every $K$ class.
|
| 143 |
+
|
| 144 |
+
# 3.4 IMPLEMENTATION
|
| 145 |
+
|
| 146 |
+
Implementation with max operator We show practical implementation under stochastic optimization for our non-negative risk estimator. An unfortunate issue is that the minimization of (11) is not point-wise due to the max-operator, thus cannot be used directly for stochastic optimization methods with mini-batch. However, an upper bound of the risk can be minimized in parallel by using mini-batch as the following,
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\frac { 1 } { N } \sum _ { i = 1 } ^ { N } \sum _ { k = 1 } ^ { K } \operatorname* { m a x } \Big \{ 0 , \pi _ { k } \Big [ - ( K - 1 ) \widehat { \mathbb { E } } _ { \overline { { P } } _ { k } } [ \ell ( k , g ) ; \mathcal { X } _ { \widehat { k } } ^ { i } ] + \sum _ { j = 1 } ^ { K } \widehat { \mathbb { E } } _ { \overline { { P } } _ { j } } [ \ell ( k , g ) ; \mathcal { X } _ { \widehat { j } } ^ { i } ] \Big ] \Big \} ,
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
where $\widehat { \mathbb { E } }$ is the empirical version of the expectation and $\mathcal { X } _ { \overline { { j } } } ^ { i }$ denotes the samples complementarily labeled as the $j$ th class in the ith mini-batch.
|
| 153 |
+
|
| 154 |
+
Implementation with gradient ascent If the objective is negative for a certain mini-batch, the previous implementation based on the max operator will avoid the objective to further decrease. However, if the objective is already negative, that mini-batch has already started to overfit. Therefore, it would be preferable to increase itself to make this mini-batch less overfitted.
|
| 155 |
+
|
| 156 |
+
Our idea is the following. We denote the risk that corresponds to the $k$ th ordinary class for the ith mini-batch as
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
r _ { k } ^ { i } ( \theta ) = \overline { { \pi } } _ { k } \big [ - ( K - 1 ) \widehat { \mathbb { E } } _ { \overline { { P } } _ { k } } [ \ell ( k , g ) ; \mathcal { X } _ { \overline { { k } } } ^ { i } ] + \sum _ { j = 1 } ^ { K } \widehat { \mathbb { E } } _ { \overline { { P } } _ { j } } [ \ell ( k , g ) ; \mathcal { X } _ { \overline { { j } } } ^ { i } ] \big ] ,
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
and the total risk as $\begin{array} { r } { L ^ { i } ( \theta ) = \sum _ { k = 1 } ^ { K } r _ { k } ^ { i } ( \theta ) } \end{array}$ . When $\mathrm { m i n } _ { k } \{ r _ { k } ^ { i } ( \theta ) \} _ { k = 1 } ^ { K } \geq - \beta$ , we conduct gradient descent as usual with gradient $\nabla _ { \theta } L ^ { i } ( \theta )$ . On the other hand, if $\mathrm { m i n } _ { k } \{ r _ { k } ^ { i } ( \theta ) \} _ { k = 1 } ^ { K } < - \beta$ , we first squash the class-decomposed risks over $- \beta$ to $- \beta$ with a min operator, and then sum the results: $\begin{array} { r } { \tilde { L ^ { i } } ( \theta ) = \sum _ { k = 1 } ^ { K } \operatorname* { m i n } \{ - \bar { \beta } , r _ { k } ^ { i } ( \theta ) \} , } \end{array}$ .
|
| 163 |
+
|
| 164 |
+
Next we set the gradient in the opposite direction with $- \nabla _ { \boldsymbol { \theta } } \widetilde { L } ^ { i } ( \boldsymbol { \theta } )$ . Conceptually, we are going up the gradient $\nabla _ { \boldsymbol { \theta } } \widetilde { L } ^ { i } ( { \boldsymbol { \theta } } )$ for only the class-decomposed risks below $- \beta$ , to avoid the class-decomposed risks that are already large to further increase. Note that $\beta$ is a hyper-parameter that controls the tolerance of negativity. $\beta = 0$ would mean there is zero tolerance, but in practice we can also have $- \beta \neq 0$ for a threshold that allows some negative ${ \mathit { \Omega } } ^ { \prime } - \beta < 0 { \mathit { \Gamma } }$ or positive $( - \beta > 0 )$ ) amount. The procedure is shown in detail in Algorithm 1.
|
| 165 |
+
|
| 166 |
+
# 4 EXPERIMENTS
|
| 167 |
+
|
| 168 |
+
In this section, we experimentally compare our three proposed methods (Algorithm 1, (8) and (12), with two baseline methods from Ishida et al. (2017) and Yu et al. (2018). Table 2 describes the summary statistics of the benchmark datasets used in this section. The implementation is based on Pytorch2 and our code will be available on http://anonymized for reproducing results.
|
| 169 |
+
|
| 170 |
+
Input: complementarily labeled training data $\{ \mathcal { X } _ { \overline { { k } } } \} _ { \overline { { k } } = 1 } ^ { K }$ , where ${ \mathit { X } } _ { \overline { { k } } }$ denotes the samples comple
|
| 171 |
+
mentarily labeled as class $\overline { { k } }$ ;
|
| 172 |
+
Output: model parameter $\theta$ for $g ( { \pmb x } ; { \boldsymbol \theta } )$
|
| 173 |
+
1: Let $\mathcal { A }$ be an external SGD-like stochastic optimization algorithm such as Kingma & Ba (2015)
|
| 174 |
+
2: Denote $\{ \mathcal { X } _ { \overline { { j } } } ^ { i } \}$ as the $i$ -th mini-batch for complementary class $j$
|
| 175 |
+
3: Denote $\begin{array} { r } { L ^ { i } ( \theta ) = \sum _ { k = 1 } ^ { K } r _ { k } ^ { i } ( \theta ) } \end{array}$
|
| 176 |
+
4: Denote $\begin{array} { r } { r _ { k } ^ { i } ( \theta ) = \overline { { \pi } } _ { k } \widetilde { \big [ } - ( K - 1 ) \widehat { \mathbb { E } } _ { \overline { { P } } _ { k } } [ \ell ( k , g ) ; \mathcal { X } _ { \overline { { k } } } ^ { i } ] + \sum _ { j = 1 } ^ { K } \widehat { \mathbb { E } } _ { \overline { { P } } _ { j } } [ \ell ( k , g ) ; \mathcal { X } _ { \overline { { j } } } ^ { i } ] \big ] } \end{array}$
|
| 177 |
+
5: Denote $\begin{array} { r } { \widetilde L ^ { i } ( \theta ) = \sum _ { k = 1 } ^ { K } \operatorname* { m i n } \{ - \beta , r _ { k } ^ { i } ( \theta ) \} } \end{array}$
|
| 178 |
+
6: while no stopping criterion has been met:
|
| 179 |
+
7: Shuffle $\{ \hat { \mathcal { X } } _ { \bar { j } } ^ { - } \} _ { \bar { j } } ^ { K }$ into $N$ mini-batches;
|
| 180 |
+
8: for $i = 1$ to $N$ :
|
| 181 |
+
9: $\begin{array} { r } { \mathbf { i f } \operatorname* { m i n } _ { k } [ r _ { 1 } ^ { i } ( \theta ) , \dots , r _ { k } ^ { i } ( \theta ) , \dots , r _ { K } ^ { i } ( \theta ) ] > - \beta \colon } \end{array}$
|
| 182 |
+
10: Set gradient $\nabla _ { \theta } L ^ { i } ( \theta )$ ;
|
| 183 |
+
11: Update $\theta$ by $\mathcal { A }$ with its current step size $\eta$ ;
|
| 184 |
+
12: else:
|
| 185 |
+
13: Set gradient $- \nabla _ { \boldsymbol { \theta } } \widetilde { L } ^ { i } ( \boldsymbol { \theta } )$ ;
|
| 186 |
+
14: Update $\theta$ by $\mathcal { A }$ with a discounted step size $\gamma \eta$ ;
|
| 187 |
+
|
| 188 |
+
# 4.1 SETUP
|
| 189 |
+
|
| 190 |
+
For MNIST and Fashion-MNIST, a linear-in-input model with a bias term and a MLP model $( d -$ $5 0 0 - 1 )$ was trained with softmax cross-entropy loss function. Weight decay of $1 e - 4$ for weight parameters and learning rate of $5 e - 5$ for Adam (Kingma & Ba, 2015) was used.
|
| 191 |
+
|
| 192 |
+
For CIFAR-10, DenseNet (Huang et al., 2017) and Resnet-18 (He et al., 2016) with default parameter settings were trained. Weight decay of $5 e - 4$ and initial learning rate of $1 e - 2$ was used. For optimization, stochastic gradient descent was used with the momentum set to 0.9. Learning rate was halved every 30 epochs.
|
| 193 |
+
|
| 194 |
+
We trained and compared 5 methods (Free (8), Max operator (12), Gradient ascent (Alg.1), PC (Ishida et al., 2017) and Forward (Yu et al., 2018)) with only complementarily labeled data. Note that the first three are the proposed methods. We complementarily labeled our benchmark datasets so that the assumption of (3) is satisfied. This is straightforward when the dataset has a uniform (ordinarily-labeled) class prior, because it reduces to just choosing a class randomly other than the true class. For Gradient ascent, we used $\beta = 0$ and $\gamma = 0$ for simplicity. We trained 300 epochs, where mini-batch was set to 100.
|
| 195 |
+
|
| 196 |
+
# 4.2 RESULTS
|
| 197 |
+
|
| 198 |
+
Instead of showing the test accuracy for a single chosen model based on validation, we show the accuracy for all 300 epochs on test data to demonstrate how the issues discussed in Section 3.2 appear and how different implementations Section 3.4 is effective. In Figure 2, we show the mean test accuracy and standard deviation for 4 trials for the three benchmark datasets, on test data evaluated with ordinary labels.
|
| 199 |
+
|
| 200 |
+
First we compare our three proposed methods with each other. For linear models in MNIST and Fashion-MNIST, all proposed methods work similarly. However in the case of using a more flexible model (MLP model for MNIST/Fashion-MNIST, Densenet/Resnet for CIFAR-10), we can see that Free is the worst, Max operator is better and Gradient ascent is the best out of the proposed three methods at the end of all epochs $F r e e < M a x$ operator $<$ Gradient ascent). These results are consistent with the discussions of overfitting in Section 3.2 and the motivations for different implementations in Section 3.4.
|
| 201 |
+
|
| 202 |
+
Next, we compare with baseline methods. For linear models, all methods have similar performance.
|
| 203 |
+
However for deep models, the superiority stands out for Gradient ascent for all datasets.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 2: Experimental results for various datasets and models. Dark colors show the mean accuracy of 4 trials and light colors show standard deviation.
|
| 207 |
+
|
| 208 |
+
# 5 CONCLUSION
|
| 209 |
+
|
| 210 |
+
We first proposed a general risk estimator for learning from complementary labels that does not require restrictions on the form of the loss function or the model. However, since the proposed method suffers from overfitting, we proposed a modified version to alleviate this issue in two ways and have better performance. At last, we conducted experiments to show our proposed method outperforms or is comparable to current state-of-the-art methods for various benchmark datasets and for both linear and deep models.
|
| 211 |
+
|
| 212 |
+
# REFERENCES
|
| 213 |
+
|
| 214 |
+
Han Bao, Gang Niu, and Masashi Sugiyama. Classification from pairwise similarity and unlabeled data. In ICML, 2018.
|
| 215 |
+
|
| 216 |
+
Olivier Chapelle, Bernhard Schölkopf, and Alexander Zien (eds.). Semi-Supervised Learning. MIT Press, 2006.
|
| 217 |
+
|
| 218 |
+
Marthinus Christoffel du Plessis, Gang Niu, and Masashi Sugiyama. Analysis of learning from positive and unlabeled data. In NIPS, 2014.
|
| 219 |
+
|
| 220 |
+
Marthinus Christoffel du Plessis, Gang Niu, and Masashi Sugiyama. Convex formulation for learning from positive and unlabeled data. In ICML, 2015.
|
| 221 |
+
|
| 222 |
+
Charles Elkan and Keith Noto. Learning classifiers from only positive and unlabeled data. In KDD, 2008.
|
| 223 |
+
|
| 224 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 225 |
+
|
| 226 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In CVPR, 2017.
|
| 227 |
+
|
| 228 |
+
Takashi Ishida, Gang Niu, Weihua Hu, and Masashi Sugiyama. Learning from complementary labels. In NIPS, 2017.
|
| 229 |
+
|
| 230 |
+
Takashi Ishida, Gang Niu, and Masashi Sugiyama. Binary classification from positive-confidence data. In NIPS, 2018. To appear.
|
| 231 |
+
|
| 232 |
+
Diederik P. Kingma and Jimmy L. Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 233 |
+
|
| 234 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 235 |
+
|
| 236 |
+
Ryuichi Kiryo, Gang Niu, Marthinus Christoffel du Plessis, and Masashi Sugiyama. Positiveunlabeled learning with non-negative risk estimator. In NIPS, 2017.
|
| 237 |
+
|
| 238 |
+
Xingjun Ma, Yisen Wang, Michael E. Houle, Shuo Zhou, Sarah M. Erfani, Shu-Tao Xia, Sudanthi Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In ICML, 2018.
|
| 239 |
+
|
| 240 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing with virtual adversarial training. In ICLR, 2016.
|
| 241 |
+
|
| 242 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
|
| 243 |
+
|
| 244 |
+
Nagarajan Natarajan, Inderjit S. Dhillon, Pradeep K. Ravikumar, and Ambuj Tewari. Learning with noisy labels. In NIPS, 2013.
|
| 245 |
+
|
| 246 |
+
Avital Oliver, Augustus Odena, Colin Raffel, Ekin D. Cubuk, and Ian J. Goodfellow. Realistic evaluation of deep semi-supervised learning algorithms. In NIPS, 2018. To appear.
|
| 247 |
+
|
| 248 |
+
Giorgio Patrini, Alessandro Rozza, Aditya Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, 2017.
|
| 249 |
+
|
| 250 |
+
Tomoya Sakai, Marthinus Christoffel du Plessis, Gang Niu, and Masashi Sugiyama. Semisupervised classification based on classification from positive and unlabeled data. In ICML, 2017.
|
| 251 |
+
|
| 252 |
+
Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In NIPS, 2017.
|
| 253 |
+
|
| 254 |
+
Xiyu Yu, Tongliang Liu, Mingming Gong, and Dacheng Tao. Learning with biased complementary labels. In ECCV, 2018.
|
| 255 |
+
|
| 256 |
+
Tong Zhang. Statistical analysis of some multi-category large margin classification methods. Journal of Machine Learning Research, 5:1225–1251, 2004.
|
| 257 |
+
|
| 258 |
+
# A PROOF OF THEOREM 1
|
| 259 |
+
|
| 260 |
+
Proof. First of all,
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
{ \begin{array} { r l } & { \mathbb { P } ( X , { \overline { { Y } } } = { \overline { { y } } } ) = { \frac { 1 } { K - 1 } } \sum _ { y \neq { \overline { { y } } } } \mathbb { P } ( X , Y = y ) } \\ & { \quad \quad = { \frac { 1 } { K - 1 } } { \Big ( } \sum _ { y = 1 } ^ { K } \mathbb { P } ( X , Y = y ) - \mathbb { P } ( X , Y = { \overline { { y } } } ) { \Big ) } } \\ & { \quad \quad = { \frac { 1 } { K - 1 } } { \big ( } \mathbb { P } ( X ) - \mathbb { P } ( X , Y = { \overline { { y } } } ) { \big ) } . } \end{array} }
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
The first equality holds since the marginal distribution is equivalent for $\mathcal { D }$ and $\overline { { \mathcal { D } } }$ and we assume (3). Consequently,
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { l } { \displaystyle \mathbb { P } ( \overline { { Y } } = \overline { { y } } | X = x ) = \frac { \mathbb { P } ( X = x , \overline { { Y } } = \overline { { y } } ) } { \mathbb { P } ( X = x ) } } \\ { \displaystyle = \frac { 1 } { K - 1 } \cdot \Big ( 1 - \frac { \mathbb { P } ( X , Y = \overline { { y } } ) } { \mathbb { P } ( X = x ) } \Big ) } \\ { \displaystyle = \frac { 1 } { K - 1 } \cdot \big ( 1 - \mathbb { P } ( Y = \overline { { y } } | X = x ) \big ) } \\ { \displaystyle = - \frac { 1 } { K - 1 } \mathbb { P } ( Y = \overline { { y } } | X = x ) + \frac { 1 } { K - 1 } . } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
More simply, we have
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\pmb { \eta } ( x ) = - ( K - 1 ) \overline { { \pmb { \eta } } } ( x ) + \mathbf { 1 } .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Finally, we transform the classification risk,
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\begin{array} { r l } { R ( g ; \ell ) = \mathbb { E } _ { ( X , Y ) \sim \overline { { D } } } [ \ell ( Y , g ( X ) ) ] } & { } \\ & { = \mathbb { E } _ { X \sim M } [ \eta ^ { \top } \ell ( g ( X ) ) ] } \\ & { = \mathbb { E } _ { X \sim M } \Big [ \big ( - ( K - 1 ) \overline { { \eta } } ^ { \top } + \mathbf { 1 } ^ { \top } \big ) \ell \big ( g ( X ) \big ) \Big ] } \\ & { = \mathbb { E } _ { X \sim M } \Big [ - ( K - 1 ) \overline { { \eta } } ^ { \top } \ell \big ( g ( X ) \big ) + \mathbf { 1 } ^ { \top } \ell \big ( g ( X ) \big ) \Big ] } \\ & { = \mathbb { E } _ { ( X , \overline { { Y } } ) \sim \overline { { D } } } \big [ - ( K - 1 ) \cdot \ell \big ( \overline { { Y } } , g ( X ) \big ) \big ] + \mathbf { 1 } ^ { \top } \mathbb { E } _ { X \sim M } \big [ \ell \big ( g ( X ) \big ) \big ] } \\ & { = \displaystyle \sum _ { k = 1 } ^ { K } \mathbb { E } _ { X \sim \overline { { P } } _ { k } } \Big [ \overline { { \pi } } _ { k } \cdot \Big ( - ( K - 1 ) \cdot \ell \big ( k , g ( X ) \big ) + \mathbf { 1 } ^ { \top } \ell \big ( g ( X ) \big ) \Big ) \Big ] } \\ & { = R ( g ; \overline { { \ell } } ) } \end{array}
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
for the complementary loss,
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\overline { { \ell } } ( k , \pmb { g } ) : = - ( K - 1 ) \ell ( k , \pmb { g } ) + \mathbf { 1 } ^ { \top } \ell ( \pmb { g } ) ,
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
which concludes the proof.
|
| 291 |
+
|
| 292 |
+
# B DETAILS OF DATASETS USED IN SECTION 4
|
| 293 |
+
|
| 294 |
+
In Table 2, we explain the details of the datasets used in Section 4. See http://yann.lecun.com/exdb/mnist/ for MNIST, https://github.com/zalandoresearch/fashion-mnist for Fashion-MNIST, and https://www.cs.toronto.edu/\~kriz/cifar.html for CIFAR-10.
|
| 295 |
+
|
| 296 |
+
Table 2: Summary statistics of benchmark datasets.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Name</td><td>#Train</td><td>#Test</td><td>#Dim</td><td># Classes</td><td>Model</td></tr><tr><td>MNIST</td><td>60,000</td><td>10,000</td><td>784</td><td>10</td><td>Linear, MLP</td></tr><tr><td>Fashion MNIST</td><td>60.000</td><td>10,000</td><td>784</td><td>10</td><td>Linear,MLP</td></tr><tr><td>CIFAR-10</td><td>60,000</td><td>10,000</td><td>2,048</td><td>10</td><td>DenseNet, Resnet</td></tr></table>
|
md/train/WigDnV-_Gq/WigDnV-_Gq.md
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BernNet: Learning Arbitrary Graph Spectral Filters via Bernstein Approximation
|
| 2 |
+
|
| 3 |
+
Mingguo He Renmin University of China mingguo@ruc.edu.cn
|
| 4 |
+
|
| 5 |
+
Zhewei Wei∗ Renmin University of China zhewei@ruc.edu.cn
|
| 6 |
+
|
| 7 |
+
Zengfeng Huang Fudan University huangzf@fudan.edu.cn
|
| 8 |
+
|
| 9 |
+
Hongteng $\mathbf { X } \mathbf { u } ^ { * }$ Renmin University of China hongtengxu@ruc.edu.cn
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Many representative graph neural networks, e.g., GPR-GNN and ChebNet, approximate graph convolutions with graph spectral filters. However, existing work either applies predefined filter weights or learns them without necessary constraints, which may lead to oversimplified or ill-posed filters. To overcome these issues, we propose BernNet, a novel graph neural network with theoretical support that provides a simple but effective scheme for designing and learning arbitrary graph spectral filters. In particular, for any filter over the normalized Laplacian spectrum of a graph, our BernNet estimates it by an order- $K$ Bernstein polynomial approximation and designs its spectral property by setting the coefficients of the Bernstein basis. Moreover, we can learn the coefficients (and the corresponding filter weights) based on observed graphs and their associated signals and thus achieve the BernNet specialized for the data. Our experiments demonstrate that BernNet can learn arbitrary spectral filters, including complicated band-rejection and comb filters, and it achieves superior performance in real-world graph modeling tasks. Code is available at https://github.com/ivam-he/BernNet.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Graph neural networks (GNNs) have received extensive attention from researchers due to their
|
| 18 |
+
excellent performance on various graph learning tasks such as social analysis [24, 17, 29], drug
|
| 19 |
+
discovery [12, 25], traffic forecasting [18, 3, 6], recommendation system [38, 32] and computer
|
| 20 |
+
vision [39, 4]. Recent studies suggest that many popular GNNs operate as polynomial graph spectral
|
| 21 |
+
filters [7, 13, 5, 16, 2, 35]. Specifically, we denote an undirected graph with node set $V$ and edge
|
| 22 |
+
set $E$ as $G = ( V , E )$ , whose adjacency matrix is A. Given a signal $\mathbf { x } = [ x ] \in R ^ { n }$ on the graph, $n = | V |$ weightshe diag, where is the symmetric normalizednother equivalent polynomial normalized adjacency matrix
|
| 23 |
+
$\scriptstyle \sum _ { k = 0 } ^ { K } w _ { k } \mathbf { L } ^ { k } \mathbf { x }$ $w _ { k }$ $\mathbf { L } = \mathbf { I } - \mathbf { D } ^ { - 1 / 2 } \mathbf { A } \mathbf { D } ^ { - 1 / 2 }$ $G$ $\mathbf { D }$ $\scriptstyle \sum _ { k = 0 } ^ { K } c _ { k } \mathbf { P } ^ { k } \mathbf { x }$ $\mathbf { P } = \mathbf { D } ^ { - 1 / 2 } \mathbf { A } \mathbf { D } ^ { - 1 / 2 }$ $c _ { k }$
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: An illustration of the proposed BernNet.
|
| 27 |
+
|
| 28 |
+
We can broadly categorize the GNNs applying the above filtering operation into two classes, depending on whether they design the filter weights or learn them based on observed graphs. Some representative models in these two classes are shown below.
|
| 29 |
+
|
| 30 |
+
• The GNNs driven by designing filters: GCN [13] uses a simplified first-order Chebyshev polynomial, which is proven to be a low-pass filter [1, 31, 34, 41]. APPNP [14] utilizes Personalized PageRank (PPR) to set the filter weights and achieves a low-pass filter as well [15, 41]. GNN-LF/HF [41] designs filter weights from the perspective of graph optimization functions, which can simulate high- and low-pass filters.
|
| 31 |
+
|
| 32 |
+
• The GNNs driven by learning filters: ChebNet [7] approximates the filtering operation with Chebyshev polynomials, and learns a filter via trainable weights of the Chebyshev basis. GPR-GNN [5] learns a polynomial filter by directly performing gradient descent on the filter weights, which can derive high- or low-pass filters. ARMA [2] learns a rational filter via the family of Auto-Regressive Moving Average filters [21].
|
| 33 |
+
|
| 34 |
+
Although the above GNNs achieve some encouraging results in various graph modeling tasks, they still suffer from two major drawbacks. Firstly, most existing methods focus on designing or learning simple filters (e.g., low- and/or high-pass filters), while real-world applications often require much more complex filters such as band-rejection and comb filters. To the best of our knowledge, none of the existing work supports designing arbitrary interpretable spectral filters. The GNNs driven by learning filters can learn arbitrary filters in theory, but they cannot intuitively show what filters they have learned. In other words, their interpretability is poor. For example, GPR-GNN [5] learns the filter weights $w _ { k }$ ’s but only proves a small subset of the learnt weight sequences corresponds to low- or high-pass filters. Secondly, the GNNs often design their filters empirically or learn the filter weights without any necessary constraints. As a result, their filter weights often have poor controllability. For example, GNN-LF/HF [41] designs its filters with a complex and non-intuitive polynomial with difficult-to-tune hyperparameters. The multi-layer GCN/SGC [13, 31] leads to “ill-posed” filters (i.e., those deriving negative spectral responses). Additionally, the filters learned by GPR-GNN [5] or ChebNet [7] have a chance to be ill-posed as well.
|
| 35 |
+
|
| 36 |
+
To overcome the above issues, we propose a novel graph neural network called BernNet, which provides an effective algorithmic framework for designing and learning arbitrary graph spectral filters. As illustrated in Figure 1, for an arbitrary spectral filter $h : [ 0 , 2 ] \mapsto [ 0 , 1 ]$ over the spectrum of the symmetric normalized Laplacian $\mathbf { L }$ , our BernNet approximates $h$ by a $K$ -order Bernstein polynomial approximation, i.e., $\begin{array} { r } { \bar { h } ( \lambda ) = \sum _ { k = 0 } ^ { K } \theta _ { k } b _ { k } ^ { K } ( \lambda ) } \end{array}$ . The non-negative coefficients $\{ \theta _ { k } \} _ { k = 0 } ^ { K }$ of the Bernstein basis $\{ b _ { k } ^ { K } ( \lambda ) \} _ { k = 0 } ^ { K }$ work as the model parameter, which can be interpreted as $h ( 2 k / K )$ , $k = 0 , \ldots , K$ (i.e., the filter values uniformly sampled from [0, 2]). By designing or learning the $\theta _ { k }$ ’s, we can obtain various spectral filters, whose filtering operation can be formulated as $\begin{array} { r l } { ~ } & { { } \sum _ { k = 0 } ^ { K } \theta _ { k } \frac { 1 } { 2 ^ { K } } \binom { K } { k } ( 2 \mathbf { I } - \mathbf { L } ) ^ { K - k } \mathbf { L } ^ { k } \mathbf { x } } \end{array}$ , where $\mathbf { x }$ is the graph signal. We further demonstrate the rationality of our BernNet from the perspective of graph optimization — any valid polynomial filers, i.e., those polynomial functions mapping $[ 0 , 2 ]$ to $[ 0 , 1 ]$ , can always be expressed by our BernNet, and accordingly, the filters learned by our BernNet are always valid. Finally, we conduct experiments to demonstrate that 1) BernNet can learn arbitrary graph spectral filters (e.g., band-rejection, comb, low-band-pass, etc.), and 2) BernNet achieves superior performance on real-world datasets.
|
| 37 |
+
|
| 38 |
+
# 2 BernNet
|
| 39 |
+
|
| 40 |
+
# 2.1 Bernstein approximation of spectral filters
|
| 41 |
+
|
| 42 |
+
Given an arbitrary filter function $h : [ 0 , 2 ] \mapsto [ 0 , 1 ]$ , let $\mathbf { L } = \mathbf { U } \mathbf { A } \mathbf { U } ^ { T }$ denote the eigendecomposition of the symmetric normalized Laplacian matrix $\mathbf { L }$ , where $\mathbf { U }$ is the matrix of eigenvectors and $\Lambda =$ $d i a g [ \lambda _ { 1 } , . . . , \lambda _ { n } ]$ is the diagonal matrix of eigenvalues. We use
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
h ( { \bf L } ) { \bf x } = { \bf U } h ( { \boldsymbol \Lambda } ) { \bf U } ^ { T } { \bf x } = { \bf U } d i a g [ h ( \lambda _ { 1 } ) , . . . , h ( \lambda _ { n } ) ] { \bf U } ^ { T } { \bf x }
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
to denote a spectral filter on graph signal $\mathbf { x }$ . The key of our work is approximate $h ( \mathbf { L } )$ (or, equivalently, $h ( \lambda ) )$ . For this purpose, we leverage the Bernstein basis and Bernstein polynomial approximation defined below.
|
| 49 |
+
|
| 50 |
+
Definition 2.1 ( [10]). (Bernstein polynomial approximation) Given an arbitrary continuous function $f ( t )$ on $t \in [ 0 , 1 ]$ , the Bernstein polynomial approximation (of order $K$ ) for $f$ is defined as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
p _ { K } ( t ) : = \sum _ { k = 0 } ^ { K } \theta _ { k } \cdot b _ { k } ^ { K } ( t ) = \sum _ { k = 0 } ^ { K } f \left( \frac { k } { K } \right) \cdot \binom { K } { k } ( 1 - t ) ^ { K - k } t ^ { k } .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Here, for $k = 0 , . . . , K$ $\begin{array} { r } { K , b _ { k } ^ { K } ( t ) = \binom { K } { k } ( 1 - t ) ^ { K - k } t ^ { k } } \end{array}$ is the $k$ -th Bernstein base, and $\textstyle \theta _ { k } = f ( { \frac { k } { K } } )$ is the function value at $k / K$ , which works as the coefficient of $b _ { k } ^ { K } ( t )$ .
|
| 57 |
+
|
| 58 |
+
Lemma 2.1 ( [10]). Given an arbitrary continuous function $f ( t )$ on $t \in [ 0 , 1 ] ,$ , let $p _ { K } ( t )$ denote the Bernstein approximation of $f ( t )$ as defined in Equation (2). We have $p _ { K } ( t ) f ( t )$ as $K \infty$ .
|
| 59 |
+
|
| 60 |
+
For the filter function $h : [ 0 , 2 ] \mapsto [ 0 , 1 ]$ , we let $\begin{array} { r } { t = \frac { \lambda } { 2 } } \end{array}$ and $f ( t ) = h ( 2 t )$ , so that the Bernstein polynomial approximation becomes applicable, where $\theta _ { k } = f ( k / K ) = h ( 2 k / K )$ and $b _ { k } ^ { K } ( t ) =$ $\begin{array} { r } { b _ { k } ^ { K } ( \frac { \lambda } { 2 } ) \ = \ \binom { K } { k } ( 1 - \frac { \lambda } { 2 } ) ^ { K - k } ( \frac { \lambda } { 2 } ) ^ { k } } \end{array}$ for $k = 1 , . . . , K$ . Consequently, we can approximate $h ( \lambda )$ by $\begin{array} { r } { p _ { K } ( \lambda / 2 ) = \sum _ { k = 0 } ^ { K } \theta _ { k } { \binom { K } { k } } ( 1 - \frac { \lambda } { 2 } ) ^ { K - k } \left( \frac { \lambda } { 2 } \right) ^ { k } = \sum _ { k = 0 } ^ { K } \theta _ { k } \frac { 1 } { 2 ^ { K } } { \binom { K } { k } } ( 2 - \lambda ) ^ { K - k } \lambda ^ { k } . } \end{array}$ , and Lemma 2.1 ensures that $p _ { K } ( \lambda / 2 ) \to h ( \lambda )$ as $K \infty$ .
|
| 61 |
+
|
| 62 |
+
Replacing $\{ h ( \lambda _ { i } ) \} _ { i = 1 } ^ { n }$ with $\{ p _ { K } ( \lambda _ { i } / 2 ) \} _ { i = 1 } ^ { n }$ , we approximate the spectral filter $h ( \mathbf { L } )$ in Equation (1) as Udiag $[ p _ { K } ( \lambda _ { 1 } / 2 ) , . . . , p _ { K } ( \lambda _ { n } / 2 ) ] \mathbf { U } ^ { T }$ and derive the proposed BernNet. In particular, given a graph signal $\mathbf { x }$ , the convolutional operator of our BernNet is defined as follows:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbf { z } = \underbrace { \mathbf { U } d i a g [ p _ { K } ( \lambda _ { 1 } / 2 ) , . . . , p _ { K } ( \lambda _ { n } / 2 ) ] \mathbf { U } ^ { T } } _ { \mathrm { B e r n N e t } } \mathbf { U } ^ { T } \mathbf { x } = \sum _ { k = 0 } ^ { K } \theta _ { k } { \frac { 1 } { 2 ^ { K } } } { \binom { K } { k } } ( 2 \mathbf { I } - \mathbf { L } ) ^ { K - k } \mathbf { L } ^ { k } \mathbf { x }
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where each coefficient $\theta _ { k }$ can be either set to $h ( 2 k / K )$ to approximate a predetermined filter $h$ , or learnt from the graph structure and signal in an end-to-end fashion. As a natural extension of Lemma 2.1, our BernNet owns the following proposition.
|
| 69 |
+
|
| 70 |
+
Proposition 2.1. For an arbitrary continuous filter function $h : [ 0 , 2 ] [ 0 , 1 ] ,$ , by setting $\theta _ { k } =$ $h ( 2 \bar { k } / K ) , k = 0 , \dots , K$ , the $\mathbf { z }$ in Equation (3) satisfies ${ \bf z } h ( { \bf L } ) { \bf x } $ as $K \infty$ .
|
| 71 |
+
|
| 72 |
+
Proof. According to the above derivation, we have $\begin{array} { r } { p _ { K } ( \lambda / 2 ) = \sum _ { k = 0 } ^ { K } \theta _ { k } \binom { K } { k } ( 1 - \frac { \lambda } { 2 } ) ^ { K - k } \left( \frac { \lambda } { 2 } \right) ^ { k } = } \end{array}$ $\begin{array} { r } { \sum _ { k = 0 } ^ { K } \theta _ { k } \frac { 1 } { 2 ^ { K } } \binom { K } { k } ( 2 - \lambda ) ^ { K - k } \lambda ^ { k } } \end{array}$ , and Lemma 2.1 ensures that $p _ { K } ( \lambda / 2 ) \to h ( \lambda )$ as $\theta _ { k } = h ( 2 k / K )$ and $K \infty$ .
|
| 73 |
+
|
| 74 |
+
Consequently, we have
|
| 75 |
+
|
| 76 |
+
$\mathbf { z } = \mathbf { U } d i a g [ p _ { K } ( \lambda _ { 1 } / 2 ) , . . . , p _ { K } ( \lambda _ { n } / 2 ) ] \mathbf { U } ^ { T } \mathbf { x } \to \mathbf { U } d i a g [ h ( \lambda _ { 1 } ) , . . . , h ( \lambda _ { n } ) ] \mathbf { U } ^ { T } \mathbf { x } = h ( \mathbf { L } )$ as $\theta _ { k } = h ( 2 k / K )$ and $K \infty$ .
|
| 77 |
+
|
| 78 |
+
# 2.2 Realizing existing filters with BernNet.
|
| 79 |
+
|
| 80 |
+
As shown in Proposition 2.1, our BernNet can approximate arbitrary continuous spectral filters with sufficient precision. Below we give some representative examples of how our BernNet exactly realizes existing filters that are commonly used in GNNs.
|
| 81 |
+
|
| 82 |
+
Table 1: Realizing commonly used filters with BernNet.
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Filter types</td><td>Filter h(λ)</td><td>0k for k=0,...,K</td><td>Bernstein approximation pk()</td><td>BernNet</td></tr><tr><td>All-pass</td><td>1</td><td>0=1</td><td>1</td><td>I</td></tr><tr><td>Linear low-pass</td><td>1->/2</td><td>0=1-k/K</td><td>1-λ/2</td><td>1</td></tr><tr><td>Linear high-pass</td><td>入/2</td><td>0=k/K</td><td>入/2</td><td></td></tr><tr><td>Impulse low-pass</td><td>(入)</td><td>0=1and other 0k =0</td><td>(1-X/2)K</td><td></td></tr><tr><td>Impulse high-pass</td><td>8(入)</td><td>0K=1and other 0k =0</td><td>(入/2)K</td><td>美K</td></tr><tr><td>Impulse band-pass</td><td>8(入)</td><td>0K/2 =1and other 0k =0</td><td>(K2)(1->/2)K/2(/2)K/2</td><td>(K/2)(21-L)K/2LK/2</td></tr></table>
|
| 85 |
+
|
| 86 |
+
• All-pass filter $h ( \lambda ) = 1$ . We set $\theta _ { k } \ = \ 1$ for $k = 0 , \ldots , K$ , and the approximation $p _ { K } ( \frac { \lambda } { 2 } ) = 1$ is exactly the same with $h ( \lambda )$ . Accordingly, our BernNet becomes an identity matrix, which realizes the all-pass filter perfectly.
|
| 87 |
+
|
| 88 |
+
• Linear low-pass filter $h ( \lambda ) = 1 - \lambda / 2$ . We set $\theta _ { k } = 1 - k / K$ for $k = 0 , \ldots , K$ and obtain $p _ { K } ( \frac { \lambda } { 2 } ) = 1 - \lambda / 2$ . The BernNet becomes $\begin{array} { r } { \sum _ { k = 0 } ^ { K } \frac { ( K - k ) } { K } \frac { 1 } { 2 ^ { K } } \binom { K } { k } ( 2 \mathbf { I } - \mathbf { L } ) ^ { K - k } \mathbf { L } ^ { k } = \mathbf { I } - \frac { 1 } { 2 } \mathbf { L } } \end{array}$ which achieves the linear low-pass filter exactly. Note that $\begin{array} { r } { \mathbf { I } - \frac { 1 } { 2 } \mathbf { L } = \frac { 1 } { 2 } ( \mathbf { I } + \mathbf { P } ) } \end{array}$ is also the same as the graph convolutional network (GCN) before renormalization [13].
|
| 89 |
+
|
| 90 |
+
• Linear high-pass filter $h ( \lambda ) = \lambda / 2$ . Similarly, we can set $\theta _ { k } = k / K$ for $k = 0 , \ldots , K$ to get a perfect approximation $\begin{array} { r } { p _ { K } ( \frac { \lambda } { 2 } ) = \frac { \lambda } { 2 } } \end{array}$ , and the BernNet becomes $\scriptstyle { \frac { 1 } { 2 } } \mathbf { L }$ .
|
| 91 |
+
|
| 92 |
+
Note that even for those non-continuous spectral filters, e.g., the impulse low/high/band-pass filters, our BernNet can also provide good approximations (with sufficient large $K$ ).
|
| 93 |
+
|
| 94 |
+
• Impulse low-pass filter $h ( \lambda ) = \delta _ { 0 } ( \lambda )$ .† We set $\theta _ { 0 } = 1$ and $\theta _ { k } \ = \ 0$ for $k \neq 0$ , and $\begin{array} { r } { p _ { K } \bar { ( \frac { \lambda } { 2 } ) } = ( 1 - \frac { \bar { \lambda } } { 2 } ) ^ { K } } \end{array}$ . Accordingly, the BernNet becomes $\begin{array} { r } { \frac { 1 } { 2 ^ { K } } ( 2 \mathbf { I } - \mathbf { L } ) ^ { K } } \end{array}$ , deriving an $K$ -layer linear low-pass filter.
|
| 95 |
+
|
| 96 |
+
• Impulse high-pass filter $h ( \lambda ) = \delta _ { 2 } ( \lambda )$ . We set $\theta _ { K } = 1$ and $\theta _ { k } = 0$ for $k \neq K$ , and $\begin{array} { r } { p _ { K } ( \frac { \lambda } { 2 } ) = ( \frac { \lambda } { 2 } ) ^ { K } } \end{array}$ . The BernNet becomes $\scriptstyle { \frac { 1 } { 2 ^ { K } } } \mathbf { L } ^ { K }$ , i.e., an $K$ -layer linear high-pass filter.
|
| 97 |
+
|
| 98 |
+
• Impulse band-pass filter $h ( \lambda ) = \delta _ { 1 } ( \lambda )$ . Similarly, we set $\theta _ { K / 2 } = 1$ and $\theta _ { k } = 0$ for $k \neq$ $K / 2$ , and $\begin{array} { r } { p _ { K } ( \frac { \lambda } { 2 } ) = \binom { K } { K / 2 } ( 1 - \lambda / 2 ) ^ { K / 2 } ( \lambda / 2 ) ^ { K / 2 } } \end{array}$ . The BernNet becomes $\frac { 1 } { 2 ^ { K } } \binom { K } { K / 2 } ( 2 \mathbf { I } -$ $\mathbf { L } ) ^ { K / 2 } \mathbf { L } ^ { K / 2 }$ , which can be explained as stacking a $K / 2$ -layer linear low-pass filter and a $K / 2$ -layer linear high-pass filter. Obviously, $K$ should be an even number in this case.
|
| 99 |
+
|
| 100 |
+
Table 1 summarizes the design of the BernNet for the filters above. We can find that an appealing advantage of our BernNet is that its coefficients are highly correlated with the spectral property of the target filter. In particular, we can determine to pass or reject the spectral signal with $\textstyle \lambda \approx { \frac { { \bar { 2 } } k } { K } }$ by using a large or small property provid $\theta _ { k }$ because each Bernstein base useful guidance when designi $b _ { k } ^ { K } ( \lambda )$ corresponds to a “bump” located at rs, which enhances the interpretabili $\textstyle { \frac { 2 k } { K } }$ . This of our BernNet.
|
| 101 |
+
|
| 102 |
+
# 2.3 Learning complex filters with BernNet
|
| 103 |
+
|
| 104 |
+
Besides designing the above typical filters, our BernNet can express more complex filters, such as band-pass, band-rejection, comb, low-band-pass filters, etc. Moreover, given the graph signals before and after applying such filters (i.e., the x’s and the corresponding $\mathbf { z }$ ’s), our BernNet can learn their approximations in an end-to-end manner. Specifically, given the pairs $\{ \mathbf { x } , \mathbf { z } \}$ , we learn the coefficients $\{ \theta _ { k } \} _ { k = 0 } ^ { K }$ of the BernNet by gradient descent. More implementation details can be found at the experimental section below. Figure 2 illustrates the four complex filters and the approximations we learned (The low-band pass filter is $h ( \lambda ) = I _ { [ 0 , 0 . 5 ] } ( \lambda ) + \hat { \exp { ( - 1 0 0 ( \lambda - 0 . 5 ) ^ { 2 } ) } } \hat { I } _ { ( 0 . 5 , 1 ) } ( \lambda ) +$ $\exp { ( - 5 0 ( \lambda - 1 . 5 ) ^ { 2 } ) } I _ { [ 1 , 2 ] } ( \lambda )$ , where $I _ { \Omega } ( \lambda ) = 1$ when $\lambda \in \Omega$ , otherwise $I _ { \Omega } ( \lambda ) = 0 )$ . In general, our BernNet can learn a smoothed approximation of these complex filters, and the approximation precision improves with the increase of the order $K$ . Note that although the BernNet cannot pinpoint the exact peaks of the comb filter or drop to 0 for the valleys of comb or low-band-pass filters due to the limitation of $K$ , it still significantly outperforms other GNNs for learning such complex filters.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Illustrations of four complex filters and their approximations learnt by BernNet.
|
| 108 |
+
|
| 109 |
+
# 3 BernNet in the Lens of Graph Optimization
|
| 110 |
+
|
| 111 |
+
In this section, we motivate BernNet from the perspective of graph optimization. In particular, we show that any polynomial filter that attempts to approximate a valid filter has to take the form of BernNet.
|
| 112 |
+
|
| 113 |
+
# 3.1 A generalized graph optimization problem
|
| 114 |
+
|
| 115 |
+
Given a $n$ -dimensional graph signal $\mathbf { x }$ , we consider a generalized graph optimization problem
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\operatorname* { m i n } _ { \mathbf { z } } f ( \mathbf { z } ) = ( 1 - \alpha ) \mathbf { z } ^ { T } \boldsymbol { \gamma } ( \mathbf { L } ) \mathbf { z } + \alpha \| \mathbf { z } - \mathbf { x } \| _ { 2 } ^ { 2 }
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\alpha \in [ 0 , 1 )$ is a trade-off parameter, $\mathbf { z } \in R ^ { n }$ denotes the propagated representation of the input graph signal $\mathbf { x }$ , and $\gamma ( \mathbf { L } )$ denotes an energy function of $\mathbf { L }$ , determining the rate of propagation [28]. Generally, $\gamma ( \cdot )$ operates on the spectral of $\mathbf { L }$ , and we have $\gamma ( { \bf L } ) = { \bf U } { \bar { d } } i a g [ \gamma ( \lambda _ { 1 } ) , \dot { \bf \omega } . \dot { \bf \omega } , \dot { \gamma ( \lambda _ { n } ) } ] { \bf U } ^ { T }$ .
|
| 122 |
+
|
| 123 |
+
We can model the polynomial filtering operation of existing GNNs with the optimal solution of Equation (4). For example, if we set $\begin{array} { r } { \gamma ( \mathbf { L } ) = \mathbf { L } } \end{array}$ , then the optimization function (4) becomes $f ( \mathbf { \bar { z } } ) = ( 1 - \alpha ) \mathbf { z } ^ { T } \mathbf { L } \mathbf { z } + \acute { \alpha } \| \mathbf { z } - \mathbf { x } \| _ { 2 } ^ { 2 }$ , a well-known convex graph optimization function proposed by Zhou et al. [40]. $f ( \mathbf { z } )$ takes the minimum when the derivativ e ∂f(z)z = 2(1 − α)Lz + 2α (z − x) = 0, which solves to
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathbf { z } ^ { * } = \alpha \left( \mathbf { I } - ( 1 - \alpha ) ( \mathbf { I } - \mathbf { L } ) \right) ^ { - 1 } \mathbf { x } = \sum _ { k = 0 } ^ { \infty } \alpha ( 1 - \alpha ) ^ { k } \left( \mathbf { I } - \mathbf { L } \right) ^ { k } \mathbf { x } = \sum _ { k = 0 } ^ { \infty } \alpha ( 1 - \alpha ) ^ { k } \mathbf { P } ^ { k } \mathbf { x } .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
By taking a suffix sum $\begin{array} { r } { \sum _ { k = 0 } ^ { K } \alpha ( 1 - \alpha ) ^ { k } \mathbf { P } ^ { k } \mathbf { x } } \end{array}$ , we obtain the polynomial filtering operation for APPNP [14]. Zhu et al. [41] further show that GCN [13], DAGNN [19], and JKNet [36] can be interpreted by the optimization function (4) with $\gamma ( \mathbf { L } ) = \mathbf { L }$ .
|
| 130 |
+
|
| 131 |
+
The generalized form of Equation (4) allows us to simulate more complex polynomial filtering operation. For example, let $\alpha = 0 . 5$ and $\gamma ( \mathbf { L } ) = e ^ { t \mathbf { L } } - \mathbf { I }$ , a heat kernel with $t$ as the temperature parameter. Then $f ( \mathbf { z } )$ takes the minimum when the derivative $\begin{array} { r } { \frac { \partial f ( \mathbf { z } ) } { \partial \mathbf { z } } = \left( e ^ { t \mathbf { L } } - \mathbf { I } \right) \mathbf { z } + \mathbf { z } - \mathbf { x } = \mathbf { 0 } } \end{array}$ , which solves to
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathbf { z } ^ { * } = e ^ { - t \mathbf { L } } \mathbf { x } = e ^ { - t ( \mathbf { I } - \mathbf { P } ) } \mathbf { x } = \sum _ { k = 0 } ^ { \infty } e ^ { - t } \frac { t ^ { k } } { k ! } \mathbf { P } ^ { k } \mathbf { x } .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
By taking a suffix sum $\textstyle \sum _ { k = 0 } ^ { K } e ^ { - t } { \frac { t ^ { k } } { k ! } } \mathbf { P } ^ { k } \mathbf { x }$ , we obtain the polynomial filtering operation for the heat kernal based GNN such as GDC [15] and GraphHeat [34].
|
| 138 |
+
|
| 139 |
+
# 3.2 Non-negative constraint on polynomial filters
|
| 140 |
+
|
| 141 |
+
A natural question is that, does an arbitrary energy function $\gamma ( \mathbf { L } )$ correspond to a valid or ill-posed spectral filter? Conversely, does any polynomial filtering operation $\scriptstyle \sum _ { k = 0 } ^ { K } w _ { k } \mathbf { L } ^ { k } \mathbf { x }$ correspond to the optimal solution of the optimization function (4) for some energy function $\gamma ( \mathbf { L } )$ ?
|
| 142 |
+
|
| 143 |
+
As it turns out, there is a “minimum requirement” for the energy function $\gamma ( \mathbf { L } )$ ; $\gamma ( \mathbf { L } )$ has to be positive semidefinite. In particular, if $\gamma ( \mathbf { L } )$ is not positive semidefinite, then the optimization function $f ( \mathbf { z } )$ is not convex, and the solution to $\begin{array} { r } { \frac { \partial f ( \mathbf { z } ) } { \partial \mathbf { z } } = 0 } \end{array}$ may corresponds to a saddle point. Furthermore, without the positive semidefinite constraint on $\gamma ( \mathbf { L } )$ , $f ( \mathbf { z } )$ may goes to $- \infty$ as we set $\mathbf { z }$ to be a multiple of the eigenvector corresponding to the negative eigenvalue.
|
| 144 |
+
|
| 145 |
+
Non-negative polynomial filters. Given a positive semidefinite energy function $\gamma ( \mathbf { L } )$ , we now consider how the corresponding polynomial filtering operatio n PKk=0 wkLkx should look like. Recall that we assume $\boldsymbol \gamma ( \mathbf { L } ) = \mathbf { U } d i a g [ \gamma ( \lambda _ { 1 } ) , . . . , \gamma ( \lambda _ { n } ) ] \mathbf { U } ^ { T }$ . By the positive semidefinite constraint, we have $\gamma ( \lambda ) \geq 0$ for $\lambda \in [ 0 , 2 ]$ . Since the objective function $f ( \mathbf { z } )$ is convex, it takes the minimum when $\begin{array} { r } { \frac { \partial f ( \mathbf { z } ) } { \partial \mathbf { z } } = 2 ( 1 - \alpha ) \gamma ( \mathbf { L } ) \mathbf { z } + 2 \alpha \left( \mathbf { z } - \mathbf { x } \right) = \mathbf { 0 } } \end{array}$ . Accordingly, the optimum $z ^ { * }$ can be derived as
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\alpha \left( \alpha \mathbf { I } + ( 1 - \alpha ) \gamma ( \mathbf { L } ) \right) ^ { - 1 } \mathbf { x } = \mathbf { U } d i a g \left[ \frac { \alpha } { \alpha + ( 1 - \alpha ) \gamma ( \lambda _ { 1 } ) } , . . . , \frac { \alpha } { \alpha + ( 1 - \alpha ) \gamma ( \lambda _ { n } ) } \right] \mathbf { U } ^ { T } \mathbf { x } .
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
Let h(λ) = αα+(1−α)γ(λ) denote the exact spectral filter, and $\begin{array} { r } { g ( \lambda ) = \sum _ { k = 0 } ^ { K } w _ { k } \lambda ^ { k } } \end{array}$ denote a polynomial approximation of $h ( \lambda )$ (e.g. the suffix sum of $h ( \lambda )$ ’s taylor expansion). Since $\gamma ( \lambda ) \geq 0$ when the polynomial filter $\lambda \in [ 0 , 2 ]$ , we have $\begin{array} { r } { 0 \leq \dot { h } ( \lambda ) \leq \frac { \alpha } { \alpha + ( 1 - \alpha ) \cdot 0 } = 1 } \end{array}$ $\begin{array} { r } { g ( \lambda ) = \sum _ { k = 0 } ^ { K } w _ { k } \lambda ^ { k } } \end{array}$ 0 also satisfies for $\lambda \in [ 0 , 2 ]$ $0 \leq g ( \lambda ) \leq 1$ . Consequently, it is natural to assume .
|
| 152 |
+
|
| 153 |
+
Constraint 3.1. Assuming the energy function $\gamma ( \mathbf { L } )$ is positive semidefinite, a polynomial filter $\begin{array} { r } { g ( \lambda ) = \sum _ { k = 0 } ^ { K } w _ { k } \lambda ^ { k } } \end{array}$ approximating the optimal solution to Equation (4) has to satisfy
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
0 \leq g ( \lambda ) = \sum _ { k = 0 } ^ { K } w _ { k } \lambda ^ { k } \leq 1 , \forall \lambda \in [ 0 , 2 ] .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
While Constraint 3.1 seems to be simple and intuitive, some of the existing GNN may not satisfies this constraint. For example, GCN uses $\mathbf { \bar { z } } = \mathbf { P x } = \left( \mathbf { I } - \mathbf { L } \right) \mathbf { x }$ , which corresponds to a polynomial filter $g ( \lambda ) = 1 - \lambda$ that takes negative value when $\lambda > 1$ , violating Constraint 3.1. As shown in [31], the renormalization trick $\tilde { \mathbf { P } } = \left( \mathbf { I } + \mathbf { D } \right) ^ { - 1 / 2 } \left( \mathbf { I } + \mathbf { A } \right) \left( \mathbf { I } + \mathbf { D } \right) ^ { - 1 / 2 }$ shrinks the spectral and thus reliefs the problem. However, $g ( \lambda )$ may still take negative value as the maximum eigenvalue of $\tilde { \mathbf { L } } = \mathbf { I } - \tilde { \mathbf { P } }$ is still larger than 1.
|
| 160 |
+
|
| 161 |
+
# 3.3 Non-negative polynomials and Bernstein basis
|
| 162 |
+
|
| 163 |
+
Constraint 3.1 motivates us to design polynomial filters g(λ) = PKk=0 wkλk such that 0 ≤ g(λ) ≤ 1 when . The part is trivial, as we can always rescale each by a factor of $\scriptstyle \sum _ { k = 0 } ^ { K } | w _ { k } | 2 ^ { k }$ . The $g ( \lambda ) \geq 0$ part, however, requires more elaboration. Note that we can not simply set $w _ { k } \geq 0$ for each $k = 0 \ldots , K$ , since it is shown in [5] that such polynomials only correspond to low-pass filters.
|
| 164 |
+
|
| 165 |
+
As it turns out, the Bernstein basis has the following nice property: a polynomial that is non-negative on a certain interval can always be expressed as a non-negative linear combination of Bernstein basis. Specifically, we have the following lemma.
|
| 166 |
+
|
| 167 |
+
Lemma 3.1 ([23]). Assume a polynomial $\textstyle p ( x ) = \sum _ { k = 0 } ^ { K } \theta _ { k } x ^ { k }$ satisfies $p ( x ) \geq 0$ for $x \in [ 0 , 1 ]$ . Then there exists a sequence of non-negative coefficients $\theta _ { k }$ , ${ \bf \ddot { \boldsymbol { k } } } = 0 , \dots , K$ , such that
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
p ( x ) = \sum _ { k = 0 } ^ { K } \theta _ { k } b _ { k } ^ { K } ( x ) = \sum _ { k = 0 } ^ { K } \theta _ { k } \binom { K } { k } ( 1 - x ) ^ { K - k } x ^ { k }
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Lemma 3.1 suggests that to approximate a valid filter, the polynomial filter $g ( \lambda )$ has to be a nonnegative linear combination of Bernstein basis. Specifically, by setting $x = \lambda / 2$ , the filter $g ( \lambda )$ that satisfies $g ( \lambda ) \geq 0$ for $\lambda \in [ 0 , 2 ]$ can be expressed as
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
g ( \lambda ) : = p \left( \frac { \lambda } { 2 } \right) = \sum _ { k = 0 } ^ { K } \theta _ { k } \frac { 1 } { 2 ^ { K } } \binom { K } { k } ( 2 - \lambda ) ^ { K - k } \lambda ^ { k } .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Consequently, any valid polynomial filter that approximate the optimal solution of (4) with positive semidefinite energy function $\gamma ( \mathbf { L } )$ has to take the following form: $\begin{array} { r } { \mathbf { z } = \sum _ { k = 0 } ^ { K } \theta _ { k } \frac { 1 } { 2 ^ { K } } \binom { \bar { K } } { k } ( 2 \mathbf { I } - } \end{array}$ $\mathbf { L } ) ^ { K - k } \mathbf { L } ^ { k } \mathbf { x }$ . This observation motivates our BernNet from the perspective of graph optimization — any valid polynomial filers, i.e., the $g : [ 0 , 2 ] \mapsto [ 0 , 1 ]$ , can always be expressed by BernNet, and accordingly, the filters learned by our BernNet are always valid.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 3: A input image and the filtering results.
|
| 183 |
+
|
| 184 |
+
Table 2: Average sum of squared error and $R ^ { 2 }$ score in parentheses.
|
| 185 |
+
|
| 186 |
+
<table><tr><td></td><td>Low-pass</td><td>High-pass</td><td>Band-pass</td><td>Band-rejection</td><td>Comb</td></tr><tr><td></td><td>exp(-10x2)</td><td>1-exp(-10x²)</td><td>exp(-10(λ -1)2)</td><td>1 -exp(-10(λ-1)²)</td><td>|sin(πλ)l</td></tr><tr><td>GCN</td><td>3.4799(.9872)</td><td>67.6635(.2364)</td><td>25.8755(.1148)</td><td>21.0747(.9438)</td><td>50.5120(.2977)</td></tr><tr><td>GAT</td><td>2.3574(.9905)</td><td>21.9618(.7529)</td><td>14.4326(.4823)</td><td>12.6384(.9652)</td><td>23.1813(.6957)</td></tr><tr><td>GPR-GNN</td><td>0.4169(.9984)</td><td>0.0943(.9986)</td><td>3.5121(.8551)</td><td>3.7917(.9905)</td><td>4.6549(.9311)</td></tr><tr><td>ARMA</td><td>1.8478(.9932)</td><td>1.8632(.9793)</td><td>7.6922(.7098)</td><td>8.2732(.9782)</td><td>15.1214(.7975)</td></tr><tr><td>ChebNet</td><td>0.8220(.9973)</td><td>0.7867(.9903)</td><td>2.2722(.9104)</td><td>2.5296(.9934)</td><td>4.0735(.9447)</td></tr><tr><td>BernNet</td><td>0.0314(.9999)</td><td>0.0113(.9999)</td><td>0.0411(.9984)</td><td>0.9313(.9973)</td><td>0.9982(.9868)</td></tr></table>
|
| 187 |
+
|
| 188 |
+
# 4 Related Work
|
| 189 |
+
|
| 190 |
+
Graph neural networks (GNNs) can be broadly divided into spectral-based GNNs and spatial-based GNNs [33].
|
| 191 |
+
|
| 192 |
+
Spectral-based GNNs design spectral graph filters in the spectral domain. ChebNet [7] uses Chebyshev polynomial to approximate a filter. GCN [13] simplifies the Chebyshev filter with the first-order approximation. GraphHeat [34] uses heat kernel to design a graph filter. APPNP [14] utilizes Personalized PageRank (PPR) to set the filter weights. GPR-GNN [5] learns the polynomial filters via gradient descent on the polynomial coefficients. ARMA [2] learns a rational filter via the family of Auto-Regressive Moving Average filters [21]. AdaGNN [9] learns simple filters across multiple layers with a single parameter for each feature channel at each layer. As aforementioned, these methods mainly focus on designing low- or high-pass filters or learning filters without any constraints, which may lead to misspecified even ill-posed filters.
|
| 193 |
+
|
| 194 |
+
On the other hand, spatial-based GNNs directly propagate and aggregate graph information in the spatial domain. From this perspective, GCN [13] can be explained as the aggregation of the one-hop neighbor information on the graph. GAT [30] uses the attention mechanism to learn aggregation weights. Recently, Balcilar et al. [1] bridge the gap between spectral-based and spatial-based GNNs and unify GNNs in the same framework. Their work shows that the GNNs can be interpreted as sophisticated data-driven filters. This motivates the design of the proposed BernNet, which can learn arbitrary non-negative spectral filters from real-world graph signals.
|
| 195 |
+
|
| 196 |
+
# 5 Experiments
|
| 197 |
+
|
| 198 |
+
In this section, we conduct experiments to evaluate BernNet’s capability to learn arbitrary filters as well as the performance of BernNet on real datasets. All the experiments are conducted on a machine with an NVIDIA TITAN V GPU (12GB memory), Intel Xeon CPU $( 2 . 2 0 \mathrm { G H z } )$ , and 512GB of RAM.
|
| 199 |
+
|
| 200 |
+
# 5.1 Learning filters from the signal
|
| 201 |
+
|
| 202 |
+
We conduct an empirical analysis on 50 real images with the resolution of $1 0 0 \times 1 0 0$ from the Image Processing Toolbox in Matlab. We conduct independent experiments on these 50 images and report the average of the evaluation index. Following the experimental setting in [1], we regard each image as a 2D regular 4-neighborhood grid graph. The graph structure translates to an 1 $) , 0 0 0 \times 1 0 , 0 0 0$ adjacency matrix while the pixel intensity translates to a 10, 000-dimensional signal vector.
|
| 203 |
+
|
| 204 |
+
Table 3: Dataset statistics.
|
| 205 |
+
|
| 206 |
+
<table><tr><td></td><td>Cora</td><td>CiteSeer</td><td>PubMed</td><td>Computers</td><td>Photo</td><td>Chameleon</td><td>Squirrel</td><td>Actor</td><td>Texas</td><td>Cornell</td></tr><tr><td>Nodes</td><td>2708</td><td>3327</td><td>19717</td><td>13752</td><td>7650</td><td>2277</td><td>5201</td><td>7600</td><td>183</td><td>183</td></tr><tr><td>Edges</td><td>5278</td><td>4552</td><td>44324</td><td>245861</td><td>119081</td><td>31371</td><td>198353</td><td>26659</td><td>279</td><td>277</td></tr><tr><td>Features</td><td>1433</td><td>3703</td><td>500</td><td>767</td><td>745</td><td>2325</td><td>2089</td><td>932</td><td>1703</td><td>1703</td></tr><tr><td>Classes</td><td>7</td><td>6</td><td>5</td><td>10</td><td>8</td><td>5</td><td>5</td><td>5</td><td>5</td><td>5</td></tr></table>
|
| 207 |
+
|
| 208 |
+
For each of the 50 images, we apply 5 different filters (low-pass, high-pass, band-pass, band-rejection and comb) to the spectral domain of its signal. The formula of each filter is shown in Table 2. Recall that applying a low-pass filter $\exp ( - 1 0 \lambda ^ { 2 } )$ to the spectral domain $\mathbf { L } = \mathbf { U } d i a g \left[ \lambda _ { 1 } , \ldots , \lambda _ { n } \right] \mathbf { U } ^ { \top }$ means applying Udiag $\left[ \exp ( - 1 0 \lambda _ { 1 } ^ { 2 } ) , \dots , \exp ( - 1 0 \lambda _ { n } ^ { 2 } ) \right] \mathbf { U } ^ { \top }$ to the graph signal. Figure 3 shows the one of the input image and the corresponding filtering results.
|
| 209 |
+
|
| 210 |
+
In this task, we use the original graph signal as the input and the filtering signal to supervise the training process. The goal is to minimize the square error between output and the filtering signal by learning the correct filter. We evaluate BernNet against five popular GNN models: GCN [13], GAT [30], GPR-GNN [5], ARMA [2] and ChebNet [7]. To ensure fairness, we use two convolutional units and a linear output layer for all models. We train all models with approximately $2 \mathrm { k }$ trainable parameters and tune the hidden units to ensure they have similar parameters. Following [1], we discard any regularization or dropout and simply force the GNN to learn the input-output relation. For all models, we set the maximum number of epochs to 2000 and stop the training if the loss does not drop for 100 consecutive times and use Adam optimization with a 0.01 learning rate without decay. Models do not use the position information of the picture pixels. We use a mask to cover the edge nodes of the picture, so the problem can be regarded as a simple regression problem. For BernNet, we use a two-layer model, with each layer sharing the same set of $\theta _ { k }$ for $k = 0 , \ldots , K$ and set $K = 1 0$ . For GPR-GNN, we use the officially released code (see the supplementary materials for URL and commit numbers) and set the order of polynomial filter $K = 1 0$ . Other baseline models are based on Pytorch Geometric implementation [11]. The more detailed experiments setting can be found in the Appendix.
|
| 211 |
+
|
| 212 |
+
Table 2 shows the average of the sum of squared error (lower the better) and the $R ^ { 2 }$ scores (higher the better). We first observe that GCN and GAT can only handle low-pass filters, which concurs with the theoretical analysis in [1]. GPR-GNN, ARMA and ChebNet can learn different filters from the signals. However, BernNet consistently outperformed these models by a large margin on all tasks in terms of both metrics. We attribute this quality to BernNet’s ability to tune the coefficients $\theta _ { k }$ ’s, which directly correspond to the uniformly sampled filter values.
|
| 213 |
+
|
| 214 |
+
# 5.2 Node classification on real-world datasets
|
| 215 |
+
|
| 216 |
+
We now evaluate the performance of BernNet against the competitors on real-world datasets. Following [5], we include three citation graph Cora, CiteSeer and PubMed [27, 37], and the Amazon co-purchase graph Computers and Photo [20]. As shown in [5] these 5 datasets are homophilic graphs on which the connected nodes tend to share the same label. We also include the Wikipedia graph Chameleon and Squirrel [26], the Actor co-occurrence graph, and webpage graphs Texas and Cornell from WebKB‡ [22]. These 5 datasets are heterophilic datasets on which connected nodes tend to have different labels. We summarize the statistics of these datasets in Table 3.
|
| 217 |
+
|
| 218 |
+
Following [5], we perform full-supervised node classification task with each model, where we randomly split the node set into train/validation/test set with ratio $6 0 \% / 2 0 \% / 2 0 \%$ . For fairness, we generate 10 random splits by random seeds and evaluate all models on the same splits, and report the average metric for each model.
|
| 219 |
+
|
| 220 |
+
We compare BernNet with 6 baseline models: MLP, GCN [13], GAT [30], APPNP [14], ChebNet [7], and GPR-GNN [5]. For GPR-GNN, we use the officially released code (see the supplementary materials for URL and commit numbers) and set the order of polynomial filter $K = 1 0$ . For other models, we use the corresponding Pytorch Geometric library implementations [11]. For BernNet, we
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure 4: Filters learnt from real-world datasets by BernNet.
|
| 224 |
+
|
| 225 |
+
Table 4: Results on real world benchmark datasets: Mean accuracy $( \% ) \pm 9 5 \%$ confidence interval.
|
| 226 |
+
|
| 227 |
+
<table><tr><td></td><td>GCN</td><td>GAT</td><td>APPNP</td><td>MLP</td><td>ChebNet</td><td>GPR-GNN</td><td>BernNet</td></tr><tr><td>Cora</td><td>87.14±1.01</td><td>88.03±0.79</td><td>88.14±0.73</td><td>76.96±0.95</td><td>86.67±0.82</td><td>88.57±0.69</td><td>88.52±0.95</td></tr><tr><td>CiteSeer</td><td>79.86±0.67</td><td>80.52±0.71</td><td>80.47±0.74</td><td>76.58±0.88</td><td>79.11±0.75</td><td>80.12±0.83</td><td>80.09±0.79</td></tr><tr><td>PubMed</td><td>86.74±0.27</td><td>87.04±0.24</td><td>88.12±0.31</td><td>85.94±0.22</td><td>87.95±0.28</td><td>88.46±0.33</td><td>88.48±0.41</td></tr><tr><td>Computers</td><td>83.32±0.33</td><td>83.32±0.39</td><td>85.32±0.37</td><td>82.85±0.38</td><td>87.54±0.43</td><td>86.85±0.25</td><td>87.64±0.44</td></tr><tr><td>Photo</td><td>88.26±0.73</td><td>90.94±0.68</td><td>88.51±0.31</td><td>84.72±0.34</td><td>93.77±0.32</td><td>93.85±0.28</td><td>93.63±0.35</td></tr><tr><td>Chameleon</td><td>59.61±2.21</td><td>63.13±1.93</td><td>51.84±1.82</td><td>46.85±1.51</td><td>59.28±1.25</td><td>67.28±1.09</td><td>68.29±1.58</td></tr><tr><td>Actor</td><td>33.23±1.16</td><td>33.93±2.47</td><td>39.66±0.55</td><td>40.19±0.56</td><td>37.61±0.89</td><td>39.92±0.67</td><td>41.79±101</td></tr><tr><td>Squirrel</td><td>46.78±0.87</td><td>44.49±0.88</td><td>34.71±0.57</td><td>31.03±1.18</td><td>40.55±0.42</td><td>50.15±1.92</td><td>51.35±0.73</td></tr><tr><td>Texas</td><td>77.38±3.28</td><td>80.82±2.13</td><td>90.98±1.64</td><td>91.45±1.14</td><td>86.22±2.45</td><td>92.95±1.31</td><td>93.12±0.65</td></tr><tr><td>Cornell</td><td>65.90±4.43</td><td>78.21±2.95</td><td>91.81±1.96</td><td>90.82±1.63</td><td>83.93±2.13</td><td>91.37±1.81</td><td>92.13±1.64</td></tr></table>
|
| 228 |
+
|
| 229 |
+
use the following propagation process:
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
\mathbf { Z } = \sum _ { k = 0 } ^ { K } \theta _ { k } \frac { 1 } { 2 ^ { K } } \binom { K } { k } ( 2 \mathbf { I } - \mathbf { L } ) ^ { K - k } \mathbf { L } ^ { k } f \left( \mathbf { X } \right) ,
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
where $f ( \mathbf { X } )$ is a 2-layer MLP with 64 hidden units on the feature matrix $\mathbf { X }$ . Note that this propagation process is almost identical to that of APPNP or GPR-GNN. The only difference is that we substitute the Generalized PageRank polynomial with Bernstein polynomial. We set the $K = 1 0$ and use different learning rate and dropout for the linear layer and the propagation layer. For all models, we optimal leaning rate over $\{ 0 . 0 \bar { 0 } 1 , 0 . 0 0 2 , 0 . 0 1 , 0 . 0 5 \}$ and weight decay $\{ 0 . 0 , \dot { 0 } . 0 0 0 5 \}$ . More detailed experimental settings are discussed in Appendix.
|
| 236 |
+
|
| 237 |
+
We use the micro-F1 score with a $9 5 \%$ confidence interval as the evaluation metric. The relevant results are summarized in Table 4. Boldface letters indicate the best result for the given confidence interval. We observe that BernNet provides the best results on seven out of the ten datasets. On the other three datasets, BernNet also achieves competitive results against SOTA methods.
|
| 238 |
+
|
| 239 |
+
More interestingly, this experiment also shows BernNet can learn complex filters from real-world datasets with only the supervision of node labels. Figure 4 plots some of the filters BernNet learnt in the training process. On Actor, BernNet learns an all-pass-alike filter, which concurs with the fact that MLP outperforms all other baselines on this dataset. On Chameleon and Squirrel, BernNet learns two comb-alike filters. Given that BernNet outperforms all competitors by at least $1 \%$ on these two datasets, it may suggest that comb-alike filters are necessary for Chameleon and Squirrel. Figure 5 shows the Coefficients $\theta _ { k }$ learnt from real-world datasets by BernNet. When comparing Figures 4 and 5, we observe that the curves of filters and curves of coefficients are almost the same. This is because BernNet’s coefficients are highly correlated with the spectral property of the target filter, which indicates BernNet Bernnet has strong interpretability.
|
| 240 |
+
|
| 241 |
+
Finally, we present the train time for each method in Table 5. BernNet is slower than other methods due to its quadratic dependence on the degree $K$ . However, compared to the SOTA method GPRGNN, the margin is generally less than 2, which is often acceptable in practice. In theory, both ChebNet [7] and GPR-GNN [5] are linear time complexity related to propagation step $K$ , but BernNet is quadratic time complexity related to $K$ . Delgado et al. [8] show that Bernstein approximation can be evaluated in linear time related to $K$ using the corner cutting algorithm. However, BernNet can not use this algorithm directly, because we need to multiply signal $\mathbf { x }$ . How to convert BernNet to linear complexity will be a problem worth studying in the future.
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
Figure 5: Coefficients $\theta _ { k }$ learnt from real-world datasets by BernNet.
|
| 245 |
+
|
| 246 |
+
Table 5: Average running time per epoch (ms)/average total running time (s).
|
| 247 |
+
|
| 248 |
+
<table><tr><td></td><td>GCN</td><td>GAT</td><td>APPNP</td><td>MLP</td><td>ChebNet</td><td>GPR-GNN</td><td>BernNet</td></tr><tr><td>Cora</td><td>4.59/1.62</td><td>9.56/2.03</td><td>7.16/2.32</td><td>3.06/0.93</td><td>6.25/1.76</td><td>9.94/2.21</td><td>19.71/5.47</td></tr><tr><td>CiteSeer</td><td>4.63/1.95</td><td>9.93/2.21</td><td>7.79/2.77</td><td>2.95/1.09</td><td>8.28/2.56</td><td>11.16/2.37</td><td>22.36/6.32</td></tr><tr><td>PubMed</td><td>5.12/1.87</td><td>16.16/3.41</td><td>8.21/2.63</td><td>2.91/1.61</td><td>18.04/3.03</td><td>10.45/2.81</td><td>22.02/8.19</td></tr><tr><td>Computers</td><td>5.72/2.52</td><td>30.91/7.85</td><td>9.19/3.48</td><td>3.47/1.31</td><td>20.64/9.64</td><td>16.05/4.38</td><td>28.83/8.69</td></tr><tr><td>Photo</td><td>5.08/2.63</td><td>19.97/5.41</td><td>8.69/4.18</td><td>3.67/1.66</td><td>13.25/7.02</td><td>13.96/3.94</td><td>24.69/7.37</td></tr><tr><td>Chameleon</td><td>4.93/0.99</td><td>13.11/2.66</td><td>7.93/1.62</td><td>3.14/0.63</td><td>10.92/2.25</td><td>10.93/2.41</td><td>22.54/4.75</td></tr><tr><td>Actor</td><td>5.43/1.09</td><td>11.94/2.45</td><td>8.46/1.71</td><td>3.82/0.77</td><td>7.99/1.62</td><td>11.57/2.35</td><td>23.34/5.81</td></tr><tr><td>Squirrel</td><td>5.61/1.13</td><td>22.76/4.91</td><td>8.01/1.61</td><td>3.41/0.69</td><td>38.12/7.78</td><td>9.87/5.56</td><td>25.58/9.23</td></tr><tr><td>Texas</td><td>4.58/0.92</td><td>9.65/1.96</td><td>7.83/1.63</td><td>3.19/0.65</td><td>6.51/1.34</td><td>10.45/2.16</td><td>23.35/4.81</td></tr><tr><td>Cornell</td><td>4.83/0.97</td><td>9.79/1.99</td><td>8.23/1.68</td><td>3.25/0.66</td><td>5.85/1.22</td><td>9.86/2.05</td><td>22.23/5.26</td></tr></table>
|
| 249 |
+
|
| 250 |
+
# 6 Conclusion
|
| 251 |
+
|
| 252 |
+
This paper proposes BernNet, a graph neural network that provides a simple and intuitive mechanism for designing and learning an arbitrary spectral filter via Bernstein polynomial approximation. Compared to previous methods, BernNet can approximate complex filters such as band-rejection and comb filters, and can provide better interpretability. Furthermore, the polynomial filters designed and learned by BernNet are always valid. Experiments show that BernNet outperforms SOTA methods in terms of effectiveness on both synthetic and real-world datasets. For future work, an interesting direction is to improve the efficiency of BernNet.
|
| 253 |
+
|
| 254 |
+
# Broader Impact
|
| 255 |
+
|
| 256 |
+
The proposed BernNet algorithm addresses the challenge of designing and learning arbitrary spectral filters on graphs. We consider this algorithm a general technical and theoretical contribution, without any foreseeable specific impacts. For applications in bioinformatics, computer vision, and natural language processing, applying the BernNet algorithm may improve the performance of existing GNN models. We leave the exploration of other potential impacts to future work.
|
| 257 |
+
|
| 258 |
+
# Acknowledgments and Disclosure of Funding
|
| 259 |
+
|
| 260 |
+
Zhewei Wei was supported in part by National Natural Science Foundation of China (No. 61972401, No. 61932001 and No. 61832017), by Beijing Outstanding Young Scientist Program NO. BJJWZYJH012019100020098, by Alibaba Group through Alibaba Innovative Research Program, and by CCF-Baidu Open the Fund (NO.2021PP15002000). Zengfeng Huang was supported by National Natural Science Foundation of China Grant No. 61802069, and by Shanghai Science and Technology Commission Grant No. 17JC1420200. Hongteng Xu was supported by Tencent AI Lab Rhino-Bird Joint Research Program. This work is supported by China Unicom Innovation Ecological Cooperation Plan and by Intelligent Social Governance Platform, Major Innovation $\&$ Planning Interdisciplinary Platform for the “Double-First Class” Initiative, Renmin University of China. We also wish to acknowledge the support provided and contribution made by Public Policy and Decision-making Research Lab of Renmin University of China.
|
| 261 |
+
|
| 262 |
+
References
|
| 263 |
+
[1] Muhammet Balcilar, 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 ICLR, 2021.
|
| 264 |
+
[2] Filippo Maria Bianchi, Daniele Grattarola, Lorenzo Livi, and Cesare Alippi. Graph neural networks with convolutional arma filters. TPAMI, 2021.
|
| 265 |
+
[3] Toon Bogaerts, Antonio D Masegosa, Juan S Angarita-Zapata, Enrique Onieva, and Peter Hellinckx. A graph cnn-lstm neural network for short and long-term traffic forecasting based on trajectory data. Transportation Research Part C: Emerging Technologies, 2020.
|
| 266 |
+
[4] Zhao-Min Chen, Xiu-Shen Wei, Peng Wang, and Yanwen Guo. Multi-label image recognition with graph convolutional networks. In CVPR, 2019.
|
| 267 |
+
[5] Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. In ICLR, 2021.
|
| 268 |
+
[6] Zhiyong Cui, Kristian Henrickson, Ruimin Ke, and Yinhai Wang. Traffic graph convolutional recurrent neural network: A deep learning framework for network-scale traffic learning and forecasting. T-ITS, 21(11):4883–4894, 2019.
|
| 269 |
+
[7] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, pages 3844–3852, 2016.
|
| 270 |
+
[8] Jorge Delgado and Juan Manuel Pena. A linear complexity algorithm for the bernstein basis. In GMP, pages 162–167, 2003.
|
| 271 |
+
[9] Yushun Dong, Kaize Ding, Brian Jalaian, Shuiwang Ji, and Jundong Li. Graph neural networks with adaptive frequency response filter. In CIKM, 2021.
|
| 272 |
+
[10] Rida T Farouki. The bernstein polynomial basis: A centennial retrospective. Computer Aided Geometric Design, 29(6):379–419, 2012.
|
| 273 |
+
[11] Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. In ICLR, 2019.
|
| 274 |
+
[12] Dejun Jiang, Zhenxing Wu, Chang-Yu Hsieh, Guangyong Chen, Ben Liao, Zhe Wang, Chao Shen, Dongsheng Cao, Jian Wu, and Tingjun Hou. Could graph neural networks learn better molecular representation for drug discovery? a comparison study of descriptor-based and graph-based models. Journal of cheminformatics, 13(1):1–23, 2021.
|
| 275 |
+
[13] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 276 |
+
[14] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In ICLR, 2019.
|
| 277 |
+
[15] Johannes Klicpera, Stefan Weißenberger, and Stephan Günnemann. Diffusion improves graph learning. In NeurIPS, 2019.
|
| 278 |
+
[16] Ron Levie, Federico Monti, Xavier Bresson, and Michael M Bronstein. Cayleynets: Graph convolutional neural networks with complex rational spectral filters. Transactions on Signal Processing, 67(1):97–109, 2018.
|
| 279 |
+
[17] Chang Li and Dan Goldwasser. Encoding social information with graph convolutional networks forpolitical perspective detection in news media. In ACL, 2019.
|
| 280 |
+
[18] Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. In ICLR, 2018.
|
| 281 |
+
[19] Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In KDD, 2020.
|
| 282 |
+
[20] Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton Van Den Hengel. Image-based recommendations on styles and substitutes. In SIGIR, 2015.
|
| 283 |
+
[21] Sunil K Narang, Akshay Gadde, and Antonio Ortega. Signal processing techniques for interpolation in graph structured data. In ICASSP. IEEE, 2013.
|
| 284 |
+
[22] Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. In ICLR, 2020.
|
| 285 |
+
[23] Victoria Powers and Bruce Reznick. Polynomials that are positive on an interval. Transactions of the American Mathematical Society, 352(10):4677–4692, 2000.
|
| 286 |
+
[24] Jiezhong Qiu, Jian Tang, Hao Ma, Yuxiao Dong, Kuansan Wang, and Jie Tang. Deepinf: Social influence prediction with deep learning. In KDD, 2018.
|
| 287 |
+
[25] Prakash Chandra Rathi, R Frederick Ludlow, and Marcel L Verdonk. Practical high-quality electrostatic potential surfaces for drug discovery using a graph-convolutional deep neural network. Journal of medicinal chemistry, 63(16):8778–8790, 2019.
|
| 288 |
+
[26] Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. Journal of Complex Networks, 9(2):cnab014, 2021.
|
| 289 |
+
[27] 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.
|
| 290 |
+
[28] Daniel Spielman. Spectral and algebraic graph theory. Yale lecture notes, draft of December, 4, 2019.
|
| 291 |
+
[29] Peihao Tong, Qifan Zhang, and Junjie Yao. Leveraging domain context for question answering over knowledge graph. Data Science and Engineering, 4(4):323–335, 2019.
|
| 292 |
+
[30] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. In ICLR, 2018.
|
| 293 |
+
[31] Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In ICML, 2019.
|
| 294 |
+
[32] Shu Wu, Yuyuan Tang, Yanqiao Zhu, Liang Wang, Xing Xie, and Tieniu Tan. Session-based recommendation with graph neural networks. In AAAI, 2019.
|
| 295 |
+
[33] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 2020.
|
| 296 |
+
[34] Bingbing Xu, Huawei Shen, Qi Cao, Keting Cen, and Xueqi Cheng. Graph convolutional networks using heat kernel for semi-supervised learning. In IJCAI, 2019.
|
| 297 |
+
[35] Bingbing Xu, Huawei Shen, Qi Cao, Yunqi Qiu, and Xueqi Cheng. Graph wavelet neural network. In ICLR, 2018.
|
| 298 |
+
[36] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In ICML, 2018.
|
| 299 |
+
[37] Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. In ICML, pages 40–48. PMLR, 2016.
|
| 300 |
+
[38] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In KDD, 2018.
|
| 301 |
+
[39] Long Zhao, Xi Peng, Yu Tian, Mubbasir Kapadia, and Dimitris N Metaxas. Semantic graph convolutional networks for 3d human pose regression. In CVPR, 2019.
|
| 302 |
+
[40] Dengyong Zhou, Olivier Bousquet, Thomas Lal, Jason Weston, and Bernhard Schölkopf. Learning with local and global consistency. In NeurIPS, 2004.
|
| 303 |
+
[41] Meiqi Zhu, Xiao Wang, Chuan Shi, Houye Ji, and Peng Cui. Interpreting and unifying graph neural networks with an optimization framework. In WWW, 2021.
|
md/train/de11dbHzAMF/de11dbHzAMF.md
ADDED
|
@@ -0,0 +1,490 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONDITIONALLY ADAPTIVE MULTI-TASK LEARNING: IMPROVING TRANSFER LEARNING IN NLP USING FEWER PARAMETERS & LESS DATA
|
| 2 |
+
|
| 3 |
+
Jonathan Pilault1∗, Amine El hattami1∗, Christopher Pal1,2,3 1Polytechnique Montreal & Mila, 2Element AI, 3Canada CIFAR AI Chair {jonathan.pilault,amine.elhattami,christopher.pal}@polymtl.ca
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Multi-Task Learning (MTL) networks have emerged as a promising method for transferring learned knowledge across different tasks. However, MTL must deal with challenges such as: overfitting to low resource tasks, catastrophic forgetting, and negative task transfer, or learning interference. Often, in Natural Language Processing (NLP), a separate model per task is needed to obtain the best performance. However, many fine-tuning approaches are both parameter inefficient, i.e., potentially involving one new model per task, and highly susceptible to losing knowledge acquired during pretraining. We propose a novel Transformer based Adapter consisting of a new conditional attention mechanism as well as a set of task-conditioned modules that facilitate weight sharing. Through this construction, we achieve more efficient parameter sharing and mitigate forgetting by keeping half of the weights of a pretrained model fixed. We also use a new multi-task data sampling strategy to mitigate the negative effects of data imbalance across tasks. Using this approach, we are able to surpass single task fine-tuning methods while being parameter and data efficient (using around $66 \%$ of the data for weight updates). Compared to other BERT Large methods on GLUE, our 8-task model surpasses other Adapter methods by $2 . 8 \%$ and our 24-task model outperforms by $0 . 7 \mathrm { - } 1 . 0 \%$ models that use MTL and single task fine-tuning. We show that a larger variant of our single multi-task model approach performs competitively across $2 6 \mathrm { N L P }$ tasks and yields state-of-the-art results on a number of test and development sets. Our code is publicly available at https://github.com/CAMTL/CA-MTL.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The introduction of deep, contextualized Masked Language Models $( \mathbf { M L M } ) ^ { 1 }$ trained on massive amounts of unlabeled data has led to significant advances across many different Natural Language Processing (NLP) tasks (Peters et al., 2018; Liu et al., 2019a). Much of these recent advances can be attributed to the now well-known BERT approach (Devlin et al., 2018). Substantial improvements over previous state-of-the-art results on the GLUE benchmark (Wang et al., 2018) have been obtained by multiple groups using BERT models with task specific fine-tuning. The “BERT-variant $^ +$ fine-tuning” formula has continued to improve over time with newer work constantly pushing the state-of-the-art forward on the GLUE benchmark. The use of a single neural architecture for multiple NLP tasks has shown promise long before the current wave of BERT inspired methods (Collobert & Weston, 2008) and recent work has argued that autoregressive language models (ARLMs) trained on large-scale datasets – such as the GPT family of models (Radford et al., 2018), are in practice multi-task learners (Brown et al., 2020). However, even with MLMs and ARLMs trained for multi-tasking, single task fine-tuning is usually also employed to achieve state-of-the-art performance on specific tasks of interest. Typically this fine-tuning process may entail: creating a task-specific fine-tuned model (Devlin et al., 2018), training specialized model components for task-specific predictions (Houlsby et al., 2019) or fine-tuning a single multi-task architecture (Liu et al., 2019b).
|
| 12 |
+
|
| 13 |
+
Single-task fine-tuning overall pretrained model parameters may have other issues. Recent analyses of such MLM have shed light on the linguistic knowledge that is captured in the hidden states and attention maps (Clark et al., 2019b; Tenney et al., 2019a; Merchant et al., 2020). Particularly, BERT has middle Transformer (Vaswani et al., 2017) layers that are typically the most transferable to a downstream task (Liu et al., 2019a). The model proxies the steps of the traditional NLP pipeline in a localizable way (Tenney et al., 2019a) — with basic syntactic information appearing earlier in the network, while high-level semantic information appearing in higher-level layers. Since pretraining is usually done on large-scale datasets, it may be useful, for a variety of downstream tasks, to conserve that knowledge. However, single task fine-tuning causes catastrophic forgetting of the knowledge learned during MLM (Howard & Ruder, 2018). To preserve knowledge, freezing part of a pretrained network and using Adapters for new tasks have shown promising results (Houlsby et al., 2019).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: CA-MTL base architecture with our uncertainty-based sampling algorithm. Each task has its own decoder. The input embedding layer and the lower Transformer layers are frozen. The upper Transformer layer and Conditional Alignment module are modulated with the task embedding.
|
| 17 |
+
|
| 18 |
+
Inspired by the human ability to transfer learned knowledge from one task to another new task, Multi-Task Learning (MTL) in a general sense (Caruana, 1997; Rajpurkar et al., 2016b; Ruder, 2017) has been applied in many fields outside of NLP. Caruana (1993) showed that a model trained in a multi-task manner can take advantage of the inductive transfer between tasks, achieving a better generalization performance. MTL has the advantage of computational/storage efficiency (Zhang & Yang, 2017), but training models in a multi-task setting is a balancing act; particularly with datasets that have different: (a) dataset sizes, (b) task difficulty levels, and (c) different types of loss functions. In practice, learning multiple tasks at once is challenging since negative transfer (Wang et al., 2019a), task interference (Wu et al., 2020; Yu et al., 2020) and catastrophic forgetting (Serrà et al., 2018) can lead to worse data efficiency, training stability and generalization compared to single task fine-tuning.
|
| 19 |
+
|
| 20 |
+
Using Conditionally Adaptive Learning, we seek to improve pretraining knowledge retention and multi-task inductive knowledge transfer. Our contributions are the following:
|
| 21 |
+
|
| 22 |
+
• A new task conditioned Transformer that adapts and modulates pretrained weights (Section 2.1). • A novel way to prioritize tasks with an uncertainty based multi-task data sampling method that helps balance the sampling of tasks to avoid catastrophic forgetting (Section 2.2).
|
| 23 |
+
|
| 24 |
+
Our Conditionally Adaptive Multi-Task Learning (CA-MTL) approach is illustrated in Figure 1. To the best of our knowledge, our work is the first to explore the use of a latent representation of tasks to modularize and adapt pretrained architectures. Further, we believe our work is also the first to examine uncertainty sampling for large-scale multi-task learning in NLP. We show the efficacy of CA-MTL by: (a) testing on 26 different tasks and $\mathbf { ( b ) }$ presenting state-of-the-art results on a number of test sets as well as superior performance against both single-task and MTL baselines. Moreover, we further demonstrate that our method has advantages over (c) other adapter networks, and (d) other MTL sampling methods. Finally, we provide ablations and separate analysis of the MT-Uncertainty Sampling technique in section 4.1 and of each component of the adapter in 4.2.
|
| 25 |
+
|
| 26 |
+
# 2 METHODOLOGY
|
| 27 |
+
|
| 28 |
+
This section is organized according to the two main MTL problems that we will tackle: (1) How to modularize a pretrained network with latent task representations? (2) How to balance different tasks in MTL? We define each task as: $\mathbb { T } _ { i } \triangleq \{ p _ { i } ( \mathbf { y } _ { i } | \mathbf { x } _ { i } , \mathbf { z } _ { i } ) , \mathcal { L } _ { i } , \tilde { p } _ { i } ( \mathbf { x } _ { i } ) \}$ , where $\mathbf { z } _ { i }$ is task $i$ ’s learnable shallow embedding, $\mathcal { L } _ { i }$ is the task loss, and $\tilde { p } _ { i } ( \mathbf { x } _ { i } )$ is the empirical distribution of the training data pair $\left\{ \mathbf { x } _ { i } , \mathbf { y } _ { i } \right\}$ , for $i \in \{ 1 , \ldots , T \}$ and $T$ the number of supervised tasks. The MTL objective is:
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\operatorname* { m i n } _ { \phi ( \mathbf { z } ) , \theta _ { 1 } , \dots , \theta _ { T } } \sum _ { i = 1 } ^ { T } \mathcal { L } _ { i } \big ( f _ { \phi ( \mathbf { z } _ { i } ) , \theta _ { i } } \big ( \mathbf { x } _ { i } \big ) , \mathbf { y } _ { i } \big )
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $f$ is the predictor function (includes encoder model and decoder heads), $\phi ( \mathbf { z } )$ are learnable generated weights conditioned on $\mathbf { z }$ , and $\theta _ { i }$ are task-specific parameters for the output decoder heads. $\mathbf { z }$ is constructed using an embedding lookup table.
|
| 35 |
+
|
| 36 |
+
# 2.1 TASK CONDITIONED TRANSFORMER
|
| 37 |
+
|
| 38 |
+
Our task conditioned Transformer architecture is based on one simple concept. We either add conditional layers or modulate existing pretrained weights using a task representation by extending Feature Wise Linear Modulation (Perez et al., 2018) functions in several ways depending on the Transformer layer. We define our framework below.
|
| 39 |
+
|
| 40 |
+
Definition 1 (Conditional Weight Transformations). Given a neural network weight matrix $W$ , we compute transformations of the form $\phi ( \mathbf { W } | z _ { i } ) = \gamma _ { i } ( z _ { i } ) \mathbf { W } + \beta _ { i } ( z _ { i } )$ , where $\gamma _ { i }$ and $\beta _ { i }$ are learned functions that transform the weights based on a learned vector embedding $z _ { i }$ , for task $i$ .
|
| 41 |
+
|
| 42 |
+
Definition 2 (Conditionally Adaptive Learning). In our setting, Conditionally Adaptive Learning is the process of learning a set of φs for the conditionally adaptive modules presented below along with a set of task embedding vectors $z _ { i }$ for $T$ tasks, using a multi-task loss (see equation 1).
|
| 43 |
+
|
| 44 |
+
In the subsections that follow: We introduce a new Transformer Attention Module using blockdiagonal Conditional Attention that allows the original query-key based attention to account for task-specific biases (section 2.1.1). We propose a new Conditional Alignment method that aligns the data of diverse tasks and that performs better than its unconditioned and higher capacity predecessor (section 2.1.2). We adapt layer normalization statistics to specific tasks using a new Conditional Layer Normalization module (section 2.1.3). We add a Conditional Bottleneck that facilitates weight sharing and task-specific information flow from lower layers (section 2.1.4). In our experiments we provide an ablation study of these components (Table 1) examining performance in terms of GLUE scores.
|
| 45 |
+
|
| 46 |
+
# 2.1.1 CONDITIONAL ATTENTION
|
| 47 |
+
|
| 48 |
+
Given $d$ , the input dimensions, the query Q, the key $\mathbf { K }$ , and the value $\mathbf { V }$ as defined in Vaswani et al. (2017), we redefine the attention operation:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { l } { { \displaystyle \mathrm { A t t e n t i o n } ( { \bf Q } , { \bf K } , { \bf V } , { \bf z } _ { i } ) ) = \mathrm { s o f t m a x } \left[ { \cal M } ( { \bf z } _ { i } ) + \frac { { \bf Q } { \bf K } ^ { T } } { \sqrt { d } } \right] { \bf V } } } \\ { { \displaystyle ~ { \cal M } ( { \bf z } _ { i } ) = \bigoplus _ { n = 1 } ^ { N } A _ { n } ^ { \prime } ( { \bf z } _ { i } ) , ~ A _ { n } ^ { \prime } ( { \bf z } _ { i } ) = A _ { n } \gamma _ { i } ( { \bf z } _ { i } ) + \beta _ { i } ( { \bf z } _ { i } ) } } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where is the direct sum operator (see section A.6), $N$ is the number of block matrices $A _ { n } \in \mathbb { R } ^ { ( L / N ) \times ( L / N ) }$ along the diagonal of the attention matrix, $L$ is the input sequence, $M ( \mathbf { z } _ { i } ) = \operatorname { d i a g } ( A _ { 1 } ^ { \prime } , \ldots , A _ { N } ^ { \prime } )$ is a block diagonal conditional matrix. Note that $A _ { n }$ is constructed using $L / N$ trainable and randomly initialized $L / N$ dimensional vectors. While the original attention matrix depends on the hidden states $h$ , ${ \cal M } ( { \bf z } _ { i } )$ is a learnable weight matrix that only depends on the task embedding $\mathbf { z } _ { i } \in \mathbb { R } ^ { d }$ . $\gamma _ { i } , \beta _ { i } : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { L ^ { 2 } / N ^ { 2 } }$ are Feature Wise Linear Modulation (Perez et al., 2018) functions. We also experimented with full-block Conditional Attention $\in \mathbb { R } ^ { L \times L }$ . Not only did it have $N ^ { 2 }$ more parameters compared to the block-diagonal variant, but it also performed significantly worse on the GLUE development set (see FBA variant in Table 10). It is possible that GLUE tasks derive a certain benefit from localized attention that is a consequence of ${ M } ( { \bf { z } } _ { i } )$ . With ${ \cal M } ( { \bf z } _ { i } )$ , each element in a sequence can only attend to other elements in its subsequence of length $L / N$ . In our experiments we used $N = d / L$ . The full Conditional Attention mechanism used in our experiments is illustrated in Figure 2.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Conditional Attention Module
|
| 58 |
+
|
| 59 |
+
# 2.1.2 CONDITIONAL ALIGNMENT
|
| 60 |
+
|
| 61 |
+
Wu et al. (2020) showed that in MTL having $T$ separate alignment modules $R _ { 1 } , \ldots , R _ { T }$ increases BERTLARGE avg. scores on five GLUE tasks (CoLA, MRPC, QNLI, RTE, SST-2) by $2 . 3 5 \%$ . Inspired by this work, we found that adding a task conditioned alignment layer between the input embedding layer and the first BERT Transformer layer improved multi-task model performance. However, instead of having $T$ separate alignment matrices $R _ { i }$ for each $T$ task, one alignment matrix $\hat { R }$ is generated as a function of the task embedding $z _ { i }$ . As in Wu et al. (2020), we tested this module on the same five GLUE tasks and with BERTLARGE. Enabling task conditioned weight sharing across covariance alignment modules allows us to outperforms $\mathbf { B E R T _ { L A R G E } }$ by $3 . 6 1 \%$ . This is $1 . 2 6 \%$ higher than having $T$ separate alignment matrices. Inserting $\hat { R }$ into BERT, yields the following encoder function $\hat { f }$ :
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\hat { f } = \sum _ { t = 1 } ^ { T } g _ { \theta _ { i } } ( E ( \mathbf { x } _ { i } ) \hat { R } ( \mathbf { z } _ { i } ) B ) , \qquad \hat { R } ( \mathbf { z } _ { i } ) = R \gamma _ { i } ( \mathbf { z } _ { i } ) + \beta _ { i } ( \mathbf { z } _ { i } )
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\mathbf { x } _ { i } \in \mathbb { R } ^ { d }$ is the layer input, $g _ { \boldsymbol { \theta } _ { i } }$ is the decoder head function for task $i$ with weights $\theta _ { i }$ , $E$ the frozen BERT embedding layer, $B$ the BERT Transformer layers and $R$ the linear weight matrix of a single task conditioned alignment matrix. $\gamma _ { i } , \beta _ { i } : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { \dot { d } }$ are Feature Wise Linear Modulation functions.
|
| 68 |
+
|
| 69 |
+
# 2.1.3 CONDITIONAL LAYER NORMALIZATION (CLN)
|
| 70 |
+
|
| 71 |
+
We extend the Conditional Batch Normalization idea from de Vries et al. (2017) to Layer Normalization (Ba et al., 2016). For task $\mathcal { T } _ { i }$ , $i \in \{ 1 , \ldots , T \}$ :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathbf { h } _ { i } = { \frac { 1 } { \sigma } } \odot ( \mathbf { a } _ { i } - { \boldsymbol { \mu } } ) * { \hat { \gamma } } _ { i } ( \mathbf { z } _ { i } ) + \beta _ { i } ( \mathbf { z } _ { i } ) , \qquad { \hat { \gamma } } _ { i } ( \mathbf { z } _ { i } ) = { \gamma } ^ { \prime } { \gamma } _ { i } ( \mathbf { z } _ { i } ) + { \beta } ^ { \prime }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\mathbf { h } _ { i }$ is the CLN output vector, ${ \bf { a } } _ { i }$ are the preceding layer activations associated with task $i$ , $\mu$ and $\sigma$ are the mean and the variance of the summed inputs within each layer as defined in Ba et al. (2016). Conditional Layer Normalization is initialized with BERT’s Layer Normalization affine transformation weights and bias $\gamma ^ { \prime }$ and $\beta ^ { \prime }$ from the original formulation: $\begin{array} { r } { \mathbf { h } = \frac { 1 } { \sigma } \odot ( \mathbf { a } - \boldsymbol { \mu } ) * \boldsymbol { \gamma } ^ { \prime } + \boldsymbol { \beta } ^ { \prime } } \end{array}$ . During training, the weight and bias functions of $\gamma _ { i } ( * )$ and $\beta _ { i } ( * )$ are always trained, while the original Layer Normalization weight may be kept fixed. This module was added to account for task specific rescaling of individual training cases. Layer Normalization normalizes the inputs across features. The conditioning introduced in equation 2.1.3 allows us to modulate the normalization’s output based on a task’s latent representation.
|
| 78 |
+
|
| 79 |
+
# 2.1.4 CONDITIONAL BOTTLENECK
|
| 80 |
+
|
| 81 |
+
We created a task conditioned two layer feed-forward bottleneck layer (CFF up/down in Figure 3). The conditional bottleneck layer follows the same transformation as in equation 2. The module in Figure 3a is added to the top most Transformer layers of CA-MTL and uses a CLN. For CA-MTLLARGE this module is the main building block of the skip connection added alongside all Transformer layers seen in Figure 3b. The connection at layer $j$ takes in the matrix sum of the Transformer layer output at $j$ and the previous connection’s output at $j - 1$ . The Conditional bottleneck allows lower layer information to flow upwards depending on the task. Our intuition for introducing this component is related to recent studies (Tenney et al., 2019a) that showed that the “most important layers for a given task appear at specific positions”. As with the other modules described so far, each task adaptation is created from the weights of a single shared adapter that is modulated by the task embedding.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 3: a) Conditional Bottleneck for CA-MTLBASE. b) Conditional Bottleneck for CA-MTLLARGE.
|
| 85 |
+
|
| 86 |
+
# 2.2 MULTI-TASK UNCERTAINTY SAMPLING
|
| 87 |
+
|
| 88 |
+
MT-Uncertainty Sampling is a task selection strategy that is inspired by Active Learning techniques. Our algorithm 1 is outlined in the Appendix, Section A.2. Similar to Active Learning, our algorithm first evaluates the model uncertainty. MT-Uncertainty Sampling uses Shannon Entropy, an uncertainty measure, to choose training examples by first doing forward pass through the model with $b \times T$ input samples. For an output classification prediction with $C _ { i }$ possible classes and probabilities $( p _ { i , 1 } , \ldots , p _ { i , C _ { i } } )$ , the Shannon Entropy $H _ { i }$ , for task $\mathbb { T } _ { i }$ and $i \in \{ 1 , \ldots , T \}$ , our uncertainty measure $\mathbb { U } ( \mathbf { x } )$ are given by:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
H _ { i } = H _ { i } { \big ( } f _ { \phi ( \mathbf { z } _ { i } ) , \theta _ { i } } ( \mathbf { x } ) { \big ) } = - \sum _ { c = 1 } ^ { C _ { i } } p _ { c } \log p _ { c } , \qquad \mathbb { U } ( x _ { i } ) = { \frac { H _ { i } { \big ( } f _ { \phi ( \mathbf { z } _ { i } ) , \theta _ { i } } ( \mathbf { x } ) { \big ) } } { \hat { H } \times H _ { i } ^ { \prime } } }
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\hat { H } = \operatorname* { m a x } _ { i \in \{ 1 , \dots , T \} } \bar { H } _ { i } = \operatorname* { m a x } \Bigg [ \frac { 1 } { b } \sum _ { { \bf x } \in { \bf x } _ { i } } H _ { i } \Bigg ] , \qquad H _ { i } ^ { \prime } = - \sum _ { c = 1 } ^ { C _ { i } } \frac { 1 } { C _ { i } } \log \Bigg [ \frac { 1 } { C _ { i } } \Bigg ]
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where ${ \bar { H } } _ { i }$ is the average Shannon Entropy across $b$ samples of task t, $H _ { i } ^ { \prime }$ , the Shannon entropy of choosing classes with uniform distribution and $\hat { H }$ , the maximum of each task’s average entropy over $b$ samples. $H _ { i } ^ { \prime }$ is normalizing factor that accounts for differing number of prediction classes (without the normalizing factor $H _ { i } ^ { \prime }$ , tasks with a binary classification $C _ { i } = 1$ were rarely chosen). Further, to limit high entropy outliers and to favor tasks with highest uncertainty, we normalize with $\hat { H }$ . The measure in eq. 4 allows Algorithm 1 to choose $b$ samples from $b \times T$ candidates to train the model.
|
| 99 |
+
|
| 100 |
+
# 3 RELATED WORK
|
| 101 |
+
|
| 102 |
+
Multi-Tasking in NLP. To take advantage of the potential positive transfer of knowledge from one task to another, several works have proposed carefully choosing which tasks to train as an intermediate step in NLP before single task fine-tuning (Bingel & Søgaard, 2017; Kerinec et al., 2018; Wang et al., 2019a; Standley et al., 2019; Pruksachatkun et al., 2020; Phang et al., 2018). The intermediate tasks are not required to perform well and are not typically evaluated jointly. In this work, all tasks are trained jointly and all tasks used are evaluated from a single model. In Natural Language Understanding (NLU), it is still the case that to get the best task performance one often needs a separate model per task (Clark et al., $2 0 1 9 \mathrm { c }$ ; McCann et al., 2018). At scale, Multilingual NMT systems (Aharoni et al., 2019) have also found that MTL model performance degrades as the number of tasks increases. We notice a similar trend in NLU with our baseline MTL model. Recently, approaches in MTL have tackled the problem by designing task specific decoders on top of a shared model (Liu et al., 2019b) or distilling multiple single-task models into one (Clark et al., 2019c). Nonetheless, such MTL approaches still involves single task fine-tuning. In this paper, we show that it is possible to achieve high performance in NLU without single task fine-tuning.
|
| 103 |
+
|
| 104 |
+
Adapters. Adapters are trainable modules that are attached in specific locations of a pretrained network. They provide another promising avenue to limit the number of parameters needed when confronted with a large number of tasks. This approach is useful with pretrained MLM models that have rich linguistic information (Tenney et al., 2019b; Clark et al., 2019b; Liu et al., 2019a; Tenney et al., 2019a). Recently, Houlsby et al. (2019) added an adapter to a pretrained BERT model by fine-tuning the layer norms and adding feed forward bottlenecks in every Transformer layer. However, such methods adapt each task individually during the fine-tuning process. Unlike prior work, our method harnesses the vectorized representations of tasks to modularize a single pretrained model across all tasks. Stickland et al. (2019) and Tay et al. (2020) also mix both MTL and adapters with BERT and T5 encoder-decoder (Raffel et al., 2019) respectively by creating local task modules that are controlled by a global task agnostic module. The main drawback is that a new set of non-shared parameters must be added when a new task is introduced. CA-MTL shares all parameters and is able to re-modulate existing weights with a new task embedding vector.
|
| 105 |
+
|
| 106 |
+
Active Learning, Task Selection and Sampling. Our sampling technique is similar to the ones found in several active learning algorithms (Chen et al., 2006) that are based on Shannon entropy estimations. Reichart et al. (2008) and Ikhwantri et al. (2018) examined Multi-Task Active Learning (MTAL), a technique that chooses one informative sample for $T$ different learners (or models) for each $T$ tasks. Instead we choose $T$ tasks samples for one model. Moreover, the algorithm weights each sample by the corresponding task score, and the Shannon entropy is normalized to account for various losses (see equation 5). Also, our algorithm is used in a large scale MTL setup $\gg 2$ tasks). Recently, Glover & Hokamp (2019) explored task selection in MTL using learning policies based on counterfactual estimations (Charles et al., 2013). However, such method considers only fixed stochastic parameterized policies while our method adapts its selection criterion based on model uncertainty throughout the training process.
|
| 107 |
+
|
| 108 |
+
# 4 EXPERIMENTS AND RESULTS
|
| 109 |
+
|
| 110 |
+
We show that our adapter of section 2 achieve parameter efficient transfer for 26 NLP tasks. Our implementation of CA-MTL is based on HuggingFace (Wolf et al., 2019). Hyperparameters and our experimental set-up are outlined in A.5. To preserve the weights of the pretrained model, CA-MTL’s bottom half Transformer layers are frozen in all experiments (except in section 4.4). We also tested different layer freezing configurations and found that freezing half the layers worked best on average (see Section A.8).
|
| 111 |
+
|
| 112 |
+
# 4.1 MULTI-TASK UNCERTAINTY SAMPLING
|
| 113 |
+
|
| 114 |
+
Our MT-Uncertainty sampling strategy, from section 2.2, is compared to 3 other task selection schemes: a) Counterfactual b) Task size c) Random. We used a BERTBASE (no adapters) on $2 0 0 \mathrm { k }$ iterations and with the same hyperparameters as in Glover & Hokamp (2019). For more information on Counterfactual task selection, we invite the reader to consult the full explanation in Glover & Hokamp (2019). For $T$ tasks and the dataset $D _ { i }$ for tasks $i \in \{ 1 , \ldots , T \}$ , we rewrite the definitions of Random πrand and Task size π|task| sampling:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\pi _ { r a n d } = 1 / T , \pi _ { | t a s k | } = | D _ { i } | \biggl [ \sum _ { i = 1 } ^ { T } | D _ { i } | \biggl ] ^ { - 1 }
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: MT-Uncertainty vs. other task sampling strategies: median dev set scores on 8 GLUE tasks and using $\mathbf { B E R T _ { B A S E } }$ . Data for the Counterfactual and Task Size policy $\pi | t a s k |$ (eq. 6) is from Glover & Hokamp (2019).
|
| 122 |
+
|
| 123 |
+
In Figure 4, we see from the results that MTUncertainty converges faster by reaching the $80 \%$ average GLUE score line before other task sampling methods. Further, MT-Uncertainty maximum score on $2 0 0 \mathrm { k }$ iterations is at 82.2, which is $1 . 7 \%$ higher than Counterfactual sampling. The datasets in the GLUE benchmark offers a wide range of dataset sizes. This is useful to test how MT-Uncertainty manages a jointly trained low resource task (CoLA) and high resource task (MNLI). Figure 5 explains how catastrophic forgetting is curtailed by sampling tasks before performance drops. With $\pi _ { r a n d }$ , all of CoLA’s tasks are sampled by iteration 500, at which point the larger MNLI
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: CoLA/MNLI Dev set scores and Entropy for $\pi _ { r a n d }$ (left) and MT-Uncertainty (right).
|
| 127 |
+
|
| 128 |
+
dataset overtakes the learning process and CoLA’s dev set performance starts to diminish. On the other hand, with MT-Uncertainty sampling, CoLA is sampled whenever Shannon entropy is higher than MNLI’s. The model first assesses uncertain samples using Shannon Entropy then decides what data is necessary to train on. This process allows lower resource tasks to keep performance steady. We provide evidence in Figure 8 of A.2 that MT-Uncertainty is able to manage task difficulty — by choosing the most difficult tasks first.
|
| 129 |
+
|
| 130 |
+
# 4.2 ABLATION AND MODULE ANALYSIS
|
| 131 |
+
|
| 132 |
+
In Table 1, we present the results of an ablation study to determine which elements of CA-MTLBERT-BASE had the largest positive gain on average GLUE scores. Starting from a MTL BERTBASE baseline trained using random task sampling $( \pi _ { r a n d } )$ . Apart for the Conditional Adapter, each module as well as MTUncertainty lift overall performance and reduce variance across tasks. Please note that we also included accuracy/F1 scores for QQP, MRPC and Pearson/ Spearman correlation for STS-B to calculate score standard deviation Task $\sigma$ . Intuitively, when negative task transfer occurs between two tasks, either (1) task interference is bidirectional and scores are both impacted, or (2) interference is unidirectional and only one score is impacted. We calculate Task $\sigma$ to characterize changes in the dynamic range of performance across multiple tasks. We do this to asses the degree to which performance improvements are distributed across all tasks or only subsets of tasks. As we can see from Table 1, Conditional Attention, Conditional Alignment, Conditional Layer Normalization, MT-Uncertainty play roles in reducing Task $\sigma$ and increasing performance across tasks. This provides partial evidence of CA-MTL’s ability to mitigating negative task transfer.
|
| 133 |
+
|
| 134 |
+
Table 1: Model ablation studya on the GLUE dev set. All models have the bottom half layers frozen.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Model changes</td><td>Avg GLUE</td><td>Task σ GLUE</td><td>% data used</td></tr><tr><td>BERTBASEMTL(πrand)</td><td>80.61</td><td>14.41</td><td>100</td></tr><tr><td>+ Conditional Attention</td><td>82.41</td><td>10.67</td><td>100</td></tr><tr><td>+ Conditional Adapter</td><td>82.90</td><td>11.27</td><td>100</td></tr><tr><td> + CA and CLN</td><td>83.12</td><td>10.91</td><td>100</td></tr><tr><td>+ MT-Uncertainty (CA-MTLBERT-BASE)</td><td>84.03</td><td>10.02</td><td>66.3</td></tr></table>
|
| 137 |
+
|
| 138 |
+
$\overline { { ^ \mathrm { a } C \mathrm { A } = } }$ Conditional Alignment, CLN=Conditional Layer Normalization, Task $\sigma { = } 1$ scores standard deviation across tasks.
|
| 139 |
+
|
| 140 |
+
We show that Conditional Alignment can learn to capture covariate distribution differences with task embeddings co-learned from other adapter components of CA-MTL. In Figure 6, we arrive at similar conclusions as Wu et al. (2020), who proved that negative task transfer is reduced when task covariances are aligned. The authors provided a “covariance similarity score” to gauge covariance alignment. For task $i$ and $j$ with $m _ { i }$ and $m _ { j }$ data samples respectively, and given $d$ dimensional inputs to the first Transformer layer $X _ { i } ~ \in ~ \mathbb { R } ^ { m _ { i } \times d }$ and $\boldsymbol { X } _ { j } \in \mathbb { R } ^ { m _ { j } \times d }$ , we rewrite the steps to calculate the covariance similarity score between task $i$ and $j$ : (a) Take the covariance matrix $X _ { i } ^ { \top } X _ { i }$ , (b) Find its best rank- $\cdot r _ { i }$ approximation $U _ { i , r _ { i } } D _ { i , r _ { i } } U _ { i , r _ { i } } ^ { \top }$ , where $r _ { i }$ is chosen to contain $9 9 \%$ of the singular values. (c) Apply steps (a), (b) to $X _ { j }$ , and compute the covariance similarity score $C o v S i m _ { i , j }$ :
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 6: Task performance vs. avg. covariance similarity scores (eq. 7) for MTL and CA-MTL.
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
C o v S i m _ { i , j } : = \frac { | | ( U _ { i , r _ { i } } D _ { i , r _ { i } } ^ { 1 / 2 } ) ^ { \top } U _ { j , r _ { j } } D _ { j , r _ { j } } ^ { 1 / 2 } | | _ { F } } { | | U _ { i , r _ { i } } D _ { i , r _ { i } } ^ { 1 / 2 } | | _ { F } \cdot | | U _ { j , r _ { j } } D _ { j , r _ { j } } ^ { 1 / 2 } | | _ { F } } . \ C o v S i m _ { i } = \frac { 1 } { T - 1 } \sum _ { j \neq i } C o v S i m _ { i , j }
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
Since we are training models with $T$ tasks, we take the average covariance similarity score $C o v S i m _ { i }$ between task $i$ and all other tasks. We measure $C o v S i m _ { i }$ using equation 7 between 9 single-task models trained on individual GLUE tasks. For each task in Figure 6, we measure the similarity score on the MTL trained BERTBASE baseline, e.g., CoLA (MTL), or CA-MTLBERT-BASE model, e.g., MNLI (CA-MTL). Our score improvement measure is the $\%$ difference between a single task model and MTL or CA-MTL on the particular task. We find that covariance similarity increases for 9 tasks and that performance increases for 7 out 9 tasks. These measurements confirm that the Conditional Alignment is able to align task covariance, thereby helping alleviate task interference.
|
| 150 |
+
|
| 151 |
+
# 4.3 JOINTLY TRAINING ON 8 TASKS: GLUE
|
| 152 |
+
|
| 153 |
+
In Table 2, we evaluate the performance of CA-MTL against single task fine-tuned models, MTL as well as the other BERT-based adapters on GLUE. As in Houlsby et al. (2019), $\bf { M N L I } _ { \mathrm { m } }$ and $\mathrm { M N L I _ { m m } }$ are treated as separate tasks. Our results indicate that CA-MTL outperforms both the BASE adapter,
|
| 154 |
+
|
| 155 |
+
Table 2: Adapters with layer freezing vs. ST/MT on GLUE test set. F1 scores are reported for QQP/MRPC, Spearman’s correlation for STS-B, accuracy on the matched/mismatch sets for MNLI, Matthew’s correlation for CoLA and accuracy for other tasks. \* Individual scores not available. ${ \mathrm { S T } } { = } { \mathrm { : } }$ Single Task, MTL $\vartriangle$ Multitask, g.e.= greater or equal to. Results from: 1Devlin et al. (2018) 2Stickland et al. (2019). 3Houlsby et al. (2019) .
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Type</td><td rowspan="2">Total params</td><td rowspan="2">Trained params/task</td><td rowspan="2">#tasks g.e.ST</td><td colspan="8">GLUE MRPC QNLI QQP RTE SST-2 STS-B</td></tr><tr><td>MNLI</td><td></td><td></td><td></td><td></td><td></td><td></td><td>Avg</td></tr><tr><td colspan="10">Base Models- Test Server Results</td><td colspan="7"></td></tr><tr><td>BERTBASE</td><td>ST</td><td>9.0×</td><td>100%</td><td>丨</td><td>52.1</td><td>84.6/83.4</td><td>88.9</td><td>90.5</td><td>71.2</td><td>66.4</td><td>93.5</td><td></td><td>85.8</td><td>79.6</td></tr><tr><td>BERTBASE2 2</td><td>MTL</td><td>1.0×</td><td>11.1%</td><td>2</td><td>51.2</td><td>84.0/83.4</td><td>86.7</td><td></td><td>89.3</td><td>70.8</td><td>76.6</td><td>93.4</td><td>83.6</td><td>79.9</td></tr><tr><td>PALs+Anneal Samp. 2</td><td>MTL</td><td>1.13×</td><td>12.5%</td><td>4</td><td>51.2</td><td>84.3/83.5</td><td></td><td>88.7</td><td>90.0</td><td>71.5</td><td>76.0</td><td>92.6</td><td>85.8</td><td>80.4</td></tr><tr><td>CA-MTLBERT-BASE( (ours)</td><td>MTL</td><td>1.12×</td><td>5.6%</td><td>5</td><td>53.1</td><td>85.9/85.8</td><td></td><td>88.6</td><td>90.5</td><td>69.2</td><td>76.4</td><td>93.2</td><td>85.3</td><td>80.9</td></tr><tr><td colspan="10">LargeModels TestServer Results</td><td colspan="7"></td></tr><tr><td>BERTLARGE 1</td><td>ST</td><td>9.0×</td><td>100%</td><td></td><td></td><td>60.5</td><td>86.7/85.9</td><td>89.3</td><td>92.7</td><td>72.1</td><td>70.1</td><td>94.9</td><td>86.5</td><td>82.1</td></tr><tr><td> Adapters-2563</td><td>ST</td><td>1.3×</td><td>3.6%</td><td>1 3</td><td>59.5</td><td>84.9/85.1</td><td></td><td>89.5</td><td>90.7</td><td>71.8</td><td>71.5</td><td>94.0</td><td>86.9</td><td>80.0</td></tr><tr><td>CA-MTLBERT-LARGE (ours)</td><td>MTL</td><td>1.12×</td><td>5.6%</td><td>3</td><td>59.5</td><td>85.9/85.4</td><td></td><td>89.3</td><td>92.6</td><td>71.4</td><td>79.0</td><td>94.7</td><td>87.7</td><td>82.8</td></tr></table>
|
| 158 |
+
|
| 159 |
+
PALS $+$ Anneal Sampling (Stickland et al., 2019), and the LARGE adapter, Adapters-256 (Houlsby et al., 2019). Against single task (ST) models, CA-MTL is $1 . 3 \%$ higher than $\mathbf { B E R T _ { B A S E } }$ , with 5 out 9 tasks equal or greater performance, and $0 . 7 \%$ higher than BERTLARGE, with 3 out 9 tasks equal or greater performance. ST models, however, need 9 models or close to $9 \times$ more parameters for all 9 tasks. We noted that CA-MTLBERT-LARGE’s average score is driven by strong RTE scores. While RTE benefits from MTL, this behavior may also be a side effect of layer freezing. In Table 10, we see that CA-MTL has gains over ST on more and more tasks as we gradually unfreeze layers.
|
| 160 |
+
|
| 161 |
+
# 4.4 TRANSFER TO NEW TASKS
|
| 162 |
+
|
| 163 |
+
In Table 3 we examine the ability of our method to quickly adapt to new tasks. We performed domain adaptation on SciTail (Khot et al., 2018) and SNLI (Bowman et al., 2015) datasets, using a CA-MTLBASE model trained on GLUE and a new linear decoder head. We
|
| 164 |
+
|
| 165 |
+
Table 3: Domain adaptation results on dev. sets for BASE models. 1Liu et al. (2019b), 2Jiang et al. (2020)
|
| 166 |
+
|
| 167 |
+
<table><tr><td rowspan="2">% data used</td><td colspan="4">SciTail</td><td colspan="4">SNLI</td></tr><tr><td>0.1%</td><td>1%</td><td>10%</td><td>|100%</td><td>0.1%</td><td>1%|10%</td><td></td><td>100%</td></tr><tr><td>BERTBASE</td><td>51.2</td><td>82.2</td><td>90.5</td><td>94.3</td><td>52.5</td><td>78.1</td><td>86.7</td><td>91.0</td></tr><tr><td>MT-DNN1</td><td>81.9</td><td>88.3</td><td>91.1</td><td>95.7</td><td>81.9</td><td>88.3</td><td>91.1</td><td>95.7</td></tr><tr><td>MT-DNNSMART2 2</td><td>82.3</td><td>88.6</td><td>91.3</td><td>96.1</td><td>82.7</td><td>86.0</td><td>88.7</td><td>91.6</td></tr><tr><td>CA-MTLBERT</td><td>83.2</td><td>88.7</td><td>91.4</td><td>95.6</td><td>82.8</td><td>86.2</td><td>88.0</td><td>91.5</td></tr></table>
|
| 168 |
+
|
| 169 |
+
tested several pretrained and randomly initialized task embeddings in a zero-shot setting. The complete set of experiments with all task embeddings can be found in the Appendix, Section A.4. We then selected the best task embedding for our results in Table 3. STS-B and MRPC MTL-trained task embeddings performed best on SciTail and SNLI respectively. CA-MTLBERT-BASE has faster adaptation than MT-DNNSMART (Jiang et al., 2020) as evidenced by higher performances in low-resource regimes ( $0 . 1 \%$ and $1 \%$ of the data). When trained on the complete dataset, CA-MTLBERT-BASE is on par with MT-DNNSMART. Unlike MT-DNNSMART however, we do not add context from a semantic similarity model – MT-DNNSMART is built off HNN (He et al., 2019). Nonetheless, with a larger model, CA-MTL surpasses MT-DNNSMART on the full SNLI and SciTail datasets in Table 6.
|
| 170 |
+
|
| 171 |
+
# 4.5 JOINTLY TRAINING ON 24 TASKS: GLUE/SUPER-GLUE, MRQA AND WNUT2017
|
| 172 |
+
|
| 173 |
+
Effects of Scaling Task Count. In Figure 7 we continue to test if CA-MTL mitigates task interference by measuring GLUE average scores when progressively adding 9 GLUE tasks, 8 Super-GLUE tasks (Wang et al., 2019b), 6 MRQA tasks (Fisch et al., 2019). Tasks are described in Appendix section A.9. The results show that adding 23 tasks drops the performance of our baseline MTL BERTBASE $( \pi _ { r a n d } )$ . MTL BERT increases by $4 . 3 \%$ when adding MRQA but, with 23 tasks, the model performance drops by $1 . 8 \%$ . The opposite is true when CA-MTL modules are integrated into the model. CA-MTL continues to show gains with a large number of tasks and surpasses the baseline MTL model by close to $4 \%$ when trained on 23 tasks.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 7: Effects of adding more datasets on avg GLUE scores. Experiments conducted on 3 epochs. When 23 tasks are trained jointly, performance of CA-MTLBERT-BASE continues to improve.
|
| 177 |
+
|
| 178 |
+
24-task CA-MTL. We jointly trained large MTL baselines and CA-MTL models on GLUE/Super-GLUE/MRQA and Named Entity Recognition (NER) WNUT2017 (Derczynski et al., 2017). Since some dev. set scores are not provided and since RoBERTa results were reported with a median score over 5 random seeds, we ran our own single seed ST/MTL baselines (marked “ReImp”) for a fair comparison. The dev. set numbers reported in Liu et al. (2019c) are displayed with our baselines in Table 9. Results are presented in Table 4.
|
| 179 |
+
|
| 180 |
+
Table 4: 24-task CA-MTL vs. ST and vs. 24-task MTL with frozen layers on GLUE, SuperGLUE, MRQA and NER development sets. ${ \mathrm { S T } } { = } { \mathrm { S } }$ ingle Task, MTL Multitask, g.e.= greater or equal to. Details in section A.5.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Model</td><td colspan="3">Task Grouping GLUE SuperGLUE MRQA</td><td>Avg</td><td>#tasks e.g.ST</td><td>Total Params</td></tr><tr><td colspan="7">BERT-LARGEmodels</td></tr><tr><td>STReImp</td><td>84.5</td><td>68.9</td><td>79.7 54.1</td><td>76.8</td><td></td><td>24×</td></tr><tr><td>MTLReImp</td><td>83.2</td><td>72.1</td><td>77.8 42.2</td><td>76.4</td><td>9/24</td><td>1×</td></tr><tr><td>CA-MTL</td><td>86.6</td><td>74.1</td><td>79.5 49.0</td><td>79.1</td><td>17/24</td><td>1.12×</td></tr><tr><td colspan="7">RoBERTa-LARGEmodels</td></tr><tr><td>STReImp</td><td>88.2</td><td>76.5</td><td>83.6 57.8</td><td>81.9</td><td></td><td>24×</td></tr><tr><td>MTLReImp</td><td>86.0</td><td>78.6</td><td>80.7</td><td>49.3 80.7</td><td>7/24</td><td>1×</td></tr><tr><td>CA-MTL</td><td>89.4</td><td>80.0</td><td>82.4 55.2</td><td>83.1</td><td>15/24</td><td>1.12×</td></tr></table>
|
| 183 |
+
|
| 184 |
+
We notice in Table 4 that even for large models, CA-MTL provides large gains in performance on average over both ST and MTL models. For the BERT based models, CA-MTL provides $2 . 3 \%$ gain over ST and higher scores on 17 out 24 tasks. For RoBERTa based models, CA-MTL provides $1 . 2 \%$ gain over ST and higher scores on 15 out 24 tasks. We remind the reader that this is achieved with a single model. Even when trained with 16 other tasks, it is interesting to note that the MTL baseline perform better than the ST baseline on Super GLUE where most tasks have a small number of samples. Also, we used NER to test if we could still outperform the ST baseline on a token-level task, significantly different from other tasks. Unfortunately, while CA-MTL performs significantly better than the MTL baseline model, CA-MTL had not yet overfit on this particular task and could have closed the gap with the ST baselines with more training cycles.
|
| 185 |
+
|
| 186 |
+
Comparisons with other methods. In Table 5, CA-MTLBERT is compared to other Large BERT based methods that either use $\mathbf { M T L } + \mathbf { S T }$ , such as MT-DNN (Liu et al., 2019b), intermediate tasks $+ \mathrm { \Omega } \mathrm { S T }$ , such as STILTS (Phang et al., 2018) or MTL model distillation $+ \mathrm { \bf ~ \nabla ~ } \mathrm { S T }$ , such as BAM! (Clark et al., 2019c). Our method scores higher than MT-DNN on 5 of 9 tasks and by $1 . 0 \%$ on avg. Against STILTS, CA-MTL realizes a $0 . 7 \%$ avg. score gain, surpassing scores on 6 of 9 tasks. We also show
|
| 187 |
+
|
| 188 |
+
Table 5: Our 24-task CA-MTL vs. other large models on GLUE. F1 is reported for QQP/MRPC, Spearman’s corr. for STS-B, Matthew’s corr. for CoLA and accuracy for other tasks. \*Split not available. \*\*Uses intermediate task fine-tuning $+ \thinspace \mathrm { S T }$ .
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Model</td><td colspan="7">GLUE tasks</td><td rowspan="2">Avg</td></tr><tr><td></td><td>CoLA MNLI</td><td>MRPC QNLI QQP RTE SST-2 STS-B</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="9">BERT-LARGE based models on Dev set.</td></tr><tr><td>MT-DNN</td><td>63.5 87.1/86.7</td><td>91.0</td><td>92.9</td><td>89.2</td><td>83.4</td><td>94.3</td><td>90.6</td><td>85.6</td></tr><tr><td>STILTS **</td><td>62.1 86.1*</td><td>92.3</td><td>90.5</td><td>88.5</td><td>83.4</td><td>93.2</td><td>90.8</td><td>85.9</td></tr><tr><td>BAM!</td><td>61.8 87.0*</td><td>1</td><td>92.5</td><td>1</td><td>82.8</td><td>93.6</td><td>89.7</td><td>1</td></tr><tr><td>24-task CA-MTL</td><td>63.8 86.3/86.0</td><td>92.9</td><td>93.4</td><td>88.1</td><td>84.5</td><td>94.5</td><td>90.3</td><td>86.6</td></tr><tr><td colspan="9">RoBERTa-LARGEbasedmodelson Testset. RoBERTA** with</td></tr><tr><td>Ensemble</td><td>67.8 91.0/90.8</td><td>91.6</td><td>95.4</td><td>74.0</td><td>87.9</td><td>97.5</td><td>92.5</td><td>87.3</td></tr><tr><td>24-task CA-MTL</td><td>62.2 89.0/88.4</td><td>92.0</td><td>94.7</td><td>72.3</td><td>86.2</td><td>96.3</td><td>89.8</td><td>85.7</td></tr></table>
|
| 191 |
+
|
| 192 |
+
that CA-MTLRoBERTa is within only $1 . 6 \%$ of a RoBERTa ensemble of 5 to 7 models per task and that uses intermediate tasks. Using our 24-task CA-MTL large RoBERTa-based model, we report NER F1 scores on the WNUT2017 test set in Table 6a. We compare our result with RoBERTaLARGE and XLM-RLARGE (Nguyen et al., 2020) the current state-of-the-art (SOTA). Our model outperforms XLM-RLARGE by $1 . 6 \%$ , reaching a new state-of-the-art. Using domain adaptation as described in Section 4.4, we report results on the SciTail test set in Table 6b and SNLI test set in Table 6b. For SciTail, our model matches the current $\mathrm { S O T A } ^ { 2 }$ ALUM (Liu et al., 2020), a RoBERTa large based model that additionally uses the SMART (Jiang et al., 2020) fine-tuning method. For SNLI, our model outperforms SemBert, the current $\mathsf { S O T A } ^ { 3 }$ .
|
| 193 |
+
|
| 194 |
+
Table 6: CA-MTL test performance vs. SOTA.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>(b) SciTail</td><td>% Acc</td></tr><tr><td>MT-DNN ALUMRoBERTa</td><td>94.1 96.3</td></tr><tr><td>ALUMRoBERTa-SMART</td><td>96.8</td></tr><tr><td>CA-MTLRoBERTa (ours)</td><td>96.8</td></tr></table>
|
| 197 |
+
|
| 198 |
+
<table><tr><td rowspan=1 colspan=1>(a)WNUT2017</td><td rowspan=1 colspan=1>F1</td></tr><tr><td rowspan=1 colspan=1>RoBERTaLARGEXLM-RLARGE</td><td rowspan=1 colspan=1>56.957.1</td></tr><tr><td rowspan=1 colspan=1>CA-MTLRoBERTa(ours)</td><td rowspan=1 colspan=1>58.0</td></tr></table>
|
| 199 |
+
|
| 200 |
+
<table><tr><td rowspan=1 colspan=1>(C) SNLI</td><td rowspan=1 colspan=1>% Acc</td></tr><tr><td rowspan=1 colspan=1>MT-DNNMT-DNNSMARTSemBERT</td><td rowspan=1 colspan=1>91.691.791.9</td></tr><tr><td rowspan=1 colspan=1>CA-MTLRoBERTa(ours)</td><td rowspan=1 colspan=1>92.1</td></tr></table>
|
| 201 |
+
|
| 202 |
+
# 5 CONCLUSION
|
| 203 |
+
|
| 204 |
+
We believe that our experiments here have helped demonstrate the potential of task conditioned adaptive learning within a single model that performs multiple tasks. In a large-scale 24-task NLP experiment, CA-MTL outperforms fully tuned single task models by $2 . 3 \%$ for BERT Large and by $1 . 2 \%$ for RoBERTa Large using 1.12 times the number of parameters, while single task fine-tuning approach requires 24 separately tuned single task models or 24 times the number of parameters. When a BERT vanilla MTL model sees its performance drop as the number of tasks increases, CA-MTL scores continue to climb. Performance gains are not driven by a single task as it is often the case in MTL. Each CA-MTL module that adapts a Transformer model is able to reduce performance variances between tasks, increasing average scores and aligning task covariances. This evidence shows that CA-MTL is able to mitigate task interference and promote more efficient parameter sharing. We showed that MT-Uncertainty is able to avoid degrading performances of low resource tasks. Tasks are sampled whenever the model sees entropy increase, helping avoid catastrophic forgetting. Overall, CA-MTL offers a promising avenue to dynamically adapt and modularize knowledge embedded in large monolithic pretrained models. Extending such ideas will be an objective for future work.
|
| 205 |
+
|
| 206 |
+
# ACKNOWLEDGMENTS
|
| 207 |
+
|
| 208 |
+
This research was supported by the Canada CIFAR AI Chairs Program, NSERC and PROMPT. Experiments in this article were conducted with Compute Canada and MILA computational infrastructure and we thank them for their support. We would like to thank Colin Raffel, Sandeep Subramanian, and Nicolas Gontier for their useful feedback and the anonymous reviewers for helpful comments, discussions and suggestions.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Roee Aharoni, Melvin Johnson, and Orhan Firat. Massively multilingual neural machine translation. 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. 3874–3884, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1388. URL https://www.aclweb.org/anthology/N19-1388.
|
| 213 |
+
|
| 214 |
+
Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016. URL http://arxiv.org/abs/1607.06450.
|
| 215 |
+
|
| 216 |
+
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.
|
| 217 |
+
|
| 218 |
+
Joachim Bingel and Anders Søgaard. Identifying beneficial task relations for multi-task learning in deep neural networks. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 164–169, Valencia, Spain, April 2017. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/E17-2026.
|
| 219 |
+
|
| 220 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2015.
|
| 221 |
+
|
| 222 |
+
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, pp. arXiv–2005, 2020.
|
| 223 |
+
|
| 224 |
+
Rich Caruana. Multitask learning. Mach. Learn., 28(1):41–75, July 1997. ISSN 0885-6125. doi: 10.1023/A:1007379606734. URL https://doi.org/10.1023/A:1007379606734.
|
| 225 |
+
|
| 226 |
+
Richard Caruana. Multitask learning: A knowledge-based source of inductive bias. In Proceedings of the Tenth International Conference on Machine Learning, pp. 41–48. Morgan Kaufmann, 1993.
|
| 227 |
+
|
| 228 |
+
Daniel Cer, Mona Diab, Eneko Agirre, Iñigo Lopez-Gazpio, and Lucia Specia. SemEval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pp. 1–14, Vancouver, Canada, August 2017. Association for Computational Linguistics. doi: 10.18653/v1/S17-2001. URL https://www.aclweb.org/anthology/S17-2001.
|
| 229 |
+
|
| 230 |
+
Denis Charles, Max Chickering, and Patrice Simard. Counterfactual reasoning and learning systems: The example of computational advertising. Journal of Machine Learning Research, 14:3207–3260, November 2013.
|
| 231 |
+
|
| 232 |
+
Jinying Chen, Andrew Schein, Lyle Ungar, and Martha Palmer. An empirical study of the behavior of active learning for word sense disambiguation. In Proceedings of the Human Language Technology Conference of the NAACL, Main Conference, pp. 120–127, New York City, USA, June 2006. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/N06-1016.
|
| 233 |
+
|
| 234 |
+
Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. CoRR, abs/1711.02257, 2017. URL http://arxiv.org/abs/1711.02257.
|
| 235 |
+
|
| 236 |
+
Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. BoolQ: Exploring the surprising difficulty of natural yes/no questions. 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. 2924–2936, Minneapolis, Minnesota, June 2019a. Association for Computational Linguistics. doi: 10.18653/ v1/N19-1300. URL https://www.aclweb.org/anthology/N19-1300.
|
| 237 |
+
|
| 238 |
+
Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of BERT’s attention. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 276–286, Florence, Italy, August 2019b. Association for Computational Linguistics. doi: 10.18653/v1/W19-4828. URL https: //www.aclweb.org/anthology/W19-4828.
|
| 239 |
+
|
| 240 |
+
Kevin Clark, Minh-Thang Luong, Urvashi Khandelwal, Christopher D. Manning, and Quoc V. Le. Bam! born-again multi-task networks for natural language understanding. CoRR, abs/1907.04829, 2019c. URL http://arxiv.org/abs/1907.04829.
|
| 241 |
+
|
| 242 |
+
Edward Collins, Nikolai Rozanov, and Bingbing Zhang. Evolutionary data measures: Understanding the difficulty of text classification tasks. In Proceedings of the 22nd Conference on Computational Natural Language Learning, pp. 380–391, Brussels, Belgium, October 2018. Association for Computational Linguistics. doi: 10.18653/v1/K18-1037. URL https://www.aclweb.org/ anthology/K18-1037.
|
| 243 |
+
|
| 244 |
+
Ronan Collobert and Jason Weston. A unified architecture for natural language processing: deep neural networks with multitask learning. In ICML, pp. 160–167, 2008. URL https://doi. org/10.1145/1390156.1390177.
|
| 245 |
+
|
| 246 |
+
Marie-Catherine de Marneffe, Mandy Simons, and Judith Tonhauser. The commitmentbank: Investigating projection in naturally occurring discourse. Proceedings of Sinn und Bedeutung, 23(2):107– 124, Jul. 2019. doi: 10.18148/sub/2019.v23i2.601. URL https://ojs.ub.uni-konstanz. de/sub/index.php/sub/article/view/601.
|
| 247 |
+
|
| 248 |
+
Harm de Vries, Florian Strub, Jeremie Mary, Hugo Larochelle, Olivier Pietquin, and Aaron C Courville. Modulating early visual processing by language. 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. 6594– 6604. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 7237-modulating-early-visual-processing-by-language.pdf.
|
| 249 |
+
|
| 250 |
+
Leon Derczynski, Eric Nichols, Marieke van Erp, and Nut Limsopatham. Results of the WNUT2017 shared task on novel and emerging entity recognition. In Proceedings of the 3rd Workshop on Noisy User-generated Text, pp. 140–147, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/W17-4418. URL https://www.aclweb.org/ anthology/W17-4418.
|
| 251 |
+
|
| 252 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805.
|
| 253 |
+
|
| 254 |
+
William B. Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005), 2005. URL https://www.aclweb.org/anthology/I05-5002.
|
| 255 |
+
|
| 256 |
+
Matthew Dunn, Levent Sagun, Mike Higgins, V. Ugur Güney, Volkan Cirik, and Kyunghyun Cho. Searchqa: A new q&a dataset augmented with context from a search engine. CoRR, abs/1704.05179, 2017. URL http://arxiv.org/abs/1704.05179.
|
| 257 |
+
|
| 258 |
+
Adam Fisch, Alon Talmor, Robin Jia, Minjoon Seo, Eunsol Choi, and Danqi Chen. MRQA 2019 shared task: Evaluating generalization in reading comprehension. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pp. 1–13, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-5801. URL https: //www.aclweb.org/anthology/D19-5801.
|
| 259 |
+
|
| 260 |
+
John Glover and Chris Hokamp. Task selection policies for multitask learning. CoRR, 2019. URL http://arxiv.org/abs/1907.06214.
|
| 261 |
+
|
| 262 |
+
Andrew Gordon, Zornitsa Kozareva, and Melissa Roemmele. SemEval-2012 task 7: Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In \*SEM 2012: The First Joint Conference on Lexical and Computational Semantics – Volume 1: Proceedings of the main conference and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), pp. 394–398, Montréal, Canada, 7-8 June 2012. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/S12-1052.
|
| 263 |
+
|
| 264 |
+
Michelle Guo, Albert Haque, De-An Huang, Serena Yeung, and Li Fei-Fei. Dynamic task prioritization for multitask learning. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018.
|
| 265 |
+
|
| 266 |
+
Pengcheng He, Xiaodong Liu, Weizhu Chen, and Jianfeng Gao. A hybrid neural network model for commonsense reasoning. In Proceedings of the First Workshop on Commonsense Inference in Natural Language Processing, pp. 13–21, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-6002. URL https://www.aclweb.org/ anthology/D19-6002.
|
| 267 |
+
|
| 268 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. CoRR, abs/1902.00751, 2019. URL http://arxiv.org/abs/1902.00751.
|
| 269 |
+
|
| 270 |
+
Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 328–339, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1031. URL https://www.aclweb.org/anthology/ P18-1031.
|
| 271 |
+
|
| 272 |
+
Fariz Ikhwantri, Samuel Louvan, Kemal Kurniawan, Bagas Abisena, Valdi Rachman, Alfan Farizki Wicaksono, and Rahmad Mahendra. Multi-task active learning for neural semantic role labeling on low resource conversational corpus. In Proceedings of the Workshop on Deep Learning Approaches for Low-Resource NLP, pp. 43–50, 2018.
|
| 273 |
+
|
| 274 |
+
Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. SMART: Robust and efficient fine-tuning for pre-trained natural language models through principled regularized optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 2177–2190, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.197. URL https://www.aclweb.org/anthology/2020. acl-main.197.
|
| 275 |
+
|
| 276 |
+
Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1601– 1611, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/ v1/P17-1147. URL https://www.aclweb.org/anthology/P17-1147.
|
| 277 |
+
|
| 278 |
+
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. CoRR, abs/1907.10529, 2019. URL http://arxiv.org/abs/1907.10529.
|
| 279 |
+
|
| 280 |
+
Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. CoRR, abs/1705.07115, 2017. URL http://arxiv.org/ abs/1705.07115.
|
| 281 |
+
|
| 282 |
+
Emma Kerinec, Chloé Braud, and Anders Søgaard. When does deep multi-task learning work for loosely related document classification tasks? In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 1–8, Brussels, Belgium, November 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-5401. URL https://www.aclweb.org/anthology/W18-5401.
|
| 283 |
+
|
| 284 |
+
Daniel Khashabi, Snigdha Chaturvedi, Michael Roth, Shyam Upadhyay, and Dan Roth. Looking beyond the surface: A challenge set for reading comprehension over multiple sentences. 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. 252–262, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1023. URL https://www.aclweb.org/anthology/N18-1023.
|
| 285 |
+
|
| 286 |
+
Tushar Khot, A. Sabharwal, and Peter Clark. Scitail: A textual entailment dataset from science question answering. In AAAI, 2018.
|
| 287 |
+
|
| 288 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015.
|
| 289 |
+
|
| 290 |
+
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Matthew Kelcey, Jacob Devlin, Kenton Lee, Kristina N. Toutanova, Llion Jones, Ming-Wei Chang, Andrew Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. Natural questions: a benchmark for question answering research. Transactions of the Association of Computational Linguistics, 2019.
|
| 291 |
+
|
| 292 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020.
|
| 293 |
+
|
| 294 |
+
Hector J. Levesque. The winograd schema challenge. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning. AAAI, 2011. URL http://dblp.uni-trier.de/ db/conf/aaaiss/aaaiss2011-6.html#Levesque11.
|
| 295 |
+
|
| 296 |
+
Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. Linguistic knowledge and transferability of contextual representations. CoRR, abs/1903.08855, 2019a. URL http://arxiv.org/abs/1903.08855.
|
| 297 |
+
|
| 298 |
+
Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-task deep neural networks for natural language understanding. CoRR, abs/1901.11504, 2019b. URL http://arxiv.org/ abs/1901.11504.
|
| 299 |
+
|
| 300 |
+
Xiaodong Liu, Hao Cheng, Pengcheng He, Weizhu Chen, Yu Wang, Hoifung Poon, and Jianfeng Gao. Adversarial training for large neural language models, 2020.
|
| 301 |
+
|
| 302 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907.11692, 2019c. URL http://arxiv.org/abs/1907.11692.
|
| 303 |
+
|
| 304 |
+
Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018.
|
| 305 |
+
|
| 306 |
+
Amil Merchant, Elahe Rahimtoroghi, Ellie Pavlick, and Ian Tenney. What happens to bert embeddings during fine-tuning? arXiv preprint arXiv:2004.14448, 2020.
|
| 307 |
+
|
| 308 |
+
Dat Quoc Nguyen, Thanh Vu, and Anh Tuan Nguyen. Bertweet: A pre-trained language model for english tweets. arXiv preprint arXiv:2005.10200, 2020.
|
| 309 |
+
|
| 310 |
+
Hao Peng, Roy Schwartz, Dianqi Li, and Noah A. Smith. A mixture of $\mathrm { ~ h ~ - ~ } 1$ heads is better than h heads. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 6566–6577, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.587. URL https://www.aclweb.org/anthology/2020. acl-main.587.
|
| 311 |
+
|
| 312 |
+
Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. Film: Visual reasoning with a general conditioning layer. In AAAI, 2018.
|
| 313 |
+
|
| 314 |
+
Matthew E. Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. Dissecting contextual word embeddings: Architecture and representation. CoRR, abs/1808.08949, 2018. URL http: //arxiv.org/abs/1808.08949.
|
| 315 |
+
|
| 316 |
+
Jason Phang, Thibault Févry, and Samuel R. Bowman. Sentence encoders on STILTs: Supplementary training on intermediate labeled-data tasks. CoRR, abs/1811.01088, 2018. URL http://arxiv. org/abs/1811.01088.
|
| 317 |
+
|
| 318 |
+
Adam Poliak, Aparajita Haldar, Rachel Rudinger, J. Edward Hu, Ellie Pavlick, Aaron Steven White, and Benjamin Van Durme. Collecting diverse natural language inference problems for sentence representation evaluation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 67–81, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1007. URL https://www.aclweb.org/ anthology/D18-1007.
|
| 319 |
+
|
| 320 |
+
Yada Pruksachatkun, Jason Phang, Haokun Liu, Phu Mon Htut, Xiaoyi Zhang, Richard Yuanzhe Pang, Clara Vania, Katharina Kann, and Samuel R Bowman. Intermediate-task transfer learning with pretrained models for natural language understanding: When and why does it work? arXiv preprint arXiv:2005.00628, 2020.
|
| 321 |
+
|
| 322 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018.
|
| 323 |
+
|
| 324 |
+
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, 2019.
|
| 325 |
+
|
| 326 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383–2392, Austin, Texas, November 2016a. Association for Computational Linguistics. doi: 10.18653/v1/D16-1264. URL https://www.aclweb.org/ anthology/D16-1264.
|
| 327 |
+
|
| 328 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383–2392, Austin, Texas, November 2016b. Association for Computational Linguistics. doi: 10.18653/v1/D16-1264.
|
| 329 |
+
|
| 330 |
+
Roi Reichart, Katrin Tomanek, Udo Hahn, and Ari Rappoport. Multi-task active learning for linguistic annotations. In Proceedings of ACL-08: HLT, pp. 861–869, 2008.
|
| 331 |
+
|
| 332 |
+
Sebastian Ruder. An overview of multi-task learning in deep neural networks. ArXiv, abs/1706.05098, 2017.
|
| 333 |
+
|
| 334 |
+
Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. CoRR, abs/1810.04650, 2018. URL http://arxiv.org/abs/1810.04650.
|
| 335 |
+
|
| 336 |
+
Joan Serrà, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. In ICML, pp. 4555–4564, 2018. URL http:// proceedings.mlr.press/v80/serra18a.html.
|
| 337 |
+
|
| 338 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1631–1642, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/D13-1170.
|
| 339 |
+
|
| 340 |
+
Trevor Standley, Amir Roshan Zamir, Dawn Chen, Leonidas J. Guibas, Jitendra Malik, and Silvio Savarese. Which tasks should be learned together in multi-task learning? CoRR, abs/1905.07553, 2019. URL http://arxiv.org/abs/1905.07553.
|
| 341 |
+
|
| 342 |
+
Asa Cooper Stickland, Iain Murray, someone, and someone. BERT and PALs: Projected attention layers for efficient adaptation in multi-task learning. volume 97 of Proceedings of Machine Learning Research, pp. 5986–5995, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/stickland19a.html.
|
| 343 |
+
|
| 344 |
+
Yi Tay, Zhe Zhao, Dara Bahri, Donald Metzler, and Da-Cheng Juan. Hypergrid: Efficient multi-task transformers with grid-wise decomposable hyper projections. arXiv preprint arXiv:2007.05891, 2020.
|
| 345 |
+
|
| 346 |
+
Ian Tenney, Dipanjan Das, and Ellie Pavlick. BERT rediscovers the classical NLP pipeline. CoRR, abs/1905.05950, 2019a. URL http://arxiv.org/abs/1905.05950.
|
| 347 |
+
|
| 348 |
+
Ian Tenney, Patrick Xia, Berlin Chen, Alex Wang, Adam Poliak, R. Thomas McCoy, Najoung Kim, Benjamin Van Durme, Samuel R. Bowman, Dipanjan Das, and Ellie Pavlick. What do you learn from context? probing for sentence structure in contextualized word representations. CoRR, abs/1905.06316, 2019b. URL http://arxiv.org/abs/1905.06316.
|
| 349 |
+
|
| 350 |
+
Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. NewsQA: A machine comprehension dataset. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pp. 191–200, Vancouver, Canada, August 2017. Association for Computational Linguistics. doi: 10.18653/v1/W17-2623. URL https: //www.aclweb.org/anthology/W17-2623.
|
| 351 |
+
|
| 352 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. URL http://arxiv.org/abs/1706.03762.
|
| 353 |
+
|
| 354 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 353–355, Brussels, Belgium, November 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-5446. URL https://www.aclweb.org/anthology/W18-5446.
|
| 355 |
+
|
| 356 |
+
Alex Wang, Jan Hula, Patrick Xia, Raghavendra Pappagari, R. Thomas McCoy, Roma Patel, Najoung Kim, Ian Tenney, Yinghui Huang, Katherin Yu, Shuning Jin, Berlin Chen, Benjamin Van Durme, Edouard Grave, Ellie Pavlick, and Samuel R. Bowman. Can you tell me how to get past sesame street? sentence-level pretraining beyond language modeling. In Proceedings of the Annual Meeting of the Association for Computational Linguistics (ACL), 2019a.
|
| 357 |
+
|
| 358 |
+
Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. Superglue: A stickier benchmark for general-purpose language understanding systems. CoRR, abs/1905.00537, 2019b. URL http://arxiv.org/abs/ 1905.00537.
|
| 359 |
+
|
| 360 |
+
Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. CoRR, abs/1805.12471, 2018. URL http://arxiv.org/abs/1805.12471.
|
| 361 |
+
|
| 362 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1112–1122, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1101. URL https: //www.aclweb.org/anthology/N18-1101.
|
| 363 |
+
|
| 364 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, and Jamie Brew. Huggingface’s transformers: State-of-the-art natural language processing. CoRR, abs/1910.03771, 2019. URL http://arxiv.org/abs/1910.03771.
|
| 365 |
+
|
| 366 |
+
Sen Wu, Hongyang R. Zhang, and Christopher Ré. Understanding and improving information transfer in multi-task learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SylzhkBtDB.
|
| 367 |
+
|
| 368 |
+
Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2369–2380, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1259. URL https://www.aclweb.org/ anthology/D18-1259.
|
| 369 |
+
|
| 370 |
+
Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. arXiv preprint arXiv:2001.06782, 2020.
|
| 371 |
+
|
| 372 |
+
Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. Record: Bridging the gap between human and machine commonsense reading comprehension. CoRR, abs/1810.12885, 2018. URL http://arxiv.org/abs/1810.12885.
|
| 373 |
+
|
| 374 |
+
Yu Zhang and Qiang Yang. A survey on multi-task learning. CoRR, abs/1707.08114, 2017. URL http://arxiv.org/abs/1707.08114.
|
| 375 |
+
|
| 376 |
+
# A APPENDIX
|
| 377 |
+
|
| 378 |
+
# A.1 SUMMARY OF ACRONYMS
|
| 379 |
+
|
| 380 |
+
Acronyms of datasets and descriptions can be found below in section A.9.
|
| 381 |
+
|
| 382 |
+
Table 7: List of acronyms used in this paper.
|
| 383 |
+
|
| 384 |
+
<table><tr><td>Acronym</td><td>Description</td></tr><tr><td>ARLM CA-MTL</td><td>AutoregressiveLanguageModels</td></tr><tr><td></td><td>Conditional Adaptive Multi-Task Learning:our architecture</td></tr><tr><td>CFF</td><td>Conditional Feed-Forward:a feed-forward layer modulated by a conditioning vector</td></tr><tr><td>CLN</td><td>Conditional Layer Normalization in section 2.1.3</td></tr><tr><td>EDM</td><td>Evolutionary Data Measures (Collins et al.,2O18):a task difficulty estimate</td></tr><tr><td>GLUE</td><td>General Language Understanding Evaluation Wang et al. (2O18):a benchmark with multiple datasets</td></tr><tr><td>QA</td><td>Question Answering</td></tr><tr><td>MT</td><td>Multi-Task</td></tr><tr><td>MTAL</td><td>Multi-Task Active Learning: finding the most informative instance for multiple learners (or models)</td></tr><tr><td>MLM</td><td>Masked Language Model: BERT Devlin et al.(2O18) is an example of an MLM</td></tr><tr><td>MTL</td><td>Multi-Task Learning:"learning tasks in paralel while using a shared representation"(Caruana,1997)</td></tr><tr><td>MRQA</td><td>Machine Reading for Question Answering Fisch et al.(2O19):a benchmark with multiple datasets</td></tr><tr><td>NER</td><td>Named Entity Recognition</td></tr><tr><td>NLP</td><td>Natural Language Processing</td></tr><tr><td>SOTA</td><td>State of the art</td></tr><tr><td>ST</td><td>Single Task fine-tuning:all weights are typically updated</td></tr><tr><td>ST-A</td><td>ST withAdapter modules:one adapter per task is trained and pretrained weights are optionally updated</td></tr></table>
|
| 385 |
+
|
| 386 |
+
A.2 UNCERTAINTY SAMPLING: ALGORITHM AND ADDITIONAL RESULTS
|
| 387 |
+
|
| 388 |
+
# Algorithm 1: Multi-task Uncertainty Sampling
|
| 389 |
+
|
| 390 |
+
Input: Training data $D _ { t }$ for task $t \in [ 1 , \ldots , T ]$ ; batch size $b$ ; $C _ { t }$ possible output classes
|
| 391 |
+
for task $t$ ; $f : = f _ { \phi ( \mathbf { z } _ { i } ) , \theta _ { i } }$ our model with weights $\phi , \theta _ { i }$ ;
|
| 392 |
+
Output: $B ^ { \prime }$ - multi-task batch of size $b$
|
| 393 |
+
1 $B \emptyset$
|
| 394 |
+
2 for $t \gets 1$ to $T$ do
|
| 395 |
+
3 Generate $\mathbf { x } _ { t } : = \{ x _ { t , 1 } , \ldots , x _ { t , b } \} \overset { \mathrm { i . i . d . } } { \sim } D _ { t }$
|
| 396 |
+
4 for $i \gets 1$ to $b$ do
|
| 397 |
+
5 $\begin{array} { r } { \mathcal { H } _ { t , i } \gets - \sum _ { c = 1 } ^ { C _ { i } } p _ { c } ( f ( x _ { t , i } ) ) \log p _ { c } ( f ( x _ { t , i } ) ) } \end{array}$ . Entropy of each sample
|
| 398 |
+
6
|
| 399 |
+
7 end
|
| 400 |
+
8 Compute $\begin{array} { r } { \bar { \mathcal { H } } _ { t } \gets \frac { 1 } { b } \sum _ { \mathbf { x } \in \mathbf { x } _ { i } } \mathcal { H } _ { t , i } } \end{array}$ . Average entropy for task t
|
| 401 |
+
9
|
| 402 |
+
10 Compute $\begin{array} { r } { H _ { t } ^ { \prime } \gets - \sum _ { c = 1 } ^ { C _ { t } } \frac { 1 } { C _ { t } } \log \bigg [ \frac { 1 } { C _ { t } } \bigg ] } \end{array}$ . Max entropy (uniform distribution)
|
| 403 |
+
11
|
| 404 |
+
12 $B B \cup { \bf x } _ { t }$ and $D _ { t } \gets D _ { t } \setminus { \bf x } _ { t }$
|
| 405 |
+
13 if $D _ { t } = \varnothing$ then
|
| 406 |
+
14 Reload $D _ { t }$
|
| 407 |
+
15 end
|
| 408 |
+
16 for $i \gets 1$ to $b$ do
|
| 409 |
+
17 Compute: $\mathcal { U } _ { t , i } \mathcal { H } _ { t , i } / H _ { t } ^ { \prime }$ . Uncertainty normalized with max entropy
|
| 410 |
+
18 end
|
| 411 |
+
19 end
|
| 412 |
+
20 Compute $\hat { \mathcal { H } } \gets \operatorname* { m a x } _ { i \in \{ 1 , \dots , T \} } [ \bar { \mathcal { H } } _ { t } ]$ . Entropy of task with highest average entropy
|
| 413 |
+
21 Update ${ \mathcal { U } } _ { t , i } \gets { \mathcal { U } } _ { t , i } / { \hat { \mathcal { H } } }$ . Normalize each sample’s uncertainty measure
|
| 414 |
+
22 $\mathcal { B } ^ { \prime } \mathrm { t o p \_ b } ( \{ \mathcal { U } _ { t , i } | t \in [ 1 , \ldots , T ] , i \in [ 1 , \ldots , b ] \} )$ . b samples w/ highest uncertainty
|
| 415 |
+
Return: With $B ^ { \prime }$ , solve eq. 1 with gradient descent; updated model $f$
|
| 416 |
+
|
| 417 |
+
An advantage of our MT-Uncertainty Sampling approach is its ability to manage task difficulty. This is highlighted in Figure 8. In this experiment, we estimated task difficulty using the Evolutionary Data Measures $( \mathrm { E D M } ) ^ { 4 }$ proposed by Collins et al. (2018). The task difficulty estimate relies on multiple dataset statistics such as the data size, class diversity, class balance and class interference. Interestingly, estimated task difficulty correlates with the first instance that the selection of a specific task occurs. Supposing that QNLI is an outlier, we notice that peaks in the data occur whenever tasks are first selected by MT Uncertainty sampling. This process follows the following order: 1. MNLI 2. CoLA 3. RTE 4. QQP 5. MRPC 6.SST-2, which is the order from highest task difficulty to lowest task difficulty using EDM. As opposed to Curriculum Learning (Bengio et al., 2009), MT-Uncertainty dynamically prioritizes the most difficult tasks. As also discovered in MTL vision work (Guo et al., 2018), this type of prioritization on more difficult tasks may explain MT-Uncertainty’s improved performance over other task selection methods. In MTL, heuristics to balance tasks during training is typically done by weighting each task’s loss differently. We see here how MT-Uncertainty is able to prioritize task difficulty.
|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
Figure 8: Task composition of MT-Uncertainty sampling and estimated task difficulty using EDM: number of training samples per task at each iteration for batch size of 32. The occurrence of first peaks and estimated difficulty follow the same order: From highest to lowest: $\mathrm { M N L I } > \mathrm { C o L A } > \mathrm { R T E } > \mathrm { Q Q P } = \mathrm { M R P C } > \mathrm { S S T - 2 } .$
|
| 421 |
+
|
| 422 |
+
While the EDM difficulty measure is shown to correlate well with model performance, it lacks precision. As reported in Collins et al. (2018), the average score achieved on the Yahoo Answers dataset is $6 9 . 9 \%$ and its difficulty is 4.51. The average score achieved on Yelp Full is $5 6 . 8 \%$ , $1 3 . 1 \%$ less than Yahoo Answers and its difficulty is 4.42. The authors mention that “This indicates that the difficulty measure in its current incarnation may be more effective at assigning a class of difficulty to datasets, rather than a regression-like value”.
|
| 423 |
+
|
| 424 |
+
# A.3 OTHER RELATED WORK
|
| 425 |
+
|
| 426 |
+
Multi-Tasking in NLP and other fields. MTL weight sharing algorithms such as Mixture-of-Experts (MoE) have found success in NLP (Lepikhin et al., 2020). CA-MTL can complement MoE since the Transformers multi-headed attention can be seen as a form of MoE (Peng et al., 2020). In Vision, MTL can also improve with optimization (Sener & Koltun, 2018) or gradient-based approaches (Chen et al., 2017; Yu et al., 2020).
|
| 427 |
+
|
| 428 |
+
Active Learning, Task Selection and Sampling. Ikhwantri et al. (2018) examined multi-task active learning for neural semantic role labeling in a low resource setting, using entity recognition as the sole auxiliary task. They used uncertainty sampling for active learning and found that $12 \%$ less data could be used compared to passive learning. Reichart et al. (2008) has examined different active learning techniques for the two task annotation scenario, focusing on named entity recognition and syntactic parse tree annotations. In contrast, here we examine the larger scale data regime, the modularization of a multi-task neural architecture, and the many task $\left( \gg 2 \right)$ ) setting among other differences. Other than MTAL (Reichart et al., 2008; Ikhwantri et al., 2018), Kendall et al. (2017) leveraged model uncertainty to balance MTL losses but not to select tasks as is proposed here.
|
| 429 |
+
|
| 430 |
+
# A.4 ZERO-SHOT RESULTS ON SCITAIL AND SNLI
|
| 431 |
+
|
| 432 |
+
Before testing models on domain adaptation in section 4.4, we ran zero-shot evaluations on the development set of SciTail and SNLI. Table 8 outlines 8-task CA-MTLBERT-BASE’s zero-shot transfer abilities when pretrained on GLUE with our MTL approach. We expand the task embedding layer to accommodate an extra task and explore various embedding initialization. We found that reusing STS-B and MRPC task embeddings worked best for SciTail and SNLI respectively.
|
| 433 |
+
|
| 434 |
+
Table 8: CA-MTL is flexible and extensible to new tasks. However, CA-MTL is sensitive to the new task’s embedding. We tested multiple task embeddings that worked best on either SciTail or SNLI by checking performance in a zero shot setting or using $0 \%$ of the data.
|
| 435 |
+
|
| 436 |
+
<table><tr><td rowspan=1 colspan=1>Initializationof newtask embedding layer</td><td rowspan=1 colspan=1>SciTail0% of data</td><td rowspan=1 colspan=1>SNLI0% of data</td></tr><tr><td rowspan=12 colspan=1>CoLA'sembeddingsMNLI's embeddingsMRPC's embeddingsSTS-B's embeddingsSST-2's embeddingsQQP's embeddingsQNLI's embeddingsRTE's embeddingsWNLI's embeddingsAverageRandom initializationXavier initialization</td><td rowspan=1 colspan=1>43.0</td><td rowspan=1 colspan=1>34.0</td></tr><tr><td rowspan=1 colspan=1>24.2</td><td rowspan=1 colspan=1>33.0</td></tr><tr><td rowspan=1 colspan=1>34.5</td><td rowspan=1 colspan=1>45.5</td></tr><tr><td rowspan=1 colspan=1>46.9</td><td rowspan=1 colspan=1>33.2</td></tr><tr><td rowspan=1 colspan=1>25.8</td><td rowspan=1 colspan=1>34.2</td></tr><tr><td rowspan=1 colspan=1>31.7</td><td rowspan=2 colspan=1>37.338.0</td></tr><tr><td rowspan=1 colspan=1>32.0</td></tr><tr><td rowspan=1 colspan=1>32.3</td><td rowspan=3 colspan=1>40.630.437.7</td></tr><tr><td rowspan=1 colspan=1>29.0</td></tr><tr><td rowspan=1 colspan=1>28.7</td></tr><tr><td rowspan=1 colspan=1>46.8</td><td rowspan=1 colspan=1>34.0</td></tr><tr><td rowspan=1 colspan=1>29.8</td><td rowspan=1 colspan=1>37.6</td></tr></table>
|
| 437 |
+
|
| 438 |
+
# A.5 MORE EXPERIMENTAL DETAILS
|
| 439 |
+
|
| 440 |
+
We used a batch size of 32 and a seed of 12 in all experiments. We used Adam (Kingma & Ba, 2015) as the optimizer with a learning rate of 2e-5. We applied a learning rate decay with warm up over the first $10 \%$ of the training steps. Unless otherwise specified, we used 5 epochs, a seed of 12 and a sequence length of 128. Additional details are outlined in section . Our data prepossessing and linear decoder heads are the same as in Devlin et al. (2018). We used the same dropout rate of 0.1 in all layers. To run our experiments, we used either four NVIDIA P100 GPU for base models or four NVIDIA V100 GPU for larger ones. We did not perform parameter search. We do not use ensemble of models or task-specific tricks (Devlin et al., 2018; Liu et al., 2019b; Clark et al., 2019c). All models are either 12 Transformer layers for BASE and 24 Transformer layers for LARGE. Apart from CA-MTL, models trained in multi-task learning (BERT or RoBERTa without adapters) used random task sampling. For Table 1 and Figure 7, all BERT-based model have half their layers frozen (untrained) for a fair comparison of ablation results. For the 24-task MTL and CA-MTL models in Tables 4 and 5, we increased the input sequence length to 256 and used 8 epochs.
|
| 441 |
+
|
| 442 |
+
# A.6 THE DIRECT SUM OPERATOR
|
| 443 |
+
|
| 444 |
+
In section 2.1.1, we used the direct sum operator $\oplus$ . This operation allows us to create a block diagonal matrix. The direct sum of a matrix $A \in \mathbb { R } ^ { n \times m }$ and $\bar { \boldsymbol { B } } \in \mathbb { R } ^ { p \times q }$ results in a matrix of size $( m + p ) \times ( n + q )$ , defined as:
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
\mathbf { A } \oplus \mathbf { B } = { \left[ \begin{array} { l l } { \mathbf { A } } & { \mathbf { 0 } } \\ { \mathbf { 0 } } & { \mathbf { B } } \end{array} \right] } = { \left[ \begin{array} { l l l l l l } { a _ { 1 1 } } & { \cdots } & { a _ { 1 n } } & { 0 } & { \cdots } & { 0 } \\ { \vdots } & { \ddots } & { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { a _ { m 1 } } & { \cdots } & { a _ { m n } } & { 0 } & { \cdots } & { 0 } \\ { 0 } & { \cdots } & { 0 } & { b _ { 1 1 } } & { \cdots } & { b _ { 1 q } } \\ { \vdots } & { \ddots } & { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { \cdots } & { 0 } & { b _ { p 1 } } & { \cdots } & { b _ { p q } } \end{array} \right] }
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
# A.7 BASELINES AND OTHER EXPERIMENTAL RESULTS
|
| 451 |
+
|
| 452 |
+
In this section, we present our baseline results for BERT, RoBERTa, CA-MTL as well as other models. Our single task results (ST) that we ran ourselves surpass other paper’s reported scores in Table 9. Liu et al. (2019c) reports random seed median scores for RoBERTa. However, our RoBERTa ST baseline matches or surpasses the original paper’s scores 4 out 7 times on the development set when scores are comparable (QQP F1 and STS-B spearman are not reported).
|
| 453 |
+
|
| 454 |
+
Table 9: F1 scores are reported for QQP/MRPC, Spearman’s correlation for STS-B, accuracy on the matched/mismatch sets for MNLI, Matthew’s correlation for CoLA and accuracy for other tasks. ${ \mathrm { S T } } { = } { \mathrm { : } }$ Single Task, MTL $\vartriangle$ Multitask. $^ { * } \mathrm { Q N L I }$ v1 (we report v2) $^ { * * }$ score or Spearman’s correlation is not reported. $^ { \ast \ast \ast }$ Unknown random seeds. Results from: 1Stickland et al. (2019) 2Liu et al. (2019b) 3Phang et al. (2018) 4Liu et al. (2019c).
|
| 455 |
+
|
| 456 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Total params</td><td rowspan="2">Trained params/task</td><td colspan="9">GLUE</td></tr><tr><td>CoLA</td><td>MNLI</td><td>MRPC</td><td></td><td></td><td></td><td></td><td>QNLI QQP RTE SST-2 STS-B</td><td>Avg</td></tr><tr><td colspan="10">Base Models-Dev set Results</td></tr><tr><td>PALs+Anneal Samp.1</td><td>1.13×</td><td>12.5%</td><td></td><td></td><td></td><td>一</td><td>一</td><td>1</td><td>一</td><td></td><td>81.70</td></tr><tr><td>8-task CA-MTLBERT-BASE (Ours)</td><td>1.12×</td><td>5.6%</td><td>60.9</td><td>82.7/83.1</td><td>88.9</td><td>90.7</td><td></td><td>90.379.1</td><td>91.9</td><td>88.8</td><td>84.03</td></tr><tr><td colspan="10">BERTLARGEModels DevsetResults</td></tr><tr><td>STBERT-LARGE2</td><td>9×</td><td>100%</td><td>60.5</td><td>86.7/85.9</td><td>89.3</td><td>92.7*</td><td>89.3</td><td>70.1</td><td>94.9</td><td>86.5</td><td>84.0</td></tr><tr><td>ST BERT-LARGE</td><td>9×</td><td>100%</td><td>62.1</td><td>86.2/86.2</td><td>92.3</td><td>89.4</td><td>88.5</td><td>70.0</td><td>92.5</td><td>90.1</td><td>84.1</td></tr><tr><td>ST BERT-LARGE (ours)</td><td>9×</td><td>100%</td><td>63.6</td><td>86.5/86.0</td><td>91.4</td><td>91.0</td><td>88.5</td><td>70.2</td><td>94.7</td><td>88.2</td><td>84.5</td></tr><tr><td>24-task CA-MTLBERT-LARGE (Ours)</td><td>1.12×</td><td>5.6%</td><td>63.8</td><td>86.3/86.0</td><td>92.9</td><td>93.4</td><td>88.1</td><td>84.5</td><td>94.5</td><td>90.3</td><td>86.6</td></tr><tr><td colspan="10">RoBERTaLARGEModels-DevsetResults</td></tr><tr><td>RoBERTa-LARGE4</td><td>9×</td><td></td><td></td><td></td><td></td><td></td><td>**</td><td></td><td></td><td></td><td></td></tr><tr><td>(Median 5 runs)***</td><td></td><td>100%</td><td>68.0</td><td>90.2</td><td>90.9</td><td>94.7</td><td></td><td>86.6</td><td>96.4</td><td>**</td><td></td></tr><tr><td>STRoBERTa-LARGE(ours)</td><td>9× 1.12×</td><td>100%</td><td>68.3</td><td>89.2/88.9</td><td>92.6</td><td>94.8</td><td>84.6</td><td>87.0 88.8 91.0</td><td>96.4</td><td>91.7</td><td>88.2</td></tr><tr><td>24-task CA-MTLRoBERTa-LARGE (ours)</td><td></td><td>5.6%</td><td>69.7</td><td>89.4/89.3</td><td>93.9</td><td>94.9</td><td></td><td></td><td>96.2</td><td>91.0</td><td>89.4</td></tr></table>
|
| 457 |
+
|
| 458 |
+
A.8 SOME RESULTS ON LAYER FREEZING AND WITH FULL BLOCK ATTENTION.
|
| 459 |
+
|
| 460 |
+
All experiments in this section were run for only 5 epochs, exclusively on the GLUE dataset for the large BERT-based 8-task CA-MTL model. Results in Table 10 reveal that as we freeze more layers, performance tends to decrease. However, since we wanted to preserve as much pretrained knowledge as possible, we chose to keep at least $50 \%$ of layers frozen. While this has slightly lowered our performance on 9 GLUE tasks, we believe that keeping as much of the original pretrained weights is beneficial when increasing the total number of tasks in MTL to 24 or more tasks. However, we did not explore this hypothesis more.
|
| 461 |
+
|
| 462 |
+
Table 10: 8-task CA-MTLBERT-LARGE (see section 4.3) for various layer freezing configurations. F1 scores are reported for QQP/MRPC, Spearman’s correlation for STS-B, accuracy on the matched/mismatch sets for MNLI, Matthew’s correlation for CoLA and accuracy for other tasks. $\mathrm { F B A } = \mathrm { F u l l }$ Block Attention
|
| 463 |
+
|
| 464 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">%frozen layers</td><td rowspan="2">#tasks g.eST CoLA</td><td colspan="8">GLUE MRPC QNLI QQP RTE SST-2 STS-B Avg</td></tr><tr><td>MNLI</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="10">LARGEModels-Dev set Results</td></tr><tr><td>STBERT-LARGE (ours)</td><td>0%</td><td>一</td><td>63.6 86.5/86.0</td><td>91.4</td><td>91.0</td><td></td><td>88.570.2</td><td>93.1</td><td>88.2</td><td>84.3</td></tr><tr><td>CA-MTL</td><td>0%</td><td>7</td><td>60.2 86.2/86.0</td><td>92.0</td><td>91.5</td><td>88.7</td><td>76.3</td><td>93.3</td><td>89.5</td><td>84.9</td></tr><tr><td>CA-MTL</td><td>25%</td><td>6</td><td>63.7 86.1/85.8</td><td>89.1</td><td>91.2</td><td>88.6</td><td>79.7</td><td>92.9</td><td>88.5</td><td>85.1</td></tr><tr><td>CA-MTL</td><td>50%</td><td>3</td><td>63.2 85.5/85.5</td><td>91.8</td><td>90.9</td><td>88.3</td><td>81.4</td><td>93.0</td><td>90.1</td><td>85.5</td></tr><tr><td>CA-MTL FBA</td><td>50%</td><td>0</td><td>60.2 81.7/81.1</td><td>88.0</td><td>85.8</td><td></td><td>85.7 78.7</td><td>88.6</td><td>87.1</td><td>81.8</td></tr></table>
|
| 465 |
+
|
| 466 |
+
# A.9 DATASET DESCRIPTION
|
| 467 |
+
|
| 468 |
+
The datasets that were used for the domain adaptation experiments were SciTail5 and SNLI6. We jointly trained a CA-MTLRoBERTa-LARGE model on 9 GLUE tasks, 8 Super-GLUE7 tasks, 6 MRQA8 tasks, and on $\mathrm { W N U T 2 0 1 7 ^ { 9 } }$ (Derczynski et al., 2017).
|
| 469 |
+
|
| 470 |
+
All GLUE tasks are binary classification, except STS-B (regression) and MNLI (three classes). We used the same GLUE data preprocessing as in Devlin et al. (2018).
|
| 471 |
+
|
| 472 |
+
Table 11: GLUE (Wang et al., 2018) dataset description. References: 1Warstadt et al. (2018), 2Socher et al. (2013), 3Dolan & Brockett (2005), 4Cer et al. (2017), 5Williams et al. (2018), 6Wang et al. (2018), 7Levesque (2011)
|
| 473 |
+
|
| 474 |
+
<table><tr><td rowspan=1 colspan=1>Acronym</td><td rowspan=1 colspan=1>Corpus</td><td rowspan=1 colspan=1>Train</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>Domain</td></tr><tr><td rowspan=4 colspan=1>CoLA1SST-22MRPC3STS-B4QQPMNLI5RTE6WNLI7</td><td rowspan=4 colspan=1>Corpus of Linguistic AcceptabilityStanford Sentiment TreebankMicrosoft Research Paraphrase CorpusSemantic Textual Similarity BenchmarkQuora Question PairsMulti-Genre NLIRecognition Textual EntailmentWinograd NLI</td><td rowspan=1 colspan=2>8.5K67K3.7K</td><td rowspan=4 colspan=1>acceptabilitysentiment detectionparaphrase detectiontextual similarityparaphrase detectioninferenceinference/entailmentcoreference</td><td rowspan=4 colspan=1>miscellaneousmovie reviewsnewsmiscellaneousonline QAmiscellaneousnews,Wikipediafiction books</td></tr><tr><td rowspan=1 colspan=2>7K364K</td></tr><tr><td rowspan=1 colspan=2>393K</td></tr><tr><td rowspan=1 colspan=2>2.5K634</td></tr></table>
|
| 475 |
+
|
| 476 |
+
Table 12: Super-GLUE (Wang et al., 2019b) dataset description. References: 1Clark et al. (2019a), 2de Marneffe et al. (2019), 3Gordon et al. (2012), 4Khashabi et al. (2018), 5Zhang et al. (2018), 6Wang et al. (2019b), 7Poliak et al. (2018), 8Levesque (2011)
|
| 477 |
+
|
| 478 |
+
<table><tr><td>Acronym</td><td>Corpus</td><td>Train</td><td>Task</td><td>Domain</td></tr><tr><td>BoolQ1</td><td>Boolean Questions</td><td>9.4K</td><td>acceptability</td><td>Google queries,Wikipedia</td></tr><tr><td>CB² COPA3</td><td>CommitmentBank</td><td>250</td><td>sentiment detection</td><td>miscellaneous</td></tr><tr><td>MultiRC4</td><td>Choice of Plausible Alternatives Multi-Sentence Reading Comprehension</td><td>400 5.1K</td><td>paraphrase detection textual similarity</td><td>blogs,encyclopedia miscellaneous</td></tr><tr><td>ReCoRD5</td><td>Reading Comprehension</td><td>101K</td><td>paraphrase detection</td><td>news</td></tr><tr><td></td><td>and Commonsense Reasoning</td><td></td><td></td><td></td></tr><tr><td>RTE6 WiC7</td><td>Recognition Textual Entailment</td><td>2.5K 6K</td><td>inference</td><td>news,Wikipedia</td></tr><tr><td>WSC8</td><td>Word-in-Context</td><td>554</td><td>word sense disambiguation</td><td>WordNet,VerbNet</td></tr><tr><td></td><td>Winograd Schema Challenge</td><td></td><td>coreference resolution</td><td>fiction books</td></tr></table>
|
| 479 |
+
|
| 480 |
+
Table 13: MRQA (Fisch et al., 2019) dataset description. References: 1Rajpurkar et al. (2016a), 2Trischler et al. (2017), 3Joshi et al. (2017), 4Dunn et al. (2017), 5Yang et al. (2018), $^ 6 \mathrm { K }$ wiatkowski et al. (2019)
|
| 481 |
+
|
| 482 |
+
<table><tr><td>Acronym</td><td>Corpus</td><td>Train</td><td>Task</td><td>Domain</td></tr><tr><td>SQuAD1</td><td>Stanford QADataset</td><td>86.6K</td><td>crowdsourced questions</td><td>Wikipedia</td></tr><tr><td>NewsQA²</td><td>NewsQA</td><td>74.2K</td><td>crowdsourced questions</td><td>news</td></tr><tr><td>TriviaQA3</td><td>TriviaQA</td><td>61.7K</td><td>trivia QA</td><td>web snippets</td></tr><tr><td>SearchQA4</td><td>SearchQA</td><td>117.4K</td><td>Jeopardy QA</td><td>web snippets</td></tr><tr><td>HotpotQA5</td><td>HotpotQA</td><td>72.9K</td><td>crowdsourced questions</td><td>Wikipedia</td></tr><tr><td>Natural Questions6</td><td>Natural Questions</td><td>104.7K</td><td>search logs</td><td>Wikipedia</td></tr></table>
|
| 483 |
+
|
| 484 |
+
SuperGLUE has a more diverse task format than GLUE, which is mostly limited to sentence and sentence-pair classification. We follow the same preprocessing procedure as in Wang et al. (2019b). All tasks are binary classification tasks, except CB (three classes). Also, WiC and WSC are span based classification tasks. We used the same modified MRQA dataset and preprocessing steps that were used in Joshi et al. (2019). All MRQA tasks are span prediction tasks which seeks to identify start and end tokens of an answer span in the input text.
|
| 485 |
+
|
| 486 |
+
Table 14: SNLI (Bowman et al., 2015) and SciTail (Khot et al., 2018) datasets description.
|
| 487 |
+
|
| 488 |
+
<table><tr><td>Acronym Corpus</td><td></td><td>|Train]</td><td>Task</td><td>Domain</td></tr><tr><td>SNLIT</td><td>Stanford Natural Language Inference</td><td>550.2k</td><td>inference</td><td>human-written English sentence pairs</td></tr><tr><td>SciTail²</td><td>Science and Entailment</td><td>23.5K</td><td>entailment</td><td>Science question answering</td></tr></table>
|
| 489 |
+
|
| 490 |
+
SNLI is a natural inference task where we predict three classes. Examples of three target labels are: Entailment, Contradiction, and Neutral (irrelevant). SciTail is a textual entailment dataset. The hypotheses in SciTail are created from multiple-choice science exams and the answer candidates (premise) are extracted from the web using information retrieval tools. SciTail is a binary true/false classification tasks that seeks to predict whether the premise entails the hypothesis. The two datasets are used only for domain adaptation in this study (see section A.4 for the details of our approach).
|
md/train/fUxqIofPPi/fUxqIofPPi.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Projected GANs Converge Faster
|
| 2 |
+
|
| 3 |
+
Axel Sauer1,2 Kashyap Chitta1,2 Jens Müller3 Andreas Geiger1,2 1University of Tübingen 2Max Planck Institute for Intelligent Systems, Tübingen 3Computer Vision and Learning Lab, University Heidelberg 2{firstname.lastname}@tue.mpg.de 3{firstname.lastname}@iwr.uni-heidelberg.de
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Generative Adversarial Networks (GANs) produce high-quality images but are challenging to train. They need careful regularization, vast amounts of compute, and expensive hyper-parameter sweeps. We make significant headway on these issues by projecting generated and real samples into a fixed, pretrained feature space. Motivated by the finding that the discriminator cannot fully exploit features from deeper layers of the pretrained model, we propose a more effective strategy that mixes features across channels and resolutions. Our Projected GAN improves image quality, sample efficiency, and convergence speed. It is further compatible with resolutions of up to one Megapixel and advances the state-of-the-art Fréchet Inception Distance (FID) on twenty-two benchmark datasets. Importantly, Projected GANs match the previously lowest FIDs up to 40 times faster, cutting the wall-clock time from 5 days to less than 3 hours given the same computational resources.
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
Figure 1: Convergence with Projected GANs. Evolution of samples for a fixed latent code during training on the AFHQ-Dog dataset [5]. We find that discriminating features in the projected feature space speeds up convergence and yields lower FIDs. This finding is consistent across many datasets.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
A Generative Adversarial Network (GAN) consists of a generator and a discriminator. For image synthesis, the generator’s task is to generate an RGB image; the discriminator aims to distinguish real from fake samples. On closer inspection, the discriminator’s task is two-fold: First, it projects the real and fake samples into a meaningful space, i.e., it learns a representation of the input space. Second, it discriminates based on this representation. Unfortunately, training the discriminator jointly with the generator is a notoriously hard task. While discriminator regularization techniques help to balance the adversarial game [31], standard regularization methods like gradient penalties [36] are susceptible to hyperparameter choices [26] and can lead to a substantial decrease in performance [4].
|
| 15 |
+
|
| 16 |
+
In this paper, we explore the utility of pretrained representations to improve and stabilize GAN training. Using pretrained representations has become ubiquitous in computer vision [29, 30, 48] and natural language processing [18, 45, 47]. While combining pretrained perceptual networks [58] with GANs for image-to-image translation has led to impressive results [14, 49, 59, 64], this idea has not yet materialized for unconditional noise-to-image synthesis. Indeed, we confirm that a naïve application of this idea does not lead to state-of-the-art results (Section 4) as strong pretrained features enable the discriminator to dominate the two-player game, resulting in vanishing gradients for the generator [2]. In this work, we demonstrate how these challenges can be overcome and identify two key components for exploiting the full potential of pretrained perceptual feature spaces for GAN training: feature pyramids to enable multi-scale feedback with multiple discriminators and random projections to better utilize deeper layers of the pretrained network.
|
| 17 |
+
|
| 18 |
+
We conduct extensive experiments on small and large datasets with a resolution of up to $1 0 2 4 ^ { 2 }$ pixels. Across all datasets, we demonstrate state-of-the-art image synthesis results at significantly reduced training time (Fig. 1). We also find that Projected GANs increase data efficiency and avoid the need for additional regularization, rendering expensive hyperparameter sweeps unnecessary. Code, models, and supplementary videos can be found on the project page https://sites.google.com/view/ projected-gan.
|
| 19 |
+
|
| 20 |
+
# 2 Related Work
|
| 21 |
+
|
| 22 |
+
We categorize related work into two main areas: pretraining for GANs and discriminator design.
|
| 23 |
+
|
| 24 |
+
Pretrained Models for GAN Training. Work on leveraging pretrained representations for GANs can be divided into two categories: First, transferring parts of a GAN to a new dataset [15, 38, 65, 71] and, second, using pretrained models to control and improve GANs. The latter is advantageous as pretraining does not need to be adversarial. Our work falls into this second category. Pretrained models can be used as a guiding mechanism to disentangle causal generative factors [54], for text-driven image manipulation [44], matching the generator activations to inverted classifiers [19, 56], or to generate images via gradient ascent in the latent space of a generator [41]. The non-adversarial approach of [53] learns generative models with moment matching in pretrained models; however, the results remain far from competitive to standard GANs. An established method is the combination of adversarial and perceptual losses [21]. Commonly, the losses are combined additively [10, 14, 32, 52, 64]. Additive combination, however, is only possible if a reconstruction target is available, e.g., in paired image-toimage translation settings [74]. Instead of providing the pretrained network with a reconstruction target, Sungatullina et al. [59] propose to optimize an adversarial loss on frozen VGG features [58]. They show that their approach improves CycleGAN [74] on image translation tasks. In a similar vein, [49] recently proposed a different perceptual discriminator. They utilize a pretrained VGG and connect its features with the prediction of a pretrained segmentation network. The combined features are fed into multiple discriminators at different scales. The two last approaches are specific to the image-toimage translation task. We demonstrate that these methods do not work well for the more challenging unconditional setting where the entire image content is synthesized from a random latent code.
|
| 25 |
+
|
| 26 |
+
Discriminator Design. Much work on GANs focuses on novel generator architectures [4, 26, 27, 69], while the discriminator often remains close to a vanilla convolutional neural network or mirrors the generator. Notable exceptions are [55,70] which utilize an encoder-decoder discriminator architecture. However, in contrast to us, they neither use pretrained features nor random projections. A different line of work considers a setup with multiple discriminators, applied to either the generated RGB image [8, 13] or low-dimensional projections thereof [1, 40]. The use of several discriminators promises improved sample diversity, training speed, and training stability. However, these approaches are not utilized in current state-of-the-art systems because of diminishing returns compared to the increased computational effort. Providing multi-scale feedback with one or multiple discriminators has been helpful for both image synthesis [23, 24] and image-to-image translation [43, 64]. While these works interpolate the RGB image at different resolutions, our findings indicate the importance of multi-scale feature maps, showing parallels to the success of pyramid networks for object detection [34]. Lastly, to prevent overfitting of the discriminator, differentiable augmentation methods have recently been proposed [25, 63, 72, 73]. We find that adopting these strategies helps exploit the full potential of pretrained representations for GAN training.
|
| 27 |
+
|
| 28 |
+
# 3 Projected GANs
|
| 29 |
+
|
| 30 |
+
GANs aim to model the distribution of a given training dataset. A generator $G$ maps latent vectors $\mathbf { z }$ sampled from a simple distribution $\mathbb { P } _ { \mathbf { z } }$ (typically a normal distribution) to corresponding generated samples $G ( \mathbf { z } )$ . The discriminator $D$ then aims to distinguish real samples $\mathbf { x } \sim \mathbb { P } _ { \mathbf { x } }$ from the generated samples $G ( \mathbf { z } ) \sim \mathbb { P } _ { G ( \mathbf { z } ) }$ . This basic idea results in the following minimax objective
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \Big ( \mathbb { E } _ { \mathbf { x } } [ \log D ( \mathbf { x } ) ] + \mathbb { E } _ { \mathbf { z } } [ \log ( 1 - D ( G ( \mathbf { z } ) ) ) ] \Big )
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
We introduce a set of feature projectors $\{ P _ { l } \}$ which map real and generated images to the discriminator’s input space. Projected GAN training can thus be formulated as follows
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\underset { G } { \mathrm { m i n } } \underset { \{ D _ { l } \} } { \mathrm { m a x } } \sum _ { l \in \mathcal { L } } \left( \mathbb { E } _ { \mathbf { x } } [ \log D _ { l } ( P _ { l } ( \mathbf { x } ) ) ] + \mathbb { E } _ { \mathbf { z } } [ \log ( 1 - D _ { l } ( P _ { l } ( G ( \mathbf { z } ) ) ) ) ] \right)
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $\{ D _ { l } \}$ is a set of independent discriminators operating on different feature projections. Note that we keep $\{ P _ { l } \}$ fixed in (2) and only optimize the parameters of $G$ and $\{ D _ { l } \}$ . The feature projectors $\{ P _ { l } \}$ should satisfy two necessary conditions: they should be differentiable and provide sufficient statistics of their inputs, i.e., they should preserve important information. Moreover, we aim to find feature projectors $\{ P _ { l } \}$ which turn the (difficult to optimize) objective in (1) into an objective more amenable to gradient-based optimization. We now show that a projected GAN indeed matches the distribution in the projected feature space, before specifying the details of our feature projectors.
|
| 43 |
+
|
| 44 |
+
# 3.1 Consistency
|
| 45 |
+
|
| 46 |
+
The projected GAN objective in (2) no longer optimizes directly to match the true distribution $\mathbb { P } _ { T }$ . To understand the training properties under ideal conditions, we consider a more generalized form of the consistency theorem of [40]:
|
| 47 |
+
|
| 48 |
+
Theorem 1. Let $\mathbb { P } _ { T }$ denote the density of the true data distribution and $\mathbb { P } _ { G }$ the density of the distribution the Generator $G$ produces. Let $P _ { l } \circ T$ and $P _ { l } \circ G$ be the functional composition of the differentiable and fixed function $P _ { l }$ and the true/generated data distribution, and y be the transformed input to the discriminator. For a fixed $G$ , the optimal discriminators are given by
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
D _ { l , G } ^ { * } ( \mathbf { y } ) = \frac { \mathbb { P } _ { P _ { l } \circ T } ( \mathbf { y } ) } { \mathbb { P } _ { P _ { l } \circ T } ( \mathbf { y } ) + \mathbb { P } _ { P _ { l } \circ G } ( \mathbf { y } ) }
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
for all $l \in \mathcal L$ . In this case, the optimal $G$ under (2) is achieved iff $\mathbb { P } _ { P _ { l } \circ T } = \mathbb { P } _ { P _ { l } \circ G }$ for all $l \in \mathcal L$
|
| 55 |
+
|
| 56 |
+
A proof of the theorem is provided in the appendix. From the theorem, we conclude that a feature projector $P _ { l }$ with its associated discriminator $D _ { l }$ encourages the generator to match the true distribution along the marginal through $P _ { l }$ . Therefore, at convergence, $G$ matches the generated and true distributions in feature space. The theorem also holds when using stochastic data augmentations [25] before the deterministic projections $P _ { l }$ .
|
| 57 |
+
|
| 58 |
+
# 3.2 Model Overview
|
| 59 |
+
|
| 60 |
+
Projecting to and training in pretrained feature spaces opens up a realm of new questions which we address below. This section will provide an overview of the general system and is followed by extensive ablations of each design choice. As our feature projections affect the discriminator, we focus on $P _ { l }$ and $D _ { l }$ in this section and postpone the discussion of generator architectures to Section 5.
|
| 61 |
+
|
| 62 |
+
Multi-Scale Discriminators. We obtain features from four layers $L _ { l }$ of a pretrained feature network $F$ at resolutions $( L _ { 1 } = 6 4 ^ { 2 } , L _ { 2 } = 3 2 ^ { 2 } , L _ { 3 } = 1 6 ^ { 2 } , L _ { 4 } = 8 ^ { 2 } )$ . We associate a separate discriminator $D _ { l }$ with the features at layer $L _ { l }$ , respectively. Each discriminator $D _ { l }$ uses a simple convolutional architecture with spectral normalization [37] at each convolutional layer. We observe better performance if all discriminators output logits at the same resolution $( 4 ^ { 2 } )$ . Accordingly, we use fewer down-sampling blocks for lower resolution inputs. Following common practice, we sum all logits for computing the overall loss. For the generator pass, we sum the losses of all discriminators. More complex strategies [1, 13] did not improve performance in our experiments.
|
| 63 |
+
|
| 64 |
+
Random Projections. We observe that features at deeper layers are significantly harder to cover, as evidenced by our experiments in Section 4. We hypothesize that a discriminator can focus on a subset of the feature space while wholly disregarding other parts. This problem might be especially prominent in the deeper, more semantic layers. Therefore, we propose two different strategies to dilute prominent features, encouraging the discriminator to utilize all available information equally. Common to both strategies is that they mix features using differentiable random projections which are fixed, i.e., after random initialization, the parameters of these layers are not trained.
|
| 65 |
+
|
| 66 |
+
Cross-Channel Mixing (CCM). Empirically, we found two properties to be desirable: (i) the random projection should be information preserving to leverage the full representational power of $F$ , and (ii) it should not be trivially invertible. The easiest way to mix across channels is a $1 \times 1$ convolution. A $1 \times 1$ convolution with an equal number of output and input channels is a generalization of a permutation [28] and consequently preserves information about its input. In practice, we find that more output channels lead to better performance as the mapping remains injective and therefore information preserving. Kingma et al. [28] initialize their convolutional layers as a random rotation matrix as a good starting point for optimization. We do not find this to improve GAN performance (see Appendix), arguably since it violates (ii). We therefore randomly initialize the weights of the convolutional layer via Kaiming initialization [16]. Note that we do not add any activation functions. We apply this random projection at each of the four scales and feed the transformed feature to the discriminator as depicted in Fig. 2.
|
| 67 |
+
|
| 68 |
+
Cross-Scale Mixing (CSM). To encourage feature mixing across scales, CSM extends CCM with random $3 \times 3$ convolutions and bilinear upsampling, yielding a U-Net [50] architecture, see Fig. 3. However, our CSM block is simpler than a vanilla U-Net [50]: we only use a single convolutional layer at each scale. As for CCM, we utilize Kaiming initialization for all weights.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
|
| 72 |
+
Pretrained Feature Networks. We ablate over varying feature networks. First, we investigate different versions of EfficientNets, which allow for direct control over model size versus performance. EfficientNets are image classification models trained on ImageNet [7] and designed to provide favorable accuracy-compute tradeoffs. Second, we use ResNets of varying sizes. To analyze the dependency on ImageNet features (Section 4.3), we also consider R50-CLIP [46], a ResNet optimized with a contrastive language-image objective on a dataset of 400 million (image, text) pairs. Lastly, we utilize a vision transformer architecture (ViTBase) [9] and its efficient follow-up (DeiT-small distilled) [62]. We do not choose an inception network [60] to avoid strong correlations with the evaluation metric FID [17]. In the appendix, we also evaluate several other neural and non-neural metrics to rule out correlations. These additional metrics reflect the rankings obtained by FID.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 2: CCM (dashed blue arrows) employs $1 \times 1$ convolutions with random weights.
|
| 76 |
+
Figure 3: CSM (dashed red arrows) adds random $3 \times 3$ convolutions and bilinear upsampling, yielding a U-Network.
|
| 77 |
+
|
| 78 |
+
In the following, we conduct a systematic ablation study to analyze the importance and best configuration of each component in our Projected GAN model, before comparing it to the state-of-the-art.
|
| 79 |
+
|
| 80 |
+
# 4 Ablation Study
|
| 81 |
+
|
| 82 |
+
To determine the best configuration of discriminators, mixing strategy, and pretrained feature network, we conduct experiments on LSUN-Church [67], which is medium-sized (126k images) and reasonably visually complex, using a resolution of $2 5 6 ^ { 2 }$ pixels. For the generator $G$ we use the generator architecture of FastGAN [35], consisting of several upsampling blocks, with additional skip-layerexcitation blocks. Using a hinge loss [33], we train with a batch size of 64 until 1 million real images have been shown to the discriminator, a sufficient amount for $G$ to reach values close to convergence. If not specified otherwise, we use an EfficientNet-Lite1 [61] feature network in this section. We found that discriminator augmentation [25, 63, 72, 73] consistently improves the performance of all methods, and is required to reach state-of-the-art performance. We leverage differentiable data-augmentation [72] which we found to yield the best results in combination with the FastGAN generator.
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Discriminator(s)</td><td>rel-FD1↓</td><td>rel-FD2↓</td><td>rel-FD3↓</td><td></td><td>rel-FD4↓rel-FID↓</td></tr><tr><td colspan="6">No Projection</td></tr><tr><td>onL1</td><td>0.56</td><td>0.32</td><td>0.31</td><td>0.55</td><td>0.66</td></tr><tr><td>on Li,L2</td><td>0.35</td><td>0.21</td><td>0.23</td><td>0.47</td><td>0.53</td></tr><tr><td>on L1,L2,L3</td><td>0.42</td><td>0.26</td><td>0.28</td><td>0.64</td><td>0.90</td></tr><tr><td>On L1,L2,L3,L4</td><td>0.46</td><td>0.34</td><td>0.38</td><td>0.79</td><td>1.15</td></tr><tr><td>on L2,L3,L4</td><td>0.95</td><td>0.67</td><td>0.71</td><td>1.19</td><td>1.99</td></tr><tr><td>onL3,L4</td><td>2.14</td><td>1.41</td><td>1.18</td><td>1.99</td><td>3.46</td></tr><tr><td>onL4</td><td>10.92</td><td>5.74</td><td>2.56</td><td>2.79</td><td>5.08</td></tr><tr><td>Perceptual D</td><td>2.98</td><td>1.76</td><td>1.20</td><td>1.89</td><td>2.73</td></tr><tr><td colspan="6">CCM</td></tr><tr><td>on L1</td><td>0.27</td><td>0.21</td><td>0.26</td><td>0.50</td><td>0.59</td></tr><tr><td>on L1,L2</td><td>0.27</td><td>0.18</td><td>0.21</td><td>0.41</td><td>0.48</td></tr><tr><td>on L1,L2,L3</td><td>0.31</td><td>0.25</td><td>0.24</td><td>0.54</td><td>0.67</td></tr><tr><td>on L1,L2,L3,L4</td><td>0.53</td><td>0.34</td><td>0.34</td><td>0.59</td><td>0.77</td></tr><tr><td>Perceptual D</td><td>5.33</td><td>3.06</td><td>2.14</td><td>1.09</td><td>4.77</td></tr><tr><td colspan="6">CCM + CSM</td></tr><tr><td>onL1</td><td>0.34</td><td>0.25</td><td>0.19</td><td>0.35</td><td>0.44</td></tr><tr><td>on L1,L2</td><td>0.21</td><td>0.18</td><td>0.16</td><td>0.27</td><td>0.31</td></tr><tr><td>on Li,L2,L3</td><td>0.41</td><td>0.26</td><td>0.17</td><td>0.23</td><td>0.29</td></tr><tr><td>on L1,L2,L3,L4</td><td>0.26</td><td>0.16</td><td>0.13</td><td>0.16</td><td>0.24</td></tr><tr><td>Perceptual D</td><td>2.53</td><td>1.37</td><td>0.89</td><td>0.43</td><td>2.13</td></tr></table>
|
| 85 |
+
|
| 86 |
+
Table 1: Feature Space Fréchet Distances. We aim to find the best combination of discriminators and random projections to fit the distributions in feature network $F$ . We show the relative FD at different layers of $F$ $( r e l – F D _ { i } )$ between $5 0 \mathrm { k }$ generated and real images on LSUN-Church. rel- $F D _ { i }$ is normalized using the baseline Fréchet Distances for a model with a standard single RGB image discriminator. Hence, values $> 1$ indicate worse performance than the RGB baseline. We report rel- $. F D$ for four layers of an EfficientNet $( L _ { 1 } , L _ { 2 } , L _ { 3 }$ and $L _ { 4 }$ from shallow to deep), as well as relative Fréchet Inception Distance (FID) [17]. Note that $r e l – F D _ { i }$ should not be compared between different feature spaces, i.e., only within-column comparisons are meaningful. Blue boxes highlight the layers which we supervise via independent discriminators. The green box corresponds to a perceptual discriminator [59], which takes in all feature maps at once.
|
| 87 |
+
|
| 88 |
+
# 4.1 Which feature network layers are most informative?
|
| 89 |
+
|
| 90 |
+
We first investigate the relevance of independent multi-scale discriminators. For this experiment, we do not use feature mixing. To measure how well $G$ fits a particular feature space, we employ the Fréchet Distance (FD) [12] on the spatially pooled features denoted as $F D _ { i }$ for layer $i$ . FDs across different feature spaces are not directly comparable. Therefore, we train a GAN baseline with a standard RGB discriminator, record $F \bar { D _ { i } ^ { R G B } }$ at each layer and quantify the relative improvement via the fraction rel- $F D _ { i } = F D _ { i } / F D _ { i } ^ { R G B }$ . We also investigate a perceptual discriminator [59], where feature maps are fed into different layers of the same discriminator to predict a single logit.
|
| 91 |
+
|
| 92 |
+
The results in Table 1 (No Projection) show that two discriminators are better than one and improve over the vanilla RGB baseline. Surprisingly, adding discriminators at deep layers hurts performance. We conclude that these more semantic features do not respond well to direct adversarial losses. We also experimented with discriminators at resized versions of the original image, but could not find a setting of hyperparameters and architectures that improves over the single image baseline. Omitting the discriminators on the shallow features decreases performance, which is anticipated, as these layers contain most of the information about the original image. A similar effect has been observed for feature inversion [11] – the deeper the layer, the harder it is to reconstruct its input. Lastly, we observe that independent discriminators outperform the perceptual discriminator by a significant margin.
|
| 93 |
+
|
| 94 |
+
<table><tr><td rowspan="2"></td><td colspan="5">EfficientNet</td><td colspan="3">ResNet</td><td colspan="2">Transformer</td></tr><tr><td>lite0</td><td>lite1</td><td>lite2</td><td>lite3</td><td>lite4</td><td>R18</td><td>R50</td><td>R50-CLIP</td><td>DeiT</td><td>ViT</td></tr><tr><td>Params (M)↓</td><td>2.96</td><td>3.72</td><td>4.36</td><td>6.42</td><td>11.15</td><td>11.18</td><td>23.51</td><td>23.53</td><td>92.36</td><td>317.52</td></tr><tr><td>IN top-1个</td><td>75.48</td><td>76.64</td><td>77.47</td><td>79.82</td><td>81.54</td><td>69.75</td><td>79.04</td><td>N/A</td><td>85.42</td><td>85.16</td></tr><tr><td>FID↓</td><td>2.53</td><td>1.65</td><td>1.69</td><td>1.79</td><td>2.35</td><td>4.16</td><td>4.40</td><td>3.80</td><td>2.46</td><td>12.38</td></tr></table>
|
| 95 |
+
|
| 96 |
+
Table 2: Pretrained Feature Networks Study. We train the projected GAN with different pretrained feature networks. We find that compact EfficientNets outperform both ResNets and Transformers.
|
| 97 |
+
|
| 98 |
+
# 4.2 How can we best utilize the pretrained features?
|
| 99 |
+
|
| 100 |
+
Given the insights from the previous section, we aim to improve the utilization of deep features. For this experiment, we only investigate configurations that include discriminators at high resolutions. Table 1 (CCM and $\mathbf { C C M } + \mathbf { C S M } )$ presents the results for both mixing strategies. CCM moderately decreases the FDs across all settings, confirming our hypothesis that mixing channels results in better feedback for the generator. When adding CSM, we achieve another notable improvement across all configurations. Especially rel- $F D _ { i }$ at deeper layers are significantly decreased, demonstrating CSM’s usefulness to leverage deep semantic features. Interestingly, we observe that the best performance is now obtained by combining all four discriminators. A perceptual discriminator is again inferior to multiple discriminators. We remark that integrating the original image, via an independent discriminator or CCM or CSM always resulted in worse performance. This failure suggests that naïvely combining non-projected with projected adversarial optimization impairs training dynamics.
|
| 101 |
+
|
| 102 |
+
# 4.3 Which feature network architecture is most effective?
|
| 103 |
+
|
| 104 |
+
Using the best setting determined by the experiments above $\mathbf { \mathrm { C C M } } + \mathbf { \mathrm { C S M } }$ with four discriminators), we study the effectiveness of various perceptual feature network architectures for Projected GAN training. To ensure convergence, also for larger architectures, we train for 10 million images. Table 2 reports the FIDs achieved on LSUN-Church. Surprisingly, we find that there is no correlation with ImageNet accuracy. On the contrary, we observe lower FIDs for smaller models (e.g., EfficientNetslite). This observation indicates that a more compact representation is beneficial while at the same time reducing computational overhead and consequently training time. R50-CLIP slightly outperforms its R50 counterpart, indicating that ImageNet features are not required to achieve low FID. For the sake of completeness, we also train with randomly initialized feature networks, which, however, converge to much higher FID values (see Appendix). In the following, we thus use EfficientNet-Lite1 as our feature network.
|
| 105 |
+
|
| 106 |
+
# 5 Comparison to State-of-the-Art
|
| 107 |
+
|
| 108 |
+
This section conducts a comprehensive analysis demonstrating the advantages of Projected GANs with respect to state-of-the-art models. Our experiments are structured into three sections: evaluation of convergence speed and data efficiency (5.1), and comparisons on large (5.2) and small (5.3) benchmark datasets. We cover a wide variety of datasets in terms of size (hundreds to millions of samples), resolution $2 5 6 ^ { 2 }$ to $1 0 2 4 ^ { 2 }$ ), and visual complexity (clip-art, paintings, and photographs).
|
| 109 |
+
|
| 110 |
+
Evaluation Protocol. We measure image quality using the Fréchet Inception Distance (FID) [17]. Following [26, 27], we report the FID between 50k generated and all real images. We select the snapshot with the best FID for each method. In addition to image quality, we include a metric to evaluate convergence. As in [25], we measure training progress based on the number of real images shown to the discriminator (Imgs). We report the number of images required by the model for the FID to reach values within $5 \%$ of the best FID over training. In the appendix, we also report other metrics that are less benchmarked in GAN literature: KID [3], SwAV-FID [39], precision and recall [51]. Unless otherwise specified, we follow the evaluation protocol of [20] to facilitate fair comparisons. Specifically, we compare all approaches given the same fixed number of images (10 million). With this setting, each experiment takes roughly 100-200 GPU hours on a NVIDIA V100, for more details we refer to the appendix.
|
| 111 |
+
|
| 112 |
+
Baselines. We use StyleGAN2-ADA [25] and FastGAN [35] as baselines. StyleGAN2-ADA is the strongest model on most datasets in terms of sample quality, whereas FastGAN excels in training speed. We implement these baselines and our Projected GANs within the codebase provided by the authors of StyleGAN2-ADA [25]. For each model, we ran two kinds of data augmentation:
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 4: Training Properties. Left: Projected FastGAN surpasses the best FID of StyleGAN2 (at $\mathbf { 8 8 \ M }$ images) after just $1 . 1 \textbf { M }$ images on LSUN-Church. Right: Projected FastGAN yields significantly improved FID scores, even when using subsets of CLEVR with 1k and $1 0 \mathrm { k }$ samples.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 5: Training progress on LSUN church at $2 5 6 ^ { 2 }$ pixels. Shown are samples for a fixed noise vector z over k images. From top to bottom: FastGAN, StyleGAN2-ADA, Projected GAN.
|
| 119 |
+
|
| 120 |
+
differentiable data-augmentation [72] and adaptive discriminator augmentation [25]. We select the better performing augmentation strategy per model. For all baselines and datasets, we perform data amplification through $\mathbf { X }$ -flips. Projected GANs use the same generator and discriminator architecture and training hyperparameters (learning rate and batch size) for all experiments. For high-resolution image generation, additional upsampling blocks are included in the generator to match the desired output resolution. We carefully tune all hyper-parameters for both baselines for best results: we find that FastGAN is sensitive to the choice of batch size, and StyleGAN2-ADA to the learning rate and R1 penalty. The appendix documents additional implementation details used in each of our experiments.
|
| 121 |
+
|
| 122 |
+
# 5.1 Convergence Speed and Data Efficiency
|
| 123 |
+
|
| 124 |
+
Following [20] and [68], we analyze the training properties of Projected GANs on LSUN-Church at an image resolution of $2 5 6 ^ { 2 }$ pixels and on the 70k CLEVR dataset [22]. In this section, we also train longer than $1 0 \mathbf { M }$ images if necessary, as we are interested in convergence properties.
|
| 125 |
+
|
| 126 |
+
Convergence Speed. We apply projected GAN training for both the style-based generator of StyleGAN2 and the standard generator with a single input noise vector of FastGAN. As shown in Fig. 4 (left), FastGAN converges quickly but saturates at a high FID. StyleGAN2 converges more slowly $\mathbf { \delta } ^ { \mathrm { 8 8 \mathbf { \delta } M } }$ images) but reaches a lower FID. Projected GAN training improves both generators. Particularly for FastGAN, improvements in both convergence speed and final FID are significant while improvements for StyleGAN2 are less pronounced. Remarkably, Projected FastGAN reaches the previously best FID of StyleGAN2 after experiencing only $1 . 1 \mathbf { M }$ images as compared to $\mathbf { 8 8 M }$ of StyleGAN2. In wall clock time, this corresponds to less than 3 hours instead of 5 days. Hence, from now on, we utilize the FastGAN generator and refer to this model simply as Projected GAN.
|
| 127 |
+
|
| 128 |
+
Fig. 5 shows samples for a fixed noise vector z during training on LSUN-Church. For both FastGAN and StyleGAN, patches of texture gradually morph into a global structure. For Projected GAN, we directly observe the emergence of structure which becomes more detailed over time. Interestingly, the Projected GAN latent space appears to be very volatile, i.e., for fixed $\mathbf { z }$ the images undergo significant perceptual changes during training. In the non-projected cases, these changes are more gradual. We hypothesize that this induced volatility might be due to the discriminator providing more semantic feedback compared to conventional RGB losses. Such semantic feedback could introduce more stochasticity during training which in turn improves convergence and performance. We also observed that the signed real logits of the discriminator remain at the same level throughout training (see Appendix). Stable signed logits indicate that the discriminator does not suffer from overfitting.
|
| 129 |
+
|
| 130 |
+
Sample Efficiency. The use of pretrained models is generally linked to improved sample efficiency. To evaluate this property, we also created two subsets of the 70k CLEVR dataset by randomly subsampling $1 0 \mathrm { k }$ and 1k images from it, respectively. As depicted in Fig. 4 (right), our Projected GAN significantly improves over both baselines across all dataset splits.
|
| 131 |
+
|
| 132 |
+
# 5.2 Large Datasets
|
| 133 |
+
|
| 134 |
+
Besides CLEVR and LSUN-Church, we benchmark Projected GANs against various state-of-the-art models on three other large datasets: LSUN-Bedroom [67] (3M indoor bedroom scenes), FFHQ [26] $7 0 \mathrm { k }$ images of faces) and Cityscapes [6] ( $2 5 \mathrm { k }$ driving scenes captured from a vehicle). For all datasets, we use an image resolution of $2 5 6 ^ { 2 }$ pixels. As Cityscapes and CLEVR images are not of aspect ratio 1:1 we resize them to $2 5 6 ^ { 2 }$ for training. Besides StyleGAN2-ADA and FastGAN, we compare against SAGAN [69] and GANsformers [20]. All models were trained for $1 0 \mathbf { M }$ images. For the large datasets, we also report numbers for StyleGAN2 trained for more than $1 0 \mathbf { M }$ images to report the lowest FID values achieved in previous literature (denoted as StyleGAN2\*). In the appendix, we report results on nine more large datasets.
|
| 135 |
+
|
| 136 |
+
Table 3 shows that the Projected GAN outperforms all state-of-the-art models in terms of FID values on all datasets by a large margin. For example, on LSUN-Bedroom, it achieves an FID value of 1.52 compared to 6.15 by GANsformer, the previously best model in this setting. Projected GAN achieves state-of-the-art FID values remarkably fast, e.g., on LSUN-church, it achieves an FID value of 3.18 after 1.1 M Imgs. StyleGAN2 has obtained the previously lowest FID value of 3.39 after 88 M Imgs, 80 times as many as needed by Projected GAN. Similar speed-ups are also realized for all other large datasets as shown in Table 3. Interestingly, when training longer on FFHQ (39 M Imgs), we observe further improvements of Projected GAN to an FID of 2.2. Note that all five datasets represent very different objects in various scenes. This demonstrates that the performance gain is robust to the choice of the dataset, although the feature network is trained only on ImageNet. It is important to note that the main improvements are based on improved sample diversity as indicated by recall which we report in the appendix. The improvement in diversity is most notable on large datasets, e.g., LSUN church, where the image fidelity appears to be similar to StyleGAN.
|
| 137 |
+
|
| 138 |
+
# 5.3 Small Datasets
|
| 139 |
+
|
| 140 |
+
To further evaluate our method in the few-shot setting, we compare against StyleGAN2-ADA and FastGAN on art paintings from WikiArt (1000 images; wikiart.org), Oxford Flowers (1360 images) [42], photographs of landscapes (4319 images; flickr.com), AnimalFace-Dog (389 images) [57] and Pokemon (833 images; pokemon.com). Further, we report results on high-resolution versions of Pokemon and Art-Painting $( 1 0 2 4 ^ { 2 } )$ . Lastly, we evaluate on AFHQ-Cat, -Dog and -Wild at $5 1 2 ^ { 2 }$ [5]. The AFHQ datasets contain ${ \sim } 5 \mathrm { k }$ closeups per category cat, dog, or wildlife. We do not have a license to re-distribute these datasets, but we provide the URLs to enable reproducibility, similar to [35].
|
| 141 |
+
|
| 142 |
+
Projected GAN outperforms all baselines in terms of FID values by a significant margin on all datasets and all resolutions as shown in Table 3. Remarkably, our model beats the prior state-of-the-art on all datasets $( 2 5 6 ^ { 2 } )$ after observing fewer than $6 0 0 \mathrm { k }$ images. For AnimalFace-Dog, the Projected GAN surpasses the previously best FID after only 20k images. One might argue that the EfficientNet used as feature network facilitates data generation for the animal datasets as EfficientNet is trained on ImageNet which contains many animal classes (e.g., 120 classes for dog breeds). However, it is interesting to observe that Projected GANs also achieve state-of-the-art FID on Pokemon and Art Painting though these datasets differ significantly from ImageNet. This evidences the generality of ImageNet features. For the high-resolution datasets, Projected GANs achieve the same FID value many times faster than the best baselines, e.g., ten times faster than StyleGAN2-ADA on AFHQCat or four times faster than FastGAN on Pokemon. We remark that $F$ and $D _ { l }$ generalize to any resolution as they are fully convolutional.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: Real samples (top rows) vs. samples by Projected GAN (bottom rows). Datasets (top left to bottom right): CLEVR $( 2 5 6 ^ { 2 } )$ ), LSUN church $( 2 5 6 ^ { 2 } )$ , Art Painting $( 2 5 6 ^ { 2 } )$ , Landscapes $( 2 5 6 ^ { 2 } )$ , AFHQ-wild $( 5 1 \bar { 2 } ^ { 2 } )$ , Pokemon $( 2 5 6 ^ { 2 } )$ , AFHQ-dog $( 5 1 2 ^ { 2 } )$ , AFHQ-cat $( \bar { 5 1 } 2 ^ { 2 } )$ ).
|
| 146 |
+
|
| 147 |
+
<table><tr><td></td><td colspan="9">FID Imgs FID Imgs FID</td><td>FID</td><td></td></tr><tr><td></td><td colspan="9">Large Datasets (2562)</td></tr><tr><td></td><td colspan="2">CLEVR</td><td colspan="2">FFHQ</td><td colspan="2">Cityscapes</td><td colspan="2">Bedroom</td><td colspan="2">Church</td></tr><tr><td>SAGAN [69]</td><td>26.04</td><td>10M</td><td>16.21</td><td>10 M</td><td>12.81</td><td>10M</td><td>14.06</td><td>10 M</td><td>6.15</td><td>10M</td></tr><tr><td>STYLEGAN2-ADA [25]</td><td>10.17</td><td>10M</td><td>7.32</td><td>10M</td><td>8.35</td><td>10M</td><td>11.53</td><td>10M</td><td>5.85</td><td>10M</td></tr><tr><td>GANSFORMERS [20]</td><td>9.24</td><td>10M</td><td>7.42</td><td>10M</td><td>5.23</td><td>10M</td><td>6.15</td><td>10M</td><td>5.47</td><td>10M</td></tr><tr><td>FASTGAN [35]</td><td>3.24</td><td>10M</td><td>12.69</td><td>10M</td><td>8.78</td><td>1.8M</td><td>8.24</td><td>4.8M</td><td>8.43</td><td>8.9M</td></tr><tr><td>PROJECTED GAN</td><td>0.89</td><td>4.5M</td><td>3.39</td><td>7.1M</td><td>3.41</td><td>1.7 M</td><td>1.52</td><td>5.2 M</td><td>1.59</td><td>9.2 M</td></tr><tr><td>PROJECTED GAN*</td><td>3.39 5.05</td><td>0.5M 25M</td><td>3.56</td><td>7.0 M</td><td>4.60</td><td>1.1M</td><td>2.58</td><td>1.5 M</td><td>3.18</td><td>1.1 M</td></tr><tr><td>STYLEGAN2* [25,26,68]</td><td></td><td></td><td>3.62</td><td>25M</td><td>1</td><td>-</td><td>2.65</td><td>70M</td><td>3.39</td><td>88M</td></tr><tr><td></td><td colspan="10">Small Datasets (2562)</td></tr><tr><td>STYLEGAN2-ADA [25]</td><td colspan="2">Art Painting</td><td colspan="2">Landscape</td><td colspan="2">AnimalFace</td><td colspan="2">Flowers</td><td colspan="2">Pokemon</td></tr><tr><td>FASTGAN [35]</td><td>43.07</td><td>3.2M</td><td>15.99</td><td>6.3M</td><td>60.90</td><td>2.2M</td><td>21.66</td><td>3.8M</td><td>40.38</td><td>3.4M</td></tr><tr><td>PROJECTED GAN</td><td>44.02</td><td>0.7M</td><td>16.44</td><td>1.8 M</td><td>62.11</td><td>0.2M</td><td>26.23</td><td>0.8M</td><td>81.86</td><td>2.5M</td></tr><tr><td></td><td>27.96</td><td>0.8M</td><td>6.92</td><td>3.5M</td><td>17.88</td><td>10M</td><td>13.86</td><td>1.8 M</td><td>26.36</td><td>0.8M</td></tr><tr><td>PROJECTED GAN*</td><td>40.22</td><td>0.2M</td><td>14.99</td><td>0.6M</td><td>58.07</td><td>0.02 M</td><td>21.60</td><td>0.2M</td><td>36.57</td><td>0.3M</td></tr><tr><td></td><td colspan="4">1024²</td><td colspan="7">5122</td></tr><tr><td>STYLEGAN2-ADA [25]</td><td colspan="2"> Art Painting</td><td colspan="2">Pokemon</td><td colspan="2">AFHQ-Cat</td><td colspan="2">AFHQ-Dog</td><td colspan="2">AFHQ-Wild</td></tr><tr><td></td><td>41.69</td><td>1.0M</td><td>56.76</td><td>0.6M</td><td>3.55</td><td>10M</td><td>7.40</td><td>10M</td><td>3.05</td><td>10M</td></tr><tr><td>FASTGAN [35]</td><td>46.71</td><td>0.8M</td><td>56.46</td><td>0.8M</td><td>4.69</td><td>1.1 M</td><td>13.09</td><td>1.6 M</td><td>3.14</td><td>1.6 M</td></tr><tr><td>PROJECTED GAN</td><td>32.07</td><td>0.9 M</td><td>33.96</td><td>1.3M</td><td>2.16</td><td>3.7M</td><td>4.52</td><td>3.8M</td><td>2.17</td><td>5.4M</td></tr><tr><td>PROJECTED GAN*</td><td>40.33</td><td>0.2M</td><td>53.74</td><td>0.2 M</td><td>3.53</td><td>1.0 M</td><td>7.10</td><td>0.9 M</td><td>3.03</td><td>1.6 M</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Table 3: Quantitative Results. Projected $\mathrm { G A N ^ { * } }$ reports the point where our approach surpasses the state-of-the-art. StyleGAN2\* obtains the lowest FID in previous literature if trained long enough.
|
| 150 |
+
|
| 151 |
+
# 6 Discussion and Future Work
|
| 152 |
+
|
| 153 |
+
While we achieve low FID on all datasets, we also identify two systematic failure cases: As depicted in Fig. 7, we sometimes observe “floating heads” on AFHQ. In a few samples, the animals appear in high quality but resemble cutouts on blurry or bland backgrounds. We hypothesize that generating a realistic background and image composition is less critical when a prominent object is already depicted. This hypothesis follows from the fact that we used image classification models for the projection, which have been shown to only marginally reduce in accuracy when applied on images of objects with removed background [66]. On FFHQ, projected GAN sometimes produces poor-quality samples with wrong proportions and artifacts, even at state-of-the-art FID, see Fig. 8.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 7: "Floating Heads"
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 8: Artifacts on FFHQ.
|
| 160 |
+
|
| 161 |
+
In terms of generators, StyleGAN is more challenging to tune and does not profit as much from projected training. The FastGAN generator is fast to optimize but simultaneously produced unrealistic samples in some parts of the latent space – a problem that could be solved by a mapping network similar to StyleGAN. Hence, we speculate that unifying the strengths of both architectures in combination with projected training might improve performance further. Moreover, our study of different pretrained networks indicates that efficient models are especially suitable for projected GAN training. Exploring this connection in-depth, and in general, determining desirable feature space properties opens up exciting new research opportunities. Lastly, our work advances efficiency for generative models. More efficient models lower the barrier of computational effort needed for generating realistic images. A lower barrier facilitates malignant use of generative models (e.g., “deep fakes”) while simultaneously also democratizing research in this area.
|
| 162 |
+
|
| 163 |
+
# Acknowledgments and Disclosure of Funding
|
| 164 |
+
|
| 165 |
+
We acknowledge the financial support by the BMWi in the project KI Delta Learning (project number 19A19013O). Andreas Geiger was supported by the ERC Starting Grant LEGO-3D (850533). Kashyap Chitta was supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039B and the International Max Planck Research School for Intelligent Systems (IMPRS-IS). Jens Müller received funding by the Heidelberg Collaboratory for Image Processing (HCI). We thank the Center for Information Services and High Performance Computing (ZIH) at Dresden University of Technology for generous allocations of computation time. Lastly, we would like to thank Vanessa Sauer for her general support.
|
| 166 |
+
|
| 167 |
+
# References
|
| 168 |
+
|
| 169 |
+
[1] I. Albuquerque, J. Monteiro, T. Doan, B. Considine, T. Falk, and I. Mitliagkas. Multi-objective training of generative adversarial networks with multiple discriminators. In Proc. of the International Conf. on Machine learning (ICML), 2019. 2, 3
|
| 170 |
+
[2] M. Arjovsky and L. Bottou. Towards principled methods for training generative adversarial networks. In Proc. of the International Conf. on Learning Representations (ICLR), 2017. 2
|
| 171 |
+
[3] M. Binkowski, D. J. Sutherland, M. Arbel, and A. Gretton. Demystifying MMD gans. In Proc. of the International Conf. on Learning Representations (ICLR), 2018. 6
|
| 172 |
+
[4] A. Brock, J. Donahue, and K. Simonyan. Large scale GAN training for high fidelity natural image synthesis. In Proc. of the International Conf. on Learning Representations (ICLR), 2019. 1, 2
|
| 173 |
+
[5] Y. Choi, Y. Uh, J. Yoo, and J.-W. Ha. Stargan v2: Diverse image synthesis for multiple domains. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2020. 1, 8
|
| 174 |
+
[6] 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. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2016. 8 image database. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR),
|
| 175 |
+
2009. 4 [8] T. Doan, J. Monteiro, I. Albuquerque, B. Mazoure, A. Durand, J. Pineau, and R. D. Hjelm. Online adaptative curriculum learning for gans. In Proc. of the Conf. on Artificial Intelligence (AAAI), 2019. 2 [9] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In Proc. of the International Conf. on Learning Representations (ICLR), 2021. 4 [10] A. Dosovitskiy and T. Brox. Generating images with perceptual similarity metrics based on deep networks. In Advances in Neural Information Processing Systems (NIPS), 2016. 2 [11] A. Dosovitskiy and T. Brox. Inverting visual representations with convolutional networks. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2016. 5 [12] D. Dowson and B. Landau. The fréchet distance between multivariate normal distributions. Journal of multivariate analysis, 1982. 5 [13] I. Durugkar, I. Gemp, and S. Mahadevan. Generative multi-adversarial networks. In Proc. of the International Conf. on Learning Representations (ICLR), 2017. 2, 3 [14] P. Esser, R. Rombach, and B. Ommer. Taming transformers for high-resolution image synthesis. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2020. 2 [15] H. Ham, T. J. Jun, and D. Kim. Unbalanced gans: Pre-training the generator of generative adversarial network using variational autoencoder. arXiv.org, 2002.02112, 2020. 2 [16] K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proc. of the IEEE International Conf. on Computer Vision (ICCV), 2015. 4 [17] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems (NIPS), 2017. 4, 5, 6 [18] J. Howard and S. Ruder. Universal language model fine-tuning for text classification. In Association for Computational Linguistics (ACL), 2018. 2 [19] X. Huang, Y. Li, O. Poursaeed, J. Hopcroft, and S. Belongie. Stacked generative adversarial networks. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2017. 2 [20] D. A. Hudson and C. L. Zitnick. Generative adversarial transformers. arXiv.org, 2103.01209,
|
| 176 |
+
2021. 6, 7, 8, 9 [21] J. Johnson, A. Alahi, and L. Fei-Fei. Perceptual losses for real-time style transfer and superresolution. In Proc. of the European Conf. on Computer Vision (ECCV), 2016. 2 [22] J. Johnson, B. Hariharan, L. van der Maaten, L. Fei-Fei, C. Lawrence Zitnick, and R. Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2017. 7 [23] A. Karnewar and O. Wang. Msg-gan: Multi-scale gradients for generative adversarial networks. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2020. 2 [24] T. Karras, T. Aila, S. Laine, and J. Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In Proc. of the International Conf. on Learning Representations (ICLR),
|
| 177 |
+
2018. 2 [25] T. Karras, M. Aittala, J. Hellsten, S. Laine, J. Lehtinen, and T. Aila. Training generative adversarial networks with limited data. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 2, 3, 4, 6, 7, 9 [26] T. Karras, S. Laine, and T. Aila. A style-based generator architecture for generative adversarial networks. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2019. 1,
|
| 178 |
+
2, 6, 8, 9 [27] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila. Analyzing and improving the image quality of StyleGAN. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2020. 2, 6 [28] D. P. Kingma and P. Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems (NeurIPS), 2018. 4 [29] A. Kolesnikov, L. Beyer, X. Zhai, J. Puigcerver, J. Yung, S. Gelly, and N. Houlsby. Big transfer (bit): General visual representation learning. In Proc. of the European Conf. on Computer Vision (ECCV), 2020. 1
|
| 179 |
+
[30] S. Kornblith, J. Shlens, and Q. V. Le. Do better imagenet models transfer better? In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2019. 1
|
| 180 |
+
[31] K. Kurach, M. Lucic, X. Zhai, M. Michalski, and S. Gelly. The gan landscape: Losses, architectures, regularization, and normalization. In Proc. of the International Conf. on Machine learning (ICML) Workshops, 2018. 1
|
| 181 |
+
[32] C. Ledig, L. Theis, F. Huszar, J. Caballero, A. Cunningham, A. Acosta, A. P. Aitken, A. Tejani, J. Totz, Z. Wang, and W. Shi. Photo-realistic single image super-resolution using a generative adversarial network. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2017. 2
|
| 182 |
+
[33] J. H. Lim and J. C. Ye. Geometric gan. arXiv.org, 1705.02894, 2017. 4
|
| 183 |
+
[34] T. Lin, P. Dollár, R. B. Girshick, K. He, B. Hariharan, and S. J. Belongie. Feature pyramid networks for object detection. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2017. 2
|
| 184 |
+
[35] B. Liu, Y. Zhu, K. Song, and A. Elgammal. Towards faster and stabilized gan training for highfidelity few-shot image synthesis. In Proc. of the International Conf. on Learning Representations (ICLR), 2021. 4, 6, 8, 9
|
| 185 |
+
[36] L. Mescheder, A. Geiger, and S. Nowozin. Which training methods for gans do actually converge? In Proc. of the International Conf. on Machine learning (ICML), 2018. 1
|
| 186 |
+
[37] T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. In Proc. of the International Conf. on Learning Representations (ICLR), 2018. 3
|
| 187 |
+
[38] S. Mo, M. Cho, and J. Shin. Freeze the discriminator: a simple baseline for fine-tuning gans. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR) Workshops, 2020. 2
|
| 188 |
+
[39] S. Morozov, A. Voynov, and A. Babenko. On self-supervised image representations for GAN evaluation. In Proc. of the International Conf. on Learning Representations (ICLR), 2021. 6
|
| 189 |
+
[40] B. Neyshabur, S. Bhojanapalli, and A. Chakrabarti. Stabilizing gan training with multiple random projections. arXiv.org, 1705.0783, 2017. 2, 3
|
| 190 |
+
[41] A. Nguyen, J. Yosinski, Y. Bengio, A. Dosovitskiy, and J. Clune. Plug & play generative networks: Conditional iterative generation of images in latent space. arXiv.org, 1612.00005, 2016. 2
|
| 191 |
+
[42] M.-E. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In Proc. Indian Conf. on Computer Vision, Graphics & Image Processing, 2008. 8
|
| 192 |
+
[43] T. Park, M.-Y. Liu, T.-C. Wang, and J.-Y. Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2019. 2
|
| 193 |
+
[44] O. Patashnik, Z. Wu, E. Shechtman, D. Cohen-Or, and D. Lischinski. Styleclip: Text-driven manipulation of stylegan imagery. arXiv.org, 2103.17249, 2021. 2
|
| 194 |
+
[45] M. E. Peters, M. Neumann, M. Iyyer, M. Gardner, C. Clark, K. Lee, and L. Zettlemoyer. Deep contextualized word representations. In Conf. of the North American Chapter of the Association for Computational Linguistics (NAACL), 2018. 2
|
| 195 |
+
[46] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. arXiv.org, 2103.00020, 2021. 4
|
| 196 |
+
[47] A. Radford, K. Narasimhan, T. Salimans, and I. Sutskever. Improving language understanding by generative pre-training, 2018. 2
|
| 197 |
+
[48] R. Ranftl, K. Lasinger, D. Hafner, K. Schindler, and V. Koltun. Towards robust monocular depth estimation: Mixing datasets for zero-shot cross-dataset transfer. IEEE Trans. on Pattern Analysis and Machine Intelligence (PAMI), 2020. 1
|
| 198 |
+
[49] S. R. Richter, H. A. AlHaija, and V. Koltun. Enhancing photorealism enhancement. arXiv.org, 2105.04619, 2021. 2
|
| 199 |
+
[50] O. Ronneberger, P. Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2015. 4
|
| 200 |
+
[51] M. S. Sajjadi, O. Bachem, M. Lucic, O. Bousquet, and S. Gelly. Assessing generative models via precision and recall. In Advances in Neural Information Processing Systems (NeurIPS), 2018. 6
|
| 201 |
+
[52] M. S. Sajjadi, B. Scholkopf, and M. Hirsch. Enhancenet: Single image super-resolution through automated texture synthesis. In Proc. of the IEEE International Conf. on Computer Vision (ICCV), 2017. 2
|
| 202 |
+
[53] C. N. d. Santos, Y. Mroueh, I. Padhi, and P. Dognin. Learning implicit generative models by matching perceptual features. In Proc. of the IEEE International Conf. on Computer Vision (ICCV), 2019. 2
|
| 203 |
+
[54] A. Sauer and A. Geiger. Counterfactual generative networks. In Proc. of the International Conf. on Learning Representations (ICLR), 2021. 2
|
| 204 |
+
[55] E. Schonfeld, B. Schiele, and A. Khoreva. A u-net based discriminator for generative adversarial networks. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2020. 2
|
| 205 |
+
[56] A. Shocher, Y. Gandelsman, I. Mosseri, M. Yarom, M. Irani, W. T. Freeman, and T. Dekel. Semantic pyramid for image generation. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2020. 2
|
| 206 |
+
[57] Z. Si and S.-C. Zhu. Learning hybrid image templates (hit) by information projection. IEEE Trans. on Pattern Analysis and Machine Intelligence (PAMI), 2011. 8
|
| 207 |
+
[58] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In Proc. of the International Conf. on Learning Representations (ICLR), 2015. 2
|
| 208 |
+
[59] D. Sungatullina, E. Zakharov, D. Ulyanov, and V. Lempitsky. Image manipulation with perceptual discriminators. In Proc. of the European Conf. on Computer Vision (ECCV), 2018. 2, 5
|
| 209 |
+
[60] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. E. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2015. 4
|
| 210 |
+
[61] M. Tan and Q. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In Proc. of the International Conf. on Machine learning (ICML), 2019. 4
|
| 211 |
+
[62] H. Touvron, M. Cord, M. Douze, F. Massa, A. Sablayrolles, and H. Jégou. Training dataefficient image transformers & distillation through attention. arXiv.org, 2012.12877, 2020. 4
|
| 212 |
+
[63] N.-T. Tran, V.-H. Tran, N.-B. Nguyen, T.-K. Nguyen, and N.-M. Cheung. On data augmentation for gan training. IEEE Trans. on Image Processing (TIP), 2021. 2, 4
|
| 213 |
+
[64] T.-C. Wang, M.-Y. Liu, J.-Y. Zhu, A. Tao, J. Kautz, and B. Catanzaro. High-resolution image synthesis and semantic manipulation with conditional gans. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2018. 2
|
| 214 |
+
[65] Y. Wang, C. Wu, L. Herranz, J. van de Weijer, A. Gonzalez-Garcia, and B. Raducanu. Transferring gans: generating images from limited data. In Proc. of the European Conf. on Computer Vision (ECCV), 2018. 2
|
| 215 |
+
[66] K. Xiao, L. Engstrom, A. Ilyas, and A. Madry. Noise or signal: The role of image backgrounds in object recognition. In Proc. of the International Conf. on Learning Representations (ICLR), 2021. 10
|
| 216 |
+
[67] F. Yu, A. Seff, Y. Zhang, S. Song, T. Funkhouser, and J. Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv.org, 1506.03365, 2015. 4, 8
|
| 217 |
+
[68] N. Yu, G. Liu, A. Dundar, A. Tao, B. Catanzaro, L. Davis, and M. Fritz. Dual contrastive loss and attention for gans. arXiv.org, 2103.16748, 2021. 7, 9
|
| 218 |
+
[69] H. Zhang, I. Goodfellow, D. Metaxas, and A. Odena. Self-attention generative adversarial networks. In Proc. of the International Conf. on Machine learning (ICML), 2019. 2, 8, 9
|
| 219 |
+
[70] J. Zhao, M. Mathieu, and Y. LeCun. Energy-based generative adversarial network. In Proc. of the International Conf. on Learning Representations (ICLR), 2017. 2
|
| 220 |
+
[71] M. Zhao, Y. Cong, and L. Carin. On leveraging pretrained gans for generation with limited data. In Proc. of the International Conf. on Machine learning (ICML), 2020. 2
|
| 221 |
+
[72] S. Zhao, Z. Liu, J. Lin, J.-Y. Zhu, and S. Han. Differentiable augmentation for data-efficient gan training. In Advances in Neural Information Processing Systems (NeurIPS), 2020. 2, 4, 7
|
| 222 |
+
[73] Z. Zhao, Z. Zhang, T. Chen, S. Singh, and H. Zhang. Image augmentations for gan training. arXiv.org, 2006.02595, 2020. 2, 4
|
| 223 |
+
[74] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycleconsistent adversarial networks. In Proc. of the IEEE International Conf. on Computer Vision (ICCV), 2017. 2
|
md/train/r1glDpNYwS/r1glDpNYwS.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LABELFOOL: A TRICK IN THE LABEL SPACE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
It is widely known that well-designed perturbations can cause state-of-the-art machine learning classifiers to mis-label an image, with sufficiently small perturbations that are imperceptible to the human eyes. However, by detecting the inconsistency between the image and wrong label, the human observer would be alerted of the attack. In this paper, we aim to design attacks that not only make classifiers generate wrong labels, but also make the wrong labels imperceptible to human observers. To achieve this, we propose an algorithm called LabelFool which identifies a target label similar to the ground truth label and finds a perturbation of the image for this target label. We first find the target label for an input image by a probability model, then move the input in the feature space towards the target label. Subjective studies on ImageNet show that in the label space, our attack is much less recognizable by human observers, while objective experimental results on ImageNet show that we maintain similar performance in the image space as well as attack rates to state-of-the-art attack algorithms.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks are powerful learning models that achieve state-of-the-art pattern recognition performance in classification tasks (Krizhevsky et al., 2012b; LeCun et al., 2010; He et al., 2016). Nevertheless, it is found that adding well-designed perturbations to original samples can make classifiers of deep neural networks fail (Szegedy et al., 2013). These kinds of samples are called adversarial samples. Techniques for generating adversarial samples are called attackers.
|
| 12 |
+
|
| 13 |
+
We think the ideal attacker should satisfy three levels of requirements. The first requirement is fooling networks which means making classifiers fail to classify an image successfully. For example, a dog image can be classified as a cat after added some well-designed perturbations. There are a number of methods for achieving a high attack rate (Goodfellow et al., 2015; Carlini & Wagner, 2017; Dong et al., 2018).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: This graph illustrates the importance of the imperceptibility of adversarial samples in both image space and label space. Triangles are three attackers. Circles represent human observers.
|
| 17 |
+
|
| 18 |
+
The second requirement for the ideal attacker is the imperceptibility in the image space. This means the magnitude of perturbations in the pixel level needs to be as tiny as possible so that it is imperceptible to human eyes. For example, additive perturbations are minimized with $l _ { p }$ norm to generate imperceptible adversarial samples (Seyed-Mohsen et al., 2016). Extreme cases also exist where only changing one or a few pixels (Su et al., 2019; Modas et al., 2019) can make classifiers fail. Moosavi-Dezfooli et al. (2017) even show the existence of universal (image-agnostic) perturbations.
|
| 19 |
+
|
| 20 |
+
The third requirement for the ideal attacker, which is newly proposed in this paper, is the imperceptibility of the error made by the classifier in the label space. It means making the classifier to mis-classify an image as the label which is similar to its ground truth, so that people won’t notice the misclassification. For example, in Figure 1, a human user will probably ignore the mis-classification if an attacker caused a “church” to be mis-classified as a “monastery” as the third attacker does. However, a human user will easily notice the mistake if an attacker caused a “church” to be misclassified as a “dome” as the second attacker does or caused an apparent perturbation in the image space as the first attacker does. In real applications, a human user will take defensive measures as soon as he notices the attack. Therefore making the whole attack process imperceptible is crucial for letting observers’ guard down. Tiny perturbations in the image space but large perturbations in the label space can muddle through on the input terminal. But as soon as observers check on the output terminal and see the obviously-incorrect label for an input, they will realize that the classifier fail due to some attacks and take defensive measures immediately, just as Figure 1 shows. This justifies the power of attacks which also confuse people in the label space. So the imperceptibility in the label space is quite important. However, to our best knowledge, few attackers have realized this point.
|
| 21 |
+
|
| 22 |
+
In this paper, we propose an untargeted-attack algorithm called LabelFool, to perturb an image to be mis-classified as the label which is similar to its ground truth, so that people won’t notice the misclassification. In the meantime, LabelFool also guarantees the imperceptibility in the image space as well as maintaining a high attack rate in fooling classifiers. There are two steps by which we accomplish our goal. The first step is to choose a target label which is similar to the input image’s ground truth. The second step is to perturb the input to be classified as this target label. The way is finding the classification boundary between the current label and the target label, and then moving the input towards this boundary until it is classified as the target label. We conduct a subjective experiment on ImageNet (Deng et al., 2009) which shows that adversarial samples generated by our method are indeed much less recognizable in the label space by human observers than other attacks. We also perform objective experiments on ImageNet to demonstrate that adversarial samples generated by LabelFool still guarantee the imperceptibility in the image space as well as maintaining a high attack rate in fooling classifiers.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
The phenomenon that neural networks are sensitive to adversarial samples was proposed by Szegedy et al. (2013). Since then, many researchers have studied how to generat adversarial samples. FGSM (Goodfellow et al., 2015) was proposed to maximize the classification error subject to $l _ { \infty }$ -norm based distortion constraints. CW attack (Carlini & Wagner, 2017) generates adversarial samples by solving an optimization problem based on $l _ { 0 } / l _ { 2 } / l _ { \infty }$ constraint, and $l _ { 0 }$ CW attack is the first proposed method that can cause targeted misclassification on the ImageNet dataset, meaning that we can specify the label of adversarial samples. But this designation of the target label is arbitrary. Until this paper, there has no guide about how to choose a target label such that it is difficult for a person to notice that the network has failed.
|
| 27 |
+
|
| 28 |
+
Besides achieving the goal of misclassification, many researchers realize the importance of imperceptibility in the image space (Xu et al., 2019). One-pixel attack (Su et al., 2019) and SparseFool (Modas et al., 2019) attack networks in a scenario where perturbing only one/a few pixels can make a big difference. Moosavi-Dezfooli et al. (2017) show the existence of universal image-agnostic perturbations for state-of-the-art deep neural networks. DeepFool (Seyed-Mohsen et al., 2016) seeks the minimum image-level distortion. And for generating adversarial samples, it directly moves the input sample to the nearest class in the feature space. This is the most closely related work to ours, because features extracted from classification models can reflect images’ perceptual information and the classes which are close in the feature space are often perceptually similar. However, DeepFool approximates the multi-dimensional classification boundaries in two dimensions and this might make big errors on finding the nearest class. All these attacks generate adversarial samples by iteration and the algorithm stops as soon as an adversarial sample is born no matter what label it belongs to. This will lead to an apparent misclassification so that observers will sound the defensive alarm quickly.
|
| 29 |
+
|
| 30 |
+
In this paper, we will compare our method with three attacks: FGSM, DeepFool and SparseFool to show the advantage of our method in the imperceptibility in the label space. We will also demonstrate that the performance gain in the label space is not at the expense of the loss in the image space or attack rate.
|
| 31 |
+
|
| 32 |
+
# 3 LABELFOOL
|
| 33 |
+
|
| 34 |
+
In this section, we will introduce our method about how to choose a target label which is undetectable by human observers and how we can perturb the input image so that the classifier assigns this specific label. The whole pipeline is shown in Figure 2. All the symbols and notations used in this paper are summarized in Table 1. We use the same notation $i ( i = 1 , 2 , \dots )$ for “class” and “label”, because “class” and “label” are interchangeable in this paper. LabelFool contains two steps. The first step is to choose a target label for the input image which is similar to its ground truth. The second step is to perturb the input image to be classified as this label. Inspired by DeepFool (Seyed-Mohsen et al., 2016), we make modifications at the feature level. We keep moving the input towards this chosen class at the feature level until it is classified as the label we want.
|
| 35 |
+
|
| 36 |
+
# 3.1 CHOOSE A TARGET LABEL
|
| 37 |
+
|
| 38 |
+
The first step of our method is choosing the target label $t _ { x }$ for an input image $x$ . As we want the target label to be imperceptible in the label space to human observers, we need to find the most “similar” label to the input image’s ground truth $l _ { x }$ where the most “similar” means the nearest in the perceptual distance metric. However, $l _ { x }$ is usually unknown when an input image is given. So it is important to estimate the probability distribution $P$ of an input’s ground truth $l _ { x }$ , based on which, we can compute the distance between each class in the dataset and $l _ { x }$ , then choose the nearest one as the target class. We propose a weighted distance model to achieve this goal. Before introducing the model, there are some preparations.
|
| 39 |
+
|
| 40 |
+
Given two image $x , y$ , we choose pre-trained image classification models to extract features $\phi _ { x } , \phi _ { y }$ because these features can reflect some perceptual information. As we want to calculate the distance in the perceptual distance metric and cosine distance has been used to measure perceptual similarity in many works (Lin et al., 2016; Wang et al., 2019), we compute the distance between $x$ and $y$ as $d ( x , y ) = 1 - \cos { ( \phi _ { x } , \phi _ { y } ) }$ . After having the distance between two images, we can compute the distance between classes. Each class is a set of images. To measure the distance between two sets, we choose Hausdorff distance (Henrikson, 1999). The distance between class $i$ and class $j$ is denoted as $D _ { i , j }$ . Suppose a dataset has $n$ classes. Then, we can construct a matrix $\pmb { { \cal D } } \in \mathbb { R } ^ { n \times n }$ by calculating the distance between all pairs of classes in the dataset, and it will be used in the following probability model to provide the distance we need. After these preparations, we can start to decide the target label for an input image.
|
| 41 |
+
|
| 42 |
+
As introduced before, we need to estimate the probability distribution $P$ of the ground truth $l _ { x }$ because we want to find the nearest label to $l _ { x }$ which is unknown in the beginning. When an image $x$ is put into a classifier $f$ , state-of-the-art machine learning classifiers usually output a predicted label $\hat { l } _ { x }$ and a probability vector $\hat { p }$ whose elements mean $P ( x \in c l a s s \ i ) = \hat { p } _ { i }$ . For simplicity, we suppose the elements in $\hat { p }$ are sorted in the descending order. Meanwhile, $\hat { p }$ can be thought as $P$ ’s approximation. Furthermore, we define a distance function between $l _ { x }$ and the class $i$ in a $\mathbf { n }$ -classes dataset as $D _ { i } ( l _ { x } )$ . In order to choose the nearest label to $l _ { x }$ as the target label $t _ { x }$ , we need to estimate the expectation of $D _ { i } ( l _ { x } )$ which is denoted as $\mathbb { E } _ { l _ { x } \sim P } [ D _ { i } ( l _ { x } ) ] ( i = \bar { 1 } , \dots , n )$ . In general, our target function is Eq. (1).
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
t _ { x } = \underset { i = 1 , \ldots , n } { \arg \operatorname* { m i n } } \mathbb { E } _ { l _ { x } \sim P } [ D _ { i } ( l _ { x } ) ]
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
Specifically, when $\hat { p } _ { 1 }$ is larger than some threshold $\delta _ { 1 }$ , we use Maximum Likelihood Estimation (MLE) (Pfanzagl, 2011) which means we believe the classifier and take the predicted label $\hat { l } _ { x }$ as
|
| 49 |
+
|
| 50 |
+
# Meaning
|
| 51 |
+
|
| 52 |
+
$x$ Input image
|
| 53 |
+
$\phi _ { x }$ The feature of image $x$
|
| 54 |
+
$_ { D }$ The perceptual distance matrix where $D _ { i , j }$ represents the distance between class $i$ and class $j$ $f$ Classifier
|
| 55 |
+
$\hat { p }$ Probability vector (elements are in descending order)
|
| 56 |
+
$l _ { x }$ The ground truth of the input image $x$
|
| 57 |
+
$\hat { l } _ { x }$ The predicted class of the input image $x$ by the classifier
|
| 58 |
+
$D _ { i } ( l _ { x } )$ A function calculating the distance between class $i$ and the ground truth $l _ { x }$
|
| 59 |
+
$t _ { x }$ Target label for input $x$
|
| 60 |
+
$\delta _ { 1 } , \delta _ { 2 }$ Two thresholds, in this paper, $\delta _ { 1 } = 0 . 8 , \delta _ { 2 } = 0 . 0 1$
|
| 61 |
+
$M$ The number of elements larger than $\delta _ { 2 }$ in $\hat { p } _ { : }$ , i.e. $M = \mathrm { m a x } _ { j = 1 , \dots , n } \{ j : { \hat { p } } _ { j } > \delta _ { 2 } \}$
|
| 62 |
+
${ \mathcal { F } } _ { j }$ The classification boundary between class $\hat { l } _ { x }$ and class $j$ of an image
|
| 63 |
+
|
| 64 |
+
the ground truth $l _ { x }$ , then choose the label (except $\hat { l } _ { x }$ ) nearest to $\hat { l } _ { x }$ as the target label $t _ { x }$ . So in this circumstance, we assume $l _ { x } = \hat { l } _ { x }$ and $\mathbb { E } _ { l _ { x } \sim P } [ D _ { i } ( l _ { x } ) ] = D _ { i , \hat { l } _ { x } }$ . Therefore, $t _ { x }$ is
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
t _ { x } = \operatorname * { a r g m i n } _ { i \neq \hat { l } _ { x } , i = 1 , \ldots , n } D _ { i , \hat { l } _ { x } } \quad \mathrm { i f } \hat { p } _ { 1 } > \delta _ { 1 } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
When $\hat { p } _ { 1 }$ is smaller than the threshold $\delta _ { 1 }$ , we are not sure whether $l _ { x }$ is equal to $\hat { l } _ { x }$ . Instead, we sample some labels and compute the weighted distance between each label $i$ and these labels. We sample all labels whose probability are larger than a threshold $\delta _ { 2 }$ and we use $M$ to represent the number of sampled labels. We think the input image might belong to one of these $M$ labels. The labels whose probability are smaller than $\delta _ { 2 }$ will be abandoned because we think the input image can hardly fall into these categories. The weight and the distance is provided by the vector $\hat { p }$ and matrix $_ D$ respectively. So in this circumstance, as we are not sure which label is the ground truth, we want to find a target label which has the minimum expected distance with all these possible labels. Therefore, the value of $\mathbb { E } _ { l _ { x } \sim P } [ D _ { i } ( l _ { x } ) ]$ can be approximated as X j=1 pˆj · Di,j and the target label $t _ { x }$ is shown in Eq. (3). This can be explained by Importance Sampling (Owen & Zhou, 2000) because it is hard to sample from the real probability distribution $P$ . We can only use the probability distribution $\hat { p }$ which is an approximation of $P$ to estimate the value of $\mathbb { E } _ { l _ { x } \sim P } [ D _ { i } ( l _ { x } ) ]$ .
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
t _ { x } = \underset { i = 1 , \ldots , n } { \arg \operatorname* { m i n } } \sum _ { j = 1 } ^ { M } \hat { p } _ { j } \cdot D _ { i , j } \quad \mathrm { i f } \hat { p } _ { 1 } \leq \delta _ { 1 }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
In conclusion, the whole strategy for choosing the target label $t _ { x }$ of an input image $x$ is computed as Eq. (4). The target label $t _ { x }$ minimizes $\mathbb { E } _ { l _ { x } \sim P } [ D _ { i } ( l _ { x } ) ]$ just as Figure 2 shows.
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
t _ { x } = \left\{ \begin{array} { l l } { \displaystyle \arg \operatorname* { m i n } _ { i , \hat { l } _ { x } } D _ { i , \hat { l } _ { x } } } & { \mathrm { i f } \hat { p } _ { 1 } > \delta _ { 1 } } \\ { \displaystyle i \neq \hat { l } _ { x } , i = 1 , . . . , n } \\ { \displaystyle \arg \operatorname* { m i n } _ { i = 1 , . . . , n } \sum _ { j = 1 } ^ { M } \hat { p } _ { j } \cdot D _ { i , j } } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
# 3.2 GENERATE ADVERSARIAL SAMPLES
|
| 83 |
+
|
| 84 |
+
After having the target label, the second step is to attack the input image to be mis-classified as this target label. It’s easy to achieve by taking the target label as a parameter and putting it into the targeted-attack algorithm such as targeted-FGSM (Goodfellow et al., 2015) and targeted-CW (Carlini & Wagner, 2017), but this operation may suffer huge loss in the image space because of large perturbations.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Pipeline of our method. There are two steps. In the first step, we first compute the distance $D _ { i , j }$ between every two class $i , j$ in a n-classes dataset. Then we choose the target label $t _ { x }$ for an input image $x$ by two strategies according to the value of $\hat { p } _ { 1 }$ . The second step is to attack the input into this target label. Solid lines are the real boundaries between the current label and the indicated label and dashed lines with notes $\mathcal { F }$ are the approximate two-dimensional boundaries. Red indicates the target label while blue indicates other labels. Our method moves the input towards the boundary $\mathcal { F } _ { t _ { x } }$ until it is classified as $t _ { x }$ .
|
| 88 |
+
|
| 89 |
+
Inspired by DeepFool (Seyed-Mohsen et al., 2016), we propose a method which can not only attack an input image to be mis-classified as the target label successfully, but also ensure tiny perturbations in the image space. The mathematical derivation in this step is similar to DeepFool (Seyed-Mohsen et al., 2016) and the only difference is that, we have a target label chosen in the first step while DeepFool doesn’t. As introduced in DeepFool (Seyed-Mohsen et al., 2016), a high dimensional classification boundary can be approximated by a line in two dimensions. As shown in Figure 2, for an image $x _ { 0 }$ , ${ \mathcal { F } } _ { j }$ represents the 2D approximated boundary between its current predicted class and class $j$ and $t _ { x }$ is the target class we choose in the first step. In the first iteration, we move $x _ { 0 }$ towards $\mathcal { F } _ { t _ { x } }$ and get a new point $x _ { 1 }$ . The direction of movement is perpendicular to $\mathcal { F } _ { t _ { x } }$ . The distance of the movement is the vertical distance from $x _ { 0 }$ to $\mathcal { F } _ { t _ { x } }$ . If the predicted label $\hat { l } _ { x _ { 1 } }$ of the new point equals $\hat { l } _ { x _ { 0 } }$ , the classification boundaries are the same as those before moving $x _ { 0 }$ . Otherwise, the classification boundaries change. No matter whether the boundaries change or not, we repeatedly move the current point towards $\mathcal { F } _ { t _ { x } }$ until it is classified as label $t _ { x }$ or the maximum number of iterations has been reached. A pseudocode of the second step is shown in Algorithm 1.
|
| 90 |
+
|
| 91 |
+
# Algorithm 1 : Generate Adversarial Samples
|
| 92 |
+
|
| 93 |
+
Input: image $x$ , classifier $f$ , target label $t _ { x }$ Output: Adversarial image $\hat { x }$ 1: initialize $x _ { 0 } \gets x , i \gets 0$ 2: while $\hat { l } _ { x _ { i } } \neq t _ { x }$ and i < max iter do 3: $w \gets \nabla f _ { \hat { l } _ { x _ { i } } } ( x _ { i } ) - \nabla f _ { t _ { x } } ( x _ { i } )$ 4: $g \gets f _ { \hat { l } _ { x _ { i } } } ( \bar { x } _ { i } ) - f _ { t _ { x } } ( x _ { i } )$
|
| 94 |
+
|
| 95 |
+
5: ri ← kw k22 |g| w
|
| 96 |
+
6: xi+1 ← xi + ri, i ← i + 1
|
| 97 |
+
7: end while
|
| 98 |
+
8: return $\hat { x } = x _ { i + 1 }$
|
| 99 |
+
|
| 100 |
+
# 4 EXPERIMENTS
|
| 101 |
+
|
| 102 |
+
In this paper, all experiments are conducted on ImageNet. ImageNet provides the CLS-LOC dataset for classification tasks. Its train split contains about 1300 thousand images. There are 50 thousand validation images and 100 thousand test images. Our experiments are conducted on the train split of CLS-LOC dataset which will be noted as ImageNet-train split in the following part. We perform extensive experiments to show LabelFool can satisfy all three levels of requirements as an attacker. First we demonstrate the deceptiveness of samples generated by LabelFool to humans in the label space through a subjective experiment. Then we calculate the perceptibility and image quality of adversarial samples to show there is not much loss in the image space even compared to DeepFool (Seyed-Mohsen et al., 2016), which is the state-of-the-art method in the image space. Finally, we conduct attacks on several models to prove the exceptional ability of our method on fooling neural networks which is the first requirement for an ideal attack.
|
| 103 |
+
|
| 104 |
+
# 4.1 IMPERCEPTIBILITY IN THE LABEL SPACE
|
| 105 |
+
|
| 106 |
+
Setup. In this part, we will compare LabelFool with three attack methods: DeepFool, FGSM and SparseFool. We first sample 600 source images from ImageNet-train split randomly, and these images are in different classes. Each source image will derive four adversarial images and a baseline image, namely DeepFool-attacked image, LabelFool-attacked image, FGSM-attacked image, SparseFool-attacked image and clean image. Each adversarial image has its mis-classified label and each baseline image has the truth label. We then use term “puzzles” to describe the combination of an image and its label, for $5 \times 6 0 0 = 3 0 0 0$ puzzles. A human observer needs to determine whether the label is correct for the image, answering “True” or “False” for each puzzle. To eliminate observers’ memory effects, we split 3000 puzzles into five groups, ensuring that 600 images in one group come from different source images. An interface presentation of our subjective experiment is shown in Appendix A. We have 10 observers (3 females and 7 males, age between 20-29) to do our subjective experiment.
|
| 107 |
+
|
| 108 |
+
Evaluation. In this paper, we define an index named Performance Gain $( P G )$ as the evaluation index. Human observers answer “True” or “False” for each puzzle, and the rate with which they answer incorrectly is called Confusion Rate $( C R )$ . So every observer has a $C R$ for each attack method or baseline. It is an absolute indicator demonstrating how much observers are confused by a set of puzzles. But doing arithmetic on $C R$ of different observers is meaningless, as different observers have different baseline results. So we define a relative indicator called Performance Gain $( P G )$ , which demonstrates how much improvement in the confusion rate after attacking comparing with baseline. It is a kind of normalization. The formula for PG is shown in Eq. (5), where $C R _ { A }$ means the confusion rate of an attacker and $C R _ { B }$ means the confusion rate of baseline. The higher $P G$ an attacker has, the better it confuses people in the label space.
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
P G _ { A } = \frac { C R _ { A } - C R _ { B } } { C R _ { B } } \ ( A i s \ a n \ a t t a c k e r , B = B a s e l i n e )
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Results. We report the average performance gain of 10 observers in total images in the left of Figure 3. As a whole, there is a huge improvement compared with FGSM and SparseFool, about 25 percent improvement and 30 percent improvement respectively. Compared with DeepFool, the gap in $P G$ is a little smaller because DeepFool finds the nearest class in the feature level and features usually reflect images’ perceptual information as we introduced in Section 2. But there is still 3 percent improvement in performance gain.
|
| 115 |
+
|
| 116 |
+
As animal classes are more fine-grained, the effects of the imperceptibility in the label space become more pronounced. We attack an animal image so that its true animal label changed into a similar animal label, it is difficult for humans to notice that our attack is taking place. Meanwhile, other attacks change the label into an obviously-incorrect label such as a non-animal category or another species (Some examples in Appendix B). In our subjective experiment, there are 247 animal images out of 600 source images. The right graph in Figure 3 shows the average performance gain of 10 observers in animal images. The accurate data for both graphs in Figure 3 is shown in Appendix C.
|
| 117 |
+
|
| 118 |
+
As for animal images, the improvement is very obvious comparing with all three attack methods. There are about nearly 90 percent improvement in performance gain comparing with FGSM and
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: A line chart for average performance gain of 10 observers. The horizontal axis represents four attack methods. The vertical axis represents the mean value of 10 human observers’ performance gain. The graph in the left is for total results, and the right one is for animal images.
|
| 122 |
+
|
| 123 |
+
SparseFool. A significant improvement can also be seen when comparing with DeepFool, there are about 50 percent improvement in average performance gain.
|
| 124 |
+
|
| 125 |
+
# 4.2 IMPERCEPTIBILITY IN THE IMAGE SPACE
|
| 126 |
+
|
| 127 |
+
In this subsection, we will show our performance in the image space to demonstrate that our improvement in the label space is not at the cost of huge loss in the image space. We use three metrics to evaluate performance in the image space. One is perceptibility which is similar to the definition in previous works (Szegedy et al., 2013; Seyed-Mohsen et al., 2016) : $p =$ $\frac { 1 } { W _ { N } \times H _ { N } } \sum _ { w = 1 } ^ { W _ { N } } \sum _ { h = 1 } ^ { \bar { H } _ { N } } { \lVert { \Delta y _ { w , h } } \rVert ^ { 2 } }$ , where $y _ { w , h }$ is a 3-dimensional vector representing the RGB intensities (normalized in [0, 1]) of a pixel. The other two are perceptual similarity (Zhang et al., 2018) and PieAPP (Prashnani et al., 2018). These two are metrics for image quality. Perceptual similarity measures the perceptual distance between an image and its reference image while PieAPP measures the perceptual error. In this paper, the reference image is the clean image. And the smaller these three metrics are, the better the adversarial samples are.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 4: Mean value of perceptibility, perceptual similarity and PieAPP for adversarial samples generated by different attack methods on different models.
|
| 131 |
+
|
| 132 |
+
We randomly choose 1000 images from ImageNet and attack the classifier to generate 1000 adversarial samples. Then we compute mean value for these adversarial samples of three metrics. In this experiment, we test four classifiers: ResNet-34, ResNet-50, VGG-19 (with batch normalization) (Simonyan & Zisserman, 2014) and AlexNet (Krizhevsky et al., 2012a). The results are shown in Figure 4 whose original data are reported in Appendix C. We can see although LabelFool is significantly better than FGSM and SparseFool, it is still a little worse than DeepFool in all three metrics. However, visual results (Figure 5) indicate that human observers can not notice the difference between LabelFool and DeepFool in the image space as the metric value is on such a small scale.
|
| 133 |
+
|
| 134 |
+
# 4.3 FOOL NETWORKS
|
| 135 |
+
|
| 136 |
+
We will show attack rate in the last experiment which is the most fundamental requirement for an attacker. Results are shown in Table 2. The results are the average value of three groups of
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
|
| 140 |
+
Figure 5: Two visual results of adversarial samples generated from AlexNet in the image space. In each result, the left image is the clean image, the middle one is DeepFool-attacked adversarial sample and the right one is LabelFool-attacked adversarial sample. Above the images are the true label/ the label after attacked. The three metrics of adversarial samples are reported in the table below them.
|
| 141 |
+
|
| 142 |
+
Table 2: Attack rate of different methods on different models.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Model</td><td>DeepFool</td><td>LabelFool</td><td>FGSM</td><td>SparseFool</td></tr><tr><td>ResNet-34</td><td>92.67%</td><td>97.50%</td><td>95.03%</td><td>92.60%</td></tr><tr><td>ResNet-50</td><td>93.08%</td><td>97.88%</td><td>95.09%</td><td>92.53%</td></tr><tr><td>VGG-19(bn)</td><td>92.03%</td><td>97.48%</td><td>94.59%</td><td>83.70%</td></tr><tr><td>AlexNet</td><td>90.35%</td><td>97.38%</td><td>96.44%</td><td>89.11%</td></tr></table>
|
| 145 |
+
|
| 146 |
+
experiments. Each group has 1000 original images from ImageNet, we use these original images to generate adversarial images for four models respectively. We surprisingly find that LabelFool has the highest attack rate on all models comparing with other methods. This might benefit from our probability model which is used to choose the target label. Because in our strategy, when $\hat { p } _ { 1 } \leq \delta _ { 1 }$ , we do not use the predicted label as the ground truth like other methods do. Instead, we consider all labels whose probability are larger than $\delta _ { 2 }$ and choose the label nearest to all these labels as the target label. This operation can avoid some mistakes and improve the attack rate when the classifier doesn’t give a correct classification result. An example is shown in Appendix D.
|
| 147 |
+
|
| 148 |
+
# 5 CONCLUSION AND FURTHER DISCUSSION
|
| 149 |
+
|
| 150 |
+
Conclusion. In this study, we pay attention to tiny perturbations in the label space. To our best knowledge, we are the first one who points out the importance of the imperceptibility in the label space for adversarial samples. Furthermore, we explore a feasible method named LabelFool to identify a target label “similar” with an input image’s ground truth and perturb the input image to be mis-classified as this target label so that a human observer will overlook the misclassification and lower the vigilance of defenses. Our experiments show that, while LabelFool is a little behind DeepFool in the image space, it is much imperceptible in the label space to human observers. Since we adopt Importance Sampling instead of MLE only in traditional method, the success rate of attack also get gains.
|
| 151 |
+
|
| 152 |
+
Further discussion. In this paper, we just propose a feasible way to generate adversarial samples which can confuse people in the label space. However, there is room for improvement in our approach. Our results provide the following avenues for future research.
|
| 153 |
+
|
| 154 |
+
• The perceptual features can be optimized by a well-designed loss function which can improve the accuracy rate in finding nearest label ulteriorly.
|
| 155 |
+
• We only consider perceptual distance in this paper, but semantic distance also has its significance for reference of confusing people in the label space. We may take the semantic tree into consideration and make a trade off between perceptual distance and semantic distance in future research.
|
| 156 |
+
|
| 157 |
+
# REFERENCES
|
| 158 |
+
|
| 159 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, pp. 39–57. IEEE, 2017.
|
| 160 |
+
|
| 161 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255. Ieee, 2009.
|
| 162 |
+
|
| 163 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9185–9193, 2018.
|
| 164 |
+
|
| 165 |
+
Ian Goodfellow, Shlens Jonathon, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference of Learning Representation, 2015.
|
| 166 |
+
|
| 167 |
+
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.
|
| 168 |
+
|
| 169 |
+
Jeff Henrikson. Completeness and total boundedness of the hausdorff metric. MIT Undergraduate Journal of Mathematics, 1:69–80, 1999.
|
| 170 |
+
|
| 171 |
+
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, 2012a.
|
| 172 |
+
|
| 173 |
+
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, 2012b.
|
| 174 |
+
|
| 175 |
+
Yann LeCun, Koray Kavukcuoglu, and Clement Farabet. Convolutional networks and applications ´ in vision. In Proceedings of 2010 IEEE International Symposium on Circuits and Systems, pp. 253–256. IEEE, 2010.
|
| 176 |
+
|
| 177 |
+
Tsung Yu Lin, Aruni Roychowdhury, and Subhransu Maji. Bilinear cnn models for fine-grained visual recognition. In IEEE International Conference on Computer Vision, 2016.
|
| 178 |
+
|
| 179 |
+
Apostolos Modas, Moosavi-Dezfooli Seyed-Mohsen, and Ecole Polytechnique Federale de Lausanne Pascal Frossard. Sparsefool: a few pixels make a big difference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 180 |
+
|
| 181 |
+
S. Moosavi-Dezfooli, O. Fawzi A. Fawzi, and P. Frossard. Universal adversarial perturbations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 182 |
+
|
| 183 |
+
Art Owen and Yi Zhou. Safe and effective importance sampling. Journal of the American Statistical Association, 95(449):135–143, 2000.
|
| 184 |
+
|
| 185 |
+
Johann Pfanzagl. Parametric statistical theory. Walter de Gruyter, 2011. ISBN 3-11-013863-8.
|
| 186 |
+
|
| 187 |
+
Ekta Prashnani, Hong Cai, Yasamin Mostofi, and Pradeep Sen. PieAPP: Perceptual image-error assessment through pairwise preference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1808–1817, 2018.
|
| 188 |
+
|
| 189 |
+
Seyed-Mohsen, Moosavi-Dezfooli, Pascal Frossard Alhussein Fawzi, and Ecole Polytechnique Federale de Lausanne. DeepFool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 190 |
+
|
| 191 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 192 |
+
|
| 193 |
+
Jiawei Su, Danilo Vasconcellos Vargas, and Kouichi Sakurai. One pixel attack for fooling deep neural networks. IEEE Transactions on Evolutionary Computation, 2019. doi: 10.1109/TEVC. 2019.2890858.
|
| 194 |
+
|
| 195 |
+
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.
|
| 196 |
+
|
| 197 |
+
Xun Wang, Xintong Han, Weilin Huang, Dengke Dong, and Matthew R Scott. Multi-similarity loss with general pair weighting for deep metric learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5022–5030, 2019.
|
| 198 |
+
|
| 199 |
+
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. In International Conference of Learning Representation, 2019.
|
| 200 |
+
|
| 201 |
+
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.
|
| 202 |
+
|
| 203 |
+
# A AN INTERFACE PRESENTATION OF THE SUBJECTIVE EXPERIMENT
|
| 204 |
+
|
| 205 |
+
Figure 6 shows the interface of our subjective experiments.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Note:Please determine whether the label given is the correct label for the picture.
|
| 209 |
+
Figure 6: Interface presentation of our subjective experiment.
|
| 210 |
+
|
| 211 |
+
# B EXAMPLES FOR ANIMAL CLASSES
|
| 212 |
+
|
| 213 |
+
Figure 7 shows three examples for animal classes to demonstrate that LabelFool makes fine-grained changes but other methods make some ridiculous changes instead.
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
|
| 217 |
+
Figure 7: Three examples for animal images. The first column shows the clean image. The second column shows the ground truth label and other columns show the label after attacked.
|
| 218 |
+
|
| 219 |
+
# C ORIGINAL DATA FOR FIGURE 3 AND 4
|
| 220 |
+
|
| 221 |
+
Table 3 is the original data for Figure 3. The original data of perceptibility, perceptual similarity, PieAPP in Figure 4 is reported in Table 4, 5, 6 respectively. It is provided for the sake of convince if anyone wants to rewrite Figure 3 or 4.
|
| 222 |
+
|
| 223 |
+
Table 3: Data for Figure 3
|
| 224 |
+
|
| 225 |
+
<table><tr><td colspan="2">Index</td><td>DeepFool</td><td>LabelFool</td><td>FGSM</td><td>SparseFool</td></tr><tr><td>Total</td><td>Performance Gain</td><td>1.68</td><td>1.71</td><td>1.39</td><td>1.34</td></tr><tr><td>Animal</td><td>Performance Gain</td><td>3.55</td><td>4.04</td><td>3.11</td><td>3.00</td></tr></table>
|
| 226 |
+
|
| 227 |
+
Table 4: Perceptibility Data for Figure 4
|
| 228 |
+
|
| 229 |
+
<table><tr><td>Model</td><td>DeepFool</td><td>LabelFool</td><td>FGSM</td><td>SparseFool</td></tr><tr><td>ResNet-50</td><td>3.36E-05</td><td>4.75E-05</td><td>6.55E-04</td><td>2.56E-03</td></tr><tr><td>ResNet-34</td><td>3.35E-05</td><td>4.84E-05</td><td>6.59E-04</td><td>2.56E-03</td></tr><tr><td>VGG-19bn</td><td>3.18E-05</td><td>3.80E-05</td><td>6.44E-04</td><td>2.56E-03</td></tr><tr><td>AlexNet</td><td>3.59E-05</td><td>7.24E-05</td><td>6.68E-04</td><td>2.56E-03</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 5: Perceptual Similarity Data for Figure 4
|
| 232 |
+
|
| 233 |
+
<table><tr><td>Model</td><td>DeepFool</td><td>LabelFool</td><td>FGSM</td><td>SparseFool</td></tr><tr><td>ResNet-50</td><td>1.48E-3</td><td>5.64E-3</td><td>0.20</td><td>0.42</td></tr><tr><td>ResNet-34</td><td>1.39E-3</td><td>5.91E-3</td><td>0.20</td><td>0.41</td></tr><tr><td>VGG-19bn</td><td>6.86E-4</td><td>2.54E-3</td><td>0.18</td><td>0.41</td></tr><tr><td>AlexNet</td><td>1.34E-2</td><td>3.50E-2</td><td>0.30</td><td>0.40</td></tr></table>
|
| 234 |
+
|
| 235 |
+
Table 6: PieAPP Data for Figure 4
|
| 236 |
+
|
| 237 |
+
<table><tr><td>Model</td><td>DeepFool</td><td>LabelFool</td><td>FGSM</td><td>SparseFool</td></tr><tr><td>ResNet-50</td><td>0.07</td><td>0.14</td><td>1.35</td><td>1.57</td></tr><tr><td>ResNet-34</td><td>0.07</td><td>0.15</td><td>1.31</td><td>1.46</td></tr><tr><td>VGG-19bn</td><td>0.05</td><td>0.08</td><td>1.27</td><td>1.59</td></tr><tr><td>AlexNet</td><td>0.07</td><td>0.21</td><td>1.28</td><td>1.21</td></tr></table>
|
| 238 |
+
|
| 239 |
+
# D AN EXAMPLE FOR SECTION 4.3
|
| 240 |
+
|
| 241 |
+
This is an example to illustrate why our method has the highest attack rate. We only give an example of DeepFool and LabelFool. SparseFool and FGSM have similar effects with DeepFool.
|
| 242 |
+
|
| 243 |
+
Figure 8 is an example where the classifier fail to give a correct classification for the input image $x$ . The ground truth of $x$ is class 2 while the predicted class is class 3. In this example, DeepFool takes class 3 as the true class. Then DeepFool finds the nearest class to class 3 in the feature space which is class 2 in this example, and moves the input image towards class 2. When the perturbed image is classified as class 2 which is different from the predicted class, DeepFool considers the attack succeed and stops the algorithm. However, it fails to attack actually because class 2 is the true class of $x$ .
|
| 244 |
+
|
| 245 |
+
Different from DeepFool, LabelFool sample top 3 classes in this example because their probabilities are larger than 0.01 and compute the expected distance between each class in the dataset and these 3 classes (Eq.(3)). Finally, LabelFool choose class 394 as the target class because it has the minimum expected distance with top 3 classes. By moving $x$ towards class 394, LabelFool attacks successfully.
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 8: The line chart in the right part shows the top 10 elements in $\hat { p }$ , when an image $x$ whose ground truth class is class 2 is given into the classifier VGG 19bn. The horizontal axis represents the class and the vertical axis represents the probability that $x$ belongs to this class. The predicted class $\hat { l } _ { x }$ is class 3 and it means the classifier fail to give a correct classification.
|
| 249 |
+
|
| 250 |
+
# E SUPPLEMENTARY EXAMPLES FOR LABELFOOL
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 9: Some other examples for illustrating what LabelFool does. The first column shows the clean image. The second column shows the ground truth label and other columns show the label after attacked.
|
| 254 |
+
|
| 255 |
+
# F AN APPLICATION: FACE RECOGNITION
|
| 256 |
+
|
| 257 |
+
Figure 10 is an application to show it is necessary to generate imperceptible adversarial examples in the label space even for image classification tasks. We take face recognition system for entrance as an example. In Figure 10, A is the person who is using the face system to go into the gate. LabelFool aims to let the system misclassify A and B who is the one looks like A, but other untargeted attacks may let the system misclassify A an C who looks totally different from A. The attack is easy to be detected by the guard if the system misclassifies A and C, but it is hard to detect if the system misclassifies A and B. Letting a fake B in will bring great potential risks to security and safety.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 10: A is the person who is using a face system to enter the gate. Green lines represent what LabelFool aims to do, that is to miscalssify A and B who looks like A. Red lines represent what other untargeted attacks do. They misclassify A and C who looks totally different from A and this error is easy to be detected by the guard.
|
md/train/r1ltgp4FwS/r1ltgp4FwS.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TEMPORAL COHERENCE VIA SELFSUPERVISION FOR GAN-BASED VIDEO GENERATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We focus on temporal self-supervision for GAN-based video generation tasks. While adversarial training successfully yields generative models for a variety of areas, temporal relationship in the generated data is much less explored. This is crucial for sequential generation tasks , e.g. video super-resolution and unpaired video translation. For the former, state-of-the-art methods often favor simpler norm losses such as $L ^ { 2 }$ over adversarial training. However, their averaging nature easily leads to temporally smooth results with an undesirable lack of spatial detail. For unpaired video translation, existing approaches modify the generator networks to form spatio-temporal cycle consistencies. In contrast, we focus on improving the learning objectives, and propose a temporally self-supervised algorithm. For both tasks, we show that temporal adversarial learning is key to achieving temporally coherent solutions without sacrificing spatial detail. We also propose a novel Ping-Pong loss to improve the long-term temporal consistency. It effectively prevents recurrent networks from accumulating artifacts temporally without depressing detailed features. We also propose a first set of metrics to quantitatively evaluate the accuracy as well as the perceptual quality of the temporal evolution. A series of user studies confirms the rankings computed with these metrics.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative adversarial models (GANs) have been extremely successful at learning complex distributions such as natural images (Zhu et al., 2017; Isola et al., 2017). However, for sequence generation, directly applying GANs without carefully engineered constraints typically results in strong artifacts over time due to the significant difficulties introduced by the temporal changes. In particular, conditional video generation tasks are very challenging learning problems where generators should not only learn to represent the data distribution of the target domain, but also learn to correlate the output distribution over time with conditional inputs. Their central objective is to faithfully reproduce the temporal dynamics of the target domain and not resort to trivial solutions such as features that arbitrarily appear and disappear over time.
|
| 12 |
+
|
| 13 |
+
In our work, we propose a novel adversarial learning method for a recurrent training approach that supervises both spatial content as well as temporal relationships. We apply our approach to two video-related tasks that offer substantially different challenges: video super-resolution (VSR) and unpaired video translation (UVT). With no ground truth motion available, the spatio-temporal adversarial loss and the recurrent structure enable our model to generate realistic results while keeping the generated structures coherent over time. With the two learning tasks we demonstrate how spatio-temporal adversarial training can be employed in paired as well as unpaired data domains. In addition to the adversarial network which supervises the short-term temporal coherence, long-term consistency is self-supervised using a novel bi-directional loss formulation, which we refer to as “Ping-Pong” (PP) loss in the following. The PP loss effectively avoids the temporal accumulation of artifacts, which can potentially benefit a variety of recurrent architectures. The central contributions of our work are: a spatio-temporal discriminator unit together with a careful analysis of training objectives for realistic and coherent video generation tasks, a novel PP loss supervising long-term consistency, in addition to a set of metrics for quantifying temporal coherence based on motion estimation and perceptual distance. Together, our contributions lead to models that outperform previous work in terms of temporally-coherent detail, which we quantify with a wide range of metrics and user studies.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: When learning a mapping between Trump and Obama, the CycleGAN model gives good spatial features, but collapses to essentially static outputs of Obama. It manages to transfer facial expressions back to Trump using tiny differences encoded in its Obama outputs, instead of learning a meaningful mapping. Being able to establish the correct temporal cycle-consistency between domains, ours and RecycleGAN can generate correct blinking motions. Our model outperforms the latter in terms of coherent detail that is generated.
|
| 17 |
+
|
| 18 |
+
# 2 RELATED WORK
|
| 19 |
+
|
| 20 |
+
Deep learning has made great progress for image generation tasks. While regular losses such as $L ^ { 2 }$ (Kim et al., 2016; Lai et al., 2017) offer good performance for image super-resolution (SR) tasks in terms of PSNR metrics, GAN researchers found adversarial training (Goodfellow et al., 2014) to significantly improve the perceptual quality in multi-modal problems including image SR (Ledig et al., 2016), image translations (Zhu et al., 2017; Isola et al., 2017), and others. Perceptual metrics (Zhang et al., 2018; Prashnani et al., 2018) are proposed to reliably evaluate image similarity by considering semantic features instead of pixel-wise errors.
|
| 21 |
+
|
| 22 |
+
Video generation tasks, on the other hand, require realistic results to change naturally over time. Recent works in VSR improve the spatial detail and temporal coherence by either using multiple low-resolution (LR) frames as inputs (Jo et al., 2018; Tao et al., 2017; Liu et al., 2017), or recurrently using previously estimated outputs (Sajjadi et al., 2018). The latter has the advantage to re-use high-frequency details over time. In general, adversarial learning is less explored for VSR and applying it in conjunction with a recurrent structure gives rise to a special form of temporal mode collapse, as we will explain below. For video translation tasks, GANs are more commonly used but discriminators typically only supervise the spatial content. E.g., Zhu et al. (2017) does not employ temporal constrains and generators can fail to learn the temporal cycle-consistency. In order to learn temporal dynamics, RecycleGAN (Bansal et al., 2018) proposes to use a prediction network in addition to a generator, while a concurrent work (Chen et al., 2019) chose to learn motion translation in addition to spatial content translation. Being orthogonal to these works, we propose a spatiotemporal adversarial training for both VSR and UVT and we show that temporal self-supervision is crucial for improving spatio-temporal correlations without sacrificing spatial detail. While $L ^ { 2 }$ temporal losses based on warping are used to enforce temporal smoothness in video style transfer tasks (Ruder et al., 2016; Chen et al., 2017), concurrent GAN-based VSR work (Perez-Pellitero ´ et al., 2018) and UVT work (Park et al., 2019), it leads to an undesirable smooth over spatial detail and temporal changes in outputs. Likewise, the $L ^ { 2 }$ temporal metric represents a sub-optimal way to quantify temporal coherence and perceptual metrics that evaluate natural temporal changes are unavailable up to now. We work on this open issue, propose two improved temporal metric and demonstrate the advantages of temporal self-supervision over direct temporal losses.
|
| 23 |
+
|
| 24 |
+
Previous work, e.g. tempoGAN (Xie et al., 2018) and vid2vid (Wang et al., 2018b), have proposed adversarial temporal losses to achieve time consistency. While tempoGAN employs a second temporal discriminator with multiple aligned frames to assess the realism of temporal changes, it is not suitable for videos, as it relies on ground truth motions and employs a single-frame processing that is sub-optimal for natural images. On the other hand, vid2vid focuses on paired video translations and proposes a video discriminator based on a conditional motion input that is estimated from the ??௧ିଵ ??௧ ??௧ାଵ { }x3 ?? { paired ground-truth sequences. We focus on more difficult unpaired translation tasks instead, and ?? ௧ିଵ Conditional LR Triplet ?? Static Triplet ?? or Stati demonstrate the gains in quality of our approach in the evaluation section. For tracking and optical ?? flow estimation, L2-based time-cycle losses (Wang et al., 2019) were proposed to constrain motions௧ିଵ ??௧ ௧ାଵ ௧ିଵ ௧ ௧ାଵ+ ??௧ିଵ ??௧ ??௧ାଵ ??௧ିଵor and tracked correspondences using symmetric video inputs. By optimizing indirectly via motionFrame- Original Triplet ?? Origi compensation or tracking, this loss improves the accuracy of the results. For video generation, weRecurrent ??௧ ??௧ିଵ ??௧ାଵ ??௧ ??௧ିଵ ??௧ାଵ ?? ??௧ିଵ ??௧ାଵ ??௧ିଵ propose a PP loss that also makes use of symmetric sequences. However, we directly constrainGenerator Warped Triplet ?? Warped Triplet ?? ?? ?? ??or the PP loss via the generated video content, which successfully improves the long-term temporal௪ consistency in the video results.
|
| 25 |
+
|
| 26 |
+
# 3 LEARNING TEMPORALLY COHERENT CONDITIONAL VIDEO GENERATION
|
| 27 |
+
|
| 28 |
+
Generative Network Before explaining the temporal self-supervision in more detail, we outline the gener→ative model to be supervised. Our generator networks ??௧produce image sequences in a frame-recurrent manner with the help of a recurrent generator G and a flow estimator $F$ ??→. We follow previous work (Sajjadi et al., 2018), where $\mathbf { G }$ produces output $g _ { t }$ in the target doDomain main B from conditional input frame $a _ { t }$ Dfrom the in??→ ??→put domain A, and recursively uses the previous generated output $g _ { t - 1 }$ . $F$ →is trained to estimate the motion $v _ { t }$ between $a _ { t - 1 }$ and $a _ { t }$ ௧, which is then used as a motion compensation that aligns $g _ { t - 1 }$ ??→to the current frame. This procedure, also shown in Fig. 2a), can be summarized as: $g _ { t } = \mathbf { G } ( a _ { t } , W ( g _ { t - 1 } , v _ { t } ) { \bar { ) } }$ , where $v _ { t } =$ $\Gamma ( a _ { t - 1 } , a _ { t } )$ and $W$ is the warping operation. While one generator is enough to map data from A to B for paired tasks such as VSR, unpaired generation requires a second generator to establish cycle consis??→tency. (Zhu et al., 2017). In the UVT task, we use two recurrent generators, mapping from domain A to B and back. As shown in Fig. 2b), given $g _ { t } ^ { a b } = { \bf G } _ { \mathrm { a b } } ( a _ { t } , \tilde { W ( } g _ { t - 1 } ^ { a b } , v _ { t } ) )$ ??, we can use $a _ { t }$ as the labeled data of $g _ { t } ^ { a b a } = \mathrm { G } _ { \mathrm { b a } } ( g _ { t } ^ { a b } , W ( g _ { t - 1 } ^ { a b a } , v _ { t } ) )$ to enforce consistency. A ResNet architecture ?? ??→ →is used for the VSR generator G and a encoder-decoder structure is applied to UVT generators and $F$ . We intentionally keep generators simple and in line with previous work, in order to demonstrate Domain BDomain Athe advantages of the temporal self-supervision that we will explain in the following paragraphs.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: a) G. b) The UVT cycle link using recurrent G.
|
| 32 |
+
|
| 33 |
+
௧Spatio-Temporal Adversarial Self-Supervision The central ??௧ିଵbuilding block of our approach is a novel spatio-temporal discriminator $D _ { s , t }$ ௧ ??that receives triplets of frames. This contrasts with typically used spatial discriminators which supervise only a single image. By concatenating multiple adjacent frames along Frame-the channel dimension, the frame triplets form an important building block for learning because they can provide networks with gradient information regarding the realism of spatial structures as well as short-term temporal information, such as first- and second-order time derivatives.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 3: Conditional VSR $D _ { s , t }$
|
| 37 |
+
|
| 38 |
+
We propose a $D _ { s , t }$ architecture, illustrated in Fig. 3 and Fig. 4, that primarily receives two types of triplets: three adjacent frames and the corresponding warped ones. We warp later frames backward and previous ones forward. While original frames contain the full spatio-temporal information, warped frames more easily yield temporal information with their aligned content. For the input variants we use the following notation: $\begin{array} { r c l } { \operatorname { I } _ { g } } & { = } & { \big \{ g _ { t - 1 } , g _ { t } , g _ { t + 1 } \big \} , \operatorname { I } _ { b } } & { = } & { \big \{ b _ { t - 1 } , b _ { t } , b _ { t + 1 } \big \} } \end{array}$ ; $\operatorname { I } _ { w g } = \{ W ( g _ { t - 1 } , v _ { t } ) , g _ { t } , W ( g _ { t + 1 } , v _ { t } ^ { \prime } ) \}$ , $\operatorname { I } _ { w b } = \{ W ( b _ { t - 1 } , v _ { t } ) , b _ { t } , W ( b _ { t + 1 } , v _ { t } ^ { \prime } ) \}$ .
|
| 39 |
+
|
| 40 |
+
For VSR tasks, $D _ { s , t }$ should guide the generator to learn the correlation between LR inputs and highresolution (HR) targets. Therefore, three LR frames $\mathrm { I } _ { a } = \{ a _ { t - 1 } , a _ { t } , a _ { t + 1 } \}$ from the input domain are used as a conditional input. The input of $D _ { s , t }$ can be summarized as $\mathrm { I } _ { s , t } ^ { b } = \left\{ \mathrm { I } _ { b } , \mathrm { I } _ { w b } , \mathrm { I } _ { a } \right\}$ labelled as real and the generated inputs $\mathrm { I } _ { s , t } ^ { g } = \{ \mathrm { I } _ { g } , \mathrm { I } _ { w g } , \mathrm { I } _ { a } \}$ labelled as fake. In this way, the conditional $D _ { s , t }$ will penalize $G$ if $\mathrm { I } _ { g }$ contains less spatial details or unrealistic artifacts according to $\mathrm { I } _ { a } , \mathrm { I } _ { b }$ . At the same time, temporal relationships between the generated images $\mathrm { I } _ { w g }$ and those of the ground truth $\mathrm { I } _ { w b }$ should match. With our setup, the discriminator profits from the warped frames to classify realistic and unnatural temporal changes, and for situations where the motion estimation is less accurate, the discriminator can fall back to the original, i.e. not warped, images.
|
| 41 |
+
|
| 42 |
+
For UVT tasks, we demonstrate that the temporal cycle??௧ିଵ Conditional LR Triplet ??௧consistency between different domains can be established using ௧ ??the supervision of unconditional spatio-temporal discriminators. ??௧ିଵ ??௧ ??௧ାଵ ??௧ିଵ ??௧ ??௧ାଵ+This is in contrast to previous work which focuses on the generaOriginal Triplet ?? Original Triplet ??tive networks to form spatio-temporal cycle links. Our approach Frame- ?? ?? ?? ??actually yields improved results, as we will show below, and Generator ௧ ?? ?? ௧ ??+ ??Fig. 1 shows a preview of the quality that can be achieved using Warped Triplet ??௪ Warped Triplet ??௪spatio-temporal discriminators. In practice, we found it crucial to ensure that generators first learn reasonable spatial features, and ௦,௧only then improve their temporal correlation. Therefore, different to the $D _ { s , t }$ 0/1௧ of VST that always receives 3 concatenated triplets as an input, the unconditional $D _ { s , t }$ of UVT only takes one triplet at a time. Focusing on the generated data, the input for a single batch can either be a static triplet of $\operatorname { I } _ { s g } = \{ g _ { t } , g _ { t } , g _ { t } \}$ , the warped triplet $\mathrm { I } _ { w g }$ , or the original triplet $\mathrm { I } _ { g }$ . The same holds for the reference data of the target domain, as shown in Fig. 4. With sufficient but complex information contained in these triplets, transition techniques are applied so that ??→ ??the network can consider the spatio-temporal information step by step, i.e., we initially start with $100 \%$ static triplets $\mathrm { I } _ { s g }$ ?? ??→as the input. Then, over the course of training, $2 5 \%$ → of them transition to $\mathrm { I } _ { w g }$ triplets with simpler temporal information, with another $2 5 \%$ ??௧ transition to $\mathrm { I } _ { g }$ ??௧afterwards, leading to a $( 5 0 \% , 2 5 \% , 2 5 \% )$ ?? ??→ → → ??→ distribution of triplets. Details of the transition calculations are given in Appendix D. Here, the warping is again performed via $F$ .
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 4: Unconditional UVT $D _ { s , t }$
|
| 46 |
+
|
| 47 |
+
??While non-adversarial training typically employs loss formulations with static goals, the GAN train??௧ିଵ ??௧ିଵ ??→ing yields dynamic goals due to discriminative networks discovering the learning objectives over ??௧??→ ??௧??௧→the course of the training run. Therefore, their inputs have strong influence on the training process ??and the final results. Modifying the inputs in a controlled manner can lead to different results and → substantial improvements if done correctly, as will be shown in Sec. 4. Although the proposed concatenation of several frames seems like a simple change that has been used in a variety of projects, it is an important operation that allows discriminators to understand spatio-temporal data distributions. As will be shown below, it can effectively reduce temporal problems encountered by spatial GANs. While $L ^ { 2 }$ −based temporal losses are widely used in the field of video generation, the spatiotemporal adversarial loss is crucial for preventing the inference of blurred structures in multi-modal data-sets. Compared to GANs using multiple discriminators, the single $D _ { s , t }$ network can learn to balance the spatial and temporal aspects from the reference data and avoid inconsistent sharpness as well as overly smooth results. Additionally, by extracting shared spatio-temporal features, it allows for smaller network sizes.
|
| 48 |
+
|
| 49 |
+
Self-Supervision for Long-term Temporal Consistency When relying on a previous output as input, i.e., for frame-recurrent architectures, generated structures easily accumulate frame by frame. In an adversarial training, generators learn to heavily rely on previously generated frames and can easily converge towards strongly reinforcing spatial features over longer periods of time. For videos, this especially occurs along directions of motion, and these solutions can be seen as a special form of temporal mode collapse. We have noticed this issue in a variety of recurrent architectures, examples are shown in Fig. 5 a) and the Dst in Fig. 1. While this issue could be alleviated by training with longer sequences, we generally want generators to be able to work with sequences of arbitrary length for inference. To address this inherent problem of recurrent generators, we propose a new bi-directional “Ping-Pong” loss. For natural videos, a sequence with forward order as well as its reversed counterpart offer valid information. Thus, from any input of length $n$ , we can construct a symmetric PP sequence in form of $a _ { 1 } , . . . a _ { n - 1 } , a _ { n } , a _ { n - 1 } , . . . a _ { 1 }$ as shown in Fig. 5. When inferring this in a frame-recurrent manner, the generated result should not strengthen any invalid features from frame to frame. Rather, the result should stay close to valid information and be symmetric, i.e., the forward result $g _ { t } = G ( a _ { t } , g _ { t - 1 } )$ and the one generated from the reversed part, $g _ { t } ^ { \prime } = G ( a _ { t } ,$ , $g _ { t + 1 } ^ { \prime } )$ , should be identical. Based on this observation, we train our networks with extended PP sequences and constrain the generated outputs from both “legs” to be the same using the loss: $\begin{array} { r } { \dot { \mathcal { L } _ { p p } } = \sum _ { i = 1 } ^ { n - 1 } \| g _ { t } - g _ { t } ^ { \prime } \| _ { 2 } . } \end{array}$ . Note that in contrast to the generator loss, the $L ^ { 2 }$ norm is a correct choice here: We are not faced with multi-modal data where an $L ^ { 2 }$ norm would lead to undesirable averaging, but rather aim to constrain the recurrent generator to its own, unique version over time. The PP terms provide constraints for short term consistency via $\lVert g _ { n - 1 } - { g _ { n - 1 } } ^ { \prime } \rVert _ { 2 }$ , while terms such as $\left\| g _ { 1 } - { g _ { 1 } } ^ { \prime } \right\| _ { 2 }$ prevent long-term drifts of the results. As shown in Fig. 5(b), this PP loss successfully removes drifting artifacts while appropriate high-frequency details are preserved. In addition, it effectively extends the training data set, and as such represents a useful form of data augmentation. A comparison is shown in Appendix E to disentangle the effects of the augmentation of PP sequences and the temporal constrains. The results show that the temporal constraint is the key to reliably suppressing the temporal accumulation of artifacts, achieving consistency, and allowing models to infer much longer sequences than seen during training.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 5: a) Result without PP loss. The VSR network is trained with a recurrent frame-length of 10. When inference on long sequences, frame 15 and latter frames of the foliage scene show the drifting artifacts. b) Result trained with PP loss. These artifacts are removed successfully for the latter. c) The ground-truth image. With our PP loss (shown on the right), the $L ^ { 2 }$ distance between $g _ { t }$ and $g _ { t } ^ { \prime }$ is minimized to remove drifting artifacts and improve temporal coherence.
|
| 53 |
+
|
| 54 |
+
Perceptual Loss Terms As perceptual metrics, both pre-trained NNs (Johnson et al., 2016; Wang et al., 2018a) and in-training discriminators (Xie et al., 2018) were successfully used in previous work. Here, we use feature maps from a pre-trained VGG-19 network (Simonyan & Zisserman, 2014), as well as $D _ { s , t }$ itself. In the VSR task, we can encourage the generator to produce features similar to the ground truth ones by increasing the cosine similarity between their feature maps. In UVT tasks without paired ground truth data, we still want the generators to match the distribution of features in the target domain. Similar to a style loss in traditional style transfer (Johnson et al., 2016), we here compute the $D _ { s , t }$ feature correlations measured by the Gram matrix instead. The feature maps of $D _ { s , t }$ contain both spatial and temporal information, and hence are especially well suited for the perceptual loss.
|
| 55 |
+
|
| 56 |
+
Loss and Training Summary We now explain how to integrate the spatio-temporal discriminator into the paired and unpaired tasks. We use a standard discriminator loss for the $D _ { s , t }$ of VSR and a least-square discriminator loss for the $D _ { s , t }$ of UVT. Correspondingly, a non-saturated $\mathcal { L } _ { a d v }$ is used for the $G$ and $F$ of VSR, and a least-squares one is used for the UVT generators. As summarized in Table 1, $G$ and $F$ are trained with the mean squared loss $\mathcal { L } _ { \mathrm { c o n t e n t } }$ , adversarial losses $\mathcal { L } _ { a d v }$ , perceptual losses $\mathcal { L } _ { \phi }$ , the PP loss ${ \mathcal { L } } _ { \mathrm { P P } }$ , and a warping loss ${ \mathcal { L } } _ { \mathrm { w a r p } }$ , where again $g , b$ and $\Phi$ stand for generated samples, ground truth images and feature maps of VGG-19 or $D _ { s , t }$ . We only show losses for the mapping from A to B for UVT tasks, as the backward mapping simply mirrors the terms. We refer to our full model for both tasks as TecoGAN below.1 Training parameters and details are given in Appendix G.
|
| 57 |
+
|
| 58 |
+
Table 1: Summary of loss terms.
|
| 59 |
+
|
| 60 |
+
<table><tr><td rowspan=1 colspan=1>Loss for</td><td rowspan=1 colspan=1>VSR,Ds,t</td><td rowspan=1 colspan=2>UVT,D,t</td></tr><tr><td rowspan=1 colspan=1>LDs,t</td><td rowspan=1 colspan=1>-Eb~Pb(b)[log D(b,t)]-Ea~pa(a)[log(1- D(1g,t))]</td><td rowspan=1 colspan=2>Eb~p(b)[D(b,t)-1]²+Ea~p(a)[D(1g,t)]²</td></tr><tr><td rowspan=1 colspan=1>Loss for</td><td rowspan=1 colspan=1>VSR,G&F</td><td rowspan=1 colspan=2>UVT, Gab</td></tr><tr><td rowspan=1 colspan=1>LG,F</td><td rowspan=1 colspan=3>XcLcontent +XaLadv+XL+XpLPp+XwLwarp</td></tr><tr><td rowspan=1 colspan=1>Lcontent</td><td rowspan=1 colspan=1>llgt-btll2</td><td rowspan=1 colspan=1>1lg→b-a-all2+</td><td rowspan=1 colspan=1>1g-a6-bll2</td></tr><tr><td rowspan=1 colspan=1>Ladv</td><td rowspan=1 colspan=1>-Ea~pa(a)[log Ds,t(1g,t)]</td><td rowspan=1 colspan=2>-Ba~pa(aDg2</td></tr><tr><td rowspan=1 colspan=1>L</td><td rowspan=1 colspan=1>1.0-(1,t)*Φ(,t)/(1g,t)*,t</td><td rowspan=1 colspan=2>GM(Φ(g,t))-GM(Φ(,t))2</td></tr><tr><td rowspan=1 colspan=1>LPP</td><td rowspan=1 colspan=3>∑-1gt-9t/12</td></tr><tr><td rowspan=1 colspan=1>Lwarp</td><td rowspan=1 colspan=1>∑llat-W(at-1,F(at-1,at))ll2</td><td rowspan=1 colspan=2>0.0,apre-trainedFis used</td></tr></table>
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 6: In VSR of the foliage scene, adversarial models (ENet, DsOnly, DsDt, DsDtPP, TecoGANand TecoGAN) yield better perceptual quality than methods using $L ^ { 2 }$ loss (FRVSR and DUF). In temporal profiles on the right, DsDt, DsDtPP and TecoGAN show significantly less temporal discontinuities compared to ENet and DsOnly. The temporal information of our discriminators successfully suppresses these artifacts.
|
| 64 |
+
|
| 65 |
+
# 4 ANALYSIS AND EVALUATION OF LEARNING OBJECTIVES
|
| 66 |
+
|
| 67 |
+
In the following, we illustrate the effects of temporal supervision using two ablation studies. In the first one, models trained with ablated loss functions show how ${ \mathcal { L } } _ { \mathrm { a d v } }$ and $\mathcal { L } _ { \mathrm { P P } }$ change the overall learning objectives. Next, full UVT models are trained with different $D _ { s , t }$ inputs. This highlights how differently the corresponding discriminators converge to different spatio-temporal equilibriums, and the general importance of providing suitable data distributions from the target domain. While we provide qualitative and quantitative evaluations in the following, we also refer the reader to our supplemental html document 2, with video clips that more clearly highlight the temporal differences.
|
| 68 |
+
|
| 69 |
+
Loss Ablation Study Below we compare variants of our full TecoGAN model to EnhanceNet (ENet) (Sajjadi et al., 2017), FRVSR (Sajjadi et al., 2018), and DUF (Jo et al., 2018) for VSR, and CycleGAN (Zhu et al., 2017) and RecycleGAN (Bansal et al., 2018) for UVT. Specifically, ENet and CycleGAN represent state-of-the-art single-image adversarial models without temporal information, FRVSR and DUF are state-of-the-art VSR methods without adversarial losses, and RecycleGAN is a spatial adversarial model with a prediction network learning the temporal evolution.
|
| 70 |
+
|
| 71 |
+
For VSR, we first train a DsOnly model that uses a frame-recurrent $G$ and $F$ with a VGG-19 loss and only the regular spatial discriminator. Compared to ENet, which exhibits strong incoherence due to the lack of temporal information, DsOnly improves temporal coherence thanks to the framerecurrent connection, but there are noticeable high-frequency changes between frames. The temporal profiles of DsOnly in Fig. 6 and 8, correspondingly contain sharp and broken lines. When adding a temporal discriminator in addition to the spatial one $( D s D t )$ , this version generates more coherent results, and its temporal profiles are sharp and coherent. However, DsDt often produces the drifting artifacts discussed in Sec. 3, as the generator learns to reinforce existing details from previous frames to fool $D _ { s }$ with sharpness, and satisfying $D _ { t }$ with good temporal coherence in the form of persistent detail. While this strategy works for generating short sequences during training, the strengthening effect can lead to very undesirable artifacts for long-sequence inferences. By adding the self-supervision for long-term temporal consistency $\mathcal { L } _ { p p }$ , we arrive at the $D s D t P P$ model, which effectively suppresses these drifting artifacts with an improved temporal coherence. In Fig. 6 and Fig. 8, DsDtPP results in continuous yet detailed temporal profiles without streaks from temporal drifting. Although DsDtPP generates good results, it is difficult in practice to balance the generator and the two discriminators. The results shown here were achieved only after numerous runs manually tuning the weights of the different loss terms. By using the proposed $D _ { s , t }$ discriminator instead, we get a first complete model for our method, denoted as $T e c o G A N ^ { \odot }$ . This network is trained with a discriminator that achieves an excellent quality with an effectively halved network size, as illustrated on the right of Fig. 7. The single discriminator correspondingly leads to a significant reduction in resource usage. Using two discriminators requires ca. $70 \%$ more GPU memory, and leads to a reduced training performance by ca. $20 \%$ . The TecoGANmodel yields similar perceptual and temporal quality to DsDtPP with a significantly faster and more stable training.
|
| 72 |
+
|
| 73 |
+
Since the TecoGANmodel requires less training resources, we also trained a larger generator with $50 \%$ more weights. In the following we will focus on this larger single-discriminator architecture with PP loss as our full TecoGAN model for VSR. Compared to the TecoGANmodel, it can generate more details, and the training process is more stable, indicating that the larger generator and $D _ { s , t }$ are more evenly balanced. Result images and temporal profiles are shown in Fig. 6 and Fig. 8. Video results are shown in Sec. 4 of the supplemental material.
|
| 74 |
+
|
| 75 |
+
We also carry out a similar ablation study for the UVT task. Again, we start from a single-image GAN-based model, a CycleGAN variant which already has two pairs of spatial generators and discriminators. Then, we train the DsOnly variant by adding flow estimation via $F$ and extending the spatial generators to frame-recurrent ones. By augmenting the two discriminators to use the triplet inputs proposed in Sec. 3, we arrive at the Dst model with spatio-temporal discriminators, which does not yet use the PP loss. Although UVT tasks are substantially different from VSR tasks, the comparisons in Fig. 1 and Sec. 4.6 of our supplemental material yield similar conclusions. In these tests, we use renderings of 3D fluid simulations of rising smoke as our unpaired training data. These simulations are generated with randomized numerical simulations using a resolution of $6 4 ^ { 3 }$ for domain A and $2 5 6 ^ { \overline { { 3 } } }$ for domain B, and both are visualized with images of size $2 5 6 ^ { 2 }$ . Therefore, video translation from domain A to B is a tough task, as the latter contains significantly more turbulent and small-scale motions. With no temporal information available, the CycleGAN variant generates HR smoke that strongly flickers. The DsOnly model offers better temporal coherence by relying on its frame-recurrent input, but it learns a solution that largely ignores the current input and fails to keep reasonable spatio-temporal cycle-consistency links between the two domains. On the contrary, our $D _ { s , t }$ enables the Dst model to learn the correlation between the spatial and temporal aspects, thus improving the cycle-consistency. However, without $\mathcal { L } _ { p p }$ , the Dst model (like the DsDt model of VSR) reinforces detail over time in an undesirable way. This manifests itself as inappropriate smoke density in empty regions. Using our full TecoGAN model which includes $\mathcal { L } _ { p p }$ , yields the best results, with detailed smoke structures and very good spatio-temporal cycle-consistency.
|
| 76 |
+
|
| 77 |
+
For comparison, a DsDtPP model involving a larger number of separate networks, i.e. four discriminators, two frame-recurrent generators and the $F$ , is trained. By weighting the temporal adversarial losses from Dt with 0.3 and the spatial ones from Ds with 0.5, we arrived at a balanced training run. Although this model performs similarly to the TecoGAN model on the smoke dataset, the proposed spatio-temporal $D _ { s , t }$ architecture represents a more preferable choice in practice, as it learns a natural balance of temporal and spatial components by itself, and requires fewer resources. Continuing along this direction, it will be interesting future work to evaluate variants, such as a shared $D _ { s , t }$ for both domains, i.e. a multi-class classifier network.
|
| 78 |
+
|
| 79 |
+
Besides the smoke dataset, an ablation study for the Obama and Trump dataset from Fig. 1 shows a very similar behavior, as can be seen in the supplemental material.
|
| 80 |
+
|
| 81 |
+
Spatio-temporal Adversarial Equilibriums Our evaluation so far highlights that temporal adversarial learning is crucial for achieving spatial detail that is coherent over time for VSR, and for enabling the generators to learn the spatio-temporal correlation between domains in UVT. Next, we will shed light on the complex spatio-temporal adversarial learning objectives by varying the information provided to the discriminator network. The following tests $D _ { s , t }$ networks that are identical apart from changing inputs, and we focus on the smoke dataset.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 7: Visual summary of VSR models. LPIPS $\mathbf { \widetilde { x } }$ -axis) measures spatial detail and temporal coherence is measured by tLP (y-axis) and tOF (bubble size with smaller as better). The middle graph zooms in the reddashed-box region on the left, containing models in our ablation study. The right graph shows network sizes.
|
| 85 |
+
|
| 86 |
+
In order to learn the spatial and temporal features of the target domain as well as their correlation, the simplest input for $D _ { s , t }$ consists of only the original, unwarped triplets, i.e. $\{ \boldsymbol { \mathrm { I } } _ { g }$ or $\mathrm { I } _ { b } \big \}$ . Using these, we train a baseline model, which yields a sub-optimal quality: it lacks sharp spatial structures, and contains coherent but dull motions. Despite containing the full information, these input triplets prevent $D _ { s , t }$ from providing the desired supervision. For paired video translation tasks, the vid2vid network achieves improved temporal coherence by using a video discriminator to supervise the output sequence conditioned with the ground-truth motion. With no ground-truth data available, we train a vid2vid variant by using the estimated motions and original triplets, i.e $\{ \mathrm { I } _ { g } + F ( g _ { t - 1 } , g _ { t } ) + F ( g _ { t + 1 } , g _ { t } )$ or $\operatorname { I } _ { b } + F ( b _ { t - 1 } , b _ { t } ) + F ( b _ { t + 1 } , b _ { t } ) \big \}$ , as the input for $D _ { s , t }$ . However, the result do not significantly improve. The motions are only partially reliable, and hence don’t help for the difficult unpaired translation task. Therefore, the discriminator still fails to fully correlate spatial and temporal features. We then train a third model, concat, using the original triplets and the warped ones, i.e. $\{ \boldsymbol { \mathrm { I } } _ { g } + \boldsymbol { \mathrm { I } } _ { w g }$ or $\operatorname { I } _ { b } + \operatorname { I } _ { w b } \}$ . In this case, the model learns to generate more spatial details with a more vivid motion. I.e., the improved temporal information from the warped triplets gives the discriminator important cues. However, the motion still does not fully resemble the target domain. We arrive at our final TecoGAN model for UVT by controlling the composition of the input data: as outlined above, we first provide only static triplets $\{ \mathrm { I } _ { s g }$ or $\mathrm { ~ \bar { I } } _ { s b } \}$ , and then apply the transitions of warped triplets $\{ \mathrm { I } _ { w g }$ or $\mathrm { I } _ { w b } \}$ , and original triplets $\{ \boldsymbol { \mathrm { I } } _ { g }$ or $\mathrm { I } _ { b } \big \}$ over the course of training. In this way, the network can first learn to extract spatial features, and build on them to establish temporal features. Finally, discriminators learn features about the correlation of spatial and temporal content by analyzing the original triplets, and provide gradients such that the generators learn to use the motion information from the input and establish a correlation between the motions in the two unpaired domains. Consequently, the discriminator, despite receiving only a single triplet at once, can guide the generator to produce detailed structures that move coherently. Video comparisons are shown in Sec 5. of the supplemental material.
|
| 87 |
+
|
| 88 |
+
Results and Metric Evaluation While the visual results discussed above provide a first indicator of the quality our approach achieves, quantitative evaluations are crucial for automated evaluations across larger numbers of samples. Below we focus on the VSR task as ground-truth data is available in this case. We conduct user studies and present evaluations of the different models w.r.t. established spatial metrics. We also motivate and propose two novel temporal metrics to quantify temporal coherence. A visual summary is shown in Fig. 7.
|
| 89 |
+
|
| 90 |
+
For evaluating image SR, Blau & Michaeli (2018) demonstrated that there is an inherent trade-off between the perceptual quality of the result and the distortion measured with vector norms or lowlevel structures such as PSNR and SSIM. On the other hand, metrics based on deep feature maps such as LPIPS (Zhang et al., 2018) can capture more semantic similarities. We measure the PSNR and LPIPS using the Vid4 scenes. With a PSNR decrease of less than 2dB over DUF which has twice the model size of ours, TecoGAN outperforms all methods by more than $40 \%$ on LPIPS.
|
| 91 |
+
|
| 92 |
+
Table 2: Averaged VSR metric evaluations for the Vid4 data set with the following metrics, PSNR: pixel-wise accuracy. LPIPS (AlexNet): perceptual distance to the ground truth. T-diff: pixel-wise differences of warped frames. tOF: pixel-wise distance of estimated motions. tLP: perceptual distance between consecutive frames. User study: Bradley-Terry scores (Bradley & Terry, 1952). Performance is averaged over 500 images up-scaled from 320x134 to $1 2 8 0 \mathrm { x } 5 3 6$ . More details can be found in Appendix B and C.
|
| 93 |
+
|
| 94 |
+
<table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=1>PSNR↑</td><td rowspan=1 colspan=1>LPIPS↓×10</td><td rowspan=1 colspan=1>T-diff×100</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>LP↓×100</td><td rowspan=1 colspan=1>User个Study</td><td rowspan=1 colspan=1>ModelSize(M↓</td><td rowspan=1 colspan=1>ProcessingTime(ms/rame)</td></tr><tr><td rowspan=1 colspan=1>DsOnly</td><td rowspan=1 colspan=1>24.14</td><td rowspan=1 colspan=1>1.727</td><td rowspan=1 colspan=1>6.852</td><td rowspan=1 colspan=1>2.157</td><td rowspan=1 colspan=1>2.160</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>0.8(G)+1.7(F)</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>DsDt</td><td rowspan=1 colspan=1>24.75</td><td rowspan=1 colspan=1>1.770</td><td rowspan=1 colspan=1>5.071</td><td rowspan=1 colspan=1>2.198</td><td rowspan=1 colspan=1>0.614</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>0.8(G)+1.7(F)</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>DsDtPP</td><td rowspan=1 colspan=1>25.77</td><td rowspan=1 colspan=1>1.733</td><td rowspan=1 colspan=1>4.369</td><td rowspan=1 colspan=1>2.103</td><td rowspan=1 colspan=1>0.489</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>0.8(G)+1.7(F)</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>TecoGAN</td><td rowspan=1 colspan=1>25.89</td><td rowspan=1 colspan=1>1.743</td><td rowspan=1 colspan=1>4.076</td><td rowspan=1 colspan=1>2.082</td><td rowspan=1 colspan=1>0.718</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>0.8(G)+1.7(F)</td><td rowspan=1 colspan=1>37.07</td></tr><tr><td rowspan=1 colspan=1>TecoGAN</td><td rowspan=1 colspan=1>25.57</td><td rowspan=1 colspan=1>1.623</td><td rowspan=1 colspan=1>4.961</td><td rowspan=1 colspan=1>1.897</td><td rowspan=1 colspan=1>0.668</td><td rowspan=1 colspan=1>3.258</td><td rowspan=1 colspan=1>1.3(G)+1.7(F)</td><td rowspan=1 colspan=1>41.92</td></tr><tr><td rowspan=1 colspan=1>ENet</td><td rowspan=1 colspan=1>22.31</td><td rowspan=1 colspan=1>2.458</td><td rowspan=1 colspan=1>9.281</td><td rowspan=1 colspan=1>4.009</td><td rowspan=1 colspan=1>4.848</td><td rowspan=1 colspan=1>1.616</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>FRVSR</td><td rowspan=1 colspan=1>26.91</td><td rowspan=1 colspan=1>2.506</td><td rowspan=1 colspan=1>3.648</td><td rowspan=1 colspan=1>2.090</td><td rowspan=1 colspan=1>0.957</td><td rowspan=1 colspan=1>2.600</td><td rowspan=1 colspan=1>0.8(SRNet)+1.7(F)</td><td rowspan=1 colspan=1>36.95</td></tr><tr><td rowspan=1 colspan=1>DUF</td><td rowspan=1 colspan=1>27.38</td><td rowspan=1 colspan=1>2.607</td><td rowspan=1 colspan=1>3.298</td><td rowspan=1 colspan=1>1.588</td><td rowspan=1 colspan=1>1.329</td><td rowspan=1 colspan=1>2.933</td><td rowspan=1 colspan=1>6.2</td><td rowspan=1 colspan=1>942.21</td></tr><tr><td rowspan=1 colspan=1>Bi-cubic</td><td rowspan=1 colspan=1>23.66</td><td rowspan=1 colspan=1>5.036</td><td rowspan=1 colspan=1>3.152</td><td rowspan=1 colspan=1>5.578</td><td rowspan=1 colspan=1>2.144</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 95 |
+
|
| 96 |
+
Table 3: For the Obama&Trump dataset, the averaged tLP and tOF evaluations closely correspond to our user studies. The table below summarizes user preferences as Bradley-Terry scores.
|
| 97 |
+
|
| 98 |
+
<table><tr><td rowspan=1 colspan=1>UVT scenes</td><td rowspan=1 colspan=2> Trump-→Obama</td><td rowspan=1 colspan=2> Obama-→Trump</td><td rowspan=1 colspan=2>AVG</td><td rowspan=1 colspan=2>User Studies ↑, ref. to</td></tr><tr><td rowspan=1 colspan=1> metrics</td><td rowspan=1 colspan=1>tLP↓</td><td rowspan=1 colspan=1>tOF↓</td><td rowspan=1 colspan=1>tLP↓</td><td rowspan=1 colspan=1>tOF↓</td><td rowspan=1 colspan=1>tLP↓</td><td rowspan=1 colspan=1>tOF↓</td><td rowspan=1 colspan=1> original input</td><td rowspan=1 colspan=1> arbitrary target</td></tr><tr><td rowspan=1 colspan=1>CycleGAN</td><td rowspan=1 colspan=1>0.0176</td><td rowspan=1 colspan=1>0.7727</td><td rowspan=1 colspan=1>0.0277</td><td rowspan=1 colspan=1>1.1841</td><td rowspan=1 colspan=1>0.0234</td><td rowspan=1 colspan=1>0.9784</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>0.0</td></tr><tr><td rowspan=1 colspan=1>RecycleGAN</td><td rowspan=1 colspan=1>0.0111</td><td rowspan=1 colspan=1>0.8705</td><td rowspan=1 colspan=1>0.0248</td><td rowspan=1 colspan=1>1.1237</td><td rowspan=1 colspan=1>0.0179</td><td rowspan=1 colspan=1>0.9971</td><td rowspan=1 colspan=1>0.994</td><td rowspan=1 colspan=1>0.202</td></tr><tr><td rowspan=1 colspan=1>TecoGAN</td><td rowspan=1 colspan=1>0.0120</td><td rowspan=1 colspan=1>0.6155</td><td rowspan=1 colspan=1>0.0191</td><td rowspan=1 colspan=1>0.7670</td><td rowspan=1 colspan=1>0.0156</td><td rowspan=1 colspan=1>0.6913</td><td rowspan=1 colspan=1>1.817</td><td rowspan=1 colspan=1>0.822</td></tr></table>
|
| 99 |
+
|
| 100 |
+
While traditional temporal metrics based on vector norm differences of warped frames, e.g. T-diff, can be easily deceived by very blurry results, e.g. bi-cubic interpolated ones, we propose to use a tandem of two new metrics, tOF and tLP, to measure the consistence over time. tOF measures the pixel-wise difference of motions estimated from sequences, and tLP measures perceptual changes over time using deep feature map:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r } { \mathsf { t O F } = \| O F ( b _ { t - 1 } , b _ { t } ) - O F ( g _ { t - 1 } , g _ { t } ) \| _ { 1 } \mathrm { a n d } \mathrm { t L P } = \| L P ( b _ { t - 1 } , b _ { t } ) - L P ( g _ { t - 1 } , g _ { t } ) \| _ { 1 } \mathrm { , } } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $O F$ represents an optical flow estimation with LucasKanade (1981) and $\boldsymbol { L P }$ is the perceptual LPIPS metric. In tLP, the behavior of the reference is also considered, as natural videos exhibit a certain degree of changes over time. In conjunction, both pixel-wise differences and perceptual changes are crucial for quantifying realistic temporal coherence. While they could be combined into a single score, we list both measurements separately, as their relative importance could vary in different application settings. Our evaluation with these temporal metrics in Table 2 shows that all temporal adversarial models outperform spatial adversarial ones, and the full TecoGAN model performs very well: With a large amount of spatial detail, it still achieves good temporal coherence, on par with non-adversarial methods such as DUF and FRVSR. For VSR, we have confirmed these automated evaluations with several user studies. Across all of them, we find that the majority of the participants considered the TecoGAN results to be closest to the ground truth.
|
| 107 |
+
|
| 108 |
+
For the UVT tasks, where no ground-truth data is available, we can still evaluate tOF and tLP metrics by comparing the motion and the perceptual changes of the output data w.r.t. the ones from the input data , i.e., $\begin{array} { r } { { \mathrm { t O F } } = O F ( a _ { t - 1 } , a _ { t } ) - O F ( g _ { t - 1 } ^ { a b } , g _ { t } ^ { a b } ) _ { 1 } } \end{array}$ and $\begin{array} { r } { \mathrm { t L P } { = \left. { L P ( a _ { t - 1 } , a _ { t } ) - L P ( g _ { t - 1 } ^ { a \to b } , g _ { t } ^ { a \to b } ) } \right. } _ { 1 } . } \end{array}$ . With sharp spatial features and coherent motion, TecoGAN outperforms previous work on the Obama&Trump dataset, as shown in Table 3, although it is worth to point out that the tOF is less informative in this case, as the motion in the target domain is not necessarily pixel-wise aligned with the input. Overall, TecoGAN achieves good tLP scores thanks to its temporal coherence, on par with RecycleGAN, and its spatial detail is on par with CycleGAN. As for VSR, a perceptual evaluation by humans in the right column of Table 3 confirms our metric evaluations for the UVT task (details in Appendix C).
|
| 109 |
+
|
| 110 |
+
# 5 CONCLUSIONS AND DISCUSSION
|
| 111 |
+
|
| 112 |
+
In paired as well as unpaired data domains, we have demonstrated that it is possible to learn stable temporal functions with GANs thanks to the proposed discriminator architecture and PP loss. We have shown that this yields coherent and sharp details for VSR problems that go beyond what can be achieved with direct supervision. In UVT, we have shown that our architecture guides the training process to successfully establish the spatio-temporal cycle consistency between two domains. These results are reflected in the proposed metrics and user studies.
|
| 113 |
+
|
| 114 |
+
While our method generates very realistic results for a wide range of natural images, our method can generate temporally coherent yet sub-optimal details in certain cases such as under-resolved faces and text in VSR, or UVT tasks with strongly different motion between two domains. For the latter case, it would be interesting to apply both our method and motion translation from concurrent work (Chen et al., 2019). This can make it easier for the generator to learn from our temporal self supervision. In our method, the interplay of the different loss terms in the non-linear training procedure does not provide a guarantee that all goals are fully reached every time. However, we found our method to be stable over a large number of training runs, and we anticipate that it will provide a very useful basis for wide range of generative models for temporal data sets.
|
| 115 |
+
|
| 116 |
+
# REFERENCES
|
| 117 |
+
|
| 118 |
+
Aayush Bansal, Shugao Ma, Deva Ramanan, and Yaser Sheikh. Recycle-gan: Unsupervised video retargeting. In The European Conference on Computer Vision (ECCV), September 2018.
|
| 119 |
+
Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In Proc. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, Utah, USA, pp. 6228–6237, 2018.
|
| 120 |
+
Ralph Allan Bradley and Milton E Terry. Rank analysis of incomplete block designs: I. the method of paired comparisons. Biometrika, 39(3/4):324–345, 1952.
|
| 121 |
+
(CC) Blender Foundation | mango.blender.org. Tears of steel. https://mango.blender.org/, 2011. Online; accessed 15 Nov. 2018.
|
| 122 |
+
Dongdong Chen, Jing Liao, Lu Yuan, Nenghai Yu, and Gang Hua. Coherent online video style transfer. In Proc. Intl. Conf. Computer Vision (ICCV), 2017.
|
| 123 |
+
Yang Chen, Yingwei Pan, Ting Yao, Xinmei Tian, and Tao Mei. Mocycle-gan: Unpaired video-to-video translation. arXiv preprint arXiv:1908.09514, August 2019.
|
| 124 |
+
M-L Eckert, Wolfgang Heidrich, and Nils Thuerey. Coupled fluid density and motion from single views. In Computer Graphics Forum, volume 37(8), pp. 47–58. Wiley Online Library, 2018.
|
| 125 |
+
Gustav Theodor Fechner and Wilhelm Max Wundt. Elemente der Psychophysik: erster Theil. Breitkopf & Hartel, 1889. ¨
|
| 126 |
+
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.
|
| 127 |
+
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.
|
| 128 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-image translation with conditional adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 129 |
+
Younghyun Jo, Seoung Wug Oh, Jaeyeon Kang, and Seon Joo Kim. Deep video super-resolution network using dynamic upsampling filters without explicit motion compensation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3224–3232, 2018.
|
| 130 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and superresolution. In European Conference on Computer Vision, pp. 694–711. Springer, 2016.
|
| 131 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017.
|
| 132 |
+
|
| 133 |
+
Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1646–1654, 2016.
|
| 134 |
+
|
| 135 |
+
Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsuan Yang. Deep laplacian pyramid networks for fast and accurate superresolution. In IEEE Conference on Computer Vision and Pattern Recognition, volume 2, pp. 5, 2017.
|
| 136 |
+
|
| 137 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew ´ Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. arXiv:1609.04802, 2016.
|
| 138 |
+
|
| 139 |
+
Renjie Liao, Xin Tao, Ruiyu Li, Ziyang Ma, and Jiaya Jia. Video super-resolution via deep draft-ensemble learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 531–539, 2015.
|
| 140 |
+
|
| 141 |
+
Ce Liu and Deqing Sun. A bayesian approach to adaptive video super resolution. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pp. 209–216. IEEE, 2011.
|
| 142 |
+
|
| 143 |
+
Ding Liu, Zhaowen Wang, Yuchen Fan, Xianming Liu, Zhangyang Wang, Shiyu Chang, and Thomas Huang. Robust video super-resolution with learned temporal dynamics. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 2526–2534. IEEE, 2017.
|
| 144 |
+
|
| 145 |
+
Bruce D. Lucas and Takeo Kanade. An iterative image registration technique with an application to stereo vision (darpa). In Proceedings of the 1981 DARPA Image Understanding Workshop, pp. 121–130, April 1981.
|
| 146 |
+
|
| 147 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2794–2802, 2017.
|
| 148 |
+
|
| 149 |
+
Kwanyong Park, Sanghyun Woo, Dahun Kim, Donghyeon Cho, and In So Kweon. Preserving semantic and temporal consistency for unpaired video-to-video translation. arXiv preprint arXiv:1908.07683, August 2019.
|
| 150 |
+
|
| 151 |
+
Eduardo Perez-Pellitero, Mehdi SM Sajjadi, Michael Hirsch, and Bernhard Sch ´ olkopf. Photorealistic video ¨ super resolution. arXiv preprint arXiv:1807.07930, 2018.
|
| 152 |
+
|
| 153 |
+
Ekta Prashnani, Hong Cai, Yasamin Mostofi, and Pradeep Sen. PieAPP: Perceptual Image-Error Assessment through Pairwise Preference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1808–1817, 2018.
|
| 154 |
+
|
| 155 |
+
Manuel Ruder, Alexey Dosovitskiy, and Thomas Brox. Artistic style transfer for videos. In German Conference on Pattern Recognition, pp. 26–36. Springer, 2016.
|
| 156 |
+
|
| 157 |
+
Mehdi SM Sajjadi, Bernhard Scholkopf, and Michael Hirsch. Enhancenet: Single image super-resolution ¨ through automated texture synthesis. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 4501–4510. IEEE, 2017.
|
| 158 |
+
|
| 159 |
+
Mehdi SM Sajjadi, Raviteja Vemulapalli, and Matthew Brown. Frame-recurrent video super-resolution. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2018), 2018.
|
| 160 |
+
|
| 161 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 162 |
+
|
| 163 |
+
Xin Tao, Hongyun Gao, Renjie Liao, Jue Wang, and Jiaya Jia. Detail-revealing deep video super-resolution. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017.
|
| 164 |
+
|
| 165 |
+
Kiwon Um, Xiangyu Hu, and Nils Thuerey. Perceptual evaluation of liquid simulation methods. ACM Transactions on Graphics (TOG), 36(4):143, 2017.
|
| 166 |
+
|
| 167 |
+
Chaoyue Wang, Chang Xu, Chaohui Wang, and Dacheng Tao. Perceptual adversarial networks for image-toimage transformation. IEEE Transactions on Image Processing, 27(8):4066–4079, 2018a.
|
| 168 |
+
|
| 169 |
+
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. In Advances in Neural Information Processing Systems (NIPS), 2018b.
|
| 170 |
+
|
| 171 |
+
Xiaolong Wang, Allan Jabri, and Alexei A Efros. Learning correspondence from the cycle-consistency of time. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2566–2576, 2019.
|
| 172 |
+
|
| 173 |
+
You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow. ACM Transactions on Graphics (TOG), 37(4):95, 2018.
|
| 174 |
+
|
| 175 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. arXiv preprint, 2018.
|
| 176 |
+
|
| 177 |
+
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.
|
| 178 |
+
|
| 179 |
+
# APPENDIX
|
| 180 |
+
|
| 181 |
+
In the following, we first provide qualitative analysis(Appendix A) using multiple results that are mentioned but omitted in our main document due to space constraints. We then explain details of the metrics and present the quantitative analysis based on them(Appendix B). The conducted user studies are in support of our TecoGAN network and proposed temporal metrics (Appendix C). Then, we give technical details of our spatio-temporal discriminator (Sec. D), details of network architectures and training parameters (Appendix F, Appendix G). In the end, we discuss the performance of our approach in Appendix H.
|
| 182 |
+
|
| 183 |
+
# A QUALITATIVE ANALYSIS
|
| 184 |
+
|
| 185 |
+
For the VSR task, we test our model on a wide range of video data, including the generally used Vid4 dataset shown in Fig. 8 and 12, detailed scenes from the movie Tears of Steel (ToS, 2011) shown in Fig. 12, and others shown in Fig. 9. As mentioned in the main document, the TecoGAN model is trained with down-sampled inputs and it can similarly work with original images that were not down-sampled or filtered, such as a data-set of real-world photos (Liao et al., 2015). In Fig. 10, we compared our results to two other methods (Liao et al., 2015; Tao et al., 2017) that have used the same dataset. With the help of adversarial learning, our model is able to generate improved and realistic details in down-sampled images as well as captured images.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 8: VSR temporal profile comparisons of the calendar scene (time shown along y-axis). TecoGAN models lead to natural temporal progressions, and our final model closely matches the desired ground truth behavior over time.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 9: Additional VSR comparisons. The TecoGAN model generates sharp details in both scenes.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Liao et al. (2015) Ours Liao2015 Ours Tao et al. (2017) Figure 10: Comparisons for VSR of captured images.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 11: Results of UVT tasks on different datasets.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 12: Detail views of the VSR results of ToS scenes (first three columns) and Vid4 scenes (two right-most columns) with comparisons.
|
| 201 |
+
|
| 202 |
+
Table 4: Metrics evaluated for the VSR Vid4 scenes.
|
| 203 |
+
|
| 204 |
+
<table><tr><td>PSNR↑</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td><td>TecoGAN</td><td>DsOnly</td><td></td><td>DsDt</td><td>DsDtPP</td></tr><tr><td>calendar</td><td>20.27</td><td>19.85</td><td>23.86</td><td>24.07 26.45</td><td>23.21</td><td>23.35 25.13</td><td></td><td>22.23</td><td>22.76</td><td>22.95</td></tr><tr><td>foliage</td><td>23.57 24.82</td><td>21.15 23.36</td><td>26.35 27.71</td><td>28.25</td><td>24.26 26.78</td><td>26.94</td><td></td><td>22.33 25.86</td><td>22.73 26.52</td><td>25.00 27.03</td></tr><tr><td>city walk</td><td>25.84</td><td>24.90</td><td>29.56</td><td>30.58</td><td>28.11</td><td>28.14</td><td></td><td>26.49</td><td>27.37</td><td>28.14</td></tr><tr><td>average</td><td>23.66</td><td>22.31</td><td>26.91</td><td>27.38</td><td>25.57</td><td>25.89</td><td></td><td>24.14</td><td>24.75</td><td>25.77</td></tr><tr><td>LPIPS↓×10 calendar</td><td>BIC 5.935</td><td>ENet 2.191</td><td>FRVSR 2.989</td><td>DUF 3.086</td><td>TecoGAN 1.511</td><td>TecoGAN 2.142</td><td></td><td>DsOnly 1.532</td><td>DsDt 2.111</td><td>DsDtPP 2.112</td></tr><tr><td>foliage</td><td>5.338</td><td>2.663</td><td>3.242</td><td>3.492</td><td>1.902</td><td></td><td>1.984</td><td>2.113</td><td>2.092</td><td>1.902</td></tr><tr><td>city</td><td>5.451</td><td>3.431</td><td>2.429</td><td>2.447</td><td>2.084</td><td>1.940</td><td></td><td>2.120</td><td>1.889</td><td>1.989</td></tr><tr><td>walk</td><td>3.655</td><td>1.794</td><td>1.374</td><td>1.380</td><td>1.106</td><td>1.011</td><td></td><td>1.215</td><td>1.057</td><td>1.051</td></tr><tr><td>average</td><td>5.036</td><td>2.458</td><td>2.506</td><td>2.607</td><td>1.623</td><td>1.743</td><td></td><td>1.727</td><td>1.770</td><td>1.733</td></tr><tr><td>tOF↓×10</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td><td>TecoGAN</td><td></td><td>DsOnly</td><td>DsDt</td><td>DsDtPP</td></tr><tr><td>calendar</td><td>4.956</td><td>3.450</td><td>1.537</td><td>1.134</td><td>1.342</td><td>1.403</td><td></td><td>1.609</td><td>1.683</td><td>1.583</td></tr><tr><td>foliage</td><td>4.922</td><td>3.775</td><td>1.489</td><td>1.356</td><td>1.238</td><td>1.444</td><td></td><td>1.543</td><td>1.562</td><td>1.373</td></tr><tr><td>city</td><td>7.967</td><td>6.225</td><td>2.992</td><td>1.724</td><td>2.612</td><td>2.905</td><td></td><td>2.920</td><td>2.936</td><td>3.062</td></tr><tr><td>walk</td><td>5.150</td><td>3.203</td><td>2.569</td><td>2.127</td><td>2.571</td><td>2.765</td><td></td><td>2.745</td><td>2.796</td><td>2.649</td></tr><tr><td>average</td><td>5.578</td><td>4.009</td><td>2.090</td><td>1.588</td><td>1.897</td><td>2.082</td><td></td><td>2.157</td><td>2.198</td><td>2.103</td></tr><tr><td>tLP↓×100</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td><td>TecoGAN</td><td></td><td>DsOnly</td><td>DsDt</td><td>DsDtPP</td></tr><tr><td>calendar</td><td>3.258</td><td>2.957</td><td>1.067</td><td>1.603</td><td>0.165</td><td>1.087</td><td></td><td>0.872</td><td>0.764</td><td>0.670</td></tr><tr><td>foliage city</td><td>2.434 2.193</td><td>6.372 7.953</td><td>1.644 0.752</td><td>2.034 1.399</td><td>0.894 0.974</td><td>0.740 0.347</td><td></td><td>3.422 2.660</td><td>0.493 0.490</td><td>0.454 0.140</td></tr><tr><td>walk</td><td>0.851</td><td>2.729</td><td>0.286</td><td>0.307</td><td>0.653</td><td>0.635</td><td></td><td>1.596</td><td>0.697</td><td>0.613</td></tr><tr><td>average</td><td>2.144</td><td>4.848</td><td>0.957</td><td>1.329</td><td>0.668</td><td>0.718</td><td></td><td>2.160</td><td>0.614</td><td>0.489</td></tr><tr><td>T-diff↓×100</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td><td>TecoGAN</td><td>DsOnly</td><td>DsDt</td><td>DsDtPP</td><td></td></tr><tr><td>calendar</td><td>2.271</td><td>9.153</td><td>3.212</td><td>2.750</td><td>4.663</td><td>3.496</td><td>6.287</td><td>4.347</td><td></td><td>GT</td></tr><tr><td>foliage</td><td>3.745</td><td>11.997</td><td>3.478</td><td>3.115</td><td>5.674</td><td>4.179</td><td></td><td></td><td>4.167</td><td>6.478</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>8.961</td><td>6.068</td><td>4.548</td><td>4.396</td></tr><tr><td>city</td><td>1.974</td><td>7.788</td><td>2.452</td><td>2.244</td><td>3.528</td><td>2.965</td><td>4.929</td><td>3.525</td><td>2.991</td><td>4.282</td></tr><tr><td>walk</td><td>4.101</td><td>7.576</td><td>5.028</td><td>4.687</td><td>5.460</td><td>5.234</td><td>6.454</td><td>5.714</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>5.305</td><td>5.525</td></tr><tr><td>average</td><td>3.152</td><td>9.281</td><td>3.648</td><td>3.298</td><td>4.961</td><td>4.076</td><td>6.852</td><td>5.071</td><td>4.369</td><td>5.184</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 205 |
+
|
| 206 |
+
For UVT tasks, we train models for Obama and Trump translations, LR- and HR- smoke simulation translations, as well as translations between smoke simulations and real-smoke captures. While smoke simulations usually contain strong numerical viscosity with details limited by the simulation resolution, the real smoke, captured using the setup from Eckert et al. (2018), contains vivid fluid motions with many vortices and high-frequency details. As shown in Fig. 11, our method can be used to narrow the gap between simulations and real-world phenomenon.
|
| 207 |
+
|
| 208 |
+
# B METRICS AND QUANTITATIVE ANALYSIS
|
| 209 |
+
|
| 210 |
+
Spatial Metrics We evaluate all VSR methods with PSNR together with the human-calibrated LPIPS metric (Zhang et al., 2018). While higher PSNR values indicate a better pixel-wise accuracy, lower LPIPS values represent better perceptual quality and closer semantic similarity. Mean values of the Vid4 scenes Liu & Sun (2011) are shown on the top of Table 4. Trained with direct vector norms losses, FRVSR and DUF achieve high PSNR scores. However, the undesirable smoothing induced by these losses manifests themselves in larger LPIPS distances. ENet, on the other hand, with no information from neighboring frames, yields the lowest PSNR and achieves an LPIPS score that is only slightly better than DUF and FRVSR. TecoGAN model with adversarial training achieves an excellent LPIPS score, with a PSNR decrease of less than 2dB over DUF, which is very reasonable, since PSNR and perceptual quality were shown to be anti-correlated (Blau & Michaeli, 2018), especially in regions where PSNR is very high. Based on good perceptual quality and reasonable pixel-wise accuracy, TecoGAN outperforms all other methods by more than $40 \%$ for LPIPS.
|
| 211 |
+
|
| 212 |
+
Temporal Metrics For both VSR and UVT, evaluating temporal coherence without ground-truth motion is a very challenging problem. The metric $T \ – d i f f = \left. g _ { t } - W ( g _ { t - 1 } , v _ { t } ) \right. _ { 1 }$ was used by Chen et al. (2017) as a rough assessment of temporal differences. As shown on bottom of Table 4, T-diff, due to its local nature, is easily deceived by blurry method such as the bi-cubic interrelation and can not correlate well with visual assessments of coherence. By measuring the pixel-wise motion difference using tOF in together with the perceptual changes over time using tLP, we show the temporal evaluations for the VSR task in the middle of Table 4. Not surprisingly, the results of ENet show larger errors for all metrics due to their strongly flickering content. Bi-cubic up-sampling, DUF, and FRVSR achieve very low T-diff errors due to their smooth results, representing an easy, but undesirable avenue for achieving coherency. However, the overly smooth changes of the former two are identified by the tLP scores.While our DsOnly model generates sharper results at the expense of temporal coherence, it still outperforms ENet there. By adding temporal information to discriminators, our DsDt, $\mathrm { D s D t + P P }$ , TecoGANand TecoGAN improve in terms of temporal metrics. Especially the full TecoGAN model stands out here. For the UVT tasks, temporal motions are evaluated by comparing to the input sequence. With sharp spatial features and coherent motion, TecoGAN outperforms previous work on the Obama&Trump dataset, as shown in Table 3.
|
| 213 |
+
|
| 214 |
+
Table 5: Metrics evaluated for the VSR of ToS.
|
| 215 |
+
|
| 216 |
+
<table><tr><td>PSNR↑</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td><td>tOF↓×10</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td></tr><tr><td>room</td><td>26.90</td><td>25.22</td><td>29.80</td><td>30.85</td><td>29.31</td><td>room</td><td>1.735</td><td>1.625</td><td>0.861</td><td>0.901</td><td>0.737</td></tr><tr><td>bridge</td><td>28.34</td><td>26.40</td><td>32.56</td><td>33.02</td><td>30.81</td><td>bridge</td><td>5.485</td><td>4.037</td><td>1.614</td><td>1.348</td><td>1.492</td></tr><tr><td>face</td><td>33.75</td><td>32.17</td><td>39.94</td><td>40.23</td><td>38.60</td><td>face</td><td>4.302</td><td>2.255</td><td>1.782</td><td>1.577</td><td>1.667</td></tr><tr><td>average</td><td>29.58</td><td>27.82</td><td>34.04</td><td>34.60</td><td>32.75</td><td>average</td><td>4.110</td><td>2.845</td><td>1.460</td><td>1.296</td><td>1.340</td></tr><tr><td>LPIPS↓×10</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td><td>tLP↓×100</td><td>BIC</td><td>ENet</td><td>FRVSR</td><td>DUF</td><td>TecoGAN</td></tr><tr><td>room</td><td>5.167</td><td>2.427</td><td>1.917</td><td>1.987</td><td>1.358</td><td>room</td><td>1.320</td><td>2.491</td><td>0.366</td><td>0.307</td><td>0.590</td></tr><tr><td>bridge</td><td>4.897</td><td>2.807</td><td>1.761</td><td>1.684</td><td>1.263</td><td>bridge</td><td>2.237</td><td>6.241</td><td>0.821</td><td>0.526</td><td>0.912</td></tr><tr><td>face</td><td>2.241</td><td>1.784</td><td>0.586</td><td>0.517</td><td>0.590</td><td>face</td><td>1.270</td><td>1.613</td><td>0.290</td><td>0.314</td><td>0.379</td></tr><tr><td>average</td><td>4.169</td><td>2.395</td><td>1.449</td><td>1.414</td><td>1.086</td><td>average</td><td>1.696</td><td>3.827</td><td>0.537</td><td>0.403</td><td>0.664</td></tr></table>
|
| 217 |
+
|
| 218 |
+
Spatio-temporal Evaluations Since temporal metrics can trivially be reduced for blurry image content, we found it important to evaluate results with a combination of spatial and temporal metrics. Given that perceptual metrics are already widely used for image evaluations, we believe it is the right time to consider perceptual changes in temporal evaluations, as we did with our proposed temporal coherence metrics. Although not perfect, they are not easily deceived. Specifically, tOF is more robust than a direct pixel-wise metric as it compares motions instead of image content. In the supplemental material, we visualize the motion difference and it can well reflect the visual inconsistencies. On the other hand, we found that our calculation of tLP is a general concept that can work reliably with different perceptual metric: When repeating the tLP evaluation with the PieAPP metric (Prashnani et al., 2018) instead of $L P$ , i.e., tPieP $=$ $\lVert f ( y _ { t - 1 } , y _ { t } ) - f ( g _ { t - 1 } , g _ { t } ) \rVert _ { 1 }$ , where $\mathrm { f } ( \cdot )$ indicates the perceptual error function of PieAPP, we get close to identical results, listed in Fig. 13. The conclusions from $t P i e P$ also closely match the LPIPS-based evaluation: our network architecture can generate realistic and temporally coher
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 13: Tables and visualization of perceptual metrics computed with PieAPP (Prashnani et al., 2018) (instead of LPIPS used in Fig. 7 previously) on ENet, FRVSR, DUF and TecoGAN for the VSR of Vid4. Bubble size indicates the tOF score.
|
| 222 |
+
|
| 223 |
+
ent detail, and the metrics we propose allow for a stable, automated evaluation of the temporal perception of a generated video sequence.
|
| 224 |
+
|
| 225 |
+
Besides the previously evaluated the Vid4 dataset, with graphs shown in Fig. 14, 15, we also get similar evaluation results on the Tears of Steel data-sets (room, bridge, and face, in the following referred to as $T o S$ scenes) and corresponding results are shown in Table 5 and Fig. 16. In all tests, we follow the procedures of previous work (Jo et al., 2018; Sajjadi et al., 2018) to make the outputs of all methods comparable, i.e., for all result images, we first exclude spatial borders with a distance of 8 pixels to the image sides, then further shrink borders such that the LR input image is divisible by 8 and for spatial metrics, we ignore the first two and the last two frames, while for temporal metrics, we ignore first three and last two frames, as an additional previous frame is required for inference. In the following, we conduct user studies for the Vid4 scenes. By comparing the user study results and the metric breakdowns shown in Table 4, we found our metrics to reliably capture the human temporal perception, as shown in Appendix C.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Figure 14: Bar graphs of temporal metrics for Vid4.
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
Figure 15: Spatial metrics for Vid4.
|
| 234 |
+
Figure 16: Metrics for ToS.
|
| 235 |
+
|
| 236 |
+
# C USER STUDIES
|
| 237 |
+
|
| 238 |
+
We conduct several user studies for the VSR task using five different methods, namely bi-cubic interpolation, ENet, FRVSR, DUF and our TecoGAN. The established 2AFC design (Fechner & Wundt, 1889; Um et al., 2017) is applied, i.e., participants have a pair-wise choice, with the groundtruth video shown as reference. One example can be seen in Fig. 17. The videos are synchronized and looped until user made the final decision. With no control to stop videos, users Participants cannot stop or influence the playback, and hence can focus more on the whole video, instead of specific spatial details. Videos positions (left/A or right/B) are randomized.
|
| 239 |
+
|
| 240 |
+
After collecting 1000 votes from 50 users for every scene, i.e. twice for all possible pairs $( 5 \times 4 / 2 =$ 10 pairs), we follow common procedure and compute scores for all models with the Bradley-Terry model (1952). The outcomes for the Vid4 scenes can be seen in Fig. 18 (overall scores are listed in Table 2 of the main document).
|
| 241 |
+
|
| 242 |
+
From the Bradley-Terry scores for the Vid4 scenes we can see that the TecoGAN model performs very well, and achieves the first place in three cases, as well as a second place in the walk scene. The latter is most likely caused by the overall slightly smoother images of the walk scene, in conjunction with the presence of several human faces, where our model can lead to the generation of unexpected details. However, overall the user study shows that users preferred the TecoGAN output over the other two deep-learning methods with a $6 3 . 5 \%$ probability.
|
| 243 |
+
|
| 244 |
+
This result also matches with our metric evaluations. In Table 4, while TecoGAN achieves spatial (LPIPS) improvements in all scenes, DUF and FRVSR are not far behind in the walk scene. In terms of temporal metrics tOF and tLP, TecoGAN achieves similar or lower scores compared to FRVSR and DUF for calendar, foliage and city scenes. The lower performance of our model for the walk scene is likewise captured by higher tOF and tLP scores. Overall, the metrics confirm the performance of our TecoGAN approach and match the results of the user studies, which indicate that our proposed temporal metrics successfully capture important temporal aspects of human perception.
|
| 245 |
+
|
| 246 |
+
For UVT tasks which have no ground-truth data, we carried out two sets of user studies: One uses an arbitrary sample from the target domain as the reference and the other uses the actual input from the source domain as the reference. On the Obama&Trump data-sets, we evaluate results from CycleGAN, RecycleGAN, and TecoGAN following the same modality, i.e. a 2AFC design with 50 users for each run. E.g., on the left of Fig. 19, users evaluate the generated Obama in reference with the input Trump on the y-axis, while an arbitrary Obama video is shown as the reference on the $\mathrm { X }$ -axis. Effectively, the y-axis is more important than the $\mathbf { X } ^ { \prime }$ -axis as it indicates whether the translated result preserves the original expression. A consistent ranking of TecoGAN $>$ RecycleGAN $>$ CycleGAN is shown on the y-axis with clear separations, i.e. standard errors don’t overlap. The $\mathbf { X }$ -axis indicates whether the inferred result matches the general spatio-temporal content of the target domain. Our TecoGAN model also receives the highest scores here, although the responses are slightly more spread out. On the right of Fig. 19, we summarize both studies in a single graph highlighting that the TecoGAN model is consistently preferred by the participants of our user studies.
|
| 247 |
+
|
| 248 |
+
# D TECHNICAL DETAILS OF THE SPATIO-TEMPORAL DISCRIMINATOR
|
| 249 |
+
|
| 250 |
+
Motion Compensation Used in Warped Triplet In the TecoGAN architecture, relationships $D _ { s , t }$ deteen e teand $I N _ { s , t } ^ { g }$ $\hat { I } N _ { s , t } ^ { y }$ network F. However, at the boundary of images, the output of $\mathrm { F }$ is usually less accurate due to the lack of reliable neighborhood information. There is a higher chance that objects move into the field of view, or leave suddenly, which significantly affects the images warped with the inferred motion. An example is shown in Fig. 20. This increases the difficulty for $D _ { s , t }$ , as it cannot fully rely on the images being aligned via warping. To alleviate this problem, we only use the center region of $I N _ { s , t } ^ { g }$ Ns,t and $\dot { I N } _ { s , t } ^ { y }$ as the input of the discriminator, and we reset a boundary of 16 pixels. Thus, for an input resolution of $I N _ { s , t } ^ { g }$ and $I N _ { s , t } ^ { y }$ of
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 20: Near image boundaries, flow estimation is less accurate and warping often fails to align well. First two columns show original and warped frames and the third one shows differences after warping (ideally all black). The top row shows things move into the view with problems near lower boundaries, while the second row has objects moving out of the view.
|
| 254 |
+
|
| 255 |
+
$1 2 8 \times 1 2 8$ for the VSR task, the inner part in size of $9 6 \times 9 6$ is left untouched, while the border regions are overwritten with zeros.
|
| 256 |
+
|
| 257 |
+
The flow estimation network F with the loss $\mathcal { L } _ { G , F }$ should only be trained to support $\mathbf { G }$ in reaching the output quality as determined by $D _ { s , t }$ , but not the other way around. The latter could lead to $\mathrm { F }$ networks that confuse $D _ { s , t }$ with strong distortions of $I N _ { s , t } ^ { g }$ and $I N _ { s , t } ^ { y }$ . In order to avoid the this undesirable case, we stop the gradient back propagation from $I N _ { s , t } ^ { g }$ and $I N _ { s , t } ^ { y }$ to F. In this way, gradients from $D _ { s , t }$ to $\mathrm { F }$ are only back propagated through the generated samples $g _ { t - 1 } , g _ { t }$ and $g _ { t + 1 }$ into the generator network. In this way $D _ { s , t }$ can guide $\mathbf { G }$ to improve the image content, and $\mathrm { F }$ learns to warp the previous frame in accordance with the detail that G can synthesize. However, F does not adjust the motion estimation only to reduce the adversarial loss.
|
| 258 |
+
|
| 259 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="4">TheBradley-Terry scores (standard error)</td></tr><tr><td>calendar</td><td>foliage</td><td>city</td><td>walk</td></tr><tr><td>Bi-cubic</td><td>0.000(0.000)</td><td>0.000(0.000)</td><td>0.000(0.000)</td><td>0.000 (0.000)</td></tr><tr><td>ENet</td><td>1.834 (0.228)</td><td>1.634(0.180)</td><td>1.282 (0.205)</td><td>1.773( (0.197)</td></tr><tr><td>FRVSR</td><td>3.043 (0.246)</td><td>2.177 (0.186)</td><td>3.173 (0.240)</td><td>2.424 (0.204)</td></tr><tr><td>DUF</td><td>3.468 (0.252)</td><td>2.243 (0.186)</td><td>3.302 (0.242)</td><td>3.175 (0.214)</td></tr><tr><td>TecoGAN</td><td>4.091 (0.262)</td><td>2.769 (0.194)</td><td>4.052 (0.255)</td><td>2.693 (0.207)</td></tr></table>
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 17: A sample setup of user study.
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 18: Tables and bar graphs of Bradley-Terry scores and standard errors for Vid4 VSR.
|
| 268 |
+
Figure 19: Tables and graphs of Bradley-Terry scores and standard errors for Obama&Trump UVT.
|
| 269 |
+
|
| 270 |
+
Curriculum Learning for UVT Discriminators As mentioned in the main part, we train the UVT $D _ { s , t }$ with $100 \%$ spatial triplets at the very beginning. During training, $2 5 \%$ of them gradually transfer into warped triplets and another $2 5 \%$ transfer into original triplets. The transfer of the warped triplets can be represented as: $( 1 - \alpha ) \mathrm { I } _ { c g } + \alpha \mathrm { I } _ { w g }$ , with $\alpha$ growing form 0 to 1. For the original triplets, we additionally fade the “warping” operation out by using $( \bar { 1 } - \alpha ) \mathrm { I } _ { c g } + \alpha \lbrace W ( g _ { t - 1 } , \bar { v } _ { t } \ast$ $\beta ) , g _ { t } , W ( g _ { t + 1 } , v _ { t } ^ { \prime } * \beta ) \}$ , again with $\alpha$ growing form 0 to 1 and $\beta$ decreasing from 1 to 0. We found this smooth transition to be helpful for a stable training.
|
| 271 |
+
|
| 272 |
+
# E DATA AUGMENTATION AND TEMPORAL CONSTRAINS IN THE PP LOSS
|
| 273 |
+
|
| 274 |
+
Since training with sequences of arbitrary length is not possible with current hardware, problems such as the streaking artifacts discussed above generally arise for recurrent models. In the proposed PP loss, both the Ping-Pang data augmentation and the temporal consistency constraint contribute to solving these problems. In order to show their separated contributions, we trained another TecoGAN variant that only employs the data augmentation without the constraint (i.e., $\lambda _ { p } = 0$ in Table 1).
|
| 275 |
+
|
| 276 |
+
Denoted as PP-Augment, we show its results in comparison with the DsDt and TecoGANmodels in Fig. 21. Video results are shown in the in the supplemental material.
|
| 277 |
+
|
| 278 |
+
During training, the generator of DsDt receives 10 frames, and generators of PP-Augment and TecoGANsee 19 frames. While DsDt shows strong recurrent accumulation artifacts early on, the PP-Augment version slightly reduces the artifacts. In Fig. 21, it works good for frame 15, but shows artifacts from frame 32 on. Only our regular model (TecoGAN) successfully avoids temporal accumulation for all 40 frames. Hence, with the PP constraint, the model avoids recurrent accumulation of artifacts and works well for sequences that are substantially longer than the training length.
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 21: 1st & 2nd row: Frame 15 & 40 of the Foliage scene. While DsDt leads to strong recurrent artifacts early on, PPAugment shows similar artifacts later in time (2nd row, middle). TecoGANmodel successfully removes these artifacts.
|
| 282 |
+
|
| 283 |
+
Among others, we have tested our model with ToS sequences of lengths 150, 166 and 233. For all of these sequences, the TecoGAN model successfully avoids temporal accumulation or streaking artifacts.
|
| 284 |
+
|
| 285 |
+
# F NETWORK ARCHITECTURE
|
| 286 |
+
|
| 287 |
+
In this section, we use the following notation to specify all network architectures used: conc() represents the concatenation of two tensors along the channel dimension; $C / C T$ (input, kernel size, output channel, stride size) stands for the convolution and transposed convolution operation, respectively; $" + "$ denotes element-wise addition; BilinearUp2 up-samples input tensors by a factor of 2 using bi-linear interpolation; BicubicResize4(input) increases the resolution of the input tensor to 4 times higher via bi-cubic up-sampling; Dense(input, output size) is a densely-connected layer, which uses Xavier initialization for the kernel weights.
|
| 288 |
+
|
| 289 |
+
The architecture of our VSR generator $\mathbf { G }$ is:
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\mathrm { c o n c } ( x _ { t } , W ( g _ { t - 1 } , v _ { t } ) ) \to l _ { i n } ; C ( l _ { i n } , 3 , 6 4 , 1 ) , \mathrm { R e L U } \to l _ { 0 }
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\begin{array} { r } { C T ( l _ { n } , 3 , 6 4 , 2 ) , \mathrm { R e L U } l _ { u p 2 } ; C T ( l _ { u p 2 } , 3 , 6 4 , 2 ) , \mathrm { R e L U } l _ { u p 4 } ; } \\ { C ( l _ { u p 4 } , 3 , 3 , 1 ) , \mathrm { R e L U } l _ { r e s } ; \mathrm { B i c u b i c R e s i z e 4 } ( x _ { t } ) + l _ { r e s } g _ { t } . } \end{array}
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
In TecoGAN, there are 10 sequential residual blocks in the generator ( $l _ { n } ~ = ~ l _ { 1 0 } ~ )$ , while the TecoGAN generator has 16 residual blocks ( $l _ { n } ~ = ~ l _ { 1 6 } ~ )$ . Each ResidualBlock(li) contains the following operations: $C ( l _ { i } , 3 , 6 4 , 1 ) , \mathrm { R e L U } r _ { i }$ ; $C ( r _ { i } , 3 , 6 4 , 1 ) + l _ { i } l _ { i + 1 }$ .
|
| 300 |
+
|
| 301 |
+
The VSR $D _ { s , t }$ ’s architecture is:
|
| 302 |
+
|
| 303 |
+
$\mathrm { I N } _ { s , t } ^ { g }$ or $\mathrm { I N } _ { s , t } ^ { y } \to l _ { i n }$ ; $C ( l _ { i n } , 3 , 6 4 , 1 )$ , Leaky $\mathrm { R e L U } l _ { 0 }$ ;
|
| 304 |
+
$C ( l _ { 0 } , 4 , 6 4 , 2 )$ , BatchNorm, Leaky ReLU $ l _ { 1 }$ ; $C ( l _ { 1 } , 4 , 6 4 , 2 )$ , BatchNorm, Leaky $\mathrm { R e L U } l _ { 2 }$ ;
|
| 305 |
+
$C ( l _ { 2 } , 4 , 1 2 8 , 2 )$ , BatchNorm, Leaky $\mathrm { R e L U } l _ { 3 }$ ; $C ( l _ { 3 } , 4 , 2 5 6 , 2 )$ , BatchNorm, Leaky ReLU $\to l _ { 4 }$ ; $D e n s e ( l _ { 4 } , 1 )$ , sigmoid $\to l _ { o u t }$ .
|
| 306 |
+
|
| 307 |
+
VSR discriminators used in our variant models, DsDt, DsDtPP and DsOnly, have a similar architecture as $D _ { s , t }$ . They only differ in terms of their inputs.
|
| 308 |
+
|
| 309 |
+
The flow estimation network F has the following architecture:
|
| 310 |
+
|
| 311 |
+
conc $( x _ { t } , x _ { t - 1 } ) \to l _ { i n }$ ; $C ( l _ { i n } , 3 , 3 2 , 1 )$ , Leaky $\mathrm { R e L U } l _ { 0 }$ ;
|
| 312 |
+
$C ( l _ { 0 } , 3 , 3 2 , 1 )$ , Leaky ReLU, MaxPooling $ l _ { 1 }$ ; $C ( l _ { 1 } , 3 , 6 4 , 1 )$ , Leaky $\mathrm { R e L U } l _ { 2 }$ ;
|
| 313 |
+
$C ( l _ { 2 } , 3 , 6 4 , 1 )$ , Leaky ReLU, MaxPooling $ l _ { 3 }$ ; $C ( l _ { 3 } , 3 , 1 2 8 , 1 )$ , Leaky $\mathrm { R e L U } l _ { 4 }$ ;
|
| 314 |
+
$C ( l _ { 4 } , 3 , 1 2 8 , 1 )$ , Leaky ReLU, MaxPooling $\to l _ { 5 }$ ; $C ( l _ { 5 } , 3 , 2 5 6 , 1 )$ , Leaky ReLU $\to l _ { 6 }$ ;
|
| 315 |
+
$C ( l _ { 6 } , 3 , 2 5 6 , 1 )$ , Leaky ReLU, BilinearUp2 $\to l _ { 7 }$ ; $C ( l _ { 7 } , 3 , 1 2 8 , 1 )$ , Leaky $\mathrm { R e L U } \to l _ { 8 }$ ;
|
| 316 |
+
$C ( l _ { 8 } , 3 , 1 2 8 , 1 )$ , Leaky ReLU, Bilinear $\mathrm { U p } 2 \to l _ { 9 }$ ; $C ( l _ { 9 } , 3 , 6 4 , 1 )$ , Leaky ReLU $\to l _ { 1 0 }$ ;
|
| 317 |
+
$C ( l _ { 1 0 } , 3 , 6 4 , 1 )$ , Leaky ReLU, Bilinear $\mathrm { U p } 2 l _ { 1 1 }$ ; $C ( l _ { 1 1 } , 3 , 3 2 , 1 )$ , Leaky ReLU $ l _ { 1 2 }$ ; $C ( l _ { 1 2 } , 3 , 2 , 1 )$ , tanh $ l _ { o u t }$ ; $l _ { o u t } * \mathrm { M a x V e l } \to v _ { t }$ .
|
| 318 |
+
|
| 319 |
+
Here, MaxVel is a constant vector, which scales the network output to the normal velocity range.
|
| 320 |
+
|
| 321 |
+
While $\mathrm { F }$ is the same for UVT tasks, UVT generators have an encoder-decoder structure:
|
| 322 |
+
|
| 323 |
+
c $\operatorname { n c } ( x _ { t } , W ( g _ { t - 1 } , v _ { t } ) ) \to l _ { i n } ; C ( l _ { i n } , 7 , 3 2 , 1 )$ , InstanceNorm, $\mathrm { R e L U } l _ { 0 }$ ; $C ( l _ { 0 } , 3 , 6 4 , 2 )$ , InstanceNorm, $\mathrm { R e L U } l _ { 1 }$ ; $C ( l _ { 1 } , 3 , 1 2 8 , 2 )$ , InstanceNorm, ReLU $ l _ { 2 }$ ; $R e s i d u a l B l o c k ( l _ { 2 } + i ) l _ { 3 + i }$ with $i = 0 , . . . , n - 1$ ; $C T ( l _ { n + 2 } , 3 , 6 4 , 2 )$ , InstanceNorm, $\mathrm { R e L U } l _ { n + 3 }$ ; $C T ( l _ { n + 3 } , 3 , 3 2 , 2 )$ , InstanceNorm, $\mathrm { R e L U } l _ { n + 4 }$ ; $C T ( l _ { n + 4 } , 7 , 3 , 1 )$ , tanh $ l _ { o u t }$
|
| 324 |
+
|
| 325 |
+
Residua $B l o c k ( l _ { 2 } + i )$ contains the following operations: $C ( l _ { 2 + i } , 3 , 1 2 8 , 1 )$ , InstanceNorm, ReLU $t _ { 2 + i }$ ; $C ( t _ { 2 + i } , 3 , 1 2 8 , 1 )$ , InstanceNorm $ r _ { 2 + i }$ ; $r _ { 2 + i } + l _ { 2 + i } \to l _ { 3 + i }$ . We use 10 residual blocks for all UVT generators.
|
| 326 |
+
|
| 327 |
+
Since UVT generators are larger than the VSR generator, we also use a larger $D _ { s , t }$ architecture:
|
| 328 |
+
|
| 329 |
+
$\mathbb { N } _ { s , t } ^ { g }$ or $\Pi _ { s , t } ^ { y } l _ { i n } ; C ( l _ { i n } , 4 , 6 4 , 2 4 ) , \mathrm { R e L U } l _ { 0 } \mathrm { , }$ ; $C ( l _ { 0 } , 4 , 1 2 8 , 2 )$ , InstanceNorm, Leaky $\mathrm { R e L U } l _ { 1 }$ ; $C ( l _ { 1 } , 4 , 2 5 6 , 2 )$ , InstanceNorm, Leaky $\mathrm { R e L U } \to l _ { 2 }$ ; $C ( l _ { 2 } , 4 , 5 1 2 , 2 )$ , InstanceNorm, Leaky ReLU $ l _ { 3 }$ ; $D e n s e ( l _ { 3 } , 1 ) \to l _ { o u t }$ .
|
| 330 |
+
|
| 331 |
+
Again, all ablation studies use the same architecture with different inputs.
|
| 332 |
+
|
| 333 |
+
# G TRAINING DETAILS
|
| 334 |
+
|
| 335 |
+
We use the non-saturated GAN for VSR and LSGAN (Mao et al., 2017) for UVT and both of them can prevent the gradient vanishing problem of a vanilla GAN (Goodfellow et al., 2014). While we train stably with a dynamic discriminator updating strategy, i.e. discriminators are not updated when there is already a large difference between $D ( \boldsymbol { \mathrm { I } } ^ { b } )$ and $D ( \mathbf { I } ^ { g } )$ , the training process could potentially be further improved with modern GAN algorithms, e.g. Wasserstein GAN (Gulrajani et al., 2017).We train $\mathbf { G }$ and $F$ together for VSR , while we simply use the pre-trained $F$ for UVT.
|
| 336 |
+
|
| 337 |
+
For the VSR task, our training data-set consists of 250 short HR videos, each with 120 frames. We use sequences with a length of 10 and a batch size of 4. A black image is used as the first previous frame of each video sequence. I.e., one batch contains 40 frames and with the PP loss formulation, the NN receives gradients from 76 frames in total for every training iteration. To improve the stability of the adversarial training, we pre-train $\mathbf { G }$ and $F$ with a simple $L ^ { 2 }$ loss of $\bar { \sum \| } g _ { t } - b _ { t } \| _ { 2 } + \lambda _ { w } \bar { \mathcal { L } } _ { w a r p }$ for $5 0 0 \mathrm { k }$ batches. We use $9 0 0 \mathrm { k }$ batches for the adversarial training stage. The data-sets of the UVT tasks contain around 2400 to 3600 frames. We train the generators with a sequence length of 6 and a batch size of 1. Since temporal triplets are gradually faded in, we do not pre-train models for UVT tasks. With smaller datasets, we train UVT models with $1 0 0 \mathrm { k }$ batches.
|
| 338 |
+
|
| 339 |
+
In the pre-training stage of VSR, we train the F and a generator with 10 residual blocks. An ADAM optimizer with $\beta \ : = \ : 0 . 9$ is used throughout. The learning rate starts from $1 0 ^ { - 4 }$ and decays by $50 \%$ every $5 0 \mathrm { k }$ batches until it reaches $2 . 5 * 1 0 ^ { - 5 }$ . This pre-trained model is then used for all TecoGAN variants as initial state. In the adversarial training stage of VSR, all TecoGAN variants are trained with a fixed learning rate of $5 * 1 0 ^ { - 5 }$ . The generators in DsOnly, DsDt, DsDtPP and TecoGANhave 10 residual blocks, whereas the TecoGAN model has 6 additional residual blocks in its generator. Therefore, after loading 10 residual blocks from the pre-trained model, these additional residual blocks are faded in smoothly with a factor of $2 . 5 * 1 0 ^ { - 5 }$ . We found this growing training methodology, first introduced by Growing GAN (Karras et al., 2017), to be stable and efficient in our tests. When training the VSR DsDt and DsDtPP, extra parameters are used to balance the two cooperating discriminators properly. Through experiments, we found $D _ { t }$ to be stronger. Therefore, we reduce the learning rate of $D _ { t }$ to $1 . 5 * \bar { 1 } 0 ^ { - 5 }$ in order to keep both discriminators balanced. At the same time, a factor of 0.0003 is used on the temporal adversarial loss to the generator, while the spatial adversarial loss has a factor of 0.001. During the VSR training, input LR video frames are cropped to a size of $3 2 \times 3 2$ . In all VSR models, the Leaky ReLU operation uses a tangent of 0.2 for the negative half space. Additional training parameters are listed in Table 6.
|
| 340 |
+
|
| 341 |
+
Table 6: Training parameters
|
| 342 |
+
|
| 343 |
+
<table><tr><td rowspan=1 colspan=1>VSRParam</td><td rowspan=1 colspan=1>DsOnly</td><td rowspan=1 colspan=1>DsDt DsDtPP</td><td rowspan=1 colspan=1>TecoGAN</td><td rowspan=1 colspan=1>TecoGAN UVTParam</td><td rowspan=1 colspan=1>DsOnlyDst</td><td rowspan=1 colspan=1>DsDtPP</td><td rowspan=1 colspan=1>TecoGAN</td></tr><tr><td rowspan=1 colspan=1>入a</td><td rowspan=1 colspan=1>1e-3</td><td rowspan=1 colspan=1>Ds:1e-3,Dt:3e-4</td><td rowspan=1 colspan=1>1e-3</td><td rowspan=1 colspan=1>1e-3 入a</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>Ds:0.5Dt:0.3</td><td rowspan=1 colspan=1>0.5</td></tr><tr><td rowspan=1 colspan=1>入p</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=3>0.0 0.5 Xp</td><td rowspan=1 colspan=1>0.00.0</td><td rowspan=1 colspan=2>100.0</td></tr><tr><td rowspan=1 colspan=1>入</td><td rowspan=1 colspan=4>0.02 for VGG and 1.0 forDiscriminator 入</td><td rowspan=1 colspan=3>from 10 decays to 0.0</td></tr><tr><td rowspan=1 colspan=1>入,Ac</td><td rowspan=1 colspan=4>1.0, 1.0 入</td><td rowspan=1 colspan=3>0.0,a pre-trainedF isused for UST tasks</td></tr><tr><td rowspan=1 colspan=1>Tearning-rate</td><td rowspan=1 colspan=1>5e-5</td><td rowspan=1 colspan=1>1.5e-5 for Dt,5e-5 for others.</td><td rowspan=1 colspan=2>5e-5 5e-5 入c</td><td rowspan=1 colspan=3>10.0</td></tr></table>
|
| 344 |
+
|
| 345 |
+
For all UVT tasks, we use a learning rate of $1 0 ^ { - 4 }$ to train the first $9 0 \mathrm { k }$ batches and the last $1 0 \mathrm { k }$ batches are trained with the learning rate decay from $1 0 ^ { - 4 }$ to 0. Images of the input domain are cropped into a size of $2 5 6 \times 2 5 6$ when training, while the original size is $2 8 8 \times 2 8 8$ . While the Additional training parameters are also listed in Table 6. For UVT, $\mathcal { L } _ { \mathrm { { c o n t e n t } } }$ and $\mathcal { L } _ { \phi }$ are only used to improve the convergence of the training process. We fade out the $\mathcal { L } _ { \mathrm { c o n t e n t } }$ in the first $1 0 \mathrm { k }$ batches and the $\mathcal { L } _ { \phi }$ is used for the first $8 0 \mathrm { k }$ and faded out in last $2 0 \mathrm { k }$ .
|
| 346 |
+
|
| 347 |
+
# H PERFORMANCE
|
| 348 |
+
|
| 349 |
+
TecoGAN is implemented in TensorFlow. While generator and discriminator are trained together, we only need the trained generator network for the inference of new outputs after training, i.e., the whole discriminator network can be discarded. We evaluate the models on a Nvidia GeForce GTX 1080Ti GPU with 11G memory, the resulting VSR performance for which is given in Table 2.
|
| 350 |
+
|
| 351 |
+
The VSR TecoGANmodel and FRVSR have the same number of weights (843587 in the SRNet, i.e. generator network, and 1.7M in F), and thus show very similar performance characteristics with around $3 7 ~ \mathrm { m s }$ spent for one frame. The larger VSR TecoGAN model with 1286723 weights in the generator is slightly slower than $\mathrm { T e c o G A N ^ { \odot } }$ , spending $4 2 \mathrm { m s }$ per frame. In the UVT task, generators spend around $6 0 \mathrm { m s }$ per frame with a size of $5 1 2 \times 5 1 2$ . However, compared with the DUF model, with has more than 6 million weights in total, the TecoGAN performance significantly better thanks to its reduced size.
|
md/train/rJXMpikCZ/rJXMpikCZ.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAPH ATTENTION NETWORKS
|
| 2 |
+
|
| 3 |
+
Petar Velickovi ˇ c´∗
|
| 4 |
+
Department of Computer Science and Technology
|
| 5 |
+
University of Cambridge
|
| 6 |
+
petar.velickovic@cst.cam.ac.uk
|
| 7 |
+
|
| 8 |
+
Guillem Cucurull∗ Centre de Visio per Computador, UAB´ gcucurull@gmail.com
|
| 9 |
+
|
| 10 |
+
Arantxa Casanova∗ Centre de Visio per Computador, UAB ´ ar.casanova.8@gmail.com
|
| 11 |
+
|
| 12 |
+
# Adriana Romero
|
| 13 |
+
|
| 14 |
+
Montreal Institute for Learning Algorithms´
|
| 15 |
+
Facebook AI Research
|
| 16 |
+
adrianars@fb.com
|
| 17 |
+
|
| 18 |
+
# Pietro Lio\` Department of Computer Science and Technology University of Cambridge pietro.lio@cst.cam.ac.uk
|
| 19 |
+
|
| 20 |
+
# Yoshua Bengio
|
| 21 |
+
|
| 22 |
+
Montreal Institute for Learning Algorithms ´ yoshua.umontreal@gmail.com
|
| 23 |
+
|
| 24 |
+
# ABSTRACT
|
| 25 |
+
|
| 26 |
+
We present graph attention networks (GATs), novel neural network architectures that operate on graph-structured data, leveraging masked self-attentional layers to address the shortcomings of prior methods based on graph convolutions or their approximations. By stacking layers in which nodes are able to attend over their neighborhoods’ features, we enable (implicitly) specifying different weights to different nodes in a neighborhood, without requiring any kind of computationally intensive matrix operation (such as inversion) or depending on knowing the graph structure upfront. In this way, we address several key challenges of spectral-based graph neural networks simultaneously, and make our model readily applicable to inductive as well as transductive problems. Our GAT models have achieved or matched state-of-the-art results across four established transductive and inductive graph benchmarks: the Cora, Citeseer and Pubmed citation network datasets, as well as a protein-protein interaction dataset (wherein test graphs remain unseen during training).
|
| 27 |
+
|
| 28 |
+
# 1 INTRODUCTION
|
| 29 |
+
|
| 30 |
+
Convolutional Neural Networks (CNNs) have been successfully applied to tackle problems such as image classification (He et al., 2016), semantic segmentation (Jegou et al., 2017) or machine ´ translation (Gehring et al., 2016), where the underlying data representation has a grid-like structure. These architectures efficiently reuse their local filters, with learnable parameters, by applying them to all the input positions.
|
| 31 |
+
|
| 32 |
+
However, many interesting tasks involve data that can not be represented in a grid-like structure and that instead lies in an irregular domain. This is the case of 3D meshes, social networks, telecommunication networks, biological networks or brain connectomes. Such data can usually be represented in the form of graphs.
|
| 33 |
+
|
| 34 |
+
There have been several attempts in the literature to extend neural networks to deal with arbitrarily structured graphs. Early work used recursive neural networks to process data represented in graph domains as directed acyclic graphs (Frasconi et al., 1998; Sperduti & Starita, 1997). Graph Neural Networks (GNNs) were introduced in Gori et al. (2005) and Scarselli et al. (2009) as a generalization of recursive neural networks that can directly deal with a more general class of graphs, e.g. cyclic, directed and undirected graphs. GNNs consist of an iterative process, which propagates the node states until equilibrium; followed by a neural network, which produces an output for each node based on its state. This idea was adopted and improved by Li et al. (2016), which propose to use gated recurrent units (Cho et al., 2014) in the propagation step.
|
| 35 |
+
|
| 36 |
+
Nevertheless, there is an increasing interest in generalizing convolutions to the graph domain. Advances in this direction are often categorized as spectral approaches and non-spectral approaches.
|
| 37 |
+
|
| 38 |
+
On one hand, spectral approaches work with a spectral representation of the graphs and have been successfully applied in the context of node classification. In Bruna et al. (2014), the convolution operation is defined in the Fourier domain by computing the eigendecomposition of the graph Laplacian, resulting in potentially intense computations and non-spatially localized filters. These issues were addressed by subsequent works. Henaff et al. (2015) introduced a parameterization of the spectral filters with smooth coefficients in order to make them spatially localized. Later, Defferrard et al. (2016) proposed to approximate the filters by means of a Chebyshev expansion of the graph Laplacian, removing the need to compute the eigenvectors of the Laplacian and yielding spatially localized filters. Finally, Kipf & Welling (2017) simplified the previous method by restricting the filters to operate in a 1-step neighborhood around each node. However, in all of the aforementioned spectral approaches, the learned filters depend on the Laplacian eigenbasis, which depends on the graph structure. Thus, a model trained on a specific structure can not be directly applied to a graph with a different structure.
|
| 39 |
+
|
| 40 |
+
On the other hand, we have non-spectral approaches (Duvenaud et al., 2015; Atwood & Towsley, 2016; Hamilton et al., 2017), which define convolutions directly on the graph, operating on groups of spatially close neighbors. One of the challenges of these approaches is to define an operator which works with different sized neighborhoods and maintains the weight sharing property of CNNs. In some cases, this requires learning a specific weight matrix for each node degree (Duvenaud et al., 2015), using the powers of a transition matrix to define the neighborhood while learning weights for each input channel and neighborhood degree (Atwood & Towsley, 2016), or extracting and normalizing neighborhoods containing a fixed number of nodes (Niepert et al., 2016). Monti et al. (2016) presented mixture model CNNs (MoNet), a spatial approach which provides a unified generalization of CNN architectures to graphs. More recently, Hamilton et al. (2017) introduced GraphSAGE, a method for computing node representations in an inductive manner. This technique operates by sampling a fixed-size neighborhood of each node, and then performing a specific aggregator over it (such as the mean over all the sampled neighbors’ feature vectors, or the result of feeding them through a recurrent neural network). This approach has yielded impressive performance across several large-scale inductive benchmarks.
|
| 41 |
+
|
| 42 |
+
Attention mechanisms have become almost a de facto standard in many sequence-based tasks (Bahdanau et al., 2015; Gehring et al., 2016). One of the benefits of attention mechanisms is that they allow for dealing with variable sized inputs, focusing on the most relevant parts of the input to make decisions. When an attention mechanism is used to compute a representation of a single sequence, it is commonly referred to as self-attention or intra-attention. Together with Recurrent Neural Networks (RNNs) or convolutions, self-attention has proven to be useful for tasks such as machine reading (Cheng et al., 2016) and learning sentence representations (Lin et al., 2017). However, Vaswani et al. (2017) showed that not only self-attention can improve a method based on RNNs or convolutions, but also that it is sufficient for constructing a powerful model obtaining state-of-the-art performance on the machine translation task.
|
| 43 |
+
|
| 44 |
+
Inspired by this recent work, we introduce an attention-based architecture to perform node classification of graph-structured data. The idea is to compute the hidden representations of each node in the graph, by attending over its neighbors, following a self-attention strategy. The attention architecture has several interesting properties: (1) the operation is efficient, since it is parallelizable across nodeneighbor pairs; (2) it can be applied to graph nodes having different degrees by specifying arbitrary weights to the neighbors; and (3) the model is directly applicable to inductive learning problems, including tasks where the model has to generalize to completely unseen graphs. We validate the proposed approach on four challenging benchmarks: Cora, Citeseer and Pubmed citation networks as well as an inductive protein-protein interaction dataset, achieving or matching state-of-the-art results that highlight the potential of attention-based models when dealing with arbitrarily structured graphs.
|
| 45 |
+
|
| 46 |
+
It is worth noting that, as Kipf & Welling (2017) and Atwood & Towsley (2016), our work can also be reformulated as a particular instance of MoNet (Monti et al., 2016). Moreover, our approach of sharing a neural network computation across edges is reminiscent of the formulation of relational networks (Santoro et al., 2017) and VAIN (Hoshen, 2017), wherein relations between objects or agents are aggregated pair-wise, by employing a shared mechanism. Similarly, our proposed attention model can be connected to the works by Duan et al. (2017) and Denil et al. (2017), which use a neighborhood attention operation to compute attention coefficients between different objects in an environment. Other related approaches include locally linear embedding (LLE) (Roweis & Saul, 2000) and memory networks (Weston et al., 2014). LLE selects a fixed number of neighbors around each data point, and learns a weight coefficient for each neighbor to reconstruct each point as a weighted sum of its neighbors. A second optimization step extracts the point’s feature embedding. Memory networks also share some connections with our work, in particular, if we interpret the neighborhood of a node as the memory, which is used to compute the node features by attending over its values, and then is updated by storing the new features in the same position.
|
| 47 |
+
|
| 48 |
+
# 2 GAT ARCHITECTURE
|
| 49 |
+
|
| 50 |
+
In this section, we will present the building block layer used to construct arbitrary graph attention networks (through stacking this layer), and directly outline its theoretical and practical benefits and limitations compared to prior work in the domain of neural graph processing.
|
| 51 |
+
|
| 52 |
+
# 2.1 GRAPH ATTENTIONAL LAYER
|
| 53 |
+
|
| 54 |
+
We will start by describing a single graph attentional layer, as the sole layer utilized throughout all of the GAT architectures used in our experiments. The particular attentional setup utilized by us closely follows the work of Bahdanau et al. (2015)—but the framework is agnostic to the particular choice of attention mechanism.
|
| 55 |
+
|
| 56 |
+
The input to our layer is a set of node features, $\mathbf { h } = \{ \vec { h } _ { 1 } , \vec { h } _ { 2 } , \dots , \vec { h } _ { N } \} , \vec { h } _ { i } \in \mathbb { R } ^ { F }$ , where $N$ is the number of nodes, and $F$ is the number of features in each node. The layer produces a new set of node features (of potentially different cardinality $F ^ { \prime }$ ), $\mathbf { h } ^ { \prime } = \{ \vec { h } _ { 1 } ^ { \prime } , \vec { h } _ { 2 } ^ { \prime } , \dotsc , \vec { h } _ { N } ^ { \prime } \} , \vec { h } _ { i } ^ { \prime } \in \mathbb { R } ^ { F ^ { \prime } }$ , as its output.
|
| 57 |
+
|
| 58 |
+
In order to obtain sufficient expressive power to transform the input features into higher-level features, at least one learnable linear transformation is required. To that end, as an initial step, a shared linear transformation, parametrized by a weight matrix, $\mathbf { W } \in \mathbb { R } ^ { F ^ { \prime } \times F }$ , is applied to every node. We then perform self-attention on the nodes—a shared attentional mechanism $a : \mathbb { R } ^ { F ^ { \prime } } \times \mathbf { \bar { \mathbb { R } } } ^ { F ^ { \prime } } \to \mathbb { R }$ computes attention coefficients
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
e _ { i j } = a ( \mathbf { W } \Vec { h } _ { i } , \mathbf { W } \Vec { h } _ { j } )
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
that indicate the importance of node $j$ ’s features to node $i$ . In its most general formulation, the model allows every node to attend on every other node, dropping all structural information. We inject the graph structure into the mechanism by performing masked attention—we only compute $e _ { i j }$ for nodes $j \in \mathcal N _ { i }$ , where ${ \mathcal { N } } _ { i }$ is some neighborhood of node $i$ in the graph. In all our experiments, these will be exactly the first-order neighbors of $i$ (including $i$ ). To make coefficients easily comparable across different nodes, we normalize them across all choices of $j$ using the softmax function:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\alpha _ { i j } = \mathrm { s o f t m a x } _ { j } ( e _ { i j } ) = \frac { \exp ( e _ { i j } ) } { \sum _ { k \in { \mathcal { N } } _ { i } } \exp ( e _ { i k } ) } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
In our experiments, the attention mechanism $a$ is a single-layer feedforward neural network, parametrized by a weight vector $\vec { \bf a } \in \mathbb { R } ^ { 2 F ^ { \prime } }$ , and applying the LeakyReLU nonlinearity (with negative input slope $\alpha = 0 . 2$ ). Fully expanded out, the coefficients computed by the attention mechanism (illustrated by Figure 1 (left)) may then be expressed as:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\alpha _ { i j } = \frac { \mathrm { e x p } \left( \mathrm { L e a k y R e L U } \left( \vec { \mathbf { a } } ^ { T } [ \mathbf { W } \vec { h } _ { i } \vert \mathbf { W } \vec { h } _ { j } ] \right) \right) } { \sum _ { k \in \mathcal { N } _ { i } } \mathrm { e x p } \left( \mathrm { L e a k y R e L U } \left( \vec { \mathbf { a } } ^ { T } [ \mathbf { W } \vec { h } _ { i } \vert \vert \mathbf { W } \vec { h } _ { k } ] \right) \right) }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $_ T$ represents transposition and $\parallel$ is the concatenation operation.
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 1: Left: The attention mechanism $a ( \mathbf { W } \vec { h } _ { i } , \mathbf { W } \vec { h } _ { j } )$ employed by our model, parametrized by a weight vector $\vec { \bf a } \in \mathbb { R } ^ { 2 F ^ { \prime } }$ , applying a LeakyReLU activation. Right: An illustration of multihead attention (with $K = 3$ heads) by node 1 on its neighborhood. Different arrow styles and colors denote independent attention computations. The aggregated features from each head are concatenated or averaged to obtain $\vec { h } _ { 1 } ^ { \prime }$ .
|
| 80 |
+
|
| 81 |
+
Once obtained, the normalized attention coefficients are used to compute a linear combination of the features corresponding to them, to serve as the final output features for every node (after potentially applying a nonlinearity, $\sigma$ ):
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\vec { h } _ { i } ^ { \prime } = \sigma \left( \sum _ { j \in \mathcal { N } _ { i } } \alpha _ { i j } \mathbf { W } \vec { h } _ { j } \right) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
To stabilize the learning process of self-attention, we have found extending our mechanism to employ multi-head attention to be beneficial, similarly to Vaswani et al. (2017). Specifically, $K$ independent attention mechanisms execute the transformation of Equation 4, and then their features are concatenated, resulting in the following output feature representation:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\vec { h } _ { i } ^ { \prime } = \prod _ { k = 1 } ^ { K } \sigma \left( \sum _ { j \in \mathcal { N } _ { i } } \alpha _ { i j } ^ { k } \mathbf { W } ^ { k } \vec { h } _ { j } \right)
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\parallel$ represents concatenation, $\alpha _ { i j } ^ { k }$ are normalized attention coefficients computed by the $k$ -th attention mechanism $( a ^ { k } )$ , and $\mathbf { W } ^ { k }$ is the corresponding input linear transformation’s weight matrix. Note that, in this setting, the final returned output, $\mathbf { h } ^ { \prime }$ , will consist of $K F ^ { \prime }$ features (rather than $F ^ { \prime }$ ) for each node.
|
| 94 |
+
|
| 95 |
+
Specially, if we perform multi-head attention on the final (prediction) layer of the network, concatenation is no longer sensible—instead, we employ averaging, and delay applying the final nonlinearity (usually a softmax or logistic sigmoid for classification problems) until then:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\vec { h } _ { i } ^ { \prime } = \sigma \left( \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \sum _ { j \in \mathcal { N } _ { i } } \alpha _ { i j } ^ { k } \mathbf { W } ^ { k } \vec { h } _ { j } \right)
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
The aggregation process of a multi-head graph attentional layer is illustrated by Figure 1 (right).
|
| 102 |
+
|
| 103 |
+
# 2.2 COMPARISONS TO RELATED WORK
|
| 104 |
+
|
| 105 |
+
The graph attentional layer described in subsection 2.1 directly addresses several issues that were present in prior approaches to modelling graph-structured data with neural networks:
|
| 106 |
+
|
| 107 |
+
• Computationally, it is highly efficient: the operation of the self-attentional layer can be parallelized across all edges, and the computation of output features can be parallelized across all nodes. No eigendecompositions or similar computationally intensive matrix operations are required. The time complexity of a single GAT attention head computing $F ^ { \prime }$ features may be expressed as $O ( | V | F F ^ { \prime } + | E | F ^ { \prime } )$ , where $F$ is the number of input features, and $| V |$ and $| E |$ are the numbers of nodes and edges in the graph, respectively. This complexity is on par with the baseline methods such as Graph Convolutional Networks (GCNs) (Kipf & Welling, 2017). Applying multi-head attention multiplies the storage and parameter requirements by a factor of $K$ , while the individual heads’ computations are fully independent and can be parallelized.
|
| 108 |
+
|
| 109 |
+
• As opposed to GCNs, our model allows for (implicitly) assigning different importances to nodes of a same neighborhood, enabling a leap in model capacity. Furthermore, analyzing the learned attentional weights may lead to benefits in interpretability, as was the case in the machine translation domain (e.g. the qualitative analysis of Bahdanau et al. (2015)).
|
| 110 |
+
|
| 111 |
+
• The attention mechanism is applied in a shared manner to all edges in the graph, and therefore it does not depend on upfront access to the global graph structure or (features of) all of its nodes (a limitation of many prior techniques). This has several desirable implications:
|
| 112 |
+
|
| 113 |
+
– The graph is not required to be undirected (we may simply leave out computing $\alpha _ { i j }$ if edge $j \to i$ is not present). – It makes our technique directly applicable to inductive learning—including tasks where the model is evaluated on graphs that are completely unseen during training.
|
| 114 |
+
|
| 115 |
+
• The recently published inductive method of Hamilton et al. (2017) samples a fixed-size neighborhood of each node, in order to keep its computational footprint consistent; this does not allow it access to the entirety of the neighborhood while performing inference. Moreover, this technique achieved some of its strongest results when an LSTM (Hochreiter & Schmidhuber, 1997)-based neighborhood aggregator is used. This assumes the existence of a consistent sequential node ordering across neighborhoods, and the authors have rectified it by consistently feeding randomly-ordered sequences to the LSTM. Our technique does not suffer from either of these issues—it works with the entirety of the neighborhood (at the expense of a variable computational footprint, which is still on-par with methods like the GCN), and does not assume any ordering within it.
|
| 116 |
+
|
| 117 |
+
• As mentioned in Section 1, GAT can be reformulated as a particular instance of MoNet (Monti et al., 2016). More specifically, setting the pseudo-coordinate function to be $u ( x , y ) \ : = \ : f ( x ) \| f ( y )$ , where $f ( x )$ represent (potentially MLP-transformed) features of node $x$ and $\parallel$ is concatenation; and the weight function to be $w _ { j } ( u ) = \mathrm { s o f t m a x } ( \mathrm { M L P } ( u ) )$ (with the softmax performed over the entire neighborhood of a node) would make MoNet’s patch operator similar to ours. Nevertheless, one should note that, in comparison to previously considered MoNet instances, our model uses node features for similarity computations, rather than the node’s structural properties (which would assume knowing the graph structure upfront).
|
| 118 |
+
|
| 119 |
+
We were able to produce a version of the GAT layer that leverages sparse matrix operations, reducing the storage complexity to linear in the number of nodes and edges and enabling the execution of GAT models on larger graph datasets. However, the tensor manipulation framework we used only supports sparse matrix multiplication for rank-2 tensors, which limits the batching capabilities of the layer as it is currently implemented (especially for datasets with multiple graphs). Appropriately addressing this constraint is an important direction for future work. Depending on the regularity of the graph structure in place, GPUs may not be able to offer major performance benefits compared to CPUs in these sparse scenarios. It should also be noted that the size of the “receptive field” of our model is upper-bounded by the depth of the network (similarly as for GCN and similar models). Techniques such as skip connections (He et al., 2016) could be readily applied for appropriately extending the depth, however. Lastly, parallelization across all the graph edges, especially in a distributed manner, may involve a lot of redundant computation, as the neighborhoods will often highly overlap in graphs of interest.
|
| 120 |
+
|
| 121 |
+
Table 1: Summary of the datasets used in our experiments.
|
| 122 |
+
|
| 123 |
+
<table><tr><td></td><td>Cora</td><td>Citeseer</td><td>Pubmed</td><td>PPI</td></tr><tr><td>Task</td><td>Transductive</td><td>Transductive</td><td>Transductive</td><td>Inductive</td></tr><tr><td># Nodes</td><td>2708 (1 graph)</td><td>3327 (1 graph)</td><td>19717 (1 graph)</td><td>56944 (24 graphs)</td></tr><tr><td>#Edges</td><td>5429</td><td>4732</td><td>44338</td><td>818716</td></tr><tr><td>#Features/Node</td><td>1433</td><td>3703</td><td>500</td><td>50</td></tr><tr><td># Classes</td><td>7</td><td>6</td><td>3</td><td>121 (multilabel)</td></tr><tr><td># Training Nodes</td><td>140</td><td>120</td><td>60</td><td>44906 (20 graphs)</td></tr><tr><td># Validation Nodes</td><td>500</td><td>500</td><td>500</td><td>6514 (2 graphs)</td></tr><tr><td># Test Nodes</td><td>1000</td><td>1000</td><td>1000</td><td>5524 (2 graphs)</td></tr></table>
|
| 124 |
+
|
| 125 |
+
# 3 EVALUATION
|
| 126 |
+
|
| 127 |
+
We have performed comparative evaluation of GAT models against a wide variety of strong baselines and previous approaches, on four established graph-based benchmark tasks (transductive as well as inductive), achieving or matching state-of-the-art performance across all of them. This section summarizes our experimental setup, results, and a brief qualitative analysis of a GAT model’s extracted feature representations.
|
| 128 |
+
|
| 129 |
+
# 3.1 DATASETS
|
| 130 |
+
|
| 131 |
+
Transductive learning We utilize three standard citation network benchmark datasets—Cora, Citeseer and Pubmed (Sen et al., 2008)—and closely follow the transductive experimental setup of Yang et al. (2016). In all of these datasets, nodes correspond to documents and edges to (undirected) citations. Node features correspond to elements of a bag-of-words representation of a document. Each node has a class label. We allow for only 20 nodes per class to be used for training—however, honoring the transductive setup, the training algorithm has access to all of the nodes’ feature vectors. The predictive power of the trained models is evaluated on 1000 test nodes, and we use 500 additional nodes for validation purposes (the same ones as used by Kipf & Welling (2017)). The Cora dataset contains 2708 nodes, 5429 edges, 7 classes and 1433 features per node. The Citeseer dataset contains 3327 nodes, 4732 edges, 6 classes and 3703 features per node. The Pubmed dataset contains 19717 nodes, 44338 edges, 3 classes and 500 features per node.
|
| 132 |
+
|
| 133 |
+
Inductive learning We make use of a protein-protein interaction (PPI) dataset that consists of graphs corresponding to different human tissues (Zitnik & Leskovec, 2017). The dataset contains 20 graphs for training, 2 for validation and 2 for testing. Critically, testing graphs remain completely unobserved during training. To construct the graphs, we used the preprocessed data provided by Hamilton et al. (2017). The average number of nodes per graph is 2372. Each node has 50 features that are composed of positional gene sets, motif gene sets and immunological signatures. There are 121 labels for each node set from gene ontology, collected from the Molecular Signatures Database (Subramanian et al., 2005), and a node can possess several labels simultaneously.
|
| 134 |
+
|
| 135 |
+
An overview of the interesting characteristics of the datasets is given in Table 1.
|
| 136 |
+
|
| 137 |
+
# 3.2 STATE-OF-THE-ART METHODS
|
| 138 |
+
|
| 139 |
+
Transductive learning For transductive learning tasks, we compare against the same strong baselines and state-of-the-art approaches as specified in Kipf & Welling (2017). This includes label propagation (LP) (Zhu et al., 2003), semi-supervised embedding (SemiEmb) (Weston et al., 2012), manifold regularization (ManiReg) (Belkin et al., 2006), skip-gram based graph embeddings (DeepWalk) (Perozzi et al., 2014), the iterative classification algorithm (ICA) (Lu & Getoor, 2003) and Planetoid (Yang et al., 2016). We also directly compare our model against GCNs (Kipf & Welling, 2017), as well as graph convolutional models utilising higher-order Chebyshev filters (Defferrard et al., 2016), and the MoNet model presented in Monti et al. (2016).
|
| 140 |
+
|
| 141 |
+
Inductive learning For the inductive learning task, we compare against the four different supervised GraphSAGE inductive methods presented in Hamilton et al. (2017). These provide a variety of approaches to aggregating features within a sampled neighborhood: GraphSAGE-GCN (which extends a graph convolution-style operation to the inductive setting), GraphSAGE-mean (taking the elementwise mean value of feature vectors), GraphSAGE-LSTM (aggregating by feeding the neighborhood features into an LSTM) and GraphSAGE-pool (taking the elementwise maximization operation of feature vectors transformed by a shared nonlinear multilayer perceptron). The other transductive approaches are either completely inappropriate in an inductive setting or assume that nodes are incrementally added to a single graph, making them unusable for the setup where test graphs are completely unseen during training (such as the PPI dataset).
|
| 142 |
+
|
| 143 |
+
Additionally, for both tasks we provide the performance of a per-node shared multilayer perceptron (MLP) classifier (that does not incorporate graph structure at all).
|
| 144 |
+
|
| 145 |
+
# 3.3 EXPERIMENTAL SETUP
|
| 146 |
+
|
| 147 |
+
Transductive learning For the transductive learning tasks, we apply a two-layer GAT model. Its architectural hyperparameters have been optimized on the Cora dataset and are then reused for Citeseer. The first layer consists of $K = 8$ attention heads computing $F ^ { \prime } = 8$ features each (for a total of 64 features), followed by an exponential linear unit (ELU) (Clevert et al., 2016) nonlinearity. The second layer is used for classification: a single attention head that computes $C$ features (where $C$ is the number of classes), followed by a softmax activation. For coping with the small training set sizes, regularization is liberally applied within the model. During training, we apply $L _ { 2 }$ regularization with $\lambda = 0 . 0 0 0 5$ . Furthermore, dropout (Srivastava et al., 2014) with $p = 0 . 6$ is applied to both layers’ inputs, as well as to the normalized attention coefficients (critically, this means that at each training iteration, each node is exposed to a stochastically sampled neighborhood). Similarly as observed by Monti et al. (2016), we found that Pubmed’s training set size (60 examples) required slight changes to the GAT architecture: we have applied $K = 8$ output attention heads (instead of one), and strengthened the $L _ { 2 }$ regularization to $\lambda = 0 . 0 0 1$ . Otherwise, the architecture matches the one used for Cora and Citeseer.
|
| 148 |
+
|
| 149 |
+
Inductive learning For the inductive learning task, we apply a three-layer GAT model. Both of the first two layers consist of $K = 4$ attention heads computing $F ^ { \prime } = 2 5 6$ features (for a total of 1024 features), followed by an ELU nonlinearity. The final layer is used for (multi-label) classification: $K = 6$ attention heads computing 121 features each, that are averaged and followed by a logistic sigmoid activation. The training sets for this task are sufficiently large and we found no need to apply $L _ { 2 }$ regularization or dropout—we have, however, successfully employed skip connections (He et al., 2016) across the intermediate attentional layer. We utilize a batch size of 2 graphs during training. To strictly evaluate the benefits of applying an attention mechanism in this setting (i.e. comparing with a near GCN-equivalent model), we also provide the results when a constant attention mechanism, $a ( x , y ) = 1$ , is used, with the same architecture—this will assign the same weight to every neighbor.
|
| 150 |
+
|
| 151 |
+
Both models are initialized using Glorot initialization (Glorot & Bengio, 2010) and trained to minimize cross-entropy on the training nodes using the Adam SGD optimizer (Kingma & Ba, 2014) with an initial learning rate of 0.01 for Pubmed, and 0.005 for all other datasets. In both cases we use an early stopping strategy on both the cross-entropy loss and accuracy (transductive) or micro- $\cdot \mathrm { F _ { 1 } }$ (inductive) score on the validation nodes, with a patience of 100 epochs1.
|
| 152 |
+
|
| 153 |
+
# 3.4 RESULTS
|
| 154 |
+
|
| 155 |
+
The results of our comparative evaluation experiments are summarized in Tables 2 and 3.
|
| 156 |
+
|
| 157 |
+
For the transductive tasks, we report the mean classification accuracy (with standard deviation) on the test nodes of our method after 100 runs, and reuse the metrics already reported in Kipf & Welling (2017) and Monti et al. (2016) for state-of-the-art techniques. Specifically, for the Chebyshev filterbased approach (Defferrard et al., 2016), we provide the maximum reported performance for filters of orders $K = 2$ and $K = 3$ . In order to fairly assess the benefits of the attention mechanism, we further evaluate a GCN model that computes 64 hidden features, attempting both the ReLU and
|
| 158 |
+
|
| 159 |
+
Table 2: Summary of results in terms of classification accuracies, for Cora, Citeseer and Pubmed. GCN- ${ \boldsymbol { \cdot } } 6 4 ^ { \ast }$ corresponds to the best GCN result computing 64 hidden features (using ReLU or ELU).
|
| 160 |
+
|
| 161 |
+
<table><tr><td colspan="4">Transductive</td></tr><tr><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td></tr><tr><td>MLP</td><td>55.1%</td><td>46.5%</td><td>71.4%</td></tr><tr><td>ManiReg (Belkin et al., 2006)</td><td>59.5%</td><td>60.1%</td><td>70.7%</td></tr><tr><td>SemiEmb (Weston et al., 2012)</td><td>59.0%</td><td>59.6%</td><td>71.7%</td></tr><tr><td>LP (Zhu et al., 2003)</td><td>68.0%</td><td>45.3%</td><td>63.0%</td></tr><tr><td>DeepWalk (Perozzi et al., 2014)</td><td>67.2%</td><td>43.2%</td><td>65.3%</td></tr><tr><td>ICA (Lu& Getoor,2003)</td><td>75.1%</td><td>69.1%</td><td>73.9%</td></tr><tr><td>Planetoid (Yang et al., 2016)</td><td>75.7%</td><td>64.7%</td><td>77.2%</td></tr><tr><td>Chebyshev (Defferrard et al.,2016)</td><td>81.2%</td><td>69.8%</td><td>74.4%</td></tr><tr><td>GCN (Kipf & Welling,2017)</td><td>81.5%</td><td>70.3%</td><td>79.0%</td></tr><tr><td>MoNet (Monti et al., 2016)</td><td>81.7 ± 0.5%</td><td></td><td>78.8 ± 0.3%</td></tr><tr><td>GCN-64*</td><td>81.4 ± 0.5%</td><td>70.9 ± 0.5%</td><td>79.0 ± 0.3%</td></tr><tr><td>GAT (ours)</td><td>83.0 ± 0.7%</td><td>72.5 ± 0.7%</td><td>79.0 ± 0.3%</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 3: Summary of results in terms of micro-averaged $\mathrm { F _ { 1 } }$ scores, for the PPI dataset. GraphSAGE∗ corresponds to the best GraphSAGE result we were able to obtain by just modifying its architecture. Const-GAT corresponds to a model with the same architecture as GAT, but with a constant attention mechanism (assigning same importance to each neighbor; GCN-like inductive operator).
|
| 164 |
+
|
| 165 |
+
<table><tr><td colspan="2">Inductive</td></tr><tr><td>Method</td><td>PPI</td></tr><tr><td>Random</td><td>0.396</td></tr><tr><td>MLP</td><td>0.422</td></tr><tr><td>GraphSAGE-GCN (Hamilton et al., 2017)</td><td>0.500</td></tr><tr><td>GraphSAGE-mean (Hamilton et al., 2017)</td><td>0.598</td></tr><tr><td>GraphSAGE-LSTM (Hamilton et al., 2017)</td><td>0.612</td></tr><tr><td>GraphSAGE-pool (Hamilton et al.,2017)</td><td>0.600</td></tr><tr><td>GraphSAGE*</td><td>0.768</td></tr><tr><td>Const-GAT (ours)</td><td>0.934 ± 0.006</td></tr><tr><td>GAT (ours)</td><td>0.973 ± 0.002</td></tr></table>
|
| 166 |
+
|
| 167 |
+
ELU activation, and reporting (as ${ \mathrm { G C N } } { - } 6 4 ^ { * }$ ) the better result after 100 runs (which was the ReLU in all three cases).
|
| 168 |
+
|
| 169 |
+
For the inductive task, we report the micro-averaged $\mathrm { F _ { 1 } }$ score on the nodes of the two unseen test graphs, averaged after 10 runs, and reuse the metrics already reported in Hamilton et al. (2017) for the other techniques. Specifically, as our setup is supervised, we compare against the supervised GraphSAGE approaches. To evaluate the benefits of aggregating across the entire neighborhood, we further provide (as GraphSAGE∗) the best result we were able to achieve with GraphSAGE by just modifying its architecture (this was with a three-layer GraphSAGE-LSTM with [512, 512, 726] features computed in each layer and 128 features used for aggregating neighborhoods). Finally, we report the 10-run result of our constant attention GAT model (as Const-GAT), to fairly evaluate the benefits of the attention mechanism against a GCN-like aggregation scheme (with the same architecture).
|
| 170 |
+
|
| 171 |
+
Our results successfully demonstrate state-of-the-art performance being achieved or matched across all four datasets—in concordance with our expectations, as per the discussion in Section 2.2. More specifically, we are able to improve upon GCNs by a margin of $1 . 5 \%$ and $1 . 6 \%$ on Cora and Citeseer, respectively, suggesting that assigning different weights to nodes of a same neighborhood may be beneficial. It is worth noting the improvements achieved on the PPI dataset: Our GAT model improves by $2 0 . 5 \%$ w.r.t. the best GraphSAGE result we were able to obtain, demonstrating that our model has the potential to be applied in inductive settings, and that larger predictive power can be leveraged by observing the entire neighborhood. Furthermore, it improves by $3 . 9 \%$ w.r.t. Const-GAT (the identical architecture with constant attention mechanism), once again directly demonstrating the significance of being able to assign different weights to different neighbors.
|
| 172 |
+
|
| 173 |
+
The effectiveness of the learned feature representations may also be investigated qualitatively—and for this purpose we provide a visualization of the t-SNE (Maaten & Hinton, 2008)-transformed feature representations extracted by the first layer of a GAT model pre-trained on the Cora dataset (Figure 2). The representation exhibits discernible clustering in the projected 2D space. Note that these clusters correspond to the seven labels of the dataset, verifying the model’s discriminative power across the seven topic classes of Cora. Additionally, we visualize the relative strengths of the normalized attention coefficients (averaged across all eight attention heads). Properly interpreting these coefficients (as performed by e.g. Bahdanau et al. (2015)) will require further domain knowledge about the dataset under study, and is left for future work.
|
| 174 |
+
|
| 175 |
+
# 4 CONCLUSIONS
|
| 176 |
+
|
| 177 |
+
We have presented graph attention networks (GATs), novel convolution-style neural networks that operate on graph-structured data, leveraging masked self-attentional layers. The graph attentional layer utilized throughout these networks is computationally efficient (does not require computationally intensive matrix operations, and is parallelizable across all nodes in the graph), allows for (implicitly) assigning different importances to different nodes within a neighborhood while dealing with different sized neighborhoods, and does not depend on knowing the entire graph structure upfront— thus addressing many of the theoretical issues with previous spectral-based approaches. Our models leveraging attention have successfully achieved or matched state-of-the-art performance across four well-established node classification benchmarks, both transductive and inductive (especially, with completely unseen graphs used for testing).
|
| 178 |
+
|
| 179 |
+
There are several potential improvements and extensions to graph attention networks that could be addressed as future work, such as overcoming the practical problems described in subsection 2.2 to be able to handle larger batch sizes. A particularly interesting research direction would be taking advantage of the attention mechanism to perform a thorough analysis on the model interpretability.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 2: A t-SNE plot of the computed feature representations of a pre-trained GAT model’s first hidden layer on the Cora dataset. Node colors denote classes. Edge thickness indicates aged attention coefficients between nodes . $i$ and $j$ , across all eight attention heads $\textstyle \bigl ( \sum _ { k = 1 } ^ { - K } \alpha _ { i j } ^ { k } + \alpha _ { j i } ^ { k } \bigr )$
|
| 183 |
+
|
| 184 |
+
Moreover, extending the method to perform graph classification instead of node classification would also be relevant from the application perspective. Finally, extending the model to incorporate edge features (possibly indicating relationship among nodes) would allow us to tackle a larger variety of problems.
|
| 185 |
+
|
| 186 |
+
# ACKNOWLEDGEMENTS
|
| 187 |
+
|
| 188 |
+
The authors would like to thank the developers of TensorFlow (Abadi et al., 2015). PV and PL have received funding from the European Union’s Horizon 2020 research and innovation programme PROPAG-AGEING under grant agreement No 634821. We further acknowledge the support of the following agencies for research funding and computing support: CIFAR, Canada Research Chairs, Compute Canada and Calcul Quebec, as well as NVIDIA for the generous GPU support. Special ´ thanks to: Benjamin Day and Fabian Jansen for kindly pointing out issues in a previous iteration of the paper; Michał Drozd˙ zal for useful discussions, feedback and support; and Ga ˙ etan Marceau for ´ reviewing the paper prior to submission.
|
| 189 |
+
|
| 190 |
+
# REFERENCES
|
| 191 |
+
|
| 192 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Watten- ´ berg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
|
| 193 |
+
|
| 194 |
+
James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1993–2001, 2016.
|
| 195 |
+
|
| 196 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. International Conference on Learning Representations (ICLR), 2015.
|
| 197 |
+
|
| 198 |
+
Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. Journal of machine learning research, 7 (Nov):2399–2434, 2006.
|
| 199 |
+
|
| 200 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. International Conference on Learning Representations (ICLR), 2014.
|
| 201 |
+
|
| 202 |
+
Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016.
|
| 203 |
+
|
| 204 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
|
| 205 |
+
|
| 206 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). International Conference on Learning Representations (ICLR), 2016.
|
| 207 |
+
|
| 208 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks ¨ on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3844–3852, 2016.
|
| 209 |
+
|
| 210 |
+
Misha Denil, Sergio Gomez Colmenarejo, Serkan Cabi, David Saxton, and Nando de Freitas. Pro- ´ grammable agents. arXiv preprint arXiv:1706.06383, 2017.
|
| 211 |
+
|
| 212 |
+
Yan Duan, Marcin Andrychowicz, Bradly Stadie, Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. arXiv preprint arXiv:1703.07326, 2017.
|
| 213 |
+
|
| 214 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015.
|
| 215 |
+
|
| 216 |
+
Paolo Frasconi, Marco Gori, and Alessandro Sperduti. A general framework for adaptive processing of data structures. IEEE transactions on Neural Networks, 9(5):768–786, 1998.
|
| 217 |
+
|
| 218 |
+
Jonas Gehring, Michael Auli, David Grangier, and Yann N. Dauphin. A convolutional encoder model for neural machine translation. CoRR, abs/1611.02344, 2016. URL http://arxiv. org/abs/1611.02344.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference on Neural Networks, pp. 729734, 2005.
|
| 223 |
+
|
| 224 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. Neural Information Processing Systems (NIPS), 2017.
|
| 225 |
+
|
| 226 |
+
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.
|
| 227 |
+
|
| 228 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
|
| 229 |
+
|
| 230 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 231 |
+
|
| 232 |
+
Yedid Hoshen. Vain: Attentional multi-agent predictive modeling. 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. 2698– 2708. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 6863-vain-attentional-multi-agent-predictive-modeling.pdf.
|
| 233 |
+
|
| 234 |
+
Simon Jegou, Michal Drozdzal, David V ´ azquez, Adriana Romero, and Yoshua Bengio. The one ´ hundred layers tiramisu: Fully convolutional densenets for semantic segmentation. In Workshop on Computer Vision in Vehicle Technology CVPRW, 2017.
|
| 235 |
+
|
| 236 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 237 |
+
|
| 238 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017.
|
| 239 |
+
|
| 240 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. International Conference on Learning Representations (ICLR), 2016.
|
| 241 |
+
|
| 242 |
+
Zhouhan Lin, Minwei Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. A structured self-attentive sentence embedding. arXiv preprint arXiv:1703.03130, 2017.
|
| 243 |
+
|
| 244 |
+
Qing Lu and Lise Getoor. Link-based classification. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pp. 496–503, 2003.
|
| 245 |
+
|
| 246 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
|
| 247 |
+
|
| 248 |
+
Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M\` Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. arXiv preprint arXiv:1611.08402, 2016.
|
| 249 |
+
|
| 250 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In Proceedings of The 33rd International Conference on Machine Learning, volume 48, pp. 2014–2023, 2016.
|
| 251 |
+
|
| 252 |
+
Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 701–710. ACM, 2014.
|
| 253 |
+
|
| 254 |
+
Sam T. Roweis and Lawrence K. Saul. Nonlinear dimensionality reduction by locally linear embedding. Science, 290:2323–2326, 2000.
|
| 255 |
+
|
| 256 |
+
Adam Santoro, David Raposo, David GT Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. arXiv preprint arXiv:1706.01427, 2017.
|
| 257 |
+
|
| 258 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009.
|
| 259 |
+
|
| 260 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93, 2008.
|
| 261 |
+
|
| 262 |
+
A. Sperduti and A. Starita. Supervised neural networks for the classification of structures. Trans. Neur. Netw., 8(3):714–735, May 1997. ISSN 1045-9227. doi: 10.1109/72.572108.
|
| 263 |
+
|
| 264 |
+
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.
|
| 265 |
+
|
| 266 |
+
Aravind Subramanian, Pablo Tamayo, Vamsi K Mootha, Sayan Mukherjee, Benjamin L Ebert, Michael A Gillette, Amanda Paulovich, Scott L Pomeroy, Todd R Golub, Eric S Lander, et al. Gene set enrichment analysis: a knowledge-based approach for interpreting genome-wide expression profiles. Proceedings of the National Academy of Sciences, 102(43):15545–15550, 2005.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Jason Weston, Fred´ eric Ratle, Hossein Mobahi, and Ronan Collobert. Deep learning via semi- ´ supervised embedding. In Neural Networks: Tricks of the Trade, pp. 639–655. Springer, 2012.
|
| 271 |
+
|
| 272 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. CoRR, abs/1410.3916, 2014. URL http://arxiv.org/abs/1410.3916.
|
| 273 |
+
|
| 274 |
+
Zhilin Yang, William Cohen, and Ruslan Salakhudinov. Revisiting semi-supervised learning with graph embeddings. In International Conference on Machine Learning, pp. 40–48, 2016.
|
| 275 |
+
|
| 276 |
+
Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International conference on Machine learning (ICML-03), pp. 912–919, 2003.
|
| 277 |
+
|
| 278 |
+
Marinka Zitnik and Jure Leskovec. Predicting multicellular function through multi-layer tissue networks. Bioinformatics, 33(14):i190–i198, 2017.
|
md/train/rklklCVYvB/rklklCVYvB.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TIME2VEC: LEARNING A VECTOR REPRESENTATION OF TIME
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Time is an important feature in many applications involving events that occur synchronously and/or asynchronously. To effectively consume time information, recent studies have focused on designing new architectures. In this paper, we take an orthogonal but complementary approach by providing a model-agnostic vector representation for time, called $T i m e 2 V e c$ , that can be easily imported into many existing and future architectures and improve their performances. We show on a range of models and problems that replacing the notion of time with its Time2Vec representation improves the performance of the final model.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In building machine learning models, “time” is often an important feature. Examples include predicting daily sales for a company based on the date (and other available features), predicting the time for a patient’s next health event based on their medical history, and predicting the song a person is interested in listening to based on their listening history. The input for problems involving time can be considered as a sequence where, rather than being identically and independently distributed (iid), there exists a dependence across time (and/or space) among the data points. The sequence can be either synchronous, i.e. sampled at regular intervals, or asynchronous, i.e. sampled at different points in time. In both cases, time may be an important feature. For predicting daily sales, for instance, it may be useful to know if it is a holiday or not. For predicting the time for a patient’s next encounter, it is important to know the (asynchronous) times of their previous visits.
|
| 12 |
+
|
| 13 |
+
Recurrent neural networks (RNNs) do not typically treat time itself as a feature, typically assuming that inputs are synchronous. When time is known to be a relevant feature, it is often fed in as yet another input dimension (Choi et al., 2016; Du et al., 2016; Li et al., 2018b). In practice, RNNs often fail at effectively making use of time as a feature. To help the RNN make better use of time, several researchers design hand-crafted features of time that suit their specific problem and feed those features into the RNN (Choi et al., 2016; Baytas et al., 2017; Kwon et al., 2019). Hand-crafting features, however, can be expensive and requires domain expertise about the problem.
|
| 14 |
+
|
| 15 |
+
Many recent studies aim at obviating the need for hand-crafting features by proposing generalpurpose—as opposed to problem specific—architectures that better handle time (Neil et al., 2016; Zhu et al., 2017; Mei & Eisner, 2017; Hu & Qi, 2017; Upadhyay et al., 2018; Li et al., 2018a). We follow an orthogonal but complementary approach to these recent studies by developing a generalpurpose model-agnostic representation for time that can be potentially used in any architecture. In particular, we develop a learnable vector representation (or embedding) for time as a vector representation can be easily combined with many models or architectures. We call this vector representation Time2Vec. To validate the effectiveness of Time2Vec, we conduct experiments on several (synthesized and real-world) datasets and integrate it with several architectures. Our main result is to show that on a range of problems and architectures that consume time, using Time2Vec instead of the time itself offers a boost in performance.
|
| 16 |
+
|
| 17 |
+
# 2 RELATED WORK
|
| 18 |
+
|
| 19 |
+
There is a long history of algorithms for predictive modeling in time series analysis. They include auto-regressive techniques (Akaike, 1969) that predict future measurements in a sequence based on a window of past measurements. Since it is not always clear how long the window of past measurements should be, hidden Markov models (Rabiner & Juang, 1986), dynamic Bayesian networks (Murphy & Russell, 2002), and dynamic conditional random fields (Sutton et al., 2007) use hidden states as a finite memory that can remember information arbitrarily far in the past. These models can be seen as special cases of recurrent neural networks (Hochreiter & Schmidhuber, 1997). They typically assume that inputs are synchronous, i.e. arrive at regular time intervals, and that the underlying process is stationary with respect to time. It is possible to aggregate asynchronous events into time-bins and to use synchronous models over the bins (Lipton et al., 2016; Anumula et al., 2018). Asynchronous events can also be directly modeled with point processes (e.g., Poisson, Cox, and Hawkes point processes) (Daley & Vere-Jones, 2007; Laub et al., 2015; Xiao et al., 2017; Li et al., 2018a; Xiao et al., 2018) and continuous time normalizing flows (Chen et al., 2018). Alternatively, one can also interpolate or make predictions at arbitrary time stamps with Gaussian processes (Rasmussen, 2004) or support vector regression (Drucker et al., 1997).
|
| 20 |
+
|
| 21 |
+
Our goal is not to propose a new model for time series analysis, but instead to propose a representation of time in the form of a vector embedding that can be used by many models. Vector embedding has been previously successfully used for other domains such as text (Mikolov et al., 2013; Pennington et al., 2014), (knowledge) graphs (Grover & Leskovec, 2016; Nickel et al., 2016; Kazemi & Poole, 2018), and positions (Vaswani et al., 2017; Gehring et al., 2017). Our approach is related to time decomposition techniques that encode a temporal signal into a set of frequencies (Cohen, 1995). However, instead of using a fixed set of frequencies as in Fourier transforms (Bracewell & Bracewell, 1986), we allow the frequencies to be learned. We take inspiration from the neural decomposition of Godfrey & Gashler (2018) (and similarly (Gashler & Ashmore, 2016)). For time-series analysis, Godfrey & Gashler (2018) decompose a 1D signal of time into several sine functions and a linear function to extrapolate (or interpolate) the given signal. We follow a similar intuition but instead of decomposing a 1D signal of time into its components, we transform the time itself and feed its transformation into the model that is to consume the time information. Our approach corresponds to the technique of Godfrey & Gashler (2018) when applied to regression tasks in 1D signals, but it is more general since we learn a representation that can be shared across many signals and can be fed to many models for tasks beyond regression.
|
| 22 |
+
|
| 23 |
+
While there is a body of literature on designing neural networks with sine activations (Lapedes & Farber, 1987; Sopena et al., 1999; Wong et al., 2002; Mingo et al., 2004; Liu et al., 2016), our work uses sine only for transforming time; the rest of the network uses other activations. There is also a set of techniques that consider time as yet another feature and concatenate time (or some hand designed features of time such as log and/or inverse of delta time) with the input (Choi et al., 2016; Li et al., 2017; Du et al., 2016; Baytas et al., 2017; Kwon et al., 2019; Trivedi et al., 2017; Kumar et al., 2018; Ma et al., 2018). Kazemi et al. (2019) survey several such approaches for dynamic (knowledge) graphs. These models can directly benefit from our proposed vector embedding, Time2Vec, by concatenating Time2Vec with the input instead of their time features. Other works (Neil et al., 2016; Zhu et al., 2017; Mei & Eisner, 2017; Hu & Qi, 2017; Upadhyay et al., 2018; Li et al., 2018a) propose new neural architectures that take into account time (or some features of time). We show how Time2Vec can be used in one of these architectures to better exploit temporal information; it can be potentially used in other architectures as well.
|
| 24 |
+
|
| 25 |
+
# 3 BACKGROUND & NOTATION
|
| 26 |
+
|
| 27 |
+
We use lower-case letters to denote scalars, bold lower-case letters to denote vectors, and bold upper-case letters to denote matrices. We represent the $i ^ { t h }$ element of the vector $\pmb { r }$ as $\pmb { r } [ i ]$ . For two vectors $\pmb { r }$ and $\pmb { s }$ , we use $[ \pmb { r } ; \pmb { s } ]$ to represent their concatenation and $\pmb { r } \odot \pmb { s }$ to represent element-wise (Hadamard) multiplication of the two vectors. Throughout the paper, we use $\tau$ to represent a scalar notion of time (e.g., absolute time or time from the last event) and $\tau$ for a vector of time features.
|
| 28 |
+
|
| 29 |
+
Long Short Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) is considered one of the most successful RNN architectures for sequence modeling. A formulation of the original LSTM model and a variant of it based on peepholes (Gers & Schmidhuber, 2000) is presented in Appendix C. When time is a relevant feature, the easiest way to handle time is to consider it as just another feature (or extract some engineered features from it), concatenate the time features with the input, and use the standard LSTM model (or some other sequence model) (Choi et al., 2016; Du et al., 2016; Li et al.,
|
| 30 |
+
|
| 31 |
+
2018b). In this paper, we call this model $L S T M + T .$ Another way of handling time is by changing the formulation of the standard LSTM. Zhu et al. (2017) developed one such formulation, named TimeLSTM, by adding time gates to the architecture of the LSTM with peepholes. They proposed three architectures namely TLSTM1, TLSTM2, TLSTM3. A description of TLSTM1 and TLSTM3 can be found in Appendix C (we skipped TLSTM2 as it is quite similar to TLSTM3).
|
| 32 |
+
|
| 33 |
+
# 4 TIME2VEC
|
| 34 |
+
|
| 35 |
+
A common approach to deal with time in different applications is to apply some hand-crafted function(s) $f _ { 1 } , \ldots , f _ { m }$ to $\tau$ , $\mathit { \Pi } _ { \tau }$ can be absolute time, time from last event, etc.), concatenate the outputs $f _ { 1 } ( \tau ) , \dots , f _ { m } ( \tau )$ with the rest of the input features $\pmb { x }$ , and feed the resulting vector $[ { \pmb x } ; f _ { 1 } ( \tau ) ; \dots ; f _ { m } ( \tau ) ]$ to a sequence model (see Section 2 for references). This approach requires hand-crafting useful functions of time which may be difficult (or impossible) in several applications, and the hand-crafted functions may not be optimal for the task at hand. Instead of hand-crafting functions of time, we devise a representation of time which can be used to approximate any function through learnable parameters. Such a representation offers two advantages: 1- it obviates the need for hand-crafting functions of time and 2- it provides the grounds for learning suitable functions of time based on the data. As vector representations can be efficiently integrated with the current deep learning architectures, we employ a vector representation for time.
|
| 36 |
+
|
| 37 |
+
Our proposed representation leverages the Fourier sine series (Arfken & Weber, 1999) according to which any 1D function can be approximated in a given interval using a weighted sum of sinusoids with appropriate frequencies (and phase-shifts). We include $k$ sinusoids of the form $s i n ( \omega _ { i } \tau + \varphi _ { i } )$ in our vector representation where $\omega _ { i }$ and $\varphi _ { i }$ are learnable parameters1. That is, we concatenate the input features $\pmb { x }$ with $k$ sinusoids and feed the concatenation $[ \pmb { x } ; s i n ( \omega _ { 1 } \tau + \varphi _ { 1 } ) ; \dots ; s i n ( \omega _ { k } \tau + \varphi _ { k } ) ]$ into a sequence model. Different functions of time can be created using these sinusoids by taking a weighted sum of them with different weights. We allow the weights of the sequence model to combine the sinusoids and create functions of time suitable for the task. If we expand the output $\begin{array} { r } { \pmb { a } ( \tau , k ) [ j ] = \gamma _ { j } + \sum _ { i = 1 } ^ { k } \theta _ { j , i } \sin \left( \omega _ { i } \tau + \varphi _ { i } \right) } \end{array}$ fore, wheures p $\theta _ { j , i ^ { \mathrm { S } } }$ g an activation function), it are the first layer weights and on the temporal features). Ea $\gamma _ { j }$ $\pmb { x }$ $\mathbf { \pmb { a } } ( \tau , k ) [ j ]$ operates on the input features $\pmb { x }$ as well as a learned function $\begin{array} { r } { f _ { j } ( \tau ) = \sum _ { i = 1 } ^ { k } \theta _ { j , i } \sin { \left( \omega _ { i } \tau + \varphi _ { i } \right) } } \end{array}$ of time, as opposed to a hand-crafted function2. Following Godfrey & Gashler (2018), to facilitate approximating functions with non-periodic patterns and help with generalization, we also include a linear projection of time in our vector representation. We name our vector representation of time Time2Vec. Time2Vec of $\tau$ , denoted as $\mathbf { t } 2 \mathbf { v } ( \tau )$ , is a vector of size $k + 1$ defined as follows:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathbf t 2 \mathbf v ( \tau ) [ i ] = { \left\{ \begin{array} { l l } { \omega _ { i } \tau + \varphi _ { i } , } & { { \mathrm { i f } } i = 0 . } \\ { \sin { ( \omega _ { i } \tau + \varphi _ { i } ) } , } & { { \mathrm { i f } } 1 \leq i \leq k . } \end{array} \right. }
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\mathbf { t } 2 \mathbf { v } ( \tau ) [ i ]$ is the $i ^ { t h }$ element of $\mathbf { t } 2 \mathbf { v } ( \tau )$ and $\omega _ { i } \mathbf { s }$ and $\varphi _ { i } \mathbf { s }$ are learnable parameters.
|
| 44 |
+
|
| 45 |
+
The use of sine functions is inspired in part by Vaswani et al. (2017)’s positional encoding. Consider a sequence of items (e.g., a sequence of words) $\{ I _ { 1 } , I _ { 2 } , \ldots , I _ { N } \}$ and a vector representation ${ \pmb v } _ { I _ { j } } \in \mathbb { R } ^ { d }$ for the $j ^ { t h }$ item $I _ { j }$ in the sequence. Vaswani et al. (2017) added $\sin { ( j / 1 0 0 0 0 ^ { k / d } ) }$ to ${ \pmb v } _ { I _ { j } } [ k ]$ if $k$ is even and $\sin { ( j / 1 0 0 0 0 ^ { k / d } + \pi / 2 ) }$ if $k$ is odd so that the resulting vector includes information about the position of the item in the sequence. These sine functions are called the positional encoding. Intuitively, positions can be considered as the times and the items can be considered as the events happening at that time. Thus, Time2Vec can be considered as representing continuous time, instead of discrete positions, using sine functions. The sine functions in Time2Vec also enable capturing periodic behaviors which is not a goal in positional encoding. We feed Time2Vec as an input to the model (or to some gate in the model) instead of adding it to other vector representations. Unlike positional encoding, we show in our experiments that learning the frequencies and phase-shifts of sine functions in Time2Vec result in better performance compared to fixing them.
|
| 46 |
+
|
| 47 |
+
# 4.1 PROPERTIES OF TIME2VEC
|
| 48 |
+
|
| 49 |
+
We review some of the interesting and desired properties of Time2Vec.
|
| 50 |
+
|
| 51 |
+
Periodicity: In many scenarios, some events occur periodically. The amount of sales of a store, for instance, may be higher on weekends or holidays. Weather condition usually follows a periodic pattern over different seasons (Gashler & Ashmore, 2016). Some other events may be non-periodic but only happen after a point in time and/or become more probable as time proceeds. For instance, some diseases are more likely for older ages.
|
| 52 |
+
|
| 53 |
+
The period of $\sin \left( \omega _ { i } \tau + \varphi _ { i } \right)$ is $\frac { 2 \pi } { \omega _ { i } }$ , i.e. it has the same value for $\tau$ and $\textstyle { \tau + { \frac { 2 \pi } { \omega _ { i } } } }$ . Therefore, the sine functions in Time2Vec help capture periodic behaviors without the need for feature engineering. For instance, a sine function $\sin { \left( \omega \tau + \varphi \right) }$ with $\begin{array} { r } { \omega = \frac { 2 \pi } { 7 } } \end{array}$ repeats every 7 days (assuming $\tau$ indicates days) and can be potentially used to model weekly patterns. Furthermore, unlike other basis functions which may show strange behaviors for extrapolation (see, e.g., (Poole et al., 2014)), sine functions are expected to work well for extrapolating to future and out of sample data (Vaswani et al., 2017). The linear term represents the progression of time and can be used for capturing non-periodic patterns in the input that depend on time.
|
| 54 |
+
|
| 55 |
+
Invariance to Time Rescaling: Since time can be measured in different scales (e.g., days, hours, seconds, etc.), another important property of a representation for time is invariance to time rescaling (see, e.g., (Tallec & Ollivier, 2018)). A class $\mathcal { C }$ of models is invariant to time rescaling if for any model $\mathcal { M } _ { 1 } \in \mathcal { C }$ and any scalar $\alpha > 0$ , there exists a model $\mathcal { M } _ { 2 } \in \mathcal { C }$ that behaves on $\alpha \tau$ ( $\mathit { \Pi } _ { \tau }$ scaled by $\alpha$ ) in the same way $\mathcal { M } _ { 1 }$ behaves on original $\tau \mathrm { s }$ . Proposition 1 establishes the invariance of Time2Vec to time rescaling. The proof is in Appendix D.
|
| 56 |
+
|
| 57 |
+
Proposition 1. Time2Vec is invariant to time rescaling.
|
| 58 |
+
|
| 59 |
+
Simplicity: A representation for time should be easily consumable by different models and architectures. A matrix representation, for instance, may be difficult to consume as it cannot be easily appended with the other inputs. By selecting a vector representation for time, we ensure easy integration with deep learning architectures.
|
| 60 |
+
|
| 61 |
+
# 5 EXPERIMENTS & RESULTS
|
| 62 |
+
|
| 63 |
+
We use the following datasets:
|
| 64 |
+
|
| 65 |
+
1) Synthesized data: We create a toy dataset to use for explanatory experiments. The inputs in this dataset are the integers between 1 and 365. Input integers that are multiples of 7 belong to class one and the other integers belong to class two. The first $7 5 \%$ is used for training and the last $2 5 \%$ for testing. This dataset is inspired by the periodic patterns (e.g., weekly or monthly) that often exist in daily-collected data; the input integers can be considered as the days.
|
| 66 |
+
|
| 67 |
+
2) Event-MNIST: Sequential (event-based) MNIST is a common benchmark in sequence modeling literature (see, e.g., (Bellec et al., 2018; Campos et al., 2018; Fatahi et al., 2016)). We create a sequential event-based version of MNIST by flattening the images and recording the position of the pixels whose intensities are larger than a threshold (0.9 in our experiment). Following this transformation, each image will be represented as an array of increasing numbers such as $[ t _ { 1 } , t _ { 2 } , t _ { 3 } , \ldots , t _ { m } ]$ . We consider these values as the event times and use them to classify the images. As in other sequence modeling works, our aim in building this dataset is not to beat the state-of-the-art on the MNIST dataset; our aim is to provide a dataset where the only input is time and different representations for time can be compared when extraneous variables (confounders) are eliminated as much as possible.
|
| 68 |
+
|
| 69 |
+
3) N TIDIGITS18 (Anumula et al., 2018): The dataset includes audio spikes of the TIDIGITS spoken digit dataset (Leonard & Doddington, 1993) recorded by the binaural 64-channel silicon cochlea sensor. Each sample is a sequence of $( t , c )$ tuples where $t$ represents time and $c$ denotes the index of active frequency channel at time $t$ . The labels are sequences of 1 to 7 connected digits with a vocabulary consisting of 11 digits (i.e. “zero” to “nine” plus “oh”) and the goal is to classify the spoken digit based on the given sequence of active channels. We use the reduced version of the dataset where only the single digit samples are used for training and testing. The reduced dataset has a total of 2,464 training and 2,486 test samples.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Comparing $\mathrm { L S T M + T }$ and LSTM+Time2Vec on several datasets.
|
| 73 |
+
|
| 74 |
+
4) Stack Overflow (SOF): This dataset contains sequences of badges obtained by stack overflow users and the timestamps at which the badges were obtained3. We used the subset released by Du et al. (2016) containing $\sim 6 K$ users, 22 event types (badges), and $\sim 4 8 0 K$ events. Given a sequence $[ ( b _ { 1 } ^ { u } , t _ { 1 } ^ { u } ) , ( b _ { 2 } ^ { u } , t _ { 2 } ^ { u } ) , . . . , ( b _ { n } ^ { u } , t _ { n } ^ { u } ) ]$ for each user $u$ where $b _ { i } ^ { u }$ is the badge id and $t _ { i } ^ { u }$ is the timestamp when $u$ received this badge id, the task is to predict the badge the user will obtain at time $t _ { k + 1 } ^ { u }$ .
|
| 75 |
+
|
| 76 |
+
5) Last.FM: This dataset contains a history of listening habits for Last.FM users (Celma, 2010). We used the code released by Zhu et al. (2017) to pre-process the data. The dataset contains $\sim 1 K$ users, 5000 event types (songs), and $\sim 8 1 9 K$ events. The prediction problem is similar to the SOF dataset but with dynamic updating (see, (Zhu et al., 2017) for details).
|
| 77 |
+
|
| 78 |
+
6) CiteULike: This dataset contains data about what and when a user posted on citeulike website4. The original dataset has about 8000 samples. Similar to Last.FM, we used the pre-processing used by Zhu et al. (2017) to select $\sim 1 . 6 K$ sequences with 5000 event types (papers) and $\sim 3 6 K$ events. The task for this dataset is similar to that for Last.FM.
|
| 79 |
+
|
| 80 |
+
Measures: For classification tasks, we report accuracy corresponding to the percentage of correctly classified examples. For recommendation tasks, we report Recall $@ q$ and $M R R @ q$ . Following Zhu et al. (2017), to generate a recommendation list, we sample $k - 1$ random items and add the correct item to the sampled list resulting in a list of $k$ items. Then our model ranks these $k$ items. Looking only at the top ten recommendations, Recall $@ \mathbf { q }$ corresponds to the percentage of recommendation lists where the correct item is in the top $q$ ; $\mathbf { M R R } @ \mathbf { q }$ (reported in Appendix B) corresponds to the mean of the inverses of the rankings of the correct items where the inverse rank is considered 0 if the item does not appear in top $q$ recommendations. For Last.FM and CiteULike, following Zhu et al. (2017) we report Recall $@ 1 0$ and $\mathbf { M R R } @ 1 0$ . For SOF, we report Recall $\textcircled { \alpha } 3$ and MRR as there are only 22 event types and Recall $@ 1 0$ and MRR $@ 1 0$ are not informative enough. The detail of the implementations is presented in Appendix A.
|
| 81 |
+
|
| 82 |
+
# 5.1 ON THE EFFECTIVENESS OF TIME2VEC
|
| 83 |
+
|
| 84 |
+
Fig. 1 represents the obtained results of comparing $L S T M + T i m e 2 V e c$ with $L S T M + T$ on several datasets with different properties and statistics. On all datasets, replacing time with Time2Vec improves the performance in most cases and never deteriorates it; in many cases, LSTM $^ +$ Time2Vec performs consistently better than $\mathrm { L S T M + T } .$ . Anumula et al. (2018) mention that $\mathrm { L S T M + T }$ fails on N TIDIGITS18 as the dataset contains very long sequences. By feeding better features to the LSTM rather than relying on the LSTM to extract them, Time2Vec helps better optimize the LSTM and offers higher accuracy (and lower variance) compared to $\mathrm { L S T M + T } .$ Besides N TIDIGITS18, SOF also contains somewhat long sequences and long time horizons. The results on these two datasets indicate that Time2Vec can be effective for datasets with long sequences and time horizons.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Comparing TLSTM1 and TLSTM3 on Last.FM and CiteULike in terms of Recall $@$ 10 with and without Time2Vec.
|
| 88 |
+
|
| 89 |
+
To verify if Time2Vec can be integrated with other architectures and improve their performance, we integrate it with TLSTM1 and TLSTM3, two recent and powerful models for handling asynchronous events. We replaced their notion $\tau$ of time with $\mathbf { t } 2 \mathbf { v } ( \tau )$ and replaced the vectors getting multiplied to $\tau$ with matrices accordingly. The updated formulations are presented in Appendix C. The obtained results in Fig. 2 for TLSTM1 and TLSTM3 on Last.FM and CiteULike demonstrates that replacing time with Time2Vec for both TLSTM1 and TLSTM3 improves the performance.
|
| 90 |
+
|
| 91 |
+
# 5.2 MODEL VARIANTS & ABLATION STUDY
|
| 92 |
+
|
| 93 |
+
Other activation functions: Inspired by Fourier sine series and by positional encoding, we used sine activations in Eq. 1. To evaluate how sine activations compare to other activation functions for our setting, we repeated the experiment on Event-MNIST in Section 5.1 when using non-periodic activations such as Sigmoid, Tanh, and rectified linear units (ReLU) (Nair & Hinton, 2010), and periodic activations such as mod and triangle. We fixed the length of the Time2Vec to $6 4 + 1$ , i.e. 64 units with a non-linear transformation and 1 unit with a linear transformation. From the results shown in Fig. 5(a), it can be observed that the periodic activation functions (sine, mod, and triangle) outperform the non-periodic ones. Other than not being able to capture periodic behaviors, we believe one of the main reasons why these non-periodic activation functions do not perform well is because as time goes forward and becomes larger, Sigmoid and Tanh saturate and ReLU either goes to zero or explodes. Among periodic activation functions, sine outperforms the other two.
|
| 94 |
+
|
| 95 |
+
Fixed frequencies and phase-shifts: Vaswani et al. (2017) mention that learning sine frequencies and phase-shifts for their positional encoding gives the same performance as fixing frequencies to exponentially-decaying values and phase-shifts to 0 and $\frac { \pi } { 2 }$ . This raises the question of whether learning the sine frequencies and phase-shifts of Time2Vec from data offer any advantage compared to fixing them. To answer this question, we compare three models on Event-MNIST when using Time2Vec of length $1 6 + 1$ : 1- fixing $\mathbf { t } 2 \mathbf { v } ( \tau ) [ n ]$ to sin $\left( { \frac { 2 \pi n } { 1 6 } } \right)$ for $n \leq 1 6$ , 2- fixing the frequencies and phase shifts according to Vaswani et al. (2017)’s positional encoding, and 3- learning the frequencies and phase-shifts from the data. Fig. 5(b) represents our obtained results. The obtained results in Fig. 5(b) show that learning the frequencies and phase-shifts rather than fixing them helps improve the performance of the model.
|
| 96 |
+
|
| 97 |
+
Modeling Periodic Behaviours: To measure how well Time2Vec performs in capturing periodic behaviours, we trained a model on our synthesized dataset where the input integer (day) is used as
|
| 98 |
+
|
| 99 |
+
(a) A weighted sum of the sinusoids in Time2Vec oscillating every 7 days.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 3: The models learned for our synthesized dataset before the final activation. The red dots represent the points to be classified as 1.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
(b) A weighted sum of the sinusoids in Time2Vec oscillating every 14 days.
|
| 106 |
+
|
| 107 |
+
the time for Time2Vec and a fully connected layer is used on top of the Time2Vec to predict the class. That is, the probability of one of the classes is a sigmoid of a weighted sum of the Time2Vec elements. Fig. 3 (a) shows a the learned function for the days in the test set where the weights, frequencies and phase-shifts are learned from the data. The red dots on the figure represent multiples of 7. It can be observed that Time2Vec successfully learns the correct period and oscillates every 7 days. The phase-shifts have been learned in a way that all multiples of 7 are placed on the positive peaks of the signal to facilitate separating them from the other days. Looking at the learned frequency and phase-shift for the sine functions across several runs, we observed that in many runs one of the main sine functions has a frequency around $\begin{array} { r } { 0 . 8 9 8 \approx \frac { 2 \pi } { 7 } } \end{array}$ and a phase-shift around $1 . 5 6 \approx \frac { \pi } { 2 }$ , thus learning to oscillate every 7 days and shifting by $\frac { \pi } { 2 }$ to make sure multiples of 7 end up at the peaks of the signal. Fig. 4 shows the initial and learned sine frequencies for one run. It can be viewed that at the beginning, the weights and frequencies are random numbers. But after training, only the desired frequency $\textstyle { \left( { \frac { 2 \pi } { 7 } } \right) }$ has a high weight (and the 0 frequency which gets subsumed into the bias). The model perfectly classifies the examples in the test set which represents the sine functions in Time2Vec can be used effectively for extrapolation and out of sample times assuming that the test set follows similar periodic patterns as the train set5. We added some noise to our labels by flipping $5 \%$ of the labels selected at random and observed a similar performance in most runs.
|
| 108 |
+
|
| 109 |
+
To test invariance to time rescaling, we multiplied the inputs by 2 and observed that in many runs, the frequency of one of the main sine functions was around $\begin{array} { r } { 0 . 4 4 \dot { 8 } \approx \frac { 2 \pi } { 2 * 7 } } \end{array}$ thus oscillating every 14 days. An example of a combination of signals learned to oscillate every 14 days is in Fig. 3 (b).
|
| 110 |
+
|
| 111 |
+
The use of periodicity in sine functions: It has been argued that when sine activations are used, only a monotonically increasing (or decreasing) part of it is used and the periodic part is ignored (Giambattista Parascandolo, 2017). When we use Time2Vec, however, the periodicity of the sine functions are also being used and seem to be key to the effectiveness of the Time2Vec representation. Fig. 5(c) shows some statistics on the frequencies learned for Event-MNIST where we count the number of learned frequencies that fall within intervals of lengths 0.1 centered at $[ 0 . 0 5 , 0 . 1 5 , \ldots , 0 . 9 5 ]$ ] (all learned frequencies are between 0 and 1). The figure contains two peaks at 0.35 and 0.85. Since the input to the sine functions for this problem can have a maximum value of 784 (number of pixels in an image), sine functions with frequencies around 0.35 and 0.85 finish (almost) 44 and 106 full periods. The smallest learned frequency is 0.029 which finishes (almost) 3.6 full periods. These values indicate that the model is indeed using the periodicity of the sine functions, not just a monotonically increasing (or decreasing) part of them.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 4: (a) Initial vs. (b) learned weights and frequencies for our synthesized dataset.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 5: An ablation study of several components in Time2Vec. (a) Comparing different activation functions for Time2Vec on Event-MNIST. Sigmoid and Tanh almost overlap. (b) Comparing frequencies fixed to equally-spaced values, frequencies fixed according to positional encoding (Vaswani et al., 2017), and learned frequencies on Event-MNIST. (c) A histogram of the frequencies learned in Time2Vec for Event-MNIST. The $\mathbf { X }$ -axis represents frequency intervals and the y-axis represents the number of frequencies in that interval. (d) The performance of TLSTM3 $+$ Time2Vec on CiteULike in terms of Recall $@ 1 0$ with and without the linear term.
|
| 118 |
+
|
| 119 |
+
The Linear Term: To see the effect of the linear term in Time2Vec, we repeated the experiment for Event-MNIST when the linear term is removed from Time2VecWe observed that the results were not ˙ affected substantially, thus showing that the linear term may not be helpful for Event-MNIST. This might be due to the simplicity of the Event-MNIST dataset. Then we conducted a similar experiment for TLSTM3 on CiteULike (which is a more challenging dataset) and obtained the results in Fig. 5(d). From these results, we can see that the linear term helps facilitate learning functions of time that can be effectively consumed by the model.
|
| 120 |
+
|
| 121 |
+
# 6 CONCLUSION & FUTURE WORK
|
| 122 |
+
|
| 123 |
+
In many tasks for synchronous and asynchronous event predictions, time is an important feature. Previous work has mainly resorted to applying hand-crafted functions to time and concatenating these functions with the rest of the input features. In this work, we presented an approach that automatically learns these functions from data. In particular, we developed Time2Vec, a vector representation for time, using sine and linear activations and showed the effectiveness of this representation across several datasets and several tasks. In the majority of our experiments, Time2Vec improved our results, while the remaining results were not hindered by its application. While sine functions have been argued to complicate the optimization (Lapedes & Farber, 1987; Giambattista Parascandolo, 2017), we did not experience such a complication except for the experiment in Subsection 5.2 on our synthesized dataset when using only a few sine functions. We hypothesize that the main reasons include combining sine functions with a powerful model (e.g., LSTM) and using many sine functions which reduces the distance to the goal (see, e.g., (Neyshabur et al., 2019)). We leave a deeper theoretical analysis of this hypothesis, development of better optimizers, and experimenting with other representations for time as future work.
|
| 124 |
+
|
| 125 |
+
# REFERENCES
|
| 126 |
+
|
| 127 |
+
Hirotugu Akaike. Fitting autoregressive models for prediction. Annals of the institute of Statistical Mathematics, 21(1):243–247, 1969.
|
| 128 |
+
|
| 129 |
+
Jithendar Anumula, Daniel Neil, Tobi Delbruck, and Shih-Chii Liu. Feature representations for neuromorphic audio spike streams. Frontiers in neuroscience, 12:23, 2018.
|
| 130 |
+
|
| 131 |
+
George B Arfken and Hans J Weber. Mathematical methods for physicists, 1999.
|
| 132 |
+
|
| 133 |
+
Inci M Baytas, Cao Xiao, Xi Zhang, Fei Wang, Anil K Jain, and Jiayu Zhou. Patient subtyping via time-aware lstm networks. In ACM SIGKDD, pp. 65–74, 2017.
|
| 134 |
+
|
| 135 |
+
Guillaume Bellec, Darjan Salaj, Anand Subramoney, Robert Legenstein, and Wolfgang Maass. Long short-term memory and learning-to-learn in networks of spiking neurons. In NeurIPS, 2018.
|
| 136 |
+
|
| 137 |
+
Ronald Newbold Bracewell and Ronald N Bracewell. The Fourier transform and its applications. McGraw-Hill New York, 1986.
|
| 138 |
+
|
| 139 |
+
V´ıctor Campos, Brendan Jou, Xavier Giro-i Nieto, Jordi Torres, and Shih-Fu Chang. Skip rnn: ´ Learning to skip state updates in recurrent neural networks. In ICLR, 2018.
|
| 140 |
+
|
| 141 |
+
O. Celma. Music Recommendation and Discovery in the Long Tail. Springer, 2010.
|
| 142 |
+
|
| 143 |
+
Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 144 |
+
|
| 145 |
+
Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F Stewart, and Jimeng Sun. Doctor AI: Predicting clinical events via recurrent neural networks. In Machine Learning for Healthcare Conference, pp. 301–318, 2016.
|
| 146 |
+
|
| 147 |
+
Leon Cohen. Time-frequency analysis, volume 778. Prentice hall, 1995.
|
| 148 |
+
|
| 149 |
+
Daryl J Daley and David Vere-Jones. An introduction to the theory of point processes: volume II: general theory and structure. Springer Science & Business Media, 2007.
|
| 150 |
+
|
| 151 |
+
Harris Drucker, Christopher JC Burges, Linda Kaufman, Alex J Smola, and Vladimir Vapnik. Support vector regression machines. In NeurIPS, pp. 155–161, 1997.
|
| 152 |
+
|
| 153 |
+
Nan Du, Hanjun Dai, Rakshit Trivedi, Utkarsh Upadhyay, Manuel Gomez-Rodriguez, and Le Song. Recurrent marked temporal point processes: Embedding event history to vector. In ACM SIGKDD, pp. 1555–1564. ACM, 2016.
|
| 154 |
+
|
| 155 |
+
Mazdak Fatahi, Mahmood Ahmadi, Mahyar Shahsavari, Arash Ahmadi, and Philippe Devienne. evt mnist: A spike based version of traditional mnist. arXiv preprint arXiv:1604.06751, 2016.
|
| 156 |
+
|
| 157 |
+
Michael S Gashler and Stephen C Ashmore. Modeling time series data with deep fourier neural networks. Neurocomputing, 188:3–11, 2016.
|
| 158 |
+
|
| 159 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. arXiv preprint arXiv:1705.03122, 2017.
|
| 160 |
+
|
| 161 |
+
Felix A Gers and Jurgen Schmidhuber. Recurrent nets that time and count. In ¨ IJCNN, volume 3, pp. 189–194. IEEE, 2000.
|
| 162 |
+
|
| 163 |
+
Tuomas Virtanen Giambattista Parascandolo, Heikki Huttunen. Taming the waves: sine as activation function in deep neural networks. 2017. URL https://openreview.net/pdf?id= Sks3zF9eg.
|
| 164 |
+
|
| 165 |
+
Luke B Godfrey and Michael S Gashler. Neural decomposition of time-series data for effective generalization. IEEE transactions on neural networks and learning systems, 29(7):2973–2985, 2018.
|
| 166 |
+
|
| 167 |
+
Klaus Greff, Rupesh K Srivastava, Jan Koutn´ık, Bas R Steunebrink, and Jurgen Schmidhuber. Lstm: ¨ A search space odyssey. IEEE transactions on neural networks and learning systems, 28(10): 2222–2232, 2017.
|
| 168 |
+
|
| 169 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In ACM SIGKDD, pp. 855–864, 2016.
|
| 170 |
+
|
| 171 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 172 |
+
|
| 173 |
+
Hao Hu and Guo-Jun Qi. State-frequency memory recurrent neural networks. In International Conference on Machine Learning, pp. 1568–1577, 2017.
|
| 174 |
+
|
| 175 |
+
Seyed Mehran Kazemi and David Poole. SimplE embedding for link prediction in knowledge graphs. In NeurIPS, pp. 4289–4300, 2018.
|
| 176 |
+
|
| 177 |
+
Seyed Mehran Kazemi, Rishab Goel, Kshitij Jain, Ivan Kobyzev, Akshay Sethi, Peter Forsyth, and Pascal Poupart. Relational representation learning for dynamic (knowledge) graphs: A survey. arXiv preprint arXiv:1905.11485, 2019.
|
| 178 |
+
|
| 179 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 180 |
+
|
| 181 |
+
Srijan Kumar, Xikun Zhang, and Jure Leskovec. Learning dynamic embedding from temporal interaction networks. arXiv preprint arXiv:1812.02289, 2018.
|
| 182 |
+
|
| 183 |
+
Bum Chul Kwon, Min-Je Choi, Joanne Taery Kim, Edward Choi, Young Bin Kim, Soonwook Kwon, Jimeng Sun, and Jaegul Choo. Retainvis: Visual analytics with interpretable and interactive recurrent neural networks on electronic medical records. IEEE transactions on visualization and computer graphics, 25(1):299–309, 2019.
|
| 184 |
+
|
| 185 |
+
Alan Lapedes and Robert Farber. Nonlinear signal processing using neural networks: Prediction and system modelling. Technical report, 1987.
|
| 186 |
+
|
| 187 |
+
Patrick J Laub, Thomas Taimre, and Philip K Pollett. Hawkes processes. arXiv preprint arXiv:1507.02822, 2015.
|
| 188 |
+
|
| 189 |
+
R Gary Leonard and George Doddington. Tidigits. Linguistic Data Consortium, Philadelphia, 1993.
|
| 190 |
+
|
| 191 |
+
Shuang Li, Shuai Xiao, Shixiang Zhu, Nan Du, Yao Xie, and Le Song. Learning temporal point processes via reinforcement learning. In NeurIPS, pp. 10804–10814, 2018a.
|
| 192 |
+
|
| 193 |
+
Yang Li, Nan Du, and Samy Bengio. Time-dependent representation for neural event sequence prediction. arXiv preprint arXiv:1708.00065, 2017.
|
| 194 |
+
|
| 195 |
+
Yang Li, Nan Du, and Samy Bengio. Time-dependent representation for neural event sequence prediction. 2018b. URL https://openreview.net/pdf?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HyrT5Hkvf.
|
| 196 |
+
|
| 197 |
+
Zachary C Lipton, David Kale, and Randall Wetzel. Directly modeling missing data in sequences with rnns: Improved classification of clinical time series. In Machine Learning for Healthcare Conference, pp. 253–270, 2016.
|
| 198 |
+
|
| 199 |
+
Peng Liu, Zhigang Zeng, and Jun Wang. Multistability of recurrent neural networks with nonmonotonic activation functions and mixed time delays. IEEE Transactions on Systems, Man, and Cybernetics: Systems, 46(4):512–523, 2016.
|
| 200 |
+
|
| 201 |
+
Yao Ma, Ziyi Guo, Zhaochun Ren, Eric Zhao, Jiliang Tang, and Dawei Yin. Streaming graph neural networks. arXiv preprint arXiv:1810.10627, 2018.
|
| 202 |
+
|
| 203 |
+
Hongyuan Mei and Jason M Eisner. The neural hawkes process: A neurally self-modulating multivariate point process. In NeurIPS, pp. 6754–6764, 2017.
|
| 204 |
+
|
| 205 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NeurIPS, 2013.
|
| 206 |
+
|
| 207 |
+
Luis Mingo, Levon Aslanyan, Juan Castellanos, Miguel Diaz, and Vladimir Riazanov. Fourier neural networks: An approach with sinusoidal activation functions. 2004.
|
| 208 |
+
|
| 209 |
+
Kevin Patrick Murphy and Stuart Russell. Dynamic bayesian networks: representation, inference and learning. 2002.
|
| 210 |
+
|
| 211 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, pp. 807–814, 2010.
|
| 212 |
+
|
| 213 |
+
Daniel Neil, Michael Pfeiffer, and Shih-Chii Liu. Phased lstm: Accelerating recurrent network training for long or event-based sequences. In NeurIPS, pp. 3882–3890, 2016.
|
| 214 |
+
|
| 215 |
+
Behnam Neyshabur, Zhiyuan Li, Srinadh Bhojanapalli, Yann LeCun, and Nathan Srebro. The role of over-parametrization in generalization of neural networks. In ICLR, 2019.
|
| 216 |
+
|
| 217 |
+
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.
|
| 218 |
+
|
| 219 |
+
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.
|
| 220 |
+
|
| 221 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, pp. 1532–1543, 2014.
|
| 222 |
+
|
| 223 |
+
David Poole, David Buchman, Seyed Mehran Kazemi, Kristian Kersting, and Sriraam Natarajan. Population size extrapolation in relational probabilistic modelling. In SUM. Springer, 2014.
|
| 224 |
+
|
| 225 |
+
Lawrence R Rabiner and Biing-Hwang Juang. An introduction to hidden markov models. ieee assp magazine, 3(1):4–16, 1986.
|
| 226 |
+
|
| 227 |
+
Carl Edward Rasmussen. Gaussian processes in machine learning. In Advanced lectures on machine learning, pp. 63–71. Springer, 2004.
|
| 228 |
+
|
| 229 |
+
Josep M Sopena, Enrique Romero, and Rene Alquezar. Neural networks with periodic and monotonic activation functions: a comparative study in classification problems. 1999.
|
| 230 |
+
|
| 231 |
+
Charles Sutton, Andrew McCallum, and Khashayar Rohanimanesh. Dynamic conditional random fields: Factorized probabilistic models for labeling and segmenting sequence data. Journal of Machine Learning Research, 8(Mar):693–723, 2007.
|
| 232 |
+
|
| 233 |
+
Corentin Tallec and Yann Ollivier. Can recurrent neural networks warp time? In International Conference on Learning Representation (ICLR), 2018.
|
| 234 |
+
|
| 235 |
+
Rakshit Trivedi, Hanjun Dai, Yichen Wang, and Le Song. Know-evolve: Deep temporal reasoning for dynamic knowledge graphs. In ICML, pp. 3462–3471, 2017.
|
| 236 |
+
|
| 237 |
+
Utkarsh Upadhyay, Abir De, and Manuel Gomez-Rodriguez. Deep reinforcement learning of marked temporal point processes. In NeurIPS, 2018.
|
| 238 |
+
|
| 239 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 240 |
+
|
| 241 |
+
Kwok-wo Wong, Chi-sing Leung, and Sheng-jiang Chang. Handwritten digit recognition using multilayer feedforward neural networks with periodic and monotonic activation functions. In Pattern Recognition, volume 3, pp. 106–109. IEEE, 2002.
|
| 242 |
+
|
| 243 |
+
Shuai Xiao, Mehrdad Farajtabar, Xiaojing Ye, Junchi Yan, Le Song, and Hongyuan Zha. Wasserstein learning of deep generative point process models. In NeurIPS, 2017.
|
| 244 |
+
|
| 245 |
+
Shuai Xiao, Hongteng Xu, Junchi Yan, Mehrdad Farajtabar, Xiaokang Yang, Le Song, and Hongyuan Zha. Learning conditional generative models for temporal point processes. In AAAI, 2018.
|
| 246 |
+
|
| 247 |
+
Yu Zhu, Hao Li, Yikang Liao, Beidou Wang, Ziyu Guan, Haifeng Liu, and Deng Cai. What to do next: Modeling user behaviors by time-lstm. In IJCAI, pp. 3602–3608, 2017.
|
| 248 |
+
|
| 249 |
+

|
| 250 |
+
Figure 6: Comparing $\mathrm { L S T M + T }$ and LSTM $\cdot +$ Time2Vec on Event-MNIST.
|
| 251 |
+
|
| 252 |
+
# A IMPLEMENTATION DETAIL
|
| 253 |
+
|
| 254 |
+
For the experiments on Event-MNIST, N TIDIGITS18 and SOF, we implemented6 our model in PyTorch Paszke et al. (2017). We used Adam optimizer Kingma & Ba (2014) with a learning rate of 0.001. For Event-MNIST and SOF, we fixed the hidden size of the LSTM to 128. For N TIDIGITS18, due to its smaller train set, we fixed the hidden size to 64. We allowed each model 200 epochs. We used a batch size of 512 for Event-MNIST and 128 for N TIDIGITS18 and SOF. For the experiments on Last.FM and CiteULike, we used the code released by Zhu et al. $( 2 0 1 7 ) ^ { 7 }$ without any modifications, except replacing $\tau$ with $\mathbf { t } 2 \mathbf { v } ( \tau )$ . The only other thing we changed in their code was to change the SAMPLE TIME variable from 3 to 20. SAMPLE TIME controls the number of times we do sampling to compute Recall $@ 1 0$ and $\mathbf { M R R } @ 1 0$ . We experienced a high variation when sampling only 3 times so we increased the number of times we sample to 20 to make the results more robust. For both Last.FM and CiteULike, Adagrad optimizer is used with a learning rate of 0.01, vocabulary size is 5000, and the maximum length of the sequence is 200. For Last.FM, the hidden size of the LSTM is 128 and for CiteULike, it is 256. For all except the synthesized dataset, we shifted the event times such that the first event of each sequence starts at time 0.
|
| 255 |
+
|
| 256 |
+
For the fairness of the experiments, we made sure the competing models for all our experiments have an (almost) equal number of parameters. For instance, since adding Time2Vec as an input to the LSTM increases the number of model parameters compared to just adding time as a feature, we reduced the hidden size of the LSTM for this model to ensure the number of model parameters stays (almost) the same. For the experiments involving Time2Vec, unless stated otherwise, we tried vectors with 16, 32 and 64 sine functions (and one linear term). We reported the vector length offering the best performance in the main text. The results for other vector lengths can be found in Appendix B. For the synthetic dataset, we use Adam optimizer with a learning rate of 0.001 without any regularization. The length of the Time2Vec vector is 32.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 7: Comparing $\mathrm { L S T M + T }$ and LSTM $+$ Time2Vec on Event-MNIST and raw N TIDIGITS18.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 8: Comparing LSTM+T and LSTM+Time2Vec on SOF.
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
Figure 9: Comparing LSTM $+ \mathrm { T }$ and LSTM $^ +$ Time2Vec on Last.FM.
|
| 266 |
+
|
| 267 |
+
# B MORE RESULTS
|
| 268 |
+
|
| 269 |
+
We ran experiments on other versions of the N TIDIGITS18 dataset as well. Following Anumula et al. (2018), we converted the raw event data to event-binned features by virtue of aggregating active channels through a period of time in which a pre-defined number of events occur. The outcome of binning is thus consecutive frames each with multiple but a fixed number of active channels. In our experiments, we used event-binning with 100 events per frame. For this variant of the dataset, we compared $\mathrm { L S T M + T }$ and LSTM+Time2Vec similar to the experiments in Section 5.1. The obtained results were on-par. Then, similar to Event-MNIST, we only fed as input the times at which events occurred (i.e. we removed the channels from the input). We allowed the models 1000 epochs to make sure they converge. The obtained results are presented in Fig. 6. It can be viewed that Time2Vec provides an effective representation for time and LSTM $+$ Time2Vec outperforms LSTM $+ \mathrm { T }$ on this dataset.
|
| 270 |
+
|
| 271 |
+
In the main text, for the experiments involving Time2Vec, we tested Time2Vec vectors with 16, 32 and 64 sinusoids and reported the best one for the clarity of the diagrams. Here, we show the results for all frequencies. Figures 7, 8, 9, and 10 compare LSTM $+ \mathrm { T }$ and LSTM $^ +$ Time2Vec for our datasets. Figures 11, and 12 compare TLSTM1 with TLSTM1 $^ +$ Time2Vec on Last.FM and CiteULike. Figures 13, and 14 compare TLSTM3 with TLSTM1 $^ +$ Time2Vec on Last.FM and CiteULike. In most cases, Time2Vec with 64 sinusoids outperforms (or gives on-par results with) the cases with 32 or 16 sinusoids. An exception is TLSTM3 where 16 sinusoids works best. We believe that is because TLSTM3 has two time gates and adding, e.g., 64 temporal components (corresponding to the sinusoids) to each gate makes it overfit to the temporal signals.
|
| 272 |
+
|
| 273 |
+
# C LSTM ARCHITECTURES
|
| 274 |
+
|
| 275 |
+
The original LSTM model can be neatly defined with the following equations:
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
\begin{array} { r l } & { { i _ { j } } = \sigma \left( W _ { i } { { \bf { x } } _ { j } } + U _ { i } { { h _ { j - 1 } } } + { { \bf { b } } _ { i } } \right) } \\ & { { f _ { j } } = \sigma \left( { W _ { f } { { \bf { x } } _ { j } } + U _ { f } { { h _ { j - 1 } } } + { { b _ { f } } } } \right) } \\ & { { { { \overline { { c } } } _ { j } } } = T a n h \left( { W _ { c } { { \bf { x } } _ { j } } + U _ { c } { { h _ { j - 1 } } } + { { b _ { c } } } } \right) } \\ & { { { { \overline { { c _ { j } } } } } } = { f _ { t } } \odot { { \bf { c } } _ { j - 1 } } + { i _ { j } } \odot { { { \overline { { { c _ { j } } } } } } } } \\ & { { { \sigma _ { j } } } = \sigma \left( { W _ { o } { { \bf { x } } _ { j } } + U _ { o } { { h _ { j - 1 } } } + { { b _ { o } } } } \right) } \\ & { { { { h _ { j } } } = { { o _ { j } } } \odot T a n h \left( { { c _ { j } } } \right) } } \end{array}
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 10: Comparing LSTM+T and LSTM $^ +$ Time2Vec on CiteULike.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 11: TLSTM1’s performance on Last.FM with and without Time2Vec.
|
| 286 |
+
|
| 287 |
+
Here $\mathbf { \delta } _ { i , \mathrm { ~ \tiny ~ \left. ~ \right. ~ } }$ , $\pmb { f } _ { t }$ , and $\mathbf { \sigma } _ { \pmb { o } _ { t } }$ represent the input, forget and output gates respectively, while $\mathbf { c } _ { t }$ is the memory cell and $\pmb { h } _ { t }$ is the hidden state. $\sigma$ and T anh represent the Sigmoid and hyperbolic tangent activation functions respectively. We refer to $\pmb { x } _ { j }$ as the $j ^ { \bar { t } h }$ event.
|
| 288 |
+
|
| 289 |
+
Peepholes: Gers & Schmidhuber (2000) introduced a variant of the LSTM architecture where the input, forget, and output gates peek into the memory cell. In this variant, ${ \pmb w } _ { p i } \odot { \pmb c } _ { j - 1 } , { \pmb w } _ { p f } \odot { \pmb c } _ { j - 1 }$ and ${ \pmb w } _ { p o } \odot { \pmb c } _ { j }$ are added to the linear parts of Eq. (2), (3), and (6) respectively, where ${ \pmb w } _ { p i } , { \pmb w } _ { p f }$ , and ${ \pmb w } _ { p o }$ are learnable parameters.
|
| 290 |
+
|
| 291 |
+
$\mathbf { L S T M + T } \mathbf { : }$ Let $\tau _ { j }$ represent the time features for the $j ^ { t h }$ event in the input and let $\pmb { x } _ { j } ^ { \prime } = [ \pmb { x } _ { j } ; \pmb { \tau } _ { j } ]$ Then $\mathrm { L S T M + T }$ uses the exact same equations as the standard LSTM (denoted above) except that $\pmb { x } _ { j }$ is replaced with $\pmb { x } _ { j } ^ { \prime }$ .
|
| 292 |
+
|
| 293 |
+
TimeLSTM: We explain TLSTM1 and TLSTM3 which have been used in our experiments. For clarity of writing, we do not include the peephole terms in the equations but they are used in the experiments. In TLSTM1, a new time gate is introduced as in Eq. equation 8 and Eq. equation 5 and equation 6 are updated to Eq. equation 9 and equation 10 respectively:
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\begin{array} { r l } & { \pmb { t } _ { j } = \sigma \left( \pmb { W } _ { t } \pmb { x } _ { j } + \sigma \left( \pmb { u } _ { t } \tau _ { j } \right) + \pmb { b } _ { t } \right) } \\ & { \pmb { c } _ { j } = \pmb { f } _ { j } \odot \pmb { c } _ { j - 1 } + \pmb { i } _ { j } \odot \pmb { t } _ { j } \odot \overline { { \pmb { c } _ { j } } } } \\ & { \pmb { o } _ { j } = \sigma \left( \pmb { W } _ { o } \pmb { x } _ { j } + \pmb { v } _ { t } \tau _ { j } + \pmb { U } _ { o } \pmb { h } _ { j - 1 } + \pmb { b } _ { o } \right) } \end{array}
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
$t _ { j }$ controls the influence of the current input on the prediction and makes the required information from timing history get stored on the cell state. TLSTM3 uses two time gates:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\begin{array} { r } { \pmb { t 1 } _ { j } = \sigma \left( \pmb { W } _ { t 1 } \pmb { x } _ { j } + \sigma \left( \pmb { u } _ { t 1 } \tau _ { j } \right) + \pmb { b } _ { t 1 } \right) } \\ { \pmb { t 2 } _ { j } = \sigma \left( \pmb { W } _ { t 2 } \pmb { x } _ { j } + \sigma \left( \pmb { u } _ { t 2 } \tau _ { j } \right) + \pmb { b } _ { t 2 } \right) } \end{array}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
where the elements of $W _ { t 1 }$ are constrained to be non-positive. $\pmb { t 1 }$ is used for controlling the influence of the last consumed item and $\pmb { t 2 }$ stores the $\tau \mathbf { S }$ thus enabling modeling long range dependencies. TLSTM3 couples the input and forget gates following Greff et al. (2017) along with the $\pmb { t 1 }$ and $\pmb { t 2 }$ gates and replaces Eq. (5) to (7) with the following:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { r l } & { \tilde { \mathbf { c } } _ { j } = \left( 1 - i _ { j } \odot t { \bf 1 } _ { j } \right) \odot \mathbf { c } _ { j - 1 } + i _ { j } \odot t { \bf 1 } _ { j } \odot \bar { \mathbf { c } } _ { j } } \\ & { \mathbf { c } _ { j } = \left( 1 - i _ { j } \right) \odot \mathbf { c } _ { j - 1 } + i _ { j } \odot t { \bf 2 } _ { j } \odot \bar { \mathbf { c } } _ { j } } \\ & { \mathbf { o } _ { j } = \sigma \left( W _ { o } \mathbf { x } _ { j } + \mathbf { v } _ { t } \tau _ { j } + U _ { o } \mathbf { h } _ { j - 1 } + \mathbf { b } _ { o } \right) } \\ & { \mathbf { h } _ { j } = o _ { j } \odot T a n h \left( \tilde { \mathbf { c } } _ { j } \right) } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 12: TLSTM1’s performance on CiteULike with and without Time2Vec.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 13: TLSTM3’s performance on Last.FM with and without Time2Vec.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 14: TLSTM3’s performance on CiteULike with and without Time2Vec.
|
| 319 |
+
|
| 320 |
+
Zhu et al. (2017) use $\tau _ { j } = \Delta t _ { j }$ in their experiments, where $\Delta t _ { j }$ is the duration between the current and the last event.
|
| 321 |
+
|
| 322 |
+
TimeLSTM $^ +$ Time2Vec: To replace time in TLSTM1 with Time2Vec, we modify Eq. (8) and (10) as follows:
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r l } & { \pmb { t _ { j } } = \sigma \left( \pmb { W _ { t } } \pmb { x _ { j } } + \sigma \left( \pmb { U _ { t } } \pmb { \mathrm { t } } 2 \mathbf { v } ( \tau ) \right) + \pmb { b _ { t } } \right) } \\ & { \pmb { o _ { j } } = \sigma ( \pmb { W _ { o } } \pmb { x _ { j } } + \pmb { V _ { t } } \pmb { \mathrm { t } } 2 \mathbf { v } ( \tau ) + \pmb { U _ { o } } \pmb { h _ { j - 1 } } + \pmb { b _ { o } } ) } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
i.e., $\tau$ is replaced with $\mathbf { t } 2 \mathbf { v } ( \tau )$ , $\mathbf { \pmb { u } } _ { t }$ is replaced with $\boldsymbol { U } _ { t }$ , and ${ \pmb v } _ { t }$ is replaced with $V _ { t }$ . Similarly, for TLSTM3 we modify Eq. (11), (12) and (15) as follows:
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { r } { t \pmb { 1 } _ { j } = \sigma \left( \pmb { W } _ { t 1 } \pmb { x } _ { j } + \sigma \left( \pmb { U } _ { t 1 } \pmb { \mathrm { t } } 2 \pmb { \mathrm { v } } ( \tau ) \right) + \pmb { b } _ { t 1 } \right) } \\ { t \pmb { 2 } _ { j } = \sigma \left( \pmb { W } _ { t 2 } \pmb { x } _ { j } + \sigma \left( \pmb { U } _ { t 2 } \pmb { \mathrm { t } } 2 \pmb { \mathrm { v } } ( \tau ) \right) + \pmb { b } _ { t 2 } \right) } \\ { \pmb { o } _ { j } = \sigma ( \pmb { W } _ { o } \pmb { x } _ { j } + \pmb { V } _ { t } \pmb { \mathrm { t } } 2 \pmb { \mathrm { v } } ( \tau ) + \pmb { U } _ { o } \pmb { h } _ { j - 1 } + \pmb { b } _ { o } ) } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
# D PROOFS
|
| 335 |
+
|
| 336 |
+
Proposition 1. Time2Vec is invariant to time rescaling.
|
| 337 |
+
|
| 338 |
+
Proof. Consider the following Time2Vec representation $\mathcal { M } _ { 1 }$ :
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\mathbf t 2 \mathbf v ( \tau ) [ i ] = { \left\{ \begin{array} { l l } { \omega _ { i } \tau + \varphi _ { i } , } & { { \mathrm { i f } } i = 0 . } \\ { \sin { ( \omega _ { i } \tau + \varphi _ { i } ) } , } & { { \mathrm { i f } } 1 \leq i \leq k . } \end{array} \right. }
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Replacing $\tau$ with $\alpha \cdot \tau$ (for $\alpha > 0$ ), the Time2Vec representation updates as follows:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\mathbf { t } 2 \mathbf { v } ( \alpha \cdot \tau ) [ i ] = { \left\{ \begin{array} { l l } { \omega _ { i } ( \alpha \cdot \tau ) + \varphi _ { i } , } & { { \mathrm { i f } } i = 0 . } \\ { \sin { ( \omega _ { i } ( \alpha \cdot \tau ) + \varphi _ { i } ) } , } & { { \mathrm { i f } } 1 \leq i \leq k . } \end{array} \right. }
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Consider anosame way as Time2Vec representation . This proves that Time2 $\mathcal { M } _ { 2 }$ with frequencies s invariant to time $\begin{array} { r } { \omega _ { i } ^ { \prime } = \frac { \omega _ { i } } { \alpha } } \end{array}$ . Then g. $\mathcal { M } _ { 2 }$ behaves in the $\mathcal { M } _ { 1 }$
|
md/train/rkxoNnC5FQ/rkxoNnC5FQ.md
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPIGAN: PRIVILEGED ADVERSARIAL LEARNINGFROM SIMULATION
|
| 2 |
+
|
| 3 |
+
Kuan-Hui Lee, Jie Li, Adrien Gaidon Toyota Research Institute {kuan.lee,jie.li,adrien.gaidon}@tri.global
|
| 4 |
+
|
| 5 |
+
& German Ros
|
| 6 |
+
Intel Labs
|
| 7 |
+
german.ros@intel.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Deep Learning for Computer Vision depends mainly on the source of supervision. Photo-realistic simulators can generate large-scale automatically labeled synthetic data, but introduce a domain gap negatively impacting performance. We propose a new unsupervised domain adaptation algorithm, called SPIGAN, relying on Simulator Privileged Information (PI) and Generative Adversarial Networks (GAN). We use internal data from the simulator as PI during the training of a target task network. We experimentally evaluate our approach on semantic segmentation. We train the networks on real-world Cityscapes and Vistas datasets, using only unlabeled real-world images and synthetic labeled data with $\mathbf { Z }$ -buffer (depth) PI from the SYNTHIA dataset. Our method improves over no adaptation and state-of-theart unsupervised domain adaptation techniques.
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: SPIGAN example inputs and outputs. From left to right: input images from a simulator; adapted images from SPIGAN’s generator network; predictions from SPIGAN’s privileged network (depth layers); semantic segmentation predictions from the target task network.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Learning from as little human supervision as possible is a major challenge in Machine Learning. In Computer Vision, labeling images and videos is the main bottleneck towards achieving large scale learning and generalization. Recently, training in simulation has shown continuous improvements in several tasks, such as optical flow (Mayer et al., 2016), object detection (Mar´ın et al., 2010; Vazquez et al., 2014; Xu et al., 2014; Sun & Saenko, 2014; Peng et al., 2015), tracking (Gaidon et al., 2016), pose and viewpoint estimation (Shotton et al., 2011; Papon & Schoeler, 2015; Su et al., 2015), action recognition (de Souza et al., 2017), and semantic segmentation (Handa et al., 2016; Ros et al., 2016; Richter et al., 2016). However, large domain gaps between synthetic and real domains remain as the main handicap of this type of strategies. This is often addressed by manually labeling some amount of real-world target data to train the model on mixed synthetic and real-world labeled data (supervised domain adaptation). In contrast, several recent unsupervised domain adaptation algorithms have leveraged the potential of Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) for pixel-level adaptation in this context (Bousmalis et al., 2017; Shrivastava et al., 2016). These methods often use simulators as black-box generators of $( x , y )$ input / output training samples for the desired task.
|
| 19 |
+
|
| 20 |
+
Our main observation is that simulators internally know a lot more about the world and how the scene is formed, which we call Privileged Information (PI). This Privileged Information includes physical properties that might be useful for learning. This additional information $z$ is not available in the real-world and is, therefore, generally ignored during learning. In this paper, we propose a novel adversarial learning algorithm, called SPIGAN, to leverage Simulator $P I$ for GAN-based unsupervised learning of a target task network from unpaired unlabeled real-world data.
|
| 21 |
+
|
| 22 |
+
We jointly learn four different networks: (i) a generator $G$ (to adapt the pixel-level distribution of synthetic images to be more like real ones), (ii) a discriminator $D$ (to distinguish adapted and real images), (iii) a task network $T$ (to predict the desired label $y$ from image $x$ ), and (iv) a privileged network $P$ trained on both synthetic images $x$ and adapted ones $G ( x )$ to predict their associated privileged information $z$ . Our main contribution is a new method to leverage $P I$ from a simulator via the privileged network $P$ , which acts as an auxiliary task and regularizer to the task network $T$ , the main output of our SPIGAN learning algorithm.
|
| 23 |
+
|
| 24 |
+
We evaluate our approach on semantic segmentation in urban scenes, a challenging real-world task. We use the standard Cityscapes (Cordts et al., 2016) and Vistas (Neuhold et al., 2017) datasets as target real-world data (without using any of the training labels) and SYNTHIA (Ros et al., 2016) as simulator output. Although our method applies to any kind of PI that can be predicted via a deep network (optical flow, instance segmentation, object detection, material properties, forces, ...), we consider one of the most common and simple forms of PI available in any simulator: depth from its z-buffer. We show that SPIGAN can successfully learn a semantic segmentation network $T$ using no real-world labels, partially bridging the sim-to-real gap (see Figure 1). SPIGAN also outperforms related state-of-the-art unsupervised domain adaptation methods.
|
| 25 |
+
|
| 26 |
+
The rest of the paper is organized as follows. Section 2 presents a brief review of related works. Section 3 presents our SPIGAN unsupervised domain adaptation algorithm using simulator privileged information. We report our quantitative experiments on semantic segmentation in Section 4, and conclude in Section 5.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Domain adaptation (cf. Csurka (2017) for a recent review) is generally approached either as domaininvariant learning (Hoffman et al., 2013; Herath et al., 2017; Yan et al., 2017; Ganin & Lempitsky, 2015) or as a statistical alignment problem (Tzeng et al., 2014; Long et al., 2015). Our work focuses on unsupervised adaptation methods in the context of deep learning. This problem consists in learning a model for a task in a target domain (e.g., semantic segmentation of real-world urban scenes) by combining unlabeled data from this domain with labeled data from a related but different source domain (e.g., synthetic data from simulation). The main challenge is overcoming the domain gap, i.e. the differences between the source and target distributions, without any supervision from the target domain. The Domain Adversarial Neural Network (DANN) (Tzeng et al., 2014; Ganin & Lempitsky, 2015; Ganin et al., 2016) is a popular approach that learns domain invariant features by maximizing domain confusion. This approach has been successfully adopted and extended by many other researchers, e.g., Purushotham et al. (2017); Chen et al. (2017); Zhang et al. (2017). Curriculum Domain Adaptation (Zhang et al., 2017) is a recent evolution for semantic segmentation that reduces the domain gap via a curriculum learning approach (solving simple tasks first, such as global label distribution in the target domain).
|
| 31 |
+
|
| 32 |
+
Recently, adversarial domain adaptation based on GANs (Goodfellow et al., 2014) have shown encouraging results for unsupervised domain adaptation directly at the pixel level. These techniques learn a generative model for source-to-target image translation, including from and to multiple domains (Taigman et al., 2016; Shrivastava et al., 2016; Zhu et al., 2017; Isola et al., 2017; Kim et al., 2017). In particular, CycleGAN (Zhu et al., 2017) leverages cycle consistency using a forward GAN and a backward GAN to improve the training stability and performance of image-to-image translation. An alternative to GAN is Variational Auto-Encoders (VAEs), which have also been used for image translation (Liu et al., 2017).
|
| 33 |
+
|
| 34 |
+
Several related works propose GAN-based unsupervised domain adaptation methods to address the specific domain gap between synthetic and real-world images. SimGAN (Shrivastava et al., 2016) leverages simulation for the automatic generation of large annotated datasets with the goal of refining synthetic images to make them look more realistic. Sadat Saleh et al. (2018) effectively leverages synthetic data by treating foreground and background in different manners. Similar to our approach, recent methods consider the final recognition task during the image translation process. Closely related to our work, PixelDA (Bousmalis et al., 2017) is a pixel-level domain adaptation method that jointly trains a task classifier along with a GAN using simulation as its source domain but no privileged information. These approaches focus on simple tasks and visual conditions that are easy to simulate, hence having a low domain gap to begin with.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: SPIGAN learning algorithm from unlabeled real-world images $x _ { r }$ and the unpaired output of a simulator (synthetic images $x _ { s }$ , their labels $y _ { s }$ , e.g. semantic segmentation ground truth, and Privileged Information PI $z _ { s }$ , e.g., depth from the $\mathbf { Z }$ -buffer) modeled as random variables. Four networks are learned jointly: (i) a generator $G ( x _ { s } ) \sim x _ { r }$ , (ii) a discriminator $D$ between $G ( x _ { s } ) =$ $x _ { f }$ and $x _ { r }$ , (iii) a perception task network $T ( x _ { r } ) \sim y _ { r }$ , which is the main target output of SPIGAN (e.g., a semantic segmentation deep net), and (iv) a privileged network $P$ to support the learning of $T$ by predicting the simulator’s $\mathrm { P I } \ z _ { s }$ .
|
| 38 |
+
|
| 39 |
+
On the other hand, Hoffman et al. (2016b) are the first to study semantic segmentation as the task network in adversarial training. Zhang et al. (2017) uses a curriculum learning style approach to reduce domain gap. Saito et al. (2017) conducts domain adaptation by utilizing the task-specific decision boundaries with classifiers. Sankaranarayanan et al. (2018) leverage the GAN framework by learning general representation shared between the generator and segmentation networks. Chen et al. (2018) use a target guided distillation to encourage the task network to imitate a pretrained model. Zhang et al. (2018) propose to combine appearance and representation adaptation. Tsai et al. (2018) propose an adversarial learning method to adapt in the output (segmentation) space. Zou et al. (2018) generates pseudo-labels based on confidence scores with balanced class distribution and propose an iterative self-training framework.
|
| 40 |
+
|
| 41 |
+
Our main novelty is the use of Privileged Information from a simulator in a generic way by considering a privileged network in our architecture (see Figure 2). We show that for the challenging task of semantic segmentation of urban scenes, our approach significantly improves by augmenting the learning objective with our auxiliary privileged task, especially in the presence of a large sim-to-real domain gap, the main problem in challenging real-world conditions.
|
| 42 |
+
|
| 43 |
+
Our work is inspired by Learning Using Privileged Information (LUPI) (Vapnik & Vashist, 2009), which is linked to distillation (Hinton et al., 2015) as shown by Lopez-Paz et al. (2015). LUPI’s goal is to leverage additional data only available at training time. For unsupervised domain adaptation from a simulator, there is a lot of potentially useful information about the generation process that could inform the adaptation. However, that information is only available at training time, as we do not have access to the internals of the real-world data generator. Several works have used privileged information at training time for domain adaptation (Chen et al., 2014; Hoffman et al., 2016a; Li et al., 2014; Sarafianos et al., 2017; Garcia et al., 2018). Hoffman et al. (2016a) leverage RGBD information to help adapt an object detector at the feature level, while Garcia et al. (2018) propose a similar concept of modality distillation for action recognition. Inspired by this line of work, we exploit the privileged information from simulators for sim-to-real unsupervised domain adaptation.
|
| 44 |
+
|
| 45 |
+
# 3 SIMULATOR PRIVILEGED INFORMATION GAN
|
| 46 |
+
|
| 47 |
+
# 3.1 UNSUPERVISED LEARNING WITH A SIMULATOR
|
| 48 |
+
|
| 49 |
+
Our goal is to design a procedure to learn a model (neural network) that solves a perception task (e.g., semantic segmentation) using raw sensory data coming from a target domain (e.g., videos of a car driving in urban environments) without using any ground truth data from the target domain. We formalize this problem as unsupervised domain adaptation from a synthetic domain (source domain) to a real domain (target domain). The source domain consists of labeled synthetic images together with Privileged Information (PI), obtained from the internal data structures of a simulator. The target domain consists of unlabeled images.
|
| 50 |
+
|
| 51 |
+
The simulated source domain serves as an idealized representation of the world, offering full control of the environment (weather conditions, types of scene, sensor configurations, etc.) with automatic generation of raw sensory data and labels for the task of interest. The main challenge we address in this work is how to overcome the gap between this synthetic source domain and the target domain to ensure generalization of the task network in the real-world without target supervision.
|
| 52 |
+
|
| 53 |
+
Our main hypothesis is that the PI provided by the simulator is a rich source of information to guide and constrain the training of the target task network. The PI can be defined as any information internal to the simulator, such as depth, optical flow, or physical properties about scene components used during simulation (e.g., materials, forces, etc.). We leverage the simulator’s PI within a GAN framework, called SPIGAN. Our approach is described in the next section.
|
| 54 |
+
|
| 55 |
+
# 3.2 SPIGAN
|
| 56 |
+
|
| 57 |
+
Let $X _ { r } ~ = ~ \{ x _ { r } ^ { ( j ) }$ , $j ~ = ~ 1 \ldots N ^ { r } \}$ be a set of $N ^ { r }$ unlabeled real-world images . Let $X _ { s } \ =$ i), y(i)s , z(i)s ), i = 1 . . . N s} be a set of N s simulated images xs with their labels ys and PI
|
| 58 |
+
$z _ { s }$
|
| 59 |
+
tends to multiple separate types of $\mathrm { P I }$ .
|
| 60 |
+
|
| 61 |
+
SPIGAN (cf. Fig. 2) jointly learns a model $( \theta _ { G } , \theta _ { D } , \theta _ { T } , \theta _ { P } )$ , consisting of: (i) a generator $G ( x ; \theta _ { G } )$ , (ii) a discriminator $D ( x ; \theta _ { D } )$ , (iii) a task predictor $T ( x ; \theta _ { T } )$ , and (iv) a privileged network $P ( x ; \theta _ { P } )$ . The generator $G$ is a mapping function, transforming an image $x _ { s }$ in $X _ { s }$ (source domain) to $x _ { f }$ in $X _ { f }$ (adapted or fake domain). SPIGAN aims to make the adapted domain statistically close to the target domain to maximize the accuracy of the task predictor $T ( x ; \theta _ { T } )$ during testing. The discriminator $D$ is expected to tell the difference between $x _ { f }$ and $x _ { r }$ , playing an adversarial game with the generator until a termination criteria is met (refer to section 4.1) . The target task network $T$ is learned on the synthetic $x _ { s }$ and adapted $G ( x _ { s } ; \theta _ { G } )$ images to predict the synthetic label $y _ { s }$ , assuming the generator presents a reasonable degree of label (content) preservation. This assumption is met for the regime of our experiments. Similarly, the privileged network $P$ is trained on the same input but to predict the $\mathrm { P I } ~ z$ , which in turn assumes the generator $G$ is also PI-preserving. During testing only $T ( x ; \theta _ { T } )$ is needed to do inference for the selected perception task.
|
| 62 |
+
|
| 63 |
+
The main learning goal is to train a model $\theta _ { T }$ that can correctly perform a perception task $T$ in the target real-world domain. All models are trained jointly in order to exploit all available information to constrain the solution space. In this way, the $\mathrm { P I }$ provided by the privileged network $P$ is used to constrain the learning of $T$ and to encourage the generator to model the target domain while being label- and PI-preserving. Our joint learning objective is described in the following section.
|
| 64 |
+
|
| 65 |
+
# 3.3 LEARNING OBJECTIVE
|
| 66 |
+
|
| 67 |
+
We design a consistent set of loss functions and domain-specific constraints related to the main prediction task $T$ . We optimize the following minimax objective:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\operatorname* { m i n } _ { \theta _ { G } , \theta _ { T } , \theta _ { P } } \operatorname* { m a x } _ { \theta _ { D } } \alpha \mathcal { L } _ { \mathrm { G A N } } + \beta \mathcal { L } _ { T } + \gamma \mathcal { L } _ { P } + \delta \mathcal { L } _ { \mathrm { p e r c } }
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\alpha , \beta , \gamma , \delta$ are the weights for adversarial loss, task prediction loss, PI regularization, and perceptual regularization respectively, further described below.
|
| 74 |
+
|
| 75 |
+
Adversarial loss $\mathcal { L } _ { \mathbf { G A N } }$ . Instead of using a standard adversarial loss, we use a least-squares based adversarial loss Mao et al. (2016); Zhu et al. (2017), which stabilizes the training process and generates better image results in our experiments:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { G A N } } ( D , G ) = \mathbb { E } _ { x _ { r } \sim \mathcal { P } _ { r } } [ ( D ( x _ { r } ; \theta _ { D } ) - 1 ) ^ { 2 } ] } \\ & { \quad \quad \quad \quad + \mathbb { E } _ { x _ { s } \sim \mathcal { P } _ { s } } [ D ( G ( x _ { s } ; \theta _ { G } ) ; \theta _ { D } ) ^ { 2 } ] } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { P } _ { r }$ (resp. $\mathcal { P } _ { s }$ ) denotes the real-world (resp. synthetic) data distribution.
|
| 82 |
+
|
| 83 |
+
Task prediction loss $\mathcal { L } _ { T }$ . We learn the task network by optimizing its loss over both synthetic images $x _ { s }$ and their adapted version $G ( x _ { s } , \theta _ { G } )$ . This assumes the generator is label-preserving, i.e., that $y _ { s }$ can be used as a label for both images. Thanks to our joint objective, this assumption is directly encouraged during the learning of the generator through the joint estimation of $\theta _ { P }$ , which relates to scene properties captured by the PI. Naturally, different tasks require different loss functions. In our experiments, we consider the task of semantic segmentation and use the standard cross-entropy loss (Eq. 4) over images of size $W \times H$ and a probability distribution over $C$ semantic categories. The total combined loss in the special case of semantic segmentation is therefore:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { l } { \displaystyle \mathcal { L } _ { T } ( T , G ) = \mathcal { L } _ { \mathrm { C E } } ( x _ { s } , y _ { s } ) + \mathcal { L } _ { \mathrm { C E } } ( G ( x _ { s } ; \theta _ { G } ) , y _ { s } ) } \\ { \displaystyle \mathcal { L } _ { \mathrm { C E } } ( x , y ) = \frac { - 1 } { W H } \sum _ { u , v } ^ { W , H } \sum _ { c = 1 } ^ { C } \mathbb { 1 } _ { [ c = y _ { u , v } ] } \log ( T ( x ; \theta _ { T } ) _ { u , v } ) } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\mathbb { 1 } _ { [ a = b ] }$ is the indicator function.
|
| 90 |
+
|
| 91 |
+
PI regularization $\mathcal { L } _ { P }$ . Similarly, the auxiliary task of predicting PI also requires different losses depending on the type of PI. In our experiments, we use depth from the $\mathbf { Z }$ -buffer and an $\ell _ { 1 }$ -norm:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l } & { \mathcal { L } _ { P } ( P , G ) = \rvert | P ( x _ { s } ; \theta _ { P } ) - z _ { s } | | _ { 1 } } \\ & { \qquad + | | P ( G ( x _ { s } ; \theta _ { G } ) ; \theta _ { P } ) - z _ { s } | | _ { 1 } } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Perceptual regularization $\mathcal { L } _ { \mathrm { p e r c } }$ . To maintain the semantics of the source images in the generated images, we additionally use the perceptual loss Johnson et al. (2016); Chen & Koltun (2017):
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { \mathrm { p e r c } } ( G ) = | | \phi ( x _ { s } ) - \phi ( G ( x _ { s } ; \theta _ { G } ) ) | | _ { 1 }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\phi$ is a mapping from image space to a pre-determined feature space Chen & Koltun (2017) (see 4.1 for more details).
|
| 104 |
+
|
| 105 |
+
Optimization. In practice, we follow the standard adversarial training strategy to optimize our joint learning objective (Eq. 1). We alternate between updates to the parameters of the discriminator $\theta _ { D }$ , keeping all other parameters fixed, then fix $\theta _ { D }$ and optimize the parameters of the generator $\theta _ { G }$ , the privileged network $\theta _ { P }$ , and most importantly the task network $\theta _ { T }$ . We discuss the details of our implementation, including hyper-parameters, in section 4.1.
|
| 106 |
+
|
| 107 |
+
# 4 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
We evaluate our unsupervised domain adaptation method on the task of semantic segmentation in a challenging real-world domain for which training labels are not available.
|
| 110 |
+
|
| 111 |
+
As our source synthetic domain, we select the public SYNTHIA dataset (Ros et al., 2016) as synthetic source domain given the availability of automatic annotations and PI. SYNTHIA is a dataset generated from an autonomous driving simulator of urban scenes. These images were generated under different weathers and illumination conditions to maximize visual variability. Pixel-wise segmentation and depth labels are provided for each image. In our experiment, we use the sequence of SYNTHIA-RAND-CITYSCAPES, which contains semantic segmentation labels that are more compatible with Cityscapes.
|
| 112 |
+
|
| 113 |
+
For target real-world domains, we use the Cityscapes (Cordts et al., 2016) and Mapillary Vistas (Neuhold et al., 2017) datasets. Cityscapes is one of most widely used real-world urban scene image segmentation datasets with images collected around urban streets in Europe. For this dataset, We use the standard split for training and validation with 2, 975 and 500 images respectively. Mapillary Vistas is a larger dataset with a wider variety of scenes, cameras, locations, weathers, and illumination conditions. We use 16, 000 images for training and 2, 000 images for evaluation. During training, none of the labels from the real-world domains are used.
|
| 114 |
+
|
| 115 |
+
In our experiment, we first evaluate adaptation from SYNTHIA to Cityscapes on 16 classes, following the standard evaluation protocol used in Hoffman et al. (2016b); Zhang et al. (2017); Saito et al. (2017); Sankaranarayanan et al. (2018); Zou et al. (2018). Then we show the positive impact of using PI by conducting ablation study with and without PI (depth) during adaptation from SYNTHIA to both Cityscapes and Vistas, on a common 7 categories ontology. To be consistent with the semantic segmentation best practices, we use standard intersection-over-union (IoU) per category and mean intersection-over-union (mIoU) as our main validation metric.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Loss curves for the task, perceptual, and privileged parts of the learning objective during the training of SYNTHIA-to-Cityscapes.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Early stopping at the iteration when the discriminator loss is significantly and consistently better than the generator loss (90 here).
|
| 122 |
+
|
| 123 |
+
# 4.1 IMPLEMENTATION DETAILS
|
| 124 |
+
|
| 125 |
+
We adapt the generator and discriminator model architectures from CycleGAN (Zhu et al., 2017) and (Johnson et al., 2016). For simplicity, we use a single sim-to-real generator (no cycle consistency) consisting of two down-sampling convolution layers, nine ResNet blocks (He et al., 2016) and two fractionally-strided convolution layers. Our discriminator is a PatchGAN (Isola et al., 2017) network with 3 layers. We use the standard FCN8s architecture Long et al. (2015) for both the task predictor $T$ and the privileged network $P$ , given its ease of training and its acceptance in domain adaptation works Hoffman et al. (2016b). For the perceptual loss $\mathcal { L } _ { \mathrm { p e r c } }$ , we follow the implementation in Chen & Koltun (2017). The feature is constructed by the concatenation of the activations of a pre-trained VGG19 network Witten et al. (2016) of layers ”conv1 $\lrcorner 2 ^ { \ast }$ , ”conv2 $_ { - 2 } \mathbf { \mathit { ^ { , } } }$ , ”conv3 2”, ”conv4 2”, ”conv5 2”.
|
| 126 |
+
|
| 127 |
+
Following the common protocol in unsupervised domain adaptation Shrivastava et al. (2016); Zhu et al. (2017); Bousmalis et al. (2016); Sankaranarayanan et al. (2018), we set hyper-parameters using a coarse grid search on a small validation set different than the target set. For Cityscapes, we use a subset of the validation set of Vistas, and vice-versa. We found a set of values that are effective across datasets and experiments, which show they have a certain degree of robustness and generalization. The weights in our joint adversarial loss (Eq. 1) are set to $\alpha = 1$ , $\beta = 0 . 5$ , $\gamma = 0 . 1$ , $\delta = 0 . 3 3$ , for the GAN, task, privileged, and perceptual objectives respectively. This confirms that the two most important factors in the objective are the GAN and task losses $\langle \alpha = 1$ , $\beta = 0 . 5$ ). This is intuitive, as the goal is to improve the generalization performance of the task network (the task loss being an empirical proxy) across a potentially large domain gap (addressed first and foremost by the GAN loss). The regularization terms are secondary in the objective, stabilizing the training (perceptual loss) and constraining the adaptation process (privileged loss). Figures 3 and 4 show an example of our loss curves and the stability of our training.
|
| 128 |
+
|
| 129 |
+
Another critical hyper-parameter for unsupervised learning is the stopping criterion. We observed that the stabilizing effects of the task and privileged losses (Eqs. 3,5) on the GAN objective (Eq. 2) made a simple rule effective for early stopping. We stop training at the iteration when the discriminator loss is significantly and consistently better than the generator loss (iteration 90 in Figure 4). This is inspired by the semi-supervised results of Dai et al. (2017), where effective discriminative adaptation of the task network might not always be linked to the best image generator. We evaluate the methods with two resolutions: $3 2 0 \times 6 4 0$ and $5 1 2 \times 1 0 2 4$ , respectively. Images are resized to the evaluated size during training and evaluation. During training, we sample crops of size $3 2 0 \times 3 2 0$ (resp. $4 0 0 \times 4 0 0 )$ for lower (resp. higher) resolution experiments. In all adversarial learning cases, we do five steps of the generator for every step of the other networks. The Adam optimizer (Kingma & Ba, 2014) is used to adjust all parameters with initial learning rate 0.0002 in our PyTorch implementation (Paszke et al., 2017).
|
| 130 |
+
|
| 131 |
+
Table 1: Semantic segmentation unsupervised domain adaptation from SYNTHIA to Cityscapes. We present semantic segmentation results with per-class IoU and mean IoU. The highest IoU (at the same resolution) for each class within the compared algorithms is highlighted with bold font.
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan="3">rrnnrign</td><td rowspan="3">Method</td><td rowspan="3"></td><td rowspan="3">srraar</td><td rowspan="3">Buipling</td><td rowspan="3">1</td><td rowspan="3"></td><td rowspan="3"></td><td rowspan="3">-l</td><td rowspan="3">uIs-L</td><td rowspan="3">Vieeree</td><td rowspan="3">3</td><td rowspan="3">nosiad</td><td rowspan="3"></td><td rowspan="3">3u</td><td rowspan="3"></td><td rowspan="3">mrrriltt</td><td rowspan="3">ealrlr</td><td rowspan="3">ntr eer</td></tr><tr><td></td><td></td></tr><tr><td>reee </td></tr><tr><td>FCNs wild source-only</td><td></td><td>6.4</td><td>17.7</td><td>29.7 1.2</td><td>0.0</td><td>15.1</td><td>0.0</td><td>7.2</td><td>30.3</td><td>66.8</td><td>51.1</td><td>1.5</td><td>47.3</td><td>3.9</td><td>0.1</td><td>0.0</td><td>17.4</td></tr><tr><td rowspan="10">259322</td><td>FCNs wild</td><td>11.5</td><td>19.6</td><td>30.8</td><td>4.4</td><td>0.0</td><td>20.3</td><td>0.1</td><td>11.7</td><td>42.3 68.7</td><td>51.2</td><td>3.8</td><td></td><td>54.0 3.2</td><td>0.2</td><td>0.6</td><td>20.2</td></tr><tr><td>CDA source-only</td><td>5.6</td><td>11.2</td><td>59.6</td><td>0.8</td><td>0.5</td><td>21.5</td><td>8.0 5.3</td><td>72.4</td><td>75.6</td><td>35.1</td><td>9.0</td><td>23.6</td><td>4.5</td><td>0.5</td><td>18.0</td><td>22.0</td></tr><tr><td>CDA</td><td>65.2</td><td>26.1</td><td>74.9</td><td>0.1</td><td>0.5</td><td>10.7 3.7</td><td>3.0</td><td>76.1</td><td>70.6</td><td>47.1</td><td>8.2</td><td>43.2</td><td>20.7</td><td>0.7</td><td>13.1</td><td>29.0</td></tr><tr><td>LSD source-only</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>23.2</td></tr><tr><td>LSD</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>n/a</td><td>34.5</td></tr><tr><td>Our source-only</td><td>14.2</td><td>12.4</td><td>73.3</td><td>0.5</td><td>0.1</td><td>23.1 5.8</td><td>12.2</td><td>79.4</td><td>78.6</td><td>45.1</td><td>7.8</td><td>32.8</td><td>5.7</td><td>5.6</td><td>1.6</td><td>24.9</td></tr><tr><td>SPIGAN-no-PI</td><td>68.8</td><td>24.5</td><td>73.4</td><td>3.6</td><td>0.1</td><td>22.0 5.8</td><td>8.9</td><td>74.6</td><td>77.3</td><td>41.5</td><td>8.8</td><td>58.2</td><td>15.4</td><td>6.7</td><td>8.4</td><td>31.1</td></tr><tr><td>SPIGAN</td><td>80.5</td><td>38.9</td><td>73.4</td><td>1.8</td><td>0.3</td><td>20.3</td><td>7.9 11.3</td><td>77.1</td><td>77.6</td><td>46.6</td><td>13.2</td><td>63.8</td><td>22.8</td><td>8.8</td><td>11.2</td><td>34.7</td></tr><tr><td>LSD source-only</td><td>30.1</td><td>17.5</td><td>70.2</td><td>5.9</td><td>0.1</td><td>16.7 9.1</td><td>12.6</td><td>74.5</td><td>76.3</td><td>43.9</td><td>13.2</td><td>35.7</td><td>14.3</td><td>3.7</td><td>5.6</td><td>26.8</td></tr><tr><td>LSD CBST source-only</td><td>80.1</td><td>29.1</td><td>77.5</td><td>2.8</td><td>0.4</td><td>26.8 11.1</td><td>18.0</td><td>78.1</td><td>76.7</td><td>48.2</td><td>15.2</td><td>70.5</td><td>17.4</td><td>8.7</td><td>16.7</td><td>36.1</td></tr><tr><td rowspan="8">2222222</td><td></td><td>17.2</td><td>19.7</td><td>73.3</td><td>1.1</td><td>0.0</td><td>19.1 3.0</td><td>9.1</td><td>71.8</td><td>78.3</td><td>37.6</td><td>4.7</td><td>42.2</td><td>9.0</td><td>0.1</td><td>0.9</td><td>22.6</td></tr><tr><td>CBST</td><td>69.9</td><td>28.7</td><td>69.5</td><td>12.1</td><td>0.1</td><td>25.4 11.9</td><td>13.6</td><td>82.0</td><td>81.9</td><td>49.1</td><td>14.5</td><td>66.0</td><td>6.6</td><td>3.7</td><td>32.4</td><td>35.4</td></tr><tr><td>Our source-only</td><td>21.2</td><td>12.3</td><td>69.1 2.8</td><td>0.1</td><td>24.8</td><td>10.4</td><td>15.3</td><td>74.8</td><td>78.2</td><td>50.3</td><td>8.8</td><td>41.9</td><td>18.3</td><td>6.6</td><td>6.8</td><td>27.6</td></tr><tr><td>SPIGAN-no-PI</td><td>69.5</td><td>29.4</td><td>68.7</td><td>4.4</td><td>0.3</td><td>32.4 5.8</td><td>15.0</td><td>81.0</td><td>78.7</td><td>52.2</td><td>13.1</td><td>72.8</td><td>23.6</td><td>7.9</td><td>18.7</td><td>35.8</td></tr><tr><td>SPIGAN</td><td>71.1</td><td>29.8</td><td>71.4</td><td>3.7</td><td>0.3</td><td>33.2</td><td>6.4 15.6</td><td>81.2</td><td>78.9</td><td>52.7</td><td>13.1</td><td>75.9</td><td>25.5</td><td>10.0</td><td>20.5</td><td>36.8</td></tr><tr><td>(LSD) Target-only</td><td>96.5</td><td>74.6</td><td>86.1</td><td>37.1</td><td>33.2</td><td>30.2 39.7</td><td>51.6</td><td>87.3</td><td>90.4</td><td>60.1</td><td>31.7</td><td>88.4</td><td>52.5</td><td>33.6</td><td>59.1</td><td>59.5</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan=1 colspan=1>Jasetee</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>美</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>CJsuoo</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Jrmee</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>ueunu</td><td rowspan=1 colspan=1>Vairee</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>neeee</td></tr><tr><td rowspan=4 colspan=1>ssdesssts</td><td rowspan=1 colspan=1>FCN source</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>79.6</td><td rowspan=1 colspan=1>51.0</td><td rowspan=1 colspan=1>8.7</td><td rowspan=1 colspan=1>29.0</td><td rowspan=1 colspan=1>50.9</td><td rowspan=1 colspan=1>3.0</td><td rowspan=1 colspan=1>31.6</td><td rowspan=1 colspan=2>36.3</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=2 colspan=1>SPIGAN-baseSPIGAN-no-PISPIGAN</td><td rowspan=2 colspan=1>?</td><td rowspan=2 colspan=1>√</td><td rowspan=2 colspan=1>82.590.391.2</td><td rowspan=2 colspan=1>52.758.266.4</td><td rowspan=2 colspan=1>7.26.89.6</td><td rowspan=2 colspan=1>30.635.856.8</td><td rowspan=1 colspan=1>52.269.0</td><td rowspan=2 colspan=1>5.69.517.7</td><td rowspan=2 colspan=1>34.252.160.3</td><td rowspan=2 colspan=2>37.946.053.4</td><td rowspan=2 colspan=1>0.340.160.09</td></tr><tr><td rowspan=1 colspan=1>71.5</td></tr><tr><td rowspan=1 colspan=1>FCN target</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>95.2</td><td rowspan=1 colspan=1>78.4</td><td rowspan=1 colspan=1>10.0</td><td rowspan=1 colspan=1>80.1</td><td rowspan=1 colspan=1>82.5</td><td rowspan=1 colspan=1>37.0</td><td rowspan=1 colspan=1>75.1</td><td rowspan=1 colspan=2>65.4</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=5 colspan=1>seisit</td><td rowspan=1 colspan=1>FCN source</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>61.5</td><td rowspan=1 colspan=1>40.8</td><td rowspan=1 colspan=1>10.4</td><td rowspan=1 colspan=1>53.3</td><td rowspan=1 colspan=1>65.7</td><td rowspan=1 colspan=1>16.6</td><td rowspan=1 colspan=1>30.4</td><td rowspan=1 colspan=2>39.8</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=3 colspan=1>SPIGAN-baseSPIGAN-no-PISPIGAN</td><td rowspan=3 colspan=1>√</td><td rowspan=3 colspan=1>√</td><td rowspan=3 colspan=1>59.453.074.1</td><td rowspan=2 colspan=1>29.730.8</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>10.4</td><td rowspan=1 colspan=1>52.2</td><td rowspan=1 colspan=1>5.9</td><td rowspan=1 colspan=1>20.3</td><td rowspan=1 colspan=2>22.7</td><td rowspan=1 colspan=1>0.83</td></tr><tr><td rowspan=1 colspan=1>3.6</td><td rowspan=1 colspan=1>14.6</td><td rowspan=1 colspan=1>53.0</td><td rowspan=1 colspan=1>5.8</td><td rowspan=1 colspan=1>26.9</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>26.8</td><td rowspan=1 colspan=1>0.80</td></tr><tr><td rowspan=1 colspan=1>47.1</td><td rowspan=1 colspan=1>6.8</td><td rowspan=1 colspan=1>43.3</td><td rowspan=1 colspan=1>83.7</td><td rowspan=1 colspan=1>11.2</td><td rowspan=1 colspan=1>42.2</td><td rowspan=1 colspan=2>44.1</td><td rowspan=1 colspan=1>0.42</td></tr><tr><td rowspan=1 colspan=1>FCN target</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>90.4</td><td rowspan=1 colspan=1>76.5</td><td rowspan=1 colspan=1>32.8</td><td rowspan=1 colspan=1>82.8</td><td rowspan=1 colspan=1>94.9</td><td rowspan=1 colspan=1>40.3</td><td rowspan=1 colspan=1>77.4</td><td rowspan=1 colspan=2>70.7</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 2: Semantic Segmentation results (per category and mean IoUs, higher is better) for SYNTHIA adapting to Cityscapes and Vistas. The last column is the ratio of images in the validation set for which we observe negative transfer (lower is better).
|
| 138 |
+
|
| 139 |
+
# 4.2 RESULTS AND DISCUSSION
|
| 140 |
+
|
| 141 |
+
In this section we present our evaluation of the SPIGAN algorithm in the context of adapting a semantic segmentation network from SYNTHIA to Cityscapes. Depth maps from SYNTHIA are used as PI in the proposed algorithm.
|
| 142 |
+
|
| 143 |
+
We compare our results to several state-of-art domain adaptation algorithms, including FCNs in the wild (FCNs wild) (Hoffman et al., 2016b), Curriculum DA (CDA) (Zhang et al., 2017), Learning from synthetic data (LSD) (Sankaranarayanan et al., 2018), and Class-balanced Self-Training (CBST) Zou et al. (2018).
|
| 144 |
+
|
| 145 |
+
Quantitative results for these methods are shown in Table 1 for the semantic segmentation task on the target domain of Cityscapes (validation set). As reference baselines, we include results training only on source images and non-adapted labels. We also provide our algorithm performance without the PI for comparison (i.e., $\gamma = 0$ in Eq. 1, named ”SPIGAN-no-PI”).
|
| 146 |
+
|
| 147 |
+
Results show that on Cityscapes SPIGAN achieves state-of-the-art semantic segmentation adaptation in terms of mean IoU. A finer analysis of the results attending to individual classes suggests that the use of PI helps to estimate layout-related classes such as road and sidewalk and object-related classes such as person, rider, car, bus and motorcycle. SPIGAN achieves an improvement of $3 \%$ in $3 2 0 \times 6 4 0$ , $1 . 0 \hat { \% }$ in $5 1 2 \times 1 0 2 4$ , in mean IoU with respect to the non-PI method. This improvement is thanks to the regularization provided by $P ( x ; \theta _ { P } )$ during training, which decreases the number of artifacts as shown in Figure 5. This comparison, therefore, confirms our main contribution: a general approach to leveraging synthetic data and $\mathrm { P I }$ from the simulator to improve generalization performance across the sim-to-real domain gap.
|
| 148 |
+
|
| 149 |
+
# 4.3 ABLATION STUDY
|
| 150 |
+
|
| 151 |
+
To better understand the proposed algorithm, and the impact of PI, we conduct further experiments comparing SPIGAN (with PI), SPIGAN-no-PI (without PI), and SPIGAN-base (without both PI and perceptual regularization), the task network of SPIGAN trained only on the source domain (FCN source, lower bound, no adaptation), and on the target domain (FCN target, upper bound), all at $3 2 0 \times 6 4 0$ resolution. We also include results on the Vistas dataset, which presents a more challenging adaptation problem due to the higher diversity of its images. For these experiments, we use a 7 semantic classes ontology to produce a balanced ontology common to the three datasets (SYNTHIA, Cityscapes and Vistas). Adaptation results for both target domains are given in Table 2.
|
| 152 |
+
|
| 153 |
+
In addition to the conventional segmentation performance metrics, we also carried out a study to measure the amount of negative transfer, summarized in Table 2. A negative transfer case is defined as a real-world testing sample that has a mIoU lower than the FCN source prediction (no adaptation).
|
| 154 |
+
|
| 155 |
+
As shown in Table 2, SPIGAN-no-PI, including perceptual regularization, performs better than SPIGAN-base in both datasets. The performance is generally improved in all categories, which implies that perceptual regularization effectively stabilizes the adaptation during training.
|
| 156 |
+
|
| 157 |
+
For Cityscapes, the quantitative results in Table 2 show that SPIGAN is able to provide dramatic adaptation as hypothesized. SPIGAN improves the mean IoU by $1 7 . 1 \%$ , with the PI itself providing an improvement of $7 . 4 \%$ . This is consistent with our observation in the previous experiment (Table 1). We also notice that SPIGAN gets significant improvements on ”nature”, ”construction”, and ”vehicle” categories. In addition, SPIGAN is able to improve the IoU by $+ 1 5 \%$ on the ”human” category, a difficult class in semantic segmentation. We provide examples of qualitative results for the adaptation from SYNTHIA to Cityscapes in Figure 5 and Figure 7.
|
| 158 |
+
|
| 159 |
+
On the Vistas dataset, SPIGAN is able to decrease the domain gap by $+ 4 . 3 \%$ mean IoU. In this case, using PI is crucial to improve generalization performance. SPIGAN-no-PI indeed suffers from negative transfer, with its adapted network performing $- 1 3 \%$ worse than the FCN source without adaptation. Table 2 shows that $8 0 \%$ of the evaluation images have a lower individual IoU after adaptation in the SPIGAN-no-PI case (vs. $4 2 \%$ in the SPIGAN case).
|
| 160 |
+
|
| 161 |
+
The main difference between the Cityscapes and Vistas results is due to the difference in visual diversity between the datasets. Cityscapes is indeed a more visually uniform benchmark than Vistas: it was recorded in a few German cities in nice weather, whereas Vistas contains crowdsourced data from all over the world with varying cameras, environments, and weathers. This makes Cityscapes more amenable to image translation methods (including SPIGAN-no-PI), as can be seen in Figure 5 where a lot of the visual adaptation happens at the color and texture levels, whereas Figure 6 shows that SYNTHIA images adapted towards Vistas contain a lot more artifacts. Furthermore, a larger domain gap is known to increase the risk of negative transfer (cf. Csurka (2017)). This is indeed what we quantitatively measured in Table 2 and qualitatively confirmed in Figure 6.
|
| 162 |
+
|
| 163 |
+
SPIGAN suffers from similar but less severe artifacts. As shown in Figure 6, they are more consistent with the depth of the scene, which helps addressing the domain gap and avoids the catastrophic failures visible in the SPIGAN-no-PI case. This consistent improvement brought by PI in both of the experiments not only shows that PI imposes useful constraints that promote better task-oriented training, but also implies that PI more robustly guides the training to reduce domain shift.
|
| 164 |
+
|
| 165 |
+
By comparing the results on the two different datasets, we also found that all the unsupervised adaptation methods share some similarity in the performance of certain categories. For instance, the ”vehicle” category has seen the largest improvement for both Cityscapes and Vistas. This trend is consistent with the well-known fact that ”object” categories are easier to adapt than ”stuff” Vazquez et al. (2014). However, the same improvement did not appear in the ”human” category mainly because the SYNTHIA subset we used in our experiments contains very few humans. This phenomenon has been recently studied in Sadat Saleh et al. (2018).
|
| 166 |
+
|
| 167 |
+
# 5 CONCLUSION
|
| 168 |
+
|
| 169 |
+
We present SPIGAN, a novel method for leveraging synthetic data and Privileged Information (PI) available in simulated environments to perform unsupervised domain adaptation of deep networks. Our approach jointly learns a generative pixel-level adaptation network together with a target task network and privileged information models. We showed that our approach is able to address large domain gaps between synthetic data and target real-world domains, including for challenging realworld tasks like semantic segmentation of urban scenes. For future work, we plan to investigate SPIGAN applied to additional tasks, with different types of PI that can be obtained from simulation.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 5: Adaptation from SYNTHIA to Cityscapes. (a) Examples of images from the source domain. (b) Source images after the adaptation process w/o Privileged Information. (c) Source images after the adaptation process using SPIGAN.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 6: Adaptation from SYNTHIA to Vistas. (a) Examples of images from the source domain. (b) Source images after the adaptation process w/o Privileged Information. (c) Source images after the adaptation process using SPIGAN. Image adaptation is more challenging between these two datasets due to a larger domain gap. Qualitative results indicate that SPIGAN is encoding more regularization in the image generation.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 7: Semantic segmentation results on Cityscapes. For a set of real images (a) we show examples of predicted semantic segmentation masks. SPIGAN predictions (c) are more accurate (i.e., closer to the ground truth (d)) than those produced without PI during training (b).
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 8: Semantic segmentation results on Vistas. For a set of real images (a) we show examples of predicted semantic segmentation masks. SPIGAN predictions (c) are more accurate (i.e., closer to the ground truth (d)) than those produced without PI during training (b).
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In NIPS, 2016.
|
| 186 |
+
|
| 187 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In Computer Vision and Pattern Recognition, 2017.
|
| 188 |
+
|
| 189 |
+
Lin Chen, Wen Li, and Dong Xu. Recognizing rgb images by learning from rgb-d data. In Computer Vision and Pattern Recognition, 2014.
|
| 190 |
+
|
| 191 |
+
Qifeng Chen and Vladlen Koltun. Photographic image synthesis with cascaded refinement networks. In International Conference on Computer Vision, Oct 2017.
|
| 192 |
+
|
| 193 |
+
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 International Conference on Computer Vision, 2017.
|
| 194 |
+
|
| 195 |
+
Yuhua Chen, Wen Li, and Luc Van Gool. Road: Reality oriented adaptation for semantic segmentation of urban scenes. In Computer Vision and Pattern Recognition, 2018.
|
| 196 |
+
|
| 197 |
+
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 Computer Vision and Pattern Recognition, 2016.
|
| 198 |
+
|
| 199 |
+
Gabriela Csurka. Domain Adaptation in Computer Vision Applications. Springer, 2017.
|
| 200 |
+
|
| 201 |
+
Zihang Dai, Zhilin Yang, Fan Yang, William W. Cohen, and Ruslan Salakhutdinov. Good semisupervised learning that requires a bad GAN. NIPS, 2017.
|
| 202 |
+
|
| 203 |
+
Cesar Roberto de Souza, Adrien Gaidon, Yohann Cabon, and Antonio Manuel L ´ opez Pe ´ na. Pro- ˜ cedural generation of videos to train deep action recognition networks. In Computer Vision and Pattern Recognition, 2017.
|
| 204 |
+
|
| 205 |
+
Adrien Gaidon, Qiao Wang, Yohann Cabon, and Eleonora Vig. Virtual worlds as proxy for multiobject tracking analysis. In Computer Vision and Pattern Recognition, 2016.
|
| 206 |
+
|
| 207 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In International Conference on Machine Learning, 2015.
|
| 208 |
+
|
| 209 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 2016.
|
| 210 |
+
|
| 211 |
+
Nuno Garcia, Pietro Morerio, and Vittorio Murino. Modality distillation with multiple stream networks for action recognition. In European Conference on Computer Vision, 2018.
|
| 212 |
+
|
| 213 |
+
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.
|
| 214 |
+
|
| 215 |
+
Ankur Handa, Viorica Patraucean, Vijay Badrinarayanan, Simon Stent, and Roberto Cipolla. Understanding real world indoor scenes with synthetic data. In Computer Vision and Pattern Recognition, 2016.
|
| 216 |
+
|
| 217 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, 2016.
|
| 218 |
+
|
| 219 |
+
Samitha Herath, Mehrtash Harandi, and Fatih Porikli. Learning an invariant hilbert space for domain adaptation. In Computer Vision and Pattern Recognition, 2017.
|
| 220 |
+
|
| 221 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 222 |
+
|
| 223 |
+
Judy Hoffman, Erik Rodner, Jeff Donahue, Kate Saenko, and Trevor Darrell. Efficient learning of domain-invariant image representations. In International Conference on Learning Representations, 2013.
|
| 224 |
+
|
| 225 |
+
Judy Hoffman, Saurabh Gupta, and Trevor Darrell. Learning with side information through modality hallucination. In Computer Vision and Pattern Recognition, 2016a.
|
| 226 |
+
|
| 227 |
+
Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcns in the wild: Pixel-level adversarial and constraint-based adaptation. arXiv preprint arXiv:1612.02649, 2016b.
|
| 228 |
+
|
| 229 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-image translation with conditional adversarial networks. In Computer Vision and Pattern Recognition, 2017.
|
| 230 |
+
|
| 231 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision. Springer, 2016.
|
| 232 |
+
|
| 233 |
+
Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In International Conference on Machine Learning, 2017.
|
| 234 |
+
|
| 235 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 236 |
+
|
| 237 |
+
Wen Li, Li Niu, and Dong Xu. Exploiting privileged information from web data for image categorization. In European Conference on Computer Vision, 2014.
|
| 238 |
+
|
| 239 |
+
Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. arXiv preprint arXiv:1703.00848, 2017.
|
| 240 |
+
|
| 241 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In International Conference on Machine Learning, 2015.
|
| 242 |
+
|
| 243 |
+
David Lopez-Paz, Lon Bottou, Bernhard Schlkopf, and Vladimir Vapnik. Unifying distillation and privileged information. arXiv preprint arXiv:1511.03643, 2015.
|
| 244 |
+
|
| 245 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, and Zhen Wang. Multi-class generative adversarial networks with the l2 loss function. arXiv preprint arXiv:1611.04076, 2016.
|
| 246 |
+
|
| 247 |
+
Javier Mar´ın, David Vazquez, David Ger ´ onimo, and Antonio M. L ´ opez. Learning appearance in ´ virtual scenarios for pedestrian detection. In Computer Vision and Pattern Recognition, 2010.
|
| 248 |
+
|
| 249 |
+
Nikolaus Mayer, Eddy Ilg, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In Computer Vision and Pattern Recognition, 2016.
|
| 250 |
+
|
| 251 |
+
Gerhard Neuhold, Tobias Ollmann, Samuel Rota Bulo, and Peter Kontschieder. The mapillary vistas \` dataset for semantic understanding of street scenes. In International Conference on Computer Vision, 2017.
|
| 252 |
+
|
| 253 |
+
Jeremie Papon and Markus Schoeler. Semantic pose using deep networks trained on synthetic RGBD. In International Conference on Computer Vision, 2015.
|
| 254 |
+
|
| 255 |
+
Adam Paszke, Sam Gross, Soumith Chintala, et al. Pytorch, 2017.
|
| 256 |
+
|
| 257 |
+
Xingchao Peng, Baochen Sun, Karim Ali, and Kate Saenko. Learning deep object detectors from 3D models. In International Conference on Computer Vision, 2015.
|
| 258 |
+
|
| 259 |
+
Sanjay Purushotham, Wilka Carvalho, Tanachat Nilanon, and Yan Liu. Variational recurrent adversarial deep domain adaptation. In International Conference on Learning Representations, 2017.
|
| 260 |
+
|
| 261 |
+
Stephan R. Richter, Vibhav Vineet, Stefan Roth, and Koltun Vladlen. Playing for data: Ground truth from computer games. In European Conference on Computer Vision, 2016.
|
| 262 |
+
|
| 263 |
+
German Ros, Laura Sellart, Joanna Materzyska, David Vazquez, and Antonio M. L ´ opez. The SYN- ´ THIA dataset: a large collection of synthetic images for semantic segmentation of urban scenes. In Computer Vision and Pattern Recognition, 2016.
|
| 264 |
+
|
| 265 |
+
Fatemeh Sadat Saleh, Mohammad Sadegh Aliakbarian, Mathieu Salzmann, Lars Petersson, and Jose M. Alvarez. Effective use of synthetic data for urban scene semantic segmentation. In European Conference on Computer Vision, 2018.
|
| 266 |
+
|
| 267 |
+
Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. arXiv preprint arXiv:1712.02560, 3, 2017.
|
| 268 |
+
|
| 269 |
+
Swami Sankaranarayanan, Yogesh Balaji, Arpit Jain, Ser Nam Lim, and Rama Chellappa. Learning from synthetic data: Addressing domain shift for semantic segmentation. In Computer Vision and Pattern Recognition, 2018.
|
| 270 |
+
|
| 271 |
+
Nikolaos Sarafianos, Michalis Vrigkas, and Ioannis A Kakadiaris. Adaptive svm+: Learning with privileged information for domain adaptation. arXiv preprint arXiv:1708.09083, 2017.
|
| 272 |
+
|
| 273 |
+
Jamie Shotton, Andrew Fitzgibbon, Mat Cook, Toby Sharp, Mark Finocchio, Richard Moore, Alex Kipmanand, and Andrew Blake. Real-time human pose recognition in parts from a single depth image. In Computer Vision and Pattern Recognition, 2011.
|
| 274 |
+
|
| 275 |
+
Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Josh Susskind, Wenda Wang, and Russ Webb. Learning from simulated and unsupervised images through adversarial training. arXiv preprint arXiv:1612.07828, 2016.
|
| 276 |
+
|
| 277 |
+
Hao Su, Charles R. Qi, Yangyan Yi, and Leonidas Guibas. Render for CNN: viewpoint estimation in images using CNNs trained with rendered 3D model views. In International Conference on Computer Vision, 2015.
|
| 278 |
+
|
| 279 |
+
Baochen Sun and Kate Saenko. From virtual to reality: Fast adaptation of virtual object detectors to real domains. In British Machine Vision Conference, 2014.
|
| 280 |
+
|
| 281 |
+
Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. arXiv preprint arXiv:1611.02200, 2016.
|
| 282 |
+
|
| 283 |
+
Yi-Hsuan Tsai, Wei-Chih Hung, Samuel Schulter, Kihyuk Sohn, Ming-Hsuan Yang, and Manmohan Chandraker. Learning to adapt structured output space for semantic segmentation. In Computer Vision and Pattern Recognition, 2018.
|
| 284 |
+
|
| 285 |
+
Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014.
|
| 286 |
+
|
| 287 |
+
Vladimir Vapnik and Akshay Vashist. A new learning paradigm: Learning using privileged information. Neural Networks, 2009.
|
| 288 |
+
|
| 289 |
+
David Vazquez, Antonio M. Lopez, Javier Mar ´ ´ın, Daniel Ponsa, and David Geronimo. Virtual and ´ real world adaptation for pedestrian detection. Transactions on Pattern Analysis and Machine Intelligence, 36(4):797 – 809, 2014.
|
| 290 |
+
|
| 291 |
+
Ian H Witten, Eibe Frank, Mark A Hall, and Christopher J Pal. Data Mining: Practical machine learning tools and techniques. Morgan Kaufmann, 2016.
|
| 292 |
+
|
| 293 |
+
Jiaolong Xu, David Vazquez, Antonio M. L ´ opez, Javier Mar ´ ´ın, and Daniel Ponsa. Learning a partbased pedestrian detector in a virtual world. Transaction on Intelligent Transportation Systems, 15(5):2121–2131, 2014.
|
| 294 |
+
|
| 295 |
+
Ke Yan, Lu Kou, and David Zhang. Learning domain-invariant subspace using domain features and independence maximization. Transactions on Cybernetics, 2017.
|
| 296 |
+
|
| 297 |
+
Yang Zhang, Philip David, and Boqing Gong. Curriculum domain adaptation for semantic segmentation of urban scenes. In International Conference on Computer Vision, 2017.
|
| 298 |
+
|
| 299 |
+
Yiheng Zhang, Zhaofan Qiu, Ting Yao, Dong Liu, and Tao Mei. Fully convolutional adaptation networks for semantic segmentation. In Computer Vision and Pattern Recognition, 2018.
|
| 300 |
+
|
| 301 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In International Conference on Computer Vision, 2017.
|
| 302 |
+
|
| 303 |
+
Yang Zou, Zhiding Yu, BVK Vijaya Kumar, and Jinsong Wang. Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In European Conference on Computer Vision, 2018.
|
md/train/rytstxWAW/rytstxWAW.md
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FASTGCN: FAST LEARNING WITH GRAPH CONVOLUTIONAL NETWORKS VIA IMPORTANCE SAMPLING
|
| 2 |
+
|
| 3 |
+
Jie Chen∗, Tengfei Ma∗, Cao Xiao
|
| 4 |
+
IBM Research
|
| 5 |
+
chenjie@us.ibm.com, Tengfei.Ma1@ibm.com, cxiao@us.ibm.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
The graph convolutional networks (GCN) recently proposed by Kipf and Welling are an effective graph model for semi-supervised learning. This model, however, was originally designed to be learned with the presence of both training and test data. Moreover, the recursive neighborhood expansion across layers poses time and memory challenges for training with large, dense graphs. To relax the requirement of simultaneous availability of test data, we interpret graph convolutions as integral transforms of embedding functions under probability measures. Such an interpretation allows for the use of Monte Carlo approaches to consistently estimate the integrals, which in turn leads to a batched training scheme as we propose in this work—FastGCN. Enhanced with importance sampling, FastGCN not only is efficient for training but also generalizes well for inference. We show a comprehensive set of experiments to demonstrate its effectiveness compared with GCN and related models. In particular, training is orders of magnitude more efficient while predictions remain comparably accurate.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Graphs are universal representations of pairwise relationship. Many real world data come naturally in the form of graphs; e.g., social networks, gene expression networks, and knowledge graphs. To improve the performance of graph-based learning tasks, such as node classification and link prediction, recently much effort is made to extend well-established network architectures, including recurrent neural networks (RNN) and convolutional neural networks (CNN), to graph data; see, e.g., Bruna et al. (2013); Duvenaud et al. (2015); Li et al. (2015); Jain et al. (2015); Henaff et al. (2015); Niepert et al. (2016); Kipf & Welling (2016a;b).
|
| 14 |
+
|
| 15 |
+
Whereas learning feature representations for graphs is an important subject among this effort, here, we focus on the feature representations for graph vertices. In this vein, the closest work that applies a convolution architecture is the graph convolutional network (GCN) (Kipf & Welling, 2016a;b). Borrowing the concept of a convolution filter for image pixels or a linear array of signals, GCN uses the connectivity structure of the graph as the filter to perform neighborhood mixing. The architecture may be elegantly summarized by the following expression:
|
| 16 |
+
|
| 17 |
+
$$
|
| 18 |
+
H ^ { ( l + 1 ) } = \sigma ( \hat { A } H ^ { ( l ) } W ^ { ( l ) } ) ,
|
| 19 |
+
$$
|
| 20 |
+
|
| 21 |
+
where $\hat { A }$ is some normalization of the graph adjacency matrix, $H ^ { ( l ) }$ contains the embedding (rowwise) of the graph vertices in the $l$ th layer, $\mathbf { \overline { { W } } } ^ { ( l ) }$ is a parameter matrix, and $\sigma$ is nonlinearity.
|
| 22 |
+
|
| 23 |
+
As with many graph algorithms, the adjacency matrix encodes the pairwise relationship for both training and test data. The learning of the model as well as the embedding is performed for both data simultaneously, at least as the authors proposed. For many applications, however, test data may not be readily available, because the graph may be constantly expanding with new vertices (e.g. new members of a social network, new products to a recommender system, and new drugs for functionality tests). Such scenarios require an inductive scheme that learns a model from only a training set of vertices and that generalizes well to any augmentation of the graph.
|
| 24 |
+
|
| 25 |
+
A more severe challenge for GCN is that the recursive expansion of neighborhoods across layers incurs expensive computations in batched training. Particularly for dense graphs and powerlaw graphs, the expansion of the neighborhood for a single vertex quickly fills up a large portion of the graph. Then, a usual mini-batch training will involve a large amount of data for every batch, even with a small batch size. Hence, scalability is a pressing issue to resolve for GCN to be applicable to large, dense graphs.
|
| 26 |
+
|
| 27 |
+
To address both challenges, we propose to view graph convolutions from a different angle and interpret them as integral transforms of embedding functions under probability measures. Such a view provides a principled mechanism for inductive learning, starting from the formulation of the loss to the stochastic version of the gradient. Specifically, we interpret that graph vertices are iid samples of some probability distribution and write the loss and each convolution layer as integrals with respect to vertex embedding functions. Then, the integrals are evaluated through Monte Carlo approximation that defines the sample loss and the sample gradient. One may further alter the sampling distribution (as in importance sampling) to reduce the approximation variance.
|
| 28 |
+
|
| 29 |
+
The proposed approach, coined FastGCN, not only rids the reliance on the test data but also yields a controllable cost for per-batch computation. At the time of writing, we notice a newly published work GraphSAGE (Hamilton et al., 2017) that proposes also the use of sampling to reduce the computational footprint of GCN. Our sampling scheme is more economic, resulting in a substantial saving in the gradient computation, as will be analyzed in more detail in Section 3.3. Experimental results in Section 4 indicate that the per-batch computation of FastGCN is more than an order of magnitude faster than that of GraphSAGE, while classification accuracies are highly comparable.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Over the past few years, several graph-based convolution network models emerged for addressing applications of graph-structured data, such as the representation of molecules (Duvenaud et al., 2015). An important stream of work is built on spectral graph theory (Bruna et al., 2013; Henaff et al., 2015; Defferrard et al., 2016). They define parameterized filters in the spectral domain, inspired by graph Fourier transform. These approaches learn a feature representation for the whole graph and may be used for graph classification.
|
| 34 |
+
|
| 35 |
+
Another line of work learns embeddings for graph vertices, for which Goyal & Ferrara (2017) is a recent survey that covers comprehensively several categories of methods. A major category consists of factorization based algorithms that yield the embedding through matrix factorizations; see, e.g., Roweis & Saul (2000); Belkin & Niyogi (2001); Ahmed et al. (2013); Cao et al. (2015); Ou et al. (2016). These methods learn the representations of training and test data jointly. Another category is random walk based methods (Perozzi et al., 2014; Grover & Leskovec, 2016) that compute node representations through exploration of neighborhoods. LINE (Tang et al., 2015) is also such a technique that is motivated by the preservation of the first and second-order proximities. Meanwhile, there appear a few deep neural network architectures, which better capture the nonlinearity within graphs, such as SDNE (Wang et al., 2016). As motivated earlier, GCN (Kipf & Welling, 2016a) is the model on which our work is based.
|
| 36 |
+
|
| 37 |
+
The most relevant work to our approach is GraphSAGE (Hamilton et al., 2017), which learns node representations through aggregation of neighborhood information. One of the proposed aggregators employs the GCN architecture. The authors also acknowledge the memory bottleneck of GCN and hence propose an ad hoc sampling scheme to restrict the neighborhood size. Our sampling approach is based on a different and more principled formulation. The major distinction is that we sample vertices rather than neighbors. The resulting computational savings are analyzed in Section 3.3.
|
| 38 |
+
|
| 39 |
+
# 3 TRAINING AND INFERENCE THROUGH SAMPLING
|
| 40 |
+
|
| 41 |
+
One striking difference between GCN and many standard neural network architectures is the lack of independence in the sample loss. Training algorithms such as SGD and its batch generalization are designed based on the additive nature of the loss function with respect to independent data samples. For graphs, on the other hand, each vertex is convolved with all its neighbors and hence defining a sample gradient that is efficient to compute is beyond straightforward.
|
| 42 |
+
|
| 43 |
+
Concretely, consider the standard SGD scenario where the loss is the expectation of some function $g$ with respect to a data distribution $D$ :
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
L = \operatorname { E } _ { x \sim D } [ g ( W ; x ) ] .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Here, $W$ denotes the model parameter to be optimized. Of course, the data distribution is generally unknown and one instead minimizes the empirical loss through accessing $n$ iid samples $x _ { 1 } , \ldots , x _ { n }$ :
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
L _ { \mathrm { e m p } } = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } g ( W ; x _ { i } ) , \qquad x _ { i } \sim D , \ \forall i .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
In each step of SGD, the gradient is approximated by $\nabla g ( W ; x _ { i } )$ , an (assumed) unbiased sample of $\nabla L$ . One may interpret that each gradient step makes progress toward the sample loss $g ( W ; x _ { i } )$ . The sample loss and the sample gradient involve only one single sample $x _ { i }$ .
|
| 56 |
+
|
| 57 |
+
For graphs, one may no longer leverage the independence and compute the sample gradient $\nabla g ( W ; x _ { i } )$ by discarding the information of $i$ ’s neighboring vertices and their neighbors, recursively. We therefore seek an alternative formulation. In order to cast the learning problem under the same sampling framework, let us assume that there is a (possibly infinite) graph $G ^ { \prime }$ with the vertex set $V ^ { \prime }$ associated with a probability space $( V ^ { \prime } , F , P )$ , such that for the given graph $G$ , it is an induced subgraph of $G ^ { \prime }$ and its vertices are iid samples of $V ^ { \prime }$ according to the probability measure $P$ . For the probability space, $V ^ { \prime }$ serves as the sample space and $F$ may be any event space (e.g., the power set $F = 2 ^ { V ^ { \prime } }$ ). The probability measure $P$ defines a sampling distribution.
|
| 58 |
+
|
| 59 |
+
To resolve the problem of lack of independence caused by convolution, we interpret that each layer of the network defines an embedding function of the vertices (random variable) that are tied to the same probability measure but are independent. See Figure 1. Specifically, recall the architecture of GCN
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\tilde { H } ^ { ( l + 1 ) } = \hat { A } H ^ { ( l ) } W ^ { ( l ) } , \quad H ^ { ( l + 1 ) } = \sigma ( \tilde { H } ^ { ( l + 1 ) } ) , \quad l = 0 , \dots , M - 1 , \quad L = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } g ( H ^ { ( M ) } ( i , : ) ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
For the functional generalization, we write
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\tilde { h } ^ { ( l + 1 ) } ( v ) = \int \hat { A } ( v , u ) h ^ { ( l ) } ( u ) W ^ { ( l ) } d P ( u ) , \quad h ^ { ( l + 1 ) } ( v ) = \sigma ( \tilde { h } ^ { ( l + 1 ) } ( v ) ) , \quad l = 0 , \ldots , M - 1 ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
L = \mathrm { E } _ { v \sim P } [ g ( h ^ { ( M ) } ( v ) ) ] = \int g ( h ^ { ( M ) } ( v ) ) d P ( v ) .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Here, $u$ and $v$ are independent random variables, both of which have the same probability measure $P$ . The function $\it { h ^ { ( l ) } }$ is interpreted as the embedding function from the lth layer. The embedding functions from two consecutive layers are related through convolution, expressed as an integral transform, where the kernel $\hat { A } ( v , u )$ corresponds to the $( v , u )$ element of the matrix $\hat { A }$ . The loss is the expectation of $g ( h ^ { ( M ) } )$ for the final embedding $h ^ { ( M ) }$ . Note that the integrals are not the usual Riemann–Stieltjes integrals, because the variables $u$ and $v$ are graph vertices but not real numbers; however, this distinction is only a matter of formalism.
|
| 76 |
+
|
| 77 |
+
Writing GCN in the functional form allows for evaluating the integrals in the Monte Carlo manner, which leads to a batched training algorithm and also to a natural separation of training and test data, as in inductive learning. For each layer $l$ , we use $t _ { l }$ iid samples $u _ { 1 } ^ { ( l ) } , \ldots , u _ { t _ { l } } ^ { ( l ) } \sim P$ to approximately evaluate the integral transform (2); that is,
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\tilde { h } _ { t _ { l + 1 } } ^ { ( l + 1 ) } ( v ) : = \frac { 1 } { t _ { l } } \sum _ { j = 1 } ^ { t _ { l } } \hat { A } ( v , u _ { j } ^ { ( l ) } ) h _ { t _ { l } } ^ { ( l ) } ( u _ { j } ^ { ( l ) } ) W ^ { ( l ) } , \quad h _ { t _ { l + 1 } } ^ { ( l + 1 ) } ( v ) : = \sigma ( \tilde { h } _ { t _ { l + 1 } } ^ { ( l + 1 ) } ( v ) ) , \quad l = 0 , \ldots , M - 1 ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
with the convention $h _ { t _ { 0 } } ^ { ( 0 ) } \equiv h ^ { ( 0 ) }$ . Then, the loss $L$ in (3) admits an estimator
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
L _ { t _ { 0 } , t _ { 1 } , \dots , t _ { M } } : = \frac { 1 } { t _ { M } } \sum _ { i = 1 } ^ { t _ { M } } g ( h _ { t _ { M } } ^ { ( M ) } ( u _ { i } ^ { ( M ) } ) ) .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
The follow result establishes that the estimator is consistent. The proof is a recursive application of the law of large numbers and the continuous mapping theorem; it is given in the appendix.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 1: Two views of GCN. On the left (graph convolution view), each circle represents a graph vertex. On two consecutive rows, a circle $i$ is connected (in gray line) with circle $j$ if the two corresponding vertices in the graph are connected. A convolution layer uses the graph connectivity structure to mix the vertex features/embeddings. On the right (integral transform view), the embedding function in the next layer is an integral transform (illustrated by the orange fanout shape) of the one in the previous layer. For the proposed method, all integrals (including the loss function) are evaluated by using Monte Carlo sampling. Correspondingly in the graph view, vertices are subsampled in a bootstrapping manner in each layer to approximate the convolution. The sampled portions are collectively denoted by the solid blue circles and the orange lines.
|
| 93 |
+
|
| 94 |
+
Theorem 1. If $g$ and $\sigma$ are continuous, then
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\operatorname * { l i m } _ { t _ { 0 } , t _ { 1 } , . . . , t _ { M } \infty } { \cal L } _ { t _ { 0 } , t _ { 1 } , . . . , t _ { M } } = { \cal L } w i t h p r o b a b i l i t y o n e .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
In practical use, we are given a graph whose vertices are already assumed to be samples. Hence, we will need bootstrapping to obtain a consistent estimate. In particular, for the network architecture (1), the output $H ^ { ( M ) }$ is split into batches as usual. We will still use $u _ { 1 } ^ { ( M ) } , \dots , u _ { t _ { M } } ^ { ( M ) }$ to denote a batch of vertices, which come from the given graph. For each batch, we sample (with replacement) uniformly each layer and obtain samples $u _ { i } ^ { ( l ) }$ , $i = 1 , \ldots , t _ { l }$ , $l = 0 , \ldots , M - 1$ . Such a procedure is equivalent to uniformly sampling the rows of $H ^ { ( l ) }$ for each $l$ . Then, we obtain the batch loss
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
L _ { \mathrm { b a t c h } } = \frac { 1 } { t _ { M } } \sum _ { i = 1 } ^ { t _ { M } } g ( H ^ { ( M ) } ( u _ { i } ^ { ( M ) } , : ) ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where, recursively,
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
H ^ { ( l + 1 ) } ( v , : ) = \sigma \left( \frac { n } { t _ { l } } \sum _ { j = 1 } ^ { t _ { l } } \hat { A } ( v , u _ { j } ^ { ( l ) } ) H ^ { ( l ) } ( u _ { j } ^ { ( l ) } , : ) W ^ { ( l ) } \right) , \quad l = 0 , \ldots , M - 1 .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Here, the $n$ inside the activation function $\sigma$ is the number of vertices in the given graph and is used to account for the normalization difference between the matrix form (1) and the integral form (2). The corresponding batch gradient may be straightforwardly obtained through applying the chain rule on each $H ^ { ( l ) }$ . See Algorithm 1.
|
| 113 |
+
|
| 114 |
+
# 3.1 VARIANCE REDUCTION
|
| 115 |
+
|
| 116 |
+
As for any estimator, one is interested in improving its variance. Whereas computing the full variance is highly challenging because of nonlinearity in all the layers, it is possible to consider each single layer and aim at improving the varianceSpecifically, consider for the lth layer, the function $\tilde { h } _ { t _ { l + 1 } } ^ { ( l + 1 ) } ( v )$ bedding function before nonlinearity. as an approximation to the convolution $\begin{array} { r l } { \int \hat { A } ( v , u ) h _ { t _ { l } } ^ { ( l ) } ( u ) W ^ { ( l ) } d P ( u ) } \end{array}$ . When taking $t _ { l + 1 }$ samples $v = u _ { 1 } ^ { ( l + 1 ) } , \dots , u _ { t _ { l + 1 } } ^ { ( l + 1 ) }$ , the sample average of by this lay $\tilde { h } _ { t _ { l + 1 } } ^ { ( l + 1 ) } ( v )$ admits a variance that captures the deviation from the eventual loss contributed, we seek an improvement of this variance. Now that we consider each layer separately, we will do the following change of notation to keep the expressions less cumbersome:
|
| 117 |
+
|
| 118 |
+
# Algorithm 1 FastGCN batched training (one epoch)
|
| 119 |
+
|
| 120 |
+
1: for each batch do
|
| 121 |
+
2: For each layer $l$ , sample uniformly $t _ { l }$ vertices $u _ { 1 } ^ { ( l ) } , \ldots , u _ { t _ { l } } ^ { ( l ) }$
|
| 122 |
+
3: for each layer $l$ do $\triangleright$ Compute batch gradient $\nabla L _ { \mathrm { b a t c h } }$
|
| 123 |
+
4: If $v$ is sampled in the next layer,
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\nabla \tilde { H } ^ { ( l + 1 ) } ( v , : ) \gets \frac { n } { t _ { l } } \sum _ { j = 1 } ^ { t _ { l } } \hat { A } ( v , u _ { j } ^ { ( l ) } ) \nabla \Big \{ H ^ { ( l ) } ( u _ { j } ^ { ( l ) } , : ) W ^ { ( l ) } \Big \}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
5: end for
|
| 130 |
+
6: $W W - \eta \nabla L _ { \mathrm { b a t c h } }$
|
| 131 |
+
7: end for
|
| 132 |
+
|
| 133 |
+
. SGD step
|
| 134 |
+
|
| 135 |
+
<table><tr><td></td><td>Function</td><td>Samples</td><td>Num. samples</td></tr><tr><td>Layer l +1; random variable u</td><td></td><td>(+1)→Ui 山i</td><td>t+1→s</td></tr><tr><td>Layer l; random variable u</td><td>m (u)W(l) → x(u)</td><td>uj (1) →uj</td><td>t→t</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Under the joint distribution of $v$ and $u$ , the aforementioned sample average is
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
G : = \frac { 1 } { s } \sum _ { i = 1 } ^ { s } y ( v _ { i } ) = \frac { 1 } { s } \sum _ { i = 1 } ^ { s } \left( \frac { 1 } { t } \sum _ { j = 1 } ^ { t } \hat { A } ( v _ { i } , u _ { j } ) x ( u _ { j } ) \right) .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
First, we have the following result.
|
| 144 |
+
|
| 145 |
+
Proposition 2. The variance of $G$ admits
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathrm { V a r } \{ G \} = R + \frac { 1 } { s t } \int \int \hat { A } ( v , u ) ^ { 2 } x ( u ) ^ { 2 } d P ( u ) d P ( v ) ,
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
R = \frac { 1 } { s } \left( 1 - \frac { 1 } { t } \right) \int e ( v ) ^ { 2 } d P ( v ) - \frac { 1 } { s } \left( \int e ( v ) d P ( v ) \right) ^ { 2 } \quad a n d \quad e ( v ) = \int \hat { A } ( v , u ) x ( u ) d P ( u ) .
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
The variance (6) consists of two parts. The first part $R$ leaves little room for improvement, because the sampling in the $v$ space is not done in this layer. The second part (the double integral), on the other hand, depends on how the $u _ { j }$ ’s in this layer are sampled. The current result (6) is the consequence of sampling $u _ { j }$ ’s by using the probability measure $P$ . One may perform importance sampling, altering the sampling distribution to reduce variance. Specifically, let $Q ( u )$ be the new probability measure, where the $u _ { j }$ ’s are drawn from. We hence define the new sample average approximation
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
y _ { Q } ( v ) : = \frac { 1 } { t } \sum _ { j = 1 } ^ { t } \hat { A } ( v , u _ { j } ) x ( u _ { j } ) \left( \frac { d P ( u ) } { d Q ( u ) } \bigg | _ { u _ { j } } \right) , \qquad u _ { 1 } , \ldots , u _ { t } \sim Q ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
and the quantity of interest
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
G _ { Q } : = \frac { 1 } { s } \sum _ { i = 1 } ^ { s } y _ { Q } ( v _ { i } ) = \frac { 1 } { s } \sum _ { i = 1 } ^ { s } \left( \frac { 1 } { t } \sum _ { j = 1 } ^ { t } \hat { A } ( v _ { i } , u _ { j } ) x ( u _ { j } ) \left( \left. \frac { d P ( u ) } { d Q ( u ) } \right| _ { u _ { j } } \right) \right) .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Clearly, the expectation of $G _ { Q }$ is the same as that of $G$ , regardless of the new measure $Q$ . The following result gives the optimal $Q$ .
|
| 170 |
+
|
| 171 |
+
# Theorem 3. If
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
d Q ( u ) = \frac { b ( u ) | x ( u ) | d P ( u ) } { \int b ( u ) | x ( u ) | d P ( u ) } \quad w h e r e \quad b ( u ) = \left[ \int \hat { A } ( v , u ) ^ { 2 } d P ( v ) \right] ^ { \frac { 1 } { 2 } } ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
then the variance of $G _ { Q }$ admits
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\mathrm { V a r } \{ G _ { Q } \} = R + { \frac { 1 } { s t } } \left[ \int b ( u ) | x ( u ) | d P ( u ) \right] ^ { 2 } ,
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
where $R$ is defined in Proposition 2. The variance is minimum among all choices of $Q$ .
|
| 184 |
+
|
| 185 |
+
A drawback of defining the sampling distribution $Q$ in this manner is that it involves $| x ( u ) |$ , which constantly changes during training. It corresponds to the product of the embedding matrix $H ^ { ( l ) }$ and the parameter matrix $\mathsf { \bar { W } } ^ { ( l ) }$ . The parameter matrix is updated in every iteration; and the matrix product is expensive to compute. Hence, the cost of computing the optimal measure $Q$ is quite high.
|
| 186 |
+
|
| 187 |
+
As a compromise, we consider a different choice of $Q$ , which involves only $b ( u )$ . The following proposition gives the precise definition. The resulting variance may or may not be smaller than (6). In practice, however, we find that it is almost always helpful.
|
| 188 |
+
|
| 189 |
+
# Proposition 4. If
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
d Q ( u ) = \frac { b ( u ) ^ { 2 } d P ( u ) } { \int b ( u ) ^ { 2 } d P ( u ) }
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
where $b ( u )$ is defined in (7), then the variance of $G _ { Q }$ admits
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\mathrm { V a r } \{ G _ { Q } \} = R + \frac { 1 } { s t } \int b ( u ) ^ { 2 } d P ( u ) \int x ( u ) ^ { 2 } d P ( u ) ,
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
where $R$ is defined in Proposition 2.
|
| 202 |
+
|
| 203 |
+
With this choice of the probability measure $Q$ , the ratio $d Q ( u ) / d P ( u )$ is proportional to $b ( u ) ^ { 2 }$ , which is simply the integral of $\hat { A } ( v , u ) ^ { 2 }$ with respect to $v$ . In practical use, for the network architecture (1), we define a probability mass function for all the vertices in the given graph:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
q ( u ) = \| \hat { A } ( : , u ) \| ^ { 2 } / \sum _ { u ^ { \prime } \in V } \| \hat { A } ( : , u ^ { \prime } ) \| ^ { 2 } , \quad u \in V
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
and sample $t$ vertices $u _ { 1 } , \ldots , u _ { t }$ according to this distribution. From the expression of $q$ , we see that it has no dependency on $l$ ; that is, the sampling distribution is the same for all layers. To summarize, the batch loss $L _ { \mathrm { b a t c h } }$ in (4) now is recursively expanded as
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
H ^ { ( l + 1 ) } ( v , : ) = \sigma \left( \frac { 1 } { t _ { l } } \sum _ { j = 1 } ^ { t _ { l } } \frac { \hat { A } ( v , u _ { j } ^ { ( l ) } ) H ^ { ( l ) } ( u _ { j } ^ { ( l ) } , : ) W ^ { ( l ) } } { q ( u _ { j } ^ { ( l ) } ) } \right) , \quad u _ { j } ^ { ( l ) } \sim q , \quad l = 0 , \ldots , M - 1 .
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
The major difference between (5) and (10) is that the former obtains samples uniformly whereas the latter according to $q$ . Accordingly, the scaling inside the summation changes. The corresponding batch gradient may be straightforwardly obtained through applying the chain rule on each $\bar { H } ^ { ( l ) }$ . See Algorithm 2.
|
| 216 |
+
|
| 217 |
+
# Algorithm 2 FastGCN batched training (one epoch), improved version
|
| 218 |
+
|
| 219 |
+
1: For each vertex $u$ , compute sampling probability $q ( u ) \propto \lVert \hat { A } ( : , u ) \rVert ^ { 2 }$
|
| 220 |
+
2: for each batch do For each layer l, sample tl vertices u(l)1 , . $u _ { 1 } ^ { ( l ) } , \ldots , u _ { t _ { l } } ^ { ( l ) }$ according to distribution $q$
|
| 221 |
+
4: . Compute batch gradient $\nabla L _ { \mathrm { b a t c h } }$
|
| 222 |
+
5: If $v$ is sampled in the next layer,
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
\nabla \tilde { H } ^ { ( l + 1 ) } ( v , : ) \gets \frac { 1 } { t _ { l } } \sum _ { j = 1 } ^ { t _ { l } } \frac { \hat { A } ( v , u _ { j } ^ { ( l ) } ) } { q ( u _ { j } ^ { ( l ) } ) } \nabla \Big \{ H ^ { ( l ) } ( u _ { j } ^ { ( l ) } , : ) W ^ { ( l ) } \Big \}
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
. SGD step
|
| 229 |
+
|
| 230 |
+
# 3.2 INFERENCE
|
| 231 |
+
|
| 232 |
+
The sampling approach described in the preceding subsection clearly separates out test data from training. Such an approach is inductive, as opposed to transductive that is common for many graph algorithms. The essence is to cast the set of graph vertices as iid samples of a probability distribution, so that the learning algorithm may use the gradient of a consistent estimator of the loss to perform parameter update. Then, for inference, the embedding of a new vertex may be either computed by using the full GCN architecture (1), or approximated through sampling as is done in parameter learning. Generally, using the full architecture is more straightforward and easier to implement.
|
| 233 |
+
|
| 234 |
+
# 3.3 COMPARISON WITH GRAPHSAGE
|
| 235 |
+
|
| 236 |
+
GraphSAGE (Hamilton et al., 2017) is a newly proposed architecture for generating vertex embeddings through aggregating neighborhood information. It shares the same memory bottleneck with GCN, caused by recursive neighborhood expansion. To reduce the computational footprint, the authors propose restricting the immediate neighborhood size for each layer. Using our notation for the sample size, if one samples $t _ { l }$ neighbors for each vertex in the lth layer, then the size of the expanded neighborhood is, in the worst case, the product of the $t _ { l }$ ’s. On the other hand, FastGCN samples vertices rather than neighbors in each layer. Then, the total number of involved vertices is at most the sum of the $t _ { l }$ ’s, rather than the product. See experimental results in Section 4 for the order-of-magnitude saving in actual computation time.
|
| 237 |
+
|
| 238 |
+
# 4 EXPERIMENTS
|
| 239 |
+
|
| 240 |
+
We follow the experiment setup in Kipf & Welling (2016a) and Hamilton et al. (2017) to demonstrate the effective use of FastGCN, comparing with the original GCN model as well as GraphSAGE, on the following benchmark tasks: (1) classifying research topics using the Cora citation data set (McCallum et al., 2000); (2) categorizing academic papers with the Pubmed database; and (3) predicting the community structure of a social network modeled with Reddit posts. These data sets are downloaded from the accompany websites of the aforementioned references. The graphs have increasingly more nodes and higher node degrees, representative of the large and dense setting under which our method is motivated. Statistics are summarized in Table 1. We adjusted the training/validation/test split of Cora and Pubmed to align with the supervised learning scenario. Specifically, all labels of the training examples are used for training, as opposed to only a small portion in the semi-supervised setting (Kipf & Welling, 2016a). Such a split is coherent with that of the other data set, Reddit, used in the work of GraphSAGE. Additional experiments using the original split of Cora and Pubmed are reported in the appendix.
|
| 241 |
+
|
| 242 |
+
Table 1: Dataset Statistics
|
| 243 |
+
|
| 244 |
+
<table><tr><td>Dataset</td><td>Nodes</td><td>Edges</td><td>Classes</td><td>Features</td><td>Training/Validation/Test</td></tr><tr><td>Cora</td><td>2,708</td><td>5,429</td><td>7</td><td>1,433</td><td>1,208/500/1,000</td></tr><tr><td>Pubmed</td><td>19,717</td><td>44,338</td><td>3</td><td>500</td><td>18,217/500/1,000</td></tr><tr><td>Reddit</td><td>232,965</td><td>11,606,919</td><td>41</td><td>602</td><td>152,410/23,699/55,334</td></tr></table>
|
| 245 |
+
|
| 246 |
+
Implementation details are as following. All networks (including those under comparison) contain two layers as usual. The codes of GraphSAGE and GCN are downloaded from the accompany websites and the latter is adapted for FastGCN. Inference with FastGCN is done with the full GCN network, as mentioned in Section 3.2. Further details are contained in the appendix.
|
| 247 |
+
|
| 248 |
+
We first consider the use of sampling in FastGCN. The left part of Table 2 (columns under “Sampling”) lists the time and classification accuracy as the number of samples increases. For illustration purpose, we equalize the sample size on both layers. Clearly, with more samples, the per-epoch training time increases, but the accuracy (as measured by using micro F1 scores) also improves generally.
|
| 249 |
+
|
| 250 |
+
An interesting observation is that given input features $H ^ { ( 0 ) }$ , the product $\hat { A } H ^ { ( 0 ) }$ in the bottom layer does not change, which means that the chained expansion of the gradient with respect to $W ^ { ( 0 ) }$ in the last step is a constant throughout training. Hence, one may precompute the product rather than sampling this layer to gain efficiency. The compared results are listed on the right part of Table 2 (columns under “Precompute”). One sees that the training time substantially decreases while the accuracy is comparable. Hence, all the experiments that follow use precomputation.
|
| 251 |
+
|
| 252 |
+
Table 2: Benefit of precomputing $\hat { A } H ^ { ( 0 ) }$ for the input layer. Data set: Pubmed. Training time is in seconds, per-epoch (batch size 1024). Accuracy is measured by using micro F1 score.
|
| 253 |
+
|
| 254 |
+
<table><tr><td colspan="2">Sampling</td><td rowspan="2">F1</td><td rowspan="2">Precompute Time F1</td></tr><tr><td>t1</td><td>Time</td></tr><tr><td>5</td><td>0.737</td><td>0.859</td><td>0.139 0.849</td></tr><tr><td>10</td><td>0.755</td><td>0.863</td><td>0.141 0.870</td></tr><tr><td>25</td><td>0.760</td><td>0.873</td><td>0.144 0.879</td></tr><tr><td>50</td><td>0.774</td><td>0.864</td><td>0.142 0.880</td></tr></table>
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure 2: Prediction accuracy: uniform versus importance sampling. The three data sets from top to bottom are ordered the same as Table 1.
|
| 258 |
+
|
| 259 |
+
Next, we compare the sampling approaches for FastGCN: uniform and importance sampling. Figure 2 summarizes the prediction accuracy under both approaches. It shows that importance sampling consistently yields higher accuracy than does uniform sampling. Since the altered sampling distribution (see Proposition 4 and Algorithm 2) is a compromise alternative of the optimal distribution that is impractical to use, this result suggests that the variance of the used sampling indeed is smaller than that of uniform sampling; i.e., the term (9) stays closer to (8) than does (6). A possible reason is that $b ( u )$ correlates with $| x ( u ) |$ . Hence, later experiments will apply importance sampling.
|
| 260 |
+
|
| 261 |
+
We now demonstrate that the proposed method is significantly faster than the original GCN as well as GraphSAGE, while maintaining comparable prediction performance. See Figure 3. The bar heights indicate the per-batch training time, in the log scale. One sees that GraphSAGE is a substantial improvement of GCN for large and dense graphs (e.g., Reddit), although for smaller ones (Cora and Pubmed), GCN trains faster. FastGCN is the fastest, with at least an order of magnitude improvement compared with the runner up (except for Cora), and approximately two orders of magnitude speed up compared with the slowest. Here, the training time of FastGCN is with respect to the sample size that achieves the best prediction accuracy. As seen from the table on the right, this accuracy is highly comparable with the best of the other two methods.
|
| 262 |
+
|
| 263 |
+
<table><tr><td colspan="3">Micro F1 Score</td></tr><tr><td>Cora</td><td>Pubmed</td><td>Reddit</td></tr><tr><td>FastGCN</td><td>0.850 0.880</td><td>0.937</td></tr><tr><td>GraphSAGE-GCN</td><td>0.829 0.849</td><td>0.923</td></tr><tr><td>GraphSAGE-mean</td><td>0.822 0.888</td><td>0.946</td></tr><tr><td>GCN (batched)</td><td>0.851 0.867</td><td>0.930</td></tr><tr><td>GCN (original)</td><td>0.865 0.875</td><td>NA</td></tr></table>
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 3: Per-batch training time in seconds (left) and prediction accuracy (right). For timing, GraphSAGE refers to GraphSAGE-GCN in Hamilton et al. (2017). The timings of using other aggregators, such as GraphSAGE-mean, are similar. GCN refers to using batched learning, as opposed to the original version that is nonbatched; for more details of the implementation, see the appendix. The nonbatched version of GCN runs out of memory on the large graph Reddit. The sample sizes for FastGCN are 400, 100, and 400, respectively for the three data sets.
|
| 267 |
+
|
| 268 |
+
In the discussion period, the authors of GraphSAGE offered an improved implementation of their codes and alerted that GraphSAGE was better suited for massive graphs. The reason is that for small graphs, the sample size (recalling that it is the product across layers) is comparable to the graph size and hence improvement is marginal; moreover, sampling overhead might then adversely affect the timing. For fair comparison, the authors of GraphSAGE kept the sampling strategy but improved the implementation of their original codes by eliminating redundant calculations of the sampled nodes. Now the per-batch training time of GraphSAGE compares more favorably on the smallest graph Cora; see Table 3. Note that this implementation does not affect large graphs (e.g., Reddit) and our observation of orders of magnitude faster training remains valid.
|
| 269 |
+
|
| 270 |
+
Table 3: Further comparison of per-batch training time (in seconds) with new implementation of GraphSAGE for small graphs. The new implementation is in PyTorch whereas the rest are in TensorFlow.
|
| 271 |
+
|
| 272 |
+
<table><tr><td></td><td>Cora</td><td>Pubmed</td><td>Reddit</td></tr><tr><td>FastGCN</td><td>0.0084</td><td>0.0047</td><td>0.0129</td></tr><tr><td>GraphSAGE-GCN (old impl)</td><td>1.1630</td><td>0.3579</td><td>0.4260</td></tr><tr><td>GraphSAGE-GCN (new impl)</td><td>0.0380</td><td>0.3989</td><td>NA</td></tr><tr><td>GCN (batched)</td><td>0.0166</td><td>0.0815</td><td>2.1731</td></tr></table>
|
| 273 |
+
|
| 274 |
+
# 5 CONCLUSIONS
|
| 275 |
+
|
| 276 |
+
We have presented FastGCN, a fast improvement of the GCN model recently proposed by Kipf & Welling (2016a) for learning graph embeddings. It generalizes transductive training to an inductive manner and also addresses the memory bottleneck issue of GCN caused by recursive expansion of neighborhoods. The crucial ingredient is a sampling scheme in the reformulation of the loss and the gradient, well justified through an alternative view of graph convoluntions in the form of integral transforms of embedding functions. We have compared the proposed method with additionally GraphSAGE (Hamilton et al., 2017), a newly published work that also proposes using sampling to restrict the neighborhood size, although the two sampling schemes substantially differ in both algorithm and cost. Experimental results indicate that our approach is orders of magnitude faster than GCN and GraphSAGE, while maintaining highly comparable prediction performance with the two.
|
| 277 |
+
|
| 278 |
+
The simplicity of the GCN architecture allows for a natural interpretation of graph convolutions in terms of integral transforms. Such a view, yet, generalizes to many graph models whose formulations are based on first-order neighborhoods, examples of which include MoNet that applies to (meshed) manifolds (Monti et al., 2017), as well as many message-passing neural networks (see e.g., Scarselli et al. (2009); Gilmer et al. (2017)). The proposed work elucidates the basic Monte Carlo ingredients for consistently estimating the integrals. When generalizing to other networks aforementioned, an additional effort is to investigate whether and how variance reduction may improve the estimator, a possibly rewarding avenue of future research.
|
| 279 |
+
|
| 280 |
+
# REFERENCES
|
| 281 |
+
|
| 282 |
+
Amr Ahmed, Nino Shervashidze, Shravan Narayanamurthy, Vanja Josifovski, and Alexander J. Smola. Distributed large-scale natural graph factorization. In Proceedings of the 22Nd International Conference on World Wide Web, WWW ’13, pp. 37–48, 2013. ISBN 978-1-4503-2035-1.
|
| 283 |
+
Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In Proceedings of the 14th International Conference on Neural Information Processing Systems: Natural and Synthetic, NIPS’01, pp. 585–591, 2001.
|
| 284 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. CoRR, abs/1312.6203, 2013.
|
| 285 |
+
Shaosheng Cao, Wei Lu, and Qiongkai Xu. Grarep: Learning graph representations with global structural information. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, CIKM ’15, pp. 891–900, 2015. ISBN 978-1-4503-3794-6.
|
| 286 |
+
|
| 287 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. CoRR, abs/1606.09375, 2016.
|
| 288 |
+
|
| 289 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2224–2232. Curran Associates, Inc., 2015.
|
| 290 |
+
|
| 291 |
+
J. Gilmer, S.S. Schoenholz, P.F. Riley, O. Vinyals, and G.E. Dahl. Neural message passing for quantum chemistry. In ICML, 2017.
|
| 292 |
+
|
| 293 |
+
Palash Goyal and Emilio Ferrara. Graph embedding techniques, applications, and performance: A survey. CoRR, abs/1705.02801, 2017.
|
| 294 |
+
|
| 295 |
+
Aditya Grover and Jure Leskovec. Node2vec: Scalable feature learning for networks. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 855–864, 2016. ISBN 978-1-4503-4232-2.
|
| 296 |
+
|
| 297 |
+
William L. Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. CoRR, abs/1706.02216, 2017.
|
| 298 |
+
|
| 299 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. CoRR, abs/1506.05163, 2015.
|
| 300 |
+
|
| 301 |
+
Ashesh Jain, Amir Roshan Zamir, Silvio Savarese, and Ashutosh Saxena. Structural-rnn: Deep learning on spatio-temporal graphs. CoRR, abs/1511.05298, 2015.
|
| 302 |
+
|
| 303 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. CoRR, abs/1609.02907, 2016a.
|
| 304 |
+
|
| 305 |
+
TN. Kipf and M. Welling. Variational graph auto-encoders. In NIPS Workshop on Bayesian Deep Learning. 2016b.
|
| 306 |
+
|
| 307 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard S. Zemel. Gated graph sequence neural networks. CoRR, abs/1511.05493, 2015.
|
| 308 |
+
|
| 309 |
+
Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. Automating the construction of internet portals with machine learning. Inf. Retr., 3(2):127–163, July 2000. ISSN 1386-4564.
|
| 310 |
+
|
| 311 |
+
F. Monti, D. Boscaini, J. Masci, E. Rodala, J. Svoboda, and M.M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model CNNs. In CVPR, 2017.
|
| 312 |
+
|
| 313 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. CoRR, abs/1605.05273, 2016.
|
| 314 |
+
|
| 315 |
+
Mingdong Ou, Peng Cui, Jian Pei, Ziwei Zhang, and Wenwu Zhu. Asymmetric transitivity preserving graph embedding. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 1105–1114, 2016. ISBN 978-1-4503- 4232-2.
|
| 316 |
+
|
| 317 |
+
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, KDD ’14, pp. 701–710, 2014. ISBN 978-1-4503-2956-9.
|
| 318 |
+
|
| 319 |
+
Sam T. Roweis and Lawrence K. Saul. Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500):2323–2326, 2000. ISSN 0036-8075. doi: 10.1126/science.290.5500. 2323.
|
| 320 |
+
|
| 321 |
+
F. Scarselli, M. Gori, A.C. Tsoi, M. Hagenbuchner, and G. Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20, 2009.
|
| 322 |
+
|
| 323 |
+
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th International Conference on World Wide Web, WWW ’15, pp. 1067–1077, 2015. ISBN 978-1-4503-3469-3.
|
| 324 |
+
|
| 325 |
+
Daixin Wang, Peng Cui, and Wenwu Zhu. Structural deep network embedding. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 1225–1234, 2016. ISBN 978-1-4503-4232-2.
|
| 326 |
+
|
| 327 |
+
# A PROOFS
|
| 328 |
+
|
| 329 |
+
Proof of Theorem 1. Because the samples $u _ { j } ^ { ( 0 ) }$ are iid, by the strong law of large numbers,
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\tilde { h } _ { t _ { 1 } } ^ { ( 1 ) } ( v ) = \frac { 1 } { t _ { 0 } } \sum _ { j = 1 } ^ { t _ { 0 } } \hat { A } ( v , u _ { j } ^ { ( 0 ) } ) h ^ { ( 0 ) } ( u _ { j } ^ { ( 0 ) } ) W ^ { ( 0 ) }
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
converges almost surely to $\tilde { h } ^ { ( 1 ) } ( v )$ . Then, because the activation function $\sigma$ is continuous, the continuous mapping theorem implies that $h _ { t _ { 1 } } ^ { ( 1 ) } ( v ) \ = \ \sigma ( \tilde { h } _ { t _ { 1 } } ^ { ( 1 ) } ( v ) )$ converges almost surely to $h ^ { ( 1 ) } ( v ) = \sigma ( \tilde { h } ^ { ( 1 ) } ( v ) )$ . Thus, $\begin{array} { r } { \int \hat { A } ( v , u ) h _ { t _ { 1 } } ^ { ( 1 ) } ( u ) W ^ { ( 1 ) } d P ( u ) } \end{array}$ converges almost surely to $\tilde { h } ^ { ( 2 ) } ( v ) =$ $\begin{array} { r } { \int \hat { A } ( v , u ) h ^ { ( 1 ) } ( u ) W ^ { ( 1 ) } d P ( u ) } \end{array}$ , where note that the probability space is with respect to the 0th layer and hence has nothing to do with that of the variable $u$ or $v$ in this statement. Similarly,
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\tilde { h } _ { t _ { 2 } } ^ { ( 2 ) } ( v ) = \frac { 1 } { t _ { 1 } } \sum _ { j = 1 } ^ { t _ { 1 } } \hat { A } ( v , u _ { j } ^ { ( 1 ) } ) h _ { t _ { 1 } } ^ { ( 1 ) } ( u _ { j } ^ { ( 1 ) } ) W ^ { ( 1 ) }
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
converges almost surely to $\begin{array} { r } { \int \hat { A } ( v , u ) h _ { t _ { 1 } } ^ { ( 1 ) } ( u ) W ^ { ( 1 ) } d P ( u ) } \end{array}$ and thus to $\tilde { h } ^ { ( 2 ) } ( v )$ . A simple induction completes the rest of the proof.
|
| 342 |
+
|
| 343 |
+
Proof of Proposition 2. Conditioned on $v$ , the expectation of $y ( v )$ is
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\operatorname { E } [ y ( v ) | v ] = \int { \hat { A } } ( v , u ) x ( u ) d P ( u ) = e ( v ) ,
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
and the variance is $1 / t$ times that of $\hat { A } ( v , u ) x ( u )$ , i.e.,
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\mathrm { V a r } \{ y ( v ) | v \} = \frac { 1 } { t } \left( \int \hat { A } ( v , u ) ^ { 2 } x ( u ) ^ { 2 } d P ( u ) - e ( v ) ^ { 2 } \right) .
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Instantiating (11) and (12) with iid samples $v _ { 1 } , \ldots , v _ { s } \sim P$ and taking variance and expectation in the front, respectively, we obtain
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\left\{ \mathop { \mathrm { A r } } \left\{ \left[ \frac { 1 } { s } \sum _ { i = 1 } ^ { s } y ( v _ { i } ) \right] v _ { 1 } , \ldots , v _ { s } \right\} \right\} = \mathop { \mathrm { V a r } } \left\{ \frac { 1 } { s } \sum _ { i = 1 } ^ { s } e ( v _ { i } ) \right\} = \frac { 1 } { s } \int e ( v ) ^ { 2 } d P ( v ) - \frac { 1 } { s } \left( \int e ( v ) d P ( v ) \right) =
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
and
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\mathbb { E } \left[ \mathrm { V a r } \left\{ \frac { 1 } { s } \sum _ { i = 1 } ^ { s } y ( v _ { i } ) \Bigg | v _ { 1 } , \dots , v _ { s } \right\} \right] = \frac { 1 } { s t } \iint \hat { A } ( v , u ) ^ { 2 } x ( u ) ^ { 2 } d P ( u ) d P ( v ) - \frac { 1 } { s t } \int e ( v ) ^ { 2 } d P ( v ) .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Then, applying the law of total variance
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\operatorname { a r } \{ { \frac { 1 } { s } } \sum _ { i = 1 } ^ { s } y ( v _ { i } ) \} = \operatorname { V a r } \{ \operatorname { E } [ { \frac { 1 } { s } } \sum _ { i = 1 } ^ { s } y ( v _ { i } ) | v _ { 1 } , \ldots , v _ { s } ] \} + \operatorname { E } [ \operatorname { V a r } \{ { \frac { 1 } { s } } \sum _ { i = 1 } ^ { s } y ( v _ { i } ) { \Bigg | } v _ { 1 } , \ldots , v _ { s } \} ] ,
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
we conclude the proof.
|
| 374 |
+
|
| 375 |
+
Proof of Theorem 3. Conditioned on $v$ , the variance of $y _ { Q } ( v )$ is $1 / t$ times that of
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
{ \hat { A } } ( v , u ) x ( u ) { \frac { d P ( u ) } { d Q ( u ) } } \quad ( { \mathrm { w h e r e ~ } } u \sim Q ) ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
i.e.,
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\mathrm { V a r } \{ y _ { Q } ( v ) | v \} = \frac { 1 } { t } \left( \int \frac { \hat { A } ( v , u ) ^ { 2 } { x } ( u ) ^ { 2 } d P ( u ) ^ { 2 } } { d Q ( u ) } - e ( v ) ^ { 2 } \right) .
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Then, following the proof of Proposition 2, the overall variance is
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\mathrm { V a r } \{ G _ { Q } \} = R + \frac { 1 } { s t } \iint \frac { \hat { A } ( v , u ) ^ { 2 } x ( u ) ^ { 2 } d P ( u ) ^ { 2 } d P ( v ) } { d Q ( u ) } = R + \frac { 1 } { s t } \int \frac { b ( u ) ^ { 2 } x ( u ) ^ { 2 } d P ( u ) ^ { 2 } } { d Q ( u ) } .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Hence, the optimal $d Q ( u )$ must be proportional to $b ( u ) | x ( u ) | d P ( u )$ . Because it also must integrate to unity, we have
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
d Q ( u ) = \frac { b ( u ) | x ( u ) | d P ( u ) } { \int b ( u ) | x ( u ) | d P ( u ) } ,
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
in which case
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\mathrm { V a r } \{ G _ { Q } \} = R + { \frac { 1 } { s t } } \left[ \int b ( u ) | x ( u ) | d P ( u ) \right] ^ { 2 } .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Proof of Proposition 4. Conditioned on $v$ , the variance of $y _ { Q } ( v )$ is $1 / t$ times that of
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\hat { A } ( v , u ) x ( u ) \frac { d P ( u ) } { d Q ( u ) } = \frac { \hat { A } ( v , u ) \mathrm { s g n } ( x ( u ) ) } { b ( u ) } \int b ( u ) | x ( u ) | d P ( u ) ,
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
i.e.,
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\mathrm { V a r } \{ y _ { Q } ( v ) | v \} = \frac { 1 } { t } \left( \left[ \int b ( u ) | x ( u ) | d P ( u ) \right] ^ { 2 } \int \frac { \hat { A } ( v , u ) ^ { 2 } } { b ( u ) ^ { 2 } } d Q ( u ) - e ( v ) ^ { 2 } \right) .
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
The rest of the proof follows that of Proposition 2.
|
| 418 |
+
|
| 419 |
+
# B ADDITIONAL EXPERIMENT DETAILS
|
| 420 |
+
|
| 421 |
+
# B.1 BASELINES
|
| 422 |
+
|
| 423 |
+
GCN: The original GCN cannot work on very large graphs (e.g., Reddit). So we modified it into a batched version by simply removing the sampling in our FastGCN (i.e., using all the nodes instead of sampling a few in each batch). For relatively small graphs (Cora and Pubmed), we also compared the results with the original GCN.
|
| 424 |
+
|
| 425 |
+
GraphSAGE: For training time comparison, we use GraphSAGE-GCN that employs GCN as the aggregator. It is also the fastest version among all choices of the aggregators. For accuracy comparison, we also compared with GraphSAGE-mean. We used the codes from https: //github.com/williamleif/GraphSAGE. Following the setting of Hamilton et al. (2017), we use two layers with neighborhood sample sizes $S _ { 1 } = 2 5$ and $S _ { 2 } = 1 0$ . For fair comparison with our method, the batch size is set to be the same as FastGCN, and the hidden dimension is 128.
|
| 426 |
+
|
| 427 |
+
# B.2 EXPERIMENT SETUP
|
| 428 |
+
|
| 429 |
+
Datasets: The Cora and Pubmed data sets are from https://github.com/tkipf/gcn. As we explained in the paper, we kept the validation index and test index unchanged but changed the training index to use all the remaining nodes in the graph. The Reddit data is from http: //snap.stanford.edu/graphsage/.
|
| 430 |
+
|
| 431 |
+
Experiment Setting: We preformed hyperparameter selection for the learning rate and model dimension. We swept learning rate in the set $\left. 0 . 0 1 , 0 . 0 0 1 , 0 . 0 0 0 1 \right.$ . The hidden dimension of FastGCN for Reddit is set as 128, and for the other two data sets, it is 16. The batch size is 256 for Cora and Reddit, and 1024 for Pubmed. Dropout rate is set as 0. We use Adam as the optimization method for training. In the test phase, we use the trained parameters and all the graph nodes instead of sampling. For more details please check our codes in a temporary git repository https://github.com/matenure/FastGCN.
|
| 432 |
+
|
| 433 |
+
Hardware: Running time is compared on a single machine with 4-core 2.5 GHz Intel Core i7, and 16G RAM.
|
| 434 |
+
|
| 435 |
+
# C ADDITIONAL EXPERIMENTS
|
| 436 |
+
|
| 437 |
+
C.1 TRAINING TIME COMPARISON
|
| 438 |
+
|
| 439 |
+
Figure 3 in the main text compares the per-batch training time for different methods. Here, we list the total training time for reference. It is impacted by the convergence of SGD, whose contributing factors include learning rate, batch size, and sample size. See Table 4. Although the orders-ofmagnitude speedup of per-batch time is slightly weakened by the convergence speed, one still sees a substantial advantage of the proposed method in the overall training time. Note that even though the original GCN trains faster than the batched version, it does not scale because of memory limitation. Hence, a fair comparison should be gauged with the batched version. We additionally show in Figure 4 the evolution of prediction accuracy as training progresses.
|
| 440 |
+
|
| 441 |
+
Table 4: Total training time (in seconds).
|
| 442 |
+
|
| 443 |
+
<table><tr><td></td><td>Cora</td><td>Pubmed</td><td>Reddit</td></tr><tr><td>FastGCN</td><td>2.7</td><td>15.5</td><td>638.6</td></tr><tr><td>GraphSAGE-GCN</td><td>72.4</td><td>259.6</td><td>3318.5</td></tr><tr><td>GCN (batched)</td><td>6.9</td><td>210.8</td><td>58346.6</td></tr><tr><td>GCN (original)</td><td>1.7</td><td>21.4</td><td>NA</td></tr></table>
|
| 444 |
+
|
| 445 |
+

|
| 446 |
+
Figure 4: Training/test accuracy versus training time. From left to right, the data sets are Cora, Pubmed, and Reddit, respectively.
|
| 447 |
+
|
| 448 |
+
# C.2 ORIGINAL DATA SPLIT FOR CORA AND PUBMED
|
| 449 |
+
|
| 450 |
+
As explained in Section 4, we increased the number of labels used for training in Cora and Pubmed, to align with the supervised learning setting of Reddit. For reference, here we present results by using the original data split with substantially fewer training labels. We also fork a separate version of FastGCN, called FastGCN-transductive, that uses both training and test data for learning. See Table 5.
|
| 451 |
+
|
| 452 |
+
The results for GCN are consistent with those reported by Kipf & Welling (2016a). Because labeled data are scarce, the training of GCN is quite fast. FastGCN beats it only on Pubmed. The accuracy results of FastGCN are inferior to GCN, also because of the limited number of training labels. The transductive version FastGCN-transductive matches the accuracy of that of GCN. The results for GraphSAGE are curious. We suspect that the model significantly overfits the data, because perfect training accuracy (i.e., 1) is attained.
|
| 453 |
+
|
| 454 |
+
One may note a subtlety that the training of GCN (original) is slower than what is reported in Table 4, even though fewer labels are used here. The reason is that we adopt the same hyperparameters as in Kipf & Welling (2016a) to reproduce the F1 scores of their work, whereas for Table 4, a better learning rate is found that boosts the performance on the new split of the data, in which case GCN (original) converges faster.
|
| 455 |
+
|
| 456 |
+
Table 5: Total training time and test accuracy for Cora and Pubmed, original data split. Time is in seconds.
|
| 457 |
+
|
| 458 |
+
<table><tr><td></td><td colspan="2">Cora</td><td colspan="2">Pubmed</td></tr><tr><td></td><td>Time</td><td>F1</td><td>Time</td><td>F1</td></tr><tr><td>FastGCN</td><td>2.52</td><td>0.723</td><td>0.97</td><td>0.721</td></tr><tr><td>FastGCN-transductive</td><td>5.88</td><td>0.818</td><td>8.97</td><td>0.776</td></tr><tr><td>GraphSAGE-GCN</td><td>107.95</td><td>0.334</td><td>39.34</td><td>0.386</td></tr><tr><td>GCN (original)</td><td>2.18</td><td>0.814</td><td>32.65</td><td>0.795</td></tr></table>
|
| 459 |
+
|
| 460 |
+
# D CONVERGENCE
|
| 461 |
+
|
| 462 |
+
Strictly speaking, the training algorithms proposed in Section 3 do not precisely follow the existing theory of SGD, because the gradient estimator, though consistent, is biased. In this section, we fill the gap by deriving a convergence result. Similar to the case of standard SGD where the convergence rate depends on the properties of the objective function, here we analyze only a simple case; a comprehensive treatment is out of the scope of the present work. For convenience, we will need a separate system of notations and the same notations appearing in the main text may bear a different meaning here. We abbreviate “with probability one” to “w.p.1” for short.
|
| 463 |
+
|
| 464 |
+
We use $f ( x )$ to denote the objective function and assume that it is differentiable. Differentiability is not a restriction because for the nondifferentiable case, the analysis that follows needs simply change the gradient to the subgradient. The key assumption made on $f$ is that it is $l$ -strictly convex; that is, there exists a positive real number $l$ such that
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
f ( x ) - f ( y ) \geq \langle \nabla f ( y ) , x - y \rangle + { \frac { l } { 2 } } \| x - y \| ^ { 2 } ,
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
for all $x$ and $y$ . We use $g$ to denote the gradient estimator. Specifically, denote by $g ( x ; \xi _ { N } )$ , with $\xi _ { N }$ being a random variable, a strongly consistent estimator of $\nabla f ( x )$ ; that is,
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\operatorname* { l i m } _ { N \to \infty } g ( x ; \xi _ { N } ) = \nabla f ( x ) \quad { \mathrm { w . p . 1 } } .
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
Moreover, we consider the SGD update rule
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
x _ { k + 1 } = x _ { k } - \gamma _ { k } \ g ( x _ { k } ; \xi _ { N } ^ { ( k ) } ) ,
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
where (k) is an indepedent sample of $\xi _ { N }$ for the $k$ th update. The following result states that the update converges on the order of $O ( 1 / k )$ .
|
| 483 |
+
|
| 484 |
+
Theorem 5. Let $x ^ { * }$ be the (global) minimum of $f$ and assume that $\| \nabla f ( x ) \|$ is uniformly bounded by some constant $G > 0$ . $I f \gamma _ { k } = ( l k ) ^ { - 1 }$ , then there exists a sequence $B _ { k }$ with
|
| 485 |
+
|
| 486 |
+
$$
|
| 487 |
+
B _ { k } \leq \frac { \operatorname* { m a x } \{ \| x _ { 1 } - x ^ { * } \| ^ { 2 } , ~ G ^ { 2 } / l ^ { 2 } \} } { k }
|
| 488 |
+
$$
|
| 489 |
+
|
| 490 |
+
such that $\| x _ { k } - x ^ { * } \| ^ { 2 } \to B _ { k }$ w.p.1.
|
| 491 |
+
|
| 492 |
+
Proof. Expanding $\| x _ { k + 1 } - x ^ { * } \| ^ { 2 }$ by using the update rule (14), we obtain
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\| x _ { k + 1 } - x ^ { * } \| ^ { 2 } = \| x _ { k } - x ^ { * } \| ^ { 2 } - 2 \gamma _ { k } \langle g _ { k } , x _ { k } - x ^ { * } \rangle + \gamma _ { k } ^ { 2 } \| g _ { k } \| ^ { 2 } ,
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
where $g _ { k } \equiv g ( x _ { k } ; \xi _ { N } ^ { ( k ) } )$ . Because for a given $x _ { k } , \textrm { } g _ { k }$ converges to $\nabla f ( x _ { k } )$ w.p.1, we have that conditioned on $x _ { k }$ ,
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\| x _ { k + 1 } - x ^ { * } \| ^ { 2 } \to \| x _ { k } - x ^ { * } \| ^ { 2 } - 2 \gamma _ { k } \langle \nabla f ( x _ { k } ) , x _ { k } - x ^ { * } \rangle + \gamma _ { k } ^ { 2 } \| \nabla f ( x _ { k } ) \| ^ { 2 } \quad \mathrm { w . p . 1 } .
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
On the other hand, applying the strict convexity (13), by first taking $x = x _ { k } , y = x ^ { * }$ and then taking $x = x ^ { * } , y = x _ { k }$ , we obtain
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
\langle \nabla f ( x _ { k } ) , x _ { k } - x ^ { * } \rangle \geq l \| x _ { k } - x ^ { * } \| ^ { 2 } .
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
Substituting (16) to (15), we have that conditioned on $x _ { k }$ ,
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\| x _ { k + 1 } - x ^ { * } \| ^ { 2 } \to C _ { k } \quad { \mathrm { w . p . 1 } }
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
for some
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array} { r } { C _ { k } \leq ( 1 - 2 l \gamma _ { k } ) \| x _ { k } - x ^ { * } \| ^ { 2 } + \gamma _ { k } ^ { 2 } G ^ { 2 } = ( 1 - 2 / k ) \| x _ { k } - x ^ { * } \| ^ { 2 } + G ^ { 2 } / ( l ^ { 2 } k ^ { 2 } ) . } \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
Now consider the randomness of $x _ { k }$ and apply induction. For the base case $k = 2$ , the theorem clearly holds with $B _ { 2 } = C _ { 1 }$ . If the theorem holds for $k = T$ , let $L = \operatorname* { m a x } \{ \| x _ { 1 } - x ^ { * } \| ^ { 2 } , \ G ^ { 2 } / l ^ { 2 } \}$ . Then, taking the probabilistic limit of $x _ { T }$ on both sides of (17), we have that $C _ { T }$ converges w.p.1 to some limit that is less than or equal to $( 1 - 2 / T ) ( L / T ) + G ^ { 2 } / ( l ^ { 2 } T ^ { 2 } ) \leq L / ( T + 1 )$ . Letting this limit be $B _ { T + 1 }$ , we complete the induction proof. □
|