paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
A Generalized Weighted Optimization Method for Computational Learning and Inversion
1 INTRODUCTION . Given N data pairs { xj , yj } Nj=1 , where xj ∈ R , yj ∈ C , j = 1 , . . . , N , we are interested in learning a random Fourier feature ( RFF ) model ( Rahimi & Recht , 2008 ; Liao et al. , 2020 ; Xie et al. , 2020 ) fθ ( x ) = P−1∑ k=0 θke ikx , x ∈ [ 0 , 2π ] , ( 1 ) where P ∈ N is a given positive integer and we used the short-hand notation θ : = ( θ0 , · · · , θP−1 ) T with the superscript T denoting the transpose operation . This exact model as well as its generalization to more complicated setups have been extensively studied ; see for instance Liao & Couillet ( 2018 ) ; Shahrampour & Kolouri ( 2019 ) ; d ’ Ascoli et al . ( 2020 ) ; Li et al . ( 2020 ) ; Özcelikkale ( 2020 ) ; Liu et al . ( 2020 ; 2021 ) and references therein . While this model may seem to be overly simplified from a practical perspective for many real-world applications , it serves as a prototype for theoretical understandings of different phenomena in machine learning models ( Sriperumbudur & Szabo , 2015 ; Belkin et al. , 2020 ; Li et al. , 2021a ) . A common way to computationally solve this learning problem is to reformulate it as an optimization problem where we find θ by minimizing the model and data mismatch for a given dataset . In this paper , we assume that the training data are collected on a uniform grid of x over the domain [ 0 , 2π ] . That is , { xj = 2πjN } N−1 j=0 . Let ωN = exp ( 2πi N ) where i is the imaginary unit . We introduce Ψ ∈ CN×P to be the feature matrix with elements ( Ψ ) jk = ( ωN ) jk , 0 ≤ j ≤ N − 1 , 0 ≤ k ≤ P − 1 . Based on the form of fθ ( x ) in ( 1 ) , we can then write the 2-norm based data mismatch into the form∑N−1 j=0 |fθ ( xj ) − yj |2 = ‖Ψθ − y‖22 where the column data vector y = ( y0 , · · · , yN−1 ) T. The learning problem is therefore recast as a least-squares optimization problem of the form θ̂ = arg min θ ‖Ψθ − y‖22 , ( 2 ) assuming that a minimizer does exist , especially when we restrict θ to an appropriate space . In a general feature regression problem , the Fourier feature { eikx } P−1k=0 is then replaced with a different feature model { ϕk ( x ) } P−1k=0 , while the least-squares form ( 2 ) remains unchanged except that the entries of the matrix Ψ is now Ψjk = ϕk ( xj ) . We emphasize that this type of generalization will be discussed in Section 5 . Moreover , we remark that this least-squares optimization formulation is a classical computational inversion tool in solving the general linear inverse problems of the form Ψθ = y ; see for instance Engl et al . ( 1996 ) ; Tarantola ( 2005 ) and references therein . Previous work on weighted optimization for feature and kernel learning . Xie et al . ( 2020 ) studied the fitting problem for this model under the assumption that the coefficient vector θ is sampled from a distribution with the property that γ is a positive constant , Eθ [ θ ] = 0 , Eθ [ θθ∗ ] = cγΛ−2γ [ P ] , ( 3 ) where the superscript ∗ denotes the Hermitian transpose and the diagonal matrix Λ [ P ] has diagonal elements ( Λ [ P ] ) kk = tk = 1 + k , k ≥ 0 . That is , Λ [ P ] = diag { t0 , t1 , t2 , . . . , tk , . . . , tP−1 } , tk : = 1 + k . ( 4 ) The subscript [ P ] indicates that Λ [ P ] is a diagonal submatrix of Λ that contains its element indexed in the set [ P ] : = { 0 , 1 , · · · , P − 1 } . The normalization constant cγ = 1/ ( ∑P−1 k=0 ( 1 + k ) −2γ ) is only selected so that Eθ [ ‖θ‖2 ] = 1 . It does not play a significant role in the rest of the paper . The main assumption in ( 3 ) says that statistically , the signal to be recovered has algebraically decaying Fourier coefficients . This is simply saying that the target function we are learning is relatively smooth , which is certainly the case for many functions as physical models in practical applications . It was shown in Xie et al . ( 2020 ) that , to learn a model with p ≤ P features , it is advantageous to use the following weighted least-squares formulation θ̂p = Λ −β [ p ] ŵ , with ŵ = arg minθ ‖Ψ [ N×p ] Λ −β [ p ] w − y‖ 2 2 , ( 5 ) when the learning problem is overparameterized , i.e. , p > N . Here , Ψ [ N×p ] ∈ CN×p is the matrix containing the first p columns of Ψ , and β > 0 is some pre-selected exponent that can be different from the γ in ( 3 ) . To be more precise , we define the the generalization error of the learning problem Eβ ( P , p , N ) : = Eθ [ ‖fθ ( x ) − fθ̂p ( x ) ‖ 2 L2 ( [ 0,2π ] ) ] = Eθ [ ‖θ̂p − θ‖22 ] , ( 6 ) where the equality comes from the Parseval ’ s identity , and θ̂p is understood as the vector ( θTp , 0 , · · · , 0 ) T so that θ and θ̂p are of the same length P . The subscript θ in Eθ indicates that the expectation is taken with respect to the distribution of the random variable θ . It was shown in Xie et al . ( 2020 ) that the lowest generalization error achieved from the weighted least-squares approach ( 5 ) in the overparameterized regime ( p > N ) is strictly less than the lowest possible generalization error in the underparameterized regime ( p ≤ N ) . This , together with the analysis and numerical evidence in previous studies such as those in Belkin et al . ( 2019 ; 2020 ) , leads to the understanding that smoother approximations ( i.e. , solutions that are dominated by lower Fourier modes ) give better generalization in learning with the RFF model ( 1 ) . Main contributions of this work . In this work , we analyze a generalized version of ( 5 ) for general feature regression from noisy data . Following the same notations as before , we introduce the following weighted least-squares formulation for feature regression : θ̂ δ p = Λ −β [ p ] ŵ , with ŵ = arg min w ‖Λ−α [ N ] ( Ψ [ N×p ] Λ −β [ p ] w − y δ ) ‖22 , ( 7 ) where the superscript δ on y and θ̂p denotes the fact that the training data contain random noise of level δ ( which will be specified later ) . The exponent α is pre-selected and can be different from β . While sharing similar roles with the weight matrix Λ−β [ P ] , the weight matrix Λ −α [ N ] provides us the additional ability to deal with noise in the training data . Moreover , as we will see later , the weight matrix Λ−α [ N ] does not have to be either diagonal or in the same form as the matrix Λ −β [ p ] ; the current form is to simplify the calculations for the RFF model . It can be chosen based on the a priori information we have on the operator Ψ as well as the noise distribution of the training data . The highlight and also one of the main contributions of our work is that we introduce a new weight matrix Λ−α [ N ] that emphasizes the data mismatch in terms of its various modes , in addition to Λ −β [ p ] , the weight matrix imposed on the unknown feature coefficient vector θ . This type of generalization has appeared in different forms in many computational approaches for solving inverse and learning problems where the standard 2-norm ( or ` 2 in the infinite-dimensional setting ) is replaced with a weighted norm that is either weaker or stronger than the unweighted 2-norm . In this paper , we characterize the impact of the new weighted optimization framework ( 7 ) on the generalization capability of various feature regression and kernel regression models . The new contributions of this work are threefold . First , we discuss in detail the generalized weighted leastsquares framework ( 7 ) in Section 2 and summarize the main results for training with noise-free data in Section 3 for the RFF model in both the overparameterized and the underparameterized regimes . This is the setup considered in Xie et al . ( 2020 ) , but our analysis is based on the proposed weighted model ( 7 ) instead of ( 5 ) as in their work . Second , we provide the generalization error in both two regimes for the case of training with noisy data ; see Section 4 . This setup was not considered in Xie et al . ( 2020 ) , but we demonstrate here that it is a significant advantage of the weighted optimization when data contains noise since the weighting could effectively minimize the influence of the noise and thus improve the stability of feature regression . Third , we extend the same type of results to more general models in feature regression and kernel regression that are beyond the RFF model , given that the operator Ψ satisfies certain properties . In the general setup presented in Section 5 , we derive error bounds in the asymptotic limit when P , N , and p all become very large . Our analysis provides some guidelines on selecting weighting schemes through either the parameter domain weighting or the data domain weighting , or both , to emphasize the features of the unknowns to be learned based on a priori knowledge . 2 GENERALIZED WEIGHTED LEAST-SQUARES FORMULATION . There are four essential elements in the least-squares formulation of the learning problem : ( i ) the parameter to be learned ( θ ) , ( ii ) the dataset used in the training process ( y ) , ( iii ) the feature matrix ( Ψ ) , and ( iv ) the metric chosen to measure the data mismatch between Ψθ and y . Element ( i ) of the problem is determined not only by the data but also by a priori information we have . The information encoded in ( 3 ) reveals that the size ( i.e. , the variance ) of the Fourier modes in the RFF model decays as fast as ( 1 + k ) −2γ . Therefore , the low-frequency modes in ( 1 ) dominate high-frequency modes , which implies that in the learning process , we should search for the solution vectors that have more low-frequency components than the high-frequency components . The motivation behind introducing the weight matrix Λ−β [ p ] in ( 5 ) is exactly to force the optimization algorithm to focus on admissible solutions that are consistent with the a priori knowledge given in ( 3 ) , which is to seek θ whose components |θk|2 statistically decay like ( 1 + k ) −2β . When the problem is formally determined ( i.e. , p = N ) , the operator Ψ is invertible , and the training data are noise-free , similar to the weight matrix Λ−β [ p ] , the weight matrix Λ −α [ N ] does not change the solution of the learning problem . However , as we will see later , these two weight matrices do impact the solutions in various ways under the practical setups that we are interested in , for instance , when the problem is over-parameterized or when the training data contain random noise . The weight matrix Λ−α [ N ] is introduced to handle elements ( ii ) - ( iv ) of the learning problem . First , since Λ−α [ N ] is directly applied to the data y δ , it allows us to suppress ( when α > 0 ) or promote ( when α < 0 ) high-frequency components in the data during the training process . In particular , when transformed back to the physical space , the weight matrix Λ−α [ N ] with α > 0 corresponds to a smoothing convolutional operator whose kernel has Fourier coefficients decaying at the rate k−α . This operator suppresses high-frequency information in the data . Second , Λ−α [ N ] is also directly applied to Ψθ . This allows us to precondition the learning problem by making Λ−α [ N ] Ψ a betterconditioned operator ( in an appropriate sense ) than Ψ , for some applications where the feature matrix Ψ has certain undesired properties . Finally , since Λ−α [ N ] is applied to the residual Ψθ − y , we can regard the new weighted optimization formulation ( 7 ) as the generalization of the classic leastsquares formulation with a new loss function ( a weighted norm ) measuring the data mismatch . Weighting optimization schemes such as ( 7 ) have been studied , implicitly or explicitly , in different settings ( Needell et al. , 2014 ; Byrd & Lipton , 2019 ; Engquist et al. , 2020 ; Li , 2021 ; Yang et al. , 2021 ) . For instance , if we take β = 0 , then we have a case where we rescale the classical leastsquares loss function with the weight Λ−α [ N ] . If we take α = 1 , then this least-squares functional is equivalent to the loss function based on the H−1 norm , instead of the usual L2 norm , of the mismatch between the target function fθ ( x ) and the learned model fθ̂ ( x ) . Based on the asymptotic equivalence between the quadratic Wasserstein metric and the H−1 semi-norm ( on an appropriate functional space ) , this training problem is asymptotically equivalent to the same training problem based on a quadratic Wasserstein loss function ; see for instance Engquist et al . ( 2020 ) for more detailed illustration on the connection . In the classical statistical inversion setting , Λ2α plays the role of the covariance matrix of the additive Gaussian random noise in the data ( Kaipio & Somersalo , 2005 ) . When the noise is sampled from mean-zero Gaussian distribution with covariance matrix Λ2α , a standard maximum likelihood estimator ( MLE ) is often constructed as the minimizer of ( Ψθ − y ) ∗Λ−2α [ N ] ( Ψθ − y ) = ‖Λ −α [ N ] ( Ψθ − y ) ‖ 2 2 . The exact solution to ( 7 ) , with X+ denoting the Moore–Penrose inverse of operator X , is given by θ̂ δ p = Λ −β [ p ] ( Λ−α [ N ] Ψ [ N×p ] Λ −β [ p ] ) + Λ−α [ N ] y δ . ( 8 ) In the rest of this paper , we analyze this training result and highlight the impact of the weight matrices Λ−α [ N ] and Λ −β [ N ] in different regimes of the learning problem . We reproduce the classical bias-variance trade-off analysis in the weighted optimization framework . For that purpose , we utilize the linearity of the problem to decompose θ̂ δ p as θ̂ δ p = Λ −β [ p ] ( Λ −α [ N ] Ψ [ N×p ] Λ −β [ p ] ) +Λ−α [ N ] y + Λ −β [ p ] ( Λ −α [ N ] Ψ [ N×p ] Λ −β [ p ] ) +Λ−α [ N ] ( y δ − y ) , ( 9 ) where the first part is simply θ̂p , the result of learning with noise-free data , while the second part is the contribution from the additive noise . We define the generalization error in this case as Eδα , β ( P , p , N ) = Eθ , δ [ ‖fθ ( x ) − fθ̂δp ( x ) ‖ 2 L2 ( [ 0,2π ] ) ] = Eθ , δ [ ‖θ̂ δ p − θ̂p + θ̂p − θ‖22 ] , ( 10 ) where the expectation is taken over the joint distribution of θ and the random noise δ . By the standard triangle inequality , this generalization error is bounded by sum of the generalization error from training with noise-free data and the error caused by the noise . We will use this simple observation to bound the generalization errors when no exact formulas can be derived . We also look at the variance of the generalization error with respect to the random noise , which is Varδ ( Eθ [ ‖θ̂ δ − θ‖22 ] ) : = Eδ [ ( Eθ [ ‖θ̂ δ − θ‖22 ] − Eθ , δ [ ‖θ̂ δ − θ‖22 ] ) 2 ] . ( 11 ) In the rest of the work , we consider two parameter regimes of learning : ( i ) In the overparameterized regime , we have the following setup of the parameters : N < p ≤ P , and , P = µN , p = νN for some µ , ν ∈ N s.t . µ ≥ ν 1 . ( 12 ) ( ii ) In the underparameterized regime , we have the following scaling relations : p ≤ N ≤ P , and , P = µN for some µ ∈ N. ( 13 ) The formally-determined case of p = N ≤ P is included in both the overparameterized and the underparameterized regimes . We make the following assumptions throughout the work : ( A-I ) The random noise δ in the training data is additive in the sense that yδ = y + δ . ( A-II ) The random vectors δ and θ are independent . ( A-III ) The random noise δ ∼ N ( 0 , σI [ P ] ) for some constant σ > 0 . While assumptions ( A-I ) and ( A-II ) are essential , assumption ( A-III ) is only needed to simplify the calculations . Most of the results we obtain in this paper can be reproduced straightforwardly for the random noise δ with any well-defined covariance matrix .
The paper follows and extends the work by Belkin, Hsu, and Xu (2020) and Liang and Rakhlin (2018) which studies the bias-variance trade-off of the regression/interpolation problem in the under/over-parametrization regions. In particular, this paper follows the random Fourier model setting in Xie et al. (2020) and analyzed a generalized weighted least-square optimization method that allows the weighting in both the parametrization and data space. The authors derived the generalization error of such weighted least-square framework for the over parametrized and under parameterized regimes and compare them in these two cases. The general conclusion is that emphasizing low-frequency features provide better generalization ability. The paper also studies both noise-free and noise cases.
SP:35355126f30b88391404bdea921a944e9e9da117
FedDiscrete: A Secure Federated Learning Algorithm Against Weight Poisoning
Federated learning ( FL ) is a privacy-aware collaborative learning paradigm that allows multiple parties to jointly train a machine learning model without sharing their private data . However , recent studies have shown that FL is vulnerable to availability poisoning attacks , integrity backdoor attacks and inference attacks via weight poisoning and inference . In this paper , we propose a probabilistic discretization mechanism on the client side , which transforms the client ’ s model weight into a vector that can only have two different values but still guarantees that the server obtains an unbiased estimation of the client ’ s model weight . We theoretically analyze the utility , robustness , and convergence of our proposed discretization mechanism and empirically verify its superior robustness against various weight-based attacks under the cross-device FL setting . 1 INTRODUCTION . Federated learning ( FL ) is an emerging privacy-aware framework that trains a machine learning model across multiple parties without accessing their local private data ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) . In FL , each client first trains the local model using its private data and then sends the model gradients to an honest central server . The central server aggregates all local model gradients to form a global model , which is sent back to the clients for the next round of training . However , sharing model gradients might still leads to security concerns and privacy leakage . Recent studies have shown that FL is vulnerable to various model weight poisoning attacks . The adversarial client ( s ) can stealthily manipulate the global model via modifying the local model updates to achieve attack goals like , preventing model convergence , implanting backdoors into the global model , and inferring the privacy information of clients ’ private data ( Gu et al. , 2017 ; Blanchard et al. , 2017 ; Pyrgelis et al. , 2017 ; Xie et al. , 2019 ; Bagdasaryan et al. , 2020 ; Wang et al. , 2020 ; Tang et al. , 2020 ) . To address such an issue , recent works start to explore different defense techniques to robustify FL against model weight poisoning attacks ( Blanchard et al. , 2017 ; Bagdasaryan et al. , 2020 ; Shen et al. , 2016 ; Geyer et al. , 2017 ; Fung et al. , 2018 ) . However , most existing works apply the defense or robust techniques at the server side , which changes the role of the central server from being honest to trusted . And prior approaches mostly only focus on one type of attacks . Our contributions . In this paper , we propose the FEDDISCRETE , a flexible FL framework that can combine any popular FL algorithms , for example , FedAvg ( McMahan et al. , 2017 ) and FedProx ( Li et al. , 2020 ) , with our probabilistic discretization mechanism . Theoretical analyses on the utility , robustness , and convergence are performed to show that FEDDISCRETE is inherently robust to availability poisoning attacks ( Kurita et al. , 2020 ) , integrity backdoor attacks ( Gu et al. , 2017 ) and server inference attacks ( Shokri et al. , 2017 ) . FEDDISCRETE is evaluated on four popular image classification datasets under both data are i.i.d and non-i.i.d settings . The numerical results indicate that FEDDISCRETE is robust to various weight-based attacks . 2 BACKGROUNDS AND RELATED WORKS . In this section , we provide necessary background information on concepts thorough the paper and formalize the problem to be solved . Federated learning ( FL ) . FL is a privacy-aware collaborative learning , where N clients and one trusted server work together to learn a global model ( McMahan et al. , 2017 ) . Depending on the application scenarios , the number of clients n can range from as small as two to several hundreds in the cross-silo setting or can easily go beyond millions in the cross-device setting . A classical way of formulating FL into an optimization problem is ( Wang et al. , 2021a ) min w∈Rd F ( w ) : = N∑ i=1 piFi ( w ) , where Fi ( w ) = 1 |Di| ∑ ξ∈Di fi ( w ; ξ ) and N∑ i=1 pi = 1 . ( 1 ) In Eq . 1 , w is the global model weight ; Fi is the i-client local objective function ; the local loss functions fi ( w ; ξ ) are often assumed to be the same across all clients ; the local data Di can have different distribution . Following the seminal work of ( McMahan et al. , 2017 ) , extensive researches have been conducted to address various challenges in FL . For instance , ( Li et al. , 2020 ; Reddi et al. , 2020 ) aim to design efficient optimization algorithms ; ( Konečnỳ et al. , 2016 ; Luping et al. , 2019 ) try to improve the communication efficiency ; ( Bagdasaryan et al. , 2020 ; Xie et al. , 2021 ) study the security issues on both attacks and defenses . Adversaries . For any FL attack , the server is assumed to be honest , which faithfully follow the training protocols and any client can not directly get the model weight of other clients . Under these assumptions , there are two adversaries : 1 ) the malicious clients can manipulate the weights for various attack purposes , such as interfering the global model training or implanting backdoors into the global model ; 2 ) the curious server can explore the privacy information from local clients via inference attacks . Availability poisoning attacks . The goal of availability poisoning attacks ( APAs ) is for malicious local client ( s ) to destroy or reduce the global model ’ s utility ( Shen et al. , 2016 ; Sun et al. , 2018 ) . In APAs , the attacker can either control the global model ’ s utility on target tasks or decrease the most of the model ’ s utility as the optimal attack strategy . In practice , adding a large random noise can successfully worsen the global model ’ s utility but can be easily discovered by anomaly detection techniques . In this case , any advanced attack needs to know and tries to bypass the defense techniques used in training . In this work , we assume the attacker has full knowledge of training process and all possible defense techniques . Integrity backdoor attacks . The goals of integrity backdoor attack ( IBAs ) are two-fold : 1 ) the attacker aims to implant backdoors into the global model , through which the attacker can control the prediction results by injecting the trigger to any clean examples ; 2 ) at the same time , the attacker wants the global model can still perform as good as the non-attacked model on all clean inputs ( Bagdasaryan et al. , 2020 ) . Note that , IBAs are also conducted by the malicious clients in FL . Inference attacks . Many studies show that the attacker could explore the private information from the model weights , such as membership and attribute information ( Pyrgelis et al. , 2017 ; Shokri et al. , 2017 ; Ganju et al. , 2018 ; Melis et al. , 2019 ) or even recover the training samples used by clients Zhu et al . ( 2019 ) . When the honest-but-curious server becomes malicious , it can explore privacy information of each client ’ s local dataset through inference attacks ( IAs ) since the server has full access to clients ’ model weight . Both APAs and IBAs can be achieved via weights poisoning that modifies the local model weights . For example , as the global model converges , the deviations of local models start to cancel out , i.e. , ∑nt−1 i=1 ( w t i − wt−1 ) ≈ 0 given as in Eq . 2 of Bagdasaryan et al . ( 2020 ) , where t and i the communication round and client index respectively , wt and wti are the global and local model respectively , and nt is the number of participating clients . If the adversary aims to replace global model wt with a target model X , then it could propose to upload a local model weight wtA = ntX − ( nt − 1 ) wt−1 − ∑nt−1 i=1 ( w t i − wt−1 ) ≈ nt ( X − wt−1 ) + wt−1 as given in Eq . 3 in Bagdasaryan et al . ( 2020 ) . Prior works ( Bagdasaryan et al. , 2020 ; Wang et al. , 2020 ; Xie et al. , 2019 ) demonstrate the effectiveness of both APAs and IBAs when the training algorithm is FedAvg . IAs can be easily achieved by many existing advanced attack methods once they have the full access to the client model Shokri et al . ( 2017 ) ; Hu et al . ( 2021 ) . Related works . To address the various attacks , many prior defense works have been proposed and achieved good performance against the attacks . However , prior defense works only address one aspects of aforementioned three attacks . For availability poisoning attacks , Steinhardt et al . ( 2017 ) proposed a defending framework , which can be applied to defenders that remove outliers and then minimize a margin-based loss on the remaining data . Under assumptions , this framework provides the approximate upper bounds on the efficacy of any data poisoning attack . However , this framework does not fit in the FL setting , as it needs the access to all private data . Blanchard et al . ( 2017 ) studied the presences of Byzantine adversaries and proposed Krum aggregation rule to defend under the assumption that the participants ’ training data are i.i.d , which is not necessarily true in the FL setting . And indeed as argued in ( Bagdasaryan et al. , 2020 ) , Krum can be used by the adversaries to make the attack more effective . FoolsGold ( Fung et al. , 2018 ) can mitigate sybils data poisoning attacks under the assumption that the honest clients can be separated from sybils by the diversity of their gradient updates . As discussed by the authors , FoolsGold is not successful at mitigating attacks initiated by a single adversary . For integrity backdoor attacks , Xie et al . ( 2021 ) provided a general framework that is certifiably robust to the backdoor attacks under the FL setting via the model weight smoothing . However , the convexity assumption is imposed on the loss function , which limits certified robustness to more challenging and widely used deep neural network . Ozdayi et al . ( 2021 ) proposed a defense approach based on adjusting server ’ s learning rate with the guidance of sign information of agents ’ updates . For inference attacks , differential privacy is widely adopted approach to defend , where are judiciously random noise added on either the clients ’ model update or the global model , e.g. , Geyer et al . ( 2017 ) , but it suffers from the trade-off between privacy and accuracy . Compared to this work , neither of these works can address three types of attacks simultaneously . 3 METHOD . We introduce FEDDISCRETE , a federated learning framework with a simply yet effective discrete mechanism and the flexibility to accommodate various FL optimization algorithms . A complete description is given in Algorithm 1 . FEDDISCRETEdifferences FEDDISCRETE consists of three stages , namely , local training , discretization and aggregation , which are discussed in details . Local Training . Since we mainly focus on the cross-device setting , in each communication round t , the server first selects a subset of |St| = K clients to participate the current round of training and broadcasts the global model wt to the selected clients . The clients who receives the global model then performs local training using any appropriate algorithm to generate a new local model , i.e . wt+1i for all i ∈ St . The ith client can 1 ) use the local stochastic gradient descent ( SGD ) method as is considered in FedAVG to perform a fixed number of SGD steps to improve communication efficiency ; 2 ) use adaptive method ( Wang et al. , 2021b ) to improve the convergence ; 3 ) approximately minimize Fi ( w ) + µ2 ‖w−w t‖2 for some µ > 0 as proposed in FedProx to accommodate the system and data heterogeneity ( Li et al. , 2020 ) . Discretization . For all i ∈ St , the ith local client computes the maximum and minimum values of wti and sends noise-perturbed maximum value u t i and minimal value l t i back to the server , where the noise is added to protect the privacy of the local training data and the noise is sampled and added in a way that to guarantee uti and l t i are the valid upper bound and lower bound of w t+1 i elementwise . Once the server received the client-wise upper-bounds and lower-bounds , it computes the minimum of the lower bounds ltmin and the maximum of the upper bounds u t max to prepare the inputs for the discretization mechanism ( see Definition 3.1 ) , which outputs an unbiased estimator of the input ( see Lemma 4.1 ) . For all i ∈ St , the ith client discretizes its continuous model wti into M ( wti ; ltmin , utmax ) and uploadsM ( wti ; ltmin , utmax ) to the server for aggregation . Aggregation . Rather than simply aggregating { M ( wti ; ltmin , utmax ) } i∈St , the sever first inspects whether each coordinate of wti is either l t min or u t max to exclude the any potential malicious adversaries that attempt to bypass the discretization process . And the server only aggregates the local model weights that pass the sanity check . Also when the server computes ltmin and u t max , it can be more conservative by discarding the extreme values in { lti } i∈St and { uti } i∈St by setting thresholds on the lower quantile of { lti } i∈St and upper quantile of { uti } i∈St to prevent adversaries proposing extremely large upper bounds and/or small lower bounds . For the ease of presentation , we do not include this choice in the description of Algorithm 1 . Definition 3.1 ( Discretization Mechanism ) . For any ( w , l , u ) ∈ R×R×R with l ≤ w ≤ u , define the discretization mechanism as M ( w ; l , u ) = { u , w.p . w−lu−l l , w.p . u−wu−l , ( 2 ) where w.p . is the shorthand notation for “ with probability ” . Algorithm 1 FEDDISCRETE 1 : Input : Initial model weight w0 ∈ Rd , total training rounds T , the participants size K , and the learning rate { ηt } T−1t=0 and a positive sequence { σi } Ni=1 . 2 : for t = 0 , 1 , 2 , . . . , T − 1 do 3 : The sever randomly selects an index set St with |St| = K and broadcasts wt to the client i if i ∈ St. 4 : For the ith client , where i ∈ St , it performs the local training to obtain wt+1i and samples two random variables ξti and ζ t i from the truncated Gaussian TN ( 0 , σi ; 0 , 1 ) . Then it computes and uploads lti = minj∈ [ d ] { [ wti ] j −wt } − ξti and uti = maxj∈ [ d ] { [ wti ] j −wt } + ζti to the server . 5 : The sever computes lt = mini∈St { lti } and ut = maxi∈St { uti } then broadcasts lt , ut to clients in St. 6 : For the ith client , where i ∈ St , it applies the discretization mechanismM is an elementwise fashion and uploads the discrete model weightM ( wt+1i −wt ; lt , ut ) to the server . 7 : The server conducts the sanity check for { M ( wt+1i −wt ; lt , ut ) } i∈St , i.e. , validates whether all elements of wt+1i are either l t or ut . Form the set S′t ⊆ St to collect all the clients ’ index passing the sanity check and compute wt+1 = wt+ηt 1|S′t| ∑ i∈S′t M ( wt+1i − wt ; lt , ut ) . 8 : end for We close this section by making following comments . • Discretization is a widely applied technique , for example , in influence maximization Kempe et al . ( 2003 ) , the algorithm needs to simulate the propagation from a probabilistic graph that is consists of a set of edges with activation probabilities in [ 0 , 1 ] . It is also can be regarded as a special form of quantization that is widely used in the distributed optimization ( Alistarh et al. , 2017 ; Reisizadeh et al. , 2020 ) to improve communication efficiency . Compared with prior discretization works , this is the first work to adopt discretization to protect FL from weight poisoning attack . • Compared with the FedAvg , although an additional round of communication is required in FEDDISCRETE to perform the discretization mechanism . We argue that FEDDISCRETE is more communication-efficient than FedAvg . Assume each scalar takes 64bits , then for the t-th round , the total bits communicated are 128dK for FedAvg , while for FEDDISCRETE are 64dK + 128K + dK . For large d , FEDDISCRETE communicates less bits . 1 • Although the discretization mechanism outputs an unbiased estimation of wt+1i , the variance of the estimatorM ( wt+1i ) can be large . To mitigate this issue , one can compute more finely-grained upper bounds and lower bounds . For example , assume each client wants to train a neural network . Then , instead of computing the maximum and minimum values over the entire w , the client could compute layer-wise maximum and minimum values . And the discretization mechanism could be applied layer-wise with tighter upper bounds and lower bounds . This leads to smaller variance in the estimator at the cost of increasing the communicated bits . • Intuitively , the discretization mechanism is effective in defending weight poisoning attacks as the judiciously crafted adversary model is discretized . For example , consider the model replacement attack in Eq . 3 of Bagdasaryan et al . ( 2020 ) , once the malicious model wtA is discretized intoM ( wtA ) , the model replacement becomes ineffective .
Federated learning (FL) has been shown to be vulnerable to weight poisoning attacks. An attacker who controls malicious clients can poison the clients’ model weights such that a backdoor to perform availability poisoning attacks, integrity backdoor attacks and inference attacks. In this work, the authors proposed a new FL algorithm called FedDiscrete, which probabilistically discretizes the clients’ model weights into two different values. The authors derived the convergence of FedDiscrete and empirically showed its performance against existing attacks. However, I am worried about the theoretical analysis on the robustness, as well as the empirical robustness against adaptive attacks.
SP:77cbeaffd1cf539e8793dcf0e95f5bb9186cf973
FedDiscrete: A Secure Federated Learning Algorithm Against Weight Poisoning
Federated learning ( FL ) is a privacy-aware collaborative learning paradigm that allows multiple parties to jointly train a machine learning model without sharing their private data . However , recent studies have shown that FL is vulnerable to availability poisoning attacks , integrity backdoor attacks and inference attacks via weight poisoning and inference . In this paper , we propose a probabilistic discretization mechanism on the client side , which transforms the client ’ s model weight into a vector that can only have two different values but still guarantees that the server obtains an unbiased estimation of the client ’ s model weight . We theoretically analyze the utility , robustness , and convergence of our proposed discretization mechanism and empirically verify its superior robustness against various weight-based attacks under the cross-device FL setting . 1 INTRODUCTION . Federated learning ( FL ) is an emerging privacy-aware framework that trains a machine learning model across multiple parties without accessing their local private data ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) . In FL , each client first trains the local model using its private data and then sends the model gradients to an honest central server . The central server aggregates all local model gradients to form a global model , which is sent back to the clients for the next round of training . However , sharing model gradients might still leads to security concerns and privacy leakage . Recent studies have shown that FL is vulnerable to various model weight poisoning attacks . The adversarial client ( s ) can stealthily manipulate the global model via modifying the local model updates to achieve attack goals like , preventing model convergence , implanting backdoors into the global model , and inferring the privacy information of clients ’ private data ( Gu et al. , 2017 ; Blanchard et al. , 2017 ; Pyrgelis et al. , 2017 ; Xie et al. , 2019 ; Bagdasaryan et al. , 2020 ; Wang et al. , 2020 ; Tang et al. , 2020 ) . To address such an issue , recent works start to explore different defense techniques to robustify FL against model weight poisoning attacks ( Blanchard et al. , 2017 ; Bagdasaryan et al. , 2020 ; Shen et al. , 2016 ; Geyer et al. , 2017 ; Fung et al. , 2018 ) . However , most existing works apply the defense or robust techniques at the server side , which changes the role of the central server from being honest to trusted . And prior approaches mostly only focus on one type of attacks . Our contributions . In this paper , we propose the FEDDISCRETE , a flexible FL framework that can combine any popular FL algorithms , for example , FedAvg ( McMahan et al. , 2017 ) and FedProx ( Li et al. , 2020 ) , with our probabilistic discretization mechanism . Theoretical analyses on the utility , robustness , and convergence are performed to show that FEDDISCRETE is inherently robust to availability poisoning attacks ( Kurita et al. , 2020 ) , integrity backdoor attacks ( Gu et al. , 2017 ) and server inference attacks ( Shokri et al. , 2017 ) . FEDDISCRETE is evaluated on four popular image classification datasets under both data are i.i.d and non-i.i.d settings . The numerical results indicate that FEDDISCRETE is robust to various weight-based attacks . 2 BACKGROUNDS AND RELATED WORKS . In this section , we provide necessary background information on concepts thorough the paper and formalize the problem to be solved . Federated learning ( FL ) . FL is a privacy-aware collaborative learning , where N clients and one trusted server work together to learn a global model ( McMahan et al. , 2017 ) . Depending on the application scenarios , the number of clients n can range from as small as two to several hundreds in the cross-silo setting or can easily go beyond millions in the cross-device setting . A classical way of formulating FL into an optimization problem is ( Wang et al. , 2021a ) min w∈Rd F ( w ) : = N∑ i=1 piFi ( w ) , where Fi ( w ) = 1 |Di| ∑ ξ∈Di fi ( w ; ξ ) and N∑ i=1 pi = 1 . ( 1 ) In Eq . 1 , w is the global model weight ; Fi is the i-client local objective function ; the local loss functions fi ( w ; ξ ) are often assumed to be the same across all clients ; the local data Di can have different distribution . Following the seminal work of ( McMahan et al. , 2017 ) , extensive researches have been conducted to address various challenges in FL . For instance , ( Li et al. , 2020 ; Reddi et al. , 2020 ) aim to design efficient optimization algorithms ; ( Konečnỳ et al. , 2016 ; Luping et al. , 2019 ) try to improve the communication efficiency ; ( Bagdasaryan et al. , 2020 ; Xie et al. , 2021 ) study the security issues on both attacks and defenses . Adversaries . For any FL attack , the server is assumed to be honest , which faithfully follow the training protocols and any client can not directly get the model weight of other clients . Under these assumptions , there are two adversaries : 1 ) the malicious clients can manipulate the weights for various attack purposes , such as interfering the global model training or implanting backdoors into the global model ; 2 ) the curious server can explore the privacy information from local clients via inference attacks . Availability poisoning attacks . The goal of availability poisoning attacks ( APAs ) is for malicious local client ( s ) to destroy or reduce the global model ’ s utility ( Shen et al. , 2016 ; Sun et al. , 2018 ) . In APAs , the attacker can either control the global model ’ s utility on target tasks or decrease the most of the model ’ s utility as the optimal attack strategy . In practice , adding a large random noise can successfully worsen the global model ’ s utility but can be easily discovered by anomaly detection techniques . In this case , any advanced attack needs to know and tries to bypass the defense techniques used in training . In this work , we assume the attacker has full knowledge of training process and all possible defense techniques . Integrity backdoor attacks . The goals of integrity backdoor attack ( IBAs ) are two-fold : 1 ) the attacker aims to implant backdoors into the global model , through which the attacker can control the prediction results by injecting the trigger to any clean examples ; 2 ) at the same time , the attacker wants the global model can still perform as good as the non-attacked model on all clean inputs ( Bagdasaryan et al. , 2020 ) . Note that , IBAs are also conducted by the malicious clients in FL . Inference attacks . Many studies show that the attacker could explore the private information from the model weights , such as membership and attribute information ( Pyrgelis et al. , 2017 ; Shokri et al. , 2017 ; Ganju et al. , 2018 ; Melis et al. , 2019 ) or even recover the training samples used by clients Zhu et al . ( 2019 ) . When the honest-but-curious server becomes malicious , it can explore privacy information of each client ’ s local dataset through inference attacks ( IAs ) since the server has full access to clients ’ model weight . Both APAs and IBAs can be achieved via weights poisoning that modifies the local model weights . For example , as the global model converges , the deviations of local models start to cancel out , i.e. , ∑nt−1 i=1 ( w t i − wt−1 ) ≈ 0 given as in Eq . 2 of Bagdasaryan et al . ( 2020 ) , where t and i the communication round and client index respectively , wt and wti are the global and local model respectively , and nt is the number of participating clients . If the adversary aims to replace global model wt with a target model X , then it could propose to upload a local model weight wtA = ntX − ( nt − 1 ) wt−1 − ∑nt−1 i=1 ( w t i − wt−1 ) ≈ nt ( X − wt−1 ) + wt−1 as given in Eq . 3 in Bagdasaryan et al . ( 2020 ) . Prior works ( Bagdasaryan et al. , 2020 ; Wang et al. , 2020 ; Xie et al. , 2019 ) demonstrate the effectiveness of both APAs and IBAs when the training algorithm is FedAvg . IAs can be easily achieved by many existing advanced attack methods once they have the full access to the client model Shokri et al . ( 2017 ) ; Hu et al . ( 2021 ) . Related works . To address the various attacks , many prior defense works have been proposed and achieved good performance against the attacks . However , prior defense works only address one aspects of aforementioned three attacks . For availability poisoning attacks , Steinhardt et al . ( 2017 ) proposed a defending framework , which can be applied to defenders that remove outliers and then minimize a margin-based loss on the remaining data . Under assumptions , this framework provides the approximate upper bounds on the efficacy of any data poisoning attack . However , this framework does not fit in the FL setting , as it needs the access to all private data . Blanchard et al . ( 2017 ) studied the presences of Byzantine adversaries and proposed Krum aggregation rule to defend under the assumption that the participants ’ training data are i.i.d , which is not necessarily true in the FL setting . And indeed as argued in ( Bagdasaryan et al. , 2020 ) , Krum can be used by the adversaries to make the attack more effective . FoolsGold ( Fung et al. , 2018 ) can mitigate sybils data poisoning attacks under the assumption that the honest clients can be separated from sybils by the diversity of their gradient updates . As discussed by the authors , FoolsGold is not successful at mitigating attacks initiated by a single adversary . For integrity backdoor attacks , Xie et al . ( 2021 ) provided a general framework that is certifiably robust to the backdoor attacks under the FL setting via the model weight smoothing . However , the convexity assumption is imposed on the loss function , which limits certified robustness to more challenging and widely used deep neural network . Ozdayi et al . ( 2021 ) proposed a defense approach based on adjusting server ’ s learning rate with the guidance of sign information of agents ’ updates . For inference attacks , differential privacy is widely adopted approach to defend , where are judiciously random noise added on either the clients ’ model update or the global model , e.g. , Geyer et al . ( 2017 ) , but it suffers from the trade-off between privacy and accuracy . Compared to this work , neither of these works can address three types of attacks simultaneously . 3 METHOD . We introduce FEDDISCRETE , a federated learning framework with a simply yet effective discrete mechanism and the flexibility to accommodate various FL optimization algorithms . A complete description is given in Algorithm 1 . FEDDISCRETEdifferences FEDDISCRETE consists of three stages , namely , local training , discretization and aggregation , which are discussed in details . Local Training . Since we mainly focus on the cross-device setting , in each communication round t , the server first selects a subset of |St| = K clients to participate the current round of training and broadcasts the global model wt to the selected clients . The clients who receives the global model then performs local training using any appropriate algorithm to generate a new local model , i.e . wt+1i for all i ∈ St . The ith client can 1 ) use the local stochastic gradient descent ( SGD ) method as is considered in FedAVG to perform a fixed number of SGD steps to improve communication efficiency ; 2 ) use adaptive method ( Wang et al. , 2021b ) to improve the convergence ; 3 ) approximately minimize Fi ( w ) + µ2 ‖w−w t‖2 for some µ > 0 as proposed in FedProx to accommodate the system and data heterogeneity ( Li et al. , 2020 ) . Discretization . For all i ∈ St , the ith local client computes the maximum and minimum values of wti and sends noise-perturbed maximum value u t i and minimal value l t i back to the server , where the noise is added to protect the privacy of the local training data and the noise is sampled and added in a way that to guarantee uti and l t i are the valid upper bound and lower bound of w t+1 i elementwise . Once the server received the client-wise upper-bounds and lower-bounds , it computes the minimum of the lower bounds ltmin and the maximum of the upper bounds u t max to prepare the inputs for the discretization mechanism ( see Definition 3.1 ) , which outputs an unbiased estimator of the input ( see Lemma 4.1 ) . For all i ∈ St , the ith client discretizes its continuous model wti into M ( wti ; ltmin , utmax ) and uploadsM ( wti ; ltmin , utmax ) to the server for aggregation . Aggregation . Rather than simply aggregating { M ( wti ; ltmin , utmax ) } i∈St , the sever first inspects whether each coordinate of wti is either l t min or u t max to exclude the any potential malicious adversaries that attempt to bypass the discretization process . And the server only aggregates the local model weights that pass the sanity check . Also when the server computes ltmin and u t max , it can be more conservative by discarding the extreme values in { lti } i∈St and { uti } i∈St by setting thresholds on the lower quantile of { lti } i∈St and upper quantile of { uti } i∈St to prevent adversaries proposing extremely large upper bounds and/or small lower bounds . For the ease of presentation , we do not include this choice in the description of Algorithm 1 . Definition 3.1 ( Discretization Mechanism ) . For any ( w , l , u ) ∈ R×R×R with l ≤ w ≤ u , define the discretization mechanism as M ( w ; l , u ) = { u , w.p . w−lu−l l , w.p . u−wu−l , ( 2 ) where w.p . is the shorthand notation for “ with probability ” . Algorithm 1 FEDDISCRETE 1 : Input : Initial model weight w0 ∈ Rd , total training rounds T , the participants size K , and the learning rate { ηt } T−1t=0 and a positive sequence { σi } Ni=1 . 2 : for t = 0 , 1 , 2 , . . . , T − 1 do 3 : The sever randomly selects an index set St with |St| = K and broadcasts wt to the client i if i ∈ St. 4 : For the ith client , where i ∈ St , it performs the local training to obtain wt+1i and samples two random variables ξti and ζ t i from the truncated Gaussian TN ( 0 , σi ; 0 , 1 ) . Then it computes and uploads lti = minj∈ [ d ] { [ wti ] j −wt } − ξti and uti = maxj∈ [ d ] { [ wti ] j −wt } + ζti to the server . 5 : The sever computes lt = mini∈St { lti } and ut = maxi∈St { uti } then broadcasts lt , ut to clients in St. 6 : For the ith client , where i ∈ St , it applies the discretization mechanismM is an elementwise fashion and uploads the discrete model weightM ( wt+1i −wt ; lt , ut ) to the server . 7 : The server conducts the sanity check for { M ( wt+1i −wt ; lt , ut ) } i∈St , i.e. , validates whether all elements of wt+1i are either l t or ut . Form the set S′t ⊆ St to collect all the clients ’ index passing the sanity check and compute wt+1 = wt+ηt 1|S′t| ∑ i∈S′t M ( wt+1i − wt ; lt , ut ) . 8 : end for We close this section by making following comments . • Discretization is a widely applied technique , for example , in influence maximization Kempe et al . ( 2003 ) , the algorithm needs to simulate the propagation from a probabilistic graph that is consists of a set of edges with activation probabilities in [ 0 , 1 ] . It is also can be regarded as a special form of quantization that is widely used in the distributed optimization ( Alistarh et al. , 2017 ; Reisizadeh et al. , 2020 ) to improve communication efficiency . Compared with prior discretization works , this is the first work to adopt discretization to protect FL from weight poisoning attack . • Compared with the FedAvg , although an additional round of communication is required in FEDDISCRETE to perform the discretization mechanism . We argue that FEDDISCRETE is more communication-efficient than FedAvg . Assume each scalar takes 64bits , then for the t-th round , the total bits communicated are 128dK for FedAvg , while for FEDDISCRETE are 64dK + 128K + dK . For large d , FEDDISCRETE communicates less bits . 1 • Although the discretization mechanism outputs an unbiased estimation of wt+1i , the variance of the estimatorM ( wt+1i ) can be large . To mitigate this issue , one can compute more finely-grained upper bounds and lower bounds . For example , assume each client wants to train a neural network . Then , instead of computing the maximum and minimum values over the entire w , the client could compute layer-wise maximum and minimum values . And the discretization mechanism could be applied layer-wise with tighter upper bounds and lower bounds . This leads to smaller variance in the estimator at the cost of increasing the communicated bits . • Intuitively , the discretization mechanism is effective in defending weight poisoning attacks as the judiciously crafted adversary model is discretized . For example , consider the model replacement attack in Eq . 3 of Bagdasaryan et al . ( 2020 ) , once the malicious model wtA is discretized intoM ( wtA ) , the model replacement becomes ineffective .
This paper proposes a secure federated learning framework against weight poisoning. The key component in the framework is the discretization mechanism which works well with a sufficient number of clients. Theoretical analysis of the robustness and convergence is provided. Lastly, numerical analysis is provided to verify the performance of the proposed method.
SP:77cbeaffd1cf539e8793dcf0e95f5bb9186cf973
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
1 INTRODUCTION Thanks to many architectural and algorithmic innovations , the recent decade has witnessed the unprecedented success of deep learning in various high-profile challenges , e.g. , the ImageNet recognition task ( Krizhevsky et al. , 2012 ) , the challenging board game of Go ( Silver et al. , 2017 ) and human-like text generation ( Brown et al. , 2020 ) . Among them , shortcut connections ( He et al. , 2016a ; Srivastava et al. , 2015 ) and normalization layers ( Ioffe & Szegedy , 2015 ; Ba et al. , 2016 ) are two architectural components of modern networks that are critically important for achieving fast training at very high depths , and feature prominently in the ubiquitous ResNet architecture of He et al . ( 2016b ) . Despite the success of ResNets , there is significant evidence to suggest that the primary reason they work so well is that they resemble ensembles of shallower networks during training ( Veit et al. , 2016 ) , which lets them avoid the common pathologies associated with very deep networks ( e.g . Hochreiter et al. , 2001 ; Duvenaud et al. , 2014 ) . In this sense , the question of whether truly deep networks can be efficient and effectively trained on challenging tasks remains an open one . As argued by Oyedotun et al . ( 2020 ) and Ding et al . ( 2021 ) , the multi-branch topology of ResNets also has certain drawbacks . For example , it is memory-inefficient at inference time , as the input to every residual block has to be kept in memory until the final addition . In particular , the shortcut branches in ResNet-50 account for about 40 % of the memory usage by feature maps . Also , the classical interpretation of why deep networks perform well – because of the hierarchical feature representations they produce – does not strictly apply to ResNets , due to their aforementioned tendency to behave like ensembles of shallower networks . Beyond the drawbacks of ResNets , training vanilla deep neural networks ( which we define as networks without shortcut connections or normalization layers ) is an interesting research problem in its own right , and finding a solution could open the path to discovering new model architectures . However , recent progress in this direction has not fully succeeded in matching the generalization performance of ResNets . Schoenholz et al . ( 2017 ) used a mean-field analysis of deep MLPs to choose variances for the initial weights and bias parameters , and showed that the resulting method – called Edge of Chaos ( EOC ) – allowed vanilla networks to be trained at very high depths on small datasets . Building on EOC , and incorporating dynamical isometry theory , Xiao et al . ( 2018 ) was able to train vanilla networks with Tanh units1 at depths of up to 10,000 . While impressive , these EOC-initialized networks trained significantly slower than standard ResNets of the same depth , and also exhibited significantly worse generalization performance . While Oyedotun et al . ( 2020 ) was able to narrow the generalization gap between vanilla networks and ResNets , their experiments were limited to networks with only 30 layers , and their networks required many times more parameters . More recently , Martens et al . ( 2021 ) introduced a method called Deep Kernel Shaping ( DKS ) for initializing and transforming networks ( and their activation functions ) based on an analysis of their initialization-time kernel properties . They showed that their approach enabled vanilla networks to train faster than previous methods , even matching the speed of similarly sized ResNets when combined with stronger optimizers like K-FAC ( Martens & Grosse , 2015 ; Grosse & Martens , 2016 ) or Shampoo ( Anil et al. , 2020 ) . However , their method isn ’ t fully compatible with ReLUs , and in their experiments ( which focused on training speed ) their networks exhibited significantly more overfitting than ResNets . Inspired by both DKS and the line of work using mean-field theory , we propose a new method called Tailored Activation Transformation ( TAT ) . TAT inherits the main advantages of DKS , while working particularly well with the “ Leaky ReLU ” activation function . While being easy to implement and introducing negligible extra computational cost , TAT enables very deep vanilla neural networks to be trained on ImageNet without the use of any additional architectural elements . Using TAT , we demonstrate for the first time that a 50-layer vanilla deep network can nearly match the validation accuracy of its ResNet counterpart when trained on Imagenet . And unlike with the EOC method , validation accuracy we achieve does not decrease with depth ( see Figure 1 ) . Furthermore , TAT can also be applied to ResNets without normalization layers , allowing them to match or even exceed the validation accuracy of standard ResNets of the same width/depth . 2 BACKGROUND . Our main tool of analysis will be kernel functions for neural networks ( Neal , 1996 ; Cho & Saul , 2009 ; Daniely et al. , 2016 ) and the related Q/C maps ( Saxe et al. , 2013 ; Poole et al. , 2016 ; Martens et al. , 2021 ) . In this section , we introduce our notation and some key concepts used throughout . 2.1 KERNEL FUNCTION APPROXIMATION FOR WIDE NETWORKS . For simplicity , we start with the kernel function approximation for feedforward fully-connected networks , and discuss its extensions to convolutional networks and non-feedforward networks later . In particular , we will assume a network that is defined by a sequence of L combined layers ( each of which is an affine transformation followed by the elementwise activation function φ ) as follows : xl+1 = φ ( Wlx l + bl ) ∈ Rdl+1 , ( 1 ) with weights Wl ∈ Rdl+1×dl initialized as Wl iid∼ N ( 0 , 1/dl ) ( or scale-corrected uniform orthogonal matrices ( Martens et al. , 2021 ) ) , and biases bl ∈ Rdl+1 initialized to zero . Due to the randomness of the initial parameters θ , the network can be viewed as random feature model f lθ ( x ) , x ` at each layer l ( with x0 = x ) at initialization time . This induces a random kernel defined as follows : κlf ( x1 , x2 ) = 1 dl f lθ ( x1 ) > f lθ ( x2 ) . ( 2 ) Given these assumptions , as the width of each layer goes to infinity , κlf ( x1 , x2 ) converges in probability ( see Theorem 3 ) to a deterministic kernel κ̃lf ( x1 , x2 ) that has a simple form , and can be computed layer by layer as follows : Σl+1 = Ez∼N ( 0 , Σl ) [ φ ( z ) φ ( z ) > ] , with Σl = [ κ̃lf ( x1 , x1 ) κ̃ l f ( x1 , x2 ) κ̃lf ( x1 , x2 ) κ̃ l f ( x2 , x2 ) ] , ( 3 ) where κ̃0f ( x1 , x2 ) = κ 0 f ( x1 , x2 ) = x > 1 x2/d0 . 1Dynamical isometry is unavailable for ReLU ( Pennington et al. , 2017 ) , even with orthogonal weights . 2.2 LOCAL Q/C MAPS . By equation 3 , any diagonal entry ql+1i of Σ l+1 only depends on the corresponding diagonal entry qli of Σl . Hence , we obtain the following recursion for these diagonal entries , which we call q values : ql+1i = Q ( q l i ) = Ez∼N ( 0 , qli ) [ φ ( z ) 2 ] = Ez∼N ( 0,1 ) [ φ ( √ qliz ) 2 ] , with q0i = ‖xi‖2/d0 ( 4 ) where Q is the local Q map . We note that qli is an approximation of κlf ( xi , xi ) . Analogously , one can write the recursion for the normalized off-diagonal entries , which we call c values , as : cl+1 = C ( cl , ql1 , ql2 ) = E [ z1z2 ] ∼N ( 0 , Σl ) [ φ ( z1 ) φ ( z2 ) ] √ Q ( ql1 ) Q ( ql2 ) , with Σl = [ ql1 √ ql1q l 2c l √ ql1q l 2c l ql2 ] , ( 5 ) where C is the local C map and c0 = x > 1 x2/d0 . We note that cl is an approximation of the cosine similarity between f lθ ( x1 ) and f l θ ( x2 ) . Because C is a three dimensional function , it is difficult to analyze , as the associated q values can vary wildly for distinct inputs . However , by scaling the inputs to have norm √ d0 , and rescaling φ so that Q ( 1 ) = 1 , it follows that qli = 1 for all l. This allows us to treat C as a one dimensional function from [ −1 , 1 ] to [ −1 , 1 ] satisfying C ( 1 ) = 1 . Additionally , it can be shown that C possesses special structure as a positive definite function ( see Appendix A.4 for details ) . Going forward , we will thus assume that q0i = 1 , and that φ is scaled so that Q ( 1 ) = 1 . 2.3 EXTENSIONS TO CONVOLUTIONAL NETWORKS AND MORE COMPLEX TOPOLOGIES . As argued in Martens et al . ( 2021 ) , Q/C maps can also be defined for convolutional networks if one adopts a Delta initialization ( Balduzzi et al. , 2017 ; Xiao et al. , 2018 ) , in which all weights except those in the center of the filter are initialized to zero . Intuitively , this makes convolutional networks behave like a collection of fully-connected networks operating independently over feature map locations . As such , the Q/C map computations for a feed-forward convolutional network are the same as above . Martens et al . ( 2021 ) also gives formulas to compute q and c values for weighted sum operations between the outputs of multiple layers ( without nonlinearities ) , thus allowing more complex network topologies . In particular , the sum operation ’ s output q value is given by q = ∑n i=1 w 2 i qi , and its output c value is given by 1q ∑n i=1 w 2 i qici . In order to maintain the property that all q values are 1 in the network , we will assume that sum operations are normalized in the sense that ∑n i=1 w 2 i = 1 . Following Martens et al . ( 2021 ) , we will extend the definition of Q/C maps to include global Q/C maps , which describe the behavior of entire networks . Global maps , denoted by Qf and Cf for a given network f , can be computed by applying the above rules for each layer in f . For example , the global C map of a three-layer network f is simply Cf ( c ) = C ◦ C ◦ C ( c ) . Like the local C map , global C maps are positive definite functions ( see Appendix A.4 ) . In this work , we restrict our attention to the family of networks comprising of combined layers , and normalized sums between the output of multiple affine layers , for which we can compute global Q/C maps . For all the theorems in this work , we assume this family of networks .
This paper studied the problem of DNN training and generalization in vanilla architecture (without BN and Skip Connections in ResNets). It follows NTK theory and the approach of applying certain transformations to the activation functions. This work improves an existing work DKS, and solves its incompatibility to ReLU activations ("Leaky" ReLUs). This work introduces the necessary modifications to the Q/C map conditions for using Leaky ReLUs and shows empirical improvement over DKS or an easier method EOC on ImageNet.
SP:a8e70c04bc1fdbb5fa33e164c705074b8221a12f
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
1 INTRODUCTION Thanks to many architectural and algorithmic innovations , the recent decade has witnessed the unprecedented success of deep learning in various high-profile challenges , e.g. , the ImageNet recognition task ( Krizhevsky et al. , 2012 ) , the challenging board game of Go ( Silver et al. , 2017 ) and human-like text generation ( Brown et al. , 2020 ) . Among them , shortcut connections ( He et al. , 2016a ; Srivastava et al. , 2015 ) and normalization layers ( Ioffe & Szegedy , 2015 ; Ba et al. , 2016 ) are two architectural components of modern networks that are critically important for achieving fast training at very high depths , and feature prominently in the ubiquitous ResNet architecture of He et al . ( 2016b ) . Despite the success of ResNets , there is significant evidence to suggest that the primary reason they work so well is that they resemble ensembles of shallower networks during training ( Veit et al. , 2016 ) , which lets them avoid the common pathologies associated with very deep networks ( e.g . Hochreiter et al. , 2001 ; Duvenaud et al. , 2014 ) . In this sense , the question of whether truly deep networks can be efficient and effectively trained on challenging tasks remains an open one . As argued by Oyedotun et al . ( 2020 ) and Ding et al . ( 2021 ) , the multi-branch topology of ResNets also has certain drawbacks . For example , it is memory-inefficient at inference time , as the input to every residual block has to be kept in memory until the final addition . In particular , the shortcut branches in ResNet-50 account for about 40 % of the memory usage by feature maps . Also , the classical interpretation of why deep networks perform well – because of the hierarchical feature representations they produce – does not strictly apply to ResNets , due to their aforementioned tendency to behave like ensembles of shallower networks . Beyond the drawbacks of ResNets , training vanilla deep neural networks ( which we define as networks without shortcut connections or normalization layers ) is an interesting research problem in its own right , and finding a solution could open the path to discovering new model architectures . However , recent progress in this direction has not fully succeeded in matching the generalization performance of ResNets . Schoenholz et al . ( 2017 ) used a mean-field analysis of deep MLPs to choose variances for the initial weights and bias parameters , and showed that the resulting method – called Edge of Chaos ( EOC ) – allowed vanilla networks to be trained at very high depths on small datasets . Building on EOC , and incorporating dynamical isometry theory , Xiao et al . ( 2018 ) was able to train vanilla networks with Tanh units1 at depths of up to 10,000 . While impressive , these EOC-initialized networks trained significantly slower than standard ResNets of the same depth , and also exhibited significantly worse generalization performance . While Oyedotun et al . ( 2020 ) was able to narrow the generalization gap between vanilla networks and ResNets , their experiments were limited to networks with only 30 layers , and their networks required many times more parameters . More recently , Martens et al . ( 2021 ) introduced a method called Deep Kernel Shaping ( DKS ) for initializing and transforming networks ( and their activation functions ) based on an analysis of their initialization-time kernel properties . They showed that their approach enabled vanilla networks to train faster than previous methods , even matching the speed of similarly sized ResNets when combined with stronger optimizers like K-FAC ( Martens & Grosse , 2015 ; Grosse & Martens , 2016 ) or Shampoo ( Anil et al. , 2020 ) . However , their method isn ’ t fully compatible with ReLUs , and in their experiments ( which focused on training speed ) their networks exhibited significantly more overfitting than ResNets . Inspired by both DKS and the line of work using mean-field theory , we propose a new method called Tailored Activation Transformation ( TAT ) . TAT inherits the main advantages of DKS , while working particularly well with the “ Leaky ReLU ” activation function . While being easy to implement and introducing negligible extra computational cost , TAT enables very deep vanilla neural networks to be trained on ImageNet without the use of any additional architectural elements . Using TAT , we demonstrate for the first time that a 50-layer vanilla deep network can nearly match the validation accuracy of its ResNet counterpart when trained on Imagenet . And unlike with the EOC method , validation accuracy we achieve does not decrease with depth ( see Figure 1 ) . Furthermore , TAT can also be applied to ResNets without normalization layers , allowing them to match or even exceed the validation accuracy of standard ResNets of the same width/depth . 2 BACKGROUND . Our main tool of analysis will be kernel functions for neural networks ( Neal , 1996 ; Cho & Saul , 2009 ; Daniely et al. , 2016 ) and the related Q/C maps ( Saxe et al. , 2013 ; Poole et al. , 2016 ; Martens et al. , 2021 ) . In this section , we introduce our notation and some key concepts used throughout . 2.1 KERNEL FUNCTION APPROXIMATION FOR WIDE NETWORKS . For simplicity , we start with the kernel function approximation for feedforward fully-connected networks , and discuss its extensions to convolutional networks and non-feedforward networks later . In particular , we will assume a network that is defined by a sequence of L combined layers ( each of which is an affine transformation followed by the elementwise activation function φ ) as follows : xl+1 = φ ( Wlx l + bl ) ∈ Rdl+1 , ( 1 ) with weights Wl ∈ Rdl+1×dl initialized as Wl iid∼ N ( 0 , 1/dl ) ( or scale-corrected uniform orthogonal matrices ( Martens et al. , 2021 ) ) , and biases bl ∈ Rdl+1 initialized to zero . Due to the randomness of the initial parameters θ , the network can be viewed as random feature model f lθ ( x ) , x ` at each layer l ( with x0 = x ) at initialization time . This induces a random kernel defined as follows : κlf ( x1 , x2 ) = 1 dl f lθ ( x1 ) > f lθ ( x2 ) . ( 2 ) Given these assumptions , as the width of each layer goes to infinity , κlf ( x1 , x2 ) converges in probability ( see Theorem 3 ) to a deterministic kernel κ̃lf ( x1 , x2 ) that has a simple form , and can be computed layer by layer as follows : Σl+1 = Ez∼N ( 0 , Σl ) [ φ ( z ) φ ( z ) > ] , with Σl = [ κ̃lf ( x1 , x1 ) κ̃ l f ( x1 , x2 ) κ̃lf ( x1 , x2 ) κ̃ l f ( x2 , x2 ) ] , ( 3 ) where κ̃0f ( x1 , x2 ) = κ 0 f ( x1 , x2 ) = x > 1 x2/d0 . 1Dynamical isometry is unavailable for ReLU ( Pennington et al. , 2017 ) , even with orthogonal weights . 2.2 LOCAL Q/C MAPS . By equation 3 , any diagonal entry ql+1i of Σ l+1 only depends on the corresponding diagonal entry qli of Σl . Hence , we obtain the following recursion for these diagonal entries , which we call q values : ql+1i = Q ( q l i ) = Ez∼N ( 0 , qli ) [ φ ( z ) 2 ] = Ez∼N ( 0,1 ) [ φ ( √ qliz ) 2 ] , with q0i = ‖xi‖2/d0 ( 4 ) where Q is the local Q map . We note that qli is an approximation of κlf ( xi , xi ) . Analogously , one can write the recursion for the normalized off-diagonal entries , which we call c values , as : cl+1 = C ( cl , ql1 , ql2 ) = E [ z1z2 ] ∼N ( 0 , Σl ) [ φ ( z1 ) φ ( z2 ) ] √ Q ( ql1 ) Q ( ql2 ) , with Σl = [ ql1 √ ql1q l 2c l √ ql1q l 2c l ql2 ] , ( 5 ) where C is the local C map and c0 = x > 1 x2/d0 . We note that cl is an approximation of the cosine similarity between f lθ ( x1 ) and f l θ ( x2 ) . Because C is a three dimensional function , it is difficult to analyze , as the associated q values can vary wildly for distinct inputs . However , by scaling the inputs to have norm √ d0 , and rescaling φ so that Q ( 1 ) = 1 , it follows that qli = 1 for all l. This allows us to treat C as a one dimensional function from [ −1 , 1 ] to [ −1 , 1 ] satisfying C ( 1 ) = 1 . Additionally , it can be shown that C possesses special structure as a positive definite function ( see Appendix A.4 for details ) . Going forward , we will thus assume that q0i = 1 , and that φ is scaled so that Q ( 1 ) = 1 . 2.3 EXTENSIONS TO CONVOLUTIONAL NETWORKS AND MORE COMPLEX TOPOLOGIES . As argued in Martens et al . ( 2021 ) , Q/C maps can also be defined for convolutional networks if one adopts a Delta initialization ( Balduzzi et al. , 2017 ; Xiao et al. , 2018 ) , in which all weights except those in the center of the filter are initialized to zero . Intuitively , this makes convolutional networks behave like a collection of fully-connected networks operating independently over feature map locations . As such , the Q/C map computations for a feed-forward convolutional network are the same as above . Martens et al . ( 2021 ) also gives formulas to compute q and c values for weighted sum operations between the outputs of multiple layers ( without nonlinearities ) , thus allowing more complex network topologies . In particular , the sum operation ’ s output q value is given by q = ∑n i=1 w 2 i qi , and its output c value is given by 1q ∑n i=1 w 2 i qici . In order to maintain the property that all q values are 1 in the network , we will assume that sum operations are normalized in the sense that ∑n i=1 w 2 i = 1 . Following Martens et al . ( 2021 ) , we will extend the definition of Q/C maps to include global Q/C maps , which describe the behavior of entire networks . Global maps , denoted by Qf and Cf for a given network f , can be computed by applying the above rules for each layer in f . For example , the global C map of a three-layer network f is simply Cf ( c ) = C ◦ C ◦ C ( c ) . Like the local C map , global C maps are positive definite functions ( see Appendix A.4 ) . In this work , we restrict our attention to the family of networks comprising of combined layers , and normalized sums between the output of multiple affine layers , for which we can compute global Q/C maps . For all the theorems in this work , we assume this family of networks .
This paper mainly discusses the training of neural networks without residual connections. To close the gap between residual-free and regular models, an activation transformation technique named "Tailored Activation Transformation (TAT)" is introduced. Compared to the state-of-art method DKS, the proposed TAT can yield better results for models using ReLU-family activation. Overall the motivation is well-discussed and sufficient ablation studies are provided.
SP:a8e70c04bc1fdbb5fa33e164c705074b8221a12f
Self-Distribution Distillation: Efficient Uncertainty Estimation
1 INTRODUCTION . Neural networks ( NNs ) have enjoyed much success in recent years achieving state-of-the-art performance on a large number of tasks within domains such as natural language processing ( Vaswani et al. , 2017 ) , speech recognition ( Hinton et al. , 2012 ) and computer vision ( Krizhevsky et al. , 2012 ) . Unfortunately , despite the prediction performance of NNs they are known to yield poor estimates of the uncertainties in their predictions—in knowing what they do not know ( Lakshminarayanan et al. , 2017 ; Guo et al. , 2017 ) . With the increasing application of neural network based systems in performing safety-critical tasks such as biometric identification ( Schroff et al. , 2015 ) , medical diagnosis ( De Fauw et al. , 2018 ) or fully autonomous driving ( Kendall et al. , 2019 ) , it becomes increasingly important to be able to robustly estimate the uncertainty in a model ’ s prediction . By having access to accurate measures of prediction uncertainty , a system can act in a more safe and informed manner . Ensemble methods , and related schemes , have become the standard approach for uncertainty estimation . Lakshminarayanan et al . ( 2017 ) proposed generating a deep ( random-seed ) ensemble by training each member model with a different initialisation and stochastic gradient descent ( SGD ) . Not only does this ensemble perform significantly better than a standard trained NN , it also displays better predictive uncertainty estimates . Although simple to implement , training and deploying an ensemble results in a linear increase in the computational cost . Alternatively Gal & Ghahramani ( 2016 ) introduced the Monte Carlo ( dropout ) ensemble ( MC ensemble ) which at test time estimates predictive uncertainty by sampling members of an ensemble using dropout . Though this approach generally does not perform as well as a deep ensemble ( given the same computational power and neglecting memory ) ( Lakshminarayanan et al. , 2017 ) , it is significantly cheaper to train as it integrates the ensemble generation method into training . Despite ensemble generation methods being computationally more expensive , they have an important ability to decompose predictive ( total ) uncertainty into data and knowledge uncertainty ( Depeweg et al. , 2018 ; Gal & Ghahramani , 2016 ) . Knowledge or epistemic uncertainty refers to the lack of knowledge or ignorance about the most optimal choice of model ( parameters ) ( Hüllermeier & Waegeman , 2021 ) . As additional data is collected , the uncertainty in model parameters should decrease . This form of uncertainty becomes important whenever the model is tasked with making predictions for out-of-distribution data-points . For in-distribution inputs , it is expected that the trained model can return reliable predictions . On the other hand data or aleatoric uncertainty , represents inherent noise in the data being modelled , for example from overlapping classes . Even if more data is collected , this type of noise is inherent to the process and can not be avoided or reduced ( Malinin & Gales , 2018 ; Gal & Ghahramani , 2016 ; Ovadia et al. , 2019 ) The ability to decompose and distinguish between these sources of uncertainty is important as it allows the cause of uncertainty in the prediction to be known and how it should be used in downstream tasks ( Houlsby et al. , 2011 ; Kirsch et al. , 2019 ) . Summary of contributions : In this work we make two important contributions to NN classifier training and uncertainty prediction . First we introduce self-distribution distillation ( S2D ) , a new general training approach that in an integrated , simultaneous fashion , trains a teacher ensemble and distribution distils the knowledge to a student . This integrated training allows the user to bypass training a separate expensive teacher ensemble while distribution distillation ( Malinin et al. , 2020 ) allows the student to capture the diversity and model a distribution over ensemble member predictions . Additionally , distribution distillation would give the student the ability to estimate both data and knowledge uncertainty in a single forward pass unlike standard NNs which inherently can not decompose predictive uncertainty , and unlike ensemble methods which can not perform the decomposition in a single pass . Second , we train an ensemble of these newly introduced models and investigate different distribution distillation techniques giving rise to hierarchical distributions over predictions for uncertainty . This approach is useful when there are no , or few , computational constraints in the training phase but still require robust uncertainties and efficiency in the deployment stage . 2 BACKGROUND AND RELATED WORK . This section describes two techniques for uncertainty estimation . First , ensemble methods for predictive uncertainty estimation will be viewed from a Bayesian viewpoint . Second , a specific form of distillation for efficient uncertainty estimation will be discussed . 2.1 ENSEMBLE METHODS . From a Bayesian perspective the parameters , θ , of a neural net are treated as random variables with some prior distribution p ( θ ) . Together with the training dataD , this allows the posterior distribution p ( θ|D ) to be derived . To obtain the predictive distribution over all classes y ∈ Y ( for some input x∗ ) marginalisation over θ is required : P ( y|x∗ , D ) = Ep ( θ|D ) [ P ( y|x∗ , θ ) ] ( 1 ) Since finding the true posterior is intractable a variational approximation p ( θ|D ) ≈ q ( θ ) is made ( Jordan et al. , 1999 ; Blundell et al. , 2015 ; Graves , 2011 ; Maddox et al. , 2019 ) . Furthermore , marginalising over all weight values remains intractable leading to a sampling ensemble , approximation method ( Gal & Ghahramani , 2016 ; Lakshminarayanan et al. , 2017 ) : P ( y|x∗ , D ) ≈ 1 M M∑ m=1 P ( y|x∗ , θ ( m ) ) , θ ( m ) ∼ q ( θ ) ( 2 ) Here , an ensemble generation method is required to obtain the predictive distribution and uncertainty . Two previously mentioned approaches to generate an ensemble are deep ( naive ) randomseed and MC-dropout ensemble1 . Deep ensembles are based on training M models on the same data but with different initialisations leading to functionally different solutions . On the other hand , a MC-dropout ensemble explicitly defines a variational approximation through the hyper-parameters of dropout ( Srivastava et al. , 2014 ) ( used during training ) , allowing for straightforward sampling of model parameters . Another approach , SWA-Gaussian ( Maddox et al. , 2019 ) , finds a Gaussian approximation based on the first two moments of stochastic gradient descent iterates . Unlike the deep ensemble approach , and similar to MC-dropout , this method allows for simple and efficient sampling but suffers from higher memory consumption . Even a diagonal Gaussian approximation 1In-depth comparisons of ensemble methods were conducted in Ovadia et al . ( 2019 ) ; Ashukha et al . ( 2020 ) requires twice the memory of a standard network . There also exists alternative memory and/or compute efficient ensemble approaches such as BatchEnsembles ( Wen et al. , 2020 ) and MIMO ( Havasi et al. , 2021 ) . While the former approach is parameter efficient it requires multiple forward passes at test time similar to MC ensembles . The latter avoids this issue by the use of independent subnetworks within a single deep model leading to both efficient training and testing in terms of computational and memory costs . However , MIMO still requires multiple output heads at test time ; this is an issue when scaling to large scale classification tasks where the output layer has tens or hundreds of thousands classes . Given an ensemble , the goal is to estimate and decompose the predictive uncertainty . First , the entropy of the predictive distribution P ( y|x∗ , D ) can be seen as a measure of total uncertainty . Second , this can be decomposed ( Depeweg et al. , 2018 ; Kendall & Gal , 2017 ) as : H [ P ( y|x∗ , D ) ] ︸ ︷︷ ︸ Total Uncertainty = I [ y , θ|x∗ , D ] ︸ ︷︷ ︸ Knowledge Uncertainty + Ep ( θ|D ) [ H [ P ( y|x∗ , θ ) ] ] ︸ ︷︷ ︸ Data Uncertainty ( 3 ) where I is mutual information and H represents entropy . This specific decomposition allows total uncertainty to be decomposed into separate estimates of knowledge and data uncertainty . Furthermore , the conditional mutual information can be rephrased as : I [ y , θ|x∗ , D ] = Ep ( θ|D ) [ KL ( P ( y|x∗ , θ ) ∥∥ P ( y|x∗ , D ) ) ] ( 4 ) For an in-domain sample x∗ the mutual information should be low as appropriately trained models P ( y|x∗ , θ ) should be close to the predictive distribution . High predictive uncertainty will only occur if the input exists in a region of high data uncertainty , for example when an input has significant class overlap . When the input x∗ is out-of-distribution of the training data , one should expect inconsistent , different , predictions P ( y|x∗ , θ ) leading to a much higher knowledge uncertainty estimate . 2.2 ENSEMBLE ( DISTRIBUTION ) DISTILLATION . Ensemble methods have generally shown superior performance on a range of tasks but suffer from being computationally expensive . To tackle this issue , a technique called knowledge distillation ( KD ) and its variants were developed for transferring the knowledge of an ensemble ( teacher ) into a single ( student ) model while maintaining good performance ( Hinton et al. , 2014 ; Kim & Rush , 2016 ; Guo et al. , 2020 ) . This is generally achieved by minimising the KL-divergence between the student prediction and the predictive distribution of the teacher ensemble . In essence , KD trains a new student model to predict the average prediction of its teacher model . However from the perspective of uncertainty estimation the student model no longer has any information about the diversity of various ensemble member predictions ; it was only trained to model the average prediction . Hence , it is no longer possible to decompose the total uncertainty into different sources , only the total uncertainty can be obtained from the student . To tackle this issue ensemble distribution distillation ( En2D ) was developed ( Malinin et al. , 2020 ) . Let π signify a categorical distribution , that is πc = P ( y = ωc|π ) . The goal is to directly model the space of categorical predictions { π ( m ) = f ( x∗ ; θ ( m ) ) } Mm=1 made by the ensemble . In work developed by Malinin et al . ( 2020 ) this is done by letting a student model ( with weights φ ) predict the parameters of a Dirichlet , which is a continuous distribution over categorical distributions : p ( π|x∗ , φ ) = Dir ( π ; α ) , α = f ( x∗ ; φ ) ( 5 ) The key idea in this concept is that we are not directly interested in the posterior p ( θ|D ) but how predictions π for particular inputs behave when induced by this posterior . Therefore , it is possible to replace p ( θ|D ) with a trained distribution p ( π|x∗ , φ ) . It is now necessary to train the student given the information from the teacher which is straightforwardly done using negative log-likelihood : L ( φ ) = − 1 M M∑ m=1 ln Dir ( π ( m ) ; α ) ( 6 ) A decomposable estimate of total uncertainty is then possible by using conditional mutual information between the class y and prediction π instead of θ Malinin & Gales ( 2018 ) : H [ P ( y|x∗ , φ ) ] ︸ ︷︷ ︸ Total Uncertainty = I [ y , π|x∗ , φ ] ︸ ︷︷ ︸ Knowledge Uncertainty + Ep ( π|x∗ , φ ) [ H [ P ( y|π ) ] ] ︸ ︷︷ ︸ Data Uncertainty ( 7 ) This decomposition has a similar interpretation to eq . ( 3 ) . Using a Dirichlet model , these uncertainties can be found using a single forward pass , achieving a much higher level of efficiency compared to an ensemble . Assuming this distillation technique is successful , the distribution distilled student should be able to closely emulate the ensemble and be able to estimate similar high quality uncertainties on both ID and OOD data . However , ensemble distribution distillation is only applicable and useful when the ensemble members are not overconfident and display diversity in their predictions—there is no need in capturing diversity when there is none . It is often the case that , for example , convolutional neural networks are over-parameterised , display severe overconfidence and can essentially achieve perfect training accuracy restricting the effectiveness of this method ( Guo et al. , 2017 ; Seo et al. , 2019 ; Ryabinin et al. , 2021 ) . Furthermore , this method can only be used when an ensemble is available , leading to a high training cost .
The paper proposes an ensemble distillation approach, in which one network is used as feature extractor and "two heads" (two networks representing teacher and student) are added to the network for self-distillation. The multiple teacher predictions can be generated through by adding multiplicative Gaussian noise. The distillation approach follows Malinin et al. [1] who proposes to model the predictive distribution with a Dirichlet and predicts the parameter of the Dirichlet distribution (instead of predicting the Categorial distribution). This approach can be both used for model distillation and ensemble distillation. The authors evaluated their models on CIFAR-100, LSUN, SVHN w.r.t. classification performance, calibration and out-of-distribution detection.
SP:7819ce9440a684398e2958e908a55022ac70b890
Self-Distribution Distillation: Efficient Uncertainty Estimation
1 INTRODUCTION . Neural networks ( NNs ) have enjoyed much success in recent years achieving state-of-the-art performance on a large number of tasks within domains such as natural language processing ( Vaswani et al. , 2017 ) , speech recognition ( Hinton et al. , 2012 ) and computer vision ( Krizhevsky et al. , 2012 ) . Unfortunately , despite the prediction performance of NNs they are known to yield poor estimates of the uncertainties in their predictions—in knowing what they do not know ( Lakshminarayanan et al. , 2017 ; Guo et al. , 2017 ) . With the increasing application of neural network based systems in performing safety-critical tasks such as biometric identification ( Schroff et al. , 2015 ) , medical diagnosis ( De Fauw et al. , 2018 ) or fully autonomous driving ( Kendall et al. , 2019 ) , it becomes increasingly important to be able to robustly estimate the uncertainty in a model ’ s prediction . By having access to accurate measures of prediction uncertainty , a system can act in a more safe and informed manner . Ensemble methods , and related schemes , have become the standard approach for uncertainty estimation . Lakshminarayanan et al . ( 2017 ) proposed generating a deep ( random-seed ) ensemble by training each member model with a different initialisation and stochastic gradient descent ( SGD ) . Not only does this ensemble perform significantly better than a standard trained NN , it also displays better predictive uncertainty estimates . Although simple to implement , training and deploying an ensemble results in a linear increase in the computational cost . Alternatively Gal & Ghahramani ( 2016 ) introduced the Monte Carlo ( dropout ) ensemble ( MC ensemble ) which at test time estimates predictive uncertainty by sampling members of an ensemble using dropout . Though this approach generally does not perform as well as a deep ensemble ( given the same computational power and neglecting memory ) ( Lakshminarayanan et al. , 2017 ) , it is significantly cheaper to train as it integrates the ensemble generation method into training . Despite ensemble generation methods being computationally more expensive , they have an important ability to decompose predictive ( total ) uncertainty into data and knowledge uncertainty ( Depeweg et al. , 2018 ; Gal & Ghahramani , 2016 ) . Knowledge or epistemic uncertainty refers to the lack of knowledge or ignorance about the most optimal choice of model ( parameters ) ( Hüllermeier & Waegeman , 2021 ) . As additional data is collected , the uncertainty in model parameters should decrease . This form of uncertainty becomes important whenever the model is tasked with making predictions for out-of-distribution data-points . For in-distribution inputs , it is expected that the trained model can return reliable predictions . On the other hand data or aleatoric uncertainty , represents inherent noise in the data being modelled , for example from overlapping classes . Even if more data is collected , this type of noise is inherent to the process and can not be avoided or reduced ( Malinin & Gales , 2018 ; Gal & Ghahramani , 2016 ; Ovadia et al. , 2019 ) The ability to decompose and distinguish between these sources of uncertainty is important as it allows the cause of uncertainty in the prediction to be known and how it should be used in downstream tasks ( Houlsby et al. , 2011 ; Kirsch et al. , 2019 ) . Summary of contributions : In this work we make two important contributions to NN classifier training and uncertainty prediction . First we introduce self-distribution distillation ( S2D ) , a new general training approach that in an integrated , simultaneous fashion , trains a teacher ensemble and distribution distils the knowledge to a student . This integrated training allows the user to bypass training a separate expensive teacher ensemble while distribution distillation ( Malinin et al. , 2020 ) allows the student to capture the diversity and model a distribution over ensemble member predictions . Additionally , distribution distillation would give the student the ability to estimate both data and knowledge uncertainty in a single forward pass unlike standard NNs which inherently can not decompose predictive uncertainty , and unlike ensemble methods which can not perform the decomposition in a single pass . Second , we train an ensemble of these newly introduced models and investigate different distribution distillation techniques giving rise to hierarchical distributions over predictions for uncertainty . This approach is useful when there are no , or few , computational constraints in the training phase but still require robust uncertainties and efficiency in the deployment stage . 2 BACKGROUND AND RELATED WORK . This section describes two techniques for uncertainty estimation . First , ensemble methods for predictive uncertainty estimation will be viewed from a Bayesian viewpoint . Second , a specific form of distillation for efficient uncertainty estimation will be discussed . 2.1 ENSEMBLE METHODS . From a Bayesian perspective the parameters , θ , of a neural net are treated as random variables with some prior distribution p ( θ ) . Together with the training dataD , this allows the posterior distribution p ( θ|D ) to be derived . To obtain the predictive distribution over all classes y ∈ Y ( for some input x∗ ) marginalisation over θ is required : P ( y|x∗ , D ) = Ep ( θ|D ) [ P ( y|x∗ , θ ) ] ( 1 ) Since finding the true posterior is intractable a variational approximation p ( θ|D ) ≈ q ( θ ) is made ( Jordan et al. , 1999 ; Blundell et al. , 2015 ; Graves , 2011 ; Maddox et al. , 2019 ) . Furthermore , marginalising over all weight values remains intractable leading to a sampling ensemble , approximation method ( Gal & Ghahramani , 2016 ; Lakshminarayanan et al. , 2017 ) : P ( y|x∗ , D ) ≈ 1 M M∑ m=1 P ( y|x∗ , θ ( m ) ) , θ ( m ) ∼ q ( θ ) ( 2 ) Here , an ensemble generation method is required to obtain the predictive distribution and uncertainty . Two previously mentioned approaches to generate an ensemble are deep ( naive ) randomseed and MC-dropout ensemble1 . Deep ensembles are based on training M models on the same data but with different initialisations leading to functionally different solutions . On the other hand , a MC-dropout ensemble explicitly defines a variational approximation through the hyper-parameters of dropout ( Srivastava et al. , 2014 ) ( used during training ) , allowing for straightforward sampling of model parameters . Another approach , SWA-Gaussian ( Maddox et al. , 2019 ) , finds a Gaussian approximation based on the first two moments of stochastic gradient descent iterates . Unlike the deep ensemble approach , and similar to MC-dropout , this method allows for simple and efficient sampling but suffers from higher memory consumption . Even a diagonal Gaussian approximation 1In-depth comparisons of ensemble methods were conducted in Ovadia et al . ( 2019 ) ; Ashukha et al . ( 2020 ) requires twice the memory of a standard network . There also exists alternative memory and/or compute efficient ensemble approaches such as BatchEnsembles ( Wen et al. , 2020 ) and MIMO ( Havasi et al. , 2021 ) . While the former approach is parameter efficient it requires multiple forward passes at test time similar to MC ensembles . The latter avoids this issue by the use of independent subnetworks within a single deep model leading to both efficient training and testing in terms of computational and memory costs . However , MIMO still requires multiple output heads at test time ; this is an issue when scaling to large scale classification tasks where the output layer has tens or hundreds of thousands classes . Given an ensemble , the goal is to estimate and decompose the predictive uncertainty . First , the entropy of the predictive distribution P ( y|x∗ , D ) can be seen as a measure of total uncertainty . Second , this can be decomposed ( Depeweg et al. , 2018 ; Kendall & Gal , 2017 ) as : H [ P ( y|x∗ , D ) ] ︸ ︷︷ ︸ Total Uncertainty = I [ y , θ|x∗ , D ] ︸ ︷︷ ︸ Knowledge Uncertainty + Ep ( θ|D ) [ H [ P ( y|x∗ , θ ) ] ] ︸ ︷︷ ︸ Data Uncertainty ( 3 ) where I is mutual information and H represents entropy . This specific decomposition allows total uncertainty to be decomposed into separate estimates of knowledge and data uncertainty . Furthermore , the conditional mutual information can be rephrased as : I [ y , θ|x∗ , D ] = Ep ( θ|D ) [ KL ( P ( y|x∗ , θ ) ∥∥ P ( y|x∗ , D ) ) ] ( 4 ) For an in-domain sample x∗ the mutual information should be low as appropriately trained models P ( y|x∗ , θ ) should be close to the predictive distribution . High predictive uncertainty will only occur if the input exists in a region of high data uncertainty , for example when an input has significant class overlap . When the input x∗ is out-of-distribution of the training data , one should expect inconsistent , different , predictions P ( y|x∗ , θ ) leading to a much higher knowledge uncertainty estimate . 2.2 ENSEMBLE ( DISTRIBUTION ) DISTILLATION . Ensemble methods have generally shown superior performance on a range of tasks but suffer from being computationally expensive . To tackle this issue , a technique called knowledge distillation ( KD ) and its variants were developed for transferring the knowledge of an ensemble ( teacher ) into a single ( student ) model while maintaining good performance ( Hinton et al. , 2014 ; Kim & Rush , 2016 ; Guo et al. , 2020 ) . This is generally achieved by minimising the KL-divergence between the student prediction and the predictive distribution of the teacher ensemble . In essence , KD trains a new student model to predict the average prediction of its teacher model . However from the perspective of uncertainty estimation the student model no longer has any information about the diversity of various ensemble member predictions ; it was only trained to model the average prediction . Hence , it is no longer possible to decompose the total uncertainty into different sources , only the total uncertainty can be obtained from the student . To tackle this issue ensemble distribution distillation ( En2D ) was developed ( Malinin et al. , 2020 ) . Let π signify a categorical distribution , that is πc = P ( y = ωc|π ) . The goal is to directly model the space of categorical predictions { π ( m ) = f ( x∗ ; θ ( m ) ) } Mm=1 made by the ensemble . In work developed by Malinin et al . ( 2020 ) this is done by letting a student model ( with weights φ ) predict the parameters of a Dirichlet , which is a continuous distribution over categorical distributions : p ( π|x∗ , φ ) = Dir ( π ; α ) , α = f ( x∗ ; φ ) ( 5 ) The key idea in this concept is that we are not directly interested in the posterior p ( θ|D ) but how predictions π for particular inputs behave when induced by this posterior . Therefore , it is possible to replace p ( θ|D ) with a trained distribution p ( π|x∗ , φ ) . It is now necessary to train the student given the information from the teacher which is straightforwardly done using negative log-likelihood : L ( φ ) = − 1 M M∑ m=1 ln Dir ( π ( m ) ; α ) ( 6 ) A decomposable estimate of total uncertainty is then possible by using conditional mutual information between the class y and prediction π instead of θ Malinin & Gales ( 2018 ) : H [ P ( y|x∗ , φ ) ] ︸ ︷︷ ︸ Total Uncertainty = I [ y , π|x∗ , φ ] ︸ ︷︷ ︸ Knowledge Uncertainty + Ep ( π|x∗ , φ ) [ H [ P ( y|π ) ] ] ︸ ︷︷ ︸ Data Uncertainty ( 7 ) This decomposition has a similar interpretation to eq . ( 3 ) . Using a Dirichlet model , these uncertainties can be found using a single forward pass , achieving a much higher level of efficiency compared to an ensemble . Assuming this distillation technique is successful , the distribution distilled student should be able to closely emulate the ensemble and be able to estimate similar high quality uncertainties on both ID and OOD data . However , ensemble distribution distillation is only applicable and useful when the ensemble members are not overconfident and display diversity in their predictions—there is no need in capturing diversity when there is none . It is often the case that , for example , convolutional neural networks are over-parameterised , display severe overconfidence and can essentially achieve perfect training accuracy restricting the effectiveness of this method ( Guo et al. , 2017 ; Seo et al. , 2019 ; Ryabinin et al. , 2021 ) . Furthermore , this method can only be used when an ensemble is available , leading to a high training cost .
This paper contributes to neural network classifier training and uncertainty prediction. It proposes a self-distribution distillation method that can train a single model to estimate uncertainties in an integrated training phase. Also, it is flexible to be extended to build ensembles of models in the training phase and efficiently deployed in the test phase. Experiments are done on both classification and out-of-distribution detection tasks to show effectiveness.
SP:7819ce9440a684398e2958e908a55022ac70b890
Robust Cross-Modal Semi-supervised Few Shot Learning
1 INTRODUCTION . Despite the impressive success of deep learning models , frequently it requires massive amount of training data to fully demonstrate the potential of the model . In contrast , human is capable of learning new concepts given limited data . Consequently , few-shot learning gathers extensive research interest due to the capabilities of learning new concepts from limited training data . Nevertheless , the success of few-shot learning requires careful handling to robustness and generalization as it is extremely susceptible to noisy labels , outliers as well as adversarial attack Lu et al . ( 2020a ) . For instance , in order to automatically recognize several kinds of uncommon animals , only a few annotated images for them are available due to their rarity . Moreover , the images could potentially be corrupted due to an uncontrollable shooting environment or an instrumental malfunction . To mitigate this , one common approach to few shot learning is meta-learning Ren et al . ( 2018 ) , where the goal is to learn a classifier to distinguish between previously unseen classes , given labeled classes and a larger pool of unseen examples , some of which may belong to the classes of interest , namely semi-supervised few shot learning ( SFSL ) . Despite the impressive capabilities equipped the ability to leverage unlabeled examples for SFSL , the challenge of lacking novel samples remains to be a bottleneck . Besides visual information , textual data frequently contains rich information and more descriptive concepts for learning . Incorporating image-text multi-modal learning into the framework by training on image-text pairs provides an efficient tool to inject the diversity to the generation process Pahde1 et al . ( 2021 ) Pahde1 et al . ( 2018 ) . The work in Pahde1 et al . ( 2018 ) provides a benchmark for multimodal few-shot learning relying on a class-discriminative text conditional generative adversarial network . Later on , Pahde1 et al . ( 2021 ) tackles the multimodal few shot learning problem by employing a cross-modal feature generation network to infer the class membership of unseen samples with a simple nearest neighbor approach . Despite of the success of these methods with clean features and perfect labels , the important case that features and labels are contaminated due to out-of-distribution samples , adversarial attack and human fatigue is rarely studied . In parallel , Bayesian deep learning ( BDL ) has served as a powerful tool in terms of transforming the problem of posterior inference of a BDL model into the optimization of an objective function based on latent variables . Now the question then is : how to design a Bayesian deep learning which counters the noisy labels and outliers jointly in the multimodal semisupervised few-shot learning . Accordingly , this paper tackles this challenging problem in robust cross-modal few-shot learning by integrating a deep generative heterogenous model that generalizes well to multi-modality ( e.g . image-text modeling ) in order to counter noisy labels and outliers . Specifically , a robust heterogeneous variational auto-encoder is first proposed to encode the noisy visual features and labels in order to jointly learn the information from both modalities by placing the uncertainty prior on the top of the infinite Gaussian mixture models . Subsequently , a robust variational lower bound based on β-divergence is derived to infer the network parameters . Finally , a robust semi-supervised GAN is integrated with the heterogenous variational auto-encoder by collapsing the generator and the decoder into one to further boost the learning capabilities . RCFSL is built on top of Bayesian deep learning by fusing cross-modal information via the approximation of the joint posterior distributions . In contrast to modality-alignment methods Xing et al . ( 2019a ) Tsai et al . ( 2017 ) for robust few-shot learning , the robustness of RCFSL is achieved by accurate modeling of the complicated joint distribution of multi-modality data and robust variational inference by the derived lower bound . Distinct from the work in Xing et al . ( 2019b ) calculating linear combinations in the prototypical representation space , our fusion of multimodality features in the probability distribution is completely data-driven , yielding more robust classification performance in few-shot learning . Major contributions of this paper are : ( 1 ) RCFSL harnesses three levels of denoising to ensure the robustness of cross-modal semi-supervised few-shot learning : Firstly , motivated by Hou & Galata ( 2008 ) , it places the uncertainty prior of the parameters of an infinite Gaussian mixture distribution of image data to avoid mixture components collapsing onto a point or a hyperplane due to outliers . ( 2 ) Subsequently , the robust β-divergence is employed to replace Kullback-Leibler divergence used for data fitting to infer the network parameters and a novel evidence lower bound for semi-supervised few shot learning is derived . ( 3 ) Noise-transition layers are applied to both the heterogenous variational encoder and the robust discriminator in semi-supervised learning with an end-to-end training . The performance of RCFSL is further boosted with robust feature generation yielding 7 % to 10 % absolute accuracy improvement over STOA approaches . Related Work Previous work in multimodal few shot learning frequently tends to first learn text to image mapping to generate additional visual features and then calculate the joint prototype using a weighted average from two representations . Two recent approaches have attracted significant attention in the few-shot learning domain : Matching Networks Vinyals et al . ( 2016 ) , and Prototypical Networks Snell et al . ( 2017 ) where the sample set and the query set are embedded with a neural network , and nearest neighbor classification is exploited relying on a metric in the embedded space . In Oreshkin et al . ( 2018 ) , metric scaling and metric task conditioning are utilized to improve the performance of few-shot learning algorithms . Kim et al . ( 2018 ) and Finn et al . ( 2018 ) employ a probabilistic extension to model-agnostic meta-learning ( MAML ) framework trained with variational approximation so that the model can generalize well to a new task with a few fine-tuning updates . In Zhang et al . ( 2020 ) , a bidirectional joint image-text modeling was proposed and VHE-raster-scan-GAN was applied . RCFSL advances the work from Zhang et al . ( 2020 ) by improving the robustness of the multi-modal heterogenous encoder and extend the solution to semi-supervised few shot learning . In Tseng et al . ( 2020 ) , feature-wise transformation layers are utilized for augmenting the image features relying on affine transforms to simulate various feature distributions under different domains for few-shot learning . Different from Tseng et al . ( 2020 ) , RCFSL augments the robust feature generation from BDL perspective relying on robust semi-supervised GAN . Moreover , our method advances from other robust few shot learning such as Rapnets Lu et al . ( 2020b ) and Adversarial Query Goldblum et al . ( 2020 ) by providing mathmatically rigoriously denoising schemes via uncertainty priors and robust divergence in variational inference . 2 OUR METHOD . Our approach is to focus on first constructing a semi-supervised robust heterogeneous variational autoencoder leveraging a mixture model to encode both image and text data in few shot learning insensitive to both noisy labels and outliers . Subsequently , a novel robust variational lower bound is derived to facilitate the inference of network parameters relying on β-divergence for both labeled and unlabeled data . Finally , a robust generative adversairial network is integrated with denoising layers to strengthen the denoising performance togehter with the end-to-end optimization to generate additional visual features to alleviate the sparsity in the semi-supervised few shot learning . Let Ω denote image space , Υ denote text space and C = { 1 , . . . , R } be the discrete label space . Further let xi ∈ Ω as the i-th input image observation , ti ∈ Υ as its corresponding textual description and yi ∈ C as its label . Denote Cbase as base classes where we have both labeled and unlabeled samples and denote Cnovel novel classes , which are underrepresented in the data . Inspired by the fact that the student-t distribution is more robust to the outliers than Gaussian distribution by constraining the shapes of the mixture components from collapsing Hou & Galata ( 2008 ) , we propose to place uncertainty priors ( e.g . Gaussian priors ) on parameters of infinite Gaussian mixture models to characterize the influence of outliers on image data and constrain the shape of the components to prevent them from collapsing . The Heterogeneous Mixture Model : Variational autoencoder Diederik & Welling ( 2013 ) has been recently proposed as a powerful solution for semi-supervised learning . To the best of our knowledge , this is the first time that a robust heterogenous VAE model has been applied which naturally integrates noisy images and text together which cohesively fuse continuous and discrete multi-modality features . Variational inference are applied to fit the heterogenous model on both of image and text features ΨI from base classes Cbase , where the embedding is obtained from the last dense layer right before the softmax output in the discriminator . Once a good mapping ΨI based on heterogenous image and text data is learnt , given a test sample , the class membership is given by assigning the class label of the closest prototype to an unseen test sample . In particular , the heterogenous features are first fed into the Dirichlet process mixture and clustered based on their similarity measures , where here image features are modeled as infinite Gaussian mixture distribution Allen et al . ( 2019 ) to characterize the samples from the unseen classes by computing the posterior distribution for unrepresented clusters more accurately and inferring the number of classes automatically and text features are characterized by Poisson distribution . Specifically , xn is a noisy measurement of its true position and is a draw from the Gaussian mixture model , where the mean of each Gaussian component Tk is unknown and the variance Ck is known . In order to characterize the uncertainty and the outliers from the input , the Gaussian prior is placed on the top of the mean for each Gaussian component . Namely , Tk satisfies the normal distribution with the mean µk and the precision matrix Λk . ωi is the latent variable for the ith data point specifying which Gaussian it came from and π is the mixing weight for the Gaussian mixture model . Specifically , a NormalWishart prior Murphy ( 2007 ) is placed on the mean and precision of the Gaussian components : p ( µ , Λ ) = ∏K k=1N ( µk|m0 , ( β0Λk ) −1 ) W ( Λk|W0 , ν0 ) , where m0 is set to be zero and β0 is set to be a very small value . W ( Λ|W , ν ) is a Wishart distribution with scale matrix W and ν degrees of freedom . For text features after word embeddings , l and ζl are the prior shape and rate parameters respectively in the Gamma distribution that generates the average rate parameter for the l-th Poisson feature . In particular , the cluster assignments for each observation are drawn from multinomial distributions where the prior parameters represent the mixing weights of the corresponding clusters . Specifically , the truncated stick-breaking process is employed to construct mixing weights . By construction , a single parameter α controls the portion of the K − 1 major clusters , and χ separately controls for the portion of the remainder via a stick-breaking procedure Beta ( ( K − 1 ) α , χ ) Blei & Jordan ( 2017 ) . Namely , where ω = [ ω1 , . . . , ωK ] belongs to the ( K − 1 ) -dimensional simplex and is generated from a Dirichlet prior with two parameters p ( ω ) D̃ir ( α , . . . , α , χ ) . Typically , given the image data x and the textual features t , variational inference with deep learning from powerful probabilistic models are constructed by an inference neural network q ( z|x , t ) and a generative neural network p ( x , t|z ) . The generative model and the inference model are parameterized by θ and φ respectively . Subsequently , the network parameters are estimated by optimizing the evidence lower bound ( ELBO ) in the variational inference . For unsupervised learning of multimodality data , the vanilla VAEs are optimized by maximizing ELBO : ELBO = Epdata ( t , x ) [ L ( t , x ) ] , L ( x ) : = Ez∼q ( z|x , t ) [ ln p ( t|z ) ] −DKL [ q ( z|x , t ) //p ( z ) ] ( 1 ) The Generative and Inference Model : We shall now present the proposed generative and inference model for few-shot learning . Given a semi-supervised learning setting , the labels y are either unknown ( for unlabeled data ) or noisy ( for labeled data ) . The generative model is then defined as : pθ ( x , t|ω , T , C ) pθ ( T |Z , µ , Λ , λ ) pθ ( a|z , ỹ , x , t ) pθ ( x , t|ỹ , z ) p ( z ) p ( ỹ ) p ( ω ) p ( t|λ ) . Define pθ as the deep neural network with parameters θ and y as the ground truth of class label . For unlabeled data , y is considered as a latent variable . Further denote Cat ( . ) as a multinomial distribution and in this paper we reasonably assume that the labels are of categorical distribution and the proposed model applies to other distributions for the latent variable y . In order to fit more complicated posteriors for the marginal distribution p ( z|x , t ) and bridge the gap between two modalities , motivated by Maaløe et al . ( 2017 ) , we extend the variational distribution with auxiliary variables a , so that the generative model is invariant to marginalization over a p ( x , z , a , ω , T , C , µ , Λ ) = pθ ( x|ω , T , C ) pθ ( T |Z , µ , Λ ) pθ ( a|z , x ) pθ ( x , z ) . To attenuate the influence with the noisy labels , further denote ỹ as the corrupted labels and ŷ as the corrected label after denoising layer . Define K×K noise transition matrix M to associate ỹ with ŷ and estimation of M has been addressed in previous methods Sukhbaatar et al . ( 2015 ) Patrini et al . ( 2017 ) . In particular , M = ( Mi , j ) ∈ [ 0 , 1 ] c×c ( ∑ iMi , j = 1 ) . The proposed generative model can then be expressed as : p ( z ) = N ( z|0 , I ) , p ( ỹ ) = Cat ( ỹ|η ) , pθ ( a|z , ỹ , x , t ) = f ( a ; z , ỹ , x , t ) , pθ ( x , t|z , ỹ ) = f ( x , t ; z , ỹ , θ ) , p ( Tk|µk , Λk ) = N ( tk|µk , Λ−1k ) , p ( ŷ = i|ỹ = j ) = Mij , ( 2 ) p ( x , t|T , C , λ ) = N ( xn|tk , Ck ) ∏Nl n=1N ( tn|tỹn , Cỹn ) λkexp−λ k ! if the jth cluster is represented p ( x , t|T , C , λ ) = ∫ p ( xn|tk , Ck ) p ( tk|µk , Λk ) p ( µk , Λk ) dµkdΛk λ kexp−λ k ! if the jth cluster is unrepresented The inference model can be represented as : qφ ( a , z , µ , Λ , T , ỹ , λ|x , t ) = q ( z|a , ỹ , x , t ) q ( a|x , t ) q ( ỹ|a , x , t ) q ( T , µ , Λ , λ|x , t ) qφ ( z|a , ỹ , x , t ) = N ( z|µφ ( a , ỹ , x , t ) , diag ( σ2 ) ) , qφ ( ỹ|a , x , t ) = Cat ( ỹ|ηφ ( a , x , t ) ) , qφ ( µk , Λk ) = q ( µk|Λk ) q ( Λk ) , q ( λl|t ) ∝ Gamma ( λl| l + ∑ i ψiktil , ζl + ∑ i ψik ) , ( 3 ) where q ( λl|t ) characterizes posterior variational density of Poisson parameters given the discrete embedded feature vectors t converted from text data . ψik stands for the probability of the ith observation belongs to the cluster k. til represents the l-th Poisson feature of the ith observation . Denote N−n , j as the number of data points , excluding xn which belongs to the mixture component j . To compute q ( T , µ , Λ , λ|x , t ) , mean-field approximation is applied Bishop ( 2006 ) to factorize all the latent variables and parameters for the represented and unrepresented jth cluster respectively : q ( T , µ , Λ , λ|x , t ) = N−n , jN−1+αN ( xn|tk , Ck ) ∏Nl n=1N ( tn|tỹn , Cỹn ) q ( λl|t ) q ( T , µ , Λ , λ|x , t ) = αN−1+α ∫ p ( xn|tk , Ck ) p ( tk|µk , Λk ) p ( µk , Λk ) dµkdΛkq ( λl|t ) ( 4 ) The above equation indicates that given the multimodality data , the unlabeled samples has a certain probability of being classified as unrepresented mixtures ( e.g . unseen new classes ) , which facilitates the learning capabilities of the proposed robust semi-supervised few shot learning . Within an iteration , some unlabeled samples are associated with unrepresented mixtures , a new represented mixtures will emerge which successfully addressed the challenges in semi-supervised few shot learning when the unlabeled data contains unseen new classes which doesnot exist in labeled data . Robust Variational Lower Bound : To further alleviate the impact from outliers , the robust divergence is employed to infer network parameters more accurately . The theoretical foundation of β-divergence has been initially defined at Basu et al . ( 1998 ) , where the β-divergence between two functions g and f are defined as Dβ ( g ‖ f ) = 1 β ∫ g ( x ) 1+βdx+ ∫ f ( x ) 1+βdx− β + 1 β ∫ g ( x ) f ( x ) βdx ( 5 ) When β → 0 , the β-divergence converges to KL-divergence , limβ→0Dβ ( g ‖ f ) = DKL ( g ‖ f ) . As described in Futami et al . ( 2018 ) , minimizing the β-divergence from the empirical distribution p̂ ( x ) to p ( x ; θ ) arg minθDβ ( p̂ ( x ) ‖ p ( x ; θ ) ) , it is easy to show 1N ∑N i=1 p ( xi ; θ ) β ∂ ln p ( xi ; θ ) ∂θ − Ep ( x ; θ ) [ p ( x ; θ ) β ∂ ln p ( x ; θ ) ∂θ ] . As the probability densities of outliers are usually much smaller than those of inliers , the first term of the above equation is the likelihood weighted according to the power of the probability density for each sample , which effectively suppress the likelihood of outliers . This estimator is also called asM -estimator Huber & Ronchetti ( 2011 ) , which provides provably superior performance in various machine applications Li & Gal ( 2017 ) . The variational lower bound for the proposed RCFSL model for labeled data can be represented as log p ( x , ỹ , t ) = ∫ a ∫ z ∫ T ∫ µ ∫ Λ ∫ λ ∫ ω log ( x , ỹ , a , z , T , µ , Λ , λ , t ) dadzdTdµdΛdλdω ≥ E [ log ( pθ ( a , z , T , µ , Λ , λ , ω , x , ỹ , t ) ) ] − E [ qφ ( a , z , T , µ , Λ , ω|x , t , ỹ ) ] = E [ log ( pθ ( a , z , T , µ , Λ , ω , x , t , ỹ ) ) ] −E [ qφ ( a|x , t ) ] − E [ qφ ( z|a , ỹ , x , t ) ] − E [ qφ ( T |µ , Λ , x ) ] − E [ qφ ( µ , Λ ) ] − E [ qφ ( ω|α ) ] − E [ qφ ( λ|t ) ] The above inequality can be rewritten as log p ( x , ỹ , t ) ≥ Eqφ ( a , z , T , µ , Λ , λ , ω|x , y , t ) [ log pθ ( a , z , T , µ , Λ , λ , x , ỹ , t ) qφ ( a , z , T , µ , Λ , λ , ω|x , ỹ , t ) ] = Eqφ ( a , z , T , µ , Λ , λ , ω|x , t , ỹ ) [ log ( pθ ( x , t , ỹ|a , z , T , µ , Λ , λ , ω ) ) ] + DKL [ q ( a , z , T , µ , Λ , λ|x , t , ỹ ) //p ( a , z , T , µ , Λ , λ ) ] ( 6 ) To mitigate the influence of outliers , let H = { a , z , T , ω , µ , Λ , λ } represent the set of all the latent variables and leverage the technique from Futami et al . ( 2018 ) , we can replace KL-divergence with β-Divergence and cast the β-ELBO for labeled data Lβ as : Lβ = ∫ q ( H|x , t , ỹ ) ( −β + 1 β N∑ i=1 p ( ỹi|H ; xi , ti ) β +N ∫ p ( ỹ|H ; x , t ) 1+βdỹ ) + DKL [ q ( H|x , t , ỹ ) //p ( H ) ] ( 7 ) For unlabeled data , by introducing the variational distribution for ỹ as qφ ( a , x , t|ỹ ) , the variational lower bound for the proposed RCFSL can be represented as log p ( x , t ) = ∫ a ∫ z ∫ T ∫ µ ∫ Λ ∫ ỹ log ( x , ỹ , a , z , T , µ , Λ ) dadzdTdµΛdỹ ≥ Eqφ ( a , ỹ , z , T , µ , Λ|x , t ) [ log pθ ( a , z , T , µ , Λ , x , t , λ , ỹ ) qφ ( a , z , T , µ , Λ , λ , ỹ|x , t ) ] = E [ log ( pθ ( a , z , T , µ , Λ , ω , λ , x , t , ỹ ) ) ] − E [ qφ ( a|x , t ) ] − E [ qφ ( ỹ|a , x , t ) ] −E [ qφ ( z|a , ỹ , x , t ) ] − E [ qφ ( T |µ , Λ , x ) ] − E [ qφ ( µ , Λ ) ] − E [ qφ ( ω|π ) ] − E [ qφ ( λ|t ) ] Similarly , replacing the KL-divergence with β-Divergence and augmenting the latent variableHu = { a , z , y , T , ω , µ , Λ , λ } , the β-ELBO for unlabeled data in RCFSL is : Uβ = ∫ q ( Hu|x , t ) ( − β + 1 β N∑ i=1 p ( xi , ti|Hu ) β + ∫ p ( x , t|Hu ) 1+βdx ) + DKL [ q ( Hu|x , t ) //p ( Hu ) ] , Practically , Lβ and Uβ are calculated via Monte Carlo sampling . The robustness of our proposed ELBO can be guaranteed leveraging the influence function ( IF ) Futami et al . ( 2018 ) Huber & Ronchetti ( 2011 ) . As IF is widely used to analyze how much contamination affects estimated statistics , it is straightforward to show that given the perturbation on the empirical cumulative distribution caused by outliers , it is straightforward to show that the IF of our posterior distribution is bounded . The objective function for robust cross-modal variational autoencoder is : LRCV AE = Lβ + λ1Uβ , where λ1 represents the weight to control the trade-off between the labeled data and unlabeled data . Robust Feature Generation : The construction of the proposed uncertainty priors and the robust divergence measure in our framework aims at better approximation of the posterior distribution under noisy labels and outliers . This is also related to employing generative adversarial learning of z and x , t defined by the data , the encoder , the prior and decoder . Different from VAEs that assumes parametric data distribution and perform posterior inference , GANs in general utilize implicit data distribution and do not provide meaningful latent representations . By learning both a generator G and a discriminator D , a min-max objective is optimized : min G max D { Ex , t∼pdata ( x , t ) [ ln ( D ( x , t ) ) ] + Ez∼p ( z ) [ ln ( 1−D ( G ( z ) ) ] } ( 8 ) In Kaneko et al . ( 2019 ) , a noise transition model is incorporated to learn a clean label conditional generative distribution . But their model only considered noisy labels without outliers and is limited to supervised learning . Recent work on semi-supervised GAN with k classes Kumar et al . ( 2017 ) Salimans et al . ( 2016 ) modify the discriminator with k + 1 outputs on the discriminator by considering the fake images as the k + 1th class . Hence , the loss for the training can be computed with a supervised loss and an unsupervised loss respectively : L = Lsup + Lunsup = −Ex , t , y∼pd ( x , t , y ) log pf ( y|x , t , y ≤ k ) − Ex , t∼pg ( x , t ) log ( pf ( y = k + 1|x , t ) ) − Ex , t∼pd ( x , t ) log ( 1− pf ( y = k + 1|x , t ) ) , ( 9 ) where Lsup represents the negative log probability of the label given the data is real . Denote D ( x , t ) = 1 − pf ( y = k + 1|x , t ) , the loss for semi-supervised GAN on multimodality data LsGAN can be written as : L = −Ex , t∼pd ( x , t ) logD ( x , t ) − Ez∼noise ( 1 − D ( G ( z ) ) ) − Ex , t , y∼pd ( x , t , y ) log pf ( y|x , t , y ≤ k ) . More recently , the label noise robust GAN ( rGAN ) Kaneko et al . ( 2019 ) has achieved promising performance in classifying images with noisy labels by incorporating a noise transition model to learn a clean label conditional generative distribution under noisy labels . Thus , given the noise samples ( x̃r , ỹr ) ∼ p̃d ( x , ỹ ) , to construct a label-noise robust conditional generator and discriminator , the objective function of the robust semi-supervised GAN in the proposed robust cross-modal semi-supervised few-shot learning is expressed as : LRSGAN = −Ex , t∼pd ( x , t ) log ( 1− C̃ ( ỹ = k+1|x , t ) ) −Ez∼noise ( 1−D ( G ( z ) ) ) −E ( x̃r , t , ỹr ) ∼p̃d ( x , t , ỹ ) log C̃ ( ỹ = ỹr|x , t , ỹ ≤ k ) = −Ex , t∼pd ( x , t ) log ( 1 −Mŷr , ỹr Ĉ ( ŷ = k + 1|x , t ) ) − Ez∼noise ( 1 − D ( G ( z ) ) ) − E ( x̃r , t , ỹr ) ∼p̃d ( x , t , ỹ ) log ∑ ŷr Mŷr , ỹr Ĉ ( ŷ = ŷ r|x , t , ŷ ≤ k ) . Without modeling the data distribution explicitly and representing the latent space in a meaningful manner , it does not provide the functionality to counter the outliers in the generator and discriminator . Motivated by the thought of bridging the gap between robust VAE and robust GAN , we feed the robust variational posterior p ( z|x , t ) instead of the random noise p ( z ) into the label noise robust semi-supervised GAN as the source of randomness as both of the decoder and the generator of RSGAN share the mapping from z to x and t. The full optimization function for the proposed RCFSL framework can be represented as : minGRCFSL maxD Epdata ( x , t ) [ L ( x , t ) ] L ( x , t ) : = lnD ( x , t ) + DKL [ q ( H|x , t , ỹ ) //p ( H ) ] + λ1DKL [ q ( Hu|x , t ) //p ( Hu ) ] + Ez∼q ( H|x , t , ỹ ) [ ln ( 1−D ( GRSGAN ( z ) ) + ( −β+1β ∑N i=1 p ( ỹi|H ; xi , ti ) β + N ∫ p ( ỹ|H ; x , t ) 1+βdỹ ] + λ1Ez∼q ( Hu|x , t ) [ ( − β+1 β ∑N i=1 p ( xi , ti|Hu ) β + λ1N ∫ p ( x , t|Hu ) 1+βdx ) ] , ( 10 ) where λ1 is set to be the ratio of unlabled samples verus labeled samples and the discriminator loss is characterized by E [ lnD ( x , t ) ] = −Ex , t∼pd ( x , t ) log ( 1 − Mŷr , ỹr Ĉ ( ŷ = k + 1|x , t ) ) − E ( x̃r , t , ỹr ) ∼p̃d ( x , t , ỹ ) log ∑ ŷr Mŷr , ỹr Ĉ ( ŷ = ŷ r|x , t , ŷ ≤ k ) . This new architecture is expected to better predict the class labels under the compound noise . We then train RCFSL including the robust heterogenous encoder , the generator and the robust discriminator in an end-to-end manner using adaptive moment estimation ( Adam ) Kingma & Ba ( 2015 ) . Each multimodal embedding prototype pc ( of category c ) is computed by averaging the embeddings of all support samples of class c. Once the robust embedding is obtained , the distance between the embedding of the query qt and the multimodal prototype pc is calculated by p ( y = c|pc ) = exp ( −d ( f ( qt ) , pc ) ) ∑ k exp ( −d ( f ( qt ) , pk ) ) where d refers to Euclidean distance and the query is classified as the class with the minimum distance .
The paper presents a cross-modal semi-supervised few-shot learning approach for image classification. The idea is to train variational auto-encoder (VAE) with both image and text data for learning a feature representation. Then features are extracted from a test sample and assigned to the class of the closest prototype train sample. In addition, a generative adversarial objective is employed for learning the latent code of the VAE. Since the proposed idea is meant for learning from noisy labels, there is an uncertainty prior in the image features as part of the infinite Gaussian mixture distribution. The approach is evaluated on standard few-shot learning benchmarks which are modified to account for the noise labels. The results are promising compared to the prior work.
SP:9de6cee2ba08db0f6086702122bb484aa48532f9
Robust Cross-Modal Semi-supervised Few Shot Learning
1 INTRODUCTION . Despite the impressive success of deep learning models , frequently it requires massive amount of training data to fully demonstrate the potential of the model . In contrast , human is capable of learning new concepts given limited data . Consequently , few-shot learning gathers extensive research interest due to the capabilities of learning new concepts from limited training data . Nevertheless , the success of few-shot learning requires careful handling to robustness and generalization as it is extremely susceptible to noisy labels , outliers as well as adversarial attack Lu et al . ( 2020a ) . For instance , in order to automatically recognize several kinds of uncommon animals , only a few annotated images for them are available due to their rarity . Moreover , the images could potentially be corrupted due to an uncontrollable shooting environment or an instrumental malfunction . To mitigate this , one common approach to few shot learning is meta-learning Ren et al . ( 2018 ) , where the goal is to learn a classifier to distinguish between previously unseen classes , given labeled classes and a larger pool of unseen examples , some of which may belong to the classes of interest , namely semi-supervised few shot learning ( SFSL ) . Despite the impressive capabilities equipped the ability to leverage unlabeled examples for SFSL , the challenge of lacking novel samples remains to be a bottleneck . Besides visual information , textual data frequently contains rich information and more descriptive concepts for learning . Incorporating image-text multi-modal learning into the framework by training on image-text pairs provides an efficient tool to inject the diversity to the generation process Pahde1 et al . ( 2021 ) Pahde1 et al . ( 2018 ) . The work in Pahde1 et al . ( 2018 ) provides a benchmark for multimodal few-shot learning relying on a class-discriminative text conditional generative adversarial network . Later on , Pahde1 et al . ( 2021 ) tackles the multimodal few shot learning problem by employing a cross-modal feature generation network to infer the class membership of unseen samples with a simple nearest neighbor approach . Despite of the success of these methods with clean features and perfect labels , the important case that features and labels are contaminated due to out-of-distribution samples , adversarial attack and human fatigue is rarely studied . In parallel , Bayesian deep learning ( BDL ) has served as a powerful tool in terms of transforming the problem of posterior inference of a BDL model into the optimization of an objective function based on latent variables . Now the question then is : how to design a Bayesian deep learning which counters the noisy labels and outliers jointly in the multimodal semisupervised few-shot learning . Accordingly , this paper tackles this challenging problem in robust cross-modal few-shot learning by integrating a deep generative heterogenous model that generalizes well to multi-modality ( e.g . image-text modeling ) in order to counter noisy labels and outliers . Specifically , a robust heterogeneous variational auto-encoder is first proposed to encode the noisy visual features and labels in order to jointly learn the information from both modalities by placing the uncertainty prior on the top of the infinite Gaussian mixture models . Subsequently , a robust variational lower bound based on β-divergence is derived to infer the network parameters . Finally , a robust semi-supervised GAN is integrated with the heterogenous variational auto-encoder by collapsing the generator and the decoder into one to further boost the learning capabilities . RCFSL is built on top of Bayesian deep learning by fusing cross-modal information via the approximation of the joint posterior distributions . In contrast to modality-alignment methods Xing et al . ( 2019a ) Tsai et al . ( 2017 ) for robust few-shot learning , the robustness of RCFSL is achieved by accurate modeling of the complicated joint distribution of multi-modality data and robust variational inference by the derived lower bound . Distinct from the work in Xing et al . ( 2019b ) calculating linear combinations in the prototypical representation space , our fusion of multimodality features in the probability distribution is completely data-driven , yielding more robust classification performance in few-shot learning . Major contributions of this paper are : ( 1 ) RCFSL harnesses three levels of denoising to ensure the robustness of cross-modal semi-supervised few-shot learning : Firstly , motivated by Hou & Galata ( 2008 ) , it places the uncertainty prior of the parameters of an infinite Gaussian mixture distribution of image data to avoid mixture components collapsing onto a point or a hyperplane due to outliers . ( 2 ) Subsequently , the robust β-divergence is employed to replace Kullback-Leibler divergence used for data fitting to infer the network parameters and a novel evidence lower bound for semi-supervised few shot learning is derived . ( 3 ) Noise-transition layers are applied to both the heterogenous variational encoder and the robust discriminator in semi-supervised learning with an end-to-end training . The performance of RCFSL is further boosted with robust feature generation yielding 7 % to 10 % absolute accuracy improvement over STOA approaches . Related Work Previous work in multimodal few shot learning frequently tends to first learn text to image mapping to generate additional visual features and then calculate the joint prototype using a weighted average from two representations . Two recent approaches have attracted significant attention in the few-shot learning domain : Matching Networks Vinyals et al . ( 2016 ) , and Prototypical Networks Snell et al . ( 2017 ) where the sample set and the query set are embedded with a neural network , and nearest neighbor classification is exploited relying on a metric in the embedded space . In Oreshkin et al . ( 2018 ) , metric scaling and metric task conditioning are utilized to improve the performance of few-shot learning algorithms . Kim et al . ( 2018 ) and Finn et al . ( 2018 ) employ a probabilistic extension to model-agnostic meta-learning ( MAML ) framework trained with variational approximation so that the model can generalize well to a new task with a few fine-tuning updates . In Zhang et al . ( 2020 ) , a bidirectional joint image-text modeling was proposed and VHE-raster-scan-GAN was applied . RCFSL advances the work from Zhang et al . ( 2020 ) by improving the robustness of the multi-modal heterogenous encoder and extend the solution to semi-supervised few shot learning . In Tseng et al . ( 2020 ) , feature-wise transformation layers are utilized for augmenting the image features relying on affine transforms to simulate various feature distributions under different domains for few-shot learning . Different from Tseng et al . ( 2020 ) , RCFSL augments the robust feature generation from BDL perspective relying on robust semi-supervised GAN . Moreover , our method advances from other robust few shot learning such as Rapnets Lu et al . ( 2020b ) and Adversarial Query Goldblum et al . ( 2020 ) by providing mathmatically rigoriously denoising schemes via uncertainty priors and robust divergence in variational inference . 2 OUR METHOD . Our approach is to focus on first constructing a semi-supervised robust heterogeneous variational autoencoder leveraging a mixture model to encode both image and text data in few shot learning insensitive to both noisy labels and outliers . Subsequently , a novel robust variational lower bound is derived to facilitate the inference of network parameters relying on β-divergence for both labeled and unlabeled data . Finally , a robust generative adversairial network is integrated with denoising layers to strengthen the denoising performance togehter with the end-to-end optimization to generate additional visual features to alleviate the sparsity in the semi-supervised few shot learning . Let Ω denote image space , Υ denote text space and C = { 1 , . . . , R } be the discrete label space . Further let xi ∈ Ω as the i-th input image observation , ti ∈ Υ as its corresponding textual description and yi ∈ C as its label . Denote Cbase as base classes where we have both labeled and unlabeled samples and denote Cnovel novel classes , which are underrepresented in the data . Inspired by the fact that the student-t distribution is more robust to the outliers than Gaussian distribution by constraining the shapes of the mixture components from collapsing Hou & Galata ( 2008 ) , we propose to place uncertainty priors ( e.g . Gaussian priors ) on parameters of infinite Gaussian mixture models to characterize the influence of outliers on image data and constrain the shape of the components to prevent them from collapsing . The Heterogeneous Mixture Model : Variational autoencoder Diederik & Welling ( 2013 ) has been recently proposed as a powerful solution for semi-supervised learning . To the best of our knowledge , this is the first time that a robust heterogenous VAE model has been applied which naturally integrates noisy images and text together which cohesively fuse continuous and discrete multi-modality features . Variational inference are applied to fit the heterogenous model on both of image and text features ΨI from base classes Cbase , where the embedding is obtained from the last dense layer right before the softmax output in the discriminator . Once a good mapping ΨI based on heterogenous image and text data is learnt , given a test sample , the class membership is given by assigning the class label of the closest prototype to an unseen test sample . In particular , the heterogenous features are first fed into the Dirichlet process mixture and clustered based on their similarity measures , where here image features are modeled as infinite Gaussian mixture distribution Allen et al . ( 2019 ) to characterize the samples from the unseen classes by computing the posterior distribution for unrepresented clusters more accurately and inferring the number of classes automatically and text features are characterized by Poisson distribution . Specifically , xn is a noisy measurement of its true position and is a draw from the Gaussian mixture model , where the mean of each Gaussian component Tk is unknown and the variance Ck is known . In order to characterize the uncertainty and the outliers from the input , the Gaussian prior is placed on the top of the mean for each Gaussian component . Namely , Tk satisfies the normal distribution with the mean µk and the precision matrix Λk . ωi is the latent variable for the ith data point specifying which Gaussian it came from and π is the mixing weight for the Gaussian mixture model . Specifically , a NormalWishart prior Murphy ( 2007 ) is placed on the mean and precision of the Gaussian components : p ( µ , Λ ) = ∏K k=1N ( µk|m0 , ( β0Λk ) −1 ) W ( Λk|W0 , ν0 ) , where m0 is set to be zero and β0 is set to be a very small value . W ( Λ|W , ν ) is a Wishart distribution with scale matrix W and ν degrees of freedom . For text features after word embeddings , l and ζl are the prior shape and rate parameters respectively in the Gamma distribution that generates the average rate parameter for the l-th Poisson feature . In particular , the cluster assignments for each observation are drawn from multinomial distributions where the prior parameters represent the mixing weights of the corresponding clusters . Specifically , the truncated stick-breaking process is employed to construct mixing weights . By construction , a single parameter α controls the portion of the K − 1 major clusters , and χ separately controls for the portion of the remainder via a stick-breaking procedure Beta ( ( K − 1 ) α , χ ) Blei & Jordan ( 2017 ) . Namely , where ω = [ ω1 , . . . , ωK ] belongs to the ( K − 1 ) -dimensional simplex and is generated from a Dirichlet prior with two parameters p ( ω ) D̃ir ( α , . . . , α , χ ) . Typically , given the image data x and the textual features t , variational inference with deep learning from powerful probabilistic models are constructed by an inference neural network q ( z|x , t ) and a generative neural network p ( x , t|z ) . The generative model and the inference model are parameterized by θ and φ respectively . Subsequently , the network parameters are estimated by optimizing the evidence lower bound ( ELBO ) in the variational inference . For unsupervised learning of multimodality data , the vanilla VAEs are optimized by maximizing ELBO : ELBO = Epdata ( t , x ) [ L ( t , x ) ] , L ( x ) : = Ez∼q ( z|x , t ) [ ln p ( t|z ) ] −DKL [ q ( z|x , t ) //p ( z ) ] ( 1 ) The Generative and Inference Model : We shall now present the proposed generative and inference model for few-shot learning . Given a semi-supervised learning setting , the labels y are either unknown ( for unlabeled data ) or noisy ( for labeled data ) . The generative model is then defined as : pθ ( x , t|ω , T , C ) pθ ( T |Z , µ , Λ , λ ) pθ ( a|z , ỹ , x , t ) pθ ( x , t|ỹ , z ) p ( z ) p ( ỹ ) p ( ω ) p ( t|λ ) . Define pθ as the deep neural network with parameters θ and y as the ground truth of class label . For unlabeled data , y is considered as a latent variable . Further denote Cat ( . ) as a multinomial distribution and in this paper we reasonably assume that the labels are of categorical distribution and the proposed model applies to other distributions for the latent variable y . In order to fit more complicated posteriors for the marginal distribution p ( z|x , t ) and bridge the gap between two modalities , motivated by Maaløe et al . ( 2017 ) , we extend the variational distribution with auxiliary variables a , so that the generative model is invariant to marginalization over a p ( x , z , a , ω , T , C , µ , Λ ) = pθ ( x|ω , T , C ) pθ ( T |Z , µ , Λ ) pθ ( a|z , x ) pθ ( x , z ) . To attenuate the influence with the noisy labels , further denote ỹ as the corrupted labels and ŷ as the corrected label after denoising layer . Define K×K noise transition matrix M to associate ỹ with ŷ and estimation of M has been addressed in previous methods Sukhbaatar et al . ( 2015 ) Patrini et al . ( 2017 ) . In particular , M = ( Mi , j ) ∈ [ 0 , 1 ] c×c ( ∑ iMi , j = 1 ) . The proposed generative model can then be expressed as : p ( z ) = N ( z|0 , I ) , p ( ỹ ) = Cat ( ỹ|η ) , pθ ( a|z , ỹ , x , t ) = f ( a ; z , ỹ , x , t ) , pθ ( x , t|z , ỹ ) = f ( x , t ; z , ỹ , θ ) , p ( Tk|µk , Λk ) = N ( tk|µk , Λ−1k ) , p ( ŷ = i|ỹ = j ) = Mij , ( 2 ) p ( x , t|T , C , λ ) = N ( xn|tk , Ck ) ∏Nl n=1N ( tn|tỹn , Cỹn ) λkexp−λ k ! if the jth cluster is represented p ( x , t|T , C , λ ) = ∫ p ( xn|tk , Ck ) p ( tk|µk , Λk ) p ( µk , Λk ) dµkdΛk λ kexp−λ k ! if the jth cluster is unrepresented The inference model can be represented as : qφ ( a , z , µ , Λ , T , ỹ , λ|x , t ) = q ( z|a , ỹ , x , t ) q ( a|x , t ) q ( ỹ|a , x , t ) q ( T , µ , Λ , λ|x , t ) qφ ( z|a , ỹ , x , t ) = N ( z|µφ ( a , ỹ , x , t ) , diag ( σ2 ) ) , qφ ( ỹ|a , x , t ) = Cat ( ỹ|ηφ ( a , x , t ) ) , qφ ( µk , Λk ) = q ( µk|Λk ) q ( Λk ) , q ( λl|t ) ∝ Gamma ( λl| l + ∑ i ψiktil , ζl + ∑ i ψik ) , ( 3 ) where q ( λl|t ) characterizes posterior variational density of Poisson parameters given the discrete embedded feature vectors t converted from text data . ψik stands for the probability of the ith observation belongs to the cluster k. til represents the l-th Poisson feature of the ith observation . Denote N−n , j as the number of data points , excluding xn which belongs to the mixture component j . To compute q ( T , µ , Λ , λ|x , t ) , mean-field approximation is applied Bishop ( 2006 ) to factorize all the latent variables and parameters for the represented and unrepresented jth cluster respectively : q ( T , µ , Λ , λ|x , t ) = N−n , jN−1+αN ( xn|tk , Ck ) ∏Nl n=1N ( tn|tỹn , Cỹn ) q ( λl|t ) q ( T , µ , Λ , λ|x , t ) = αN−1+α ∫ p ( xn|tk , Ck ) p ( tk|µk , Λk ) p ( µk , Λk ) dµkdΛkq ( λl|t ) ( 4 ) The above equation indicates that given the multimodality data , the unlabeled samples has a certain probability of being classified as unrepresented mixtures ( e.g . unseen new classes ) , which facilitates the learning capabilities of the proposed robust semi-supervised few shot learning . Within an iteration , some unlabeled samples are associated with unrepresented mixtures , a new represented mixtures will emerge which successfully addressed the challenges in semi-supervised few shot learning when the unlabeled data contains unseen new classes which doesnot exist in labeled data . Robust Variational Lower Bound : To further alleviate the impact from outliers , the robust divergence is employed to infer network parameters more accurately . The theoretical foundation of β-divergence has been initially defined at Basu et al . ( 1998 ) , where the β-divergence between two functions g and f are defined as Dβ ( g ‖ f ) = 1 β ∫ g ( x ) 1+βdx+ ∫ f ( x ) 1+βdx− β + 1 β ∫ g ( x ) f ( x ) βdx ( 5 ) When β → 0 , the β-divergence converges to KL-divergence , limβ→0Dβ ( g ‖ f ) = DKL ( g ‖ f ) . As described in Futami et al . ( 2018 ) , minimizing the β-divergence from the empirical distribution p̂ ( x ) to p ( x ; θ ) arg minθDβ ( p̂ ( x ) ‖ p ( x ; θ ) ) , it is easy to show 1N ∑N i=1 p ( xi ; θ ) β ∂ ln p ( xi ; θ ) ∂θ − Ep ( x ; θ ) [ p ( x ; θ ) β ∂ ln p ( x ; θ ) ∂θ ] . As the probability densities of outliers are usually much smaller than those of inliers , the first term of the above equation is the likelihood weighted according to the power of the probability density for each sample , which effectively suppress the likelihood of outliers . This estimator is also called asM -estimator Huber & Ronchetti ( 2011 ) , which provides provably superior performance in various machine applications Li & Gal ( 2017 ) . The variational lower bound for the proposed RCFSL model for labeled data can be represented as log p ( x , ỹ , t ) = ∫ a ∫ z ∫ T ∫ µ ∫ Λ ∫ λ ∫ ω log ( x , ỹ , a , z , T , µ , Λ , λ , t ) dadzdTdµdΛdλdω ≥ E [ log ( pθ ( a , z , T , µ , Λ , λ , ω , x , ỹ , t ) ) ] − E [ qφ ( a , z , T , µ , Λ , ω|x , t , ỹ ) ] = E [ log ( pθ ( a , z , T , µ , Λ , ω , x , t , ỹ ) ) ] −E [ qφ ( a|x , t ) ] − E [ qφ ( z|a , ỹ , x , t ) ] − E [ qφ ( T |µ , Λ , x ) ] − E [ qφ ( µ , Λ ) ] − E [ qφ ( ω|α ) ] − E [ qφ ( λ|t ) ] The above inequality can be rewritten as log p ( x , ỹ , t ) ≥ Eqφ ( a , z , T , µ , Λ , λ , ω|x , y , t ) [ log pθ ( a , z , T , µ , Λ , λ , x , ỹ , t ) qφ ( a , z , T , µ , Λ , λ , ω|x , ỹ , t ) ] = Eqφ ( a , z , T , µ , Λ , λ , ω|x , t , ỹ ) [ log ( pθ ( x , t , ỹ|a , z , T , µ , Λ , λ , ω ) ) ] + DKL [ q ( a , z , T , µ , Λ , λ|x , t , ỹ ) //p ( a , z , T , µ , Λ , λ ) ] ( 6 ) To mitigate the influence of outliers , let H = { a , z , T , ω , µ , Λ , λ } represent the set of all the latent variables and leverage the technique from Futami et al . ( 2018 ) , we can replace KL-divergence with β-Divergence and cast the β-ELBO for labeled data Lβ as : Lβ = ∫ q ( H|x , t , ỹ ) ( −β + 1 β N∑ i=1 p ( ỹi|H ; xi , ti ) β +N ∫ p ( ỹ|H ; x , t ) 1+βdỹ ) + DKL [ q ( H|x , t , ỹ ) //p ( H ) ] ( 7 ) For unlabeled data , by introducing the variational distribution for ỹ as qφ ( a , x , t|ỹ ) , the variational lower bound for the proposed RCFSL can be represented as log p ( x , t ) = ∫ a ∫ z ∫ T ∫ µ ∫ Λ ∫ ỹ log ( x , ỹ , a , z , T , µ , Λ ) dadzdTdµΛdỹ ≥ Eqφ ( a , ỹ , z , T , µ , Λ|x , t ) [ log pθ ( a , z , T , µ , Λ , x , t , λ , ỹ ) qφ ( a , z , T , µ , Λ , λ , ỹ|x , t ) ] = E [ log ( pθ ( a , z , T , µ , Λ , ω , λ , x , t , ỹ ) ) ] − E [ qφ ( a|x , t ) ] − E [ qφ ( ỹ|a , x , t ) ] −E [ qφ ( z|a , ỹ , x , t ) ] − E [ qφ ( T |µ , Λ , x ) ] − E [ qφ ( µ , Λ ) ] − E [ qφ ( ω|π ) ] − E [ qφ ( λ|t ) ] Similarly , replacing the KL-divergence with β-Divergence and augmenting the latent variableHu = { a , z , y , T , ω , µ , Λ , λ } , the β-ELBO for unlabeled data in RCFSL is : Uβ = ∫ q ( Hu|x , t ) ( − β + 1 β N∑ i=1 p ( xi , ti|Hu ) β + ∫ p ( x , t|Hu ) 1+βdx ) + DKL [ q ( Hu|x , t ) //p ( Hu ) ] , Practically , Lβ and Uβ are calculated via Monte Carlo sampling . The robustness of our proposed ELBO can be guaranteed leveraging the influence function ( IF ) Futami et al . ( 2018 ) Huber & Ronchetti ( 2011 ) . As IF is widely used to analyze how much contamination affects estimated statistics , it is straightforward to show that given the perturbation on the empirical cumulative distribution caused by outliers , it is straightforward to show that the IF of our posterior distribution is bounded . The objective function for robust cross-modal variational autoencoder is : LRCV AE = Lβ + λ1Uβ , where λ1 represents the weight to control the trade-off between the labeled data and unlabeled data . Robust Feature Generation : The construction of the proposed uncertainty priors and the robust divergence measure in our framework aims at better approximation of the posterior distribution under noisy labels and outliers . This is also related to employing generative adversarial learning of z and x , t defined by the data , the encoder , the prior and decoder . Different from VAEs that assumes parametric data distribution and perform posterior inference , GANs in general utilize implicit data distribution and do not provide meaningful latent representations . By learning both a generator G and a discriminator D , a min-max objective is optimized : min G max D { Ex , t∼pdata ( x , t ) [ ln ( D ( x , t ) ) ] + Ez∼p ( z ) [ ln ( 1−D ( G ( z ) ) ] } ( 8 ) In Kaneko et al . ( 2019 ) , a noise transition model is incorporated to learn a clean label conditional generative distribution . But their model only considered noisy labels without outliers and is limited to supervised learning . Recent work on semi-supervised GAN with k classes Kumar et al . ( 2017 ) Salimans et al . ( 2016 ) modify the discriminator with k + 1 outputs on the discriminator by considering the fake images as the k + 1th class . Hence , the loss for the training can be computed with a supervised loss and an unsupervised loss respectively : L = Lsup + Lunsup = −Ex , t , y∼pd ( x , t , y ) log pf ( y|x , t , y ≤ k ) − Ex , t∼pg ( x , t ) log ( pf ( y = k + 1|x , t ) ) − Ex , t∼pd ( x , t ) log ( 1− pf ( y = k + 1|x , t ) ) , ( 9 ) where Lsup represents the negative log probability of the label given the data is real . Denote D ( x , t ) = 1 − pf ( y = k + 1|x , t ) , the loss for semi-supervised GAN on multimodality data LsGAN can be written as : L = −Ex , t∼pd ( x , t ) logD ( x , t ) − Ez∼noise ( 1 − D ( G ( z ) ) ) − Ex , t , y∼pd ( x , t , y ) log pf ( y|x , t , y ≤ k ) . More recently , the label noise robust GAN ( rGAN ) Kaneko et al . ( 2019 ) has achieved promising performance in classifying images with noisy labels by incorporating a noise transition model to learn a clean label conditional generative distribution under noisy labels . Thus , given the noise samples ( x̃r , ỹr ) ∼ p̃d ( x , ỹ ) , to construct a label-noise robust conditional generator and discriminator , the objective function of the robust semi-supervised GAN in the proposed robust cross-modal semi-supervised few-shot learning is expressed as : LRSGAN = −Ex , t∼pd ( x , t ) log ( 1− C̃ ( ỹ = k+1|x , t ) ) −Ez∼noise ( 1−D ( G ( z ) ) ) −E ( x̃r , t , ỹr ) ∼p̃d ( x , t , ỹ ) log C̃ ( ỹ = ỹr|x , t , ỹ ≤ k ) = −Ex , t∼pd ( x , t ) log ( 1 −Mŷr , ỹr Ĉ ( ŷ = k + 1|x , t ) ) − Ez∼noise ( 1 − D ( G ( z ) ) ) − E ( x̃r , t , ỹr ) ∼p̃d ( x , t , ỹ ) log ∑ ŷr Mŷr , ỹr Ĉ ( ŷ = ŷ r|x , t , ŷ ≤ k ) . Without modeling the data distribution explicitly and representing the latent space in a meaningful manner , it does not provide the functionality to counter the outliers in the generator and discriminator . Motivated by the thought of bridging the gap between robust VAE and robust GAN , we feed the robust variational posterior p ( z|x , t ) instead of the random noise p ( z ) into the label noise robust semi-supervised GAN as the source of randomness as both of the decoder and the generator of RSGAN share the mapping from z to x and t. The full optimization function for the proposed RCFSL framework can be represented as : minGRCFSL maxD Epdata ( x , t ) [ L ( x , t ) ] L ( x , t ) : = lnD ( x , t ) + DKL [ q ( H|x , t , ỹ ) //p ( H ) ] + λ1DKL [ q ( Hu|x , t ) //p ( Hu ) ] + Ez∼q ( H|x , t , ỹ ) [ ln ( 1−D ( GRSGAN ( z ) ) + ( −β+1β ∑N i=1 p ( ỹi|H ; xi , ti ) β + N ∫ p ( ỹ|H ; x , t ) 1+βdỹ ] + λ1Ez∼q ( Hu|x , t ) [ ( − β+1 β ∑N i=1 p ( xi , ti|Hu ) β + λ1N ∫ p ( x , t|Hu ) 1+βdx ) ] , ( 10 ) where λ1 is set to be the ratio of unlabled samples verus labeled samples and the discriminator loss is characterized by E [ lnD ( x , t ) ] = −Ex , t∼pd ( x , t ) log ( 1 − Mŷr , ỹr Ĉ ( ŷ = k + 1|x , t ) ) − E ( x̃r , t , ỹr ) ∼p̃d ( x , t , ỹ ) log ∑ ŷr Mŷr , ỹr Ĉ ( ŷ = ŷ r|x , t , ŷ ≤ k ) . This new architecture is expected to better predict the class labels under the compound noise . We then train RCFSL including the robust heterogenous encoder , the generator and the robust discriminator in an end-to-end manner using adaptive moment estimation ( Adam ) Kingma & Ba ( 2015 ) . Each multimodal embedding prototype pc ( of category c ) is computed by averaging the embeddings of all support samples of class c. Once the robust embedding is obtained , the distance between the embedding of the query qt and the multimodal prototype pc is calculated by p ( y = c|pc ) = exp ( −d ( f ( qt ) , pc ) ) ∑ k exp ( −d ( f ( qt ) , pk ) ) where d refers to Euclidean distance and the query is classified as the class with the minimum distance .
This paper focuses on semi-supervised few-shot learning with multi-modality data. The authors introduce an uncertainty prior of an infinite Gaussian model, integrating multi-modality information from image and text data into a heterogenous variational autoencoder. Meanwhile, a new variational lower bound is derived for the inference of parameters. In addition, a GAN is developed for the data sparsity in few shot learning. Experimental results demonstrate the effectiveness of the proposed method to some extent.
SP:9de6cee2ba08db0f6086702122bb484aa48532f9
VIMPAC: Video Pre-Training via Masked Token Prediction and Contrastive Learning
Video understanding relies on perceiving the overall global content and modeling its internal connections ( e.g. , causality , movement , and spatio-temporal correspondence ) . To learn these interactions , we apply a mask-then-predict pre-training task on the discretized video tokens generated via VQ-VAE . Unlike language , where the text tokens are more independent , neighboring video tokens typically have strong correlations ( e.g. , consecutive video frames usually look similar ) , and hence uniformly masking individual tokens will make the task too trivial to learn useful representations . To deal with this issue , we propose a block masking strategy where we mask neighboring video tokens in both spatial and temporal domains . We also add a contrastive learning objective to further capture the global content by predicting whether the video clips are sampled from the same video . We pre-train our model on uncurated videos and show that our pre-trained model can reach state-of-the-art results on several video understanding datasets ( e.g. , SSV2 , Diving48 ) . Lastly , we provide detailed analyses of the model scalability and pre-training method design . 1 INTRODUCTION . In recent years , state-of-the-art self-supervised methods have been exploring different directions for pre-training images and text representations , with Contrastive Learning ( CL ) providing strong results for vision representation learning ( Oord et al. , 2018 ; Chen et al. , 2020b ; He et al. , 2020 ; Chen et al. , 2020c ; Tian et al. , 2020 ) , and Language Modeling ( LM ) becoming the de-facto standard in language pre-training ( Devlin et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ; Lan et al. , 2019 ) . Both approaches are quite different from each other . A contrastive objective compares positive/negative examples at a coarse/sample level , focusing on global-content ( e.g. , for image classification ) while a token modeling objective predict missing tokens from context at a much finer/sub-sample level to model sequential and short range interactions between tokens ( e.g . in text generation tasks ) . Interestingly , video understanding naturally combines both types of requirements . 2D processing along the spatial dimensions of the video bears similarity to image processing , while 1D processing along the temporal dimension often involves modeling sequential events and short range coherence . Hence , in this work , we propose to combine both text and image representation learning approaches for improved video pre-training , taking advantage of recent advances in self-supervised methods of both fields . We name our method as VIMPAC : VIdeo pre-training via Masked token Prediction And Contrastive learning . From language research , we adopt a ‘ masked language model ’ pretraining objective ( Devlin et al. , 2019 ) where a model is trained to reconstruct local masked regions in videos . From the computer vision world , we borrow a contrastive learning objective , specifically the InfoNCE ( Oord et al. , 2018 ) objective is applied on positive/negative video samples . While the masked language model objective encourages models to learn low-level semantics and sequential interaction , the contrastive loss provide a supervision for the model to learn more global and separable representations that are useful for many downstream tasks ( e.g. , action classification ( Soomro et al. , 2012b ; Carreira & Zisserman , 2017 ) ) . The two objectives provide complementary signals for training : while short range correlations can be predominantly modeled from the training signal of the mask-and-predict task , the contrastive learning objective can provide signals on a more coarse-grained global-context and semantic level . However , unlike language which is composed of discrete tokens from a compact vocabulary , videos are typically represented as RGB pixels in an almost continuous , high dimensional vector space . Naively masking pixels in videos induces a prohibitive computation cost while also tending to overemphasize local details . To overcome these issues , we first tokenize input videos using the latent codes of a pretrained Vector Quantized-Variational Auto-Encoder ( VQ-VAE ) ( van den Oord et al. , 2017 ; Ramesh et al. , 2021 ) to encode them in smaller quantized representations on which a reconstruction model can then be trained with a masked token modeling objective . In practice , we also discovered that models trained with a uniform random token masking strategy can fail to learn meaningful and useful visual representations as neighboring pixels may contain similar and correlated content ( in particular along the temporal dimension ) , making the task of predicting a randomly masked token from its visible neighbors trivial . We therefore also introduce a block-masking scheme that simultaneously masking video tokens in a 3D spatio-temporal block . Reconstructing such an extended spatio-temporal cube requires performing long-range predictions , forcing the models to learn a more complex set of relations between the video tokens , resulting in better visual representations . Our contrastive learning approaches also departs from previous work in several aspects . First , since we apply the contrastive objective on token-discretized video samples and in combination with the token modeling loss , we observe strong performance without requiring the usual extensive set of data augmentations ( Chen et al. , 2020b ; c ; Qian et al. , 2021 ; Feichtenhofer et al. , 2021 ) . Second , we are able to leverage positive clip pairs that are temporally distant from each other ( can be as far as 400 seconds away ) , while previous work favors using positives within a shorter range ( maximum 36 seconds for uncurated videos in Feichtenhofer et al . ( 2021 ) or 10 seconds in Qian et al . ( 2021 ) ) . We evaluate the performances of our method VIMPAC on several video understanding datasets , including two temporally-heavy tasks , SSV2 and Diving48 on which it achieves state-of-the-art results with regard to both self-supervised and supervised pre-training works , and a set of more spatially-heavy datasets , UCF101 , HMDB51 , and Kinetics-400 , on which it also achieves competitive results . Overall , taking advantage of VQ-VAE discretized video tokens , we present a method for self-supervised learning of video representations that combines two general streams of research in self-supervision : masked language modeling and contrastive learning . Our contribution is 3-folds : ( i ) We apply the mask-then-predict task to video understanding and introduce the use of block masking . ( ii ) We propose a contrastive learning method which is able to achieve strong performance without spatial data augmentation . ( iii ) We empirically show that this method achieves strong performance on several video classification datasets , especially on temporally-heavy datasets , SSV2 and Diving48 , where it sets new state-of-the-art results . We also present comprehensive ablation studies to analyze the various aspects of our proposed approach . 2 RELATED WORK . Unsupervised representation learning , with the promise of learning from large-scale unlabeled data , has drawn increasing attention in recent years , in both computer vision and natural language processing ( NLP ) communities . Most mainstream self-supervised methods can be categorized into three general directions : generative , denoising , and discriminative ( Chen et al. , 2020b ; Grill et al. , 2020 ; Doersch et al. , 2015 ) . Generative and denoising methods seek to generate or reconstruct corrupted text/image/video tokens according to their empirical distributions . In generative and auto-regressive methods , next tokens are predicted given a causal context ( Chen et al. , 2020a ; van den Oord et al. , 2016 ) while denoising methods seek to reconstruct corrupted or masked tokens given an extended context ( Devlin et al. , 2019 ; Raffel et al. , 2019 ) . For text , since the tokens ( words or sub-words ( Sennrich et al. , 2016 ; Wu et al. , 2016 ) ) are discrete and has relatively high entropy rate , language modeling has became the de-facto approach for pre-training models for most natural language tasks ( Ruder et al. , 2019 ) . In the case of images , generative approaches often operate on pixel space ( Bertalmio et al. , 2001 ; Yu et al. , 2018 ; Kim et al. , 2019 ; Chen et al. , 2020a ; van den Oord et al. , 2016 ) , which can be extremely expensive for larger input size like videos and has hence limited the widespread adoption of these methods . Recently , discretizing images and videos with discrete variational auto-encoders ( VQ-VAE ) , has been explored in compression and generative setups ( van den Oord et al. , 2017 ; Razavi et al. , 2019 ; Walker et al. , 2021 ; Ramesh et al. , 2021 ; Yan et al. , 2021 ) , and Sun et al . ( 2019 ) tackles the video-language problem by frame-level quantization . Such approaches avoid modeling pixel-level details and have enabled the use of generative models for images and videos ( Walker et al. , 2021 ; Ramesh et al. , 2021 ) . Differing from these works , our framework investigates the use of such quantized representations in a denoising/reconstruction setup rather than generative , which has been shown in the NLP community to learn better representations ( Raffel et al. , 2019 ; Devlin et al. , 2019 ) . Moreover , beyond simply applying MLM to the video tokens , we propose a block masking strategy to reduce the strong local correlation in neighboring video tokens . This 3D block masking strategy is inspired from recent span-masking schemes ( Raffel et al. , 2019 ; Joshi et al. , 2020 ) for language modeling . The concurrent work ( Bao et al. , 2021 ) explores using the VQ-VAE tokens as labels for masked patches in the image domain . The other direction of research , which our framework combines , is discriminative methods which start from the hypothesis that learning to reconstruct local details is not necessary for learning good visual representations . In some of these approaches , an objective is constructed around hand-crafted heuristics tasks like spatial arrangement , color , playback speed or frame order predictions ( Doersch et al. , 2015 ; Zhang et al. , 2016 ; Gidaris et al. , 2018 ; Fernando et al. , 2017 ; Lee et al. , 2017 ; Wei et al. , 2018 ; Epstein et al. , 2020 ; Benaim et al. , 2020 ; Sun et al. , 2021 ) . Another line of discriminative approaches is contrastive learning which aims at training a model to be able to recognize different views ( e.g. , different augmentation of images or different temporal samples of videos ) of the same image or video , as a way to learn general representations ( Chen et al. , 2020b ; He et al. , 2020 ; Chen et al. , 2020c ; Grill et al. , 2020 ; Caron et al. , 2020 ; Feichtenhofer et al. , 2021 ) . This direction of research is reminiscent of sentence-order prediction tasks introduced in NLP ( Devlin et al. , 2019 ; Lan et al. , 2019 ) with the goal of predicting whether two text sequences should be juxtaposed or not , an approach challenged in more recent literature ( Liu et al. , 2019 ; Lan et al. , 2019 ) . In the present work , inspired by visual representation rather than text representation learning literature , we adapt the contrastive learning approach to video by training a model to differentiate pairs of clips from a single video from pairs of clips from disparate videos . Another thread of research focuses on the way to adapt transformer models to video tasks ( Bertasius et al. , 2021 ; Arnab et al. , 2021 ) . Recent works ( Fan et al. , 2021 ; Liu et al. , 2021 ) extend it with hierarchical modeling and efficient attention patterns . These methods focus on the modeling and achieve good results with supervised pre-training . Besides the difference in focus ( modeling vs. pretraining ) to our paper , the hierarchical design is also not directly applicable to our mask prediction tasks .
This paper proposes a new video pretraining method by combining masked token prediction and contrastive learning. Off-she-shelf VQ-VAE is used in this paper for discrete video tokens generation. In order to make the masked token prediction more effective, the authors proposed a block mask strategy where spatial-temporal neighboring video tokens are masked together. Experimental results are shown to validate its effectiveness.
SP:133e984aa4736226e82246f3937b0a08cd8beb68
VIMPAC: Video Pre-Training via Masked Token Prediction and Contrastive Learning
Video understanding relies on perceiving the overall global content and modeling its internal connections ( e.g. , causality , movement , and spatio-temporal correspondence ) . To learn these interactions , we apply a mask-then-predict pre-training task on the discretized video tokens generated via VQ-VAE . Unlike language , where the text tokens are more independent , neighboring video tokens typically have strong correlations ( e.g. , consecutive video frames usually look similar ) , and hence uniformly masking individual tokens will make the task too trivial to learn useful representations . To deal with this issue , we propose a block masking strategy where we mask neighboring video tokens in both spatial and temporal domains . We also add a contrastive learning objective to further capture the global content by predicting whether the video clips are sampled from the same video . We pre-train our model on uncurated videos and show that our pre-trained model can reach state-of-the-art results on several video understanding datasets ( e.g. , SSV2 , Diving48 ) . Lastly , we provide detailed analyses of the model scalability and pre-training method design . 1 INTRODUCTION . In recent years , state-of-the-art self-supervised methods have been exploring different directions for pre-training images and text representations , with Contrastive Learning ( CL ) providing strong results for vision representation learning ( Oord et al. , 2018 ; Chen et al. , 2020b ; He et al. , 2020 ; Chen et al. , 2020c ; Tian et al. , 2020 ) , and Language Modeling ( LM ) becoming the de-facto standard in language pre-training ( Devlin et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ; Lan et al. , 2019 ) . Both approaches are quite different from each other . A contrastive objective compares positive/negative examples at a coarse/sample level , focusing on global-content ( e.g. , for image classification ) while a token modeling objective predict missing tokens from context at a much finer/sub-sample level to model sequential and short range interactions between tokens ( e.g . in text generation tasks ) . Interestingly , video understanding naturally combines both types of requirements . 2D processing along the spatial dimensions of the video bears similarity to image processing , while 1D processing along the temporal dimension often involves modeling sequential events and short range coherence . Hence , in this work , we propose to combine both text and image representation learning approaches for improved video pre-training , taking advantage of recent advances in self-supervised methods of both fields . We name our method as VIMPAC : VIdeo pre-training via Masked token Prediction And Contrastive learning . From language research , we adopt a ‘ masked language model ’ pretraining objective ( Devlin et al. , 2019 ) where a model is trained to reconstruct local masked regions in videos . From the computer vision world , we borrow a contrastive learning objective , specifically the InfoNCE ( Oord et al. , 2018 ) objective is applied on positive/negative video samples . While the masked language model objective encourages models to learn low-level semantics and sequential interaction , the contrastive loss provide a supervision for the model to learn more global and separable representations that are useful for many downstream tasks ( e.g. , action classification ( Soomro et al. , 2012b ; Carreira & Zisserman , 2017 ) ) . The two objectives provide complementary signals for training : while short range correlations can be predominantly modeled from the training signal of the mask-and-predict task , the contrastive learning objective can provide signals on a more coarse-grained global-context and semantic level . However , unlike language which is composed of discrete tokens from a compact vocabulary , videos are typically represented as RGB pixels in an almost continuous , high dimensional vector space . Naively masking pixels in videos induces a prohibitive computation cost while also tending to overemphasize local details . To overcome these issues , we first tokenize input videos using the latent codes of a pretrained Vector Quantized-Variational Auto-Encoder ( VQ-VAE ) ( van den Oord et al. , 2017 ; Ramesh et al. , 2021 ) to encode them in smaller quantized representations on which a reconstruction model can then be trained with a masked token modeling objective . In practice , we also discovered that models trained with a uniform random token masking strategy can fail to learn meaningful and useful visual representations as neighboring pixels may contain similar and correlated content ( in particular along the temporal dimension ) , making the task of predicting a randomly masked token from its visible neighbors trivial . We therefore also introduce a block-masking scheme that simultaneously masking video tokens in a 3D spatio-temporal block . Reconstructing such an extended spatio-temporal cube requires performing long-range predictions , forcing the models to learn a more complex set of relations between the video tokens , resulting in better visual representations . Our contrastive learning approaches also departs from previous work in several aspects . First , since we apply the contrastive objective on token-discretized video samples and in combination with the token modeling loss , we observe strong performance without requiring the usual extensive set of data augmentations ( Chen et al. , 2020b ; c ; Qian et al. , 2021 ; Feichtenhofer et al. , 2021 ) . Second , we are able to leverage positive clip pairs that are temporally distant from each other ( can be as far as 400 seconds away ) , while previous work favors using positives within a shorter range ( maximum 36 seconds for uncurated videos in Feichtenhofer et al . ( 2021 ) or 10 seconds in Qian et al . ( 2021 ) ) . We evaluate the performances of our method VIMPAC on several video understanding datasets , including two temporally-heavy tasks , SSV2 and Diving48 on which it achieves state-of-the-art results with regard to both self-supervised and supervised pre-training works , and a set of more spatially-heavy datasets , UCF101 , HMDB51 , and Kinetics-400 , on which it also achieves competitive results . Overall , taking advantage of VQ-VAE discretized video tokens , we present a method for self-supervised learning of video representations that combines two general streams of research in self-supervision : masked language modeling and contrastive learning . Our contribution is 3-folds : ( i ) We apply the mask-then-predict task to video understanding and introduce the use of block masking . ( ii ) We propose a contrastive learning method which is able to achieve strong performance without spatial data augmentation . ( iii ) We empirically show that this method achieves strong performance on several video classification datasets , especially on temporally-heavy datasets , SSV2 and Diving48 , where it sets new state-of-the-art results . We also present comprehensive ablation studies to analyze the various aspects of our proposed approach . 2 RELATED WORK . Unsupervised representation learning , with the promise of learning from large-scale unlabeled data , has drawn increasing attention in recent years , in both computer vision and natural language processing ( NLP ) communities . Most mainstream self-supervised methods can be categorized into three general directions : generative , denoising , and discriminative ( Chen et al. , 2020b ; Grill et al. , 2020 ; Doersch et al. , 2015 ) . Generative and denoising methods seek to generate or reconstruct corrupted text/image/video tokens according to their empirical distributions . In generative and auto-regressive methods , next tokens are predicted given a causal context ( Chen et al. , 2020a ; van den Oord et al. , 2016 ) while denoising methods seek to reconstruct corrupted or masked tokens given an extended context ( Devlin et al. , 2019 ; Raffel et al. , 2019 ) . For text , since the tokens ( words or sub-words ( Sennrich et al. , 2016 ; Wu et al. , 2016 ) ) are discrete and has relatively high entropy rate , language modeling has became the de-facto approach for pre-training models for most natural language tasks ( Ruder et al. , 2019 ) . In the case of images , generative approaches often operate on pixel space ( Bertalmio et al. , 2001 ; Yu et al. , 2018 ; Kim et al. , 2019 ; Chen et al. , 2020a ; van den Oord et al. , 2016 ) , which can be extremely expensive for larger input size like videos and has hence limited the widespread adoption of these methods . Recently , discretizing images and videos with discrete variational auto-encoders ( VQ-VAE ) , has been explored in compression and generative setups ( van den Oord et al. , 2017 ; Razavi et al. , 2019 ; Walker et al. , 2021 ; Ramesh et al. , 2021 ; Yan et al. , 2021 ) , and Sun et al . ( 2019 ) tackles the video-language problem by frame-level quantization . Such approaches avoid modeling pixel-level details and have enabled the use of generative models for images and videos ( Walker et al. , 2021 ; Ramesh et al. , 2021 ) . Differing from these works , our framework investigates the use of such quantized representations in a denoising/reconstruction setup rather than generative , which has been shown in the NLP community to learn better representations ( Raffel et al. , 2019 ; Devlin et al. , 2019 ) . Moreover , beyond simply applying MLM to the video tokens , we propose a block masking strategy to reduce the strong local correlation in neighboring video tokens . This 3D block masking strategy is inspired from recent span-masking schemes ( Raffel et al. , 2019 ; Joshi et al. , 2020 ) for language modeling . The concurrent work ( Bao et al. , 2021 ) explores using the VQ-VAE tokens as labels for masked patches in the image domain . The other direction of research , which our framework combines , is discriminative methods which start from the hypothesis that learning to reconstruct local details is not necessary for learning good visual representations . In some of these approaches , an objective is constructed around hand-crafted heuristics tasks like spatial arrangement , color , playback speed or frame order predictions ( Doersch et al. , 2015 ; Zhang et al. , 2016 ; Gidaris et al. , 2018 ; Fernando et al. , 2017 ; Lee et al. , 2017 ; Wei et al. , 2018 ; Epstein et al. , 2020 ; Benaim et al. , 2020 ; Sun et al. , 2021 ) . Another line of discriminative approaches is contrastive learning which aims at training a model to be able to recognize different views ( e.g. , different augmentation of images or different temporal samples of videos ) of the same image or video , as a way to learn general representations ( Chen et al. , 2020b ; He et al. , 2020 ; Chen et al. , 2020c ; Grill et al. , 2020 ; Caron et al. , 2020 ; Feichtenhofer et al. , 2021 ) . This direction of research is reminiscent of sentence-order prediction tasks introduced in NLP ( Devlin et al. , 2019 ; Lan et al. , 2019 ) with the goal of predicting whether two text sequences should be juxtaposed or not , an approach challenged in more recent literature ( Liu et al. , 2019 ; Lan et al. , 2019 ) . In the present work , inspired by visual representation rather than text representation learning literature , we adapt the contrastive learning approach to video by training a model to differentiate pairs of clips from a single video from pairs of clips from disparate videos . Another thread of research focuses on the way to adapt transformer models to video tasks ( Bertasius et al. , 2021 ; Arnab et al. , 2021 ) . Recent works ( Fan et al. , 2021 ; Liu et al. , 2021 ) extend it with hierarchical modeling and efficient attention patterns . These methods focus on the modeling and achieve good results with supervised pre-training . Besides the difference in focus ( modeling vs. pretraining ) to our paper , the hierarchical design is also not directly applicable to our mask prediction tasks .
The paper proposes a few new techniques: 1) A new video modeling architecture that uses a pre-trained VQ-VAE to tokenize frames, followed by a transformer encoder that aggregates the features and produces the final action class label. 2) Pre-training such an architecture using self-supervision by a) Masked prediction: Authors mask out blocks of tokens and predict them using the context (akin to BERT) and b) contrastive learning: Authors use the representation for two clips from same video as a positive match and otherwise negative match. The final model is trained with a linear combination of the masked prediction and contrastive losses, and finally finetuned for downstream tasks. The model is pretrained on HowTo100M dataset, and finetuned on multiple downstream datasets, where it obtains gains on more temporal datasets like SS-v2.
SP:133e984aa4736226e82246f3937b0a08cd8beb68
Neural Temporal Logic Programming
1 INTRODUCTION . Complex time series data is present across many data modalities such as sensors , records , audio , and video data . Typically there are composite events of interest in these time series which are composed of other atomic events in a certain order ( Liu et al. , 1999 ; Chakravarthy et al. , 1994 ; Hinze , 2003 ) . An example is a health symptom that can be observed in a doctor ’ s report . Atomic events , such as patient vitals and medications , and their temporal relations dictate an underlying causal rule leading to the composite event symptom . These rules may be unknown but useful to recover ( Kovačević et al. , 2013 ; Guillame-Bert et al. , 2017 ) . Recent methods leverage the advances in highly parameterized deep architectures to learn latent representations of atomic event data ( Pham et al. , 2017 ; Chen et al. , 2018 ; Choi et al. , 2019 ) , with the increasing availability of large temporal datasets . Methods , such as LSTM ( Hochreiter & Schmidhuber , 1997 ) or Transformer ( Vaswani et al. , 2017 ) based architectures , provide stateof-the-art performance in terms of composite event inference . However , it is uncertain whether the latent representations learn the underlying causal sequence of events or overfit spurious signals in the training data . Having representations faithful to causal mechanisms is advantageous for interpretability , out-of-distribution generalization , and adapting to smaller data sets . Therefore it is important to leverage parametric models that can handle data noise while providing a mechanism to extract explicit temporal rules ( Carletti et al. , 2019 ) . Extracting explicit logic rules has been studied through Inductive Logic Programming ( ILP ) methods ( Muggleton , 1991 ; Muggleton & De Raedt , 1994 ) and have been leveraged in parametric fashions as well ( Yang et al. , 2017 ; Evans & Grefenstette , 2018 ; Rocktäschel & Riedel , 2017 ) . ILP starts with set of background knowledge , consisting of grounded atoms ( i.e . facts which do not contain variables ) such as location ( Braves , Atlanta ) , where the predicate location determines the relationship between the items Braves and Atlanta . There are set of labels from which rules should be learned . The task is to construct a set of rules , when executed over the background knowledge , entail the provided labels . Given the label InLeague ( Braves , NL East ) and the background knowledge ( Figure 1 ILP Input ) as input , a candidate rule is InLeague ( Team , League ) : = Location ( Team , City ) ∧ Division ( City , League ) . Here InLeague ( Team , League ) is the head of the rule consisting of an atom with variables Team , League as items . The body consists of two atoms and when these atoms exist on the background knowledge the rule is evaluated as true.We apply ILP over real world temporal data , however learning such rules poses three key challenges . Temporal Background Knowledge First , ILP methods operate over an existing grounded background knowledge . The temporal case does not have this knowledge when operating over raw time series . For example in a baseball video , grounded atomic events pitch or swing , or grounded predicates such as before ( pitch , swing ) are not explicitly provided . By nature , the video would be labeled with a higher level composite event description , such as `` Player A ’ s home run '' instead of individual atomic events and their corresponding temporal predicates . Such atoms can be extracted using a model in a probabilistic fashion at each time point , and a temporal ILP method should handle this uncertainty . The temporal predicates between these probabilistic atomic events can be applied in a rule-based manner ( ex . t1 < t2 → before ) , but due to the noisy nature of extracted atomic events , the predicate predictions should be robust to consistent noise in the atomic event data . Atomic Event Relevance Second , ILP works learn consistent rules that satisfy a path in the background knowledge given the terms in the labels , such as InLeague ( Braves , NL East ) . The labels are nullary predicates in the temporal case , so the relevant source and target atomic events and predicates to use for rule induction are unknown . In our example , we know from the video we have a label strike , but are not told when it occurred or what other events , such as pitch , swing , and miss are needed to compose a rule for strike . Without a prior on which atomic events to search from , we must consider all pairwise temporal relations between atomic events in the input . This leads to a combinatorial search of all pairwise events for each predicate in the temporal rule body . Multi-Event Labels Third , ILP domains work on disjoint labels , while in time series , multiple composite events could occur in each input . In our baseball video , such as a highlight reel , composite event labels strike , steal and their corresponding atomic events can co-occur in a single video . This further extends the search space of atomic events we consider for each composite event rule . We illustrate these differences in Figure 1 and further discuss these challenges regarding search complexity in Appendix A . To address these challenges , Neural TLP operates on two key steps . Parameter Learning First Neural TLP inputs probabilistic atomic events and learns parameters to infer temporal predicates between atomic events . We represent the atomic event data in an intervalbased representation to efficiently predict all pairwise predicates between atomic events . The inferred predicates are then projected to predict the composite event labels . Structure Learning When the predicate parameters are learned , Neural TLP learns a sparse vector to select the correct rule over the combinatorial space of possible rules . To prune the search space , we use the learned projected weights to select candidate grounded predicates per composite event . We evaluate our method on a synthetic video dataset to empirically test our temporal rule induction performance . Additionally , we apply our framework to provide relevant rules in the healthcare domain , which were verified by doctors . 2 PROBLEM FORMULATION . We define the complete set of atomic events X = { x1 , x2 , . . . , x|X | } along a timeline T . These atomic events can be existing features in time series data or user defined features of interest . A temporal logic rule r ( Xr , Tr ) can be defined as using a subset of N ≤ |X | atomic events Xr = { xu } Nu=1 ⊆ X , and their associated time intervals Tr = { tu } Nu=1 ⊆ T . The time intervals consists of start and end times tu = [ tustart , tuend ] . These intervals indicate durational events and we can also initialize instantaneous events occurring at one time point where tustart = tuend . A rule is evaluated as true if the corresponding atomic events xu are present and are in correct ordering with respect to the intervals tv of other events xv : r ( Xr , Tr ) : = ( ∧ xu∈Xr xu ) ∧ ( ∧ tu , tv∈Tr pi ( tu , tv ) ) The temporal predicates pi ∈ { before , during , after } = P represent a simplified subset of Allen ’ s Temporal Algebra ( Allen , 1983 ) . We simplify the notation of the rules as a conjunction of temporal predicates between observed events , where the event time intervals are implicit : r : = n∧ xu , xv∈Xr pi ( xu , xv ) ( 1 ) For example , the grounded predicate before ( pitch [ 2,2.7 ] , swing [ 3,3.5 ] ) would evaluate to true . These underlying causal rules r induce the composite event labels r → yr seen in the data . Multiple composite events of interest can co-occur during the same time series sample T which we denote as y = { yr } |R| ∈ { 0 , 1 } |R| . Any yr = 1 indicates the latent rule r occurred over T resulting in label yr . While T contains precise atomic event interval information , the observed time series T̃ consists of a sequence of probabilistic atomic events from times [ 1 , T ] . Potentially k different objects T̃ i compose the final time series data T̃ = ⋃k i=1 T̃ i . Examples of objects can be multiple concurrent sensor data , or tracking multiple people moving within a video . Then the input T̃ is formulated as MT ∈ [ 0 , 1 ] k×|X|×T across object , atomic event , and probability dimensions respectively . The temporal ILP task is to recover all underlying rules R given m samples of inputs and labels { ( MTi , yi ) } mi=1 . In Neural TLP this involves learning parameters for the predicates between atomic events and then learning the combination of grounded predicates that induce each r ∈ R . 3 NEURAL TEMPORAL LOGIC PROGRAMMING . Neural TLP operates in two stages . The parameter learning stage learns how to compress the temporal data and learns parameterized temporal predicates . Once these parameters are learned , the structure learning stage learns which conjunctive combination of pairwise atomic event predicates is associated with each composite event label . This conjunction composes the rule r for label yr and is jointly computed for all R. An overview of the framework is presented in Figure 2 . 3.1 PARAMETER LEARNING STAGE . Temporal Compression Starting from the raw probabilistic atomic event data , we first compress the timeline through convolution . This 1D convolution over the temporal dimension compresses and smooths the timeline to mitigate noise from spurious events . Here the convolution kernel K|X |×l of length l is learned per atomic event . We also parameterize α as an extra degree of freedom to scale these convolved scores , which is useful when computing the intermediate predicates downstream . MC ∈ Rk×|X|×t = α · conv_1D ( MT ∈ [ 0 , 1 ] k×|X|×T , K ) ( 2 ) The time information is incorporated by multiplying the time dimension MD into compressed events : MA ∈ Rk×|X|×t = MC ⊙ MD . Here MD has the same dimensions as MC , but the temporal dimension is enumerated from [ 1 , t ] , where MD : , : ,l = l. This can be thought as a positional encoding . For example if we look at the sample compressed scores for a single object i and atomic event j MCi , j,6:10 = [ .01 , .05 , .7 , .7 , .03 ] and MDi , j,6:10 = [ 6 , 7 , 8 , 9 , 10 ] then MAi , j,6:10 = [ .06 , .35 , 5.6 , 6.3 , .3 ] . Intuitively we can see that from MAi , j,6:10 that ( 1 ) atomic event j occurs when the scores are high at 5.6 and 6.3 and that ( 2 ) score 6.3 occurs after score 5.6 due to the multiplied time index . This temporal representation provides a path to compute precise time intervals of atomic event occurrences and define predicates to compare atomic event intervals . Predicate Modeling From the compressed timelines , we determine the temporal predicates between atomic events . These relations are computed in a pairwise manner for all atomic events ∀xu , xv ∈ X occurring in object i through a small network which we call Temporal Predicate Network ( TPN ) . For notation sake here , we represent the atomic event u ’ s timeline for object i as tiu = MAi , u , : ∈ Rt and correspondingly for atomic event v. We denote TPN as gθ ( tiu , t i v ) , which takes pairwise atomic event timelines and predicts a temporal predicate p ∈ P to indicate the relationship between the atomic events . Methods such as Temporal Relation Networks ( Zhou et al. , 2018 ) learn these predicates between video events by sampling frames throughout the video . The timelines can be long in our setting , and events can occur sparsely , making sampling timelines expensive and noisy . To efficiently compute these relations , we would like to recover each event ’ s underlying start and end time intervals . From intervals , we can encode strong inductive biases to predict the predicates.We are working with continuous time series scores in tiu , t i v , so the intervals have to be extracted as the first step in TPN . To compute the start of an event interval , we create a mask to identify the atomic event noise . Those values will be below some small value ϵ , corresponding to noise in the timeline . We learn the convolution scalar α from Equation 2 to scale scores corresponding to active atomic event occurrences above ϵ while keeping scores corresponding to atomic event noise below ϵ . Then the mask is added to the time series , and a min is performed to get the start of the active atomic event interval . Afterwards the min of the mask is subtracted to remove any effect of the mask on the start value . tmask = ( max ( t i u ) + ϵ ) · ( tiu < ϵ ) ( 3 ) ustart = min ( t i u + tmask ) −min ( tmask ) ( 4 ) To get the end of the event interval we simply compute uend = max ( tiu ) since we multiplied the event scores with the time index earlier . This interval computation from the input time series is visualized in Figure 3 . This is computed similarly for the other pairwise event v : [ vstart , vend ] . Given the start and end times for the event pairs u , v , the un-normalized predicate scores are computed as : before ( u , v ) = vstart − uend ( 5 ) after ( u , v ) = ustart − vend ( 6 ) during ( u , v ) = min ( { vend − ustart , uend − vstart } ) ( 7 ) Although we use 3 predicates in our model , similar scores can be developed for more fine grained predicates . Then the values are aggregated as p = [ before ( u , v ) ; during ( u , v ) ; after ( u , v ) ] to compute normalized predictions as p = softmax ( p−βγ ) . Here β and γ and scale and shift parameters learned from data . Our predicates scores assume that intervals for both u and v occur , so if either event doesn ’ t occur we suppress all predicate predictions : supp = min ( { uend − ustart , vend − vstart } ) ( 8 ) pi = min ( { pi , supp } ) ( 9 ) Since we leverage a simple interval representation to compare atomic event objects , we can scale comparing atomic events within the object and between the other k−1 objects : xu ∈ X , xv ∈ ( X×k ) . This second-order interaction information is useful if we want to know if , for example , two events occurred simultaneously within different objects . For a single object i , these relations are computed for all pairwise predicates through TPN in MP ∈ R|X |× ( |X |×k ) ×|P| = Rk×|X|×|X|×|P| . Aggregating over all objects k , we get MQ = [ MP1 ; . . . ; MPk ] ∈ Rk 2×|X|×|X|×|P| . We marginalize over the object dimension to get our final pairwise relation matrix MR = ∑ i MQi , : , : , : ∈ R |X |×|X|×|P| . Composite Event Prediction The final inference step from the pairwise relational predicates to the composite events labels is carried out by fϕ . This is a linear projection function fϕ ( MR ) : = σ ( dropout ( vec ( MR ) ) W ) used to infer the composite event labels ŷ . Here we flatten MR as vec ( MR ) ∈ R|X |·|X |·|P| and regularize it by randomly masking out the grounded predicates ( Srivastava et al. , 2014 ) . This representation is then projected to the label space using W ∈ R ( |X |·|X |·|P| ) ×|y| before passing the un-normalized results through a sigmoid function σ. W learns what grounded relational predicates pi ( xu , xv ) , such as before ( pitch , swing ) , correspond to each composite event label . These weights will also be useful for extracting the rules , in the structure learning stage .
The paper proposes an end-to-end differentiable strategy (called neural TLP) to learn unknown temporal relations between atomic events (like after(miss, swing), “miss occurs after swing” in the baseball example), subsequently used to predict composite events (like strike). The strategy consists of a cascade of a smoothing stage to filter out noise from the input time series, an interval time extractor, a stage predicting temporal relations (such as before, after and during) and a linear output layer. Furthermore, the paper proposes a post-hoc procedure to extract propositional logical rules relating atomic events to composite ones from the last layer. The performance of the proposed strategy is evaluated on video recognition (CATER) and healthcare (MIMIC-III) datasets against two baselines, namely a LSTM neural net and a simplified version of the proposed strategy.
SP:2babd7819655158cde03167c37188ddf6a9147b2
Neural Temporal Logic Programming
1 INTRODUCTION . Complex time series data is present across many data modalities such as sensors , records , audio , and video data . Typically there are composite events of interest in these time series which are composed of other atomic events in a certain order ( Liu et al. , 1999 ; Chakravarthy et al. , 1994 ; Hinze , 2003 ) . An example is a health symptom that can be observed in a doctor ’ s report . Atomic events , such as patient vitals and medications , and their temporal relations dictate an underlying causal rule leading to the composite event symptom . These rules may be unknown but useful to recover ( Kovačević et al. , 2013 ; Guillame-Bert et al. , 2017 ) . Recent methods leverage the advances in highly parameterized deep architectures to learn latent representations of atomic event data ( Pham et al. , 2017 ; Chen et al. , 2018 ; Choi et al. , 2019 ) , with the increasing availability of large temporal datasets . Methods , such as LSTM ( Hochreiter & Schmidhuber , 1997 ) or Transformer ( Vaswani et al. , 2017 ) based architectures , provide stateof-the-art performance in terms of composite event inference . However , it is uncertain whether the latent representations learn the underlying causal sequence of events or overfit spurious signals in the training data . Having representations faithful to causal mechanisms is advantageous for interpretability , out-of-distribution generalization , and adapting to smaller data sets . Therefore it is important to leverage parametric models that can handle data noise while providing a mechanism to extract explicit temporal rules ( Carletti et al. , 2019 ) . Extracting explicit logic rules has been studied through Inductive Logic Programming ( ILP ) methods ( Muggleton , 1991 ; Muggleton & De Raedt , 1994 ) and have been leveraged in parametric fashions as well ( Yang et al. , 2017 ; Evans & Grefenstette , 2018 ; Rocktäschel & Riedel , 2017 ) . ILP starts with set of background knowledge , consisting of grounded atoms ( i.e . facts which do not contain variables ) such as location ( Braves , Atlanta ) , where the predicate location determines the relationship between the items Braves and Atlanta . There are set of labels from which rules should be learned . The task is to construct a set of rules , when executed over the background knowledge , entail the provided labels . Given the label InLeague ( Braves , NL East ) and the background knowledge ( Figure 1 ILP Input ) as input , a candidate rule is InLeague ( Team , League ) : = Location ( Team , City ) ∧ Division ( City , League ) . Here InLeague ( Team , League ) is the head of the rule consisting of an atom with variables Team , League as items . The body consists of two atoms and when these atoms exist on the background knowledge the rule is evaluated as true.We apply ILP over real world temporal data , however learning such rules poses three key challenges . Temporal Background Knowledge First , ILP methods operate over an existing grounded background knowledge . The temporal case does not have this knowledge when operating over raw time series . For example in a baseball video , grounded atomic events pitch or swing , or grounded predicates such as before ( pitch , swing ) are not explicitly provided . By nature , the video would be labeled with a higher level composite event description , such as `` Player A ’ s home run '' instead of individual atomic events and their corresponding temporal predicates . Such atoms can be extracted using a model in a probabilistic fashion at each time point , and a temporal ILP method should handle this uncertainty . The temporal predicates between these probabilistic atomic events can be applied in a rule-based manner ( ex . t1 < t2 → before ) , but due to the noisy nature of extracted atomic events , the predicate predictions should be robust to consistent noise in the atomic event data . Atomic Event Relevance Second , ILP works learn consistent rules that satisfy a path in the background knowledge given the terms in the labels , such as InLeague ( Braves , NL East ) . The labels are nullary predicates in the temporal case , so the relevant source and target atomic events and predicates to use for rule induction are unknown . In our example , we know from the video we have a label strike , but are not told when it occurred or what other events , such as pitch , swing , and miss are needed to compose a rule for strike . Without a prior on which atomic events to search from , we must consider all pairwise temporal relations between atomic events in the input . This leads to a combinatorial search of all pairwise events for each predicate in the temporal rule body . Multi-Event Labels Third , ILP domains work on disjoint labels , while in time series , multiple composite events could occur in each input . In our baseball video , such as a highlight reel , composite event labels strike , steal and their corresponding atomic events can co-occur in a single video . This further extends the search space of atomic events we consider for each composite event rule . We illustrate these differences in Figure 1 and further discuss these challenges regarding search complexity in Appendix A . To address these challenges , Neural TLP operates on two key steps . Parameter Learning First Neural TLP inputs probabilistic atomic events and learns parameters to infer temporal predicates between atomic events . We represent the atomic event data in an intervalbased representation to efficiently predict all pairwise predicates between atomic events . The inferred predicates are then projected to predict the composite event labels . Structure Learning When the predicate parameters are learned , Neural TLP learns a sparse vector to select the correct rule over the combinatorial space of possible rules . To prune the search space , we use the learned projected weights to select candidate grounded predicates per composite event . We evaluate our method on a synthetic video dataset to empirically test our temporal rule induction performance . Additionally , we apply our framework to provide relevant rules in the healthcare domain , which were verified by doctors . 2 PROBLEM FORMULATION . We define the complete set of atomic events X = { x1 , x2 , . . . , x|X | } along a timeline T . These atomic events can be existing features in time series data or user defined features of interest . A temporal logic rule r ( Xr , Tr ) can be defined as using a subset of N ≤ |X | atomic events Xr = { xu } Nu=1 ⊆ X , and their associated time intervals Tr = { tu } Nu=1 ⊆ T . The time intervals consists of start and end times tu = [ tustart , tuend ] . These intervals indicate durational events and we can also initialize instantaneous events occurring at one time point where tustart = tuend . A rule is evaluated as true if the corresponding atomic events xu are present and are in correct ordering with respect to the intervals tv of other events xv : r ( Xr , Tr ) : = ( ∧ xu∈Xr xu ) ∧ ( ∧ tu , tv∈Tr pi ( tu , tv ) ) The temporal predicates pi ∈ { before , during , after } = P represent a simplified subset of Allen ’ s Temporal Algebra ( Allen , 1983 ) . We simplify the notation of the rules as a conjunction of temporal predicates between observed events , where the event time intervals are implicit : r : = n∧ xu , xv∈Xr pi ( xu , xv ) ( 1 ) For example , the grounded predicate before ( pitch [ 2,2.7 ] , swing [ 3,3.5 ] ) would evaluate to true . These underlying causal rules r induce the composite event labels r → yr seen in the data . Multiple composite events of interest can co-occur during the same time series sample T which we denote as y = { yr } |R| ∈ { 0 , 1 } |R| . Any yr = 1 indicates the latent rule r occurred over T resulting in label yr . While T contains precise atomic event interval information , the observed time series T̃ consists of a sequence of probabilistic atomic events from times [ 1 , T ] . Potentially k different objects T̃ i compose the final time series data T̃ = ⋃k i=1 T̃ i . Examples of objects can be multiple concurrent sensor data , or tracking multiple people moving within a video . Then the input T̃ is formulated as MT ∈ [ 0 , 1 ] k×|X|×T across object , atomic event , and probability dimensions respectively . The temporal ILP task is to recover all underlying rules R given m samples of inputs and labels { ( MTi , yi ) } mi=1 . In Neural TLP this involves learning parameters for the predicates between atomic events and then learning the combination of grounded predicates that induce each r ∈ R . 3 NEURAL TEMPORAL LOGIC PROGRAMMING . Neural TLP operates in two stages . The parameter learning stage learns how to compress the temporal data and learns parameterized temporal predicates . Once these parameters are learned , the structure learning stage learns which conjunctive combination of pairwise atomic event predicates is associated with each composite event label . This conjunction composes the rule r for label yr and is jointly computed for all R. An overview of the framework is presented in Figure 2 . 3.1 PARAMETER LEARNING STAGE . Temporal Compression Starting from the raw probabilistic atomic event data , we first compress the timeline through convolution . This 1D convolution over the temporal dimension compresses and smooths the timeline to mitigate noise from spurious events . Here the convolution kernel K|X |×l of length l is learned per atomic event . We also parameterize α as an extra degree of freedom to scale these convolved scores , which is useful when computing the intermediate predicates downstream . MC ∈ Rk×|X|×t = α · conv_1D ( MT ∈ [ 0 , 1 ] k×|X|×T , K ) ( 2 ) The time information is incorporated by multiplying the time dimension MD into compressed events : MA ∈ Rk×|X|×t = MC ⊙ MD . Here MD has the same dimensions as MC , but the temporal dimension is enumerated from [ 1 , t ] , where MD : , : ,l = l. This can be thought as a positional encoding . For example if we look at the sample compressed scores for a single object i and atomic event j MCi , j,6:10 = [ .01 , .05 , .7 , .7 , .03 ] and MDi , j,6:10 = [ 6 , 7 , 8 , 9 , 10 ] then MAi , j,6:10 = [ .06 , .35 , 5.6 , 6.3 , .3 ] . Intuitively we can see that from MAi , j,6:10 that ( 1 ) atomic event j occurs when the scores are high at 5.6 and 6.3 and that ( 2 ) score 6.3 occurs after score 5.6 due to the multiplied time index . This temporal representation provides a path to compute precise time intervals of atomic event occurrences and define predicates to compare atomic event intervals . Predicate Modeling From the compressed timelines , we determine the temporal predicates between atomic events . These relations are computed in a pairwise manner for all atomic events ∀xu , xv ∈ X occurring in object i through a small network which we call Temporal Predicate Network ( TPN ) . For notation sake here , we represent the atomic event u ’ s timeline for object i as tiu = MAi , u , : ∈ Rt and correspondingly for atomic event v. We denote TPN as gθ ( tiu , t i v ) , which takes pairwise atomic event timelines and predicts a temporal predicate p ∈ P to indicate the relationship between the atomic events . Methods such as Temporal Relation Networks ( Zhou et al. , 2018 ) learn these predicates between video events by sampling frames throughout the video . The timelines can be long in our setting , and events can occur sparsely , making sampling timelines expensive and noisy . To efficiently compute these relations , we would like to recover each event ’ s underlying start and end time intervals . From intervals , we can encode strong inductive biases to predict the predicates.We are working with continuous time series scores in tiu , t i v , so the intervals have to be extracted as the first step in TPN . To compute the start of an event interval , we create a mask to identify the atomic event noise . Those values will be below some small value ϵ , corresponding to noise in the timeline . We learn the convolution scalar α from Equation 2 to scale scores corresponding to active atomic event occurrences above ϵ while keeping scores corresponding to atomic event noise below ϵ . Then the mask is added to the time series , and a min is performed to get the start of the active atomic event interval . Afterwards the min of the mask is subtracted to remove any effect of the mask on the start value . tmask = ( max ( t i u ) + ϵ ) · ( tiu < ϵ ) ( 3 ) ustart = min ( t i u + tmask ) −min ( tmask ) ( 4 ) To get the end of the event interval we simply compute uend = max ( tiu ) since we multiplied the event scores with the time index earlier . This interval computation from the input time series is visualized in Figure 3 . This is computed similarly for the other pairwise event v : [ vstart , vend ] . Given the start and end times for the event pairs u , v , the un-normalized predicate scores are computed as : before ( u , v ) = vstart − uend ( 5 ) after ( u , v ) = ustart − vend ( 6 ) during ( u , v ) = min ( { vend − ustart , uend − vstart } ) ( 7 ) Although we use 3 predicates in our model , similar scores can be developed for more fine grained predicates . Then the values are aggregated as p = [ before ( u , v ) ; during ( u , v ) ; after ( u , v ) ] to compute normalized predictions as p = softmax ( p−βγ ) . Here β and γ and scale and shift parameters learned from data . Our predicates scores assume that intervals for both u and v occur , so if either event doesn ’ t occur we suppress all predicate predictions : supp = min ( { uend − ustart , vend − vstart } ) ( 8 ) pi = min ( { pi , supp } ) ( 9 ) Since we leverage a simple interval representation to compare atomic event objects , we can scale comparing atomic events within the object and between the other k−1 objects : xu ∈ X , xv ∈ ( X×k ) . This second-order interaction information is useful if we want to know if , for example , two events occurred simultaneously within different objects . For a single object i , these relations are computed for all pairwise predicates through TPN in MP ∈ R|X |× ( |X |×k ) ×|P| = Rk×|X|×|X|×|P| . Aggregating over all objects k , we get MQ = [ MP1 ; . . . ; MPk ] ∈ Rk 2×|X|×|X|×|P| . We marginalize over the object dimension to get our final pairwise relation matrix MR = ∑ i MQi , : , : , : ∈ R |X |×|X|×|P| . Composite Event Prediction The final inference step from the pairwise relational predicates to the composite events labels is carried out by fϕ . This is a linear projection function fϕ ( MR ) : = σ ( dropout ( vec ( MR ) ) W ) used to infer the composite event labels ŷ . Here we flatten MR as vec ( MR ) ∈ R|X |·|X |·|P| and regularize it by randomly masking out the grounded predicates ( Srivastava et al. , 2014 ) . This representation is then projected to the label space using W ∈ R ( |X |·|X |·|P| ) ×|y| before passing the un-normalized results through a sigmoid function σ. W learns what grounded relational predicates pi ( xu , xv ) , such as before ( pitch , swing ) , correspond to each composite event label . These weights will also be useful for extracting the rules , in the structure learning stage .
This paper presents an approach for learning temporal rules from data. The idea is to extract atomic events, and their temporal relationships between them. Subsequently, composite events are learned using composite event labels for supervision. The whole approach is formulated as an optimisation problem, after which standard techniques are applied to solve it.
SP:2babd7819655158cde03167c37188ddf6a9147b2
Online Coreset Selection for Rehearsal-based Continual Learning
1 INTRODUCTION . Humans possess the ability to learn a large number of tasks by accumulating knowledge and skills over time . Building a system resembling human learning abilities is a deep-rooted desire since sustainable learning over a long-term period is essential for general artificial intelligence . In light of this need , continual learning ( CL ) ( Thrun , 1995 ) , or lifelong learning , tackles a learning scenario where a model continuously learns over a sequence of tasks ( Kumar & Daume III , 2012 ; Li & Hoiem , 2016 ) within a broad research area , such as classification ( Kirkpatrick et al. , 2017 ; Chaudhry et al. , 2019a ) , image generation ( Zhai et al. , 2019 ) , language learning ( Li et al. , 2019b ; Biesialska et al. , 2020 ) , clinical application ( Lee & Lee , 2020 ; Lenga et al. , 2020 ) , speech recognition ( Sadhu & Hermansky , 2020 ) , and federated learning ( Yoon et al. , 2021 ) . A well-known challenge for continual learning is catastrophic forgetting ( McCloskey & Cohen , 1989 ) , where the continual learner loses the fidelity for past tasks after adapting the previously learned knowledge to future tasks . Recent rehearsal-based continual learning methods adapt the continual model to the previous tasks by maintaining and revisiting a small replay buffer ( Titsias et al. , 2020 ; Mirzadeh et al. , 2020 ) . However , the majority of these methods store random-sampled instances as a proxy set to mitigate catastrophic forgetting , limiting their practicality to real-world applications ( see Figure 1a ) when all the training instances are not equally useful , as some of them can be more representative or informative for the current task , and others can lead to performance degeneration for previous tasks . Furthermore , these unequal potentials could be more severe under practical scenarios containing imbalanced , streaming , or noisy instances ( see Figure 2 ) . This leads to an essential question in continual learning : How can we obtain a coreset to promote task adaptation for the current task while minimizing catastrophic forgetting on previously seen tasks ? To address this question , we propose Online Coreset Selection ( OCS ) , a novel method for continual learning that selects representative training instances for the current and previous tasks from arriving streaming data in an online fashion based on our following three selection strategies : ( 1 ) Minibatch similarity selects samples that are representative to the current task Tt . ( 2 ) sample diversity encourages minimal redundancy among the samples of current task Tt . ( 3 ) Coreset affinity promotes minimum interference between the selected samples and knowledge of the previous tasks Tk , ∀k < t. To this end , OCS minimizes the catastrophic forgetting on the previous tasks by utilizing the obtained coreset for future training , and also encourages the current task adaptation by updating the model parameters on the top-κ selected data instances . The overall concept is illustrated in Figure 1b . Our method is simple , intuitive , and is generally applicable to any rehearsal-based continual learning method . We evaluate the performance of OCS on various continual learning scenarios and show that it outperforms state-of-the-art rehearsal-based techniques on balanced , imbalanced , and noisy continual learning benchmarks of varying complexity . We also show that OCS is general and exhibits collaborative learning with the existing rehearsal-based methods , leading to increased task adaptation and inhibiting catastrophic forgetting . To summarize , our contributions are threefold : • We address the problem of coreset selection for realistic and challenging continual learning scenarios , where the data continuum is composed of class-imbalanced or noisy instances that deteriorate the performance of the continual learner during training . • We propose Online Coreset Selection ( OCS ) , a simple yet effective online coreset selection method to obtain a representative and diverse subset that has a high affinity to the previous tasks from each minibatch during continual learning . Specifically , we present three gradient-based selection criteria to select the coreset for current task adaptation while mitigating catastrophic forgetting . • We demonstrate that OCS is applicable to any rehearsal-based continual learning method and experimentally validate it on multiple benchmark scenarios , where it largely improves the performance of the base algorithms across various performance metrics . 2 RELATED WORK . Continual learning . In the past few years , there has been significant progress in continual learning to alleviate catastrophic forgetting ( McCloskey & Cohen , 1989 ) . The regularization approaches ( Kirkpatrick et al. , 2017 ; Lee et al. , 2017 ; Serrà et al. , 2018 ) modify the model parameters with additional regularization constraints to prevent catastrophic forgetting . The architecture approaches ( Rusu et al. , 2016 ; Yoon et al. , 2018 ; Xu & Zhu , 2018 ; Li et al. , 2019a ; Yoon et al. , 2020 ) utilize network isolation or expansion during continual learning to improve network performance . Another line of research uses rehearsal approaches , which memorize or generate a small fraction of data points for previous tasks and utilizes them to retain the task knowledge ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; Aljundi et al. , 2019b ; Borsos et al. , 2020 ) . For example , Gradient-based Sample Selection ( GSS ) ( Aljundi et al. , 2019b ) formulates the selection of the replay buffer as a constraint selection problem to maximize the variance of gradient direction . ER-MIR ( Aljundi et al. , 2019a ) iteratively constructs the replay buffer using a loss-based criterion , where the model selects the top-κ instances that increase the loss between the current and previous iteration . However , the existing rehearsalbased methods ( Rebuffi et al. , 2017 ; Aljundi et al. , 2019b ; a ; Chaudhry et al. , 2019a ; b ) do not select the coreset before the current task adaptation and update the model on all the arriving data streams , which makes them susceptible to real-world applications that include noisy and imbalanced data distributions . In contrast , OCS selects the instances before updating the model using our proposed selection criteria , which makes it robust to past and current task training across various CL scenarios . Coreset selection . There exist various directions to obtain a coreset from a large dataset . Importance sampling ( Johnson & Guestrin , 2018 ; Katharopoulos & Fleuret , 2018 ; Sinha et al. , 2020 ) strengthens the loss/gradients of important samples based on influence functions . Kool et al . ( 2019 ) connect stochastic Gumbel-top-k trick and beam search to hierarchically sample sequences without replacement . Rebuffi et al . ( 2017 ) propose a herding based strategy for coreset selection . Nguyen et al . ( 2018 ) formulate the coreset summarization in continual learning using online variational inference ( Sato , 2001 ; Broderick et al. , 2013 ) . Aljundi et al . ( 2019b ) select the replay buffer to maximize the variance in the gradient-space . Contrary to these methods , OCS considers the diversity , task informativity and relevancy to the past tasks . Recently , Borsos et al . ( 2020 ) propose a bilevel optimization framework with cardinality constraints for coreset selection . However , their method is extremely limited in practice and inapplicable in large-scale settings due to the excessive computational cost incurred during training . In contrast , our method is simple , and scalable since it can construct the coreset in the online streaming data continuum without additional optimization constraints . 3 REHEARSAL-BASED CONTINUAL LEARNING . We consider learning a model over a sequence of tasks { T1 , . . . , TT } = T , where each task is composed of independently and identically distributed datapoints and their labels , such that task Tt includes Dt = { xt , n , yt , n } Ntn=1 ∼ Xt × Yt , where Nt is the total number of data instances , and Xt × Yt is an unknown data generating distribution . We assume that an arbitrary set of labels for task Tt , yt = { yt , n } Ntn=1 has unique classes , yt ∩ yk = ∅ , ∀t 6= k. In a standard continual learning scenario , the model learns a corresponding task at each step and t-th task is accessible at step t only . Let neural network fΘ : X1 : T → Y1 : T be parameterized by a set of weights Θ = { θl } Ll=1 , where L is the number of layers in the neural network . We define the training objective at step t as follows : minimize Θ Nt∑ n=1 ` ( fΘ ( xt , n ) , yt , n ) , ( 1 ) where ` ( · ) is any standard loss function ( e.g. , cross-entropy loss ) . The naive CL design where a simple sequential training on multiple tasks without any means for tackling catastrophic forgetting can not retain the knowledge of previous tasks and thus results in catastrophic forgetting . To tackle this problem , rehearsal-based methods ( Nguyen et al. , 2018 ; Chaudhry et al. , 2019a ; Titsias et al. , 2020 ) update the model on a randomly sampled replay buffer Ck constructed from the previously observed tasks , where Ck = { xk , j , yk , j } Jkj=1 ∼ Dk , ∀k < t and Jk Nk . Consequently , the quality of selected instances is essential for rehearsal-based continual learning . For example , some data instances can be more informative and representative than others to describe a task and improve model performance . In contrast , some data instances can degrade the model ’ s memorization of past tasks ’ knowledge . Therefore , obtaining the most beneficial examples for the current task is crucial for the success of rehearsal-based CL methods. ) Classwise acc . of T2 Average Fgt . of T1 To validate our hypothesis , we design a learning scenario with a sequence of two tasks , MNIST ( T1 ) → CIFAR-10 ( T2 ) using ResNet-18 . After the standard single epoch training on T1 , we update the model weights through a single backpropagation step using a randomly selected data point from T2 , and measure test accuracy of its corresponding class c and forgetting of the entire dataset of a past task T1 . Results for individual impacts on 1000 data points from T2 are described in Section 3 . The influence of each data point from T2 has a large disparity not only on the corresponding class accuracy but also on past task ’ s forgetting that results in a very high standard deviation . We emphasize that each data point has a different potential impact in terms of forgetting past tasks . Few data points are much more robust to catastrophic forgetting than others , and this can be severe when the influences are accumulated during training . Based on this motivation , our objective is to select the data instances that can promote current task adaptation while minimizing catastrophic forgetting on the previous tasks . We propose a selection criterion that selects the subset that maximizes the gradient similarity between the representative instances and the current task dataset . More formally : u∗ = maximize u∈Nκ S ( 1 Nt ∇fΘ ( Dt ) , 1 κ ∑ n∈u ∇fΘ ( xt , n , yt , n ) ) , where u = { n : n ∈ N < Nt } , ( 2 ) where S is any arbitrary similarity function and u∗ is an index set that selects top-κ informative samples without replacement . However , obtaining a representative subset from the entire dataset is computationally expensive and intractable for online continual learning ; therefore , we consider a minibatch as an approximation of the dataset and select few representative data instances at each minibatch iteration . We empirically validate that our approximation generally holds across various datasets , network structures , and minibatch sizes in Appendix B and Figure B.9 . Consequently , the model iteratively updates the parameters to find the optimal local minima of the loss using informative data points , which obtain similar gradient directions with the averaged gradients of the dataset . In the next section , we propose OCS which consists of a simple similarity criterion to achieve this objective . However , similarity criterion is not sufficient to select the representative coreset for online continual learning ; hence , we propose diversity and coreset affinity criteria to mitigate catastrophic forgetting .
This paper proposes an Online Coreset Selection method to select the most representative and informative coreset at each iteration and trains them. The proposed method maximizes the model’s adaptation to a target dataset while selecting high-affinity samples to past tasks, which directly inhibits catastrophic forgetting. Experiments on the benchmark datasets show competitive results compared with baselines.
SP:34c39b5ae4a943556b4acb7ee4a899c8703f2f21
Online Coreset Selection for Rehearsal-based Continual Learning
1 INTRODUCTION . Humans possess the ability to learn a large number of tasks by accumulating knowledge and skills over time . Building a system resembling human learning abilities is a deep-rooted desire since sustainable learning over a long-term period is essential for general artificial intelligence . In light of this need , continual learning ( CL ) ( Thrun , 1995 ) , or lifelong learning , tackles a learning scenario where a model continuously learns over a sequence of tasks ( Kumar & Daume III , 2012 ; Li & Hoiem , 2016 ) within a broad research area , such as classification ( Kirkpatrick et al. , 2017 ; Chaudhry et al. , 2019a ) , image generation ( Zhai et al. , 2019 ) , language learning ( Li et al. , 2019b ; Biesialska et al. , 2020 ) , clinical application ( Lee & Lee , 2020 ; Lenga et al. , 2020 ) , speech recognition ( Sadhu & Hermansky , 2020 ) , and federated learning ( Yoon et al. , 2021 ) . A well-known challenge for continual learning is catastrophic forgetting ( McCloskey & Cohen , 1989 ) , where the continual learner loses the fidelity for past tasks after adapting the previously learned knowledge to future tasks . Recent rehearsal-based continual learning methods adapt the continual model to the previous tasks by maintaining and revisiting a small replay buffer ( Titsias et al. , 2020 ; Mirzadeh et al. , 2020 ) . However , the majority of these methods store random-sampled instances as a proxy set to mitigate catastrophic forgetting , limiting their practicality to real-world applications ( see Figure 1a ) when all the training instances are not equally useful , as some of them can be more representative or informative for the current task , and others can lead to performance degeneration for previous tasks . Furthermore , these unequal potentials could be more severe under practical scenarios containing imbalanced , streaming , or noisy instances ( see Figure 2 ) . This leads to an essential question in continual learning : How can we obtain a coreset to promote task adaptation for the current task while minimizing catastrophic forgetting on previously seen tasks ? To address this question , we propose Online Coreset Selection ( OCS ) , a novel method for continual learning that selects representative training instances for the current and previous tasks from arriving streaming data in an online fashion based on our following three selection strategies : ( 1 ) Minibatch similarity selects samples that are representative to the current task Tt . ( 2 ) sample diversity encourages minimal redundancy among the samples of current task Tt . ( 3 ) Coreset affinity promotes minimum interference between the selected samples and knowledge of the previous tasks Tk , ∀k < t. To this end , OCS minimizes the catastrophic forgetting on the previous tasks by utilizing the obtained coreset for future training , and also encourages the current task adaptation by updating the model parameters on the top-κ selected data instances . The overall concept is illustrated in Figure 1b . Our method is simple , intuitive , and is generally applicable to any rehearsal-based continual learning method . We evaluate the performance of OCS on various continual learning scenarios and show that it outperforms state-of-the-art rehearsal-based techniques on balanced , imbalanced , and noisy continual learning benchmarks of varying complexity . We also show that OCS is general and exhibits collaborative learning with the existing rehearsal-based methods , leading to increased task adaptation and inhibiting catastrophic forgetting . To summarize , our contributions are threefold : • We address the problem of coreset selection for realistic and challenging continual learning scenarios , where the data continuum is composed of class-imbalanced or noisy instances that deteriorate the performance of the continual learner during training . • We propose Online Coreset Selection ( OCS ) , a simple yet effective online coreset selection method to obtain a representative and diverse subset that has a high affinity to the previous tasks from each minibatch during continual learning . Specifically , we present three gradient-based selection criteria to select the coreset for current task adaptation while mitigating catastrophic forgetting . • We demonstrate that OCS is applicable to any rehearsal-based continual learning method and experimentally validate it on multiple benchmark scenarios , where it largely improves the performance of the base algorithms across various performance metrics . 2 RELATED WORK . Continual learning . In the past few years , there has been significant progress in continual learning to alleviate catastrophic forgetting ( McCloskey & Cohen , 1989 ) . The regularization approaches ( Kirkpatrick et al. , 2017 ; Lee et al. , 2017 ; Serrà et al. , 2018 ) modify the model parameters with additional regularization constraints to prevent catastrophic forgetting . The architecture approaches ( Rusu et al. , 2016 ; Yoon et al. , 2018 ; Xu & Zhu , 2018 ; Li et al. , 2019a ; Yoon et al. , 2020 ) utilize network isolation or expansion during continual learning to improve network performance . Another line of research uses rehearsal approaches , which memorize or generate a small fraction of data points for previous tasks and utilizes them to retain the task knowledge ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; Aljundi et al. , 2019b ; Borsos et al. , 2020 ) . For example , Gradient-based Sample Selection ( GSS ) ( Aljundi et al. , 2019b ) formulates the selection of the replay buffer as a constraint selection problem to maximize the variance of gradient direction . ER-MIR ( Aljundi et al. , 2019a ) iteratively constructs the replay buffer using a loss-based criterion , where the model selects the top-κ instances that increase the loss between the current and previous iteration . However , the existing rehearsalbased methods ( Rebuffi et al. , 2017 ; Aljundi et al. , 2019b ; a ; Chaudhry et al. , 2019a ; b ) do not select the coreset before the current task adaptation and update the model on all the arriving data streams , which makes them susceptible to real-world applications that include noisy and imbalanced data distributions . In contrast , OCS selects the instances before updating the model using our proposed selection criteria , which makes it robust to past and current task training across various CL scenarios . Coreset selection . There exist various directions to obtain a coreset from a large dataset . Importance sampling ( Johnson & Guestrin , 2018 ; Katharopoulos & Fleuret , 2018 ; Sinha et al. , 2020 ) strengthens the loss/gradients of important samples based on influence functions . Kool et al . ( 2019 ) connect stochastic Gumbel-top-k trick and beam search to hierarchically sample sequences without replacement . Rebuffi et al . ( 2017 ) propose a herding based strategy for coreset selection . Nguyen et al . ( 2018 ) formulate the coreset summarization in continual learning using online variational inference ( Sato , 2001 ; Broderick et al. , 2013 ) . Aljundi et al . ( 2019b ) select the replay buffer to maximize the variance in the gradient-space . Contrary to these methods , OCS considers the diversity , task informativity and relevancy to the past tasks . Recently , Borsos et al . ( 2020 ) propose a bilevel optimization framework with cardinality constraints for coreset selection . However , their method is extremely limited in practice and inapplicable in large-scale settings due to the excessive computational cost incurred during training . In contrast , our method is simple , and scalable since it can construct the coreset in the online streaming data continuum without additional optimization constraints . 3 REHEARSAL-BASED CONTINUAL LEARNING . We consider learning a model over a sequence of tasks { T1 , . . . , TT } = T , where each task is composed of independently and identically distributed datapoints and their labels , such that task Tt includes Dt = { xt , n , yt , n } Ntn=1 ∼ Xt × Yt , where Nt is the total number of data instances , and Xt × Yt is an unknown data generating distribution . We assume that an arbitrary set of labels for task Tt , yt = { yt , n } Ntn=1 has unique classes , yt ∩ yk = ∅ , ∀t 6= k. In a standard continual learning scenario , the model learns a corresponding task at each step and t-th task is accessible at step t only . Let neural network fΘ : X1 : T → Y1 : T be parameterized by a set of weights Θ = { θl } Ll=1 , where L is the number of layers in the neural network . We define the training objective at step t as follows : minimize Θ Nt∑ n=1 ` ( fΘ ( xt , n ) , yt , n ) , ( 1 ) where ` ( · ) is any standard loss function ( e.g. , cross-entropy loss ) . The naive CL design where a simple sequential training on multiple tasks without any means for tackling catastrophic forgetting can not retain the knowledge of previous tasks and thus results in catastrophic forgetting . To tackle this problem , rehearsal-based methods ( Nguyen et al. , 2018 ; Chaudhry et al. , 2019a ; Titsias et al. , 2020 ) update the model on a randomly sampled replay buffer Ck constructed from the previously observed tasks , where Ck = { xk , j , yk , j } Jkj=1 ∼ Dk , ∀k < t and Jk Nk . Consequently , the quality of selected instances is essential for rehearsal-based continual learning . For example , some data instances can be more informative and representative than others to describe a task and improve model performance . In contrast , some data instances can degrade the model ’ s memorization of past tasks ’ knowledge . Therefore , obtaining the most beneficial examples for the current task is crucial for the success of rehearsal-based CL methods. ) Classwise acc . of T2 Average Fgt . of T1 To validate our hypothesis , we design a learning scenario with a sequence of two tasks , MNIST ( T1 ) → CIFAR-10 ( T2 ) using ResNet-18 . After the standard single epoch training on T1 , we update the model weights through a single backpropagation step using a randomly selected data point from T2 , and measure test accuracy of its corresponding class c and forgetting of the entire dataset of a past task T1 . Results for individual impacts on 1000 data points from T2 are described in Section 3 . The influence of each data point from T2 has a large disparity not only on the corresponding class accuracy but also on past task ’ s forgetting that results in a very high standard deviation . We emphasize that each data point has a different potential impact in terms of forgetting past tasks . Few data points are much more robust to catastrophic forgetting than others , and this can be severe when the influences are accumulated during training . Based on this motivation , our objective is to select the data instances that can promote current task adaptation while minimizing catastrophic forgetting on the previous tasks . We propose a selection criterion that selects the subset that maximizes the gradient similarity between the representative instances and the current task dataset . More formally : u∗ = maximize u∈Nκ S ( 1 Nt ∇fΘ ( Dt ) , 1 κ ∑ n∈u ∇fΘ ( xt , n , yt , n ) ) , where u = { n : n ∈ N < Nt } , ( 2 ) where S is any arbitrary similarity function and u∗ is an index set that selects top-κ informative samples without replacement . However , obtaining a representative subset from the entire dataset is computationally expensive and intractable for online continual learning ; therefore , we consider a minibatch as an approximation of the dataset and select few representative data instances at each minibatch iteration . We empirically validate that our approximation generally holds across various datasets , network structures , and minibatch sizes in Appendix B and Figure B.9 . Consequently , the model iteratively updates the parameters to find the optimal local minima of the loss using informative data points , which obtain similar gradient directions with the averaged gradients of the dataset . In the next section , we propose OCS which consists of a simple similarity criterion to achieve this objective . However , similarity criterion is not sufficient to select the representative coreset for online continual learning ; hence , we propose diversity and coreset affinity criteria to mitigate catastrophic forgetting .
The author propose a novel approach for online coreset selection, i.e exemplars used in the rehearsal process of past tasks in a continual learning framework. The proposed method is based on the observation that not all the samples in a dataset are equally valuable, but their quality affects model's effectiveness and efficiency. The method selects the most representative and informative samples at each iteration and trains them in an online manner. The approach has been conviently compared with state-of-the art methods and demonstrated its superiority.
SP:34c39b5ae4a943556b4acb7ee4a899c8703f2f21
C5T5: Controllable Generation of Organic Molecules with Transformers
1 INTRODUCTION . Organic molecules are used in countless applications across human society : as medicines , industrial chemicals , fuels , pesticides , plastics , television screens , solar cells , and many others . Traditionally , new molecules are designed for particular tasks by hand , but the space of all possible molecules is so vast ( e.g . the total number of drug-like molecules may be as high as 1060 ) that most useful materials are probably still undiscovered ( Reymond et al. , 2012 ) . To automate materials discovery , domain experts have turned to high-throughput screening , in which a large library of potentially useful molecules is generated heuristically , and the most promising molecules are chosen for further study using computational models that estimate how effective each substance will be for the target application ( Hughes et al. , 2011 ) . Unfortunately , even high-throughput methods can still only screen a tiny fraction of all possible molecules . Generating molecules directly with machine learning addresses this limitation , but de novo generation can be of limited use in domains like drug discovery , where experts ’ intuitions about structureactivity relationships and external factors like patentability are important to consider in the design process . These constraints can often be expressed by providing known portions of the molecular structure ; for example a domain expert may be interested in a particular scaffold because it has favorable intellectual property attributes , or certain parts of a drug may be needed for the desired biological activity , while other parts can be modified to increase bioavailability . To address this real-world setting , we consider the problem of learning to make localized modifications to a molecule that change its physical properties in a desired way . We propose C5T5 : Controllable Characteristic-Conditioned Chemical Changer with T5 ( Raffel et al. , 2019 ) , a novel method for generative modeling of organic molecules that gives domain experts fine-grained control over the molecular optimization process while also providing more understandable predictions than prior methods ( Figure 1 ) . Our two key contributions are 1 ) recasting molecular modeling as language modeling on the semantically rich IUPAC name base representation , and 2 ) the development of a novel conditional language modeling strategy using transformers that supports targeted modifications to existing molecules . IUPAC Names . The IUPAC naming system is a systematic way of naming organic molecules based on functional groups and moieties , or commonly occurring clusters of connected atoms that have known chemical behaviors . Organic chemists have discovered countless chemical reactions that operate on functional groups , and they use these reactions to develop synthesis routes for novel molecules . Despite this , existing generative methods for organic molecules have ignored IUPAC names as a representation , instead opting for atom-based representations like SMILES ( Weininger , 1988 ) and molecular graphs ( Duvenaud et al. , 2015 ) . See Figure 2 for a comparison of these representations . We argue for several advantages of IUPAC names in Section 3.1 . To the best of our knowledge we are the first to use IUPAC names as a base representation for molecular modeling . Self-Supervised Objective for Zero-Shot Editing . To enable targeted modifications of molecules without predefined edit pairs , we train transformers with a conditional variant of a self-supervised infilling task , where the model must replace masked-out tokens in the IUPAC name . As described in Section 3.2 , we condition the model by prepending IUPAC names with discretized molecular property values ; the model then learns the conditional relationships between the property value and molecular structure . To the best of our knowledge , C5T5 is the first method to use conditional infilling for select-and-replace editing ; we anticipate this method could be broadly applied in other controlled generation contexts , such as modeling affect , politeness , or topic of natural language ( Ghosh et al. , 2017 ; Ficler & Goldberg , 2017 ; Niu & Bansal , 2018 ; Keskar et al. , 2019 ) . As we show in Section 4 , C5T5 is able to make interpretable targeted modifications to molecules that lead to desired changes across several physical properties important in drug design . 2 RELATED WORK . Modeling . A number of machine learning methods have been developed for the task of designing organic molecules , but most do not allow a user to make targeted modifications to a molecule . Some methods , like generative adversarial networks and unconditional sequence models , provide no control over a generated molecule ’ s structure ( Grisoni et al. , 2020 ; Guimaraes et al. , 2017 ; SanchezLengeling et al . ; De Cao & Kipf , 2018 ; Kajino , 2019 ) , and are therefore more useful for generating candidate libraries than optimizing a particular molecule . Other methods , like variational autoencoders or sequence models that are conditioned on a base molecule , allow specifying that generated molecules should be similar to a starting molecule in some learned space , but there is no way to specifically target a certain part of the molecule to modify ( He et al. , 2021b ; Jin et al. , 2019 ; Shin et al. , 2021 ; Yang et al. , 2020 ; Kotsias et al. , 2020 ; Gómez-Bombarelli et al. , 2018 ; Lim et al. , 2018 ; Dollar et al. , 2021 ; Liu et al. , 2018 ; Jin et al. , 2018 ; Maziarka et al. , 2020 ; Olivecrona et al. , 2017 ; Bagal et al. , 2021 ; You et al. , 2018 ; Shi * et al. , 2020 ) . Recognizing the importance of leveraging domain experts ’ intuition about structure-activity relationships , several methods , published mostly in chemistry venues , have explored constraining generated molecules to contain a scaffold , or a subgraph of the full molecular graph ( Li et al. , 2019 ; Lim et al. , 2020 ; Maziarz et al. , 2021 ) . However , these methods append to scaffolds arbitrarily instead of allowing domain experts to specify which part of the molecule they would like to modify or append to , limiting their utility for human-in-theloop molecular optimization . A few methods have explored allowing targeted modifications , where a domain expert can mask out a portion of a starting molecule and ask the model to replace the mask with a novel side chain ( Arús-Pous et al. , 2020 ; Langevin et al. , 2020 ; He et al. , 2021a ) . These methods are limited because they only support masking parts of the molecule that can be truncated by cutting a single bond , and because they require a dataset of paired molecules ( scaffolds & decorators ) that must be constructed using hand-crafted rules . In contrast , C5T5 learns in an entirely unsupervised fashion and therefore requires no paired data ; the only limit to what can be masked is what can be represented using IUPAC tokens . Representation . Existing methods all use SMILES ( or a derivative representation ) or graphs to represent molecules . There are a number of drawbacks to using the SMILES representation : a small change in a molecule can lead to a large change in the SMILES string ( Jin et al. , 2018 ) ; flattening the graph into a list of atoms artificially creates variable- and long-range dependencies between bonded atoms ; and it is difficult to reason about common substructures , because the same structure can be represented in many different ways depending on how the graph was flattened . And although graphs seem like a natural representation for molecules , graphs do a poor job encoding symmetry , longrange interactions between atoms that are many bonds apart but nearby in 3D space , and long-range interactions that arise from conjugated systems ( Duvenaud et al. , 2015 ) . C5T5 operates instead of IUPAC names , which we argue in Section 3.1 is a more suitable representation for molecular optimization because tokens have much more semantic meaning . See Appendix A for more details on how C5T5 relates to prior work . Transformers for Molecular Modeling Outside of molecular optimization , transformers have found a number of applications in molecular modeling tasks , including property prediction ( Wang et al. , 2019 ; Rong et al. , 2020 ) , chemical reaction prediction ( Schwaller et al. , 2019 ) , retrosynthesis ( Karpov et al. , 2019 ) and generating proteins ( Elnaggar et al. , 2020 ; Grechishnikova , 2021 ) . A few works have explored using transformers for generative modeling of organic molecules ( He et al. , 2021b ; Shin et al. , 2021 ; Dollar et al. , 2021 ) . Some works have also proposed using transformers for scaffold-conditioned generative modeling ( He et al. , 2021a ; Bagal et al. , 2021 ) . This work extends these efforts by proposing a simple yet effective training and zero-shot adaptation method , and by using IUPAC names instead of SMILES strings . IUPAC Names Although we are unaware of prior work using IUPAC names as a base representation for molecular modeling , several works have explored using machine learning to convert between IUPAC names and other molecular representations ( Rajan et al. , 2021 ; Handsel et al. , 2021 ; Krasnov et al. , 2021 ) . 3 METHOD . Molecular optimization is a difficult problem because it requires modifying a molecule that already satisfies a number of requirements . Modifications need to improve a particular aspect of the molecule without degrading its performance on other metrics , and without making it too difficult to synthesize . We argue that by using IUPAC names ( Section 3.1 ) and by allowing users to target particular parts of a molecule to modify ( Section 3.2 ) , C5T5 has the potential to support humanin-the-loop molecular editing that complements domain experts ’ intuitions about structure-activity relationships and synthetic accessibility . 3.1 IUPAC NAMING . The International Union of Pure and Applied Chemistry ( IUPAC ) publishes a set of rules that allow systematic conversion between a chemical structure and a human-readable name ( Favre & Powell , 2013 ) . For example , 2-chloropentane refers unambiguously to five carbons ( “ pent ” ) connected by single bonds ( “ ane ” ) with a chlorine atom ( “ chloro ” ) bonded to the second carbon from one end ( “ 2- ” ) . IUPAC names are used ubiquitously in scholarly articles , patents , and educational materials . In contrast to other linear molecular representations like SMILES and its derivatives , where single tokens mostly refer to individual atoms and bonds , tokens in IUPAC names generally have a rich semantic meaning . For example , the token “ ic acid ” denotes a carboxylic acid , which is a common functional group that has well-known physical and chemical properties ; there are many known chemical reactions that either start with or produce carboxylic acids . Other tokens denote additional functional groups ( e.g . “ imide , ” “ imine , ” “ al , ” “ one ” ) , locants ( e.g . “ 1 , ” “ 2 , ” “ N ” ) , which indicate connectivity , alkanes ( e.g . “ meth , ” “ eth , ” “ prop ” ) , which denote the lengths of carbon chains , polycyclic rings ( e.g . “ naphthalene , ” “ anthracene ” ) , stereochemistry markers ( “ R , ” “ S ” ) , and multipliers ( e.g . “ di , ” “ tri ” ) , which concisely represent duplicated and symmetric structures . Figure 2 shows the relationships between IUPAC names , graph representations , and SMILES . For molecular optimization , C5T5 supports qualitatively different molecular edits compared to graph- and SMILES-based methods by virtue of its use of IUPAC names : editing a locant token corresponds to moving a functional group along a carbon backbone or changing the connectivity of a fused ring system ; and editing a multiplier token corresponds to creating or eliminating duplicated and symmetric structures . For example , changing “ ethylbenzene “ to “ hexaethylbenzene ” replicates the ethyl structure around the entire benzene ring with a single token edit . These sorts of modifications require much more extensive editing for SMILES- and graph-based methods.1 We argue that IUPAC names are especially attractive for molecular optimization , since the process requires interaction between the algorithm and a domain expert , so interpretability is paramount . Compared to graph- or SMILES-based models , C5T5 makes predictions that can be traced back to moieties and functional groups that domain experts are more likely to understand , trust , and know how to synthesize than either arbitrary collections of atoms and bonds or motifs decided upon by machine learning practitioners . In addition to improved interpretability , we argue that using IUPAC names has advantages purely from the standpoint of modeling data , since moving from SMILES to IUPAC names is akin to moving from a character-based to a word-based sequence model . Modeling at this higher level of abstraction enables the network to direct more of its capacity to structure at the relevant semantic level , instead of relearning lower-level details like the specific atomic composition of functional groups . In this vein , we demonstrate the potential of IUPAC names by learning word2vec representations of IUPAC name tokens ( Mikolov et al. , 2013 ) , drawn from a list of over 100 million names in the PubChem repository ( Kim et al. , 2016 ) and tokenized using a list of tokens in OPSIN—an open-source IUPAC Name parser library ( MIT License ) ( Lowe et al. , 2011 ) . For example , as shown in Figure 2 , the chemical “ 2-acetyloxybenzoic acid ” gets tokenized to [ “ 2 ” , “ - ” , “ acet ” , “ yl ” , “ oxy ” , “ benzo ” , “ ic acid ” ] . As with natural language modeling , we find that the embedding space learned by word2vec encodes the semantic meaning of the tokens , as shown in Figure 3 . Different classes of tokens tend to be clustered together , and similar tokens within clusters are located nearby . For example , aromatic compounds with two rings are clearly separated from those with three , locants are ordered roughly correctly from 1 to 100 , and multiplier tokens are also roughly in order ( zoom not shown ) . Following Mikolov et al . ( 2013 ) , we also find that simple arithmetic operations in the embedding vector space correspond to semantic analogies between tokens . For example , the nearest neighbor of “ phosphonous acid ” - “ nitrous acid ” + “ nitroso ” is the embedding for “ phosphoroso. ” 2 The nearest neighbor of “ diphosphate ” - “ disulfate ” + “ sulfate ” is “ phosphate. ” Likewise for “ selenate ” - “ tellurate ” + “ tellurite ” being closest to “ selenite . ”
This paper proposes a method C5T5, a self-supervised pre-training method based on the T5 pre-trained model, which is able to make zero-shot select-and-replace edits to satisfy specific property values. The specific difference of this paper is the IUPAC names (a standardized molecular representation), and the method is totally self-supervised. The experiments are evaluated on octanol-water partition, distribution coefficients, polar surface area, and refractivity, above four properties. Experiments show that the designed methods are able to achieve the optimization objective.
SP:49192c4c658b9b74837f6fe36d67289ec82d3e6c
C5T5: Controllable Generation of Organic Molecules with Transformers
1 INTRODUCTION . Organic molecules are used in countless applications across human society : as medicines , industrial chemicals , fuels , pesticides , plastics , television screens , solar cells , and many others . Traditionally , new molecules are designed for particular tasks by hand , but the space of all possible molecules is so vast ( e.g . the total number of drug-like molecules may be as high as 1060 ) that most useful materials are probably still undiscovered ( Reymond et al. , 2012 ) . To automate materials discovery , domain experts have turned to high-throughput screening , in which a large library of potentially useful molecules is generated heuristically , and the most promising molecules are chosen for further study using computational models that estimate how effective each substance will be for the target application ( Hughes et al. , 2011 ) . Unfortunately , even high-throughput methods can still only screen a tiny fraction of all possible molecules . Generating molecules directly with machine learning addresses this limitation , but de novo generation can be of limited use in domains like drug discovery , where experts ’ intuitions about structureactivity relationships and external factors like patentability are important to consider in the design process . These constraints can often be expressed by providing known portions of the molecular structure ; for example a domain expert may be interested in a particular scaffold because it has favorable intellectual property attributes , or certain parts of a drug may be needed for the desired biological activity , while other parts can be modified to increase bioavailability . To address this real-world setting , we consider the problem of learning to make localized modifications to a molecule that change its physical properties in a desired way . We propose C5T5 : Controllable Characteristic-Conditioned Chemical Changer with T5 ( Raffel et al. , 2019 ) , a novel method for generative modeling of organic molecules that gives domain experts fine-grained control over the molecular optimization process while also providing more understandable predictions than prior methods ( Figure 1 ) . Our two key contributions are 1 ) recasting molecular modeling as language modeling on the semantically rich IUPAC name base representation , and 2 ) the development of a novel conditional language modeling strategy using transformers that supports targeted modifications to existing molecules . IUPAC Names . The IUPAC naming system is a systematic way of naming organic molecules based on functional groups and moieties , or commonly occurring clusters of connected atoms that have known chemical behaviors . Organic chemists have discovered countless chemical reactions that operate on functional groups , and they use these reactions to develop synthesis routes for novel molecules . Despite this , existing generative methods for organic molecules have ignored IUPAC names as a representation , instead opting for atom-based representations like SMILES ( Weininger , 1988 ) and molecular graphs ( Duvenaud et al. , 2015 ) . See Figure 2 for a comparison of these representations . We argue for several advantages of IUPAC names in Section 3.1 . To the best of our knowledge we are the first to use IUPAC names as a base representation for molecular modeling . Self-Supervised Objective for Zero-Shot Editing . To enable targeted modifications of molecules without predefined edit pairs , we train transformers with a conditional variant of a self-supervised infilling task , where the model must replace masked-out tokens in the IUPAC name . As described in Section 3.2 , we condition the model by prepending IUPAC names with discretized molecular property values ; the model then learns the conditional relationships between the property value and molecular structure . To the best of our knowledge , C5T5 is the first method to use conditional infilling for select-and-replace editing ; we anticipate this method could be broadly applied in other controlled generation contexts , such as modeling affect , politeness , or topic of natural language ( Ghosh et al. , 2017 ; Ficler & Goldberg , 2017 ; Niu & Bansal , 2018 ; Keskar et al. , 2019 ) . As we show in Section 4 , C5T5 is able to make interpretable targeted modifications to molecules that lead to desired changes across several physical properties important in drug design . 2 RELATED WORK . Modeling . A number of machine learning methods have been developed for the task of designing organic molecules , but most do not allow a user to make targeted modifications to a molecule . Some methods , like generative adversarial networks and unconditional sequence models , provide no control over a generated molecule ’ s structure ( Grisoni et al. , 2020 ; Guimaraes et al. , 2017 ; SanchezLengeling et al . ; De Cao & Kipf , 2018 ; Kajino , 2019 ) , and are therefore more useful for generating candidate libraries than optimizing a particular molecule . Other methods , like variational autoencoders or sequence models that are conditioned on a base molecule , allow specifying that generated molecules should be similar to a starting molecule in some learned space , but there is no way to specifically target a certain part of the molecule to modify ( He et al. , 2021b ; Jin et al. , 2019 ; Shin et al. , 2021 ; Yang et al. , 2020 ; Kotsias et al. , 2020 ; Gómez-Bombarelli et al. , 2018 ; Lim et al. , 2018 ; Dollar et al. , 2021 ; Liu et al. , 2018 ; Jin et al. , 2018 ; Maziarka et al. , 2020 ; Olivecrona et al. , 2017 ; Bagal et al. , 2021 ; You et al. , 2018 ; Shi * et al. , 2020 ) . Recognizing the importance of leveraging domain experts ’ intuition about structure-activity relationships , several methods , published mostly in chemistry venues , have explored constraining generated molecules to contain a scaffold , or a subgraph of the full molecular graph ( Li et al. , 2019 ; Lim et al. , 2020 ; Maziarz et al. , 2021 ) . However , these methods append to scaffolds arbitrarily instead of allowing domain experts to specify which part of the molecule they would like to modify or append to , limiting their utility for human-in-theloop molecular optimization . A few methods have explored allowing targeted modifications , where a domain expert can mask out a portion of a starting molecule and ask the model to replace the mask with a novel side chain ( Arús-Pous et al. , 2020 ; Langevin et al. , 2020 ; He et al. , 2021a ) . These methods are limited because they only support masking parts of the molecule that can be truncated by cutting a single bond , and because they require a dataset of paired molecules ( scaffolds & decorators ) that must be constructed using hand-crafted rules . In contrast , C5T5 learns in an entirely unsupervised fashion and therefore requires no paired data ; the only limit to what can be masked is what can be represented using IUPAC tokens . Representation . Existing methods all use SMILES ( or a derivative representation ) or graphs to represent molecules . There are a number of drawbacks to using the SMILES representation : a small change in a molecule can lead to a large change in the SMILES string ( Jin et al. , 2018 ) ; flattening the graph into a list of atoms artificially creates variable- and long-range dependencies between bonded atoms ; and it is difficult to reason about common substructures , because the same structure can be represented in many different ways depending on how the graph was flattened . And although graphs seem like a natural representation for molecules , graphs do a poor job encoding symmetry , longrange interactions between atoms that are many bonds apart but nearby in 3D space , and long-range interactions that arise from conjugated systems ( Duvenaud et al. , 2015 ) . C5T5 operates instead of IUPAC names , which we argue in Section 3.1 is a more suitable representation for molecular optimization because tokens have much more semantic meaning . See Appendix A for more details on how C5T5 relates to prior work . Transformers for Molecular Modeling Outside of molecular optimization , transformers have found a number of applications in molecular modeling tasks , including property prediction ( Wang et al. , 2019 ; Rong et al. , 2020 ) , chemical reaction prediction ( Schwaller et al. , 2019 ) , retrosynthesis ( Karpov et al. , 2019 ) and generating proteins ( Elnaggar et al. , 2020 ; Grechishnikova , 2021 ) . A few works have explored using transformers for generative modeling of organic molecules ( He et al. , 2021b ; Shin et al. , 2021 ; Dollar et al. , 2021 ) . Some works have also proposed using transformers for scaffold-conditioned generative modeling ( He et al. , 2021a ; Bagal et al. , 2021 ) . This work extends these efforts by proposing a simple yet effective training and zero-shot adaptation method , and by using IUPAC names instead of SMILES strings . IUPAC Names Although we are unaware of prior work using IUPAC names as a base representation for molecular modeling , several works have explored using machine learning to convert between IUPAC names and other molecular representations ( Rajan et al. , 2021 ; Handsel et al. , 2021 ; Krasnov et al. , 2021 ) . 3 METHOD . Molecular optimization is a difficult problem because it requires modifying a molecule that already satisfies a number of requirements . Modifications need to improve a particular aspect of the molecule without degrading its performance on other metrics , and without making it too difficult to synthesize . We argue that by using IUPAC names ( Section 3.1 ) and by allowing users to target particular parts of a molecule to modify ( Section 3.2 ) , C5T5 has the potential to support humanin-the-loop molecular editing that complements domain experts ’ intuitions about structure-activity relationships and synthetic accessibility . 3.1 IUPAC NAMING . The International Union of Pure and Applied Chemistry ( IUPAC ) publishes a set of rules that allow systematic conversion between a chemical structure and a human-readable name ( Favre & Powell , 2013 ) . For example , 2-chloropentane refers unambiguously to five carbons ( “ pent ” ) connected by single bonds ( “ ane ” ) with a chlorine atom ( “ chloro ” ) bonded to the second carbon from one end ( “ 2- ” ) . IUPAC names are used ubiquitously in scholarly articles , patents , and educational materials . In contrast to other linear molecular representations like SMILES and its derivatives , where single tokens mostly refer to individual atoms and bonds , tokens in IUPAC names generally have a rich semantic meaning . For example , the token “ ic acid ” denotes a carboxylic acid , which is a common functional group that has well-known physical and chemical properties ; there are many known chemical reactions that either start with or produce carboxylic acids . Other tokens denote additional functional groups ( e.g . “ imide , ” “ imine , ” “ al , ” “ one ” ) , locants ( e.g . “ 1 , ” “ 2 , ” “ N ” ) , which indicate connectivity , alkanes ( e.g . “ meth , ” “ eth , ” “ prop ” ) , which denote the lengths of carbon chains , polycyclic rings ( e.g . “ naphthalene , ” “ anthracene ” ) , stereochemistry markers ( “ R , ” “ S ” ) , and multipliers ( e.g . “ di , ” “ tri ” ) , which concisely represent duplicated and symmetric structures . Figure 2 shows the relationships between IUPAC names , graph representations , and SMILES . For molecular optimization , C5T5 supports qualitatively different molecular edits compared to graph- and SMILES-based methods by virtue of its use of IUPAC names : editing a locant token corresponds to moving a functional group along a carbon backbone or changing the connectivity of a fused ring system ; and editing a multiplier token corresponds to creating or eliminating duplicated and symmetric structures . For example , changing “ ethylbenzene “ to “ hexaethylbenzene ” replicates the ethyl structure around the entire benzene ring with a single token edit . These sorts of modifications require much more extensive editing for SMILES- and graph-based methods.1 We argue that IUPAC names are especially attractive for molecular optimization , since the process requires interaction between the algorithm and a domain expert , so interpretability is paramount . Compared to graph- or SMILES-based models , C5T5 makes predictions that can be traced back to moieties and functional groups that domain experts are more likely to understand , trust , and know how to synthesize than either arbitrary collections of atoms and bonds or motifs decided upon by machine learning practitioners . In addition to improved interpretability , we argue that using IUPAC names has advantages purely from the standpoint of modeling data , since moving from SMILES to IUPAC names is akin to moving from a character-based to a word-based sequence model . Modeling at this higher level of abstraction enables the network to direct more of its capacity to structure at the relevant semantic level , instead of relearning lower-level details like the specific atomic composition of functional groups . In this vein , we demonstrate the potential of IUPAC names by learning word2vec representations of IUPAC name tokens ( Mikolov et al. , 2013 ) , drawn from a list of over 100 million names in the PubChem repository ( Kim et al. , 2016 ) and tokenized using a list of tokens in OPSIN—an open-source IUPAC Name parser library ( MIT License ) ( Lowe et al. , 2011 ) . For example , as shown in Figure 2 , the chemical “ 2-acetyloxybenzoic acid ” gets tokenized to [ “ 2 ” , “ - ” , “ acet ” , “ yl ” , “ oxy ” , “ benzo ” , “ ic acid ” ] . As with natural language modeling , we find that the embedding space learned by word2vec encodes the semantic meaning of the tokens , as shown in Figure 3 . Different classes of tokens tend to be clustered together , and similar tokens within clusters are located nearby . For example , aromatic compounds with two rings are clearly separated from those with three , locants are ordered roughly correctly from 1 to 100 , and multiplier tokens are also roughly in order ( zoom not shown ) . Following Mikolov et al . ( 2013 ) , we also find that simple arithmetic operations in the embedding vector space correspond to semantic analogies between tokens . For example , the nearest neighbor of “ phosphonous acid ” - “ nitrous acid ” + “ nitroso ” is the embedding for “ phosphoroso. ” 2 The nearest neighbor of “ diphosphate ” - “ disulfate ” + “ sulfate ” is “ phosphate. ” Likewise for “ selenate ” - “ tellurate ” + “ tellurite ” being closest to “ selenite . ”
**Summary** This paper proposed a way to modify the molecule based on language pretraining techniques. The sequence representation of molecules is based on IUPAC names, which can be more semantically meaningful and much easier to model than the SMILES or graph based molecule representation. The pretraining is done via a conditional text generation model where the model predicts the fragment names based on the remainder of the molecule and corresponding property values. The application on downstream molecule property optimization tasks show that the proposed approach is effective at obtaining high quality molecules.
SP:49192c4c658b9b74837f6fe36d67289ec82d3e6c
Learning 3D Representations of Molecular Chirality with Invariance to Bond Rotations
1 INTRODUCTION . Advances in graph neural networks ( GNNs ) have revolutionized molecular representation learning for ( bio ) chemical applications such as high-fidelity property prediction ( Huang et al. , 2021 ; Chuang et al. , 2020 ) , accelerated conformer generation ( Ganea et al. , 2021 ; Mansimov et al. , 2019 ; Simm & Hernandez-Lobato , 2020 ; Xu et al. , 2021 ; Pattanaik et al. , 2020b ) , and molecular optimization ( Elton et al. , 2019 ; Brown et al. , 2019 ) . Fueling recent developments have been efforts to model shape-dependent physio-chemical properties by learning directly from molecular conformers ( snapshots of 3D molecular structures ) or from 4D conformer ensembles , which better capture molecular flexibility . For instance , recent state-of-the-art ( SOTA ) GNNs feature message updates informed by bond distances , bond angles , and torsion angles of the conformer ( Schütt et al. , 2017 ; Klicpera et al. , 2020b ; Liu et al. , 2021 ; Klicpera et al. , 2021 ) . However , few studies have considered the expressivity of GNNs when tasked with learning the nuanced effects of stereochemistry , which describes how the relative arrangement of atoms in space differ for molecules with equivalent graph connectivity . Tetrahedral ( point ) chirality is among the most prevalent types of stereochemistry , and describes the spatial arrangement of chemical substituents around the vertices of a tetrahedron centered on a chiral center , typically a carbon atom with four non-equivalent bonded neighbors . Two molecules which differ only in the relative atomic arrangements around their chiral centers are called stereoisomers , or enantiomers if they can be interconverted through reflection across a plane . Enantiomers are distinguished in chemical line drawings by a dashed or bold wedge indicating whether a bonded neighbor to a chiral center is directed into or out of the page ( Figure 1A ) . Although enantiomers share many chemical properties such as boiling/melting points , electronic energies ( e.g. , from QM9 ( Ramakrishnan et al. , 2014 ) ) , and solubility in most solvents , enantiomers can display strikingly different behavior when interacting with external chiral environments . For instance , chirality is critical for pharmaceutical drug design ( Nguyen et al. , 2006 ; Jamali et al. , 1989 ) , where protein-ligand interactions may be highly influenced by ligand chirality , as well for designing structure-directing agents for zeolite growth ( Luis & Beatriz , 2018 ) and for optimizing enantioselective catalysts ( Pfaltz & Drury , 2004 ; Liao et al. , 2018 ) . Chiral centers are inverted upon reflection through a mirror plane . Consequently , E ( 3 ) -invariant 3D GNNs that only consider pairwise atomic distances or bond angles in their message updates , such as SchNet ( Schütt et al. , 2017 ) and DimeNet/DimeNet++ ( Klicpera et al. , 2020a ; b ) , are inherently limited in their ability to distinguish enantiomers ( Figure 1B ) . Although SE ( 3 ) -invariant 3D GNNs , such as the recently proposed SphereNet ( Liu et al. , 2021 ) and GemNet ( Klicpera et al. , 2021 ) , can in theory learn chirality , their expressivity in this setting has not been explored . Alongside the development of 3D GNNs , which process individual 3D conformers , there have been efforts to better represent conformational flexibility by encoding multiple conformers in a 4D ( multi-instance ) ensemble for property prediction ( Zankov et al. , 2021 ; 2019 ; Axelrod & GomezBombarelli , 2021 ) , identifying important conformer poses ( Chuang & Keiser , 2020 ) , and predicting solvation energies ( Weinreich et al. , 2021 ) . Unless in the solid state , molecules are not rigid objects or static 2D graphs , but are flexible structures that continuously interconvert through rapid rotations of chemical bonds as well as through a number of smaller perturbations such as bond stretching , bending , and wagging . Explicitly modeling this probability distribution over accessible conformer space has the potential to drastically improve the modeling of protein-drug interactions , where the most relevant active pose of the ligand is not known a priori , as well as in the prediction of Boltzmann-averages , which depend on a distribution of conformers . One challenge with these methods is selecting which conformers to include in an ensemble : the space of accessible conformations combinatorially explodes with the number of rotatable bonds , and important poses are not known a priori . Modeling flexibility with multi-instance methods thus requires explicit conformer enumeration , increasing the cost of training/inference without guaranteeing performance gains . Apart from 2D methods , which ignore 3D information altogether , no studies have explicitly modeled conformational flexibility directly within a model architecture . To explicitly model tetrahedral chirality and conformational flexibility , we design a neural framework to augment 2D GNNs with processing of the SE ( 3 ) -invariant internal coordinates of a conformer , namely bond distances , bond angles , and torsion angles . Our specific contributions are : • We design a method for graph neural networks to learn the relative orientations of substituents around tetrahedral chiral centers directly from 3D torsion angles • We introduce a novel invariance to internal rotations of rotatable bonds directly into a model architecture , potentially mitigating the need for 4D ensemble methods or conformer-based data augmentation to treat conformational flexibility of molecules • We propose a contrastive learning framework to probe the ability of SE ( 3 ) -invariant 3D graph neural networks to differentiate stereoisomers in a learned latent space • Through our ablation study , we demonstrate that a global node aggregation scheme , adapted from Winter et al . ( 2021 ) , which exploits subgraphs based on internal coordinate connectivity can provide a simple way to improve GNNs for chiral property prediction We explore multiple tasks to benchmark the ability of our model to learn the effects of chirality . We do not consider common MoleculeNet ( Wu et al. , 2017 ) benchmarks , as our focus is on tasks where the effects of chirality are more distinguishable from experimental noise . Our self-supervised contrastive learning task is the first of its kind applied to clustering multiple 3D conformers of different stereoisomers in a latent space . Following Pattanaik et al . ( 2020a ) , we also employ a toy R/S labeling task as a necessary but not sufficient test of chiral recognition . For a harder classification task , we follow Mamede et al . ( 2021 ) in predicting how enantiomers experimentally rotate circularly polarized light . Lastly , we create a dataset of simulated docking scores to rank small enantiomeric ligands by their binding affinities in a chirality-sensitive protein pocket . We make our datasets for the contrastive learning , R/S classification , and docking tasks available to the public . Comparisons with 2D baselines and the SE ( 3 ) -invariant SphereNet demonstrate that our model , Chiral InterRotoInvariant Neural Network ( ChIRo ) , achieves SOTA in 3D chiral molecular representation learning . 2 RELATED WORK . Message passing neural networks . Gilmer et al . ( 2017 ) introduced a framework for using GNNs to embed molecules into a continuous latent space for property prediction . In the typical 2D message passing scheme , a molecule is modeled as a discrete 2D graph G with atoms as nodes and bonds as edges . Nodes and edges are initialized with features xi and eij to embed initial node states : h0i = U0 ( xi , { eij } j∈N ( i ) ) ( 1 ) where N ( i ) denotes the neighboring atoms of node i . In each layer t of message passing , node states are updated with aggregated messages from neighboring nodes . After T layers , graph feature vectors are constructed from some ( potentially learnable ) aggregation over the learned node states . A readout phase then uses this graph embedding for downstream property prediction : ht+1i = Ut ( h t i , m t+1 i ) , m t+1 i = ∑ j∈N ( i ) Mt ( h t i , h t j , eij ) ( 2 ) ŷ = Readout ( g ) , g = Agg ( { hTi |i ∈ G } ) ( 3 ) There exist many variations on this basic message passing framework ( Duvenaud et al. , 2015 ; Kearnes et al. , 2016 ) . In particular , Yang et al . ( 2019 ) ’ s directed message passing neural network ( DMPNN , or ChemProp ) based on Dai et al . ( 2016 ) learns edge-based messages mtij and updates edge embeddings htij rather than node embeddings . The Graph Attention Network ( Veličković et al. , 2018 ) constructs message updates mti using attention pooling over local node states . 3D Message Passing and Euclidean Invariances . 3D GNNs differ in their message passing schemes by using molecular internal coordinates ( distances , angles , torsions ) to pass geometryinformed messages between nodes . It is important to use 3D information that is at least SE ( 3 ) invariant , as molecular properties are invariant to global rotations or translations of the conformer . SchNet ( Schütt et al. , 2017 ) , a well-established network for learning quantum mechanical properties of 3D conformers , updates node states using messages informed by radial basis function expansions of interatomic distances between neighboring nodes . DimeNet ( Klicpera et al. , 2020b ) and its newer variant DimeNet++ ( Klicpera et al. , 2020a ) exploit additional molecular geometry by using spherical Bessel functions to embed angles ϕijk between the edges formed between nodes i and j and nodes j and k ̸= i in the directed message updates to node i. SchNet and DimeNet are E ( 3 ) -invariant , as pairwise distances and angles formed between two edges are unchanged upon global rotations , translations , and reflections . Since enantiomers are mirror images , SchNet and DimeNet are therefore invariant to this form of chirality . To be SE ( 3 ) -invariant , 3D GNNs must consider torsion angles , denoted ψixyj , between the planes defined by angles ϕixy and ϕxyj , where i , x , y , j are four sequential nodes along a simple path . Torsion angles are negated upon reflection , and thus models considering all torsion angles should be implicitly sensitive to chirality . Flam-Shepherd et al . ( 2020 ) , Liu et al . ( 2021 ) ( SphereNet ) , and Klicpera et al . ( 2021 ) ( GemNet ) introduce 3D GNNs that all embed torsions in their message updates . Using a complete set of torsion angles provides access to the full geometric information present in the conformer but does not guarantee expressivity when learning chiral-dependent functions . Torsions are negated upon reflection , but any given torsion can also be changed via simple rotations of a rotatable bond–which changes the conformation , but not the molecular identity ( i.e. , chirality does not change ) . Reflecting a non-chiral conformer will also negate its torsions , but the reflected conformer can be reverted to its original structure via rotations about internal bonds . To understand chirality , neural models must learn how coupled torsions , the set of torsions { ψixyj } ( i , j ) that share a bond between nodes x and y ( with x or y being chiral ) , collectively differ between enantiomers . E ( 3 ) - and SE ( 3 ) -Equivariant Neural Networks . Recent work has introduced equivariant layers into graph neural network architectures to explicitly model how global rotations , translations , and ( in some cases ) reflections of a 3D structure transform tensor properties , such as molecular dipoles or force vectors . SE ( 3 ) -equivariant models ( Fuchs et al. , 2020 ; Thomas et al. , 2018 ) should be sensitive to chirality , while E ( 3 ) -equivariant models ( Satorras et al. , 2021 ) will only be sensitive if the output layer is not E ( 3 ) -invariant . Since we use SE ( 3 ) -invariant internal coordinates as our 3D representation , we only compare our model to other SE ( 3 ) - or E ( 3 ) -invariant 3D GNNs . Explicit representations of chirality in machine learning models . A number of machine learning studies account for chirality through hand-crafted molecular descriptors ( Schneider et al. , 2018 ; Golbraikh et al. , 2001 ; Kovatcheva et al. , 2007 ; Valdés-Martinı́ et al. , 2017 ; Mamede et al. , 2021 ) . A naı̈ve but common method for making 2D GNNs sensitive to chirality is through the inclusion of chiral tags as node features . Local chiral tags describe the orientation of substituents around chiral centers ( CW or CCW ) given an ordered list of neighbors . Global chiral tags use the Cahn-IngoldPrelog ( CIP ) rules for labeling the handedness of chiral centers as R ( “ rectus ” ) or S ( “ sinister ” ) . It is unclear whether ( and how ) models can suitably learn chiral-dependent functions when exposed to these tags as the only indication of chirality . Pattanaik et al . ( 2020a ) propose changing the symmetric message aggregation function in 2D GNNs ( sum/max/mean ) to an asymmetric function tailored to tetrahedral chiral centers , but this method does not learn chirality from 3D molecular geometries . Chirality in 2D Vision and 3D Pose Estimation . Outside of molecular chirality , there has been work in the deep learning community to develop neural methods that learn chiral representations for 2D image recognition ( Lin et al. , 2020 ) and 3D human pose estimation ( Yeh et al. , 2019 ) . In particular , Yeh et al . ( 2019 ) consider integrating equivariance to chiral transforms directly into neural architectures including feed forward layers , LSTMs/GRUs , and convolutional layers .
The paper focuses on improving the capacity of GNN models, using chirality identification as the case study. As an important character to represent the geometry in molecules, chirality has a fundamental impact on the molecule properties and downstream applications. It is a major extension of [1]. The distinguishing features are mainly based on the sinusoid transformations of torsion angles, which are invariant to the bond rotations.
SP:a4a47d63cd3c5c0b5c4f7e735f3a4f84528f5d5d
Learning 3D Representations of Molecular Chirality with Invariance to Bond Rotations
1 INTRODUCTION . Advances in graph neural networks ( GNNs ) have revolutionized molecular representation learning for ( bio ) chemical applications such as high-fidelity property prediction ( Huang et al. , 2021 ; Chuang et al. , 2020 ) , accelerated conformer generation ( Ganea et al. , 2021 ; Mansimov et al. , 2019 ; Simm & Hernandez-Lobato , 2020 ; Xu et al. , 2021 ; Pattanaik et al. , 2020b ) , and molecular optimization ( Elton et al. , 2019 ; Brown et al. , 2019 ) . Fueling recent developments have been efforts to model shape-dependent physio-chemical properties by learning directly from molecular conformers ( snapshots of 3D molecular structures ) or from 4D conformer ensembles , which better capture molecular flexibility . For instance , recent state-of-the-art ( SOTA ) GNNs feature message updates informed by bond distances , bond angles , and torsion angles of the conformer ( Schütt et al. , 2017 ; Klicpera et al. , 2020b ; Liu et al. , 2021 ; Klicpera et al. , 2021 ) . However , few studies have considered the expressivity of GNNs when tasked with learning the nuanced effects of stereochemistry , which describes how the relative arrangement of atoms in space differ for molecules with equivalent graph connectivity . Tetrahedral ( point ) chirality is among the most prevalent types of stereochemistry , and describes the spatial arrangement of chemical substituents around the vertices of a tetrahedron centered on a chiral center , typically a carbon atom with four non-equivalent bonded neighbors . Two molecules which differ only in the relative atomic arrangements around their chiral centers are called stereoisomers , or enantiomers if they can be interconverted through reflection across a plane . Enantiomers are distinguished in chemical line drawings by a dashed or bold wedge indicating whether a bonded neighbor to a chiral center is directed into or out of the page ( Figure 1A ) . Although enantiomers share many chemical properties such as boiling/melting points , electronic energies ( e.g. , from QM9 ( Ramakrishnan et al. , 2014 ) ) , and solubility in most solvents , enantiomers can display strikingly different behavior when interacting with external chiral environments . For instance , chirality is critical for pharmaceutical drug design ( Nguyen et al. , 2006 ; Jamali et al. , 1989 ) , where protein-ligand interactions may be highly influenced by ligand chirality , as well for designing structure-directing agents for zeolite growth ( Luis & Beatriz , 2018 ) and for optimizing enantioselective catalysts ( Pfaltz & Drury , 2004 ; Liao et al. , 2018 ) . Chiral centers are inverted upon reflection through a mirror plane . Consequently , E ( 3 ) -invariant 3D GNNs that only consider pairwise atomic distances or bond angles in their message updates , such as SchNet ( Schütt et al. , 2017 ) and DimeNet/DimeNet++ ( Klicpera et al. , 2020a ; b ) , are inherently limited in their ability to distinguish enantiomers ( Figure 1B ) . Although SE ( 3 ) -invariant 3D GNNs , such as the recently proposed SphereNet ( Liu et al. , 2021 ) and GemNet ( Klicpera et al. , 2021 ) , can in theory learn chirality , their expressivity in this setting has not been explored . Alongside the development of 3D GNNs , which process individual 3D conformers , there have been efforts to better represent conformational flexibility by encoding multiple conformers in a 4D ( multi-instance ) ensemble for property prediction ( Zankov et al. , 2021 ; 2019 ; Axelrod & GomezBombarelli , 2021 ) , identifying important conformer poses ( Chuang & Keiser , 2020 ) , and predicting solvation energies ( Weinreich et al. , 2021 ) . Unless in the solid state , molecules are not rigid objects or static 2D graphs , but are flexible structures that continuously interconvert through rapid rotations of chemical bonds as well as through a number of smaller perturbations such as bond stretching , bending , and wagging . Explicitly modeling this probability distribution over accessible conformer space has the potential to drastically improve the modeling of protein-drug interactions , where the most relevant active pose of the ligand is not known a priori , as well as in the prediction of Boltzmann-averages , which depend on a distribution of conformers . One challenge with these methods is selecting which conformers to include in an ensemble : the space of accessible conformations combinatorially explodes with the number of rotatable bonds , and important poses are not known a priori . Modeling flexibility with multi-instance methods thus requires explicit conformer enumeration , increasing the cost of training/inference without guaranteeing performance gains . Apart from 2D methods , which ignore 3D information altogether , no studies have explicitly modeled conformational flexibility directly within a model architecture . To explicitly model tetrahedral chirality and conformational flexibility , we design a neural framework to augment 2D GNNs with processing of the SE ( 3 ) -invariant internal coordinates of a conformer , namely bond distances , bond angles , and torsion angles . Our specific contributions are : • We design a method for graph neural networks to learn the relative orientations of substituents around tetrahedral chiral centers directly from 3D torsion angles • We introduce a novel invariance to internal rotations of rotatable bonds directly into a model architecture , potentially mitigating the need for 4D ensemble methods or conformer-based data augmentation to treat conformational flexibility of molecules • We propose a contrastive learning framework to probe the ability of SE ( 3 ) -invariant 3D graph neural networks to differentiate stereoisomers in a learned latent space • Through our ablation study , we demonstrate that a global node aggregation scheme , adapted from Winter et al . ( 2021 ) , which exploits subgraphs based on internal coordinate connectivity can provide a simple way to improve GNNs for chiral property prediction We explore multiple tasks to benchmark the ability of our model to learn the effects of chirality . We do not consider common MoleculeNet ( Wu et al. , 2017 ) benchmarks , as our focus is on tasks where the effects of chirality are more distinguishable from experimental noise . Our self-supervised contrastive learning task is the first of its kind applied to clustering multiple 3D conformers of different stereoisomers in a latent space . Following Pattanaik et al . ( 2020a ) , we also employ a toy R/S labeling task as a necessary but not sufficient test of chiral recognition . For a harder classification task , we follow Mamede et al . ( 2021 ) in predicting how enantiomers experimentally rotate circularly polarized light . Lastly , we create a dataset of simulated docking scores to rank small enantiomeric ligands by their binding affinities in a chirality-sensitive protein pocket . We make our datasets for the contrastive learning , R/S classification , and docking tasks available to the public . Comparisons with 2D baselines and the SE ( 3 ) -invariant SphereNet demonstrate that our model , Chiral InterRotoInvariant Neural Network ( ChIRo ) , achieves SOTA in 3D chiral molecular representation learning . 2 RELATED WORK . Message passing neural networks . Gilmer et al . ( 2017 ) introduced a framework for using GNNs to embed molecules into a continuous latent space for property prediction . In the typical 2D message passing scheme , a molecule is modeled as a discrete 2D graph G with atoms as nodes and bonds as edges . Nodes and edges are initialized with features xi and eij to embed initial node states : h0i = U0 ( xi , { eij } j∈N ( i ) ) ( 1 ) where N ( i ) denotes the neighboring atoms of node i . In each layer t of message passing , node states are updated with aggregated messages from neighboring nodes . After T layers , graph feature vectors are constructed from some ( potentially learnable ) aggregation over the learned node states . A readout phase then uses this graph embedding for downstream property prediction : ht+1i = Ut ( h t i , m t+1 i ) , m t+1 i = ∑ j∈N ( i ) Mt ( h t i , h t j , eij ) ( 2 ) ŷ = Readout ( g ) , g = Agg ( { hTi |i ∈ G } ) ( 3 ) There exist many variations on this basic message passing framework ( Duvenaud et al. , 2015 ; Kearnes et al. , 2016 ) . In particular , Yang et al . ( 2019 ) ’ s directed message passing neural network ( DMPNN , or ChemProp ) based on Dai et al . ( 2016 ) learns edge-based messages mtij and updates edge embeddings htij rather than node embeddings . The Graph Attention Network ( Veličković et al. , 2018 ) constructs message updates mti using attention pooling over local node states . 3D Message Passing and Euclidean Invariances . 3D GNNs differ in their message passing schemes by using molecular internal coordinates ( distances , angles , torsions ) to pass geometryinformed messages between nodes . It is important to use 3D information that is at least SE ( 3 ) invariant , as molecular properties are invariant to global rotations or translations of the conformer . SchNet ( Schütt et al. , 2017 ) , a well-established network for learning quantum mechanical properties of 3D conformers , updates node states using messages informed by radial basis function expansions of interatomic distances between neighboring nodes . DimeNet ( Klicpera et al. , 2020b ) and its newer variant DimeNet++ ( Klicpera et al. , 2020a ) exploit additional molecular geometry by using spherical Bessel functions to embed angles ϕijk between the edges formed between nodes i and j and nodes j and k ̸= i in the directed message updates to node i. SchNet and DimeNet are E ( 3 ) -invariant , as pairwise distances and angles formed between two edges are unchanged upon global rotations , translations , and reflections . Since enantiomers are mirror images , SchNet and DimeNet are therefore invariant to this form of chirality . To be SE ( 3 ) -invariant , 3D GNNs must consider torsion angles , denoted ψixyj , between the planes defined by angles ϕixy and ϕxyj , where i , x , y , j are four sequential nodes along a simple path . Torsion angles are negated upon reflection , and thus models considering all torsion angles should be implicitly sensitive to chirality . Flam-Shepherd et al . ( 2020 ) , Liu et al . ( 2021 ) ( SphereNet ) , and Klicpera et al . ( 2021 ) ( GemNet ) introduce 3D GNNs that all embed torsions in their message updates . Using a complete set of torsion angles provides access to the full geometric information present in the conformer but does not guarantee expressivity when learning chiral-dependent functions . Torsions are negated upon reflection , but any given torsion can also be changed via simple rotations of a rotatable bond–which changes the conformation , but not the molecular identity ( i.e. , chirality does not change ) . Reflecting a non-chiral conformer will also negate its torsions , but the reflected conformer can be reverted to its original structure via rotations about internal bonds . To understand chirality , neural models must learn how coupled torsions , the set of torsions { ψixyj } ( i , j ) that share a bond between nodes x and y ( with x or y being chiral ) , collectively differ between enantiomers . E ( 3 ) - and SE ( 3 ) -Equivariant Neural Networks . Recent work has introduced equivariant layers into graph neural network architectures to explicitly model how global rotations , translations , and ( in some cases ) reflections of a 3D structure transform tensor properties , such as molecular dipoles or force vectors . SE ( 3 ) -equivariant models ( Fuchs et al. , 2020 ; Thomas et al. , 2018 ) should be sensitive to chirality , while E ( 3 ) -equivariant models ( Satorras et al. , 2021 ) will only be sensitive if the output layer is not E ( 3 ) -invariant . Since we use SE ( 3 ) -invariant internal coordinates as our 3D representation , we only compare our model to other SE ( 3 ) - or E ( 3 ) -invariant 3D GNNs . Explicit representations of chirality in machine learning models . A number of machine learning studies account for chirality through hand-crafted molecular descriptors ( Schneider et al. , 2018 ; Golbraikh et al. , 2001 ; Kovatcheva et al. , 2007 ; Valdés-Martinı́ et al. , 2017 ; Mamede et al. , 2021 ) . A naı̈ve but common method for making 2D GNNs sensitive to chirality is through the inclusion of chiral tags as node features . Local chiral tags describe the orientation of substituents around chiral centers ( CW or CCW ) given an ordered list of neighbors . Global chiral tags use the Cahn-IngoldPrelog ( CIP ) rules for labeling the handedness of chiral centers as R ( “ rectus ” ) or S ( “ sinister ” ) . It is unclear whether ( and how ) models can suitably learn chiral-dependent functions when exposed to these tags as the only indication of chirality . Pattanaik et al . ( 2020a ) propose changing the symmetric message aggregation function in 2D GNNs ( sum/max/mean ) to an asymmetric function tailored to tetrahedral chiral centers , but this method does not learn chirality from 3D molecular geometries . Chirality in 2D Vision and 3D Pose Estimation . Outside of molecular chirality , there has been work in the deep learning community to develop neural methods that learn chiral representations for 2D image recognition ( Lin et al. , 2020 ) and 3D human pose estimation ( Yeh et al. , 2019 ) . In particular , Yeh et al . ( 2019 ) consider integrating equivariance to chiral transforms directly into neural architectures including feed forward layers , LSTMs/GRUs , and convolutional layers .
This paper presents a novel SE(3)-invariant GNN model for predicting 3D geometry-dependent physicochemical properties of molecules. In particular, this method focuses on an important issue of how to handle the chirality of molecules in molecular GNNs. When a molecule takes a 3D shape, we have a degree of freedom to rotate every C-C single bond. To distinguish enantiomers (mirror-image molecule pairs), we also need to see whether two molecule pairs are superposable by these single-bond rotation operations. The developed method proposed a torsion-angle encoder having 1) an invariance to rotations about internal molecular bonds and 2) the ability to learn molecular chirality. Several empirical results are also reported.
SP:a4a47d63cd3c5c0b5c4f7e735f3a4f84528f5d5d
ToM2C: Target-oriented Multi-agent Communication and Cooperation with Theory of Mind
1 INTRODUCTION . Cooperation is a key component of human society , which enables people to divide labor and achieve common goals that could not be accomplished independently . In particular , humans are able to form an ad-hoc team with partners and communicate cooperatively with one another ( Tomasello , 2014 ) . Cognitive studies ( Sher et al. , 2014 ; Sanfey et al. , 2015 ; Etel & Slaughter , 2019 ) show that the ability to model others ’ mental states ( intentions , beliefs , and desires ) , called Theory of Mind ( ToM ) ( Premack & Woodruff , 1978 ) , is important for such social interaction . Consider a simple real-world scenario ( Fig . 1 ) , where three people ( Alice , Bob and Carol ) are required to take the fruits ( apple , orange and pear ) following the shortest path . To achieve it , the individual should take four steps sequentially : 1 ) observe their surrounding ; 2 ) infer the observation and intention of others ; 3 ) communicate with others to share the local observation or intention if necessary ; 4 ) make a decision and take action to get the chosen fruits without conflict . In this process , the ToM is naturally adopted in inferring others ( Step 2 ) and also guides the communication ( Step 3 ) . In this paper , we focus on the Target-oriented Multi-Agent Cooperation ( ToMAC ) problem , where agents need to cooperatively adjust the relations among the agents and targets to reach the expectation , e.g. , covering all the targets . Such problem setting widely exists in real-world applications , e.g. , collecting multiple objects ( Fig . 1 ) , navigating to multiple landmarks ( Lowe et al. , 2017 ) , transporting objects ( Tuci et al. , 2018 ) , and monitoring a group of pedestrians ( Xu et al. , 2020 ) . While running , the distributed agents are required to concurrently choose a subset of interesting targets and optimize the relation to them to contribute to the team goal . In this case , the key to realizing high-quality cooperation is to reach a consensus among agents to avoid the inner conflict in the team . However , the existing multi-agent reinforcement learning methods still do not handle it well , as they only implicitly model others in the state representation and are inefficient in communication . Here we propose a Target-oriented Multi-agent Communication and Cooperation mechanism ( ToM2C ) using Theory of Mind . Shown as Fig . 2 , each agent is of a two-level hierarchy . The high-level policy ( planner ) needs to cooperatively choose certain interesting targets as a sub-goal to deal with , such as tracking certain moving objects or navigating to a specific landmark . Then low-level policy ( executor ) takes primitive actions to reach the selected goals for k steps . To be more specific , each agent receives local observation of targets , and estimates the local observation of others in the ToM Net . Combining the observed and inferred states , the ToM net will predict/infer the target choices ( intentions ) of other agents . After that , each agent decides ‘ whom ’ to communicate with according to local observation filtered by the inferred goals of others . The message is the predicted goals of the message receiver , inferred by the sender . In the end , all the agents decide their own goals by leveraging the observed , inferred , and received information . With the inferring and sharing of intentions , the agents can easily reach a consensus to cooperatively adjust the target-agent relations . Furthermore , we also introduce a communication reduction method to remove the redundant message passing among agents . Thanks to the Centralized Training and Decentralized Execution ( CTDE ) paradigm , we measure the effect of the received messages on each agent , by comparing the output of the planner with and without messages . Hence , we can figure out the unnecessary connection among agents . Then we train the connection choice network to cut these dispensable channels in a supervised manner . Eventually , we argue that ToM2C systemically solves the problem of ‘ when ’ , ‘ who ’ and ‘ what ’ in multi-agent communication , providing an efficient and interpretable communication protocol for multi-agent cooperation . The experiments are conducted in two environments . First in the cooperative navigation scenario ( Lowe et al. , 2017 ) , the team goal is to occupy landmarks ( static targets ) and avoid collision . Then we evaluate our method in a more complex scenario , multi-sensor multi-target covering scenario ( Xu et al. , 2020 ) . The team goal of the sensors is to adjust their orientation to cover as many moving targets as possible . The results show that our method achieves the best performance ( the highest reward and the lowest communication cost ) among the state-of-the-art MARL methods , e.g. , HiT-MAC ( Xu et al. , 2020 ) , I2C ( Ding et al. , 2020 ) , MAPPO ( Yu et al. , 2021 ) and TarMAC ( Das et al. , 2019 ) . Moreover , we further show the good scalability of ToM2C and conduct an ablation study to evaluate the contribution of each key component of our model . Our contributions can be summarized in three-folds : 1 ) We introduce a cognition-inspired social agent with the ability to infer the mental states of others . Such ability enhances multi-agent cooperation in target-oriented tasks . 2 ) We provide a ToM-based communication mechanism , which is fully decentralized in execution . We also propose a communication reduction method to remove redundant connections among agents . 3 ) We conduct experiments in two representative target-oriented tasks : the cooperative navigation and multi-sensor multi-target coverage problem . The results show that ToM2C not only outperforms the state-of-the-art MARL methods on reward and communication efficiency but also is of good scalability across scenes of different populations . 2 RELATED WORK . Multi-agent Cooperation and Communication . The cooperation of multiple agents is crucial yet challenging in distributed systems . Agents ’ policies continue to shift during training , leading to a non-stationary environment and difficulty in model convergence . To mitigate the non-stationarity , the centralized training decentralized execution ( CTDE ) paradigm are widely employed in the recent multi-agent learning works ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Iqbal & Sha , 2019 ) . However , these methods only implicitly guide agents to overfit to certain policy patterns of others . Without communication mechanism , agents lack the ability to negotiate with each other and avoid conflicts . As a result , it is hard for the individual agent to quickly adapt to unseen cooperators/environments . Learning to communicate ( Sukhbaatar et al. , 2016 ) is a feasible way to promote efficient multi-agent cooperation . Unfortunately , most of previous works ( Sukhbaatar et al. , 2016 ; Das et al. , 2019 ; Singh et al. , 2019 ) require a broadcast communication channel , leading to huge pressure on bandwidth . Besides , even though I2C ( Ding et al. , 2020 ) proposes an individual communication method , the message is just the encoding of observation , which is not only costly but also uninterpretable . In this paper , we will investigate a more efficient peer-to-peer communication , based on theory-of-mind . Hierarchical frameworks Yang et al . ( 2019 ) ; Kim et al . ( 2020 ) ; Xu et al . ( 2020 ) are also investigated to promote multi-agent cooperation/coordination . HiT-MAC ( Xu et al. , 2020 ) is the closest work to ours . It proposes a hierarchical multi-agent coordination framework to decompose the target coverage problem into two-level tasks : assigning targets by the centralized coordinator and tracking assigned targets by decentralized executors . The agents in ToM2C are also of a two-level hierarchy . Considering the natural structure of ToMAC , we also decompose the cooperation tasks in this way , rather than learning skills in an unsupervised manner ( Yang et al. , 2019 ) . Differently , both levels in ToM2C are enabled to perform distributively , thanks to the use of ToM and communication mechanism . Theory of Mind . Theory of Mind is a long-studied concept in cognitive science ( Sher et al. , 2014 ; Sanfey et al. , 2015 ; Etel & Slaughter , 2019 ) . However , how to apply the discovery in cognitive science to build cooperative multi-agent systems still remains a challenge . Most previous works make use of Theory of Mind to interpret agent behaviors , but fail to take a step forward to enhance cooperation . For example , Machine Theory of Mind ( Rabinowitz et al. , 2018 ) proposes a meta-learning method to learn a ToMnet that predicts the behaviors or characteristics of a single agent . Besides , Shum et al . ( 2019 ) studies how to apply Bayesian inference to understand the behaviors of a group and predict the group structure . Track et al . ( 2018 ) introduces the concept of Satisficing Theory of Mind , which refers to the sufficing and satisfying model of others . Shu et al . ( 2021 ) and Gandhi et al . ( 2021 ) introduce benchmarks for evaluating machine mental reasoning . These works mainly focus on how to accurately infer the mental state of others , rather than interactive cooperation . Puig et al . ( 2021 ) ; Carroll et al . ( 2019 ) ; Netanyahu et al . ( 2021 ) studies the human-AI cooperation with mental inference . Lim et al . ( 2020 ) considers a 2-player scenario and employs Bayesian Theory of Mind to promote collaboration . Nevertheless , the task is relative simple and it requires the model of other agents to do the inference . M3RL ( Shu & Tian , 2019 ) proposes to train a manager that infers the minds of agents and assigns sub-tasks to them , which benefits from the centralized mechanism and is not comparable with decentralized methods . Wu et al . ( 2021 ) introduce Bayesian approach for ToM-based cooperation , yet assuming that the environment has a partially ordered set of sub-tasks . Differently , we study how to leverage ToM to guide efficient decentralized communication to further enhance the multi-agent cooperation . Opponent Modeling . Opponent modeling ( He et al. , 2016 ; Raileanu et al. , 2018 ; Grover et al. , 2018 ) is another kind of method comparable with Theory of Mind . Agents endowed with opponent modeling can explicitly represent the model of others , and therefore plan with awareness of the current status of others . Nevertheless , these methods rely on the access to the observation of others , which means they are not truly decentralized paradigms . Compared with existing methods , ToM2C applies ToM not only to explicitly model intentions and mental states but also to improve the efficiency of communication to further promote cooperation . 3 METHODS . In this section , we will explain how to build a target-oriented social agent to achieve efficient multi-agent communication and cooperation . We formulate the target-oriented cooperative task as a Dec-POMDP ( Bernstein et al. , 2002 ) . The aim of all agents is to maximize the team reward . The overall network architecture is shown in Fig . 2 , from the perspective of agent i . The model is mainly composed of four functional networks : observation encoder , Theory of Mind network ( ToM Net ) , message sender , and decision maker . First , the raw observation oi , indicating the states of observed targets , will be encoded into Ei by an attention-based encoder . After that , the ToM Net takes Theory of Mind inference ToMi ( G∗i |Ei , Φ ) to estimate the joint intention ( sub-goals ) of others G∗i , according to the encoded observation Ei and the poses of agents Φ = ( φ1 , ... , φn ) . In details , taking ToMi , j as an example , it uses the estimated observation i , j infers the probability of agent j choosing these targets as its goals , denoted as g∗i , j . The estimation of i , j is based on the pose φj . In general , pose φj indicates the location and rotation of the agent j . Specifically , it can be represented as a 6D vector ( x , y , z , roll , yaw , pitch ) in 3D space and a 3D vector ( x , y , yaw ) in 2D plane . After the ToM inference , the message sender decides whom to communicate with . Here we employ a graph neural network to model the connection among agents . The node feature of agent j is the concatenation of i , j and Ei filtered by g∗i , j . The final communication connection is sampled according to the computed graph edge features . Agent i will send g∗i , j to agent j if there exists a communication edge from i to j . At the end , we aggregate G∗i , Ei and received messages ∑ g∗ ? , j as ηi for the decision making . The planner πHi ( gi|ηi ) , guided by the team reward , chooses the sub-goal gi to the low-level executor πLi ( ai|oi , gi ) , which takes K steps primitive actions to reach the sub-goal . In the following sections , we will illustrate the key components of ToM2C in detail .
The paper presents a new method for communication and cooperation in multi-agent settings. The method relies on modelling other agents' intentions and internal states using Theory of Mind based neural nets. The predictions from the ToM model are used to decide how to communicate and coordinate with other agents. The authors test the method on two common multi-agent cooperation tasks to achieve SOTA communication efficiency and reward performance. The authors also show the utility of modelling mental states and using communication through ablation studies. Finally, the model shows flexibility in generalization, with consistent performance across different settings.
SP:c1bfd8893b1f9e54afbe95410eae68f08eed1f9d
ToM2C: Target-oriented Multi-agent Communication and Cooperation with Theory of Mind
1 INTRODUCTION . Cooperation is a key component of human society , which enables people to divide labor and achieve common goals that could not be accomplished independently . In particular , humans are able to form an ad-hoc team with partners and communicate cooperatively with one another ( Tomasello , 2014 ) . Cognitive studies ( Sher et al. , 2014 ; Sanfey et al. , 2015 ; Etel & Slaughter , 2019 ) show that the ability to model others ’ mental states ( intentions , beliefs , and desires ) , called Theory of Mind ( ToM ) ( Premack & Woodruff , 1978 ) , is important for such social interaction . Consider a simple real-world scenario ( Fig . 1 ) , where three people ( Alice , Bob and Carol ) are required to take the fruits ( apple , orange and pear ) following the shortest path . To achieve it , the individual should take four steps sequentially : 1 ) observe their surrounding ; 2 ) infer the observation and intention of others ; 3 ) communicate with others to share the local observation or intention if necessary ; 4 ) make a decision and take action to get the chosen fruits without conflict . In this process , the ToM is naturally adopted in inferring others ( Step 2 ) and also guides the communication ( Step 3 ) . In this paper , we focus on the Target-oriented Multi-Agent Cooperation ( ToMAC ) problem , where agents need to cooperatively adjust the relations among the agents and targets to reach the expectation , e.g. , covering all the targets . Such problem setting widely exists in real-world applications , e.g. , collecting multiple objects ( Fig . 1 ) , navigating to multiple landmarks ( Lowe et al. , 2017 ) , transporting objects ( Tuci et al. , 2018 ) , and monitoring a group of pedestrians ( Xu et al. , 2020 ) . While running , the distributed agents are required to concurrently choose a subset of interesting targets and optimize the relation to them to contribute to the team goal . In this case , the key to realizing high-quality cooperation is to reach a consensus among agents to avoid the inner conflict in the team . However , the existing multi-agent reinforcement learning methods still do not handle it well , as they only implicitly model others in the state representation and are inefficient in communication . Here we propose a Target-oriented Multi-agent Communication and Cooperation mechanism ( ToM2C ) using Theory of Mind . Shown as Fig . 2 , each agent is of a two-level hierarchy . The high-level policy ( planner ) needs to cooperatively choose certain interesting targets as a sub-goal to deal with , such as tracking certain moving objects or navigating to a specific landmark . Then low-level policy ( executor ) takes primitive actions to reach the selected goals for k steps . To be more specific , each agent receives local observation of targets , and estimates the local observation of others in the ToM Net . Combining the observed and inferred states , the ToM net will predict/infer the target choices ( intentions ) of other agents . After that , each agent decides ‘ whom ’ to communicate with according to local observation filtered by the inferred goals of others . The message is the predicted goals of the message receiver , inferred by the sender . In the end , all the agents decide their own goals by leveraging the observed , inferred , and received information . With the inferring and sharing of intentions , the agents can easily reach a consensus to cooperatively adjust the target-agent relations . Furthermore , we also introduce a communication reduction method to remove the redundant message passing among agents . Thanks to the Centralized Training and Decentralized Execution ( CTDE ) paradigm , we measure the effect of the received messages on each agent , by comparing the output of the planner with and without messages . Hence , we can figure out the unnecessary connection among agents . Then we train the connection choice network to cut these dispensable channels in a supervised manner . Eventually , we argue that ToM2C systemically solves the problem of ‘ when ’ , ‘ who ’ and ‘ what ’ in multi-agent communication , providing an efficient and interpretable communication protocol for multi-agent cooperation . The experiments are conducted in two environments . First in the cooperative navigation scenario ( Lowe et al. , 2017 ) , the team goal is to occupy landmarks ( static targets ) and avoid collision . Then we evaluate our method in a more complex scenario , multi-sensor multi-target covering scenario ( Xu et al. , 2020 ) . The team goal of the sensors is to adjust their orientation to cover as many moving targets as possible . The results show that our method achieves the best performance ( the highest reward and the lowest communication cost ) among the state-of-the-art MARL methods , e.g. , HiT-MAC ( Xu et al. , 2020 ) , I2C ( Ding et al. , 2020 ) , MAPPO ( Yu et al. , 2021 ) and TarMAC ( Das et al. , 2019 ) . Moreover , we further show the good scalability of ToM2C and conduct an ablation study to evaluate the contribution of each key component of our model . Our contributions can be summarized in three-folds : 1 ) We introduce a cognition-inspired social agent with the ability to infer the mental states of others . Such ability enhances multi-agent cooperation in target-oriented tasks . 2 ) We provide a ToM-based communication mechanism , which is fully decentralized in execution . We also propose a communication reduction method to remove redundant connections among agents . 3 ) We conduct experiments in two representative target-oriented tasks : the cooperative navigation and multi-sensor multi-target coverage problem . The results show that ToM2C not only outperforms the state-of-the-art MARL methods on reward and communication efficiency but also is of good scalability across scenes of different populations . 2 RELATED WORK . Multi-agent Cooperation and Communication . The cooperation of multiple agents is crucial yet challenging in distributed systems . Agents ’ policies continue to shift during training , leading to a non-stationary environment and difficulty in model convergence . To mitigate the non-stationarity , the centralized training decentralized execution ( CTDE ) paradigm are widely employed in the recent multi-agent learning works ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Iqbal & Sha , 2019 ) . However , these methods only implicitly guide agents to overfit to certain policy patterns of others . Without communication mechanism , agents lack the ability to negotiate with each other and avoid conflicts . As a result , it is hard for the individual agent to quickly adapt to unseen cooperators/environments . Learning to communicate ( Sukhbaatar et al. , 2016 ) is a feasible way to promote efficient multi-agent cooperation . Unfortunately , most of previous works ( Sukhbaatar et al. , 2016 ; Das et al. , 2019 ; Singh et al. , 2019 ) require a broadcast communication channel , leading to huge pressure on bandwidth . Besides , even though I2C ( Ding et al. , 2020 ) proposes an individual communication method , the message is just the encoding of observation , which is not only costly but also uninterpretable . In this paper , we will investigate a more efficient peer-to-peer communication , based on theory-of-mind . Hierarchical frameworks Yang et al . ( 2019 ) ; Kim et al . ( 2020 ) ; Xu et al . ( 2020 ) are also investigated to promote multi-agent cooperation/coordination . HiT-MAC ( Xu et al. , 2020 ) is the closest work to ours . It proposes a hierarchical multi-agent coordination framework to decompose the target coverage problem into two-level tasks : assigning targets by the centralized coordinator and tracking assigned targets by decentralized executors . The agents in ToM2C are also of a two-level hierarchy . Considering the natural structure of ToMAC , we also decompose the cooperation tasks in this way , rather than learning skills in an unsupervised manner ( Yang et al. , 2019 ) . Differently , both levels in ToM2C are enabled to perform distributively , thanks to the use of ToM and communication mechanism . Theory of Mind . Theory of Mind is a long-studied concept in cognitive science ( Sher et al. , 2014 ; Sanfey et al. , 2015 ; Etel & Slaughter , 2019 ) . However , how to apply the discovery in cognitive science to build cooperative multi-agent systems still remains a challenge . Most previous works make use of Theory of Mind to interpret agent behaviors , but fail to take a step forward to enhance cooperation . For example , Machine Theory of Mind ( Rabinowitz et al. , 2018 ) proposes a meta-learning method to learn a ToMnet that predicts the behaviors or characteristics of a single agent . Besides , Shum et al . ( 2019 ) studies how to apply Bayesian inference to understand the behaviors of a group and predict the group structure . Track et al . ( 2018 ) introduces the concept of Satisficing Theory of Mind , which refers to the sufficing and satisfying model of others . Shu et al . ( 2021 ) and Gandhi et al . ( 2021 ) introduce benchmarks for evaluating machine mental reasoning . These works mainly focus on how to accurately infer the mental state of others , rather than interactive cooperation . Puig et al . ( 2021 ) ; Carroll et al . ( 2019 ) ; Netanyahu et al . ( 2021 ) studies the human-AI cooperation with mental inference . Lim et al . ( 2020 ) considers a 2-player scenario and employs Bayesian Theory of Mind to promote collaboration . Nevertheless , the task is relative simple and it requires the model of other agents to do the inference . M3RL ( Shu & Tian , 2019 ) proposes to train a manager that infers the minds of agents and assigns sub-tasks to them , which benefits from the centralized mechanism and is not comparable with decentralized methods . Wu et al . ( 2021 ) introduce Bayesian approach for ToM-based cooperation , yet assuming that the environment has a partially ordered set of sub-tasks . Differently , we study how to leverage ToM to guide efficient decentralized communication to further enhance the multi-agent cooperation . Opponent Modeling . Opponent modeling ( He et al. , 2016 ; Raileanu et al. , 2018 ; Grover et al. , 2018 ) is another kind of method comparable with Theory of Mind . Agents endowed with opponent modeling can explicitly represent the model of others , and therefore plan with awareness of the current status of others . Nevertheless , these methods rely on the access to the observation of others , which means they are not truly decentralized paradigms . Compared with existing methods , ToM2C applies ToM not only to explicitly model intentions and mental states but also to improve the efficiency of communication to further promote cooperation . 3 METHODS . In this section , we will explain how to build a target-oriented social agent to achieve efficient multi-agent communication and cooperation . We formulate the target-oriented cooperative task as a Dec-POMDP ( Bernstein et al. , 2002 ) . The aim of all agents is to maximize the team reward . The overall network architecture is shown in Fig . 2 , from the perspective of agent i . The model is mainly composed of four functional networks : observation encoder , Theory of Mind network ( ToM Net ) , message sender , and decision maker . First , the raw observation oi , indicating the states of observed targets , will be encoded into Ei by an attention-based encoder . After that , the ToM Net takes Theory of Mind inference ToMi ( G∗i |Ei , Φ ) to estimate the joint intention ( sub-goals ) of others G∗i , according to the encoded observation Ei and the poses of agents Φ = ( φ1 , ... , φn ) . In details , taking ToMi , j as an example , it uses the estimated observation i , j infers the probability of agent j choosing these targets as its goals , denoted as g∗i , j . The estimation of i , j is based on the pose φj . In general , pose φj indicates the location and rotation of the agent j . Specifically , it can be represented as a 6D vector ( x , y , z , roll , yaw , pitch ) in 3D space and a 3D vector ( x , y , yaw ) in 2D plane . After the ToM inference , the message sender decides whom to communicate with . Here we employ a graph neural network to model the connection among agents . The node feature of agent j is the concatenation of i , j and Ei filtered by g∗i , j . The final communication connection is sampled according to the computed graph edge features . Agent i will send g∗i , j to agent j if there exists a communication edge from i to j . At the end , we aggregate G∗i , Ei and received messages ∑ g∗ ? , j as ηi for the decision making . The planner πHi ( gi|ηi ) , guided by the team reward , chooses the sub-goal gi to the low-level executor πLi ( ai|oi , gi ) , which takes K steps primitive actions to reach the sub-goal . In the following sections , we will illustrate the key components of ToM2C in detail .
This paper proposes a new algorithm called TOM2C to solve the multi-agent reinforcement learning problem. To achieve goals in the MARL problem, communication between agents is important. However, it is often challenging due to scalability and communication costs. To solve this problem, the authors adopt the Theory of Mind to multi-agents. The agent infers the mental states and intentions of others upon partial observation. TOM2C has two kinds of agents: a planner that decides sub-goal and reaches a consensus, and a low-level executor that takes actions. The authors also provide a communication reduction method based on CTDE.
SP:c1bfd8893b1f9e54afbe95410eae68f08eed1f9d
SANE: Specialization-Aware Neural Network Ensemble
1 INTRODUCTION . Real-world data distribution could be complex in most cases and people usually approximate it by a composition of several simpler distributions ( Xie et al. , 2016 ; Yang et al. , 2016 ; Tsai et al. , 2020 ) . Intuitively , to fit the complex data distribution conveniently , we can divide the complex model learning process into training several simpler models , each of which specializes in one simple distribution . In this paper , we call this idea model specialization . Ensemble learning is one of the most effective methods to leverage model specialization . Originated from decades ago ( Hansen & Salamon , 1990 ) , ensemble method ( Schapire , 1990 ; Breiman , 1996 ; Zhou et al. , 2002 ) has been proven effective for practical machine learning tasks in various scenarios including computer vision ( Huang et al. , 2017 ) , natural language processing ( Shazeer et al. , 2017 ) and tabular data mining ( Liu et al. , 2020 ) . Many works conduct ensemble learning through improving diversity across base models , which has been shown to reduce the variance of the combined predictions and improve generalization ( Lee et al. , 2015 ; Zhou et al. , 2018 ) . The recent methodologies pursuing model diversity mainly through incorporating randomization in data sampling ( Breiman , 1996 ; Ho , 1995 ) or model training ( Srivastava et al. , 2014 ; Lakshminarayanan et al. , 2016 ) . Some other works propose sequential optimization such as boosting ( Freund , 1995 ; Chen & Guestrin , 2016 ; Ke et al. , 2017 ) and snapshot ensemble ( Huang et al. , 2017 ) . Other methods , e.g. , model decorrelation ( Zhou et al. , 2018 ) and diversity enhancement ( Zhang et al. , 2020 ) , explicitly encourage model diversity through incorporating additional objectives . However , overvaluing diversity may hurt the ensemble effectiveness and the trade-off between the performance and diversity of base models still remains an open problem ( Rame & Cord , 2021 ; Fort et al. , 2019 ; Masegosa , 2019 ) . Moreover , without explicitly enforcing model specialization , pursuing model diversity does not provide guarantees of each model ’ s specialization on different simple distribution in the composition . The last two columns in Figure 1 visualize the specialty of each model by plotting the data regions where the base model makes correct predictions . It shows that neither the ensemble of ( b ) randomly initialized base models nor ( c ) diversified base models produce models with different specialties . Specifically , although the method in ( c ) enforces diversity and shows low correlation among base models ’ outputs , their data regions with correct predictions are very similar as shown in the last two columns in Figure 1 , resulting in inferior performance after ensemble . Besides , simply putting specialized base models together does not necessarily bring promising ensemble performance . We need to know each base model ’ s specialty over different samples and aggregate their outputs based on their specialty . As shown in Figure 1 ( d ) , although the overall accuracy of the two base models are low , the ensemble model performs surprisingly well ( 100 % accuracy in ( d ) ) as long as 1 ) each base model specializes in unique sub-regions of the latent space and 2 ) the ensemble model knows which sub-regions each base model specializes in , demonstrating the effectiveness of specialization in ensemble learning . More detailed analyses of Figure 1 are presented in Section 2 . In this paper , we propose an end-to-end ensemble learning method that actively enforces model specialization by training models to specialize in specific simple distributions , and aggregates them based on their specialties . Firstly , we represent the composition of simple distributions by mapping them into a unified latent space , where samples from each data distribution form a locally clustered sub-region . This paper proposes to enforce each base model to specialize in one sub-region , and we call this region the base model ’ s corresponding specialty region . The base models ’ specialty regions are defined by a set of learnable anchor points , each of which corresponds to the center of the specialty region , called specialty anchor . During training , base models ’ parameters and their corresponding specialty anchors are learned simultaneously . Each base model ’ s specialty is enforced by encouraging model to focus more on samples in the vicinity of its specialty anchor . Finally , during prediction , based on the correlation between models ’ specialty anchors and the samples in the latent space , our method is able to automatically estimate each base model ’ s specialty over testing samples , and the outputs of the base models are adaptively aggregated based on their specialty over different testing samples . To demonstrate the effectiveness of the proposed method , we conduct extensive experiments in prediction tasks on two tabular datasets and two image classification datasets . The comprehensive empirical studies show that 1 ) coupling specialized base models and specializationaware aggregation can benefit ensemble learning and 2 ) the proposed specialization-aware neural network ensemble method can achieve superior performance compared with the state-of-the-art ensemble methods in various prediction tasks . 2 PRELIMINARIES AND SYNTHETIC ANALYSIS . 2.1 PRELIMINARIES . In general , ensemble learning consists of two tasks : training multiple base models and aggregating their predictions . We use { Mk } Kk=1 to denote a collection of K base models . For a given instance xn ∈ Rd and its label yn ∈ [ 1 , C ] , each base model learns a mapping Mk : Rd 7−→ RC , which produces logits for C classes . Base models ’ predictions are then aggregated in a weighted manner . The likelihood is written as p ( yn |xn ) = ∑K k=1 wk p ( yn |xn ; θk ) s.t . ∑K k=1 wk = 1 , whereMk is parameterized by θk and wk denotes the weight for aggregating k-th model prediction . Objectives of ensemble learning . To maximize the likelihood , most previous studies attempt to promote ∑K k=1 p ( yn |xn ; θk ) ( true confidence ofMk , for brevity ) , with fixed model weights on all samples . To this end , some works train models based on random initialization to reduce prediction variance and generalization errors , while others explicitly quantify diversity to reduce the correlation of errors between models . However , there is always a problem about the trade-off between diversity and accuracy in this scenario , since the weighted majority correctness among selected models determines the correctness of the ensemble . One way to avoid the conflict between adopting diverse models and boosting the overall performance is to use sample-specific model weights to aggregate models ’ predictions . Intuitively , if a base model performs much better than any other base models over a specific sub-region of the dataset containing one or more samples ( i.e. , a base model specializes in a sub-set of the dataset ) , it should be assigned with higher weight in this sub-region . As a result , we define the specialized model as follows . Definition 2.1 . ( Specialized model ) We define the specialized modelMk of a sample ( xn , yn ) with two aspects : ( 1 ) k = argmaxk′ p ( yn |xn ; θk′ ) , and ( 2 ) yn = argmaxc p ( c |xn ; θk ) where c ∈ [ 1 , C ] denotes the class label . If no model satisfies the above conditions , then xn is not specialized by any model . That is , the specialized model is the one that works correctly and has the highest prediction confidence on a given sample among all the base models . 2.2 SYNTHETIC ANALYSIS . In this section , we conduct the experiment with three ensemble solutions including a random initialization based method and a diversity-based ensemble method , and then we illustrate how specialization can benefit ensemble . A 5× 5 checkerboard synthetic dataset containing 25 Gaussian blobs shown in Figure 1 ( a ) is used for analysis . Two widely used ensemble methods are selected for this experiment . Firstly , following the classical random ensemble , base models with different weight initialization are trained independently and aggregated averagely . On the basis of the random ensemble , we further implement a diversitydriven ensemble by incorporating a diversity loss ( Li et al. , 2012 ) into the error function of each base model to encourage base models to perform differently on the same sample . To illustrate how different base models and their ensembles make predictions , we draw their decision boundaries and graphs showing their individual specialty regions , which for a single model is where it makes the correct prediction . A multi-layer perceptron ( MLP ) with one hidden layer and 20 neurons serves as the base model of ensembles through this section . For simplicity of visualization and analysis , we maintain two base models for each ensemble method . Random ensemble v.s . diversity-driven ensemble . The results of these two methods are , respectively , shown in Figure 1 ( b ) and ( c ) . From random ensemble results in Figure 1 ( b ) , the base models are similar in performance and decision boundary thus resulting in their limited ability for fitting the complex distribution with ensemble . One question may be raised : will enforcing the base learners to predict differently on the same samples by incorporating diversity loss be sufficient to solve the above issue ? From Figure 1 ( c ) , base models ’ specialty regions for the diversity-driven ensemble are similar to that for the random ensemble , despite the fact that the prediction confidence of the base model diverges significantly across different sample regions . This suggests that diversity may not be sufficient to encourage the base model towards specialized on more samples , thus failing to improve ensemble performance . We can also observe that ensemble fails on some samples correctly predicted by a base model , for such a model we define as an unexpressed specialist . Definition 2.2 . ( Unexpressed specialist ) Given the specialized modelMk on a sample ( xn , yn ) , we defineMk as an unexpressed specialist if yn 6= argmaxc ∑K i=1 wi p ( c |xn ; θi ) where c ∈ [ 1 , C ] . Specialization-aware ensemble . In terms of diversity-driven results , the pursuit of diversity does not lead to model specialization . To verify whether a specialization-driven approach is better than the diversity-driven approach , we further use true confidence of model prediction on a sample ( i.e. , p ( c = yn|xn ; θk ) ) to explicitly quantify its specialization and conduct specialization-aware ensemble learning . As for training , we train the two base models while weighting the classification losses of each base model with the normalized true confidence . As a result , for model inference and ensemble , averaging their predictions only yields an accuracy of 71.0 % , whereas an ensemble weighted by the true confidence of the base models yields an accuracy of 100.0 % . It clearly illustrates that , as long as the specialization has been cautiously tackled , specialization-aware ensemble over weak base models will significantly improve the ensemble performance . As shown in Figure 1 ( d ) , base models ’ specialty regions overlap less , with more samples having a specialized model compared with the first two methods . Both specialization-aware training and output aggregation based on model specialty could contribute to the result that improves the accuracy from 71.0 % to 100.0 % . We verify that both factors are equally important by conducting an ablation study on the diversitydriven ensemble , where we assign the ensemble weights in ( c ) by the true confidences of each base model as we do in ( d ) . However , the test accuracy is not improved ( still 81 % ) by such a design . Therefore , ideally , our target is to have an expressed specialist for each sample by training specialized models and aggregating based on their specialty accordingly . To this end , a problem with the current specialization-driven ensemble is that the base models tend to have overconfidence in the samples they are not specialized in ( outside their known distributions ) ( Hein et al. , 2019 ) . These overconfident yet incorrect predictions tend to induce the presence of unexpressed specialists . Thus , not only do we need the models to be specialized in different specialty regions , but we also want these specialists to have a global perception to avoid overconfidence . As opposed to specialized , we also try to jointly train the sum of base models by directly minimizing the cross entropy between ground truth and the final ensemble result 1K ∑K k=1Mk ( · ) . Surprisingly , from our experiments in Section 4.3 and evidences in other study ( Allen-Zhu & Li , 2020 ) , the performance of the trained large model is even worse than that of the single model . It shows that in this way we can actually give more loss weights in back-propagation for models with higher true confidence , i.e. , it leads to specialization of models . However , without specialization-aware aggregation , the averaged ensemble result turns out to be inferior .
This paper presents a novel method for ensemble learning. By introducing a anchor scheme and specialization loss , the base learner are forced to be specialized. The method is validated on both tabular and image datasets.
SP:31b86280f4e7863cfa6c70d55695d26e7b65a8bf
SANE: Specialization-Aware Neural Network Ensemble
1 INTRODUCTION . Real-world data distribution could be complex in most cases and people usually approximate it by a composition of several simpler distributions ( Xie et al. , 2016 ; Yang et al. , 2016 ; Tsai et al. , 2020 ) . Intuitively , to fit the complex data distribution conveniently , we can divide the complex model learning process into training several simpler models , each of which specializes in one simple distribution . In this paper , we call this idea model specialization . Ensemble learning is one of the most effective methods to leverage model specialization . Originated from decades ago ( Hansen & Salamon , 1990 ) , ensemble method ( Schapire , 1990 ; Breiman , 1996 ; Zhou et al. , 2002 ) has been proven effective for practical machine learning tasks in various scenarios including computer vision ( Huang et al. , 2017 ) , natural language processing ( Shazeer et al. , 2017 ) and tabular data mining ( Liu et al. , 2020 ) . Many works conduct ensemble learning through improving diversity across base models , which has been shown to reduce the variance of the combined predictions and improve generalization ( Lee et al. , 2015 ; Zhou et al. , 2018 ) . The recent methodologies pursuing model diversity mainly through incorporating randomization in data sampling ( Breiman , 1996 ; Ho , 1995 ) or model training ( Srivastava et al. , 2014 ; Lakshminarayanan et al. , 2016 ) . Some other works propose sequential optimization such as boosting ( Freund , 1995 ; Chen & Guestrin , 2016 ; Ke et al. , 2017 ) and snapshot ensemble ( Huang et al. , 2017 ) . Other methods , e.g. , model decorrelation ( Zhou et al. , 2018 ) and diversity enhancement ( Zhang et al. , 2020 ) , explicitly encourage model diversity through incorporating additional objectives . However , overvaluing diversity may hurt the ensemble effectiveness and the trade-off between the performance and diversity of base models still remains an open problem ( Rame & Cord , 2021 ; Fort et al. , 2019 ; Masegosa , 2019 ) . Moreover , without explicitly enforcing model specialization , pursuing model diversity does not provide guarantees of each model ’ s specialization on different simple distribution in the composition . The last two columns in Figure 1 visualize the specialty of each model by plotting the data regions where the base model makes correct predictions . It shows that neither the ensemble of ( b ) randomly initialized base models nor ( c ) diversified base models produce models with different specialties . Specifically , although the method in ( c ) enforces diversity and shows low correlation among base models ’ outputs , their data regions with correct predictions are very similar as shown in the last two columns in Figure 1 , resulting in inferior performance after ensemble . Besides , simply putting specialized base models together does not necessarily bring promising ensemble performance . We need to know each base model ’ s specialty over different samples and aggregate their outputs based on their specialty . As shown in Figure 1 ( d ) , although the overall accuracy of the two base models are low , the ensemble model performs surprisingly well ( 100 % accuracy in ( d ) ) as long as 1 ) each base model specializes in unique sub-regions of the latent space and 2 ) the ensemble model knows which sub-regions each base model specializes in , demonstrating the effectiveness of specialization in ensemble learning . More detailed analyses of Figure 1 are presented in Section 2 . In this paper , we propose an end-to-end ensemble learning method that actively enforces model specialization by training models to specialize in specific simple distributions , and aggregates them based on their specialties . Firstly , we represent the composition of simple distributions by mapping them into a unified latent space , where samples from each data distribution form a locally clustered sub-region . This paper proposes to enforce each base model to specialize in one sub-region , and we call this region the base model ’ s corresponding specialty region . The base models ’ specialty regions are defined by a set of learnable anchor points , each of which corresponds to the center of the specialty region , called specialty anchor . During training , base models ’ parameters and their corresponding specialty anchors are learned simultaneously . Each base model ’ s specialty is enforced by encouraging model to focus more on samples in the vicinity of its specialty anchor . Finally , during prediction , based on the correlation between models ’ specialty anchors and the samples in the latent space , our method is able to automatically estimate each base model ’ s specialty over testing samples , and the outputs of the base models are adaptively aggregated based on their specialty over different testing samples . To demonstrate the effectiveness of the proposed method , we conduct extensive experiments in prediction tasks on two tabular datasets and two image classification datasets . The comprehensive empirical studies show that 1 ) coupling specialized base models and specializationaware aggregation can benefit ensemble learning and 2 ) the proposed specialization-aware neural network ensemble method can achieve superior performance compared with the state-of-the-art ensemble methods in various prediction tasks . 2 PRELIMINARIES AND SYNTHETIC ANALYSIS . 2.1 PRELIMINARIES . In general , ensemble learning consists of two tasks : training multiple base models and aggregating their predictions . We use { Mk } Kk=1 to denote a collection of K base models . For a given instance xn ∈ Rd and its label yn ∈ [ 1 , C ] , each base model learns a mapping Mk : Rd 7−→ RC , which produces logits for C classes . Base models ’ predictions are then aggregated in a weighted manner . The likelihood is written as p ( yn |xn ) = ∑K k=1 wk p ( yn |xn ; θk ) s.t . ∑K k=1 wk = 1 , whereMk is parameterized by θk and wk denotes the weight for aggregating k-th model prediction . Objectives of ensemble learning . To maximize the likelihood , most previous studies attempt to promote ∑K k=1 p ( yn |xn ; θk ) ( true confidence ofMk , for brevity ) , with fixed model weights on all samples . To this end , some works train models based on random initialization to reduce prediction variance and generalization errors , while others explicitly quantify diversity to reduce the correlation of errors between models . However , there is always a problem about the trade-off between diversity and accuracy in this scenario , since the weighted majority correctness among selected models determines the correctness of the ensemble . One way to avoid the conflict between adopting diverse models and boosting the overall performance is to use sample-specific model weights to aggregate models ’ predictions . Intuitively , if a base model performs much better than any other base models over a specific sub-region of the dataset containing one or more samples ( i.e. , a base model specializes in a sub-set of the dataset ) , it should be assigned with higher weight in this sub-region . As a result , we define the specialized model as follows . Definition 2.1 . ( Specialized model ) We define the specialized modelMk of a sample ( xn , yn ) with two aspects : ( 1 ) k = argmaxk′ p ( yn |xn ; θk′ ) , and ( 2 ) yn = argmaxc p ( c |xn ; θk ) where c ∈ [ 1 , C ] denotes the class label . If no model satisfies the above conditions , then xn is not specialized by any model . That is , the specialized model is the one that works correctly and has the highest prediction confidence on a given sample among all the base models . 2.2 SYNTHETIC ANALYSIS . In this section , we conduct the experiment with three ensemble solutions including a random initialization based method and a diversity-based ensemble method , and then we illustrate how specialization can benefit ensemble . A 5× 5 checkerboard synthetic dataset containing 25 Gaussian blobs shown in Figure 1 ( a ) is used for analysis . Two widely used ensemble methods are selected for this experiment . Firstly , following the classical random ensemble , base models with different weight initialization are trained independently and aggregated averagely . On the basis of the random ensemble , we further implement a diversitydriven ensemble by incorporating a diversity loss ( Li et al. , 2012 ) into the error function of each base model to encourage base models to perform differently on the same sample . To illustrate how different base models and their ensembles make predictions , we draw their decision boundaries and graphs showing their individual specialty regions , which for a single model is where it makes the correct prediction . A multi-layer perceptron ( MLP ) with one hidden layer and 20 neurons serves as the base model of ensembles through this section . For simplicity of visualization and analysis , we maintain two base models for each ensemble method . Random ensemble v.s . diversity-driven ensemble . The results of these two methods are , respectively , shown in Figure 1 ( b ) and ( c ) . From random ensemble results in Figure 1 ( b ) , the base models are similar in performance and decision boundary thus resulting in their limited ability for fitting the complex distribution with ensemble . One question may be raised : will enforcing the base learners to predict differently on the same samples by incorporating diversity loss be sufficient to solve the above issue ? From Figure 1 ( c ) , base models ’ specialty regions for the diversity-driven ensemble are similar to that for the random ensemble , despite the fact that the prediction confidence of the base model diverges significantly across different sample regions . This suggests that diversity may not be sufficient to encourage the base model towards specialized on more samples , thus failing to improve ensemble performance . We can also observe that ensemble fails on some samples correctly predicted by a base model , for such a model we define as an unexpressed specialist . Definition 2.2 . ( Unexpressed specialist ) Given the specialized modelMk on a sample ( xn , yn ) , we defineMk as an unexpressed specialist if yn 6= argmaxc ∑K i=1 wi p ( c |xn ; θi ) where c ∈ [ 1 , C ] . Specialization-aware ensemble . In terms of diversity-driven results , the pursuit of diversity does not lead to model specialization . To verify whether a specialization-driven approach is better than the diversity-driven approach , we further use true confidence of model prediction on a sample ( i.e. , p ( c = yn|xn ; θk ) ) to explicitly quantify its specialization and conduct specialization-aware ensemble learning . As for training , we train the two base models while weighting the classification losses of each base model with the normalized true confidence . As a result , for model inference and ensemble , averaging their predictions only yields an accuracy of 71.0 % , whereas an ensemble weighted by the true confidence of the base models yields an accuracy of 100.0 % . It clearly illustrates that , as long as the specialization has been cautiously tackled , specialization-aware ensemble over weak base models will significantly improve the ensemble performance . As shown in Figure 1 ( d ) , base models ’ specialty regions overlap less , with more samples having a specialized model compared with the first two methods . Both specialization-aware training and output aggregation based on model specialty could contribute to the result that improves the accuracy from 71.0 % to 100.0 % . We verify that both factors are equally important by conducting an ablation study on the diversitydriven ensemble , where we assign the ensemble weights in ( c ) by the true confidences of each base model as we do in ( d ) . However , the test accuracy is not improved ( still 81 % ) by such a design . Therefore , ideally , our target is to have an expressed specialist for each sample by training specialized models and aggregating based on their specialty accordingly . To this end , a problem with the current specialization-driven ensemble is that the base models tend to have overconfidence in the samples they are not specialized in ( outside their known distributions ) ( Hein et al. , 2019 ) . These overconfident yet incorrect predictions tend to induce the presence of unexpressed specialists . Thus , not only do we need the models to be specialized in different specialty regions , but we also want these specialists to have a global perception to avoid overconfidence . As opposed to specialized , we also try to jointly train the sum of base models by directly minimizing the cross entropy between ground truth and the final ensemble result 1K ∑K k=1Mk ( · ) . Surprisingly , from our experiments in Section 4.3 and evidences in other study ( Allen-Zhu & Li , 2020 ) , the performance of the trained large model is even worse than that of the single model . It shows that in this way we can actually give more loss weights in back-propagation for models with higher true confidence , i.e. , it leads to specialization of models . However , without specialization-aware aggregation , the averaged ensemble result turns out to be inferior .
This paper presents a SANE model to improve the ensemble learning from the perspective of model specialization. In particular, it first gives the analysis on existing ensemble strategies, i.e., random and diversity-driven, via conducting experiments on synthetic data. By this way, it points out the weakness of these strategies lies in the lack of specialty. Motivated by this, this paper presents the specialization-aware method to improve the ensemble learning. Specifically, it introduces anchor points in the latent space for guiding the model learning towards specialty. To derive the correlation between samples and anchors, it utilizes the transformer-like attention mechanism for learning the weights of base models. This paper demonstrates its effectiveness on several image and tabular benchmarks.
SP:31b86280f4e7863cfa6c70d55695d26e7b65a8bf
Revisit Kernel Pruning with Lottery Regulated Grouped Convolutions
1 INTRODUCTION . The applications of convolutional neural networks ( CNNs ) have demonstrated proven success in various computer vision tasks ( Voulodimos et al. , 2018 ) . However , with modern CNN architectures being increasingly deeper and wider , over-parameterization has become one of the major challenges of deploying such models to devices with limited computational resources and memory capacity ( Frankle & Carbin , 2019 ) . Therefore , the study of network pruning—the technique of removing redundant weights from the originally trained network without significantly sacrificing accuracy—has been an important subject both for practical concerns ( Mozer & Smolensky , 1989 ) and to better understand the properties and mechanisms of neural networks ( Arora et al. , 2018 ) . In the realm of CNN pruning , a spectrum of techniques have been studied where the two ends are populated by structured pruning and unstructured pruning methods ( Mao et al. , 2017 ) . Methods from the former end often propose to remove redundant weights in groups while following some geometrical constraints—such as removing a certain filter or layer . The methods from the latter end , on the other hand , prune the network with a more fine-grained view where they evaluate every weight individually . Yet , there are many other methods lay in between of the two ends . Methods that are more “ unstructured ” are believed to be capable of yielding better accuracy retention with a commensurate amount of parameters pruned , due to having a higher degree of freedom on how and where to introduce sparsity to the originally dense network . Empirical findings also support this claim ( Liu et al. , 2019 ; Mao et al. , 2017 ) . Despite having advantages on accuracy retention , the resultant networks from methods closer to the unstructured end will be more sparse and less regulated on where to introduce sparsity . Which may not provide actual compression and acceleration without relying on custom-indexing , sparse convolution libraries , or even dedicated hardware devices ; thus , limits the deployability of such methods ( Mao et al. , 2017 ) . Meanwhile , methods closer to the structured end , by preserving a more regulated resultant network , are more likely to be library/hardware-friendly . The most deployable structured pruning method may deliver a densely resultant network and therefore gain immediate compression and acceleration benefits . We denote this kind of pruning method as densely structured . Naturally , many scholars want to develop new methods within the realm of densely structured pruning but with better accuracy retention . The majority of densely structured pruning methods focus on pruning the original network at a filter- or layer-level . We argue that the blanket removal of an entire filter or layer may harm the representation power of the network and result in undesired accuracy loss — as removing a filter would consequently remove all feature maps generated by such filter . Even worse , removing a layer would eliminate more feature maps and even face the danger of layer-collapse , a phenomenon of having an untrainable pruned network due to premature pruning of an entire layer ( Tanaka et al. , 2020 ) . In this paper , we revisit the idea of kernel pruning ( to only prune one or several k × k kernels from a 3D-filter , instead of an entire one ) as an alternative and less aggressive pruning approach . We hypothesize that by not removing the entire filter , the representation power of the original network will be better preserved . Although the idea of kernel pruning is nothing too novel ( as it is simply a special case of individual weights pruning with 100 % of weights of a kernel pruned ) , it is mostly applied under the context of unstructured pruning or structured pruning methods which may not deliver a dense pruned network ( Mao et al. , 2017 ; Ma et al. , 2020 ) . This is because a direct implementation of kernel pruning with no constraint would introduce sparsity across the network and therefore making the pruned network no longer dense . We address this problem by proposing a versatile grouped pruning framework , where we : 1 . Cluster similar filters from each convolutional layer into a ( predefined ) number of equal sized filter groups . 2 . For each filter group , identify a certain portion of grouped kernels to prune according to the required pruning ratio . 3 . Permute the remaining filters to form a densely grouped convolutional architecture according to the number of groups used in step 1 . Like most other post-train grouped pruning methods , we face the challenge of determining which clustering schemes and which importance metrics to use in step 1 and 2 of the above procedure . Upon investigations and experiments , we discovered that a classical clustering scoring system ( e.g. , the Silhouette score ) might not capture the better clustering scheme in regard to accuracy retention . Yet many filter importance metrics require sophisticated procedures , which are not computationally friendly or easy to execute when applied at a kernel-level . We address the first challenge by consulting model-generated information—in this case , the empirical findings on Lottery Ticket Hypothesis and related literature on weights shifting—to develop a scoring system that identifies the optimal clustering scheme among options per each convolutional layer ( Frankle & Carbin , 2019 ; Renda et al. , 2020 ) . For the second challenge , we design a simple and cost-efficient greedy algorithm with multiple restarts to generate multiple candidate kernel selection queues and identify the one queue where the preserved kernels are most “ distinctive ” from each other yet “ similar ” to the pruned kernels . The main contributions and advantages of our method are : • We brought attention to the heavily overlooked approach of kernel pruning under the context of densely structured pruning . • We developed a framework that is compatible with further-developed/discovered clustering schemes and inductive biases , or more advanced variations upon them . This overcomes one of the major drawbacks of many filter pruning methods : as most of them propose different filter importance metrics that are largely incompatible with each other either in terms of their procedures or computational requirements . • The resultant network of our method is structured as a densely grouped convolution , which enables parallel computing capability and greatly increases the practical deployability of our methods : as we can now share the required computation and memory footprint across multiple end-user devices , where most of them have very limited said resources individually ( e.g. , IoT devices , mobile phones , and wearable technologies ) . • Even by just applying well-understood classical mathematical tools , extensive experiments demonstrate our method outperforms comparable SOTA methods across different networks and datasets . Additionally , our method often needs less data augmentation , a smaller finetuning budget , and it executes without requiring any custom retraining , special fine-tuning , or iterative prune-train cycles — which is rare for the approaches relying on Lottery Ticket Hypothesis-related studies . 2 RELATED WORK . Many prior arts have explored the possibility of obtaining a smaller model with comparable performance by removing redundant weights ( Zhu & Gupta , 2018 ; Han et al. , 2016 ) , filters ( Molchanov et al. , 2017 ; Yu et al. , 2018 ; He et al. , 2019 ; Wang et al. , 2019a ) , layers ( Wang et al. , 2019b ; Lin et al. , 2019 ) , image input ( Howard et al. , 2017 ; Han et al. , 2020 ) , or from all three dimensions ( Wang et al. , 2021 ) . It is clear that filter pruning attracts the most attention among all structured pruning approaches . Our method is inspired by grouped convolution , a widely adopted convolutional architecture which could be implemented efficiently on common devices ( Iandola et al. , 2017 ) . Although kernel pruning used together with filter clustering is not a popular trend , we have seen such a combination in Yu et al . ( 2017 ) . However , the proposed method by Yu requires iterative analysis of many different intermediate feature maps per layer , involves a complex knowledge distillation application during the fine-tuning stage , and lacks comparable experiment results to recent pruning literature . Where our method delivers beyond-SOTA performance with a straightforward one-shot pruning and standard fine-tuning procedure . In addition , our method consults empirical findings on the lottery ticket hypothesis and its derived literature regarding weights masking and weights shifting ( Frankle & Carbin , 2019 ; Renda et al. , 2020 ; Zhou et al. , 2019 ) . More on this in the Proposed Method section . 3 PROPOSED METHOD . 3.1 PRELIMINARIES . Assume a convolutional neural network W has L convolutional layers , we denote the W ` to be the ` -th convolutional layer of W ( for ` ∈ { Z+ | [ 1 , L ] } ) . Therefore , we shall have a 4-D tensor W ` ∈ RC ` out×C ` in×H ` ×W ` where C ` out represents the number of filters in W ` ( also known as the number of output channels in some literature ) , C ` in represents the number of kernels per filter ( a.k.a . number of input channels ) , and H ` ×W ` represents the size of each kernel . The overall procedure of our method can be mainly divided into four stages : 1 ) Clustering filters into n equal-sized groups , where the best clustering scheme for each convolutional layer is determined using the tickets magnitude increase score derived from prior arts on lottery ticket hypothesis and weight-shifting ; 2 ) Evaluating several candidate grouped kernel pruning strategies generated by a greedy approximation algorithm with multiple restarts , where the strategy with preserved grouped kernels that are most distinctive from each other , yet most similar to the pruned grouped kernels gets selected ; 3 ) Permuting the preserved filters to form a grouped convolutional architecture with n groups ; 4 ) Fine-tuning the pruned and grouped network to recover accuracy lost from pruning . 3.2 CLUSTERING FILTERS INTO GROUPS . The first step of our method is to cluster filters from the same convolutional layer into n equal-sized groups . Known that for a layer W ` we have C ` out filters , there shall be C ` out/n filters inside each equal-sized filter group . We denotes F ` i to be the i-th filter in W ` ( namely , F ` i = W ` [ i , : , : , : ] ) for i ∈ { Z+ | [ 1 , C ` out ] } . Filter clustering is a maturely adopted technique in network pruning since it is a widely accepted assumption that when similar filters are clustered together , the representation power of some filters can be covered by the rest of the filters in the same group ( which therefore enables the potential of pruning ) . Additionally , this technique drastically decomposes the scope of the problem , as we may now proceed to evaluate in a group-by-group fashion instead of evaluating all of the filters from W ` at the same time . Many prior arts have developed methods on filter clustering with linearity assumptions ( Guo et al. , 2020 ) , via retraining with a custom loss function ( Wu et al. , 2018 ) , or through an iterative process ( Yu et al. , 2017 ) . We argue that since each filter F ` i is a tensor of C ` in ×H ` ×W ` , considerations regarding non-linearity and high-dimensional relationships should be added . Therefore , we utilize the following three combinations of proven mathematical tools on dimensionality reduction and clustering in order to cluster filters from each layer into n equal-sized groups .
The proposed work focuses on kernel pruning. The core idea revolves around grouping filters using a similarity criterion and removing common convolutional kernels with the group. The proposed work explores optimal grouping schemes for filters and after pruning unwanted filters, the retained filters are restructured and the network can be fine-tuned to recoup prediction accuracy.
SP:9fa6596a6fa0d1363852455b53f196fbfe956729
Revisit Kernel Pruning with Lottery Regulated Grouped Convolutions
1 INTRODUCTION . The applications of convolutional neural networks ( CNNs ) have demonstrated proven success in various computer vision tasks ( Voulodimos et al. , 2018 ) . However , with modern CNN architectures being increasingly deeper and wider , over-parameterization has become one of the major challenges of deploying such models to devices with limited computational resources and memory capacity ( Frankle & Carbin , 2019 ) . Therefore , the study of network pruning—the technique of removing redundant weights from the originally trained network without significantly sacrificing accuracy—has been an important subject both for practical concerns ( Mozer & Smolensky , 1989 ) and to better understand the properties and mechanisms of neural networks ( Arora et al. , 2018 ) . In the realm of CNN pruning , a spectrum of techniques have been studied where the two ends are populated by structured pruning and unstructured pruning methods ( Mao et al. , 2017 ) . Methods from the former end often propose to remove redundant weights in groups while following some geometrical constraints—such as removing a certain filter or layer . The methods from the latter end , on the other hand , prune the network with a more fine-grained view where they evaluate every weight individually . Yet , there are many other methods lay in between of the two ends . Methods that are more “ unstructured ” are believed to be capable of yielding better accuracy retention with a commensurate amount of parameters pruned , due to having a higher degree of freedom on how and where to introduce sparsity to the originally dense network . Empirical findings also support this claim ( Liu et al. , 2019 ; Mao et al. , 2017 ) . Despite having advantages on accuracy retention , the resultant networks from methods closer to the unstructured end will be more sparse and less regulated on where to introduce sparsity . Which may not provide actual compression and acceleration without relying on custom-indexing , sparse convolution libraries , or even dedicated hardware devices ; thus , limits the deployability of such methods ( Mao et al. , 2017 ) . Meanwhile , methods closer to the structured end , by preserving a more regulated resultant network , are more likely to be library/hardware-friendly . The most deployable structured pruning method may deliver a densely resultant network and therefore gain immediate compression and acceleration benefits . We denote this kind of pruning method as densely structured . Naturally , many scholars want to develop new methods within the realm of densely structured pruning but with better accuracy retention . The majority of densely structured pruning methods focus on pruning the original network at a filter- or layer-level . We argue that the blanket removal of an entire filter or layer may harm the representation power of the network and result in undesired accuracy loss — as removing a filter would consequently remove all feature maps generated by such filter . Even worse , removing a layer would eliminate more feature maps and even face the danger of layer-collapse , a phenomenon of having an untrainable pruned network due to premature pruning of an entire layer ( Tanaka et al. , 2020 ) . In this paper , we revisit the idea of kernel pruning ( to only prune one or several k × k kernels from a 3D-filter , instead of an entire one ) as an alternative and less aggressive pruning approach . We hypothesize that by not removing the entire filter , the representation power of the original network will be better preserved . Although the idea of kernel pruning is nothing too novel ( as it is simply a special case of individual weights pruning with 100 % of weights of a kernel pruned ) , it is mostly applied under the context of unstructured pruning or structured pruning methods which may not deliver a dense pruned network ( Mao et al. , 2017 ; Ma et al. , 2020 ) . This is because a direct implementation of kernel pruning with no constraint would introduce sparsity across the network and therefore making the pruned network no longer dense . We address this problem by proposing a versatile grouped pruning framework , where we : 1 . Cluster similar filters from each convolutional layer into a ( predefined ) number of equal sized filter groups . 2 . For each filter group , identify a certain portion of grouped kernels to prune according to the required pruning ratio . 3 . Permute the remaining filters to form a densely grouped convolutional architecture according to the number of groups used in step 1 . Like most other post-train grouped pruning methods , we face the challenge of determining which clustering schemes and which importance metrics to use in step 1 and 2 of the above procedure . Upon investigations and experiments , we discovered that a classical clustering scoring system ( e.g. , the Silhouette score ) might not capture the better clustering scheme in regard to accuracy retention . Yet many filter importance metrics require sophisticated procedures , which are not computationally friendly or easy to execute when applied at a kernel-level . We address the first challenge by consulting model-generated information—in this case , the empirical findings on Lottery Ticket Hypothesis and related literature on weights shifting—to develop a scoring system that identifies the optimal clustering scheme among options per each convolutional layer ( Frankle & Carbin , 2019 ; Renda et al. , 2020 ) . For the second challenge , we design a simple and cost-efficient greedy algorithm with multiple restarts to generate multiple candidate kernel selection queues and identify the one queue where the preserved kernels are most “ distinctive ” from each other yet “ similar ” to the pruned kernels . The main contributions and advantages of our method are : • We brought attention to the heavily overlooked approach of kernel pruning under the context of densely structured pruning . • We developed a framework that is compatible with further-developed/discovered clustering schemes and inductive biases , or more advanced variations upon them . This overcomes one of the major drawbacks of many filter pruning methods : as most of them propose different filter importance metrics that are largely incompatible with each other either in terms of their procedures or computational requirements . • The resultant network of our method is structured as a densely grouped convolution , which enables parallel computing capability and greatly increases the practical deployability of our methods : as we can now share the required computation and memory footprint across multiple end-user devices , where most of them have very limited said resources individually ( e.g. , IoT devices , mobile phones , and wearable technologies ) . • Even by just applying well-understood classical mathematical tools , extensive experiments demonstrate our method outperforms comparable SOTA methods across different networks and datasets . Additionally , our method often needs less data augmentation , a smaller finetuning budget , and it executes without requiring any custom retraining , special fine-tuning , or iterative prune-train cycles — which is rare for the approaches relying on Lottery Ticket Hypothesis-related studies . 2 RELATED WORK . Many prior arts have explored the possibility of obtaining a smaller model with comparable performance by removing redundant weights ( Zhu & Gupta , 2018 ; Han et al. , 2016 ) , filters ( Molchanov et al. , 2017 ; Yu et al. , 2018 ; He et al. , 2019 ; Wang et al. , 2019a ) , layers ( Wang et al. , 2019b ; Lin et al. , 2019 ) , image input ( Howard et al. , 2017 ; Han et al. , 2020 ) , or from all three dimensions ( Wang et al. , 2021 ) . It is clear that filter pruning attracts the most attention among all structured pruning approaches . Our method is inspired by grouped convolution , a widely adopted convolutional architecture which could be implemented efficiently on common devices ( Iandola et al. , 2017 ) . Although kernel pruning used together with filter clustering is not a popular trend , we have seen such a combination in Yu et al . ( 2017 ) . However , the proposed method by Yu requires iterative analysis of many different intermediate feature maps per layer , involves a complex knowledge distillation application during the fine-tuning stage , and lacks comparable experiment results to recent pruning literature . Where our method delivers beyond-SOTA performance with a straightforward one-shot pruning and standard fine-tuning procedure . In addition , our method consults empirical findings on the lottery ticket hypothesis and its derived literature regarding weights masking and weights shifting ( Frankle & Carbin , 2019 ; Renda et al. , 2020 ; Zhou et al. , 2019 ) . More on this in the Proposed Method section . 3 PROPOSED METHOD . 3.1 PRELIMINARIES . Assume a convolutional neural network W has L convolutional layers , we denote the W ` to be the ` -th convolutional layer of W ( for ` ∈ { Z+ | [ 1 , L ] } ) . Therefore , we shall have a 4-D tensor W ` ∈ RC ` out×C ` in×H ` ×W ` where C ` out represents the number of filters in W ` ( also known as the number of output channels in some literature ) , C ` in represents the number of kernels per filter ( a.k.a . number of input channels ) , and H ` ×W ` represents the size of each kernel . The overall procedure of our method can be mainly divided into four stages : 1 ) Clustering filters into n equal-sized groups , where the best clustering scheme for each convolutional layer is determined using the tickets magnitude increase score derived from prior arts on lottery ticket hypothesis and weight-shifting ; 2 ) Evaluating several candidate grouped kernel pruning strategies generated by a greedy approximation algorithm with multiple restarts , where the strategy with preserved grouped kernels that are most distinctive from each other , yet most similar to the pruned grouped kernels gets selected ; 3 ) Permuting the preserved filters to form a grouped convolutional architecture with n groups ; 4 ) Fine-tuning the pruned and grouped network to recover accuracy lost from pruning . 3.2 CLUSTERING FILTERS INTO GROUPS . The first step of our method is to cluster filters from the same convolutional layer into n equal-sized groups . Known that for a layer W ` we have C ` out filters , there shall be C ` out/n filters inside each equal-sized filter group . We denotes F ` i to be the i-th filter in W ` ( namely , F ` i = W ` [ i , : , : , : ] ) for i ∈ { Z+ | [ 1 , C ` out ] } . Filter clustering is a maturely adopted technique in network pruning since it is a widely accepted assumption that when similar filters are clustered together , the representation power of some filters can be covered by the rest of the filters in the same group ( which therefore enables the potential of pruning ) . Additionally , this technique drastically decomposes the scope of the problem , as we may now proceed to evaluate in a group-by-group fashion instead of evaluating all of the filters from W ` at the same time . Many prior arts have developed methods on filter clustering with linearity assumptions ( Guo et al. , 2020 ) , via retraining with a custom loss function ( Wu et al. , 2018 ) , or through an iterative process ( Yu et al. , 2017 ) . We argue that since each filter F ` i is a tensor of C ` in ×H ` ×W ` , considerations regarding non-linearity and high-dimensional relationships should be added . Therefore , we utilize the following three combinations of proven mathematical tools on dimensionality reduction and clustering in order to cluster filters from each layer into n equal-sized groups .
The authors present a new metric to determine the similarity between different grouped kernels and prune the unimportant $k\times k$ slices out of a 3D filter. They utilize the Lottery Ticket Hypothesis and propose a greedy search strategy to overcome the challenge of a huge search space. The experiment results show that the one-shot scheme can still be comparable to two-stage leading methods on the CIFAR-10 dataset, with a slightly lower training cost. The empirical success of this paper may serve as proof of the existence of the Lottery Ticket Hypothesis.
SP:9fa6596a6fa0d1363852455b53f196fbfe956729
ViViT: Curvature access through the generalized Gauss-Newton's low-rank structure
1 INTRODUCTION & MOTIVATION . The large number of trainable parameters in deep neural networks imposes computational constraints on the information that can be made available to optimization algorithms . Standard machine learning libraries ( Abadi et al. , 2015 ; Paszke et al. , 2019 ) mainly provide access to first-order information in the form of average mini-batch gradients . This is a limitation that complicates the development of novel methods that may outperform the state-of-the-art : They must use the same objects to remain easy to implement and use , and to rely on the highly optimized code of those libraries . There is evidence that this has led to stagnation in the performance of first-order optimizers ( Schmidt et al. , 2021 ) . Here , we thus study how to provide efficient access to richer information , namely higher-order derivatives and full statistics of the mini-batch loss . Recent advances in automatic differentiation ( Bradbury et al. , 2020 ; Dangel et al. , 2020 ) have made such information more readily accessible through vectorization of algebraic structure in the differentiated loss . We leverage and extend this functionality to efficiently access curvature in form of the Hessian ’ s generalized Gauss-Newton ( GGN ) approximation . It offers practical advantages over the Hessian and is established for training ( Martens , 2010 ; Martens & Grosse , 2015 ) , compressing ( Singh & Alistarh , 2020 ) , or adding uncertainty to ( Ritter et al. , 2018b ; a ; Kristiadi et al. , 2020 ) neural nets . It is also linked theoretically to the natural gradient method ( Amari , 2000 ) via the Fisher information matrix ( Martens , 2020 , Section 9.2 ) , and has been used to investigate the generalization of neural networks ( Jastrzebski et al. , 2020 ; Thomas et al. , 2020 ) . Traditional ways to access curvature fall into two categories . Firstly , repeated automatic differentiation allows for matrix-free exact multiplication with the Hessian ( Pearlmutter , 1994 ) and GGN ( Schraudolph , 2002 ) . Iterative linear and eigensolvers can leverage such functionality to compute Newton steps ( Martens , 2010 ; Zhang et al. , 2017 ; Gargiani et al. , 2020 ) and spectral properties ( Sagun et al. , 2017 ; 2018 ; Adams et al. , 2018 ; Ghorbani et al. , 2019 ; Papyan , 2019b ; Yao et al. , 2019 ; Granziol et al. , 2021 ) on arbitrary architectures thanks to the generality of automatic differentiation . However , repeated matrix-vector products represent a critical factor for performance . Secondly , Kronecker-factored approximate curvature ( K-FAC ) ( Martens & Grosse , 2015 ; Grosse & Martens , 2016 ; Botev et al. , 2017 ; Martens et al. , 2018 ) constructs an explicit light-weight representation of the GGN based on its algebraic Kronecker structure . The computations are streamlined via gradient backpropagation and the resulting matrices are cheap to store and invert . This allows K-FAC to scale : It has been used successfully with very large mini-batches ( Osawa et al. , 2019 ) . One reason for this efficiency is that K-FAC only approximates the GGN ’ s block diagonal , neglecting interactions across layers . Such terms could be useful , however , for other applications , like uncertainty quantification with Laplace approximations ( Ritter et al. , 2018b ; a ; Kristiadi et al. , 2020 ) that currently rely on K-FAC . Moreover , due to its specific design for optimization , the Kronecker representation does not become more accurate with more data . It remains a simplification , exact only under assumptions unlikely to be met in practice ( Martens & Grosse , 2015 ) . This might be a downside for applications that depend on a precise curvature proxy . Here , we propose VIVIT ( inspired by V V > in Equation ( 3 ) ) , a vivid curvature model that leverages the GGN ’ s low-rank structure . Like K-FAC , its representation is computed in parallel with gradients . But it allows a cost-accuracy trade-off , ranging from the exact GGN to an approximation that has the cost of a single gradient computation . Our contributions are as follows : • We highlight the GGN ’ s low-rank structure , and with it a structural limit for the inherent curvature information contained in a mini-batch . • This low-rank structure allows for efficient computation of various GGN properties : The exact eigenvalue spectrum , including eigenvectors , and per-sample directional derivatives . They enable VIVIT to model curvature noise in a mini-batch , in contrast to existing methods . • Approximations allow VIVIT to flexibly trade off computational cost and accuracy . We empirically demonstrate scalability on deep neural networks and provide a fully-featured efficient implementation in PYTORCH ( Paszke et al. , 2019 ) on top of the BACKPACK ( Dangel et al. , 2020 ) package.1 Using VIVIT , we illustrate that noise in deep learning poses a challenge for the stability of secondorder methods and give a simple example how its quantities can be used to address this problem . 2 NOTATION & METHOD . Consider a model f : Θ × X → Y and a dataset { ( xn , yn ) ∈ X × Y } Nn=1 . For simplicity we use N for both the mini-batch and training set size . The network , parameterized by θ ∈ Θ , maps a sample xn to a prediction ŷn . Predictions are scored by a convex loss function ` : Y × Y → R ( e.g . cross-entropy or square loss ) , which compares to the ground truth yn . The training objective L : Θ→ R is the empirical risk L ( θ ) = 1N ∑N n=1 ` ( f ( θ , xn ) , yn ) . ( 1 ) We use ` n ( θ ) = ` ( f ( θ , xn ) , yn ) and fn ( θ ) = f ( θ , xn ) for per-sample losses and predictions . For gradients , we write gn ( θ ) = ∇θ ` n ( θ ) and g ( θ ) = ∇θL ( θ ) , suppressing θ if unambiguous . We also set Θ = RD and Y = RC with D , C the model parameter and prediction space dimensions , respectively . For classification , C is the number of classes . Hessian & GGN : Two-fold chain rule application to the split ` ◦ f decomposes the Hessian of Equation ( 1 ) into two parts∇2θL ( θ ) = G ( θ ) +R ( θ ) ∈ RD×D ; the positive semi-definite GGN G = 1N ∑N n=1 ( Jθfn ) > ( ∇2fn ` n ) ( Jθfn ) = 1 N ∑N n=1Gn ( 2 ) and a residual R = 1/N ∑N n=1 ∑C c=1 ( ∇2θ [ fn ] c ) [ ∇fn ` n ] c. Here , we use the Jacobian Jab that contains partial derivatives of b with respect to a , [ Jab ] ij = ∂ [ b ] i/∂ [ a ] j . As the residual may alter the Hessian ’ s definiteness – an undesirable property for many applications – we focus on the GGN . Low-rank structure : By basic inequalities , Equation ( 2 ) has rank ( G ) ≤ NC.2 To make this explicit , we factorize the positive semi-definite Hessian ∇2fn ` n = ∑C c=1 sncs > nc , where snc ∈ RC and denote its backpropagated version by vnc = [ Jθfn ] > snc ∈ RD . Absorbing sums into matrix multiplications , we arrive at the GGN ’ s outer product representation that lies at the heart of VIVIT , G = 1N ∑N n=1 ∑C c=1 vncv > nc = V V > with V = 1√ N ( v11 v12 . . . vNC ) ∈ RD×NC . ( 3 ) 1Code available at https : //github.com/PwLo3K46/vivit . 2We assume the overparameterized deep learning setting ( NC < D ) and suppress the trivial rank bound D. V allows for exact computations with the explicit GGN matrix , at linear rather than quadratic memory cost in D. We first formulate the extraction of relevant GGN properties from this factorization , before addressing how to further approximate V to reduce memory and computation costs . 2.1 COMPUTING THE FULL GGN EIGENSPECTRUM . Each GGN eigenvalue λ ∈ R satisfies the characteristic polynomial det ( G − λID ) = 0 with identity matrix ID ∈ RD×D . Leveraging the VIVIT factorization of Equation ( 3 ) and the matrix determinant lemma , the D-dimensional eigenproblem reduces to that of the much smaller Gram matrix G̃ = V > V ∈ RNC×NC which contains pairwise scalar products of vnc ( see Appendix A.1 ) , det ( G− λID ) = 0 ⇔ ( −λ ) D−NC det ( G̃− λINC ) = 0 . ( 4 ) With at least D −NC trivial solutions that represent vanishing eigenvalues , the GGN curvature is flat along most directions in parameter space . Nontrivial solutions that give rise to curved directions are fully-contained in the Gram matrix , and hence much cheaper to compute . For example , the left panel of Figure 1a visualizes the full , exact GGN ’ s empirical spectral density on a mini-batch for a deep convolutional neural net on CIFAR-10 . It reproduces the characteristics that have been reported by numerous works , e.g . Sagun et al . ( 2018 ) : An extensive amount of vanishing or small eigenvalues and a small number of larger outliers . Despite these various Hessian spectral studies which rely on iterative eigensolvers and implicit matrix multiplication ( Sagun et al. , 2017 ; 2018 ; Adams et al. , 2018 ; Ghorbani et al. , 2019 ; Papyan , 2019b ; Yao et al. , 2019 ; Granziol et al. , 2021 ) , we are not aware of works that extract the exact GGN spectrum from its Gram matrix . In contrast to those techniques , this matrix can be computed in parallel with gradients in a single backward pass , which results in less sequential overhead . In fact , our approach allows for plots like Figure 1 to be efficiently live-monitored during training , which may be interesting for practitioners that seek to better understand their model ( Schneider et al. , 2021 ) . Eigenvalues themselves can help identify reasonable hyperparameters , like learning rates . But we can also reconstruct the associated eigenvectors in parameter space . These are directions along which curvature information is contained in the mini-batch . Let S̃+ = { ( λk , ẽk ) |λk 6= 0 , G̃ẽk = λkẽk } Kk=1 denote the nontrivial Gram spectrum with orthonormal eigenvectors ẽ > j ẽk = δjk ( δ represents the Kronecker delta and K = rank ( G ) ) . Then , the transformed set of vectors ek = 1/ √ λkV ẽk are orthonormal eigenvectors ofG associated to eigenvalues λk ( see Appendix A.2 ) , ∀ ( λk , ẽk ) ∈ S̃+ : G̃ẽk = λkẽk =⇒ GV ẽk = λkV ẽk . ( 5 ) The eigenspectrum provides access to the GGN ’ s pseudo-inverse based on V and S̃+ , required by e.g . second-order methods ( see Section 4.2 ) . As we show next , quadratic models defined through the GGN naturally decompose along the eigenvectors from S+ = { ( λk , ek ) |λk 6= 0 , Gek = λkek } Kk=1 .
This work proposes a curvature model VIVIT based on generalized Gauss-Newton (GGN) approximation for the training of neural networks with a convex loss function. The low-rank structure of VIVIT allows for efficient eigen-value decomposition, which also gives per-sample directional derivatives and curvatures. To further improve the efficiency, sampling within the mini-batch and among the coordinates of the prediction can be applied to trade off computational cost with accuracy. As an application example, VIVIT is used to provide noise-aware directional damping which improves the stability of second-order methods.
SP:c28b8fa3bb2124845a81b3a8e30c6790b2c10df9
ViViT: Curvature access through the generalized Gauss-Newton's low-rank structure
1 INTRODUCTION & MOTIVATION . The large number of trainable parameters in deep neural networks imposes computational constraints on the information that can be made available to optimization algorithms . Standard machine learning libraries ( Abadi et al. , 2015 ; Paszke et al. , 2019 ) mainly provide access to first-order information in the form of average mini-batch gradients . This is a limitation that complicates the development of novel methods that may outperform the state-of-the-art : They must use the same objects to remain easy to implement and use , and to rely on the highly optimized code of those libraries . There is evidence that this has led to stagnation in the performance of first-order optimizers ( Schmidt et al. , 2021 ) . Here , we thus study how to provide efficient access to richer information , namely higher-order derivatives and full statistics of the mini-batch loss . Recent advances in automatic differentiation ( Bradbury et al. , 2020 ; Dangel et al. , 2020 ) have made such information more readily accessible through vectorization of algebraic structure in the differentiated loss . We leverage and extend this functionality to efficiently access curvature in form of the Hessian ’ s generalized Gauss-Newton ( GGN ) approximation . It offers practical advantages over the Hessian and is established for training ( Martens , 2010 ; Martens & Grosse , 2015 ) , compressing ( Singh & Alistarh , 2020 ) , or adding uncertainty to ( Ritter et al. , 2018b ; a ; Kristiadi et al. , 2020 ) neural nets . It is also linked theoretically to the natural gradient method ( Amari , 2000 ) via the Fisher information matrix ( Martens , 2020 , Section 9.2 ) , and has been used to investigate the generalization of neural networks ( Jastrzebski et al. , 2020 ; Thomas et al. , 2020 ) . Traditional ways to access curvature fall into two categories . Firstly , repeated automatic differentiation allows for matrix-free exact multiplication with the Hessian ( Pearlmutter , 1994 ) and GGN ( Schraudolph , 2002 ) . Iterative linear and eigensolvers can leverage such functionality to compute Newton steps ( Martens , 2010 ; Zhang et al. , 2017 ; Gargiani et al. , 2020 ) and spectral properties ( Sagun et al. , 2017 ; 2018 ; Adams et al. , 2018 ; Ghorbani et al. , 2019 ; Papyan , 2019b ; Yao et al. , 2019 ; Granziol et al. , 2021 ) on arbitrary architectures thanks to the generality of automatic differentiation . However , repeated matrix-vector products represent a critical factor for performance . Secondly , Kronecker-factored approximate curvature ( K-FAC ) ( Martens & Grosse , 2015 ; Grosse & Martens , 2016 ; Botev et al. , 2017 ; Martens et al. , 2018 ) constructs an explicit light-weight representation of the GGN based on its algebraic Kronecker structure . The computations are streamlined via gradient backpropagation and the resulting matrices are cheap to store and invert . This allows K-FAC to scale : It has been used successfully with very large mini-batches ( Osawa et al. , 2019 ) . One reason for this efficiency is that K-FAC only approximates the GGN ’ s block diagonal , neglecting interactions across layers . Such terms could be useful , however , for other applications , like uncertainty quantification with Laplace approximations ( Ritter et al. , 2018b ; a ; Kristiadi et al. , 2020 ) that currently rely on K-FAC . Moreover , due to its specific design for optimization , the Kronecker representation does not become more accurate with more data . It remains a simplification , exact only under assumptions unlikely to be met in practice ( Martens & Grosse , 2015 ) . This might be a downside for applications that depend on a precise curvature proxy . Here , we propose VIVIT ( inspired by V V > in Equation ( 3 ) ) , a vivid curvature model that leverages the GGN ’ s low-rank structure . Like K-FAC , its representation is computed in parallel with gradients . But it allows a cost-accuracy trade-off , ranging from the exact GGN to an approximation that has the cost of a single gradient computation . Our contributions are as follows : • We highlight the GGN ’ s low-rank structure , and with it a structural limit for the inherent curvature information contained in a mini-batch . • This low-rank structure allows for efficient computation of various GGN properties : The exact eigenvalue spectrum , including eigenvectors , and per-sample directional derivatives . They enable VIVIT to model curvature noise in a mini-batch , in contrast to existing methods . • Approximations allow VIVIT to flexibly trade off computational cost and accuracy . We empirically demonstrate scalability on deep neural networks and provide a fully-featured efficient implementation in PYTORCH ( Paszke et al. , 2019 ) on top of the BACKPACK ( Dangel et al. , 2020 ) package.1 Using VIVIT , we illustrate that noise in deep learning poses a challenge for the stability of secondorder methods and give a simple example how its quantities can be used to address this problem . 2 NOTATION & METHOD . Consider a model f : Θ × X → Y and a dataset { ( xn , yn ) ∈ X × Y } Nn=1 . For simplicity we use N for both the mini-batch and training set size . The network , parameterized by θ ∈ Θ , maps a sample xn to a prediction ŷn . Predictions are scored by a convex loss function ` : Y × Y → R ( e.g . cross-entropy or square loss ) , which compares to the ground truth yn . The training objective L : Θ→ R is the empirical risk L ( θ ) = 1N ∑N n=1 ` ( f ( θ , xn ) , yn ) . ( 1 ) We use ` n ( θ ) = ` ( f ( θ , xn ) , yn ) and fn ( θ ) = f ( θ , xn ) for per-sample losses and predictions . For gradients , we write gn ( θ ) = ∇θ ` n ( θ ) and g ( θ ) = ∇θL ( θ ) , suppressing θ if unambiguous . We also set Θ = RD and Y = RC with D , C the model parameter and prediction space dimensions , respectively . For classification , C is the number of classes . Hessian & GGN : Two-fold chain rule application to the split ` ◦ f decomposes the Hessian of Equation ( 1 ) into two parts∇2θL ( θ ) = G ( θ ) +R ( θ ) ∈ RD×D ; the positive semi-definite GGN G = 1N ∑N n=1 ( Jθfn ) > ( ∇2fn ` n ) ( Jθfn ) = 1 N ∑N n=1Gn ( 2 ) and a residual R = 1/N ∑N n=1 ∑C c=1 ( ∇2θ [ fn ] c ) [ ∇fn ` n ] c. Here , we use the Jacobian Jab that contains partial derivatives of b with respect to a , [ Jab ] ij = ∂ [ b ] i/∂ [ a ] j . As the residual may alter the Hessian ’ s definiteness – an undesirable property for many applications – we focus on the GGN . Low-rank structure : By basic inequalities , Equation ( 2 ) has rank ( G ) ≤ NC.2 To make this explicit , we factorize the positive semi-definite Hessian ∇2fn ` n = ∑C c=1 sncs > nc , where snc ∈ RC and denote its backpropagated version by vnc = [ Jθfn ] > snc ∈ RD . Absorbing sums into matrix multiplications , we arrive at the GGN ’ s outer product representation that lies at the heart of VIVIT , G = 1N ∑N n=1 ∑C c=1 vncv > nc = V V > with V = 1√ N ( v11 v12 . . . vNC ) ∈ RD×NC . ( 3 ) 1Code available at https : //github.com/PwLo3K46/vivit . 2We assume the overparameterized deep learning setting ( NC < D ) and suppress the trivial rank bound D. V allows for exact computations with the explicit GGN matrix , at linear rather than quadratic memory cost in D. We first formulate the extraction of relevant GGN properties from this factorization , before addressing how to further approximate V to reduce memory and computation costs . 2.1 COMPUTING THE FULL GGN EIGENSPECTRUM . Each GGN eigenvalue λ ∈ R satisfies the characteristic polynomial det ( G − λID ) = 0 with identity matrix ID ∈ RD×D . Leveraging the VIVIT factorization of Equation ( 3 ) and the matrix determinant lemma , the D-dimensional eigenproblem reduces to that of the much smaller Gram matrix G̃ = V > V ∈ RNC×NC which contains pairwise scalar products of vnc ( see Appendix A.1 ) , det ( G− λID ) = 0 ⇔ ( −λ ) D−NC det ( G̃− λINC ) = 0 . ( 4 ) With at least D −NC trivial solutions that represent vanishing eigenvalues , the GGN curvature is flat along most directions in parameter space . Nontrivial solutions that give rise to curved directions are fully-contained in the Gram matrix , and hence much cheaper to compute . For example , the left panel of Figure 1a visualizes the full , exact GGN ’ s empirical spectral density on a mini-batch for a deep convolutional neural net on CIFAR-10 . It reproduces the characteristics that have been reported by numerous works , e.g . Sagun et al . ( 2018 ) : An extensive amount of vanishing or small eigenvalues and a small number of larger outliers . Despite these various Hessian spectral studies which rely on iterative eigensolvers and implicit matrix multiplication ( Sagun et al. , 2017 ; 2018 ; Adams et al. , 2018 ; Ghorbani et al. , 2019 ; Papyan , 2019b ; Yao et al. , 2019 ; Granziol et al. , 2021 ) , we are not aware of works that extract the exact GGN spectrum from its Gram matrix . In contrast to those techniques , this matrix can be computed in parallel with gradients in a single backward pass , which results in less sequential overhead . In fact , our approach allows for plots like Figure 1 to be efficiently live-monitored during training , which may be interesting for practitioners that seek to better understand their model ( Schneider et al. , 2021 ) . Eigenvalues themselves can help identify reasonable hyperparameters , like learning rates . But we can also reconstruct the associated eigenvectors in parameter space . These are directions along which curvature information is contained in the mini-batch . Let S̃+ = { ( λk , ẽk ) |λk 6= 0 , G̃ẽk = λkẽk } Kk=1 denote the nontrivial Gram spectrum with orthonormal eigenvectors ẽ > j ẽk = δjk ( δ represents the Kronecker delta and K = rank ( G ) ) . Then , the transformed set of vectors ek = 1/ √ λkV ẽk are orthonormal eigenvectors ofG associated to eigenvalues λk ( see Appendix A.2 ) , ∀ ( λk , ẽk ) ∈ S̃+ : G̃ẽk = λkẽk =⇒ GV ẽk = λkV ẽk . ( 5 ) The eigenspectrum provides access to the GGN ’ s pseudo-inverse based on V and S̃+ , required by e.g . second-order methods ( see Section 4.2 ) . As we show next , quadratic models defined through the GGN naturally decompose along the eigenvectors from S+ = { ( λk , ek ) |λk 6= 0 , Gek = λkek } Kk=1 .
This paper highlights how the low-rank structure of the generalized Gauss-Newton (GGN) approximation of the Hessian can be used as a computationally efficient tool to study the loss landscape of deep neural networks. In particular, authors discuss methods to compute the full spectrum of the GGN and thus providing access to per-sample directional gradients and curvature approximation. Through the lens of the GGN spectrum, authors make observations on the geometry of the loss landscape and its evolution during training, and propose an adaptive damping technique for second-order optimizers that utilizes the GGN curvature information.
SP:c28b8fa3bb2124845a81b3a8e30c6790b2c10df9
GCF: Generalized Causal Forest for Heterogeneous Treatment Effect Estimation Using Nonparametric Methods
Heterogeneous treatment effect ( HTE ) estimation with continuous treatment is essential in multiple disciplines , such as the online marketplace and pharmaceutical industry . The existing machine learning ( ML ) methods , like forest-based modeling , either work only for discrete treatments or make partially linear or parametric assumptions that may suffer from model misspecification . To alleviate these problems , we extend causal forest ( CF ) with non-parametric dose-response functions ( DRFs ) that can be estimated locally using kernel-based Double/Debiased ML estimators . Moreover , we propose a distance-based splitting criterion in the functional space of Partial DRFs to capture the heterogeneity for continuous treatments . We call the proposed algorithm generalized causal forest ( GCF ) as it generalizes the use case of CF to a much broader setup . We show the effectiveness of GCF compared to SOTA on synthetic data and proprietary real-world data sets . 1 INTRODUCTION . Heterogeneous treatment effect ( HTE ) estimation has been of growing interest for decision-makers in a wide spectrum of contexts . It uncovers the effect of interventions at sub-group levels , thereby providing highly tailored suggestions rather than a one-size-fits-all policy . When it comes to precision medicine , HTE provides the leveraged information that physicians need to precisely treat different patients with proper dosages of drugs depending on their genes , living habits , and EHR history . Recently , with the emerging big data that exhibits astronomical complexities , HTE has been essential for online marketplaces ( Syrgkanis et al. , 2021 ; Du et al. , 2019 ; Ye et al. , 2018 ) . For largescale data that presents a huge challenge , algorithms that adapt the booming machine learning ( ML ) techniques to HTE estimation are proposed ( Künzel et al. , 2019 ; Zhao et al. , 2017 ; Chernozhukov et al. , 2018 ; Hill , 2011 ) . However , these methods largely focus on binary or discrete treatments and thereby being not widely applicable , given the fact that continuous treatments are prevalent in practice . Examples include targeting customers with continuous incentives , customizing the duration of ads to improve user engagement , and design optimal interest rates to maximize revenue while control for default . For HTE estimation with continuous treatments , it could be feasible to discretize the treatments and utilize the above approaches , but the limitations are two-phase and bring non-trivial challenges to researchers . First , ordinal treatments like different levels of education can not be treated as categorical otherwise the order information across treatments will be lost , and secondly , discretizing or bucketing has the limitations of model inaccuracy and can not recognize the right patterns of the outcome across treatments . To elucidate the complex relationship between treatment and outcome , researchers put forward ideas of dose-response function ( DRF ) . The estimation of DRF in the presence of high dimensional features can be viewed as a natural extension of regression problems with additional complexities . The success of random forest ( RF ) for regression problems motivates the development of causal forest ( CF ) ( Athey et al. , 2019 ) and orthogonal random forest ( Oprescu et al. , 2019 ) and the modification of Bayesian Additive Random Forest ( Woody et al. , 2020 ; Hahn et al. , 2020 ) . These methods partition the feature space with a splitting criterion fitted on treatments that can provide accurate estimations for HTE . But often they posit linear or partially linear models of DRF which are vulnerable to model misspecifications . Figure 1 is an illustration of model misspecification of random forest and CF . Doubly Robust estimators ( DREs ) allows for misspecification of either the treatment or outcome regression . Recent work ( Kennedy et al. , 2017 ) combines the estimation of generalized propensity score with regression models of the outcome that can further reduce the bias and use kernel regression for non-parametric estimation of DRF . However , it may suffer from the curse of dimensionality when the feature space is high-dimensional given large-scale instances . To advance , ( Colangelo & Lee , 2020 ) provide kernel-based DML estimators that can easily deal with high-dimensional data . Nevertheless , the localization and weighting mechanism of CF is not taken into account , which is essential for capturing heterogeneity . It remains unexplored that how to effectively combine ML methods with localized estimations under no model assumptions . In this paper , we propose generalized causal forest ( GCF ) by extending CF to a generalized one with a brand new splitting criterion , and herein the generalization is two-fold . First , we generalize the local linear model of CF to a non-parametric one with DRF . Meanwhile , we employ the distance metrics in the functional space of Partial DRF as the splitting criterion and use kernel-based DML estimators as the DRF approximation . When it comes to implementations , many open source packages integrate recent research with the trending ML methods that facilitate HTE estimation , such as EconML ( Oprescu et al . ) , CausalML ( Chen et al. , 2020 ) and GRF . EconML , CausalML offer a suite of high-performance ML algorithms like DML , while GRF specially supports CF . However , they are only compatible with single-machine systems and may not be efficient when it comes to large-scale instances . Apache Spark ( Meng et al. , 2016 ) is integrated for handling large-scale data with distributed and in-memory computing , while inclusively provides APIs of trending ML algorithms with the built-in MLlib . Therefore , as one of our contributions , we build our algorithm on Spark that enables large-scale data processing and easy use of any ML techniques . To summarize , the main contributions are : • We are the first to generalize CF ’ s partially linear model to a non-parametric one with DRF and apply kernel-based DML estimators . The proposed algorithm pictures the nonparametric behaviors of how outcome varies with treatments . • We propose a distance-based splitting criterion with various distance metrics in the functional space of Partial DRF that generalizes the differences of CAPE in CF . • Our proposed GCF has been tested on both synthetic and large-scale real-world datasets . It improves on SOTA in terms of multiple evaluation metrics . We implement GCF on Apache Spark MLlib and achieves higher computatinal efficiency by distributed computing . The rest of the paper is organized as follows . In Section 2 , we present related works in the literature . In Section 3 , we introduce some notations and backgrounds . In Section 4 , we introduce the Generalized Causal Forest . In Section 5 , we examine the empirical performance of GCF by applying it to both synthetic and real-world data sets . We conclude the paper with some discussions in Section 6 . 2 RELATED WORKS . A growing amount of literature has been devoted to address the problem of HTE estimation with continuous treatments . The algorithms in the context of DRF include methods targeting at confounding bias , kernel-based or ML-based methods for regression bias reduction , and techniques of DRE or DML that balance the trade-off between the two biases . DRF combined with IPW ( Zhu et al. , 2015 ; Graham et al. , 2015 ) can achieve consistent estimators by weighting the estimation with probability density of treatment . For the regression bias , ( Galagate & Schafer , 2015 ) employ parametric estimations and ( Flores et al. , 2007 ) model DRF as non-parametric functions using kernel regression . To advance , ( Kennedy et al. , 2017 ) propose a doubly robust estimators for DRF by combine the estimation of generalized propensity score with the estimation of outcome using kernel regression . Thus far , these approaches only provide global estimations and can not handle massive amounts of high-dimensional data . Recently , the great efficiency of ML methods motivates their generalization to the problem of HTE estimation . Towards that end , estimating DRF with ML-based algorithms is developed and among which tree-based models are a great candidate since it partitions the feature space for dimensionality reduction and maximizes the heterogeneity as well . Causal Forest ( CF ) proposed in ( Athey et al. , 2019 ) utilizes a subset of training samples for growing trees by recursively partitioning via a splitting criterion . Then HTE estimation is given by weighted average over the outcomes of the remaining training samples , known as honesty principle . The final estimator obtained from CF further exhibits a lower degree of bias by tree ensembles . However , their splitting criterion relies on a linear model assumption and is formulated as the difference between the slopes of linear models . The same limitation applies to Orthogonal Random Forest ( Oprescu et al. , 2019 ) and Bayesian Additive Regression Tress ( Hill , 2011 ; Woody et al. , 2020 ; Hahn et al. , 2020 ) . Nevertheless , the complexity of HTE estimation may not be fully captured by linear or general parametric models , which brings the necessity of non-parametric ML models . Kernel-based DML ( Colangelo & Lee , 2020 ) estimates the nuisance functions with cross-fitting , constructs a non-parametric DML estimator by Gaeutax Derivative . This motivates the utilization of DML and non-parametric estimation in our work , though it only provide global estimators with the limited capacity of localization . A fully non-parametric DML with locally weighted estimations for continuous treatments has not been considered yet . Building on prior art , we point out that our integration of DRF estimation into CF overcome the challenges aforementioned by using local non-parametric DRF to constructing splitting criterion . We introduce the conceptual partial DRF as a component of the splitting criterion and employ the distance in the functional space of Partial DRF as a proxy for heterogeneity instead of the difference of slopes . Moreover , the partial DRF can be estimated precisely by the robust kernel-based DML estimators in our splitting criterion . 3 PREREQUISITES . 3.1 NOTATIONS AND ASSUMPTIONS . We formally introduce the notations for HTE estimation with continuous treatments . Following the potential outcome framework in ( Neyman , 1923 ; Rubin , 1974 ) , we let T be the continuous treatment , X = ( Xj ) pXj=1 be the pX -dim confounding variables , U be the outcome-specific covariates , Z be the treatment-specific covariates that are independent of U , and Y be the outcome of interests . The population Ω = ( X , U , Z , Y , T ) ∈ RpX+pU+pZ+1+1 satisfies Y = g ( T , X , U ) + ; T = f ( X , Z ) + ν where , ν are noises of zero mean and g : Rp × R→ R and f : Rp → R. { ( Xi , Ui , Zi , Yi , Ti ) , i = 1 , . . . , n } are i.i.d . samples drawn from the population Ω . In practice , the decomposition ofX , U , Z from observed covariates is difficult . Therefore , without additional specification , we use X to represent observed covariates throughout the paper to simply notations . The potential outcomes under treatment t is Y ( t ) . Recall that Propensity Score ( PS ) ( Rubin , 1974 ) for a discrete treatment is P ( T = t|X ) , the probability for a unit receiving treatment t given the covariates X . For continuous treatments , ( Rubin , 1974 ; Hirano & Imbens , 2004 ) introduce Generalized Propensity Score ( GPS ) which is the probability density function π ( T = t|X ) . The estimand of interests , CATE θ ( t , X ) , is formally defined as θ ( t , X ) = E [ Y ( t ) |X ] − E [ Y ( 0 ) |X ] To identify θ ( t , X ) , common assumptions as in ( Holland , 1986 ; Kennedy et al. , 2017 ) are made throughout the paper . Assumption 1 . Consistency : E [ Y |T = t ] = E [ Y ( t ) |T = t ] , i.e . the outcome of any sample solely depends on its treatment ; Assumption 2 . Ignorability : The potential outcomes Y ( T ) is independent of treatment T given covariatesX . Assumption 3 . Positivity : The GPS π ( T = t|X ) > pmin > 0 , ∀t , X , i.e . the density for any sample receiving any treatment is bounded away from 0 . Under the above assumptions , we have θ ( t , X ) = E [ Y ( t ) |X ] − E [ Y ( 0 ) |X ] = E [ Y |T = t , X ] − E [ Y |T = 0 , X ] = E [ g ( t , X ) |T = t , X ] − E [ g ( t , X ) |T = 0 , X ] where the first equality holds by Assumption 1 and the second equality holds by Assumption 2 . Positivity is indispensable for the conditional expectation in the last line to be well-defined whereas being often too strong . In practice , it can be reduced to the following . Assumption 4 . Weak Positivity : The variance of GPS σ ( π ) = ∫ t t2 · π ( T = t|X ) dt − ( ∫ t t · π ( T = t|X ) dt ) 2 > σmin > 0 , ∀t , X .
The paper proposes a generalized version of the causal forest for heterogeneous treatment effect estimation for continuous treatment by non-parametric modeling of the dose-response function. To provide non-parametric modeling, the proposed method makes use of kernel-based double/debiased estimators. Experiments of the proposed methods are run on assorted synthetic datasets as well as real-world datasets to demonstrate the effectiveness of the proposed method compared to competing methods.
SP:3e5e45d6810536f4e73cc6a2ba1fbf26992b20d4
GCF: Generalized Causal Forest for Heterogeneous Treatment Effect Estimation Using Nonparametric Methods
Heterogeneous treatment effect ( HTE ) estimation with continuous treatment is essential in multiple disciplines , such as the online marketplace and pharmaceutical industry . The existing machine learning ( ML ) methods , like forest-based modeling , either work only for discrete treatments or make partially linear or parametric assumptions that may suffer from model misspecification . To alleviate these problems , we extend causal forest ( CF ) with non-parametric dose-response functions ( DRFs ) that can be estimated locally using kernel-based Double/Debiased ML estimators . Moreover , we propose a distance-based splitting criterion in the functional space of Partial DRFs to capture the heterogeneity for continuous treatments . We call the proposed algorithm generalized causal forest ( GCF ) as it generalizes the use case of CF to a much broader setup . We show the effectiveness of GCF compared to SOTA on synthetic data and proprietary real-world data sets . 1 INTRODUCTION . Heterogeneous treatment effect ( HTE ) estimation has been of growing interest for decision-makers in a wide spectrum of contexts . It uncovers the effect of interventions at sub-group levels , thereby providing highly tailored suggestions rather than a one-size-fits-all policy . When it comes to precision medicine , HTE provides the leveraged information that physicians need to precisely treat different patients with proper dosages of drugs depending on their genes , living habits , and EHR history . Recently , with the emerging big data that exhibits astronomical complexities , HTE has been essential for online marketplaces ( Syrgkanis et al. , 2021 ; Du et al. , 2019 ; Ye et al. , 2018 ) . For largescale data that presents a huge challenge , algorithms that adapt the booming machine learning ( ML ) techniques to HTE estimation are proposed ( Künzel et al. , 2019 ; Zhao et al. , 2017 ; Chernozhukov et al. , 2018 ; Hill , 2011 ) . However , these methods largely focus on binary or discrete treatments and thereby being not widely applicable , given the fact that continuous treatments are prevalent in practice . Examples include targeting customers with continuous incentives , customizing the duration of ads to improve user engagement , and design optimal interest rates to maximize revenue while control for default . For HTE estimation with continuous treatments , it could be feasible to discretize the treatments and utilize the above approaches , but the limitations are two-phase and bring non-trivial challenges to researchers . First , ordinal treatments like different levels of education can not be treated as categorical otherwise the order information across treatments will be lost , and secondly , discretizing or bucketing has the limitations of model inaccuracy and can not recognize the right patterns of the outcome across treatments . To elucidate the complex relationship between treatment and outcome , researchers put forward ideas of dose-response function ( DRF ) . The estimation of DRF in the presence of high dimensional features can be viewed as a natural extension of regression problems with additional complexities . The success of random forest ( RF ) for regression problems motivates the development of causal forest ( CF ) ( Athey et al. , 2019 ) and orthogonal random forest ( Oprescu et al. , 2019 ) and the modification of Bayesian Additive Random Forest ( Woody et al. , 2020 ; Hahn et al. , 2020 ) . These methods partition the feature space with a splitting criterion fitted on treatments that can provide accurate estimations for HTE . But often they posit linear or partially linear models of DRF which are vulnerable to model misspecifications . Figure 1 is an illustration of model misspecification of random forest and CF . Doubly Robust estimators ( DREs ) allows for misspecification of either the treatment or outcome regression . Recent work ( Kennedy et al. , 2017 ) combines the estimation of generalized propensity score with regression models of the outcome that can further reduce the bias and use kernel regression for non-parametric estimation of DRF . However , it may suffer from the curse of dimensionality when the feature space is high-dimensional given large-scale instances . To advance , ( Colangelo & Lee , 2020 ) provide kernel-based DML estimators that can easily deal with high-dimensional data . Nevertheless , the localization and weighting mechanism of CF is not taken into account , which is essential for capturing heterogeneity . It remains unexplored that how to effectively combine ML methods with localized estimations under no model assumptions . In this paper , we propose generalized causal forest ( GCF ) by extending CF to a generalized one with a brand new splitting criterion , and herein the generalization is two-fold . First , we generalize the local linear model of CF to a non-parametric one with DRF . Meanwhile , we employ the distance metrics in the functional space of Partial DRF as the splitting criterion and use kernel-based DML estimators as the DRF approximation . When it comes to implementations , many open source packages integrate recent research with the trending ML methods that facilitate HTE estimation , such as EconML ( Oprescu et al . ) , CausalML ( Chen et al. , 2020 ) and GRF . EconML , CausalML offer a suite of high-performance ML algorithms like DML , while GRF specially supports CF . However , they are only compatible with single-machine systems and may not be efficient when it comes to large-scale instances . Apache Spark ( Meng et al. , 2016 ) is integrated for handling large-scale data with distributed and in-memory computing , while inclusively provides APIs of trending ML algorithms with the built-in MLlib . Therefore , as one of our contributions , we build our algorithm on Spark that enables large-scale data processing and easy use of any ML techniques . To summarize , the main contributions are : • We are the first to generalize CF ’ s partially linear model to a non-parametric one with DRF and apply kernel-based DML estimators . The proposed algorithm pictures the nonparametric behaviors of how outcome varies with treatments . • We propose a distance-based splitting criterion with various distance metrics in the functional space of Partial DRF that generalizes the differences of CAPE in CF . • Our proposed GCF has been tested on both synthetic and large-scale real-world datasets . It improves on SOTA in terms of multiple evaluation metrics . We implement GCF on Apache Spark MLlib and achieves higher computatinal efficiency by distributed computing . The rest of the paper is organized as follows . In Section 2 , we present related works in the literature . In Section 3 , we introduce some notations and backgrounds . In Section 4 , we introduce the Generalized Causal Forest . In Section 5 , we examine the empirical performance of GCF by applying it to both synthetic and real-world data sets . We conclude the paper with some discussions in Section 6 . 2 RELATED WORKS . A growing amount of literature has been devoted to address the problem of HTE estimation with continuous treatments . The algorithms in the context of DRF include methods targeting at confounding bias , kernel-based or ML-based methods for regression bias reduction , and techniques of DRE or DML that balance the trade-off between the two biases . DRF combined with IPW ( Zhu et al. , 2015 ; Graham et al. , 2015 ) can achieve consistent estimators by weighting the estimation with probability density of treatment . For the regression bias , ( Galagate & Schafer , 2015 ) employ parametric estimations and ( Flores et al. , 2007 ) model DRF as non-parametric functions using kernel regression . To advance , ( Kennedy et al. , 2017 ) propose a doubly robust estimators for DRF by combine the estimation of generalized propensity score with the estimation of outcome using kernel regression . Thus far , these approaches only provide global estimations and can not handle massive amounts of high-dimensional data . Recently , the great efficiency of ML methods motivates their generalization to the problem of HTE estimation . Towards that end , estimating DRF with ML-based algorithms is developed and among which tree-based models are a great candidate since it partitions the feature space for dimensionality reduction and maximizes the heterogeneity as well . Causal Forest ( CF ) proposed in ( Athey et al. , 2019 ) utilizes a subset of training samples for growing trees by recursively partitioning via a splitting criterion . Then HTE estimation is given by weighted average over the outcomes of the remaining training samples , known as honesty principle . The final estimator obtained from CF further exhibits a lower degree of bias by tree ensembles . However , their splitting criterion relies on a linear model assumption and is formulated as the difference between the slopes of linear models . The same limitation applies to Orthogonal Random Forest ( Oprescu et al. , 2019 ) and Bayesian Additive Regression Tress ( Hill , 2011 ; Woody et al. , 2020 ; Hahn et al. , 2020 ) . Nevertheless , the complexity of HTE estimation may not be fully captured by linear or general parametric models , which brings the necessity of non-parametric ML models . Kernel-based DML ( Colangelo & Lee , 2020 ) estimates the nuisance functions with cross-fitting , constructs a non-parametric DML estimator by Gaeutax Derivative . This motivates the utilization of DML and non-parametric estimation in our work , though it only provide global estimators with the limited capacity of localization . A fully non-parametric DML with locally weighted estimations for continuous treatments has not been considered yet . Building on prior art , we point out that our integration of DRF estimation into CF overcome the challenges aforementioned by using local non-parametric DRF to constructing splitting criterion . We introduce the conceptual partial DRF as a component of the splitting criterion and employ the distance in the functional space of Partial DRF as a proxy for heterogeneity instead of the difference of slopes . Moreover , the partial DRF can be estimated precisely by the robust kernel-based DML estimators in our splitting criterion . 3 PREREQUISITES . 3.1 NOTATIONS AND ASSUMPTIONS . We formally introduce the notations for HTE estimation with continuous treatments . Following the potential outcome framework in ( Neyman , 1923 ; Rubin , 1974 ) , we let T be the continuous treatment , X = ( Xj ) pXj=1 be the pX -dim confounding variables , U be the outcome-specific covariates , Z be the treatment-specific covariates that are independent of U , and Y be the outcome of interests . The population Ω = ( X , U , Z , Y , T ) ∈ RpX+pU+pZ+1+1 satisfies Y = g ( T , X , U ) + ; T = f ( X , Z ) + ν where , ν are noises of zero mean and g : Rp × R→ R and f : Rp → R. { ( Xi , Ui , Zi , Yi , Ti ) , i = 1 , . . . , n } are i.i.d . samples drawn from the population Ω . In practice , the decomposition ofX , U , Z from observed covariates is difficult . Therefore , without additional specification , we use X to represent observed covariates throughout the paper to simply notations . The potential outcomes under treatment t is Y ( t ) . Recall that Propensity Score ( PS ) ( Rubin , 1974 ) for a discrete treatment is P ( T = t|X ) , the probability for a unit receiving treatment t given the covariates X . For continuous treatments , ( Rubin , 1974 ; Hirano & Imbens , 2004 ) introduce Generalized Propensity Score ( GPS ) which is the probability density function π ( T = t|X ) . The estimand of interests , CATE θ ( t , X ) , is formally defined as θ ( t , X ) = E [ Y ( t ) |X ] − E [ Y ( 0 ) |X ] To identify θ ( t , X ) , common assumptions as in ( Holland , 1986 ; Kennedy et al. , 2017 ) are made throughout the paper . Assumption 1 . Consistency : E [ Y |T = t ] = E [ Y ( t ) |T = t ] , i.e . the outcome of any sample solely depends on its treatment ; Assumption 2 . Ignorability : The potential outcomes Y ( T ) is independent of treatment T given covariatesX . Assumption 3 . Positivity : The GPS π ( T = t|X ) > pmin > 0 , ∀t , X , i.e . the density for any sample receiving any treatment is bounded away from 0 . Under the above assumptions , we have θ ( t , X ) = E [ Y ( t ) |X ] − E [ Y ( 0 ) |X ] = E [ Y |T = t , X ] − E [ Y |T = 0 , X ] = E [ g ( t , X ) |T = t , X ] − E [ g ( t , X ) |T = 0 , X ] where the first equality holds by Assumption 1 and the second equality holds by Assumption 2 . Positivity is indispensable for the conditional expectation in the last line to be well-defined whereas being often too strong . In practice , it can be reduced to the following . Assumption 4 . Weak Positivity : The variance of GPS σ ( π ) = ∫ t t2 · π ( T = t|X ) dt − ( ∫ t t · π ( T = t|X ) dt ) 2 > σmin > 0 , ∀t , X .
The authors extend the generalized random forest by Athey et al. (2019) from partially linear models to nonparametric ones and combine it with a doubly robust estimation step. The paper contains a small scale simulation study and a small real data analysis.
SP:3e5e45d6810536f4e73cc6a2ba1fbf26992b20d4
Edge Rewiring Goes Neural: Boosting Network Resilience via Policy Gradient
1 INTRODUCTION . Modern infrastructure systems , such as computer routing and electric power networks , are vulnerable to natural disasters and malicious attacks ( Schneider et al. , 2011 ) . Consider the scenario where the abnormality of one power supply station causes other power supply stations to overload , which cascades more power supply to fail , resulting in a region-wide power outage . Figure 1 visualizes this scenario that the failures of a dozen of nodes could jeopardize the connectivity and utility of the EU power network with 217 nodes . The ability for a system to defend itself from such failures and attacks is characterized by the network resilience . A resilient network should continue to function and maintain an acceptable level of utility when part of the network fails . A network becomes more resilient if some connections could backup the others . It is seemingly straightforward to achieve resilience by adding redundant edges . However , it will not be practically feasible as the nodes are usually already running at their full capacity . For example , a power supply facility can only support a certain number of connections and can not afford additional loads . In such a regime , degree-preserving operations , such as edge rewiring , are desired ( Schneider et al. , 2011 ; Rong & Liu , 2018 ; Yazıcıoğlu et al. , 2015 ; Zhou & Liu , 2014 ) . Let G = ( V , E ) be a graph . An edge rewiring operation alters the graph structure by removing AC and BD and adding AB and CD , where AC , BD ∈ E and AB , CD , AD , BC /∈ E.1 Edge rewiring is empirically effective to maximize network resilience and becomes the prevailing atomic operation in the literature . Despite this , methods for improving network resilience via edge rewiring share several limitations : utility loss , local optimality , and transduction . 1A few works have a different definition for the edge rewiring operation . • Network utility loss . Improving network resilience aims to protect the network utility from degrading under attack and make the network continue functioning . Optimizing network resilience without considering the network utility could jeopardize the functioning without the presence of an attack . • Local optimality . Combinatorially choosing the edges to rewire to optimize the resilience is proved to be NP-hard ( Mosk-Aoyama , 2008 ) . Previous studies predominantly seek approximate optimality through greedy-like algorithms , which yields local optimality in practice . • Transductivity . Traditional resilience optimization methods are transductive since they search the resilience topology on a given graph . This search process has to be executed for every graph and does not transfer between graphs , even if the graphs are only up to a minor structure difference . To tackle the challenges above , in this work , we present ResiNet , the first objective-agnostic learning-based method for inductively discovering resilient network topologies . Frist , by formulating the cumulative gain of the objective into RL , ResiNet is agnostic to arbitrary objective function , which makes resilience optimization practical in real applications by incorporating the utility into the resilience . The nature of delayed gratification in RL also allows the agent to bypass local optimums caused by step-wise optimal actions . Second , the fact that graphs have different sizes and arbitrary node permutations makes it challenging to solve transductivity when selecting edges with deep learning . In this scenario , nodes can no longer be represented by their ID since it is computationally infeasible to train a model to handle all isomorphic graphs . Using an attention-based mechanism ( Vinyals et al. , 2015 ) to identify edges and an auto-regressive space ( Trivedi et al. , 2020 ) to formulate edge selection , an agent trained by ResiNet works on a wide range of graphs with different sizes and permutations . Deep learning and graph neural networks ( GNNs ) have been successfully applied to many combinatorial optimization problems on graphs ( Khalil et al. , 2017 ; Li et al. , 2018a ; Karalias & Loukas , 2020 ) . However , as we empirically observed , the combination of GNNs and RL can not perform well on the task of improving network resilience via edge rewiring . We suspect that this is caused by a dilemma for the expressive power of GNN : If the representation power of the GNN is too weak ( e.g. , the regular GNN ) , then it could not distinguish graphs with minor differences and will choose similar actions in consecutive steps of RL . This causes the process to alternate between two graphs , forming an infinite loop . If the representation power is too strong ( e.g. , SMP , IDGNN ) , it tends to give similar representations to connected vertices , known as the oversmoothing phenomenon ( Vignac et al. , 2020 ; You et al. , 2021 ) . It is then difficult for the agent to distinguish vertices in a connected component , causing large randomness in the output of the policy . This dilemma may lead to the bad performance of selecting edges using regular GNNs and RL . Therefore , to successfully select two edges from a degree-preserving evolving dynamic graph at each step , the implementation of ResiNet is armed with Filtration enhanced GNN ( FireGNN ) , our technical innovation , to solve the above dilemma of the expressive power of GNN . FireGNN creates a series of subgraphs ( the filtration ) by successively removing nodes from the graph , and aggregates the node representations from the subgraphs . It makes the GNN powerful when representing graphs while avoiding oversmoothing as the node information are adequately acquired from a multi-step filtration . This technical innovation is inspired by persistent homology and the approximation of the persistence diagram ( Edelsbrunner & Harer , 2008 ; Aktas et al. , 2019 ; Hofer et al. , 2020 ) . The main contributions of this paper are summarized as follows : 1 ) We propose ResiNet , a data-driven framework to boost network resilience in a degreepreserving way with moderate loss of the network utility by forming resilience optimization into a objective-agnostic sequential decision process of edge rewiring . Extensive experiments show that with a small number of rewiring operations , ResiNet achieves a nearoptimal resilience gain on multiple graphs while balancing network utilities . Existing approaches are outperformed by a large margin . 2 ) FireGNN , our technical innovation , balances the expressive power and the oversmoothing issue through the graph filtration augmentation . FireGNN could distinguish very similar graphs and distinguish connected vertices at the same time , which is essential to make the combination of GNNs and RL work on the network resilience optimization . 3 ) ResiNet is the first to improve network resilience in an inductive way , with the specialized auto-regressive permutation-invariant size-variable policy network . Once an agent is trained , it works on a wide range of graphs . The policy network is general enough to be extended to other problems in constrained graph generation . 2 RELATED WORKS . Network attacks and defenses The problem of attacking a network is characterized by the target resilience measurement and the manipulation type . Depending on the application , network resilience is defined as a corresponding measure to quantify the network functionality , such as graph connectivity ( Grassia et al. , 2021 ; Fan et al. , 2020 ) . For particular networks ( e.g. , scale-free networks ) , attacks appear in destroying critical nodes and critical connections ( Grassia et al. , 2021 ; Fan et al. , 2020 ; Zhao et al. , 2021 ; Zhang et al. , 2017 ; Medya et al. , 2020 ) . Heuristic and learning-based attack methods ( Holme et al. , 2002 ; Iyer et al. , 2013 ; Grassia et al. , 2021 ; Fan et al. , 2020 ) have been proposed to target the critical subset of the network . To defend against potential attacks , various defense strategies have been proposed to protect the network functionality from crashing and preserve some of its topologies . The commonly used defense manipulations include adding additional edges ( Li et al. , 2019 ; Carchiolo et al. , 2019 ) , protecting vulnerable edges ( Wang et al. , 2014 ) and rewiring two edges ( Schneider et al. , 2011 ; Chan & Akoglu , 2016 ; Buesser et al. , 2011 ) . Among these manipulations , edge rewiring fits well to real-world applications as it induces less functionality changes ( e.g . degree preserving ) to the original network and does not impose additional loads to the vertices ( Schneider et al. , 2011 ; Rong & Liu , 2018 ; Yazıcıoğlu et al. , 2015 ; Zhou & Liu , 2014 ) . GNNs for combinatorial optimization problems The idea of applying GNNs to solve combinatorial optimization problems on graphs is becoming a promising yet challenging topic . Abundant algorithms have been developed and can be classified into three categories . Supervised learning approach combines GNNs with heuristics search procedures or solvers to solve classical combinatorial problems , such as graph matching ( Bai et al. , 2018 ) , graph coloring ( Lemos et al. , 2019 ) , TSP ( Li et al. , 2018b ; Joshi et al. , 2019 ) and SAT ( Wang et al. , 2019 ) . These methods require labeled instances and thus are difficult to generalize to large-scale instances directly . Unsupervised learning approach ( Karalias & Loukas , 2020 ) trains GNNs to parametrize a probability distribution over sets . The probabilistic proof achieves the existence of feasible solutions . After that , the derandomized method is applied to decode the desired solutions . However , meeting complex constraints have not been supported yet . Reinforcement learning approach formulates a problem as a Markov decision process with a proper reward function to guide the search towards an optimal solution . Some classical CO problems have achieved remarkable results like TSP ( Fu et al. , 2020 ; Khalil et al. , 2017 ) , Vehicle Routing Problem ( Nazari et al. , 2018 ; Peng et al. , 2020 ; Yu et al. , 2019 ) , SAT ( Yolcu & Póczos , 2019 ) and max-cut ( Khalil et al. , 2017 ) . In this paper , we adopt the RL based approach but with a specialized policy network . Positioning of this work In this paper , we use only the edge rewiring operation to defend against degree-based and centrality-based attacks while preserving the network utility . Extended related works The related works on Network resilience and utility , multi-views graph augmentation for GNNs , and deep graph generation models are deferred to Appendix A . 3 PROPOSED APPROACH : RESINET . In this section , we first present the problem formulation of maximizing network resilience while preserving utility performance . We then discuss the graph resilience-aware environment design and give the graph policy network which guides the process of edge rewiring . The problem of boosting network resilience is formulated as a reinforcement learning task by iteratively rewiring the edges . 3.1 PROBLEM DEFINITION . An undirected graph is defined as G = ( V , E ) , where V = { 1 , 2 , . . . , N } is the set of N nodes , E is the set of M edges , A ∈ { 0 , 1 } N×N is the adjacency matrix , and F ∈ RN×d is the d-dimensional node feature matrix.2 The degree of a node is defined as di = ∑N j=1Aij , and a node with degree 0 is called an isolated node . Let GG denote the set of graphs with the same node degrees as G. Given the network resilience functionR ( G ) and the utility function U ( G ) , the objective of boosting the resilience of G is to find a target graph G ? ∈ GG , which maximizes the network resilience while preserving the network utility . Formally , the problem of maximizing network resilience is formulated as G ? = argmax G′∈GG α · R ( G ′ ) + ( 1− α ) · U ( G ′ ) , where α ∈ R is the scalar weight that balances the resilience and the utility . Two examples of resilience functions , including the graph connectivity-based measurement ( Schneider et al. , 2011 ) and the spectrum-based measurement ( e.g. , adjacency matrix spectrum and Laplacian matrix spectrum ) , and two examples of utility functions , including global efficiency and local efficiency , are given in Appendix B . Our formulation could generalize to other definitions of resilience and utility .
This paper studies how to improve network resilience by proposing a reinforcement learning-based framework named **ResiNet** and a new GNN architecture called **FireGNN**. The proposed framework is able to directly generalize to unseen graphs. The new GNN architecture applies the graph filtration process, which enhances the expressivity of GNN. The authors conduct experiments on synthetic and real datasets to compare the proposed framework with previous baseline methods.
SP:599f2f7249aba31390c85edfeda4e7dd63ec4915
Edge Rewiring Goes Neural: Boosting Network Resilience via Policy Gradient
1 INTRODUCTION . Modern infrastructure systems , such as computer routing and electric power networks , are vulnerable to natural disasters and malicious attacks ( Schneider et al. , 2011 ) . Consider the scenario where the abnormality of one power supply station causes other power supply stations to overload , which cascades more power supply to fail , resulting in a region-wide power outage . Figure 1 visualizes this scenario that the failures of a dozen of nodes could jeopardize the connectivity and utility of the EU power network with 217 nodes . The ability for a system to defend itself from such failures and attacks is characterized by the network resilience . A resilient network should continue to function and maintain an acceptable level of utility when part of the network fails . A network becomes more resilient if some connections could backup the others . It is seemingly straightforward to achieve resilience by adding redundant edges . However , it will not be practically feasible as the nodes are usually already running at their full capacity . For example , a power supply facility can only support a certain number of connections and can not afford additional loads . In such a regime , degree-preserving operations , such as edge rewiring , are desired ( Schneider et al. , 2011 ; Rong & Liu , 2018 ; Yazıcıoğlu et al. , 2015 ; Zhou & Liu , 2014 ) . Let G = ( V , E ) be a graph . An edge rewiring operation alters the graph structure by removing AC and BD and adding AB and CD , where AC , BD ∈ E and AB , CD , AD , BC /∈ E.1 Edge rewiring is empirically effective to maximize network resilience and becomes the prevailing atomic operation in the literature . Despite this , methods for improving network resilience via edge rewiring share several limitations : utility loss , local optimality , and transduction . 1A few works have a different definition for the edge rewiring operation . • Network utility loss . Improving network resilience aims to protect the network utility from degrading under attack and make the network continue functioning . Optimizing network resilience without considering the network utility could jeopardize the functioning without the presence of an attack . • Local optimality . Combinatorially choosing the edges to rewire to optimize the resilience is proved to be NP-hard ( Mosk-Aoyama , 2008 ) . Previous studies predominantly seek approximate optimality through greedy-like algorithms , which yields local optimality in practice . • Transductivity . Traditional resilience optimization methods are transductive since they search the resilience topology on a given graph . This search process has to be executed for every graph and does not transfer between graphs , even if the graphs are only up to a minor structure difference . To tackle the challenges above , in this work , we present ResiNet , the first objective-agnostic learning-based method for inductively discovering resilient network topologies . Frist , by formulating the cumulative gain of the objective into RL , ResiNet is agnostic to arbitrary objective function , which makes resilience optimization practical in real applications by incorporating the utility into the resilience . The nature of delayed gratification in RL also allows the agent to bypass local optimums caused by step-wise optimal actions . Second , the fact that graphs have different sizes and arbitrary node permutations makes it challenging to solve transductivity when selecting edges with deep learning . In this scenario , nodes can no longer be represented by their ID since it is computationally infeasible to train a model to handle all isomorphic graphs . Using an attention-based mechanism ( Vinyals et al. , 2015 ) to identify edges and an auto-regressive space ( Trivedi et al. , 2020 ) to formulate edge selection , an agent trained by ResiNet works on a wide range of graphs with different sizes and permutations . Deep learning and graph neural networks ( GNNs ) have been successfully applied to many combinatorial optimization problems on graphs ( Khalil et al. , 2017 ; Li et al. , 2018a ; Karalias & Loukas , 2020 ) . However , as we empirically observed , the combination of GNNs and RL can not perform well on the task of improving network resilience via edge rewiring . We suspect that this is caused by a dilemma for the expressive power of GNN : If the representation power of the GNN is too weak ( e.g. , the regular GNN ) , then it could not distinguish graphs with minor differences and will choose similar actions in consecutive steps of RL . This causes the process to alternate between two graphs , forming an infinite loop . If the representation power is too strong ( e.g. , SMP , IDGNN ) , it tends to give similar representations to connected vertices , known as the oversmoothing phenomenon ( Vignac et al. , 2020 ; You et al. , 2021 ) . It is then difficult for the agent to distinguish vertices in a connected component , causing large randomness in the output of the policy . This dilemma may lead to the bad performance of selecting edges using regular GNNs and RL . Therefore , to successfully select two edges from a degree-preserving evolving dynamic graph at each step , the implementation of ResiNet is armed with Filtration enhanced GNN ( FireGNN ) , our technical innovation , to solve the above dilemma of the expressive power of GNN . FireGNN creates a series of subgraphs ( the filtration ) by successively removing nodes from the graph , and aggregates the node representations from the subgraphs . It makes the GNN powerful when representing graphs while avoiding oversmoothing as the node information are adequately acquired from a multi-step filtration . This technical innovation is inspired by persistent homology and the approximation of the persistence diagram ( Edelsbrunner & Harer , 2008 ; Aktas et al. , 2019 ; Hofer et al. , 2020 ) . The main contributions of this paper are summarized as follows : 1 ) We propose ResiNet , a data-driven framework to boost network resilience in a degreepreserving way with moderate loss of the network utility by forming resilience optimization into a objective-agnostic sequential decision process of edge rewiring . Extensive experiments show that with a small number of rewiring operations , ResiNet achieves a nearoptimal resilience gain on multiple graphs while balancing network utilities . Existing approaches are outperformed by a large margin . 2 ) FireGNN , our technical innovation , balances the expressive power and the oversmoothing issue through the graph filtration augmentation . FireGNN could distinguish very similar graphs and distinguish connected vertices at the same time , which is essential to make the combination of GNNs and RL work on the network resilience optimization . 3 ) ResiNet is the first to improve network resilience in an inductive way , with the specialized auto-regressive permutation-invariant size-variable policy network . Once an agent is trained , it works on a wide range of graphs . The policy network is general enough to be extended to other problems in constrained graph generation . 2 RELATED WORKS . Network attacks and defenses The problem of attacking a network is characterized by the target resilience measurement and the manipulation type . Depending on the application , network resilience is defined as a corresponding measure to quantify the network functionality , such as graph connectivity ( Grassia et al. , 2021 ; Fan et al. , 2020 ) . For particular networks ( e.g. , scale-free networks ) , attacks appear in destroying critical nodes and critical connections ( Grassia et al. , 2021 ; Fan et al. , 2020 ; Zhao et al. , 2021 ; Zhang et al. , 2017 ; Medya et al. , 2020 ) . Heuristic and learning-based attack methods ( Holme et al. , 2002 ; Iyer et al. , 2013 ; Grassia et al. , 2021 ; Fan et al. , 2020 ) have been proposed to target the critical subset of the network . To defend against potential attacks , various defense strategies have been proposed to protect the network functionality from crashing and preserve some of its topologies . The commonly used defense manipulations include adding additional edges ( Li et al. , 2019 ; Carchiolo et al. , 2019 ) , protecting vulnerable edges ( Wang et al. , 2014 ) and rewiring two edges ( Schneider et al. , 2011 ; Chan & Akoglu , 2016 ; Buesser et al. , 2011 ) . Among these manipulations , edge rewiring fits well to real-world applications as it induces less functionality changes ( e.g . degree preserving ) to the original network and does not impose additional loads to the vertices ( Schneider et al. , 2011 ; Rong & Liu , 2018 ; Yazıcıoğlu et al. , 2015 ; Zhou & Liu , 2014 ) . GNNs for combinatorial optimization problems The idea of applying GNNs to solve combinatorial optimization problems on graphs is becoming a promising yet challenging topic . Abundant algorithms have been developed and can be classified into three categories . Supervised learning approach combines GNNs with heuristics search procedures or solvers to solve classical combinatorial problems , such as graph matching ( Bai et al. , 2018 ) , graph coloring ( Lemos et al. , 2019 ) , TSP ( Li et al. , 2018b ; Joshi et al. , 2019 ) and SAT ( Wang et al. , 2019 ) . These methods require labeled instances and thus are difficult to generalize to large-scale instances directly . Unsupervised learning approach ( Karalias & Loukas , 2020 ) trains GNNs to parametrize a probability distribution over sets . The probabilistic proof achieves the existence of feasible solutions . After that , the derandomized method is applied to decode the desired solutions . However , meeting complex constraints have not been supported yet . Reinforcement learning approach formulates a problem as a Markov decision process with a proper reward function to guide the search towards an optimal solution . Some classical CO problems have achieved remarkable results like TSP ( Fu et al. , 2020 ; Khalil et al. , 2017 ) , Vehicle Routing Problem ( Nazari et al. , 2018 ; Peng et al. , 2020 ; Yu et al. , 2019 ) , SAT ( Yolcu & Póczos , 2019 ) and max-cut ( Khalil et al. , 2017 ) . In this paper , we adopt the RL based approach but with a specialized policy network . Positioning of this work In this paper , we use only the edge rewiring operation to defend against degree-based and centrality-based attacks while preserving the network utility . Extended related works The related works on Network resilience and utility , multi-views graph augmentation for GNNs , and deep graph generation models are deferred to Appendix A . 3 PROPOSED APPROACH : RESINET . In this section , we first present the problem formulation of maximizing network resilience while preserving utility performance . We then discuss the graph resilience-aware environment design and give the graph policy network which guides the process of edge rewiring . The problem of boosting network resilience is formulated as a reinforcement learning task by iteratively rewiring the edges . 3.1 PROBLEM DEFINITION . An undirected graph is defined as G = ( V , E ) , where V = { 1 , 2 , . . . , N } is the set of N nodes , E is the set of M edges , A ∈ { 0 , 1 } N×N is the adjacency matrix , and F ∈ RN×d is the d-dimensional node feature matrix.2 The degree of a node is defined as di = ∑N j=1Aij , and a node with degree 0 is called an isolated node . Let GG denote the set of graphs with the same node degrees as G. Given the network resilience functionR ( G ) and the utility function U ( G ) , the objective of boosting the resilience of G is to find a target graph G ? ∈ GG , which maximizes the network resilience while preserving the network utility . Formally , the problem of maximizing network resilience is formulated as G ? = argmax G′∈GG α · R ( G ′ ) + ( 1− α ) · U ( G ′ ) , where α ∈ R is the scalar weight that balances the resilience and the utility . Two examples of resilience functions , including the graph connectivity-based measurement ( Schneider et al. , 2011 ) and the spectrum-based measurement ( e.g. , adjacency matrix spectrum and Laplacian matrix spectrum ) , and two examples of utility functions , including global efficiency and local efficiency , are given in Appendix B . Our formulation could generalize to other definitions of resilience and utility .
The paper proposes a neural approach that increases network resilience by edge wiring. The approach uses a combination of graph neural network (GNN) and policy gradient method to do so. The experiments use a few small networks and several non-neural baselines. 
SP:599f2f7249aba31390c85edfeda4e7dd63ec4915
On the relation between statistical learning and perceptual distances
1 INTRODUCTION . The relationship between the internal representations of supervised learning models and biological systems has previously been explored ( Cadieu et al. , 2014 ) , and this connection can be explained by both systems being optimized to perform the same object recognition task . A much less studied area is comparing modern representations learned in an unsupervised manner to those of biological systems . As one of the most influential ideas in this area , the efficient coding hypothesis states that the internal representations of the brain have evolved to efficiently represent the stimuli ( Attneave , 1954 ; Barlow , 1961 ) and has been validated against statistical models for images ( Simoncelli & Olshausen , 2001 ; Malo & Laparra , 2010 ) . Similarly , the explicit constraints of dimensionality reduction or compression present in many unsupervised representation learning models , mainly autoencoders ( Ballé et al. , 2018 ; 2016 ; Baldi , 2012 ) , impose a type of parsimony on the representation . To understand properties of these representations of interest , here we consider distance measurements between the representations of pairs of stimuli . Such distance measurements can be thought of as perceptual distances , which are rooted in psychophysics : a good perceptual distance mimics the human rating of similarity between the two stimuli with high accuracy . Traditionally , perceptual distances have been hand-designed models with few adjustable parameters , inspired by the physiology or observations in visual psychology , as the Multi-Scale Structural SIMilarity index ( MS-SSIM ) ( Wang et al. , 2003 ) . More recently , it has become common to use an explicit image representation and ’ induce ’ a distance from it . For instance , comparing the internal representations of models trained for image classification for pairs of stimuli has been used for perceptual judgments and was shown to correlate well with human opinions ( Zhang et al. , 2018 ; Ding et al. , 2020 ) . This is also true for unsupervised representations that focus on learning features of natural scenes which are information efficient . For example , in the normalized Laplacian pyramid distance ( NLPD ) ( Laparra et al. , 2016 ) , the representation is learned based on redundancy reduction in neighboring pixels . The Perceptual Information Metric ( PIM ) ( Bhardwaj et al. , 2020 ) uses a contrastive representation learning technique based on compression and slowness . With regards to training autoencoders , a particular type of model that can be used to unsupervisedly learn an explicit representation , here we examine three distinct types of induced distances : the reconstruction distance Dr , the inner distance Din and the self-distance Ds . These distances correspond to different representations learned by the autoencoder ( see Fig . 1 ) . While the connection between the biological response and image probability has been examined before ( Laughlin , 1981 ; Twer & MacLeod , 2001 ; Malo & Gutiérrez , 2006 ; Malo & Laparra , 2010 ; Laparra et al. , 2012 ; Laparra & Malo , 2015 ; Hyvärinen et al. , 2009 ) , the relation between perceptual distances , unsupervised image representations , and the statistics of natural images has not been studied in depth . The current understanding is simply that distances induced by representations relevant for image classification or compression are useful for perceptual judgments . We show that the relation is deeper than that , linking it to image statistics . Furthermore , we examine the unexpected effects of utilizing perceptual distances in the loss functions of autoencoders , which is a common approach in designing neural image compression methods ( Ballé et al. , 2018 ) . One would expect that using a perceptual distance that is closely related to the internal image representation of the brain would give rise to a representation inside the model that is much more closely tied to humans , but that does not seem to be the case . This is surprising given the limited ability of Euclidean distances like Mean Squared Error ( MSE ) to reproduce human opinion ( Girod , 1993 ; Wang & Bovik , 2009 ) , compared to successful perceptual distances . We argue that this is because of a double counting effect where the distribution of natural images is taken into account twice in the training of the autoencoder ; once in the training data and again in the perceptual distance , leading to an over-stressing of high density regions in the data . Conversely , where data is sparse or contains non-representative samples , this effect can result in regularization by discounting losses from outliers . Our specific contributions are : 1 We demonstrate that good perceptual distances , i.e . distances that are good at predicting human psychophysical responses , are also correlated with image likelihoods obtained using a recent probabilistic image model ( PixelCNN++ ( Salimans et al. , 2017 ) ) . This underlines indirectly the idea that part of the biology is informed by efficient representation , as conjectured by Barlow . 2 The distances induced by autoencoders trained to minimize an Euclidean loss are correlated with the probability of the training data . Moreover , when autoencoders are trained using natural images , these induced distances are highly correlated with human perception . 3 Using a perceptual distance instead of a Euclidean loss in the optimization of autoencoders implies taking into account the data distribution twice : one in the perceptual distance and another through the empirical risk minimization procedure . We call this the double counting effect . This effect may explain the limited improvements obtained when using perceptual distances in some machine learning applications . We find that perceptual distances lead to models that over-stress high density regions . We emphasize this by showing that image autoencoders can be trained without image data ( just using uniform random noise as input ) if a proper perceptual distance is used . 2 ON THE RELATION BETWEEN PERCEPTUAL DISTANCE AND IMAGE PROBABILITY . The broadest formulation of the classical efficient coding hypothesis in neuroscience ( Barlow , 1961 ) states that the organization of the sensory system can be explained by the regularities of the natural signals ( Barlow , 2001 ) . This hypothesis has inspired statistical derivations of the nonlinear response of biological vision based on equalization : maximization of channel capacity ( Laughlin , 1981 ) and error minimization under noise ( Twer & MacLeod , 2001 ) are one-dimensional equalization techniques that directly relate signal probability , ppxq , with the response of the system to the visual input , y “ Spxq , where S is the given system . These univariate equalization techniques have been generalized to multivariate scenarios to explain the nonlinearities of the biological responses to spatial texture ( Malo & Gutiérrez , 2006 ) , color ( Laparra et al. , 2012 ) , and motion ( Laparra & Malo , 2015 ) . Interestingly , biological networks optimized to reproduce subjective image distortion display statistical properties despite using no statistical information in fitting their parameters . Divisive normalization obtained from perceptual distances substantially reduces the redundancy in natural images ( Malo & Laparra , 2010 ) , and captures a large fraction of the available information in the input ( Malo , 2020 ) . A similar factorization is obtained in Wilson-Cowan networks fitted to reproduce subjective distortions ( Gomez-Villa et al. , 2020a ) . Here the perceptual distance between an image x1 and its distorted version , x2 , will be referred to as Dppx1 , x2q and is computed in the response representation y . For small distortions ( i.e . x1 close to x2 ) , equalization models imply that there is an explicit relation between the perceptual distance , Dppx1 , x2q , and the probability of the original image according to the distribution of natural images , ppx1q ( see Appendix A ) : Dppx1 , x2q ||x2 ´ x1||2 “ Dppx1 , x2q ? m RMSE « ppxqγ ( 1 ) where γ ą 0 , and the Euclidean length ||x2 ´ x1||2 is just the Root Mean Squared Error ( RMSE ) scaled by the dimensionality of the data m. As we are interested in correlations , ignoring the scaling term , this relation leads to the first observation that we check experimentally in this work : Observation 1 The perceptual quantity Dppx1 , x2qRMSEpx1 , x2q is correlated with ppx1q for small distortions ( i.e . when ||x1 ´ x2||2 ă δ for small δ ) . This quantity is related to the sensitivity of the perceptual distance to displacements in the signal domain , BDpBx . In fact , the ( n-dimensional ) gradient reduces to Dp RMSE in the 1-d case ( Appendix A.1 ) . The observation states that the perceptual distance is more sensitive in high probability regions . This observation is experimentally illustrated in Appendix A.2 , that shows a strong connection between the sensitivity of perceptual distances ( either NLPD or MS-SSIM ) and the distribution of natural images , as opposed to the sensitivity of Euclidean RMSE , which is not related to the data . 3 ON THE RELATION BETWEEN DISTANCES INDUCED BY AUTOENCODERS AND PROBABILITY . In section 2 we showed the relation between perceptual distances and the distribution of natural images , and here we connect the distance induced by a statistical model and the probability of the data used to train it . We first discuss our observations , followed by describing the experimental setup . Statistical learning is based on risk minimization which connects the model , the loss to minimize and the distribution of the data . As a result , the trained model captures the statistics of the data . In this section we elaborate on this connection by computing Euclidean distances in the representations induced by the learned model . Here we focus on autoencoders , although the considerations apply to other statistical learning settings . We will consider the three different options to define the induced distances by an autoencoder shown in Fig . 1 . We will refer to them as self-reconstruction distance Ds “ ||x´ x̂||2 , reconstruction distance Dr “ ||x̂1 ´ x̂2||2 , and inner distance Din “ ||y1 ´ y2||2 . The autoencoder model will be denoted as f , which is consists of an encoder ep¨q and a decoder dp¨q , f “ d ˝ e. The reconstructed data is , x̂ “ fpxq , and y is the data in the inner domain , y “ epxq . We will explicitly show how all these three distances depend in different ways on the probability of the input data . Given samples x from a distribution ppxq a generic autoencoder minimizes this risk : R “ ExrLpfpxq , xqs “ ż Lpfpxq , xqdP pxq “ ż ppxq ¨ Lpx̂ , xqdx ( 2 ) where Exr¨s stands for expectation over variable x L is a loss between the input x and the reconstruction fpxq “ x̂ . Since ppxq is unknown and often intractable , the risk is approximated using the empirical risk minimization principle ( Devroye et al. , 1996 ; Vapnik , 1999 ) : Remp “ 1n řn i “ 1 Lpfpxiq , xiq , where the xi are samples from the training dataset of size n. Although it is well known , it is important for the reasoning of this work to stress that , the function fpxq that minimizes the empirical risk Remp is not the same function that would minimize the loss function L uniformly over all space . For example , if we choose L “ ||xi ´ fpxiq||2 , minimizing Remp is not minimizing the RMSE , but the RMSE weighted by the probability of samples , Eq . 2 . Therefore , the distance an autoencoder induces will be different to the loss function used for training . Once the model , fpxq , is trained , it inherits some properties of the data distribution , ppxq . This implies that the model ’ s behavior depends on the probability of the region of the input space where it is applied . In what follows , we make some observations on the relation between the distances Ds , Dr , and Din and the distribution ppxq . We assume that L is the Euclidean distance ( or RMSE ) , but similar arguments qualitatively apply to distances monotonically related to RMSE . Observation 2 The self-reconstruction distance in an autoencoder is correlated to the inverse of the probability : Ds “ ||x´ x̂||29 1ppxq . The difference between the original and the reconstructed data point in denoising and contractive autoencoders has been related with score matching : x ´ x̂ “ BlogpppxqqBx ( Vincent , 2011 ; Alain & Bengio , 2014 ) . This expression can be formulated using the distribution of the noisy data instead ( Miyasawa , 1961 ; Raphan & Simoncelli , 2011 ) . Here we argue that for a family of distributions the modulus of the difference ( ||x ´ x̂||2 ) can be related with the distribution itself ( Obs . 2 ) . This is true for Gaussian distribution , and a good proxy in general for unimodal distributions as the ones proposed to describe the distribution of natural images ( Portilla et al. , 2003 ; Hyvärinen et al. , 2009 ; Lyu & Simoncelli , 2009 ; Malo & Laparra , 2010 ; Lyu , 2011 ; van den Oord & Schrauwen , 2014 ; Ballé et al. , 2016 ) ( see details in Appendix B ) . Our intuition comes from Eq . 2 that enforces small reconstruction errors in high probability regions , i.e . when ppxq is high , ||x´ fpxq||2 should be low . This implies a dependency for the allowed error ( variance of the error ) on the probability : V arxp||x´fpxq||2q9 1ppxq , where V arx is computed around the point x . This is the idea behind the use of autoencoders for anomaly detection . An autoencoder trained for data coming from a particular distribution ppxq , obtains high self-reconstruction error when it is evaluated on data from a different distribution . Analogous to the distance used in Observation 1 , we argue that the quantity DrRMSE is correlated with the probability . The rationale is that if fp.q was trained to minimize the average distortion introduced in the reconstruction , then Dr has to be more sensitive in high density regions . Observation 3 The sensitivity of the reconstruction distance induced by an autoencoder in x1 , Dr RMSE “ ||fpx1q´fpx2q||2 ||x1´x2||2 , is correlated with ppx1q when ||x1 ´ x2||2 ă δ for small δ . While the autoencoder aims to reconstruct the original data , there are some restrictions which make the learned transformation different from the identity . This transformation is going to put more resources in regions where training data is more likely . This enforces a relation between the sensitivity ( derivative ) of the model and the probability distribution , i.e . | BfBx pxq| M ppxq ( see an example in Appendix C ) . Our hypothesis is that this relation should be positively ( possibly nonlinearly ) correlated . In particular we will be reasoning in the direction of using ppx1q||x1 ´ x2||2 as a proxy for the induced reconstruction distance Dr when x1 and x2 are close . While the distance in the inner domain , Din “ ||y1 ´ y2||2 , is highly used ( Ding et al. , 2020 ; Zhang et al. , 2018 ; Gatys et al. , 2016 ) , it is the most difficult to interpret . The main problem is to decide which representation inside the model to use . For autoencoders , the inner representation is usually selected as the layer with the least dimensions , although it is arbitrary what is defined as the inner representation . In compression autoencoders one has two suitable candidate representations , before or after the quantisation step . Both have different interesting properties , however in either cases the sensitivity conjecture also makes qualitative sense for Din . Observation 4 The sensitivity of the distance induced by a compression autoencoder in the inner domain at point x1 , DinRMSE “ ||epx1q´epx2q||2 ||x1´x2||2 , correlates with ppx1q when ||x1 ´ x2||2ăδ for small δ . This observation has a strong connection with density estimation , independent component analysis and data equalization . The density target under a transformation is ppxq “ ppepxqq| BeBx pxq| . If one wants to describe p ( x ) , a suitable target distribution for the transform domain is the uniform distribution . Therefore , if one assumes ppepxqq constant , the determinant of the Jacobian of the transformation is equal to the probability distribution as assumed in the equalization model ( Observation 1 ) , and similarly , one would have ||epxq´epx ` ∆xq||2||x´x ` ∆x||2 « ppxq . A similar result can be obtained modeling the noise in the inner domain ( Berardino et al. , 2017 ) . Note this observation has parallelisms with the procedure that the human visual system has to do in order to process the natural images as stated in Sec . 2 . Experiment . Here we explore the relation of the previously defined distances with the probability distribution of the training data using a compression autoencoder in a toy 2D example . Compression using autoencoders is presented as follows ( Ballé et al. , 2018 ; 2016 ) ; an input x is transformed using the encoder , or analysis transform , epxq to an encoding y. Scalar quantisation is then applied to y to create a vector of integer indices q and a reconstruction ŷ . The quantisation is approximated during training with additive uniform noise ỹ “ y ` ∆y to get a continuous gradient . It is then transformed back into the image domain using the decoder dpŷq to create the reconstructed image x̂ . Given x , the aim is to find a quantised representation q that minimizes the approximated entropy , or rate R “ Hrppỹqs , estimated by a density model p , whilst also minimizing the distortion loss , D , usually weighted by a Lagrange multiplier in order to achieve different compression rates . Thus the loss function L “ R ` λD becomes L “ Exr´ log2 ppepxq ` ∆yqs ` λDpx , dpepxq ` ∆yqq . ( 3 ) In order to have explicit access to the data distribution , a 2D Student-t distribution is used with one dimension having high variance and the other low variance . The Student-t distribution is a reasonable approximation for the distribution of natural images ( van den Oord & Schrauwen , 2014 ) . A 2 layer MLP is used for e and d. For full experimental setup see Appendix C. The induced distances are calculated for a set of samples taken from the Student-t distribution . Fig . 2 shows that these induced distances are correlated with the probability ppx1q . The three observations hold for intermediate regimes , low rate gets bad reconstruction while high rate gets almost no compression . Observation 2 ( Ds ) holds at low and medium rates where the Spearman correlation is -0.68 to -0.4 , but starts to fail at 4.67bpp ( bits-per-pixel ) where correlation approaches -0.18 . The same occurs for Observation 3 ( Dr ) where at high entropy the correlation decreases slightly from 0.49 at 2.03bpp to 0.31 at 4.67bpp . Observation 4 ( Din ) holds over all rates but especially at high rates where the largest correlation of 0.90 is found . These results indicate that the learned representations inside an autoencoder correlate with the training distribution . Although we test at a wide range of rates , if the entropy is very restricted , f “ d ¨ e has no capacity and in the limit may even be a constant function . However , this is a very extreme case and , in practice , an autoencoder like this would never be used .
The work presented in this paper aims to analyze the relationships between the probability distribution of the data, perceptual distances, and unsupervised machine learning. Perceptual sensitivity is correlated with the probability of an image in its close neighborhood. The paper also explores the relation between distances induced by autoencoders and the probability distribution of the training data, as well as how these induced distances are correlated with human perception. At the end, the paper specifies that perceptual distances do not always lead to noticeable gains in performance over Euclidean distance in common image processing tasks.
SP:c686503ec773532c596fdf2b90a6bcc4db9044d3
On the relation between statistical learning and perceptual distances
1 INTRODUCTION . The relationship between the internal representations of supervised learning models and biological systems has previously been explored ( Cadieu et al. , 2014 ) , and this connection can be explained by both systems being optimized to perform the same object recognition task . A much less studied area is comparing modern representations learned in an unsupervised manner to those of biological systems . As one of the most influential ideas in this area , the efficient coding hypothesis states that the internal representations of the brain have evolved to efficiently represent the stimuli ( Attneave , 1954 ; Barlow , 1961 ) and has been validated against statistical models for images ( Simoncelli & Olshausen , 2001 ; Malo & Laparra , 2010 ) . Similarly , the explicit constraints of dimensionality reduction or compression present in many unsupervised representation learning models , mainly autoencoders ( Ballé et al. , 2018 ; 2016 ; Baldi , 2012 ) , impose a type of parsimony on the representation . To understand properties of these representations of interest , here we consider distance measurements between the representations of pairs of stimuli . Such distance measurements can be thought of as perceptual distances , which are rooted in psychophysics : a good perceptual distance mimics the human rating of similarity between the two stimuli with high accuracy . Traditionally , perceptual distances have been hand-designed models with few adjustable parameters , inspired by the physiology or observations in visual psychology , as the Multi-Scale Structural SIMilarity index ( MS-SSIM ) ( Wang et al. , 2003 ) . More recently , it has become common to use an explicit image representation and ’ induce ’ a distance from it . For instance , comparing the internal representations of models trained for image classification for pairs of stimuli has been used for perceptual judgments and was shown to correlate well with human opinions ( Zhang et al. , 2018 ; Ding et al. , 2020 ) . This is also true for unsupervised representations that focus on learning features of natural scenes which are information efficient . For example , in the normalized Laplacian pyramid distance ( NLPD ) ( Laparra et al. , 2016 ) , the representation is learned based on redundancy reduction in neighboring pixels . The Perceptual Information Metric ( PIM ) ( Bhardwaj et al. , 2020 ) uses a contrastive representation learning technique based on compression and slowness . With regards to training autoencoders , a particular type of model that can be used to unsupervisedly learn an explicit representation , here we examine three distinct types of induced distances : the reconstruction distance Dr , the inner distance Din and the self-distance Ds . These distances correspond to different representations learned by the autoencoder ( see Fig . 1 ) . While the connection between the biological response and image probability has been examined before ( Laughlin , 1981 ; Twer & MacLeod , 2001 ; Malo & Gutiérrez , 2006 ; Malo & Laparra , 2010 ; Laparra et al. , 2012 ; Laparra & Malo , 2015 ; Hyvärinen et al. , 2009 ) , the relation between perceptual distances , unsupervised image representations , and the statistics of natural images has not been studied in depth . The current understanding is simply that distances induced by representations relevant for image classification or compression are useful for perceptual judgments . We show that the relation is deeper than that , linking it to image statistics . Furthermore , we examine the unexpected effects of utilizing perceptual distances in the loss functions of autoencoders , which is a common approach in designing neural image compression methods ( Ballé et al. , 2018 ) . One would expect that using a perceptual distance that is closely related to the internal image representation of the brain would give rise to a representation inside the model that is much more closely tied to humans , but that does not seem to be the case . This is surprising given the limited ability of Euclidean distances like Mean Squared Error ( MSE ) to reproduce human opinion ( Girod , 1993 ; Wang & Bovik , 2009 ) , compared to successful perceptual distances . We argue that this is because of a double counting effect where the distribution of natural images is taken into account twice in the training of the autoencoder ; once in the training data and again in the perceptual distance , leading to an over-stressing of high density regions in the data . Conversely , where data is sparse or contains non-representative samples , this effect can result in regularization by discounting losses from outliers . Our specific contributions are : 1 We demonstrate that good perceptual distances , i.e . distances that are good at predicting human psychophysical responses , are also correlated with image likelihoods obtained using a recent probabilistic image model ( PixelCNN++ ( Salimans et al. , 2017 ) ) . This underlines indirectly the idea that part of the biology is informed by efficient representation , as conjectured by Barlow . 2 The distances induced by autoencoders trained to minimize an Euclidean loss are correlated with the probability of the training data . Moreover , when autoencoders are trained using natural images , these induced distances are highly correlated with human perception . 3 Using a perceptual distance instead of a Euclidean loss in the optimization of autoencoders implies taking into account the data distribution twice : one in the perceptual distance and another through the empirical risk minimization procedure . We call this the double counting effect . This effect may explain the limited improvements obtained when using perceptual distances in some machine learning applications . We find that perceptual distances lead to models that over-stress high density regions . We emphasize this by showing that image autoencoders can be trained without image data ( just using uniform random noise as input ) if a proper perceptual distance is used . 2 ON THE RELATION BETWEEN PERCEPTUAL DISTANCE AND IMAGE PROBABILITY . The broadest formulation of the classical efficient coding hypothesis in neuroscience ( Barlow , 1961 ) states that the organization of the sensory system can be explained by the regularities of the natural signals ( Barlow , 2001 ) . This hypothesis has inspired statistical derivations of the nonlinear response of biological vision based on equalization : maximization of channel capacity ( Laughlin , 1981 ) and error minimization under noise ( Twer & MacLeod , 2001 ) are one-dimensional equalization techniques that directly relate signal probability , ppxq , with the response of the system to the visual input , y “ Spxq , where S is the given system . These univariate equalization techniques have been generalized to multivariate scenarios to explain the nonlinearities of the biological responses to spatial texture ( Malo & Gutiérrez , 2006 ) , color ( Laparra et al. , 2012 ) , and motion ( Laparra & Malo , 2015 ) . Interestingly , biological networks optimized to reproduce subjective image distortion display statistical properties despite using no statistical information in fitting their parameters . Divisive normalization obtained from perceptual distances substantially reduces the redundancy in natural images ( Malo & Laparra , 2010 ) , and captures a large fraction of the available information in the input ( Malo , 2020 ) . A similar factorization is obtained in Wilson-Cowan networks fitted to reproduce subjective distortions ( Gomez-Villa et al. , 2020a ) . Here the perceptual distance between an image x1 and its distorted version , x2 , will be referred to as Dppx1 , x2q and is computed in the response representation y . For small distortions ( i.e . x1 close to x2 ) , equalization models imply that there is an explicit relation between the perceptual distance , Dppx1 , x2q , and the probability of the original image according to the distribution of natural images , ppx1q ( see Appendix A ) : Dppx1 , x2q ||x2 ´ x1||2 “ Dppx1 , x2q ? m RMSE « ppxqγ ( 1 ) where γ ą 0 , and the Euclidean length ||x2 ´ x1||2 is just the Root Mean Squared Error ( RMSE ) scaled by the dimensionality of the data m. As we are interested in correlations , ignoring the scaling term , this relation leads to the first observation that we check experimentally in this work : Observation 1 The perceptual quantity Dppx1 , x2qRMSEpx1 , x2q is correlated with ppx1q for small distortions ( i.e . when ||x1 ´ x2||2 ă δ for small δ ) . This quantity is related to the sensitivity of the perceptual distance to displacements in the signal domain , BDpBx . In fact , the ( n-dimensional ) gradient reduces to Dp RMSE in the 1-d case ( Appendix A.1 ) . The observation states that the perceptual distance is more sensitive in high probability regions . This observation is experimentally illustrated in Appendix A.2 , that shows a strong connection between the sensitivity of perceptual distances ( either NLPD or MS-SSIM ) and the distribution of natural images , as opposed to the sensitivity of Euclidean RMSE , which is not related to the data . 3 ON THE RELATION BETWEEN DISTANCES INDUCED BY AUTOENCODERS AND PROBABILITY . In section 2 we showed the relation between perceptual distances and the distribution of natural images , and here we connect the distance induced by a statistical model and the probability of the data used to train it . We first discuss our observations , followed by describing the experimental setup . Statistical learning is based on risk minimization which connects the model , the loss to minimize and the distribution of the data . As a result , the trained model captures the statistics of the data . In this section we elaborate on this connection by computing Euclidean distances in the representations induced by the learned model . Here we focus on autoencoders , although the considerations apply to other statistical learning settings . We will consider the three different options to define the induced distances by an autoencoder shown in Fig . 1 . We will refer to them as self-reconstruction distance Ds “ ||x´ x̂||2 , reconstruction distance Dr “ ||x̂1 ´ x̂2||2 , and inner distance Din “ ||y1 ´ y2||2 . The autoencoder model will be denoted as f , which is consists of an encoder ep¨q and a decoder dp¨q , f “ d ˝ e. The reconstructed data is , x̂ “ fpxq , and y is the data in the inner domain , y “ epxq . We will explicitly show how all these three distances depend in different ways on the probability of the input data . Given samples x from a distribution ppxq a generic autoencoder minimizes this risk : R “ ExrLpfpxq , xqs “ ż Lpfpxq , xqdP pxq “ ż ppxq ¨ Lpx̂ , xqdx ( 2 ) where Exr¨s stands for expectation over variable x L is a loss between the input x and the reconstruction fpxq “ x̂ . Since ppxq is unknown and often intractable , the risk is approximated using the empirical risk minimization principle ( Devroye et al. , 1996 ; Vapnik , 1999 ) : Remp “ 1n řn i “ 1 Lpfpxiq , xiq , where the xi are samples from the training dataset of size n. Although it is well known , it is important for the reasoning of this work to stress that , the function fpxq that minimizes the empirical risk Remp is not the same function that would minimize the loss function L uniformly over all space . For example , if we choose L “ ||xi ´ fpxiq||2 , minimizing Remp is not minimizing the RMSE , but the RMSE weighted by the probability of samples , Eq . 2 . Therefore , the distance an autoencoder induces will be different to the loss function used for training . Once the model , fpxq , is trained , it inherits some properties of the data distribution , ppxq . This implies that the model ’ s behavior depends on the probability of the region of the input space where it is applied . In what follows , we make some observations on the relation between the distances Ds , Dr , and Din and the distribution ppxq . We assume that L is the Euclidean distance ( or RMSE ) , but similar arguments qualitatively apply to distances monotonically related to RMSE . Observation 2 The self-reconstruction distance in an autoencoder is correlated to the inverse of the probability : Ds “ ||x´ x̂||29 1ppxq . The difference between the original and the reconstructed data point in denoising and contractive autoencoders has been related with score matching : x ´ x̂ “ BlogpppxqqBx ( Vincent , 2011 ; Alain & Bengio , 2014 ) . This expression can be formulated using the distribution of the noisy data instead ( Miyasawa , 1961 ; Raphan & Simoncelli , 2011 ) . Here we argue that for a family of distributions the modulus of the difference ( ||x ´ x̂||2 ) can be related with the distribution itself ( Obs . 2 ) . This is true for Gaussian distribution , and a good proxy in general for unimodal distributions as the ones proposed to describe the distribution of natural images ( Portilla et al. , 2003 ; Hyvärinen et al. , 2009 ; Lyu & Simoncelli , 2009 ; Malo & Laparra , 2010 ; Lyu , 2011 ; van den Oord & Schrauwen , 2014 ; Ballé et al. , 2016 ) ( see details in Appendix B ) . Our intuition comes from Eq . 2 that enforces small reconstruction errors in high probability regions , i.e . when ppxq is high , ||x´ fpxq||2 should be low . This implies a dependency for the allowed error ( variance of the error ) on the probability : V arxp||x´fpxq||2q9 1ppxq , where V arx is computed around the point x . This is the idea behind the use of autoencoders for anomaly detection . An autoencoder trained for data coming from a particular distribution ppxq , obtains high self-reconstruction error when it is evaluated on data from a different distribution . Analogous to the distance used in Observation 1 , we argue that the quantity DrRMSE is correlated with the probability . The rationale is that if fp.q was trained to minimize the average distortion introduced in the reconstruction , then Dr has to be more sensitive in high density regions . Observation 3 The sensitivity of the reconstruction distance induced by an autoencoder in x1 , Dr RMSE “ ||fpx1q´fpx2q||2 ||x1´x2||2 , is correlated with ppx1q when ||x1 ´ x2||2 ă δ for small δ . While the autoencoder aims to reconstruct the original data , there are some restrictions which make the learned transformation different from the identity . This transformation is going to put more resources in regions where training data is more likely . This enforces a relation between the sensitivity ( derivative ) of the model and the probability distribution , i.e . | BfBx pxq| M ppxq ( see an example in Appendix C ) . Our hypothesis is that this relation should be positively ( possibly nonlinearly ) correlated . In particular we will be reasoning in the direction of using ppx1q||x1 ´ x2||2 as a proxy for the induced reconstruction distance Dr when x1 and x2 are close . While the distance in the inner domain , Din “ ||y1 ´ y2||2 , is highly used ( Ding et al. , 2020 ; Zhang et al. , 2018 ; Gatys et al. , 2016 ) , it is the most difficult to interpret . The main problem is to decide which representation inside the model to use . For autoencoders , the inner representation is usually selected as the layer with the least dimensions , although it is arbitrary what is defined as the inner representation . In compression autoencoders one has two suitable candidate representations , before or after the quantisation step . Both have different interesting properties , however in either cases the sensitivity conjecture also makes qualitative sense for Din . Observation 4 The sensitivity of the distance induced by a compression autoencoder in the inner domain at point x1 , DinRMSE “ ||epx1q´epx2q||2 ||x1´x2||2 , correlates with ppx1q when ||x1 ´ x2||2ăδ for small δ . This observation has a strong connection with density estimation , independent component analysis and data equalization . The density target under a transformation is ppxq “ ppepxqq| BeBx pxq| . If one wants to describe p ( x ) , a suitable target distribution for the transform domain is the uniform distribution . Therefore , if one assumes ppepxqq constant , the determinant of the Jacobian of the transformation is equal to the probability distribution as assumed in the equalization model ( Observation 1 ) , and similarly , one would have ||epxq´epx ` ∆xq||2||x´x ` ∆x||2 « ppxq . A similar result can be obtained modeling the noise in the inner domain ( Berardino et al. , 2017 ) . Note this observation has parallelisms with the procedure that the human visual system has to do in order to process the natural images as stated in Sec . 2 . Experiment . Here we explore the relation of the previously defined distances with the probability distribution of the training data using a compression autoencoder in a toy 2D example . Compression using autoencoders is presented as follows ( Ballé et al. , 2018 ; 2016 ) ; an input x is transformed using the encoder , or analysis transform , epxq to an encoding y. Scalar quantisation is then applied to y to create a vector of integer indices q and a reconstruction ŷ . The quantisation is approximated during training with additive uniform noise ỹ “ y ` ∆y to get a continuous gradient . It is then transformed back into the image domain using the decoder dpŷq to create the reconstructed image x̂ . Given x , the aim is to find a quantised representation q that minimizes the approximated entropy , or rate R “ Hrppỹqs , estimated by a density model p , whilst also minimizing the distortion loss , D , usually weighted by a Lagrange multiplier in order to achieve different compression rates . Thus the loss function L “ R ` λD becomes L “ Exr´ log2 ppepxq ` ∆yqs ` λDpx , dpepxq ` ∆yqq . ( 3 ) In order to have explicit access to the data distribution , a 2D Student-t distribution is used with one dimension having high variance and the other low variance . The Student-t distribution is a reasonable approximation for the distribution of natural images ( van den Oord & Schrauwen , 2014 ) . A 2 layer MLP is used for e and d. For full experimental setup see Appendix C. The induced distances are calculated for a set of samples taken from the Student-t distribution . Fig . 2 shows that these induced distances are correlated with the probability ppx1q . The three observations hold for intermediate regimes , low rate gets bad reconstruction while high rate gets almost no compression . Observation 2 ( Ds ) holds at low and medium rates where the Spearman correlation is -0.68 to -0.4 , but starts to fail at 4.67bpp ( bits-per-pixel ) where correlation approaches -0.18 . The same occurs for Observation 3 ( Dr ) where at high entropy the correlation decreases slightly from 0.49 at 2.03bpp to 0.31 at 4.67bpp . Observation 4 ( Din ) holds over all rates but especially at high rates where the largest correlation of 0.90 is found . These results indicate that the learned representations inside an autoencoder correlate with the training distribution . Although we test at a wide range of rates , if the entropy is very restricted , f “ d ¨ e has no capacity and in the limit may even be a constant function . However , this is a very extreme case and , in practice , an autoencoder like this would never be used .
This paper presents a mainly theoretical explication of the relationship between natural image statistics and perceptual distances for small image distortions. The paper presents a number of observations linking distances in natural images, autoencoders, and perceptual similarity for humans. The paper finally explores some implications of these observations, including impressive-seeming results on training with no data using perceptual distances as regularizers.
SP:c686503ec773532c596fdf2b90a6bcc4db9044d3
On the Optimal Memorization Power of ReLU Neural Networks
( √ N ) parameters . Known VC-dimension upper bounds imply that memorizing N samples requires Ω ( √ N ) parameters , and hence our construction is optimal up to logarithmic factors . We also give a generalized construction for networks with depth bounded by 1 ≤ L ≤ √ N , for memorizing N samples using Õ ( N/L ) parameters . This bound is also optimal up to logarithmic factors . Our construction uses weights with large bit complexity . We prove that having such a large bit complexity is both necessary and sufficient for memorization with a sub-linear number of parameters . 1 INTRODUCTION . The expressive power of neural networks has been widely studied in many previous works . These works study different aspects of expressiveness , such as the universal approximation property ( Cybenko , 1989 ; Leshno et al. , 1993 ) , and the benefits of depth in neural networks ( Telgarsky , 2016 ; Eldan and Shamir , 2016 ; Safran and Shamir , 2017 ; Daniely , 2017 ; Chatziafratis et al. , 2019 ) . Another central and well studied question is about their memorization power . The problem of memorization in neural networks can be viewed in the following way : For every dataset of N labeled samples ( x1 , y1 ) , . . . , ( xN , yN ) ∈ X × Y , construct a network N : X → Y such that N ( xi ) = yi for every i = 1 , . . . , N . Many works have shown results regarding the memorization power of neural networks , using different assumptions on the activation function and data samples ( see e.g . Huang and Babri ( 1998 ) ; Huang ( 2003 ) ; Baum ( 1988 ) ; Vershynin ( 2020 ) ; Daniely ( 2019 ; 2020 ) ; Bubeck et al . ( 2020 ) ; Park et al . ( 2020 ) ; Hardt and Ma ( 2016 ) ; Yun et al . ( 2019 ) ; Zhang et al . ( 2021 ) ; Nguyen and Hein ( 2018 ) ; Rajput et al . ( 2021 ) ; Sontag ( 1997 ) ) . The question of memorization also have practical implications on phenomenons such as ” double descent ” ( Belkin et al . ( 2019 ) ; Nakkiran et al . ( 2019 ) ) which connects the memorization power of neural networks with their generalization capabilities . A trivial lower bound on the required size of the network for memorizingN labeled points is implied by the VC dimension of the network ( cf . Shalev-Shwartz and Ben-David ( 2014 ) ) . That is , if a network with a certain size can not shatter any specific set of N points , then it certainly can not memorize all sets of N points . Known VC dimension bounds for networks with W parameters is on the order ofO ( W 2 ) ( Goldberg and Jerrum ( 1995 ) ; Bartlett et al . ( 1998 ; 2019 ) ) . Hence , it follows that memorizing N samples would require at least Ω ( N1/2 ) parameters . The best known upper bound is given in Park et al . ( 2020 ) , where it is shown that memorizing N data samples can be done using a neural network with O ( N2/3 ) parameters . Thus , there is a clear gap between the lower and upper bounds , although we note that the upper bound is for memorization of any set of data samples , while the lower bound is for shattering a single set of data samples . In this paper we ask the following questions : What is the minimal number of parameters that are required to memorize N labeled data samples ? Is the task of memorizing any set of N data samples more difficult than shattering a single set of N samples ? We answer these questions by providing a construction of a ReLU feedforward neural network which achieves the lower bound up to logarithmic factors . In this construction we use a very deep neural network , but with a constant width of 12 . In more details , our main result is the following : Theorem 1.1 ( informal statement ) . Let ( x1 , y1 ) , . . . , ( xN , yN ) ∈ Rd × { 1 , . . . , C } be a set of N labeled samples of a constant dimension d , with ‖xi‖ ≤ r for every i and ‖xi − xj‖ ≥ δ for every i 6= j . Then , there exists a ReLU neural network F : Rd → R with width 12 , depth Õ ( √ N ) , and Õ ( √ N ) parameters , such that F ( xi ) = yi for every i ∈ [ N ] , where the notation Õ ( · ) hides logarithmic factors in N , C , r , δ−1 . Comparing this result to the known VC bounds , we show that , up to logarithmic factors , our construction is optimal . This also shows , quite surprisingly , that up to logarithmic factors , the task of shattering a single set of N points is not more difficult than memorizing any set of N points , under the mild separability assumption of the data samples . We note that this result can also be extended to regression tasks ( see Remark 3.3 ) . In our construction , the depth of the network is Θ̃ ( √ N ) . We also give a generalized construction where the depth of the network is limited to some 1 ≤ L ≤ √ N . In his case , the number of param- eters in our construction is Õ ( N L ) ( see Theorem 5.1 ) . We compare this result to the VC-dimension bound from Bartlett et al . ( 2019 ) , and show that our construction is optimal up to logarithmic factors . Our construction uses a bit extraction technique , inspired by Telgarsky ’ s triangle function ( Telgarsky ( 2016 ) ) , and by Safran and Shamir ( 2017 ) . Using this technique , we are able to use weights with bit complexity Θ̃ ( √ N ) , and deep neural networks to “ extract ” the bits of information from the specially crafted weights of the network . We also generalize our results to the case of having a bounded bit complexity restriction on the weights . We show both lower ( Theorem 6.1 ) and upper ( Theorem 6.2 ) bounds , proving that memorizing N points using a network with N1− parameters , for some ∈ [ 0 , 0.5 ] can be done if the bit complexity of each weight is Θ̃ ( N ) . Hence , our construction is also optimal , up to logarithmic factors , w.r.t the bit complexity of the network . We emphasize that also in previous works showing non-trivial VC bounds ( e.g . Bartlett et al . ( 1998 ; 2019 ) ) weights with large bit complexity are used . We note that increasing the bit complexity beyond N1/2 can not be used to further reduce the number of parameters ( see the discussion in section 4 ) . RELATED WORK . MEMORIZATION – UPPER BOUNDS . The problem of memorizing arbitrary data points with neural networks has a rich history . Baum ( 1988 ) studied memorization in single-hidden-layer neural networks with the threshold activation , and showed that dNd e neurons suffice to memorize N arbitrary points in general position in R d with binary labels . Bubeck et al . ( 2020 ) extended the construction of Baum ( 1988 ) and showed that single-hidden-layer ReLU networks with 4 · dNd e hidden neurons can memorize N points in general position with arbitrary real labels . In Huang et al . ( 1991 ) and Sartori and Antsaklis ( 1991 ) it is shown that single-hidden-layer networks with the threshold activation can memorize any arbitrary set of N points , even if they are not in general position , using N − 1 neurons . Huang and Babri ( 1998 ) proved a similar result for any bounded non-linear activation function σ where either limz→∞ σ ( z ) or limz→−∞ σ ( z ) exists . Zhang et al . ( 2021 ) proved that single-hidden-layer ReLU networks can memorize arbitraryN points in Rd with arbitrary real labels usingN neurons and 2N+d parameters . Huang ( 2003 ) showed that two-hidden-layers networks with the sigmoid activation can memorize N points with O ( √ N ) neurons , but the number of parameters is still linear in N . Yun et al . ( 2019 ) proved a similar result for ReLU ( and hard-tanh ) networks . Vershynin ( 2020 ) showed that threshold and ReLU networks can memorize N binary-labeled unit vectors in Rd separated by a distance of δ > 0 , using Õ ( e1/δ 2 + √ N ) neurons and Õ ( e1/δ 2 ( d+ √ N ) +N ) parameters . Rajput et al . ( 2021 ) improved the dependence on δ by giving a construction with Õ ( 1 δ + √ N ) neurons and Õ ( d δ +N ) parameters . This result holds only for threshold networks , but does not assume that the inputs are on the unit sphere . The memorization power of more specific architectures was also studied . Hardt and Ma ( 2016 ) proved that residual ReLU networks with O ( N ) neurons can memorize N points on the unit sphere separated by a constant distance . Nguyen and Hein ( 2018 ) considered convolutional neural networks and showed , under certain assumptions , memorization using O ( N ) neurons . Note that in all the results mentioned above the number of parameters is at least linear in N . Our work is inspired by Park et al . ( 2020 ) , that established a first memorization result with a sub-linear number of parameters . They showed that neural networks with sigmoidal or ReLU activations can memorize N points in Rd separated by a normalized distance of δ , using O ( N2/3 + log ( 1/δ ) ) parameters ( where the dimension d is constant ) . Thus , in this work we improve the dependence on N from N2/3 to √ N ( up to logarithmic factors ) , which is optimal . We also note that the first stage in our construction is similar to the first stage in theirs . Finally , optimization aspects of memorization were studied in Bubeck et al . ( 2020 ) ; Daniely ( 2019 ; 2020 ) . MEMORIZATION – LOWER BOUNDS . An Ω ( N ) lower bound on the number of parameters required for memorizing arbitrary N points using neural networks with standard activations ( e.g. , threshold , sigmoid and ReLU ) is given in Sontag ( 1997 ) . Thus , for networks with o ( N ) parameters , there is a set of size N that can not be shattered . It implies that in order to obtain memorization with a sub-linear number of parameters some assumptions are required . Our positive result circumvents this lower bound by assuming that the data is separated . Moreover , lower bounds on the number of parameters required for memorization are implied by bounds on the VC dimension of neural networks . Indeed , if W parameters are not sufficient for shattering even a single set of size N , then they are clearly not sufficient for memorizing all sets of size N . The VC dimension of neural networks has been extensively studied in recent decades ( cf . Anthony and Bartlett ( 2009 ) ; Bartlett et al . ( 2019 ) ) . The most relevant results for our work are by Goldberg and Jerrum ( 1995 ) and Bartlett et al . ( 2019 ) . We discuss these results and their implications in Sections 4 and 5 . Trade-offs between the number of parameters of the network and the Lipschitz parameter of the prediction function in memorizing a given dataset are studies in Bubeck et al . ( 2021 ) ; Bubeck and Sellke ( 2021 ) .
This paper studies memorization capacity of deep ReLU networks. For arbitrary $N$ data points in a ball of size $r$ satisfying minimum separation $\delta$, the authors show that there exists a ReLU network of constant width and depth $\tilde O(\sqrt{N})$ that perfectly memorizes the entire dataset (Theorem 3.1). This means that memorizing arbitrary $N$ data points can be done using only $\tilde O(\sqrt{N})$ parameters, when depth increases with $N$. Combined with a classical upper bound on VC dimension (Goldberg and Jerrum (1995)), the construction is optimal up to log factors. Theorem 3.1 is extended to the case of fixed depth $L \leq \sqrt{N}$ (Theorem 5.1) and fixed bit complexity per parameter (Theorem 6.2), and these additional results are also optimal modulo log factors.
SP:8be64c1f03d32e6be9088572692563996ab09713
On the Optimal Memorization Power of ReLU Neural Networks
( √ N ) parameters . Known VC-dimension upper bounds imply that memorizing N samples requires Ω ( √ N ) parameters , and hence our construction is optimal up to logarithmic factors . We also give a generalized construction for networks with depth bounded by 1 ≤ L ≤ √ N , for memorizing N samples using Õ ( N/L ) parameters . This bound is also optimal up to logarithmic factors . Our construction uses weights with large bit complexity . We prove that having such a large bit complexity is both necessary and sufficient for memorization with a sub-linear number of parameters . 1 INTRODUCTION . The expressive power of neural networks has been widely studied in many previous works . These works study different aspects of expressiveness , such as the universal approximation property ( Cybenko , 1989 ; Leshno et al. , 1993 ) , and the benefits of depth in neural networks ( Telgarsky , 2016 ; Eldan and Shamir , 2016 ; Safran and Shamir , 2017 ; Daniely , 2017 ; Chatziafratis et al. , 2019 ) . Another central and well studied question is about their memorization power . The problem of memorization in neural networks can be viewed in the following way : For every dataset of N labeled samples ( x1 , y1 ) , . . . , ( xN , yN ) ∈ X × Y , construct a network N : X → Y such that N ( xi ) = yi for every i = 1 , . . . , N . Many works have shown results regarding the memorization power of neural networks , using different assumptions on the activation function and data samples ( see e.g . Huang and Babri ( 1998 ) ; Huang ( 2003 ) ; Baum ( 1988 ) ; Vershynin ( 2020 ) ; Daniely ( 2019 ; 2020 ) ; Bubeck et al . ( 2020 ) ; Park et al . ( 2020 ) ; Hardt and Ma ( 2016 ) ; Yun et al . ( 2019 ) ; Zhang et al . ( 2021 ) ; Nguyen and Hein ( 2018 ) ; Rajput et al . ( 2021 ) ; Sontag ( 1997 ) ) . The question of memorization also have practical implications on phenomenons such as ” double descent ” ( Belkin et al . ( 2019 ) ; Nakkiran et al . ( 2019 ) ) which connects the memorization power of neural networks with their generalization capabilities . A trivial lower bound on the required size of the network for memorizingN labeled points is implied by the VC dimension of the network ( cf . Shalev-Shwartz and Ben-David ( 2014 ) ) . That is , if a network with a certain size can not shatter any specific set of N points , then it certainly can not memorize all sets of N points . Known VC dimension bounds for networks with W parameters is on the order ofO ( W 2 ) ( Goldberg and Jerrum ( 1995 ) ; Bartlett et al . ( 1998 ; 2019 ) ) . Hence , it follows that memorizing N samples would require at least Ω ( N1/2 ) parameters . The best known upper bound is given in Park et al . ( 2020 ) , where it is shown that memorizing N data samples can be done using a neural network with O ( N2/3 ) parameters . Thus , there is a clear gap between the lower and upper bounds , although we note that the upper bound is for memorization of any set of data samples , while the lower bound is for shattering a single set of data samples . In this paper we ask the following questions : What is the minimal number of parameters that are required to memorize N labeled data samples ? Is the task of memorizing any set of N data samples more difficult than shattering a single set of N samples ? We answer these questions by providing a construction of a ReLU feedforward neural network which achieves the lower bound up to logarithmic factors . In this construction we use a very deep neural network , but with a constant width of 12 . In more details , our main result is the following : Theorem 1.1 ( informal statement ) . Let ( x1 , y1 ) , . . . , ( xN , yN ) ∈ Rd × { 1 , . . . , C } be a set of N labeled samples of a constant dimension d , with ‖xi‖ ≤ r for every i and ‖xi − xj‖ ≥ δ for every i 6= j . Then , there exists a ReLU neural network F : Rd → R with width 12 , depth Õ ( √ N ) , and Õ ( √ N ) parameters , such that F ( xi ) = yi for every i ∈ [ N ] , where the notation Õ ( · ) hides logarithmic factors in N , C , r , δ−1 . Comparing this result to the known VC bounds , we show that , up to logarithmic factors , our construction is optimal . This also shows , quite surprisingly , that up to logarithmic factors , the task of shattering a single set of N points is not more difficult than memorizing any set of N points , under the mild separability assumption of the data samples . We note that this result can also be extended to regression tasks ( see Remark 3.3 ) . In our construction , the depth of the network is Θ̃ ( √ N ) . We also give a generalized construction where the depth of the network is limited to some 1 ≤ L ≤ √ N . In his case , the number of param- eters in our construction is Õ ( N L ) ( see Theorem 5.1 ) . We compare this result to the VC-dimension bound from Bartlett et al . ( 2019 ) , and show that our construction is optimal up to logarithmic factors . Our construction uses a bit extraction technique , inspired by Telgarsky ’ s triangle function ( Telgarsky ( 2016 ) ) , and by Safran and Shamir ( 2017 ) . Using this technique , we are able to use weights with bit complexity Θ̃ ( √ N ) , and deep neural networks to “ extract ” the bits of information from the specially crafted weights of the network . We also generalize our results to the case of having a bounded bit complexity restriction on the weights . We show both lower ( Theorem 6.1 ) and upper ( Theorem 6.2 ) bounds , proving that memorizing N points using a network with N1− parameters , for some ∈ [ 0 , 0.5 ] can be done if the bit complexity of each weight is Θ̃ ( N ) . Hence , our construction is also optimal , up to logarithmic factors , w.r.t the bit complexity of the network . We emphasize that also in previous works showing non-trivial VC bounds ( e.g . Bartlett et al . ( 1998 ; 2019 ) ) weights with large bit complexity are used . We note that increasing the bit complexity beyond N1/2 can not be used to further reduce the number of parameters ( see the discussion in section 4 ) . RELATED WORK . MEMORIZATION – UPPER BOUNDS . The problem of memorizing arbitrary data points with neural networks has a rich history . Baum ( 1988 ) studied memorization in single-hidden-layer neural networks with the threshold activation , and showed that dNd e neurons suffice to memorize N arbitrary points in general position in R d with binary labels . Bubeck et al . ( 2020 ) extended the construction of Baum ( 1988 ) and showed that single-hidden-layer ReLU networks with 4 · dNd e hidden neurons can memorize N points in general position with arbitrary real labels . In Huang et al . ( 1991 ) and Sartori and Antsaklis ( 1991 ) it is shown that single-hidden-layer networks with the threshold activation can memorize any arbitrary set of N points , even if they are not in general position , using N − 1 neurons . Huang and Babri ( 1998 ) proved a similar result for any bounded non-linear activation function σ where either limz→∞ σ ( z ) or limz→−∞ σ ( z ) exists . Zhang et al . ( 2021 ) proved that single-hidden-layer ReLU networks can memorize arbitraryN points in Rd with arbitrary real labels usingN neurons and 2N+d parameters . Huang ( 2003 ) showed that two-hidden-layers networks with the sigmoid activation can memorize N points with O ( √ N ) neurons , but the number of parameters is still linear in N . Yun et al . ( 2019 ) proved a similar result for ReLU ( and hard-tanh ) networks . Vershynin ( 2020 ) showed that threshold and ReLU networks can memorize N binary-labeled unit vectors in Rd separated by a distance of δ > 0 , using Õ ( e1/δ 2 + √ N ) neurons and Õ ( e1/δ 2 ( d+ √ N ) +N ) parameters . Rajput et al . ( 2021 ) improved the dependence on δ by giving a construction with Õ ( 1 δ + √ N ) neurons and Õ ( d δ +N ) parameters . This result holds only for threshold networks , but does not assume that the inputs are on the unit sphere . The memorization power of more specific architectures was also studied . Hardt and Ma ( 2016 ) proved that residual ReLU networks with O ( N ) neurons can memorize N points on the unit sphere separated by a constant distance . Nguyen and Hein ( 2018 ) considered convolutional neural networks and showed , under certain assumptions , memorization using O ( N ) neurons . Note that in all the results mentioned above the number of parameters is at least linear in N . Our work is inspired by Park et al . ( 2020 ) , that established a first memorization result with a sub-linear number of parameters . They showed that neural networks with sigmoidal or ReLU activations can memorize N points in Rd separated by a normalized distance of δ , using O ( N2/3 + log ( 1/δ ) ) parameters ( where the dimension d is constant ) . Thus , in this work we improve the dependence on N from N2/3 to √ N ( up to logarithmic factors ) , which is optimal . We also note that the first stage in our construction is similar to the first stage in theirs . Finally , optimization aspects of memorization were studied in Bubeck et al . ( 2020 ) ; Daniely ( 2019 ; 2020 ) . MEMORIZATION – LOWER BOUNDS . An Ω ( N ) lower bound on the number of parameters required for memorizing arbitrary N points using neural networks with standard activations ( e.g. , threshold , sigmoid and ReLU ) is given in Sontag ( 1997 ) . Thus , for networks with o ( N ) parameters , there is a set of size N that can not be shattered . It implies that in order to obtain memorization with a sub-linear number of parameters some assumptions are required . Our positive result circumvents this lower bound by assuming that the data is separated . Moreover , lower bounds on the number of parameters required for memorization are implied by bounds on the VC dimension of neural networks . Indeed , if W parameters are not sufficient for shattering even a single set of size N , then they are clearly not sufficient for memorizing all sets of size N . The VC dimension of neural networks has been extensively studied in recent decades ( cf . Anthony and Bartlett ( 2009 ) ; Bartlett et al . ( 2019 ) ) . The most relevant results for our work are by Goldberg and Jerrum ( 1995 ) and Bartlett et al . ( 2019 ) . We discuss these results and their implications in Sections 4 and 5 . Trade-offs between the number of parameters of the network and the Lipschitz parameter of the prediction function in memorizing a given dataset are studies in Bubeck et al . ( 2021 ) ; Bubeck and Sellke ( 2021 ) .
The paper shows that, under a mild separability condition, the number of connections in a ReLU network required to memorize N data points is of order $\sqrt{N}$ (up to logarithmic factors). This result improves upon the recent work of Park et al. (2021), and matches the previous lower bound. One key proof-technical innovation is pairing _both the input and label informations_ for each partition and encoding them at stage 2, whereas the previous approach focused on the input only. Authors also refine the framework to incorporate the bit-precision constraints, based on which Telgarsky's bit extraction technique can be used.
SP:8be64c1f03d32e6be9088572692563996ab09713
Model-based Reinforcement Learning with a Hamiltonian Canonical ODE Network
Model-based reinforcement learning usually suffers from a high sample complexity in training the world model , especially for the environments with complex dynamics . To make the training for general physical environments more efficient , we introduce Hamiltonian canonical ordinary differential equations into the learning process , which inspires a novel model of neural ordinary differential auto-encoder ( NODA ) . NODA can model the physical world by nature and is flexible to impose Hamiltonian mechanics ( e.g. , the dimension of the physical equations ) which can further accelerate training of the environment models . It can consequentially empower an RL agent with the robust extrapolation using a small amount of samples as well as the guarantee on the physical plausibility . Theoretically , we prove that NODA has uniform bounds for multi-step transition errors and value errors under certain conditions . Extensive experiments show that NODA can learn the environment dynamics effectively with a high sample efficiency , making it possible to facilitate reinforcement learning agents at the early stage . 1 INTRODUCTION . Reinforcement learning has obtained substantial progress in both theoretical foundations ( Asadi et al. , 2018 ; Jiang , 2018 ) and empirical applications ( Mnih et al. , 2013 ; 2015 ; Peters & Schaal , 2006 ; Johannink et al. , 2019 ) . In particular , model-free reinforcement learning ( MFRL ) can complete complex tasks such as Atari games ( Schrittwieser et al. , 2020 ) and robot control ( Roveda et al. , 2020 ) . However , the MFRL algorithms often need a large amount of interactions with the environment ( Langlois et al. , 2019 ) in order to train an agent , which impedes their further applications . Model-based reinforcement learning ( MBRL ) methods can alleviate this issue by resorting to a model to characterize the environmental dynamics and conduct planning ( van Hasselt et al. , 2019 ; Moerland et al. , 2020a ) . In general , MBRL can quench the thirst of massive amounts of real data that may be costly to acquire , by using rollouts from the model ( Langlois et al. , 2019 ; Deisenroth & Rasmussen , 2011 ) . It has witnessed numerous works on approximating the model with various strategies , such as leastsquares temporal difference ( Boyan , 1999 ) , guided policy search ( GPS ) ( Levine & Abbeel , 2014 ) , dynamic Bayesian networks ( DBN ) ( Hester & Stone , 2012 ) , and deep neural networks ( Fujimoto et al. , 2018 ) . However , the sample efficiency of MBRL can still be limited due to the high sample complexity of learning a world model when the environment is complex . Traditional methods such as the Gaussian Processes based method ( Deisenroth & Rasmussen , 2011 ) can perform well on some problems with high sample efficiency , but they are not easy to scale to high-dimensional problems ( Plaat et al. , 2020 ) . High-capacity models scale well , but they often have low sample efficiency ( Plaat et al. , 2020 ) . The trade-off between scalability and sample complexity remains as a critical issue for model-based RL . To address the aforementioned issue , we propose to introduce physical knowledge to reduce the sample complexity for learning high-dimensional dynamics in physical environments . We focus on reinforcement learning in an environment whose dynamics can be formulated by Hamiltonian canonical equations ( Goldstein et al. , 2002 ) . Up till now , Hamiltonian dynamics have been successfully applied in numerous areas of physics from robotics to industrial automation . Specifically , we formulate the environments dynamics as ordinary differential equations ( ODEs ) , and then use a novel network architecture called Neural Ordinary Differential Auto-encoder ( NODA ) as our world model , which is naturally induced by physical equations . In particular , NODA consists of two parts — an auto-encoder and an ODE network . We use the auto-encoder to get the underlying physical variables , and use the ODE network to learn the dynamics over physical variables . By using NODA , we can enjoy its ability of modeling the physical world as well as its flexibility of combining physical knowledge ( if any ) , such as the dimension of physical variables . Theoretically , we provide uniform bounds for both multi-step transition errors and value errors for NODA by extending the former study of Lipschitz models ( Asadi et al. , 2018 ) to continuous action spaces . It is noted that NODA can be combined with both MFRL methods like SAC ( Haarnoja et al. , 2018 ) and MBRL methods like Dreamer ( Hafner et al. , 2019 ) by facilitating the learning of the world model . Extensive experiments show that we can learn NODA well using a small number of data with an appropriate structure encoded , which can boost the sample efficiency by using imaginary trajectories over the environment models ( Todorov et al. , 2012 ; Schulman et al. , 2015 ) . 2 BACKGROUND . We start by presenting the background knowledge of reinforcement learning , and then explain the relationship between MBRL and Hamiltonian mechanics . 2.1 MODEL-BASED REINFORCEMENT LEARNING . We consider the Markov decision process ( MDP ) model for reinforcement learning . Formally , an MDP is formulated as a tuple 〈S , A , T , R , γ〉 , where S is the state space , A is the action space , T : S ×A → P ( S ) is the transition function , R : S ×A → R is the reward function , and γ ∈ [ 0 , 1 ) is a discount factor . We denote the set P ( · ) as all probability measures on the space in the bracket . Our goal is to find a policy π that can choose an action to maximize the accumulated reward . Here we focus on the challenging tasks with continuous state and action spaces ( i.e. , there are infinite states and actions ) . MBRL aims to learn a policy by integrating planning with the aid of a known or learned model ( Moerland et al. , 2020b ) , and an essential part of MBRL is to learn a transition function that characterizes the environment . The transition function above is defined over a given state , but we can generalize it to represent the transition from a state distribution z ∈ P ( S ) . By calling the generalized transition function recursively , we can get the n-step generalized transition function , which is defined as : Definition 1 ( Transition Functions ) In a metric state space ( S , dS ) and an action spaceA , we can define the generalized transition function of TG ( over state distribution z ) , and the n-step generalized transition function of TnG ( for fixed sequence of actions ) ( Asadi et al. , 2018 ) as TG ( s ′ | s , a ) = ∫ T ( s′ | s , a ) z ( s ) ds TnG ( · | z ) = TG ( · | · · ·TG ( · | z , a0 ) · · · , an−1 ) ︸ ︷︷ ︸ n recursive calls . ( 1 ) Here the generalized transition gives the distribution of outcome under a certain state distribution . For MBRL , it is nontrivial to learn the transition function ( i.e. , the dynamics for a physical environment ) because S can be high-dimensional . Several attempts have been made to learn such dynamics , while they have various limitations . For instance , probabilistic inference for learning control ( PILCO ) ( Deisenroth & Rasmussen , 2011 ) uses Gaussian processes to model the transition function , but the inference part does not scale well to high dimensions ( Langlois et al. , 2019 ) . Stochastic ensemble value expansion ( STEVE ) ( Buckman et al. , 2018 ) and adaptation augmented model-based policy optimization ( AMPO ) ( Shen et al. , 2020 ) use scalable machine learning models , but there is no further discussion on how to learn such a model efficiently . Actually , high-dimensional state and action spaces usually require much more data samples ( Plaat et al. , 2020 ) . Monte Carlo tree search ( MCTS ) ( Silver et al. , 2017 ) can introduce human knowledge of the transition function to enhance learning , but it is restricted to cases where transition functions are totally known . 2.2 HAMILTONIAN MECHANICS . Methods of analytical mechanics have been introduced to predict the evolution of dynamic systems such as pendulums . For example , Lagrangian neural networks ( Lutter et al. , 2019 ; Cranmer et al. , 2020 ) and Hamiltonian neural networks ( Greydanus et al. , 2019 ) can be used to simulate dynamic systems . These papers focus on how to model the Lagrangian or the Hamiltonian . One challenge for such methods is that the equations for the Lagrangian or the Hamiltonian are second-order differential equations , which are difficult to model in a general way . Besides , numerical solutions of second-order differential equations are prone to error accumulation . One natural idea is to reformulate second-order differential equations into first-order ones . Then , we can use an existing neural network ( Chen et al. , 2018 ) to model these equations in the ODE form . In this paper , we concentrate on the Hamiltonian case , for which the first-order representation corresponds to Hamiltonian canonical equations ( Junkins & Schaub , 2009 ) .1 Specifically , in Hamiltonian mechanics , we use pairs of generalized coordinate and generalized momentum ( qk , pk ) to completely describe a dynamic system ( k ∈ { 0 , 1 , · · · , K } ) , where K is the dimension of generalized coordinates.It is noted thatK can be intuitively interpreted as the degree of freedom . We denote pk and qk as canonical states , and they are minimal independent parameters which can describe the state of the system . We define Hamiltonian H : R2K+1 → R as a function of these variables and time t. Then the evolution of the system satisfies Hamiltonian canonical equations ( Junkins & Schaub , 2009 ) : dqk dt = ∂H ∂pk , dpk dt = − ∂H ∂qk +Qk ( t ) , ( 2 ) where k ∈ { 0 , 1 , · · · , K } , andQk ( t ) are the generalized forces which describe the effects of external forces . One advantage of using these equations is that they can describe general dynamic systems . Moreover , it is possible to incorporate prior knowledge into Hamiltonian canonical equations , e.g. , by assuming a specific form of energy ( Sprangers et al. , 2014 ) . In our case , prior knowledge can be available . For example , we may know the dimension K of the generalized coordinate and generalized momentum , which only requires the knowledge of the ’ degree of freedom ’ for a given system but makes a difference in training . Another example is about transfer learning : If we already learn the underlying dynamics , we can combine the learnt dynamics with other modules to transfer the learnt knowledge to a variety of different tasks . We empirically examine the these advantages in the experimental section . 3 METHODOLOGY . We now formally present NODA , which consists of an auto-encoder and an ODE network . NODA aims to serve as a simulator of the real environment ( i.e. , a dynamic system ) by learning the transition function and the reward function . Here we assume that the transition is deterministic , otherwise an SDE network ( Li et al. , 2020 ) can be used instead . Then we can use NODA to assist reinforcement learning by generating imaginary trajectories , as outlined in Algorithm 1 . Besides , we also discuss the prior knowledge that can be incorporated with NODA .
The paper proposes a variant of a Hamiltonian neural network for learning dynamics models for model-based RL. The proposed network architecture uses encoders/decoders to map the system state x = [q, p] from the observations s and vice versa. In the latent state, a standard HNN is used to compute dx/dt to increment the time step. In the experiments, the paper applies this dynamics model to model-based rl and wants to show that this specific dynamics model increases the sample efficiency and leads to greater performance. It is especially noteworthy that the domains include locomotion tasks that include many contacts.
SP:e653f89bc504607362dfa2ba413b0481674f08df
Model-based Reinforcement Learning with a Hamiltonian Canonical ODE Network
Model-based reinforcement learning usually suffers from a high sample complexity in training the world model , especially for the environments with complex dynamics . To make the training for general physical environments more efficient , we introduce Hamiltonian canonical ordinary differential equations into the learning process , which inspires a novel model of neural ordinary differential auto-encoder ( NODA ) . NODA can model the physical world by nature and is flexible to impose Hamiltonian mechanics ( e.g. , the dimension of the physical equations ) which can further accelerate training of the environment models . It can consequentially empower an RL agent with the robust extrapolation using a small amount of samples as well as the guarantee on the physical plausibility . Theoretically , we prove that NODA has uniform bounds for multi-step transition errors and value errors under certain conditions . Extensive experiments show that NODA can learn the environment dynamics effectively with a high sample efficiency , making it possible to facilitate reinforcement learning agents at the early stage . 1 INTRODUCTION . Reinforcement learning has obtained substantial progress in both theoretical foundations ( Asadi et al. , 2018 ; Jiang , 2018 ) and empirical applications ( Mnih et al. , 2013 ; 2015 ; Peters & Schaal , 2006 ; Johannink et al. , 2019 ) . In particular , model-free reinforcement learning ( MFRL ) can complete complex tasks such as Atari games ( Schrittwieser et al. , 2020 ) and robot control ( Roveda et al. , 2020 ) . However , the MFRL algorithms often need a large amount of interactions with the environment ( Langlois et al. , 2019 ) in order to train an agent , which impedes their further applications . Model-based reinforcement learning ( MBRL ) methods can alleviate this issue by resorting to a model to characterize the environmental dynamics and conduct planning ( van Hasselt et al. , 2019 ; Moerland et al. , 2020a ) . In general , MBRL can quench the thirst of massive amounts of real data that may be costly to acquire , by using rollouts from the model ( Langlois et al. , 2019 ; Deisenroth & Rasmussen , 2011 ) . It has witnessed numerous works on approximating the model with various strategies , such as leastsquares temporal difference ( Boyan , 1999 ) , guided policy search ( GPS ) ( Levine & Abbeel , 2014 ) , dynamic Bayesian networks ( DBN ) ( Hester & Stone , 2012 ) , and deep neural networks ( Fujimoto et al. , 2018 ) . However , the sample efficiency of MBRL can still be limited due to the high sample complexity of learning a world model when the environment is complex . Traditional methods such as the Gaussian Processes based method ( Deisenroth & Rasmussen , 2011 ) can perform well on some problems with high sample efficiency , but they are not easy to scale to high-dimensional problems ( Plaat et al. , 2020 ) . High-capacity models scale well , but they often have low sample efficiency ( Plaat et al. , 2020 ) . The trade-off between scalability and sample complexity remains as a critical issue for model-based RL . To address the aforementioned issue , we propose to introduce physical knowledge to reduce the sample complexity for learning high-dimensional dynamics in physical environments . We focus on reinforcement learning in an environment whose dynamics can be formulated by Hamiltonian canonical equations ( Goldstein et al. , 2002 ) . Up till now , Hamiltonian dynamics have been successfully applied in numerous areas of physics from robotics to industrial automation . Specifically , we formulate the environments dynamics as ordinary differential equations ( ODEs ) , and then use a novel network architecture called Neural Ordinary Differential Auto-encoder ( NODA ) as our world model , which is naturally induced by physical equations . In particular , NODA consists of two parts — an auto-encoder and an ODE network . We use the auto-encoder to get the underlying physical variables , and use the ODE network to learn the dynamics over physical variables . By using NODA , we can enjoy its ability of modeling the physical world as well as its flexibility of combining physical knowledge ( if any ) , such as the dimension of physical variables . Theoretically , we provide uniform bounds for both multi-step transition errors and value errors for NODA by extending the former study of Lipschitz models ( Asadi et al. , 2018 ) to continuous action spaces . It is noted that NODA can be combined with both MFRL methods like SAC ( Haarnoja et al. , 2018 ) and MBRL methods like Dreamer ( Hafner et al. , 2019 ) by facilitating the learning of the world model . Extensive experiments show that we can learn NODA well using a small number of data with an appropriate structure encoded , which can boost the sample efficiency by using imaginary trajectories over the environment models ( Todorov et al. , 2012 ; Schulman et al. , 2015 ) . 2 BACKGROUND . We start by presenting the background knowledge of reinforcement learning , and then explain the relationship between MBRL and Hamiltonian mechanics . 2.1 MODEL-BASED REINFORCEMENT LEARNING . We consider the Markov decision process ( MDP ) model for reinforcement learning . Formally , an MDP is formulated as a tuple 〈S , A , T , R , γ〉 , where S is the state space , A is the action space , T : S ×A → P ( S ) is the transition function , R : S ×A → R is the reward function , and γ ∈ [ 0 , 1 ) is a discount factor . We denote the set P ( · ) as all probability measures on the space in the bracket . Our goal is to find a policy π that can choose an action to maximize the accumulated reward . Here we focus on the challenging tasks with continuous state and action spaces ( i.e. , there are infinite states and actions ) . MBRL aims to learn a policy by integrating planning with the aid of a known or learned model ( Moerland et al. , 2020b ) , and an essential part of MBRL is to learn a transition function that characterizes the environment . The transition function above is defined over a given state , but we can generalize it to represent the transition from a state distribution z ∈ P ( S ) . By calling the generalized transition function recursively , we can get the n-step generalized transition function , which is defined as : Definition 1 ( Transition Functions ) In a metric state space ( S , dS ) and an action spaceA , we can define the generalized transition function of TG ( over state distribution z ) , and the n-step generalized transition function of TnG ( for fixed sequence of actions ) ( Asadi et al. , 2018 ) as TG ( s ′ | s , a ) = ∫ T ( s′ | s , a ) z ( s ) ds TnG ( · | z ) = TG ( · | · · ·TG ( · | z , a0 ) · · · , an−1 ) ︸ ︷︷ ︸ n recursive calls . ( 1 ) Here the generalized transition gives the distribution of outcome under a certain state distribution . For MBRL , it is nontrivial to learn the transition function ( i.e. , the dynamics for a physical environment ) because S can be high-dimensional . Several attempts have been made to learn such dynamics , while they have various limitations . For instance , probabilistic inference for learning control ( PILCO ) ( Deisenroth & Rasmussen , 2011 ) uses Gaussian processes to model the transition function , but the inference part does not scale well to high dimensions ( Langlois et al. , 2019 ) . Stochastic ensemble value expansion ( STEVE ) ( Buckman et al. , 2018 ) and adaptation augmented model-based policy optimization ( AMPO ) ( Shen et al. , 2020 ) use scalable machine learning models , but there is no further discussion on how to learn such a model efficiently . Actually , high-dimensional state and action spaces usually require much more data samples ( Plaat et al. , 2020 ) . Monte Carlo tree search ( MCTS ) ( Silver et al. , 2017 ) can introduce human knowledge of the transition function to enhance learning , but it is restricted to cases where transition functions are totally known . 2.2 HAMILTONIAN MECHANICS . Methods of analytical mechanics have been introduced to predict the evolution of dynamic systems such as pendulums . For example , Lagrangian neural networks ( Lutter et al. , 2019 ; Cranmer et al. , 2020 ) and Hamiltonian neural networks ( Greydanus et al. , 2019 ) can be used to simulate dynamic systems . These papers focus on how to model the Lagrangian or the Hamiltonian . One challenge for such methods is that the equations for the Lagrangian or the Hamiltonian are second-order differential equations , which are difficult to model in a general way . Besides , numerical solutions of second-order differential equations are prone to error accumulation . One natural idea is to reformulate second-order differential equations into first-order ones . Then , we can use an existing neural network ( Chen et al. , 2018 ) to model these equations in the ODE form . In this paper , we concentrate on the Hamiltonian case , for which the first-order representation corresponds to Hamiltonian canonical equations ( Junkins & Schaub , 2009 ) .1 Specifically , in Hamiltonian mechanics , we use pairs of generalized coordinate and generalized momentum ( qk , pk ) to completely describe a dynamic system ( k ∈ { 0 , 1 , · · · , K } ) , where K is the dimension of generalized coordinates.It is noted thatK can be intuitively interpreted as the degree of freedom . We denote pk and qk as canonical states , and they are minimal independent parameters which can describe the state of the system . We define Hamiltonian H : R2K+1 → R as a function of these variables and time t. Then the evolution of the system satisfies Hamiltonian canonical equations ( Junkins & Schaub , 2009 ) : dqk dt = ∂H ∂pk , dpk dt = − ∂H ∂qk +Qk ( t ) , ( 2 ) where k ∈ { 0 , 1 , · · · , K } , andQk ( t ) are the generalized forces which describe the effects of external forces . One advantage of using these equations is that they can describe general dynamic systems . Moreover , it is possible to incorporate prior knowledge into Hamiltonian canonical equations , e.g. , by assuming a specific form of energy ( Sprangers et al. , 2014 ) . In our case , prior knowledge can be available . For example , we may know the dimension K of the generalized coordinate and generalized momentum , which only requires the knowledge of the ’ degree of freedom ’ for a given system but makes a difference in training . Another example is about transfer learning : If we already learn the underlying dynamics , we can combine the learnt dynamics with other modules to transfer the learnt knowledge to a variety of different tasks . We empirically examine the these advantages in the experimental section . 3 METHODOLOGY . We now formally present NODA , which consists of an auto-encoder and an ODE network . NODA aims to serve as a simulator of the real environment ( i.e. , a dynamic system ) by learning the transition function and the reward function . Here we assume that the transition is deterministic , otherwise an SDE network ( Li et al. , 2020 ) can be used instead . Then we can use NODA to assist reinforcement learning by generating imaginary trajectories , as outlined in Algorithm 1 . Besides , we also discuss the prior knowledge that can be incorporated with NODA .
This paper proposes a model of neural ODE auto-encoder, NODA, which incorporates Hamiltonian mechanics to learn a world model. The paper shows theoretical results of transition errors and value errors. NODA is tested on a range of RL tasks.
SP:e653f89bc504607362dfa2ba413b0481674f08df
Cognitively Inspired Learning of Incremental Drifting Concepts
Humans continually expand their learned knowledge to new domains and learn new concepts without any interference with past learned experiences . In contrast , machine learning models perform poorly in a continual learning setting , where input data distribution changes over time . Inspired by the nervous system learning mechanisms , we develop a computational model that enables a deep neural network to learn new concepts and expand its learned knowledge to new domains incrementally in a continual learning setting . We rely on the Parallel Distributed Processing theory to encode abstract concepts in an embedding space in terms of a multimodal distribution . This embedding space is modeled by internal data representations in a hidden network layer . We also leverage the Complementary Learning Systems theory to equip the model with a memory mechanism to overcome catastrophic forgetting through implementing pseudo-rehearsal . Our model can generate pseudo-data points for experience replay and accumulate new experiences to past learned experiences without causing cross-task interference . 1 INTRODUCTION . Humans continually abstract concept classes from their input sensory data to build semantic descriptions , and then update and expand these concepts as more experiences are accumulated Widmer & Kubat ( 1996 ) , and use them to express their ideas and communicate with each other Gennari et al . ( 1989 ) ; Lake et al . ( 2015 ) . For example , “ cat ” and “ dog ” are one of the first concept classes that many children learn to identify . Most humans expand these concepts as concept drift occurs , e.g. , incorporating many atypical dog breeds into the “ dog ” concept , and also incrementally learn new concept classes , e.g . “ horse ” and “ sheep , ” as they acquire more experiences . Although this concept learning procedure occurs continually in humans , continual and incremental learning of concept classes remains a major challenge in artificial intelligence ( AI ) . AI models are usually trained on a fixed number of classes and the data distribution is assumed to be stationary during model execution . Hence , when an AI model is trained or updated on sequentially observed tasks with diverse distributions or is trained on new classes , it tends to forget what has been learned before due to cross-task interference , known as the phenomenon of catastrophic forgetting in the literature French ( 1991 ) . Inspired by the Parallel Distributed Processing ( PDP ) paradigm McClelland et al . ( 1986 ) ; McClelland & Rogers ( 2003 ) , our goal is to enable a deep neural network to learn drifting concept classes Gama et al . ( 2014 ) incrementally and continually in a sequential learning setting . PDP hypothesizes that abstract concepts are encoded in higher layers of the nervous system McClelland & Rogers ( 2003 ) ; Saxe et al . ( 2019 ) . Similarly , and based on behavioral similarities between artificial deep neural networks and the nervous system Morgenstern et al . ( 2014 ) , we can assume that the data representations in hidden layers of a deep network encode semantic concepts with different levels of abstractions . We model these representations as an embedding space in which semantic similarities between input data points are encoded in terms of geometric distances Jiang & Conrath ( 1997 ) , i.e. , data points that belong to the same concept class are mapped into separable clusters in the embedding space . When a new concept is abstracted , a new distinct cluster should be formed in the embedding space to encode that new class . Incremental concepts learning is feasible by tracking and remembering the representation clusters that are formed in the embedding space and by considering their dynamics as more experiences are accumulated in new unexplored domains . We benefit from the Complementary Learning Systems ( CLS ) theory McClelland et al . ( 1995 ) to mitigate catastrophic forgetting . CLS is based on empirical evidences that suggest experience replay of recently observed patterns during sleeping and waking periods in the human brain helps to accumulate the new experiences to the past learned experiences without causing interference McClelland et al . ( 1995 ) ; Robins ( 1995 ) . According to this theory , hippocampus plays the role of a short-term memory buffer that stores samples of recent experiences and catastrophic forgetting is prevented by replaying samples from the hippocampal storage to implement pseudo-rehearsal in the neocortex during sleeping periods through enhancing past learned knowledge . Unlike AI memory buffers that store raw input data point , e.g. , samples of raw images , hippocampal storage can only store encoded representations after some level of abstraction which suggests a generative nature . Inspired by the above two theories , we expand a base deep neural classifier with a decoder network , which is amended from a hidden layer , to form an autoencoder with the hidden layer as its bottleneck . The bottleneck is used to model the discriminative embedding space . As a result of supervised learning , the embedding space becomes discriminative , i.e . a data cluster is formed for each concept class in the embedding space McClelland & Rogers ( 2003 ) . These clusters can be considered analogous to neocortical representations in the brain , where the learned abstract concepts are encoded McClelland et al . ( 1986 ) . We use a multi-modal distribution to estimate this distribution . We update this parametric distribution to accumulate new experiences to past learned experiences consistently . Since our model is generative , we can implement the offline memory replay process in the sleeping brain to prevent catastrophic forgetting McClelland et al . ( 1995 ) ; Rasch & Born ( 2013 ) . When a new task arrives , we draw random samples from the multi-modal distribution and feed them into the decoder network to generate representative pseudo-data points . These pseudo-data points are then used to implement pseudo-rehearsal for experience replay Robins ( 1995 ) . We demonstrate that the neural network can learn drifting conceptsincrementally while mitigating forgetting . 2 RELATED WORK . The problem of continual learning of incremental drifting concepts lies in the intersection of lifelong learning to encode drifting concept classes and incremental learning to incorporate new concept classes . In a lifelong learning setting , the number of classes are usually assumed to be fixed , but the distribution of sequential tasks is non-stationary . In an incremental learning setting , concept classes are learned sequentially while the conditional distribution for each concept class is stationary . Continual learning : the major challenge of continual learning is tackling catastrophic forgetting . Previous works in the literature mainly rely on experience replay Li & Hoiem ( 2018 ) . The core idea of experience replay is to implement pseudo-rehearsal by replaying representative samples of past tasks along with the current task data to retain the learned distributions . Since storing these samples requires a memory buffer , the challenge is selecting the representative samples to meet the buffer size limit . For example , selecting uncommon samples that led to maximum effect in past experiences has been found to be effective Schaul et al . ( 2016 ) . However , as more tasks are learned , selecting the effective samples becomes more complex . The alternative approach is to use generative models that behave more similar to humans French ( 1999 ) . Shin et al . ( Shin et al . ( 2017 ) ) use a generative adversarial structure to mix the distributions of all tasks . It is also feasible to couple the distributions of all tasks in the bottleneck of an autoencoder . The shared distribution then can be used to generate pseudo-samples Rannen et al . ( 2017 ) .Weight consolidation using structural plasticity Lamprecht & LeDoux ( 2004 ) ; Zenke et al . ( 2017 ) ; Kirkpatrick et al . ( 2017 ) is another approach to approximate experience replay . The idea is to identify important weights that retain knowledge about a task and then consolidate them according to their relative importance for past tasks in the future . Incremental learning : : forgetting in incremental learningstems from updating the model when new classes are incorporated , rather concept drifts in a fixed number of learned classes . Hence , the goal is to learn new classes such that knowledge about the past learned classes is not overwritten . A simple approach is to expand the base network as new classes are observed . Tree-CNN Roy et al . ( 2020 ) proposes a hierarchical structure that grows like a tree when new classes are observed . The idea is to group new classes into feature-driven super-classes and find the exact label by limiting the search space . As the network grows , the new data can be used to train the expanded network . Sarwar et al . Sarwar et al . ( 2019 ) add new convolutional filters in all layers to learn the new classes through new parameters . The alternative approach is to retain the knowledge about old classes in an embedding feature space . Rebuffi et al . Rebuffi et al . ( 2017 ) proposed iCarl which maps images into a feature space that remains discriminative as more classes are learned incrementally . A fixed memory buffer is used to store exemplar images for each observed class . Each time a new class is observed , these images are used to learn a class-level representative vector in the feature space such that the testing images can be classified using nearest neighbor with respect to these vectors . Contributions : We develop a unified framework that addresses challenges of both incremental learning and lifelong learning for the first time . Our idea is based on tracking and consolidating the multimodal distribution that is formed by the internal data representations of sequential tasks in a base neural network model hidden layers . We model this distribution as a Gaussian mixture model ( GMM ) with time-dependent number of components . Concept drifts are learned by updating the corresponding GMM component for a particular class and new concepts are learned by adding new GMM components . We also make the model generative to implement experience replay . We provide both theoretical and experimental results to justify why our algorithm is effective . 3 PROBLEM STATEMENT . Consider a learning agent which observes a sequence of observed tasks { Z ( t ) } Tt=1 Chen & Liu ( 2016 ) and after learning each task moves forward to learn the next task . Each task is a classification problem in a particular domain and each class represents a concept . The classes for each task can be new unobserved classes , i.e. , necessitating incremental learning Rebuffi et al . ( 2017 ) , or drifted forms of the past learned classes , i.e. , necessitating lifelong learning Chen & Liu ( 2016 ) , or potentially a mixture of both cases . Formally , a task is characterized by a dataset D ( t ) = 〈X ( t ) , Y ( t ) 〉 , where X ( t ) = [ xt1 , . . . , x t n ] ∈ Rd×nt and Y ( t ) ∈ Rkt×nt are the data points and one-hot labels , respectively . The goal is to train a time-dependent classifier function f ( t ) ( · ) : Rd →⊂ Rkt - where kt is the number of classes for the t-th task and is fixed for each task- such that the classifier continually generalizes on the tasks seen so far . The data points x ( t ) i ∼ q ( t ) ( x ) are assumed to be drawn i.i.d . from an unknown task distribution q ( t ) ( x ) . Figure 1 visualizes a high-level block-diagram of this continual and dynamic learning procedure . The agent needs to expand its knowledge about all the observed concepts such that it can perform well on all the previous learned domains . Learning each task in isolation is a standard supervised learning problem . After selecting a suitable parameterized family of functions f ( t ) θ : Rd → Rkt with learnable parameters θ , e.g . a deep neural network with learnable weight paramters θ , we can solve for the optimal parameters using the empirical risk minimization ( ERM ) : θ̂ ( t ) = arg minθ ê ( t ) θ = arg minθ ∑ i Ld ( f ( t ) θ ( x ( t ) i ) , y ( t ) i ) , where Ld ( · ) is a proper loss function . If nt is large enough , the empirical risk expectation would be a good approximation of the real expected risk function e ( t ) ( θ ) = Ex∼q ( t ) ( x ) ( Ld ( fθ ( t ) ( x ) , f ( x ) ) ) . As a result , if the base parametric family is rich and complex enough for learning the task function , then the ERM optimal model generalizes well on unseen test samples that are drawn from q ( t ) ( x ) . For the rest of the paper , we consider the base model fθ ( t ) to be a deep neural network with an increasing output size to encode incrementally observed classes . As stated , we rely on the PDP paradigm . Hence , we decompose the deep network into an encoder sub-network φv ( · ) : Rd → Z ⊂ Rf with learnable parameter v , e.g. , convolutional layers of a CNN , and a classifier sub-network hw ( · ) kt : Rf → Rkt with learnable parameters w , e.g. , fully connected layers of a CNN , where Z denotes the embedding space in which the concepts will be be formed as separable clusters . The concepts for each task are known a priori and hence new nodes are added to the classifier subnetwork output to incorporate the new classes at time t. We use a softmax layer as the last layer of the classifier subnetwork . Hence , we can consider the classifier to be a a maximum a posteriori ( MAP ) estimator after training . This means that the encoder network transforms the input data distribution into an internal multi-modal distribution with kt modes in the embedding space because the embedding space Z should be concept-discriminative for good generalization . Each concept class is represented by a single mode of this distribution . We use a Gaussian mixture model ( GMM ) to model and approximate this distribution ( see Figure 1 , middle panel ) . Catastrophic forgetting is the result of changes in this internal distribution when changes in the input distribution leads to updating the internal distribution heuristically . Our idea is to track changes in the data distribution and update and consolidate the internal distribution such that the acquired knowledge from past experiences is not overwritten when new experiences are encountered and learned in the future . Figure 1 : Block-diagram visualization of the proposed Incremental Learning System including the learning procedure steps . ( Based viewed enlarged on screen and in color . Enlarged version is included in the Appendix ) The main challenge is to adapt the network f ( t ) θ ( · ) and the standard ERM training loss such that we can track the internal distribution continually and accumulate the new acquired knowledge consistently to the past learned knowledge with minimum interference . For this purpose , we form a generative model by amending the base model with a decoder ψu : Z → Rd , with learnable parameters u . This decoder maps back the internal representations to reconstruct the input data point in the input space such that the pair ( φu , ψu ) forms an autoencoder . According to our previous discussion , a multi-modal distribution would be formed in the bottleneck of the autoencoder upon learning each task . This distribution encodes the learned knowledge about the concepts that have been learned from past experiences so far . If we approximate this distribution with a GMM , we can generate pseudodata points that represent the previously learned concepts and use them for pseudo-rehearsal . For this purpose , we can simply draw samples from all modes of the GMM and feed these samples into the decoder subnetwork to generate a pseudo-dataset ( see Figure 1 ) . After learning each task , we can update the GMM estimate such that the new knowledge acquired is accumulated to the past gained knowledge consistenly to avoid interference . By doing this procedure continually , our model is able to learn drifting concepts incrementally . Figure 1 visualizes this repetitive procedure in this lifelong learning setting .
In this paper, the authors propose ICLA, an approach to tackle the problem of incremental and continual learning. By keeping track of a model's "internal" representations of data, they identify and overcome the "drift" issue (as in continual learning). Particularly, they adopt an encoder-decoder style architecture to learn an embedding space that serves two purposes. (i) The embeddings from the encoder serve as an "internal" representation of data whose distribution is explicitly estimated using a Gaussian Mixture Model. (ii) By sampling embeddings from this GMM and passing them through the decoder, they turn this into a generative framework to support memory replay to overcome forgetting. When new classes are incorporated (as in incremental learning), additional components are added to the parameterization of the GMM. The authors provide some theoretical guarantees for error bounds and conduct empirical evaluations on MNIST and FMNIST.
SP:25274bb362e98c010d0caa4849ac064586e19a0a
Cognitively Inspired Learning of Incremental Drifting Concepts
Humans continually expand their learned knowledge to new domains and learn new concepts without any interference with past learned experiences . In contrast , machine learning models perform poorly in a continual learning setting , where input data distribution changes over time . Inspired by the nervous system learning mechanisms , we develop a computational model that enables a deep neural network to learn new concepts and expand its learned knowledge to new domains incrementally in a continual learning setting . We rely on the Parallel Distributed Processing theory to encode abstract concepts in an embedding space in terms of a multimodal distribution . This embedding space is modeled by internal data representations in a hidden network layer . We also leverage the Complementary Learning Systems theory to equip the model with a memory mechanism to overcome catastrophic forgetting through implementing pseudo-rehearsal . Our model can generate pseudo-data points for experience replay and accumulate new experiences to past learned experiences without causing cross-task interference . 1 INTRODUCTION . Humans continually abstract concept classes from their input sensory data to build semantic descriptions , and then update and expand these concepts as more experiences are accumulated Widmer & Kubat ( 1996 ) , and use them to express their ideas and communicate with each other Gennari et al . ( 1989 ) ; Lake et al . ( 2015 ) . For example , “ cat ” and “ dog ” are one of the first concept classes that many children learn to identify . Most humans expand these concepts as concept drift occurs , e.g. , incorporating many atypical dog breeds into the “ dog ” concept , and also incrementally learn new concept classes , e.g . “ horse ” and “ sheep , ” as they acquire more experiences . Although this concept learning procedure occurs continually in humans , continual and incremental learning of concept classes remains a major challenge in artificial intelligence ( AI ) . AI models are usually trained on a fixed number of classes and the data distribution is assumed to be stationary during model execution . Hence , when an AI model is trained or updated on sequentially observed tasks with diverse distributions or is trained on new classes , it tends to forget what has been learned before due to cross-task interference , known as the phenomenon of catastrophic forgetting in the literature French ( 1991 ) . Inspired by the Parallel Distributed Processing ( PDP ) paradigm McClelland et al . ( 1986 ) ; McClelland & Rogers ( 2003 ) , our goal is to enable a deep neural network to learn drifting concept classes Gama et al . ( 2014 ) incrementally and continually in a sequential learning setting . PDP hypothesizes that abstract concepts are encoded in higher layers of the nervous system McClelland & Rogers ( 2003 ) ; Saxe et al . ( 2019 ) . Similarly , and based on behavioral similarities between artificial deep neural networks and the nervous system Morgenstern et al . ( 2014 ) , we can assume that the data representations in hidden layers of a deep network encode semantic concepts with different levels of abstractions . We model these representations as an embedding space in which semantic similarities between input data points are encoded in terms of geometric distances Jiang & Conrath ( 1997 ) , i.e. , data points that belong to the same concept class are mapped into separable clusters in the embedding space . When a new concept is abstracted , a new distinct cluster should be formed in the embedding space to encode that new class . Incremental concepts learning is feasible by tracking and remembering the representation clusters that are formed in the embedding space and by considering their dynamics as more experiences are accumulated in new unexplored domains . We benefit from the Complementary Learning Systems ( CLS ) theory McClelland et al . ( 1995 ) to mitigate catastrophic forgetting . CLS is based on empirical evidences that suggest experience replay of recently observed patterns during sleeping and waking periods in the human brain helps to accumulate the new experiences to the past learned experiences without causing interference McClelland et al . ( 1995 ) ; Robins ( 1995 ) . According to this theory , hippocampus plays the role of a short-term memory buffer that stores samples of recent experiences and catastrophic forgetting is prevented by replaying samples from the hippocampal storage to implement pseudo-rehearsal in the neocortex during sleeping periods through enhancing past learned knowledge . Unlike AI memory buffers that store raw input data point , e.g. , samples of raw images , hippocampal storage can only store encoded representations after some level of abstraction which suggests a generative nature . Inspired by the above two theories , we expand a base deep neural classifier with a decoder network , which is amended from a hidden layer , to form an autoencoder with the hidden layer as its bottleneck . The bottleneck is used to model the discriminative embedding space . As a result of supervised learning , the embedding space becomes discriminative , i.e . a data cluster is formed for each concept class in the embedding space McClelland & Rogers ( 2003 ) . These clusters can be considered analogous to neocortical representations in the brain , where the learned abstract concepts are encoded McClelland et al . ( 1986 ) . We use a multi-modal distribution to estimate this distribution . We update this parametric distribution to accumulate new experiences to past learned experiences consistently . Since our model is generative , we can implement the offline memory replay process in the sleeping brain to prevent catastrophic forgetting McClelland et al . ( 1995 ) ; Rasch & Born ( 2013 ) . When a new task arrives , we draw random samples from the multi-modal distribution and feed them into the decoder network to generate representative pseudo-data points . These pseudo-data points are then used to implement pseudo-rehearsal for experience replay Robins ( 1995 ) . We demonstrate that the neural network can learn drifting conceptsincrementally while mitigating forgetting . 2 RELATED WORK . The problem of continual learning of incremental drifting concepts lies in the intersection of lifelong learning to encode drifting concept classes and incremental learning to incorporate new concept classes . In a lifelong learning setting , the number of classes are usually assumed to be fixed , but the distribution of sequential tasks is non-stationary . In an incremental learning setting , concept classes are learned sequentially while the conditional distribution for each concept class is stationary . Continual learning : the major challenge of continual learning is tackling catastrophic forgetting . Previous works in the literature mainly rely on experience replay Li & Hoiem ( 2018 ) . The core idea of experience replay is to implement pseudo-rehearsal by replaying representative samples of past tasks along with the current task data to retain the learned distributions . Since storing these samples requires a memory buffer , the challenge is selecting the representative samples to meet the buffer size limit . For example , selecting uncommon samples that led to maximum effect in past experiences has been found to be effective Schaul et al . ( 2016 ) . However , as more tasks are learned , selecting the effective samples becomes more complex . The alternative approach is to use generative models that behave more similar to humans French ( 1999 ) . Shin et al . ( Shin et al . ( 2017 ) ) use a generative adversarial structure to mix the distributions of all tasks . It is also feasible to couple the distributions of all tasks in the bottleneck of an autoencoder . The shared distribution then can be used to generate pseudo-samples Rannen et al . ( 2017 ) .Weight consolidation using structural plasticity Lamprecht & LeDoux ( 2004 ) ; Zenke et al . ( 2017 ) ; Kirkpatrick et al . ( 2017 ) is another approach to approximate experience replay . The idea is to identify important weights that retain knowledge about a task and then consolidate them according to their relative importance for past tasks in the future . Incremental learning : : forgetting in incremental learningstems from updating the model when new classes are incorporated , rather concept drifts in a fixed number of learned classes . Hence , the goal is to learn new classes such that knowledge about the past learned classes is not overwritten . A simple approach is to expand the base network as new classes are observed . Tree-CNN Roy et al . ( 2020 ) proposes a hierarchical structure that grows like a tree when new classes are observed . The idea is to group new classes into feature-driven super-classes and find the exact label by limiting the search space . As the network grows , the new data can be used to train the expanded network . Sarwar et al . Sarwar et al . ( 2019 ) add new convolutional filters in all layers to learn the new classes through new parameters . The alternative approach is to retain the knowledge about old classes in an embedding feature space . Rebuffi et al . Rebuffi et al . ( 2017 ) proposed iCarl which maps images into a feature space that remains discriminative as more classes are learned incrementally . A fixed memory buffer is used to store exemplar images for each observed class . Each time a new class is observed , these images are used to learn a class-level representative vector in the feature space such that the testing images can be classified using nearest neighbor with respect to these vectors . Contributions : We develop a unified framework that addresses challenges of both incremental learning and lifelong learning for the first time . Our idea is based on tracking and consolidating the multimodal distribution that is formed by the internal data representations of sequential tasks in a base neural network model hidden layers . We model this distribution as a Gaussian mixture model ( GMM ) with time-dependent number of components . Concept drifts are learned by updating the corresponding GMM component for a particular class and new concepts are learned by adding new GMM components . We also make the model generative to implement experience replay . We provide both theoretical and experimental results to justify why our algorithm is effective . 3 PROBLEM STATEMENT . Consider a learning agent which observes a sequence of observed tasks { Z ( t ) } Tt=1 Chen & Liu ( 2016 ) and after learning each task moves forward to learn the next task . Each task is a classification problem in a particular domain and each class represents a concept . The classes for each task can be new unobserved classes , i.e. , necessitating incremental learning Rebuffi et al . ( 2017 ) , or drifted forms of the past learned classes , i.e. , necessitating lifelong learning Chen & Liu ( 2016 ) , or potentially a mixture of both cases . Formally , a task is characterized by a dataset D ( t ) = 〈X ( t ) , Y ( t ) 〉 , where X ( t ) = [ xt1 , . . . , x t n ] ∈ Rd×nt and Y ( t ) ∈ Rkt×nt are the data points and one-hot labels , respectively . The goal is to train a time-dependent classifier function f ( t ) ( · ) : Rd →⊂ Rkt - where kt is the number of classes for the t-th task and is fixed for each task- such that the classifier continually generalizes on the tasks seen so far . The data points x ( t ) i ∼ q ( t ) ( x ) are assumed to be drawn i.i.d . from an unknown task distribution q ( t ) ( x ) . Figure 1 visualizes a high-level block-diagram of this continual and dynamic learning procedure . The agent needs to expand its knowledge about all the observed concepts such that it can perform well on all the previous learned domains . Learning each task in isolation is a standard supervised learning problem . After selecting a suitable parameterized family of functions f ( t ) θ : Rd → Rkt with learnable parameters θ , e.g . a deep neural network with learnable weight paramters θ , we can solve for the optimal parameters using the empirical risk minimization ( ERM ) : θ̂ ( t ) = arg minθ ê ( t ) θ = arg minθ ∑ i Ld ( f ( t ) θ ( x ( t ) i ) , y ( t ) i ) , where Ld ( · ) is a proper loss function . If nt is large enough , the empirical risk expectation would be a good approximation of the real expected risk function e ( t ) ( θ ) = Ex∼q ( t ) ( x ) ( Ld ( fθ ( t ) ( x ) , f ( x ) ) ) . As a result , if the base parametric family is rich and complex enough for learning the task function , then the ERM optimal model generalizes well on unseen test samples that are drawn from q ( t ) ( x ) . For the rest of the paper , we consider the base model fθ ( t ) to be a deep neural network with an increasing output size to encode incrementally observed classes . As stated , we rely on the PDP paradigm . Hence , we decompose the deep network into an encoder sub-network φv ( · ) : Rd → Z ⊂ Rf with learnable parameter v , e.g. , convolutional layers of a CNN , and a classifier sub-network hw ( · ) kt : Rf → Rkt with learnable parameters w , e.g. , fully connected layers of a CNN , where Z denotes the embedding space in which the concepts will be be formed as separable clusters . The concepts for each task are known a priori and hence new nodes are added to the classifier subnetwork output to incorporate the new classes at time t. We use a softmax layer as the last layer of the classifier subnetwork . Hence , we can consider the classifier to be a a maximum a posteriori ( MAP ) estimator after training . This means that the encoder network transforms the input data distribution into an internal multi-modal distribution with kt modes in the embedding space because the embedding space Z should be concept-discriminative for good generalization . Each concept class is represented by a single mode of this distribution . We use a Gaussian mixture model ( GMM ) to model and approximate this distribution ( see Figure 1 , middle panel ) . Catastrophic forgetting is the result of changes in this internal distribution when changes in the input distribution leads to updating the internal distribution heuristically . Our idea is to track changes in the data distribution and update and consolidate the internal distribution such that the acquired knowledge from past experiences is not overwritten when new experiences are encountered and learned in the future . Figure 1 : Block-diagram visualization of the proposed Incremental Learning System including the learning procedure steps . ( Based viewed enlarged on screen and in color . Enlarged version is included in the Appendix ) The main challenge is to adapt the network f ( t ) θ ( · ) and the standard ERM training loss such that we can track the internal distribution continually and accumulate the new acquired knowledge consistently to the past learned knowledge with minimum interference . For this purpose , we form a generative model by amending the base model with a decoder ψu : Z → Rd , with learnable parameters u . This decoder maps back the internal representations to reconstruct the input data point in the input space such that the pair ( φu , ψu ) forms an autoencoder . According to our previous discussion , a multi-modal distribution would be formed in the bottleneck of the autoencoder upon learning each task . This distribution encodes the learned knowledge about the concepts that have been learned from past experiences so far . If we approximate this distribution with a GMM , we can generate pseudodata points that represent the previously learned concepts and use them for pseudo-rehearsal . For this purpose , we can simply draw samples from all modes of the GMM and feed these samples into the decoder subnetwork to generate a pseudo-dataset ( see Figure 1 ) . After learning each task , we can update the GMM estimate such that the new knowledge acquired is accumulated to the past gained knowledge consistenly to avoid interference . By doing this procedure continually , our model is able to learn drifting concepts incrementally . Figure 1 visualizes this repetitive procedure in this lifelong learning setting .
This paper proposed an algorithm for learning concepts incrementally taking inspiration from Parallel Distributed Processing and Complementary Learning Systems. The core idea is to use Gaussian Mixture Models and update them incrementally plus exploit a generative model to perform pseudo-rehearsal. The paper presents a methodology and follow-up experimental results that are shown to perform well.
SP:25274bb362e98c010d0caa4849ac064586e19a0a
AdaFocal: Calibration-aware Adaptive Focal Loss
1 INTRODUCTION . Neural networks have found tremendous success in almost every field including computer vision , natural language processing , and speech recognition . Over time , these networks have grown complex and larger in size to achieve state-of-the-art performance and they continue to evolve further in that direction . However , it has been well established that such high capacity networks suffer from poor calibration Guo et al . ( 2017 ) , i.e . the confidence scores of the predictions do not reflect the real world probabilities of those predictions being true . For example , if the network assigns 0.8 confidence to a set of predictions , we should expect 80 % of those predictions to be correct . However , this is far from reality since modern networks tend to be grossly over-confident . This is of great concern , particularly for mission-critical applications such as autonomous driving , medical diagnosis , wherein the downstream decision making not only rely on the predictions but also on their confidence . In recent years , there has been a growing interest in developing methods for calibrating neural networks . These can be mainly divided into two categories ( 1 ) post-hoc approaches that perform calibration after training ( 2 ) methods that calibrate the model during training itself . The first includes methods such as Platt scaling Platt ( 1999 ) , histogram binning Zadrozny & Elkan ( 2001 ) , Isotonic regression Zadrozny & Elkan ( 2002 ) , Bayesian binning and averaging Naeini et al . ( 2015 ) ; Naeini & Cooper ( 2016 ) , and Spline fitting Gupta et al . ( 2021 ) . Methods in the second category focus on training the model on an objective function that accounts for calibration as well , including Maximum Mean Calibration Error ( MMCE ) Kumar et al . ( 2018 ) , Label smoothing Müller et al . ( 2019 ) , and recently focal loss Mukhoti et al . ( 2020 ) . These methods aim to produce inherently calibrated models which when combined with post training calibration methods lead to further improvements . Contribution . Our work falls into the second category . We build upon the calibration properties of focal loss to propose a modification that further improves its performance . Firstly , we make the observation that while regular focal loss , with a fixed γ parameter , improves the overall calibration by preventing samples from being over-confident , it also leaves other samples under-confident . To address this drawback , we propose a modification to the focal loss called AdaFocal that adjusts the γ for each training sample ( or rather a group of samples ) separately by taking into account the model ’ s under/over-confidence about a similar corresponding group in the validation set . We evaluate the performance of our method on four image classification tasks : CIFAR-10 , CIFAR-100 , Tiny-ImageNet and ImageNet , and one text classification task : 20 Newsgroup , using various model architectures , and show that AdaFocal substantially outperforms the regular focal loss and other state-of-the-art calibration techniques in the literature . We further study the performance of AdaFocal on an out-of-distribution detection task and find it to perform better than the competing methods . Finally , we find that the models trained using AdaFocal get innately calibrated to a level that most times do not significantly benefit from temperature scaling . 2 PROBLEM SETUP AND DEFINITIONS . Consider a classification setting where we are given a set of training data { ( xn , ytrue , n ) } , with xn ∈ X being the input and ytrue , i ∈ Y = { 1 , 2 , . . . , K } the associated ground-truth label . Using this data we wish to train a classifier fθ ( x ) that outputs a vector p̂ over theK classes . We also assume access to a validation set for hyper-parameter tuning and a test set for evaluating its performance . For example , fθ ( · ) can be a neural network with learnable parameters θ , x is an image , and p̂ is the output of a softmax layer whose kth element p̂k is the probability score for class k. We refer to ŷ = argmaxk∈Y p̂k as the network ’ s prediction and the associated probability score p̂ŷ as the predicted confidence , and the same quantity for the jth example is p̂ŷ , j . In this setting , a network is said to be perfectly calibrated if the predicted confidence p̂ŷ reflects the true probability of the network classifying x correctly i.e . P ( ŷ = ytrue | p̂ŷ = p ) = p , ∀p ∈ [ 0 , 1 ] Guo et al . ( 2017 ) . Continuing our example , if the network assigns an average confidence score of 0.8 to a set of predictions then we should expect 80 % of those to be correct . We define Calibration Error as E = p̂ŷ − P ( ŷ = ytrue | p̂ŷ ) and the Expected Calibration Error as Ep̂ŷ [ E ] = Ep̂ŷ [ |p̂ŷ − P ( ŷ = ytrue | p̂ŷ ) | ] Guo et al . ( 2017 ) . However , as the true calibration error can not be computed empirically with a finite sized dataset , the following three approximations are generally used in the literature . That is , for a dataset { ( xn , ytrue , n ) } Nn=1 , ( 1 ) ECE = ∑M i=1 |Bi| N |Ci − Ai| Guo et al . ( 2017 ) , where Bi is equal-width bin that contains all examples j with p̂ŷ , j in the range [ iM , i+1 M ) , Ci = 1 |Bi| ∑ j∈Bi p̂ŷ , j is the average confidence and Ai = 1 |Bi| ∑ j∈Bi 1 ( ŷj = ytrue , j ) is the bin accuracy . Note that Ei = Ci − Ai is the empirical approximation of the calibration error E , ( 2 ) AdaECE = ∑M i=1 |Bi| N |Ci − Ai| Nguyen & O ’ Connor ( 2015 ) , where ∀i , j |Bi| = |Bj | are adaptively sized ( equal-mass ) bins that contain an equal number of samples , and ( 3 ) ClasswiseECE Kumar et al . ( 2018 ) ; Kull et al . ( 2019 ) estimates the calibration over all K classes : ClasswiseECE = 1 K ∑M i=1 ∑K k=1 |Bi , k| N |Ci , k −Ai , k| where Ci , k = 1 |Bi , k| ∑ j∈Bi , k p̂k , j is the average confidence for the kth class and Ai , k = 1|Bi , k| ∑ j∈Bi , k 1 ( ytrue , j = k ) is the accuracy of the kth class in the ith bin . Lastly , as ECE has been shown to be a biased estimate of true calibration Vaicenavicius et al . ( 2019 ) , we additionally use two de-biased estimates of ECE namely ECEdebiased proposed in Kumar et al . ( 2019 ) and ECEsweep proposed in Roelofs et al . ( 2021 ) to further confirm our results . 3 CALIBRATION PROPERTIES OF FOCAL LOSS . Focal loss Lin et al . ( 2017 ) LFL ( p ) = − ( 1 − p ) γ log p was originally proposed to improve the accuracy of classifiers by focusing on hard examples and down-weighting well classified examples . Recently it was further shown that focal loss may also result in significantly better calibrated models than cross entropy Mukhoti et al . ( 2020 ) . This is because , based on the relation : LFL ≥ KL ( q||p̂ ) − γH ( p̂ ) where q is the one-hot target vector , focal loss while minimising the main KL divergence objective also increases the entropy of the prediction p̂ . As a consequence this prevents the network from being overly confident on wrong predictions and overall improves calibration . The regular focal loss with fixed γ , as we show in this section , does not achieve the best calibration . In Figure 1 , we plot the calibration behaviour of ResNet50 in different bins when trained on CIFAR-10 with different focal losses . The ith bin ’ s calibration error subscripted by `` val '' Eval , i = Cval , i−Aval , i is computed on the validation set using 15 equal-mass binning . The figure shows the lowest ( bin-0 ) , a middle ( bin-7 ) and highest bin ( bin-7 ) . For reference , the rest of the bins and their bin boundaries are shown in Appendix B . From Figure 1 ( a ) , we see that although focal loss γ = 4 achieves the overall lowest calibration error ( AdaECE ) , there ’ s no single γ that performs the best across all the bins . For example , in bin-0 γ = 4 , 5 seems to achieve better calibration whereas γ = 0 , 3 are over-confident . For bin-7 , on the other hand , γ = 3 seems to be better calibrated whereas γ = 4 , 5 are under-confident and γ = 0 is over-confident . This clearly indicates that using different γs for different bins can further improve the calibration . Such an attempt is presented in Mukhoti et al . ( 2020 ) called the Sample-Dependent Focal Loss ( FLSD-53 ) which assigns γ = 5 if the training sample ’ s true class posterior p̂ytrue ∈ [ 0 , 0.2 ) and γ = 3 if p̂ytrue ∈ [ 0.2 , 1 ] . However , this strategy is fixed for every dataset-model pair and is based on simple heuristics of choosing higher γ for smaller values of p̂ytrue and relatively lower γ for higher values of p̂ytrue . However , from Figure 1 ( b ) , we see that FLSD-53 is also not the best strategy across all the bins . This , therefore , motivates the design of a γ selection strategy that can assign an appropriate γ for each bin based on the magnitude and sign of Eval , i . However , in order to design such a strategy we need solutions to the following two major challenges : 1 . How do we find some correspondence between the `` confidence of training samples '' , which we can manipulate during training by adjusting the entropy regularising parameter γ , and the `` confidence of the validation samples '' , which we want to be actually manipulated but do not have direct control over ? In other words , in order to indirectly control the confidence of a particular group of validation samples , how do we know which particular group of training samples ’ confidence to be manipulated ? 2 . Given that there is a correspondence between a training group and a validation group ( even if it ’ s loose ) , how do we arrive at the exact values of γ that will lead to better calibration ? We try to answer the first question in the next section and the answer to the second question leads to AdaFocal which is the main contribution of the paper . 4 CORRESPONDENCE BETWEEN CONFIDENCE OF TRAIN AND VAL . SAMPLES . In order to find some correspondence , an intuitive thing to do would be to group the validation samples into M equal-mass validation-bins , and then use these validation-bin boundaries to group the training samples as well . Then , we can compare the average confidence of the validation samples and the average confidence of the training samples , in the same validation-bin , to check for any correspondence . Quantities of interest For binning validation samples , we always look at the confidence of the top predicted class ŷ denoted by p̂val , top ( bin average : Cval , top ) . For training samples , on the other hand , instead of the confidence of the top predicted class ŷ denoted by p̂train , top ( bin average : Ctrain , top ) , we will focus on the confidence of the true class ytrue denoted by p̂train , true ( average : Ctrain , true ) because during training we only care about p̂train , true which is manipulated through some loss function . For reference however , Figure 10 in Appendix C compares Ctrain , true and Ctrain , top to show that as the training set accuracy approaches 100 % , the top predicted class and the true class for a training sample become the same . Henceforth , for a cleaner notation , we will always refer to Ctrain ≡ Ctrain , true and Cval ≡ Cval , top . Common binning When training samples are grouped using the bin boundaries of the validationbins . In Figure 2 ( b ) , we compareCtrain , i in validation-bin-i 1 withCval , i in the same validation-bin-i , and find that there is indeed a good correspondence between the two quantities . For example in Figure 2 ( b ) , as γ increases from 0 , 3 to 5 , the solid-line ( Ctrain , i ) gets lower , and the same behaviour is observed on the starred-line ( Cval , i ) as well . For completeness , rest of the bins are shown in Figure 12 Appendix C. This is very encouraging as now we can expect ( even though loosely ) that if we increase/decrease the confidence of a group of training samples in some lower ( or middle , or higher ) probability region then the same will be reflected on a similar group of validation samples in lower ( or middle , or higher ) probability region . This therefore provides a way to indirectly control the value of Cval , i by manipulating Ctrain , i , and from a calibration point of view , our strategy going forward would be to exploit this correspondence to keep Ctrain , i ( which we have control over during training ) closer to Aval , i ( the validation set accuracy in validation-bin-i ) so that Cval , i also stays closer to Aval , i to overall reduce the calibration error Eval , i = Cval , i −Aval , i . Independent binning Before proceeding , for completeness , we also look at the case when training samples and validation samples are grouped independently into their respective training-bins and validation-bins . Figure 2 ( a ) compares Ctrain , i in training-bin-i with Cval , i in validation-bin-i . We observe a similar behaviour as mentioned above . Note that since the binning is independent , the boundaries of training-bin-imay not be exactly the same as that of validation-bin-i , however as shown in Figure 11 Appendix C ( along with rest of the bins and their bin boundaries ) , they are quite close , meaning that a training group in lower ( /middle/higher ) probability region have good correspondence with the validation group in a similar nearby region . Going forward , for the ease of algorithm design , we will simply stick to the case of `` common binning '' where training samples are grouped as per validation-bin boundaries . This will allows us to maintain a one-to-one correspondence between the boundaries of the ith training and validation group .
This paper studies the calibration of deep learning, which aims to make confidence store accurately describe predictions' correctness probabilities. The authors improve focal loss and propose a calibration-aware focal loss for better calibration. The proposed approach adaptively adjusts the coefficient of focal loss according to the momentums and current predictions' confidence. The authors conduct experiments on SVNH, CIFAR10/100 datasets to verify the approach's efficacy.
SP:7a78356d71affb20e118d817bb2b0b5f34d8d075
AdaFocal: Calibration-aware Adaptive Focal Loss
1 INTRODUCTION . Neural networks have found tremendous success in almost every field including computer vision , natural language processing , and speech recognition . Over time , these networks have grown complex and larger in size to achieve state-of-the-art performance and they continue to evolve further in that direction . However , it has been well established that such high capacity networks suffer from poor calibration Guo et al . ( 2017 ) , i.e . the confidence scores of the predictions do not reflect the real world probabilities of those predictions being true . For example , if the network assigns 0.8 confidence to a set of predictions , we should expect 80 % of those predictions to be correct . However , this is far from reality since modern networks tend to be grossly over-confident . This is of great concern , particularly for mission-critical applications such as autonomous driving , medical diagnosis , wherein the downstream decision making not only rely on the predictions but also on their confidence . In recent years , there has been a growing interest in developing methods for calibrating neural networks . These can be mainly divided into two categories ( 1 ) post-hoc approaches that perform calibration after training ( 2 ) methods that calibrate the model during training itself . The first includes methods such as Platt scaling Platt ( 1999 ) , histogram binning Zadrozny & Elkan ( 2001 ) , Isotonic regression Zadrozny & Elkan ( 2002 ) , Bayesian binning and averaging Naeini et al . ( 2015 ) ; Naeini & Cooper ( 2016 ) , and Spline fitting Gupta et al . ( 2021 ) . Methods in the second category focus on training the model on an objective function that accounts for calibration as well , including Maximum Mean Calibration Error ( MMCE ) Kumar et al . ( 2018 ) , Label smoothing Müller et al . ( 2019 ) , and recently focal loss Mukhoti et al . ( 2020 ) . These methods aim to produce inherently calibrated models which when combined with post training calibration methods lead to further improvements . Contribution . Our work falls into the second category . We build upon the calibration properties of focal loss to propose a modification that further improves its performance . Firstly , we make the observation that while regular focal loss , with a fixed γ parameter , improves the overall calibration by preventing samples from being over-confident , it also leaves other samples under-confident . To address this drawback , we propose a modification to the focal loss called AdaFocal that adjusts the γ for each training sample ( or rather a group of samples ) separately by taking into account the model ’ s under/over-confidence about a similar corresponding group in the validation set . We evaluate the performance of our method on four image classification tasks : CIFAR-10 , CIFAR-100 , Tiny-ImageNet and ImageNet , and one text classification task : 20 Newsgroup , using various model architectures , and show that AdaFocal substantially outperforms the regular focal loss and other state-of-the-art calibration techniques in the literature . We further study the performance of AdaFocal on an out-of-distribution detection task and find it to perform better than the competing methods . Finally , we find that the models trained using AdaFocal get innately calibrated to a level that most times do not significantly benefit from temperature scaling . 2 PROBLEM SETUP AND DEFINITIONS . Consider a classification setting where we are given a set of training data { ( xn , ytrue , n ) } , with xn ∈ X being the input and ytrue , i ∈ Y = { 1 , 2 , . . . , K } the associated ground-truth label . Using this data we wish to train a classifier fθ ( x ) that outputs a vector p̂ over theK classes . We also assume access to a validation set for hyper-parameter tuning and a test set for evaluating its performance . For example , fθ ( · ) can be a neural network with learnable parameters θ , x is an image , and p̂ is the output of a softmax layer whose kth element p̂k is the probability score for class k. We refer to ŷ = argmaxk∈Y p̂k as the network ’ s prediction and the associated probability score p̂ŷ as the predicted confidence , and the same quantity for the jth example is p̂ŷ , j . In this setting , a network is said to be perfectly calibrated if the predicted confidence p̂ŷ reflects the true probability of the network classifying x correctly i.e . P ( ŷ = ytrue | p̂ŷ = p ) = p , ∀p ∈ [ 0 , 1 ] Guo et al . ( 2017 ) . Continuing our example , if the network assigns an average confidence score of 0.8 to a set of predictions then we should expect 80 % of those to be correct . We define Calibration Error as E = p̂ŷ − P ( ŷ = ytrue | p̂ŷ ) and the Expected Calibration Error as Ep̂ŷ [ E ] = Ep̂ŷ [ |p̂ŷ − P ( ŷ = ytrue | p̂ŷ ) | ] Guo et al . ( 2017 ) . However , as the true calibration error can not be computed empirically with a finite sized dataset , the following three approximations are generally used in the literature . That is , for a dataset { ( xn , ytrue , n ) } Nn=1 , ( 1 ) ECE = ∑M i=1 |Bi| N |Ci − Ai| Guo et al . ( 2017 ) , where Bi is equal-width bin that contains all examples j with p̂ŷ , j in the range [ iM , i+1 M ) , Ci = 1 |Bi| ∑ j∈Bi p̂ŷ , j is the average confidence and Ai = 1 |Bi| ∑ j∈Bi 1 ( ŷj = ytrue , j ) is the bin accuracy . Note that Ei = Ci − Ai is the empirical approximation of the calibration error E , ( 2 ) AdaECE = ∑M i=1 |Bi| N |Ci − Ai| Nguyen & O ’ Connor ( 2015 ) , where ∀i , j |Bi| = |Bj | are adaptively sized ( equal-mass ) bins that contain an equal number of samples , and ( 3 ) ClasswiseECE Kumar et al . ( 2018 ) ; Kull et al . ( 2019 ) estimates the calibration over all K classes : ClasswiseECE = 1 K ∑M i=1 ∑K k=1 |Bi , k| N |Ci , k −Ai , k| where Ci , k = 1 |Bi , k| ∑ j∈Bi , k p̂k , j is the average confidence for the kth class and Ai , k = 1|Bi , k| ∑ j∈Bi , k 1 ( ytrue , j = k ) is the accuracy of the kth class in the ith bin . Lastly , as ECE has been shown to be a biased estimate of true calibration Vaicenavicius et al . ( 2019 ) , we additionally use two de-biased estimates of ECE namely ECEdebiased proposed in Kumar et al . ( 2019 ) and ECEsweep proposed in Roelofs et al . ( 2021 ) to further confirm our results . 3 CALIBRATION PROPERTIES OF FOCAL LOSS . Focal loss Lin et al . ( 2017 ) LFL ( p ) = − ( 1 − p ) γ log p was originally proposed to improve the accuracy of classifiers by focusing on hard examples and down-weighting well classified examples . Recently it was further shown that focal loss may also result in significantly better calibrated models than cross entropy Mukhoti et al . ( 2020 ) . This is because , based on the relation : LFL ≥ KL ( q||p̂ ) − γH ( p̂ ) where q is the one-hot target vector , focal loss while minimising the main KL divergence objective also increases the entropy of the prediction p̂ . As a consequence this prevents the network from being overly confident on wrong predictions and overall improves calibration . The regular focal loss with fixed γ , as we show in this section , does not achieve the best calibration . In Figure 1 , we plot the calibration behaviour of ResNet50 in different bins when trained on CIFAR-10 with different focal losses . The ith bin ’ s calibration error subscripted by `` val '' Eval , i = Cval , i−Aval , i is computed on the validation set using 15 equal-mass binning . The figure shows the lowest ( bin-0 ) , a middle ( bin-7 ) and highest bin ( bin-7 ) . For reference , the rest of the bins and their bin boundaries are shown in Appendix B . From Figure 1 ( a ) , we see that although focal loss γ = 4 achieves the overall lowest calibration error ( AdaECE ) , there ’ s no single γ that performs the best across all the bins . For example , in bin-0 γ = 4 , 5 seems to achieve better calibration whereas γ = 0 , 3 are over-confident . For bin-7 , on the other hand , γ = 3 seems to be better calibrated whereas γ = 4 , 5 are under-confident and γ = 0 is over-confident . This clearly indicates that using different γs for different bins can further improve the calibration . Such an attempt is presented in Mukhoti et al . ( 2020 ) called the Sample-Dependent Focal Loss ( FLSD-53 ) which assigns γ = 5 if the training sample ’ s true class posterior p̂ytrue ∈ [ 0 , 0.2 ) and γ = 3 if p̂ytrue ∈ [ 0.2 , 1 ] . However , this strategy is fixed for every dataset-model pair and is based on simple heuristics of choosing higher γ for smaller values of p̂ytrue and relatively lower γ for higher values of p̂ytrue . However , from Figure 1 ( b ) , we see that FLSD-53 is also not the best strategy across all the bins . This , therefore , motivates the design of a γ selection strategy that can assign an appropriate γ for each bin based on the magnitude and sign of Eval , i . However , in order to design such a strategy we need solutions to the following two major challenges : 1 . How do we find some correspondence between the `` confidence of training samples '' , which we can manipulate during training by adjusting the entropy regularising parameter γ , and the `` confidence of the validation samples '' , which we want to be actually manipulated but do not have direct control over ? In other words , in order to indirectly control the confidence of a particular group of validation samples , how do we know which particular group of training samples ’ confidence to be manipulated ? 2 . Given that there is a correspondence between a training group and a validation group ( even if it ’ s loose ) , how do we arrive at the exact values of γ that will lead to better calibration ? We try to answer the first question in the next section and the answer to the second question leads to AdaFocal which is the main contribution of the paper . 4 CORRESPONDENCE BETWEEN CONFIDENCE OF TRAIN AND VAL . SAMPLES . In order to find some correspondence , an intuitive thing to do would be to group the validation samples into M equal-mass validation-bins , and then use these validation-bin boundaries to group the training samples as well . Then , we can compare the average confidence of the validation samples and the average confidence of the training samples , in the same validation-bin , to check for any correspondence . Quantities of interest For binning validation samples , we always look at the confidence of the top predicted class ŷ denoted by p̂val , top ( bin average : Cval , top ) . For training samples , on the other hand , instead of the confidence of the top predicted class ŷ denoted by p̂train , top ( bin average : Ctrain , top ) , we will focus on the confidence of the true class ytrue denoted by p̂train , true ( average : Ctrain , true ) because during training we only care about p̂train , true which is manipulated through some loss function . For reference however , Figure 10 in Appendix C compares Ctrain , true and Ctrain , top to show that as the training set accuracy approaches 100 % , the top predicted class and the true class for a training sample become the same . Henceforth , for a cleaner notation , we will always refer to Ctrain ≡ Ctrain , true and Cval ≡ Cval , top . Common binning When training samples are grouped using the bin boundaries of the validationbins . In Figure 2 ( b ) , we compareCtrain , i in validation-bin-i 1 withCval , i in the same validation-bin-i , and find that there is indeed a good correspondence between the two quantities . For example in Figure 2 ( b ) , as γ increases from 0 , 3 to 5 , the solid-line ( Ctrain , i ) gets lower , and the same behaviour is observed on the starred-line ( Cval , i ) as well . For completeness , rest of the bins are shown in Figure 12 Appendix C. This is very encouraging as now we can expect ( even though loosely ) that if we increase/decrease the confidence of a group of training samples in some lower ( or middle , or higher ) probability region then the same will be reflected on a similar group of validation samples in lower ( or middle , or higher ) probability region . This therefore provides a way to indirectly control the value of Cval , i by manipulating Ctrain , i , and from a calibration point of view , our strategy going forward would be to exploit this correspondence to keep Ctrain , i ( which we have control over during training ) closer to Aval , i ( the validation set accuracy in validation-bin-i ) so that Cval , i also stays closer to Aval , i to overall reduce the calibration error Eval , i = Cval , i −Aval , i . Independent binning Before proceeding , for completeness , we also look at the case when training samples and validation samples are grouped independently into their respective training-bins and validation-bins . Figure 2 ( a ) compares Ctrain , i in training-bin-i with Cval , i in validation-bin-i . We observe a similar behaviour as mentioned above . Note that since the binning is independent , the boundaries of training-bin-imay not be exactly the same as that of validation-bin-i , however as shown in Figure 11 Appendix C ( along with rest of the bins and their bin boundaries ) , they are quite close , meaning that a training group in lower ( /middle/higher ) probability region have good correspondence with the validation group in a similar nearby region . Going forward , for the ease of algorithm design , we will simply stick to the case of `` common binning '' where training samples are grouped as per validation-bin boundaries . This will allows us to maintain a one-to-one correspondence between the boundaries of the ith training and validation group .
This paper considers the problem of model calibration. Existing works calibrates the model by post-hoc approaches or objective function tailored for calibration. The authors of the paper propose an adaptive version based on Focal loss, which regularizes the overconfidence of neural networks. They observe that although focal loss improves the calibration, it leaves out the under-confident samples. To mitigate the issue, they propose adjusting the hyper-parameter $\gamma$ in focal loss according to the model's under/over-confidence. Experiments on vision and NLP classification tasks showcase the effectiveness of the adaptive version.
SP:7a78356d71affb20e118d817bb2b0b5f34d8d075
RainNet: A Large-Scale Imagery Dataset for Spatial Precipitation Downscaling
Contemporary deep learning frameworks have been applied to solve meteorolog-1 ical problems ( e.g. , front detection , synthetic radar generation , precipitation now-2 casting , e.t.c . ) and have achieved highly promising results . Spatial precipitation3 downscaling is one of the most important meteorological problems . However,4 the lack of a well-organized and annotated large-scale dataset hinders the training5 and verification of more effective and advancing deep-learning models for precip-6 itation downscaling . To alleviate these obstacles , we present the first large-scale7 spatial precipitation downscaling dataset named RainNet , which contains more8 than 62 , 400 pairs of high-quality low/high-resolution precipitation maps for over9 17 years , ready to help the evolution of deep models in precipitation downscal-10 ing . Specifically , the precipitation maps carefully collected in RainNet cover var-11 ious meteorological phenomena ( e.g. , hurricane , squall , e.t.c . ) , which is of great12 help to improve the model generalization ability . In addition , the map pairs in13 RainNet are organized in the form of image sequences ( 720 maps per month or14 1 map/hour ) , showing complex physical properties , e.g. , temporal misalignment,15 temporal sparse , and fluid properties . Two machine-learning-oriented metrics are16 specifically introduced to evaluate or verify the comprehensive performance of the17 trained model , ( e.g. , prediction maps reconstruction accuracy ) . To illustrate the18 applications of RainNet , 14 state-of-the-art models , including deep models and19 traditional approaches , are evaluated . To fully explore potential downscaling so-20 lutions , we propose an implicit physical estimation framework to learn the above21 characteristics . Extensive experiments demonstrate that the value of RainNet in22 training and evaluating downscaling models.23 1 INTRODUCTION24 Deep learning has made an enormous breakthrough in the field of computer vision , which is ex-25 tremely good at extracting valuable knowledge from numerous amounts of data . In recent years,26 with computer science development , a deluge of Earth system data is continuously being obtained,27 coming from sensors all over the earth and even in space . These ever-increasing massive amounts of28 data with different sources and structures challenge the geoscience community , which lacks practi-29 cal approaches to understand and further utilize the raw data ( Reichstein et al . ( 2019 ) ) . Specifically,30 several preliminary works ( Groenke et al . ( 2020 ) ; White et al . ( 2019 ) ; He et al . ( 2016 ) ; Ravuri et al.31 ( 2021 ) ; Angell & Sheldon ( 2018 ) ; Veillette et al . ( 2020 ) ) try to introduce machine learning and deep32 learning frameworks to solve meteorological problems , e.g. , spatial precipitation downscaling.33 In this paper , we focus on the spatial precipitation downscaling task . Spatial precipitation down-34 scaling is a procedure to infer high-resolution meteorological information from low-resolution vari-35 ables , which is one of the most important upstream components for meteorological task ( Bauer et al.36 ( 2015 ) ) . The precision of weather and climate prediction is highly dependent on the resolution and37 reliability of the initial environmental input variables , and spatial precipitation downscaling is the38 most promising solution . The improvement of the weather/climate forecast and Geo-data quality39 saves tremendous money and lives ; with the fiscal year 2020 budget over $ 1 billion , NSF funds40 thousands of colleges in the U.S. to research on these topics ( NSF ( 2020 ) ) .41 Unfortunately , there are looming issues hinders the research of spatial precipitation downscaling42 in the machine learning community : 1 ) . Lack of ” machine-learning ready ” datasets . The existing43 machine-learning-based downscaling methods are only applied to ideal retrospective problems and44 verified on simulated datasets ( e.g. , mapping bicubic of precipitation generated by weather fore-45 cast model to original data ( Berrisford et al . ( 2011 ) ) ) , which significantly weakens the credibility46 of the feasibility , practicability , and effectiveness of the methods . It is worth mentioning that the47 data obtained by the simulated degradation methods ( e.g. , bicubic ) is completely different from the48 real data usually collected by two measurement systems ( e.g. , satellite and radar ) with different49 precision . The lack of a well-organized and annotated large-scale dataset hinders the training and50 verification of more effective and complex deep-learning models for precipitation downscaling . 2 ) .51 Lack of tailored metrics to evaluate machine-learning-based frameworks . Unlike deep learning ( DL ) 52 and machine learning ( ML ) communities , scientists in meteorology usually employ maps/charts to53 assessing downscaling models case by case based on domain knowledge ( He et al . ( 2016 ) ; Walton54 et al . ( 2020 ) ) , which hinders the application of Rainnet in DL/ML communities . For example , ( He55 et al . ( 2016 ) ) use log-semivariance ( spatial metrics for local precipitation ) , quantile-quantile maps56 to analyzing the maps . 3 ) . an efficient downscaling deep-learning framework should be established.57 Contrary to image data , this real precipitation dataset covers various types of real meteorological58 phenomena ( e.g. , Hurricane , Squall , e.t.c . ) , and shows the physical characters ( e.g. , temporal mis-59 alignment , temporal sparse and fluid properties , e.t.c . ) that challenge the downscaling algorithms.60 Traditional computationally dense physics-driven downscaling methods are powerless to handle the61 increasing meteorological data size and flexible to multiple data sources.62 To alleviate these obstacles , we propose the first large-scale spatial precipitation downscaling dataset63 named RainNet , which contains more than 62 , 400 pairs of high-quality low/high-resolution precip-64 itation maps for over 17 years , ready to help the evolution of deep models in spatial precipitation65 downscaling . The proposed dataset covers more than 9 million square kilometers of land area , which66 contains both wet and dry seasons and diverse meteorological phenomena . To facilitate DL/ML and67 other researchers to use RainNet , we introduce 6 most concerning indices to evaluate downscaling68 models : mesoscale peak precipitation error ( MPPE ) , heavy rain region error ( HRRE ) , cumulative69 precipitation mean square error ( CPMSE ) , cluster mean distance ( CMD ) , heavy rain transition speed70 ( HRTS ) and average miss moving degree ( AMMD ) . In order to further simplify the application of in-71 dices , we abstract them into two weighted and summed metrics : Precipitation Error Measure ( PEM ) 72 and Precipitation Dynamics Error Measure ( PDEM ) . Unlike video super-resolution , the motion of73 the precipitation region is non-rigid ( i.e. , fluid ) , while video super-resolution mainly concerns rigid74 body motion estimation . To fully explore how to alleviate the mentioned predicament , we propose75 an implicit dynamics estimation driven downscaling deep learning model . Our model hierarchi-76 cally aligns adjacent precipitation maps , that is , implicit motion estimation , which is very simple77 but exhibits highly competitive performance . Based on meteorological science , we also proved that78 the dataset we constructed contained the full information people may need to recover the higher79 resolution observations from lower resolution ones.80 The main contributions of this paper are:81 • To the best of our knowledge , we present the first REAL ( non-simulated ) Large-Scale Spa-82 tial Precipitation Downscaling Dataset for deep learning ; 83 • We introduce 2 simple metrics to evaluate the downscaling models ; 84 • We propose a downscaling model with strong competitiveness . We evaluate 14 competitive85 potential solutions on the proposed dataset , and analyze the feasibility and effectiveness of86 these solutions.87 2 BACKGROUND88 At the beginning of the 19th century , geoscientists recognized that predicting the state of the atmo-89 sphere could be treated as an initial value problem of mathematical physics , wherein future weather90 is determined by integrating the governing partial differential equations , starting from the observed91 current weather . Today , this paradigm translates into solving a system of nonlinear differential92 equations at about half a billion points per time step and accounting for dynamic , thermodynamic,93 radiative , and chemical processes working on scales from hundreds of meters to thousands of kilo-94 meters and from seconds to weeks ( Bauer et al . ( 2015 ) ) . The Navier–Stokes and mass continuity95 equations ( including the effect of the Earth ’ s rotation ) , together with the first law of thermodynamics96 and the ideal gas law , represent the full set of prognostic equations in the atmosphere , describing the97 change in space and time of wind , pressure , density and temperature is described ( formulas given in98 supplementary ) ( Bauer et al . ( 2015 ) ) . These equations have to be solved numerically using spatial99 and temporal discretization because of the mathematical intractability of obtaining analytical solu-100 tions , and this approximation creates a distinction between so-called resolved and unresolved scales101 of motion.102 2.1 SPATIAL DOWNSCALING OF PRECIPITATION103 The global weather forecast model , treated as a computational problem , relying on high-quality104 initial data input . The error of weather forecast would increase exponentially over time from this105 initial error of input dataset . Downscaling is one of the most important approaches to improve the106 initial input quality . Precipitation is one of the essential atmospheric variables that are related to daily107 life . It could easily be observed , by all means , e.g. , gauge station , radar , and satellites . Applying108 downscaling methods to precipitation and creating high-resolution rainfall is far more meaningful109 than deriving other variables , while it is the most proper initial task to test deep learning ’ s power110 in geo-science . The traditional downscaling methods can be separated into dynamic and statistical111 downscaling.112 Dynamic downscaling treats the downscaling as an optimization problem constraint on the physical113 laws . The dynamic downscaling methods find the most likely precipitation over space and time114 under the pre-defined physical law . It usually takes over 6 hours to downscale a 6-hour precipitation115 scenario globally on supercomputers ( Courtier et al . ( 1994 ) ) . As the dynamic downscaling relying116 on pre-defined known macroscopic physics , a more flexible weather downscaling framework that117 could easily blend different sources of observations and show the ability to describe more complex118 physical phenomena on different scales is desperately in need.119 Statistical downscaling is trying to speed up the dynamic downscaling process . The input of statisti-120 cal downscaling is usually dynamic model results or two different observation datasets on different121 scales . However , due to the quality of statistical downscaling results , people rarely apply statistical122 downscaling to weather forecasts . These methods are currently applied in the tasks not requir-123 ing high data quality but more qualitative understanding , e.g. , climate projection , which forecasts124 the weather for hundreds of years on coarse grids and using statistical downscaling to get detailed125 knowledge of medium-scale future climate system.126 3 RAINNET : SPATIAL PRECIPITATION DOWNSCALING IMAGERY DATASET127 3.1 DATA COLLECTION AND PROCESSING128 To build up a standard realistic ( non-simulated ) downscaling dataset for computer vision , we129 selected the eastern coast of the United States , which covers a large region ( 7 million km2 ; 130 105◦ ∼ 65◦W , 25◦ ∼ 50◦N , GNU Free Documentation License 1.2 ) and has a 20-year high-quality131 precipitation observations . We collected two precipitation data sources from National Stage IV QPE132 Product ( StageIV ( Nelson et al . ( 2016 ) ) ; high resolution at 0.04◦ ( approximately 4km ) , GNU Free133 Documentation License 1.2 ) and North American Land Data Assimilation System ( NLDAS ( Xia134 et al . ( 2012 ) ) ; low resolution at 0.125◦ ( approximately 13km ) ) . StageIV is mosaicked into a na-135 tional product at National Centers for Environmental Prediction ( NCEP ) , from the regional hourly/6-136 hourly multi-sensor ( radar+gauges ) precipitation analyses ( MPEs ) produced by the 12 River Fore-137 cast Centers over the continental United States with some manual quality control done at the River138 Forecast Centers ( RFCs ) . NLDAS is constructed quality-controlled , spatially-and-temporally con-139 sistent datasets from the gauges and remote sensors to support modeling activities . Both products140 are hourly updated and both available from 2002 to the current age.141 In our dataset , we further selected the eastern coast region for rain season ( July ∼ November,142 covering hurricane season ; hurricanes pour over 10 % annual rainfall in less than 10 days ) . We143 matched the coordinate system to the lat-lon system for both products and further labeled all the144 hurricane periods happening in the last 17 years . These heavy rain events are the largest challenge145 for weather forecasting and downscaling products . As heavy rain could stimulus a wide-spreading146 flood , which threatening local lives and arousing public evacuation . If people underestimate the147 rainfall , a potential flood would be underrated ; while over-estimating the rainfall would lead to148 unnecessary evacuation orders and flood protection , which is also costly.149 3.2 DATASET STATISTICS150 At the time of this work , we have collected and processed precipitation data for the rainy season151 for 17 years from 2002 to 2018 . One precipitation map pair per hour , 24 precipitation map pairs152 per day . In detail , we have collected 85 months or 62424 hours , totaling 62424 pairs of high-153 resolution and low-resolution precipitation maps . The size of the high-resolution precipitation map154 is 624 × 999 , and the size of the low-resolution is 208 × 333 . Various meteorological phenomena155 and precipitation conditions ( e.g. , hurricanes , squall lines , e.t.c . ) are covered in these data . The156 precipitation map pairs in RainNet are stored in HDF5 files that make up 360 GB of disk space . We157 select 2 typical meteorological phenomena and visualize them in Fig . 1 . Our data is collected from158 satellites , radars , gauge stations , e.t.c. , which covers the inherent working characteristics of different159 meteorological measurement systems . Compared with traditional methods that generate data with160 different resolutions through physical model simulation , our dataset is of great help for deep models161 to learn real meteorological laws.162 3.3 DATASET ANALYSIS163 In order to help design a more appropriate and effective precipitation downscaling model , we have164 explored the property of the dataset in depth . As mentioned above , our dataset is collected from mul-165 tiple sensor sources ( e.g. , satellite , weather radar , e.t.c . ) , which makes the data show a certain extent166 of misalignment . Our efforts here are not able to vanquish the misalignment . This is an intrinsic167 problem brought by the fusion of multi-sensor meteorological data . Limited by observation meth-168 ods ( e.g. , satellites can only collect data when they fly over the observation area ) , meteorological169 data is usually temporal sparse , e.g. , in our dataset , the sampling interval between two precipitation170 maps is one hour . The temporal sparse leads to serious difficulties in the utilization of precipitation171 sequences . Additionally , the movement of the precipitation position is directly related to the cloud.172 It is a fluid movement process that is completely different from the rigid body movement concerned173 in Super-Resolution . At the same time , the cloud will grow or dissipate in the process of flowing174 and even form new clouds , which further complicates the process . In the nutshell , although existed175 SR is a potential solution for downscaling , there is a big difference between the two . Especially,176 the three characteristics of downscaling mentioned above : temporal misalignment , temporal sparse,177 fluid properties , which make the dynamic estimation of precipitation more challenging.178 4 EVALUATION METRICS179 Due to the difference between downscaling and traditional figure super-resolution , the metrics that180 work well under SR tasks may not be sufficient for precipitation downscaling . By gathering the181 metrics from the meteorologic literature ( the literature includes are Zhang & Yang ( 2004 ) ; Maraun182 et al . ( 2015 ) ; Ekström ( 2016 ) ; He et al . ( 2016 ) ; Pryor & Schoof ( 2020 ) ; Wootten et al . ( 2020 ) ) ,183 we select and rename 6 most common metrics ( a metrics may have multiple names in different184 literature ) to reflect the downscaling quality : mesoscale peak precipitation error ( MPPE ) , cumulative185 precipitation mean square error ( CPMSE ) , heavy rain region error ( HRRE ) , cluster mean distance186 ( CMD ) , heavy rain transition speed ( HRTS ) and average miss moving degree ( AMMD ) .These 6187 metrics can be separated as reconstruction metrics : MPPE , HRRE , CPMSE , AMMD , and dynamic188 metrics : HRTS and CMD.189 The MPPE ( mm/hour ) is calculated as the difference of top quantile between the generated/real190 rainfall dataset which considering both spatial and temporal property of mesoscale meteorological191 systems , e.g. , hurricane , squall . This metric is used in most of these papers ( for example Zhang192 & Yang ( 2004 ) ; Maraun et al . ( 2015 ) ; Ekström ( 2016 ) ; He et al . ( 2016 ) ; Pryor & Schoof ( 2020 ) ; 193 Wootten et al . ( 2020 ) suggest the quantile analysis to evaluate the downscaling quality ) .194 The CPMSE ( mm2/hour2 ) measures the cumulative rainfall difference on each pixel over the time-195 axis of the test set , which shows the spatial reconstruction property . Similar metrics are used in196 Zhang & Yang ( 2004 ) ; Maraun et al . ( 2015 ) ; Wootten et al . ( 2020 ) calculated as the pixel level197 difference of monthly rainfall and used in He et al . ( 2016 ) as a pixel level difference of cumulative198 rainfall with different length of record.199 The HRRE ( km2 ) measures the difference of heavy rain coverage on each time slide between gen-200 erated and labeled test set , which shows the temporal reconstruction ability of the models . The201 AMMD ( radian ) measures the average angle difference between main rainfall clusters . Similar202 metrics are used in Zhang & Yang ( 2004 ) ; Maraun et al . ( 2015 ) ; Wootten et al . ( 2020 ) as rainfall203 coverage of a indefinite number precipitation level and used in He et al . ( 2016 ) ; Pryor & Schoof204 ( 2020 ) as a continuous spatial analysis.205 As a single variable dataset , it is hard to evaluate the ability of different models to capture the206 precipitation dynamics when temporal information is not included ( a multi-variable dataset may207 have wind speed , a typical variable representing dynamics , included ) . So here we introduce the208 first-order temporal and spatial variables to evaluate the dynamical property of downscaling results.209 Similar approaches are suggested in Maraun et al . ( 2015 ) ; Ekström ( 2016 ) ; Pryor & Schoof ( 2020 ) .210 The CMD ( km ) physically compares the location difference of the main rainfall systems between211 the generated and labeled test set , which could be also understand as the RMSE of the first order212 derivative of precipitation data on spatial directions.The HRTS ( km/hour ) measures the difference213 between the main rainfall system moving speed between the generated and labeled test set which214 shows the ability for models to capture the dynamic property , which could be also understand as the215 RMSE of the first order derivative of precipitation data on temporal direction.Similar metrics are216 suggested in Maraun et al . ( 2015 ) ; Ekström ( 2016 ) ; Pryor & Schoof ( 2020 ) as the auto-regression217 analysis and the differential analysis.218 More details about the metrics and their equations are given in supplementary materials . One met-219 rics group ( MPPE , HRRE , CPMSE , AMMD ) mainly measures the rainfall deviation between the220 generated precipitation maps and GT . The other group ( HRTS and CMD ) mainly measures the221 dynamic deviation of generated precipitation maps . In order to further simplify the application222 of indices , we abstract them into two weighted and summed metrics : Precipitation Error Mea-223 sure ( PEM ) and Precipitation Dynamics Error Measure ( PDEM ) . We first align the dimensions224 of these two groups of metrics respectively . The first group of metrics ( MPPE , HRRE , CPMSE,225 AMMD ) is normalized , weighted and summed to get the precipitation error measure ( PEM ) . Ac-226 cording to Gupta et al . ( 1999 ) , all the metrics are transferred to Percent Bias ( PBIAS ) to be suit-227 able for metrics weighting . The original definition of PBIAS is the bias divided by observation , as228 PBIAS = |Qmodel − Qobs|/|Qobs| . Here we rewrite the original metrics to PBIAS by dividing229 the metrics with annual mean observations of the original variables ( AMO ) , as PBIASPEMi =230 |MetricsPEMi |/|AMOPEMi | , MetricsPEMi = { MPPE , HRRE , CPMSE , AMMD } . In our231 dataset , AMOPEMMPPE = 64 , AMO PEM HRREM = 533 , AMO PEM CPMSE = 0.64 , AMO PEM AMMD = 332,232 AMOPEMHRTS = 15 , AMO PEM CMD = 26 . The metrics then are ensembled to a single metric233 ( PEM ) with equal weight , as PEM = ∑ i 0.25 · PBIASPEMi . Following the same procedure,234 we then ensemble the second group of dynamic metrics ( HRTS and CMD ) to a single metrics235 PDEM = ∑ i 0.5 · PBIASPDEMi .236 We also include the most common used metrics RMSE as one single metrics in our metrics list.237 RMSE could evaluate both reconstruction and dynamic property of the downscaling result.238 5 APPLICATIONS OF RAINNET IN SPATIAL PRECIPITATION DOWNSCALING239 As a potential solution , Super-Resolution ( SR ) frameworks are generally divided into the Single-240 Image Super-Resolution ( SISR ) and the Video Super-Resolution ( VSR ) . Video Super-Resolution is241 able to leverage multi-frame information to restore images , which better matches the nature of down-242 scaling . We will demonstrate this judgment in Sec . 6.1 . The VSR pipeline usually contains three243 components : deblurring , inter-frame alignment , and super-resolution . Deblurring and inter-frame244 alignment are implemented by the motion estimation module . There are four motion estimation245 frameworks : 1 ) . RNN based ( Keys ( 1981 ) ; Tao et al . ( 2017 ) ; Huang et al . ( 2015 ) ; Haris et al.246 ( 2019 ) ) ; 2 ) . Optical Flow ( Xue et al . ( 2019 ) ) ; 3 ) . Deformable Convolution based ( Tian et al . ( 2020 ) ; 247 Xiang et al . ( 2020 ) ; Wang et al . ( 2019 ) ) ; 4 ) . Temporal Concatenation ( Jo et al . ( 2018 ) ; Caballero248 et al . ( 2017 ) ; Liao et al . ( 2015 ) ) . In fact , there is another motion estimation scheme proposed for249 the first time in the noise reduction task ( Tassano et al . ( 2020 ) ) , which achieves an excellent video250 noise reduction performance . Inspired by ( Tassano et al . ( 2020 ) ) , we design an implicit dynamics251 estimation model for the spatial precipitation downscaling . It is worth mentioning that our proposed252 model and the above four frameworks together form a relatively complete candidate set of dynamic253 estimation solutions.254 Proposed Framework . As shown in Fig . 2 , our framework consists of two components : Implicit255 dynamic estimation module and downscaling Backbone . These two parts are trained jointly . Suppose256 there areN adjacent low-resolution precipitation maps { IL T−N−12 , .. , ILT , ... , I L T+N−12 } . The task is to257 reconstruct the high-resolution precipitation map IHT of I L T . The implicit dynamic estimation module258 is composed of multiple vanilla networks A = { A1 , ... , AN−2 } ( N = 5 in this paper ) sharing259 weights . Each vanilla network receives three adjacent frames as input , outputs , and intermediate260 results . The intermediate result can be considered as a frame with implicit dynamic alignment . We261 concatenate all the intermediate frames as the input of the next module . The specific structure of262 the vanilla network can be found in the supplementary materials . The main task of the downscaling263 backbone is to restore the high-resolution precipitation map IHT based on the aligned intermediate264 frames . In order to make full use of multi-scale information , we use multiple Residual-in-Residual265 Dense Blocks ( Wang et al . ( 2018 ) ) in the network . We employ the interpolation+convolution ( Odena266 et al . ( 2016 ) ) as the up-sampling operator to reduce the checkerboard artifacts . After processing by267 downscaling backbone we get the final estimated HR map ÎHT .268 Model objective . The downscaling task is essentially to restore high-resolution precipitation maps.269 We learn from the super-resolution task and also applyL1 and perceptual loss ( Johnson et al . ( 2016 ) ) 270 as the training loss of our model . The model objective is shown below:271 L ( ̂IHT , IHT ) =‖ ÎHT − IHT ‖1 +λ ‖ φ ( ̂IHT ) − φ ( IHT ) ‖2 , ( 1 ) where φ denotes the pre-trained VGG19 network ( Simonyan & Zisserman ( 2015 ) ) , we select the272 Relu5 − 4 ( without the activator ( Wang et al . ( 2018 ) ) ) as the output layer . λ is the coefficient to273 balance the loss terms . λ = 20 in our framework.274 6 EXPERIMENTAL EVALUATION275 We conduct spatial precipitation downscaling experiments to illustrate the application of our276 proposed RainNet and evaluate the effectiveness of the benchmark downscaling frameworks . Fol-277 lowing the mainstream evaluation protocol of DL/ML communities , cross-validation is employed.278 In detail , we divide the dataset into 17 parts ( 2002.7∼2002.11 , 2003.7∼2003.11 , 2004.7∼2004.11,279 2005.7∼2005.11 , 2006.7∼2006.11 , 2007.7∼2007.11 , 2008.7∼2008.11 , 2009.7∼2009.11,280 2010.7∼2010.11 , 2011.7∼2011.11 , 2012.7∼2012.11 , 2013.7∼2013.11 , 2014.7∼2014.11,281 2015.7∼2015.11 , 2016.7∼2016.11 , 2017.7∼2017.11 , 2018.7∼2018.11 ) by year , and sequentially282 employ each year as the test set and the remaining 16 years as the training set , that is , 17-fold283 cross-validation . All models maintain the same training settings and hyperparameters during the284 training phase . These data cover various complicated precipitation situations such as hurricanes,285 squall lines , different levels of rain , and sunny days . It is sufficient to select the rainy season of286 the year as the test set from the perspective of meteorology , as the climate of one area is normally287 stable.288 6.1 BASELINES289 The SISR/VSR and the spatial precipitation down-290 scaling are similar to some extent , so we argue that291 the SR models can be applied to the task as the292 benchmark models . The input of SISR is a single293 image , and the model infers a high-resolution image294 from it . Its main focus is to generate high-quality295 texture details to achieve pleasing visual effects . In296 contrast , VSR models input multiple frames of im-297 ages ( e.g. , 3 frames , 5 frames , e.t.c. ) . In our experi-298 ments , we employ 5 frames . The core idea of VSR299 models is to increase the resolution by complement-300 ing texture information between different frames . It301 is worth mentioning that VSR models generally are302 equipped with a motion estimation module to alle-303 viate the challenge of object motion to inter-frame304 information registration.305 We evaluated 7 state-of-the-art SISR frameworks306 ( i.e. , Bicubic ( Keys ( 1981 ) ) , SRCNN1 ( Dong307 et al . ( 2016 ) ) , SRGAN2 ( Ledig et al . ( 2017 ) ) ,308 1https : //github.com/yjn870/SRCNN-pytorch 2https : //github.com/leftthomas/SRGAN EDSR3 ( Lim et al . ( 2017 ) ) , ESRGAN4 ( Wang et al . ( 2018 ) ) , DBPN5 ( Haris et al . ( 2018 ) ) ,309 RCAN6 ( Zhang et al . ( 2018 ) ) and 5 VSR frameworks ( i.e. , SRGAN-V , EDSR-V , ESRGAN-V,310 RBPN7 ( Haris et al . ( 2019 ) ) , EDVR8 ( Wang et al . ( 2019 ) ) , of which 3 VSR methods ( i.e. , SRGAN-311 V , EDSR-V , ESRGAN-V ) are modified from SISR . In particular , we build SRGAN-V , EDSR-V and312 ESRGAN-V by concatenating multiple frames of precipitation maps as the input of the model . In313 addition , we also evaluated the traditional statistics method Kriging ( Stein ( 2012 ) ) , which is widely314 applied in weather forecasting . The mentioned 8 metrics are used to quantitatively evaluate the315 performance of these SR models and our method . Further , we select some disastrous weather as316 samples for qualitative analysis to test the model ’ s ability to learn the dynamic properties of the317 weather system . And we employ the implementation of Pytorch for Bicubic . We use 4 NVIDIA318 2080 Ti GPUs for training . We train all models with following setting . The batch size is set as 24.319 Precipitation maps are random crop into 64× 64 . We employ the Adam optimizer , beta1 is 0.9 , and320 beta2 is 0.99 . The initial learning rate is 0.001 , which is reduced to 1/10 every 50 epochs , and a total321 of 200 epochs are trained . We evaluate benchmark frameworks with 17-fold cross-validation . The322 downscaling performances are shown in Tab . 1 . We divide the indicators mentioned above into two323 groups . PDEM measures the model ’ s ability to learn the dynamics of precipitation . PEM illustrates324 the model ’ s ability to reconstruct precipitation.325 From Tab . 1 , we can learn that the overall performance of the VSR methods are better than SISR326 models , which shows that the dynamic properties mentioned above are extremely important for the327 downscaling model . Furthermore , it can be seen from Fig . 3 that the SISR method is clustered in the328 upper right corner of the scatter plot , and the VSR method is concentrated in the lower-left corner,329 which further shows that the dynamic properties of the VSR methods are overall better than the SISR330 methods . In addition , our method achieves the 1st best performance in RMSE , PDE , and achieve the331 second-best performance on PEM . The score shows that the implicit dynamic estimation framework332 3https : //github.com/sanghyun-son/EDSR-PyTorch 4https : //github.com/xinntao/ESRGAN 5https : //github.com/alterzero/DBPN-Pytorch 6https : //github.com/yulunzhang/RCAN 7https : //github.com/alterzero/RBPN-PyTorch 8https : //github.com/xinntao/EDVR used is feasible and effective . It is worth mentioning that the traditional downscaling method Kriging333 performs better than many deep learning models ( e.g. , SRGAN , ESRGAN ) 334 6.1.1 QUALITATIVE ANALYSIS335 We visualized the tropical cyclone precipitation map of the 166th hour ( 6th ) in September 2010336 and the high-resolution precipitation map generated by different methods . As shown in Fig . 4 , the337 best perceptual effects are generated by EDVR and Our framework . Zooming in the result image,338 the precipitation maps generated by SRGAN and EDSR present obvious checkerboard artifacts.339 The reason for the checkerboard artifacts should be the relatively simple and sparse texture pattern340 in precipitation maps . The results generated by Bicubic , RCAN , Kriging , and SRCNN are over-341 smooth . DBPN even can not reconstruct the eye of the hurricane . Especially , the result generated by342 Kriging is as fuzzy as the input LR precipitation map . In conclusion , the visual effects generated343 by the VSR methods are generally better than the SISR methods and the traditional method . From344 the perspective of quantitative and qualitative analysis , the dynamics estimation framework is very345 critical for downscaling.346 7 CONCLUSION347 In this paper , we built the first large-scale real precipitation downscaling dataset for the deep learning348 community . This dataset has 62424 pairs of HR and LR precipitation maps in total . We believe this349 dataset will further accelerate the research on precipitation downscaling . Furthermore , we analyze350 the problem in-depth and put forward three key challenges : temporal misalignment , temporal sparse,351 fluid properties . In addition , we propose an implicit dynamic estimation model to alleviate the above352 challenges . At the same time , we evaluated the mainstream SISR and VSR models and found that353 none of these models can solve RainNet ’ s problems well . Therefore , the downscaling task on this354 dataset is still very challenging.355 This work still remains several open problems . Currently , the data domain of this research is limited356 to the eastern U.S . In future research , we would enlarge the dataset to a larger domain . The dataset357 is only a single variable now . In future research , we may include more variables , e.g . temperature358 and wind speed.359 REFERENCES360 Rico Angell and Daniel R. Sheldon . Inferring latent velocities from weather radar data using gaus-361 sian processes . In Advances in Neural Information Processing Systems 31 : Annual Conference362 on Neural Information Processing Systems 2018 , NeurIPS 2018 , December 3-8 , 2018 , Montréal,363 Canada , pp . 8998–9007 , 2018.364 Peter Bauer , Alan Thorpe , and Gilbert Brunet . The quiet revolution of numerical weather prediction.365 Nature , 2015.366 P. Berrisford , D.P . Dee , P. Poli , R. Brugge , Mark Fielding , Manuel Fuentes , P.W . Kållberg,367 S. Kobayashi , S. Uppala , and Adrian Simmons . The era-interim archive version 2.0 . 2011.368 Jose Caballero , Christian Ledig , Andrew P. Aitken , Alejandro Acosta , Johannes Totz , Zehan Wang,369 and Wenzhe Shi . Real-time video super-resolution with spatio-temporal networks and motion370 compensation . In 2017 IEEE Conference on Computer Vision and Pattern Recognition , CVPR371 2017 , Honolulu , HI , USA , July 21-26 , 2017 . IEEE Computer Society , 2017.372 PHILIPPE Courtier , J-N Thépaut , and Anthony Hollingsworth . A strategy for operational imple-373 mentation of 4d-var , using an incremental approach . Quarterly Journal of the Royal Meteorolog-374 ical Society , 1994.375 Chao Dong , Chen Change Loy , Kaiming He , and Xiaoou Tang . Image super-resolution using deep376 convolutional networks . IEEE Trans . Pattern Anal . Mach . Intell. , 2016.377 Marie Ekström . Metrics to identify meaningful downscaling skill in wrf simulations of intense378 rainfall events . Environmental Modelling & Software , 79:267–284 , 2016.379 Brian Groenke , Luke Madaus , and Claire Monteleoni . Climalign : Unsupervised statistical down-380 scaling of climate variables via normalizing flows . CoRR , 2020.381 Hoshin Vijai Gupta , Soroosh Sorooshian , and Patrice Ogou Yapo . Status of automatic calibration382 for hydrologic models : Comparison with multilevel expert calibration . Journal of hydrologic383 engineering , 4 ( 2 ) :135–143 , 1999.384 Muhammad Haris , Gregory Shakhnarovich , and Norimichi Ukita . Deep back-projection networks385 for super-resolution . In 2018 IEEE Conference on Computer Vision and Pattern Recognition,386 CVPR 2018 , Salt Lake City , UT , USA , June 18-22 , 2018 . IEEE Computer Society , 2018.387 Muhammad Haris , Gregory Shakhnarovich , and Norimichi Ukita . Recurrent back-projection net-388 work for video super-resolution . In IEEE Conference on Computer Vision and Pattern Recogni-389 tion , CVPR 2019 , Long Beach , CA , USA , June 16-20 , 2019 . Computer Vision Foundation / IEEE,390 2019.391 Xiaogang He , Nathaniel W Chaney , Marc Schleiss , and Justin Sheffield . Spatial downscaling of392 precipitation using adaptable random forests . Water resources research , 2016.393 Yan Huang , Wei Wang , and Liang Wang . Bidirectional recurrent convolutional networks for multi-394 frame super-resolution . In Advances in Neural Information Processing Systems , 2015.395 Younghyun Jo , Seoung Wug Oh , Jaeyeon Kang , and Seon Joo Kim . Deep video super-resolution396 network using dynamic upsampling filters without explicit motion compensation . In 2018 IEEE397 Conference on Computer Vision and Pattern Recognition , CVPR 2018 , Salt Lake City , UT , USA,398 June 18-22 , 2018 . IEEE Computer Society , 2018.399 Justin Johnson , Alexandre Alahi , and Li Fei-Fei . Perceptual losses for real-time style transfer and400 super-resolution . In Computer Vision - ECCV 2016 - 14th European Conference , Amsterdam , The401 Netherlands , October 11-14 , 2016 , Proceedings , Part II , 2016.402 Robert Keys . Cubic convolution interpolation for digital image processing . IEEE transactions on403 acoustics , speech , and signal processing , 1981.404 Christian Ledig , Lucas Theis , Ferenc Huszar , Jose Caballero , Andrew Cunningham , Alejandro405 Acosta , Andrew P. Aitken , Alykhan Tejani , Johannes Totz , Zehan Wang , and Wenzhe Shi . Photo-406 realistic single image super-resolution using a generative adversarial network . In 2017 IEEE407 Conference on Computer Vision and Pattern Recognition , CVPR 2017 , Honolulu , HI , USA , July408 21-26 , 2017 . IEEE Computer Society , 2017.409 Renjie Liao , Xin Tao , Ruiyu Li , Ziyang Ma , and Jiaya Jia . Video super-resolution via deep draft-410 ensemble learning . In 2015 IEEE International Conference on Computer Vision , ICCV 2015,411 Santiago , Chile , December 7-13 , 2015 . IEEE Computer Society , 2015.412 Bee Lim , Sanghyun Son , Heewon Kim , Seungjun Nah , and Kyoung Mu Lee . Enhanced deep resid-413 ual networks for single image super-resolution . In 2017 IEEE Conference on Computer Vision414 and Pattern Recognition Workshops , CVPR Workshops 2017 , Honolulu , HI , USA , July 21-26,415 2017 . IEEE Computer Society , 2017.416 Douglas Maraun , Martin Widmann , José M Gutiérrez , Sven Kotlarski , Richard E Chandler , Elke417 Hertig , Joanna Wibig , Radan Huth , and Renate AI Wilcke . Value : A framework to validate418 downscaling approaches for climate change studies . Earth ’ s Future , 3 ( 1 ) :1–14 , 2015.419 Brian R. Nelson , Olivier P. Prat , D.-J . Seo , and Emad Habib . Assessment and Implications of420 NCEP Stage IV Quantitative Precipitation Estimates for Product Intercomparisons . Weather and421 Forecasting , 2016.422 NSF . Nsf geosciences directorate funding by institution type . AGI Report , 2020.423 Augustus Odena , Vincent Dumoulin , and Chris Olah . Deconvolution and checkerboard artifacts.424 Distill , 2016.425 SC Pryor and JT Schoof . Differential credibility assessment for statistical downscaling . Journal of426 Applied Meteorology and Climatology , 59 ( 8 ) :1333–1349 , 2020.427 Suman Ravuri , Karel Lenc , Matthew Willson , Dmitry Kangin , Remi Lam , Piotr Mirowski , Megan428 Fitzsimons , Maria Athanassiadou , Sheleem Kashem , Sam Madge , et al . Skillful precipitation429 nowcasting using deep generative models of radar . Nature , 2021.430 Markus Reichstein , Gustau Camps-Valls , Bjorn Stevens , Martin Jung , Joachim Denzler , Nuno Car-431 valhais , et al . Deep learning and process understanding for data-driven earth system science.432 Nature , 2019.433 Karen Simonyan and Andrew Zisserman . Very deep convolutional networks for large-scale image434 recognition . In Yoshua Bengio and Yann LeCun ( eds . ) , 3rd International Conference on Learning435 Representations , ICLR 2015 , San Diego , CA , USA , May 7-9 , 2015 , Conference Track Proceed-436 ings , 2015.437 Michael L Stein . Interpolation of spatial data : some theory for kriging . Springer Science & Business438 Media , 2012.439 Xin Tao , Hongyun Gao , Renjie Liao , Jue Wang , and Jiaya Jia . Detail-revealing deep video super-440 resolution . In IEEE International Conference on Computer Vision , ICCV 2017 , Venice , Italy,441 October 22-29 , 2017 . IEEE Computer Society , 2017.442 Matias Tassano , Julie Delon , and Thomas Veit . Fastdvdnet : Towards real-time deep video denois-443 ing without flow estimation . In 2020 IEEE/CVF Conference on Computer Vision and Pattern444 Recognition , CVPR 2020 , Seattle , WA , USA , June 13-19 , 2020 . IEEE , 2020.445 Yapeng Tian , Yulun Zhang , Yun Fu , and Chenliang Xu . TDAN : temporally-deformable alignment446 network for video super-resolution . In 2020 IEEE/CVF Conference on Computer Vision and447 Pattern Recognition , CVPR 2020 , Seattle , WA , USA , June 13-19 , 2020 . IEEE , 2020.448 Mark S. Veillette , Siddharth Samsi , and Christopher J. Mattioli . SEVIR : A storm event imagery449 dataset for deep learning applications in radar and satellite meteorology . In Advances in Neu-450 ral Information Processing Systems 33 : Annual Conference on Neural Information Processing451 Systems 2020 , NeurIPS 2020 , December 6-12 , 2020 , virtual , 2020.452 Daniel Walton , Neil Berg , David Pierce , Ed Maurer , Alex Hall , Yen-Heng Lin , Stefan Rahimi , and453 Dan Cayan . Understanding differences in california climate projections produced by dynamical454 and statistical downscaling . Journal of Geophysical Research : Atmospheres , 2020.455 Xintao Wang , Ke Yu , Shixiang Wu , Jinjin Gu , Yihao Liu , Chao Dong , Yu Qiao , and Chen456 Change Loy . Esrgan : Enhanced super-resolution generative adversarial networks . In Proceedings457 of the European Conference on Computer Vision ( ECCV ) , pp . 0–0 , 2018.458 Xintao Wang , Kelvin CK Chan , Ke Yu , Chao Dong , and Chen Change Loy . Edvr : Video restoration459 with enhanced deformable convolutional networks . In Proceedings of the IEEE Conference on460 Computer Vision and Pattern Recognition Workshops , 2019.461 BL White , A Singh , and A Albert . Downscaling numerical weather models with gans . AGUFM,462 2019.463 Adrienne M Wootten , Elias C Massoud , Agniv Sengupta , Duane E Waliser , and Huikyo Lee . The464 effect of statistical downscaling on the weighting of multi-model ensembles of precipitation . Cli-465 mate , 8 ( 12 ) :138 , 2020.466 Youlong Xia , Kenneth Mitchell , Michael Ek , Justin Sheffield , Brian Cosgrove , Eric Wood , Lifeng467 Luo , Charles Alonge , Helin Wei , Jesse Meng , Ben Livneh , Dennis Lettenmaier , Victor Koren,468 Qingyun Duan , Kingtse Mo , Yun Fan , and David Mocko . Continental-scale water and energy469 flux analysis and validation for the north american land data assimilation system project phase470 2 ( nldas-2 ) : 1. intercomparison and application of model products . Journal of Geophysical Re-471 search : Atmospheres , 2012.472 Xiaoyu Xiang , Yapeng Tian , Yulun Zhang , Yun Fu , Jan P. Allebach , and Chenliang Xu . Zooming473 slow-mo : Fast and accurate one-stage space-time video super-resolution . In 2020 IEEE/CVF474 Conference on Computer Vision and Pattern Recognition , CVPR 2020 , Seattle , WA , USA , June475 13-19 , 2020 . IEEE , 2020.476 Tianfan Xue , Baian Chen , Jiajun Wu , Donglai Wei , and William T. Freeman . Video enhancement477 with task-oriented flow . Int . J. Comput . Vis. , 2019.478 Xuebin Zhang and Feng Yang . Rclimdex ( 1.0 ) user manual . Climate Research Branch Environment479 Canada , 22 , 2004.480 Yulun Zhang , Kunpeng Li , Kai Li , Lichen Wang , Bineng Zhong , and Yun Fu . Image super-481 resolution using very deep residual channel attention networks . In Computer Vision - ECCV482 2018 - 15th European Conference , Munich , Germany , September 8-14 , 2018 , Proceedings , Part483 VII , Lecture Notes in Computer Science . Springer , 2018.484
This paper proposes a dataset called RainNet for studying precipitation downscaling. RainNet consists of ~62k pairs of low-res/high-res precipitation maps from various meteorological events over the east coast of the US over 17 years. This dataset was created from two existing products: NLDAS and the NCEP's Stage IV 4km gridded precipitation data. Further, the paper proposes two metrics, Precipitation Error Measure (PEM) and Precipitation Dynamics Error Measure (PDEM). Finally, the paper compares several superresolution methods from computer vision literature, traditional statistical approaches to downscaling, as well as the proposed architecture/method on the proposed dataset to form a set of benchmark results.
SP:3fed87e29b3609f6d356dafce16be061a85471ab
RainNet: A Large-Scale Imagery Dataset for Spatial Precipitation Downscaling
Contemporary deep learning frameworks have been applied to solve meteorolog-1 ical problems ( e.g. , front detection , synthetic radar generation , precipitation now-2 casting , e.t.c . ) and have achieved highly promising results . Spatial precipitation3 downscaling is one of the most important meteorological problems . However,4 the lack of a well-organized and annotated large-scale dataset hinders the training5 and verification of more effective and advancing deep-learning models for precip-6 itation downscaling . To alleviate these obstacles , we present the first large-scale7 spatial precipitation downscaling dataset named RainNet , which contains more8 than 62 , 400 pairs of high-quality low/high-resolution precipitation maps for over9 17 years , ready to help the evolution of deep models in precipitation downscal-10 ing . Specifically , the precipitation maps carefully collected in RainNet cover var-11 ious meteorological phenomena ( e.g. , hurricane , squall , e.t.c . ) , which is of great12 help to improve the model generalization ability . In addition , the map pairs in13 RainNet are organized in the form of image sequences ( 720 maps per month or14 1 map/hour ) , showing complex physical properties , e.g. , temporal misalignment,15 temporal sparse , and fluid properties . Two machine-learning-oriented metrics are16 specifically introduced to evaluate or verify the comprehensive performance of the17 trained model , ( e.g. , prediction maps reconstruction accuracy ) . To illustrate the18 applications of RainNet , 14 state-of-the-art models , including deep models and19 traditional approaches , are evaluated . To fully explore potential downscaling so-20 lutions , we propose an implicit physical estimation framework to learn the above21 characteristics . Extensive experiments demonstrate that the value of RainNet in22 training and evaluating downscaling models.23 1 INTRODUCTION24 Deep learning has made an enormous breakthrough in the field of computer vision , which is ex-25 tremely good at extracting valuable knowledge from numerous amounts of data . In recent years,26 with computer science development , a deluge of Earth system data is continuously being obtained,27 coming from sensors all over the earth and even in space . These ever-increasing massive amounts of28 data with different sources and structures challenge the geoscience community , which lacks practi-29 cal approaches to understand and further utilize the raw data ( Reichstein et al . ( 2019 ) ) . Specifically,30 several preliminary works ( Groenke et al . ( 2020 ) ; White et al . ( 2019 ) ; He et al . ( 2016 ) ; Ravuri et al.31 ( 2021 ) ; Angell & Sheldon ( 2018 ) ; Veillette et al . ( 2020 ) ) try to introduce machine learning and deep32 learning frameworks to solve meteorological problems , e.g. , spatial precipitation downscaling.33 In this paper , we focus on the spatial precipitation downscaling task . Spatial precipitation down-34 scaling is a procedure to infer high-resolution meteorological information from low-resolution vari-35 ables , which is one of the most important upstream components for meteorological task ( Bauer et al.36 ( 2015 ) ) . The precision of weather and climate prediction is highly dependent on the resolution and37 reliability of the initial environmental input variables , and spatial precipitation downscaling is the38 most promising solution . The improvement of the weather/climate forecast and Geo-data quality39 saves tremendous money and lives ; with the fiscal year 2020 budget over $ 1 billion , NSF funds40 thousands of colleges in the U.S. to research on these topics ( NSF ( 2020 ) ) .41 Unfortunately , there are looming issues hinders the research of spatial precipitation downscaling42 in the machine learning community : 1 ) . Lack of ” machine-learning ready ” datasets . The existing43 machine-learning-based downscaling methods are only applied to ideal retrospective problems and44 verified on simulated datasets ( e.g. , mapping bicubic of precipitation generated by weather fore-45 cast model to original data ( Berrisford et al . ( 2011 ) ) ) , which significantly weakens the credibility46 of the feasibility , practicability , and effectiveness of the methods . It is worth mentioning that the47 data obtained by the simulated degradation methods ( e.g. , bicubic ) is completely different from the48 real data usually collected by two measurement systems ( e.g. , satellite and radar ) with different49 precision . The lack of a well-organized and annotated large-scale dataset hinders the training and50 verification of more effective and complex deep-learning models for precipitation downscaling . 2 ) .51 Lack of tailored metrics to evaluate machine-learning-based frameworks . Unlike deep learning ( DL ) 52 and machine learning ( ML ) communities , scientists in meteorology usually employ maps/charts to53 assessing downscaling models case by case based on domain knowledge ( He et al . ( 2016 ) ; Walton54 et al . ( 2020 ) ) , which hinders the application of Rainnet in DL/ML communities . For example , ( He55 et al . ( 2016 ) ) use log-semivariance ( spatial metrics for local precipitation ) , quantile-quantile maps56 to analyzing the maps . 3 ) . an efficient downscaling deep-learning framework should be established.57 Contrary to image data , this real precipitation dataset covers various types of real meteorological58 phenomena ( e.g. , Hurricane , Squall , e.t.c . ) , and shows the physical characters ( e.g. , temporal mis-59 alignment , temporal sparse and fluid properties , e.t.c . ) that challenge the downscaling algorithms.60 Traditional computationally dense physics-driven downscaling methods are powerless to handle the61 increasing meteorological data size and flexible to multiple data sources.62 To alleviate these obstacles , we propose the first large-scale spatial precipitation downscaling dataset63 named RainNet , which contains more than 62 , 400 pairs of high-quality low/high-resolution precip-64 itation maps for over 17 years , ready to help the evolution of deep models in spatial precipitation65 downscaling . The proposed dataset covers more than 9 million square kilometers of land area , which66 contains both wet and dry seasons and diverse meteorological phenomena . To facilitate DL/ML and67 other researchers to use RainNet , we introduce 6 most concerning indices to evaluate downscaling68 models : mesoscale peak precipitation error ( MPPE ) , heavy rain region error ( HRRE ) , cumulative69 precipitation mean square error ( CPMSE ) , cluster mean distance ( CMD ) , heavy rain transition speed70 ( HRTS ) and average miss moving degree ( AMMD ) . In order to further simplify the application of in-71 dices , we abstract them into two weighted and summed metrics : Precipitation Error Measure ( PEM ) 72 and Precipitation Dynamics Error Measure ( PDEM ) . Unlike video super-resolution , the motion of73 the precipitation region is non-rigid ( i.e. , fluid ) , while video super-resolution mainly concerns rigid74 body motion estimation . To fully explore how to alleviate the mentioned predicament , we propose75 an implicit dynamics estimation driven downscaling deep learning model . Our model hierarchi-76 cally aligns adjacent precipitation maps , that is , implicit motion estimation , which is very simple77 but exhibits highly competitive performance . Based on meteorological science , we also proved that78 the dataset we constructed contained the full information people may need to recover the higher79 resolution observations from lower resolution ones.80 The main contributions of this paper are:81 • To the best of our knowledge , we present the first REAL ( non-simulated ) Large-Scale Spa-82 tial Precipitation Downscaling Dataset for deep learning ; 83 • We introduce 2 simple metrics to evaluate the downscaling models ; 84 • We propose a downscaling model with strong competitiveness . We evaluate 14 competitive85 potential solutions on the proposed dataset , and analyze the feasibility and effectiveness of86 these solutions.87 2 BACKGROUND88 At the beginning of the 19th century , geoscientists recognized that predicting the state of the atmo-89 sphere could be treated as an initial value problem of mathematical physics , wherein future weather90 is determined by integrating the governing partial differential equations , starting from the observed91 current weather . Today , this paradigm translates into solving a system of nonlinear differential92 equations at about half a billion points per time step and accounting for dynamic , thermodynamic,93 radiative , and chemical processes working on scales from hundreds of meters to thousands of kilo-94 meters and from seconds to weeks ( Bauer et al . ( 2015 ) ) . The Navier–Stokes and mass continuity95 equations ( including the effect of the Earth ’ s rotation ) , together with the first law of thermodynamics96 and the ideal gas law , represent the full set of prognostic equations in the atmosphere , describing the97 change in space and time of wind , pressure , density and temperature is described ( formulas given in98 supplementary ) ( Bauer et al . ( 2015 ) ) . These equations have to be solved numerically using spatial99 and temporal discretization because of the mathematical intractability of obtaining analytical solu-100 tions , and this approximation creates a distinction between so-called resolved and unresolved scales101 of motion.102 2.1 SPATIAL DOWNSCALING OF PRECIPITATION103 The global weather forecast model , treated as a computational problem , relying on high-quality104 initial data input . The error of weather forecast would increase exponentially over time from this105 initial error of input dataset . Downscaling is one of the most important approaches to improve the106 initial input quality . Precipitation is one of the essential atmospheric variables that are related to daily107 life . It could easily be observed , by all means , e.g. , gauge station , radar , and satellites . Applying108 downscaling methods to precipitation and creating high-resolution rainfall is far more meaningful109 than deriving other variables , while it is the most proper initial task to test deep learning ’ s power110 in geo-science . The traditional downscaling methods can be separated into dynamic and statistical111 downscaling.112 Dynamic downscaling treats the downscaling as an optimization problem constraint on the physical113 laws . The dynamic downscaling methods find the most likely precipitation over space and time114 under the pre-defined physical law . It usually takes over 6 hours to downscale a 6-hour precipitation115 scenario globally on supercomputers ( Courtier et al . ( 1994 ) ) . As the dynamic downscaling relying116 on pre-defined known macroscopic physics , a more flexible weather downscaling framework that117 could easily blend different sources of observations and show the ability to describe more complex118 physical phenomena on different scales is desperately in need.119 Statistical downscaling is trying to speed up the dynamic downscaling process . The input of statisti-120 cal downscaling is usually dynamic model results or two different observation datasets on different121 scales . However , due to the quality of statistical downscaling results , people rarely apply statistical122 downscaling to weather forecasts . These methods are currently applied in the tasks not requir-123 ing high data quality but more qualitative understanding , e.g. , climate projection , which forecasts124 the weather for hundreds of years on coarse grids and using statistical downscaling to get detailed125 knowledge of medium-scale future climate system.126 3 RAINNET : SPATIAL PRECIPITATION DOWNSCALING IMAGERY DATASET127 3.1 DATA COLLECTION AND PROCESSING128 To build up a standard realistic ( non-simulated ) downscaling dataset for computer vision , we129 selected the eastern coast of the United States , which covers a large region ( 7 million km2 ; 130 105◦ ∼ 65◦W , 25◦ ∼ 50◦N , GNU Free Documentation License 1.2 ) and has a 20-year high-quality131 precipitation observations . We collected two precipitation data sources from National Stage IV QPE132 Product ( StageIV ( Nelson et al . ( 2016 ) ) ; high resolution at 0.04◦ ( approximately 4km ) , GNU Free133 Documentation License 1.2 ) and North American Land Data Assimilation System ( NLDAS ( Xia134 et al . ( 2012 ) ) ; low resolution at 0.125◦ ( approximately 13km ) ) . StageIV is mosaicked into a na-135 tional product at National Centers for Environmental Prediction ( NCEP ) , from the regional hourly/6-136 hourly multi-sensor ( radar+gauges ) precipitation analyses ( MPEs ) produced by the 12 River Fore-137 cast Centers over the continental United States with some manual quality control done at the River138 Forecast Centers ( RFCs ) . NLDAS is constructed quality-controlled , spatially-and-temporally con-139 sistent datasets from the gauges and remote sensors to support modeling activities . Both products140 are hourly updated and both available from 2002 to the current age.141 In our dataset , we further selected the eastern coast region for rain season ( July ∼ November,142 covering hurricane season ; hurricanes pour over 10 % annual rainfall in less than 10 days ) . We143 matched the coordinate system to the lat-lon system for both products and further labeled all the144 hurricane periods happening in the last 17 years . These heavy rain events are the largest challenge145 for weather forecasting and downscaling products . As heavy rain could stimulus a wide-spreading146 flood , which threatening local lives and arousing public evacuation . If people underestimate the147 rainfall , a potential flood would be underrated ; while over-estimating the rainfall would lead to148 unnecessary evacuation orders and flood protection , which is also costly.149 3.2 DATASET STATISTICS150 At the time of this work , we have collected and processed precipitation data for the rainy season151 for 17 years from 2002 to 2018 . One precipitation map pair per hour , 24 precipitation map pairs152 per day . In detail , we have collected 85 months or 62424 hours , totaling 62424 pairs of high-153 resolution and low-resolution precipitation maps . The size of the high-resolution precipitation map154 is 624 × 999 , and the size of the low-resolution is 208 × 333 . Various meteorological phenomena155 and precipitation conditions ( e.g. , hurricanes , squall lines , e.t.c . ) are covered in these data . The156 precipitation map pairs in RainNet are stored in HDF5 files that make up 360 GB of disk space . We157 select 2 typical meteorological phenomena and visualize them in Fig . 1 . Our data is collected from158 satellites , radars , gauge stations , e.t.c. , which covers the inherent working characteristics of different159 meteorological measurement systems . Compared with traditional methods that generate data with160 different resolutions through physical model simulation , our dataset is of great help for deep models161 to learn real meteorological laws.162 3.3 DATASET ANALYSIS163 In order to help design a more appropriate and effective precipitation downscaling model , we have164 explored the property of the dataset in depth . As mentioned above , our dataset is collected from mul-165 tiple sensor sources ( e.g. , satellite , weather radar , e.t.c . ) , which makes the data show a certain extent166 of misalignment . Our efforts here are not able to vanquish the misalignment . This is an intrinsic167 problem brought by the fusion of multi-sensor meteorological data . Limited by observation meth-168 ods ( e.g. , satellites can only collect data when they fly over the observation area ) , meteorological169 data is usually temporal sparse , e.g. , in our dataset , the sampling interval between two precipitation170 maps is one hour . The temporal sparse leads to serious difficulties in the utilization of precipitation171 sequences . Additionally , the movement of the precipitation position is directly related to the cloud.172 It is a fluid movement process that is completely different from the rigid body movement concerned173 in Super-Resolution . At the same time , the cloud will grow or dissipate in the process of flowing174 and even form new clouds , which further complicates the process . In the nutshell , although existed175 SR is a potential solution for downscaling , there is a big difference between the two . Especially,176 the three characteristics of downscaling mentioned above : temporal misalignment , temporal sparse,177 fluid properties , which make the dynamic estimation of precipitation more challenging.178 4 EVALUATION METRICS179 Due to the difference between downscaling and traditional figure super-resolution , the metrics that180 work well under SR tasks may not be sufficient for precipitation downscaling . By gathering the181 metrics from the meteorologic literature ( the literature includes are Zhang & Yang ( 2004 ) ; Maraun182 et al . ( 2015 ) ; Ekström ( 2016 ) ; He et al . ( 2016 ) ; Pryor & Schoof ( 2020 ) ; Wootten et al . ( 2020 ) ) ,183 we select and rename 6 most common metrics ( a metrics may have multiple names in different184 literature ) to reflect the downscaling quality : mesoscale peak precipitation error ( MPPE ) , cumulative185 precipitation mean square error ( CPMSE ) , heavy rain region error ( HRRE ) , cluster mean distance186 ( CMD ) , heavy rain transition speed ( HRTS ) and average miss moving degree ( AMMD ) .These 6187 metrics can be separated as reconstruction metrics : MPPE , HRRE , CPMSE , AMMD , and dynamic188 metrics : HRTS and CMD.189 The MPPE ( mm/hour ) is calculated as the difference of top quantile between the generated/real190 rainfall dataset which considering both spatial and temporal property of mesoscale meteorological191 systems , e.g. , hurricane , squall . This metric is used in most of these papers ( for example Zhang192 & Yang ( 2004 ) ; Maraun et al . ( 2015 ) ; Ekström ( 2016 ) ; He et al . ( 2016 ) ; Pryor & Schoof ( 2020 ) ; 193 Wootten et al . ( 2020 ) suggest the quantile analysis to evaluate the downscaling quality ) .194 The CPMSE ( mm2/hour2 ) measures the cumulative rainfall difference on each pixel over the time-195 axis of the test set , which shows the spatial reconstruction property . Similar metrics are used in196 Zhang & Yang ( 2004 ) ; Maraun et al . ( 2015 ) ; Wootten et al . ( 2020 ) calculated as the pixel level197 difference of monthly rainfall and used in He et al . ( 2016 ) as a pixel level difference of cumulative198 rainfall with different length of record.199 The HRRE ( km2 ) measures the difference of heavy rain coverage on each time slide between gen-200 erated and labeled test set , which shows the temporal reconstruction ability of the models . The201 AMMD ( radian ) measures the average angle difference between main rainfall clusters . Similar202 metrics are used in Zhang & Yang ( 2004 ) ; Maraun et al . ( 2015 ) ; Wootten et al . ( 2020 ) as rainfall203 coverage of a indefinite number precipitation level and used in He et al . ( 2016 ) ; Pryor & Schoof204 ( 2020 ) as a continuous spatial analysis.205 As a single variable dataset , it is hard to evaluate the ability of different models to capture the206 precipitation dynamics when temporal information is not included ( a multi-variable dataset may207 have wind speed , a typical variable representing dynamics , included ) . So here we introduce the208 first-order temporal and spatial variables to evaluate the dynamical property of downscaling results.209 Similar approaches are suggested in Maraun et al . ( 2015 ) ; Ekström ( 2016 ) ; Pryor & Schoof ( 2020 ) .210 The CMD ( km ) physically compares the location difference of the main rainfall systems between211 the generated and labeled test set , which could be also understand as the RMSE of the first order212 derivative of precipitation data on spatial directions.The HRTS ( km/hour ) measures the difference213 between the main rainfall system moving speed between the generated and labeled test set which214 shows the ability for models to capture the dynamic property , which could be also understand as the215 RMSE of the first order derivative of precipitation data on temporal direction.Similar metrics are216 suggested in Maraun et al . ( 2015 ) ; Ekström ( 2016 ) ; Pryor & Schoof ( 2020 ) as the auto-regression217 analysis and the differential analysis.218 More details about the metrics and their equations are given in supplementary materials . One met-219 rics group ( MPPE , HRRE , CPMSE , AMMD ) mainly measures the rainfall deviation between the220 generated precipitation maps and GT . The other group ( HRTS and CMD ) mainly measures the221 dynamic deviation of generated precipitation maps . In order to further simplify the application222 of indices , we abstract them into two weighted and summed metrics : Precipitation Error Mea-223 sure ( PEM ) and Precipitation Dynamics Error Measure ( PDEM ) . We first align the dimensions224 of these two groups of metrics respectively . The first group of metrics ( MPPE , HRRE , CPMSE,225 AMMD ) is normalized , weighted and summed to get the precipitation error measure ( PEM ) . Ac-226 cording to Gupta et al . ( 1999 ) , all the metrics are transferred to Percent Bias ( PBIAS ) to be suit-227 able for metrics weighting . The original definition of PBIAS is the bias divided by observation , as228 PBIAS = |Qmodel − Qobs|/|Qobs| . Here we rewrite the original metrics to PBIAS by dividing229 the metrics with annual mean observations of the original variables ( AMO ) , as PBIASPEMi =230 |MetricsPEMi |/|AMOPEMi | , MetricsPEMi = { MPPE , HRRE , CPMSE , AMMD } . In our231 dataset , AMOPEMMPPE = 64 , AMO PEM HRREM = 533 , AMO PEM CPMSE = 0.64 , AMO PEM AMMD = 332,232 AMOPEMHRTS = 15 , AMO PEM CMD = 26 . The metrics then are ensembled to a single metric233 ( PEM ) with equal weight , as PEM = ∑ i 0.25 · PBIASPEMi . Following the same procedure,234 we then ensemble the second group of dynamic metrics ( HRTS and CMD ) to a single metrics235 PDEM = ∑ i 0.5 · PBIASPDEMi .236 We also include the most common used metrics RMSE as one single metrics in our metrics list.237 RMSE could evaluate both reconstruction and dynamic property of the downscaling result.238 5 APPLICATIONS OF RAINNET IN SPATIAL PRECIPITATION DOWNSCALING239 As a potential solution , Super-Resolution ( SR ) frameworks are generally divided into the Single-240 Image Super-Resolution ( SISR ) and the Video Super-Resolution ( VSR ) . Video Super-Resolution is241 able to leverage multi-frame information to restore images , which better matches the nature of down-242 scaling . We will demonstrate this judgment in Sec . 6.1 . The VSR pipeline usually contains three243 components : deblurring , inter-frame alignment , and super-resolution . Deblurring and inter-frame244 alignment are implemented by the motion estimation module . There are four motion estimation245 frameworks : 1 ) . RNN based ( Keys ( 1981 ) ; Tao et al . ( 2017 ) ; Huang et al . ( 2015 ) ; Haris et al.246 ( 2019 ) ) ; 2 ) . Optical Flow ( Xue et al . ( 2019 ) ) ; 3 ) . Deformable Convolution based ( Tian et al . ( 2020 ) ; 247 Xiang et al . ( 2020 ) ; Wang et al . ( 2019 ) ) ; 4 ) . Temporal Concatenation ( Jo et al . ( 2018 ) ; Caballero248 et al . ( 2017 ) ; Liao et al . ( 2015 ) ) . In fact , there is another motion estimation scheme proposed for249 the first time in the noise reduction task ( Tassano et al . ( 2020 ) ) , which achieves an excellent video250 noise reduction performance . Inspired by ( Tassano et al . ( 2020 ) ) , we design an implicit dynamics251 estimation model for the spatial precipitation downscaling . It is worth mentioning that our proposed252 model and the above four frameworks together form a relatively complete candidate set of dynamic253 estimation solutions.254 Proposed Framework . As shown in Fig . 2 , our framework consists of two components : Implicit255 dynamic estimation module and downscaling Backbone . These two parts are trained jointly . Suppose256 there areN adjacent low-resolution precipitation maps { IL T−N−12 , .. , ILT , ... , I L T+N−12 } . The task is to257 reconstruct the high-resolution precipitation map IHT of I L T . The implicit dynamic estimation module258 is composed of multiple vanilla networks A = { A1 , ... , AN−2 } ( N = 5 in this paper ) sharing259 weights . Each vanilla network receives three adjacent frames as input , outputs , and intermediate260 results . The intermediate result can be considered as a frame with implicit dynamic alignment . We261 concatenate all the intermediate frames as the input of the next module . The specific structure of262 the vanilla network can be found in the supplementary materials . The main task of the downscaling263 backbone is to restore the high-resolution precipitation map IHT based on the aligned intermediate264 frames . In order to make full use of multi-scale information , we use multiple Residual-in-Residual265 Dense Blocks ( Wang et al . ( 2018 ) ) in the network . We employ the interpolation+convolution ( Odena266 et al . ( 2016 ) ) as the up-sampling operator to reduce the checkerboard artifacts . After processing by267 downscaling backbone we get the final estimated HR map ÎHT .268 Model objective . The downscaling task is essentially to restore high-resolution precipitation maps.269 We learn from the super-resolution task and also applyL1 and perceptual loss ( Johnson et al . ( 2016 ) ) 270 as the training loss of our model . The model objective is shown below:271 L ( ̂IHT , IHT ) =‖ ÎHT − IHT ‖1 +λ ‖ φ ( ̂IHT ) − φ ( IHT ) ‖2 , ( 1 ) where φ denotes the pre-trained VGG19 network ( Simonyan & Zisserman ( 2015 ) ) , we select the272 Relu5 − 4 ( without the activator ( Wang et al . ( 2018 ) ) ) as the output layer . λ is the coefficient to273 balance the loss terms . λ = 20 in our framework.274 6 EXPERIMENTAL EVALUATION275 We conduct spatial precipitation downscaling experiments to illustrate the application of our276 proposed RainNet and evaluate the effectiveness of the benchmark downscaling frameworks . Fol-277 lowing the mainstream evaluation protocol of DL/ML communities , cross-validation is employed.278 In detail , we divide the dataset into 17 parts ( 2002.7∼2002.11 , 2003.7∼2003.11 , 2004.7∼2004.11,279 2005.7∼2005.11 , 2006.7∼2006.11 , 2007.7∼2007.11 , 2008.7∼2008.11 , 2009.7∼2009.11,280 2010.7∼2010.11 , 2011.7∼2011.11 , 2012.7∼2012.11 , 2013.7∼2013.11 , 2014.7∼2014.11,281 2015.7∼2015.11 , 2016.7∼2016.11 , 2017.7∼2017.11 , 2018.7∼2018.11 ) by year , and sequentially282 employ each year as the test set and the remaining 16 years as the training set , that is , 17-fold283 cross-validation . All models maintain the same training settings and hyperparameters during the284 training phase . These data cover various complicated precipitation situations such as hurricanes,285 squall lines , different levels of rain , and sunny days . It is sufficient to select the rainy season of286 the year as the test set from the perspective of meteorology , as the climate of one area is normally287 stable.288 6.1 BASELINES289 The SISR/VSR and the spatial precipitation down-290 scaling are similar to some extent , so we argue that291 the SR models can be applied to the task as the292 benchmark models . The input of SISR is a single293 image , and the model infers a high-resolution image294 from it . Its main focus is to generate high-quality295 texture details to achieve pleasing visual effects . In296 contrast , VSR models input multiple frames of im-297 ages ( e.g. , 3 frames , 5 frames , e.t.c. ) . In our experi-298 ments , we employ 5 frames . The core idea of VSR299 models is to increase the resolution by complement-300 ing texture information between different frames . It301 is worth mentioning that VSR models generally are302 equipped with a motion estimation module to alle-303 viate the challenge of object motion to inter-frame304 information registration.305 We evaluated 7 state-of-the-art SISR frameworks306 ( i.e. , Bicubic ( Keys ( 1981 ) ) , SRCNN1 ( Dong307 et al . ( 2016 ) ) , SRGAN2 ( Ledig et al . ( 2017 ) ) ,308 1https : //github.com/yjn870/SRCNN-pytorch 2https : //github.com/leftthomas/SRGAN EDSR3 ( Lim et al . ( 2017 ) ) , ESRGAN4 ( Wang et al . ( 2018 ) ) , DBPN5 ( Haris et al . ( 2018 ) ) ,309 RCAN6 ( Zhang et al . ( 2018 ) ) and 5 VSR frameworks ( i.e. , SRGAN-V , EDSR-V , ESRGAN-V,310 RBPN7 ( Haris et al . ( 2019 ) ) , EDVR8 ( Wang et al . ( 2019 ) ) , of which 3 VSR methods ( i.e. , SRGAN-311 V , EDSR-V , ESRGAN-V ) are modified from SISR . In particular , we build SRGAN-V , EDSR-V and312 ESRGAN-V by concatenating multiple frames of precipitation maps as the input of the model . In313 addition , we also evaluated the traditional statistics method Kriging ( Stein ( 2012 ) ) , which is widely314 applied in weather forecasting . The mentioned 8 metrics are used to quantitatively evaluate the315 performance of these SR models and our method . Further , we select some disastrous weather as316 samples for qualitative analysis to test the model ’ s ability to learn the dynamic properties of the317 weather system . And we employ the implementation of Pytorch for Bicubic . We use 4 NVIDIA318 2080 Ti GPUs for training . We train all models with following setting . The batch size is set as 24.319 Precipitation maps are random crop into 64× 64 . We employ the Adam optimizer , beta1 is 0.9 , and320 beta2 is 0.99 . The initial learning rate is 0.001 , which is reduced to 1/10 every 50 epochs , and a total321 of 200 epochs are trained . We evaluate benchmark frameworks with 17-fold cross-validation . The322 downscaling performances are shown in Tab . 1 . We divide the indicators mentioned above into two323 groups . PDEM measures the model ’ s ability to learn the dynamics of precipitation . PEM illustrates324 the model ’ s ability to reconstruct precipitation.325 From Tab . 1 , we can learn that the overall performance of the VSR methods are better than SISR326 models , which shows that the dynamic properties mentioned above are extremely important for the327 downscaling model . Furthermore , it can be seen from Fig . 3 that the SISR method is clustered in the328 upper right corner of the scatter plot , and the VSR method is concentrated in the lower-left corner,329 which further shows that the dynamic properties of the VSR methods are overall better than the SISR330 methods . In addition , our method achieves the 1st best performance in RMSE , PDE , and achieve the331 second-best performance on PEM . The score shows that the implicit dynamic estimation framework332 3https : //github.com/sanghyun-son/EDSR-PyTorch 4https : //github.com/xinntao/ESRGAN 5https : //github.com/alterzero/DBPN-Pytorch 6https : //github.com/yulunzhang/RCAN 7https : //github.com/alterzero/RBPN-PyTorch 8https : //github.com/xinntao/EDVR used is feasible and effective . It is worth mentioning that the traditional downscaling method Kriging333 performs better than many deep learning models ( e.g. , SRGAN , ESRGAN ) 334 6.1.1 QUALITATIVE ANALYSIS335 We visualized the tropical cyclone precipitation map of the 166th hour ( 6th ) in September 2010336 and the high-resolution precipitation map generated by different methods . As shown in Fig . 4 , the337 best perceptual effects are generated by EDVR and Our framework . Zooming in the result image,338 the precipitation maps generated by SRGAN and EDSR present obvious checkerboard artifacts.339 The reason for the checkerboard artifacts should be the relatively simple and sparse texture pattern340 in precipitation maps . The results generated by Bicubic , RCAN , Kriging , and SRCNN are over-341 smooth . DBPN even can not reconstruct the eye of the hurricane . Especially , the result generated by342 Kriging is as fuzzy as the input LR precipitation map . In conclusion , the visual effects generated343 by the VSR methods are generally better than the SISR methods and the traditional method . From344 the perspective of quantitative and qualitative analysis , the dynamics estimation framework is very345 critical for downscaling.346 7 CONCLUSION347 In this paper , we built the first large-scale real precipitation downscaling dataset for the deep learning348 community . This dataset has 62424 pairs of HR and LR precipitation maps in total . We believe this349 dataset will further accelerate the research on precipitation downscaling . Furthermore , we analyze350 the problem in-depth and put forward three key challenges : temporal misalignment , temporal sparse,351 fluid properties . In addition , we propose an implicit dynamic estimation model to alleviate the above352 challenges . At the same time , we evaluated the mainstream SISR and VSR models and found that353 none of these models can solve RainNet ’ s problems well . Therefore , the downscaling task on this354 dataset is still very challenging.355 This work still remains several open problems . Currently , the data domain of this research is limited356 to the eastern U.S . In future research , we would enlarge the dataset to a larger domain . The dataset357 is only a single variable now . In future research , we may include more variables , e.g . temperature358 and wind speed.359 REFERENCES360 Rico Angell and Daniel R. Sheldon . Inferring latent velocities from weather radar data using gaus-361 sian processes . In Advances in Neural Information Processing Systems 31 : Annual Conference362 on Neural Information Processing Systems 2018 , NeurIPS 2018 , December 3-8 , 2018 , Montréal,363 Canada , pp . 8998–9007 , 2018.364 Peter Bauer , Alan Thorpe , and Gilbert Brunet . The quiet revolution of numerical weather prediction.365 Nature , 2015.366 P. Berrisford , D.P . Dee , P. Poli , R. Brugge , Mark Fielding , Manuel Fuentes , P.W . Kållberg,367 S. Kobayashi , S. Uppala , and Adrian Simmons . The era-interim archive version 2.0 . 2011.368 Jose Caballero , Christian Ledig , Andrew P. Aitken , Alejandro Acosta , Johannes Totz , Zehan Wang,369 and Wenzhe Shi . Real-time video super-resolution with spatio-temporal networks and motion370 compensation . In 2017 IEEE Conference on Computer Vision and Pattern Recognition , CVPR371 2017 , Honolulu , HI , USA , July 21-26 , 2017 . IEEE Computer Society , 2017.372 PHILIPPE Courtier , J-N Thépaut , and Anthony Hollingsworth . A strategy for operational imple-373 mentation of 4d-var , using an incremental approach . Quarterly Journal of the Royal Meteorolog-374 ical Society , 1994.375 Chao Dong , Chen Change Loy , Kaiming He , and Xiaoou Tang . Image super-resolution using deep376 convolutional networks . IEEE Trans . Pattern Anal . Mach . Intell. , 2016.377 Marie Ekström . Metrics to identify meaningful downscaling skill in wrf simulations of intense378 rainfall events . Environmental Modelling & Software , 79:267–284 , 2016.379 Brian Groenke , Luke Madaus , and Claire Monteleoni . Climalign : Unsupervised statistical down-380 scaling of climate variables via normalizing flows . CoRR , 2020.381 Hoshin Vijai Gupta , Soroosh Sorooshian , and Patrice Ogou Yapo . Status of automatic calibration382 for hydrologic models : Comparison with multilevel expert calibration . Journal of hydrologic383 engineering , 4 ( 2 ) :135–143 , 1999.384 Muhammad Haris , Gregory Shakhnarovich , and Norimichi Ukita . Deep back-projection networks385 for super-resolution . In 2018 IEEE Conference on Computer Vision and Pattern Recognition,386 CVPR 2018 , Salt Lake City , UT , USA , June 18-22 , 2018 . IEEE Computer Society , 2018.387 Muhammad Haris , Gregory Shakhnarovich , and Norimichi Ukita . Recurrent back-projection net-388 work for video super-resolution . In IEEE Conference on Computer Vision and Pattern Recogni-389 tion , CVPR 2019 , Long Beach , CA , USA , June 16-20 , 2019 . Computer Vision Foundation / IEEE,390 2019.391 Xiaogang He , Nathaniel W Chaney , Marc Schleiss , and Justin Sheffield . Spatial downscaling of392 precipitation using adaptable random forests . Water resources research , 2016.393 Yan Huang , Wei Wang , and Liang Wang . Bidirectional recurrent convolutional networks for multi-394 frame super-resolution . In Advances in Neural Information Processing Systems , 2015.395 Younghyun Jo , Seoung Wug Oh , Jaeyeon Kang , and Seon Joo Kim . Deep video super-resolution396 network using dynamic upsampling filters without explicit motion compensation . In 2018 IEEE397 Conference on Computer Vision and Pattern Recognition , CVPR 2018 , Salt Lake City , UT , USA,398 June 18-22 , 2018 . IEEE Computer Society , 2018.399 Justin Johnson , Alexandre Alahi , and Li Fei-Fei . Perceptual losses for real-time style transfer and400 super-resolution . In Computer Vision - ECCV 2016 - 14th European Conference , Amsterdam , The401 Netherlands , October 11-14 , 2016 , Proceedings , Part II , 2016.402 Robert Keys . Cubic convolution interpolation for digital image processing . IEEE transactions on403 acoustics , speech , and signal processing , 1981.404 Christian Ledig , Lucas Theis , Ferenc Huszar , Jose Caballero , Andrew Cunningham , Alejandro405 Acosta , Andrew P. Aitken , Alykhan Tejani , Johannes Totz , Zehan Wang , and Wenzhe Shi . Photo-406 realistic single image super-resolution using a generative adversarial network . In 2017 IEEE407 Conference on Computer Vision and Pattern Recognition , CVPR 2017 , Honolulu , HI , USA , July408 21-26 , 2017 . IEEE Computer Society , 2017.409 Renjie Liao , Xin Tao , Ruiyu Li , Ziyang Ma , and Jiaya Jia . Video super-resolution via deep draft-410 ensemble learning . In 2015 IEEE International Conference on Computer Vision , ICCV 2015,411 Santiago , Chile , December 7-13 , 2015 . IEEE Computer Society , 2015.412 Bee Lim , Sanghyun Son , Heewon Kim , Seungjun Nah , and Kyoung Mu Lee . Enhanced deep resid-413 ual networks for single image super-resolution . In 2017 IEEE Conference on Computer Vision414 and Pattern Recognition Workshops , CVPR Workshops 2017 , Honolulu , HI , USA , July 21-26,415 2017 . IEEE Computer Society , 2017.416 Douglas Maraun , Martin Widmann , José M Gutiérrez , Sven Kotlarski , Richard E Chandler , Elke417 Hertig , Joanna Wibig , Radan Huth , and Renate AI Wilcke . Value : A framework to validate418 downscaling approaches for climate change studies . Earth ’ s Future , 3 ( 1 ) :1–14 , 2015.419 Brian R. Nelson , Olivier P. Prat , D.-J . Seo , and Emad Habib . Assessment and Implications of420 NCEP Stage IV Quantitative Precipitation Estimates for Product Intercomparisons . Weather and421 Forecasting , 2016.422 NSF . Nsf geosciences directorate funding by institution type . AGI Report , 2020.423 Augustus Odena , Vincent Dumoulin , and Chris Olah . Deconvolution and checkerboard artifacts.424 Distill , 2016.425 SC Pryor and JT Schoof . Differential credibility assessment for statistical downscaling . Journal of426 Applied Meteorology and Climatology , 59 ( 8 ) :1333–1349 , 2020.427 Suman Ravuri , Karel Lenc , Matthew Willson , Dmitry Kangin , Remi Lam , Piotr Mirowski , Megan428 Fitzsimons , Maria Athanassiadou , Sheleem Kashem , Sam Madge , et al . Skillful precipitation429 nowcasting using deep generative models of radar . Nature , 2021.430 Markus Reichstein , Gustau Camps-Valls , Bjorn Stevens , Martin Jung , Joachim Denzler , Nuno Car-431 valhais , et al . Deep learning and process understanding for data-driven earth system science.432 Nature , 2019.433 Karen Simonyan and Andrew Zisserman . Very deep convolutional networks for large-scale image434 recognition . In Yoshua Bengio and Yann LeCun ( eds . ) , 3rd International Conference on Learning435 Representations , ICLR 2015 , San Diego , CA , USA , May 7-9 , 2015 , Conference Track Proceed-436 ings , 2015.437 Michael L Stein . Interpolation of spatial data : some theory for kriging . Springer Science & Business438 Media , 2012.439 Xin Tao , Hongyun Gao , Renjie Liao , Jue Wang , and Jiaya Jia . Detail-revealing deep video super-440 resolution . In IEEE International Conference on Computer Vision , ICCV 2017 , Venice , Italy,441 October 22-29 , 2017 . IEEE Computer Society , 2017.442 Matias Tassano , Julie Delon , and Thomas Veit . Fastdvdnet : Towards real-time deep video denois-443 ing without flow estimation . In 2020 IEEE/CVF Conference on Computer Vision and Pattern444 Recognition , CVPR 2020 , Seattle , WA , USA , June 13-19 , 2020 . IEEE , 2020.445 Yapeng Tian , Yulun Zhang , Yun Fu , and Chenliang Xu . TDAN : temporally-deformable alignment446 network for video super-resolution . In 2020 IEEE/CVF Conference on Computer Vision and447 Pattern Recognition , CVPR 2020 , Seattle , WA , USA , June 13-19 , 2020 . IEEE , 2020.448 Mark S. Veillette , Siddharth Samsi , and Christopher J. Mattioli . SEVIR : A storm event imagery449 dataset for deep learning applications in radar and satellite meteorology . In Advances in Neu-450 ral Information Processing Systems 33 : Annual Conference on Neural Information Processing451 Systems 2020 , NeurIPS 2020 , December 6-12 , 2020 , virtual , 2020.452 Daniel Walton , Neil Berg , David Pierce , Ed Maurer , Alex Hall , Yen-Heng Lin , Stefan Rahimi , and453 Dan Cayan . Understanding differences in california climate projections produced by dynamical454 and statistical downscaling . Journal of Geophysical Research : Atmospheres , 2020.455 Xintao Wang , Ke Yu , Shixiang Wu , Jinjin Gu , Yihao Liu , Chao Dong , Yu Qiao , and Chen456 Change Loy . Esrgan : Enhanced super-resolution generative adversarial networks . In Proceedings457 of the European Conference on Computer Vision ( ECCV ) , pp . 0–0 , 2018.458 Xintao Wang , Kelvin CK Chan , Ke Yu , Chao Dong , and Chen Change Loy . Edvr : Video restoration459 with enhanced deformable convolutional networks . In Proceedings of the IEEE Conference on460 Computer Vision and Pattern Recognition Workshops , 2019.461 BL White , A Singh , and A Albert . Downscaling numerical weather models with gans . AGUFM,462 2019.463 Adrienne M Wootten , Elias C Massoud , Agniv Sengupta , Duane E Waliser , and Huikyo Lee . The464 effect of statistical downscaling on the weighting of multi-model ensembles of precipitation . Cli-465 mate , 8 ( 12 ) :138 , 2020.466 Youlong Xia , Kenneth Mitchell , Michael Ek , Justin Sheffield , Brian Cosgrove , Eric Wood , Lifeng467 Luo , Charles Alonge , Helin Wei , Jesse Meng , Ben Livneh , Dennis Lettenmaier , Victor Koren,468 Qingyun Duan , Kingtse Mo , Yun Fan , and David Mocko . Continental-scale water and energy469 flux analysis and validation for the north american land data assimilation system project phase470 2 ( nldas-2 ) : 1. intercomparison and application of model products . Journal of Geophysical Re-471 search : Atmospheres , 2012.472 Xiaoyu Xiang , Yapeng Tian , Yulun Zhang , Yun Fu , Jan P. Allebach , and Chenliang Xu . Zooming473 slow-mo : Fast and accurate one-stage space-time video super-resolution . In 2020 IEEE/CVF474 Conference on Computer Vision and Pattern Recognition , CVPR 2020 , Seattle , WA , USA , June475 13-19 , 2020 . IEEE , 2020.476 Tianfan Xue , Baian Chen , Jiajun Wu , Donglai Wei , and William T. Freeman . Video enhancement477 with task-oriented flow . Int . J. Comput . Vis. , 2019.478 Xuebin Zhang and Feng Yang . Rclimdex ( 1.0 ) user manual . Climate Research Branch Environment479 Canada , 22 , 2004.480 Yulun Zhang , Kunpeng Li , Kai Li , Lichen Wang , Bineng Zhong , and Yun Fu . Image super-481 resolution using very deep residual channel attention networks . In Computer Vision - ECCV482 2018 - 15th European Conference , Munich , Germany , September 8-14 , 2018 , Proceedings , Part483 VII , Lecture Notes in Computer Science . Springer , 2018.484
The paper provides a baseline method that generates a dataset of high+low res precipitation maps. The paper argues that precision of weather event predictions depend on the imagery resolution and hence having high res maps will lead to better weather prediction. The eventual dataset that is formed contains a variety of diverse climate events like hurricanes etc and the pair of high/low res forms the necessary annotation.
SP:3fed87e29b3609f6d356dafce16be061a85471ab
What to expect of hardware metric predictors in NAS
1 INTRODUCTION . Modern neural network architectures are designed not only considering their primary objective , such as accuracy . While existing architectures can be scaled down to work with the limited available memory and computational power of , e.g. , mobile phones , they are significantly outperformed by specifically designed architectures ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Zhang et al. , 2018 ; Ma et al. , 2018 ) . Standard hardware metrics include memory usage , number of model parameters , Multiply-Accumulate operations , energy consumption , latency , and more ; each of which may be limited by the hardware platform or network task . As the range of tasks and target platforms grows , specialized architectures and the methods to find them efficiently are gaining importance . The automated design and discovery of specialized architectures is the main intent of Neural Architecture Search ( NAS ) . This recent field of study repeatedly broke state of the art records ( Zoph et al. , 2018 ; Real et al. , 2018 ; Cai et al. , 2019 ; Tan & Le , 2019 ; Chu et al. , 2019a ; Hu et al. , 2020 ) while aiming to reduce the researchers ’ involvement with this tedious and time-consuming process to a minimum . As the performance of each considered architecture needs to be evaluated , the hardware metrics need to be either measured live or guessed by a trained prediction model . While measuring live has the advantage of not suffering from inaccurate predictions , the corresponding hardware needs to be available during the search process . Measuring on-demand may also significantly slow down the search process and necessitates further measurements for each new architecture search . On the other hand , a prediction model abstracts the hardware from the search code and simplifies changes to the optimization targets , such as metrics or devices . The data set to train the predictor also has to be collected only once so that a trained predictor then works in the absence of the hardware it is predicting for , e.g. , in a cloud environment . Furthermore , a differentiable predictor can be used for gradient-based architecture optimization of typically non-differentiable metrics ( Cai et al. , 2019 ; Xu et al. , 2020 ; Nayman et al. , 2021 ) . While the many advantages make predictors a popular choice of hardware-aware NAS ( e.g . Xu et al . ( 2020 ) ; Wu et al . ( 2019 ) ; Wan et al . ( 2020 ) ; Dai et al . ( 2020 ) ; Nayman et al . ( 2021 ) ) , there are no guidelines on which predictors perform best , how many training samples are required , or what happens when a predictor is inaccurate . This work investigates the above points . As a first contribution , we conduct large-scale experiments on ten hardware-metric datasets chosen from HWNAS-Bench ( Li et al. , 2021a ) and TransNAS-Bench-101 ( Duan et al. , 2021 ) . We explore how powerful the different predictors are when using different amounts of training data and whether these results generalize across different network architecture types . As a second contribution , we extensively simulate the subsequent architecture selection to investigate the impact of inaccurate predictors . Our results demonstrate the effectiveness of network-based prediction models ; provide insights into predictor mistakes and what to expect from them . To facilitate reproducibility and further research , our experimental results and code are made available in Appendix A . 2 RELATED WORK . NAS Benchmarks : As the search spaces of NAS methods often differ from one another and lack extensive studies , the difficulty of fair comparisons and reproducibility have become a major concern ( Yang et al. , 2019 ; Li & Talwalkar , 2020 ) . To alleviate this problem , researchers have exhaustively evaluated search spaces of several thousand architectures to create benchmarks ( Ying et al. , 2019 ; Dong & Yang , 2020 ; Dong et al. , 2020 ; Siems et al. , 2020 ) , containing detailed statistics for each architecture . TransNAS-Bench-101 ( Duan et al. , 2021 ) evaluates several thousand architectures across seven diverse tasks and finds that the best task-specific architectures may vary significantly . The popular NAS-BENCH 201 benchmark ( Dong & Yang , 2020 ) has been further extended with ten different hardware metrics for all 15625 architectures on each of the three data sets CIFAR10 , CIFAR100 ( Krizhevsky et al. , 2009 ) and ImageNet16-120 ( Chrabaszcz et al. , 2017 ) . Major findings of this HW-NAS Bench ( Li et al. , 2021a ) include that FLOPs and the number of parameters are a poor approximation for other metrics such as latency . Many existing NAS methods use such inadequate substitutes for their simplicity and would benefit from their replacement with better prediction models . Li et al . also find that hardware-specific costs do not correlate well across hardware platforms . While accounting for each device ’ s characteristics improves the NAS results , it is also expensive . Predictors can reduce costs by requiring fewer measurements and shorter query times . 1 . Predictors in NAS : Aside from real-time measurements ( Tan et al. , 2019 ; Yang et al. , 2018 ) , hardware metric estimation in NAS is commonly performed via Lookup Table ( Wu et al. , 2019 ) , Analytical Estimation or a Prediction Model ( Dai et al. , 2020 ; Xu et al. , 2020 ) . While an operationand layer-wise Lookup Table can accurately estimate hardware-agnostic metrics , such as FLOPs or the number of parameters ( Cai et al. , 2019 ; Guo et al. , 2020 ; Chu et al. , 2019a ) , they may be suboptimal for device-dependent metrics . Latency and energy consumption have non-obvious factors that depend on hardware specifics such as memory , cache usage , the ability to parallelize each operation , and an interplay between different network operations . Such details can be captured with neural networks ( Dai et al. , 2020 ; Mendoza & Wang , 2020 ; Ponomarev et al. , 2020 ; Xu et al. , 2020 ) or other specialized models ( Yao et al. , 2018 ; Wess et al. , 2021 ) . Of particular interest is the correct prediction of the model loss or accuracy , possibly reducing the architecture search time by orders of magnitude ( Mellor et al. , 2020 ; Wang et al. , 2021 ; Li et al. , 2021b ) . In addition to common predictors such as Linear Regression , Random Forests ( Liaw et al. , 2002 ) or Gaussian Processes ( Rasmussen , 2003 ) ; specialized techniques may exploit training curve extrapolation , network weight sharing or gradient information . Our experiments follow the recent large-scale study of White et al . ( 2021 ) , who compare 31 diverse accuracy prediction methods based on initialization and query time , using three NAS benchmarks . 3 PREDICTING HARDWARE METRICS . Our methods follow the large-scale study of White et al . ( 2021 ) , who compared a total of 31 accuracy prediction methods . The differences between accuracy and hardware-metric prediction , our selection of predictors , and the general training pipeline are described in this section . In our experiments on HW-NAS-Bench and TransNAS-Bench-101 , described in Section 4 , we then compare these predictors across different training set sizes . 1For further reading , we recommend a recent survey on hardware-aware NAS ( Benmeziane et al. , 2021 ) Differences to accuracy predictors : There are fundamental differences when predicting hardware metrics and the accuracy of network topologies . The most essential is the cost to obtain a helpful predictor , which may vary widely for accuracy prediction methods . While determining the test accuracy requires the costly and lengthy training of networks , measuring hardware metrics does not necessitate any network training . Consequentially , specialized accuracy-estimation methods that rely on trained networks , loss history , learning curve extrapolation , or early stopping do not apply to hardware metrics . Furthermore , so-called zero-cost proxies that predict metrics from the gradients of a single batch are dependant on the network topology but not on the hardware the network is placed on . Therefore , the dominant hardware-metric predictor family is model-based . Since all relevant predictors are model-based , they can be compared by their training set size . This simplifies the initialization time of a predictor as the number of prior measured architectures on which they are trained . In stark contrast , some accuracy predictors do not need any training data , while others require several partially or fully trained networks . Since an untrained network and a few batches suffice to measure a hardware-metric , the collection of such a training set is comparably inexpensive . Additionally , hardware predictors are generally used supplementary to a one-shot network optimized for loss or accuracy . Depending on the NAS method , a fully differentiable predictor is required in order to guide the gradient-based architecture selection . Typical choices are Lookup Tables ( Cai et al. , 2019 ; Nayman et al. , 2021 ) and neural networks ( Xu et al. , 2020 ) . Model-based predictors : The goal of a predictor fp ( a ) is to accurately approximate the function f ( a ) , which may be , e.g. , the latency of an architecture a from the search space A . A model-based predictor is trained via supervised learning on a setDtrain of datapoints ( a , f ( a ) ) , after which it can be inexpensively queried for estimates on further architectures . The collection of the dataset and the duration of the training are referred to as initialization time and training time respectively . The quality of such a trained predictor is generally determined by the ( ranking ) correlation between measurements { f ( a ) |a ∈ Atest } and predictions { fp ( a ) |a ∈ Atest } on the unseen architectures Atest ⊂ A . Common correlation metric choices are Pearson ( PCC ) , Spearman ( SCC ) and Kendall ’ s Tau ( KT ) ( Chu et al. , 2019b ; Yu et al. , 2020 ; Siems et al. , 2020 ) . Our experiments include 18 model-based predictors from different families : Linear Regression , Ridge Regression ( Saunders et al. , 1998 ) , Bayesian Linear Regression ( Bishop , 2007 ) , Support Vector Machines ( Cortes & Vapnik , 1995 ) , Gaussian Process ( Rasmussen , 2003 ) , Sparse Gaussian Process ( Candela & Rasmussen , 2005 ) , Random Forests ( Liaw et al. , 2002 ) , XGBoost ( Chen & Guestrin , 2016 ) , NGBoost ( Duan et al. , 2020 ) , LGBoost ( Ke et al. , 2017 ) , BOHAMIANN ( Springenberg et al. , 2016 ) , BANANAS ( White et al. , 2019 ) , BONAS ( Shi et al. , 2020 ) , GCN ( Wen et al. , 2020 ) , small and large Multi-Layer-Perceptrons ( MLP ) , NAO ( Luo et al. , 2018 ) , and a layeroperation-wise Lookup Table model . We provide further descriptions and implementation details in Appendix B. Hyper-parameter tuning : The default hyperparameters of the used predictors vary significantly in their levels of hyper-parameter tuning , especially in the context of NAS . Additionally , some predictors may internally make use of cross-validation , while others do not . Following White et al . ( 2021 ) , we attempt to level the playing field by running a cross-validation random-search over hyperparameters each time a predictor is fit to data . Each search is limited to 5000 iterations and a total run time of 15 minutes and naturally excludes any test data . The predictor-specific parameter details are given in Appendix C. Training pipeline To make a reliable comparison , we use the NASLib library ( Ruchte et al . ( 2020 ) , see Appendix A ) . We fit each predictor on each dataset and training size 50 times , using seeds { 0 , ... , 49 } . Some predictors internally normalize the training values ( subtract mean , divide by standard deviation ) . We choose to explicitly do this for all predictors and datasets , which reduces the dependency of hyper-parameters ( e.g . learning rate ) on the dataset and allows us to analyze and compare the prediction errors across datasets more effectively .
In neural architecture search (NAS), performance predictors are an important tool, because predicting attributes such as accuracy can save costly measurements. Hardware metric predictors predict metrics such as latency in addition to accuracy. This paper gives an empirical study of 18 different performance predictors on NAS-Bench-201 and TransNAS-Bench-101, evaluating the rank correlation of the predictors on different datasets and predicted metrics. Then they evaluate how the inaccuracy of the predictors affect the predicted Pareto-front of architectures, compared to the true Pareto front. The authors run this experiment by simulating the errors in predictors. The authors find that MLP models perform the best on average across all settings they tried, and leads to an acceptable predicted Pareto-front.
SP:d5262e875cc88b3a33653ebdc21d1b418c81d26b
What to expect of hardware metric predictors in NAS
1 INTRODUCTION . Modern neural network architectures are designed not only considering their primary objective , such as accuracy . While existing architectures can be scaled down to work with the limited available memory and computational power of , e.g. , mobile phones , they are significantly outperformed by specifically designed architectures ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Zhang et al. , 2018 ; Ma et al. , 2018 ) . Standard hardware metrics include memory usage , number of model parameters , Multiply-Accumulate operations , energy consumption , latency , and more ; each of which may be limited by the hardware platform or network task . As the range of tasks and target platforms grows , specialized architectures and the methods to find them efficiently are gaining importance . The automated design and discovery of specialized architectures is the main intent of Neural Architecture Search ( NAS ) . This recent field of study repeatedly broke state of the art records ( Zoph et al. , 2018 ; Real et al. , 2018 ; Cai et al. , 2019 ; Tan & Le , 2019 ; Chu et al. , 2019a ; Hu et al. , 2020 ) while aiming to reduce the researchers ’ involvement with this tedious and time-consuming process to a minimum . As the performance of each considered architecture needs to be evaluated , the hardware metrics need to be either measured live or guessed by a trained prediction model . While measuring live has the advantage of not suffering from inaccurate predictions , the corresponding hardware needs to be available during the search process . Measuring on-demand may also significantly slow down the search process and necessitates further measurements for each new architecture search . On the other hand , a prediction model abstracts the hardware from the search code and simplifies changes to the optimization targets , such as metrics or devices . The data set to train the predictor also has to be collected only once so that a trained predictor then works in the absence of the hardware it is predicting for , e.g. , in a cloud environment . Furthermore , a differentiable predictor can be used for gradient-based architecture optimization of typically non-differentiable metrics ( Cai et al. , 2019 ; Xu et al. , 2020 ; Nayman et al. , 2021 ) . While the many advantages make predictors a popular choice of hardware-aware NAS ( e.g . Xu et al . ( 2020 ) ; Wu et al . ( 2019 ) ; Wan et al . ( 2020 ) ; Dai et al . ( 2020 ) ; Nayman et al . ( 2021 ) ) , there are no guidelines on which predictors perform best , how many training samples are required , or what happens when a predictor is inaccurate . This work investigates the above points . As a first contribution , we conduct large-scale experiments on ten hardware-metric datasets chosen from HWNAS-Bench ( Li et al. , 2021a ) and TransNAS-Bench-101 ( Duan et al. , 2021 ) . We explore how powerful the different predictors are when using different amounts of training data and whether these results generalize across different network architecture types . As a second contribution , we extensively simulate the subsequent architecture selection to investigate the impact of inaccurate predictors . Our results demonstrate the effectiveness of network-based prediction models ; provide insights into predictor mistakes and what to expect from them . To facilitate reproducibility and further research , our experimental results and code are made available in Appendix A . 2 RELATED WORK . NAS Benchmarks : As the search spaces of NAS methods often differ from one another and lack extensive studies , the difficulty of fair comparisons and reproducibility have become a major concern ( Yang et al. , 2019 ; Li & Talwalkar , 2020 ) . To alleviate this problem , researchers have exhaustively evaluated search spaces of several thousand architectures to create benchmarks ( Ying et al. , 2019 ; Dong & Yang , 2020 ; Dong et al. , 2020 ; Siems et al. , 2020 ) , containing detailed statistics for each architecture . TransNAS-Bench-101 ( Duan et al. , 2021 ) evaluates several thousand architectures across seven diverse tasks and finds that the best task-specific architectures may vary significantly . The popular NAS-BENCH 201 benchmark ( Dong & Yang , 2020 ) has been further extended with ten different hardware metrics for all 15625 architectures on each of the three data sets CIFAR10 , CIFAR100 ( Krizhevsky et al. , 2009 ) and ImageNet16-120 ( Chrabaszcz et al. , 2017 ) . Major findings of this HW-NAS Bench ( Li et al. , 2021a ) include that FLOPs and the number of parameters are a poor approximation for other metrics such as latency . Many existing NAS methods use such inadequate substitutes for their simplicity and would benefit from their replacement with better prediction models . Li et al . also find that hardware-specific costs do not correlate well across hardware platforms . While accounting for each device ’ s characteristics improves the NAS results , it is also expensive . Predictors can reduce costs by requiring fewer measurements and shorter query times . 1 . Predictors in NAS : Aside from real-time measurements ( Tan et al. , 2019 ; Yang et al. , 2018 ) , hardware metric estimation in NAS is commonly performed via Lookup Table ( Wu et al. , 2019 ) , Analytical Estimation or a Prediction Model ( Dai et al. , 2020 ; Xu et al. , 2020 ) . While an operationand layer-wise Lookup Table can accurately estimate hardware-agnostic metrics , such as FLOPs or the number of parameters ( Cai et al. , 2019 ; Guo et al. , 2020 ; Chu et al. , 2019a ) , they may be suboptimal for device-dependent metrics . Latency and energy consumption have non-obvious factors that depend on hardware specifics such as memory , cache usage , the ability to parallelize each operation , and an interplay between different network operations . Such details can be captured with neural networks ( Dai et al. , 2020 ; Mendoza & Wang , 2020 ; Ponomarev et al. , 2020 ; Xu et al. , 2020 ) or other specialized models ( Yao et al. , 2018 ; Wess et al. , 2021 ) . Of particular interest is the correct prediction of the model loss or accuracy , possibly reducing the architecture search time by orders of magnitude ( Mellor et al. , 2020 ; Wang et al. , 2021 ; Li et al. , 2021b ) . In addition to common predictors such as Linear Regression , Random Forests ( Liaw et al. , 2002 ) or Gaussian Processes ( Rasmussen , 2003 ) ; specialized techniques may exploit training curve extrapolation , network weight sharing or gradient information . Our experiments follow the recent large-scale study of White et al . ( 2021 ) , who compare 31 diverse accuracy prediction methods based on initialization and query time , using three NAS benchmarks . 3 PREDICTING HARDWARE METRICS . Our methods follow the large-scale study of White et al . ( 2021 ) , who compared a total of 31 accuracy prediction methods . The differences between accuracy and hardware-metric prediction , our selection of predictors , and the general training pipeline are described in this section . In our experiments on HW-NAS-Bench and TransNAS-Bench-101 , described in Section 4 , we then compare these predictors across different training set sizes . 1For further reading , we recommend a recent survey on hardware-aware NAS ( Benmeziane et al. , 2021 ) Differences to accuracy predictors : There are fundamental differences when predicting hardware metrics and the accuracy of network topologies . The most essential is the cost to obtain a helpful predictor , which may vary widely for accuracy prediction methods . While determining the test accuracy requires the costly and lengthy training of networks , measuring hardware metrics does not necessitate any network training . Consequentially , specialized accuracy-estimation methods that rely on trained networks , loss history , learning curve extrapolation , or early stopping do not apply to hardware metrics . Furthermore , so-called zero-cost proxies that predict metrics from the gradients of a single batch are dependant on the network topology but not on the hardware the network is placed on . Therefore , the dominant hardware-metric predictor family is model-based . Since all relevant predictors are model-based , they can be compared by their training set size . This simplifies the initialization time of a predictor as the number of prior measured architectures on which they are trained . In stark contrast , some accuracy predictors do not need any training data , while others require several partially or fully trained networks . Since an untrained network and a few batches suffice to measure a hardware-metric , the collection of such a training set is comparably inexpensive . Additionally , hardware predictors are generally used supplementary to a one-shot network optimized for loss or accuracy . Depending on the NAS method , a fully differentiable predictor is required in order to guide the gradient-based architecture selection . Typical choices are Lookup Tables ( Cai et al. , 2019 ; Nayman et al. , 2021 ) and neural networks ( Xu et al. , 2020 ) . Model-based predictors : The goal of a predictor fp ( a ) is to accurately approximate the function f ( a ) , which may be , e.g. , the latency of an architecture a from the search space A . A model-based predictor is trained via supervised learning on a setDtrain of datapoints ( a , f ( a ) ) , after which it can be inexpensively queried for estimates on further architectures . The collection of the dataset and the duration of the training are referred to as initialization time and training time respectively . The quality of such a trained predictor is generally determined by the ( ranking ) correlation between measurements { f ( a ) |a ∈ Atest } and predictions { fp ( a ) |a ∈ Atest } on the unseen architectures Atest ⊂ A . Common correlation metric choices are Pearson ( PCC ) , Spearman ( SCC ) and Kendall ’ s Tau ( KT ) ( Chu et al. , 2019b ; Yu et al. , 2020 ; Siems et al. , 2020 ) . Our experiments include 18 model-based predictors from different families : Linear Regression , Ridge Regression ( Saunders et al. , 1998 ) , Bayesian Linear Regression ( Bishop , 2007 ) , Support Vector Machines ( Cortes & Vapnik , 1995 ) , Gaussian Process ( Rasmussen , 2003 ) , Sparse Gaussian Process ( Candela & Rasmussen , 2005 ) , Random Forests ( Liaw et al. , 2002 ) , XGBoost ( Chen & Guestrin , 2016 ) , NGBoost ( Duan et al. , 2020 ) , LGBoost ( Ke et al. , 2017 ) , BOHAMIANN ( Springenberg et al. , 2016 ) , BANANAS ( White et al. , 2019 ) , BONAS ( Shi et al. , 2020 ) , GCN ( Wen et al. , 2020 ) , small and large Multi-Layer-Perceptrons ( MLP ) , NAO ( Luo et al. , 2018 ) , and a layeroperation-wise Lookup Table model . We provide further descriptions and implementation details in Appendix B. Hyper-parameter tuning : The default hyperparameters of the used predictors vary significantly in their levels of hyper-parameter tuning , especially in the context of NAS . Additionally , some predictors may internally make use of cross-validation , while others do not . Following White et al . ( 2021 ) , we attempt to level the playing field by running a cross-validation random-search over hyperparameters each time a predictor is fit to data . Each search is limited to 5000 iterations and a total run time of 15 minutes and naturally excludes any test data . The predictor-specific parameter details are given in Appendix C. Training pipeline To make a reliable comparison , we use the NASLib library ( Ruchte et al . ( 2020 ) , see Appendix A ) . We fit each predictor on each dataset and training size 50 times , using seeds { 0 , ... , 49 } . Some predictors internally normalize the training values ( subtract mean , divide by standard deviation ) . We choose to explicitly do this for all predictors and datasets , which reduces the dependency of hyper-parameters ( e.g . learning rate ) on the dataset and allows us to analyze and compare the prediction errors across datasets more effectively .
This work provides a compressive analysis across multiple (18) different hardware performance predictors by - (1) collecting their performance under different amounts of training data and different input network structures and showing each prediction method’s advantageous/disadvantageous scenarios - (2) analyzing the prediction accuracy's influence on selecting subsequent hardware architecture and giving the insights on how to pick/design hardware performance predictors for the NAS. Based on the observation drawn, MLP ones are found to be the most promising predictors in terms of the accuracy with limited training samples, while the Lookup Table model serves as a very cheap and straightforward guidance. In terms of the architecture selection guided by the model-based predictor, the work conjectures by verifying some of the selected network structures’ hardware performance and increase the number of explored network structures can lead to better pareto front of the selected network architecture
SP:d5262e875cc88b3a33653ebdc21d1b418c81d26b
Attention: Self-Expression Is All You Need
1 INTRODUCTION . Attention , i.e. , the ability to selectively focus on a subset of sensory observations , while ignoring other irrelevant information , is a central component of human perception . For example , only a few words in a sentence may be useful for predicting the next word , or only a small portion of an image may be relevant for recognizing an object . This property of biological systems has inspired the recent development of attention-based neural architectures ( Bahdanau et al. , 2014 ) , such as Transformers ( Vaswani et al. , 2017 ) , BERT ( Devlin et al. , 2018 ) , GPT ( Radford et al. , 2018 ; 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and T5 ( Raffel et al. , 2019 ) , which have achieved impressive performance in multiple natural language processing tasks , including text classification ( Chaudhari et al. , 2019 ; Galassi et al. , 2020 ) , machine translation ( Ott et al. , 2018 ) , and question answering ( Garg et al. , 2020 ) . Attentionbased architectures have also led to state-of-the-art results in various computer vision tasks ( Khan et al. , 2021 ) , including image classification ( Dosovitskiy et al. , 2020 ) , object detection ( Carion et al. , 2020 ; Zhu et al. , 2020 ) , and visual question answering ( Tan & Bansal , 2019 ; Su et al. , 2019 ) . Much of the success behind attention-based architectures is attributed to their ability to capture longrange interactions among data tokens ( such as words and image patches ) via attention coefficients that are global , learnable and adapted to the input at test time . For example , while recurrent neural network architectures in natural language processing predict the next word in a sentence using information about a few previous words , self-attention mechanisms make a prediction based on interactions among all words . Similarly , while convolutional architectures in computer vision compute local interactions among image patches using weights that do not depend on the input image at test time , vision transformers compute global interactions that are adapted to the input at test time . In this paper , we show that many of the key ideas behind attention , which we briefly summarize in Section 2 , build upon a long history of prior work on manifold learning and image processing . In Section 3 we show that the scaled dot product attention mechanism is equivalent to kernelbased regression with the Gaussian kernel ( Nadaraya , 1964 ; Watson , 1964 ) , as recently pointed out in ( Chaudhari et al. , 2019 ; Zhang et al. , 2021a ) , and that more general attention mechanisms can be obtained by choosing other kernels . We also show in Section 3 that the non-local means image denoising algorithm ( Buades et al. , 2005 ) , which can also be understood as a form of kernel-based regression , is the main building block behind the vision transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) . As a consequence , we argue that the key innovation of attention relative to kernel-based regression is not on its ability to capture global long-range interactions that are adapted to the input data ( something that non-local means already does ) , but rather on the use of many learnable parameters for defining attention . In contrast , classical kernel methods typically tune only the kernel bandwidth . In Section 4 we establish several connections between masked attention and Locally Linear Embedding ( LLE ) ( Roweis & Saul , 2000 ; 2003 ) . Specifically , we show that LLE learns a low-dimensional representation of a dataset using a masked self-attention mechanism where the masks are defined by the nearest neighbors of a data point . The resulting coefficients are not constrained to be nonnegative , thus allowing for both positive and negative attention . Moreover , they depend explicitly on multiple data tokens , unlike attention coefficients which depend only on a pair of tokens . We also show that LLE ’ s training objective can be interpreted as a fill in the blanks self-supervised learning objective . However , a key limitation of LLE is that its local neighborhood is pre-specified , so a data point can not attend to any other point . This issue is resolved by self-expressiveness , which connects every point to every other point and uses sparse regularization to reveal which points to attend to . In Section 5 we show that self-attention is closely related the notion of self-expressiveness of Elhamifar & Vidal ( 2009 ; 2013 ) ; Vidal et al . ( 2016 ) , wherein the data points to be clustered are expressed as linear combinations of other points with global coefficients that are adapted to the data and capture long-range interactions among data points . Such self-expressive coefficients are then used to define a data affinity matrix which is used to cluster the data . A first difference between self-attention and self-expressive coefficients is that the latter are not restricted to be non-negative , thus allowing for both positive and negative attention . A second difference is that self-expressive coefficients are not defined as a function of the tokens parametrized by learnable weights . Instead , the coefficients are learned directly using an unsupervised loss . A third difference is that self-expressive coefficients are typically regularized to be sparse or low-rank . As a consequence , we argue that the key innovation of self-attention relative to self-expressiveness is neither in its ability to capture global long-range interactions that are adapted to the data nor in the ability to learn such interactions ( something that self-expressiveness already does ) , but rather on the fact that attention mechanisms use multiple attention-heads in parallel and are stacked into deep architectures . We conclude with future directions on how to improve self-expressiveness using self-attention and vice versa . For example , we argue that the use of sparse regularization in ( Elhamifar & Vidal , 2009 ; 2013 ) to automatically select the most relevant coefficients is a more principled way of handling a large number of tokens than restricting attention to arbitrary local neighborhoods , as done e.g. , in criss-cross attention ( Huang et al. , 2019 ) . To achieve this , we suggest unrolling the sparse encoding mechanism in order to induce sparse attention maps through multiple layers of attention . We conjecture this may not only improve self-attention-based architectures through the use of sparse regularizers on the attention coefficients , but also improve subspace clustering methods by using self-attention , as recently proposed in ( Zhang et al. , 2021b ) . This could also allow one to extend subspace clustering methods to nonlinear manifolds by stacking multiple layers of self-expressiveness . 2 TRANSFORMERS , ATTENTION AND SELF-ATTENTION 2.1 TRANSFORMER The transformer architecture was originally designed for processing data sequences , e.g. , a sequence of words in a sentence . As shown in Figure 1 , each element of the sequence is first mapped to a vector space through a suitable embedding , e.g. , a Word2vec embedding of a word . Since the architecture does not depend on the position and order of the input sequence , a positional encoding is added to the each input embedding . The resulting input tokens are then processed by a multi-head attention layer . This layer computes output tokens as linear combinations of input tokens weighted by attention coefficients designed to capture long-range interactions among input tokens , such as word associations . The output tokens are then processed by a residual connection followed by layer normalization , a feed-forward network such as an MLP , and another residual connection and normalization layer . Therefore , the main component of the transformer architecture is the ( multi-head ) attention layer , which we describe next . 2.2 ATTENTION As illustrated in Figure 2 , the attention layer is designed to capture longrange interactions among three types of input tokens : queries , keys and values . It does so by comparing queries to keys to produce a set of attention coefficients , which are then used to generate linear combinations of the values . Specifically , let us denote the queries by matrix Q = [ q1 , . . . , qNq ] ∈ Rd×Nq , the keys by matrix K = [ k1 , . . . , kNk ] ∈ Rd×Nk , and the corresponding values by matrix V = [ v1 , . . . , vNk ] ∈ Rdv×Nk . The attention layer computes an attention coefficient cij = attn ( ki , qj ) ∈ [ 0 , 1 ] for each key-query pair and returns a linear combination of the values as follows : zj = Nk∑ i=1 vicij or Z = V C , where C = attn ( K , Q ) ∈ [ 0 , 1 ] Nk×Nq . ( 1 ) Intuitively , the attention coefficient cij measures the importance of key ki for representing query qj and the representation zj combines the values vi that are most important for qj . The are many possible choices for the attention mechanism , including additive attention , multiplicative attention and dot product attention . A common choice is scaled dot product attention , which applies a softmax operator to the dot product of keys and queries scaled by the square root of their dimension , i.e . : C = softmax ( K > Q√ d ) = exp ( k > i qj/ √ d ) ∑ i exp ( k > i qj/ √ d ) . ( 2 ) Since the coefficients are non-negative and add up to one , zj is a convex combination of the values . Let us illustrate the intuition behind attention using the following ( overly simplified ) examples : 1 . Suppose we would like to translate sentences from French to English . Let qj be a feature embedding for the jth word of a sentence in French , and let ki = vi be an embedding for the ith word of the corresponding sentence in English . Ideally , the attention mechanism should be designed such that the coefficient cij is large ( cij ≈ 1 ) only for key-query pairs ( i , j ) that correspond to the translation of French word i into English word j , in which case the output to French query qj will be its translation into English zj = vi . 2 . Suppose we are given an image-caption pair and we would like to find which regions in the image corresponds to each word in the caption . Assume we also have a collection of bounding boxes extracted from the image , e.g. , using an object detector . Let the queries be feature embeddings for the words in the caption and the keys and values be CNN features extracted from the bounding boxes . Ideally , the attention mechanism should be designed such that cij is large when the box i corresponds to word j . That is , the attention mechanism is designed to tell us which regions to pay attention to for each word . Of course , in order for multilingual word embeddings to align with each other , or for word embeddings to match image features , both features need to be mapped to a common latent space through a learnable transformation . We discuss such mappings in the next subsection in the context of selfattention , but such mapping also apply here . 2.3 SELF-ATTENTION . Let X = [ x1 , . . . , xN ] ∈ RD×N denote a set of data tokens , such as words or image patches . The goal of self-attention is to capture long-range interactions among such tokens . Such interactions are captured by first transforming these tokens into keys , queries and values via learnable coefficient matrices WK ∈ Rd×D , WQ ∈ Rd×D , and WV ∈ Rdv×d , respectively , as follows : K = WKX ∈ Rd×N , Q = WQX ∈ Rd×N , and V = WVX ∈ Rdv×n . ( 3 ) Then , we can define a set of transformed tokens using attention , e.g . : Z = V softmax ( K > Q/ √ d ) . ( 4 ) Let us illustrate the intuition behind self-attention using the vision transformer ( ViT ) proposed in ( Dosovitskiy et al. , 2020 ) . As shown in Figure 2.3 , the ViT divides an input image into a collection of patches and maps those patches to a set of vectors via a learnable linear projection . Each projected patch is augmented with a positional encoding for the location of the patch in the image . Since ViT is designed for image classification , an additional ( zero ) token is added to the input of the transformer . This token is expected to capture class information and is learned during training . The transformer encoder processes all these tokens using self-attention . Specifically , new tokens are formed as linear combinations of patches weighted by attention coefficients that capture relationships among image patches . Moreover , attention coeffi- cients relating the class token to patch tokens are expected to capture which patches to pay attention to in order to classify the image . The output class token is then passed through an MLP head to produce class probabilities . The network parameters ( input class token , patch projection , self-attention weights , encoder MLP , MLP head ) are learned using a cross-entropy loss for classification .
This paper studies the correlation between the attention mechanism and many prior arts. Heuristically, this paper links the currently hot topic, attention mechanism, with many milestones works in the past decades before the deep learning era, including subspace learning, sparse coding, kernel regression, non-local means, etc. Among these classic methods, many can be formulated as optimization problems. The minimizer to the optimization problem can be treated as the output of attention modules, and the optimization algorithm can be understood as the ``architecture'' of attention. Specifically, this work highlights the potential of sparse coding in designing the sparse attention mechanism when considering the self-expressiveness in subspace learning is essentially profoundly connected to the formulation of self-attention.
SP:c95b7015438d26176ef74968cca54ea98fddab98
Attention: Self-Expression Is All You Need
1 INTRODUCTION . Attention , i.e. , the ability to selectively focus on a subset of sensory observations , while ignoring other irrelevant information , is a central component of human perception . For example , only a few words in a sentence may be useful for predicting the next word , or only a small portion of an image may be relevant for recognizing an object . This property of biological systems has inspired the recent development of attention-based neural architectures ( Bahdanau et al. , 2014 ) , such as Transformers ( Vaswani et al. , 2017 ) , BERT ( Devlin et al. , 2018 ) , GPT ( Radford et al. , 2018 ; 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and T5 ( Raffel et al. , 2019 ) , which have achieved impressive performance in multiple natural language processing tasks , including text classification ( Chaudhari et al. , 2019 ; Galassi et al. , 2020 ) , machine translation ( Ott et al. , 2018 ) , and question answering ( Garg et al. , 2020 ) . Attentionbased architectures have also led to state-of-the-art results in various computer vision tasks ( Khan et al. , 2021 ) , including image classification ( Dosovitskiy et al. , 2020 ) , object detection ( Carion et al. , 2020 ; Zhu et al. , 2020 ) , and visual question answering ( Tan & Bansal , 2019 ; Su et al. , 2019 ) . Much of the success behind attention-based architectures is attributed to their ability to capture longrange interactions among data tokens ( such as words and image patches ) via attention coefficients that are global , learnable and adapted to the input at test time . For example , while recurrent neural network architectures in natural language processing predict the next word in a sentence using information about a few previous words , self-attention mechanisms make a prediction based on interactions among all words . Similarly , while convolutional architectures in computer vision compute local interactions among image patches using weights that do not depend on the input image at test time , vision transformers compute global interactions that are adapted to the input at test time . In this paper , we show that many of the key ideas behind attention , which we briefly summarize in Section 2 , build upon a long history of prior work on manifold learning and image processing . In Section 3 we show that the scaled dot product attention mechanism is equivalent to kernelbased regression with the Gaussian kernel ( Nadaraya , 1964 ; Watson , 1964 ) , as recently pointed out in ( Chaudhari et al. , 2019 ; Zhang et al. , 2021a ) , and that more general attention mechanisms can be obtained by choosing other kernels . We also show in Section 3 that the non-local means image denoising algorithm ( Buades et al. , 2005 ) , which can also be understood as a form of kernel-based regression , is the main building block behind the vision transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) . As a consequence , we argue that the key innovation of attention relative to kernel-based regression is not on its ability to capture global long-range interactions that are adapted to the input data ( something that non-local means already does ) , but rather on the use of many learnable parameters for defining attention . In contrast , classical kernel methods typically tune only the kernel bandwidth . In Section 4 we establish several connections between masked attention and Locally Linear Embedding ( LLE ) ( Roweis & Saul , 2000 ; 2003 ) . Specifically , we show that LLE learns a low-dimensional representation of a dataset using a masked self-attention mechanism where the masks are defined by the nearest neighbors of a data point . The resulting coefficients are not constrained to be nonnegative , thus allowing for both positive and negative attention . Moreover , they depend explicitly on multiple data tokens , unlike attention coefficients which depend only on a pair of tokens . We also show that LLE ’ s training objective can be interpreted as a fill in the blanks self-supervised learning objective . However , a key limitation of LLE is that its local neighborhood is pre-specified , so a data point can not attend to any other point . This issue is resolved by self-expressiveness , which connects every point to every other point and uses sparse regularization to reveal which points to attend to . In Section 5 we show that self-attention is closely related the notion of self-expressiveness of Elhamifar & Vidal ( 2009 ; 2013 ) ; Vidal et al . ( 2016 ) , wherein the data points to be clustered are expressed as linear combinations of other points with global coefficients that are adapted to the data and capture long-range interactions among data points . Such self-expressive coefficients are then used to define a data affinity matrix which is used to cluster the data . A first difference between self-attention and self-expressive coefficients is that the latter are not restricted to be non-negative , thus allowing for both positive and negative attention . A second difference is that self-expressive coefficients are not defined as a function of the tokens parametrized by learnable weights . Instead , the coefficients are learned directly using an unsupervised loss . A third difference is that self-expressive coefficients are typically regularized to be sparse or low-rank . As a consequence , we argue that the key innovation of self-attention relative to self-expressiveness is neither in its ability to capture global long-range interactions that are adapted to the data nor in the ability to learn such interactions ( something that self-expressiveness already does ) , but rather on the fact that attention mechanisms use multiple attention-heads in parallel and are stacked into deep architectures . We conclude with future directions on how to improve self-expressiveness using self-attention and vice versa . For example , we argue that the use of sparse regularization in ( Elhamifar & Vidal , 2009 ; 2013 ) to automatically select the most relevant coefficients is a more principled way of handling a large number of tokens than restricting attention to arbitrary local neighborhoods , as done e.g. , in criss-cross attention ( Huang et al. , 2019 ) . To achieve this , we suggest unrolling the sparse encoding mechanism in order to induce sparse attention maps through multiple layers of attention . We conjecture this may not only improve self-attention-based architectures through the use of sparse regularizers on the attention coefficients , but also improve subspace clustering methods by using self-attention , as recently proposed in ( Zhang et al. , 2021b ) . This could also allow one to extend subspace clustering methods to nonlinear manifolds by stacking multiple layers of self-expressiveness . 2 TRANSFORMERS , ATTENTION AND SELF-ATTENTION 2.1 TRANSFORMER The transformer architecture was originally designed for processing data sequences , e.g. , a sequence of words in a sentence . As shown in Figure 1 , each element of the sequence is first mapped to a vector space through a suitable embedding , e.g. , a Word2vec embedding of a word . Since the architecture does not depend on the position and order of the input sequence , a positional encoding is added to the each input embedding . The resulting input tokens are then processed by a multi-head attention layer . This layer computes output tokens as linear combinations of input tokens weighted by attention coefficients designed to capture long-range interactions among input tokens , such as word associations . The output tokens are then processed by a residual connection followed by layer normalization , a feed-forward network such as an MLP , and another residual connection and normalization layer . Therefore , the main component of the transformer architecture is the ( multi-head ) attention layer , which we describe next . 2.2 ATTENTION As illustrated in Figure 2 , the attention layer is designed to capture longrange interactions among three types of input tokens : queries , keys and values . It does so by comparing queries to keys to produce a set of attention coefficients , which are then used to generate linear combinations of the values . Specifically , let us denote the queries by matrix Q = [ q1 , . . . , qNq ] ∈ Rd×Nq , the keys by matrix K = [ k1 , . . . , kNk ] ∈ Rd×Nk , and the corresponding values by matrix V = [ v1 , . . . , vNk ] ∈ Rdv×Nk . The attention layer computes an attention coefficient cij = attn ( ki , qj ) ∈ [ 0 , 1 ] for each key-query pair and returns a linear combination of the values as follows : zj = Nk∑ i=1 vicij or Z = V C , where C = attn ( K , Q ) ∈ [ 0 , 1 ] Nk×Nq . ( 1 ) Intuitively , the attention coefficient cij measures the importance of key ki for representing query qj and the representation zj combines the values vi that are most important for qj . The are many possible choices for the attention mechanism , including additive attention , multiplicative attention and dot product attention . A common choice is scaled dot product attention , which applies a softmax operator to the dot product of keys and queries scaled by the square root of their dimension , i.e . : C = softmax ( K > Q√ d ) = exp ( k > i qj/ √ d ) ∑ i exp ( k > i qj/ √ d ) . ( 2 ) Since the coefficients are non-negative and add up to one , zj is a convex combination of the values . Let us illustrate the intuition behind attention using the following ( overly simplified ) examples : 1 . Suppose we would like to translate sentences from French to English . Let qj be a feature embedding for the jth word of a sentence in French , and let ki = vi be an embedding for the ith word of the corresponding sentence in English . Ideally , the attention mechanism should be designed such that the coefficient cij is large ( cij ≈ 1 ) only for key-query pairs ( i , j ) that correspond to the translation of French word i into English word j , in which case the output to French query qj will be its translation into English zj = vi . 2 . Suppose we are given an image-caption pair and we would like to find which regions in the image corresponds to each word in the caption . Assume we also have a collection of bounding boxes extracted from the image , e.g. , using an object detector . Let the queries be feature embeddings for the words in the caption and the keys and values be CNN features extracted from the bounding boxes . Ideally , the attention mechanism should be designed such that cij is large when the box i corresponds to word j . That is , the attention mechanism is designed to tell us which regions to pay attention to for each word . Of course , in order for multilingual word embeddings to align with each other , or for word embeddings to match image features , both features need to be mapped to a common latent space through a learnable transformation . We discuss such mappings in the next subsection in the context of selfattention , but such mapping also apply here . 2.3 SELF-ATTENTION . Let X = [ x1 , . . . , xN ] ∈ RD×N denote a set of data tokens , such as words or image patches . The goal of self-attention is to capture long-range interactions among such tokens . Such interactions are captured by first transforming these tokens into keys , queries and values via learnable coefficient matrices WK ∈ Rd×D , WQ ∈ Rd×D , and WV ∈ Rdv×d , respectively , as follows : K = WKX ∈ Rd×N , Q = WQX ∈ Rd×N , and V = WVX ∈ Rdv×n . ( 3 ) Then , we can define a set of transformed tokens using attention , e.g . : Z = V softmax ( K > Q/ √ d ) . ( 4 ) Let us illustrate the intuition behind self-attention using the vision transformer ( ViT ) proposed in ( Dosovitskiy et al. , 2020 ) . As shown in Figure 2.3 , the ViT divides an input image into a collection of patches and maps those patches to a set of vectors via a learnable linear projection . Each projected patch is augmented with a positional encoding for the location of the patch in the image . Since ViT is designed for image classification , an additional ( zero ) token is added to the input of the transformer . This token is expected to capture class information and is learned during training . The transformer encoder processes all these tokens using self-attention . Specifically , new tokens are formed as linear combinations of patches weighted by attention coefficients that capture relationships among image patches . Moreover , attention coeffi- cients relating the class token to patch tokens are expected to capture which patches to pay attention to in order to classify the image . The output class token is then passed through an MLP head to produce class probabilities . The network parameters ( input class token , patch projection , self-attention weights , encoder MLP , MLP head ) are learned using a cross-entropy loss for classification .
This paper surveys several lines of prior work which has connection to the self-attention module in transformers. Specifically, the authors show that self-attention has the similar form with the kernel regression and non-local mean algorithm. They also demonstrate that locally linear embedding and self-expression algorithm for subspace clustering have the form of representing one data point by weighted sum of other data points, and thus are connected to the weighted sum of values in self-attention. Based on these observations, the authors argue that the innovation of self-attention is not modeling the long-range relation, which is also proposed in prior work, but the learnable parameters and the multi-head design. The authors also suggest several directions for future work, such as using self-attention for manifold clustering.
SP:c95b7015438d26176ef74968cca54ea98fddab98
Multi-scale fusion self attention mechanism
1 INTRODUCTION . Attention mechanism is a model widely used in natural language processing tasks . Attention determines where the model needs attention by constructing an attention matrix . With the in-depth study of attention model , Vaswani et al . ( 2017 ) proposed a more advanced self attention mechanism . The self attention model dynamically constructs the attention matrix by calculating the correlation degree between words . Compared with the traditional attention mechanism , the self attention model can construct different attention matrices for different inputs and retain more information . Although the current self-attention model has achieved relatively successful results , we have found a serious problem , that is , self-attention can directly calculate dependencies between words . Although this attention matrix can pay good attention to the relevant information between one-to-one words . However , in real life , the language environment is very complicated . There are often many phrases in sentences . These phrases may contain many words , but the words that make up the phrase often can not fully express the meaning of the phrase itself . At this time , we need to be able to extract the one-to-many relationship between words and phrases . for instance : In Figure 1 , we give two examples . The two parts framed in green in the sentence are two phrases in the sentence . The meaning expressed by phrases such as “ in order to ” and “ Cambridge University ” in the two sentences can not get the corresponding meaning from any word of the two phrases . Therefore , these phrases need to be regarded as a whole to construct the attention matrix , so as to ensure that the information extracted by the model is correct . In previous research work , Yao et al . ( 2019 ) conducted pooling operation on entity words in relation extraction task to achieve the effect of phrase information coding . However , this operation has great limitations , that is , we need to know the position and length of phrases in advance , which is very difficult for general tasks . In this paper , we propose to use convolution kernels of different sizes to extract phrase level information in sentences , and learn whether to interact with the sampled information adaptively by the model itself . At the same time , not all scale information is required by the model , and the conflict between phrase information and its constituent words should be taken into account when selecting . For example , as shown in sentence 1 of Figure 1 , when calculating the weight of attention matrix , if the relevance of ( go , in order to ) is large , the attention relevance of ( go , in ) ( go , order ) ( go , to ) should be reduced accordingly , and vice versa . Therefore , we design a unique matrix sparsity strategy , which can better adapt to our multi-scale fusion self-attention model . The experimental results show that our model has a better effect on the relationship extraction task , and achieves a better level than the baseline on the GLUE data set . The main contributions of this paper include : 1 . Based on the traditional self attention mechanism , the phrase level representation is extracted through sampling at different scales , and the attention matrix is constructed by using the representation , which improves the deficiency that the attention model can only extract one-to-one information between words . 2 . On the basis of integrating multi-scale information , in order to better guide the model for information selection , a sparsity strategy of attention matrix is proposed , which can better select the information that needs to be focused when constructing attention matrix . 2 RELATED WORK . The initial attention mechanism is widely used in natural language processing tasks as a model to integrate information . The initial attention mechanism is often used as a model to learn the association between hidden vectors after Recurrent Neural Network ( RNN ) . Note that the emergence of the model breaks the limitation that the traditional encoder decoder structure depends on an internal fixed length vector during encoding and decoding ( Zhou et al . ( 2016 ) ) Du et al . ( 2018 ) Found in many experiments that the original single one-dimensional vector can no longer meet the requirements of extracting information diversity , so they proposed to build a 2-D attention matrix to adapt to more complex situations . Among them , they believe that each dimension in such a 2-D level attention matrix represents a different focus direction Vaswani et al . ( 2017 ) put forward the self attention mechanism in the transformer model . The author takes the attention model as the main structure of the model , improves the parallelism of the model , and changes the invariable characteristics of the previous attention matrix . The self attention model creates more contextual representations by designing different attention matrices for different samples . Correia et al . ( 2019 ) considered that the complexity of the model will increase with the increase of sentence length in the operation process of self attention mechanism , which makes it difficult for the model to deal with long text information . Therefore , the author puts forward some suggestions α- Entmax method to construct a sparse attention matrix . By constructing such a sparse attention matrix model , the parameters are reduced , which can adapt to longer text data . Li et al . ( 2021 ) aiming at the problem of insufficient information extraction in the traditional attention mechanism , proposed a method of using the hard attention mechanism to extract the important information of the model . At the same time , the author also proposed a method of adding negative information to the attention matrix to enrich the diversity of the model . 2.1 SELF ATTENTION . Before introducing our work , we first briefly introduce the self attention model of Vaswani et al . ( 2017 ) in transformer . Formally , We assume that H is a vectorized representation of a sentence with length n. The attention mechanism starts by projecting the tokens into three subspaces : the query subspace Q , key subspace K , and value subspace V , with corresponding projection matrices WQ , WK , WV . It then computes the n × n attention matrix A as follows . A = softmax ( ( Q ·KT ) / √ dk ) ( 1 ) Where dk is a scaling factor , T represents transpose operation , and K is used to calculate the correlation score between each item and the query . Then , the normalized attention weight is calculated using softmax , and the obtained attention matrix A is used to weight the value of each item in each query context . Finally , the obtained attention matrix A is multiplied by vector V to obtain the final sentence representation . 3 METHOD . In this section , we propose a general attention model , multi-scale fusion self attention mechanism , which can pay attention to the phrase level information in the sample . Our multi-scale fusion self attention model consists of two parts : multi-scale attention module and dynamic sparse module . After obtaining the corresponding coded representation of each word of the input sentence , the multi-scale attention module obtains the attention matrix at different scales . The dynamic sparse module constructs a dynamic coefficient strategy to construct a sparse attention matrix according to the summarized attention characteristics . Finally , the constructed attention matrix is multiplied by the value matrix to obtain a sentence representation with phrase level information.The multi-scale attention module is shown in Figure 2 . 3.1 MULTI-SCALE ATTENTION MODULE . Given a sentence S of length n , where Si ( 1≤i≤n ) is the word in the sentence , we can get their vector representation after encoding . The encoder can be Bert or LSTM . Take Bert as an example : H = Bert ( S ) ( 2 ) Where H ∈ Rn∗d is the vectorized representation of the sentence , where d is the encoding length , and Hi is the encoding representation of each words in the sentence . In order to obtain vector representation of different scales , we use convolutional neural network to further extract information from sentence representation . Convolutional neural network ( CNN ) can not integrate global information because it is limited by the scale of receptive field of convolution kernel , but it also makes a great improvement for Convolutional neural network to extract local informations , We use this to control the length of phrase level information to be extracted by setting the scale k of convolution kernel , so as to achieve the effect of integrating phrase level information . Convolution is an operation between the weight vector wc and the input vector of the input sequence H. The weight matrix wc is regarded as a convolution filter . We assume that the length of the filter is k , so wc ∈ Rk∗d . Convolution involves multiplying the dot product of wc by each k-gram in sequence H to obtain another sequence Hconv : Hjconv = wc Hj−k+1 : j ( 3 ) Where means multiply element by element . In order to ensure that the length of Hconv is consistent with H , we padded the convolution operation . At the same time , due to the ability to capture different features , it is usually necessary to use multiple filters ( or feature maps ) in convolution . Therefore , we use d filters ( Wc = w1c , w 2 c , ·· , w d c ) , and the convolution operation can be expressed as : Hijconv = w i c Hj−k+1 : j ( 0 ≤ i < d ) ( 4 ) The convolution result is matrix Hconv= [ H1conv , H 2 conv , ··· , H d conv ] ∈ Rd∗n . H integrates the phrase level information with K as the length . In the process of constructing the attention matrix , we refer to the construction method of Vaswani et al , and make corresponding modifications according to the characteristics of our task . The formula is as follows : Q = H ·WQ ( 5 ) K = H ·WK ( 6 ) Kconv = H T conv ·WK ( 7 ) ATT = softmax ( ( Q ·KT ) / √ dk ) ( 8 ) ATTconv = softmax ( ( Q ·KTconv ) / √ dk ) ( 9 ) The above formula is our method to construct a multi-scale attention matrix , where WQ and WK are trainable parameter matrixs with the shape of d * d. Kconv is the key matrix calculated by Hconv integrating phrase level information . The difference from the construction of Vaswani et al is that we calculated ATTconv , which is obtained by multiplying the query matrix with word as the minimum granularity and the key matrix Kconv with phrase as the minimum granularity . Its purpose is to calculate the degree of attention between words and phrases on different scales . 3.2 DYNAMIC SPARSE MODULE . In constructing the multi-scale attention model , we note that although there is phrase information in sentences , not all phrases with length k can be expressed as phrases . At the same time , we should also consider the differences between the traditional attention matrix and the multi-scale attention matrix , that is , if a word chooses to pay attention to a phrase , it should reduce the attention to each word in the phrase . Therefore , we design a dynamic sparse module for our multi-scale attention module , which can be dynamically adjusted to ensure that the model can select more suitable phrase information.The dynamic sparse module is shown in Figure 3 . The method is as follows . Q1 = H ·WQ1 ( 10 ) K1 = H ·WK1 ( 11 ) ATTcut = softmax ( ( Q1 ·KT1 ) / √ dk ) ( 12 ) WQ1 and WK1 are two trainable parameter matrices with the shape of d * d. in the above formula , we choose to reconstruct a network for calculating similarity . Different from formula 8 , this formula will be used to construct a sparse attention matrix . We set a threshold µ for att matrix to select whether the information is truncated . If the value of this position is greater than the threshold , it will be set to 1 . If not , it will be set to 0 . The formula is as follows : Maskqj = 1 if ( ATT qjcut > µ ) else 0 ( 13 ) Because the size of the threshold will closely affect the location of the matrix ’ s attention , here we set the threshold to 1 / n , so we get a mask matrix composed of 0 and 1 . Because this mask matrix only uses word level attention , we also need to build a mask matrix of multi-scale attention matrix . In order to realize the difference between traditional attention matrix and multi-scale attention matrix , we choose to reverse build the mask matrix of multi-scale attention matrix according to Mask matrix . The formula is as follows : Maskconv = E −Mask ( 14 ) Where E is a matrix with all values of one , so we can obtain the corresponding sparse multi-scale attention matrix according to the two mask matrices . The formula is as follows : ATTM = ATT Mask ( 15 ) ATTMc = ATTconv Maskconv ( 16 ) ATTfin = [ ATTM , ATTMc ] ( 17 ) ATTfin is the final attention matrix , which is obtained by splicing the traditional attention matrix and our multi-scale attention matrix in the last dimension , so it ’ s shape is n * 2n . ATTfin represents the correlation degree between the i-th word and the j-th word . When 1 ≤ j ≤ n , its value represents the attention value between words , and when n < j ≤ 2n , it represents the attention value between the i-th word and the ( j-n ) -th phrase . V = [ H HTconv ] ·WV ( 18 ) S = ATTfin · V ( 19 ) The calculation method of the value matrix is shown in formula 16 . For the trainable parameter matrix with the shape of d * d at WV , we splice H and Hconv in the first dimension and obtain the value matrix V with the shape of 2n * d through linear transformation.Finally , we multiply the obtained attention matrix ATTfin and value matrix V to obtain the final sentence representation . After obtaining the representation , we can use pooling or other dimensionality reduction methods to realize the final flat representation .
The manuscript presents a multi-scale self-attention method for NLP tasks. The aim is to better extract phrase- and word-level features. The main contribution of the proposed method is to apply different kernel sizes for feature extraction and multi-scale attention fusion. Additionally, a mechanism called dynamic sparse module is applied to adjust the weights of the obtained attention matrix.
SP:ef4369d2452cc6bc680eff611350cbf6f20e2e3b
Multi-scale fusion self attention mechanism
1 INTRODUCTION . Attention mechanism is a model widely used in natural language processing tasks . Attention determines where the model needs attention by constructing an attention matrix . With the in-depth study of attention model , Vaswani et al . ( 2017 ) proposed a more advanced self attention mechanism . The self attention model dynamically constructs the attention matrix by calculating the correlation degree between words . Compared with the traditional attention mechanism , the self attention model can construct different attention matrices for different inputs and retain more information . Although the current self-attention model has achieved relatively successful results , we have found a serious problem , that is , self-attention can directly calculate dependencies between words . Although this attention matrix can pay good attention to the relevant information between one-to-one words . However , in real life , the language environment is very complicated . There are often many phrases in sentences . These phrases may contain many words , but the words that make up the phrase often can not fully express the meaning of the phrase itself . At this time , we need to be able to extract the one-to-many relationship between words and phrases . for instance : In Figure 1 , we give two examples . The two parts framed in green in the sentence are two phrases in the sentence . The meaning expressed by phrases such as “ in order to ” and “ Cambridge University ” in the two sentences can not get the corresponding meaning from any word of the two phrases . Therefore , these phrases need to be regarded as a whole to construct the attention matrix , so as to ensure that the information extracted by the model is correct . In previous research work , Yao et al . ( 2019 ) conducted pooling operation on entity words in relation extraction task to achieve the effect of phrase information coding . However , this operation has great limitations , that is , we need to know the position and length of phrases in advance , which is very difficult for general tasks . In this paper , we propose to use convolution kernels of different sizes to extract phrase level information in sentences , and learn whether to interact with the sampled information adaptively by the model itself . At the same time , not all scale information is required by the model , and the conflict between phrase information and its constituent words should be taken into account when selecting . For example , as shown in sentence 1 of Figure 1 , when calculating the weight of attention matrix , if the relevance of ( go , in order to ) is large , the attention relevance of ( go , in ) ( go , order ) ( go , to ) should be reduced accordingly , and vice versa . Therefore , we design a unique matrix sparsity strategy , which can better adapt to our multi-scale fusion self-attention model . The experimental results show that our model has a better effect on the relationship extraction task , and achieves a better level than the baseline on the GLUE data set . The main contributions of this paper include : 1 . Based on the traditional self attention mechanism , the phrase level representation is extracted through sampling at different scales , and the attention matrix is constructed by using the representation , which improves the deficiency that the attention model can only extract one-to-one information between words . 2 . On the basis of integrating multi-scale information , in order to better guide the model for information selection , a sparsity strategy of attention matrix is proposed , which can better select the information that needs to be focused when constructing attention matrix . 2 RELATED WORK . The initial attention mechanism is widely used in natural language processing tasks as a model to integrate information . The initial attention mechanism is often used as a model to learn the association between hidden vectors after Recurrent Neural Network ( RNN ) . Note that the emergence of the model breaks the limitation that the traditional encoder decoder structure depends on an internal fixed length vector during encoding and decoding ( Zhou et al . ( 2016 ) ) Du et al . ( 2018 ) Found in many experiments that the original single one-dimensional vector can no longer meet the requirements of extracting information diversity , so they proposed to build a 2-D attention matrix to adapt to more complex situations . Among them , they believe that each dimension in such a 2-D level attention matrix represents a different focus direction Vaswani et al . ( 2017 ) put forward the self attention mechanism in the transformer model . The author takes the attention model as the main structure of the model , improves the parallelism of the model , and changes the invariable characteristics of the previous attention matrix . The self attention model creates more contextual representations by designing different attention matrices for different samples . Correia et al . ( 2019 ) considered that the complexity of the model will increase with the increase of sentence length in the operation process of self attention mechanism , which makes it difficult for the model to deal with long text information . Therefore , the author puts forward some suggestions α- Entmax method to construct a sparse attention matrix . By constructing such a sparse attention matrix model , the parameters are reduced , which can adapt to longer text data . Li et al . ( 2021 ) aiming at the problem of insufficient information extraction in the traditional attention mechanism , proposed a method of using the hard attention mechanism to extract the important information of the model . At the same time , the author also proposed a method of adding negative information to the attention matrix to enrich the diversity of the model . 2.1 SELF ATTENTION . Before introducing our work , we first briefly introduce the self attention model of Vaswani et al . ( 2017 ) in transformer . Formally , We assume that H is a vectorized representation of a sentence with length n. The attention mechanism starts by projecting the tokens into three subspaces : the query subspace Q , key subspace K , and value subspace V , with corresponding projection matrices WQ , WK , WV . It then computes the n × n attention matrix A as follows . A = softmax ( ( Q ·KT ) / √ dk ) ( 1 ) Where dk is a scaling factor , T represents transpose operation , and K is used to calculate the correlation score between each item and the query . Then , the normalized attention weight is calculated using softmax , and the obtained attention matrix A is used to weight the value of each item in each query context . Finally , the obtained attention matrix A is multiplied by vector V to obtain the final sentence representation . 3 METHOD . In this section , we propose a general attention model , multi-scale fusion self attention mechanism , which can pay attention to the phrase level information in the sample . Our multi-scale fusion self attention model consists of two parts : multi-scale attention module and dynamic sparse module . After obtaining the corresponding coded representation of each word of the input sentence , the multi-scale attention module obtains the attention matrix at different scales . The dynamic sparse module constructs a dynamic coefficient strategy to construct a sparse attention matrix according to the summarized attention characteristics . Finally , the constructed attention matrix is multiplied by the value matrix to obtain a sentence representation with phrase level information.The multi-scale attention module is shown in Figure 2 . 3.1 MULTI-SCALE ATTENTION MODULE . Given a sentence S of length n , where Si ( 1≤i≤n ) is the word in the sentence , we can get their vector representation after encoding . The encoder can be Bert or LSTM . Take Bert as an example : H = Bert ( S ) ( 2 ) Where H ∈ Rn∗d is the vectorized representation of the sentence , where d is the encoding length , and Hi is the encoding representation of each words in the sentence . In order to obtain vector representation of different scales , we use convolutional neural network to further extract information from sentence representation . Convolutional neural network ( CNN ) can not integrate global information because it is limited by the scale of receptive field of convolution kernel , but it also makes a great improvement for Convolutional neural network to extract local informations , We use this to control the length of phrase level information to be extracted by setting the scale k of convolution kernel , so as to achieve the effect of integrating phrase level information . Convolution is an operation between the weight vector wc and the input vector of the input sequence H. The weight matrix wc is regarded as a convolution filter . We assume that the length of the filter is k , so wc ∈ Rk∗d . Convolution involves multiplying the dot product of wc by each k-gram in sequence H to obtain another sequence Hconv : Hjconv = wc Hj−k+1 : j ( 3 ) Where means multiply element by element . In order to ensure that the length of Hconv is consistent with H , we padded the convolution operation . At the same time , due to the ability to capture different features , it is usually necessary to use multiple filters ( or feature maps ) in convolution . Therefore , we use d filters ( Wc = w1c , w 2 c , ·· , w d c ) , and the convolution operation can be expressed as : Hijconv = w i c Hj−k+1 : j ( 0 ≤ i < d ) ( 4 ) The convolution result is matrix Hconv= [ H1conv , H 2 conv , ··· , H d conv ] ∈ Rd∗n . H integrates the phrase level information with K as the length . In the process of constructing the attention matrix , we refer to the construction method of Vaswani et al , and make corresponding modifications according to the characteristics of our task . The formula is as follows : Q = H ·WQ ( 5 ) K = H ·WK ( 6 ) Kconv = H T conv ·WK ( 7 ) ATT = softmax ( ( Q ·KT ) / √ dk ) ( 8 ) ATTconv = softmax ( ( Q ·KTconv ) / √ dk ) ( 9 ) The above formula is our method to construct a multi-scale attention matrix , where WQ and WK are trainable parameter matrixs with the shape of d * d. Kconv is the key matrix calculated by Hconv integrating phrase level information . The difference from the construction of Vaswani et al is that we calculated ATTconv , which is obtained by multiplying the query matrix with word as the minimum granularity and the key matrix Kconv with phrase as the minimum granularity . Its purpose is to calculate the degree of attention between words and phrases on different scales . 3.2 DYNAMIC SPARSE MODULE . In constructing the multi-scale attention model , we note that although there is phrase information in sentences , not all phrases with length k can be expressed as phrases . At the same time , we should also consider the differences between the traditional attention matrix and the multi-scale attention matrix , that is , if a word chooses to pay attention to a phrase , it should reduce the attention to each word in the phrase . Therefore , we design a dynamic sparse module for our multi-scale attention module , which can be dynamically adjusted to ensure that the model can select more suitable phrase information.The dynamic sparse module is shown in Figure 3 . The method is as follows . Q1 = H ·WQ1 ( 10 ) K1 = H ·WK1 ( 11 ) ATTcut = softmax ( ( Q1 ·KT1 ) / √ dk ) ( 12 ) WQ1 and WK1 are two trainable parameter matrices with the shape of d * d. in the above formula , we choose to reconstruct a network for calculating similarity . Different from formula 8 , this formula will be used to construct a sparse attention matrix . We set a threshold µ for att matrix to select whether the information is truncated . If the value of this position is greater than the threshold , it will be set to 1 . If not , it will be set to 0 . The formula is as follows : Maskqj = 1 if ( ATT qjcut > µ ) else 0 ( 13 ) Because the size of the threshold will closely affect the location of the matrix ’ s attention , here we set the threshold to 1 / n , so we get a mask matrix composed of 0 and 1 . Because this mask matrix only uses word level attention , we also need to build a mask matrix of multi-scale attention matrix . In order to realize the difference between traditional attention matrix and multi-scale attention matrix , we choose to reverse build the mask matrix of multi-scale attention matrix according to Mask matrix . The formula is as follows : Maskconv = E −Mask ( 14 ) Where E is a matrix with all values of one , so we can obtain the corresponding sparse multi-scale attention matrix according to the two mask matrices . The formula is as follows : ATTM = ATT Mask ( 15 ) ATTMc = ATTconv Maskconv ( 16 ) ATTfin = [ ATTM , ATTMc ] ( 17 ) ATTfin is the final attention matrix , which is obtained by splicing the traditional attention matrix and our multi-scale attention matrix in the last dimension , so it ’ s shape is n * 2n . ATTfin represents the correlation degree between the i-th word and the j-th word . When 1 ≤ j ≤ n , its value represents the attention value between words , and when n < j ≤ 2n , it represents the attention value between the i-th word and the ( j-n ) -th phrase . V = [ H HTconv ] ·WV ( 18 ) S = ATTfin · V ( 19 ) The calculation method of the value matrix is shown in formula 16 . For the trainable parameter matrix with the shape of d * d at WV , we splice H and Hconv in the first dimension and obtain the value matrix V with the shape of 2n * d through linear transformation.Finally , we multiply the obtained attention matrix ATTfin and value matrix V to obtain the final sentence representation . After obtaining the representation , we can use pooling or other dimensionality reduction methods to realize the final flat representation .
This work proposes a multi-scale fusion self-attention module to help extract phase-level at different scales. It utilizes convolution operations with kernels of different sizes to achieve this end. The authors conduct experiments on the relation extraction and GLUE tasks to demonstrate its effectiveness.
SP:ef4369d2452cc6bc680eff611350cbf6f20e2e3b
Multi-Agent Constrained Policy Optimisation
1 INTRODUCTION . In recent years , reinforcement learning ( RL ) techniques have achieved remarkable successes on a variety of complex tasks ( Silver et al. , 2016 ; 2017 ; Vinyals et al. , 2019 ) . Powered by deep neural networks , deep RL enables learning sophisticated behaviours . On the other hand , deploying neural networks turns the optimisation procedure from policy space to parameter space ; this enables gradient-based methods to be applied ( Sutton et al. , 1999 ; Lillicrap et al. , 2015 ; Schulman et al. , 2017 ) . For policy gradient methods , at every iteration , the parameters of a policy network are updated in the direction of the gradient that maximises return . However , policies that are purely optimised for reward maximisation are rarely applicable to realworld problems . In many applications , an agent is often required not to visit certain states or take certain actions , which are thought of as “ unsafe ” either for itself or for other elements in the background ( Moldovan & Abbeel , 2012 ; Achiam et al. , 2017 ) . For instance , a robot carrying materials in a warehouse should not damage its parts while delivering an item to a shelf , nor should a selfdriving car cross on the red light while rushing towards its destination ( Shalev-Shwartz et al. , 2016 ) . To tackle these issues , Safe RL ( Moldovan & Abbeel , 2012 ; Garcıa & Fernández , 2015 ) is proposed , aiming to develop algorithms that learn policies that satisfy safety constraints . Despite the additional requirement of safety on solutions , algorithms with convergence guarantees have been proposed ( Xu et al. , 2021 ; Wei et al. , 2021 ) . Developing safe policies for multi-agent systems is a challenging task . Part of the difficulty comes from solving multi-agent reinforcement learning ( MARL ) problems itself ( Deng et al. , 2021 ) ; more importantly , tackling safety in MARL is hard because each individual agent has to not only consider its own safety constraints , which already may conflict its reward maximisation , but also consider the safety constraints of others so that their joint behaviour is guaranteed to be safe . As a result , there are very few solutions that offer effective learning algorithms for safe MARL problems . In fact , many of the existing methods focus on learning to cooperate ( Foerster et al. , 2018 ; Rashid et al. , 2018 ; 1Paper homepage including Videos and Code : https : //sites.google.com/view/macpo Yang & Wang , 2020 ) . However , they often require certain structures on the solution ; for example , Rashid et al . ( 2018 ) and Yang et al . ( 2020 ) adopt greedy maximisation on the local component of a monotonic joint value function , and Foerster et al . ( 2018 ) estimates the policy gradient based on the counterfactual value from a joint critic . Therefore , it is unclear how to directly incorporate safety constraints into these solution frameworks . Consequently , developing agents ’ collaborations towards reward maximisation under safety constraints remains an unsolved problem . The goal of this paper is to increase practicality of MARL algorithms through endowing them with safety awareness . For this purpose , we introduce a general framework to formulate safe MARL problems , and solve them through multi-agent policy optimisation methods . Our solutions leverage techniques from both constrained policy optimisation ( Achiam et al. , 2017 ) and multi-agent trust region learning ( Kuba et al. , 2021a ) . The resulting algorithm attains properties of both monotonic improvement guarantee and constraints satisfaction guarantee at every iteration during training . To execute the optimisation objectives , we introduce two practical deep MARL algorithms : MACPO and MAPPO-Lagrangian . As a side contribution , we also develop the first safe MARL benchmark within the MuJoCo environment , which include a variety of MARL baseline algorithms . We evaluate MACPO and MAPPO-Lagrangian on a series of tasks , and results clearly confirm the effectiveness of our solutions both in terms of constraints satisfaction and reward maximisation . To our best knowledge , MACPO and MAPPO-Lagrangian are the first safety-aware model-free MARL algorithms that work effectively in the challenging MuJoCo tasks with safety constraints . 2 RELATED WORK . Considering safety in the development of AI is a long-standing topic ( Amodei et al. , 2016 ) . When it comes to safe reinforcement learning ( Garcıa & Fernández , 2015 ) , a commonly used framework is Constrained Markov Decision Processes ( CMDPs ) ( Altman , 1999 ) . In a CMDP , at every step , in addition to the reward , the environment emits costs associated with certain constraints . As a result , the learning agent must try to satisfy those constraints while maximising the total reward . In general , the cost from the environment can be thought of as a measure of safety . Under the framework of CMDP , a safe policy is the one that explores the environment safely by keeping the total costs under certain thresholds . To tackle the learning problem in CMDPs , Achiam et al . ( 2017 ) introduced Constrained Policy Optimisation ( CPO ) , which updates agent ’ s policy under the trust region constraint ( Schulman et al. , 2015 ) to maximise surrogate return while obeying surrogate cost constraints . However , solving a constrained optimisation at every iteration of CPO can be cumbersome for implementation . An alternative solution is to apply primal-dual methods , giving rise to methods like TRPO-Lagrangian and PPO-Lagrangian ( Ray et al. , 2019 ) . Although these methods achieve impressive performance in terms of safety , the performance in terms of reward is poor ( Ray et al. , 2019 ) . Another class of algorithms that solves CMDPs is by Chow et al . ( 2018 ; 2019 ) ; these algorithms leverage the theoretical property of the Lyapunov functions and propose safe value iteration and policy gradient procedures . In contrast to CPO , Chow et al . ( 2018 ; 2019 ) can work with off-policy methods ; they also can be trained end-to-end with no need for line search . Safe multi-agent learning is an emerging research domain . Despite its importance ( Shalev-Shwartz et al. , 2016 ) , there are few solutions that work with MARL in a model-free setting . The majority of methods are designed for robotics learning . For example , the technique of barrier certificates ( Borrmann et al. , 2015 ; Ames et al. , 2016 ; Qin et al. , 2020 ) or model predictive shielding ( Zhang et al. , 2019 ) from control theory is used to model safety . These methods , however , are specifically derived for robotics applications ; they either are supervised learning based approaches , or require specific assumptions on the state space and environment dynamics . Moreover , due to the lack of a benchmark suite for safe MARL algorithms , the generalisation ability of those methods is unclear . The most related work to ours is Safe Dec-PG ( Lu et al. , 2021 ) where they used the primal-dual framework to find the saddle point between maximising reward and minimising cost . In particular , they proposed a decentralised policy descent-ascent method through a consensus network . However , reaching a consensus equivalently imposes an extra constraint of parameter sharing among neighbouring agents , which could yield suboptimal solutions ( Kuba et al. , 2021a ) . Furthermore , multi-agent policy gradient methods can suffer from high variance ( Kuba et al. , 2021b ) . In contrast , our methods employ trust region optimisation and do not assume any parameter sharing . HATRPO ( Kuba et al. , 2021a ) introduced the first multi-agent trust region method that enjoys theoretically-justified monotonic improvement guarantee . Its key idea is to make agents follow a sequential policy update scheme so that the expected joint advantage will always be positive , thus increasing reward . In this work , we show how to further develop this theory and derive a protocol which , in addition to the monotonic improvement , also guarantees to satisfy the safety constraint at every iteration during learning . The resulting algorithm ( Algorithm 1 ) successfully attains theoretical guarantees of both monotonic improvement in reward and satisfaction of safety constraints . 3 PROBLEM FORMULATION : CONSTRAINED MARKOV GAME . We formulate the safe MARL problem as a constrained Markov game 〈N , S , A , p , d0 , W , ' , C , c〉 . Here , N = { 1 , . . . , = } is the set of agents , S is the state space , A = ∏=8=1A8 is the product of the agents ’ action spaces , known as the joint action space , p : S ×A × S → ℝ is the probabilistic transition function , d0 is the initial state distribution , W ∈ [ 0 , 1 ) is the discount factor , ' : S×A → ℝ is the joint reward function , C = { 8 9 } 8∈N1≤ 9≤ < 8 is the set of sets of cost functions ( every agent 8 has < 8 cost functions ) of the form 8 9 : S ×A8 → ℝ , and finally the set of corresponding cost-constraining values is given by c = { 28 9 } 8∈N1≤ 9≤ < 8 . At time step C , the agents are in a state sC , and every agent 8 takes an action a8C according to its policy c 8 ( a8 |sC ) . Together with other agents ’ actions , it gives a joint action aC = ( a1C , . . . , a=C ) and the joint policy π ( a|s ) = ∏= 8=1 c 8 ( a8 |s ) . The agents receive the reward ' ( sC , aC ) , meanwhile each agent 8 pays the costs 89 ( sC , a8C ) , ∀ 9 = 1 , . . . , < 8 . The environment then transits to a new state sC+1 ∼ p ( ·|sC , aC ) . In this paper , we consider a fully-cooperative setting where all agents share the same reward function , aiming to maximise the expected total reward of ( π ) , s0∼d0 , a0 : ∞∼π , s1 : ∞∼p [ ∞∑ C=0 WC ' ( sC , aC ) ] , meanwhile trying to satisfy every agent 8 ’ s safety constraints , written as 89 ( π ) , s0∼d0 , a0 : ∞∼π , s1 : ∞∼p [ ∞∑ C=0 WC 89 ( sC , a8C ) ] ≤ 289 , ∀ 9 = 1 , . . . , < 8 . ( 1 ) We define the state-action value and the state-value functions in terms of reward as & π ( B , a ) , s1 : ∞∼p , a1 : ∞∼π [ ∞∑ C=0 WC ' ( sC , aC ) s0 = B , a0 = a ] , and +π ( B ) , a∼π [ & π ( B , a ) ] . The joint policies π that satisfy the Inequality ( 1 ) are referred to as feasible . Notably , in the above formulation , although the action a8C of agent 8 does not directly influence the costs { :9 ( sC , a : C ) } < : 9=1 of other agents : ≠ 8 , the action a8C will implicitly influence their total costs due to the dependence on the next state sC+1 2 . For the 9 th cost function of agent 8 , we define the 9 th state-action cost value function and the state cost value function as & 89 , π ( B , 08 ) , a−8∼π−8 , s1 : ∞∼p , a1 : ∞∼π [ ∞∑ C=0 WC 89 ( sC , a8C ) s0 = B , a80 = 08 ] , and , + 89 , π ( B ) , a∼π , s1 : ∞∼p , a1 : ∞∼π [ ∞∑ C=0 WC 89 ( sC , a8C ) s0 = B ] , respectively . Notably , the cost value functions & 8 9 , π and + 8 9 , π , although similar to traditional & π and +π , involve extra indices 8 and 9 ; the superscript 8 denotes an agent , and the subscript 9 denotes its 9 th cost . Throughout this work , we pay a close attention to the contribution to performance from different subsets of agents , therefore , we introduce the following notations . We denote an arbitrary subset 2We believe that this formulation realistically describes multi-agent interactions in the real-world ; an action of an agent has an instantaneous effect on the system only locally , but the rest of agents may suffer from its consequences at later stages . For example , consider a car that crosses on the red light , although other cars may not be at risk of riding into pedestrians immediately , the induced traffic may cause hazards soon later . { 81 , . . . , 8ℎ } of agents as 81 : ℎ ; we write −81 : ℎ to refer to its complement . Given the agent subset 81 : ℎ , we define the multi-agent state-action value function : & 81 : ℎπ ( B , a81 : ℎ ) , a−81 : ℎ∼π−81 : ℎ [ & π ( s , a81 : ℎ , a−81 : ℎ ) ] . On top of it , the multi-agent advantage function 3 is defined as follows , 81 : ℎπ ( B , a 91 : : , a81 : ℎ ) , & 91 : : ,81 : ℎπ ( B , a 91 : : , a81 : ℎ ) − & 91 : :π ( B , a 91 : : ) . ( 2 ) An interesting fact about the above multi-agent advantage function is that any advantage 81 : ℎπ can be written as a sum of sequentially-unfolding multi-agent advantages of individual agents , that is , Lemma 1 ( Multi-Agent Advantage Decomposition , Kuba et al . ( 2021b ) ) . For any state B ∈ S , subset of agents 81 : ℎ ⊆ N , and joint action a81 : ℎ , the following identity holds 81 : ℎπ ( B , a81 : ℎ ) = ℎ∑ 9=1 8 9 π ( B , a81 : 9−1 , 08 9 ) .
This paper studies the safe RL in the multi-agent setting. Specifically, the author leverage the theories from constrained policy optimization and multi-agent trust region learning to propose two algorithms: MACPO and MAPPO-Lagrangian. From the theoretical side, the author shows that in the idea setting, the proposed algorithm is guarantee to improve the objective function at iteration and the constraint satisfications can always be guaranteed. The author also demonstrate the effectiveness of their proposed algorithms in the new environment named "Safe MAMuJoCo".
SP:9418d0fd67bfb4ff1a64c745cceeb0028ee7ecd0
Multi-Agent Constrained Policy Optimisation
1 INTRODUCTION . In recent years , reinforcement learning ( RL ) techniques have achieved remarkable successes on a variety of complex tasks ( Silver et al. , 2016 ; 2017 ; Vinyals et al. , 2019 ) . Powered by deep neural networks , deep RL enables learning sophisticated behaviours . On the other hand , deploying neural networks turns the optimisation procedure from policy space to parameter space ; this enables gradient-based methods to be applied ( Sutton et al. , 1999 ; Lillicrap et al. , 2015 ; Schulman et al. , 2017 ) . For policy gradient methods , at every iteration , the parameters of a policy network are updated in the direction of the gradient that maximises return . However , policies that are purely optimised for reward maximisation are rarely applicable to realworld problems . In many applications , an agent is often required not to visit certain states or take certain actions , which are thought of as “ unsafe ” either for itself or for other elements in the background ( Moldovan & Abbeel , 2012 ; Achiam et al. , 2017 ) . For instance , a robot carrying materials in a warehouse should not damage its parts while delivering an item to a shelf , nor should a selfdriving car cross on the red light while rushing towards its destination ( Shalev-Shwartz et al. , 2016 ) . To tackle these issues , Safe RL ( Moldovan & Abbeel , 2012 ; Garcıa & Fernández , 2015 ) is proposed , aiming to develop algorithms that learn policies that satisfy safety constraints . Despite the additional requirement of safety on solutions , algorithms with convergence guarantees have been proposed ( Xu et al. , 2021 ; Wei et al. , 2021 ) . Developing safe policies for multi-agent systems is a challenging task . Part of the difficulty comes from solving multi-agent reinforcement learning ( MARL ) problems itself ( Deng et al. , 2021 ) ; more importantly , tackling safety in MARL is hard because each individual agent has to not only consider its own safety constraints , which already may conflict its reward maximisation , but also consider the safety constraints of others so that their joint behaviour is guaranteed to be safe . As a result , there are very few solutions that offer effective learning algorithms for safe MARL problems . In fact , many of the existing methods focus on learning to cooperate ( Foerster et al. , 2018 ; Rashid et al. , 2018 ; 1Paper homepage including Videos and Code : https : //sites.google.com/view/macpo Yang & Wang , 2020 ) . However , they often require certain structures on the solution ; for example , Rashid et al . ( 2018 ) and Yang et al . ( 2020 ) adopt greedy maximisation on the local component of a monotonic joint value function , and Foerster et al . ( 2018 ) estimates the policy gradient based on the counterfactual value from a joint critic . Therefore , it is unclear how to directly incorporate safety constraints into these solution frameworks . Consequently , developing agents ’ collaborations towards reward maximisation under safety constraints remains an unsolved problem . The goal of this paper is to increase practicality of MARL algorithms through endowing them with safety awareness . For this purpose , we introduce a general framework to formulate safe MARL problems , and solve them through multi-agent policy optimisation methods . Our solutions leverage techniques from both constrained policy optimisation ( Achiam et al. , 2017 ) and multi-agent trust region learning ( Kuba et al. , 2021a ) . The resulting algorithm attains properties of both monotonic improvement guarantee and constraints satisfaction guarantee at every iteration during training . To execute the optimisation objectives , we introduce two practical deep MARL algorithms : MACPO and MAPPO-Lagrangian . As a side contribution , we also develop the first safe MARL benchmark within the MuJoCo environment , which include a variety of MARL baseline algorithms . We evaluate MACPO and MAPPO-Lagrangian on a series of tasks , and results clearly confirm the effectiveness of our solutions both in terms of constraints satisfaction and reward maximisation . To our best knowledge , MACPO and MAPPO-Lagrangian are the first safety-aware model-free MARL algorithms that work effectively in the challenging MuJoCo tasks with safety constraints . 2 RELATED WORK . Considering safety in the development of AI is a long-standing topic ( Amodei et al. , 2016 ) . When it comes to safe reinforcement learning ( Garcıa & Fernández , 2015 ) , a commonly used framework is Constrained Markov Decision Processes ( CMDPs ) ( Altman , 1999 ) . In a CMDP , at every step , in addition to the reward , the environment emits costs associated with certain constraints . As a result , the learning agent must try to satisfy those constraints while maximising the total reward . In general , the cost from the environment can be thought of as a measure of safety . Under the framework of CMDP , a safe policy is the one that explores the environment safely by keeping the total costs under certain thresholds . To tackle the learning problem in CMDPs , Achiam et al . ( 2017 ) introduced Constrained Policy Optimisation ( CPO ) , which updates agent ’ s policy under the trust region constraint ( Schulman et al. , 2015 ) to maximise surrogate return while obeying surrogate cost constraints . However , solving a constrained optimisation at every iteration of CPO can be cumbersome for implementation . An alternative solution is to apply primal-dual methods , giving rise to methods like TRPO-Lagrangian and PPO-Lagrangian ( Ray et al. , 2019 ) . Although these methods achieve impressive performance in terms of safety , the performance in terms of reward is poor ( Ray et al. , 2019 ) . Another class of algorithms that solves CMDPs is by Chow et al . ( 2018 ; 2019 ) ; these algorithms leverage the theoretical property of the Lyapunov functions and propose safe value iteration and policy gradient procedures . In contrast to CPO , Chow et al . ( 2018 ; 2019 ) can work with off-policy methods ; they also can be trained end-to-end with no need for line search . Safe multi-agent learning is an emerging research domain . Despite its importance ( Shalev-Shwartz et al. , 2016 ) , there are few solutions that work with MARL in a model-free setting . The majority of methods are designed for robotics learning . For example , the technique of barrier certificates ( Borrmann et al. , 2015 ; Ames et al. , 2016 ; Qin et al. , 2020 ) or model predictive shielding ( Zhang et al. , 2019 ) from control theory is used to model safety . These methods , however , are specifically derived for robotics applications ; they either are supervised learning based approaches , or require specific assumptions on the state space and environment dynamics . Moreover , due to the lack of a benchmark suite for safe MARL algorithms , the generalisation ability of those methods is unclear . The most related work to ours is Safe Dec-PG ( Lu et al. , 2021 ) where they used the primal-dual framework to find the saddle point between maximising reward and minimising cost . In particular , they proposed a decentralised policy descent-ascent method through a consensus network . However , reaching a consensus equivalently imposes an extra constraint of parameter sharing among neighbouring agents , which could yield suboptimal solutions ( Kuba et al. , 2021a ) . Furthermore , multi-agent policy gradient methods can suffer from high variance ( Kuba et al. , 2021b ) . In contrast , our methods employ trust region optimisation and do not assume any parameter sharing . HATRPO ( Kuba et al. , 2021a ) introduced the first multi-agent trust region method that enjoys theoretically-justified monotonic improvement guarantee . Its key idea is to make agents follow a sequential policy update scheme so that the expected joint advantage will always be positive , thus increasing reward . In this work , we show how to further develop this theory and derive a protocol which , in addition to the monotonic improvement , also guarantees to satisfy the safety constraint at every iteration during learning . The resulting algorithm ( Algorithm 1 ) successfully attains theoretical guarantees of both monotonic improvement in reward and satisfaction of safety constraints . 3 PROBLEM FORMULATION : CONSTRAINED MARKOV GAME . We formulate the safe MARL problem as a constrained Markov game 〈N , S , A , p , d0 , W , ' , C , c〉 . Here , N = { 1 , . . . , = } is the set of agents , S is the state space , A = ∏=8=1A8 is the product of the agents ’ action spaces , known as the joint action space , p : S ×A × S → ℝ is the probabilistic transition function , d0 is the initial state distribution , W ∈ [ 0 , 1 ) is the discount factor , ' : S×A → ℝ is the joint reward function , C = { 8 9 } 8∈N1≤ 9≤ < 8 is the set of sets of cost functions ( every agent 8 has < 8 cost functions ) of the form 8 9 : S ×A8 → ℝ , and finally the set of corresponding cost-constraining values is given by c = { 28 9 } 8∈N1≤ 9≤ < 8 . At time step C , the agents are in a state sC , and every agent 8 takes an action a8C according to its policy c 8 ( a8 |sC ) . Together with other agents ’ actions , it gives a joint action aC = ( a1C , . . . , a=C ) and the joint policy π ( a|s ) = ∏= 8=1 c 8 ( a8 |s ) . The agents receive the reward ' ( sC , aC ) , meanwhile each agent 8 pays the costs 89 ( sC , a8C ) , ∀ 9 = 1 , . . . , < 8 . The environment then transits to a new state sC+1 ∼ p ( ·|sC , aC ) . In this paper , we consider a fully-cooperative setting where all agents share the same reward function , aiming to maximise the expected total reward of ( π ) , s0∼d0 , a0 : ∞∼π , s1 : ∞∼p [ ∞∑ C=0 WC ' ( sC , aC ) ] , meanwhile trying to satisfy every agent 8 ’ s safety constraints , written as 89 ( π ) , s0∼d0 , a0 : ∞∼π , s1 : ∞∼p [ ∞∑ C=0 WC 89 ( sC , a8C ) ] ≤ 289 , ∀ 9 = 1 , . . . , < 8 . ( 1 ) We define the state-action value and the state-value functions in terms of reward as & π ( B , a ) , s1 : ∞∼p , a1 : ∞∼π [ ∞∑ C=0 WC ' ( sC , aC ) s0 = B , a0 = a ] , and +π ( B ) , a∼π [ & π ( B , a ) ] . The joint policies π that satisfy the Inequality ( 1 ) are referred to as feasible . Notably , in the above formulation , although the action a8C of agent 8 does not directly influence the costs { :9 ( sC , a : C ) } < : 9=1 of other agents : ≠ 8 , the action a8C will implicitly influence their total costs due to the dependence on the next state sC+1 2 . For the 9 th cost function of agent 8 , we define the 9 th state-action cost value function and the state cost value function as & 89 , π ( B , 08 ) , a−8∼π−8 , s1 : ∞∼p , a1 : ∞∼π [ ∞∑ C=0 WC 89 ( sC , a8C ) s0 = B , a80 = 08 ] , and , + 89 , π ( B ) , a∼π , s1 : ∞∼p , a1 : ∞∼π [ ∞∑ C=0 WC 89 ( sC , a8C ) s0 = B ] , respectively . Notably , the cost value functions & 8 9 , π and + 8 9 , π , although similar to traditional & π and +π , involve extra indices 8 and 9 ; the superscript 8 denotes an agent , and the subscript 9 denotes its 9 th cost . Throughout this work , we pay a close attention to the contribution to performance from different subsets of agents , therefore , we introduce the following notations . We denote an arbitrary subset 2We believe that this formulation realistically describes multi-agent interactions in the real-world ; an action of an agent has an instantaneous effect on the system only locally , but the rest of agents may suffer from its consequences at later stages . For example , consider a car that crosses on the red light , although other cars may not be at risk of riding into pedestrians immediately , the induced traffic may cause hazards soon later . { 81 , . . . , 8ℎ } of agents as 81 : ℎ ; we write −81 : ℎ to refer to its complement . Given the agent subset 81 : ℎ , we define the multi-agent state-action value function : & 81 : ℎπ ( B , a81 : ℎ ) , a−81 : ℎ∼π−81 : ℎ [ & π ( s , a81 : ℎ , a−81 : ℎ ) ] . On top of it , the multi-agent advantage function 3 is defined as follows , 81 : ℎπ ( B , a 91 : : , a81 : ℎ ) , & 91 : : ,81 : ℎπ ( B , a 91 : : , a81 : ℎ ) − & 91 : :π ( B , a 91 : : ) . ( 2 ) An interesting fact about the above multi-agent advantage function is that any advantage 81 : ℎπ can be written as a sum of sequentially-unfolding multi-agent advantages of individual agents , that is , Lemma 1 ( Multi-Agent Advantage Decomposition , Kuba et al . ( 2021b ) ) . For any state B ∈ S , subset of agents 81 : ℎ ⊆ N , and joint action a81 : ℎ , the following identity holds 81 : ℎπ ( B , a81 : ℎ ) = ℎ∑ 9=1 8 9 π ( B , a81 : 9−1 , 08 9 ) .
This paper considers the multi-agent reinforcement learning (MARL) problem with safety constraints. The authors proposed two methods, Multi-Agent Constrained Policy Optimisation (MACPO) and MAPPO-Lagrangian, by leveraging the theories from both constrained policy optimization and multi-agent trust-region learning. Their method is shown valid both theoretically and empirically. My main concerns lie in their novelty compared with existing literature and the problem set.
SP:9418d0fd67bfb4ff1a64c745cceeb0028ee7ecd0
Go with the Flow: the distribution of information processing in multi-path networks
1 INTRODUCTION . The architectures of Convolutional Neural Network ( CNN ) classifiers are an important influencing factor regarding their predictive performance and computational efficiency , with many designs being proposed over the years ( Simonyan & Zisserman , 2015 ; He et al. , 2016 ; Szegedy et al. , 2015 ; Tan & Le , 2019 ; Sandler et al. , 2018 ) . These architectures can be generally subdivided into two distinct categories . First , the sequential architectures like VGG16 by Simonyan & Zisserman ( 2015 ) , which essentially consist of a sequence of layers leading from the input to the output of the network . While these architectures are simplistic in structure , they have been surpassed by multi-path architectures in efficiency and predictive performance . Multipath architectures can be described as a directed acyclic graph , with the nodes representing the layers . Information provided at the input of a multipath network can be processed by different sequences of layers that are intertwined in the overall neural architecture . The Inception-family of networks is an example for such an architecture ( Szegedy et al. , 2015 ; 2016 ; 2017 ) , where each building block features a different set of layers and allows for the parallel extraction of heterogeneous features . Networks featuring skip-connections like ResNet , MobileNetV2 , MobileNetV3 and EfficientNet ( He et al. , 2016 ; Sandler et al. , 2018 ; Howard et al. , 2019 ; Tan & Le , 2019 ) are a special case of multipath architectures , since they may only feature a single sequence of layers . However , since the skip-connections effectively allow signals to skip layers , it is possible for any signal from the input to take multiple paths to the output , thus making these architectures multipath architectures . On the other hand , multi-path architectures require the model to implicitly make decisions regarding the distribution of the inference process , since some routes connecting two layers may differ in their capacity ( number of parameters ) , depth and receptive field size . In essence , during training , the model will learn to utilize the different pathways , implicitly deciding how the inference process is distributed in branching paths and whether to skip certain layers . These decisions have been discussed theoretically by authors like He et al . ( 2016 ) , who for example elaborate the possibility of identity-mappings in skip-connections , which effectively enable the network to remove layers from the qualitative inference process . In this work , we empirically investigate how parallel pathways and skip connections are utilized in multi-path CNN architectures . Our contributions can be summarized as follows : • We find that networks with skip connections reliably skip layers when a mismatch between receptive field and input resolution occurs . This finding is in agreement with the findings of Richter et al . ( 2021b ) and Richter et al . ( 2021a ) . • We show that networks with parallel pathways of strongly different depth will prefer the shorter pathway over the longer pathway due to a partial vanishing gradient . • We demonstrate that multi-path architectures with parallel pathways of roughly similar size advance the solution quality in a similar pace and with a high degree of redundancy . 2 RELATED WORK . 2.1 MULTI-PATH NETWORKS . Since this work is focussed on multi-path architectures , we will introduce the most significant works regarding this type of neural architecture as well as the contemporary reasoning for the introduction of the proposed neural architectures . After the advent of CNNs , there were several works that focused on improving their performance by introducing novel architectures ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2015 ) . Although one of the most intuitive ways to improve the accuracy of CNNs is by increasing the number of layers ( depth ) , there is an upper limit to it . After a specific level , there are certain hurdles that occur such as network overfitting , vanishing gradient ( Hochreiter , 1998 ; Dong et al. , 2015 ) , and also it becomes computationally expensive to train them . Therefore , to train such deep networks , several works proposed the idea of multipath networks ( He et al. , 2016 ; Larsson et al. , 2017 ; Huang et al. , 2018 ; Kuen et al. , 2017 ) . The multipath networks presented in ( Mao et al. , 2016 ; Tong et al. , 2017 ; Srivastava et al. , 2015 ) introduced shortcuts in the networks structure that facilitate a customized flow of information such that the vanishing gradient problem is reduced . The work by Szegedy et al . ( 2015 ) introduced sparsely connected architectures motivated by Hebbian principle to solve the problem of overfitting and then clustering them to dense matrices ( Ümt V. Çatalyürek et al. , 2010 ) so that the network can be trained efficiently on the hardware . Further improvements to this network were introduced ( Szegedy et al. , 2016 ; 2017 ) to increase its accuracy and training efficiency . Since the information available to the shallower layers is not available to the deeper layers , He et al . ( 2016 ) introduced the Residual Networks ( ResNets ) which used skip connections to preserve the gradient . The skip connections are operated by vector addition whereas in the method proposed by Huang et al . ( 2018 ) , the skip connections are operated by concatenation of the feature maps . 2.2 RELEVANT ANALYSIS TOOLS AND SIMILARITY METRICS . Since we are interested in the information processing of CNNs , a set of analysis tools is required that allows us to analyze the processing within the neural architecture . Our main analysis tool that is used extensively throughout this work are logistic regression probes ( LRP ) by Alain et al . ( 2020 ) . LRP are logistic regressions trained on the output of a hidden layer . Since classifiers implicitly maximize the linear separability of the data , the predictive performance of the logistic regression models on the test set allows us to track the progress of the intermediate solution quality while the data is propagated from layer to layer ( see Fig . 1 ) . The usefulness of LRP has been demonstrated by the works of Richter et al . ( 2020 ) , Richter et al . ( 2021a ) and Richter et al . ( 2021b ) , which utilize LRP to identify inefficiencies in neural architectures caused by layers not contributing qualitatively to the inference process . Alain et al . ( 2020 ) find by experimenting on multilayer perceptrons with skip connections that the skipping of a sequence of layers is observable by logistic LRP by a degradation in performance . A reproduction of this experiment on MNIST using a similar architecture can be seen in Fig . 2 . In section 3 we furthermore utilize saturation proposed by Richter et al . ( 2020 ) as an additional tool for analyzing the output of hidden layers . Saturation uses PCA to approximate the subspace the data is processed , and can be interpreted as the percentage of dimensions utilized by the data in the output of space of a given layer . Thereby , highly saturated layers can be usually seen as active , in the sense that they contribute qualitatively to the prediction , while layers that are low saturated relative to the rest of the network tend to be unproductive . A sequence of unproductive layers is referred to as a tail pattern. . Since we are interested in the information processing of ( partial ) networks , tools that easily allow the comparison of learned feature representation are required . Several works ( Raghu et al. , 2017 ; Morcos et al. , 2018 ; Feng et al. , 2020 ) proposed such tools to gauge the similarity of the features learned by two models having the same architectures but trained with different initialization . The similarity is calculated by taking the hidden state activations from each model in the form of a feature matrix and finding a measure of correlation between them . The method proposed by Wang et al . ( 2018 ) uses a subspace match model to find the similarity in terms of maximum and simple matches . Raghu et al . ( 2017 ) uses Canonical Correlation Analysis ( CCA ) proposed in Golub & Zha ( 1995 ) coupled with Singular Vector Decomposition ( SVD ) to compare the representations presented by two neural networks in a process which is invariant to invertible linear transformations . The technique by Morcos et al . ( 2018 ) further improves this method by giving more weight to those intermediate CCA vectors which are more important for the representations . Another metric proposed by Feng et al . ( 2020 ) called the Transferred Discrepancy ( TD ) focuses on the practical usage of the representations by stating their similarity based on their performance in downstream tasks . Another approach to compare layer activations , that has gained popularity over the last years is Centered Kernel Alignment ( CKA , Cortes et al. , 2012 ) , which we will use for this work . It is introduced as a normalized version of the Hilbert-Schmidt Independence Criterion ( HSIC , Gretton et al. , 2005 ) , and when used with linear kernels , it is equivalent to the RV coefficient Robert & Escoufier ( 1976 ) . In this form it has been applied successfully in recent works as an efficient alternative to SVCCA and other methods ( Nguyen et al. , 2021 ; Kornblith et al. , 2019 ) , majorly because it requires less number of data points ( Kornblith et al. , 2019 ) . 3 DISTRIBUTION OF INFORMATION PROCESSING IN NETWORKS WITH SKIP-CONNECTIONS . In this section , we will investigate the first scenario we identified in which a network with a skip connection will reliably choose not to utilize the layers encapsulated by a skip connection . Skipping of layers could be described as an autogenous pruning technique , where the model decides during training to not utilize certain layers . Therefore , we hypothesize that layers that would be unproductive are likely to be skipped if the network is given the opportunity . We find that it is possible to guarantee a convolutional layer will not be able to contribute to the quality of the solution by utilizing the knowledge about the relation of receptive field and input resolution presented by Richter et al . ( 2021b ) . The authors show experimentally that convolutional layers can only enhance the quality of the solution if the receptive field of the layer ’ s input is smaller than the input image . Simply speaking , if the layer is unable to integrate novel information into a feature map position by convolving the kernel over the input , the layer will not improve the quality of the intermediate solution . In case of a simple sequential architecture neural network like VGG16 the layers pass the solved problem from layer to layer while not enhancing the intermediate solution quality , as Fig . 3 ( a ) exemplifies . The observed effect is caused by training the model on Cifar10 using the native resolution of 32 × 32 pixels . When repeating this experiment on DenseNet18 , we can see that the probe performance no longer stagnates . Instead , the final dense-block of the model is skipped entirely , which is apparent when looking at the decaying probe performance in Fig . 3 ( b ) . A similar effect can be observed when training ResNet34 in the same scenario . In this case , unproductive residual blocks are skipped . Since the input of a residual block is added to its output , the performance recovers after each building block and thus recovering the intermediate solution quality . This is reflected by a zig-zag-pattern in the LRP . Based on these results , we can see that unproductive layers are behaving differently in architectures where these layers can be bypassed . Instead of learning to functionally emulate a pass-through layer , the layers learn a representation which is functionally equivalent to an identity mapping . With functionally equivalent , we refer to the behavior of the layers being similar to a pass-through layer or an identity mapping regarding the predictive performance . We find that skipped layers do in-fact not learn an identity mapping . Instead , these layers learn a harmless non-zero representation that does not hurt the intermediate solution quality when added to the feature map containing a good solution . This makes it also impossible to remove these skipped layers in a primitive pruning step without retraining the model , since the changes in the data caused by the unproductive layers are still expected by the following layers . Nevertheless , removing the skipped layers and retraining the pruned model will lead to a more efficient network ( Richter et al. , 2021b ) .
This is an experimental paper that seeks out to investigate information processing in multi-path networks i.e. networks such as ResNet, EfficientNet, Inception-style. The goal was to investigate how different pathways process information in such networks in order to better understand learned representations to inform new network architectures in the future. The authors used logistic regression probes (LRP) and representation saturation as metrics to power their analysis. Through the analysis of a network composed of many multi-path networks with differing number of layers or different receptive fields, the authors demonstrate that shorter pathways often dominate longer pathways. Further, if pathways are slightly difference, distinct features will be promoted in later layers.
SP:60133dcf473580ef37878b0d79fc044c30adefda
Go with the Flow: the distribution of information processing in multi-path networks
1 INTRODUCTION . The architectures of Convolutional Neural Network ( CNN ) classifiers are an important influencing factor regarding their predictive performance and computational efficiency , with many designs being proposed over the years ( Simonyan & Zisserman , 2015 ; He et al. , 2016 ; Szegedy et al. , 2015 ; Tan & Le , 2019 ; Sandler et al. , 2018 ) . These architectures can be generally subdivided into two distinct categories . First , the sequential architectures like VGG16 by Simonyan & Zisserman ( 2015 ) , which essentially consist of a sequence of layers leading from the input to the output of the network . While these architectures are simplistic in structure , they have been surpassed by multi-path architectures in efficiency and predictive performance . Multipath architectures can be described as a directed acyclic graph , with the nodes representing the layers . Information provided at the input of a multipath network can be processed by different sequences of layers that are intertwined in the overall neural architecture . The Inception-family of networks is an example for such an architecture ( Szegedy et al. , 2015 ; 2016 ; 2017 ) , where each building block features a different set of layers and allows for the parallel extraction of heterogeneous features . Networks featuring skip-connections like ResNet , MobileNetV2 , MobileNetV3 and EfficientNet ( He et al. , 2016 ; Sandler et al. , 2018 ; Howard et al. , 2019 ; Tan & Le , 2019 ) are a special case of multipath architectures , since they may only feature a single sequence of layers . However , since the skip-connections effectively allow signals to skip layers , it is possible for any signal from the input to take multiple paths to the output , thus making these architectures multipath architectures . On the other hand , multi-path architectures require the model to implicitly make decisions regarding the distribution of the inference process , since some routes connecting two layers may differ in their capacity ( number of parameters ) , depth and receptive field size . In essence , during training , the model will learn to utilize the different pathways , implicitly deciding how the inference process is distributed in branching paths and whether to skip certain layers . These decisions have been discussed theoretically by authors like He et al . ( 2016 ) , who for example elaborate the possibility of identity-mappings in skip-connections , which effectively enable the network to remove layers from the qualitative inference process . In this work , we empirically investigate how parallel pathways and skip connections are utilized in multi-path CNN architectures . Our contributions can be summarized as follows : • We find that networks with skip connections reliably skip layers when a mismatch between receptive field and input resolution occurs . This finding is in agreement with the findings of Richter et al . ( 2021b ) and Richter et al . ( 2021a ) . • We show that networks with parallel pathways of strongly different depth will prefer the shorter pathway over the longer pathway due to a partial vanishing gradient . • We demonstrate that multi-path architectures with parallel pathways of roughly similar size advance the solution quality in a similar pace and with a high degree of redundancy . 2 RELATED WORK . 2.1 MULTI-PATH NETWORKS . Since this work is focussed on multi-path architectures , we will introduce the most significant works regarding this type of neural architecture as well as the contemporary reasoning for the introduction of the proposed neural architectures . After the advent of CNNs , there were several works that focused on improving their performance by introducing novel architectures ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2015 ) . Although one of the most intuitive ways to improve the accuracy of CNNs is by increasing the number of layers ( depth ) , there is an upper limit to it . After a specific level , there are certain hurdles that occur such as network overfitting , vanishing gradient ( Hochreiter , 1998 ; Dong et al. , 2015 ) , and also it becomes computationally expensive to train them . Therefore , to train such deep networks , several works proposed the idea of multipath networks ( He et al. , 2016 ; Larsson et al. , 2017 ; Huang et al. , 2018 ; Kuen et al. , 2017 ) . The multipath networks presented in ( Mao et al. , 2016 ; Tong et al. , 2017 ; Srivastava et al. , 2015 ) introduced shortcuts in the networks structure that facilitate a customized flow of information such that the vanishing gradient problem is reduced . The work by Szegedy et al . ( 2015 ) introduced sparsely connected architectures motivated by Hebbian principle to solve the problem of overfitting and then clustering them to dense matrices ( Ümt V. Çatalyürek et al. , 2010 ) so that the network can be trained efficiently on the hardware . Further improvements to this network were introduced ( Szegedy et al. , 2016 ; 2017 ) to increase its accuracy and training efficiency . Since the information available to the shallower layers is not available to the deeper layers , He et al . ( 2016 ) introduced the Residual Networks ( ResNets ) which used skip connections to preserve the gradient . The skip connections are operated by vector addition whereas in the method proposed by Huang et al . ( 2018 ) , the skip connections are operated by concatenation of the feature maps . 2.2 RELEVANT ANALYSIS TOOLS AND SIMILARITY METRICS . Since we are interested in the information processing of CNNs , a set of analysis tools is required that allows us to analyze the processing within the neural architecture . Our main analysis tool that is used extensively throughout this work are logistic regression probes ( LRP ) by Alain et al . ( 2020 ) . LRP are logistic regressions trained on the output of a hidden layer . Since classifiers implicitly maximize the linear separability of the data , the predictive performance of the logistic regression models on the test set allows us to track the progress of the intermediate solution quality while the data is propagated from layer to layer ( see Fig . 1 ) . The usefulness of LRP has been demonstrated by the works of Richter et al . ( 2020 ) , Richter et al . ( 2021a ) and Richter et al . ( 2021b ) , which utilize LRP to identify inefficiencies in neural architectures caused by layers not contributing qualitatively to the inference process . Alain et al . ( 2020 ) find by experimenting on multilayer perceptrons with skip connections that the skipping of a sequence of layers is observable by logistic LRP by a degradation in performance . A reproduction of this experiment on MNIST using a similar architecture can be seen in Fig . 2 . In section 3 we furthermore utilize saturation proposed by Richter et al . ( 2020 ) as an additional tool for analyzing the output of hidden layers . Saturation uses PCA to approximate the subspace the data is processed , and can be interpreted as the percentage of dimensions utilized by the data in the output of space of a given layer . Thereby , highly saturated layers can be usually seen as active , in the sense that they contribute qualitatively to the prediction , while layers that are low saturated relative to the rest of the network tend to be unproductive . A sequence of unproductive layers is referred to as a tail pattern. . Since we are interested in the information processing of ( partial ) networks , tools that easily allow the comparison of learned feature representation are required . Several works ( Raghu et al. , 2017 ; Morcos et al. , 2018 ; Feng et al. , 2020 ) proposed such tools to gauge the similarity of the features learned by two models having the same architectures but trained with different initialization . The similarity is calculated by taking the hidden state activations from each model in the form of a feature matrix and finding a measure of correlation between them . The method proposed by Wang et al . ( 2018 ) uses a subspace match model to find the similarity in terms of maximum and simple matches . Raghu et al . ( 2017 ) uses Canonical Correlation Analysis ( CCA ) proposed in Golub & Zha ( 1995 ) coupled with Singular Vector Decomposition ( SVD ) to compare the representations presented by two neural networks in a process which is invariant to invertible linear transformations . The technique by Morcos et al . ( 2018 ) further improves this method by giving more weight to those intermediate CCA vectors which are more important for the representations . Another metric proposed by Feng et al . ( 2020 ) called the Transferred Discrepancy ( TD ) focuses on the practical usage of the representations by stating their similarity based on their performance in downstream tasks . Another approach to compare layer activations , that has gained popularity over the last years is Centered Kernel Alignment ( CKA , Cortes et al. , 2012 ) , which we will use for this work . It is introduced as a normalized version of the Hilbert-Schmidt Independence Criterion ( HSIC , Gretton et al. , 2005 ) , and when used with linear kernels , it is equivalent to the RV coefficient Robert & Escoufier ( 1976 ) . In this form it has been applied successfully in recent works as an efficient alternative to SVCCA and other methods ( Nguyen et al. , 2021 ; Kornblith et al. , 2019 ) , majorly because it requires less number of data points ( Kornblith et al. , 2019 ) . 3 DISTRIBUTION OF INFORMATION PROCESSING IN NETWORKS WITH SKIP-CONNECTIONS . In this section , we will investigate the first scenario we identified in which a network with a skip connection will reliably choose not to utilize the layers encapsulated by a skip connection . Skipping of layers could be described as an autogenous pruning technique , where the model decides during training to not utilize certain layers . Therefore , we hypothesize that layers that would be unproductive are likely to be skipped if the network is given the opportunity . We find that it is possible to guarantee a convolutional layer will not be able to contribute to the quality of the solution by utilizing the knowledge about the relation of receptive field and input resolution presented by Richter et al . ( 2021b ) . The authors show experimentally that convolutional layers can only enhance the quality of the solution if the receptive field of the layer ’ s input is smaller than the input image . Simply speaking , if the layer is unable to integrate novel information into a feature map position by convolving the kernel over the input , the layer will not improve the quality of the intermediate solution . In case of a simple sequential architecture neural network like VGG16 the layers pass the solved problem from layer to layer while not enhancing the intermediate solution quality , as Fig . 3 ( a ) exemplifies . The observed effect is caused by training the model on Cifar10 using the native resolution of 32 × 32 pixels . When repeating this experiment on DenseNet18 , we can see that the probe performance no longer stagnates . Instead , the final dense-block of the model is skipped entirely , which is apparent when looking at the decaying probe performance in Fig . 3 ( b ) . A similar effect can be observed when training ResNet34 in the same scenario . In this case , unproductive residual blocks are skipped . Since the input of a residual block is added to its output , the performance recovers after each building block and thus recovering the intermediate solution quality . This is reflected by a zig-zag-pattern in the LRP . Based on these results , we can see that unproductive layers are behaving differently in architectures where these layers can be bypassed . Instead of learning to functionally emulate a pass-through layer , the layers learn a representation which is functionally equivalent to an identity mapping . With functionally equivalent , we refer to the behavior of the layers being similar to a pass-through layer or an identity mapping regarding the predictive performance . We find that skipped layers do in-fact not learn an identity mapping . Instead , these layers learn a harmless non-zero representation that does not hurt the intermediate solution quality when added to the feature map containing a good solution . This makes it also impossible to remove these skipped layers in a primitive pruning step without retraining the model , since the changes in the data caused by the unproductive layers are still expected by the following layers . Nevertheless , removing the skipped layers and retraining the pruned model will lead to a more efficient network ( Richter et al. , 2021b ) .
This paper analyzes the distribution of information processing in multi-path networks (including skip-connection models such as ResNet and DenseNet). They apply logistic regression on the hidden layers, namely logistic regression probes, to track the progress of the intermediate solution quality, and they analyze in which condition (depth of the path and receptive field size) the neural network prefers to skip the paths. They also measure the CKA similarity of the hidden representations learned by the multi-path model when the paths are homogeneous. They claim that with their analysis, later layers in ResNet and DenseNet can be skipped as pruning due to the unproductive layers. In addition, they find that for multi-path model, the shorter path is dominant when the depth of the paths are very different, and when the pathways are homogeneous, the behavior of the pathways changes to a coexisting behavior.
SP:60133dcf473580ef37878b0d79fc044c30adefda
Generalized rectifier wavelet covariance models for texture synthesis
1 INTRODUCTION . Textures ares spatially homogeneous images , consisting of similar patterns forming a coherent ensemble . In texture modeling , one of the standard approaches to synthesize textures relies on defining a maximum entropy model ( Jaynes , 1957 ) using a single observed image ( Raad et al. , 2018 ) . It consists of computing a set of prescribed statistics from the observed texture image , and then generating synthetic textures producing the same statistics as the observation . If the statistics correctly describe the structures present in the observation , then any new image with the same statistics should appear similar to the observation . A major challenge of such methods resides in finding a suitable set of statistics , that can generate both high-quality and diverse synthetic samples . This problem is fundamental as it is at the heart of many texture related problems . For example , in patch re-arrangement methods for texture modeling , these statistics are used to compute high-level similarities of image patches ( Li & Wand , 2016 ; Raad et al. , 2018 ) . Such statistics are also used in texture interpolation for probing visual perception ( Vacher et al. , 2020 ) , style transfer and image inpainting ( Gatys et al. , 2016 ; Laube et al. , 2018 ) . A key question along this line of research is to find what it takes to generate natural textures . This problem was originally posed in Julesz ( 1962 ) , in which the author looks for a statistical characterization of textures . In the classical work of Portilla & Simoncelli ( 2000 ) , the authors presented a model whose statistics are built on the wavelet transform of an input texture image . These statistics were carefully chosen , by showing that each of them captured a specific aspect of the structure of the image . This model produces satisfying results for a wide range of textures , but fails to reproduce complex geometric structures present in some natural texture images . Figure 1 presents a typical example composed of radishes , and synthetic images from three state-of-the-art models developed over the last few decades . To address this problem , the work of Gatys et al . ( 2015 ) proposes to use statistics built on the correlations between the feature maps of a deep CNN , pre-trained on the ImageNet classification problem ( Deng et al. , 2009 ; Simonyan & Zisserman , 2014 ) . While this model produces visually appealing images , these statistics are hard to interpret . The work of Ustyuzhaninov et al . ( 2017 ) made a significant simplification of such statistics , by using the feature maps of a one-layer rectifier CNN with random filters ( without learning ) . A crucial aspect of this simplification relies on using multi-scale filters , which are naturally connected to the wavelet transform . In this paper , we propose a wavelet-based model , more interpretable than CNN-based models ( with learned or random filters ) , to synthesize textures with complex geometric structures . It allows to bridge the gap between the classical work of Portilla & Simoncelli ( 2000 ) , and state-of-the-art models . This model is built on the recent development of the phase harmonics for image representations and non-Gaussian stationary process modeling ( Mallat et al. , 2020 ; Zhang & Mallat , 2021 ) . The phase harmonics are non-linear transformations that adjust the phase of a complex number . In Portilla & Simoncelli ( 2000 ) ; Zhang & Mallat ( 2021 ) , the authors illustrate that the phase dependencies between wavelet coefficients across scales contain important information about the geometric structures in textures and turbulent flows , and that they can be captured by applying the phase harmonics to complex wavelet coefficients . Remarkably , Mallat et al . ( 2020 ) show that the phase harmonics admit a dual representation , closely related to the rectifier non-linearity in CNNs . Our main contributions are : • We develop a family of texture models based on the wavelet transform and a generalized rectifier non-linearity , that significantly improves the visual quality of the classical waveletbased model of Portilla & Simoncelli ( 2000 ) on a wide range of textures . It relies on introducing spatial shift statistics across scales to capture geometric structures in textures . • By changing the number of statistics in our models , we show explicitly the trade-off on the quality and diversity of the synthesis . When there are too many statistics , our model tends to memorize image patches . We further investigate such memorization effects on non-stationary images and find that it sometimes relies on what statistics are chosen , rather than on how many . • Through the modeling of geometric structures in gray-scale textures , our model indicates the possibility of reducing significantly the number of statistics in the works of Gatys et al . ( 2015 ) and Ustyuzhaninov et al . ( 2017 ) , to achieve a similar visual quality . The rest of the paper is organized as follows : Section 2 reviews the framework of microcanonical maximum-entropy models , build upon a general family of covariance statistics . We then present our model for both gray-scale and color textures in Section 3 . Section 4 shows synthesis results of our model , compared with state-of-the-art models . Finally , in Section 5 , we discuss possible improvements of our model . Notations Throughout the paper , N denotes a positive integer . A gray-scale image x is an element of RN×N , i.e . x = x ( u ) , u ∈ ΩN , with ΩN : = { 0 , · · · , N−1 } 2 . A color image x = { xc } c=1,2,3 is an element of R3×N×N , or equivalently , each xc ∈ RN×N . We shall denote x̄ the observed texture ( observation ) , which is assumed to be a realisation a random vector X . For any complex number z ∈ C , z∗ is the complex conjugate of z , Real ( z ) its real part , |z| its modulus , and ϕ ( z ) its phase . 2 MICROCANONICAL COVARIANCE MODELS . We briefly review the standard framework of micro-canonical maximum-entropy models for textures . To reliably estimate the statistics in these models , we assume that a texture is a realization of a stationary and ergodic process X ( restricted to ΩN ) . We then review a special family of statistics that are used in the state-of-the-art texture models ( mentioned in Figure 1 ) , based on covariance statistics of an image representation . 1As the model from Ustyuzhaninov et al . ( 2017 ) uses on random filters , we shall use the abbreviation RF . 2.1 FRAMEWORK . Given a observation texture x̄ , we aim at generating new texture images , similar but different from x̄ . To that end , a classical method is to define a set of statistics Cx̄ , computed on the observation , and try to sample from the microcanonical set { x : ‖Cx− Cx̄‖ ≤ } , where ‖ · ‖ denotes the L2 norm . Under the stationary and ergodic assumption of X , one can construct Cx as a statistical estimator of E ( CX ) , from a complex-valued representation Rx.2 The set of covariance statistics Cx of a model can then be constructed by computing an averaging over the spatial variable u , i.e . Cx ( γ , γ′ , τ ) : = 1 |ΩN | ∑ u∈ΩN Rx ( γ , u ) Rx ( γ′ , u− τ ) ∗ , ( 1 ) for ( γ , γ′ , τ ) ∈ Υ ⊆ Γ × Γ × ΩN . The statistics Cx ( γ , γ′ , τ ) can be interpreted as estimating the covariance ( resp . correlations ) betweenRX ( γ , u ) andRX ( γ′ , u−τ ) for zero-meanRX ( resp . nonzero meanRX ) . The ergodicity assumption ensures that whenN is large enough , the approximation Cx̄ ' E ( CX ) over Υ should hold with high probability . Under these conditions , it makes sense to sample the microcanonical set in order to generate new texture samples . This framework encompasses a wide range of state-of-the-art texture models3 . In particular , the PS model developed in Portilla & Simoncelli ( 2000 ) takes inspiration from the human early visual system to define a multi-scale representation based on the wavelet transform of the image ( Heeger & Bergen , 1995 ) . We next review a family of covariance model which generalizes the statistics in the PS model . We write CM the statistics for a specific model M that uses the representation RM . 2.2 WAVELET PHASE HARMONIC COVARIANCE MODELS . We review a family of microcanonical covariance models defined by a representation built upon the wavelet transform and phase harmonics . It defines a class of covariance statistics that capture dependencies between wavelet coefficients across scales . 2.2.1 WAVELET TRANSFORM . The wavelet transform is a powerful tool in image processing to analyze signal structures , by defining a sparse representation ( Mallat , 2001 ) . For texture modeling , we consider oriented wavelets to model geometric structures in images at multiple scales . They include the Morlet wavelets and steerable wavelets , proposed in Goupillaud et al . ( 1984 ) ; Simoncelli & Freeman ( 1995 ) ; Unser & Chenouard ( 2013 ) . In particular , the Simoncelli steerable wavelets have been used to model a diverse variety of textures in Portilla & Simoncelli ( 2000 ) . Oriented wavelets are defined by the dilation and rotation of a complex function ψ : R2 7→ C on a plane . Let rθ denote the rotation by angle θ in R2 . They are derived from ψ with dilations by factors 2j , for j ∈ { 0 , 1 , · · · , J − 1 } , and rotations rθ over angles θ = ` π/L for 0 ≤ ` < L , where L is the number of angles in [ 0 , π ) . The wavelet at scale j and angle θ is defined by ψj , θ ( u ) = 2 −2jψ ( 2−jrθu ) , u ∈ R2 Scales equal or larger than J are carried by a low-pass filter φJ . The wavelet transform of an image x ∈ RN×N is a family of functions obtained by the convolution of x with discrete wavelets.4 Let Λ : = { 0 , · · · , J − 1 } × πL { 0 , · · · , L − 1 } be an index set . The wavelet coefficients are x ? ψj , θ ( u ) = ∑ v∈ΩN x ( u− v ) ψj , θ ( v ) , u ∈ ΩN , ( j , θ ) ∈ Λ . ( 2 ) The low-pass coefficients x ? φJ are defined similarly . 2The complex-valued representation Rx ( γ , u ) ∈ C is a function of ( γ , u ) in an index set Γ× ΩN . 3Such as Portilla & Simoncelli ( 2000 ) ; Gatys et al . ( 2015 ) ; Ustyuzhaninov et al . ( 2017 ) ; Zhang & Mallat ( 2021 ) 4The continuous wavelets are discretized with periodic boundary conditions on the spatial grid ΩN . 2.2.2 WAVELET PHASE HARMONICS AND THE PS MODEL . To model natural textures , it has been shown ( Portilla & Simoncelli , 2000 ; Zhang & Mallat , 2021 ) that it is crucial to capture statistical dependencies between wavelet coefficients across scales . This can be achieved by using a wavelet phase harmonic representation , which is defined by the composition of a linear wavelet transform of x , and a non-linear phase harmonic transform . In Mallat et al . ( 2020 ) , the authors introduce the phase harmonics to adjust the phase of a complex number z ∈ C. More precisely , the phase harmonics { [ z ] k } k∈Z of a complex number z ∈ C are defined by multiplying its phase ϕ ( z ) of z by integers k , while keeping the modulus constant , i.e . ∀ k ∈ Z , [ z ] k : = |z|eikϕ ( z ) . The wavelet phase harmonic representation ( WPH ) is then defined by RWPHx ( γ , u ) = [ x ? ψj , θ ( u ) ] k − µγ , γ = ( j , θ , k ) ∈ Γ = Λ× Z , ( 3 ) where µγ is defined as the spatial average of RWPHx̄ ( γ , · ) . It is shown in Zhang & Mallat ( 2021 ) that the PS model can be regarded as a low-order wavelet phase harmonics covariance model , which considers only a restricted number of pairs ( k , k′ ) ( see Appendix A for more details ) . In the next section , we shall use a dual representation of the phase harmonic operator to define a covariance model to capture high-order phase harmonics .
This work proposed a texture synthesis framework using the rectified wavelet coefficients. The paper claims that the proposed method cand achieve similar quality with the VGG feature based method (Gatys et al. 22015) and random filter based method (RF, Ustyuzhaninov et al 2017) and gets better quality than PS (Portilla & Simoncelli 2000, while requiring less number of statistics than RF.
SP:7b58625be5e935efe59d293b377ddf7abdd2c845
Generalized rectifier wavelet covariance models for texture synthesis
1 INTRODUCTION . Textures ares spatially homogeneous images , consisting of similar patterns forming a coherent ensemble . In texture modeling , one of the standard approaches to synthesize textures relies on defining a maximum entropy model ( Jaynes , 1957 ) using a single observed image ( Raad et al. , 2018 ) . It consists of computing a set of prescribed statistics from the observed texture image , and then generating synthetic textures producing the same statistics as the observation . If the statistics correctly describe the structures present in the observation , then any new image with the same statistics should appear similar to the observation . A major challenge of such methods resides in finding a suitable set of statistics , that can generate both high-quality and diverse synthetic samples . This problem is fundamental as it is at the heart of many texture related problems . For example , in patch re-arrangement methods for texture modeling , these statistics are used to compute high-level similarities of image patches ( Li & Wand , 2016 ; Raad et al. , 2018 ) . Such statistics are also used in texture interpolation for probing visual perception ( Vacher et al. , 2020 ) , style transfer and image inpainting ( Gatys et al. , 2016 ; Laube et al. , 2018 ) . A key question along this line of research is to find what it takes to generate natural textures . This problem was originally posed in Julesz ( 1962 ) , in which the author looks for a statistical characterization of textures . In the classical work of Portilla & Simoncelli ( 2000 ) , the authors presented a model whose statistics are built on the wavelet transform of an input texture image . These statistics were carefully chosen , by showing that each of them captured a specific aspect of the structure of the image . This model produces satisfying results for a wide range of textures , but fails to reproduce complex geometric structures present in some natural texture images . Figure 1 presents a typical example composed of radishes , and synthetic images from three state-of-the-art models developed over the last few decades . To address this problem , the work of Gatys et al . ( 2015 ) proposes to use statistics built on the correlations between the feature maps of a deep CNN , pre-trained on the ImageNet classification problem ( Deng et al. , 2009 ; Simonyan & Zisserman , 2014 ) . While this model produces visually appealing images , these statistics are hard to interpret . The work of Ustyuzhaninov et al . ( 2017 ) made a significant simplification of such statistics , by using the feature maps of a one-layer rectifier CNN with random filters ( without learning ) . A crucial aspect of this simplification relies on using multi-scale filters , which are naturally connected to the wavelet transform . In this paper , we propose a wavelet-based model , more interpretable than CNN-based models ( with learned or random filters ) , to synthesize textures with complex geometric structures . It allows to bridge the gap between the classical work of Portilla & Simoncelli ( 2000 ) , and state-of-the-art models . This model is built on the recent development of the phase harmonics for image representations and non-Gaussian stationary process modeling ( Mallat et al. , 2020 ; Zhang & Mallat , 2021 ) . The phase harmonics are non-linear transformations that adjust the phase of a complex number . In Portilla & Simoncelli ( 2000 ) ; Zhang & Mallat ( 2021 ) , the authors illustrate that the phase dependencies between wavelet coefficients across scales contain important information about the geometric structures in textures and turbulent flows , and that they can be captured by applying the phase harmonics to complex wavelet coefficients . Remarkably , Mallat et al . ( 2020 ) show that the phase harmonics admit a dual representation , closely related to the rectifier non-linearity in CNNs . Our main contributions are : • We develop a family of texture models based on the wavelet transform and a generalized rectifier non-linearity , that significantly improves the visual quality of the classical waveletbased model of Portilla & Simoncelli ( 2000 ) on a wide range of textures . It relies on introducing spatial shift statistics across scales to capture geometric structures in textures . • By changing the number of statistics in our models , we show explicitly the trade-off on the quality and diversity of the synthesis . When there are too many statistics , our model tends to memorize image patches . We further investigate such memorization effects on non-stationary images and find that it sometimes relies on what statistics are chosen , rather than on how many . • Through the modeling of geometric structures in gray-scale textures , our model indicates the possibility of reducing significantly the number of statistics in the works of Gatys et al . ( 2015 ) and Ustyuzhaninov et al . ( 2017 ) , to achieve a similar visual quality . The rest of the paper is organized as follows : Section 2 reviews the framework of microcanonical maximum-entropy models , build upon a general family of covariance statistics . We then present our model for both gray-scale and color textures in Section 3 . Section 4 shows synthesis results of our model , compared with state-of-the-art models . Finally , in Section 5 , we discuss possible improvements of our model . Notations Throughout the paper , N denotes a positive integer . A gray-scale image x is an element of RN×N , i.e . x = x ( u ) , u ∈ ΩN , with ΩN : = { 0 , · · · , N−1 } 2 . A color image x = { xc } c=1,2,3 is an element of R3×N×N , or equivalently , each xc ∈ RN×N . We shall denote x̄ the observed texture ( observation ) , which is assumed to be a realisation a random vector X . For any complex number z ∈ C , z∗ is the complex conjugate of z , Real ( z ) its real part , |z| its modulus , and ϕ ( z ) its phase . 2 MICROCANONICAL COVARIANCE MODELS . We briefly review the standard framework of micro-canonical maximum-entropy models for textures . To reliably estimate the statistics in these models , we assume that a texture is a realization of a stationary and ergodic process X ( restricted to ΩN ) . We then review a special family of statistics that are used in the state-of-the-art texture models ( mentioned in Figure 1 ) , based on covariance statistics of an image representation . 1As the model from Ustyuzhaninov et al . ( 2017 ) uses on random filters , we shall use the abbreviation RF . 2.1 FRAMEWORK . Given a observation texture x̄ , we aim at generating new texture images , similar but different from x̄ . To that end , a classical method is to define a set of statistics Cx̄ , computed on the observation , and try to sample from the microcanonical set { x : ‖Cx− Cx̄‖ ≤ } , where ‖ · ‖ denotes the L2 norm . Under the stationary and ergodic assumption of X , one can construct Cx as a statistical estimator of E ( CX ) , from a complex-valued representation Rx.2 The set of covariance statistics Cx of a model can then be constructed by computing an averaging over the spatial variable u , i.e . Cx ( γ , γ′ , τ ) : = 1 |ΩN | ∑ u∈ΩN Rx ( γ , u ) Rx ( γ′ , u− τ ) ∗ , ( 1 ) for ( γ , γ′ , τ ) ∈ Υ ⊆ Γ × Γ × ΩN . The statistics Cx ( γ , γ′ , τ ) can be interpreted as estimating the covariance ( resp . correlations ) betweenRX ( γ , u ) andRX ( γ′ , u−τ ) for zero-meanRX ( resp . nonzero meanRX ) . The ergodicity assumption ensures that whenN is large enough , the approximation Cx̄ ' E ( CX ) over Υ should hold with high probability . Under these conditions , it makes sense to sample the microcanonical set in order to generate new texture samples . This framework encompasses a wide range of state-of-the-art texture models3 . In particular , the PS model developed in Portilla & Simoncelli ( 2000 ) takes inspiration from the human early visual system to define a multi-scale representation based on the wavelet transform of the image ( Heeger & Bergen , 1995 ) . We next review a family of covariance model which generalizes the statistics in the PS model . We write CM the statistics for a specific model M that uses the representation RM . 2.2 WAVELET PHASE HARMONIC COVARIANCE MODELS . We review a family of microcanonical covariance models defined by a representation built upon the wavelet transform and phase harmonics . It defines a class of covariance statistics that capture dependencies between wavelet coefficients across scales . 2.2.1 WAVELET TRANSFORM . The wavelet transform is a powerful tool in image processing to analyze signal structures , by defining a sparse representation ( Mallat , 2001 ) . For texture modeling , we consider oriented wavelets to model geometric structures in images at multiple scales . They include the Morlet wavelets and steerable wavelets , proposed in Goupillaud et al . ( 1984 ) ; Simoncelli & Freeman ( 1995 ) ; Unser & Chenouard ( 2013 ) . In particular , the Simoncelli steerable wavelets have been used to model a diverse variety of textures in Portilla & Simoncelli ( 2000 ) . Oriented wavelets are defined by the dilation and rotation of a complex function ψ : R2 7→ C on a plane . Let rθ denote the rotation by angle θ in R2 . They are derived from ψ with dilations by factors 2j , for j ∈ { 0 , 1 , · · · , J − 1 } , and rotations rθ over angles θ = ` π/L for 0 ≤ ` < L , where L is the number of angles in [ 0 , π ) . The wavelet at scale j and angle θ is defined by ψj , θ ( u ) = 2 −2jψ ( 2−jrθu ) , u ∈ R2 Scales equal or larger than J are carried by a low-pass filter φJ . The wavelet transform of an image x ∈ RN×N is a family of functions obtained by the convolution of x with discrete wavelets.4 Let Λ : = { 0 , · · · , J − 1 } × πL { 0 , · · · , L − 1 } be an index set . The wavelet coefficients are x ? ψj , θ ( u ) = ∑ v∈ΩN x ( u− v ) ψj , θ ( v ) , u ∈ ΩN , ( j , θ ) ∈ Λ . ( 2 ) The low-pass coefficients x ? φJ are defined similarly . 2The complex-valued representation Rx ( γ , u ) ∈ C is a function of ( γ , u ) in an index set Γ× ΩN . 3Such as Portilla & Simoncelli ( 2000 ) ; Gatys et al . ( 2015 ) ; Ustyuzhaninov et al . ( 2017 ) ; Zhang & Mallat ( 2021 ) 4The continuous wavelets are discretized with periodic boundary conditions on the spatial grid ΩN . 2.2.2 WAVELET PHASE HARMONICS AND THE PS MODEL . To model natural textures , it has been shown ( Portilla & Simoncelli , 2000 ; Zhang & Mallat , 2021 ) that it is crucial to capture statistical dependencies between wavelet coefficients across scales . This can be achieved by using a wavelet phase harmonic representation , which is defined by the composition of a linear wavelet transform of x , and a non-linear phase harmonic transform . In Mallat et al . ( 2020 ) , the authors introduce the phase harmonics to adjust the phase of a complex number z ∈ C. More precisely , the phase harmonics { [ z ] k } k∈Z of a complex number z ∈ C are defined by multiplying its phase ϕ ( z ) of z by integers k , while keeping the modulus constant , i.e . ∀ k ∈ Z , [ z ] k : = |z|eikϕ ( z ) . The wavelet phase harmonic representation ( WPH ) is then defined by RWPHx ( γ , u ) = [ x ? ψj , θ ( u ) ] k − µγ , γ = ( j , θ , k ) ∈ Γ = Λ× Z , ( 3 ) where µγ is defined as the spatial average of RWPHx̄ ( γ , · ) . It is shown in Zhang & Mallat ( 2021 ) that the PS model can be regarded as a low-order wavelet phase harmonics covariance model , which considers only a restricted number of pairs ( k , k′ ) ( see Appendix A for more details ) . In the next section , we shall use a dual representation of the phase harmonic operator to define a covariance model to capture high-order phase harmonics .
This paper presents a new image representation model based on wavelets and non-linear rectifiers that allows to synthesize complex geometric textures with a better visual quality than previous wavelet-based models. The main interest of the paper is the usage of the mathematical results from Mallat et al 2020 and Zhang and Mallat 2021 on wavelet phase harmonics to image texture synthesis. They also show that the PS model (Portilla & Simoncelli 2000) is a particular case of the wavelet phase harmonics-based (WPH) model. Both methods underline the importance of statistical dependencies between wavelet coefficients across scales. The specific choice of the parameters available for WPH is important to balance between reproducing good structural information and memorizing patterns from the observation.
SP:7b58625be5e935efe59d293b377ddf7abdd2c845
Crystal Diffusion Variational Autoencoder for Periodic Material Generation
Generating the periodic structure of stable materials is a long-standing challenge for the material design community . This task is difficult because stable materials only exist in a low-dimensional subspace of all possible periodic arrangements of atoms : 1 ) the coordinates must lie in the local energy minimum defined by quantum mechanics , and 2 ) global stability also requires the structure to follow the complex , yet specific bonding preferences between different atom types . Existing methods fail to incorporate these factors and often lack proper invariances . We propose a Crystal Diffusion Variational Autoencoder ( CDVAE ) that captures the physical inductive bias of material stability . By learning from the data distribution of stable materials , the decoder generates materials in a diffusion process that moves atomic coordinates towards a lower energy state and updates atom types to satisfy bonding preferences between neighbors . Our model also explicitly encodes interactions across periodic boundaries and respects permutation , translation , rotation , and periodic invariances . We significantly outperform past methods in three tasks : 1 ) reconstructing the input structure , 2 ) generating valid , diverse , and realistic materials , and 3 ) generating materials that optimize a specific property . We also provide several standard datasets and evaluation metrics for the broader machine learning community . 1 INTRODUCTION . Solid state materials , represented by the periodic arrangement of atoms in the 3D space , are the foundation of many key technologies including solar cells , batteries , and catalysis ( Butler et al. , 2018 ) . Despite the rapid progress of molecular generative models and their significant impact on drug discovery , the problem of material generation has many unique challenges . Compared with small molecules , materials have more complex periodic 3D structures and can not be adequately represented by a simple graph like small molecules ( Figure 1 ) . In addition , materials can be made up of more than 100 elements in the periodic table , while molecules are generally only made up of a small subset of atoms such as carbon , oxygen , and hydrogen . Finally , the data for training ML models for material design is limited . There are only ∼200k experimentally known inorganic materials , collected by the ICSD ( Belsky et al. , 2002 ) , in contrast to close to a billion purchasable molecules in ZINC ( Irwin & Shoichet , 2005 ) . The key challenge of this task is in generating stable materials . Such materials only exist in a lowdimensional subspace of all possible periodic arrangements of atoms : 1 ) the atom coordinates must lie in the local energy minimum defined by quantum mechanics ( QM ) ; 2 ) global stability also requires the structure to follow the complex , yet specific bonding preferences between differ- ent atom types ( section 3.2 ) . The issue of stability is unique to material generation because valency checkers assessing molecular stability are not applicable to materials . Moreover , we also have to encode the interactions crossing periodic boundaries ( Figure 1 , middle ) , and satisfy permutation , translation , rotation , and periodic invariances ( section 3.1 ) . Our goal is to learn representations that can learn features of stable materials from data , while adhering to the above invariance properties . We address these challenges by learning a variational autoencoder ( VAE ) ( Kingma & Welling , 2014 ) to generate stable 3D materials directly from a latent representation without intermediates like graphs . The key insight is to exploit the fact that all materials in the data distribution are stable , therefore if noise is added to the ground truth structure , denoising it back to its original structure will likely increase stability . We capture this insight by designing a noise conditional score network ( NCSN ) ( Song & Ermon , 2019 ) as our decoder : 1 ) the decoder outputs gradients that drive the atom coordinates to the energy local minimum ; 2 ) it also updates atom types based on the neighbors to capture the specific local bonding preferences ( e.g. , Si-O is preferred over Si-Si and O-O in SiO2 ) . During generation , materials are generated using Langevin dynamics that gradually deforms an initial random structure to a stable structure . To capture the necessary invariances and encode the interactions crossing periodic boundaries , we use SE ( 3 ) equivariant graph neural networks adapted with periodicity ( PGNNs ) for both the encoder and decoder of our VAE . Our theoretical analysis further reveals an intriguing connection between the gradient field learned by our decoder and an harmonic force field . De facto , the decoder utilizes the latter to estimate the forces on atoms when their coordinates deviate from the equilibrium positions . Consequently , this formulation provides an important physical inductive bias for generating stable materials . In this work , we propose Crystal Diffusion Variational AutoEncoder ( CDVAE ) to generate stable materials by learning from the data distribution of known materials . Our main contributions include : • We curate 3 standard datasets from QM simulations and create a set of physically meaningful tasks and metrics for the problem of material generation . • We incorporate stability as an inductive bias by designing a noise conditional score network as the decoder of our VAE , which allows us to generate significantly more realistic materials . • We encode permutation , translation , rotation , and periodic invariances , as well as interactions crossing periodic boundaries with SE ( 3 ) equivariant GNNs adapted with periodicity . • Empirically , our model significantly outperforms past methods in tasks including reconstructing an input structure , generating valid , diverse , and realistic materials , and generating materials that optimize specific properties . 2 RELATED WORK . Material graph representation learning . Graph neural networks have made major impacts in material property prediction . They were first applied to the representation learning of periodic materials by Xie & Grossman ( 2018 ) and later enhanced by many studies including Schütt et al . ( 2018 ) ; Chen et al . ( 2019 ) . The Open Catalyst Project ( OCP ) provides a platform for comparing different architectures by predicting energies and forces from the periodic structure of catalytic surfaces ( Chanussot et al. , 2021 ) . Our encoder and decoder PGNNs directly use GNN architectures developed for the OCP ( Klicpera et al. , 2020b ; 2021 ; Shuaibi et al. , 2021 ; Godwin et al. , 2021 ) , which are also closely related to SE ( 3 ) equivariant networks ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ) . Quantum mechanical search of stable materials . GNN-based property prediction models are fundamentally limited by the space of ∼200k known materials . Predicting the structure of unknown materials requires very expensive random search and QM simulations , and is considered a grand challenge in materials discovery ( Oganov et al. , 2019 ) . State-of-the-art methods include random sampling ( Pickard & Needs , 2011 ) , evolutionary algorithms ( Wang et al. , 2012 ) , substituting elements in known materials ( Sun et al. , 2019 ) , etc. , but they generally have success rates less than 1 % and require extensive computation even on relatively small problems . Material generative models . Past material generative models mainly focus on two different approaches , and neither incorporate stability as an inductive bias . The first approach treats materials as 3D voxel images , but the process of decoding images back to atom types and coordinates often results in low validity , and the models are not rotationally invariant ( Hoffmann et al. , 2019 ; Noh et al. , 2019 ; Court et al. , 2020 ; Long et al. , 2021 ) . The second directly encodes atom coordinates , types , and lattices as vectors ( Ren et al. , 2020 ; Kim et al. , 2020 ; Zhao et al. , 2021 ) , but the models are generally not invariant to any Euclidean transformations . Another related method is to train a force field from QM forces and then apply the learned force field to generate stable materials by minimizing energy ( Deringer et al. , 2018 ) . This method is conceptually similar to our decoder , but it requires additional force data and can only be applied to 1-2 elements due to the exponentially increased data need for more elements . Remotely related works include generating contact maps from chemical compositions ( Hu et al. , 2021 ; Yang et al. , 2021 ) and building generative models only for compositions ( Sawada et al. , 2019 ; Pathak et al. , 2020 ; Dan et al. , 2020 ) . Molecular conformer generation and protein folding . Our decoder that generates the 3D atomic structures via a diffusion process is closely related to the diffusion models used for molecular conformer generation ( Shi et al. , 2021 ) . The key difference is that our model does not rely on intermediate representations like molecular graphs . G-SchNet ( Gebauer et al. , 2019 ) is more closely related to our method because it directly generates 3D molecules atom-by-atom without relying on a graph . Another closely related work is E-NFs ( Satorras et al. , 2021 ) that use a flow model to generate 3D molecules . In addition , score-based and energy-based models have also been used for molecular graph generation ( Liu et al. , 2021 ) and protein folding ( Wu et al. , 2021 ) . Flow models have also been used for molecular graph generation ( Shi et al. , 2020 ; Luo et al. , 2021 ) . However , these generative models do not incorporate periodicity , which makes them unsuitable for materials . 3 PRELIMINARIES . 3.1 PERIODIC STRUCTURE OF MATERIALS . Any material structure can be represented as the periodic arrangement of atoms in the 3D space . As illustrated in Figure 1 , we can always find a repeating unit , i.e . a unit cell , to describe the infinite periodic structure of a material . A unit cell that includes N atoms can be fully described by 3 sets : 1 ) atom types A = ( a0 , ... , aN ) ∈ AN , where A denotes the set of all chemical elements ; 2 ) atom coordinates X = ( x0 , ... , xN ) ∈ RN×3 ; and 3 ) periodic lattice L = ( l1 , l2 , l3 ) ∈ R3×3 . The periodic lattice defines the periodic translation symmetry of the material . Given M = ( A , X , L ) , the infinite periodic structure can be represented as , { ( a′i , x′i ) |a′i = ai , x′i = xi + k1l1 + k2l2 + k3l3 , k1 , k2 , k3 ∈ Z } , ( 1 ) where k1 , k2 , k3 are any integers that translate the unit cell using L to tile the entire 3D space . The composition of a material denotes the ratio of different elements that the material is composed of . Given the atom types of a material with N atoms A ∈ AN , the composition can be represented as c ∈ R|A| , where ci > 0 denotes the percentage of atom type i and ∑ i ci = 1 . For example , the composition of diamond in Figure 1 has c6 = 1 and ci = 0 for i 6= 6 because 6 is the atomic number of carbon . Invariances for materials . The structure of a material does not change under several invariances . 1 ) Permutation invariance . Exchanging the indices of any pair of atoms will not change the material . 2 ) Translation invariance . Translating the atom coordinates X by an arbitrary vector will not change the material . 3 ) Rotation invariance . Rotating X and L together by an arbitrary rotation matrix will not change the material . 4 ) Periodic invariance . There are infinite different ways of choosing unit cells with different shapes and sizes , e.g. , obtaining a bigger unit cell as an integer multiplier of a smaller unit cell using integer translations . The material will again not change given different choices of unit cells . Multi-graph representation for materials . Materials can be represented as a directed multi-graph G = { V , E } to encode the periodic structures following ( Xie & Grossman , 2018 ; Wells et al. , 1977 ; O ’ Keeffe & Hyde , 1980 ) , where V = { v1 , ... , vN } is the set of nodes representing atoms and E = { eij , ( k1 , k2 , k3 ) |i , j ∈ { 1 , ... , N } , k1 , k2 , k3 ∈ Z } is the set of edges representing bonds . eij , ( k1 , k2 , k3 ) denotes a directed edge from node i at the original unit cell to node j at the cell translated by k1l1 + k2l2 + k3l3 ( in Figure 1 right , ( k1 , k2 , k3 ) are labeled on top of edges ) . For materials , there is no unique way to define edges ( bonds ) and the edges are often computed using k-nearest neighbor ( KNN ) approaches under periodicity or more advanced methods such as CrystalNN ( Pan et al. , 2021 ) . Given this directed multi-graph , message-passing neural networks and SE ( 3 ) -equivariant networks can be used for the representation learning of materials .
This paper aims to address challenging stable crystal materials generation problems via diffusion variational autoencoder with graph representation learning. Several recent advances in generative models and GNN are combined together to develop the entire workflow from data distribution learning, prediction to sample generation and property optimization. The authors demonstrate their method by using three datasets and compare with three baseline methods.
SP:5633fe1fee1abdd2a61bdd7679a771ce611f0f4e
Crystal Diffusion Variational Autoencoder for Periodic Material Generation
Generating the periodic structure of stable materials is a long-standing challenge for the material design community . This task is difficult because stable materials only exist in a low-dimensional subspace of all possible periodic arrangements of atoms : 1 ) the coordinates must lie in the local energy minimum defined by quantum mechanics , and 2 ) global stability also requires the structure to follow the complex , yet specific bonding preferences between different atom types . Existing methods fail to incorporate these factors and often lack proper invariances . We propose a Crystal Diffusion Variational Autoencoder ( CDVAE ) that captures the physical inductive bias of material stability . By learning from the data distribution of stable materials , the decoder generates materials in a diffusion process that moves atomic coordinates towards a lower energy state and updates atom types to satisfy bonding preferences between neighbors . Our model also explicitly encodes interactions across periodic boundaries and respects permutation , translation , rotation , and periodic invariances . We significantly outperform past methods in three tasks : 1 ) reconstructing the input structure , 2 ) generating valid , diverse , and realistic materials , and 3 ) generating materials that optimize a specific property . We also provide several standard datasets and evaluation metrics for the broader machine learning community . 1 INTRODUCTION . Solid state materials , represented by the periodic arrangement of atoms in the 3D space , are the foundation of many key technologies including solar cells , batteries , and catalysis ( Butler et al. , 2018 ) . Despite the rapid progress of molecular generative models and their significant impact on drug discovery , the problem of material generation has many unique challenges . Compared with small molecules , materials have more complex periodic 3D structures and can not be adequately represented by a simple graph like small molecules ( Figure 1 ) . In addition , materials can be made up of more than 100 elements in the periodic table , while molecules are generally only made up of a small subset of atoms such as carbon , oxygen , and hydrogen . Finally , the data for training ML models for material design is limited . There are only ∼200k experimentally known inorganic materials , collected by the ICSD ( Belsky et al. , 2002 ) , in contrast to close to a billion purchasable molecules in ZINC ( Irwin & Shoichet , 2005 ) . The key challenge of this task is in generating stable materials . Such materials only exist in a lowdimensional subspace of all possible periodic arrangements of atoms : 1 ) the atom coordinates must lie in the local energy minimum defined by quantum mechanics ( QM ) ; 2 ) global stability also requires the structure to follow the complex , yet specific bonding preferences between differ- ent atom types ( section 3.2 ) . The issue of stability is unique to material generation because valency checkers assessing molecular stability are not applicable to materials . Moreover , we also have to encode the interactions crossing periodic boundaries ( Figure 1 , middle ) , and satisfy permutation , translation , rotation , and periodic invariances ( section 3.1 ) . Our goal is to learn representations that can learn features of stable materials from data , while adhering to the above invariance properties . We address these challenges by learning a variational autoencoder ( VAE ) ( Kingma & Welling , 2014 ) to generate stable 3D materials directly from a latent representation without intermediates like graphs . The key insight is to exploit the fact that all materials in the data distribution are stable , therefore if noise is added to the ground truth structure , denoising it back to its original structure will likely increase stability . We capture this insight by designing a noise conditional score network ( NCSN ) ( Song & Ermon , 2019 ) as our decoder : 1 ) the decoder outputs gradients that drive the atom coordinates to the energy local minimum ; 2 ) it also updates atom types based on the neighbors to capture the specific local bonding preferences ( e.g. , Si-O is preferred over Si-Si and O-O in SiO2 ) . During generation , materials are generated using Langevin dynamics that gradually deforms an initial random structure to a stable structure . To capture the necessary invariances and encode the interactions crossing periodic boundaries , we use SE ( 3 ) equivariant graph neural networks adapted with periodicity ( PGNNs ) for both the encoder and decoder of our VAE . Our theoretical analysis further reveals an intriguing connection between the gradient field learned by our decoder and an harmonic force field . De facto , the decoder utilizes the latter to estimate the forces on atoms when their coordinates deviate from the equilibrium positions . Consequently , this formulation provides an important physical inductive bias for generating stable materials . In this work , we propose Crystal Diffusion Variational AutoEncoder ( CDVAE ) to generate stable materials by learning from the data distribution of known materials . Our main contributions include : • We curate 3 standard datasets from QM simulations and create a set of physically meaningful tasks and metrics for the problem of material generation . • We incorporate stability as an inductive bias by designing a noise conditional score network as the decoder of our VAE , which allows us to generate significantly more realistic materials . • We encode permutation , translation , rotation , and periodic invariances , as well as interactions crossing periodic boundaries with SE ( 3 ) equivariant GNNs adapted with periodicity . • Empirically , our model significantly outperforms past methods in tasks including reconstructing an input structure , generating valid , diverse , and realistic materials , and generating materials that optimize specific properties . 2 RELATED WORK . Material graph representation learning . Graph neural networks have made major impacts in material property prediction . They were first applied to the representation learning of periodic materials by Xie & Grossman ( 2018 ) and later enhanced by many studies including Schütt et al . ( 2018 ) ; Chen et al . ( 2019 ) . The Open Catalyst Project ( OCP ) provides a platform for comparing different architectures by predicting energies and forces from the periodic structure of catalytic surfaces ( Chanussot et al. , 2021 ) . Our encoder and decoder PGNNs directly use GNN architectures developed for the OCP ( Klicpera et al. , 2020b ; 2021 ; Shuaibi et al. , 2021 ; Godwin et al. , 2021 ) , which are also closely related to SE ( 3 ) equivariant networks ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ) . Quantum mechanical search of stable materials . GNN-based property prediction models are fundamentally limited by the space of ∼200k known materials . Predicting the structure of unknown materials requires very expensive random search and QM simulations , and is considered a grand challenge in materials discovery ( Oganov et al. , 2019 ) . State-of-the-art methods include random sampling ( Pickard & Needs , 2011 ) , evolutionary algorithms ( Wang et al. , 2012 ) , substituting elements in known materials ( Sun et al. , 2019 ) , etc. , but they generally have success rates less than 1 % and require extensive computation even on relatively small problems . Material generative models . Past material generative models mainly focus on two different approaches , and neither incorporate stability as an inductive bias . The first approach treats materials as 3D voxel images , but the process of decoding images back to atom types and coordinates often results in low validity , and the models are not rotationally invariant ( Hoffmann et al. , 2019 ; Noh et al. , 2019 ; Court et al. , 2020 ; Long et al. , 2021 ) . The second directly encodes atom coordinates , types , and lattices as vectors ( Ren et al. , 2020 ; Kim et al. , 2020 ; Zhao et al. , 2021 ) , but the models are generally not invariant to any Euclidean transformations . Another related method is to train a force field from QM forces and then apply the learned force field to generate stable materials by minimizing energy ( Deringer et al. , 2018 ) . This method is conceptually similar to our decoder , but it requires additional force data and can only be applied to 1-2 elements due to the exponentially increased data need for more elements . Remotely related works include generating contact maps from chemical compositions ( Hu et al. , 2021 ; Yang et al. , 2021 ) and building generative models only for compositions ( Sawada et al. , 2019 ; Pathak et al. , 2020 ; Dan et al. , 2020 ) . Molecular conformer generation and protein folding . Our decoder that generates the 3D atomic structures via a diffusion process is closely related to the diffusion models used for molecular conformer generation ( Shi et al. , 2021 ) . The key difference is that our model does not rely on intermediate representations like molecular graphs . G-SchNet ( Gebauer et al. , 2019 ) is more closely related to our method because it directly generates 3D molecules atom-by-atom without relying on a graph . Another closely related work is E-NFs ( Satorras et al. , 2021 ) that use a flow model to generate 3D molecules . In addition , score-based and energy-based models have also been used for molecular graph generation ( Liu et al. , 2021 ) and protein folding ( Wu et al. , 2021 ) . Flow models have also been used for molecular graph generation ( Shi et al. , 2020 ; Luo et al. , 2021 ) . However , these generative models do not incorporate periodicity , which makes them unsuitable for materials . 3 PRELIMINARIES . 3.1 PERIODIC STRUCTURE OF MATERIALS . Any material structure can be represented as the periodic arrangement of atoms in the 3D space . As illustrated in Figure 1 , we can always find a repeating unit , i.e . a unit cell , to describe the infinite periodic structure of a material . A unit cell that includes N atoms can be fully described by 3 sets : 1 ) atom types A = ( a0 , ... , aN ) ∈ AN , where A denotes the set of all chemical elements ; 2 ) atom coordinates X = ( x0 , ... , xN ) ∈ RN×3 ; and 3 ) periodic lattice L = ( l1 , l2 , l3 ) ∈ R3×3 . The periodic lattice defines the periodic translation symmetry of the material . Given M = ( A , X , L ) , the infinite periodic structure can be represented as , { ( a′i , x′i ) |a′i = ai , x′i = xi + k1l1 + k2l2 + k3l3 , k1 , k2 , k3 ∈ Z } , ( 1 ) where k1 , k2 , k3 are any integers that translate the unit cell using L to tile the entire 3D space . The composition of a material denotes the ratio of different elements that the material is composed of . Given the atom types of a material with N atoms A ∈ AN , the composition can be represented as c ∈ R|A| , where ci > 0 denotes the percentage of atom type i and ∑ i ci = 1 . For example , the composition of diamond in Figure 1 has c6 = 1 and ci = 0 for i 6= 6 because 6 is the atomic number of carbon . Invariances for materials . The structure of a material does not change under several invariances . 1 ) Permutation invariance . Exchanging the indices of any pair of atoms will not change the material . 2 ) Translation invariance . Translating the atom coordinates X by an arbitrary vector will not change the material . 3 ) Rotation invariance . Rotating X and L together by an arbitrary rotation matrix will not change the material . 4 ) Periodic invariance . There are infinite different ways of choosing unit cells with different shapes and sizes , e.g. , obtaining a bigger unit cell as an integer multiplier of a smaller unit cell using integer translations . The material will again not change given different choices of unit cells . Multi-graph representation for materials . Materials can be represented as a directed multi-graph G = { V , E } to encode the periodic structures following ( Xie & Grossman , 2018 ; Wells et al. , 1977 ; O ’ Keeffe & Hyde , 1980 ) , where V = { v1 , ... , vN } is the set of nodes representing atoms and E = { eij , ( k1 , k2 , k3 ) |i , j ∈ { 1 , ... , N } , k1 , k2 , k3 ∈ Z } is the set of edges representing bonds . eij , ( k1 , k2 , k3 ) denotes a directed edge from node i at the original unit cell to node j at the cell translated by k1l1 + k2l2 + k3l3 ( in Figure 1 right , ( k1 , k2 , k3 ) are labeled on top of edges ) . For materials , there is no unique way to define edges ( bonds ) and the edges are often computed using k-nearest neighbor ( KNN ) approaches under periodicity or more advanced methods such as CrystalNN ( Pan et al. , 2021 ) . Given this directed multi-graph , message-passing neural networks and SE ( 3 ) -equivariant networks can be used for the representation learning of materials .
The paper proposed a new generative model for 3D periodic material molecular structure. They designed a special variational autoencoder, where the decoder is parameterized by the denoising score-matching framework. Experiments demonstrate the model can successfully generate valid and realistic material, and optimize desired properties.
SP:5633fe1fee1abdd2a61bdd7679a771ce611f0f4e
LPRules: Rule Induction in Knowledge Graphs Using Linear Programming
1 INTRODUCTION . Knowledge graphs ( KG ) are used to represent a collection of known facts via labeled directed edges . Each node of the graph represents an entity , and a labeled directed edge from one node to another indicates that the pair of nodes satisfies a binary relation given by the edge label . A fact in the knowledge graph is a triplet of the form ( a , r , b ) where a and b are nodes , and r is a binary relation labeling a directed edge from a to b indicating that r ( a , b ) is true . Consider a KG where the nodes correspond to distinct cities , states , and countries and the relations are one of capital_of , shares_border_with , or part_of . A fact ( a , part_of , b ) in such a graph corresponds to a directed edge from a to b labeled by part_of implying that a is a part of b . Practical knowledge graphs are often incomplete ( they do not contain all true representable facts ) and noisy ( they can have inconsistencies or errors ) . Knowledge graph completion ( KGC ) , triple classification , entity recognition , and relation extraction are common tasks for extracting implied information from KGs . See Ji et al . ( 2021 ) for a recent survey on KGs . KGC involves using known facts in a KG to infer additional ( missing ) facts . One approach for KGC is to learn first-order logic rules that encode known facts . In the example above , we could learn a “ rule ” capital_of ( X , Y ) → part_of ( X , Y ) where X , Y are variables that take on entity values . Then if we find a pair of entities P , Q such that ( P , capital_of , Q ) is a fact in the graph , we could infer that ( P , part_of , Q ) is also true and augment the set of facts with this new fact if not originally present . A more complex rule of length two is capital_of ( X , Y ) and part_of ( Y , Z ) → part_of ( X , Z ) . Again , applying it to entities P and Q , if there exists a third entity R such that capital_of ( P , R ) is a fact in the graph , and so is part_of ( R , Q ) , then we infer that P is a part of Q. KG link prediction deals with finding answers to queries of the form part_of ( P , ? ) , and we focus on finding first-order logic rules of the type above for this task . Instead of learning one rule for a relation , it is common to learn a set of rules along with rule weights , where larger weights indicate more important or more certain rules . Dealing with uncertainty or noise is essential for KG reasoning . Learning logic rules is a well-studied area . In a paper ( Lao & Cohen , 2010 ) on path ranking algorithms and another ( Richardson & Domingos , 2006 ) on Markov logic networks , candidate logic rules are obtained via relational path enumeration , and then rule weights are calculated . Yang et al . ( 2017 ) use neural logic programming to simultaneously obtain sets of rules and the weights of individual rules . Qu et al . ( 2021 ) , separately find rules and rule weights , but add a feedback loop from the latter learning problem to the former . The use of recursive neural networks ( RNN ) to learn rules is common nowadays , though traditional rule-mining approaches remain popular ( Meilicke et al. , 2019 ) . Embedding-based methods for KGC consist of representing nodes by vectors , and relations by vector transformations that are consistent with the facts in the knowledge graph . They exhibit better scaling with KG size , and yield more accurate predictions . See the surveys by Ji et al . ( 2021 ) and Wang et al . ( 2017 ) . On the other hand , rule-based methods can yield more interpretable explanations of associated reasoning steps ( Qu & Tang , 2019 ) , especially if one obtains compact rule sets ( with few rules and few relations per rule ) . Furthermore , entity-independent rules are more generalizeable ( Teru et al. , 2020 ) and can be applied in an inductive setting : they can be applied to entities not considered in the learning process . Embedding-based methods work mostly in a transductive setting . We propose a novel approach to learning entity-independent , weighted first-order logic rules for knowledge graph reasoning . Our approach combines rule enumeration with linear programming ( LP ) , and completely avoids the solution of difficult nonconvex optimizaton models inherent in training RNNs . We describe a linear programming ( LP ) formulation with exponentially many variables corresponding to first-order rules and associated weights . Nonzero variable values correspond to chosen rules and their weights . We deal with the exponential number of variables/rules by column generation ideas from linear optimization , where we start off with some small initial set of rules and associated variables , find the best subset of these and associated weights via the partial LP defined on the initial set of rules , and then generate new rules which can best augment the existing set of rules . Our final output rule-based scoring functions resemble those in NeuralLP ( Yang et al. , 2017 ) , DRUM ( Sadeghian et al. , 2019 ) , and RNNLogic ( Qu et al. , 2021 ) in that we form a linear combination of rule scores ( calculated differently from the above papers ) . As in RNNLogic , our iterative process of adding new rules is influenced by previous rules . Our algorithm has better scaling with KG size than a many existing rule-based methods . In addition , we obtain state-of-the-art results on three out of four standard KG datasets while taking significantly less running time than some competing codes . Furthermore , we are able to obtain results of reasonable quality – when compared to embedding-based methods – on YAGO3-10 , a large dataset which is difficult for existing rule-based methods . As an important goal of rule-based methods is to obtain interpretable solutions , we promote interpretability by adding a constraint in our LP formulation limiting the complexity of the chosen rule set ( and this hyperparameter is tuned per dataset ) . In some cases , we obtain more accurate results ( higher MRR ) for the same level of complexity as other codes , and less complex rules for the same level of accuracy in other cases . 2 RELATED WORK . 2.1 RULE-BASED METHODS . There is a rich body of literature on rule-based methods for knowledge graph reasoning . The motivation for learning rules is that they form an explicit symbolic representation of existing knowledge and are amenable to inspection and verification . Further , compact rule sets are interpretable , an efficient way to store knowledge , and useful for transfer learning . For KG applications , when rules are entity-independent , they can be used in an inductive setting ( Yang et al . ( 2017 ) , Teru et al . ( 2020 ) ) . Inductive Logic Programming ( ILP ) . In this approach , one takes as input positive and negative examples and learns logic programs that entail all positive examples and none of the negative examples . See for example Cropper & Muggleton ( 2016 ) and Cropper & Morel ( 2020 ) . First-order Logic ( FOL ) programs in the form of a collection of chain-like Horn clauses are a popular output format . Negative examples are not available in typical knowledge graphs , and some of the positive examples can be mutually inconsistent . Evans & Grefenstette ( 2018 ) developed a differential ILP framework to generate rules for noisy data . Statistical Relational Learning ( SRL ) . SRL aims to learn FOL formulas from data and to quantify their uncertainty . Markov logic , which is a probabilistic extension of FOL , is a popular framework for SRL . In this framework , one learns a set of weighted FOL formulas ; see , for example , Kok & Domingos ( 2005 ) where beam search is used to find a set of FOL rules , and rule weights are learned via standard numerical methods . In knowledge graph reasoning , chain-like rules which correspond to relational paths ( and to chain-like Horn clauses ) are widely studied . In Lao & Cohen ( 2010 ) , a weighted linear combination of rule-based functions ( e.g. , the function could return a probability that the rule implies a link between a pair of entities ) is used as a scoring function for KG link completion . An initial set of rules is created and the weights are obtained via regression . A recent , bottom-up rule-learning algorithm with excellent predictive performance is AnyBURL ( Meilicke et al. , 2019 ) . We learn FOL rules corresponding to relational paths and rule weights ; our scoring function , and learning model/algorithm are different from prior work . The column generation aspect of our work has similarities to cutting plane inference methods ( Riedel , 2008 ; Noessner et al. , 2013 ) for MAP inference in SRL . While we deal with an exponential number of possible rules/Horn clauses via column generation , the above papers use constraint generation/cutting plane ideas to deal with an exponential number of constraints corresponding to ground clauses . Neuro-symbolic methods . In NeuralLP ( Yang et al. , 2017 ) , rules and rule weights are learned simultaneously by training an appropriate RNN . Further improvements in this paradigm can be found in DRUM ( Sadeghian et al . ( 2019 ) ) . Another neuro-symbolic approach is implemented in the Neural Theorem Prover ( NTP , Rochstätel & Riedel ( 2017 ) ) . More general rules ( than the chain-like rules found in NeuralLP ) are obtained in NLIL ( Yang & Song ) along with better scaling behavior . Simultaneously solving for rules and rule-weights is difficult , and a natural question is how well the associated optimization problem can be solved , and how scalable such methods are . We use an easier-to-solve LP formulation . Hybrid methods . In RNNLogic ( Qu et al. , 2021 ) , the rules are generated using an RNN , and rule weights are later calculated via a probabilistic model . Such a separation of rule generation and weight calculation can be found in earlier work ( e.g. , Kok & Domingos ( 2005 ) ) , but in RNNLogic new rule generation is influenced by the calculated weights of previously generated rules . Our column generation method and AnyBURL have the same property . Reinforcement Learning . Recent attempts to use reinforcement learning ( RL ) to search for rules can be found in MINERVA ( Das et al. , 2018 ) , MultiHopKG ( Lin et al. , 2018 ) , M-Walk ( Shen et al. , 2018 ) and DeepPath ( Xiong et al. , 2017 ) . The first three papers use RL to explore relational paths conditioned on a specific query , and use RNNs to encode and construct a graph-walking agent . Rule types/Rule combinations . AnyBURL generates rules corresponding to different types of paths ( acyclic or cyclic , in their notation ) which may be entity-dependent or independent . As mentioned before , NLIL goes beyond simple chain-like rules . Recently Teru et al . ( 2020 ) use subgraphs to perform reasoning , and not just paths . We generate weighted , entity-independent , chain-like rules as in NeuralLP . Our scoring function combines rule scores via a linear combination . For a rule r and a pair of entities a , b , the rule score is just 1 if there exists a relational path from a to b following the rule r and 0 otherwise . We use rule weights as a measure of importance but they are not probabilities . For Neural LP , DRUM , RNNLogic and other comparable codes , the scoring functions depend on the set of paths from a to b associated with r. Finally , AnyBURL uses maximum confidence scores rather than sums of confidence scores ; further , its scoring function returns a vector of sorted scores , and two score vectors are compared lexicographically . Scalability/Compact Rule sets . As noted above , many recent papers use RNNs in the process of finding chain-like rules and this can lead to expensive computation times . On the other hand , bottom-up rule-learners such as AnyBURL are much faster . The main focus of our work is obtaining compact rule sets for the sake of interpretability while maintaining scalability via LP models and column generation . We impose explicit constraints to maintain compactness , and these constraints influence new rule generation . The new rules must perform well with previously generated/selected rules . NeuralLP , for example , usually returns compact rule sets while AnyBURL returns a very large number of rules ( and does not prune discovered rules for interpretability ) , and RNNLogic is somewhere in between ( though the number of output rules can be controlled ) .
The paper presents a method to obtain weights for a knowledge graph scoring model for link prediction. There are numerous good algorithms for mining rules from knowledge graphs (e.g. AnyBURL and AMIE). Less research has focused on the problem of creating scoring functions based on an (implicit) list of rules. This is what the present paper proposes. The core idea is to formulate a linear program whose solution corresponds to a scoring method. Instead of incorporating all rules (there are typically many!) into the LP formulation, the authors propose a column generation approach.
SP:5cf0b8f16bda52b90c78f312effd934f828e3bab
LPRules: Rule Induction in Knowledge Graphs Using Linear Programming
1 INTRODUCTION . Knowledge graphs ( KG ) are used to represent a collection of known facts via labeled directed edges . Each node of the graph represents an entity , and a labeled directed edge from one node to another indicates that the pair of nodes satisfies a binary relation given by the edge label . A fact in the knowledge graph is a triplet of the form ( a , r , b ) where a and b are nodes , and r is a binary relation labeling a directed edge from a to b indicating that r ( a , b ) is true . Consider a KG where the nodes correspond to distinct cities , states , and countries and the relations are one of capital_of , shares_border_with , or part_of . A fact ( a , part_of , b ) in such a graph corresponds to a directed edge from a to b labeled by part_of implying that a is a part of b . Practical knowledge graphs are often incomplete ( they do not contain all true representable facts ) and noisy ( they can have inconsistencies or errors ) . Knowledge graph completion ( KGC ) , triple classification , entity recognition , and relation extraction are common tasks for extracting implied information from KGs . See Ji et al . ( 2021 ) for a recent survey on KGs . KGC involves using known facts in a KG to infer additional ( missing ) facts . One approach for KGC is to learn first-order logic rules that encode known facts . In the example above , we could learn a “ rule ” capital_of ( X , Y ) → part_of ( X , Y ) where X , Y are variables that take on entity values . Then if we find a pair of entities P , Q such that ( P , capital_of , Q ) is a fact in the graph , we could infer that ( P , part_of , Q ) is also true and augment the set of facts with this new fact if not originally present . A more complex rule of length two is capital_of ( X , Y ) and part_of ( Y , Z ) → part_of ( X , Z ) . Again , applying it to entities P and Q , if there exists a third entity R such that capital_of ( P , R ) is a fact in the graph , and so is part_of ( R , Q ) , then we infer that P is a part of Q. KG link prediction deals with finding answers to queries of the form part_of ( P , ? ) , and we focus on finding first-order logic rules of the type above for this task . Instead of learning one rule for a relation , it is common to learn a set of rules along with rule weights , where larger weights indicate more important or more certain rules . Dealing with uncertainty or noise is essential for KG reasoning . Learning logic rules is a well-studied area . In a paper ( Lao & Cohen , 2010 ) on path ranking algorithms and another ( Richardson & Domingos , 2006 ) on Markov logic networks , candidate logic rules are obtained via relational path enumeration , and then rule weights are calculated . Yang et al . ( 2017 ) use neural logic programming to simultaneously obtain sets of rules and the weights of individual rules . Qu et al . ( 2021 ) , separately find rules and rule weights , but add a feedback loop from the latter learning problem to the former . The use of recursive neural networks ( RNN ) to learn rules is common nowadays , though traditional rule-mining approaches remain popular ( Meilicke et al. , 2019 ) . Embedding-based methods for KGC consist of representing nodes by vectors , and relations by vector transformations that are consistent with the facts in the knowledge graph . They exhibit better scaling with KG size , and yield more accurate predictions . See the surveys by Ji et al . ( 2021 ) and Wang et al . ( 2017 ) . On the other hand , rule-based methods can yield more interpretable explanations of associated reasoning steps ( Qu & Tang , 2019 ) , especially if one obtains compact rule sets ( with few rules and few relations per rule ) . Furthermore , entity-independent rules are more generalizeable ( Teru et al. , 2020 ) and can be applied in an inductive setting : they can be applied to entities not considered in the learning process . Embedding-based methods work mostly in a transductive setting . We propose a novel approach to learning entity-independent , weighted first-order logic rules for knowledge graph reasoning . Our approach combines rule enumeration with linear programming ( LP ) , and completely avoids the solution of difficult nonconvex optimizaton models inherent in training RNNs . We describe a linear programming ( LP ) formulation with exponentially many variables corresponding to first-order rules and associated weights . Nonzero variable values correspond to chosen rules and their weights . We deal with the exponential number of variables/rules by column generation ideas from linear optimization , where we start off with some small initial set of rules and associated variables , find the best subset of these and associated weights via the partial LP defined on the initial set of rules , and then generate new rules which can best augment the existing set of rules . Our final output rule-based scoring functions resemble those in NeuralLP ( Yang et al. , 2017 ) , DRUM ( Sadeghian et al. , 2019 ) , and RNNLogic ( Qu et al. , 2021 ) in that we form a linear combination of rule scores ( calculated differently from the above papers ) . As in RNNLogic , our iterative process of adding new rules is influenced by previous rules . Our algorithm has better scaling with KG size than a many existing rule-based methods . In addition , we obtain state-of-the-art results on three out of four standard KG datasets while taking significantly less running time than some competing codes . Furthermore , we are able to obtain results of reasonable quality – when compared to embedding-based methods – on YAGO3-10 , a large dataset which is difficult for existing rule-based methods . As an important goal of rule-based methods is to obtain interpretable solutions , we promote interpretability by adding a constraint in our LP formulation limiting the complexity of the chosen rule set ( and this hyperparameter is tuned per dataset ) . In some cases , we obtain more accurate results ( higher MRR ) for the same level of complexity as other codes , and less complex rules for the same level of accuracy in other cases . 2 RELATED WORK . 2.1 RULE-BASED METHODS . There is a rich body of literature on rule-based methods for knowledge graph reasoning . The motivation for learning rules is that they form an explicit symbolic representation of existing knowledge and are amenable to inspection and verification . Further , compact rule sets are interpretable , an efficient way to store knowledge , and useful for transfer learning . For KG applications , when rules are entity-independent , they can be used in an inductive setting ( Yang et al . ( 2017 ) , Teru et al . ( 2020 ) ) . Inductive Logic Programming ( ILP ) . In this approach , one takes as input positive and negative examples and learns logic programs that entail all positive examples and none of the negative examples . See for example Cropper & Muggleton ( 2016 ) and Cropper & Morel ( 2020 ) . First-order Logic ( FOL ) programs in the form of a collection of chain-like Horn clauses are a popular output format . Negative examples are not available in typical knowledge graphs , and some of the positive examples can be mutually inconsistent . Evans & Grefenstette ( 2018 ) developed a differential ILP framework to generate rules for noisy data . Statistical Relational Learning ( SRL ) . SRL aims to learn FOL formulas from data and to quantify their uncertainty . Markov logic , which is a probabilistic extension of FOL , is a popular framework for SRL . In this framework , one learns a set of weighted FOL formulas ; see , for example , Kok & Domingos ( 2005 ) where beam search is used to find a set of FOL rules , and rule weights are learned via standard numerical methods . In knowledge graph reasoning , chain-like rules which correspond to relational paths ( and to chain-like Horn clauses ) are widely studied . In Lao & Cohen ( 2010 ) , a weighted linear combination of rule-based functions ( e.g. , the function could return a probability that the rule implies a link between a pair of entities ) is used as a scoring function for KG link completion . An initial set of rules is created and the weights are obtained via regression . A recent , bottom-up rule-learning algorithm with excellent predictive performance is AnyBURL ( Meilicke et al. , 2019 ) . We learn FOL rules corresponding to relational paths and rule weights ; our scoring function , and learning model/algorithm are different from prior work . The column generation aspect of our work has similarities to cutting plane inference methods ( Riedel , 2008 ; Noessner et al. , 2013 ) for MAP inference in SRL . While we deal with an exponential number of possible rules/Horn clauses via column generation , the above papers use constraint generation/cutting plane ideas to deal with an exponential number of constraints corresponding to ground clauses . Neuro-symbolic methods . In NeuralLP ( Yang et al. , 2017 ) , rules and rule weights are learned simultaneously by training an appropriate RNN . Further improvements in this paradigm can be found in DRUM ( Sadeghian et al . ( 2019 ) ) . Another neuro-symbolic approach is implemented in the Neural Theorem Prover ( NTP , Rochstätel & Riedel ( 2017 ) ) . More general rules ( than the chain-like rules found in NeuralLP ) are obtained in NLIL ( Yang & Song ) along with better scaling behavior . Simultaneously solving for rules and rule-weights is difficult , and a natural question is how well the associated optimization problem can be solved , and how scalable such methods are . We use an easier-to-solve LP formulation . Hybrid methods . In RNNLogic ( Qu et al. , 2021 ) , the rules are generated using an RNN , and rule weights are later calculated via a probabilistic model . Such a separation of rule generation and weight calculation can be found in earlier work ( e.g. , Kok & Domingos ( 2005 ) ) , but in RNNLogic new rule generation is influenced by the calculated weights of previously generated rules . Our column generation method and AnyBURL have the same property . Reinforcement Learning . Recent attempts to use reinforcement learning ( RL ) to search for rules can be found in MINERVA ( Das et al. , 2018 ) , MultiHopKG ( Lin et al. , 2018 ) , M-Walk ( Shen et al. , 2018 ) and DeepPath ( Xiong et al. , 2017 ) . The first three papers use RL to explore relational paths conditioned on a specific query , and use RNNs to encode and construct a graph-walking agent . Rule types/Rule combinations . AnyBURL generates rules corresponding to different types of paths ( acyclic or cyclic , in their notation ) which may be entity-dependent or independent . As mentioned before , NLIL goes beyond simple chain-like rules . Recently Teru et al . ( 2020 ) use subgraphs to perform reasoning , and not just paths . We generate weighted , entity-independent , chain-like rules as in NeuralLP . Our scoring function combines rule scores via a linear combination . For a rule r and a pair of entities a , b , the rule score is just 1 if there exists a relational path from a to b following the rule r and 0 otherwise . We use rule weights as a measure of importance but they are not probabilities . For Neural LP , DRUM , RNNLogic and other comparable codes , the scoring functions depend on the set of paths from a to b associated with r. Finally , AnyBURL uses maximum confidence scores rather than sums of confidence scores ; further , its scoring function returns a vector of sorted scores , and two score vectors are compared lexicographically . Scalability/Compact Rule sets . As noted above , many recent papers use RNNs in the process of finding chain-like rules and this can lead to expensive computation times . On the other hand , bottom-up rule-learners such as AnyBURL are much faster . The main focus of our work is obtaining compact rule sets for the sake of interpretability while maintaining scalability via LP models and column generation . We impose explicit constraints to maintain compactness , and these constraints influence new rule generation . The new rules must perform well with previously generated/selected rules . NeuralLP , for example , usually returns compact rule sets while AnyBURL returns a very large number of rules ( and does not prune discovered rules for interpretability ) , and RNNLogic is somewhere in between ( though the number of output rules can be controlled ) .
This paper proposed a simple linear programming model for learning logical rules for KG completion. The model selects candidate rules from KG with explicit constraints and then solves a linear programming problem. The authors conduct experiments on several public datasets and the model has better efficiency than baseline models.
SP:5cf0b8f16bda52b90c78f312effd934f828e3bab
Distributional Decision Transformer for Hindsight Information Matching
1 INTRODUCTION . Reinforcement learning ( RL ) suffers from the problem of sample inefficiency , and a central question is how to extract as much learning signals , or constraint equations ( Pong et al. , 2018 ; Tu & Recht , 2019 ; Dean et al. , 2020 ) , from each trajectory data as possible . As dynamics transitions and Bellman equation provide a rich source of supervisory objectives and constraints , many algorithms combined model-free with model-based , and policy-based with value-based in order to achieve maximal sample efficiency , while approximately preserving stable , unbiased policy learning ( Heess et al. , 2015 ; Gu et al. , 2016 ; 2017 ; Buckman et al. , 2018 ; Pong et al. , 2018 ; Tu & Recht , 2019 ) . Orthogonal to these , in the recent years we have seen a number of algorithms that are derived from different motivations and frameworks , but share the following common trait : they use future trajectory information τt : T to accelerate optimization of a contextual policy π ( at|st , z ) with context z with respect to a parameterized reward function r ( st , at , z ) ( see Section 3 for notations ) . These hindsight algorithms have enabled Q-learning with sparse rewards ( Andrychowicz et al. , 2017 ) , temporally-extended model-based RL with Q-function ( Pong et al. , 2018 ) , mastery of 6-DoF object manipulation in cluttered scenes from human play ( Lynch et al. , 2019 ) , efficient multi-task RL ( Eysenbach et al. , 2020 ; Li et al. , 2020 ) , offline self-supervised discovery of manipulation primitives from pixels ( Chebotar et al. , 2021 ) , and offline RL using return-conditioned supervised learning with transformers ( Chen et al. , 2021a ; Janner et al. , 2021 ) . We derive a generic problem formulation covering all these variants , and observe that this hindsight information matching ( HIM ) framework , with behavioral cloning ( BC ) as the learning objective , can learn a conditional policy to generate trajectories that each satisfy any properties , including distributional . Given this insight and recent casting of RL as sequence modeling ( Chen et al. , 2021a ; Janner et al. , 2021 ) , we propose Generalized Decision Transformer ( GDT ) , a family of algorithms for future information matching using hindsight behavioral cloning with transformers , and greatly expand the applicability of transformers and other powerful sequential modeling architectures within RL with only small architectural changes to DT . In summary , our key contributions are : • We introduce hindsight information matching ( HIM ) ( Section 4 , Table 1 ) as a unifying view of existing hindsight-inspired algorithms , and Generalized Decision Transformers ( GDT ) as a generalization of DT for RL as sequence modeling to solve any HIM problem ( Figure 1 ) . • Inspired by distribution RL ( Bellemare et al. , 2017 ; Dabney et al. , 2018 ) and state-marginal matching ( SMM ) ( Lee et al. , 2020 ; Ghasemipour et al. , 2020 ; Gu et al. , 2021 ) , we define offline multi-task SMM problems , propose Categorical DT ( CDT ) ( Section 5 ) , validate its empirical performance to match feature distributions ( even generalizing to a synthetic bi-modal target distribution at times ) , and construct the first benchmark tasks for offline multi-task SMM . • Inspired by one-shot imitation learning ( Duan et al. , 2017 ; Finn et al. , 2017 ; Dasari & Gupta , 2020 ) , we define offline multi-task imitation learning ( IL ) , propose a Wasserstein-distance evaluation metric , develop Bi-directional DT ( BDT ) as a fully expressive variant of GDT ( Section 5 ) , and demonstrate BDT ’ s competitive performance at offline multi-task IL . 2 RELATED WORK . Hindsight Reinforcement Learning and Behavior Cloning Hindsight techniques ( Kaelbling , 1993 ; Andrychowicz et al. , 2017 ; Pong et al. , 2018 ) have revolutionized off-policy optimization with respect to parameterized reward functions . Two key insights were ( 1 ) for off-policy algorithms such as Q-learning ( Mnih et al. , 2015 ; Gu et al. , 2016 ) and actor-critic methods ( Lillicrap et al. , 2016 ; Haarnoja et al. , 2018 ; Fujimoto et al. , 2018 ; Furuta et al. , 2021a ) , the same transition samples can be used to learn with respect to any reward parameters , as long as the reward function is re-computable , i.e . “ relabel ” -able , like goal reaching rewards , and ( 2 ) if policy or Q-functions are smooth with respect to the reward parameter , generalization can speed up learning even with respect to “ unexplored ” rewards . In goal-based RL where future states can inform “ optimal ” reward parameters with respect to the transitions ’ actions , hindsight methods were applied successfully to enable effective training of goal-based Q-function for sparse rewards ( Andrychowicz et al. , 2017 ) , derive exact connections between Q-learning and classic model-based RL ( Pong et al. , 2018 ) , dataefficient off-policy hierarchical RL ( Nachum et al. , 2018 ) , multi-task RL ( Eysenbach et al. , 2020 ; Li et al. , 2020 ) , offline RL ( Chebotar et al. , 2021 ) , and more ( Eysenbach et al. , 2021 ; Choi et al. , 2021 ; Ren et al. , 2019 ; Zhao & Tresp , 2018 ; Ghosh et al. , 2021 ; Nasiriany et al. , 2021 ) . Additionally , Lynch et al . ( 2019 ) and Gupta et al . ( 2018 ) have shown that often BC is sufficient for learning generalizable parameterized policies , due to rich positive examples from future states , and most recently Chen et al . ( 2021a ) and Janner et al . ( 2021 ) , when combined with powerful transformer architectures ( Vaswani et al. , 2017 ) , it produced state-of-the-art offline RL and goal-based RL results . Lastly , while motivated from alternative mathematical principles and not for parameterized objectives , future state information was also explored as ways of reducing variance or improving estimations for generic policy gradient methods ( Pinto et al. , 2017 ; Guo et al. , 2021 ; Venuto et al. , 2021 ) . Distributional Reinforcement Learning and State-Marginal Matching Modeling the full distribution of returns instead of the averages led to the development of distributional RL algorithms ( Bellemare et al. , 2017 ; Dabney et al. , 2018 ; 2020 ; Castro et al. , 2018 ; Barth-Maron et al. , 2018 ) such as Categorical Q-learning ( Bellemare et al. , 2017 ) . While our work shares techniques such as discretization and binning , these works focus on optimizing a non-conditional reward-maximizing RL policy and therefore our problem definition is closer to that of state-marginal matching algorithms ( Hazan et al. , 2019 ; Lee et al. , 2020 ; Ghasemipour et al. , 2020 ; Gu et al. , 2021 ) , or equivalently inverse RL algorithms ( Ziebart et al. , 2008 ; Ho & Ermon , 2016 ; Finn et al. , 2016 ; Fu et al. , 2018 ; Ghasemipour et al. , 2020 ) whose connections to feature-expectation matching have been long discussed ( Abbeel & Ng , 2004 ) . However , those are often exclusively online algorithms even sample-efficient variants ( Kostrikov et al. , 2019 ) , since density-ratio estimations with either discriminative ( Ghasemipour et al. , 2020 ) or generative ( Lee et al. , 2020 ) approach requires on-policy samples , with a rare exception of Kostrikov et al . ( 2020 ) . Building on the success of DT and brute-force hindsight imitation learning , our Categorical DT is to the best our knowledge the first method that benchmarks offline state-marginal matching problem in the multi-task settings . RL and Imitation Learning as Sequence Modeling When scaled to the extreme levels of data and computing , sequence models such as transformers ( Vaswani et al. , 2017 ) can train models to master an impressive range of capabilities in natural language processing and computer vision ( Devlin et al. , 2019 ; Radford et al. , 2019 ; Brown et al. , 2020 ; Radford et al. , 2021 ; Ramesh et al. , 2021 ; Chen et al. , 2021b ; Bommasani et al. , 2021 ; Dosovitskiy et al. , 2020 ) . Comparing to their popularity in other areas , the adoption of transformers or architectural innovations in RL have been slow , partially due the difficulty of using transformers over temporal scales for online RL ( Parisotto et al. , 2020 ) . Recent successes have focused on processing variable-length per-timestep information such as morphology ( Kurin et al. , 2021 ) , sensory information ( Tang & Ha , 2021 ) , one-shot or few-shot imitation learning ( Dasari & Gupta , 2020 ) , or leveraged offline learning ( Chen et al. , 2021a ; Janner et al. , 2021 ) . Our formulation enables sequence modeling to solve novel RL problems such as statemarginal matching with minimal architectural modifications to DT , greatly expanding the impacts of transformers and other powerful sequence models in RL . 3 PRELIMINARIES . We consider a Markov Decision Process ( MDP ) defined by the tuple of action space A , state space S , transition probability function p ( s′|s , a ) , initial state distribution p ( s0 ) , reward function r ( s , a ) , and discount factor γ ∈ ( 0 , 1 ] . In deep RL , a policy that maps the state space to the action space is parameterized by the function approximators , πθ ( a|s ) 1 . The RL objective is given by : LRL ( π ) = 1 1− γ Es∼ρπ ( s ) , a∼π ( ·|s ) [ r ( s , a ) ] ( 1 ) where pπt ( s ) = ∫∫ s0 : t , a0 : t−1 ∏ t p ( st|st−1 , at−1 ) π ( at|st ) and ρπ ( s ) = ( 1 − γ ) ∑ t′ γ t′pπt′ ( st′ = s ) are short-hands for time-aligned and time-aggregated state marginal distributions following policy π . 1For simplicity of notations , we write Markovian policies ; however , such notations can easily apply to non-Markov policies such as Decision Transformer ( Chen et al. , 2021a ) by converting to an augmented MDP consisting of past N states , where N is the context window of DT . 3.1 STATE MARGINAL MATCHING . State marginal matching ( SMM ) ( Lee et al. , 2020 ; Hazan et al. , 2019 ; Ghasemipour et al. , 2020 ) has been recently studied as an alternative problem specification in RL , where instead of stationary-reward maximization , the objective is to find a policy minimizing the divergenceD between its state marginal distribution ρπ ( s ) to a given target distribution p∗ ( s ) 2 : LSMM ( π ) = −D ( ρπ ( s ) , p∗ ( s ) ) ( 2 ) where D is a divergence measure such as Kullback-Leibler ( KL ) divergence ( Lee et al. , 2020 ; Fu et al. , 2018 ) or , more generally , some f -divergences ( Ghasemipour et al. , 2020 ) . For the target distribution p∗ ( s ) , Lee et al . ( 2020 ) set a uniform distribution to enhance the exploration over the entire state space ; Ghasemipour et al . ( 2020 ) and Gu et al . ( 2021 ) set through scripted distribution sketches to generate desired behaviors ; and adversarial inverse RL methods ( Ho & Ermon , 2016 ; Fu et al. , 2018 ; Ghasemipour et al. , 2020 ; Kostrikov et al. , 2020 ) set as the expert data for imitation learning . Notably , unlike the RL objective in Eq.1 , SMM objectives like Eq.2 no longer depend on task rewards and are only functions of state transition dynamics and target state distribution .
The paper proposes an extension of Decision Transformer (DT) that can work with distributions of features. A number of prior hindsight-based or context-dependent methods are shown to be special cases of a generic scheme called Hindsight Information Matching (HIM), where arbitrary statistics of future trajectories can be used for conditioning. Therefore, the proposed Distributional Decision Transformer (DDT) can be seen as a practical implementation of the HIM algorithm. Experiments on D4RL medium-expert data for HalfCheetah, Hopper, and Walker2D investigate generalization of DDT. Additionally, another extension of DT called Unsupervised Decision Transformer (UDT) is proposed and evaluated that learns the features and rewards in unsupervised manner.
SP:9318b2155b674b593441ffbb97b56c7ce57cb39a
Distributional Decision Transformer for Hindsight Information Matching
1 INTRODUCTION . Reinforcement learning ( RL ) suffers from the problem of sample inefficiency , and a central question is how to extract as much learning signals , or constraint equations ( Pong et al. , 2018 ; Tu & Recht , 2019 ; Dean et al. , 2020 ) , from each trajectory data as possible . As dynamics transitions and Bellman equation provide a rich source of supervisory objectives and constraints , many algorithms combined model-free with model-based , and policy-based with value-based in order to achieve maximal sample efficiency , while approximately preserving stable , unbiased policy learning ( Heess et al. , 2015 ; Gu et al. , 2016 ; 2017 ; Buckman et al. , 2018 ; Pong et al. , 2018 ; Tu & Recht , 2019 ) . Orthogonal to these , in the recent years we have seen a number of algorithms that are derived from different motivations and frameworks , but share the following common trait : they use future trajectory information τt : T to accelerate optimization of a contextual policy π ( at|st , z ) with context z with respect to a parameterized reward function r ( st , at , z ) ( see Section 3 for notations ) . These hindsight algorithms have enabled Q-learning with sparse rewards ( Andrychowicz et al. , 2017 ) , temporally-extended model-based RL with Q-function ( Pong et al. , 2018 ) , mastery of 6-DoF object manipulation in cluttered scenes from human play ( Lynch et al. , 2019 ) , efficient multi-task RL ( Eysenbach et al. , 2020 ; Li et al. , 2020 ) , offline self-supervised discovery of manipulation primitives from pixels ( Chebotar et al. , 2021 ) , and offline RL using return-conditioned supervised learning with transformers ( Chen et al. , 2021a ; Janner et al. , 2021 ) . We derive a generic problem formulation covering all these variants , and observe that this hindsight information matching ( HIM ) framework , with behavioral cloning ( BC ) as the learning objective , can learn a conditional policy to generate trajectories that each satisfy any properties , including distributional . Given this insight and recent casting of RL as sequence modeling ( Chen et al. , 2021a ; Janner et al. , 2021 ) , we propose Generalized Decision Transformer ( GDT ) , a family of algorithms for future information matching using hindsight behavioral cloning with transformers , and greatly expand the applicability of transformers and other powerful sequential modeling architectures within RL with only small architectural changes to DT . In summary , our key contributions are : • We introduce hindsight information matching ( HIM ) ( Section 4 , Table 1 ) as a unifying view of existing hindsight-inspired algorithms , and Generalized Decision Transformers ( GDT ) as a generalization of DT for RL as sequence modeling to solve any HIM problem ( Figure 1 ) . • Inspired by distribution RL ( Bellemare et al. , 2017 ; Dabney et al. , 2018 ) and state-marginal matching ( SMM ) ( Lee et al. , 2020 ; Ghasemipour et al. , 2020 ; Gu et al. , 2021 ) , we define offline multi-task SMM problems , propose Categorical DT ( CDT ) ( Section 5 ) , validate its empirical performance to match feature distributions ( even generalizing to a synthetic bi-modal target distribution at times ) , and construct the first benchmark tasks for offline multi-task SMM . • Inspired by one-shot imitation learning ( Duan et al. , 2017 ; Finn et al. , 2017 ; Dasari & Gupta , 2020 ) , we define offline multi-task imitation learning ( IL ) , propose a Wasserstein-distance evaluation metric , develop Bi-directional DT ( BDT ) as a fully expressive variant of GDT ( Section 5 ) , and demonstrate BDT ’ s competitive performance at offline multi-task IL . 2 RELATED WORK . Hindsight Reinforcement Learning and Behavior Cloning Hindsight techniques ( Kaelbling , 1993 ; Andrychowicz et al. , 2017 ; Pong et al. , 2018 ) have revolutionized off-policy optimization with respect to parameterized reward functions . Two key insights were ( 1 ) for off-policy algorithms such as Q-learning ( Mnih et al. , 2015 ; Gu et al. , 2016 ) and actor-critic methods ( Lillicrap et al. , 2016 ; Haarnoja et al. , 2018 ; Fujimoto et al. , 2018 ; Furuta et al. , 2021a ) , the same transition samples can be used to learn with respect to any reward parameters , as long as the reward function is re-computable , i.e . “ relabel ” -able , like goal reaching rewards , and ( 2 ) if policy or Q-functions are smooth with respect to the reward parameter , generalization can speed up learning even with respect to “ unexplored ” rewards . In goal-based RL where future states can inform “ optimal ” reward parameters with respect to the transitions ’ actions , hindsight methods were applied successfully to enable effective training of goal-based Q-function for sparse rewards ( Andrychowicz et al. , 2017 ) , derive exact connections between Q-learning and classic model-based RL ( Pong et al. , 2018 ) , dataefficient off-policy hierarchical RL ( Nachum et al. , 2018 ) , multi-task RL ( Eysenbach et al. , 2020 ; Li et al. , 2020 ) , offline RL ( Chebotar et al. , 2021 ) , and more ( Eysenbach et al. , 2021 ; Choi et al. , 2021 ; Ren et al. , 2019 ; Zhao & Tresp , 2018 ; Ghosh et al. , 2021 ; Nasiriany et al. , 2021 ) . Additionally , Lynch et al . ( 2019 ) and Gupta et al . ( 2018 ) have shown that often BC is sufficient for learning generalizable parameterized policies , due to rich positive examples from future states , and most recently Chen et al . ( 2021a ) and Janner et al . ( 2021 ) , when combined with powerful transformer architectures ( Vaswani et al. , 2017 ) , it produced state-of-the-art offline RL and goal-based RL results . Lastly , while motivated from alternative mathematical principles and not for parameterized objectives , future state information was also explored as ways of reducing variance or improving estimations for generic policy gradient methods ( Pinto et al. , 2017 ; Guo et al. , 2021 ; Venuto et al. , 2021 ) . Distributional Reinforcement Learning and State-Marginal Matching Modeling the full distribution of returns instead of the averages led to the development of distributional RL algorithms ( Bellemare et al. , 2017 ; Dabney et al. , 2018 ; 2020 ; Castro et al. , 2018 ; Barth-Maron et al. , 2018 ) such as Categorical Q-learning ( Bellemare et al. , 2017 ) . While our work shares techniques such as discretization and binning , these works focus on optimizing a non-conditional reward-maximizing RL policy and therefore our problem definition is closer to that of state-marginal matching algorithms ( Hazan et al. , 2019 ; Lee et al. , 2020 ; Ghasemipour et al. , 2020 ; Gu et al. , 2021 ) , or equivalently inverse RL algorithms ( Ziebart et al. , 2008 ; Ho & Ermon , 2016 ; Finn et al. , 2016 ; Fu et al. , 2018 ; Ghasemipour et al. , 2020 ) whose connections to feature-expectation matching have been long discussed ( Abbeel & Ng , 2004 ) . However , those are often exclusively online algorithms even sample-efficient variants ( Kostrikov et al. , 2019 ) , since density-ratio estimations with either discriminative ( Ghasemipour et al. , 2020 ) or generative ( Lee et al. , 2020 ) approach requires on-policy samples , with a rare exception of Kostrikov et al . ( 2020 ) . Building on the success of DT and brute-force hindsight imitation learning , our Categorical DT is to the best our knowledge the first method that benchmarks offline state-marginal matching problem in the multi-task settings . RL and Imitation Learning as Sequence Modeling When scaled to the extreme levels of data and computing , sequence models such as transformers ( Vaswani et al. , 2017 ) can train models to master an impressive range of capabilities in natural language processing and computer vision ( Devlin et al. , 2019 ; Radford et al. , 2019 ; Brown et al. , 2020 ; Radford et al. , 2021 ; Ramesh et al. , 2021 ; Chen et al. , 2021b ; Bommasani et al. , 2021 ; Dosovitskiy et al. , 2020 ) . Comparing to their popularity in other areas , the adoption of transformers or architectural innovations in RL have been slow , partially due the difficulty of using transformers over temporal scales for online RL ( Parisotto et al. , 2020 ) . Recent successes have focused on processing variable-length per-timestep information such as morphology ( Kurin et al. , 2021 ) , sensory information ( Tang & Ha , 2021 ) , one-shot or few-shot imitation learning ( Dasari & Gupta , 2020 ) , or leveraged offline learning ( Chen et al. , 2021a ; Janner et al. , 2021 ) . Our formulation enables sequence modeling to solve novel RL problems such as statemarginal matching with minimal architectural modifications to DT , greatly expanding the impacts of transformers and other powerful sequence models in RL . 3 PRELIMINARIES . We consider a Markov Decision Process ( MDP ) defined by the tuple of action space A , state space S , transition probability function p ( s′|s , a ) , initial state distribution p ( s0 ) , reward function r ( s , a ) , and discount factor γ ∈ ( 0 , 1 ] . In deep RL , a policy that maps the state space to the action space is parameterized by the function approximators , πθ ( a|s ) 1 . The RL objective is given by : LRL ( π ) = 1 1− γ Es∼ρπ ( s ) , a∼π ( ·|s ) [ r ( s , a ) ] ( 1 ) where pπt ( s ) = ∫∫ s0 : t , a0 : t−1 ∏ t p ( st|st−1 , at−1 ) π ( at|st ) and ρπ ( s ) = ( 1 − γ ) ∑ t′ γ t′pπt′ ( st′ = s ) are short-hands for time-aligned and time-aggregated state marginal distributions following policy π . 1For simplicity of notations , we write Markovian policies ; however , such notations can easily apply to non-Markov policies such as Decision Transformer ( Chen et al. , 2021a ) by converting to an augmented MDP consisting of past N states , where N is the context window of DT . 3.1 STATE MARGINAL MATCHING . State marginal matching ( SMM ) ( Lee et al. , 2020 ; Hazan et al. , 2019 ; Ghasemipour et al. , 2020 ) has been recently studied as an alternative problem specification in RL , where instead of stationary-reward maximization , the objective is to find a policy minimizing the divergenceD between its state marginal distribution ρπ ( s ) to a given target distribution p∗ ( s ) 2 : LSMM ( π ) = −D ( ρπ ( s ) , p∗ ( s ) ) ( 2 ) where D is a divergence measure such as Kullback-Leibler ( KL ) divergence ( Lee et al. , 2020 ; Fu et al. , 2018 ) or , more generally , some f -divergences ( Ghasemipour et al. , 2020 ) . For the target distribution p∗ ( s ) , Lee et al . ( 2020 ) set a uniform distribution to enhance the exploration over the entire state space ; Ghasemipour et al . ( 2020 ) and Gu et al . ( 2021 ) set through scripted distribution sketches to generate desired behaviors ; and adversarial inverse RL methods ( Ho & Ermon , 2016 ; Fu et al. , 2018 ; Ghasemipour et al. , 2020 ; Kostrikov et al. , 2020 ) set as the expert data for imitation learning . Notably , unlike the RL objective in Eq.1 , SMM objectives like Eq.2 no longer depend on task rewards and are only functions of state transition dynamics and target state distribution .
This work discusses many prior methods under a Hindsight Information Matching (HIM) framework, where the methods can be interpreted as trying to minimizing the KL divergence between the achieved statistic and some target statistic for a particular choice of statistic. The authors propose to replace the return-to-go conditioning in Decision Transformer with a distribution over some specified state features, which they name Distributional Decision Transformer (DDT). This work also proposes an unsupervised variant, Unsupervised DT (UDT), which does not need certain state features to be specified and can be interpreted as performing offline state-marginal-matching. The authors show in various MuJoCo settings (HalfCheetah, Hopper, Walker2d) that the proposed methods can learn to imitate target information statistics in offline RL and imitation learning settings.
SP:9318b2155b674b593441ffbb97b56c7ce57cb39a
When, Why, and Which Pretrained GANs Are Useful?
1 INTRODUCTION . These days , generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) can successfully approximate the high-dimensional distributions of real images . The exceptional quality of the state-ofthe-art GANs ( Karras et al. , 2020b ; Brock et al. , 2019 ) makes them a key ingredient in applications , including semantic editing ( Isola et al. , 2017 ; Zhu et al. , 2018 ; Shen et al. , 2020 ; Voynov & Babenko , 2020 ) , image processing ( Pan et al. , 2020 ; Ledig et al. , 2017 ; Menon et al. , 2020 ) , video generation ( Wang et al. , 2018a ) , producing high-quality synthetics ( Zhang et al. , 2021 ; Voynov et al. , 2020 ) . To extend the success of GANs to the limited-data regime , it is common to use pretraining , i.e. , to initialize the optimization process by the GAN checkpoint pretrained on some large dataset . A line of works ( Wang et al. , 2018b ; Noguchi & Harada , 2019 ; Zhao et al. , 2020 ; Mo et al. , 2020 ; Wang et al. , 2020 ; Li et al. , 2020 ) investigate different methods to transfer GANs to new datasets and report significant advantages compared to training from scratch both in terms of generative quality and convergence speed . However , the empirical success of GAN pretraining was not investigated in-depth , and its reasons are not entirely understood . From the practical standpoint , it is unclear how to choose a proper pretrained checkpoint or if one should initialize both generator and discriminator or only one of them . To the best of our knowledge , the only work that systematically studies the benefits of pretraining is Wang et al . ( 2018b ) . However , the experiments in ( Wang et al. , 2018b ) were performed with currently outdated models , and we observed that some conclusions from Wang et al . ( 2018b ) are not confirmed for modern architectures like StyleGAN2 ( Karras et al. , 2020b ) . In particular , unlike the prior results , it appears that for state-of-the-art GANs , it is beneficial to transfer from sparse and diverse rather than dense and less diverse sources . In this work , we thoroughly investigate the process of GAN finetuning . First , we demonstrate that starting the GAN training from the pretrained checkpoint can significantly influence the diversity of the finetuned model , while the fidelity of individual samples is less affected . Second , we dissect the mechanisms of how pretrained generators and discriminators contribute to the higher coverage of finetuned GANs . In a nutshell , we show that a proper pretrained generator produces samples in the neighborhood of many modes of the target distribution , while a proper pretrained discriminator serves as a gradient field that guides the samples to the closest mode , which together result in a smaller risk of mode missing . This result explains the evidence from the literature that it is beneficial to initialize both generator and discriminator when finetuning GANs . Finally , we investigate different ways to choose a suitable pretrained GAN checkpoint for a given target dataset . Interestingly , for most of the tasks , Imagenet-pretrained models appear to be the optimal initializers , which mirrors the pretraining of discriminative models , where Imagenet-based initialization is de-facto standard ( Donahue et al. , 2014 ; Long et al. , 2015 ; He et al. , 2020 ; Chen et al. , 2020a ) . Our conclusions are confirmed by experiments with the state-of-the-art StyleGAN2 ( Karras et al. , 2020b ) , chosen due to its practical importance and a variety of open-sourced checkpoints , which can be used as pretrained sources . The main contributions of our analysis are the following : 1 . We show that initializing the GAN training by the pretrained checkpoint can significantly affect the coverage and has much less influence on the realism of individual samples . 2 . We explain why it is important to initialize both generator and discriminator by describing their roles in the finetuning process . 3 . We describe a simple automatic approach to choose a pretrained checkpoint that is the most suitable for a given generation task . 2 ANALYSIS . This section aims to explain the success of the GAN finetuning process compared to training from scratch . First , we formulate the understanding of this process speculatively and then confirm this understanding by experiments on synthetic data and real images . 2.1 HIGH-LEVEL INTUITION . Let us consider a pretrained generator G and discriminator D that are used to initialize the GAN training on a new data from a distribution ptarget . Throughout the paper , we show that a discriminator initialization is “ responsible for ” an initial gradient field , and a generator initialization is “ responsible for ” a target data modes coverage . Figure 1 illustrates the overall idea with different initialization patterns . Intuitively , the proper discriminator initialization guarantees that generated samples will move towards “ correct ” data regions . On the other hand , the proper pretrained generator guarantees that the samples will be sufficiently diverse at the initialization , and once guided by this vector field , they will cover all target distribution . Below , we confirm the validity of this intuition . 2.2 SYNTHETIC EXPERIMENT . We start by considering the simplest synthetic data presented on Figure 2 . Our goal is to train a GAN on the target distribution , a mixture of ten Gaussians arranged in a circle . We explore three options to initialize the GAN training process . First , we start from random initialization . The second and the third options initialize training by GANs pretrained on the two different source distributions . The first source distribution corresponds to a wide ring around the target points , having high coverage and low precision w.r.t . target data . The second source distribution is formed by three Gaussians that share their centers with three target ones but have a slightly higher variance . This source distribution has high precision and relatively low coverage w.r.t . target data . Then we train two source GANs from scratch to fit the first and the second source distributions and employ these checkpoints to initialize GAN training on the target data . The results of GAN training for the three options are presented on Figure 2 , which shows the advantage of pretraining from the more diverse model , which results in a higher number of covered modes . The details of the generation of the synthetic are provided in the appendix . Dissecting the contributions from G and D. Here , we continue with the synthetic example from above and take a closer look at the roles that the pretrained generator and discriminator play when finetuning GANs . Our goal is to highlight the importance of ( 1 ) the initial coverage of the target distribution by the pretrained generator and ( 2 ) the quality of the gradient field from the pretrained discriminator . We quantify the former by the established recall measure ( Kynkäänniemi et al. , 2019 ) computed in the two-dimensional dataspace with k=5 for 1000 randomly picked samples from the target distribution and the same number of samples produced by the pretrained generator . To evaluate the quality of the discriminator gradient field , we use a protocol described in ( Sinha et al. , 2020 ) . Namely , we assume that the “ golden ” groundtruth gradients would guide each sample towards the closest Gaussian center from the target distribution . Then we compute the similarity between the vector field ∇xD provided by the pretrained discriminator and the vector field of “ golden ” gradients . Specifically , we evaluate the cosine similarity between these vector fields , computed for the generated samples . Given these two measures , we consider a series of different starting generator/discriminator checkpoints ( Gi , Di ) , i = 1 , . . . , N . The details on the choice of the starting checkpoints are provided in the appendix . Then we use each pair ( Gi , Di ) as initialization of GAN training on the target distribution of ten Gaussians described above . Additionally , for all starting Gi/Di , we evaluate the recall and the discriminator gradients field similarity to the “ golden ” gradients . The overall quality of GAN finetuning is measured as the Wasserstein-1 distance between the target distribution and the distribution produced by the finetuned generator . The scatter plots of recall , the similarity of gradient fields , and Wasserstein-1 distance are provided in Figure 3 . As can be seen , both the recall and gradient similarity have significant negative correlations with the W1-distance between the ground-truth distribution and the distribution of the finetuned GAN . Furthermore , for the same level of recall , the higher values of the gradient similarity correspond to lower Wasserstein distances . Alternatively , for the same value of gradient similarity , higher recall of the source generator typically corresponds to the lower Wasserstein distance . We also note that the role of the pretrained generator is more important since , for high recall values , the influence from the discriminator is not significant ( see Figure 3 , left ) . This synthetic experiment does not rigorously prove the existence of a causal relationship between the recall or gradient similarity and the quality of the finetuned GANs since it demonstrates only correlations of them . However , in the experimental section , we show that these correlations can be successfully exploited to choose the optimal pretraining checkpoint , even for the state-of-the-art GAN architectures . 3 LARGE-SCALE EXPERIMENTS . 3.1 EXPLORING PRETRAINING FOR STYLEGAN2 . In this section , we confirm the conclusions from the previous sections experimentally with the stateof-the-art StyleGAN2 architecture ( Karras et al. , 2020b ) . If not stated otherwise , we always work with the image resolution 256× 256 . Datasets . We work with six standard datasets established in the GAN literature . We also include two datasets of satellite images to investigate the pretraining behavior beyond the domain of natural images . As potential pretrained sources , we use the StyleGAN2 models trained on these datasets . Table 1 reports the list of datasets and the FID values ( Heusel et al. , 2017 ) of the source checkpoints . We also experimented with four smaller datasets to verify our conclusions in the medium-shot and few-shot regimes . The details on the datasets are provided in the appendix . Experimental setup . Here , we describe the details of our experimental protocol for both the pretraining of the source checkpoints and the subsequent training on the target datasets . We always use the official PyTorch implementation of StyleGAN2-ADA ( Karras et al. , 2020a ) provided by the authors1 . We use the “ stylegan2 ” configuration in the ADA implementation with the default hyperparameters ( same for all datasets ) . Training is performed on eight Tesla V100 GPUs and takes approximately three hours per 1M real images shown to the discriminator . Pretraining of source checkpoints . We pretrain one checkpoint on the Imagenet for 50M real images shown to the discriminator and seven checkpoints on other source datasets from Table 1 for 25M images . A larger number of optimization steps for the Imagenet is used since this dataset is more challenging and requires more training epochs to converge . For the large LSUN datasets ( Cat , Dog , Bedroom ) , we use 106 first images to preserve memory . For Satellite-Landscapes , we use ADA due to its smaller size . Then , we always use checkpoints with the best FID for further transferring to target datasets for each source dataset . Training on target datasets . For each source checkpoint , we perform transfer learning to all datasets from Table 1 . We use the default transfer learning settings from the StyleGAN2-ADA implementation ( faster adaptive data augmentation ( ADA ) adjustment rate , if applicable , and no Gema warmup ) . ADA is disabled for the datasets containing more than 50K images and enabled 1https : //github.com/NVlabs/stylegan2-ada-pytorch for others with default hyperparameters . In these experiments , we train for 25M real images shown to the discriminator . Each transfer experiment is performed with three independent runs , and the metrics are reported for the run corresponding to the median best FID ( Heusel et al. , 2017 ) . Metrics . In the experiments , we evaluate the performance via the four following metrics . ( 1 ) Frechet Inception Distance ( FID ) ( Heusel et al. , 2017 ) , which quantifies the discrepancy between the distributions of real and fake images , represented by deep embeddings . Both distributions are approximated by Gaussians , and the Wasserstein distance between them is computed . ( 2 ) Precision ( Kynkäänniemi et al. , 2019 ) , which measures the realism of fake images , assuming that the visual quality of a particular fake is high if it belongs to the neighborhood of some real images in the embedding space . ( 3 ) Recall ( Kynkäänniemi et al. , 2019 ) , which quantifies GAN diversity , measuring the rate of real images that belong to the neighborhood of some fake images in the embedding space . ( 4 ) Convergence rate equals a number of real images that were shown to the discriminator at the moment when the generator FID for the first time exceeded the optimal FID by at most 5 % . Intuitively , this metric quantifies how fast the learning process reaches a plateau . FID is computed based on the image embeddings extracted by the InceptionV3 model2 . Precision and Recall use the embeddings provided by the VGG-16 model3 . Precision and Recall are always computed with k=5 neighbors . For FID calculation , we always use all real images and 50.000 generated samples . For Precision/Recall calculation , we use the first 200K real images ( or less , if the real dataset is smaller ) and the same amount of generated samples . Results . The metric values for all datasets are reported in Table 2 , where each cell corresponds to a particular source-target pair . For the best ( in terms of FID ) checkpoint obtained for each sourcetarget transfer , we report the FID value ( top row in each cell ) , Precision and Recall ( the second and the third rows in each cell ) , and the convergence rate measured in millions of images ( bottom row in each cell ) . We highlight the sources that provide the best FID for each target dataset or differ from the best one by at most 5 % . We additionally present the curves of FID , Precision , and Recall values for several target datasets on Figure 9 and Figure 10 in the appendix . We describe the key observations from Table 2 below : • In terms of FID , a pretraining based on a diverse source ( e.g. , Imagenet or LSUN Dog ) is superior to training from scratch on all datasets in our experiments . • The choice of the source checkpoint significantly influences the coverage of the finetuned model , and the Recall values vary considerably for different sources , especially for smaller target datasets . For instance , on the Flowers dataset , their variability exceeds ten percent . In contrast , the Precision values are less affected by pretraining , and their typical variability is about 2−3 % . Figure 4 reports the standard deviations of Precision/Recall computed over different sources and highlights that Recall has higher variability compared to Precision , despite the latter having higher absolute values . • Pretraining considerably speeds up the optimization compared to the training from scratch . 2https : //nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ metrics/inception-2015-12-05.pt 3https : //nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ metrics/vgg16.pt Overall , despite having poor quality ( FID=49.2 ) , the Imagenet-pretrained unconditional StyleGAN2 model appears to be a superior GAN initialization that typically leads to more efficient optimization compared to alternatives . This result contradicts the observations in ( Wang et al. , 2018b ) showing that it is beneficial to transfer from dense and less diverse sources rather than sparse and diverse ones , like Imagenet . We attribute this inconsistency to the fact that ( Wang et al. , 2018b ) experimented with the WGAN-GP models , which are significantly inferior to the current state-of-the-art ones .
This paper aims to achieve a better understanding of GAN fine-tuning. A synthetic experiment demonstrates that pretrained discriminators improve the quality of the initial gradients, and pretrained generators help with improving mode coverage. Transfer learning experiments on real image datasets reveal that pretraining primarily improves mode coverage rather than sample fidelity, and that datasets containing a diverse set of images are best suited for transfer.
SP:23c0b97268ae96bfb6f18bbefe9d3f208ce8170f
When, Why, and Which Pretrained GANs Are Useful?
1 INTRODUCTION . These days , generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) can successfully approximate the high-dimensional distributions of real images . The exceptional quality of the state-ofthe-art GANs ( Karras et al. , 2020b ; Brock et al. , 2019 ) makes them a key ingredient in applications , including semantic editing ( Isola et al. , 2017 ; Zhu et al. , 2018 ; Shen et al. , 2020 ; Voynov & Babenko , 2020 ) , image processing ( Pan et al. , 2020 ; Ledig et al. , 2017 ; Menon et al. , 2020 ) , video generation ( Wang et al. , 2018a ) , producing high-quality synthetics ( Zhang et al. , 2021 ; Voynov et al. , 2020 ) . To extend the success of GANs to the limited-data regime , it is common to use pretraining , i.e. , to initialize the optimization process by the GAN checkpoint pretrained on some large dataset . A line of works ( Wang et al. , 2018b ; Noguchi & Harada , 2019 ; Zhao et al. , 2020 ; Mo et al. , 2020 ; Wang et al. , 2020 ; Li et al. , 2020 ) investigate different methods to transfer GANs to new datasets and report significant advantages compared to training from scratch both in terms of generative quality and convergence speed . However , the empirical success of GAN pretraining was not investigated in-depth , and its reasons are not entirely understood . From the practical standpoint , it is unclear how to choose a proper pretrained checkpoint or if one should initialize both generator and discriminator or only one of them . To the best of our knowledge , the only work that systematically studies the benefits of pretraining is Wang et al . ( 2018b ) . However , the experiments in ( Wang et al. , 2018b ) were performed with currently outdated models , and we observed that some conclusions from Wang et al . ( 2018b ) are not confirmed for modern architectures like StyleGAN2 ( Karras et al. , 2020b ) . In particular , unlike the prior results , it appears that for state-of-the-art GANs , it is beneficial to transfer from sparse and diverse rather than dense and less diverse sources . In this work , we thoroughly investigate the process of GAN finetuning . First , we demonstrate that starting the GAN training from the pretrained checkpoint can significantly influence the diversity of the finetuned model , while the fidelity of individual samples is less affected . Second , we dissect the mechanisms of how pretrained generators and discriminators contribute to the higher coverage of finetuned GANs . In a nutshell , we show that a proper pretrained generator produces samples in the neighborhood of many modes of the target distribution , while a proper pretrained discriminator serves as a gradient field that guides the samples to the closest mode , which together result in a smaller risk of mode missing . This result explains the evidence from the literature that it is beneficial to initialize both generator and discriminator when finetuning GANs . Finally , we investigate different ways to choose a suitable pretrained GAN checkpoint for a given target dataset . Interestingly , for most of the tasks , Imagenet-pretrained models appear to be the optimal initializers , which mirrors the pretraining of discriminative models , where Imagenet-based initialization is de-facto standard ( Donahue et al. , 2014 ; Long et al. , 2015 ; He et al. , 2020 ; Chen et al. , 2020a ) . Our conclusions are confirmed by experiments with the state-of-the-art StyleGAN2 ( Karras et al. , 2020b ) , chosen due to its practical importance and a variety of open-sourced checkpoints , which can be used as pretrained sources . The main contributions of our analysis are the following : 1 . We show that initializing the GAN training by the pretrained checkpoint can significantly affect the coverage and has much less influence on the realism of individual samples . 2 . We explain why it is important to initialize both generator and discriminator by describing their roles in the finetuning process . 3 . We describe a simple automatic approach to choose a pretrained checkpoint that is the most suitable for a given generation task . 2 ANALYSIS . This section aims to explain the success of the GAN finetuning process compared to training from scratch . First , we formulate the understanding of this process speculatively and then confirm this understanding by experiments on synthetic data and real images . 2.1 HIGH-LEVEL INTUITION . Let us consider a pretrained generator G and discriminator D that are used to initialize the GAN training on a new data from a distribution ptarget . Throughout the paper , we show that a discriminator initialization is “ responsible for ” an initial gradient field , and a generator initialization is “ responsible for ” a target data modes coverage . Figure 1 illustrates the overall idea with different initialization patterns . Intuitively , the proper discriminator initialization guarantees that generated samples will move towards “ correct ” data regions . On the other hand , the proper pretrained generator guarantees that the samples will be sufficiently diverse at the initialization , and once guided by this vector field , they will cover all target distribution . Below , we confirm the validity of this intuition . 2.2 SYNTHETIC EXPERIMENT . We start by considering the simplest synthetic data presented on Figure 2 . Our goal is to train a GAN on the target distribution , a mixture of ten Gaussians arranged in a circle . We explore three options to initialize the GAN training process . First , we start from random initialization . The second and the third options initialize training by GANs pretrained on the two different source distributions . The first source distribution corresponds to a wide ring around the target points , having high coverage and low precision w.r.t . target data . The second source distribution is formed by three Gaussians that share their centers with three target ones but have a slightly higher variance . This source distribution has high precision and relatively low coverage w.r.t . target data . Then we train two source GANs from scratch to fit the first and the second source distributions and employ these checkpoints to initialize GAN training on the target data . The results of GAN training for the three options are presented on Figure 2 , which shows the advantage of pretraining from the more diverse model , which results in a higher number of covered modes . The details of the generation of the synthetic are provided in the appendix . Dissecting the contributions from G and D. Here , we continue with the synthetic example from above and take a closer look at the roles that the pretrained generator and discriminator play when finetuning GANs . Our goal is to highlight the importance of ( 1 ) the initial coverage of the target distribution by the pretrained generator and ( 2 ) the quality of the gradient field from the pretrained discriminator . We quantify the former by the established recall measure ( Kynkäänniemi et al. , 2019 ) computed in the two-dimensional dataspace with k=5 for 1000 randomly picked samples from the target distribution and the same number of samples produced by the pretrained generator . To evaluate the quality of the discriminator gradient field , we use a protocol described in ( Sinha et al. , 2020 ) . Namely , we assume that the “ golden ” groundtruth gradients would guide each sample towards the closest Gaussian center from the target distribution . Then we compute the similarity between the vector field ∇xD provided by the pretrained discriminator and the vector field of “ golden ” gradients . Specifically , we evaluate the cosine similarity between these vector fields , computed for the generated samples . Given these two measures , we consider a series of different starting generator/discriminator checkpoints ( Gi , Di ) , i = 1 , . . . , N . The details on the choice of the starting checkpoints are provided in the appendix . Then we use each pair ( Gi , Di ) as initialization of GAN training on the target distribution of ten Gaussians described above . Additionally , for all starting Gi/Di , we evaluate the recall and the discriminator gradients field similarity to the “ golden ” gradients . The overall quality of GAN finetuning is measured as the Wasserstein-1 distance between the target distribution and the distribution produced by the finetuned generator . The scatter plots of recall , the similarity of gradient fields , and Wasserstein-1 distance are provided in Figure 3 . As can be seen , both the recall and gradient similarity have significant negative correlations with the W1-distance between the ground-truth distribution and the distribution of the finetuned GAN . Furthermore , for the same level of recall , the higher values of the gradient similarity correspond to lower Wasserstein distances . Alternatively , for the same value of gradient similarity , higher recall of the source generator typically corresponds to the lower Wasserstein distance . We also note that the role of the pretrained generator is more important since , for high recall values , the influence from the discriminator is not significant ( see Figure 3 , left ) . This synthetic experiment does not rigorously prove the existence of a causal relationship between the recall or gradient similarity and the quality of the finetuned GANs since it demonstrates only correlations of them . However , in the experimental section , we show that these correlations can be successfully exploited to choose the optimal pretraining checkpoint , even for the state-of-the-art GAN architectures . 3 LARGE-SCALE EXPERIMENTS . 3.1 EXPLORING PRETRAINING FOR STYLEGAN2 . In this section , we confirm the conclusions from the previous sections experimentally with the stateof-the-art StyleGAN2 architecture ( Karras et al. , 2020b ) . If not stated otherwise , we always work with the image resolution 256× 256 . Datasets . We work with six standard datasets established in the GAN literature . We also include two datasets of satellite images to investigate the pretraining behavior beyond the domain of natural images . As potential pretrained sources , we use the StyleGAN2 models trained on these datasets . Table 1 reports the list of datasets and the FID values ( Heusel et al. , 2017 ) of the source checkpoints . We also experimented with four smaller datasets to verify our conclusions in the medium-shot and few-shot regimes . The details on the datasets are provided in the appendix . Experimental setup . Here , we describe the details of our experimental protocol for both the pretraining of the source checkpoints and the subsequent training on the target datasets . We always use the official PyTorch implementation of StyleGAN2-ADA ( Karras et al. , 2020a ) provided by the authors1 . We use the “ stylegan2 ” configuration in the ADA implementation with the default hyperparameters ( same for all datasets ) . Training is performed on eight Tesla V100 GPUs and takes approximately three hours per 1M real images shown to the discriminator . Pretraining of source checkpoints . We pretrain one checkpoint on the Imagenet for 50M real images shown to the discriminator and seven checkpoints on other source datasets from Table 1 for 25M images . A larger number of optimization steps for the Imagenet is used since this dataset is more challenging and requires more training epochs to converge . For the large LSUN datasets ( Cat , Dog , Bedroom ) , we use 106 first images to preserve memory . For Satellite-Landscapes , we use ADA due to its smaller size . Then , we always use checkpoints with the best FID for further transferring to target datasets for each source dataset . Training on target datasets . For each source checkpoint , we perform transfer learning to all datasets from Table 1 . We use the default transfer learning settings from the StyleGAN2-ADA implementation ( faster adaptive data augmentation ( ADA ) adjustment rate , if applicable , and no Gema warmup ) . ADA is disabled for the datasets containing more than 50K images and enabled 1https : //github.com/NVlabs/stylegan2-ada-pytorch for others with default hyperparameters . In these experiments , we train for 25M real images shown to the discriminator . Each transfer experiment is performed with three independent runs , and the metrics are reported for the run corresponding to the median best FID ( Heusel et al. , 2017 ) . Metrics . In the experiments , we evaluate the performance via the four following metrics . ( 1 ) Frechet Inception Distance ( FID ) ( Heusel et al. , 2017 ) , which quantifies the discrepancy between the distributions of real and fake images , represented by deep embeddings . Both distributions are approximated by Gaussians , and the Wasserstein distance between them is computed . ( 2 ) Precision ( Kynkäänniemi et al. , 2019 ) , which measures the realism of fake images , assuming that the visual quality of a particular fake is high if it belongs to the neighborhood of some real images in the embedding space . ( 3 ) Recall ( Kynkäänniemi et al. , 2019 ) , which quantifies GAN diversity , measuring the rate of real images that belong to the neighborhood of some fake images in the embedding space . ( 4 ) Convergence rate equals a number of real images that were shown to the discriminator at the moment when the generator FID for the first time exceeded the optimal FID by at most 5 % . Intuitively , this metric quantifies how fast the learning process reaches a plateau . FID is computed based on the image embeddings extracted by the InceptionV3 model2 . Precision and Recall use the embeddings provided by the VGG-16 model3 . Precision and Recall are always computed with k=5 neighbors . For FID calculation , we always use all real images and 50.000 generated samples . For Precision/Recall calculation , we use the first 200K real images ( or less , if the real dataset is smaller ) and the same amount of generated samples . Results . The metric values for all datasets are reported in Table 2 , where each cell corresponds to a particular source-target pair . For the best ( in terms of FID ) checkpoint obtained for each sourcetarget transfer , we report the FID value ( top row in each cell ) , Precision and Recall ( the second and the third rows in each cell ) , and the convergence rate measured in millions of images ( bottom row in each cell ) . We highlight the sources that provide the best FID for each target dataset or differ from the best one by at most 5 % . We additionally present the curves of FID , Precision , and Recall values for several target datasets on Figure 9 and Figure 10 in the appendix . We describe the key observations from Table 2 below : • In terms of FID , a pretraining based on a diverse source ( e.g. , Imagenet or LSUN Dog ) is superior to training from scratch on all datasets in our experiments . • The choice of the source checkpoint significantly influences the coverage of the finetuned model , and the Recall values vary considerably for different sources , especially for smaller target datasets . For instance , on the Flowers dataset , their variability exceeds ten percent . In contrast , the Precision values are less affected by pretraining , and their typical variability is about 2−3 % . Figure 4 reports the standard deviations of Precision/Recall computed over different sources and highlights that Recall has higher variability compared to Precision , despite the latter having higher absolute values . • Pretraining considerably speeds up the optimization compared to the training from scratch . 2https : //nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ metrics/inception-2015-12-05.pt 3https : //nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ metrics/vgg16.pt Overall , despite having poor quality ( FID=49.2 ) , the Imagenet-pretrained unconditional StyleGAN2 model appears to be a superior GAN initialization that typically leads to more efficient optimization compared to alternatives . This result contradicts the observations in ( Wang et al. , 2018b ) showing that it is beneficial to transfer from dense and less diverse sources rather than sparse and diverse ones , like Imagenet . We attribute this inconsistency to the fact that ( Wang et al. , 2018b ) experimented with the WGAN-GP models , which are significantly inferior to the current state-of-the-art ones .
This paper performs a large-scale study of transfer learning in GANs. It proposes a way to understand the relevance of a pre-trained generator and discriminator, as well as heuristics to select good source/initialization dataset and even a training snapshot. All of this is very valuable for the practitioners.
SP:23c0b97268ae96bfb6f18bbefe9d3f208ce8170f
JOINTLY LEARNING TOPIC SPECIFIC WORD AND DOCUMENT EMBEDDING
1 INTRODUCTION . In recent years the neural network-based methods have shown great success in various NLP-related tasks ( Zhao et al. , 2021 ) . Tow popular complementary natural language processing methods are word2vec ( Mikolov et al. , 2013a ; b ) and Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) ; but executing a model in two-step lacks mutual interaction between the two paradigms and fails to capture mutual reinforcement between themselves . Doc2vec ( Le & Mikolov , 2014 ) generalizes the idea of vector representation for documents as a stand-alone method . Though it is expensive to infer new document vectors during the test process , and regardless of assigning PV to each word in the document as a single topic , it outperforms BOW ( Zhang et al. , 2010 ) and LDA ( Fan et al. , 2008 ) in various text understanding tasks . Encouraged by word2vec and Doc2vec , Niu et al . ( 2015 ) introduced Topic2Vec . It incorporates the LDA topic model into NPLM ( Bengio et al. , 2003 ) . However , Topic2Vec can not capture the polysomic characteristics of terms as LDA models topic occurrence almost independently without capturing topic correlations ( He et al. , 2017 ) . The purpose of conducting this research is to introduce an efficient multi topical document representation with flowing objectives : • Firstly , learn probabilistic topical word embeddings using document vector as a global context where each word can be part of different underlying topics of the document instead of just a single paragraph vector . Thus , avail to capture polysemous terms . • Secondly , embedding documents by simply averaging the topical word embeddings instead of imposing an expensive inference method to learn the document embedding separately . Unlike clustering-based document modeling with the ability to capture multi-sense of words ( Gupta et al. , 2019 ) , here the challenge is to learn polysemous words in a jointly learning framework for topic-specific word and document embedding . Capturing polysemous terms is vital because the same word around different context words can represent different themes ( Liu et al. , 2020 ) and without noticing them can mislead to an unexpected thematic representation of a document . The Jointly Learning Word Embeddings and Latent Topics ( Shi et al. , 2017 ) comes to the rescue for addressing the polysemous word problem , which learns different topical word embeddings using Skip-gram Topical word Embedding ( STE ) framework . STE gets the term distributions of the topics and the topic distributions of the document using PLSA ( Hofmann , 2013 ) like mixture weighting for each data point . However , STE doesn ’ t deal with document embedding in its jointly learning process . In this research , we propose a novel document embedding framework called TDE : Topical Document Embedding . TDE learns topical word and document embeddings jointly . It incorporates the STE-diff framework ( Shi et al. , 2017 ) and follows the simple averaging of word embedding with a corruption mechanism for document embedding introduced by Chen ( 2017 ) . 2 MOTIVATION AND RELATED WORK . Huang et al . ( 2012 ) proved that combining local and global context performs better for predicting target words in the neural network-based language modeling , but this model doesn ’ t support topic-specific word embeddings . Liu et al . ( 2015 ) proposed topic-specific word embeddings where document embeddings get by aggregating over all topical-word embeddings of each word in the document . Arora et al . ( 2017 ) extend embedding to the sentence level by smooth inverse frequency ( SIF ) weighted averaging of the words in a sentence . However , this model is lack of addressing multiple sense of words . Moody ( 2016 ) introduced a hybrid model called lda2vec , which suffers from uncorrelated topics due to the incorporation of LDA . For word sense disambiguation with correlated topic modeling , Chaplot & Salakhutdinov ( 2018 ) replaced the LDA topic proportions by synset proportions for a document . Other than LDA topic modeling , Arora et al . ( 2018 ) have introduced a Gaussian random walk model for word sense disambiguation . This work can address polysemous word representation but doesn ’ t cover document-level embeddings . Mekala et al . ( 2016 ) introduced the Gaussian mixture model-based soft clustering method called SCDV , which incorporates both the topic and word embeddings . However , SCDV is not suitable for multisentence documents . Hence Luo et al . ( 2019 ) proposed P-SIF , which is fit for large documents with multiple sentences while addressing the underlying topics as well . Though P-SIF overcomes SCDV ’ s shortcomings , it is still a two-step process . From the motivation of the above advantages and drawbacks , we introduce a novel document modeling capable of learning document embedding simultaneously during the jointly learning process of topic-specific word embeddings . This model creates a pivot by concatenating a document vector and center word vector to predict the context word vector . Here the document vector works as a memory backup for missing information . The output document embeddings produced by this model is more expressive as it represents each document into a higher dimensional embedding space similar to P-SIF . 3 MODEL DESCRIPTION . Inspired by the Skip-gram Topical word Embedding ( STE ) ( Shi et al. , 2017 ) and the simplicity of the Document Vector through Corruption ( Chen , 2017 ) , we design a novel document embedding model called TDE : Topical Document Embedding . In contrast to Doc2VecC , TDE constructs global context ( document vector ) as a weighted averaging of the randomly selected topic-specific word embeddings . Unlike STE , TDE uses a generating function , which predicts context words by given the topics and pivot . Pivot constructs by concatenating global context ( document vector ) and center word ( Figure1 ) . The probability of predicting a context word depends on the inner product of the topic-specific embedding of that word ( context word ) and the pivot , which ensures the participation of underlying word , topic , and document levels knowledge . 3.1 TOPICAL DOCUMENT EMBEDDING . A matrix D represents the documents in the corpus , D = d1 , d2 , . . . , dn of size n. Each document d contains a variable-length sequence of wordsW = w1 , w2 , . . . , wTd . Each wordw in the vocabulary V of size v of the corpus is generally associated with an input projection matrix U Rh×v of size h and an output projection matrix V T Rv×h of size h. The input projection matrix represents the input to the hidden space , whereas the output projection matrix represents the hidden to output space . Matrix V T has the same dimension as matrix U but a transpose matrix . The column uw of matrix U is the input vector of word w , and the column vw of matrix V T is the output vector of word w. TDE follows an unbiased mask-out/drop-out corruption mechanism in each update of its stochastic process for randomly select topic-specific word embeddings to create the global context . Under corruption mechanism , each dimension of the original document d overwrites with the probability q and sets the uncorrupted dimensions 1 ( 1−q ) times of their original values to make the corruption unbiased . The corruption mechanism reduces word-level noise in the document by forcing the embeddings of common and non-discriminative ones close to zero . This corruption mechanism leads TDE to speed up the training process by significantly pruning the number of parameters for the backpropagation mechanism , document vectors represented by only embeddings of remaining words . The resultant global context is thus as below : x̃d = 0 , with probability q d 1−q , otherwise ( 1 ) Document vector ( global context ) x̃ = 1 T ∑ x̃d ( 2 ) where T is the length of the document ( number of words ) and the document vector x̃ is the weighted average of the words in a document , weighted by the corruption mechanism mentioned above . The probability of observing the context word wt+i given the center word wt as well as the global context x̃ and the topics zt+i and zt for context and center word respectively as p ( wt+i |wt , zt+i , zt , x̃ ) = exp ( V Twt+i , zt+i . ( Uwt , zt + 1 T Ux̃d ) ) ∑ w′ Λ exp ( V T w′ , zt+i . ( Uwt , zt + 1 T Ux̃d ) ) ( 3 ) where Λ is the vocabulary of the whole corpus and input projection matrix constructs as U = Uwt , zt + 1 T Ux̃d . The denominator in equation ( 3 ) is generally intractable due to the term ∑ w′ Λ . As such , the computational cost is proportional to the size of Λ . To deal with this intractability requires an efficient approximation method . TDE employs the approximation with the negative sampling ( Mikolov et al. , 2013a ; Chen , 2017 ) . In TDE , the probability of predicting a context word wt+i in document d depends on the pivot wtx̃ and the topic distributions of the document . The pivot constructed by concatenating the center word wt and the global context x̃ as- Pivot = wtx̃ = wt + x̃ ( 4 ) So , for every skip-gram 〈wt , wt+i〉 , where the topic assignment zt+i of wt+i is independent of the topic assignment zt of wt we have : p ( wt+i |wtx̃ , d ) = k∑ zt=1 k∑ zt+i=1 p ( wt+i | wtx̃ , zt+i , zt ) p ( zt+i , zt |d ) = k∑ zt=1 k∑ zt+i=1 p ( wt+i |wtx̃ , zt+i , zt ) p ( zt|d ) p ( zt+i |d ) ( 5 ) Following a similar analogy as STE-diff , equation ( 5 ) assumes that the context word and the center word may come from the same topic or may come from two different topics as well without imposing any hard constraint ( Figure 2 ) . Here , multiple meanings of a word depend on their contexts instead of directly k topics disjoint subspace partitioning as commonly does in clustering-based topic modeling ( Gupta et al. , 2016 ) . In TDE , word embeddings from different topics co-exist in a common shared space . Instead of the free flow of scattered words in the embedding space , different topical word embeddings stay close together document-wise rather than topic-wise gathering . Creating pivots by concatenating the center word with the document vector provides extra guidance as a global context with a complete thematic sense of the document . Thus , TDE represents more consistent topical word embeddings over STE-diff . In TDE , the compositionality of words encodes in the learned embeddings ; as a result , the requirement of heuristic weighting for test documents is no more required ; each output document vector is represented simply as an average of the topic-specific word embeddings . Given the learned projection matrix Uw , z , TDE forms document embedding dvec as below : dvec = ⊕kz=1 1 T ∑ w D Uw , z ( 6 ) where T is the length ( number of words ) of the document and k represents the underlying topics of the document . In equation ( 6 ) , the term ⊕kz=1 represents topic-wise concatenation . In this case , words in the same topic are just simple average as they represent the same thematic meaning . However , words in different topics carry different themes . Thus , concatenate over topics increases the expressive power of a document . This strategy represents documents into a higher k × s dimension , where k is the underlying topics , and s is the dimension of the word embeddings .
This paper focuses on learning document embeddings, presenting a topic-document embedding (TDE) method employing syntactic and semantic properties by jointly learning topic and word embedding in a single framework. The proposed TDE approach follows corruption mechanism to create the global context and randomly select topic-specific word embeddings in learning document vectors, thus employing word, topic and document information in learning document vectors. The experimental results have shown improved performed in terms of document classification, topic coherence and word embedding similarity evaluations.
SP:3e6d8b50675d42c92cc1c707868b029984319a4a
JOINTLY LEARNING TOPIC SPECIFIC WORD AND DOCUMENT EMBEDDING
1 INTRODUCTION . In recent years the neural network-based methods have shown great success in various NLP-related tasks ( Zhao et al. , 2021 ) . Tow popular complementary natural language processing methods are word2vec ( Mikolov et al. , 2013a ; b ) and Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) ; but executing a model in two-step lacks mutual interaction between the two paradigms and fails to capture mutual reinforcement between themselves . Doc2vec ( Le & Mikolov , 2014 ) generalizes the idea of vector representation for documents as a stand-alone method . Though it is expensive to infer new document vectors during the test process , and regardless of assigning PV to each word in the document as a single topic , it outperforms BOW ( Zhang et al. , 2010 ) and LDA ( Fan et al. , 2008 ) in various text understanding tasks . Encouraged by word2vec and Doc2vec , Niu et al . ( 2015 ) introduced Topic2Vec . It incorporates the LDA topic model into NPLM ( Bengio et al. , 2003 ) . However , Topic2Vec can not capture the polysomic characteristics of terms as LDA models topic occurrence almost independently without capturing topic correlations ( He et al. , 2017 ) . The purpose of conducting this research is to introduce an efficient multi topical document representation with flowing objectives : • Firstly , learn probabilistic topical word embeddings using document vector as a global context where each word can be part of different underlying topics of the document instead of just a single paragraph vector . Thus , avail to capture polysemous terms . • Secondly , embedding documents by simply averaging the topical word embeddings instead of imposing an expensive inference method to learn the document embedding separately . Unlike clustering-based document modeling with the ability to capture multi-sense of words ( Gupta et al. , 2019 ) , here the challenge is to learn polysemous words in a jointly learning framework for topic-specific word and document embedding . Capturing polysemous terms is vital because the same word around different context words can represent different themes ( Liu et al. , 2020 ) and without noticing them can mislead to an unexpected thematic representation of a document . The Jointly Learning Word Embeddings and Latent Topics ( Shi et al. , 2017 ) comes to the rescue for addressing the polysemous word problem , which learns different topical word embeddings using Skip-gram Topical word Embedding ( STE ) framework . STE gets the term distributions of the topics and the topic distributions of the document using PLSA ( Hofmann , 2013 ) like mixture weighting for each data point . However , STE doesn ’ t deal with document embedding in its jointly learning process . In this research , we propose a novel document embedding framework called TDE : Topical Document Embedding . TDE learns topical word and document embeddings jointly . It incorporates the STE-diff framework ( Shi et al. , 2017 ) and follows the simple averaging of word embedding with a corruption mechanism for document embedding introduced by Chen ( 2017 ) . 2 MOTIVATION AND RELATED WORK . Huang et al . ( 2012 ) proved that combining local and global context performs better for predicting target words in the neural network-based language modeling , but this model doesn ’ t support topic-specific word embeddings . Liu et al . ( 2015 ) proposed topic-specific word embeddings where document embeddings get by aggregating over all topical-word embeddings of each word in the document . Arora et al . ( 2017 ) extend embedding to the sentence level by smooth inverse frequency ( SIF ) weighted averaging of the words in a sentence . However , this model is lack of addressing multiple sense of words . Moody ( 2016 ) introduced a hybrid model called lda2vec , which suffers from uncorrelated topics due to the incorporation of LDA . For word sense disambiguation with correlated topic modeling , Chaplot & Salakhutdinov ( 2018 ) replaced the LDA topic proportions by synset proportions for a document . Other than LDA topic modeling , Arora et al . ( 2018 ) have introduced a Gaussian random walk model for word sense disambiguation . This work can address polysemous word representation but doesn ’ t cover document-level embeddings . Mekala et al . ( 2016 ) introduced the Gaussian mixture model-based soft clustering method called SCDV , which incorporates both the topic and word embeddings . However , SCDV is not suitable for multisentence documents . Hence Luo et al . ( 2019 ) proposed P-SIF , which is fit for large documents with multiple sentences while addressing the underlying topics as well . Though P-SIF overcomes SCDV ’ s shortcomings , it is still a two-step process . From the motivation of the above advantages and drawbacks , we introduce a novel document modeling capable of learning document embedding simultaneously during the jointly learning process of topic-specific word embeddings . This model creates a pivot by concatenating a document vector and center word vector to predict the context word vector . Here the document vector works as a memory backup for missing information . The output document embeddings produced by this model is more expressive as it represents each document into a higher dimensional embedding space similar to P-SIF . 3 MODEL DESCRIPTION . Inspired by the Skip-gram Topical word Embedding ( STE ) ( Shi et al. , 2017 ) and the simplicity of the Document Vector through Corruption ( Chen , 2017 ) , we design a novel document embedding model called TDE : Topical Document Embedding . In contrast to Doc2VecC , TDE constructs global context ( document vector ) as a weighted averaging of the randomly selected topic-specific word embeddings . Unlike STE , TDE uses a generating function , which predicts context words by given the topics and pivot . Pivot constructs by concatenating global context ( document vector ) and center word ( Figure1 ) . The probability of predicting a context word depends on the inner product of the topic-specific embedding of that word ( context word ) and the pivot , which ensures the participation of underlying word , topic , and document levels knowledge . 3.1 TOPICAL DOCUMENT EMBEDDING . A matrix D represents the documents in the corpus , D = d1 , d2 , . . . , dn of size n. Each document d contains a variable-length sequence of wordsW = w1 , w2 , . . . , wTd . Each wordw in the vocabulary V of size v of the corpus is generally associated with an input projection matrix U Rh×v of size h and an output projection matrix V T Rv×h of size h. The input projection matrix represents the input to the hidden space , whereas the output projection matrix represents the hidden to output space . Matrix V T has the same dimension as matrix U but a transpose matrix . The column uw of matrix U is the input vector of word w , and the column vw of matrix V T is the output vector of word w. TDE follows an unbiased mask-out/drop-out corruption mechanism in each update of its stochastic process for randomly select topic-specific word embeddings to create the global context . Under corruption mechanism , each dimension of the original document d overwrites with the probability q and sets the uncorrupted dimensions 1 ( 1−q ) times of their original values to make the corruption unbiased . The corruption mechanism reduces word-level noise in the document by forcing the embeddings of common and non-discriminative ones close to zero . This corruption mechanism leads TDE to speed up the training process by significantly pruning the number of parameters for the backpropagation mechanism , document vectors represented by only embeddings of remaining words . The resultant global context is thus as below : x̃d = 0 , with probability q d 1−q , otherwise ( 1 ) Document vector ( global context ) x̃ = 1 T ∑ x̃d ( 2 ) where T is the length of the document ( number of words ) and the document vector x̃ is the weighted average of the words in a document , weighted by the corruption mechanism mentioned above . The probability of observing the context word wt+i given the center word wt as well as the global context x̃ and the topics zt+i and zt for context and center word respectively as p ( wt+i |wt , zt+i , zt , x̃ ) = exp ( V Twt+i , zt+i . ( Uwt , zt + 1 T Ux̃d ) ) ∑ w′ Λ exp ( V T w′ , zt+i . ( Uwt , zt + 1 T Ux̃d ) ) ( 3 ) where Λ is the vocabulary of the whole corpus and input projection matrix constructs as U = Uwt , zt + 1 T Ux̃d . The denominator in equation ( 3 ) is generally intractable due to the term ∑ w′ Λ . As such , the computational cost is proportional to the size of Λ . To deal with this intractability requires an efficient approximation method . TDE employs the approximation with the negative sampling ( Mikolov et al. , 2013a ; Chen , 2017 ) . In TDE , the probability of predicting a context word wt+i in document d depends on the pivot wtx̃ and the topic distributions of the document . The pivot constructed by concatenating the center word wt and the global context x̃ as- Pivot = wtx̃ = wt + x̃ ( 4 ) So , for every skip-gram 〈wt , wt+i〉 , where the topic assignment zt+i of wt+i is independent of the topic assignment zt of wt we have : p ( wt+i |wtx̃ , d ) = k∑ zt=1 k∑ zt+i=1 p ( wt+i | wtx̃ , zt+i , zt ) p ( zt+i , zt |d ) = k∑ zt=1 k∑ zt+i=1 p ( wt+i |wtx̃ , zt+i , zt ) p ( zt|d ) p ( zt+i |d ) ( 5 ) Following a similar analogy as STE-diff , equation ( 5 ) assumes that the context word and the center word may come from the same topic or may come from two different topics as well without imposing any hard constraint ( Figure 2 ) . Here , multiple meanings of a word depend on their contexts instead of directly k topics disjoint subspace partitioning as commonly does in clustering-based topic modeling ( Gupta et al. , 2016 ) . In TDE , word embeddings from different topics co-exist in a common shared space . Instead of the free flow of scattered words in the embedding space , different topical word embeddings stay close together document-wise rather than topic-wise gathering . Creating pivots by concatenating the center word with the document vector provides extra guidance as a global context with a complete thematic sense of the document . Thus , TDE represents more consistent topical word embeddings over STE-diff . In TDE , the compositionality of words encodes in the learned embeddings ; as a result , the requirement of heuristic weighting for test documents is no more required ; each output document vector is represented simply as an average of the topic-specific word embeddings . Given the learned projection matrix Uw , z , TDE forms document embedding dvec as below : dvec = ⊕kz=1 1 T ∑ w D Uw , z ( 6 ) where T is the length ( number of words ) of the document and k represents the underlying topics of the document . In equation ( 6 ) , the term ⊕kz=1 represents topic-wise concatenation . In this case , words in the same topic are just simple average as they represent the same thematic meaning . However , words in different topics carry different themes . Thus , concatenate over topics increases the expressive power of a document . This strategy represents documents into a higher k × s dimension , where k is the underlying topics , and s is the dimension of the word embeddings .
Jointly learning word embeddings and document embeddings while taking into account topical information is somewhat interesting. The paper presents an improved skip-gram model where each individual word is associated with two matrices (e.g., the input projection matrix and the output projection matrix) which is designed to capture the topical aspect of words. In other words, each word is associated with K topic embeddings. While computing the predictive probability, the proposed model further considers a global context, i.e, a document embedding computed with the idea of document corruption. Basically, this paper simply combines the work of Shi et al. 2017 and Chen 2017, Both the innovation and experimental improvement are mariginal.
SP:3e6d8b50675d42c92cc1c707868b029984319a4a
Learning an Object-Based Memory System
1 INTRODUCTION . Consider a robot operating in a household , making observations of multiple objects as it moves around over the course of days or weeks . The objects may be moved by the inhabitants , even when the robot is not observing them , and we expect the robot to be able to find any of the objects when requested . We will call this type of problem entity monitoring . It occurs in many applications , but we are particularly motivated by the robotics applications where the observations are very high dimensional , such as images or point clouds . Such systems need to perform online data association , determining which individual objects generated each observation , and state estimation , aggregating the observations of each individual object to obtain a representation that is lower variance and more complete than any individual observation . This problem can be addressed by an online recursive filtering algorithm that receives a stream of object detections as input and generates , after each input observation , a set of hypotheses corresponding to the actual objects observed by the agent . When observations are closely spaced in time and objects only briefly go out of view , the entity monitoring problem becomes the well studied problem of object tracking . In contrast , in this paper , we are interested in studying the more generalized entity monitoring problem , where a robot must associate a set of sparse and temporally separated observations of objects over the course of days or weeks into a coherent estimate of the underlying objects and associated properties in a scene ( Figure 1 ) . In such a setting , it is important that the system does not depend on continuous visual tracking , as any individual object may be seen at one time and then again significantly later . A sub-problem of generalized entity monitoring corresponds to object identification , in which we seek to consistently re-identify objects across time . However , to solve the generalized entity monitoring problem , a system must not only identify similar objects across time , but integrate the observations into an estimate of their properties that may not be directly inferrable from any single observation . A classical solution to the entity monitoring problem , developed for the tracking case but extensible to other dynamic settings , is a data association filter ( DAF ) ( the tutorial of Bar-Shalom et al . ( 2009 ) provides a good introduction ) . A Bayes-optimal solution to this problem can be formulated , but it requires representing a number of possible hypotheses that grows exponentially with the number of observations . A much more practical , though less robust , approach is a maximum likelihood DAF ( ML-DAF ) , which commits , on each step , to a maximum likelihood data association : the algorithm maintains a set of object hypotheses , one for each object ( generally starting with the empty set ) and for each observation it decides to either : ( a ) associate the observation with an existing object hypothesis and perform a Bayesian update on that hypothesis with the new data , ( b ) start a new object hypothesis based on this observation , or ( c ) discard the observation as noise . As the number of entities in the domain and the time between observations of the same entity increase , the problem becomes more difficult and the system can begin to play the role of the long-term object-based memory ( OBM ) for an autonomous agent . The engineering approach to constructing such an OBM requires many design choices , including the specification of a latent state-space for object hypotheses , a model relating observations to object states , another model specifying the evolution of object states over time , and thresholds or other decision rules for choosing , for a new observation , whether to associate it with an existing hypothesis , use it to start a new hypothesis , or discard it . In any particular application , the engineer must tune all of these models and parameters to build an OBM that performs well . This is a time-consuming process that must be repeated for each new application . In this paper , we develop a method for training neural networks to perform as OBMs for dynamic entity monitoring . In particular , we train a system to construct a memory of the objects in the environment , without explicit models of the robot ’ s sensors , the types of objects to be encountered , or the patterns in which they might move in the environment . Although it is possible to train an unstructured recurrent neural network ( RNN ) to solve this problem , we find that building in some aspects of the structure of the OBM allows faster learning with less data and enables the system to address problems with a longer horizon . We describe a neural-network architecture that uses self-attention as a mechanism for data association , and demonstrate its effectiveness in several illustrative problems . We first validate that OBM can estimate object states when observations are drawn online from a set of cluster centers . Next , we validate that OBM can estimate object states when observations correspond to high-dimensional images . Finally , we illustrate its application on a realistic simulated robotic domain . 2 RELATED WORK . Online clustering methods In the simple setting , where object state does not change over time , the entity monitoring problem can be seen as a form of online clustering , where the assignment of data points to clusters is done online , with observations arriving sequentially and a cumulative set of hypotheses output after each observation . One of the most fundamental online clustering methods is vector quantization , articulated originally by Gray ( 1984 ) and understood as a stochastic gradient method by Kohonen ( 1995 ) . It initializes cluster centers at random and assigns each new observation to the closest cluster center , and updates that center to be closer to the observation . We show that our approach can learn to outperform this online clustering method . More recent work has explored theoretical aspects of online clustering with guarantees ( Liberty et al. , 2016 ; Bhaskara and Rwanpathirana , 2020 ; Cohen-Addad et al. , 2021 ) . Data-Association Filters The most classic filter , for the case of a single entity , is the Kalman filter ( Welch and Bishop , 2006 ) . In the presence of data-association uncertainty the Kalman filter can be extended by considering assignments of observations to multiple existing hypotheses in a DAF or ML-DAF . These approaches , all of which require hand-tuned transition and observation models , are described by ( Bar-Shalom et al. , 2009 ) . We show that our approach can learn the underlying transition and observation models and performs comparably to ML-DAF with ground truth system dynamic and observation models . Visual data-association methods A special case of the entity monitoring problem where observations are closely spaced in time has been extensively explored in the visual object tracking setting ( Luo et al. , 2014 ; Xiang et al. , 2015 ; Bewley et al. , 2016 ; Frossard and Urtasun , 2018 ; Brasó and Leal-Taixé , 2020 ) . In these problems , there is typically a fixed visual field populated with many smoothly moving objects . This enables some specialized techniques that take advantage of the fact that the observations of each object are typically smoothly varying in space-time , and incorporate additional visual appearance cues . In contrast , in our setting , there is no fixed spatial field for observations and they may be temporally widely spaced , as would be the case when a robot moves through the rooms of a house , encountering and re-encountering different objects as it does so . While work has studied the detection of repeated objects with similar appearance ( Girdhar and Ramanan , 2019 ; Bai et al. , 2019 ; Bansal et al. , 2021 ; He et al. , 2021 ; Zhang et al. , 2021b ; a ; Huang et al. , 2019 ) , our focus is on aggregating and estimating the individual states of objects based on substantially different observations in a different space , and our methods are not competitive with specialized techniques on the much more specialized problems of fixed-visual-field tracking or object re-identication . Learning for data association There is relatively little work in the area of learning for generalized data association , but Liu et al . ( 2019 ) provide a recent application of LSTMs ( Hochreiter and Schmidhuber , 1997 ) to a rich version of the data association problem , in which batches of observations arrive simultaneously , with a constraint that each observation can be assigned to at most one object hypothesis . The sequential structure of the LSTM is used here not for recursive filtering , but to handle the variable numbers of observations and hypotheses . It is assumed that Euclidean distance is an appropriate metric and that the observation and state spaces are the same . Milan et al . ( 2017 ) combine a similar use of LSTM for data association with a recurrent network that learns to track multiple targets . It learns a dynamics model for the targets , including birth and death processes , but operates in simple state and observation spaces . Slot Based and Object Centric Learning Our approach to the dynamic entity monitoring task relies on the use of attention over a set of object hypothesis slots . Generic architectures for processing such slots can be found in ( Shi et al. , 2015 ; Vinyals et al. , 2015 ; Lee et al. , 2018 ) , where we use ( Lee et al. , 2018 ) as a point of comparison for OBM . We note that these architectures provide generic mechanisms to process sets of inputs , and lack the explicit structure from DAF we build into our model . Our individual hypothesis slots correspond to beliefs over object hypotheses , and thus relates to existing work in object-centric scene learning . Such work has explored the discovery of factorized objects from both static scenes ( Burgess et al. , 2019 ; Greff et al. , 2019 ; Locatello et al. , 2020 ) . Developed concurrently and most similar to our work , ( Locatello et al. , 2020 ) also utilizes slots as a means of representing a factorized object decomposition of static images . In contrast to ( Locatello et al. , 2020 ) , our work focuses on the use of a set of slots to represent the evolution of uncertain object hypotheses over time , and incorporates attention and inductive biases from DAF to selectively update beliefs across time to obtain object hypotheses as well as their associated confidences . Algorithmic priors for neural networks One final comparison is to other methods that integrate algorithmic structure with end-to-end neural network training . This approach has been applied to sequential decision making by Tamar et al . ( 2016 ) , particle filters by Jonschkowski et al . ( 2018 ) , and Kalman filters by Krishnan et al . ( 2015 ) , as well as to a complex multi-module robot control system by Karkus et al . ( 2019 ) . The results generally are much more robust than completely hand-built models and much more sample-efficient than completely unstructured deep-learning . We view our work as an instance of this general approach . 3 PROBLEM FORMULATION . We formalize the process of learning an object-based memory system ( OBM ) . Formally , when the OBM is executed online , it receives a stream of input observations z1 , . . . zT where zt ∈ Rdz , and after each input zt , it will output two vectors representing a set of predicted properties of hypothesized objects yt = [ ytk ] k∈ ( 1 .. K ) and an associated confidence score for each hypothesis , ct = [ ctk ] k∈ ( 1 .. K ) , where ytk ∈ Rdy , ctk ∈ ( 0 , 1 ) . To ensure that confidences are bounded , we constrain ∑ k ctk = 1 . We limit the maximum number of hypothesis “ slots ” in advance to K. Dependent on the application , the z and y values may be in the same space with the same representation , but this is not necessary . We have training data representing N different entity-monitoring problem instances , D = { ( z ( i ) t , m ( i ) t ) t∈ ( 1 .. Li ) } i∈ ( 1 .. N ) , where each training example is an input/output sequence of length Li , each element of which consists of a pair of input z and m = { mj } j∈ ( 1 .. J ( i ) t ) , which is a set of nominal object hypotheses representing the true current state of objects that have actually been observed so far in the sequence . It will always be true that m ( i ) t ⊆ m ( i ) t+1 and J ( i ) t ≤ K because the set of objects seen so far is cumulative . Our objective is to train a recurrent computational model to perform as an OBM effectively in problems that are drawn from the same distribution over latent domains as those in the training set . To do so , we formulate a model ( described in section 4 ) with parameters θ , which transduces the input sequence z1 , . . . , zL into an output sequence ( y1 , c1 ) , . . . , ( yL , cL ) , and train it to minimize the following loss function : L ( θ ; D ) = N∑ i=1 Li∑ t=1 Lobj ( y ( i ) t , m ( i ) t ) + Lslot ( y ( i ) t , c ( i ) t , m ( i ) t ) + Lsparse ( c ( i ) t ) . ( 1 ) The Lobj term is a chamfer loss ( Barrow et al. , 1977 ) , which looks for the predicted yk that is closest to each actual mj and sums their distances , making sure the model has found a good , high-confidence representation for each true object , with 1 : Lobj ( y , c , m ) = ∑ j min k 1 ck + ‖yk −mj‖ . The Lslot term is similar , but makes sure that each object the model has found is a true object , where we multiply by ck to not penalize for predicted objects in which we have low confidence : Lslot ( y , c , m ) = ∑ k min j ck‖yk −mj‖ . Finally , the sparsity loss discourages the model from using multiple outputs to represent the same true object , by encouraging sparsity in object hypothesis confidences ( derivation in Section D ) : Lsparse ( c ) = − log‖c‖ .
The paper defines an entity-monitoring problem where the goal is to identify the distinct objects see in an episode where the agent/model moves through the scene/observes partial state. The paper proposes the OBM-Net model architecture to address this problem and identify all the distinct objects observed over each episode. The key idea of OBM-Net to have fixed set of slots which allow tracking multiple hypothesis over time and use an attention mechanism to update the slots with observations over time.
SP:3e46e1dd9730179c71a009b20355101423c348b1
Learning an Object-Based Memory System
1 INTRODUCTION . Consider a robot operating in a household , making observations of multiple objects as it moves around over the course of days or weeks . The objects may be moved by the inhabitants , even when the robot is not observing them , and we expect the robot to be able to find any of the objects when requested . We will call this type of problem entity monitoring . It occurs in many applications , but we are particularly motivated by the robotics applications where the observations are very high dimensional , such as images or point clouds . Such systems need to perform online data association , determining which individual objects generated each observation , and state estimation , aggregating the observations of each individual object to obtain a representation that is lower variance and more complete than any individual observation . This problem can be addressed by an online recursive filtering algorithm that receives a stream of object detections as input and generates , after each input observation , a set of hypotheses corresponding to the actual objects observed by the agent . When observations are closely spaced in time and objects only briefly go out of view , the entity monitoring problem becomes the well studied problem of object tracking . In contrast , in this paper , we are interested in studying the more generalized entity monitoring problem , where a robot must associate a set of sparse and temporally separated observations of objects over the course of days or weeks into a coherent estimate of the underlying objects and associated properties in a scene ( Figure 1 ) . In such a setting , it is important that the system does not depend on continuous visual tracking , as any individual object may be seen at one time and then again significantly later . A sub-problem of generalized entity monitoring corresponds to object identification , in which we seek to consistently re-identify objects across time . However , to solve the generalized entity monitoring problem , a system must not only identify similar objects across time , but integrate the observations into an estimate of their properties that may not be directly inferrable from any single observation . A classical solution to the entity monitoring problem , developed for the tracking case but extensible to other dynamic settings , is a data association filter ( DAF ) ( the tutorial of Bar-Shalom et al . ( 2009 ) provides a good introduction ) . A Bayes-optimal solution to this problem can be formulated , but it requires representing a number of possible hypotheses that grows exponentially with the number of observations . A much more practical , though less robust , approach is a maximum likelihood DAF ( ML-DAF ) , which commits , on each step , to a maximum likelihood data association : the algorithm maintains a set of object hypotheses , one for each object ( generally starting with the empty set ) and for each observation it decides to either : ( a ) associate the observation with an existing object hypothesis and perform a Bayesian update on that hypothesis with the new data , ( b ) start a new object hypothesis based on this observation , or ( c ) discard the observation as noise . As the number of entities in the domain and the time between observations of the same entity increase , the problem becomes more difficult and the system can begin to play the role of the long-term object-based memory ( OBM ) for an autonomous agent . The engineering approach to constructing such an OBM requires many design choices , including the specification of a latent state-space for object hypotheses , a model relating observations to object states , another model specifying the evolution of object states over time , and thresholds or other decision rules for choosing , for a new observation , whether to associate it with an existing hypothesis , use it to start a new hypothesis , or discard it . In any particular application , the engineer must tune all of these models and parameters to build an OBM that performs well . This is a time-consuming process that must be repeated for each new application . In this paper , we develop a method for training neural networks to perform as OBMs for dynamic entity monitoring . In particular , we train a system to construct a memory of the objects in the environment , without explicit models of the robot ’ s sensors , the types of objects to be encountered , or the patterns in which they might move in the environment . Although it is possible to train an unstructured recurrent neural network ( RNN ) to solve this problem , we find that building in some aspects of the structure of the OBM allows faster learning with less data and enables the system to address problems with a longer horizon . We describe a neural-network architecture that uses self-attention as a mechanism for data association , and demonstrate its effectiveness in several illustrative problems . We first validate that OBM can estimate object states when observations are drawn online from a set of cluster centers . Next , we validate that OBM can estimate object states when observations correspond to high-dimensional images . Finally , we illustrate its application on a realistic simulated robotic domain . 2 RELATED WORK . Online clustering methods In the simple setting , where object state does not change over time , the entity monitoring problem can be seen as a form of online clustering , where the assignment of data points to clusters is done online , with observations arriving sequentially and a cumulative set of hypotheses output after each observation . One of the most fundamental online clustering methods is vector quantization , articulated originally by Gray ( 1984 ) and understood as a stochastic gradient method by Kohonen ( 1995 ) . It initializes cluster centers at random and assigns each new observation to the closest cluster center , and updates that center to be closer to the observation . We show that our approach can learn to outperform this online clustering method . More recent work has explored theoretical aspects of online clustering with guarantees ( Liberty et al. , 2016 ; Bhaskara and Rwanpathirana , 2020 ; Cohen-Addad et al. , 2021 ) . Data-Association Filters The most classic filter , for the case of a single entity , is the Kalman filter ( Welch and Bishop , 2006 ) . In the presence of data-association uncertainty the Kalman filter can be extended by considering assignments of observations to multiple existing hypotheses in a DAF or ML-DAF . These approaches , all of which require hand-tuned transition and observation models , are described by ( Bar-Shalom et al. , 2009 ) . We show that our approach can learn the underlying transition and observation models and performs comparably to ML-DAF with ground truth system dynamic and observation models . Visual data-association methods A special case of the entity monitoring problem where observations are closely spaced in time has been extensively explored in the visual object tracking setting ( Luo et al. , 2014 ; Xiang et al. , 2015 ; Bewley et al. , 2016 ; Frossard and Urtasun , 2018 ; Brasó and Leal-Taixé , 2020 ) . In these problems , there is typically a fixed visual field populated with many smoothly moving objects . This enables some specialized techniques that take advantage of the fact that the observations of each object are typically smoothly varying in space-time , and incorporate additional visual appearance cues . In contrast , in our setting , there is no fixed spatial field for observations and they may be temporally widely spaced , as would be the case when a robot moves through the rooms of a house , encountering and re-encountering different objects as it does so . While work has studied the detection of repeated objects with similar appearance ( Girdhar and Ramanan , 2019 ; Bai et al. , 2019 ; Bansal et al. , 2021 ; He et al. , 2021 ; Zhang et al. , 2021b ; a ; Huang et al. , 2019 ) , our focus is on aggregating and estimating the individual states of objects based on substantially different observations in a different space , and our methods are not competitive with specialized techniques on the much more specialized problems of fixed-visual-field tracking or object re-identication . Learning for data association There is relatively little work in the area of learning for generalized data association , but Liu et al . ( 2019 ) provide a recent application of LSTMs ( Hochreiter and Schmidhuber , 1997 ) to a rich version of the data association problem , in which batches of observations arrive simultaneously , with a constraint that each observation can be assigned to at most one object hypothesis . The sequential structure of the LSTM is used here not for recursive filtering , but to handle the variable numbers of observations and hypotheses . It is assumed that Euclidean distance is an appropriate metric and that the observation and state spaces are the same . Milan et al . ( 2017 ) combine a similar use of LSTM for data association with a recurrent network that learns to track multiple targets . It learns a dynamics model for the targets , including birth and death processes , but operates in simple state and observation spaces . Slot Based and Object Centric Learning Our approach to the dynamic entity monitoring task relies on the use of attention over a set of object hypothesis slots . Generic architectures for processing such slots can be found in ( Shi et al. , 2015 ; Vinyals et al. , 2015 ; Lee et al. , 2018 ) , where we use ( Lee et al. , 2018 ) as a point of comparison for OBM . We note that these architectures provide generic mechanisms to process sets of inputs , and lack the explicit structure from DAF we build into our model . Our individual hypothesis slots correspond to beliefs over object hypotheses , and thus relates to existing work in object-centric scene learning . Such work has explored the discovery of factorized objects from both static scenes ( Burgess et al. , 2019 ; Greff et al. , 2019 ; Locatello et al. , 2020 ) . Developed concurrently and most similar to our work , ( Locatello et al. , 2020 ) also utilizes slots as a means of representing a factorized object decomposition of static images . In contrast to ( Locatello et al. , 2020 ) , our work focuses on the use of a set of slots to represent the evolution of uncertain object hypotheses over time , and incorporates attention and inductive biases from DAF to selectively update beliefs across time to obtain object hypotheses as well as their associated confidences . Algorithmic priors for neural networks One final comparison is to other methods that integrate algorithmic structure with end-to-end neural network training . This approach has been applied to sequential decision making by Tamar et al . ( 2016 ) , particle filters by Jonschkowski et al . ( 2018 ) , and Kalman filters by Krishnan et al . ( 2015 ) , as well as to a complex multi-module robot control system by Karkus et al . ( 2019 ) . The results generally are much more robust than completely hand-built models and much more sample-efficient than completely unstructured deep-learning . We view our work as an instance of this general approach . 3 PROBLEM FORMULATION . We formalize the process of learning an object-based memory system ( OBM ) . Formally , when the OBM is executed online , it receives a stream of input observations z1 , . . . zT where zt ∈ Rdz , and after each input zt , it will output two vectors representing a set of predicted properties of hypothesized objects yt = [ ytk ] k∈ ( 1 .. K ) and an associated confidence score for each hypothesis , ct = [ ctk ] k∈ ( 1 .. K ) , where ytk ∈ Rdy , ctk ∈ ( 0 , 1 ) . To ensure that confidences are bounded , we constrain ∑ k ctk = 1 . We limit the maximum number of hypothesis “ slots ” in advance to K. Dependent on the application , the z and y values may be in the same space with the same representation , but this is not necessary . We have training data representing N different entity-monitoring problem instances , D = { ( z ( i ) t , m ( i ) t ) t∈ ( 1 .. Li ) } i∈ ( 1 .. N ) , where each training example is an input/output sequence of length Li , each element of which consists of a pair of input z and m = { mj } j∈ ( 1 .. J ( i ) t ) , which is a set of nominal object hypotheses representing the true current state of objects that have actually been observed so far in the sequence . It will always be true that m ( i ) t ⊆ m ( i ) t+1 and J ( i ) t ≤ K because the set of objects seen so far is cumulative . Our objective is to train a recurrent computational model to perform as an OBM effectively in problems that are drawn from the same distribution over latent domains as those in the training set . To do so , we formulate a model ( described in section 4 ) with parameters θ , which transduces the input sequence z1 , . . . , zL into an output sequence ( y1 , c1 ) , . . . , ( yL , cL ) , and train it to minimize the following loss function : L ( θ ; D ) = N∑ i=1 Li∑ t=1 Lobj ( y ( i ) t , m ( i ) t ) + Lslot ( y ( i ) t , c ( i ) t , m ( i ) t ) + Lsparse ( c ( i ) t ) . ( 1 ) The Lobj term is a chamfer loss ( Barrow et al. , 1977 ) , which looks for the predicted yk that is closest to each actual mj and sums their distances , making sure the model has found a good , high-confidence representation for each true object , with 1 : Lobj ( y , c , m ) = ∑ j min k 1 ck + ‖yk −mj‖ . The Lslot term is similar , but makes sure that each object the model has found is a true object , where we multiply by ck to not penalize for predicted objects in which we have low confidence : Lslot ( y , c , m ) = ∑ k min j ck‖yk −mj‖ . Finally , the sparsity loss discourages the model from using multiple outputs to represent the same true object , by encouraging sparsity in object hypothesis confidences ( derivation in Section D ) : Lsparse ( c ) = − log‖c‖ .
The paper proposes an end-to-end system for the data association and filtering (DAF) problem. The architecture is built to mimic components typically found in DAF systems to provide a sort of algorithmic prior to the network. The resulting system is evaluated on several different tasks using synthetic data.
SP:3e46e1dd9730179c71a009b20355101423c348b1
Real-Time Neural Voice Camouflage
1 INTRODUCTION . Automatic speech recognition models are embedded in nearly all smart devices . Although these models have many exciting applications , the concern for the potential of these devices to eavesdrop is significant . It is becoming increasingly important to develop methods that give users the autonomy to safeguard their speech from voice processing software . Fortunately , over the last decade , there has been work demonstrating that neural networks models are easily fooled . For example , they remain vulnerable to small additive perturbations ( Carlini & Wagner , 2018 ) , ambient noise ( Xu et al. , 2020 ) , and unusual examples ( Nguyen et al. , 2015 ) . Predominant methods such as gradient-based methods and their variants have remained the standard approach to generating challenging examples for deep neural networks ( Madry et al. , 2019 ) . However , to achieve this , these methods require the full input upfront , and thus users can not practically use them as they continuously speak . Therefore , the community has increasingly been focusing on researching general , robust methods of breaking neural networks that can be used in real-time . We define robust to mean an obstruction that can not be easily removed , real-time to mean an obstruction that is generated continuously as speech is spoken , and general to mean applicable to the majority of vocabulary in a language . Existing prior work has successfully tackled at least one of these three requirements , but none all three . While some work is real-time ( Chen et al. , 2020 ; Schönherr et al. , 2018 ) , these disruptions can be filtered out as they are constrained to specific frequency ranges . Universal attacks ( Lu et al. , 2021 ) can be similarly subtracted . Gong et al . ( 2019 ) achieved both real-time and robust obstructions , but are limited to a predefined set of ten words . Streaming audio is a particularly demanding domain to disrupt because the calculation needs to be performed in real-time . By the time a sound is computed , time will have passed and the streaming signal will have changed , making standard generative methods obsolete . The sampling rate of audio is at least 16 kHz , meaning the corruption for a given input must be estimated and played over a speaker within milliseconds , which is currently infeasible . Additionally , when attacks are played over-the-air , the attack needs to be loud enough to disrupt any rogue microphone that could be far away . The attack sound needs to carry the same distance as the voice . We introduce predictive attacks , which are able to disrupt any word that automatic speech recognition models are trained to transcribe . Our approach achieves real-time performance by forecasting an attack on the future of the signal , conditioned on two seconds of input speech . Our attack is optimized to have a volume similar to normal background noise , allowing people in a room to converse naturally and without monitoring from an automatic speech recognition system . Forecasting with deep neural networks has already been successfully used in other domains to achieve real-time performance , for instance in packet loss concealment ( Pascual et al. , 2021 ) . In this paper , we demonstrate how and why this approach lends itself particularly well to developing general , robust and real-time attacks for automatic speech recognition models . Our experiments show that predictive attacks are able to largely disrupt the established DeepSpeech ( Amodei et al. , 2016 ) recognition system which was trained on the LibriSpeech dataset ( Panayotov et al. , 2015 ) . On the standard , large-scale dataset LibriSpeech , our approach causes at least a three fold increase in word error rate over baselines , and at least a six fold increase in character error rate . Our method is practical and straightforward to implement on commodity hardware . We additionally demonstrate the method works inside real-world rooms with natural ambient noise and complex scene geometries . We call our method Neural Voice Camouflage . 2 RELATED WORK . Breaking Neural Networks : Szegedy et al . ( 2014 ) first discovered adversarial attacks in computer vision . Since then , a large number of methods to break neural networks have been introduced ( Madry et al. , 2019 ; Kurakin et al. , 2017 ; Carlini & Wagner , 2017 ; Croce & Hein , 2020 ; MoosaviDezfooli et al. , 2016 ; Goodfellow et al. , 2014 ) , where noise optimized by gradient descent fool the state-of-the-art models . Audio adversarial attacks ( Carlini & Wagner , 2018 ; Qin et al. , 2019 ; Yakura & Sakuma , 2019 ; Schönherr et al. , 2018 ) have also been constructed . Gradient based iterative adversarial attacks , while effective , are computationally intensive , and need to see the whole example first before launching the attack . Faster adversarial attacks uses generators to generate attacks ( Xiao et al. , 2019 ) . However , the attacks are still offline . To make the adversarial attack reliable for live speech , the attacker needs to anticipate the future in an online manner . Online Attacks : Real-time attacks are an emerging area of research in machine learning and there have been several initial works . For example , Gong et al . ( 2019 ) develop a reinforcement learning based approach to balance the trade-off between number of samples seen and attack deployment duration . They also optimize a volume trade-off to achieve over-the-air performance . While they learn to disrupt spoken keyword detection ( a predefined set of ten words ) , our approach is able to obfuscate entire sentences . Further , attacks for streaming data with bayesian approaches have been proposed ( Braverman et al. , 2021 ; Seraphim & Poovammal , 2021 ) . However , they are unable to tackle high-dimensional data such as audio . Another direction prior work has taken to create online attacks is to constantly be attacking a certain word ( Li et al. , 2019 ) . Although this works in realtime , it only targets the wake word , and not full sentences . There also have been a few methods that jam microphones by emitting sound outside the range of human hearing . For example , Chen et al . ( 2020 ) developed an approach to emit ultrasonic attacks and Schönherr et al . ( 2018 ) also generate Time ASR ȳt Predictive Attack gθ t − r − δ αt t fψ δ t − r xt−r−δ Speech Attack Figure 2 : We illustrate our problem set-up for predictive attacks . In order to attack the audio starting at time t − r , we need to start computing the attack by time t− r− δ , assuming it takes an upper bound of δ time to record , compute and play the attack . Our approach is able to obtain real-time performance by predicting this attack in the future , given the previous observations of the stream . attacks outside the human hearing range . However , by limiting the attack to specific frequencies , a defender can design a microphone that filters this set of frequencies out . Robustness : Due to the importance of this problem , there has been extensive research into learning robust models ( Madry et al. , 2019 ; Carmon et al. , 2019 ; Wang et al. , 2020 ; Mao et al. , 2019 ; 2020 ; 2021 ) . However , building defenses is challenging , and work has even shown that many basic defenses , such as adding randomness to the input , are not effective ( Athalye et al. , 2018 ) . Among all the defense strategies , adversarial training proposed by Madry et al . ( 2019 ) is the standard defense that has been most widely used . However , adversarial training has the drawback that it improves robustness accuracy at the cost of reducing the original accuracy ( Tsipras et al. , 2019 ) , which is the reason that adversarial training is not used in most real-world applications . In this paper , we show our approach is still effective against these established defenses . Real-time Machine Learning : Interest in real-time artifical intelligence dates back to 1996 , starting with anytime algorithms , which return a solution at any given point in time ( Zilberstein , 1996 ) . More recently , there have been challenges to evaluate vision models in real-time ( Kristan et al. , 2017 ) . Generally , there has been a focus on speeding up forward passes to allow for faster inference , thereby approaching real-time ( Howard et al. , 2017 ) . In addition , there has been recent work in leveraging deep neural network predictions to achieve real-time performance , which has been applied to speech packet loss concealment ( Pascual et al. , 2021 ) . This differs from the previous approaches of improving inference speed . Recently , the community has recently taken an interest in establishing robust metrics and evaluations for real-time inference ( Li et al. , 2020 ) . 3 METHOD . We present our approach for creating real-time obstructions to automatic speech recognition ( ASR ) systems . We first motivate the background for real-time attacks , then introduce our approach that achieves online performance through predictive attack models . 3.1 STREAMING SPEECH RECOGNITION . Let xt be a streaming signal that represents the input speech up until time t. The goal of ASR is to transcribe this signal into the corresponding text yt . The field often estimates this mapping through a neural network ŷt = fψ ( xt ) where the parameters ψ are optimized to minimize the empirical risk minψ E ( x , y ) [ L ( ŷt , yt ) ] . For modeling sequences , the CTC loss function is a common choice for L ( Graves et al. , 2006 ) . In offline setups , we can corrupt the neural network fψ with a standard adversarial attack . These attacks work by finding a minimal additive perturbation vector αt that , when added to the input signal , produces a high loss : arg maxαt L ( fψ ( xt + αt ) , yt ) subject to a bound on the norm of the perturbation ‖αt‖∞ < . Adversarial attacks , such as projected gradient descent ( PGD ) or fast gradient descent , have been widely effective on vision and speech datasets ( Madry et al. , 2019 ; Goodfellow et al. , 2014 ; Carlini & Wagner , 2018 ) . Defending against them both empirically and theoretically remains an active area of research today . Standard adversarial attacks will optimize the perturbation vector αt conditioned on the current position of the stream xt . However , by the time the solution αt is found for a stream , the attack will be obsolete because time will have passed and the condition will have almost certainly changed . Audio is a particularly demanding domain because the high sampling rate ( as high as 48 kHz ) would require attacks to be computed nearly instantaneously ( less than 20 microseconds ) . Furthermore , applying the stale αt to the future xt+δ will not work because the attack vectors are optimized to corrupt the features of their input , which may vary over time . 3.2 PREDICTIVE REAL-TIME ATTACKS . We propose a class of predictive attacks , which enable real-time performance by forecasting the attack vector that will be effective in future time steps . It will invariably take some time for the attack to be computed . For attacks to operate in real-time environments , this means the attack needs to be optimized not for the observed signal , but for the unobserved signal in the future . If our observation of the signal xt is captured at time t and our algorithm takes δ seconds to compute an attack and play it , then we need to attack the signal starting at xt+δ . However , creating these attacks is challenging practically because real-world signals are stochastic and multi-modal . Due to the high uncertainty , generating future speech xt+δ for the purpose of computing attacks is infeasible . Rather than forecasting the signal , we will learn to forecast the attack vector , which encloses all possible variations of the next utterances conditioned on the current input . This attack will learn to “ hedge the bet ” by finding a single , minimal pattern that robustly obstructs all upcoming possibilities . Under the perturbation bound , we model predictive attacks as : αt+δ+r = gθ ( xt ) s.t . ‖gθ ( xt ) ‖∞ < , ( 1 ) where gθ is a predictive model conditioned on the present input speech and paramaterized by θ . To be consistent with our notation , which represents xt as the signal until time t , we include an additional offset r to represent the temporal duration of the attack . To satisfy the constraint on the perturbation bound , we use the tanh activation function to squash the range to the interval [ −1 , 1 ] before multiplying the result by a scalar . This is equal to the product of a predetermined multiplier m and the maximum of the absolute value of the input speech waveform . With predictive attacks , the algorithm for generating obstructions in real-time becomes straightforward . After the microphone observes xt , the speakers need to play αt+δ+r exactly δ seconds later . Since sound is additive modulo reverberation , this will cause a third-party microphone to receive the corrupted signal xt+δ+r + gθ ( xt ) . We found modeling the room acoustics was unnecessary because significant reverberation already breaks state-of-the-art ASR models . We will use neural networks to instantiate the predictive model g. To obtain real-time performance , our feed forward calculation needs to be less than the delay δ into the future . On commodity hardware today , this calculation is on the order of 50 milliseconds .
This paper proposes a Neural Voice Camouflage (NVC) method that has three important characteristics, which are essential for an NVC method to be used in practical scenarios: general, real-time, and robust. Since the proposed method trains a model to learn predictive attacks without any constraints about input and output, it can be applied to any vocabulary in a real-time scenario, and it is also difficult to defend the attack. On the contrary, the previous gradient-based adversarial attacks take a lot of time to compute the attack, so it is difficult to be used in a real-time scenario. Other than that, other previous methods are trained to attack only a few target words or utilize a pre-defined frequency region that can be easily filtered out. In experiments, this paper shows that the proposed method is really effective by showing that the WER&CER of an ASR model significantly increases with the method compared to other NVC methods. Furthermore, this paper conducts various analyses on the behavioral characteristics of the method that can give many insights for future work. Moreover, various experiments, which are conducted with considerations about the situation where the method is used in the real world, are also shown in this paper.
SP:7dace4ef94b6bd673112dda394ef5225f62df0b4
Real-Time Neural Voice Camouflage
1 INTRODUCTION . Automatic speech recognition models are embedded in nearly all smart devices . Although these models have many exciting applications , the concern for the potential of these devices to eavesdrop is significant . It is becoming increasingly important to develop methods that give users the autonomy to safeguard their speech from voice processing software . Fortunately , over the last decade , there has been work demonstrating that neural networks models are easily fooled . For example , they remain vulnerable to small additive perturbations ( Carlini & Wagner , 2018 ) , ambient noise ( Xu et al. , 2020 ) , and unusual examples ( Nguyen et al. , 2015 ) . Predominant methods such as gradient-based methods and their variants have remained the standard approach to generating challenging examples for deep neural networks ( Madry et al. , 2019 ) . However , to achieve this , these methods require the full input upfront , and thus users can not practically use them as they continuously speak . Therefore , the community has increasingly been focusing on researching general , robust methods of breaking neural networks that can be used in real-time . We define robust to mean an obstruction that can not be easily removed , real-time to mean an obstruction that is generated continuously as speech is spoken , and general to mean applicable to the majority of vocabulary in a language . Existing prior work has successfully tackled at least one of these three requirements , but none all three . While some work is real-time ( Chen et al. , 2020 ; Schönherr et al. , 2018 ) , these disruptions can be filtered out as they are constrained to specific frequency ranges . Universal attacks ( Lu et al. , 2021 ) can be similarly subtracted . Gong et al . ( 2019 ) achieved both real-time and robust obstructions , but are limited to a predefined set of ten words . Streaming audio is a particularly demanding domain to disrupt because the calculation needs to be performed in real-time . By the time a sound is computed , time will have passed and the streaming signal will have changed , making standard generative methods obsolete . The sampling rate of audio is at least 16 kHz , meaning the corruption for a given input must be estimated and played over a speaker within milliseconds , which is currently infeasible . Additionally , when attacks are played over-the-air , the attack needs to be loud enough to disrupt any rogue microphone that could be far away . The attack sound needs to carry the same distance as the voice . We introduce predictive attacks , which are able to disrupt any word that automatic speech recognition models are trained to transcribe . Our approach achieves real-time performance by forecasting an attack on the future of the signal , conditioned on two seconds of input speech . Our attack is optimized to have a volume similar to normal background noise , allowing people in a room to converse naturally and without monitoring from an automatic speech recognition system . Forecasting with deep neural networks has already been successfully used in other domains to achieve real-time performance , for instance in packet loss concealment ( Pascual et al. , 2021 ) . In this paper , we demonstrate how and why this approach lends itself particularly well to developing general , robust and real-time attacks for automatic speech recognition models . Our experiments show that predictive attacks are able to largely disrupt the established DeepSpeech ( Amodei et al. , 2016 ) recognition system which was trained on the LibriSpeech dataset ( Panayotov et al. , 2015 ) . On the standard , large-scale dataset LibriSpeech , our approach causes at least a three fold increase in word error rate over baselines , and at least a six fold increase in character error rate . Our method is practical and straightforward to implement on commodity hardware . We additionally demonstrate the method works inside real-world rooms with natural ambient noise and complex scene geometries . We call our method Neural Voice Camouflage . 2 RELATED WORK . Breaking Neural Networks : Szegedy et al . ( 2014 ) first discovered adversarial attacks in computer vision . Since then , a large number of methods to break neural networks have been introduced ( Madry et al. , 2019 ; Kurakin et al. , 2017 ; Carlini & Wagner , 2017 ; Croce & Hein , 2020 ; MoosaviDezfooli et al. , 2016 ; Goodfellow et al. , 2014 ) , where noise optimized by gradient descent fool the state-of-the-art models . Audio adversarial attacks ( Carlini & Wagner , 2018 ; Qin et al. , 2019 ; Yakura & Sakuma , 2019 ; Schönherr et al. , 2018 ) have also been constructed . Gradient based iterative adversarial attacks , while effective , are computationally intensive , and need to see the whole example first before launching the attack . Faster adversarial attacks uses generators to generate attacks ( Xiao et al. , 2019 ) . However , the attacks are still offline . To make the adversarial attack reliable for live speech , the attacker needs to anticipate the future in an online manner . Online Attacks : Real-time attacks are an emerging area of research in machine learning and there have been several initial works . For example , Gong et al . ( 2019 ) develop a reinforcement learning based approach to balance the trade-off between number of samples seen and attack deployment duration . They also optimize a volume trade-off to achieve over-the-air performance . While they learn to disrupt spoken keyword detection ( a predefined set of ten words ) , our approach is able to obfuscate entire sentences . Further , attacks for streaming data with bayesian approaches have been proposed ( Braverman et al. , 2021 ; Seraphim & Poovammal , 2021 ) . However , they are unable to tackle high-dimensional data such as audio . Another direction prior work has taken to create online attacks is to constantly be attacking a certain word ( Li et al. , 2019 ) . Although this works in realtime , it only targets the wake word , and not full sentences . There also have been a few methods that jam microphones by emitting sound outside the range of human hearing . For example , Chen et al . ( 2020 ) developed an approach to emit ultrasonic attacks and Schönherr et al . ( 2018 ) also generate Time ASR ȳt Predictive Attack gθ t − r − δ αt t fψ δ t − r xt−r−δ Speech Attack Figure 2 : We illustrate our problem set-up for predictive attacks . In order to attack the audio starting at time t − r , we need to start computing the attack by time t− r− δ , assuming it takes an upper bound of δ time to record , compute and play the attack . Our approach is able to obtain real-time performance by predicting this attack in the future , given the previous observations of the stream . attacks outside the human hearing range . However , by limiting the attack to specific frequencies , a defender can design a microphone that filters this set of frequencies out . Robustness : Due to the importance of this problem , there has been extensive research into learning robust models ( Madry et al. , 2019 ; Carmon et al. , 2019 ; Wang et al. , 2020 ; Mao et al. , 2019 ; 2020 ; 2021 ) . However , building defenses is challenging , and work has even shown that many basic defenses , such as adding randomness to the input , are not effective ( Athalye et al. , 2018 ) . Among all the defense strategies , adversarial training proposed by Madry et al . ( 2019 ) is the standard defense that has been most widely used . However , adversarial training has the drawback that it improves robustness accuracy at the cost of reducing the original accuracy ( Tsipras et al. , 2019 ) , which is the reason that adversarial training is not used in most real-world applications . In this paper , we show our approach is still effective against these established defenses . Real-time Machine Learning : Interest in real-time artifical intelligence dates back to 1996 , starting with anytime algorithms , which return a solution at any given point in time ( Zilberstein , 1996 ) . More recently , there have been challenges to evaluate vision models in real-time ( Kristan et al. , 2017 ) . Generally , there has been a focus on speeding up forward passes to allow for faster inference , thereby approaching real-time ( Howard et al. , 2017 ) . In addition , there has been recent work in leveraging deep neural network predictions to achieve real-time performance , which has been applied to speech packet loss concealment ( Pascual et al. , 2021 ) . This differs from the previous approaches of improving inference speed . Recently , the community has recently taken an interest in establishing robust metrics and evaluations for real-time inference ( Li et al. , 2020 ) . 3 METHOD . We present our approach for creating real-time obstructions to automatic speech recognition ( ASR ) systems . We first motivate the background for real-time attacks , then introduce our approach that achieves online performance through predictive attack models . 3.1 STREAMING SPEECH RECOGNITION . Let xt be a streaming signal that represents the input speech up until time t. The goal of ASR is to transcribe this signal into the corresponding text yt . The field often estimates this mapping through a neural network ŷt = fψ ( xt ) where the parameters ψ are optimized to minimize the empirical risk minψ E ( x , y ) [ L ( ŷt , yt ) ] . For modeling sequences , the CTC loss function is a common choice for L ( Graves et al. , 2006 ) . In offline setups , we can corrupt the neural network fψ with a standard adversarial attack . These attacks work by finding a minimal additive perturbation vector αt that , when added to the input signal , produces a high loss : arg maxαt L ( fψ ( xt + αt ) , yt ) subject to a bound on the norm of the perturbation ‖αt‖∞ < . Adversarial attacks , such as projected gradient descent ( PGD ) or fast gradient descent , have been widely effective on vision and speech datasets ( Madry et al. , 2019 ; Goodfellow et al. , 2014 ; Carlini & Wagner , 2018 ) . Defending against them both empirically and theoretically remains an active area of research today . Standard adversarial attacks will optimize the perturbation vector αt conditioned on the current position of the stream xt . However , by the time the solution αt is found for a stream , the attack will be obsolete because time will have passed and the condition will have almost certainly changed . Audio is a particularly demanding domain because the high sampling rate ( as high as 48 kHz ) would require attacks to be computed nearly instantaneously ( less than 20 microseconds ) . Furthermore , applying the stale αt to the future xt+δ will not work because the attack vectors are optimized to corrupt the features of their input , which may vary over time . 3.2 PREDICTIVE REAL-TIME ATTACKS . We propose a class of predictive attacks , which enable real-time performance by forecasting the attack vector that will be effective in future time steps . It will invariably take some time for the attack to be computed . For attacks to operate in real-time environments , this means the attack needs to be optimized not for the observed signal , but for the unobserved signal in the future . If our observation of the signal xt is captured at time t and our algorithm takes δ seconds to compute an attack and play it , then we need to attack the signal starting at xt+δ . However , creating these attacks is challenging practically because real-world signals are stochastic and multi-modal . Due to the high uncertainty , generating future speech xt+δ for the purpose of computing attacks is infeasible . Rather than forecasting the signal , we will learn to forecast the attack vector , which encloses all possible variations of the next utterances conditioned on the current input . This attack will learn to “ hedge the bet ” by finding a single , minimal pattern that robustly obstructs all upcoming possibilities . Under the perturbation bound , we model predictive attacks as : αt+δ+r = gθ ( xt ) s.t . ‖gθ ( xt ) ‖∞ < , ( 1 ) where gθ is a predictive model conditioned on the present input speech and paramaterized by θ . To be consistent with our notation , which represents xt as the signal until time t , we include an additional offset r to represent the temporal duration of the attack . To satisfy the constraint on the perturbation bound , we use the tanh activation function to squash the range to the interval [ −1 , 1 ] before multiplying the result by a scalar . This is equal to the product of a predetermined multiplier m and the maximum of the absolute value of the input speech waveform . With predictive attacks , the algorithm for generating obstructions in real-time becomes straightforward . After the microphone observes xt , the speakers need to play αt+δ+r exactly δ seconds later . Since sound is additive modulo reverberation , this will cause a third-party microphone to receive the corrupted signal xt+δ+r + gθ ( xt ) . We found modeling the room acoustics was unnecessary because significant reverberation already breaks state-of-the-art ASR models . We will use neural networks to instantiate the predictive model g. To obtain real-time performance , our feed forward calculation needs to be less than the delay δ into the future . On commodity hardware today , this calculation is on the order of 50 milliseconds .
This paper proposes a novel attack approach with a purpose of disrupting the automatic speech recognition system. The proposed method, called Neural Voice Camouflage, works in real time by forecasting attacks ahead of time when they are added to speech streams. The authors conducted experiments with the LibriSpeech dataset, and showed that the proposed model outperforms the conventional methods with or without defense mechanisms on the task of speech recognition (performance measured by WER/CER).
SP:7dace4ef94b6bd673112dda394ef5225f62df0b4
Hierarchical Multimodal Variational Autoencoders
1 INTRODUCTION . Data modalities represent different perspectives of the same concept . Generative models can learn from such data by reproducing it , which can be useful for tasks such as image caption generation ( Vinyals et al. , 2015 ) . This model family can also reproduce feature vector representations of the data , which can be helpful for tasks such as zero-shot classification ( Xian et al. , 2018b ) or reinforcement learning ( Bruce et al. , 2017 ) . One difficulty in multimodal learning lies in the differing probabilistic structures across modalities ( Fig . 1 ) . Our goal is to develop generative models that capture unimodal variations in both modalities . One line of previous works ( Zhu et al. , 2017 ; Zhang et al. , 2017 ; Reed et al. , 2016 ) tackled this challenge with conditional generative adversarial networks ( GANs ) ( Mirza and Osindero , 2014 ) . These models generate samples for one modality conditioned on another modality and are optimized via competition between a generator and a discriminator . In contrast , Suzuki et al . ( 2016 ) used variational autoencoders ( VAEs ) to jointly generate M modalities from a learned latent representation . We focus on VAEs , which are explicit density estimators and can maximize the likelihood of all data variations . GANs are implicit estimators , which can cause the generator to disproportionally favor specific variations ( Razavi et al. , 2019 ) . Some multimodal VAEs ( Wu and Goodman , 2018 ; Shi et al. , 2019 ) incorporate a single latent variable g that captures all relevant information ( Fig . 2a ) . This formulation may disregard modalityexclusive variations . Other works ( Huang et al. , 2018 ; Hsu and Glass , 2018 ; Mahajan et al. , 2020 ; Sutter et al. , 2020 ; Daunhawer et al. , 2021b ; Lee and Pavlovic , 2021 ) have introduced disentangled latent variables z1 : M , which are marginally independent of a shared latent variable g and represent structure specific to modality i ( Fig . 2b ) . We argue that a disentangled latent representation may neglect the dependencies between shared and modality-exclusive variations . As a specific example , consider captioning ( modality 2 ) pictures of birds ( modality 1 ) as in Fig . 1a . The images of seabirds can have sky or water in the background , while those of songbirds often display forest backgrounds . The captions focus on the bird and thereby easily ignore such variations . Therefore , the shared pattern across modalities ( bird species ) dictates these modality-exclusive variations . Consider a generative model where g represents shared structure and z1 image variations . When the two latent variables g and z1 are independent ( Fig . 2b ) , the decoder that maps from latent variables onto images has to learn two distinct functions - one for seabirds ( where the independent variations determine the sky or water background ) and another for songbirds ( where the independent variations determine the forest background ) . We argue that this aspiration is theoretically learnable but practically challenging because it may require a large model with disproportional capacity ( that could generalize poorly , is challenging to train , or requires abundant data ) . In contrast , we suggest that a hierarchical latent representation is an inductive bias that captures realistic data variations and guides learning . The edges between g and z1 : M give the model the flexibility to decide which unimodal variations to capture given a shared latent concept . For example , a hierarchical model could adaptively learn that z1 for seabirds solely captures sky or water background variations while z1 for songbirds captures forest background variations . This can help the decoder to share features between seabirds and songbirds . Contributions ( i ) We propose a hierarchical multimodal VAE ( HMVAE ) that incorporates a latent hierarchy , where the shared variable g resides at the top and lower variables z complement unimodal variations . ( ii ) We compare the HMVAE to several state-of-the-art baselines on the CUB and the Oxford Flower datasets . We report improved quantitative and qualitative measures in terms of semantic coherence and heterogeneity . 2 BACKGROUND AND RELATED WORK . Variational Autoencoders ( VAEs ) ( Kingma and Welling , 2013 ; Rezende et al. , 2014 ) are deep generative models that represent the joint distribution pθ ( x , z ) using neural networks with parameters θ , where x ∈ RD is the observed vector and z ∈ RD′ is the latent vector . As the true posterior pθ ( z|x ) is intractable , an approximate posterior qφ ( z|x ) with parameters φ is used for inference . The parameters θ , φ are usually trained by maximizing the evidence lower bound ( ELBO ) for the marginal likelihood : Eqφ ( z|x ) [ log pθ ( x , z ) qφ ( z|x ) ] ≤ log pθ ( x ) . ( 1 ) Many efforts have been made to increase the expressivity of VAEs , e.g. , by improving the prior of z ( Chen et al. , 2016 ; Tomczak and Welling , 2018 ) , and by introducing auxiliary latent variables ( Maaløe et al. , 2016 ) . Our approach lies in the latter paradigm . Hierarchical VAEs ( HVAEs ) ( Rezende et al. , 2014 ) have a hierarchical latent structure , where the topmost latent variable , drawn from an unconditional prior pθ ( zL ) , represents global features . The lower variables , drawn from conditional priors pθ ( zi|zi+1 ) , complement local characteristics in order to reconstruct the observed data via pθ ( x|z1 ) . Sønderby et al . ( 2016 ) found the tendency for HVAEs to not effectively use higher-level latent variables when they are trained using inference networks of the form qφ ( zi+1|zi ) . They proposed to first infer the top-level variable zL directly with qφ ( zL|x ) and then infer the intermediate variables { zi } with both bottom-up and top-down information through qφ , θ ( zi|zi+1 , x ) for hierarchical level i ∈ { 0 , ... , L− 1 } . The bottom-up and top-down information for hierarchical level i are encoded as hidden variables through neural networks : bi = fφ , i ( x ) and ti = fφ , θ , i ( zi+1 ) . We make use of this idea in our work , concatenate both hidden states and pass the result to an MLP that parameterizes the respective posterior ( see App . C.1 for further details ) . This inference procedure can result in im- proved density estimation and sample generation performance ( Sønderby et al. , 2016 ; Maaløe et al. , 2019 ; Vahdat and Kautz , 2020 ; Child , 2021 ) . Multimodal VAEs represent M modalities x1 : M = { x1 , ... , xM } that are assumed to be conditionally independent given a shared representation g : pθ ( x1 : M |g ) = ∏M m=1 pθ ( xi|g ) . Motivated by the factorization of the true posterior , Wu and Goodman ( 2018 ) used a product of experts ( PoE ) formulation to parameterize the approximate posterior distribution over the shared latent variable , where each expert characterizes information within a modality : qφ ( g|x1 : M ) ∝ pθ ( g ) ∏M m=1 qφ ( g|xm ) . ( 2 ) When all experts are Gaussian , the product posterior of any combination of experts is easily computed . Shi et al . ( 2019 ) showed that an inference model with a Gaussian PoE formulation can be miscalibrated , i.e. , overconfident experts qφ ( g|xi ) with low densities dominate the product qφ ( g|x1 : M ) . They instead used a mixture of experts ( MoE ) formulation : qφ ( g|x1 : M ) = 1M ∑M m=1 qφ ( g|xm ) . ( 3 ) With the MoE formulation , optimization is analogous to a vote , which can avoid unreasonable dominance by a single modality . Mahajan et al . ( 2020 ) applied normalizing flows ( Rezende and Mohamed , 2015 ) to map between the latent spaces of g1 and g2 in a VAE , where qφ ( gi|xi ) constitutes the posterior over gi . Normalizing flows can be more expressive than other distribution choices , such as Gaussians , which can help to represent complex multimodal relationships . However , optimizing the ELBO requires tractable sampling and density estimation in either direction , for example , by using coupling layers ( Dinh et al. , 2014 ; 2017 ) . This can be a challenging constraint in practice . Vasco et al . ( 2020 ) proposed the MHVAE , which also incorporates a hierarchical generative model . Note that both works were developed independently and offer complementary perspectives . We summarize the differences in the following : first , the MHVAE ’ s generative model is limited to two hierarchical levels ( like Fig . 3a , but for two levels ) . Our proposed generative model supports arbitrary hierarchical depth . Second , the MHVAE ’ s inference model is non-hierarchical ( Fig . 2c , Eq . 9 from the original paper ) . Our proposed inference model is hierarchical ( Fig . 3b ) Third , the MHVAE ’ s posteriors over z are unimodal . Our proposed “ top-down ” inference model computes the latent variables in the same order as the generative model . Therefore , the respective posteriors depend on all modalities . Fourth , the MHVAE ’ s inference network drops modality-specific hidden states at random during training . We use a mixture of experts posterior . Fifth , Vasco et al . ( 2020 ) evaluate their model on surjective data where single labels or attributes describe classes of images , i.e. , there is not much variation in a single modality but lots in the other . We focus on a different data scenario where each modality has a large degree of variation . 3 MULTIMODAL LATENT HIERARCHIES . We propose a hierarchical multimodal VAE ( HMVAE ) that captures the generative process of multiple modalities . The hyperparameter L ( m ) ≥ 2 defines the number of hierarchical levels for modality m. If L ( m ) = 2 , the hierarchy solely expands between the shared and unimodal variables . If L ( m ) > 2 , the model incorporates additional unimodal hierarchies . Generative model We assume conditional independence of modalities given a shared variable g ( see Fig . 3a portraying the case of two modalities and three hierarchical levels ) : pφ , θ ( x , g , z ) = ∏M m=1 pθ ( xm|zm,1 ) · ( ∏L ( m ) −2 i=1 pφ , θ ( zm , i|zm , i+1 ) ) pφ , θ ( zm , L ( m ) −1|g ) pθ ( g ) . ( 4 ) The prior for the shared variable g is isotropic Gaussian . All conditional distributions for the intermediate variables { zm,1 : L ( m ) −1 } for m ∈ { 1 , . . .M } are also isotropic Gaussian , where mean and variance are parameterized using neural networks . We use the hierarchical formulation introduced in § 2 where some parameters are shared across the generative and inference networks . The conditional distributions for the observed variables { xm } can , for example , be parameterized using isotropic Gaussian distributions ( for continuous-valued data ) or Bernoulli distributions ( for binary data ) . Inference model We extend Sønderby et al . ( 2016 ) ’ s hierarchical approach described in § 2 to the multimodal case ( see Fig . 3a depicting the case of two modalities and three hierarchical levels ) : qφ , θ ( g , z|x1 : M ) = qφ ( g|x1 : M ) · M∏ m=1 qφ , θ ( zm , L ( m ) −1|g , xm ) L ( m ) −2∏ i=1 qφ , θ ( zm , i|zm , i+1 , xm ) . ( 5 ) All distributions except the first factor qφ ( g|x1 : M ) are isotropic Gaussian with mean and variance inferred through neural networks from the conditional variables . The network employs skip connections from x1 : M to g. The inference and generative networks share some parameters in the topdown networks that point from g to the lowest unimodal variable zm , i=0 . This architecture can reinforce hierarchical decomposition ( Sønderby et al. , 2016 ) . Furthermore , it ensures that the unimodal latent variables are conditioned on all modalities ( as indicated by the red edges in Fig . 3b ) which helps learn crossmodal relationships . Section 2 and App . C.1 provide further details on the hierarchical architecture . We parameterize the posterior distribution over the shared latent variable qφ ( g|x1 : M ) using a mixture of experts formulation ( Eq . 3 ) . We follow Shi et al . ( 2019 ) and assume that several modalities can entail modality-exclusive variations , i.e. , some variations for modality i do not correlate with variations in modality j 6= i. Optimization We train the HMVAE by maximizing the ELBO with stochastic backpropagation : ELBO : = Eqφ , θ ( g , z|x1 : M ) [ log pφ , θ ( x1 : M , g , z ) qφ , θ ( g , z|x1 : M ) ] ≤ log pθ ( x1 : M ) . ( 6 ) Further motivation Figure 4 visualizes how multimodal VAEs could capture the data from the example in the Introduction ( Fig . 1 ) . The challenge lies in representing crossmodal dependencies – not the joint distribution . That is because one modality can never inform about the modality-exclusive variations of another modality . Daunhawer et al . ( 2021a ) demonstrated that this problem constitutes a core limitation across the multimodal VAE literature . In a non-hierarchical VAE , crossmodal generation is indeed challenging because g must capture all variations . This becomes problematic when generating pθ ( xi|g ) from qφ ( g|xj 6=i ) because the latter misses information about xi . In contrast , in a two-level hierarchy , z could theoretically capture the entirety of modality-exclusive variations . However , the model may choose to represent some of these variations in g to capture the hierarchical dependencies within the modality-exclusive variations . A deep hierarchy could circumvent this Problem : crossmodal generation Problem : conditional independent variations within z problem by adding infinitesimal small modality-exclusive variations per hierarchical level ( in the limit ) . Note that Fig . 4 demonstrates one set of possible hierarchical representations . A model could also utilize its degrees of freedom differently . For example , the deep model may incorporate shared structure and modality-exclusive variations for the more complex modality in g. In general , we expect a ( deep ) hierarchy to be beneficial for representing complex data such as image or text modalities .
The authors propose a Hierarchical framework for multimodal learning HMVAE. They define modality specific latent factor as well as the shared latent factor across multiple modalities. They represent modality-specific variations using latent variables dependent on the shared top-level variable. They parameterize the posterior distribution over the shared latent variable using a mixture of experts. The modality specific latent factors are adaptive inferred with both bottom-up and top-down information. They evaluate the proposed method on the Oxford Flower and the CUB datasets with various cross-modal experiments.
SP:7e0bdc833324174b53617123d8268988c0263a34
Hierarchical Multimodal Variational Autoencoders
1 INTRODUCTION . Data modalities represent different perspectives of the same concept . Generative models can learn from such data by reproducing it , which can be useful for tasks such as image caption generation ( Vinyals et al. , 2015 ) . This model family can also reproduce feature vector representations of the data , which can be helpful for tasks such as zero-shot classification ( Xian et al. , 2018b ) or reinforcement learning ( Bruce et al. , 2017 ) . One difficulty in multimodal learning lies in the differing probabilistic structures across modalities ( Fig . 1 ) . Our goal is to develop generative models that capture unimodal variations in both modalities . One line of previous works ( Zhu et al. , 2017 ; Zhang et al. , 2017 ; Reed et al. , 2016 ) tackled this challenge with conditional generative adversarial networks ( GANs ) ( Mirza and Osindero , 2014 ) . These models generate samples for one modality conditioned on another modality and are optimized via competition between a generator and a discriminator . In contrast , Suzuki et al . ( 2016 ) used variational autoencoders ( VAEs ) to jointly generate M modalities from a learned latent representation . We focus on VAEs , which are explicit density estimators and can maximize the likelihood of all data variations . GANs are implicit estimators , which can cause the generator to disproportionally favor specific variations ( Razavi et al. , 2019 ) . Some multimodal VAEs ( Wu and Goodman , 2018 ; Shi et al. , 2019 ) incorporate a single latent variable g that captures all relevant information ( Fig . 2a ) . This formulation may disregard modalityexclusive variations . Other works ( Huang et al. , 2018 ; Hsu and Glass , 2018 ; Mahajan et al. , 2020 ; Sutter et al. , 2020 ; Daunhawer et al. , 2021b ; Lee and Pavlovic , 2021 ) have introduced disentangled latent variables z1 : M , which are marginally independent of a shared latent variable g and represent structure specific to modality i ( Fig . 2b ) . We argue that a disentangled latent representation may neglect the dependencies between shared and modality-exclusive variations . As a specific example , consider captioning ( modality 2 ) pictures of birds ( modality 1 ) as in Fig . 1a . The images of seabirds can have sky or water in the background , while those of songbirds often display forest backgrounds . The captions focus on the bird and thereby easily ignore such variations . Therefore , the shared pattern across modalities ( bird species ) dictates these modality-exclusive variations . Consider a generative model where g represents shared structure and z1 image variations . When the two latent variables g and z1 are independent ( Fig . 2b ) , the decoder that maps from latent variables onto images has to learn two distinct functions - one for seabirds ( where the independent variations determine the sky or water background ) and another for songbirds ( where the independent variations determine the forest background ) . We argue that this aspiration is theoretically learnable but practically challenging because it may require a large model with disproportional capacity ( that could generalize poorly , is challenging to train , or requires abundant data ) . In contrast , we suggest that a hierarchical latent representation is an inductive bias that captures realistic data variations and guides learning . The edges between g and z1 : M give the model the flexibility to decide which unimodal variations to capture given a shared latent concept . For example , a hierarchical model could adaptively learn that z1 for seabirds solely captures sky or water background variations while z1 for songbirds captures forest background variations . This can help the decoder to share features between seabirds and songbirds . Contributions ( i ) We propose a hierarchical multimodal VAE ( HMVAE ) that incorporates a latent hierarchy , where the shared variable g resides at the top and lower variables z complement unimodal variations . ( ii ) We compare the HMVAE to several state-of-the-art baselines on the CUB and the Oxford Flower datasets . We report improved quantitative and qualitative measures in terms of semantic coherence and heterogeneity . 2 BACKGROUND AND RELATED WORK . Variational Autoencoders ( VAEs ) ( Kingma and Welling , 2013 ; Rezende et al. , 2014 ) are deep generative models that represent the joint distribution pθ ( x , z ) using neural networks with parameters θ , where x ∈ RD is the observed vector and z ∈ RD′ is the latent vector . As the true posterior pθ ( z|x ) is intractable , an approximate posterior qφ ( z|x ) with parameters φ is used for inference . The parameters θ , φ are usually trained by maximizing the evidence lower bound ( ELBO ) for the marginal likelihood : Eqφ ( z|x ) [ log pθ ( x , z ) qφ ( z|x ) ] ≤ log pθ ( x ) . ( 1 ) Many efforts have been made to increase the expressivity of VAEs , e.g. , by improving the prior of z ( Chen et al. , 2016 ; Tomczak and Welling , 2018 ) , and by introducing auxiliary latent variables ( Maaløe et al. , 2016 ) . Our approach lies in the latter paradigm . Hierarchical VAEs ( HVAEs ) ( Rezende et al. , 2014 ) have a hierarchical latent structure , where the topmost latent variable , drawn from an unconditional prior pθ ( zL ) , represents global features . The lower variables , drawn from conditional priors pθ ( zi|zi+1 ) , complement local characteristics in order to reconstruct the observed data via pθ ( x|z1 ) . Sønderby et al . ( 2016 ) found the tendency for HVAEs to not effectively use higher-level latent variables when they are trained using inference networks of the form qφ ( zi+1|zi ) . They proposed to first infer the top-level variable zL directly with qφ ( zL|x ) and then infer the intermediate variables { zi } with both bottom-up and top-down information through qφ , θ ( zi|zi+1 , x ) for hierarchical level i ∈ { 0 , ... , L− 1 } . The bottom-up and top-down information for hierarchical level i are encoded as hidden variables through neural networks : bi = fφ , i ( x ) and ti = fφ , θ , i ( zi+1 ) . We make use of this idea in our work , concatenate both hidden states and pass the result to an MLP that parameterizes the respective posterior ( see App . C.1 for further details ) . This inference procedure can result in im- proved density estimation and sample generation performance ( Sønderby et al. , 2016 ; Maaløe et al. , 2019 ; Vahdat and Kautz , 2020 ; Child , 2021 ) . Multimodal VAEs represent M modalities x1 : M = { x1 , ... , xM } that are assumed to be conditionally independent given a shared representation g : pθ ( x1 : M |g ) = ∏M m=1 pθ ( xi|g ) . Motivated by the factorization of the true posterior , Wu and Goodman ( 2018 ) used a product of experts ( PoE ) formulation to parameterize the approximate posterior distribution over the shared latent variable , where each expert characterizes information within a modality : qφ ( g|x1 : M ) ∝ pθ ( g ) ∏M m=1 qφ ( g|xm ) . ( 2 ) When all experts are Gaussian , the product posterior of any combination of experts is easily computed . Shi et al . ( 2019 ) showed that an inference model with a Gaussian PoE formulation can be miscalibrated , i.e. , overconfident experts qφ ( g|xi ) with low densities dominate the product qφ ( g|x1 : M ) . They instead used a mixture of experts ( MoE ) formulation : qφ ( g|x1 : M ) = 1M ∑M m=1 qφ ( g|xm ) . ( 3 ) With the MoE formulation , optimization is analogous to a vote , which can avoid unreasonable dominance by a single modality . Mahajan et al . ( 2020 ) applied normalizing flows ( Rezende and Mohamed , 2015 ) to map between the latent spaces of g1 and g2 in a VAE , where qφ ( gi|xi ) constitutes the posterior over gi . Normalizing flows can be more expressive than other distribution choices , such as Gaussians , which can help to represent complex multimodal relationships . However , optimizing the ELBO requires tractable sampling and density estimation in either direction , for example , by using coupling layers ( Dinh et al. , 2014 ; 2017 ) . This can be a challenging constraint in practice . Vasco et al . ( 2020 ) proposed the MHVAE , which also incorporates a hierarchical generative model . Note that both works were developed independently and offer complementary perspectives . We summarize the differences in the following : first , the MHVAE ’ s generative model is limited to two hierarchical levels ( like Fig . 3a , but for two levels ) . Our proposed generative model supports arbitrary hierarchical depth . Second , the MHVAE ’ s inference model is non-hierarchical ( Fig . 2c , Eq . 9 from the original paper ) . Our proposed inference model is hierarchical ( Fig . 3b ) Third , the MHVAE ’ s posteriors over z are unimodal . Our proposed “ top-down ” inference model computes the latent variables in the same order as the generative model . Therefore , the respective posteriors depend on all modalities . Fourth , the MHVAE ’ s inference network drops modality-specific hidden states at random during training . We use a mixture of experts posterior . Fifth , Vasco et al . ( 2020 ) evaluate their model on surjective data where single labels or attributes describe classes of images , i.e. , there is not much variation in a single modality but lots in the other . We focus on a different data scenario where each modality has a large degree of variation . 3 MULTIMODAL LATENT HIERARCHIES . We propose a hierarchical multimodal VAE ( HMVAE ) that captures the generative process of multiple modalities . The hyperparameter L ( m ) ≥ 2 defines the number of hierarchical levels for modality m. If L ( m ) = 2 , the hierarchy solely expands between the shared and unimodal variables . If L ( m ) > 2 , the model incorporates additional unimodal hierarchies . Generative model We assume conditional independence of modalities given a shared variable g ( see Fig . 3a portraying the case of two modalities and three hierarchical levels ) : pφ , θ ( x , g , z ) = ∏M m=1 pθ ( xm|zm,1 ) · ( ∏L ( m ) −2 i=1 pφ , θ ( zm , i|zm , i+1 ) ) pφ , θ ( zm , L ( m ) −1|g ) pθ ( g ) . ( 4 ) The prior for the shared variable g is isotropic Gaussian . All conditional distributions for the intermediate variables { zm,1 : L ( m ) −1 } for m ∈ { 1 , . . .M } are also isotropic Gaussian , where mean and variance are parameterized using neural networks . We use the hierarchical formulation introduced in § 2 where some parameters are shared across the generative and inference networks . The conditional distributions for the observed variables { xm } can , for example , be parameterized using isotropic Gaussian distributions ( for continuous-valued data ) or Bernoulli distributions ( for binary data ) . Inference model We extend Sønderby et al . ( 2016 ) ’ s hierarchical approach described in § 2 to the multimodal case ( see Fig . 3a depicting the case of two modalities and three hierarchical levels ) : qφ , θ ( g , z|x1 : M ) = qφ ( g|x1 : M ) · M∏ m=1 qφ , θ ( zm , L ( m ) −1|g , xm ) L ( m ) −2∏ i=1 qφ , θ ( zm , i|zm , i+1 , xm ) . ( 5 ) All distributions except the first factor qφ ( g|x1 : M ) are isotropic Gaussian with mean and variance inferred through neural networks from the conditional variables . The network employs skip connections from x1 : M to g. The inference and generative networks share some parameters in the topdown networks that point from g to the lowest unimodal variable zm , i=0 . This architecture can reinforce hierarchical decomposition ( Sønderby et al. , 2016 ) . Furthermore , it ensures that the unimodal latent variables are conditioned on all modalities ( as indicated by the red edges in Fig . 3b ) which helps learn crossmodal relationships . Section 2 and App . C.1 provide further details on the hierarchical architecture . We parameterize the posterior distribution over the shared latent variable qφ ( g|x1 : M ) using a mixture of experts formulation ( Eq . 3 ) . We follow Shi et al . ( 2019 ) and assume that several modalities can entail modality-exclusive variations , i.e. , some variations for modality i do not correlate with variations in modality j 6= i. Optimization We train the HMVAE by maximizing the ELBO with stochastic backpropagation : ELBO : = Eqφ , θ ( g , z|x1 : M ) [ log pφ , θ ( x1 : M , g , z ) qφ , θ ( g , z|x1 : M ) ] ≤ log pθ ( x1 : M ) . ( 6 ) Further motivation Figure 4 visualizes how multimodal VAEs could capture the data from the example in the Introduction ( Fig . 1 ) . The challenge lies in representing crossmodal dependencies – not the joint distribution . That is because one modality can never inform about the modality-exclusive variations of another modality . Daunhawer et al . ( 2021a ) demonstrated that this problem constitutes a core limitation across the multimodal VAE literature . In a non-hierarchical VAE , crossmodal generation is indeed challenging because g must capture all variations . This becomes problematic when generating pθ ( xi|g ) from qφ ( g|xj 6=i ) because the latter misses information about xi . In contrast , in a two-level hierarchy , z could theoretically capture the entirety of modality-exclusive variations . However , the model may choose to represent some of these variations in g to capture the hierarchical dependencies within the modality-exclusive variations . A deep hierarchy could circumvent this Problem : crossmodal generation Problem : conditional independent variations within z problem by adding infinitesimal small modality-exclusive variations per hierarchical level ( in the limit ) . Note that Fig . 4 demonstrates one set of possible hierarchical representations . A model could also utilize its degrees of freedom differently . For example , the deep model may incorporate shared structure and modality-exclusive variations for the more complex modality in g. In general , we expect a ( deep ) hierarchy to be beneficial for representing complex data such as image or text modalities .
This paper proposes a new type of model called a hierarchical multimodal VAE (HMVAE) that captures modality-specific variations using latent variables dependent on a shared top-level variable, in a manner similar to a multi-layer hierarchy. Their assumption is that modality-specific variations can sometimes depend on the structure shared across modalities which motivates their design decision to have modality-specific variables dependent on a shared top-level multimodal variable, which is in contrast to existing works on multimodal generative models that factorize into marginally independent latent variables to capture modality-specific variations (in other words not depending on a shared top-level multimodal variable). Experimental results show promising performance on the CUB and the Oxford Flower datasets and outperform existing methods in sample generation quality and quantitative measures as the held-out log-likelihood.
SP:7e0bdc833324174b53617123d8268988c0263a34
The Infinite Contextual Graph Markov Model
1 INTRODUCTION . It can be argued that one of the most daunting processes in machine learning is the selection of appropriate hyper-parameters for the task at hand . Indeed , due to the data-dependent nature of the learning problem , there usually exists no single model configuration that works well in all contexts . The most straightforward approach to mitigate this issue has typically been to rely on standard model selection techniques such as grid and random searches ( Bergstra & Bengio , 2012 ) , where the range of values to try are fixed a priori by the user . Nonetheless , there has always been an interest in alternative methods that automatically choliteratureose the “ right ” values for some hyper-parameters ( Gershman & Blei , 2012 ; He et al. , 2021 ) . In the Bayesian nonparametric ( BNP ) literature , which is of particular interest for this work , the complexity of Bayesian models automatically grows with the data ( Teh et al. , 2006 ) , e.g. , a BNP mixture model can adjust the number of its mixtures to better fit the empirical data distribution , thus freeing the user from the burden of choosing the most important ( if not all ) hyper-parameters . In recent years , much research effort has been devoted to the theoretical and practical development of Deep Graph Networks ( DGNs ) , which originated from Micheli ( 2009 ) ; Scarselli et al . ( 2009 ) . DGNs can deal with graphs of varying topology without the need for human intervention , and they rely on local and iterative processing of information commonly known as message passing ; for a thorough description of some of the most popular DGNs in the literature ( and of the more general graph representation learning field ) we refer the reader to recent surveys on the topic ( Bronstein et al. , 2017 ; Battaglia et al. , 2018 ; Bacciu et al. , 2020b ; Wu et al. , 2020 ) . Despite most of these methods belonging to the neural world , the Contextual Graph Markov Model ( CGMM ) stands out as a deep , unsupervised , constructive and fully probabilistic model that has shown competitive performances on downstream graph classification tasks ( Bacciu et al. , 2018 ; 2020a ) . CGMM trains a stack of Bayesian networks , where each layer is conditioned on the frozen posteriors of the nodes of the graph computed at previous layers . Each layer optimizes the likelihood of the data using the Expectation Maximization ( EM ) algorithm ( Moon , 1996 ) with closed-form solutions . Like its neural counterparts , for which the number of hidden units in each layer has typically been selected as a hyper-parameter , CGMM relies on model selection to choose the “ reasonable ” number of hidden states associated with the categorical latent variables . Differently from the neural methods though , CGMM is amenable to a BNP extension , as each layer is essentially a conditional mixture model . The main challenge we tackle in this work is the adaptation of CGMM to the elegant theoretical framework of BNP methods , in order to automatize the choice of its hyper-parameters , e.g. , the number of states . The principal difficulty lies in how to handle the variable-size number of neighbors of each node inside this framework , which in CGMM is solved by ( possibly weighted ) convex combinations of the neighbors ’ posteriors . The resulting model , called Infinite Contextual Graph Markov Model ( ICGMM ) , can generate as many latent states as needed to solve the unsupervised density estimation task at each layer . To the extent of our knowledge , this is the first Bayesian nonparametric model for adaptive graph processing . As a second contribution , we provide a faster implementation of our method that scales to the social datasets considered in this work while still providing state of the art results . We compare ICGMM against CGMM as well as end-to-end supervised methods on eight different graph classification tasks , following a fair , robust and reproducible experimental procedure ( Errica et al. , 2020 ) . Results show that ICGMM performs on par or better than the related models . We complement the analysis with studies on the effects of depth and generation of our model ’ s latent states . All in all , we believe that ICGMM is an important ( if not the first ) step towards a theoretically grounded and automatic construction of Deep Bayesian Graph Networks . 2 RELATED WORKS . The fundamental Bayesian nonparametric literature that is relevant to our work relates to the families of Dirichlet Processes ( DPs ) ( Gershman & Blei , 2012 ) and Hierarchical Dirichlet Processes ( HDPs ) ( Teh et al. , 2006 ) . In its most essential definition , a DP is a stochastic process that defines a probability distribution over other probability distributions . A DP is parametrized by a base distributionG0 , i.e. , the expected value of the process , and a scaling parameter α0 that controls the concentration of DP realizations aroundG0 ( Teh , 2010 ) . In particular , the Chinese Restaurant Process ( Aldous , 1985 ) , the Stick-breaking Construction ( Sethuraman , 1994 ) and the Pòlya urn scheme ( Hoppe , 1984 ) are all alternative ways to formalize a DP . Moving to HDPs is conceptually straightforward , in that it considers the base distributionG0 as a draw from another DP parametrized by a base distribution H and a scaling parameter γ . For a detailed treatment of learning with DP and HDPs , the reader can check a number of tutorials and surveys ( Teh et al. , 2006 ; Orbanz & Teh , 2010 ; Gershman & Blei , 2012 ) . Our work shares similarities with the Infinite Hidden Markov Model for temporal series ( Beal et al. , 2002 ) , with the fundamental differences that causality assumptions have to be relaxed to deal with graphs and that the hidden variables ’ distributions are conditioned on a varying number of observations . Most of the recent advances of the graph representation learning field are based on the so called feedforward DGNs ( Bacciu et al. , 2020b ) . These models rely on “ spatial ” graph convolutional layers , i.e. , the state of each node in the graph is determined by applying a permutation invariant function to its neighboring states computed at the previous layers . Combined with the depth of the architecture , these models propagate contextual information across the graph , a process also known as “ message passing ” ( Gilmer et al. , 2017 ) . However , to the best of our knowledge , the only neural method for graphs that automatically constructs part of its architecture in a principled way is the pioonering work of Micheli ( 2009 ) . In fact , the Neural Network for Graphs ( NN4G ) , known to be the first spatial DGN , relies on the Cascade Correlation learning algorithm ( Fahlman & Lebiere , 1990 ) to determine the number of layers to use for the task under investigation . Instead , despite being loosely related to our work , AutoML methods for graphs are yet another way to automatize the selection of all hyper-parameters of a DGN ( He et al. , 2021 ) . In particular , the Auto-GNN technique relies on Neural Architecture Search to discover , based on performance trends , an adequate configuration for the supervised task ( Zhou et al. , 2019 ) . We differ from these approaches in two fundamental respects : first , we build upon theoretical grounds rooted in the BNP literature ; secondly , we determine the right number of states in a completely unsupervised fashion . In what follows , we provide a formalization of the Infinite Contextual Graph Markov Model . Apart from the technical details , our hope is to show how the cross-fertilization of ideas from different research fields can help us advance the state of the art , both in the theoretical and empirical sense . 3 METHOD . This Section introduces the details of our method . Since we borrow ideas from two relatively distant fields , we define a unified mathematical notation and jargon as well as a high-level overview of the CGMM and HDP models to ease the subsequent exposition . We define a graph as a tuple g = ( Vg , Eg , Xg ) where Vg is the set of entities ( also referred to as nodes or vertices ) , Eg is the set of oriented edges ( u , v ) connecting node u to v , and the symbol Xg stands for the set of node attributes associated with the graph g. Also , the neighborhood of a node u is the set of nodes connected to u , i.e. , Nu = { v ∈ Vg| ( v , u ) ∈ Eg } . For the purpose of this work , we will define the ( categorical or continuous ) node feature of a node u with the term xu ∈ Xg . 3.1 BASICS OF CGMM . To best understand how and why this work extends CGMM , we now give a brief but essential description of its main characteristics . CGMM is , first and foremost , a deep architecture for the adaptive processing of graphs . Like other DGNs , it maps the entities of a graph , if not the graph itself , into latent representations . More specifically , we can get one of such representations for each layer of the architecture and then concatenate all of them to obtain richer node and graph embeddings . The latter is usually obtained as a global aggregation of the former . The second peculiarity of CGMM is that it is constructive , i.e. , trained in an incremental fashion : after one layer is trained , another one can be stacked atop of it and trained using the frozen outputs of the previous layer . This idea is borrowed from NN4G ( Micheli , 2009 ) , and it allows CGMM to relax the mutual dependencies between latent variables in a cyclic graph . However , because the local and iterative message passing mechanism used by spatial methods ( Micheli , 2009 ; Kipf & Welling , 2017 ) is responsible for information propagation across the graph , this relaxation is not restrictive . Thirdly , the node/graph embedding construction is fully probabilistic and unsupervised , since layer ` is represented as the Bayesian network on the left hand-side of Figure 1 . A latent variable q ` u is attached to each node u , and it is responsible for the the generation of the node feature xu . To take into account structural information , the hidden state q ` u is conditioned on the neighboring hidden states computed at the previous layer , i.e. , the set { q ` −1v | v ∈ Nu } . Importantly , the constructive approach allows us to treat the hidden ( frozen ) states of the previous layer as observable variables . Each layer is trained to fit the data distribution of node features using the EM algorithm , thus guaranteeing the convergence to a local minima . Once inference is performed , the state of each node is frozen and we can move to the subsequent layer . Lastly , the embedding of each node at layer ` is encoded as the posterior of its hidden state . 3.2 BASICS OF HDP . The HDP is a Bayesian nonparametric prior for the generation of grouped data using different infinite mixture models with shared mixture components . Let { x1 , x2 , . . . } be a set of observations that are grouped into J groups , i.e. , each observation xu belongs to the group ju ∈ { 1 , . . . , J } . Using the stick-breaking representation ( Sethuraman , 1994 ) , the HDP mixture model that generates the observations can be defined as ( Teh et al. , 2006 ) : β | γ ∼ Stick ( γ ) qu | ju , ( πj ) Jj=1 ∼ πju πj | β , α0 ∼ DP ( α0 , β ) xu | qu , ( θc ) ∞c=1 ∼ F ( θqu ) θ |H ∼H , ( 1 ) where F ( θqu ) denotes the emission distribution , parametrized by θqu , that generates the observation xu . The latent state qu indicates which mixture component should be used to generate xu . The value of qu is sampled from the distribution πju , which stands for the mixture weights of group ju . All ( πj ) J j=1 are obtained from a DP with concentration parameter α0 and base distribution β . Notably , all groups ’ mixture weights are defined on the same set of mixture components , meaning there is a form of parameter sharing across different groups . Finally , we sample the distribution β via the stick-breaking process Stick ( γ ) of Sethuraman ( 1994 ) . To generate a possibly infinite number of emission distributions , we exploit a prior distributionH that allows us to create new mixture components on demand . Thanks to the stick-breaking construction , even though an infinite number of mixture components can be used , only a finite number of them is istantiated during the inference phase . Hereinafter , we indicate with the symbol C the number of mixture components that are chosen by the HDP at inference time .
This paper is an extension of the Contextual Graph Markov Model, a deep unsupervised probabilistic approach for modeling graph data. The key idea is to leverage Hierarchical Dirichlet Processes, which enables the proposed approach to automatically choose the size of each layer’s latent representation. The authors conduct experiment on graph classification tasks, and the results are quite promising.
SP:0d10eeb943cf56da483878662ceeb5c6ec09df2c
The Infinite Contextual Graph Markov Model
1 INTRODUCTION . It can be argued that one of the most daunting processes in machine learning is the selection of appropriate hyper-parameters for the task at hand . Indeed , due to the data-dependent nature of the learning problem , there usually exists no single model configuration that works well in all contexts . The most straightforward approach to mitigate this issue has typically been to rely on standard model selection techniques such as grid and random searches ( Bergstra & Bengio , 2012 ) , where the range of values to try are fixed a priori by the user . Nonetheless , there has always been an interest in alternative methods that automatically choliteratureose the “ right ” values for some hyper-parameters ( Gershman & Blei , 2012 ; He et al. , 2021 ) . In the Bayesian nonparametric ( BNP ) literature , which is of particular interest for this work , the complexity of Bayesian models automatically grows with the data ( Teh et al. , 2006 ) , e.g. , a BNP mixture model can adjust the number of its mixtures to better fit the empirical data distribution , thus freeing the user from the burden of choosing the most important ( if not all ) hyper-parameters . In recent years , much research effort has been devoted to the theoretical and practical development of Deep Graph Networks ( DGNs ) , which originated from Micheli ( 2009 ) ; Scarselli et al . ( 2009 ) . DGNs can deal with graphs of varying topology without the need for human intervention , and they rely on local and iterative processing of information commonly known as message passing ; for a thorough description of some of the most popular DGNs in the literature ( and of the more general graph representation learning field ) we refer the reader to recent surveys on the topic ( Bronstein et al. , 2017 ; Battaglia et al. , 2018 ; Bacciu et al. , 2020b ; Wu et al. , 2020 ) . Despite most of these methods belonging to the neural world , the Contextual Graph Markov Model ( CGMM ) stands out as a deep , unsupervised , constructive and fully probabilistic model that has shown competitive performances on downstream graph classification tasks ( Bacciu et al. , 2018 ; 2020a ) . CGMM trains a stack of Bayesian networks , where each layer is conditioned on the frozen posteriors of the nodes of the graph computed at previous layers . Each layer optimizes the likelihood of the data using the Expectation Maximization ( EM ) algorithm ( Moon , 1996 ) with closed-form solutions . Like its neural counterparts , for which the number of hidden units in each layer has typically been selected as a hyper-parameter , CGMM relies on model selection to choose the “ reasonable ” number of hidden states associated with the categorical latent variables . Differently from the neural methods though , CGMM is amenable to a BNP extension , as each layer is essentially a conditional mixture model . The main challenge we tackle in this work is the adaptation of CGMM to the elegant theoretical framework of BNP methods , in order to automatize the choice of its hyper-parameters , e.g. , the number of states . The principal difficulty lies in how to handle the variable-size number of neighbors of each node inside this framework , which in CGMM is solved by ( possibly weighted ) convex combinations of the neighbors ’ posteriors . The resulting model , called Infinite Contextual Graph Markov Model ( ICGMM ) , can generate as many latent states as needed to solve the unsupervised density estimation task at each layer . To the extent of our knowledge , this is the first Bayesian nonparametric model for adaptive graph processing . As a second contribution , we provide a faster implementation of our method that scales to the social datasets considered in this work while still providing state of the art results . We compare ICGMM against CGMM as well as end-to-end supervised methods on eight different graph classification tasks , following a fair , robust and reproducible experimental procedure ( Errica et al. , 2020 ) . Results show that ICGMM performs on par or better than the related models . We complement the analysis with studies on the effects of depth and generation of our model ’ s latent states . All in all , we believe that ICGMM is an important ( if not the first ) step towards a theoretically grounded and automatic construction of Deep Bayesian Graph Networks . 2 RELATED WORKS . The fundamental Bayesian nonparametric literature that is relevant to our work relates to the families of Dirichlet Processes ( DPs ) ( Gershman & Blei , 2012 ) and Hierarchical Dirichlet Processes ( HDPs ) ( Teh et al. , 2006 ) . In its most essential definition , a DP is a stochastic process that defines a probability distribution over other probability distributions . A DP is parametrized by a base distributionG0 , i.e. , the expected value of the process , and a scaling parameter α0 that controls the concentration of DP realizations aroundG0 ( Teh , 2010 ) . In particular , the Chinese Restaurant Process ( Aldous , 1985 ) , the Stick-breaking Construction ( Sethuraman , 1994 ) and the Pòlya urn scheme ( Hoppe , 1984 ) are all alternative ways to formalize a DP . Moving to HDPs is conceptually straightforward , in that it considers the base distributionG0 as a draw from another DP parametrized by a base distribution H and a scaling parameter γ . For a detailed treatment of learning with DP and HDPs , the reader can check a number of tutorials and surveys ( Teh et al. , 2006 ; Orbanz & Teh , 2010 ; Gershman & Blei , 2012 ) . Our work shares similarities with the Infinite Hidden Markov Model for temporal series ( Beal et al. , 2002 ) , with the fundamental differences that causality assumptions have to be relaxed to deal with graphs and that the hidden variables ’ distributions are conditioned on a varying number of observations . Most of the recent advances of the graph representation learning field are based on the so called feedforward DGNs ( Bacciu et al. , 2020b ) . These models rely on “ spatial ” graph convolutional layers , i.e. , the state of each node in the graph is determined by applying a permutation invariant function to its neighboring states computed at the previous layers . Combined with the depth of the architecture , these models propagate contextual information across the graph , a process also known as “ message passing ” ( Gilmer et al. , 2017 ) . However , to the best of our knowledge , the only neural method for graphs that automatically constructs part of its architecture in a principled way is the pioonering work of Micheli ( 2009 ) . In fact , the Neural Network for Graphs ( NN4G ) , known to be the first spatial DGN , relies on the Cascade Correlation learning algorithm ( Fahlman & Lebiere , 1990 ) to determine the number of layers to use for the task under investigation . Instead , despite being loosely related to our work , AutoML methods for graphs are yet another way to automatize the selection of all hyper-parameters of a DGN ( He et al. , 2021 ) . In particular , the Auto-GNN technique relies on Neural Architecture Search to discover , based on performance trends , an adequate configuration for the supervised task ( Zhou et al. , 2019 ) . We differ from these approaches in two fundamental respects : first , we build upon theoretical grounds rooted in the BNP literature ; secondly , we determine the right number of states in a completely unsupervised fashion . In what follows , we provide a formalization of the Infinite Contextual Graph Markov Model . Apart from the technical details , our hope is to show how the cross-fertilization of ideas from different research fields can help us advance the state of the art , both in the theoretical and empirical sense . 3 METHOD . This Section introduces the details of our method . Since we borrow ideas from two relatively distant fields , we define a unified mathematical notation and jargon as well as a high-level overview of the CGMM and HDP models to ease the subsequent exposition . We define a graph as a tuple g = ( Vg , Eg , Xg ) where Vg is the set of entities ( also referred to as nodes or vertices ) , Eg is the set of oriented edges ( u , v ) connecting node u to v , and the symbol Xg stands for the set of node attributes associated with the graph g. Also , the neighborhood of a node u is the set of nodes connected to u , i.e. , Nu = { v ∈ Vg| ( v , u ) ∈ Eg } . For the purpose of this work , we will define the ( categorical or continuous ) node feature of a node u with the term xu ∈ Xg . 3.1 BASICS OF CGMM . To best understand how and why this work extends CGMM , we now give a brief but essential description of its main characteristics . CGMM is , first and foremost , a deep architecture for the adaptive processing of graphs . Like other DGNs , it maps the entities of a graph , if not the graph itself , into latent representations . More specifically , we can get one of such representations for each layer of the architecture and then concatenate all of them to obtain richer node and graph embeddings . The latter is usually obtained as a global aggregation of the former . The second peculiarity of CGMM is that it is constructive , i.e. , trained in an incremental fashion : after one layer is trained , another one can be stacked atop of it and trained using the frozen outputs of the previous layer . This idea is borrowed from NN4G ( Micheli , 2009 ) , and it allows CGMM to relax the mutual dependencies between latent variables in a cyclic graph . However , because the local and iterative message passing mechanism used by spatial methods ( Micheli , 2009 ; Kipf & Welling , 2017 ) is responsible for information propagation across the graph , this relaxation is not restrictive . Thirdly , the node/graph embedding construction is fully probabilistic and unsupervised , since layer ` is represented as the Bayesian network on the left hand-side of Figure 1 . A latent variable q ` u is attached to each node u , and it is responsible for the the generation of the node feature xu . To take into account structural information , the hidden state q ` u is conditioned on the neighboring hidden states computed at the previous layer , i.e. , the set { q ` −1v | v ∈ Nu } . Importantly , the constructive approach allows us to treat the hidden ( frozen ) states of the previous layer as observable variables . Each layer is trained to fit the data distribution of node features using the EM algorithm , thus guaranteeing the convergence to a local minima . Once inference is performed , the state of each node is frozen and we can move to the subsequent layer . Lastly , the embedding of each node at layer ` is encoded as the posterior of its hidden state . 3.2 BASICS OF HDP . The HDP is a Bayesian nonparametric prior for the generation of grouped data using different infinite mixture models with shared mixture components . Let { x1 , x2 , . . . } be a set of observations that are grouped into J groups , i.e. , each observation xu belongs to the group ju ∈ { 1 , . . . , J } . Using the stick-breaking representation ( Sethuraman , 1994 ) , the HDP mixture model that generates the observations can be defined as ( Teh et al. , 2006 ) : β | γ ∼ Stick ( γ ) qu | ju , ( πj ) Jj=1 ∼ πju πj | β , α0 ∼ DP ( α0 , β ) xu | qu , ( θc ) ∞c=1 ∼ F ( θqu ) θ |H ∼H , ( 1 ) where F ( θqu ) denotes the emission distribution , parametrized by θqu , that generates the observation xu . The latent state qu indicates which mixture component should be used to generate xu . The value of qu is sampled from the distribution πju , which stands for the mixture weights of group ju . All ( πj ) J j=1 are obtained from a DP with concentration parameter α0 and base distribution β . Notably , all groups ’ mixture weights are defined on the same set of mixture components , meaning there is a form of parameter sharing across different groups . Finally , we sample the distribution β via the stick-breaking process Stick ( γ ) of Sethuraman ( 1994 ) . To generate a possibly infinite number of emission distributions , we exploit a prior distributionH that allows us to create new mixture components on demand . Thanks to the stick-breaking construction , even though an infinite number of mixture components can be used , only a finite number of them is istantiated during the inference phase . Hereinafter , we indicate with the symbol C the number of mixture components that are chosen by the HDP at inference time .
In this paper, the authors propose a mechanism to automate the size selection of each latent representation layer of the Contextual Graph Markov model. The model automatically adjusts the size of the model parameters mitigating the expensive model selection. Moreover, the authors introduce some techniques to scale the proposed solution.
SP:0d10eeb943cf56da483878662ceeb5c6ec09df2c
Semi-supervised Offline Reinforcement Learning with Pre-trained Decision Transformers
Pre-training deep neural network models using large unlabelled datasets followed by finetuning them on small task-specific datasets has emerged as a dominant paradigm in natural language processing ( NLP ) and computer vision ( CV ) . Despite the widespread success , such a paradigm has remained atypical in reinforcement learning ( RL ) . In this paper , we investigate how we can leverage large reward-free ( i.e . task-agnostic ) offline datasets of prior interactions to pre-train agents that can then be fine-tuned using a small rewardannotated dataset . To this end , we present Pre-trained Decision Transformer ( PDT ) , a simple yet powerful algorithm for semi-supervised Offline RL . By masking reward tokens during pre-training , the transformer learns to autoregressivley predict actions based on previous state and action context and effectively extracts behaviors present in the dataset . During fine-tuning , rewards are un-masked and the agent learns the set of skills that should be invoked for the desired behavior as per the reward function . We demonstrate the efficacy of this simple and flexible approach on tasks from the D4RL benchmark with limited reward annotations . 1 INTRODUCTION . Over the past decade , we have seen tremendous progress in artificial intelligence , due in large part to our ability to train deep neural network models using massive amounts of data . The initial success of training such deep models was achieved by using large labeled datasets ( e.g . ImageNet ( Deng et al. , 2009 ) ) , which provided rich and direct supervision for various tasks ( e.g . in CV and NLP ) . However , the need for human annotations limited the scalability of such an approach , especially for tasks requiring detailed annotations like instance segmentation or machine translation ( Lin et al. , 2014 ; Bojar et al. , 2016 ) . Self-supervision has emerged as a dominant paradigm to overcome this limitation , where deep models are pre-trained using large unlabeled datasets , followed by fine-tuning with a small labelled dataset , considerably reducing the annotation requirements ( Chen et al. , 2020 ; He et al. , 2020 ; Grill et al. , 2020 ) . Analogously , progress in RL has required human annotations in the form of detailed reward functions . While some exceptions exist where the environment computes the rewards ( e.g . games like Atari and Go ) ; in most real-world applications of RL , a human is required to design reward functions or annotate frames for rewards . Such well-engineered reward functions are crucial for an agent ’ s ability to learn successful policies , which is hard to scale . At the same time , collecting reward-free and task-agnostic datasets for RL is becoming increasingly easier through use of offline datasets ( Fu et al. , 2020 ) , tele-operation and play datasets ( Rajeswaran et al. , 2018 ; Lynch et al. , 2019 ) , or reward-free exploration ( Pathak et al. , 2017 ; Eysenbach et al. , 2018 ; Liu & Abbeel , 2021 ) . In this work , we aim to design RL agents that can utilize large reward-free datasets for unsupervised pre-training as well as small reward-annotated datasets for supervised finetuning to solve a variety of downstream tasks . To this end , we consider the problem of semi-supervised offline RL , which is conducive for investigating our research question . In this setting , the agent has access to a large reward-free ( task-agnostic ) offline dataset of environment interactions . Such datasets are easier to scale than reward-labeled data and can be re-used for several downstream tasks with different rewards , similar to the trend of pre-training on unlabeled data and adapting to supervised downstream tasks in CV ( Dosovitskiy et al. , 2020 ) and NLP ( Devlin et al. , 2018 ; Brown et al. , 2020 ) . The agent further has access to a small dataset containing reward annotations , which anchors the agent to learn the desired behavior or task . For this setting , we introduce a new approach : Pre-trained Decision Transformers ( PDT ) , an architectural extension to the recently introduced Decision Transformer ( DT ; Chen et al . ( 2021 ) ) , to make it amenable to semi-supervised ( offline ) RL . DT frames RL as a sequence modeling task using an autoregressive and causally masked transformer model , and was shown to be competitive with traditional RL algorithms based on temporal difference learning . As shown in Figure 1 , our framework extends DT and consists of two steps : pre-training and fine-tuning . First , from a large and fixed offline data , we use the state and action context of trajectories to predict the next actions autoregressively with the DT architecture . To accommodate fine-tuning with reward signals , during this pre-training step , we mask the reward tokens by zeroing them out as well as modifying the causal mask of the self-attention layers to generate actions without reward tokens . This can enable the model to implicitly learn the skills present in the offline un-labeled dataset . Then in the fine-tuning step , we un-mask the reward tokens and fine-tune the transformer end-to-end , predicting both reward and action tokens . This allows the agent to use the information present in the small reward-annotated dataset to adapt its set of skills towards achieving high rewards in the downstream task . We summarize our contributions as follows : 1 . We propose a new semi-supervised offline RL setting to bring RL closer to the self-supervised learning paradigm in CV and NLP . 2 . We introduce Pre-trained Decision Transformers ( PDT ) - an extension of the recently proposed Decision Transformers which masks the reward tokens during pre-training and can automatically generate reward-to-gos during evaluation . 3 . We show how PDT can efficiently be fine-tuned for a range of diverse downstream tasks using the same pre-trained model in a few-shot manner , achieving leading aggregate performance on D4RL environments in the low-label regime . 4 . We provide insight into how different parts of PDT contribute to the final performance . 2 RELATED WORK . Behavioral Cloning ( BC ) . When a reward-free but expert-quality dataset is available , imitation learning is often considered as a simple and yet powerful baseline for learning effective policies Osa et al . ( 2018 ) ; Rahmatizadeh et al . ( 2018 ) . Our work differs in the motivation to utilize sub-optimal reward-free experience in the pre-training phase of the agent . Offline RL . Offline RL is a paradigm for RL where agents are trained on offline datasets rather than directly interacting with the environment . The main issue in utilizing existing value-based off-policy RL algorithms in the offline setting is that these methods often erroneously produce optimistic value function estimates that can encourage the policy to pick actions that are out-of-distribution ( OOD ) compared to the offline dataset , resulting in failure . One way to mitigate this problem is to constraint the learned policy to be `` close '' to the data generating policy ( also known as behavior policy ) , by means of KL-divergence ( Jaques et al. , 2019 ; Wu et al. , 2019a ; Siegel et al. , 2020 ; Peng et al. , 2019a ) , Wasserstein distance ( Wu et al. , 2019a ) , or MMD ( Kumar et al. , 2019 ) , and then using the sampled actions from this constrained policy in Bellman backup or applying a value penalty based on these divergence measures . Another way is to be conservative on value estimation by adding penalty terms that enforces the models to learn a lower bound on the value functions ( Kumar et al. , 2020 ; Fujimoto et al. , 2019 ) . All these methods however require the offline datasets to be reward-annotated , and rely crucially on rewards for learning . Another line of work extends Model Based Reinforcement Learning ( MBRL ) methods to offline settings . Similar to model-free methods , existing MBRL methods can not be readily used in offline settings due to the distribution shift problem and require some safeguard to mitigate exploiting model inaccuracies . To mitigate this issue , Kidambi et al . ( 2020 ) and Yu et al . ( 2020 ) both incorporate pessimism in learning the dynamics and estimating uncertainties in reward learning . While the dynamics models themselves can be learned without reward functions , planning or policy learning using the learned model again relies crucially on having access to a reward function or a large reward-annotated dataset . Skill Extraction with Behavioral Priors . Methods that leverage behavioral priors utilize reward-free environment interactions to learn the set of task-agnostic skills via either maximizing likelihood estimates ( Pertsch et al. , 2020 ; Ajay et al. , 2020 ; Singh et al. , 2020 ) or maximizing mutual information ( Eysenbach et al. , 2018 ; Sharma et al. , 2019 ; Campos et al. , 2020 ) . Behavioral priors learned through maximum likelihood latent variable models have been used for structured exploration in RL ( Singh et al. , 2020 ) , to solve complex long-horizon tasks from sparse rewards ( Pertsch et al. , 2020 ) , and regularize offline RL policies ( Ajay et al. , 2020 ; Wu et al. , 2019b ; Peng et al. , 2019b ; Nair et al. , 2020 ) . However , these skill extraction algorithms have high architectural complexity , requiring a generative model to learn a latent skill space and an RL agent to learn policies over skills as its action space . In contrast , PDT has one simple architecture for both skill extraction by modeling state-action sequences and control by conditioning on the desired reward . 3 APPROACH . 3.1 PRELIMINARIES . Offline Reinforcement Learning . We consider the standard RL setting of a Markov Decision Process ( MDP ) defined by the tupleM = ( S , A , R , T ) . The MDP tuple consists of state s ∈ S , actions a ∈ A , rewards r = R ( s , a ) , and transition dynamics T ( s′|s , a ) . A policy in RL aims to pick actions that will maximize the expected total return of the MDP E [ ∑T t=0R ( st , at ) ] . One episode can be represented as a trajectory in the MDP consisting of states , actions and rewards τ = ( s1 , a1 , r1 , s2 , a2 , r2 , ... , sT , aT , rT ) . Offline RL is a setting of RL that seeks to find the optimal policy from a fixed offline dataset of interactions . D = { si , ai , ri } Ni=1 . As a result , this setting is more difficult than the standard RL setting due to lack of access to the environment , and therefore is prone to distribution shift . Decision Transformers . The usage of transformers ( Vaswani et al. , 2017 ) to tackle reinforcement learning problems has been a topic of recent study in Chen et al . ( 2021 ) and Janner et al . ( 2021 ) . In Decision Transformer , rather than learning explicit policies or value functions , trajectories are modeled as sequences of state , actions , and reward-to-go . A reward-to-go ( RTG ) is defined as the sum of future rewards R̂t = ∑T t′=t rt′ . Then the problem setting becomes a sequence modeling problem , where actions are generated conditioned on the past context , current state , and the desired reward-to-go . With a context of length H at current time step t ( i.e . C ( H ) t ) , the policy becomes : p ( at|st , R̂t−1 , at−1 , st−1 , ... R̂t−H , at−H , st−H︸ ︷︷ ︸ C ( H ) t ) The architecture of Decision Transformer first applies a linear token embedding to states , actions , and RTGs , and then adds a learned positional embbedding ( shared across tokens within the same time-step ) to differentiate between similar tokens at different positions along the sequence . It uses a GPT ( Radford et al. , 2019 ) architecture to learn a policy that auto-regressively generates actions based on prior context . The loss during training DT is a mean-squared error loss between predicted actions and ground truth actions .
### What is the Problem / Question? Pre-training has not been thoroughly explored within RL, so it is unknown how effectively task-free unlabeled datasets can be used for PT in an RL context. The authors present a simple strategy for such PT for RL that shows benefits with limited reward annotations. ### Why is it impactful? RL is a famously expensive discipline of ML which nonetheless has huge application areas and potential in theoretial and deployment contexts. Being able to translate the improvements offerred by pre-training to the RL context would help empower this already important technique significantly. ### Why is it hard? Why have previous approaches failed? There are several previous approaches to this problem, including some the authors readily identify in their study, such as the CQL+BC method which uses unlabeled data to perform semi-supervised offline RL by adapting policy prior data via unlabeled data. ### How do they solve it? The authors propose using the (already published) decision transformer model, but pre-training that model first on a dataset with only action sequences, without any reward information. ### How do they validate their solution? The authors compare their proposed framework against existing models, including both the traditional DT, a BC baseline, and the CQL and CQL+BC methods (the latter of which is a semi-supervised approach). They find slight improvements over existing methods in the extreme few-shot settings (10 observed trajectories at FT time), with further reduced gains at larger #s of observed trajectories, culminating in worse performance than traditional methods at full data scale.
SP:1e8a3732ecec3487984655db61d6d56e3f4e0426
Semi-supervised Offline Reinforcement Learning with Pre-trained Decision Transformers
Pre-training deep neural network models using large unlabelled datasets followed by finetuning them on small task-specific datasets has emerged as a dominant paradigm in natural language processing ( NLP ) and computer vision ( CV ) . Despite the widespread success , such a paradigm has remained atypical in reinforcement learning ( RL ) . In this paper , we investigate how we can leverage large reward-free ( i.e . task-agnostic ) offline datasets of prior interactions to pre-train agents that can then be fine-tuned using a small rewardannotated dataset . To this end , we present Pre-trained Decision Transformer ( PDT ) , a simple yet powerful algorithm for semi-supervised Offline RL . By masking reward tokens during pre-training , the transformer learns to autoregressivley predict actions based on previous state and action context and effectively extracts behaviors present in the dataset . During fine-tuning , rewards are un-masked and the agent learns the set of skills that should be invoked for the desired behavior as per the reward function . We demonstrate the efficacy of this simple and flexible approach on tasks from the D4RL benchmark with limited reward annotations . 1 INTRODUCTION . Over the past decade , we have seen tremendous progress in artificial intelligence , due in large part to our ability to train deep neural network models using massive amounts of data . The initial success of training such deep models was achieved by using large labeled datasets ( e.g . ImageNet ( Deng et al. , 2009 ) ) , which provided rich and direct supervision for various tasks ( e.g . in CV and NLP ) . However , the need for human annotations limited the scalability of such an approach , especially for tasks requiring detailed annotations like instance segmentation or machine translation ( Lin et al. , 2014 ; Bojar et al. , 2016 ) . Self-supervision has emerged as a dominant paradigm to overcome this limitation , where deep models are pre-trained using large unlabeled datasets , followed by fine-tuning with a small labelled dataset , considerably reducing the annotation requirements ( Chen et al. , 2020 ; He et al. , 2020 ; Grill et al. , 2020 ) . Analogously , progress in RL has required human annotations in the form of detailed reward functions . While some exceptions exist where the environment computes the rewards ( e.g . games like Atari and Go ) ; in most real-world applications of RL , a human is required to design reward functions or annotate frames for rewards . Such well-engineered reward functions are crucial for an agent ’ s ability to learn successful policies , which is hard to scale . At the same time , collecting reward-free and task-agnostic datasets for RL is becoming increasingly easier through use of offline datasets ( Fu et al. , 2020 ) , tele-operation and play datasets ( Rajeswaran et al. , 2018 ; Lynch et al. , 2019 ) , or reward-free exploration ( Pathak et al. , 2017 ; Eysenbach et al. , 2018 ; Liu & Abbeel , 2021 ) . In this work , we aim to design RL agents that can utilize large reward-free datasets for unsupervised pre-training as well as small reward-annotated datasets for supervised finetuning to solve a variety of downstream tasks . To this end , we consider the problem of semi-supervised offline RL , which is conducive for investigating our research question . In this setting , the agent has access to a large reward-free ( task-agnostic ) offline dataset of environment interactions . Such datasets are easier to scale than reward-labeled data and can be re-used for several downstream tasks with different rewards , similar to the trend of pre-training on unlabeled data and adapting to supervised downstream tasks in CV ( Dosovitskiy et al. , 2020 ) and NLP ( Devlin et al. , 2018 ; Brown et al. , 2020 ) . The agent further has access to a small dataset containing reward annotations , which anchors the agent to learn the desired behavior or task . For this setting , we introduce a new approach : Pre-trained Decision Transformers ( PDT ) , an architectural extension to the recently introduced Decision Transformer ( DT ; Chen et al . ( 2021 ) ) , to make it amenable to semi-supervised ( offline ) RL . DT frames RL as a sequence modeling task using an autoregressive and causally masked transformer model , and was shown to be competitive with traditional RL algorithms based on temporal difference learning . As shown in Figure 1 , our framework extends DT and consists of two steps : pre-training and fine-tuning . First , from a large and fixed offline data , we use the state and action context of trajectories to predict the next actions autoregressively with the DT architecture . To accommodate fine-tuning with reward signals , during this pre-training step , we mask the reward tokens by zeroing them out as well as modifying the causal mask of the self-attention layers to generate actions without reward tokens . This can enable the model to implicitly learn the skills present in the offline un-labeled dataset . Then in the fine-tuning step , we un-mask the reward tokens and fine-tune the transformer end-to-end , predicting both reward and action tokens . This allows the agent to use the information present in the small reward-annotated dataset to adapt its set of skills towards achieving high rewards in the downstream task . We summarize our contributions as follows : 1 . We propose a new semi-supervised offline RL setting to bring RL closer to the self-supervised learning paradigm in CV and NLP . 2 . We introduce Pre-trained Decision Transformers ( PDT ) - an extension of the recently proposed Decision Transformers which masks the reward tokens during pre-training and can automatically generate reward-to-gos during evaluation . 3 . We show how PDT can efficiently be fine-tuned for a range of diverse downstream tasks using the same pre-trained model in a few-shot manner , achieving leading aggregate performance on D4RL environments in the low-label regime . 4 . We provide insight into how different parts of PDT contribute to the final performance . 2 RELATED WORK . Behavioral Cloning ( BC ) . When a reward-free but expert-quality dataset is available , imitation learning is often considered as a simple and yet powerful baseline for learning effective policies Osa et al . ( 2018 ) ; Rahmatizadeh et al . ( 2018 ) . Our work differs in the motivation to utilize sub-optimal reward-free experience in the pre-training phase of the agent . Offline RL . Offline RL is a paradigm for RL where agents are trained on offline datasets rather than directly interacting with the environment . The main issue in utilizing existing value-based off-policy RL algorithms in the offline setting is that these methods often erroneously produce optimistic value function estimates that can encourage the policy to pick actions that are out-of-distribution ( OOD ) compared to the offline dataset , resulting in failure . One way to mitigate this problem is to constraint the learned policy to be `` close '' to the data generating policy ( also known as behavior policy ) , by means of KL-divergence ( Jaques et al. , 2019 ; Wu et al. , 2019a ; Siegel et al. , 2020 ; Peng et al. , 2019a ) , Wasserstein distance ( Wu et al. , 2019a ) , or MMD ( Kumar et al. , 2019 ) , and then using the sampled actions from this constrained policy in Bellman backup or applying a value penalty based on these divergence measures . Another way is to be conservative on value estimation by adding penalty terms that enforces the models to learn a lower bound on the value functions ( Kumar et al. , 2020 ; Fujimoto et al. , 2019 ) . All these methods however require the offline datasets to be reward-annotated , and rely crucially on rewards for learning . Another line of work extends Model Based Reinforcement Learning ( MBRL ) methods to offline settings . Similar to model-free methods , existing MBRL methods can not be readily used in offline settings due to the distribution shift problem and require some safeguard to mitigate exploiting model inaccuracies . To mitigate this issue , Kidambi et al . ( 2020 ) and Yu et al . ( 2020 ) both incorporate pessimism in learning the dynamics and estimating uncertainties in reward learning . While the dynamics models themselves can be learned without reward functions , planning or policy learning using the learned model again relies crucially on having access to a reward function or a large reward-annotated dataset . Skill Extraction with Behavioral Priors . Methods that leverage behavioral priors utilize reward-free environment interactions to learn the set of task-agnostic skills via either maximizing likelihood estimates ( Pertsch et al. , 2020 ; Ajay et al. , 2020 ; Singh et al. , 2020 ) or maximizing mutual information ( Eysenbach et al. , 2018 ; Sharma et al. , 2019 ; Campos et al. , 2020 ) . Behavioral priors learned through maximum likelihood latent variable models have been used for structured exploration in RL ( Singh et al. , 2020 ) , to solve complex long-horizon tasks from sparse rewards ( Pertsch et al. , 2020 ) , and regularize offline RL policies ( Ajay et al. , 2020 ; Wu et al. , 2019b ; Peng et al. , 2019b ; Nair et al. , 2020 ) . However , these skill extraction algorithms have high architectural complexity , requiring a generative model to learn a latent skill space and an RL agent to learn policies over skills as its action space . In contrast , PDT has one simple architecture for both skill extraction by modeling state-action sequences and control by conditioning on the desired reward . 3 APPROACH . 3.1 PRELIMINARIES . Offline Reinforcement Learning . We consider the standard RL setting of a Markov Decision Process ( MDP ) defined by the tupleM = ( S , A , R , T ) . The MDP tuple consists of state s ∈ S , actions a ∈ A , rewards r = R ( s , a ) , and transition dynamics T ( s′|s , a ) . A policy in RL aims to pick actions that will maximize the expected total return of the MDP E [ ∑T t=0R ( st , at ) ] . One episode can be represented as a trajectory in the MDP consisting of states , actions and rewards τ = ( s1 , a1 , r1 , s2 , a2 , r2 , ... , sT , aT , rT ) . Offline RL is a setting of RL that seeks to find the optimal policy from a fixed offline dataset of interactions . D = { si , ai , ri } Ni=1 . As a result , this setting is more difficult than the standard RL setting due to lack of access to the environment , and therefore is prone to distribution shift . Decision Transformers . The usage of transformers ( Vaswani et al. , 2017 ) to tackle reinforcement learning problems has been a topic of recent study in Chen et al . ( 2021 ) and Janner et al . ( 2021 ) . In Decision Transformer , rather than learning explicit policies or value functions , trajectories are modeled as sequences of state , actions , and reward-to-go . A reward-to-go ( RTG ) is defined as the sum of future rewards R̂t = ∑T t′=t rt′ . Then the problem setting becomes a sequence modeling problem , where actions are generated conditioned on the past context , current state , and the desired reward-to-go . With a context of length H at current time step t ( i.e . C ( H ) t ) , the policy becomes : p ( at|st , R̂t−1 , at−1 , st−1 , ... R̂t−H , at−H , st−H︸ ︷︷ ︸ C ( H ) t ) The architecture of Decision Transformer first applies a linear token embedding to states , actions , and RTGs , and then adds a learned positional embbedding ( shared across tokens within the same time-step ) to differentiate between similar tokens at different positions along the sequence . It uses a GPT ( Radford et al. , 2019 ) architecture to learn a policy that auto-regressively generates actions based on prior context . The loss during training DT is a mean-squared error loss between predicted actions and ground truth actions .
This paper presents Pre-trained Decision Transformer (PDT) for semi-supervised offline reinforcement learning. PDT first pre-train a decision transformer model on the trajectory dataset without rewards, and then fine-tune on a smaller dataset with reward annotations. Empirically, PDT achieves compatible performance with offline reinforcement learning baselines.
SP:1e8a3732ecec3487984655db61d6d56e3f4e0426
Connecting Data to Mechanisms with Meta Structual Causal Model
Recent years have seen impressive progress in theoretical and algorithmic developments of causal inference across various disciplines in science and engineering . However , there are still some unresolved theoretical problems , especially for cyclic causal relationships . In this article , we propose a meta structure causal model ( meta-SCM ) framework inspired by understanding causality as information transfer . A key feature of our framework is the introduction of the concept of active mechanisms to connect data and the collection of underlying causal mechanisms . We show that the meta-SCM provides a novel approach to address the theoretical complications for modeling cyclic causal relations . In addition , we propose a sufficient activated mechanisms assumption , and explain its relationship with existing hypotheses in causal inference and learning . Finally , we conclude the main idea of the meta-SCM framework with an emphasis on its theoretical and conceptual novelty . 1 INTRODUCTION . Although there have been significant advances in causal research in recent years , there are still some important theoretical problems that have not been resolved . One of the most notoriously hard problems is about cyclic causal relations , and there is no causal modeling frameworks can properly handle it . In modern theory of causality , the mathematical framework called a structural causal model ( SCM ) is used to represent the causal mechanisms from which a causal hierarchy to describe the generated phenomena organically emerges ( Pearl , 1995 ; Pearl et al. , 2009 ; Bongers et al. , 2016 ; Bareinboim et al. , 2020 ) . Acyclic SCMs , also known as recursive SEMs , form a special wellstudied subclass of SCMs that generalize causal Bayesian networks . They have many convenient properties and are widely used in practical causal modeling , see e.g . ( Evans , 2016 ; Lauritzen , 1996 ; Richardson , 2003 ; Maathuis et al. , 2018 ) . But there is a strong need to go beyond acyclic SCMs . In fact , there are feedback loops between observed variables in many systems occurring in real world . Causal cycles may arise when one approximates such systems over time ( Fisher , 1970 ; Mogensen et al. , 2018 ; 2020 ) , or when one describes the equilibrium states of these systems ( Iwasaki & Simon , 1994 ; Lacerda et al. , 2012 ; Hyttinen et al. , 2012 ; Mooij et al. , 2013 ; Bongers & Mooij , 2018 ; Blom et al. , 2020 ; Pfister et al. , 2019 ) , though the underlying dynamic processes describing such systems have an acyclic causal structure over time . In particular , it was shown that the equilibrium states of a system governed by ( random ) differential equations can be described by an SCM that represents their causal semantics in ( Bongers & Mooij , 2018 ) , which gives rise to a plethora of SCMs that include cycles . In contrast to their acyclic counterparts , many of the convenient properties do not hold for SCMs with cycles , and they are not as well understood . Some progress has been made in the case of discrete ( Neal , 2000 ) and linear models ( Spirtes , 1993 ; 1994 ; 2013 ; Richardson et al. , 1996 ; Koster et al. , 1996 ; Hyttinen et al. , 2012 ) , and more recently the Markov properties ( Forré & Mooij , 2020 ; 2017 ) and theoretical foundation ( Bongers et al. , 2016 ) . Researchers are mostly making additional assumption of the underlying causal mechanisms to circumvent complications of cyclic SCMs in causal semantics , solvability , marginaliztions etc .. However , they are still not well understood . Even , a pressing concern is whether SCMs are able to completely model dynamical systems at equilibrium and the causal constraints model ( CCM ) is proposed but without graphical interpretations yet ( Blom et al. , 2020 ) . After introducing the formal definition of SCMs and relevant preliminaries in Section 2 , we trace back into the philosophy accounts of causality and propose the meta structural causal model ( metaSCM ) based on understanding causality as information transfer in Section 3 . The meta-SCM framework is constructed by an SCM and an extra dimension which describes how to connect data to mechanisms through the concept of active mechanisms . In particular , a meta-SCM induces a submodel for each sample in the dataset coarsely related to the active set . The new framework is proved to be more expressive by Theorem 7 , and its potential ability to address cyclic casual relationships is illustrated by an example of cyclic SCM with multiple solution and an unsolvable cyclic SCM . Comparing to the joint causal inference for meta-system ( Mooij et al. , 2016 ) which can also deal with cyclic SCMs , the meta-SCM framework avoids to add extra context variables and can even gain insights on unsolvable SCMs . The Section 4 addresses the challenging case where no additional variables , besides the samples from the data to generate , are observed . The sufficient activated mechanism ( SAM ) hypothesis is proposed as an central assumption in the meta-SCM framework , which is consistent with the role of independent causal mechanisms ( ICM ) principle or sparse mechanisms shift ( SMS ) assumption for the SCM framework . Moreover , the SAM and SMS hypotheses are also compared with the lens of informational decomposition of SCM , and it reveals that the SMS assumption might be not appropriate in certain case with an example . Section 5 , we conclude the main idea of the meta-SCM framework with an emphasis on its theoretical and conceptual novelty . The main contributions of this paper are : 1 ) We propose a totally novel dimension that describes how to link data to mechanisms to the existing causal modeling framework , particularly , a meta structural causal model framework which can be used to circumvent technique complications in cyclic SCMs . 2 ) We propose a SAM hypothesis as an inductive bias for performing causal inferences and learning consistent with the role of SMS assumption . 2 PRELIMINARIES . At the centre of modern causal modeling theory lies the structural causal model ( SCM ) ( also known as structural equation model ) which makes graphical assumptions of the underlying data generating process . There are many somewhat different formulations of SCM in literatures , e.g. , Schölkopf ( 2019 ) ; Pearl ( 2019 ) ; Bongers et al . ( 2016 ) ; Pearl et al . ( 2009 ) ; Forré & Mooij ( 2020 ) , among which the definition in Blom et al . ( 2020 ) is used in this paper . Definition 1 ( SCM ) Let I and J be index sets . A Structural Causal Model ( SCM ) M is a triple ( X , F , E ) , with : • a product of standard measurable spaces X = Πi∈IXi ( domains of endogenous ) , • a tuple of exogenous random variables E = ( Ej ) j∈J taking value in a product of standard measurable space E = ∏ j∈J Ej . • a family of F of measurable functions : fi : Xpa ( i ) ∩I × Epa ( i ) ∩J → Xi , ∀i ∈ I . The dataset are ususally assumed to be a set of samples for the solution of SCMs . Definition 2 ( Solution of SCM ) We say that a random variable X = ( Xi ) i∈I is a solution to an SCMM = ( X , F , E ) if Xi = fi ( Xpa ( i ) ∩I , Epa ( i ) ∩J ) a.s. , ∀i ∈ I . An SCM may have a unique ( up to zero sets ) solution , multiple solutions , or there may not exist any solution at all . Definition 3 An SCMM is called simple if it is uniquely solvable with respect to any subsetO ⊆ I . All acyclic SCMs are simple . Definition 4 A do intervention do ( x̃I ) with target I ⊆ I and value x̃I ∈ XI on an SCM M = ( X , F , E ) maps it to the intervened SCM Mdo ( x̃I ) = ( X , F̃ , E ) with F̃ the family of measurable functions : f̃i ( xpa ( i ) ∩I , epa ( i ) ∩J ) = { x̃i i ∈ I , fi ( xpa ( i ) ∩I , epa ( i ) ∩J ) i ∈ I \ I The intervened SCM is referred as a submodel of the original SCM , in fact , the variants derived from many different types of interventions ( e.g. , perfect , imperfect , stochastic , etc . ) are also referred as submodel . 3 META STRUCTURAL CAUSAL MODELS . One critical insight in philosophy is that the causal mechanisms behind a system under investigation are not generally observable , but they do produce observable traces ( “ data , ” in modern terminology ) . This insight naturally leads to two practical desiderata for any proper framework for causal inference , namely : 1 . The causal mechanisms underlying the phenomenon under investigation should be accounted for – indeed , formalized – in the analysis . 2 . This collection of mechanisms ( even if mostly unobservable ) should be formally tied to its output : the generated phenomena and corresponding datasets . The mathematical object called a structural causal model ( SCM ) is used to represent the causal mechanisms from which a causal hierarchy to describe the generated phenomena organically emerges . It is often assumed that every instantiation E = e of the exogenous variables uniquely determines the values of all variables in X ( Pearl , 2019 ) , which leads a unique solution of the corresponding SCM . Then the dataset D = { x ( k ) } k=1 , ... , N is a set of N samples of the unique solution . But in many cases , SCM with cycles might be not solvable or have multiple solutions ( Halpern , 1998 ) . Example 1 ( Multiple Solutions ) Consider an SCMM1 = ( X , F = { f1 , f2 } , E = { E1 } ) , where F = { x1 ← ( x22 + x2 + 1 ) /3− e21/3 x2 ← x1 Obviously , ( 1 − E1 , 1 − E1 ) and ( 1 + E1 , 1 + E1 ) are two different solutions toM1 , then which solution of the SCM should be used to link the dataset to the model ? The previous causal inference literature rarely deals with theoretical aspects of cyclic causality . In recent years , it has been formally discussed in Bongers et al . ( 2016 ) However , it is also acknowledged by this paper that there are many complications in dealing with cyclic causal models . The vast majority of methods to deal with cyclic SCM in the literature are by adding additional assumptions , such as linear constraints ( Spirtes , 1993 ; 1994 ; Hyttinen et al. , 2012 ) and certain solvability constraints ( Forré & Mooij , 2018 ; Bongers et al. , 2016 ) . These methods basically exclude the study of SCMs with multiple solutions such as Example 1 . The view of understanding causation as information transfer was first formally proposed by ( Collier , 1999 ) in philosophy recently . Inspired by this view , we realize that the causal links among variables can be cut off suggested by unsuccessful information transfer , which suggests that different samples might have different causal graphs and causal mechanisms . For example , samples of M1 might only satisfy only a subset of the structural equations due to absence of information , hence variables for two different samples x ( i ) and x ( j ) could have two different causal graphs . However , we usually do not know when and where the information transmission was interrupted for a given sample . In fact , it might be infeasible to specify the information transmission details of all samples of an SCM . To address the above problem , we introduce the concept of active set of an SCM , which is inspired by the active set method in the field of non-linear optimization theory . Definition 5 ( Active mechanisms ) For a given sample x ( k ) and the corresponding collection of mechanisms represented by an SCMM = ( X , F , E ) , if x ( k ) i = fi ( x ( k ) pa ( i ) ∩I , e ( k ) pa ( i ) ∩J ) , then we call fi an active mechanism , and denote the index set for all active mechanisms as the active set Ak . The collection of active sets { Ak } k=1,2 , ... gives us the opportunity to avoid considering the details of the information transfer between variables , and to describe the relationship between the data and the model relatively concisely . Formally , we define the meta structural causal model ( meta-SCM ) as follows : Definition 6 ( meta-SCM ) A collection of mechanisms described by an SCMM = ( X , F , E ) with a dataset D = { x ( k ) } k=1 , ... , N , in which each sample x ( k ) satisfies that : • the prior distribution of E ( k ) is P ( E ) ; • Ak ⊆ I is referred as the active set of the sample k satisfies that x ( k ) i ← fi ( x ( k ) pa ( i ) ∩I , e ( k ) pa ( i ) ∩J ) , ∀i ∈ Ak . ( 1 ) Then the tuple 〈M , D〉 ( or in shortM ) is called a meta structural causal model ( meta-SCM ) . The difference between SCM and meta-SCM . On one hand , an SCM can be interpreted as a special case of meta-SCM satisfies that the active set Ak is equal to I for any sample x ( k ) . On the other hand , a meta-SCM share the causal mechanisms with its corresponding SCM only differs on the method for linking data to model . Thus , it improves the expressiveness of the canonical SCM . Actually , a meta-SCM suggests a method for connecting any dataset to an SCM with the active sets . Formally , Theorem 7 ( Connecting Data to Mechanisms ) For an SCM M = ( X , F , E ) with any dataset D = { x ( k ) } k=1 , ... , N in the domain of X . Then each datapoint x ( k ) is a sample from some submodel SCM M̃ related to the active set Ak . Proof For any k = 1 , ... , N , let M̃ ( k ) = ( X , F̃ , E ) be an SCM with modified causal mechanisms : f̃i ( xpa ( i ) ∩I , epa ( i ) ∩J ) = { fi ( xpa ( i ) ∩I , epa ( i ) ∩J ) i ∈ Ak , x ( k ) i i ∈ I \Ak Then the active set of datapoint x ( k ) for the submodel M̃ ( k ) is I by definition1 , which directly leads to our theorem . The above proof directly assigns a submodel for each sample in the dataset , which only part of mechanisms in the original SCM holds . In fact , the submodel in our meta-SCM framework does not have to be constructed as a do-intervened model M̃ ( k ) , it can be any subclass of SCMs with desired properties ( such as acyclic ) in literatures . When there are cyclic causal relationships between variables , one encounters various technical complications , which even arise in the linear setting ( Bongers et al. , 2016 ) . The main idea for solving related difficulties is to add additional restrictions on structural equations , and the dataset are assumed to be consisted of samples from a distribution obtained by solving the SCM . In contrast , our meta-SCM does not add additional assumptions on SCM , and each datapoint is treated as a sample of the distribution obtained by solving a certain submodel . For the SCM M1 with muptiple solutions in Example 1 with dataset D = { x ( k ) } k=1 , ... , N in the domain of X , the meta-SCM can circumvent theoretical complications through providing each datapoint a distribution of any solution of a certain submodel . Usually , the details of submodel and its corresponding distribution for each sample might be unknown , and meta-SCM only provides a coarse description by the active sets . In fact , we can also circumvent the technique complications caused by solvability through metaSCM . Specifically , the structural equations of an acyclic SCM trivially have a unique solution , which ensures that the SCM gives rise to a unique , well-defined probability distribution on the variables . However , an SCM can be unsolvable in the case of cycles , e.g. , Example 2 ( Unsolvable ) Consider an SCMM2 = ( X , F = { f1 , f2 } , E = { E1 } ) , where F = { x1 ← x22 + x2 + e21 + 1 x2 ← x1 1In fact , M̃ ( k ) is the do-intervened SCM M do ( x ( k ) I\Ak ) . Then the SCM M2 is obvious not solvable , thus it can not be used to model underlying causal mechanisms of any dataset D = { x ( k ) } k=1 , ... , N in the domain of X . But with our novel approach , we might still connect data to the underlying mechanisms , e.g . by letting |Ak| = 1 for all k = 1 , ... , N . In other words , each datapoint x ( k ) is a sample of a distribution derived from the submodel M̃ ( k ) by Theorem 7 . The difference between meta-system and meta-SCM . The joint causal inference ( JCI ) framework reduces modeling a system in its environment to modeling the meta-system consisting of the system and its environment , which considers auxiliary context variables that describe the context of each data set ( Mooij et al. , 2016 ) . In contrast , our meta-SCM address the challenging case where no additional variables , besides the samples from the data to generate , are observed . For example in Fig . 1 , the meta-system consists of two variables X1 , X2 and a context variable C. More concretely , the engine X1 drives the wheels of a car X2 when going uphill C = 0 , but when going downhill , the rotation of the wheels drives the engine . In a meta-SCM , we instead introduce the concept of active mechanisms to describe each sample in a dataset . Moreover , the meta-SCM framework even gain insights on unsolvable SCMs such as Example 2 while the previous meta-system study restricts themselves to simple SCMs . In philosophy viewpoint , the JCI framework uses context changes to model interventions , which is a difference-making account for causality . Instead , the active set in meta-SCM are inspired by information transferring which is a production account of causality , see e.g . Illari & Russo ( 2014 ) . From the above discussions , the meta-SCM framework can be considered as generalization of SCM that novelly links data to causal mechanisms through active sets at individual level modeling2 , and it might be used to circumvent technical complications when cycles present . Then , a natural question is how to perform inferences with a meta-SCM when in the presence of cycles?A first difficult might be the lack of knowledge on the specific form of active sets , i.e . Ak , for each sample . In the following section , we propose a principle for learning and reasoning within the meta-SCM framework .
This paper proposes to use **active set** of causal edges, instead of auxiliary context variable or domain index to characterize nonstationary causal relations in data. In addition, the authors propose Sufficient Activated Mechanisms (SAM) to replace Sparse Mechanism Shift (SMS) as the inductive bias (assumption) for causal discovery and inference. Developing a principled way to characterize mechanism shifts in causal settings is definitely an interesting idea and potentially publishable. However, this paper introduced merely a conceptual framework instead of a working system with theoretical guarantees and contained a few unsupported claims which I feel not confident to justify their correctness. I strongly recommend the authors code the proposed meta-SCM and SAM in a training architecture and validate their correctness in both theoretical and empirical perspectives and submit the to future venues.
SP:15ebeef5c445120900b9c94bbcd6a997bfb92899
Connecting Data to Mechanisms with Meta Structual Causal Model
Recent years have seen impressive progress in theoretical and algorithmic developments of causal inference across various disciplines in science and engineering . However , there are still some unresolved theoretical problems , especially for cyclic causal relationships . In this article , we propose a meta structure causal model ( meta-SCM ) framework inspired by understanding causality as information transfer . A key feature of our framework is the introduction of the concept of active mechanisms to connect data and the collection of underlying causal mechanisms . We show that the meta-SCM provides a novel approach to address the theoretical complications for modeling cyclic causal relations . In addition , we propose a sufficient activated mechanisms assumption , and explain its relationship with existing hypotheses in causal inference and learning . Finally , we conclude the main idea of the meta-SCM framework with an emphasis on its theoretical and conceptual novelty . 1 INTRODUCTION . Although there have been significant advances in causal research in recent years , there are still some important theoretical problems that have not been resolved . One of the most notoriously hard problems is about cyclic causal relations , and there is no causal modeling frameworks can properly handle it . In modern theory of causality , the mathematical framework called a structural causal model ( SCM ) is used to represent the causal mechanisms from which a causal hierarchy to describe the generated phenomena organically emerges ( Pearl , 1995 ; Pearl et al. , 2009 ; Bongers et al. , 2016 ; Bareinboim et al. , 2020 ) . Acyclic SCMs , also known as recursive SEMs , form a special wellstudied subclass of SCMs that generalize causal Bayesian networks . They have many convenient properties and are widely used in practical causal modeling , see e.g . ( Evans , 2016 ; Lauritzen , 1996 ; Richardson , 2003 ; Maathuis et al. , 2018 ) . But there is a strong need to go beyond acyclic SCMs . In fact , there are feedback loops between observed variables in many systems occurring in real world . Causal cycles may arise when one approximates such systems over time ( Fisher , 1970 ; Mogensen et al. , 2018 ; 2020 ) , or when one describes the equilibrium states of these systems ( Iwasaki & Simon , 1994 ; Lacerda et al. , 2012 ; Hyttinen et al. , 2012 ; Mooij et al. , 2013 ; Bongers & Mooij , 2018 ; Blom et al. , 2020 ; Pfister et al. , 2019 ) , though the underlying dynamic processes describing such systems have an acyclic causal structure over time . In particular , it was shown that the equilibrium states of a system governed by ( random ) differential equations can be described by an SCM that represents their causal semantics in ( Bongers & Mooij , 2018 ) , which gives rise to a plethora of SCMs that include cycles . In contrast to their acyclic counterparts , many of the convenient properties do not hold for SCMs with cycles , and they are not as well understood . Some progress has been made in the case of discrete ( Neal , 2000 ) and linear models ( Spirtes , 1993 ; 1994 ; 2013 ; Richardson et al. , 1996 ; Koster et al. , 1996 ; Hyttinen et al. , 2012 ) , and more recently the Markov properties ( Forré & Mooij , 2020 ; 2017 ) and theoretical foundation ( Bongers et al. , 2016 ) . Researchers are mostly making additional assumption of the underlying causal mechanisms to circumvent complications of cyclic SCMs in causal semantics , solvability , marginaliztions etc .. However , they are still not well understood . Even , a pressing concern is whether SCMs are able to completely model dynamical systems at equilibrium and the causal constraints model ( CCM ) is proposed but without graphical interpretations yet ( Blom et al. , 2020 ) . After introducing the formal definition of SCMs and relevant preliminaries in Section 2 , we trace back into the philosophy accounts of causality and propose the meta structural causal model ( metaSCM ) based on understanding causality as information transfer in Section 3 . The meta-SCM framework is constructed by an SCM and an extra dimension which describes how to connect data to mechanisms through the concept of active mechanisms . In particular , a meta-SCM induces a submodel for each sample in the dataset coarsely related to the active set . The new framework is proved to be more expressive by Theorem 7 , and its potential ability to address cyclic casual relationships is illustrated by an example of cyclic SCM with multiple solution and an unsolvable cyclic SCM . Comparing to the joint causal inference for meta-system ( Mooij et al. , 2016 ) which can also deal with cyclic SCMs , the meta-SCM framework avoids to add extra context variables and can even gain insights on unsolvable SCMs . The Section 4 addresses the challenging case where no additional variables , besides the samples from the data to generate , are observed . The sufficient activated mechanism ( SAM ) hypothesis is proposed as an central assumption in the meta-SCM framework , which is consistent with the role of independent causal mechanisms ( ICM ) principle or sparse mechanisms shift ( SMS ) assumption for the SCM framework . Moreover , the SAM and SMS hypotheses are also compared with the lens of informational decomposition of SCM , and it reveals that the SMS assumption might be not appropriate in certain case with an example . Section 5 , we conclude the main idea of the meta-SCM framework with an emphasis on its theoretical and conceptual novelty . The main contributions of this paper are : 1 ) We propose a totally novel dimension that describes how to link data to mechanisms to the existing causal modeling framework , particularly , a meta structural causal model framework which can be used to circumvent technique complications in cyclic SCMs . 2 ) We propose a SAM hypothesis as an inductive bias for performing causal inferences and learning consistent with the role of SMS assumption . 2 PRELIMINARIES . At the centre of modern causal modeling theory lies the structural causal model ( SCM ) ( also known as structural equation model ) which makes graphical assumptions of the underlying data generating process . There are many somewhat different formulations of SCM in literatures , e.g. , Schölkopf ( 2019 ) ; Pearl ( 2019 ) ; Bongers et al . ( 2016 ) ; Pearl et al . ( 2009 ) ; Forré & Mooij ( 2020 ) , among which the definition in Blom et al . ( 2020 ) is used in this paper . Definition 1 ( SCM ) Let I and J be index sets . A Structural Causal Model ( SCM ) M is a triple ( X , F , E ) , with : • a product of standard measurable spaces X = Πi∈IXi ( domains of endogenous ) , • a tuple of exogenous random variables E = ( Ej ) j∈J taking value in a product of standard measurable space E = ∏ j∈J Ej . • a family of F of measurable functions : fi : Xpa ( i ) ∩I × Epa ( i ) ∩J → Xi , ∀i ∈ I . The dataset are ususally assumed to be a set of samples for the solution of SCMs . Definition 2 ( Solution of SCM ) We say that a random variable X = ( Xi ) i∈I is a solution to an SCMM = ( X , F , E ) if Xi = fi ( Xpa ( i ) ∩I , Epa ( i ) ∩J ) a.s. , ∀i ∈ I . An SCM may have a unique ( up to zero sets ) solution , multiple solutions , or there may not exist any solution at all . Definition 3 An SCMM is called simple if it is uniquely solvable with respect to any subsetO ⊆ I . All acyclic SCMs are simple . Definition 4 A do intervention do ( x̃I ) with target I ⊆ I and value x̃I ∈ XI on an SCM M = ( X , F , E ) maps it to the intervened SCM Mdo ( x̃I ) = ( X , F̃ , E ) with F̃ the family of measurable functions : f̃i ( xpa ( i ) ∩I , epa ( i ) ∩J ) = { x̃i i ∈ I , fi ( xpa ( i ) ∩I , epa ( i ) ∩J ) i ∈ I \ I The intervened SCM is referred as a submodel of the original SCM , in fact , the variants derived from many different types of interventions ( e.g. , perfect , imperfect , stochastic , etc . ) are also referred as submodel . 3 META STRUCTURAL CAUSAL MODELS . One critical insight in philosophy is that the causal mechanisms behind a system under investigation are not generally observable , but they do produce observable traces ( “ data , ” in modern terminology ) . This insight naturally leads to two practical desiderata for any proper framework for causal inference , namely : 1 . The causal mechanisms underlying the phenomenon under investigation should be accounted for – indeed , formalized – in the analysis . 2 . This collection of mechanisms ( even if mostly unobservable ) should be formally tied to its output : the generated phenomena and corresponding datasets . The mathematical object called a structural causal model ( SCM ) is used to represent the causal mechanisms from which a causal hierarchy to describe the generated phenomena organically emerges . It is often assumed that every instantiation E = e of the exogenous variables uniquely determines the values of all variables in X ( Pearl , 2019 ) , which leads a unique solution of the corresponding SCM . Then the dataset D = { x ( k ) } k=1 , ... , N is a set of N samples of the unique solution . But in many cases , SCM with cycles might be not solvable or have multiple solutions ( Halpern , 1998 ) . Example 1 ( Multiple Solutions ) Consider an SCMM1 = ( X , F = { f1 , f2 } , E = { E1 } ) , where F = { x1 ← ( x22 + x2 + 1 ) /3− e21/3 x2 ← x1 Obviously , ( 1 − E1 , 1 − E1 ) and ( 1 + E1 , 1 + E1 ) are two different solutions toM1 , then which solution of the SCM should be used to link the dataset to the model ? The previous causal inference literature rarely deals with theoretical aspects of cyclic causality . In recent years , it has been formally discussed in Bongers et al . ( 2016 ) However , it is also acknowledged by this paper that there are many complications in dealing with cyclic causal models . The vast majority of methods to deal with cyclic SCM in the literature are by adding additional assumptions , such as linear constraints ( Spirtes , 1993 ; 1994 ; Hyttinen et al. , 2012 ) and certain solvability constraints ( Forré & Mooij , 2018 ; Bongers et al. , 2016 ) . These methods basically exclude the study of SCMs with multiple solutions such as Example 1 . The view of understanding causation as information transfer was first formally proposed by ( Collier , 1999 ) in philosophy recently . Inspired by this view , we realize that the causal links among variables can be cut off suggested by unsuccessful information transfer , which suggests that different samples might have different causal graphs and causal mechanisms . For example , samples of M1 might only satisfy only a subset of the structural equations due to absence of information , hence variables for two different samples x ( i ) and x ( j ) could have two different causal graphs . However , we usually do not know when and where the information transmission was interrupted for a given sample . In fact , it might be infeasible to specify the information transmission details of all samples of an SCM . To address the above problem , we introduce the concept of active set of an SCM , which is inspired by the active set method in the field of non-linear optimization theory . Definition 5 ( Active mechanisms ) For a given sample x ( k ) and the corresponding collection of mechanisms represented by an SCMM = ( X , F , E ) , if x ( k ) i = fi ( x ( k ) pa ( i ) ∩I , e ( k ) pa ( i ) ∩J ) , then we call fi an active mechanism , and denote the index set for all active mechanisms as the active set Ak . The collection of active sets { Ak } k=1,2 , ... gives us the opportunity to avoid considering the details of the information transfer between variables , and to describe the relationship between the data and the model relatively concisely . Formally , we define the meta structural causal model ( meta-SCM ) as follows : Definition 6 ( meta-SCM ) A collection of mechanisms described by an SCMM = ( X , F , E ) with a dataset D = { x ( k ) } k=1 , ... , N , in which each sample x ( k ) satisfies that : • the prior distribution of E ( k ) is P ( E ) ; • Ak ⊆ I is referred as the active set of the sample k satisfies that x ( k ) i ← fi ( x ( k ) pa ( i ) ∩I , e ( k ) pa ( i ) ∩J ) , ∀i ∈ Ak . ( 1 ) Then the tuple 〈M , D〉 ( or in shortM ) is called a meta structural causal model ( meta-SCM ) . The difference between SCM and meta-SCM . On one hand , an SCM can be interpreted as a special case of meta-SCM satisfies that the active set Ak is equal to I for any sample x ( k ) . On the other hand , a meta-SCM share the causal mechanisms with its corresponding SCM only differs on the method for linking data to model . Thus , it improves the expressiveness of the canonical SCM . Actually , a meta-SCM suggests a method for connecting any dataset to an SCM with the active sets . Formally , Theorem 7 ( Connecting Data to Mechanisms ) For an SCM M = ( X , F , E ) with any dataset D = { x ( k ) } k=1 , ... , N in the domain of X . Then each datapoint x ( k ) is a sample from some submodel SCM M̃ related to the active set Ak . Proof For any k = 1 , ... , N , let M̃ ( k ) = ( X , F̃ , E ) be an SCM with modified causal mechanisms : f̃i ( xpa ( i ) ∩I , epa ( i ) ∩J ) = { fi ( xpa ( i ) ∩I , epa ( i ) ∩J ) i ∈ Ak , x ( k ) i i ∈ I \Ak Then the active set of datapoint x ( k ) for the submodel M̃ ( k ) is I by definition1 , which directly leads to our theorem . The above proof directly assigns a submodel for each sample in the dataset , which only part of mechanisms in the original SCM holds . In fact , the submodel in our meta-SCM framework does not have to be constructed as a do-intervened model M̃ ( k ) , it can be any subclass of SCMs with desired properties ( such as acyclic ) in literatures . When there are cyclic causal relationships between variables , one encounters various technical complications , which even arise in the linear setting ( Bongers et al. , 2016 ) . The main idea for solving related difficulties is to add additional restrictions on structural equations , and the dataset are assumed to be consisted of samples from a distribution obtained by solving the SCM . In contrast , our meta-SCM does not add additional assumptions on SCM , and each datapoint is treated as a sample of the distribution obtained by solving a certain submodel . For the SCM M1 with muptiple solutions in Example 1 with dataset D = { x ( k ) } k=1 , ... , N in the domain of X , the meta-SCM can circumvent theoretical complications through providing each datapoint a distribution of any solution of a certain submodel . Usually , the details of submodel and its corresponding distribution for each sample might be unknown , and meta-SCM only provides a coarse description by the active sets . In fact , we can also circumvent the technique complications caused by solvability through metaSCM . Specifically , the structural equations of an acyclic SCM trivially have a unique solution , which ensures that the SCM gives rise to a unique , well-defined probability distribution on the variables . However , an SCM can be unsolvable in the case of cycles , e.g. , Example 2 ( Unsolvable ) Consider an SCMM2 = ( X , F = { f1 , f2 } , E = { E1 } ) , where F = { x1 ← x22 + x2 + e21 + 1 x2 ← x1 1In fact , M̃ ( k ) is the do-intervened SCM M do ( x ( k ) I\Ak ) . Then the SCM M2 is obvious not solvable , thus it can not be used to model underlying causal mechanisms of any dataset D = { x ( k ) } k=1 , ... , N in the domain of X . But with our novel approach , we might still connect data to the underlying mechanisms , e.g . by letting |Ak| = 1 for all k = 1 , ... , N . In other words , each datapoint x ( k ) is a sample of a distribution derived from the submodel M̃ ( k ) by Theorem 7 . The difference between meta-system and meta-SCM . The joint causal inference ( JCI ) framework reduces modeling a system in its environment to modeling the meta-system consisting of the system and its environment , which considers auxiliary context variables that describe the context of each data set ( Mooij et al. , 2016 ) . In contrast , our meta-SCM address the challenging case where no additional variables , besides the samples from the data to generate , are observed . For example in Fig . 1 , the meta-system consists of two variables X1 , X2 and a context variable C. More concretely , the engine X1 drives the wheels of a car X2 when going uphill C = 0 , but when going downhill , the rotation of the wheels drives the engine . In a meta-SCM , we instead introduce the concept of active mechanisms to describe each sample in a dataset . Moreover , the meta-SCM framework even gain insights on unsolvable SCMs such as Example 2 while the previous meta-system study restricts themselves to simple SCMs . In philosophy viewpoint , the JCI framework uses context changes to model interventions , which is a difference-making account for causality . Instead , the active set in meta-SCM are inspired by information transferring which is a production account of causality , see e.g . Illari & Russo ( 2014 ) . From the above discussions , the meta-SCM framework can be considered as generalization of SCM that novelly links data to causal mechanisms through active sets at individual level modeling2 , and it might be used to circumvent technical complications when cycles present . Then , a natural question is how to perform inferences with a meta-SCM when in the presence of cycles?A first difficult might be the lack of knowledge on the specific form of active sets , i.e . Ak , for each sample . In the following section , we propose a principle for learning and reasoning within the meta-SCM framework .
This paper presents a new lens on causal graphical models from a lens of fuller generality. Rather than considering models under assumptions such as acyclicity or other constraints that enable tractable modeling, the authors consider the notion of a meta causal model which, when indexed, includes SCM as one possible snapshot. The authors give two additional assumptions (1) sparse mechanism shift and (2) sufficient activated mechanisms, and describe the implications.
SP:15ebeef5c445120900b9c94bbcd6a997bfb92899
SPP-RL: State Planning Policy Reinforcement Learning
We introduce an algorithm for reinforcement learning , in which the actor plans for the next state provided the current state . To communicate the actor output to the environment we incorporate an inverse dynamics control model and train it using supervised learning . We train the RL agent using off-policy state-of-the-art reinforcement learning algorithms : DDPG , TD3 , and SAC . To guarantee that the target states are physically relevant , the overall learning procedure is formulated as a constrained optimization problem , solved via the classical Lagrangian optimization method . We benchmark the state planning RL approach using a varied set of continuous environments , including standard MuJoCo tasks , safety-gym level 0 environments , and AntPush . In SPP approach the optimal policy is being searched for in the space of state-state mappings , a considerably larger space than the traditional space of state-action mappings . We report that quite surprisingly SPP implementations attain superior performance to vanilla state-of-the-art off-policy RL algorithms in a wide class of robotic locomotion environments . 1 INTRODUCTION . Research on reinforcement learning ( RL ) has brought a tremendous number of successful applications in diverse fields of science and technology . Application areas of RL can be split into two classes : discrete and continuous . Here , we are interested in continuous simulation environments , mostly in the robotics domain . Despite the magnitude of successful applications of RL in this domain , two of the main issues : sample efficiency and interpretability of RL trained agents , persist . These problems have utmost practical importance , especially for mission-critical applications . The current methods often require a vast amount of experience for training . The decision-making process of trained agents is not interpretable , sometimes resulting in finding proxy solutions . Thus , it is vital to research new RL algorithms that may partially solve the mentioned problems . Traditionally , RL is based on the principle of searching for the optimal policy within the space of state-action mappings . We propose a new algorithm based on the principle of training an actor ( a policy ) operating entirely in the state space ( state-state mappings ) . We call such policies the state planning policies ( SPP ) , whose actions determine desired trajectories in the state-space . The task of training SPP may initially seem infeasible due to a significantly larger dimension of states than of actions . Nonetheless , quite surprisingly , we show that the approach is feasible and often leads to significant improvements in average performance for a class of robotic locomotion tasks . We call our approach State Planning Policy Reinforcement Learning ( SPP-RL ) . It is a generic approach for problems specified using continuous environments . The main building block of SPP-RL – the RL agent can be implemented using virtually any RL algorithm . We chose to develop our approach using the state-of-the-art off-policy DDPG ( Lillicrap et al. , 2016 ) , TD3 ( Fujimoto et al. , 2018 ) , and SAC ( Haarnoja et al. , 2018a ) algorithms . Note that , in SPP-RL we need another trainable model to communicate the policy output to the environment ; as such , we incorporate a learnable inverse dynamics control model ( IDM ) , see Fig . 1 . The overall algorithm optimizes the policy simultaneously with CM . To ensure that the policy target states satisfy physical and under-actuation constraints , we formulate a constrained optimization objective for policy training . Our work lies within the category of RL methods that already implemented state-state policies , including work on hierarchical RL like Nachum et al . ( 2018 ) , and the D3G algorithm from Edwards et al . ( 2020 ) . Summary of results . Although the SPP-RL algorithm searches for the optimal policy within a much larger space , our performance benchmarks revealed that SPP-RL implementations often outperform their vanilla RL counterparts . Experiments performed in Ant & Humanoid tasks from MuJoCo suite ( Todorov et al. , 2012 ; Brockman et al. , 2016 ) reveal that SPP-DDPG outperforms DDPG . Experiments in Safety-Gym Level 0 environments ( Ray et al. , 2019 ) demonstrate that SPP-TD3 and SPP-SAC outperform by a great margin TD3 and SAC , respectively . Experiments in AntPush task ( Nachum et al. , 2018 ) show that SPP-TD3 outperforms hierarchical RL method HIRO ( Nachum et al. , 2018 ) and provides some interpretability of the agent behavior . We hypothesize that the superior performance of SPP-RL in the tested continuous environments originates in more efficient state-space exploration by state-state policies than traditional state-action policies ; here noise is being added to target states rather than actions . To argue this , we performed series of experiments , including evaluation of a shadow agent utilizing experience from SPP and vanilla replay buffers ( Sec . 5.4 ) and a study of the distributions of states gathered in different replay buffers ( App . E.2 ) . To analyze which features of the algorithm are crucial for superior performance , we report on a thorough ablation study of SPP-TD3 ( App . E.1 ) . We implemented SPP-RL methods as a modular PyTorch library shared as open-source . SPP-RL algorithms are derived from their vanilla RL counterparts , making extending the library with new RL algorithms straightforward . We also share videos with test episodes of the trained agents to accompany benchmark plots ( web , 2021 ) . Last but not least , we demonstrate theoretical convergence of clipped Double Q-learning implemented in SPP-TD3 algorithm within the classical stochastic processes , finite-state/action spaces setting and in environments based on rigid body dynamics model , refer to App . B.3 . 1.1 RELATED WORK . We present a ( non-exhaustive ) list of related works ; refer to Tab . 1 for a perspective on related work . The closest approach to ours is the D3G algorithm introduced by Edwards et al . ( 2020 ) , which includes state planning policies , and introduces a novel form of the value function defined on statenext state pairs . There are two main ways our method is distinct . First , SPP employs the classical formulation of the value function . Also , we do not include a forward dynamics model nor the cycle loss . Instead , to guarantee consistency of the policy target-states in SPP , we formulate a constrained optimization problem ( compare Fig . 2 ) solved via Lagrangian optimization . Our work builds on the classical RL algorithms going back to REINFORCE ( Williams , 1992 ) , Asynchronous Actor-Critic ( Mnih et al. , 2016 ) , and especially the off-policy actor-critic algorithms including Q-Prop ( Gu et al. , 2017 ) , DDPG ( Lillicrap et al. , 2016 ) , SAC ( Haarnoja et al. , 2018a ; b ) , and TD3 ( Fujimoto et al. , 2018 ) . State planning policies have been used in hierarchical RL ( HRL ) methods like HIRO ( Nachum et al. , 2018 ) and FuN ( Vezhnevets et al. , 2017 ) . Contrary to HRL SPP-RL approach does not employ a hierarchy of multiple policies nor state conditioned value functions . Training predictive models ( like IDMs ) is fundamental for the model-based RL approach including algorithms : a locally linear latent dynamics model ( Watter et al. , 2015 ) , model-based planning for discrete and continuous actions ( Henaff et al. , 2017 ) , model-predictive control ( Chua et al. , 2018 ) , and model based policy optimization ( Janner et al. , 2019 ) . We deployed IDMs for mapping currenttarget states to actions ; other applications of IDMs in RL include the context of planning : search on replay buffer ( Eysenbach et al. , 2019 ) , episodic memory graph ( Yang et al. , 2020 ) , and topological memory for navigation ( Savinov et al. , 2018 ) . Existing many other applications of IDM in context of RL including : policy adaptation during deployment ( Hansen et al. , 2021 ) , sim to real transfer ( Christiano et al. , 2016 ) , adversarial exploration ( Hong et al. , 2020 ) , and curiosity-driven exploration ( Pathak et al. , 2017 ) . 1.2 BACKGROUND . Following the standard setting used in RL literature , we work with infinite horizon Markov decision process ( MDP ) formalism ( S , A , P , r , ρ0 , γ ) , where S is a state space , A is a action space , P : S × A×S → [ 0 , 1 ] is a transition probability distribution , r : S ×A → R is a reward function , ρ0 is an initial state distribution , and γ ∈ ( 0 , 1 ) is a discount factor . From now on we assume that the MDP is fixed . In RL the agent interacts with E in discrete steps by selecting an action at for the state st at time t , causing the state transition st+1 = E ( st , at ) , as a result the agent collects a scalar reward rt+1 ( st , at ) , the return is defined as the sum of discounted future rewardRt = ∑T i=t γ ( i−t ) r ( si , ai ) . The goal in RL is to learn a policy that maximizes the expected return from the start distribution . 2 STATE PLANNING POLICY REINFORCEMENT LEARNING APPROACH . Our SPP approach is rooted in state-state reinforcement learning , by which we mean setting in which RL agent is trained to plan goals in the state-space , the approach already employed e.g. , in HRL , planning , D3G RL algorithms ( see Tab . 1 ) . In SPP a state planning policy π given the current state st outputs zt – the desired target state to be reached by the environment in the next step . Forcing the environment to reach the desired state requires translating the target state to a suitable action at . Hence , we employ an additional model capable of mapping the current state-target state pair ( st , zt ) to the action at – a ( trainable ) IDM model . Ideally , we like to have consistency zt ( st ) ≈ st+1 . The consistency can not be guaranteed a-priori , is rather achieved in SPP setting by employing a constrained optimization approach . A diagram illustrating SPP approach is presented in Fig . 1 . We have freedom of choice of the particular RL algorithm ( RL agent ) and IDMs implementations . Currently , we use feed-forward neural networks , and RL Agent using implementations of the stateof-the-art off-policy RL algorithms : DDPG ( Lillicrap et al. , 2016 ) , TD3 ( Fujimoto et al. , 2018 ) and SAC ( Haarnoja et al. , 2018a ) . We present details of SPP-RL implementation in Sec . 4 using as the example SPP-DDPG . The encountered experiences during the execution of an off-policy RL algorithm are stored in replay buffer D. The main building block of SPP-RL are the state planning policies , intuitively a state planning policy selects a desired trajectory in the state-space of the environment . Definition 1 . We call a state planning policy a map πθ : S → P ( S ) parametrized using a vector of parameters θ ∈ Rn ( θ ) , and we denote πθ ( z|s ) a probability of the desired target state z ∈ S for the given current state s ∈ S. We call a deterministic state planning policy a parametrized map πθ : S → S , and we denote πθ ( s ) = z . We assume that π has continuous and bounded derivatives with respect to θ . We will call state planning policy whenever it is clear from the context deterministic/stochastic and omit the parameter subscript π = πθ . Besides the state planning policy ( Def . 1 ) the second main building block of the overall SPP agent is a model for mapping the current state-target pair ( st , zt ) to suitable action at . Following the existing literature , we call such model the inverse dynamics control model ( IDM ) , or simply the control model . Definition 2 . For a given MDP ( S , A , P , r , ρ0 , γ ) . Let s , z ∈ S. We define the control model : CM : S × S → A , CM ( s , z ) = a , i.e . for the given two states CM computes the action a . We call s , z the initial state and the target state respectively , where a informally satisfies argmaxb∈S P ( s , a , b ) ∼ z for stochastic E , or z ≈ E ( s , a ) for deterministic E. Obviously , in order to work , SPP requires consistency of the target states generated by the policy with the actual next-states of the environment . We call this property the state consistency property ( or simply consistency ) of π , refer to Fig . 2 . As it may be intractable to verify SPP for all possible interactions in continuous environments , we are interested in guaranteeing the state consistency for the experiences stored in the replay buffer . Property 1 . Let D be a replay buffer , CM be an IDM and π be a ( SPP ) policy . We say that π has the state consistency property with threshold d > 0 if it holds that E ( st , st+1 ) ∈D zt∼π ( st ) [ ∥st+1 − zt∥22 ] ≤ d , for deterministic π we have zt = π ( st ) . Given ( zt , st+1 ) , we call distance ∥zt − st+1∥22 the stateconsistency distance ( refer Fig . 2 ) . We will often assume that d is known from context and omit ’ with threshold d > 0 ’ .
This paper proposes a new RL algorithm whereby the policy selects a new state rather than action, with constraints to ensure the next state selected is a valid one. The contribution is the new algorithm "SPP-RL" which can be applied to off policy algorithms such as TD3/SAC. There is experimental evidence this may be an effective approach in some settings.
SP:e65255cf3bf0f0931b173745cc587476f9c2e867
SPP-RL: State Planning Policy Reinforcement Learning
We introduce an algorithm for reinforcement learning , in which the actor plans for the next state provided the current state . To communicate the actor output to the environment we incorporate an inverse dynamics control model and train it using supervised learning . We train the RL agent using off-policy state-of-the-art reinforcement learning algorithms : DDPG , TD3 , and SAC . To guarantee that the target states are physically relevant , the overall learning procedure is formulated as a constrained optimization problem , solved via the classical Lagrangian optimization method . We benchmark the state planning RL approach using a varied set of continuous environments , including standard MuJoCo tasks , safety-gym level 0 environments , and AntPush . In SPP approach the optimal policy is being searched for in the space of state-state mappings , a considerably larger space than the traditional space of state-action mappings . We report that quite surprisingly SPP implementations attain superior performance to vanilla state-of-the-art off-policy RL algorithms in a wide class of robotic locomotion environments . 1 INTRODUCTION . Research on reinforcement learning ( RL ) has brought a tremendous number of successful applications in diverse fields of science and technology . Application areas of RL can be split into two classes : discrete and continuous . Here , we are interested in continuous simulation environments , mostly in the robotics domain . Despite the magnitude of successful applications of RL in this domain , two of the main issues : sample efficiency and interpretability of RL trained agents , persist . These problems have utmost practical importance , especially for mission-critical applications . The current methods often require a vast amount of experience for training . The decision-making process of trained agents is not interpretable , sometimes resulting in finding proxy solutions . Thus , it is vital to research new RL algorithms that may partially solve the mentioned problems . Traditionally , RL is based on the principle of searching for the optimal policy within the space of state-action mappings . We propose a new algorithm based on the principle of training an actor ( a policy ) operating entirely in the state space ( state-state mappings ) . We call such policies the state planning policies ( SPP ) , whose actions determine desired trajectories in the state-space . The task of training SPP may initially seem infeasible due to a significantly larger dimension of states than of actions . Nonetheless , quite surprisingly , we show that the approach is feasible and often leads to significant improvements in average performance for a class of robotic locomotion tasks . We call our approach State Planning Policy Reinforcement Learning ( SPP-RL ) . It is a generic approach for problems specified using continuous environments . The main building block of SPP-RL – the RL agent can be implemented using virtually any RL algorithm . We chose to develop our approach using the state-of-the-art off-policy DDPG ( Lillicrap et al. , 2016 ) , TD3 ( Fujimoto et al. , 2018 ) , and SAC ( Haarnoja et al. , 2018a ) algorithms . Note that , in SPP-RL we need another trainable model to communicate the policy output to the environment ; as such , we incorporate a learnable inverse dynamics control model ( IDM ) , see Fig . 1 . The overall algorithm optimizes the policy simultaneously with CM . To ensure that the policy target states satisfy physical and under-actuation constraints , we formulate a constrained optimization objective for policy training . Our work lies within the category of RL methods that already implemented state-state policies , including work on hierarchical RL like Nachum et al . ( 2018 ) , and the D3G algorithm from Edwards et al . ( 2020 ) . Summary of results . Although the SPP-RL algorithm searches for the optimal policy within a much larger space , our performance benchmarks revealed that SPP-RL implementations often outperform their vanilla RL counterparts . Experiments performed in Ant & Humanoid tasks from MuJoCo suite ( Todorov et al. , 2012 ; Brockman et al. , 2016 ) reveal that SPP-DDPG outperforms DDPG . Experiments in Safety-Gym Level 0 environments ( Ray et al. , 2019 ) demonstrate that SPP-TD3 and SPP-SAC outperform by a great margin TD3 and SAC , respectively . Experiments in AntPush task ( Nachum et al. , 2018 ) show that SPP-TD3 outperforms hierarchical RL method HIRO ( Nachum et al. , 2018 ) and provides some interpretability of the agent behavior . We hypothesize that the superior performance of SPP-RL in the tested continuous environments originates in more efficient state-space exploration by state-state policies than traditional state-action policies ; here noise is being added to target states rather than actions . To argue this , we performed series of experiments , including evaluation of a shadow agent utilizing experience from SPP and vanilla replay buffers ( Sec . 5.4 ) and a study of the distributions of states gathered in different replay buffers ( App . E.2 ) . To analyze which features of the algorithm are crucial for superior performance , we report on a thorough ablation study of SPP-TD3 ( App . E.1 ) . We implemented SPP-RL methods as a modular PyTorch library shared as open-source . SPP-RL algorithms are derived from their vanilla RL counterparts , making extending the library with new RL algorithms straightforward . We also share videos with test episodes of the trained agents to accompany benchmark plots ( web , 2021 ) . Last but not least , we demonstrate theoretical convergence of clipped Double Q-learning implemented in SPP-TD3 algorithm within the classical stochastic processes , finite-state/action spaces setting and in environments based on rigid body dynamics model , refer to App . B.3 . 1.1 RELATED WORK . We present a ( non-exhaustive ) list of related works ; refer to Tab . 1 for a perspective on related work . The closest approach to ours is the D3G algorithm introduced by Edwards et al . ( 2020 ) , which includes state planning policies , and introduces a novel form of the value function defined on statenext state pairs . There are two main ways our method is distinct . First , SPP employs the classical formulation of the value function . Also , we do not include a forward dynamics model nor the cycle loss . Instead , to guarantee consistency of the policy target-states in SPP , we formulate a constrained optimization problem ( compare Fig . 2 ) solved via Lagrangian optimization . Our work builds on the classical RL algorithms going back to REINFORCE ( Williams , 1992 ) , Asynchronous Actor-Critic ( Mnih et al. , 2016 ) , and especially the off-policy actor-critic algorithms including Q-Prop ( Gu et al. , 2017 ) , DDPG ( Lillicrap et al. , 2016 ) , SAC ( Haarnoja et al. , 2018a ; b ) , and TD3 ( Fujimoto et al. , 2018 ) . State planning policies have been used in hierarchical RL ( HRL ) methods like HIRO ( Nachum et al. , 2018 ) and FuN ( Vezhnevets et al. , 2017 ) . Contrary to HRL SPP-RL approach does not employ a hierarchy of multiple policies nor state conditioned value functions . Training predictive models ( like IDMs ) is fundamental for the model-based RL approach including algorithms : a locally linear latent dynamics model ( Watter et al. , 2015 ) , model-based planning for discrete and continuous actions ( Henaff et al. , 2017 ) , model-predictive control ( Chua et al. , 2018 ) , and model based policy optimization ( Janner et al. , 2019 ) . We deployed IDMs for mapping currenttarget states to actions ; other applications of IDMs in RL include the context of planning : search on replay buffer ( Eysenbach et al. , 2019 ) , episodic memory graph ( Yang et al. , 2020 ) , and topological memory for navigation ( Savinov et al. , 2018 ) . Existing many other applications of IDM in context of RL including : policy adaptation during deployment ( Hansen et al. , 2021 ) , sim to real transfer ( Christiano et al. , 2016 ) , adversarial exploration ( Hong et al. , 2020 ) , and curiosity-driven exploration ( Pathak et al. , 2017 ) . 1.2 BACKGROUND . Following the standard setting used in RL literature , we work with infinite horizon Markov decision process ( MDP ) formalism ( S , A , P , r , ρ0 , γ ) , where S is a state space , A is a action space , P : S × A×S → [ 0 , 1 ] is a transition probability distribution , r : S ×A → R is a reward function , ρ0 is an initial state distribution , and γ ∈ ( 0 , 1 ) is a discount factor . From now on we assume that the MDP is fixed . In RL the agent interacts with E in discrete steps by selecting an action at for the state st at time t , causing the state transition st+1 = E ( st , at ) , as a result the agent collects a scalar reward rt+1 ( st , at ) , the return is defined as the sum of discounted future rewardRt = ∑T i=t γ ( i−t ) r ( si , ai ) . The goal in RL is to learn a policy that maximizes the expected return from the start distribution . 2 STATE PLANNING POLICY REINFORCEMENT LEARNING APPROACH . Our SPP approach is rooted in state-state reinforcement learning , by which we mean setting in which RL agent is trained to plan goals in the state-space , the approach already employed e.g. , in HRL , planning , D3G RL algorithms ( see Tab . 1 ) . In SPP a state planning policy π given the current state st outputs zt – the desired target state to be reached by the environment in the next step . Forcing the environment to reach the desired state requires translating the target state to a suitable action at . Hence , we employ an additional model capable of mapping the current state-target state pair ( st , zt ) to the action at – a ( trainable ) IDM model . Ideally , we like to have consistency zt ( st ) ≈ st+1 . The consistency can not be guaranteed a-priori , is rather achieved in SPP setting by employing a constrained optimization approach . A diagram illustrating SPP approach is presented in Fig . 1 . We have freedom of choice of the particular RL algorithm ( RL agent ) and IDMs implementations . Currently , we use feed-forward neural networks , and RL Agent using implementations of the stateof-the-art off-policy RL algorithms : DDPG ( Lillicrap et al. , 2016 ) , TD3 ( Fujimoto et al. , 2018 ) and SAC ( Haarnoja et al. , 2018a ) . We present details of SPP-RL implementation in Sec . 4 using as the example SPP-DDPG . The encountered experiences during the execution of an off-policy RL algorithm are stored in replay buffer D. The main building block of SPP-RL are the state planning policies , intuitively a state planning policy selects a desired trajectory in the state-space of the environment . Definition 1 . We call a state planning policy a map πθ : S → P ( S ) parametrized using a vector of parameters θ ∈ Rn ( θ ) , and we denote πθ ( z|s ) a probability of the desired target state z ∈ S for the given current state s ∈ S. We call a deterministic state planning policy a parametrized map πθ : S → S , and we denote πθ ( s ) = z . We assume that π has continuous and bounded derivatives with respect to θ . We will call state planning policy whenever it is clear from the context deterministic/stochastic and omit the parameter subscript π = πθ . Besides the state planning policy ( Def . 1 ) the second main building block of the overall SPP agent is a model for mapping the current state-target pair ( st , zt ) to suitable action at . Following the existing literature , we call such model the inverse dynamics control model ( IDM ) , or simply the control model . Definition 2 . For a given MDP ( S , A , P , r , ρ0 , γ ) . Let s , z ∈ S. We define the control model : CM : S × S → A , CM ( s , z ) = a , i.e . for the given two states CM computes the action a . We call s , z the initial state and the target state respectively , where a informally satisfies argmaxb∈S P ( s , a , b ) ∼ z for stochastic E , or z ≈ E ( s , a ) for deterministic E. Obviously , in order to work , SPP requires consistency of the target states generated by the policy with the actual next-states of the environment . We call this property the state consistency property ( or simply consistency ) of π , refer to Fig . 2 . As it may be intractable to verify SPP for all possible interactions in continuous environments , we are interested in guaranteeing the state consistency for the experiences stored in the replay buffer . Property 1 . Let D be a replay buffer , CM be an IDM and π be a ( SPP ) policy . We say that π has the state consistency property with threshold d > 0 if it holds that E ( st , st+1 ) ∈D zt∼π ( st ) [ ∥st+1 − zt∥22 ] ≤ d , for deterministic π we have zt = π ( st ) . Given ( zt , st+1 ) , we call distance ∥zt − st+1∥22 the stateconsistency distance ( refer Fig . 2 ) . We will often assume that d is known from context and omit ’ with threshold d > 0 ’ .
The paper describes an approach where a state-state mapping is learned (called state-planning policy or SPP) coupled with an off-policy RL system (the authors included experiments with DDPG, TD3, and SAC). Learning a state-state mapping, Q(s,s'), needs also to learn an inverse dynamic model to estimate which action (a) will take the current state (s) to the next state (s'). The authors framed the problem as a constrained optimization approach, where the objective is to maximize the sum of discounted rewards such that the differences between the target states (produced by the policy) and the actual states (produced by the environment with the action from the control model) are within a certain threshold distance. In particular, the authors solved the optimization problem via the Lagrange multiplier method. Experiments were performed in different domains and with different state-of-the-art DRL systems.
SP:e65255cf3bf0f0931b173745cc587476f9c2e867
Learning by Directional Gradient Descent
1 INTRODUCTION . A key requirement of intelligence is the ability to integrate information over time , by constructing an internal representation of state from sequences of observations . This is critical for an agent to predict or control its future experience , whenever its environment is not fully observable ( i.e . whenever individual observation are not sufficient for making the required predictions , or decisions ) . An efficient representation must construct state incrementally through an update function st+1 = update ( st , ot ) with the previous state st and the last observation ot as inputs . Since observations may include lots of redundant or irrelevant information , state representations must be tailored to a given task , encoding all and only the aspects of past experience required to perform such task . To learn state representations from data , it is useful to be able to assess how changing the update function affects the long term performance of the agent . If the update function is parameterized by a differentiable function such as a recurrent neural network , we can measure the effect of changing each parameter in terms of a suitable loss function , and then update the parameter in the direction of steepest descent of the loss function , by using a suitable variant of ( stochastic ) gradient descent . Unfortunately , no existing method for computing the steepest descent direction of a recurrent function satisfies all the basic desiderata for a general approach to the problem . Prior methods either use too much memory ( BPTT , Rumelhart et al . 1986 ; Werbos 1988 ) , too much computation ( RTRL , Williams & Zipser 1989 ) , have too much variance ( UORO , Tallec & Ollivier 2017 ; SPSA , Spall et al . 1992 ) , or too much bias ( DPG , Silver et al . 2014 ; synthetic gradients , Jaderberg et al . 2017b ) . In this paper we propose an algorithm to efficiently perform near-steepest descent of recurrent functions , using the same computational and memory complexity as the forward computation of the recurrent function . The proposed approach is based upon the observation that the directional derivative of a recurrent function along any arbitrary direction u can be computed efficiently and then can be used to construct a descent direction . When applied to recurrent networks , this observation allows the directional derivative of a recurrent function to be computed efficiently in a fully online manner , with computational cost the same as the forward computation of the function . What direction u is most effective ? In the special case where u matches the direction of the true gradient , we recover the steepest descent update . This suggests the following algorithm : first approximate the true gradient , and then follow a descent direction along the direction of the estimated gradient , in order to reduce the loss . We analyse and evaluate empirically random choices of direction , and also investigate directions based upon several methods of gradient approximation . 01 DeepMind , London , UK , 2 University College London , 3 Mila , University of Montreal . Corresponding author : anirudhgoyal9119 @ gmail.com 2 METHODS FOR APPROXIMATING THE GRADIENT . In this section , we first give a brief overview of common methods for approximating true gradient . Notation . We consider a recurrent network represented by a differentiable function ( lt , xt ) = f ( xt−1 , ot , w ) . The recurrent network maintains at each time-step t an internal `` hidden '' state xt of size n , and receives an observation ot . The recurrent function is parameterized by a vector w of size p. At every time-step there is a loss lt. For our purposes , any output of the network ( such as its predictions or actions ) may be considered to be part of the internal state xt that leads to a loss lt . The objective is to minimise the total loss L = ∑T t=1 lt over T time-steps . A key requirement for efficient optimization is the computation of the gradient of the total loss with respect to the parameters , ∂L ∂w = ∑T t=1 ∂lt ∂w . Backpropagation-through-time ( BPTT ) . Backpropagation-through-time ( BPTT ) uses backward differentiation to compute the gradient of the cumulative loss with respect to the parameters of a recurrent neural network . Specifically , the gradient can be computed by exchanging indices to consider the effect of state xt on all future losses lt , ... , lT : ∂L ∂w = T∑ t=1 ∂lt ∂w = T∑ t=1 t∑ j=1 ∂lt ∂xj ∂xj ∂w = T∑ t=1 T∑ j=t ∂lj ∂xt ∂xt ∂w . ( 1 ) The inner term may be accumulated by backpropagation of error , T∑ j=t ∂lj ∂xt = ∂lt ∂xt + T∑ j=t+1 ∂lj ∂xt+1 ∂xt+1 ∂xt . This requires just O ( p ) computation per time-step ; however , the entire sequence must first be processed forward to compute the output . In practice , the memory-requirements of BPTT limit the computation of gradients to short windows , and limit the choice of neural network architecture to those with modest memory requirements . If the gradient of large neural networks must be computed over long horizons then BPTT may not be an appropriate choice of algorithm . Synthetic Gradients and Direct Policy Gradients . We now consider how one may use ideas drawn from reinforcement learning to estimate the future loss and hence allow for efficient online computation of gradients . One may estimate the loss using a value function ṽ ( xt ) ≈ ∑T j=t lj and use the estimated loss in place of the true loss , ∂L ∂w = T∑ t=1 T∑ j=t ∂lj ∂xt ∂xt ∂w ≈ T∑ t=1 ∂ṽ ( xt ) ∂xt ∂xt ∂w , ( 2 ) where the loss may be estimated by bootstrapping from the next time-step , ṽ ( xt ) ≈ lt + ∑T j=t+1 lj ≈ lt + ṽ ( xt+1 ) . Alternatively , one may estimate the backpropagated gradient ṽ′ ( xt ) ≈ ∑T j=t ∂lt+j ∂xt and use the estimated gradient in place of the true gradient , ∂L ∂w ≈ T∑ t=1 ṽ′ ( xt ) ∂xt ∂w , where the backpropagated gradient may be estimated by bootstrapping from the next time-step , ṽ′ ( xt ) ≈ ∂lt∂xt + ∑T j=t+1 ∂lj ∂xt+1 ∂xt+1 ∂xt ≈ ∂lt∂xt + ṽ ′ ( xt+1 ) ∂xt+1 ∂xt . It is worth noting that the former approach is equivalent to the Deterministic Policy Gradient ( DPG ) ( Silver et al. , 2014 ) in a reinforcement learning problem where the state is considered to be the input state st = xt−1 , the action is the next state at = xt , the policy is the function mapping from state xt−1 to action xt parameterized by weights w , and the reward is the negative loss rt = −lt ( Jaderberg et al. , 2017b ) . In practice , both deterministic gradients and synthetic gradients introduce significant bias into the estimate of the gradient . This has the downside that stochastic gradient descent , applied to the estimated gradient , may not actually descend the loss and may fail to converge . Real-time recurrent learning ( RTRL ) . We now consider methods that compute the gradient of a recurrent function by forward differentiation . Given a function z = hT ( ... ( h1 ( y ) ) ... ) with derivative dz dy = JT ... J1 where Jt is the Jacobian of function ht , one may instead compute the derivative dz dy = ( JT ... ( J2 ( J1 ) ) ) by processing the chain rule in a forward direction and caching the intermediate quantity dhtdy = Jt ... J1 . This is only computationally efficient when y is smaller than z ; this is the opposite case to usual in deep learning where we have many parameters for y and a scalar loss for z. Real-time recurrent learning ( RTRL , Williams & Zipser , 1989 ) applies forward differentiation to compute the gradient of the cumulative loss with respect to the parameters of recurrent functions . This is achieved by caching the sensitivity of state to weights dxtdw , i.e . the total derivative of state to weights via all previous states , ∂L ∂w = T∑ t=1 ∂lt ∂w = T∑ t=1 ∂lt ∂xt dxt dw . The sensitivity may be accumulated via forward accumulation , dxt+1 dw = ∂xt+1 ∂w + ∂xt+1 ∂xt dxt dw . The size of the matrix dxtdw is n× p and the computational cost of multiplying the Jacobian matrices in the second term is O ( pn2 ) , leading to a costly overall algorithm that is impractical for large-scale deep learning . 3 DEEP ONLINE DIRECTIONAL GRADIENT ESTIMATE ( DODGE ) . After explaining a directional derivative , we will introduce our online directional gradient estimate . 3.1 DIRECTIONAL DERIVATIVE . A basic property of gradients is that the directional derivative can be computed efficiently . One may efficiently compute the Jacobian-vector product dzdy · u = ( Jn ... ( J2 ( J1 · u ) ) ) for any tangent vector u of size p. A geometric interpretation of this product is the directional derivative of the gradient , i.e . dz dy · u describes how much the gradient descends in the direction of the vector u . 3.2 GRADIENT ESTIMATE . When applied to recurrent networks , the directional derivative of a recurrent function can be computed efficiently with computational cost of justO ( p ) per time-step , i.e . the same as the forward computation of the function . ∂L ∂w · u = T∑ t=1 ∂lt ∂xt ( dxt dw · u ) dxt+1 dw · u = ∂xt+1 ∂w · u+ ∂xt+1 ∂xt ( dxt dw · u ) For any unitary u , calculating the directional derivative along that direction provides a valid descent direction for updating weights , ∆w ∝ ( ∂L ∂w · u ) u . The direction of steepest descent may be computed from many such tangent vectors , for example ∂L ∂w = ∑p i=1 ( ∂L ∂w · ei ) ei for the unit bases e1 , ... , ep . This requires p separate directional derivatives . Alternatively , random directions such as ui ∼ { −1 , +1 } p may be sampled , leading to an accumulated gradient estimate ∂L∂w ≈ 1 n ∑n i=1 ( ∂L ∂w · ui ) ui , but at the cost of introducing significant variance . However , if the tangent vector is chosen to be the gradient direction itself , u = g‖g‖ where g = ∂L ∂w , then only one such directional derivative is required , ( g · u ) u = ( g · g ‖g‖ ) g ‖g‖ = g. We are often interested in the expectation of the gradient , E [ g ] rather than the sample gradient . For example , stochastic gradient descent ( SGD ) averages over sample gradients to descend in the direction of the overall gradient . When using directional gradient descent , one may either compute the directional derivative of an individual sample gradient , and then average , or compute the directional derivative in the direction of the expected gradient u = ḡ‖ḡ‖ where ḡ = E [ g ] , and then average : E [ ( g · u ) u ] = E [ ( g · ḡ ‖ḡ‖ ) ḡ ‖ḡ‖ ] = ( ḡ · ḡ ‖ḡ‖ ) ḡ ‖ḡ‖ = ḡ . This suggests a novel strategy of estimating the expected gradient ḡ and using the estimated gradient as a descent direction u in ( ∂L∂w · u ) u . Note that , regardless of the quality of the gradient estimate , the algorithm will always follow a valid descent direction.A valid descent direction has a non-negative dot-product with the true gradient . The quality of the gradient solely determines the steepness of descent in expectation . In the next section , we consider methods that provide such an estimate of the gradient . We refer to this family of algorithms as Deep Online Directional Gradient Estimate ( DODGE ) and they can be understood as near-steepest descent algorithms . def dodge ( loss_function , params , direction ) : # Compute the Jacobian-vector product . loss , loss_jvp = jax.jvp ( loss_function , [ params ] , [ direction ] ) grad_estimate = loss_jvp * direction return loss , grad_estimate Listing 1 : DODGE implemented in JAX .
The paper proposes a new gradient-based learning algorithm for recurrent neural networks, making use of the directional derivative along a candidate direction. The directional derivative serves the purpose of improving the usefulness of a given candidate direction for gradient-based parameter updates by computing the projection of the gradient along the given direction. The candidate direction can come from various sources such as randomly sampled directions, truncated backpropagation through time (BPTT), the “Reptile” meta-learning approach by Nichol et al. (2018), or synthetic gradients. The authors call this technique “deep online directional gradient estimate” (DODGE) and demonstrate it in several experiments including a copy task (Graves et al. 2014) and a NeRF task (Mildenhall et al. 2020).
SP:ddd7d3c20a2aed0e4408e88e37806824c5d52b4d
Learning by Directional Gradient Descent
1 INTRODUCTION . A key requirement of intelligence is the ability to integrate information over time , by constructing an internal representation of state from sequences of observations . This is critical for an agent to predict or control its future experience , whenever its environment is not fully observable ( i.e . whenever individual observation are not sufficient for making the required predictions , or decisions ) . An efficient representation must construct state incrementally through an update function st+1 = update ( st , ot ) with the previous state st and the last observation ot as inputs . Since observations may include lots of redundant or irrelevant information , state representations must be tailored to a given task , encoding all and only the aspects of past experience required to perform such task . To learn state representations from data , it is useful to be able to assess how changing the update function affects the long term performance of the agent . If the update function is parameterized by a differentiable function such as a recurrent neural network , we can measure the effect of changing each parameter in terms of a suitable loss function , and then update the parameter in the direction of steepest descent of the loss function , by using a suitable variant of ( stochastic ) gradient descent . Unfortunately , no existing method for computing the steepest descent direction of a recurrent function satisfies all the basic desiderata for a general approach to the problem . Prior methods either use too much memory ( BPTT , Rumelhart et al . 1986 ; Werbos 1988 ) , too much computation ( RTRL , Williams & Zipser 1989 ) , have too much variance ( UORO , Tallec & Ollivier 2017 ; SPSA , Spall et al . 1992 ) , or too much bias ( DPG , Silver et al . 2014 ; synthetic gradients , Jaderberg et al . 2017b ) . In this paper we propose an algorithm to efficiently perform near-steepest descent of recurrent functions , using the same computational and memory complexity as the forward computation of the recurrent function . The proposed approach is based upon the observation that the directional derivative of a recurrent function along any arbitrary direction u can be computed efficiently and then can be used to construct a descent direction . When applied to recurrent networks , this observation allows the directional derivative of a recurrent function to be computed efficiently in a fully online manner , with computational cost the same as the forward computation of the function . What direction u is most effective ? In the special case where u matches the direction of the true gradient , we recover the steepest descent update . This suggests the following algorithm : first approximate the true gradient , and then follow a descent direction along the direction of the estimated gradient , in order to reduce the loss . We analyse and evaluate empirically random choices of direction , and also investigate directions based upon several methods of gradient approximation . 01 DeepMind , London , UK , 2 University College London , 3 Mila , University of Montreal . Corresponding author : anirudhgoyal9119 @ gmail.com 2 METHODS FOR APPROXIMATING THE GRADIENT . In this section , we first give a brief overview of common methods for approximating true gradient . Notation . We consider a recurrent network represented by a differentiable function ( lt , xt ) = f ( xt−1 , ot , w ) . The recurrent network maintains at each time-step t an internal `` hidden '' state xt of size n , and receives an observation ot . The recurrent function is parameterized by a vector w of size p. At every time-step there is a loss lt. For our purposes , any output of the network ( such as its predictions or actions ) may be considered to be part of the internal state xt that leads to a loss lt . The objective is to minimise the total loss L = ∑T t=1 lt over T time-steps . A key requirement for efficient optimization is the computation of the gradient of the total loss with respect to the parameters , ∂L ∂w = ∑T t=1 ∂lt ∂w . Backpropagation-through-time ( BPTT ) . Backpropagation-through-time ( BPTT ) uses backward differentiation to compute the gradient of the cumulative loss with respect to the parameters of a recurrent neural network . Specifically , the gradient can be computed by exchanging indices to consider the effect of state xt on all future losses lt , ... , lT : ∂L ∂w = T∑ t=1 ∂lt ∂w = T∑ t=1 t∑ j=1 ∂lt ∂xj ∂xj ∂w = T∑ t=1 T∑ j=t ∂lj ∂xt ∂xt ∂w . ( 1 ) The inner term may be accumulated by backpropagation of error , T∑ j=t ∂lj ∂xt = ∂lt ∂xt + T∑ j=t+1 ∂lj ∂xt+1 ∂xt+1 ∂xt . This requires just O ( p ) computation per time-step ; however , the entire sequence must first be processed forward to compute the output . In practice , the memory-requirements of BPTT limit the computation of gradients to short windows , and limit the choice of neural network architecture to those with modest memory requirements . If the gradient of large neural networks must be computed over long horizons then BPTT may not be an appropriate choice of algorithm . Synthetic Gradients and Direct Policy Gradients . We now consider how one may use ideas drawn from reinforcement learning to estimate the future loss and hence allow for efficient online computation of gradients . One may estimate the loss using a value function ṽ ( xt ) ≈ ∑T j=t lj and use the estimated loss in place of the true loss , ∂L ∂w = T∑ t=1 T∑ j=t ∂lj ∂xt ∂xt ∂w ≈ T∑ t=1 ∂ṽ ( xt ) ∂xt ∂xt ∂w , ( 2 ) where the loss may be estimated by bootstrapping from the next time-step , ṽ ( xt ) ≈ lt + ∑T j=t+1 lj ≈ lt + ṽ ( xt+1 ) . Alternatively , one may estimate the backpropagated gradient ṽ′ ( xt ) ≈ ∑T j=t ∂lt+j ∂xt and use the estimated gradient in place of the true gradient , ∂L ∂w ≈ T∑ t=1 ṽ′ ( xt ) ∂xt ∂w , where the backpropagated gradient may be estimated by bootstrapping from the next time-step , ṽ′ ( xt ) ≈ ∂lt∂xt + ∑T j=t+1 ∂lj ∂xt+1 ∂xt+1 ∂xt ≈ ∂lt∂xt + ṽ ′ ( xt+1 ) ∂xt+1 ∂xt . It is worth noting that the former approach is equivalent to the Deterministic Policy Gradient ( DPG ) ( Silver et al. , 2014 ) in a reinforcement learning problem where the state is considered to be the input state st = xt−1 , the action is the next state at = xt , the policy is the function mapping from state xt−1 to action xt parameterized by weights w , and the reward is the negative loss rt = −lt ( Jaderberg et al. , 2017b ) . In practice , both deterministic gradients and synthetic gradients introduce significant bias into the estimate of the gradient . This has the downside that stochastic gradient descent , applied to the estimated gradient , may not actually descend the loss and may fail to converge . Real-time recurrent learning ( RTRL ) . We now consider methods that compute the gradient of a recurrent function by forward differentiation . Given a function z = hT ( ... ( h1 ( y ) ) ... ) with derivative dz dy = JT ... J1 where Jt is the Jacobian of function ht , one may instead compute the derivative dz dy = ( JT ... ( J2 ( J1 ) ) ) by processing the chain rule in a forward direction and caching the intermediate quantity dhtdy = Jt ... J1 . This is only computationally efficient when y is smaller than z ; this is the opposite case to usual in deep learning where we have many parameters for y and a scalar loss for z. Real-time recurrent learning ( RTRL , Williams & Zipser , 1989 ) applies forward differentiation to compute the gradient of the cumulative loss with respect to the parameters of recurrent functions . This is achieved by caching the sensitivity of state to weights dxtdw , i.e . the total derivative of state to weights via all previous states , ∂L ∂w = T∑ t=1 ∂lt ∂w = T∑ t=1 ∂lt ∂xt dxt dw . The sensitivity may be accumulated via forward accumulation , dxt+1 dw = ∂xt+1 ∂w + ∂xt+1 ∂xt dxt dw . The size of the matrix dxtdw is n× p and the computational cost of multiplying the Jacobian matrices in the second term is O ( pn2 ) , leading to a costly overall algorithm that is impractical for large-scale deep learning . 3 DEEP ONLINE DIRECTIONAL GRADIENT ESTIMATE ( DODGE ) . After explaining a directional derivative , we will introduce our online directional gradient estimate . 3.1 DIRECTIONAL DERIVATIVE . A basic property of gradients is that the directional derivative can be computed efficiently . One may efficiently compute the Jacobian-vector product dzdy · u = ( Jn ... ( J2 ( J1 · u ) ) ) for any tangent vector u of size p. A geometric interpretation of this product is the directional derivative of the gradient , i.e . dz dy · u describes how much the gradient descends in the direction of the vector u . 3.2 GRADIENT ESTIMATE . When applied to recurrent networks , the directional derivative of a recurrent function can be computed efficiently with computational cost of justO ( p ) per time-step , i.e . the same as the forward computation of the function . ∂L ∂w · u = T∑ t=1 ∂lt ∂xt ( dxt dw · u ) dxt+1 dw · u = ∂xt+1 ∂w · u+ ∂xt+1 ∂xt ( dxt dw · u ) For any unitary u , calculating the directional derivative along that direction provides a valid descent direction for updating weights , ∆w ∝ ( ∂L ∂w · u ) u . The direction of steepest descent may be computed from many such tangent vectors , for example ∂L ∂w = ∑p i=1 ( ∂L ∂w · ei ) ei for the unit bases e1 , ... , ep . This requires p separate directional derivatives . Alternatively , random directions such as ui ∼ { −1 , +1 } p may be sampled , leading to an accumulated gradient estimate ∂L∂w ≈ 1 n ∑n i=1 ( ∂L ∂w · ui ) ui , but at the cost of introducing significant variance . However , if the tangent vector is chosen to be the gradient direction itself , u = g‖g‖ where g = ∂L ∂w , then only one such directional derivative is required , ( g · u ) u = ( g · g ‖g‖ ) g ‖g‖ = g. We are often interested in the expectation of the gradient , E [ g ] rather than the sample gradient . For example , stochastic gradient descent ( SGD ) averages over sample gradients to descend in the direction of the overall gradient . When using directional gradient descent , one may either compute the directional derivative of an individual sample gradient , and then average , or compute the directional derivative in the direction of the expected gradient u = ḡ‖ḡ‖ where ḡ = E [ g ] , and then average : E [ ( g · u ) u ] = E [ ( g · ḡ ‖ḡ‖ ) ḡ ‖ḡ‖ ] = ( ḡ · ḡ ‖ḡ‖ ) ḡ ‖ḡ‖ = ḡ . This suggests a novel strategy of estimating the expected gradient ḡ and using the estimated gradient as a descent direction u in ( ∂L∂w · u ) u . Note that , regardless of the quality of the gradient estimate , the algorithm will always follow a valid descent direction.A valid descent direction has a non-negative dot-product with the true gradient . The quality of the gradient solely determines the steepness of descent in expectation . In the next section , we consider methods that provide such an estimate of the gradient . We refer to this family of algorithms as Deep Online Directional Gradient Estimate ( DODGE ) and they can be understood as near-steepest descent algorithms . def dodge ( loss_function , params , direction ) : # Compute the Jacobian-vector product . loss , loss_jvp = jax.jvp ( loss_function , [ params ] , [ direction ] ) grad_estimate = loss_jvp * direction return loss , grad_estimate Listing 1 : DODGE implemented in JAX .
This paper proposes to adapt the RTRL technique when training RNNs to make it usable in practice. That is, instead of computing the full gradient of the loss $L$ according to all parameters, the proposed method "DODGE" consists in computing the gradient of $L$ in *one* or a small number of directions in the parameter space. These "directional gradients" of $L$ are much easier to compute than the full gradient when using RTRL. More precisely, the user can choose a subspace $\mathcal{P}'$ (of dim. $p'$) of the space of parameters $\mathcal{P}$ (of dim. $p$), and compute the projection of the true gradient $g^*$ of $L$ on the space $\mathcal{P}'$, *with a computational cost proportional to $p'$*. This is advantageous when $p' \ll p$. Notably, this method can be used in two ways: * estimating the true gradient by computing its projection on a random low-dimensional subspace of the parameters; * improve an existing estimation $\hat{g}$ of the true gradient $g^*$ by computing the projection of $g^*$ on $\hat{g}$: this projection has better properties than $\hat{g}$.
SP:ddd7d3c20a2aed0e4408e88e37806824c5d52b4d
Controlling Directions Orthogonal to a Classifier
1 INTRODUCTION . Many machine learning applications require explicit control of directions that are orthogonal to a predefined one . For example , to ensure fairness , we can learn a classifier that is orthogonal to sensitive attributes such as gender or race ( Zemel et al. , 2013 ; Madras et al. , 2018 ) . Similar , if we transfer images from one style to another , content other than style should remain untouched . Therefore images before and after transfer should align in directions orthogonal to style . Common to these problems is the task of finding an orthogonal classifier . Given any principal classifier operating on the basis of principal variables , our goal is to find a classifier , termed orthogonal classifier , that predicts the label on the basis of orthogonal variables , defined formally later . The notion of orthogonality is clear in the linear case . Consider a joint distribution PXY over X ∈ Rd and binary label Y . Suppose the label distribution is Bernoulli , i.e. , PY = B ( Y ; 0.5 ) and class-conditional distributions are Gaussian , PX ∣Y =y = N ( X ; µy , σ2yI ) , where the means and variances depend on the label . If the principal classifier is linear , w1 = Pr ( Y = 1∣θ⊺1x ) , any classifier w2 , in the setW2 = { Pr ( Y = 1∣θ⊺2x ) ∣ θ⊺1θ2 = 0 } , is considered orthogonal to w1 . Thus the two classifiers w1 , w2 , with orthogonal decision boundaries ( Fig . 1 ) focus on distinct but complementary attributes for predicting the same label . Finding the orthogonal classifier is no longer straightforward in the non-linear case . To rigorously define what we mean by the orthogonal classifier , we first introduce the notion of mutually orthogonal random variables that correspond to ( conditinally ) independent latent variables mapped to observations through a diffeomorphism ( or bijection if discrete ) . Each r.v . is predictive of the label but represents complementary information . Indeed , we show that the orthogonal random variable maximizes the conditional mutual information with the label given the principal counterpart , subject to an independence constraint that ensures complementarity . Our search for the orthogonal classifier can be framed as follows : given a principal classifier w1 using some unknown principal r.v . for prediction , how do we find its orthogonal classifier w2 relying solely on orthogonal random variables ? The solution to this problem , which we call classifier orthogonalization , turns out to be surprisingly simple . In addition to the principal classifier , we assume access to a full classifier wx that predicts the same label based on all the available information , implicitly relying on both principal and orthogonal latent variables . The full classifier can be trained normally , absent of constraints1 . We can then effectively “ subtract ” the contribution of w1 from the full classifier to obtain the orthogonal classifier w2 which we denote as w2 = wx ∖w1 . The advantage of this construction is that 1The full classifier may fail to depend on all the features , e.g. , due to simplicity bias ( Shah et al. , 2020 ) . we do not need to explicitly identify the underlying orthogonal variables . It suffices to operate only on the level of classifier predictions . We provide several use cases for the orthogonal classifier , either as a predictor or as a discriminator . As a predictor , the orthogonal classifier predictions are invariant to the principal sensitive r.v. , thus ensuring fairness . As a discriminator , the orthogonal classifier enforces a partial alignment of distributions , allowing changes in the principal direction . We demonstrate the value of such discriminators in 1 ) controlled style transfer where the source and target domains differ in multiple aspects , but we only wish to align domain A ’ s style to domain B , leaving other aspects intact ; 2 ) domain adaptation with label shift where we align feature distributions between the source and target domains , allowing shifts in label proportions . Our results show that the simple method is on par with the state-of-the-art methods in each task . 2 NOTATIONS AND DEFINITION . Symbols . We use the uppercase to denote random variable ( e.g. , data X , label Y ) , the lowercase to denote the corresponding samples and the calligraphic letter to denote the sample spaces of r.v. , e.g. , data sample space X . We focus on the setting where label space Y is discrete , i.e. , Y = { 1 , ⋯ , C } , and denote the C − 1 dimensional probability simplex as ∆C . A classifier w ∶ X →∆C is a mapping from sample space to the simplex . Its y-th dimension w ( x ) y denotes the predicted probability of label y for sample x . Distributions . For random variables A , B , we use the notation pA , pA∣B , pAB to denote the marginal/conditional/joint distribution , i.e. , pA ( a ) = p ( A = a ) , pA∣B ( a∣b ) = p ( A = a∣B = b ) , pAB ( a , b ) = p ( A = a , B = b ) . Sometimes , for simplicity , we may ignore the subscript if there is no ambiguity , e.g. , p ( a∣b ) is an abbreviation for pA∣B ( a∣b ) . We begin by defining the notion of an orthogonal random variable . We consider continuous X , Z1 , Z2 and assume their supports are manifolds diffeomorphic to the Euclidean space . The probability density functions ( PDF ) are in C1 . Given a joint distribution pXY , we define the orthogonal random variable as follows : Definition 1 ( Orthogonal random variables ) . We say Z1 and Z2 are orthogonal random variables w.r.t pXY if they satisfy the following properties : ( i ) There exists a diffeomorphism f ∶ Z1 ×Z2 → X such that f ( Z1 , Z2 ) =X . ( ii ) Z1 and Z2 are statistically independent given Y , i.e. , Z1 ⊥ Z2∣Y . The orthogonality relation is symmetric by definition . Note that the orthogonal pair perfectly reconstructs the observations via the diffeomorphism f ; as random variables they are also sampled independently from class conditional distributions p ( Z1∣Y ) and p ( Z2∣Y ) . For example , we can regard foreground objects and background scenes in natural images as being mutually orthogonal random variables . Remark . The definition of orthogonality can be similarly developed for discrete variables and discretecontinuous mixtures . For discrete variables , for example , we can replace the requirement of diffeomorphism with bijection . Since the diffeomorphism f is invertible , we can use z1 ∶ X → Z1 and z2 ∶ X → Z2 to denote the two parts of the inverse mapping so that Z1 = z1 ( X ) and Z2 = z2 ( X ) . Note that , for a given joint distribution pXY , the decomposition into orthogonal random variables is not unique . There are multiple pairs of random variables that represent valid mutually orthogonal latents of the data . We can further justify our definition of orthogonality from an information theoretic perspective by showing that the choice of z2 attains the maximum of the following constrained optimization problem . Proposition 1 . Suppose the orthogonal r.v . of z1 ( X ) w.r.t pXY exists and is denoted as z2 ( X ) . Then z ( X ) = z2 ( X ) is a maximizer of I ( z ( X ) ; Y ∣z1 ( X ) ) subject to I ( z ( X ) ; z1 ( X ) ∣Y ) = 0 . We defer the proof to Appendix B.1 . Proposition 1 shows that the orthogonal random variable maximizes the additional information about the label we can obtain from X while remaining conditionally independent of the principal random variable . This ensures complementary in predicting the label . 3 CONSTRUCTING THE ORTHOGONAL CLASSIFIER . Let Z1 = z1 ( X ) and Z2 = z2 ( X ) be mutually orthogonal random variables w.r.t pXY . We call Z1 the principal variable and Z2 the orthogonal variable . In this section , we describe how we can construct the Bayes optimal classifier operating on features Z2 from the Bayes optimal classifier relying on Z1 . We formally refer to the classifiers of interests as : ( 1 ) principal classifier w1 ( x ) y = p ( Y = y∣Z1 = z1 ( x ) ) ; ( 2 ) orthogonal classifier w2 ( x ) y = p ( Y = y∣Z2 = z2 ( x ) ) ; ( 3 ) full classifier wx ( x ) y = p ( Y = y∣X = x ) . 3.1 CLASSIFIER ORTHOGONALIZATION . Our key idea relies on the bijection between the density ratio and the Bayes optimal classifier ( Sugiyama et al. , 2012 ) . Specifically , the ratio of densities pX ∣Y ( x∣i ) and pX ∣Y ( x∣j ) , assigned to an arbitrary point x , can be represented by the Bayes optimal classifier w ( x ) i = Pr ( Y = i∣x ) as pX∣Y ( x∣i ) pX∣Y ( x∣j ) = pY ( j ) w ( x ) i pY ( i ) w ( x ) j . Similar , the principal classifier w1 gives us associated density ratios of class-conditional distributions over Z1 . For any i , j ∈ Y , we have pZ1 ∣Y ( z1 ( x ) ∣i ) pZ1 ∣Y ( z1 ( x ) ∣j ) = pY ( j ) w1 ( x ) i pY ( i ) w1 ( x ) j . These can be combined to obtain density ratios of class-conditional distribution pZ2∣Y and subsequently calculate the orthogonal classifier w2 . We additionally rely on the fact that the diffeomorphism f permits us to change variables between x and z1 , z2 : pX ∣Y ( x∣i ) = pZ1∣Y ( z1∣i ) ∗ pZ2∣Y ( z2∣i ) ∗ volJf ( z1 , z2 ) , where volJf is volume of the Jacobian ( Berger et al. , 1987 ) of the diffeomorphism mapping . Taken together , pZ2∣Y ( z2∣i ) pZ2∣Y ( z2∣j ) = pZ1∣Y ( z1∣i ) ∗ pZ2∣Y ( z2∣i ) ∗ volJf ( z1 , z2 ) pZ1∣Y ( z1∣j ) ∗ pZ2∣Y ( z2∣j ) ∗ volJf ( z1 , z2 ) / pZ1∣Y ( z1∣i ) pZ1∣Y ( z1∣j ) = wx ( x ) i wx ( x ) j / w1 ( x ) i w1 ( x ) j ( 1 ) Note that since the diffeomorphism f is shared with all classes , the Jacobian is the same for all labelconditioned distributions on Z1 , Z2 . Hence the Jacobian volume terms cancel each other in the above equation . We can then finally work backwards from the density ratios of pZ2∣Y to the orthogonal classifier : Pr ( Y = i∣Z2 = z2 ( x ) ) = Pr ( Y = i ) wx ( x ) i w1 ( x ) i /∑ j ( Pr ( Y = j ) wx ( x ) j w1 ( x ) j ) ( 2 ) We call this procedure classifier orthogonalization since it adjusts the full classifier wx to be orthogonal to the principal classifier w1 . The validity of this procedure requires overlapping supports of the classconditional distributions , which ensures the classifier outputs wx ( x ) i , w1 ( x ) i to remain non-zero for all x ∈ X , i ∈ Y . Empirically , we usually have access to a dataset D = { ( xt , yt ) } nt=1 with n iid samples from the joint distribution pXY . To obtain the orthogonal classifier , we need to first train the full classifier ŵx based on the dataset D. We can then follow the classifier orthogonalization to get an empirical orthogonal classifier , denoted as w2 = ŵx ∖w1 . We use symbol ∖ to emphasize that the orthogonal classifier uses complementary information relative to z1 . Algorithm 1 summarizes the construction of the orthogonal classifier . Generalization bound . Since wx is trained on a finite dataset , we consider the generalization bound of the constructed orthogonal classifier . We denote the population risk as R ( w ) = −EpXY ( x , y ) [ logw ( x ) y ] and the empirical risk as R̂ ( w ) = − 1∣D∣ ∑ ( xi , yi ) ∈D logw ( xi ) yi . For a function familyW whose elements map X to the simplex ∆C , we define ŵx = infwx∈W R̂ ( wx ) , w∗x = infwx∈W R ( wx ) . We further denote the Rademacher complexity of function familyW with sample size ∣D∣ as R∣D∣ ( W ) . Algorithm 1 Classifier Orthogonalization Input : principal classifier w1 , dataset D. Train an empirical full classifier ŵx on D by empirical risk minimization . Construct an orthogonal classifier ŵx ∖w1 via classifier orthogonalization ( Eq . ( 2 ) ) . return the empirical orthogonal classifier ŵ2 = ŵx ∖w1 Theorem 1 . Assume py is uniform distribution , ∀wx ∈W takes values in ( m,1 −m ) C with m ∈ ( 0 , 12 ) , and 1/pX ∣Y ( x∣y ) ∈ ( 0 , γ ) ⊂ ( 0 , +∞ ) holds for ∀x ∈ X , y ∈ Y . Then for any δ ∈ ( 0,1 ) with probability at least 1 − δ , we have : ∣R ( ŵx ∖w1 ) −R ( w∗x ∖w1 ) ∣ ≤ ( 1 + γ ) ⎛ ⎜ ⎝ 2R∣D∣ ( W ) + 2 log 1 m ¿ ÁÁÀ2 log 1 δ ∣D∣ ⎞ ⎟ ⎠ Theorem 1 shows that the population risk of the empirical orthogonal classifier in Algorithm 1 would be close to the optimal risk if the maximum value of the reciprocal of class-conditioned distributions 1/pX ∣Y ( x∣y ) and the Rademacher term are small . Typically , the Rademacher complexity term satisfies R∣D∣ ( W ) = O ( ∣D∣− 1 2 ) ( Bartlett & Mendelson , 2001 ; Gao & Zhou , 2016 ) . We note that the empirical full classifier may fail in specific ways that are harmful for our purposes . For example , the classifier may not rely on all the key features due to simplicity bias as demonstrated by ( Shah et al. , 2020 ) . There are several ways that this effect can be mitigated , including Ross et al . ( 2020 ) ; Teney et al . ( 2021 ) .
- The paper introduces the notion of "orthogonal classifiers": classifiers that rely on orthogonal variables. It starts with the simple linear case, and adds a definition that also applies to the non-linear case. - The paper proposes two methods to identify a classifier orthogonal to a given one. - It then describes 3 use cases: style transfer, domain adaptation, and fairness.
SP:082a02221a8515ae6c08356eeae7ca4412bd2e1f
Controlling Directions Orthogonal to a Classifier
1 INTRODUCTION . Many machine learning applications require explicit control of directions that are orthogonal to a predefined one . For example , to ensure fairness , we can learn a classifier that is orthogonal to sensitive attributes such as gender or race ( Zemel et al. , 2013 ; Madras et al. , 2018 ) . Similar , if we transfer images from one style to another , content other than style should remain untouched . Therefore images before and after transfer should align in directions orthogonal to style . Common to these problems is the task of finding an orthogonal classifier . Given any principal classifier operating on the basis of principal variables , our goal is to find a classifier , termed orthogonal classifier , that predicts the label on the basis of orthogonal variables , defined formally later . The notion of orthogonality is clear in the linear case . Consider a joint distribution PXY over X ∈ Rd and binary label Y . Suppose the label distribution is Bernoulli , i.e. , PY = B ( Y ; 0.5 ) and class-conditional distributions are Gaussian , PX ∣Y =y = N ( X ; µy , σ2yI ) , where the means and variances depend on the label . If the principal classifier is linear , w1 = Pr ( Y = 1∣θ⊺1x ) , any classifier w2 , in the setW2 = { Pr ( Y = 1∣θ⊺2x ) ∣ θ⊺1θ2 = 0 } , is considered orthogonal to w1 . Thus the two classifiers w1 , w2 , with orthogonal decision boundaries ( Fig . 1 ) focus on distinct but complementary attributes for predicting the same label . Finding the orthogonal classifier is no longer straightforward in the non-linear case . To rigorously define what we mean by the orthogonal classifier , we first introduce the notion of mutually orthogonal random variables that correspond to ( conditinally ) independent latent variables mapped to observations through a diffeomorphism ( or bijection if discrete ) . Each r.v . is predictive of the label but represents complementary information . Indeed , we show that the orthogonal random variable maximizes the conditional mutual information with the label given the principal counterpart , subject to an independence constraint that ensures complementarity . Our search for the orthogonal classifier can be framed as follows : given a principal classifier w1 using some unknown principal r.v . for prediction , how do we find its orthogonal classifier w2 relying solely on orthogonal random variables ? The solution to this problem , which we call classifier orthogonalization , turns out to be surprisingly simple . In addition to the principal classifier , we assume access to a full classifier wx that predicts the same label based on all the available information , implicitly relying on both principal and orthogonal latent variables . The full classifier can be trained normally , absent of constraints1 . We can then effectively “ subtract ” the contribution of w1 from the full classifier to obtain the orthogonal classifier w2 which we denote as w2 = wx ∖w1 . The advantage of this construction is that 1The full classifier may fail to depend on all the features , e.g. , due to simplicity bias ( Shah et al. , 2020 ) . we do not need to explicitly identify the underlying orthogonal variables . It suffices to operate only on the level of classifier predictions . We provide several use cases for the orthogonal classifier , either as a predictor or as a discriminator . As a predictor , the orthogonal classifier predictions are invariant to the principal sensitive r.v. , thus ensuring fairness . As a discriminator , the orthogonal classifier enforces a partial alignment of distributions , allowing changes in the principal direction . We demonstrate the value of such discriminators in 1 ) controlled style transfer where the source and target domains differ in multiple aspects , but we only wish to align domain A ’ s style to domain B , leaving other aspects intact ; 2 ) domain adaptation with label shift where we align feature distributions between the source and target domains , allowing shifts in label proportions . Our results show that the simple method is on par with the state-of-the-art methods in each task . 2 NOTATIONS AND DEFINITION . Symbols . We use the uppercase to denote random variable ( e.g. , data X , label Y ) , the lowercase to denote the corresponding samples and the calligraphic letter to denote the sample spaces of r.v. , e.g. , data sample space X . We focus on the setting where label space Y is discrete , i.e. , Y = { 1 , ⋯ , C } , and denote the C − 1 dimensional probability simplex as ∆C . A classifier w ∶ X →∆C is a mapping from sample space to the simplex . Its y-th dimension w ( x ) y denotes the predicted probability of label y for sample x . Distributions . For random variables A , B , we use the notation pA , pA∣B , pAB to denote the marginal/conditional/joint distribution , i.e. , pA ( a ) = p ( A = a ) , pA∣B ( a∣b ) = p ( A = a∣B = b ) , pAB ( a , b ) = p ( A = a , B = b ) . Sometimes , for simplicity , we may ignore the subscript if there is no ambiguity , e.g. , p ( a∣b ) is an abbreviation for pA∣B ( a∣b ) . We begin by defining the notion of an orthogonal random variable . We consider continuous X , Z1 , Z2 and assume their supports are manifolds diffeomorphic to the Euclidean space . The probability density functions ( PDF ) are in C1 . Given a joint distribution pXY , we define the orthogonal random variable as follows : Definition 1 ( Orthogonal random variables ) . We say Z1 and Z2 are orthogonal random variables w.r.t pXY if they satisfy the following properties : ( i ) There exists a diffeomorphism f ∶ Z1 ×Z2 → X such that f ( Z1 , Z2 ) =X . ( ii ) Z1 and Z2 are statistically independent given Y , i.e. , Z1 ⊥ Z2∣Y . The orthogonality relation is symmetric by definition . Note that the orthogonal pair perfectly reconstructs the observations via the diffeomorphism f ; as random variables they are also sampled independently from class conditional distributions p ( Z1∣Y ) and p ( Z2∣Y ) . For example , we can regard foreground objects and background scenes in natural images as being mutually orthogonal random variables . Remark . The definition of orthogonality can be similarly developed for discrete variables and discretecontinuous mixtures . For discrete variables , for example , we can replace the requirement of diffeomorphism with bijection . Since the diffeomorphism f is invertible , we can use z1 ∶ X → Z1 and z2 ∶ X → Z2 to denote the two parts of the inverse mapping so that Z1 = z1 ( X ) and Z2 = z2 ( X ) . Note that , for a given joint distribution pXY , the decomposition into orthogonal random variables is not unique . There are multiple pairs of random variables that represent valid mutually orthogonal latents of the data . We can further justify our definition of orthogonality from an information theoretic perspective by showing that the choice of z2 attains the maximum of the following constrained optimization problem . Proposition 1 . Suppose the orthogonal r.v . of z1 ( X ) w.r.t pXY exists and is denoted as z2 ( X ) . Then z ( X ) = z2 ( X ) is a maximizer of I ( z ( X ) ; Y ∣z1 ( X ) ) subject to I ( z ( X ) ; z1 ( X ) ∣Y ) = 0 . We defer the proof to Appendix B.1 . Proposition 1 shows that the orthogonal random variable maximizes the additional information about the label we can obtain from X while remaining conditionally independent of the principal random variable . This ensures complementary in predicting the label . 3 CONSTRUCTING THE ORTHOGONAL CLASSIFIER . Let Z1 = z1 ( X ) and Z2 = z2 ( X ) be mutually orthogonal random variables w.r.t pXY . We call Z1 the principal variable and Z2 the orthogonal variable . In this section , we describe how we can construct the Bayes optimal classifier operating on features Z2 from the Bayes optimal classifier relying on Z1 . We formally refer to the classifiers of interests as : ( 1 ) principal classifier w1 ( x ) y = p ( Y = y∣Z1 = z1 ( x ) ) ; ( 2 ) orthogonal classifier w2 ( x ) y = p ( Y = y∣Z2 = z2 ( x ) ) ; ( 3 ) full classifier wx ( x ) y = p ( Y = y∣X = x ) . 3.1 CLASSIFIER ORTHOGONALIZATION . Our key idea relies on the bijection between the density ratio and the Bayes optimal classifier ( Sugiyama et al. , 2012 ) . Specifically , the ratio of densities pX ∣Y ( x∣i ) and pX ∣Y ( x∣j ) , assigned to an arbitrary point x , can be represented by the Bayes optimal classifier w ( x ) i = Pr ( Y = i∣x ) as pX∣Y ( x∣i ) pX∣Y ( x∣j ) = pY ( j ) w ( x ) i pY ( i ) w ( x ) j . Similar , the principal classifier w1 gives us associated density ratios of class-conditional distributions over Z1 . For any i , j ∈ Y , we have pZ1 ∣Y ( z1 ( x ) ∣i ) pZ1 ∣Y ( z1 ( x ) ∣j ) = pY ( j ) w1 ( x ) i pY ( i ) w1 ( x ) j . These can be combined to obtain density ratios of class-conditional distribution pZ2∣Y and subsequently calculate the orthogonal classifier w2 . We additionally rely on the fact that the diffeomorphism f permits us to change variables between x and z1 , z2 : pX ∣Y ( x∣i ) = pZ1∣Y ( z1∣i ) ∗ pZ2∣Y ( z2∣i ) ∗ volJf ( z1 , z2 ) , where volJf is volume of the Jacobian ( Berger et al. , 1987 ) of the diffeomorphism mapping . Taken together , pZ2∣Y ( z2∣i ) pZ2∣Y ( z2∣j ) = pZ1∣Y ( z1∣i ) ∗ pZ2∣Y ( z2∣i ) ∗ volJf ( z1 , z2 ) pZ1∣Y ( z1∣j ) ∗ pZ2∣Y ( z2∣j ) ∗ volJf ( z1 , z2 ) / pZ1∣Y ( z1∣i ) pZ1∣Y ( z1∣j ) = wx ( x ) i wx ( x ) j / w1 ( x ) i w1 ( x ) j ( 1 ) Note that since the diffeomorphism f is shared with all classes , the Jacobian is the same for all labelconditioned distributions on Z1 , Z2 . Hence the Jacobian volume terms cancel each other in the above equation . We can then finally work backwards from the density ratios of pZ2∣Y to the orthogonal classifier : Pr ( Y = i∣Z2 = z2 ( x ) ) = Pr ( Y = i ) wx ( x ) i w1 ( x ) i /∑ j ( Pr ( Y = j ) wx ( x ) j w1 ( x ) j ) ( 2 ) We call this procedure classifier orthogonalization since it adjusts the full classifier wx to be orthogonal to the principal classifier w1 . The validity of this procedure requires overlapping supports of the classconditional distributions , which ensures the classifier outputs wx ( x ) i , w1 ( x ) i to remain non-zero for all x ∈ X , i ∈ Y . Empirically , we usually have access to a dataset D = { ( xt , yt ) } nt=1 with n iid samples from the joint distribution pXY . To obtain the orthogonal classifier , we need to first train the full classifier ŵx based on the dataset D. We can then follow the classifier orthogonalization to get an empirical orthogonal classifier , denoted as w2 = ŵx ∖w1 . We use symbol ∖ to emphasize that the orthogonal classifier uses complementary information relative to z1 . Algorithm 1 summarizes the construction of the orthogonal classifier . Generalization bound . Since wx is trained on a finite dataset , we consider the generalization bound of the constructed orthogonal classifier . We denote the population risk as R ( w ) = −EpXY ( x , y ) [ logw ( x ) y ] and the empirical risk as R̂ ( w ) = − 1∣D∣ ∑ ( xi , yi ) ∈D logw ( xi ) yi . For a function familyW whose elements map X to the simplex ∆C , we define ŵx = infwx∈W R̂ ( wx ) , w∗x = infwx∈W R ( wx ) . We further denote the Rademacher complexity of function familyW with sample size ∣D∣ as R∣D∣ ( W ) . Algorithm 1 Classifier Orthogonalization Input : principal classifier w1 , dataset D. Train an empirical full classifier ŵx on D by empirical risk minimization . Construct an orthogonal classifier ŵx ∖w1 via classifier orthogonalization ( Eq . ( 2 ) ) . return the empirical orthogonal classifier ŵ2 = ŵx ∖w1 Theorem 1 . Assume py is uniform distribution , ∀wx ∈W takes values in ( m,1 −m ) C with m ∈ ( 0 , 12 ) , and 1/pX ∣Y ( x∣y ) ∈ ( 0 , γ ) ⊂ ( 0 , +∞ ) holds for ∀x ∈ X , y ∈ Y . Then for any δ ∈ ( 0,1 ) with probability at least 1 − δ , we have : ∣R ( ŵx ∖w1 ) −R ( w∗x ∖w1 ) ∣ ≤ ( 1 + γ ) ⎛ ⎜ ⎝ 2R∣D∣ ( W ) + 2 log 1 m ¿ ÁÁÀ2 log 1 δ ∣D∣ ⎞ ⎟ ⎠ Theorem 1 shows that the population risk of the empirical orthogonal classifier in Algorithm 1 would be close to the optimal risk if the maximum value of the reciprocal of class-conditioned distributions 1/pX ∣Y ( x∣y ) and the Rademacher term are small . Typically , the Rademacher complexity term satisfies R∣D∣ ( W ) = O ( ∣D∣− 1 2 ) ( Bartlett & Mendelson , 2001 ; Gao & Zhou , 2016 ) . We note that the empirical full classifier may fail in specific ways that are harmful for our purposes . For example , the classifier may not rely on all the key features due to simplicity bias as demonstrated by ( Shah et al. , 2020 ) . There are several ways that this effect can be mitigated , including Ross et al . ( 2020 ) ; Teney et al . ( 2021 ) .
The paper presents classifier orthogonalization technique that works for non-linear classifiers. The idea is to find a method that orthogonalizes the full classifier w.r.t. the principal classifier so that the resulting classifier is statistically orthogonal to principal classifier. The algorithm turns out to be very simple, only requiring access to the full classifier $P(Y|x)$ and the principal classifier $P(Y|z(x))$, where $z$ is a control variable you want to orthogonalize against. The paper also discusses an alternative method of classifier orthogonalization using importance sampling. The effectiveness of the proposed classifier orthogonalization technique has been demonstrated through 3 applications: controlled style transfer, domain adaptation, and classifier fairness. For controlled style transfer, authors modified the CycleGAN's generator update step by orthogonalizing discriminator w.r.t. the controlled style variable. For domain adaptation, they modified VADA, an adversarial domain adaptation approach, by orthogonalizing discriminator based on the label-based principal classifier, so that discriminator wouldn't discriminate the domain based on the frequency count of labels from each domain. For fairness, full classifier is orthogonalized by the sensitive attribute classifier.
SP:082a02221a8515ae6c08356eeae7ca4412bd2e1f
Efficient Certification for Probabilistic Robustness
1 Introduction . Neural networks have found great success in a wide variety of applications . For many of these applications , understanding when and how a neural network can fail is crucial . Szegedy et al . ( 2014 ) found that almost visually imperceptible perturbations of input images could drastically change the output of a neural network . This realization set off a large area of research , both in finding ways of attacking neural networks and developing defense and certification methods against said attacks . The most common setting which is considered is the worst-case robustness given an lp norm . There have been a number of adversarial robustness certification methods which operate by finding provable lp balls for which the output of the neural network is guaranteed to be constant . In other words , they find lower bounds on the minimum lp radius for which an adversarial attack exists . This is done by relaxing the network for a bounded domain . Convex relaxations are typically used ( Salman et al. , 2019 ) , although some works also consider quadratic program formulations ( Raghunathan et al. , 2018 ) . Note that these are input-specific , so they do not give guarantees about the entire input domain . As opposed to the worst-case adversarial robustness , there is also great interest in the threat model where the primary concern is natural noise and corruption rather than a malicious adversary and thus the perturbations follow some probability distribution . Typical neural networks have been found to be vulnerable to common corruptions ( Dodge & Karam , 2016 ; Geirhos et al. , 2018 ) . We distinguish between these two notions of robustness as adversarial robustness and probabilistic robustness . We note that the terms such as corruption robustness , probability of violation , and adversarial density have also been used to refer to the general concept of probabilistic robustness . For the threat model of natural noise and corruption , there has not been as much work developed as for worst-case adversarial robustness . One of the very first probabilistic verification algorithms without imposing assumptions on the decision boundary is known as the PROVEN algorithm ( Weng et al. , 2019 ) . In PROVEN , the authors derive probabilistic verification bounds based on existing worst-case robustness verification such as Fast-Lin and CROWN ( Weng et al. , 2018 ; Zhang et al. , 2018 ) . Contributions . In this work , we generalize the PROVEN algorithm proposed by Weng et al . ( 2019 ) to infinite support and greatly improve the tightness of the robustness certificate without additional computation cost . We name our algorithm I-PROVEN , as the proposed algorithm is a significantly improved version of PROVEN algorithm . The I-PROVEN algorithm can achieve significant improvements ( 2×-8× tighter ) on the tightness of probabilistic robustness certificate for both MNIST and CIFAR-10 models without additional computation cost , and it also enables the certification of probability distributions with infinite support . Based on our proposed algorithm , we conduct a case study on augmenting an existing training pipeline with probabilistic robustness verification bounds , and we find mixed results for the training . We examine potential causes and implications . 2 Background and related works . Notation . In order to describe related work in depth , we will lay out some notation . We define a K-layer feed-forward ReLU neural network with n0 inputs and nK outputs f : Rn0 → RnK as f ( x ) = f ( K ) ( x ) f ( i+1 ) ( x ) =W ( i+1 ) σ ( f ( i ) ( x ) ) + b ( i+1 ) f ( 1 ) ( x ) =W ( 1 ) x+ b ( 1 ) In other words , f ( i ) ( x ) denotes the vector of pre-activation values in the ith layer . Generally , we work in the setting of image classifiers where a class c is classified over a class i if fc ( x ) − fi ( x ) > 0 . To simplify notation , we assume that the neural networks f which we are working with have already had this margin function applied to it for some given c , i . In other words , we assume nK = 1 for convenience and we are interested in when f ( x ) > 0 . 2.1 Adversarial robustness verification . Adversarial robustness verification asks , given a neural network f and a region R ( ) in the input space , does there exist an x ∈ R ( ) such that f ( x ) ≤ 0 ? To solve this problem , we can formulate it as an equivalent optimization problem : minx∈R ( ) f ( x ) . If no such x such that f ( x ) ≤ 0 exists , or equivalently , if the minimum f ( x ) is positive , then f is robust for region R ( ) . If we can prove that f is robust on regions R ( ) for all ≤ , then the robustness certificate is . The robustness certificate is a lower bound for the true minimum distortion ∗ . The regions R ( ) of general interest are Lp balls Bp ( x0 , ) for a given image or input x0 . This arises from the interpretation that an adversary is perturbing x0 by at most under a given Lp norm . Note that certification only informs robustness about a single image . As far as we know , it is infeasible to certify an entire dataset other than processing it image by image . Convex relaxation for provable verification . These methods find a convex relaxation of a neural network in order to find provable certifications for its adversarial robustness . We will discuss these methods in detail as our method builds on them in certain ways . There are a number of works following these methods ( Weng et al. , 2018 ; Singh et al. , 2018 ; Zhang et al. , 2018 ; Singh et al. , 2019b ) , and a general framework for them is described in ( Salman et al. , 2019 ) . We will use the setup used in CROWN ( Zhang et al. , 2018 ) . In these methods , inequalities on pre-activation neurons are recursively computed l ( j ) ≤ A ( j ) L x+ b ( j ) L ≤ f ( j ) ( x ) ≤ A ( j ) U x+ b ( j ) U ≤ u ( j ) for each layer j . Note that these are element-wise bounds , l ( j ) and u ( j ) are scalar vectors , and A ( j ) L , b ( j ) L , A ( j ) U , b ( j ) U are linear transformations of inputs x . These linear bounds are obtained by relaxing the non-linear activation functions to linear lower and upper bounds given that the inputs to the activation functions are within some interval found from the inequalities applied to earlier layers , l ( i ) , u ( i ) , i < j . These inequalities are propagated backwards through the network until the original input is reached . Under the typical lp ball threat model , Hölder ’ s inequality can give scalar bounds on these layers and the process can continue to the final outputs . ( Singh et al. , 2019a ; Tjandraatmadja et al. , 2020 ) have made progress on improving these bounds beyond the convex relaxation gap pointed out by Salman et al . ( 2019 ) by considering the activation functions on multiple neurons jointly . 2.2 Probabilistic robustness . For probabilistic robustness , we are considering a known probability distribution D : Rn → [ 0 , 1 ] which the inputs x are sampled from . We will focus on additive iid uniform noise which we denote , in an abuse of notation , as B∞ ( x , ) . In other words , B∞ ( x , ) is the distribution generated by sampling points evenly from the hyperrectangle [ x1 − , x1 + ] × [ x2 − , x2 + ] × · · · × [ xn − , xn + ] . Then the problem of probabilistic robustness verification is to verify that Prx∼D [ f ( x ) > 0 ] ≥ 1−Q ( 1 ) for some given failure probability Q . We can define the robustness certificate similarly to how it was done for adversarial robustness . Weng et al . ( 2019 ) and Anderson & Sojoudi ( 2020 ) particularly consider the maximum parameterizing D for which the above holds and we also provide such results . This is found by binary searching over , as empirically we find that the robustness is monotonic in for the distributions we consider , but we note that there are no theoretical guarantees for this . Sampling methods . Sampling gives well-established statistical guarantees which can be applied to the problem of probabilistic robustness . By using the neural network essentially as a black-box , Chernoff bounds can estimate the probability of the neural network giving the incorrect classification given a distribution . This has the advantage of making no assumptions on the model or the distribution , but requires a large number of samples to achieve a high degree of accuracy and there is an inherent uncertainty present in the application of such an algorithm . Baluta et al . ( 2021 ) notes for example , that proving that the probability is between [ 0.1− 0.5× 10−4 , 0.1 + 0.5× 10−4 ] with a confidence of 0.9 would require 5.5× 106 samples . To overcome this , they propose a framework which reduces the number of samples necessary , although this is dependent on the true probability . Anderson & Sojoudi ( 2020 ) also provide a method that can find upper bounds on the probability that a model is incorrect with a small number of samples . Webb et al . ( 2018 ) uses a clever sampling method that leverages the layered structure of common architectures . They require upwards of 107 samples but are able to obtain precise estimations . Though they are unable to provide theoretical guarantees , they show that empirically , their estimations agree with naive Monte Carlo estimates with as many as 1010 samples . 2.3 Training adversarially-robust models . Training methods for improving adversarial robustness have generally taken two paths . The first augments the data with adversarial attacks in order to strengthen a model ’ s resistance to such attacks ( Madry et al. , 2017 ) . The second approach adds loss regularization terms that help the model learn robust features of the data . Xiao et al . ( 2018 ) identifies weight sparsity and ReLU stability as important factors in a model ’ s adversarial robustness and builds a training framework which incorporates these . Other works use certification methods as regularization terms in order to improve the certifiable robustness of a model . Interval bound propagation ( IBP ) has found great success in this despite being a relatively loose certification method ( Gowal et al. , 2019 ) . In particular , the efficiency of IBP has made it amenable to training . A number of other works have made progress in closing this efficiency gap ( Zhang et al. , 2019 ; Xu et al. , 2020 ; Shi et al. , 2021 ; Boopathy et al. , 2021 ) .
In this paper, the authors consider a notion of statistical/probabilistic robustness which does not require a model to be robust to all inputs in a specified set, only a certain, high-probability subset of these inputs. The authors rely on a bound propagation methodology to compute the the probability that a given input property is violated. In particular, the authors expand a known methodology (PROVEN) for computing probabilistic robustness and show that in many cases their methodology is better than that of PROVEN.
SP:09784594743442e7d357697bd4fd0c370df170c3
Efficient Certification for Probabilistic Robustness
1 Introduction . Neural networks have found great success in a wide variety of applications . For many of these applications , understanding when and how a neural network can fail is crucial . Szegedy et al . ( 2014 ) found that almost visually imperceptible perturbations of input images could drastically change the output of a neural network . This realization set off a large area of research , both in finding ways of attacking neural networks and developing defense and certification methods against said attacks . The most common setting which is considered is the worst-case robustness given an lp norm . There have been a number of adversarial robustness certification methods which operate by finding provable lp balls for which the output of the neural network is guaranteed to be constant . In other words , they find lower bounds on the minimum lp radius for which an adversarial attack exists . This is done by relaxing the network for a bounded domain . Convex relaxations are typically used ( Salman et al. , 2019 ) , although some works also consider quadratic program formulations ( Raghunathan et al. , 2018 ) . Note that these are input-specific , so they do not give guarantees about the entire input domain . As opposed to the worst-case adversarial robustness , there is also great interest in the threat model where the primary concern is natural noise and corruption rather than a malicious adversary and thus the perturbations follow some probability distribution . Typical neural networks have been found to be vulnerable to common corruptions ( Dodge & Karam , 2016 ; Geirhos et al. , 2018 ) . We distinguish between these two notions of robustness as adversarial robustness and probabilistic robustness . We note that the terms such as corruption robustness , probability of violation , and adversarial density have also been used to refer to the general concept of probabilistic robustness . For the threat model of natural noise and corruption , there has not been as much work developed as for worst-case adversarial robustness . One of the very first probabilistic verification algorithms without imposing assumptions on the decision boundary is known as the PROVEN algorithm ( Weng et al. , 2019 ) . In PROVEN , the authors derive probabilistic verification bounds based on existing worst-case robustness verification such as Fast-Lin and CROWN ( Weng et al. , 2018 ; Zhang et al. , 2018 ) . Contributions . In this work , we generalize the PROVEN algorithm proposed by Weng et al . ( 2019 ) to infinite support and greatly improve the tightness of the robustness certificate without additional computation cost . We name our algorithm I-PROVEN , as the proposed algorithm is a significantly improved version of PROVEN algorithm . The I-PROVEN algorithm can achieve significant improvements ( 2×-8× tighter ) on the tightness of probabilistic robustness certificate for both MNIST and CIFAR-10 models without additional computation cost , and it also enables the certification of probability distributions with infinite support . Based on our proposed algorithm , we conduct a case study on augmenting an existing training pipeline with probabilistic robustness verification bounds , and we find mixed results for the training . We examine potential causes and implications . 2 Background and related works . Notation . In order to describe related work in depth , we will lay out some notation . We define a K-layer feed-forward ReLU neural network with n0 inputs and nK outputs f : Rn0 → RnK as f ( x ) = f ( K ) ( x ) f ( i+1 ) ( x ) =W ( i+1 ) σ ( f ( i ) ( x ) ) + b ( i+1 ) f ( 1 ) ( x ) =W ( 1 ) x+ b ( 1 ) In other words , f ( i ) ( x ) denotes the vector of pre-activation values in the ith layer . Generally , we work in the setting of image classifiers where a class c is classified over a class i if fc ( x ) − fi ( x ) > 0 . To simplify notation , we assume that the neural networks f which we are working with have already had this margin function applied to it for some given c , i . In other words , we assume nK = 1 for convenience and we are interested in when f ( x ) > 0 . 2.1 Adversarial robustness verification . Adversarial robustness verification asks , given a neural network f and a region R ( ) in the input space , does there exist an x ∈ R ( ) such that f ( x ) ≤ 0 ? To solve this problem , we can formulate it as an equivalent optimization problem : minx∈R ( ) f ( x ) . If no such x such that f ( x ) ≤ 0 exists , or equivalently , if the minimum f ( x ) is positive , then f is robust for region R ( ) . If we can prove that f is robust on regions R ( ) for all ≤ , then the robustness certificate is . The robustness certificate is a lower bound for the true minimum distortion ∗ . The regions R ( ) of general interest are Lp balls Bp ( x0 , ) for a given image or input x0 . This arises from the interpretation that an adversary is perturbing x0 by at most under a given Lp norm . Note that certification only informs robustness about a single image . As far as we know , it is infeasible to certify an entire dataset other than processing it image by image . Convex relaxation for provable verification . These methods find a convex relaxation of a neural network in order to find provable certifications for its adversarial robustness . We will discuss these methods in detail as our method builds on them in certain ways . There are a number of works following these methods ( Weng et al. , 2018 ; Singh et al. , 2018 ; Zhang et al. , 2018 ; Singh et al. , 2019b ) , and a general framework for them is described in ( Salman et al. , 2019 ) . We will use the setup used in CROWN ( Zhang et al. , 2018 ) . In these methods , inequalities on pre-activation neurons are recursively computed l ( j ) ≤ A ( j ) L x+ b ( j ) L ≤ f ( j ) ( x ) ≤ A ( j ) U x+ b ( j ) U ≤ u ( j ) for each layer j . Note that these are element-wise bounds , l ( j ) and u ( j ) are scalar vectors , and A ( j ) L , b ( j ) L , A ( j ) U , b ( j ) U are linear transformations of inputs x . These linear bounds are obtained by relaxing the non-linear activation functions to linear lower and upper bounds given that the inputs to the activation functions are within some interval found from the inequalities applied to earlier layers , l ( i ) , u ( i ) , i < j . These inequalities are propagated backwards through the network until the original input is reached . Under the typical lp ball threat model , Hölder ’ s inequality can give scalar bounds on these layers and the process can continue to the final outputs . ( Singh et al. , 2019a ; Tjandraatmadja et al. , 2020 ) have made progress on improving these bounds beyond the convex relaxation gap pointed out by Salman et al . ( 2019 ) by considering the activation functions on multiple neurons jointly . 2.2 Probabilistic robustness . For probabilistic robustness , we are considering a known probability distribution D : Rn → [ 0 , 1 ] which the inputs x are sampled from . We will focus on additive iid uniform noise which we denote , in an abuse of notation , as B∞ ( x , ) . In other words , B∞ ( x , ) is the distribution generated by sampling points evenly from the hyperrectangle [ x1 − , x1 + ] × [ x2 − , x2 + ] × · · · × [ xn − , xn + ] . Then the problem of probabilistic robustness verification is to verify that Prx∼D [ f ( x ) > 0 ] ≥ 1−Q ( 1 ) for some given failure probability Q . We can define the robustness certificate similarly to how it was done for adversarial robustness . Weng et al . ( 2019 ) and Anderson & Sojoudi ( 2020 ) particularly consider the maximum parameterizing D for which the above holds and we also provide such results . This is found by binary searching over , as empirically we find that the robustness is monotonic in for the distributions we consider , but we note that there are no theoretical guarantees for this . Sampling methods . Sampling gives well-established statistical guarantees which can be applied to the problem of probabilistic robustness . By using the neural network essentially as a black-box , Chernoff bounds can estimate the probability of the neural network giving the incorrect classification given a distribution . This has the advantage of making no assumptions on the model or the distribution , but requires a large number of samples to achieve a high degree of accuracy and there is an inherent uncertainty present in the application of such an algorithm . Baluta et al . ( 2021 ) notes for example , that proving that the probability is between [ 0.1− 0.5× 10−4 , 0.1 + 0.5× 10−4 ] with a confidence of 0.9 would require 5.5× 106 samples . To overcome this , they propose a framework which reduces the number of samples necessary , although this is dependent on the true probability . Anderson & Sojoudi ( 2020 ) also provide a method that can find upper bounds on the probability that a model is incorrect with a small number of samples . Webb et al . ( 2018 ) uses a clever sampling method that leverages the layered structure of common architectures . They require upwards of 107 samples but are able to obtain precise estimations . Though they are unable to provide theoretical guarantees , they show that empirically , their estimations agree with naive Monte Carlo estimates with as many as 1010 samples . 2.3 Training adversarially-robust models . Training methods for improving adversarial robustness have generally taken two paths . The first augments the data with adversarial attacks in order to strengthen a model ’ s resistance to such attacks ( Madry et al. , 2017 ) . The second approach adds loss regularization terms that help the model learn robust features of the data . Xiao et al . ( 2018 ) identifies weight sparsity and ReLU stability as important factors in a model ’ s adversarial robustness and builds a training framework which incorporates these . Other works use certification methods as regularization terms in order to improve the certifiable robustness of a model . Interval bound propagation ( IBP ) has found great success in this despite being a relatively loose certification method ( Gowal et al. , 2019 ) . In particular , the efficiency of IBP has made it amenable to training . A number of other works have made progress in closing this efficiency gap ( Zhang et al. , 2019 ; Xu et al. , 2020 ; Shi et al. , 2021 ; Boopathy et al. , 2021 ) .
This work considers problem of local robustness where each input is perturbed according to some probability distribution (e.g. uniform distribution over the L-infinity ball). Proposed approach is based on extending an approach proposed by prior work which uses linear bounds to compute bounds on the output of the network. The key contribution is computing the probabilistic bounds for inner layers, and not only the final one as was done in prior work. Authors show that their approach improves over prior work on MNIST and CIFAR-10 datasets.
SP:09784594743442e7d357697bd4fd0c370df170c3
ConVAEr: Convolutional Variational AutoEncodeRs for incremental similarity learning
1 INTRODUCTION . In machine learning , incremental learning is the process of updating a model as new data becomes available or extended to support further tasks . An incrementally trained model should ideally retain previously attained knowledge while incorporating any new knowledge made available as it trains Syed et al . ( 1999 ) ; Polikar et al . ( 2001 ) . Many machine learning algorithms can not retain prior knowledge or do so in an unsatisfactory manner . Models that do not incrementally learn new tasks whilst retaining prior knowledge suffer from catastrophic forgetting . Catastrophic forgetting typically occurs during training on new data that contains no or highly imbalanced examples drawn from prior learned distributions McCloskey & Cohen ( 1989 ) ; Ratcliff ( 1990 ) . Catastrophic forgetting in deep neural networks and virtually all of the tasks supported by them remains an open research problem Goodfellow et al . ( 2013 ) ; Fernando et al . ( 2017 ) ; Robins ( 1995 ) ; Draelos et al . ( 2017 ) . Historically , analyses have been focused almost entirely on incremental supervised classification in multi-layer perceptrons ( MLP ) neural networks such as typically encountered in computer vision tasks . However , there persists a lack of evidence detailing the degree to which similarity learning tasks and the underpinning pair mining and loss functions are affected by catastrophic forgetting . Further , most techniques aimed at overcoming catastrophic forgetting in deep neural networks have been engineered with classification tasks in mind Rannen et al . ( 2017 ) ; Rebuffi et al . ( 2017 ) ; Choi et al . ( 2019 ) . Previous work by Huo & van Zyl ( 2021 ) compared four state-of-the-art algorithms for reducing catastrophic forgetting during incremental learning . These algorithms included Fully Connected VAEs ( FullVAE ) , Elastic Weight Consolidation Kirkpatrick et al . ( 2017 ) , Encoder-Based lifelong learning Rannen et al . ( 2017 ) , and incremental Classifier and Representation Learning iCaRL Rebuffi et al . ( 2017 ) . Their work analyzed several loss functions on MNIST , EMNIST , FashionMNIST , and CIFAR-10 . All the considered techniques were effective but to an unsatisfactory extent with FullVAE and iCaRL shown to be the most robust across numerous loss functions . However , given that the datasets used are somewhat trivial , these results only partially indicate what is to be expected on real-world data . This paper builds on this prior body of research and presents conclusions on the influence of catastrophic forgetting in incremental metric learning . We approximated the catastrophic forgetting test procedure of Kemker et al . ( 2018 ) which is described for classification tasks . Our work examines three-loss functions , contrastive , centre and triplet loss , using CUB200 Welinder et al . ( 2010 ) and CAR196 Krause et al . ( 2013 ) in metric learning . We contrast the current state of the art for catastrophic forgetting during incremental metric learning , FullVAE and iCaRL , to our solution ConVAEr . ConVAEr uses convolutional Variational Autoencoders ( VAE ) to generate representations fed into the convolutional layers to supplement previously seen knowledge without regenerating entire images or the need to keep a collection of previous data . We present results that allow the reader to explore which technique retains the most base knowledge , new knowledge , and overall knowledge during incremental metric learning . 1 . We show that our method yields better average knowledge retention across all experiments . 2 . We support the importance of keeping prior knowledge or data during incremental similarity learning . 3 . We demonstrate that injected VAE generated representations work as well as images exemplars . 4 . We show that intercepting exemplars from the convolutional layers retained the highest ratio of base knowledge . 5 . We note that using embeddings from the linear layers leads to better performance on new knowledge than convolutional embeddings . 2 RELATED WORK . 2.1 CATASTROPHIC FORGETTING . Goodfellow et al . ( 2013 ) investigated catastrophic forgetting in gradient-based neural networks used for classification . The results showed that various combinations of activation function and learning were affected differently by catastrophic forgetting . The work by Rannen et al . ( 2017 ) demonstrated the problem of catastrophic forgetting in deep convolutional neural networks ( DNN ) AlexNet . They highlighted the classification performance dropped in a previously learned task when a DNN is fined-tuned for newer classification tasks . The authors proposed using lightweight autoencoders to “ store ” the embedding learned by the base network . A new autoencoder is trained and kept after the network learns each new task . The method significantly reduced catastrophic forgetting during incremental classification . Choi et al . ( 2019 ) proposed the use of an autoencoder-based incremental metric learning method for classification without the use of a softmax classification layer . The work is premised on the notion of a metric-based classification method , nearest-class-mean ( NCM ) Mensink et al . ( 2013 ) . A pre-trained fixed network was used as a feature extractor and the autoencoder is trained on the feature embeddings . To overcome catastrophic forgetting while fine-tuning the autoencoder to new classes , the authors use regularization techniques : Synaptic Intelligence ( SI ) Zenke et al . ( 2017 ) , and Memory Aware Synapses ( MAS ) Aljundi et al . ( 2018 ) . The methods demonstrated good memory retention without the need to train on older data . Our work used VAE for knowledge preservation to supplement the update of the network during incremental similarity learning whereas the authors used a fixed network to supply the autoencoder for incremental classification and not similarity learning . 2.2 INCREMENTAL CLASSIFIER AND REPRESENTATION LEARNING ( ICARL ) . Incremental Classifier and Representation Learning ( iCaRL ) is a method proposed by Rebuffi et al . ( 2017 ) for reducing catastrophic forgetting . It is reported to learn classes incrementally over a longer period than other methods . iCaRL relies primarily on storing exemplars of previously seen classes . Each class ’ s exemplar set is constructed , using the herding algorithm , from the k closest images to the class ’ s mean representation . The stored exemplars are used to supplement the incremental learning phase of new classes using knowledge distillation . Since iCaRL does not directly translate to similarity learning tasks we implemented the modified version as described in the paper by Huo & van Zyl ( 2021 ) . 2.3 ENCODER-BASED LIFELONG LEARNING . Rannen et al . ( 2017 ) proposed Encoder-Based Lifelong Learning ( EBLL ) for incremental learning in classification tasks . The method modifies how the convolutional layers of a network are updated . After each incremental learning task , a single autoencoder is trained to reconstruct the “ images ” at the output of the convolutional layers . The reconstructed images are passed through the network ’ s remaining fully connected layers to calculate their resulting classification loss . The reconstruction loss , together with the classification loss , is used to update the autoencoder . The previous task ’ s classification layer ( output layer ) is detached for each new incremental learning task , and a new classification layer is attached . A frozen copy of the previous optimal network is made before training the next incremental task . The new images are passed through both the new and frozen network during training for the new task to calculate the distillation loss and added to the new classification loss and the encode loss to update the new network Rannen et al . ( 2017 ) . However , only the new network is updated . For updating the network ’ s weights , the images ’ convolutional layers outputs of the new and frozen network are passed into the autoencoder up to the bottleneck layer , where the mean square error is calculated and added to the classification loss and propagated through the autoencoders ’ network ’ s weights . This process constrains the weight update of the convolutional network layers to compromise between new and old tasks . 2.4 FULLY CONNECTED VAE . Huo & van Zyl ( 2021 ) proposed using a VAE to represent images in a representation that can be passed through intermediate layers in the network . The authors focused on preserving knowledge from the fully connected layers ( flattened output from the last CNN layer ) . Their method was shown to outperform iCaRL and other methods using similar test metrics to Kemker et al . ( 2018 ) during incremental similarity learning . The concern with their work was that they experimented using a simple network and a variety of simple datasets that are not representative of real-world performance . 2.5 OUR APPROACH ( CONVAER ) . Rannen et al . ( 2017 ) constrain the weights of the feature extraction layers ( convolutions ) that were optimal for previous tasks with an autoencoder . The solution is robust when reusing the feature extraction layers ( convolutions ) on new tasks . Each task is tested independently from the others with its classification layer—the approach yields encouraging results by finding a middle-ground across the base and new knowledge . Huo & van Zyl ( 2021 ) , however , have previously demonstrated that this approach is not practical for incremental metric learning . The iCaRL method by Rebuffi et al . ( 2017 ) depends on the storage of a large number of exemplars . As reported , the performance of iCaRL decreases with time as the number of exemplars per class is reduced to accommodate new classes . Eventually , the stored exemplars are not sufficient to rep- resent all classes . Further , retaining previous exemplars is hardly akin to overcoming catastrophic forgetting . Instead , this represents retaining previous data rather than previously learned knowledge . However , iCARL does present as a state-of-the-art method and , as such , provides a reasonable baseline for comparison . Huo & van Zyl ( 2021 ) combine ideas from Rannen et al . ( 2017 ) and Rebuffi et al . ( 2017 ) . They train a new variational autoencoder ( VAE ) for each class . The VAEs learn representations at the end of the convolutional layers . The use of VAEs allows them to generate examples from previously seen classes . The method requires that the convolutional layers be frozen after initial training or pretrained frozen convolutional layers from a base model are used . The VAEs generate representations from previously seen classes combined with the new classes during incremental metric training to perform incremental metric learning . The work of Huo & van Zyl ( 2021 ) more closely aligned with the intent of overcoming catastrophic forgetting . That is , using previously learned representations and knowledge for future metric learning tasks . We extend on the work by Huo & van Zyl ( 2021 ) by using the authors method and moving the VAE to intercept input to the convolution layer instead of at the input to the fully connected layers show in figure 2 . The autoencoder ’ s reconstruction loss function is required to vary depending on the network ’ s interception layer ’ s activation function . For example , in our case , the convolutional interception layers use ReLU activation , and consequently , we used the Binary Cross-Entropy objective function to determine the reconstruction errors summed with the Kullback-Leibler divergence . The loss function to update the VAEs is given as : LV AE = − 1 N N∑ i=1 yi · log ( p ( yi ) ) + ( 1 − yi ) · log ( 1 − p ( yi ) ) + 1 2 ( exp ( σ2 ) + µ2 − 1 − σ2 ) , ( 1 ) where σ2 is the variance of the entire dataset and µ is the mean . The first term is the Binary CrossEntropy reconstruction loss , and the second term is the Kullback–Leibler divergence . We also make use of the angle-wise distillation loss seen the paper by Huo & van Zyl ( 2021 ) on the examples generated from the VAEs . This usage with the network update during incremental learning , is similar to the approach taken by iCaRL Rebuffi et al . ( 2017 ) . The incremental learning step makes use of the following loss function defined as : Lincremental = lmetric learning + λdistil ∗ LA ( 2 ) , where lmetric learning are the three possible metric learning functions , we state below . LA is the angle-wise distillation for metric learning . λdistil is the importance that we place on the angle-wise distillation loss . The student output is the convolution image output we get from the network incrementally training at each new train step . The teacher output is the convolution output image we get from the frozen network before performing the new incremental train step . For center loss , we used a different distillation loss as defined in Hinton et al . ( 2015 ) defined as : LD ( to , so ) = − l∑ i=1 tiolog ( s i o ) ( 3 ) where l is the number of labels , tio and soi are the modified versions of the teacher model outputs and the current student model outputs . So the modified loss function during the incremental step for center loss is defined as : Lincremental = lmetric learning + λdistil ∗ LD , ( 4 ) where LD is defined above , and the rest remains the same .
The authors propose some changes to an existing approach called FullVAE for incremental metric learning for the problem of catastrophic forgetting. Both ConVAER and FullVAE use VAEs for generating feature representation prototypes that could be passed through the intermediate layers of a network. The proposed changes are the position of feeding the generated prototypes from the VAEs to the network and a modified VGG network instead of a simple ConvNet. They evaluate their method on 2 real-world datasets and show improvement compared to the baselines.
SP:7a0e649fb9f937acd9cbc350d34313a131d2afc0
ConVAEr: Convolutional Variational AutoEncodeRs for incremental similarity learning
1 INTRODUCTION . In machine learning , incremental learning is the process of updating a model as new data becomes available or extended to support further tasks . An incrementally trained model should ideally retain previously attained knowledge while incorporating any new knowledge made available as it trains Syed et al . ( 1999 ) ; Polikar et al . ( 2001 ) . Many machine learning algorithms can not retain prior knowledge or do so in an unsatisfactory manner . Models that do not incrementally learn new tasks whilst retaining prior knowledge suffer from catastrophic forgetting . Catastrophic forgetting typically occurs during training on new data that contains no or highly imbalanced examples drawn from prior learned distributions McCloskey & Cohen ( 1989 ) ; Ratcliff ( 1990 ) . Catastrophic forgetting in deep neural networks and virtually all of the tasks supported by them remains an open research problem Goodfellow et al . ( 2013 ) ; Fernando et al . ( 2017 ) ; Robins ( 1995 ) ; Draelos et al . ( 2017 ) . Historically , analyses have been focused almost entirely on incremental supervised classification in multi-layer perceptrons ( MLP ) neural networks such as typically encountered in computer vision tasks . However , there persists a lack of evidence detailing the degree to which similarity learning tasks and the underpinning pair mining and loss functions are affected by catastrophic forgetting . Further , most techniques aimed at overcoming catastrophic forgetting in deep neural networks have been engineered with classification tasks in mind Rannen et al . ( 2017 ) ; Rebuffi et al . ( 2017 ) ; Choi et al . ( 2019 ) . Previous work by Huo & van Zyl ( 2021 ) compared four state-of-the-art algorithms for reducing catastrophic forgetting during incremental learning . These algorithms included Fully Connected VAEs ( FullVAE ) , Elastic Weight Consolidation Kirkpatrick et al . ( 2017 ) , Encoder-Based lifelong learning Rannen et al . ( 2017 ) , and incremental Classifier and Representation Learning iCaRL Rebuffi et al . ( 2017 ) . Their work analyzed several loss functions on MNIST , EMNIST , FashionMNIST , and CIFAR-10 . All the considered techniques were effective but to an unsatisfactory extent with FullVAE and iCaRL shown to be the most robust across numerous loss functions . However , given that the datasets used are somewhat trivial , these results only partially indicate what is to be expected on real-world data . This paper builds on this prior body of research and presents conclusions on the influence of catastrophic forgetting in incremental metric learning . We approximated the catastrophic forgetting test procedure of Kemker et al . ( 2018 ) which is described for classification tasks . Our work examines three-loss functions , contrastive , centre and triplet loss , using CUB200 Welinder et al . ( 2010 ) and CAR196 Krause et al . ( 2013 ) in metric learning . We contrast the current state of the art for catastrophic forgetting during incremental metric learning , FullVAE and iCaRL , to our solution ConVAEr . ConVAEr uses convolutional Variational Autoencoders ( VAE ) to generate representations fed into the convolutional layers to supplement previously seen knowledge without regenerating entire images or the need to keep a collection of previous data . We present results that allow the reader to explore which technique retains the most base knowledge , new knowledge , and overall knowledge during incremental metric learning . 1 . We show that our method yields better average knowledge retention across all experiments . 2 . We support the importance of keeping prior knowledge or data during incremental similarity learning . 3 . We demonstrate that injected VAE generated representations work as well as images exemplars . 4 . We show that intercepting exemplars from the convolutional layers retained the highest ratio of base knowledge . 5 . We note that using embeddings from the linear layers leads to better performance on new knowledge than convolutional embeddings . 2 RELATED WORK . 2.1 CATASTROPHIC FORGETTING . Goodfellow et al . ( 2013 ) investigated catastrophic forgetting in gradient-based neural networks used for classification . The results showed that various combinations of activation function and learning were affected differently by catastrophic forgetting . The work by Rannen et al . ( 2017 ) demonstrated the problem of catastrophic forgetting in deep convolutional neural networks ( DNN ) AlexNet . They highlighted the classification performance dropped in a previously learned task when a DNN is fined-tuned for newer classification tasks . The authors proposed using lightweight autoencoders to “ store ” the embedding learned by the base network . A new autoencoder is trained and kept after the network learns each new task . The method significantly reduced catastrophic forgetting during incremental classification . Choi et al . ( 2019 ) proposed the use of an autoencoder-based incremental metric learning method for classification without the use of a softmax classification layer . The work is premised on the notion of a metric-based classification method , nearest-class-mean ( NCM ) Mensink et al . ( 2013 ) . A pre-trained fixed network was used as a feature extractor and the autoencoder is trained on the feature embeddings . To overcome catastrophic forgetting while fine-tuning the autoencoder to new classes , the authors use regularization techniques : Synaptic Intelligence ( SI ) Zenke et al . ( 2017 ) , and Memory Aware Synapses ( MAS ) Aljundi et al . ( 2018 ) . The methods demonstrated good memory retention without the need to train on older data . Our work used VAE for knowledge preservation to supplement the update of the network during incremental similarity learning whereas the authors used a fixed network to supply the autoencoder for incremental classification and not similarity learning . 2.2 INCREMENTAL CLASSIFIER AND REPRESENTATION LEARNING ( ICARL ) . Incremental Classifier and Representation Learning ( iCaRL ) is a method proposed by Rebuffi et al . ( 2017 ) for reducing catastrophic forgetting . It is reported to learn classes incrementally over a longer period than other methods . iCaRL relies primarily on storing exemplars of previously seen classes . Each class ’ s exemplar set is constructed , using the herding algorithm , from the k closest images to the class ’ s mean representation . The stored exemplars are used to supplement the incremental learning phase of new classes using knowledge distillation . Since iCaRL does not directly translate to similarity learning tasks we implemented the modified version as described in the paper by Huo & van Zyl ( 2021 ) . 2.3 ENCODER-BASED LIFELONG LEARNING . Rannen et al . ( 2017 ) proposed Encoder-Based Lifelong Learning ( EBLL ) for incremental learning in classification tasks . The method modifies how the convolutional layers of a network are updated . After each incremental learning task , a single autoencoder is trained to reconstruct the “ images ” at the output of the convolutional layers . The reconstructed images are passed through the network ’ s remaining fully connected layers to calculate their resulting classification loss . The reconstruction loss , together with the classification loss , is used to update the autoencoder . The previous task ’ s classification layer ( output layer ) is detached for each new incremental learning task , and a new classification layer is attached . A frozen copy of the previous optimal network is made before training the next incremental task . The new images are passed through both the new and frozen network during training for the new task to calculate the distillation loss and added to the new classification loss and the encode loss to update the new network Rannen et al . ( 2017 ) . However , only the new network is updated . For updating the network ’ s weights , the images ’ convolutional layers outputs of the new and frozen network are passed into the autoencoder up to the bottleneck layer , where the mean square error is calculated and added to the classification loss and propagated through the autoencoders ’ network ’ s weights . This process constrains the weight update of the convolutional network layers to compromise between new and old tasks . 2.4 FULLY CONNECTED VAE . Huo & van Zyl ( 2021 ) proposed using a VAE to represent images in a representation that can be passed through intermediate layers in the network . The authors focused on preserving knowledge from the fully connected layers ( flattened output from the last CNN layer ) . Their method was shown to outperform iCaRL and other methods using similar test metrics to Kemker et al . ( 2018 ) during incremental similarity learning . The concern with their work was that they experimented using a simple network and a variety of simple datasets that are not representative of real-world performance . 2.5 OUR APPROACH ( CONVAER ) . Rannen et al . ( 2017 ) constrain the weights of the feature extraction layers ( convolutions ) that were optimal for previous tasks with an autoencoder . The solution is robust when reusing the feature extraction layers ( convolutions ) on new tasks . Each task is tested independently from the others with its classification layer—the approach yields encouraging results by finding a middle-ground across the base and new knowledge . Huo & van Zyl ( 2021 ) , however , have previously demonstrated that this approach is not practical for incremental metric learning . The iCaRL method by Rebuffi et al . ( 2017 ) depends on the storage of a large number of exemplars . As reported , the performance of iCaRL decreases with time as the number of exemplars per class is reduced to accommodate new classes . Eventually , the stored exemplars are not sufficient to rep- resent all classes . Further , retaining previous exemplars is hardly akin to overcoming catastrophic forgetting . Instead , this represents retaining previous data rather than previously learned knowledge . However , iCARL does present as a state-of-the-art method and , as such , provides a reasonable baseline for comparison . Huo & van Zyl ( 2021 ) combine ideas from Rannen et al . ( 2017 ) and Rebuffi et al . ( 2017 ) . They train a new variational autoencoder ( VAE ) for each class . The VAEs learn representations at the end of the convolutional layers . The use of VAEs allows them to generate examples from previously seen classes . The method requires that the convolutional layers be frozen after initial training or pretrained frozen convolutional layers from a base model are used . The VAEs generate representations from previously seen classes combined with the new classes during incremental metric training to perform incremental metric learning . The work of Huo & van Zyl ( 2021 ) more closely aligned with the intent of overcoming catastrophic forgetting . That is , using previously learned representations and knowledge for future metric learning tasks . We extend on the work by Huo & van Zyl ( 2021 ) by using the authors method and moving the VAE to intercept input to the convolution layer instead of at the input to the fully connected layers show in figure 2 . The autoencoder ’ s reconstruction loss function is required to vary depending on the network ’ s interception layer ’ s activation function . For example , in our case , the convolutional interception layers use ReLU activation , and consequently , we used the Binary Cross-Entropy objective function to determine the reconstruction errors summed with the Kullback-Leibler divergence . The loss function to update the VAEs is given as : LV AE = − 1 N N∑ i=1 yi · log ( p ( yi ) ) + ( 1 − yi ) · log ( 1 − p ( yi ) ) + 1 2 ( exp ( σ2 ) + µ2 − 1 − σ2 ) , ( 1 ) where σ2 is the variance of the entire dataset and µ is the mean . The first term is the Binary CrossEntropy reconstruction loss , and the second term is the Kullback–Leibler divergence . We also make use of the angle-wise distillation loss seen the paper by Huo & van Zyl ( 2021 ) on the examples generated from the VAEs . This usage with the network update during incremental learning , is similar to the approach taken by iCaRL Rebuffi et al . ( 2017 ) . The incremental learning step makes use of the following loss function defined as : Lincremental = lmetric learning + λdistil ∗ LA ( 2 ) , where lmetric learning are the three possible metric learning functions , we state below . LA is the angle-wise distillation for metric learning . λdistil is the importance that we place on the angle-wise distillation loss . The student output is the convolution image output we get from the network incrementally training at each new train step . The teacher output is the convolution output image we get from the frozen network before performing the new incremental train step . For center loss , we used a different distillation loss as defined in Hinton et al . ( 2015 ) defined as : LD ( to , so ) = − l∑ i=1 tiolog ( s i o ) ( 3 ) where l is the number of labels , tio and soi are the modified versions of the teacher model outputs and the current student model outputs . So the modified loss function during the incremental step for center loss is defined as : Lincremental = lmetric learning + λdistil ∗ LD , ( 4 ) where LD is defined above , and the rest remains the same .
This paper presents the method for incremental similarity learning using feature replay with VAEs. The experimental section investigates the impact of different loss functions on the final performance of the model. Yet, the discussion of the results lacks any insights which could be beneficial for the community. The idea to replay features instead of images is not novel and the proposed method is just a minor modification of the method introduced in the paper [1] (which was published on arXiv 4.10.2021 -- two days before the deadline of ICLR submissions). Due to the lack of novelty in this paper, it should be regarded as a form of ablation study for the paper [1] rather than a separate research paper. [1] Incremental Class Learning using Variational Autoencoders with Similarity Learning, J. Huo et al. [2] GDumb: A Simple Approach that Questions Our Progress in Continual Learning, A. Prabhu et al. (edited)
SP:7a0e649fb9f937acd9cbc350d34313a131d2afc0
Network robustness as a mathematical property: training, evaluation and attack
1 INTRODUCTION . Safety and security are critical for some complex AI systems involving neural networks , yet they are difficult to ensure . The most famous instance of this problem is guaranteeing robustness against adversarial attacks ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) . Intuitively , an image is -ball robust if , when you move no more than away from it in the input space , the output does not change much , or alternatively , the classification decision that the network gives does not change . Adversarial robustness is a property that even very accurate neural networks fail to satisfy . The proposed solution is to ( re ) train the network with robustness specifically in mind . Such training can be seen as a way to impose a formal specification , and so may contribute to explainability as well as verification . This work considers four of the most prominent families of techniques : 1 . Data augmentation ( Shorten & Khoshgoftaar , 2019 ) 2 . Adversarial training ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) 3 . Lipschitz robustness training ( Anil et al. , 2019 ; Pauli et al. , 2021 ) 4 . Training with logical constraints ( Xu et al. , 2018 ; Fischer et al. , 2019 ) The last technique , training with logical constraints , is a more general approach that can train for not just robustness , but a wide range of constraints expressed in some logical language . Although the first three families of methods all seek to represent the same high-level knowledge in the neural network , each technique seeks to optimise for subtly different definitions of robustness . We formally identify these as standard ( SR ) , classification ( CR ) , Lipschitz ( LR ) and strong classification ( SCR ) robustness . Given these differences , some natural questions to ask are : What are the relationships between them ? What assumptions do they make about the training dataset ? Are some more effective than others ? Are some more interpretable by users than others ? Contributions . In this work , we attempt to answer these questions . We take classification problems as an example domain , interpreting a neural network f : Rn → Rm as a procedure that separates the n-dimensional data into m classes . This enables the following findings : We observe that from the security perspective , different definitions of robustness ultimately determine the nature of attack , thus giving rise to SR , CR , LR , SCR attacks . Thus , one can train for example with SCR constraint but attack with SR constraint . This raises questions about relative strengths of these different training methods and attacks . Some constraint-driven training methods are special cases of others . For example , adversarial training known in the literature can be seen as a form of training with SR constraint , with certain amount of parameter tuning . We can order some robustness constraints based on their strength , for example , we show that LR implies SR , and SCR implies CR . In this case , training with a stronger constraint ( e.g . LR ) will protect better against both kinds of attacks ( in this case , both SR and LR attacks ) . Some pairs of constraints can not be ordered by strength ( e.g . SR and SCR , LR and SCR ) , and in this case , optimising training for a given constraint defends better only against attacks with this same target constraint . Moreover , we show that training with logical constraints defends against adversarial attacks better than data augmentation for any choice of robustness definition as a training constraint . Finally , we show that there are additional common criteria that can be used to qualitatively compare different modes of constraint-driven training , e.g . interpretability , global or local nature . E.g . CR is the most interpretable , but not globally desirable , LR is least interpretable , but globally desirable . To our knowledge , this is the first systematic study of robustness training from the point of view of the impact of precise formalisation of robustness on training , evaluation and attack . Note that some of the previous work reported on unstable performance of constraint-driven training when defending against attacks ( Ayers et al. , 2020 ) , which we do not observe in our experiments . Some papers ( Fischer et al. , 2019 ) listed and even implemented some kinds of robustness constraints that we study here , but gave no indication of their relative performance . We are not aware of any prior analysis of SR , LR , CR , SCR abstractly as logical constraints . The paper is organised as follows . Section 2 explains how different robustness constraints arise from different machine learning approaches to constraint-driven training . Section 3 abstractly analysises these robustness definitions , establishing their relative strength , interpretability and applicability . Section 4 shows how these robustness constraints determine different evaluation metrics and attacks , and provides a comprehensive empirical evaluation of the robustness constraints deployed as training constraints and as attacks . Section 5 concludes the paper and outlines future work . 2 EXISTING TRAINING TECHNIQUES . Data augmentation is one of the simplest methods of improving the robustness of a neural network via training ( Shorten & Khoshgoftaar , 2019 ) . It is applicable to any transformation of the input ( e.g . addition of noise , translation , rotation , scaling ) that leaves the output label unchanged . To make the network robust against such a transformation , one augments the dataset with instances sampled via the transformation . Although it may seem that this simple solution has nothing to do with formal logic , it imposes significant choices from the point of view of the constraint specification : c1 . the choice of will reflect our assumptions about admissible range of perturbations ; c2 . the choice of the distance function | · − · | that measures the -proximity will reflect our assumptions on desirable geometric properties of the perturbations ; c3 . the choice of the sampling method ( random sampling , adversarial attacks , generative algorithm , prior knowledge of images etc . ) will determine the constraint we optimise for . But , perhaps even more significantly for us , this method determines the exact definition of robustness that we optimise for when we train our neural network f : Rn → Rm . We call it classification robustness and formally define as follows : given a training dataset input-output pair ( x̂ , y ) and a distance function | · − · | , for all inputs x within the -ball distance of x̂ , ensure that class y has the largest score in output f ( x ) . In other words : Definition 1 ( Classification robustness ) CR ( , x̂ ) , ∀x : |x− x̂| ≤ ⇒ argmax f ( x ) = y Used as a spec for training , this constraint does not account for possibility of having “ uncertain ” images in the dataset , for which a small perturbation ideally should change the class . For datasets that contain a significant number of such images , it will lead to significant reduction in accuracy of the trained neural networks ; and , as we show later it may even have a detrimental effect on a network ’ s robustness . Adversarial training is the current state-of the-art method to robustify a neural network . Whereas standard training tries to minimise loss between the predicted value , f ( x̂ ) , and the true value , y , for each entry ( x̂ , y ) in the training dataset , adversarial training minimises the loss with respect to the worst-case perturbation of each sample in the training dataset . It therefore replaces the standard training objective L ( x̂ , y ) with : max ∀x : |x−x̂|≤ L ( x , y ) ( 1 ) Algorithmic solutions to the maximisation problem that find the worst-case perturbation has been the subject of several papers . The earliest suggestion was the Fast Gradient Sign Method ( FGSM ) algorithm introduced by Goodfellow et al . ( 2015 ) : FGSM ( x̂ ) = proj ( x̂+ · sign ( ∇xL ( x , y ) ) ) However , modern adversarial training methods usual rely on some variant of the Projected Gradient Descent ( PGD ) algorithm ( Gu & Rigazio , 2014 ) which iterates FGSM some number of times : PGD0 ( x̂ ) = x̂ ; PGDt+1 ( x̂ ) = PGDt ( FGSM ( x̂ ) ) It has been empirically observed that neural networks trained using this family of methods exhibit greater robustness at the expense of an increased generalization error ( Tsipras et al. , 2018 ; Madry et al. , 2018 ; Zhang et al. , 2019 ) , which is frequently referred to as the accuracy-robustness tradeoff for neural networks ( although this effect has been observed to disappear as the size of the training dataset grows ( Raghunathan et al. , 2019 ) . In logical terms what is this procedure trying to train for ? Obviously it ’ s unreasonable to expect that adversarial training will ever succeed in driving the loss of all perturbations down to zero . Therefore let us assume that there ’ s some maximum distance , δ , that it is acceptable for the output to be perturbed given the size of perturbations in the input . This leads us to the following definition , where || · − · || is a suitable distance function over the output space : Definition 2 ( Standard robustness ) SR ( , δ , x̂ ) , ∀x : |x− x̂| ≤ ⇒ ||f ( x ) − y|| ≤ δ In the case of adversarial training the distance between the outputs ||x− y|| is equal to L ( x , y ) . We note that , just as with data augmentation , choices c1 – c3 are still there to be made , although the sampling methods are usually given by special-purpose FGSM/PGD heuristics based on computing the loss function gradients . Training for Lipschitz robustness . More recently , a third competing definition of robustness has been proposed : Lipschitz robustness ( Balan et al. , 2018 ) . Inspired by the well-established concept of Lipschitz continuity , Lipschitz robustness asserts that the distance between the original output and the perturbed output is at most a constant L times the change in the distance between the inputs . Definition 3 ( Lipschitz robustness ) LR ( , L , x̂ ) , ∀x : |x− x̂| ≤ ⇒ ||f ( x ) − y|| ≤ L|x− x̂| As will be discussed in Section 3 , this is a stronger requirement than standard robustness . Techniques for training for Lipschitz robustness include formulating it as a semi-definite programming optimisation problem ( Pauli et al. , 2021 ) or including a projection step that restricts the weight matrices to those with suitable Lipschitz constants ( Gouk et al. , 2021 ) . Training with logical constraints . Logically , this discussion leads one to ask whether a more general approach to constraint formulation may exist , and several attempts in the literature addressed this research question ( Xu et al. , 2018 ; Fischer et al. , 2019 ) , by proposing methods that can translate a first-order logical formula C into a constraint loss function LC . The loss function penalises the network when outputs do not satisfy a given Boolean constraint , and universal quantification is handled by a choice of sampling method . Our standard loss function L is substituted with : L∗ ( x̂ , y ) = αL ( x̂ , y ) + βLC ( x̂ , y ) ( 2 ) where weights α and β control the balance between the standard loss and the constraint loss . This method looks deceivingly as a generalisation on the previous approaches . However , even given suitable choices for c1 – c3 , classification robustness can not be modelled via a constraint loss in the DL2 framework , as argmax is not differentiable . Instead Fischer et al . ( 2019 ) define an alternative constraint we will call strong classification robustness : Definition 4 ( Strong classification robustness ) SCR ( , η , x̂ ) , ∀x : |x− x̂| ≤ ⇒ f ( x ) c ≥ η which looks only at the prediction of the true class and checks whether it is greater than some value η ( chosen to be 0.52 in their work ) . In summary , we have hopefully demonstrated how non-trivial knowledge representation choices and problems arise on the boundary between logical form of the desired constraints and their machinelearning realisations as loss functions . In the next section , we analyse the advantages and disadvantages of each definition in order to help people better make these choices in future .
The authors are proposing an approach to systematization of the types of robustness of neural network. In particular, they are discussing four types of robustness: through augmentation, through adversarial training, through Lipschitz constraint training and through logical constraints training. The authors discuss the interconnections between the four classes of robustness, hypothesize which one is more general than others, propose possible measures for how easily the robustness can be violated - randomly or intentionally. In the experimental evaluation the authors are checking the attacks vulnerability for the networks with different types of robustness, confirming discussions about them.
SP:de7e056a3ebbbb4fce17331392af4840953ea064
Network robustness as a mathematical property: training, evaluation and attack
1 INTRODUCTION . Safety and security are critical for some complex AI systems involving neural networks , yet they are difficult to ensure . The most famous instance of this problem is guaranteeing robustness against adversarial attacks ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) . Intuitively , an image is -ball robust if , when you move no more than away from it in the input space , the output does not change much , or alternatively , the classification decision that the network gives does not change . Adversarial robustness is a property that even very accurate neural networks fail to satisfy . The proposed solution is to ( re ) train the network with robustness specifically in mind . Such training can be seen as a way to impose a formal specification , and so may contribute to explainability as well as verification . This work considers four of the most prominent families of techniques : 1 . Data augmentation ( Shorten & Khoshgoftaar , 2019 ) 2 . Adversarial training ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) 3 . Lipschitz robustness training ( Anil et al. , 2019 ; Pauli et al. , 2021 ) 4 . Training with logical constraints ( Xu et al. , 2018 ; Fischer et al. , 2019 ) The last technique , training with logical constraints , is a more general approach that can train for not just robustness , but a wide range of constraints expressed in some logical language . Although the first three families of methods all seek to represent the same high-level knowledge in the neural network , each technique seeks to optimise for subtly different definitions of robustness . We formally identify these as standard ( SR ) , classification ( CR ) , Lipschitz ( LR ) and strong classification ( SCR ) robustness . Given these differences , some natural questions to ask are : What are the relationships between them ? What assumptions do they make about the training dataset ? Are some more effective than others ? Are some more interpretable by users than others ? Contributions . In this work , we attempt to answer these questions . We take classification problems as an example domain , interpreting a neural network f : Rn → Rm as a procedure that separates the n-dimensional data into m classes . This enables the following findings : We observe that from the security perspective , different definitions of robustness ultimately determine the nature of attack , thus giving rise to SR , CR , LR , SCR attacks . Thus , one can train for example with SCR constraint but attack with SR constraint . This raises questions about relative strengths of these different training methods and attacks . Some constraint-driven training methods are special cases of others . For example , adversarial training known in the literature can be seen as a form of training with SR constraint , with certain amount of parameter tuning . We can order some robustness constraints based on their strength , for example , we show that LR implies SR , and SCR implies CR . In this case , training with a stronger constraint ( e.g . LR ) will protect better against both kinds of attacks ( in this case , both SR and LR attacks ) . Some pairs of constraints can not be ordered by strength ( e.g . SR and SCR , LR and SCR ) , and in this case , optimising training for a given constraint defends better only against attacks with this same target constraint . Moreover , we show that training with logical constraints defends against adversarial attacks better than data augmentation for any choice of robustness definition as a training constraint . Finally , we show that there are additional common criteria that can be used to qualitatively compare different modes of constraint-driven training , e.g . interpretability , global or local nature . E.g . CR is the most interpretable , but not globally desirable , LR is least interpretable , but globally desirable . To our knowledge , this is the first systematic study of robustness training from the point of view of the impact of precise formalisation of robustness on training , evaluation and attack . Note that some of the previous work reported on unstable performance of constraint-driven training when defending against attacks ( Ayers et al. , 2020 ) , which we do not observe in our experiments . Some papers ( Fischer et al. , 2019 ) listed and even implemented some kinds of robustness constraints that we study here , but gave no indication of their relative performance . We are not aware of any prior analysis of SR , LR , CR , SCR abstractly as logical constraints . The paper is organised as follows . Section 2 explains how different robustness constraints arise from different machine learning approaches to constraint-driven training . Section 3 abstractly analysises these robustness definitions , establishing their relative strength , interpretability and applicability . Section 4 shows how these robustness constraints determine different evaluation metrics and attacks , and provides a comprehensive empirical evaluation of the robustness constraints deployed as training constraints and as attacks . Section 5 concludes the paper and outlines future work . 2 EXISTING TRAINING TECHNIQUES . Data augmentation is one of the simplest methods of improving the robustness of a neural network via training ( Shorten & Khoshgoftaar , 2019 ) . It is applicable to any transformation of the input ( e.g . addition of noise , translation , rotation , scaling ) that leaves the output label unchanged . To make the network robust against such a transformation , one augments the dataset with instances sampled via the transformation . Although it may seem that this simple solution has nothing to do with formal logic , it imposes significant choices from the point of view of the constraint specification : c1 . the choice of will reflect our assumptions about admissible range of perturbations ; c2 . the choice of the distance function | · − · | that measures the -proximity will reflect our assumptions on desirable geometric properties of the perturbations ; c3 . the choice of the sampling method ( random sampling , adversarial attacks , generative algorithm , prior knowledge of images etc . ) will determine the constraint we optimise for . But , perhaps even more significantly for us , this method determines the exact definition of robustness that we optimise for when we train our neural network f : Rn → Rm . We call it classification robustness and formally define as follows : given a training dataset input-output pair ( x̂ , y ) and a distance function | · − · | , for all inputs x within the -ball distance of x̂ , ensure that class y has the largest score in output f ( x ) . In other words : Definition 1 ( Classification robustness ) CR ( , x̂ ) , ∀x : |x− x̂| ≤ ⇒ argmax f ( x ) = y Used as a spec for training , this constraint does not account for possibility of having “ uncertain ” images in the dataset , for which a small perturbation ideally should change the class . For datasets that contain a significant number of such images , it will lead to significant reduction in accuracy of the trained neural networks ; and , as we show later it may even have a detrimental effect on a network ’ s robustness . Adversarial training is the current state-of the-art method to robustify a neural network . Whereas standard training tries to minimise loss between the predicted value , f ( x̂ ) , and the true value , y , for each entry ( x̂ , y ) in the training dataset , adversarial training minimises the loss with respect to the worst-case perturbation of each sample in the training dataset . It therefore replaces the standard training objective L ( x̂ , y ) with : max ∀x : |x−x̂|≤ L ( x , y ) ( 1 ) Algorithmic solutions to the maximisation problem that find the worst-case perturbation has been the subject of several papers . The earliest suggestion was the Fast Gradient Sign Method ( FGSM ) algorithm introduced by Goodfellow et al . ( 2015 ) : FGSM ( x̂ ) = proj ( x̂+ · sign ( ∇xL ( x , y ) ) ) However , modern adversarial training methods usual rely on some variant of the Projected Gradient Descent ( PGD ) algorithm ( Gu & Rigazio , 2014 ) which iterates FGSM some number of times : PGD0 ( x̂ ) = x̂ ; PGDt+1 ( x̂ ) = PGDt ( FGSM ( x̂ ) ) It has been empirically observed that neural networks trained using this family of methods exhibit greater robustness at the expense of an increased generalization error ( Tsipras et al. , 2018 ; Madry et al. , 2018 ; Zhang et al. , 2019 ) , which is frequently referred to as the accuracy-robustness tradeoff for neural networks ( although this effect has been observed to disappear as the size of the training dataset grows ( Raghunathan et al. , 2019 ) . In logical terms what is this procedure trying to train for ? Obviously it ’ s unreasonable to expect that adversarial training will ever succeed in driving the loss of all perturbations down to zero . Therefore let us assume that there ’ s some maximum distance , δ , that it is acceptable for the output to be perturbed given the size of perturbations in the input . This leads us to the following definition , where || · − · || is a suitable distance function over the output space : Definition 2 ( Standard robustness ) SR ( , δ , x̂ ) , ∀x : |x− x̂| ≤ ⇒ ||f ( x ) − y|| ≤ δ In the case of adversarial training the distance between the outputs ||x− y|| is equal to L ( x , y ) . We note that , just as with data augmentation , choices c1 – c3 are still there to be made , although the sampling methods are usually given by special-purpose FGSM/PGD heuristics based on computing the loss function gradients . Training for Lipschitz robustness . More recently , a third competing definition of robustness has been proposed : Lipschitz robustness ( Balan et al. , 2018 ) . Inspired by the well-established concept of Lipschitz continuity , Lipschitz robustness asserts that the distance between the original output and the perturbed output is at most a constant L times the change in the distance between the inputs . Definition 3 ( Lipschitz robustness ) LR ( , L , x̂ ) , ∀x : |x− x̂| ≤ ⇒ ||f ( x ) − y|| ≤ L|x− x̂| As will be discussed in Section 3 , this is a stronger requirement than standard robustness . Techniques for training for Lipschitz robustness include formulating it as a semi-definite programming optimisation problem ( Pauli et al. , 2021 ) or including a projection step that restricts the weight matrices to those with suitable Lipschitz constants ( Gouk et al. , 2021 ) . Training with logical constraints . Logically , this discussion leads one to ask whether a more general approach to constraint formulation may exist , and several attempts in the literature addressed this research question ( Xu et al. , 2018 ; Fischer et al. , 2019 ) , by proposing methods that can translate a first-order logical formula C into a constraint loss function LC . The loss function penalises the network when outputs do not satisfy a given Boolean constraint , and universal quantification is handled by a choice of sampling method . Our standard loss function L is substituted with : L∗ ( x̂ , y ) = αL ( x̂ , y ) + βLC ( x̂ , y ) ( 2 ) where weights α and β control the balance between the standard loss and the constraint loss . This method looks deceivingly as a generalisation on the previous approaches . However , even given suitable choices for c1 – c3 , classification robustness can not be modelled via a constraint loss in the DL2 framework , as argmax is not differentiable . Instead Fischer et al . ( 2019 ) define an alternative constraint we will call strong classification robustness : Definition 4 ( Strong classification robustness ) SCR ( , η , x̂ ) , ∀x : |x− x̂| ≤ ⇒ f ( x ) c ≥ η which looks only at the prediction of the true class and checks whether it is greater than some value η ( chosen to be 0.52 in their work ) . In summary , we have hopefully demonstrated how non-trivial knowledge representation choices and problems arise on the boundary between logical form of the desired constraints and their machinelearning realisations as loss functions . In the next section , we analyse the advantages and disadvantages of each definition in order to help people better make these choices in future .
This paper formally summarizes common robustness notions in the literature as: standard robustness (SR), classification robustness (CR), Lipschitz robustness (LR), and strong classification robustness (SCR). The paper proves LR implies SR, SCR implies CR. Then some empirical studies are conducted.
SP:de7e056a3ebbbb4fce17331392af4840953ea064
Deep Attentive Variational Inference
1 INTRODUCTION . A core line of research in both supervised and unsupervised learning relies on deep probabilistic models . This class of models uses deep neural networks to model distributions that express hypotheses about the way in which the data have been generated . Such architectures are preferred due to their capacity to express complex , non-linear relationships between the random variables of interest while enabling tractable inference and sampling . Latent variable probabilistic models augment the set of the observed variables with auxiliary latent variables . They are characterized by a posterior distribution over the latent variables , one which is generally intractable and typically approximated by closed-form alternatives . They provide an explicit parametric specification of the joint distributions over the expanded random variable space , while the distribution of the observed variables is computed by marginalizing over the latent variables . The Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) belongs to this model category . The VAE uses neural networks for learning the parametrization of both the inference network ( which defines the posterior distribution of the latent variables ) and the generative network ( which defines the prior distribution of the latent variables and the conditional data distribution given the latent variables ) . Their parameters are jointly learned via stochastic variational inference ( Paisley et al. , 2012 ; Hoffman et al. , 2013 ) . Early VAE architectures ( Rezende et al. , 2014 ) make strong assumptions about the posterior distribution—specifically , it is standard to assume that the posterior is approximately factorial . Since then , research has progressed on learning more expressive latent variable models . For example , Rezende & Mohamed ( 2015 ) ; Kingma et al . ( 2016 ) ; Chen et al . ( 2017 ) aim at modeling more complex posterior distributions , constructed with autoregressive layers . Theoretical research focuses on deriving tighter bounds ( Burda et al. , 2016 ; Li & Turner , 2016 ; Masrani et al. , 2019 ) or building more informative latent variables by mitigating posterior collapse ( Razavi et al. , 2019a ; Lucas et al. , 2019 ) . Sinha & Dieng ( 2021 ) improve generalization by enforcing regularization in the latent space for semantics-preserving transformations of the data . Taking a different approach , hierarchical VAEs ( Gulrajani et al. , 2017 ; Sønderby et al. , 2016 ; Maaløe et al. , 2019 ; Vahdat & Kautz , 2020 ; Child , 2020 ) leverage increasingly deep and interdependent layers of latent variables , similar to how subsequent layers in a discriminative network are believed to learn increasingly abstract representations of the data . These architectures exhibit superior generative and reconstructive capabilities since they allow for modeling of much richer structures in the latent space . Previous work overlooks the effect of long-range correlations among the latent variables . In this work , we propose to restructure common hierarchical , convolutional VAE architectures in order to increase the receptive field of the variational distributions . We first provide experimental evidence that conditional dependencies in deep probabilistic hierarchies may be implicitly disregarded by current models . Subsequently , we propose a decomposed , attention-guided scheme that allows a long-range flow of both the latent and the observed information both across different , potentially far apart , stochastic layers and within the same layer and we investigate the importance of each proposed change through extensive ablation studies . Finally , we demonstrate that our model is both computationally more economical and can attain state-of-the-art performance across a diverse set of benchmark datasets . 2 PROPOSED MODEL . 2.1 DEEP VARIATIONAL INFERENCE . A latent variable generative model defines the joint distribution of a set of observed variables , x ∈ RD , and auxiliary latent variables , z , coming from a prior distribution p ( z ) . To perform inference , the marginal likelihood of the distribution of interest , p ( x ) , can be computed by integrating out the latent variables : p ( x ) = ∫ p ( x , z ) dz . ( 1 ) Since this integration is generally intractable , a lower bound on the marginal likelihood is maximized instead . This is done by introducing an approximate posterior distribution q ( z | x ) and applying Jensen ’ s inequality : log p ( x ) = log ∫ p ( x , z ) dz = log ∫ q ( z | x ) q ( z | x ) p ( x , z ) dz ≥ ∫ q ( z | x ) log [ p ( x | z ) p ( z ) q ( z | x ) ] dz =⇒ log p ( x ) ≥ Eq ( z|x ) [ log p ( x | z ) ] −DKL ( q ( z | x ) ∥ p ( z ) ) , ( 2 ) where θ , ϕ parameterize p ( x , z ; θ ) and q ( z | x ; ϕ ) respectively . For ease of notation , we omit θ , ϕ in the derivations . This objective is called the Evidence Lower BOund ( ELBO ) and can be optimized efficiently for continuous z via stochastic gradient descent ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . For ease of implementation , it is common to assume that both q ( z | z ) and p ( z ) are fully factorized Gaussian distributions . However , this assumption may be too limiting in cases of complex underlying distributions . To compensate for this modeling constraint , many works focus on stacking and improving the stability of multiple layers of stochastic latent features which are partitioned in groups such that z = { z1 , z2 , . . . , zL } , where L is the number of such groups ( Rezende et al. , 2014 ; Gulrajani et al. , 2017 ; Kingma et al. , 2016 ; Sønderby et al. , 2016 ; Maaløe et al. , 2019 ; Vahdat & Kautz , 2020 ; Child , 2020 ) . Our work builds on architectures of bidirectional inference with a deterministic bottom-up pass . The schematic diagram of a stochastic layer in such a deep variational model is depicted in Figure 1 . In a bidirectional inference architecture with a deterministic bottom-up pass ( left part in Figure 1a ) , posterior sampling is preceded by a sequence of non-linear transformations , T ql , of the evidence , x , i.e. , hl = T q l ( hl+1 ) , with hL+1 = x . The inference q ( z | x ) and generative p ( z ) network decompose in an identical topological ordering : q ( z | x ) = ∏ l q ( zl | x , z < l ) and p ( z ) = ∏ l p ( zl | z < l ) . The top-down pass ( right part in Figure 1a ) generates the posterior samples z that feed the conditional data distribution p ( x | z ) . 2.2 MOTIVATION . Kingma et al . ( 2016 ) proposed a strongly connected directed probabilistic graphical model for the generative and inference network , so that each variable depends on all the previous in the hierarchy : p ( zl | z < l ) . Similarly , for the inference model : q ( zl | x , z < l ) . This is in contrast to other works ( Sønderby et al. , 2016 ) that consider statistical dependencies between successive layers only , i.e. , p ( zl | zl−1 ) . Maaløe et al . ( 2019 ) also highlight the importance of this modification . The longrange conditional dependencies are implicitly enforced via deterministic features that are mixed with the latent variables and propagated through the hierarchy ( see feature cpl in Figure 1a ) . State-of-the-art models ( Vahdat & Kautz , 2020 ; Child , 2020 ) leverage this fully-connected factorization and rely on the increased depth to improve performance and deliver results comparable to that of autoregressive models ( Salimans et al. , 2017 ) . However , by construction , very deep VAE architectures favor only proximate dependencies in the latent space , limiting longrange conditional dependencies between zl and z < l−1 as depth increases . This means that in practice the network may no longer respect the factorization of the variational distributions p ( z ) =∏ l p ( zl | z < l ) and q ( z | x ) = ∏ l q ( zl | x , z < l ) , leading to sub-optimal performance . Table 1 reports the absolute and relative decrease in the negative log-likelihood ( in bits per dimension ) as one increases the number of stochastic layers in an NVAE ( Vahdat & Kautz , 2020 ) . We observe that the predictive gains diminish as depth increases . We hypothesize that this may be because the effect of the latent variables of earlier layers diminishes as the context feature cpl traverses the hierarchy and is updated with latent information from subsequent layers . In this work , we improve the flexibility of the prior p ( z ) and posterior q ( z | x ) by designing more informative conditioning factors of the conditional distributions p ( zl | z < l ) and q ( zl | x , z < l ) . We do this by designing a hierarchy of densely connected stochastic layers that learn to attend to latent and observed information most critical for inference . Figure 1b is a graphical illustration of the proposed model . 2.3 DEPTH-WISE ATTENTION Figure 2 : Attend ( c < l , sl , k < l ) − a depth-wise attention block . c < l , k < l are the sequences of l − 1 contexts and corresponding keys with C and Q feature maps accordingly , while sl is the query feature . The multiplication is applied to the inner matrix dimensions . The normalization of the softmax is applied to the last dimension , treating each pixel independently from the others . α < l = { αm→l } l−1m=1 are the attention scores . We first introduce depth-wise attention . This is the technical tool that allows our model to realize the strong couplings presented in Figure 1b and motivated in Section 2.2 . The problem can be formulated as follows : Given a sequence c < l = { cm } l−1m=1 of l − 1 contexts , we need to construct a feature ĉl that summarizes the information in c < l that is most critical for a given task . ĉl and cm are features of the same dimensionality : ĉl ∈ RH×W×C , and cm ∈ RH×W×C . In our framework , this task is the construction of either prior ( Section 2.4 ) or posterior ( Section 2.5 ) beliefs of a variational layer in a deep VAE . Therefore , our architecture must be need to handle long context sequences of large dimensions H and W . The task is characterized by a query feature sl ∈ RH×W×Q of dimensionality Q with Q≪ C. Similarly , cm is represented by a key feature km ∈ RH×W×Q . To reduce computational requirements , we treat each pixel independently from the rest . This can equivalently be interpreted as concurrent processing of H ×W independent sequences of C-dimensional features . The feature maps ĉl ( i , j ) ∈ RC for pixels ( i , j ) , with 1 ≤ i ≤ H , 1 ≤ j ≤W , are computed in parallel . ĉl ( i , j ) depends only on pixel instances in c < l at the same location ( i , j ) , i.e , cm ( i , j ) with m < l , and is given by : ĉl ( i , j ) = ∑ m < l αm→l ( i , j ) cm ( i , j ) , ( 3 ) αm→l ( i , j ) = exp ( sTl ( i , j ) km ( i , j ) ) ∑ m < l exp ( s T l ( i , j ) km ( i , j ) ) . ( 4 ) In words , feature sl ( i , j ) ∈ RQ queries the significance of feature cm ( i , j ) ∈ RC , represented by km ( i , j ) ∈ RQ , to form ĉl ( i , j ) ∈ RC . αm→l ( i , j ) ∈ R , is the resulting relevance metric of the m−th term , with m < l , at pixel ( i , j ) . The overall procedure is denoted as ĉ = Attend ( c < l , sl , k < l ) , and is illustrated in Figure 2 . Finally , to improve training of models with very long sequences , we adopt the following variant of the normalization scheme proposed by Chen et al . ( 2020 ) : c < l ← c < l +Gelu ( LayerNorm ( c < l ) ) , ( 5 ) ĉl ← ĉl +Gelu ( LayerNorm ( ĉl ) ) , ( 6 ) where Gelu is the GELU non-linearity ( Hendrycks & Gimpel , 2016 ) and LayerNorm a layer normalization operation ( Ba et al. , 2016 ) .
This paper identifies a common problem in previous VAE related models: adding more stochastic layers to an already very deep model yields small predictive improvement while substantially increasing the inference and training time. Therefore, a new model that proposes to use attention mechanisms to build more expressive variational distributions in deep probabilistic models by explicitly modelling both local and global interactions in the latent space is proposed. The model is evaluated on standard dataset MNIST and OMNIGLOT, and showed superior performance against a wide range of baseline models.
SP:b5f7c5fcade8783b63c1067e0a14f5bafa88dfce
Deep Attentive Variational Inference
1 INTRODUCTION . A core line of research in both supervised and unsupervised learning relies on deep probabilistic models . This class of models uses deep neural networks to model distributions that express hypotheses about the way in which the data have been generated . Such architectures are preferred due to their capacity to express complex , non-linear relationships between the random variables of interest while enabling tractable inference and sampling . Latent variable probabilistic models augment the set of the observed variables with auxiliary latent variables . They are characterized by a posterior distribution over the latent variables , one which is generally intractable and typically approximated by closed-form alternatives . They provide an explicit parametric specification of the joint distributions over the expanded random variable space , while the distribution of the observed variables is computed by marginalizing over the latent variables . The Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) belongs to this model category . The VAE uses neural networks for learning the parametrization of both the inference network ( which defines the posterior distribution of the latent variables ) and the generative network ( which defines the prior distribution of the latent variables and the conditional data distribution given the latent variables ) . Their parameters are jointly learned via stochastic variational inference ( Paisley et al. , 2012 ; Hoffman et al. , 2013 ) . Early VAE architectures ( Rezende et al. , 2014 ) make strong assumptions about the posterior distribution—specifically , it is standard to assume that the posterior is approximately factorial . Since then , research has progressed on learning more expressive latent variable models . For example , Rezende & Mohamed ( 2015 ) ; Kingma et al . ( 2016 ) ; Chen et al . ( 2017 ) aim at modeling more complex posterior distributions , constructed with autoregressive layers . Theoretical research focuses on deriving tighter bounds ( Burda et al. , 2016 ; Li & Turner , 2016 ; Masrani et al. , 2019 ) or building more informative latent variables by mitigating posterior collapse ( Razavi et al. , 2019a ; Lucas et al. , 2019 ) . Sinha & Dieng ( 2021 ) improve generalization by enforcing regularization in the latent space for semantics-preserving transformations of the data . Taking a different approach , hierarchical VAEs ( Gulrajani et al. , 2017 ; Sønderby et al. , 2016 ; Maaløe et al. , 2019 ; Vahdat & Kautz , 2020 ; Child , 2020 ) leverage increasingly deep and interdependent layers of latent variables , similar to how subsequent layers in a discriminative network are believed to learn increasingly abstract representations of the data . These architectures exhibit superior generative and reconstructive capabilities since they allow for modeling of much richer structures in the latent space . Previous work overlooks the effect of long-range correlations among the latent variables . In this work , we propose to restructure common hierarchical , convolutional VAE architectures in order to increase the receptive field of the variational distributions . We first provide experimental evidence that conditional dependencies in deep probabilistic hierarchies may be implicitly disregarded by current models . Subsequently , we propose a decomposed , attention-guided scheme that allows a long-range flow of both the latent and the observed information both across different , potentially far apart , stochastic layers and within the same layer and we investigate the importance of each proposed change through extensive ablation studies . Finally , we demonstrate that our model is both computationally more economical and can attain state-of-the-art performance across a diverse set of benchmark datasets . 2 PROPOSED MODEL . 2.1 DEEP VARIATIONAL INFERENCE . A latent variable generative model defines the joint distribution of a set of observed variables , x ∈ RD , and auxiliary latent variables , z , coming from a prior distribution p ( z ) . To perform inference , the marginal likelihood of the distribution of interest , p ( x ) , can be computed by integrating out the latent variables : p ( x ) = ∫ p ( x , z ) dz . ( 1 ) Since this integration is generally intractable , a lower bound on the marginal likelihood is maximized instead . This is done by introducing an approximate posterior distribution q ( z | x ) and applying Jensen ’ s inequality : log p ( x ) = log ∫ p ( x , z ) dz = log ∫ q ( z | x ) q ( z | x ) p ( x , z ) dz ≥ ∫ q ( z | x ) log [ p ( x | z ) p ( z ) q ( z | x ) ] dz =⇒ log p ( x ) ≥ Eq ( z|x ) [ log p ( x | z ) ] −DKL ( q ( z | x ) ∥ p ( z ) ) , ( 2 ) where θ , ϕ parameterize p ( x , z ; θ ) and q ( z | x ; ϕ ) respectively . For ease of notation , we omit θ , ϕ in the derivations . This objective is called the Evidence Lower BOund ( ELBO ) and can be optimized efficiently for continuous z via stochastic gradient descent ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . For ease of implementation , it is common to assume that both q ( z | z ) and p ( z ) are fully factorized Gaussian distributions . However , this assumption may be too limiting in cases of complex underlying distributions . To compensate for this modeling constraint , many works focus on stacking and improving the stability of multiple layers of stochastic latent features which are partitioned in groups such that z = { z1 , z2 , . . . , zL } , where L is the number of such groups ( Rezende et al. , 2014 ; Gulrajani et al. , 2017 ; Kingma et al. , 2016 ; Sønderby et al. , 2016 ; Maaløe et al. , 2019 ; Vahdat & Kautz , 2020 ; Child , 2020 ) . Our work builds on architectures of bidirectional inference with a deterministic bottom-up pass . The schematic diagram of a stochastic layer in such a deep variational model is depicted in Figure 1 . In a bidirectional inference architecture with a deterministic bottom-up pass ( left part in Figure 1a ) , posterior sampling is preceded by a sequence of non-linear transformations , T ql , of the evidence , x , i.e. , hl = T q l ( hl+1 ) , with hL+1 = x . The inference q ( z | x ) and generative p ( z ) network decompose in an identical topological ordering : q ( z | x ) = ∏ l q ( zl | x , z < l ) and p ( z ) = ∏ l p ( zl | z < l ) . The top-down pass ( right part in Figure 1a ) generates the posterior samples z that feed the conditional data distribution p ( x | z ) . 2.2 MOTIVATION . Kingma et al . ( 2016 ) proposed a strongly connected directed probabilistic graphical model for the generative and inference network , so that each variable depends on all the previous in the hierarchy : p ( zl | z < l ) . Similarly , for the inference model : q ( zl | x , z < l ) . This is in contrast to other works ( Sønderby et al. , 2016 ) that consider statistical dependencies between successive layers only , i.e. , p ( zl | zl−1 ) . Maaløe et al . ( 2019 ) also highlight the importance of this modification . The longrange conditional dependencies are implicitly enforced via deterministic features that are mixed with the latent variables and propagated through the hierarchy ( see feature cpl in Figure 1a ) . State-of-the-art models ( Vahdat & Kautz , 2020 ; Child , 2020 ) leverage this fully-connected factorization and rely on the increased depth to improve performance and deliver results comparable to that of autoregressive models ( Salimans et al. , 2017 ) . However , by construction , very deep VAE architectures favor only proximate dependencies in the latent space , limiting longrange conditional dependencies between zl and z < l−1 as depth increases . This means that in practice the network may no longer respect the factorization of the variational distributions p ( z ) =∏ l p ( zl | z < l ) and q ( z | x ) = ∏ l q ( zl | x , z < l ) , leading to sub-optimal performance . Table 1 reports the absolute and relative decrease in the negative log-likelihood ( in bits per dimension ) as one increases the number of stochastic layers in an NVAE ( Vahdat & Kautz , 2020 ) . We observe that the predictive gains diminish as depth increases . We hypothesize that this may be because the effect of the latent variables of earlier layers diminishes as the context feature cpl traverses the hierarchy and is updated with latent information from subsequent layers . In this work , we improve the flexibility of the prior p ( z ) and posterior q ( z | x ) by designing more informative conditioning factors of the conditional distributions p ( zl | z < l ) and q ( zl | x , z < l ) . We do this by designing a hierarchy of densely connected stochastic layers that learn to attend to latent and observed information most critical for inference . Figure 1b is a graphical illustration of the proposed model . 2.3 DEPTH-WISE ATTENTION Figure 2 : Attend ( c < l , sl , k < l ) − a depth-wise attention block . c < l , k < l are the sequences of l − 1 contexts and corresponding keys with C and Q feature maps accordingly , while sl is the query feature . The multiplication is applied to the inner matrix dimensions . The normalization of the softmax is applied to the last dimension , treating each pixel independently from the others . α < l = { αm→l } l−1m=1 are the attention scores . We first introduce depth-wise attention . This is the technical tool that allows our model to realize the strong couplings presented in Figure 1b and motivated in Section 2.2 . The problem can be formulated as follows : Given a sequence c < l = { cm } l−1m=1 of l − 1 contexts , we need to construct a feature ĉl that summarizes the information in c < l that is most critical for a given task . ĉl and cm are features of the same dimensionality : ĉl ∈ RH×W×C , and cm ∈ RH×W×C . In our framework , this task is the construction of either prior ( Section 2.4 ) or posterior ( Section 2.5 ) beliefs of a variational layer in a deep VAE . Therefore , our architecture must be need to handle long context sequences of large dimensions H and W . The task is characterized by a query feature sl ∈ RH×W×Q of dimensionality Q with Q≪ C. Similarly , cm is represented by a key feature km ∈ RH×W×Q . To reduce computational requirements , we treat each pixel independently from the rest . This can equivalently be interpreted as concurrent processing of H ×W independent sequences of C-dimensional features . The feature maps ĉl ( i , j ) ∈ RC for pixels ( i , j ) , with 1 ≤ i ≤ H , 1 ≤ j ≤W , are computed in parallel . ĉl ( i , j ) depends only on pixel instances in c < l at the same location ( i , j ) , i.e , cm ( i , j ) with m < l , and is given by : ĉl ( i , j ) = ∑ m < l αm→l ( i , j ) cm ( i , j ) , ( 3 ) αm→l ( i , j ) = exp ( sTl ( i , j ) km ( i , j ) ) ∑ m < l exp ( s T l ( i , j ) km ( i , j ) ) . ( 4 ) In words , feature sl ( i , j ) ∈ RQ queries the significance of feature cm ( i , j ) ∈ RC , represented by km ( i , j ) ∈ RQ , to form ĉl ( i , j ) ∈ RC . αm→l ( i , j ) ∈ R , is the resulting relevance metric of the m−th term , with m < l , at pixel ( i , j ) . The overall procedure is denoted as ĉ = Attend ( c < l , sl , k < l ) , and is illustrated in Figure 2 . Finally , to improve training of models with very long sequences , we adopt the following variant of the normalization scheme proposed by Chen et al . ( 2020 ) : c < l ← c < l +Gelu ( LayerNorm ( c < l ) ) , ( 5 ) ĉl ← ĉl +Gelu ( LayerNorm ( ĉl ) ) , ( 6 ) where Gelu is the GELU non-linearity ( Hendrycks & Gimpel , 2016 ) and LayerNorm a layer normalization operation ( Ba et al. , 2016 ) .
This paper improves the architecture of deep VAEs using the attention mechanism. The attention mechanism is used in two ways: 1. layer-wise attention (attending stochastic feature maps which are conditioned on other variables within the hierarchy, interpreted as a mixture of skip connections) 2. non-local attention (attention across the spatial dimensions, increases the size of receptive field) The authors demonstrate the effectiveness of their architectural changes by challenging current sota deep VAEs on MNIST, OMNIGLOT and CIFAR-10. Notably, they outperform the state-of-the-art methods (in likelihood) on CIFAR-10 using fewer layers and fewer GPU hours. The authors provide an extensive ablation study, showing the impact of each type of attention on the training performances (test likelihood on CIFAR-10).
SP:b5f7c5fcade8783b63c1067e0a14f5bafa88dfce
Understanding and Preventing Capacity Loss in Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning has achieved remarkable successes in a variety of environments ( Mnih et al. , 2015 ; Moravčı́k et al. , 2017 ; Silver et al. , 2017 ; Abreu et al. , 2019 ) , but the precise reasons for its successes largely remain mysterious . Existing algorithms are highly sensitive to hyperparameters and seemingly innocuous design choices , to the extent that even minor variations to state-of-the-art methods can fail to make learning progress on tasks originally solved with ease . These instabilities are particularly pronounced in sparse-reward environments , where even different random seeds of the same algorithm can attain dramatically different performance outcomes . In these settings , even if the agent has experienced the rewards necessary to learn a high-scoring policy , it will often fail to translate those rewards into successful policy improvements . This presents a stark contrast to supervised learning , where existing approaches are reasonably robust to small hyperparameter changes , random seeds , and GPU parallelisation libraries . Moreover , naive applications of supervised learning methods such as momentum-based optimization or data augmentation to the RL problem often require additional modification to yield performance improvements ( Bengio et al. , 2020 ; Raileanu et al. , 2020 ) . We hypothesize that the non-stationary prediction problems agents face in RL may be a driving force in the challenges described above . RL agents must solve a sequence of similar prediction problems as they iteratively improve their prediction accuracy and their policy ( Dabney et al. , 2021 ) , and solving each subproblem in this sequence is necessary to progress to the next subproblem . As shown in work on active learning , warm-starting a network by fitting similar data to that used in the downstream task can hurt the network ’ s final accuracy , even if this data is drawn from the same distribution ( Ash & Adams , 2020 ) . This suggests that the slowly-shifting input and target distributions RL agents face may be particularly ill-suited to function approximation by deep neural networks . Indeed , several prior works studying the effect of re-initializing network parameters in reinforcement learning have found this enables agents to break through plateaus and improve generalization performance ( Igl et al. , 2021 ; Fedus et al. , 2020 ) . The principal thesis of this paper is that over the course of training , deep RL agents lose some of their capacity to quickly fit new prediction tasks , and in extreme cases this capacity loss prevents the agent entirely from making learning progress . We present a rigorous empirical analysis of this phenomenon which considers both the ability of networks to learn new target functions via gradientbased optimization methods , and their ability to linearly disentangle states ’ feature representations . We confirm that agents ’ ability to fit new target functions declines over the course of training in several environments from the Atari suite ( Bellemare et al. , 2013 ) and non-stationary reward prediction tasks . We further find that the ability of representations to linearly distinguish different states , a proxy for their ability to represent certain functions , quickly diminishes in sparse-reward games , leading to representation collapse , where the feature outputs for every state in the environment inhabit a low-dimensional – or possibly even zero – subspace . Finally , we show evidence that representation collapse is a key factor in agents ’ failure to make learning progress in sparse-reward environments . We then propose a simple regularization technique , Initial Feature Regularization ( InFeR ) , to prevent representation collapse : regress a set of feature projection heads to their values at initialization . This method improves performance on a number of sparse-reward environments and also increases the measures of capacity we are interested in , preventing representation collapse in sparse-reward environments and improving target-fitting capacity in dense-reward environments . One striking take-away from our results is that agents trained on so-called ‘ hard exploration ’ games such as Montezuma ’ s Revenge can attain significant improvements over existing competitive baselines without using smart exploration algorithms . This suggests that the poor performance of deep RL agents in sparse-reward environments is not solely due to inadequate exploration , but rather also in part due to poor representation learning . Essentially , agents which are ‘ too good ’ at predicting the zero value function lose their ability to fit the non-zero targets necessary for policy improvement . We believe this has significant implications for how the community views the interplay of exploration and representation learning in sparse reward environments . 2 BACKGROUND . We consider the reinforcement learning problem wherein an agent seeks to maximize expected return in an MDP M = ( X , A , R , P , ) , where X denotes the state space , A the action space , R the reward function , P the transition probability function , and the discount factor . We will be primarily interested in value-based RL , where the objective is to learn the value function Q⇡ : X ⇥ A ! R associated with some ( possibly stochastic ) policy ⇡ : X ! P ( A ) , defined as Q⇡ ( x , a ) = E⇡ , P [ P1 k=0 kR ( xk , ak ) |x0 = x , a0 = a ] . In particular , we are interested in learning the value function associated with the optimal policy ⇡⇤ which maximizes the expected discounted sum of rewards from any state . In Q-Learning ( Watkins & Dayan , 1992 ) , the agent performs updates to minimize the distance between a predicted action-value function Q and the bootstrap target defined as T Q ( x , a ) = E [ R ( x0 , a0 ) + max a02A Q ( x1 , a 0 ) |x0 = x , a0 = a ] . ( 1 ) In most practical settings , updates are performed with respect to sampled transitions rather than on the entire state space . The target can be computed for a sampled transition ( xt , at , rt , xt+1 ) as T̂ Q ( xt , at ) = rt + maxa Q ( xt+1 , a ) . When a deep neural network is used as a function approximator ( the deep RL setting ) , Q is defined to be the output of a neural network with parameters ✓ , and updates are performed by gradient descent on sampled transitions ⌧ = ( xt , at , rt , xt+1 ) . A number of tricks are often used to improve stability : the sample-based objective is minimized following stochastic gradient descent based on minibatches sampled from a replay buffer of stored transitions , and a separate set of parameters ✓̄ is used to compute the targets Q✓̄ ( xt+1 , at+1 ) which is typically updated more slowly than the network ’ s online parameters . This yields the following loss function ( where ⌧ denotes the sampled transition ) : ` TD ( Q✓ , ⌧ ) = ( Rt+1 + max a0 Q✓̄ ( Xt+1 , a 0 ) Q✓ ( Xt , At ) ) 2 . ( 2 ) In this work we will be interested in how common variations on this basic learning objective shape agents ’ learning dynamics , in particular the dynamics of the learned representation , or features . We will refer to the outputs of the final hidden layer of the network ( i.e . the penultimate layer ) as its features , denoted ✓ ( x ) . Our choice of the penultimate layer is motivated by prior literature studying representations in RL ( Ghosh & Bellemare , 2020 ; Kumar et al. , 2021 ) , although many works studying representation learning consider the outputs of earlier layers as well . In general , the features of a neural network are defined to be the outputs of whatever layer is used to compute additional representation learning objectives . 3 CAPACITY LOSS . In this section we demonstrate conditions under which neural networks progressively lose their ability to quickly fit new targets when trained on sequences of prediction tasks including , but not limited to , those found in value-based RL . We find that the loss of this notion of capacity loss , which we refer to as target-fitting capacity , is particularly pronounced in sparse prediction tasks , where many of the target values the agent seeks to predict are zero . To study the effect of extreme capacity loss on performance in greater depth , we present a special case of the target-fitting capacity measure which is efficient to compute and has the intuitive interpretation of measuring the ability of the representation to linearly disentangle states . We find evidence that agents which have greater capacity according to this metric tend to achieve better performance in challenging environments from the Atari suite where agents fail to match human performance , and that those suffering from representation collapse according to this metric fail to make any learning progress at all . 3.1 TARGET-FITTING CAPACITY . Neural networks trained with temporal difference learning objectives must solve a sequence of target prediction problems . Ideally , the network should be able to fit later targets as quickly and accurately as it is able to fit early targets . However , prior work suggests that using ‘ warm starts ’ , i.e . weights from a network trained on a different dataset or target function , can slow down training on new data points ( Ash & Adams , 2020 ) . We are therefore interested in studying whether this notion of interference may affect the ability of reinforcement learning agents to make learning progress . We begin by formally defining a notion of capacity loss which measures whether the network can quickly fit new targets , for example after a policy improvement step increases the expected reward obtained in a given state or after the target network is updated . Definition 1 ( Target-fitting capacity ) . Let PX 2 P ( X ) be some distribution over inputs X and PF a distribution over a family of functions F with domain X . Let N = ( g✓ , ✓0 ) represent the pairing of a neural network architecture with some initial parameters ✓0 , and O correspond to an optimization algorithm for supervised learning . We measure the capacity of N under the optimizer O to fit the data-generating distribution D = ( PX , PF ) as follows : C ( N , O , D ) = Ef⇠PF [ Ex⇠PX [ ( g✓0 ( x ) f ( x ) ) 2 ] ] where ✓0 = O ( ✓0 , PX , f ) . ( 3 ) This definition of capacity takes into account the interaction between the optimization algorithm and the initial parameters , and can be adapted to a broad range of function classes such as the network ’ s TD targets on the current dataset , the reward function on the environment , or randomlygenerated functions . The choice of function class is crucial to the notion of capacity measured . Using bootstrap targets from the network ’ s current parameters can identify networks which can not fit their current target function , but may reveal more about the complexity of the network output than the network ’ s capacity to fit novel targets . A network which can only output the zero function , for example , will attain very low Bellman error in a sparse-reward environment , but may not be able to fit more interesting value functions . In our evaluations , we will therefore consider a random class of functions which is independent of the current network parameters ; the effect of this choice is discussed further in Appendix B . To evaluate target-fitting capacity in deep RL agents , we sample target functions by randomly initializing neural networks with new parameters , and use the outputs of these networks as targets for regression . We then load initial parameters from an agent checkpoint at some time t , and regress on random network outputs over a fixed set of inputs sampled from the earliest available checkpoint ’ s replay buffer . This ensures that the same regression problem is being evaluated at every checkpoint . We then evaluate the mean squared error after training for fifty thousand steps . We observe that as training progresses agents ’ checkpoints on average get modestly worse at fitting these random targets in most environments ; due to space limitations we only show two representative environments where this phenomenon occurs in Figure 1 , and defer the full evaluation to Appendix C. While the resulting curves are somewhat noisy due to the randomness in the sampled target function , we do see consistent results across both the double DQN agent and the agent trained with an additional auxiliary loss . We now turn our attention to a less computationally expensive experimental setting where it is easier to obtain statistically robust results . We are particularly interested in understanding why capacity loss occurs . Two possible causes are immediate : the effect of bootstrapping , and the effect of sequential training . The effect of bootstrapping on capacity has been studied in other contexts ( Mobahi et al. , 2020 ; Kumar et al. , 2021 ) . We aim to isolate the effect of sequential prediction tasks on capacity loss . To minimize the potential for confounding factors to influence our results , we construct our toy iterative prediction problems on the MNIST data set , which consists of images of handwritten digits and corresponding labels , and manually construct a sequence of targets which the network must fit over the course of training . We first consider labels computed by a randomly initialized neural network f✓ : we transform input-label pairs ( x , y ) from the canonical MNIST dataset to ( x , f✓ ( x ) ) , where f✓ ( x ) is the network output . To generate a new task , we simply reinitialize the network ; our evaluations consist of 10 iterations of label-generation followed by a training period during which we run a gradient-based optimizer on the network starting from the parameters we obtained in the previous iteration . We further consider a ‘ sparse-reward ’ version of MNIST : for each of 10 iterations i , we use the label ŷi = [ y < i ] , where y is the true label of the image . For example , at the first iteration , all images are assigned label zero . At the second iteration , the images of the digit zero are assigned label one , while all other inputs retain the zero label . This continues until all inputs are assigned label one at the final iteration . We follow the same training procedure in both cases : optimizing the network for a fixed number of steps on one set of labels , then generating new labels and running the optimization algorithm again from the parameters obtained in the previous phase . In Figure 2 we see that most networks trained in these two experiments exhibit decreasing ability to fit later target functions under a fixed optimization budget . This effect is strongest in small networks with ReLU activations , suggesting that this capacity loss may be driven by saturated units and that this phenomenon will be easiest to detect in settings where the network architecture is not highly over-parameterized relative to the prediction task . The sparse reward setting is particularly intriguing : we do not expect to see a monotone increase in error as the later label functions correspond to ‘ easier ’ learning problems ( i.e . predicting the majority class will already yield reasonably low prediction error ) , but we do see that for equal difficulty , the network obtains greater error on the later target set than the earlier one , and this effect is significantly more pronounced than in the random labels tasks . This suggests that sparse reward signals can be particularly damaging to the ability of networks to fit new target functions .
Summary of paper: - The authors identify a problem of "capacity loss" during RL training with neural networks, this is the problem of agents gradually losing the ability to fit new functions while trainig. - The authors argue this is a key factor that hinders learning and is most prominent in sparse reward environments, propose 2 different measures of capacity loss and conduct empirical analysis to show this phenomenon exist in some Atari tasks. - The authors present a number of empirical analysis on this problem, and propose a simple regularization scheme to mitigate this issue, and presented some analysis on the effect of this scheme, giving interesting insights. - The proposed method improve performance especially on Montezuma's revenge when no specialized exploration techniques are used, supporting the paper's claims
SP:ad8e2fe49ecd290848c910422f8ba49924d31065
Understanding and Preventing Capacity Loss in Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning has achieved remarkable successes in a variety of environments ( Mnih et al. , 2015 ; Moravčı́k et al. , 2017 ; Silver et al. , 2017 ; Abreu et al. , 2019 ) , but the precise reasons for its successes largely remain mysterious . Existing algorithms are highly sensitive to hyperparameters and seemingly innocuous design choices , to the extent that even minor variations to state-of-the-art methods can fail to make learning progress on tasks originally solved with ease . These instabilities are particularly pronounced in sparse-reward environments , where even different random seeds of the same algorithm can attain dramatically different performance outcomes . In these settings , even if the agent has experienced the rewards necessary to learn a high-scoring policy , it will often fail to translate those rewards into successful policy improvements . This presents a stark contrast to supervised learning , where existing approaches are reasonably robust to small hyperparameter changes , random seeds , and GPU parallelisation libraries . Moreover , naive applications of supervised learning methods such as momentum-based optimization or data augmentation to the RL problem often require additional modification to yield performance improvements ( Bengio et al. , 2020 ; Raileanu et al. , 2020 ) . We hypothesize that the non-stationary prediction problems agents face in RL may be a driving force in the challenges described above . RL agents must solve a sequence of similar prediction problems as they iteratively improve their prediction accuracy and their policy ( Dabney et al. , 2021 ) , and solving each subproblem in this sequence is necessary to progress to the next subproblem . As shown in work on active learning , warm-starting a network by fitting similar data to that used in the downstream task can hurt the network ’ s final accuracy , even if this data is drawn from the same distribution ( Ash & Adams , 2020 ) . This suggests that the slowly-shifting input and target distributions RL agents face may be particularly ill-suited to function approximation by deep neural networks . Indeed , several prior works studying the effect of re-initializing network parameters in reinforcement learning have found this enables agents to break through plateaus and improve generalization performance ( Igl et al. , 2021 ; Fedus et al. , 2020 ) . The principal thesis of this paper is that over the course of training , deep RL agents lose some of their capacity to quickly fit new prediction tasks , and in extreme cases this capacity loss prevents the agent entirely from making learning progress . We present a rigorous empirical analysis of this phenomenon which considers both the ability of networks to learn new target functions via gradientbased optimization methods , and their ability to linearly disentangle states ’ feature representations . We confirm that agents ’ ability to fit new target functions declines over the course of training in several environments from the Atari suite ( Bellemare et al. , 2013 ) and non-stationary reward prediction tasks . We further find that the ability of representations to linearly distinguish different states , a proxy for their ability to represent certain functions , quickly diminishes in sparse-reward games , leading to representation collapse , where the feature outputs for every state in the environment inhabit a low-dimensional – or possibly even zero – subspace . Finally , we show evidence that representation collapse is a key factor in agents ’ failure to make learning progress in sparse-reward environments . We then propose a simple regularization technique , Initial Feature Regularization ( InFeR ) , to prevent representation collapse : regress a set of feature projection heads to their values at initialization . This method improves performance on a number of sparse-reward environments and also increases the measures of capacity we are interested in , preventing representation collapse in sparse-reward environments and improving target-fitting capacity in dense-reward environments . One striking take-away from our results is that agents trained on so-called ‘ hard exploration ’ games such as Montezuma ’ s Revenge can attain significant improvements over existing competitive baselines without using smart exploration algorithms . This suggests that the poor performance of deep RL agents in sparse-reward environments is not solely due to inadequate exploration , but rather also in part due to poor representation learning . Essentially , agents which are ‘ too good ’ at predicting the zero value function lose their ability to fit the non-zero targets necessary for policy improvement . We believe this has significant implications for how the community views the interplay of exploration and representation learning in sparse reward environments . 2 BACKGROUND . We consider the reinforcement learning problem wherein an agent seeks to maximize expected return in an MDP M = ( X , A , R , P , ) , where X denotes the state space , A the action space , R the reward function , P the transition probability function , and the discount factor . We will be primarily interested in value-based RL , where the objective is to learn the value function Q⇡ : X ⇥ A ! R associated with some ( possibly stochastic ) policy ⇡ : X ! P ( A ) , defined as Q⇡ ( x , a ) = E⇡ , P [ P1 k=0 kR ( xk , ak ) |x0 = x , a0 = a ] . In particular , we are interested in learning the value function associated with the optimal policy ⇡⇤ which maximizes the expected discounted sum of rewards from any state . In Q-Learning ( Watkins & Dayan , 1992 ) , the agent performs updates to minimize the distance between a predicted action-value function Q and the bootstrap target defined as T Q ( x , a ) = E [ R ( x0 , a0 ) + max a02A Q ( x1 , a 0 ) |x0 = x , a0 = a ] . ( 1 ) In most practical settings , updates are performed with respect to sampled transitions rather than on the entire state space . The target can be computed for a sampled transition ( xt , at , rt , xt+1 ) as T̂ Q ( xt , at ) = rt + maxa Q ( xt+1 , a ) . When a deep neural network is used as a function approximator ( the deep RL setting ) , Q is defined to be the output of a neural network with parameters ✓ , and updates are performed by gradient descent on sampled transitions ⌧ = ( xt , at , rt , xt+1 ) . A number of tricks are often used to improve stability : the sample-based objective is minimized following stochastic gradient descent based on minibatches sampled from a replay buffer of stored transitions , and a separate set of parameters ✓̄ is used to compute the targets Q✓̄ ( xt+1 , at+1 ) which is typically updated more slowly than the network ’ s online parameters . This yields the following loss function ( where ⌧ denotes the sampled transition ) : ` TD ( Q✓ , ⌧ ) = ( Rt+1 + max a0 Q✓̄ ( Xt+1 , a 0 ) Q✓ ( Xt , At ) ) 2 . ( 2 ) In this work we will be interested in how common variations on this basic learning objective shape agents ’ learning dynamics , in particular the dynamics of the learned representation , or features . We will refer to the outputs of the final hidden layer of the network ( i.e . the penultimate layer ) as its features , denoted ✓ ( x ) . Our choice of the penultimate layer is motivated by prior literature studying representations in RL ( Ghosh & Bellemare , 2020 ; Kumar et al. , 2021 ) , although many works studying representation learning consider the outputs of earlier layers as well . In general , the features of a neural network are defined to be the outputs of whatever layer is used to compute additional representation learning objectives . 3 CAPACITY LOSS . In this section we demonstrate conditions under which neural networks progressively lose their ability to quickly fit new targets when trained on sequences of prediction tasks including , but not limited to , those found in value-based RL . We find that the loss of this notion of capacity loss , which we refer to as target-fitting capacity , is particularly pronounced in sparse prediction tasks , where many of the target values the agent seeks to predict are zero . To study the effect of extreme capacity loss on performance in greater depth , we present a special case of the target-fitting capacity measure which is efficient to compute and has the intuitive interpretation of measuring the ability of the representation to linearly disentangle states . We find evidence that agents which have greater capacity according to this metric tend to achieve better performance in challenging environments from the Atari suite where agents fail to match human performance , and that those suffering from representation collapse according to this metric fail to make any learning progress at all . 3.1 TARGET-FITTING CAPACITY . Neural networks trained with temporal difference learning objectives must solve a sequence of target prediction problems . Ideally , the network should be able to fit later targets as quickly and accurately as it is able to fit early targets . However , prior work suggests that using ‘ warm starts ’ , i.e . weights from a network trained on a different dataset or target function , can slow down training on new data points ( Ash & Adams , 2020 ) . We are therefore interested in studying whether this notion of interference may affect the ability of reinforcement learning agents to make learning progress . We begin by formally defining a notion of capacity loss which measures whether the network can quickly fit new targets , for example after a policy improvement step increases the expected reward obtained in a given state or after the target network is updated . Definition 1 ( Target-fitting capacity ) . Let PX 2 P ( X ) be some distribution over inputs X and PF a distribution over a family of functions F with domain X . Let N = ( g✓ , ✓0 ) represent the pairing of a neural network architecture with some initial parameters ✓0 , and O correspond to an optimization algorithm for supervised learning . We measure the capacity of N under the optimizer O to fit the data-generating distribution D = ( PX , PF ) as follows : C ( N , O , D ) = Ef⇠PF [ Ex⇠PX [ ( g✓0 ( x ) f ( x ) ) 2 ] ] where ✓0 = O ( ✓0 , PX , f ) . ( 3 ) This definition of capacity takes into account the interaction between the optimization algorithm and the initial parameters , and can be adapted to a broad range of function classes such as the network ’ s TD targets on the current dataset , the reward function on the environment , or randomlygenerated functions . The choice of function class is crucial to the notion of capacity measured . Using bootstrap targets from the network ’ s current parameters can identify networks which can not fit their current target function , but may reveal more about the complexity of the network output than the network ’ s capacity to fit novel targets . A network which can only output the zero function , for example , will attain very low Bellman error in a sparse-reward environment , but may not be able to fit more interesting value functions . In our evaluations , we will therefore consider a random class of functions which is independent of the current network parameters ; the effect of this choice is discussed further in Appendix B . To evaluate target-fitting capacity in deep RL agents , we sample target functions by randomly initializing neural networks with new parameters , and use the outputs of these networks as targets for regression . We then load initial parameters from an agent checkpoint at some time t , and regress on random network outputs over a fixed set of inputs sampled from the earliest available checkpoint ’ s replay buffer . This ensures that the same regression problem is being evaluated at every checkpoint . We then evaluate the mean squared error after training for fifty thousand steps . We observe that as training progresses agents ’ checkpoints on average get modestly worse at fitting these random targets in most environments ; due to space limitations we only show two representative environments where this phenomenon occurs in Figure 1 , and defer the full evaluation to Appendix C. While the resulting curves are somewhat noisy due to the randomness in the sampled target function , we do see consistent results across both the double DQN agent and the agent trained with an additional auxiliary loss . We now turn our attention to a less computationally expensive experimental setting where it is easier to obtain statistically robust results . We are particularly interested in understanding why capacity loss occurs . Two possible causes are immediate : the effect of bootstrapping , and the effect of sequential training . The effect of bootstrapping on capacity has been studied in other contexts ( Mobahi et al. , 2020 ; Kumar et al. , 2021 ) . We aim to isolate the effect of sequential prediction tasks on capacity loss . To minimize the potential for confounding factors to influence our results , we construct our toy iterative prediction problems on the MNIST data set , which consists of images of handwritten digits and corresponding labels , and manually construct a sequence of targets which the network must fit over the course of training . We first consider labels computed by a randomly initialized neural network f✓ : we transform input-label pairs ( x , y ) from the canonical MNIST dataset to ( x , f✓ ( x ) ) , where f✓ ( x ) is the network output . To generate a new task , we simply reinitialize the network ; our evaluations consist of 10 iterations of label-generation followed by a training period during which we run a gradient-based optimizer on the network starting from the parameters we obtained in the previous iteration . We further consider a ‘ sparse-reward ’ version of MNIST : for each of 10 iterations i , we use the label ŷi = [ y < i ] , where y is the true label of the image . For example , at the first iteration , all images are assigned label zero . At the second iteration , the images of the digit zero are assigned label one , while all other inputs retain the zero label . This continues until all inputs are assigned label one at the final iteration . We follow the same training procedure in both cases : optimizing the network for a fixed number of steps on one set of labels , then generating new labels and running the optimization algorithm again from the parameters obtained in the previous phase . In Figure 2 we see that most networks trained in these two experiments exhibit decreasing ability to fit later target functions under a fixed optimization budget . This effect is strongest in small networks with ReLU activations , suggesting that this capacity loss may be driven by saturated units and that this phenomenon will be easiest to detect in settings where the network architecture is not highly over-parameterized relative to the prediction task . The sparse reward setting is particularly intriguing : we do not expect to see a monotone increase in error as the later label functions correspond to ‘ easier ’ learning problems ( i.e . predicting the majority class will already yield reasonably low prediction error ) , but we do see that for equal difficulty , the network obtains greater error on the later target set than the earlier one , and this effect is significantly more pronounced than in the random labels tasks . This suggests that sparse reward signals can be particularly damaging to the ability of networks to fit new target functions .
Summary: - Over course of training, deep RL agents experience "capacity loss", where networks are unable to quickly fit new functions. This problem is further exacerbated by non-stationary predictions (such as bootstrapping) over the course of training. - To prove this problem, the author runs two experiments (Atari and MNIST), and show that training error against a randomly-initialized network increases over time. They also define effective dimension (rank of feature space) and show that effective dimension is tightly correlated with performance. - The authors introduce INFER, which regularizes Q-value loss with error w.r. to randomly initialized network, and evaluate this on Atatri-57, showing most benefits in sparse reward environments (Montezuma's revenge)
SP:ad8e2fe49ecd290848c910422f8ba49924d31065
Reinforcement Learning under a Multi-agent Predictive State Representation Model: Method and Theory
1 INTRODUCTION . Real-world multi-agent systems are considered partially observable since agents do not have a complete perception of the environment states . The predictive state representation ( PSR ) ( Littman et al. , 2001 ) is a representation of the dynamic system state by a vector of predictions of tests conditioned on a history . The tests are sequences of actions and observations , which are true if and only if all the observations occur , given that all the actions taken and the histories are sequences of actions and observations recorded before . It records a sequence of actions and observations and focuses on observable quantities rather than the system ’ s dynamics . Therefore , compared with learning the hidden-state-based partially observable Markov decision process ( POMDP ) Kaelbling et al . ( 1998 ) models from observation data , learning PSR should be easier and less prone to local minimal problems ( Singh et al. , 2012 ) . In addition , in the cases where the moment-method is used to learn a model for controlled systems that incorporates actions , PSR is considered as a more general setting to reconstruct the structure of the dynamic system than POMDP ( Azizzadenesheli et al. , 2016 ; Hamilton , 2014 ) . Furthermore , ( Littman et al. , 2001 ; James & Singh , 2004 ; Singh et al. , 2012 ) showed that PSR can offer an alternative more compact state representation for POMDP models . Overall , PSR is considered a generalization of POMDP in terms of representation power and the development of learning algorithms . Due to the above benefits of PSR , it has been used as the basis of some model-based single-agent reinforcement learning ( James & Singh , 2004 ; Boots et al. , 2011 ; Hamilton et al. , 2014 ; Hefny et al. , 2018a ) . Moreover , the predictive states that act as sufficient statistics for the states of multiagent dynamic systems could potentially help multi-agent decision-making in the complicated , partially observable domains . However , there is no method for developing multi-agent predictive state representation ( MAPSR ) for multi-agent reinforcement learning ( MARL ) . Due to this reason , we focused on building an algorithm for learning the optimal policies by representing the multi-agent dynamic systems with the MAPSR . An existing algorithm by ( Chen et al. , 2020 ) provides a spectral framework for learning MAPSR using a tensor , with its dimensions representing the agents and joint history . A tensor decomposition is implemented to learn the model parameters . This type of algorithm avoids explicit estimation of the latent state and can get an unbiased estimation if an infinite amount of data is available . However , it is not easy to incorporate prior information such as sparsity or structure because each new source of information leads to new moments and a different and more complex set of equations to solve . ( Hefny et al. , 2015 ) represent the distributions in PSR via observable statistics and learn PSR by supervised learning , alleviating the above problem . Later , ( Hefny et al. , 2018a ) extend this method to develop a new one called predictive state controlled model that can represent the system model where the agents can affect the environment . Due to the trend of deep RL , ( Hefny et al. , 2018b ) developed an end-to-end policy learning method by using the states represented by a predictive state controlled model as the belief state to fit the policy function to train RL . Both the PSR and RL parameters are updated by using a combined loss objective . The PSR part maintains a sufficient representation of distributions under the partially observable environment , the deep RL algorithm brings efficiency for learning . The environment of MARL can be partially observable and always non-stationary ( one agent learning while the other agents ’ actions can influence the environment ) ( Bowling & Veloso , 2002 ) . Predictive state controlled model can model the prediction of systems states affected by actions ; if we design a state representation model for MARL environment that can predict the future observations of agents upon exerting future actions of other agents and conditioned on past histories , then the non-stationary environment caused by other agents learning can be modeled . Due to the above reason , we seek to develop a MARL-based PSR model and learning algorithm , which we call MAPSRL . It could potentially ameliorate both the problem of partially observable observations and non-stationarity by other agents ’ interaction for multi-agent decision making . The paper ’ s first goal is to develop a PSR model for MARL environment . In MARL settings , the distribution of observed observations is dependent on its actions and relevant to other agents and histories . So far , many works ( Ryu et al. , 2020 ; Liu et al. , 2020b ; Niu et al. , 2021 ) that take other agents ’ actions into consideration have been shown to achieve competitive performance . In order to consider the interactive relationship under the MAPSR , we introduce a dynamic interaction graph to characterize the “ neighborhoods ” of agents . Such a graph topology , which is often easy to obtain nowadays , enables us to encode the adjacency relationship of agents into our MAPSR model . We build our model under three common graphs , namely static complete graphs , static non-complete graphs , and dynamic graphs , covering as many real-world scenarios as possible . Under the existence of such a dynamic interaction graph , we build predictions of its observations by considering its neighbor ’ s actions for every agent . We call this primitive interactive predictions . Then an agent ’ s PSR will be formulated as a linear combination of those primitive interactive predictions . Due to the decentralized formulation , our model allows implementing the learning of the MAPSR on a single agent level while maintaining other agents ’ interactions through the encoding of the interactive graph topology . As set as our second goal , we analytically upper bound theL2-norm difference between the underlying true and learned predictive state representations , providing theoretical guarantees for the performance of our learning algorithm under the MAPSR model in all three graph settings . Our paper ’ s third goal is to develop an algorithm that integrates the MAPSR model to the MARL . We develop an online algorithm that simultaneously learns the MAPSR , and the agents ’ policies end-toend with a fully differentiable neural network structure . Our algorithm provides a new model-based MARL , and it has the flexibility to be extended to most of the offline MARL algorithms . We focus on the continuous action space , which is more practical and common to real-world applications such as robotic control . Finally , we test our algorithm through systematic numerical experiments on MAMujoCo robotic learning experiments ( de Witt et al. , 2020 ) and multi-agent particle learning environments ( Ryu et al. , 2020 ) , and compare our proposed method against two baselines as detailed in Section 6 . The results demonstrate the efficiency of our method . 2 RELATED WORKS . Partially Observable Environment . Real-world agents often experience situations that the observed signals are aliased and do not fully determine their state in the system . This is particularly true for multiple agents environments where agents have partial observability due to limited communication ( Oliehoek & Amato , 2016 ) . In accommodation to the partially observable environment , POMDP has been adopted by ( Kaelbling et al. , 1998 ) , and the algorithms ( Kaelbling et al. , 1998 ; Cassandra , 1998 ; Thrun , 1999 ; Pineau et al. , 2003 ; Poupart & Vlassis , 2008 ; Platt Jr et al. , 2010 ) for determining an optimal policy have shifted to using the probability distributions ( belief state ) over the state space instead of exact state space . In general , they have high complexity or suffer from local optima . Moreover , the most common POMDP policy learning assumes the agent has access to a priori knowledge of the system . The access to such prior knowledge has a premise that the agent has considerable domain knowledge ( Kaelbling et al. , 1998 ) . However , it is expected that the real-world agents learn the system model and thus a planning policy further without knowledge of the domain . Overview of PSR . ( Littman et al. , 2001 ; James & Singh , 2004 ) introduced the PSR over an expressive and robust framework for modeling dynamical systems and defined PSR as a representation of state by using a vector of predictions of fully observable quantities ( tests ) conditioned on past events ( histories ) . A predictive model is constructed directly from execution traces in the PSR framework , utilizing minimal prior information about the domain . The PSR paradigm subsumes POMDP as a special case ( Littman et al. , 2001 ) . PSR is considered much more compact than POMDP ( Aberdeen et al. , 2007 ) . The spectral learning method has been proved to show success for learning the PSR ( Boots et al. , 2011 ; Jiang et al. , 2018 ) . There are other classes of dynamical system learning algorithms that are based on likelihood-based optimization or sampling approaches ( Frigola et al. , 2013 ) , but they are prone to poor local optima . The spectral learning represents the estimated state by sufficient statistics of future observations and estimates the model parameters by method of moments . However , this line of algorithms is hard to incorporate prior information ( Hefny et al. , 2015 ) . Thus , ( Hefny et al. , 2015 ; 2018a ) introduce the supervised learning method to learn PSR and proves its convergence . Although many works study PSR in discrete action space ( Hsu et al. , 2012 ; Siddiqi et al. , 2010 ; Boots et al. , 2011 ) , ( Boots et al. , 2013 ) proposes Hilbert space embedding ( HSE ) -PSR to deal with continuous actions . ( Hefny et al. , 2018a ) uses an approximation of HSE-PSR by Random Fourier transform ( RFF ) and built a more principled generalization of PSR to deal with high dimensions . However , all of these studies aim for the single agent scenario . PSR and RL . The predictive states estimated by the PSR are considered as states in a fully observable Markov Decision Process so that the value function is learned on these states . This line of work has been done in the single-agent environment ( Boots & Gordon , 2010 ; Boots et al. , 2011 ; Hamilton et al. , 2014 ; Venkatraman et al. , 2017 ; Hefny et al. , 2018b ) . Especially , ( Hefny et al. , 2018b ) proposes the recurrent predictive state in the RNN network . Moreover , the learning PSR and policy functions are connected with the end-to-end training . MAPSR and MARL . MAPSR model is formulated by ( Chen et al. , 2020 ) and the model parameters are learnt by tensor decomposition . This formulation is aligned with the spectral algorithm , so it also has the same issue as the single-agent case . MARL algorithms have been developed to learn the Markov Game environment ( Lyu & Amato , 2020 ; Son et al. , 2019 ; Zhang et al. , 2019 ; Rashid et al. , 2018 ; Foerster et al. , 2018 ; Lowe et al. , 2017 ) . The partially observable states are pervasive in this environment , bringing non-stationarity to the learning algorithm ( Bowling & Veloso , 2002 ) so that the learning needs to consider the non-stationarity . Recent works propose more sophisticated deep MARL algorithms for multi-agent problems under the paradigm of centralized training with decentralized execution ( Zhou et al. , 2020 ; Sunehag et al. , 2017 ; Lowe et al. , 2017 ; Foerster et al. , 2018 ; Rashid et al. , 2018 ) . Other than their methods , our approach also accounts for the importance of macroscopic measures of underline systems . Also , providing a predictive state as a belief state rather than the partially observable observations can further help the agent learn . Like the single-agent case , we hope our method can further improve these algorithms .
The authors present a framework and method in which predictive state representations for multiple agents simultatneously acting and interacting within an environment. This is presented in a general way, where predictive states are Hilbert space operators which when applied to sequences of observations and actions appropriately predict the predictions of these state representations. The key advance in this work is to apply this existing PSR framework to networks of agents, with 3 types of agent network: static complete graph (all agents affect all others experience); static non-complete graph (only some agents affect one another); and dynamic non-complete graph (agents affect one another in a time varying way). A number of theoretical results are presented, including PAC bounds for the approximators in the framework. The authors then present two closely related methods to learn policies alongside these multi agent PSRs in an online way. The first MAPSRL-1 is akin to the independent actor critic (Foerster et al., 2017) and thus may suffer from the apparent non-stationarity of the environment from the perspective of any one agent. MAPSRL-2 addresses this by incorporating the PSR information from other agents into the policy gradient update. The paper presents a series of experiments based on environments encoded in the OpenAI Gym MAMujoco system. These are environments presented in previous papers and there are a broad selection of these.
SP:791463405deae8b2ebe7e98d38022bfa866d02cd
Reinforcement Learning under a Multi-agent Predictive State Representation Model: Method and Theory
1 INTRODUCTION . Real-world multi-agent systems are considered partially observable since agents do not have a complete perception of the environment states . The predictive state representation ( PSR ) ( Littman et al. , 2001 ) is a representation of the dynamic system state by a vector of predictions of tests conditioned on a history . The tests are sequences of actions and observations , which are true if and only if all the observations occur , given that all the actions taken and the histories are sequences of actions and observations recorded before . It records a sequence of actions and observations and focuses on observable quantities rather than the system ’ s dynamics . Therefore , compared with learning the hidden-state-based partially observable Markov decision process ( POMDP ) Kaelbling et al . ( 1998 ) models from observation data , learning PSR should be easier and less prone to local minimal problems ( Singh et al. , 2012 ) . In addition , in the cases where the moment-method is used to learn a model for controlled systems that incorporates actions , PSR is considered as a more general setting to reconstruct the structure of the dynamic system than POMDP ( Azizzadenesheli et al. , 2016 ; Hamilton , 2014 ) . Furthermore , ( Littman et al. , 2001 ; James & Singh , 2004 ; Singh et al. , 2012 ) showed that PSR can offer an alternative more compact state representation for POMDP models . Overall , PSR is considered a generalization of POMDP in terms of representation power and the development of learning algorithms . Due to the above benefits of PSR , it has been used as the basis of some model-based single-agent reinforcement learning ( James & Singh , 2004 ; Boots et al. , 2011 ; Hamilton et al. , 2014 ; Hefny et al. , 2018a ) . Moreover , the predictive states that act as sufficient statistics for the states of multiagent dynamic systems could potentially help multi-agent decision-making in the complicated , partially observable domains . However , there is no method for developing multi-agent predictive state representation ( MAPSR ) for multi-agent reinforcement learning ( MARL ) . Due to this reason , we focused on building an algorithm for learning the optimal policies by representing the multi-agent dynamic systems with the MAPSR . An existing algorithm by ( Chen et al. , 2020 ) provides a spectral framework for learning MAPSR using a tensor , with its dimensions representing the agents and joint history . A tensor decomposition is implemented to learn the model parameters . This type of algorithm avoids explicit estimation of the latent state and can get an unbiased estimation if an infinite amount of data is available . However , it is not easy to incorporate prior information such as sparsity or structure because each new source of information leads to new moments and a different and more complex set of equations to solve . ( Hefny et al. , 2015 ) represent the distributions in PSR via observable statistics and learn PSR by supervised learning , alleviating the above problem . Later , ( Hefny et al. , 2018a ) extend this method to develop a new one called predictive state controlled model that can represent the system model where the agents can affect the environment . Due to the trend of deep RL , ( Hefny et al. , 2018b ) developed an end-to-end policy learning method by using the states represented by a predictive state controlled model as the belief state to fit the policy function to train RL . Both the PSR and RL parameters are updated by using a combined loss objective . The PSR part maintains a sufficient representation of distributions under the partially observable environment , the deep RL algorithm brings efficiency for learning . The environment of MARL can be partially observable and always non-stationary ( one agent learning while the other agents ’ actions can influence the environment ) ( Bowling & Veloso , 2002 ) . Predictive state controlled model can model the prediction of systems states affected by actions ; if we design a state representation model for MARL environment that can predict the future observations of agents upon exerting future actions of other agents and conditioned on past histories , then the non-stationary environment caused by other agents learning can be modeled . Due to the above reason , we seek to develop a MARL-based PSR model and learning algorithm , which we call MAPSRL . It could potentially ameliorate both the problem of partially observable observations and non-stationarity by other agents ’ interaction for multi-agent decision making . The paper ’ s first goal is to develop a PSR model for MARL environment . In MARL settings , the distribution of observed observations is dependent on its actions and relevant to other agents and histories . So far , many works ( Ryu et al. , 2020 ; Liu et al. , 2020b ; Niu et al. , 2021 ) that take other agents ’ actions into consideration have been shown to achieve competitive performance . In order to consider the interactive relationship under the MAPSR , we introduce a dynamic interaction graph to characterize the “ neighborhoods ” of agents . Such a graph topology , which is often easy to obtain nowadays , enables us to encode the adjacency relationship of agents into our MAPSR model . We build our model under three common graphs , namely static complete graphs , static non-complete graphs , and dynamic graphs , covering as many real-world scenarios as possible . Under the existence of such a dynamic interaction graph , we build predictions of its observations by considering its neighbor ’ s actions for every agent . We call this primitive interactive predictions . Then an agent ’ s PSR will be formulated as a linear combination of those primitive interactive predictions . Due to the decentralized formulation , our model allows implementing the learning of the MAPSR on a single agent level while maintaining other agents ’ interactions through the encoding of the interactive graph topology . As set as our second goal , we analytically upper bound theL2-norm difference between the underlying true and learned predictive state representations , providing theoretical guarantees for the performance of our learning algorithm under the MAPSR model in all three graph settings . Our paper ’ s third goal is to develop an algorithm that integrates the MAPSR model to the MARL . We develop an online algorithm that simultaneously learns the MAPSR , and the agents ’ policies end-toend with a fully differentiable neural network structure . Our algorithm provides a new model-based MARL , and it has the flexibility to be extended to most of the offline MARL algorithms . We focus on the continuous action space , which is more practical and common to real-world applications such as robotic control . Finally , we test our algorithm through systematic numerical experiments on MAMujoCo robotic learning experiments ( de Witt et al. , 2020 ) and multi-agent particle learning environments ( Ryu et al. , 2020 ) , and compare our proposed method against two baselines as detailed in Section 6 . The results demonstrate the efficiency of our method . 2 RELATED WORKS . Partially Observable Environment . Real-world agents often experience situations that the observed signals are aliased and do not fully determine their state in the system . This is particularly true for multiple agents environments where agents have partial observability due to limited communication ( Oliehoek & Amato , 2016 ) . In accommodation to the partially observable environment , POMDP has been adopted by ( Kaelbling et al. , 1998 ) , and the algorithms ( Kaelbling et al. , 1998 ; Cassandra , 1998 ; Thrun , 1999 ; Pineau et al. , 2003 ; Poupart & Vlassis , 2008 ; Platt Jr et al. , 2010 ) for determining an optimal policy have shifted to using the probability distributions ( belief state ) over the state space instead of exact state space . In general , they have high complexity or suffer from local optima . Moreover , the most common POMDP policy learning assumes the agent has access to a priori knowledge of the system . The access to such prior knowledge has a premise that the agent has considerable domain knowledge ( Kaelbling et al. , 1998 ) . However , it is expected that the real-world agents learn the system model and thus a planning policy further without knowledge of the domain . Overview of PSR . ( Littman et al. , 2001 ; James & Singh , 2004 ) introduced the PSR over an expressive and robust framework for modeling dynamical systems and defined PSR as a representation of state by using a vector of predictions of fully observable quantities ( tests ) conditioned on past events ( histories ) . A predictive model is constructed directly from execution traces in the PSR framework , utilizing minimal prior information about the domain . The PSR paradigm subsumes POMDP as a special case ( Littman et al. , 2001 ) . PSR is considered much more compact than POMDP ( Aberdeen et al. , 2007 ) . The spectral learning method has been proved to show success for learning the PSR ( Boots et al. , 2011 ; Jiang et al. , 2018 ) . There are other classes of dynamical system learning algorithms that are based on likelihood-based optimization or sampling approaches ( Frigola et al. , 2013 ) , but they are prone to poor local optima . The spectral learning represents the estimated state by sufficient statistics of future observations and estimates the model parameters by method of moments . However , this line of algorithms is hard to incorporate prior information ( Hefny et al. , 2015 ) . Thus , ( Hefny et al. , 2015 ; 2018a ) introduce the supervised learning method to learn PSR and proves its convergence . Although many works study PSR in discrete action space ( Hsu et al. , 2012 ; Siddiqi et al. , 2010 ; Boots et al. , 2011 ) , ( Boots et al. , 2013 ) proposes Hilbert space embedding ( HSE ) -PSR to deal with continuous actions . ( Hefny et al. , 2018a ) uses an approximation of HSE-PSR by Random Fourier transform ( RFF ) and built a more principled generalization of PSR to deal with high dimensions . However , all of these studies aim for the single agent scenario . PSR and RL . The predictive states estimated by the PSR are considered as states in a fully observable Markov Decision Process so that the value function is learned on these states . This line of work has been done in the single-agent environment ( Boots & Gordon , 2010 ; Boots et al. , 2011 ; Hamilton et al. , 2014 ; Venkatraman et al. , 2017 ; Hefny et al. , 2018b ) . Especially , ( Hefny et al. , 2018b ) proposes the recurrent predictive state in the RNN network . Moreover , the learning PSR and policy functions are connected with the end-to-end training . MAPSR and MARL . MAPSR model is formulated by ( Chen et al. , 2020 ) and the model parameters are learnt by tensor decomposition . This formulation is aligned with the spectral algorithm , so it also has the same issue as the single-agent case . MARL algorithms have been developed to learn the Markov Game environment ( Lyu & Amato , 2020 ; Son et al. , 2019 ; Zhang et al. , 2019 ; Rashid et al. , 2018 ; Foerster et al. , 2018 ; Lowe et al. , 2017 ) . The partially observable states are pervasive in this environment , bringing non-stationarity to the learning algorithm ( Bowling & Veloso , 2002 ) so that the learning needs to consider the non-stationarity . Recent works propose more sophisticated deep MARL algorithms for multi-agent problems under the paradigm of centralized training with decentralized execution ( Zhou et al. , 2020 ; Sunehag et al. , 2017 ; Lowe et al. , 2017 ; Foerster et al. , 2018 ; Rashid et al. , 2018 ) . Other than their methods , our approach also accounts for the importance of macroscopic measures of underline systems . Also , providing a predictive state as a belief state rather than the partially observable observations can further help the agent learn . Like the single-agent case , we hope our method can further improve these algorithms .
The paper introduces a predictive state representation (PSR)-based MARL framework. The framework uses a graph representation to model the interactions between agents. Performance bounds are given for the learned predictive state representation. With the MAPSR, individual policies are trained by replacing the partial observation o with PSR Q. The experiments results show the advantage of the proposed method compared with the baselines experimented in the paper.
SP:791463405deae8b2ebe7e98d38022bfa866d02cd
Variational Neural Cellular Automata
1 INTRODUCTION . The process of cellular growth and differentiation is capable of creating an astonishing breadth of form and function , filling every conceivable niche in our ecosystem . Organisms range from complex multi-cellular organisms like trees , birds , and humans to tiny microorganisms living near hydrothermal vents in hot , toxic water at immense pressure . All these incredibly diverse organisms are the result of the same generative process of cellular growth and differentiation . Cellular Automata ( CA ) are computational systems inspired by this process of cellular growth and differentiation , where ” cells ” iteratively update their state based on the state of their neighbor cells and the rules of the CA . Even with simple rules , CA can exhibit complex and surprising behavior — with just four simple rules , Conway ’ s Game of Life is Turing complete . Neural Cellular Automata ( NCA ) are CA where the cell states are vectors , and the rules of the CA are parameterized and learned by neural networks ( Mordvintsev et al. , 2020 ; Nichele et al. , 2017 ; Stanley & Miikkulainen , 2003 ; Wulff & Hertz , 1992 ) . NCAs have been shown to learn to generate images , 3D structures , and even functional artifacts that are capable of regenerating when damaged ( Mordvintsev et al. , 2020 ; Sudhakaran et al. , 2021 ) . While these results are impressive , the NCAs can only generate ( and regenerate ) the single artifact it is trained on , lacking the diverse generative properties of current probabilistic generative models . In this paper , we introduce the VNCA , an NCA based architecture that addresses these limitation while only relying on local communication and self-organization . Generative modeling is a fundamental task in machine learning , and several classes of methods have been proposed . Probabilistic generative models are an attractive class of models that directly define a distribution over the data p ( x ) , which enable sampling and computing ( at least approximately ) likelihoods of observed data . The average likelihood on test data can then be compared between models , which enables fair comparison between generative models . The Variational Auto-Encoder ( VAE ) is a seminal probabilistic generative model , which models the data using a latent variable model , such that p ( x ) = ∫ z pθ ( x|z ) p ( z ) , where p ( z ) is a fixed prior and pθ ( x|z ) is a learned decoder ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . The parameters of the model is learned by maximizing the Evidence Lower Bound ( ELBO ) , a lower bound on log p ( x ) , which can be efficiently computed using amortized variational inference ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . On a high level , our proposed generative model combines NCAs with VAEs , by using a NCA as the decoder in a VAE . We perform experiments with a standard NCA decoder and a novel NCA architecture , which duplicates all cells every M steps , inspired by cell mitosis . This results in better generative modeling performance and has the computational benefit that the VNCA only computes cell updates for the living cells at each step , which are relatively few early in growth . While our model is inspired by the biological process of cellular growth and differentiation , it is not intended to be an accurate model of this process and is naturally constrained by what we can efficiently compute . Other works have explored similar directions . The VAE-NCA proposed in Chen & Wang ( 2020 ) , is actually , despite the name , not a VAE since it does not define a generative model or use variational inference . Rather it is an auto-encoder that decodes a set of weights , which parameterize a NCA that reconstructs images . NCAM ( Ruiz et al. , 2020 ) similarly uses an auto-encoder to decode weights for a NCA , which then generates images . In contrast to both of these , our method is a generative model , uses a single learned NCA , and samples the initial state of the seed cells from a prior p ( z ) . StampCA ( Frans , 2021 ) also learns an auto-encoder but similarly encodes the initial hidden NCA state of a central cell . None of these are generative models , in the sense that it ’ s not possible to sample data from them , nor do they assign likelihoods to samples . While previous works all show impressive reconstructions , it is impossible to evaluate how good generative models they really are . In contrast , we aim to offer a fair and honest evaluation of the VNCA as a generative model . Graph Neural Networks ( GNNs ) can be seen as a generalization of the local-only communication in NCA , where the grid neighborhood is relaxed into an arbitrary graph neighborhood ( Grattarola et al. , 2021 ) . GNNs compute vector-valued messages along the edges of the graph that are accumulated at the nodes , using a shared function among all nodes and edges . GNNs have been successfully used to model molecular properties ( Gilmer et al. , 2017 ) , reasoning about objects and their interactions ( Santoro et al. , 2017 ) , and learning to control self-assembling morphologies ( Pathak et al. , 2019 ) . Powerful generative image models have been proposed based on the variational auto-encoder framework . A common distinction is whether the decoder is auto-regressive or not , i.e. , whether the decoder conditions its outputs on previous outputs , usually those above and to the left of the current pixel ( Van den Oord et al. , 2016 ; Salimans et al. , 2017 ) . Auto-regressive decoders are so effective at modelling p ( x ) directly that they have the tendency to ignore the latent codes thus failing to reconstruct images well ( Alemi et al. , 2018 ) . Additionally , they are expensive to sample from since sampling must be done one pixel at a time . Our decoder is not auto-regressive , thus cheaper to sample from , and more similar to e.g. , BIVA ( Maaløe et al. , 2019 ) or NVAE ( Vahdat & Kautz , 2020 ) . Contrary to BIVA , NVAE and other similar deep convolution-based VAEs , our VNCA defines a relatively simple decoder function that only consider the immediate neighborhood of a cell ( pixel ) at each step and is applied iteratively over a number of steps . The VNCA thus aims to learns a self-organising generative process . NCAs and self-organizing systems in general , represent an exciting research direction . The repeated application of a simple function that only relies on local communication lends itself well to a distributed leaderless computation paradigm , useful in , for instance , swarm robotics ( Rubenstein et al. , 2012 ) . Additionally , such self-organizing systems are often inherently robust to perturbations ( Mordvintsev et al. , 2020 ; Najarro & Risi , 2020 ; Tang & Ha , 2021 ; Sudhakaran et al. , 2021 ) . In the VNCA , we show that this robustness allows us to set a large fraction of the cells ’ states to zero and recover almost perfectly by additional iterations of growth ( Fig . 1 , right ) . By introducing an NCA that is a proper generative probabilistic model , we hope to further spur the development of methods at the intersection of artificial life and generative models . 2 VARIATIONAL NEURAL CELLULAR AUTOMATA . The VNCA defines a generative latent variable model with z ∼ p ( z ) and x ∼ pθ ( x|z ) , where p ( z ) = N ( z|µ = 0 , Σ = I ) is a Gaussian with zero mean and diagonal co-variance and pθ ( x|z ) is a learned decoder , with parameters θ . The model is trained by maximizing the evidence lower bound ( ELBO ) , log p ( x ) −DKL ( qφ ( z|x ) ‖ p ( z|x ) ) = −DKL ( qφ ( z|x ) ‖ p ( z ) ) + Ez∼qφ ( z|x ) log pθ ( x|z ) , where , qφ ( z|x ) is a learned encoder , with parameters φ , which learns to perform amortized variational inference . Since DKL ≥ 0 , the right hand side is a lower bound on log p ( x ) and increasing it either increases log p ( x ) or decreases DKL ( qφ ( z|x ) ‖ p ( z|x ) ) , which is how closely the amortized variational inference matches the true unknown posterior p ( z|x ) . By using the reparameterization trick , the sampling , z ∼ qφ ( z|x ) , is differentiable , and both φ and θ can be learned efficiently with stochastic gradient ascent ( Kingma & Welling , 2013 ) . The DKL term on the right hand side can be weighted with a parameter β to control whether the VAE should prioritize better reconstructions ( β < 1 ) , or better samples ( β > 1 ) ( Higgins et al. , 2016 ) . For β > 1 this is still a ( looser ) lower bound on log p ( x ) . The decoder of the generative process , pθ ( x|z ) , is based on a NCA ( Fig . 2 ) . The NCA defines a recurrent computation over vector-valued ” cells ” in a grid . At step t of the NCA , the cells compute an additive update to their state , based only on the state of their neighbor cells in a 3× 3 neighborhood , zi , t = zi , t−1 + uθ ( { zj , t−1 } j∈N ( i ) ) , ( 1 ) where uθ is a learned update function , index i denote a single cell and N ( i ) denotes the indexes of the 3 × 3 neighborhood of cell i , including i . All cells are updated in parallel . In practice , uθ is efficiently implemented using a Convolutional Neural Network ( CNN ) ( Gilpin , 2019 ) with a single 3 × 3 filter followed by a number of 1 × 1 filters and non-linearities . The initial grid z0 consists of a single sample from the latent space repeated in a 2× 2 grid . A traditional NCA defines whether a cell is alive or dead based on the cell state and its neighbors ’ cell states ( Mordvintsev et al. , 2020 ) . This allows the NCA to “ grow ” from a small initial seed of alive cells . Our NCA uses a different approach inspired by cell mitosis . Every M steps of regular NCA updates all the cells duplicate by creating new cells initialized to their own current state to the right and below themselves , “ pushing ” the existing cells out of the way as they do so . This is efficiently implemented using a “ nearest ” type image rescaling operation ( Fig . 2 , right ) . After K doubling and M ( K + 1 ) steps of NCA updates , the final cell states zT condition the parameters of the likelihood distribution . For RGB images , we use a discrete logistic likelihood with L mixtures ( Salimans et al. , 2017 ) , such that the 10L first channels are the parameters of the discrete logistic mixture1 and for binary images a Bernoulli likelihood with the first channel of each cell being log p. The update function is a single 3×3 convolution , followed by four residual blocks ( He et al. , 2016 ) . Each block consists of a 1 × 1 convolution , Exponential Linear Unit ( ELU ) non-linearity ( Clevert et al. , 2015 ) and another 1× 1 convolution . Finally , a single 1× 1 convolution maps to the cell state size . This last convolution layers ’ weights and biases are initialized to zero to prevent the recurrent computation from overflowing . The number of channels for all convolutional layers , the size of the latent space , and the cell state are all 256 . The total number of parameters in the NCA decoder is approximately 1.2M . Since we are primarily interested in examining the properties of the NCA decoder , the encoder qφ ( z|x ) is a fairly standard deep convolutional network . It consists of a single layer of 5 × 5 con- 1We use the implementation from https : //github.com/vlievin/biva-pytorch volution with 32 channels followed by four layers of 5× 5 convolution with stride 2 , where each of these layers has twice the number of channels as the previous layer . Finally , the down-scaled image is flattened and passed through a dense layer which maps to twice the latent space dimensionality . The first half encodes the mean and the second half the log-variance of a Gaussian . All convolutional layers are followed by ELU non-linearities . For a detailed model definition , see the appendix .
This paper introduces a variational generative model based on Neural Cellular Automata (NCA). The model is called the Variational NCA (VNCA). The VNCA is designed for images: - The encoder is a typical convolutional neural network. - The decoder is an NCA that iteratively refines the image, alternating convolutions and upsampling up to the desired image size. The upsampling process is loosely inspired by mitosis in living cells. The authors perform morphogenesis experiments on three datasets: MNIST, Noto Emoji, and CelebA. The results are good on MNIST, less so on the other two datasets, although there is clear evidence that the model can learn to generate meaningful images. The authors also perform an experiment to see if the VNCA is robust to perturbations (occlusions) and show that the model has a reasonable degree of robustness even without ever seeing any perturbations at training time.
SP:92b53426c0008d9890df2c2213da536c132b1046
Variational Neural Cellular Automata
1 INTRODUCTION . The process of cellular growth and differentiation is capable of creating an astonishing breadth of form and function , filling every conceivable niche in our ecosystem . Organisms range from complex multi-cellular organisms like trees , birds , and humans to tiny microorganisms living near hydrothermal vents in hot , toxic water at immense pressure . All these incredibly diverse organisms are the result of the same generative process of cellular growth and differentiation . Cellular Automata ( CA ) are computational systems inspired by this process of cellular growth and differentiation , where ” cells ” iteratively update their state based on the state of their neighbor cells and the rules of the CA . Even with simple rules , CA can exhibit complex and surprising behavior — with just four simple rules , Conway ’ s Game of Life is Turing complete . Neural Cellular Automata ( NCA ) are CA where the cell states are vectors , and the rules of the CA are parameterized and learned by neural networks ( Mordvintsev et al. , 2020 ; Nichele et al. , 2017 ; Stanley & Miikkulainen , 2003 ; Wulff & Hertz , 1992 ) . NCAs have been shown to learn to generate images , 3D structures , and even functional artifacts that are capable of regenerating when damaged ( Mordvintsev et al. , 2020 ; Sudhakaran et al. , 2021 ) . While these results are impressive , the NCAs can only generate ( and regenerate ) the single artifact it is trained on , lacking the diverse generative properties of current probabilistic generative models . In this paper , we introduce the VNCA , an NCA based architecture that addresses these limitation while only relying on local communication and self-organization . Generative modeling is a fundamental task in machine learning , and several classes of methods have been proposed . Probabilistic generative models are an attractive class of models that directly define a distribution over the data p ( x ) , which enable sampling and computing ( at least approximately ) likelihoods of observed data . The average likelihood on test data can then be compared between models , which enables fair comparison between generative models . The Variational Auto-Encoder ( VAE ) is a seminal probabilistic generative model , which models the data using a latent variable model , such that p ( x ) = ∫ z pθ ( x|z ) p ( z ) , where p ( z ) is a fixed prior and pθ ( x|z ) is a learned decoder ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . The parameters of the model is learned by maximizing the Evidence Lower Bound ( ELBO ) , a lower bound on log p ( x ) , which can be efficiently computed using amortized variational inference ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . On a high level , our proposed generative model combines NCAs with VAEs , by using a NCA as the decoder in a VAE . We perform experiments with a standard NCA decoder and a novel NCA architecture , which duplicates all cells every M steps , inspired by cell mitosis . This results in better generative modeling performance and has the computational benefit that the VNCA only computes cell updates for the living cells at each step , which are relatively few early in growth . While our model is inspired by the biological process of cellular growth and differentiation , it is not intended to be an accurate model of this process and is naturally constrained by what we can efficiently compute . Other works have explored similar directions . The VAE-NCA proposed in Chen & Wang ( 2020 ) , is actually , despite the name , not a VAE since it does not define a generative model or use variational inference . Rather it is an auto-encoder that decodes a set of weights , which parameterize a NCA that reconstructs images . NCAM ( Ruiz et al. , 2020 ) similarly uses an auto-encoder to decode weights for a NCA , which then generates images . In contrast to both of these , our method is a generative model , uses a single learned NCA , and samples the initial state of the seed cells from a prior p ( z ) . StampCA ( Frans , 2021 ) also learns an auto-encoder but similarly encodes the initial hidden NCA state of a central cell . None of these are generative models , in the sense that it ’ s not possible to sample data from them , nor do they assign likelihoods to samples . While previous works all show impressive reconstructions , it is impossible to evaluate how good generative models they really are . In contrast , we aim to offer a fair and honest evaluation of the VNCA as a generative model . Graph Neural Networks ( GNNs ) can be seen as a generalization of the local-only communication in NCA , where the grid neighborhood is relaxed into an arbitrary graph neighborhood ( Grattarola et al. , 2021 ) . GNNs compute vector-valued messages along the edges of the graph that are accumulated at the nodes , using a shared function among all nodes and edges . GNNs have been successfully used to model molecular properties ( Gilmer et al. , 2017 ) , reasoning about objects and their interactions ( Santoro et al. , 2017 ) , and learning to control self-assembling morphologies ( Pathak et al. , 2019 ) . Powerful generative image models have been proposed based on the variational auto-encoder framework . A common distinction is whether the decoder is auto-regressive or not , i.e. , whether the decoder conditions its outputs on previous outputs , usually those above and to the left of the current pixel ( Van den Oord et al. , 2016 ; Salimans et al. , 2017 ) . Auto-regressive decoders are so effective at modelling p ( x ) directly that they have the tendency to ignore the latent codes thus failing to reconstruct images well ( Alemi et al. , 2018 ) . Additionally , they are expensive to sample from since sampling must be done one pixel at a time . Our decoder is not auto-regressive , thus cheaper to sample from , and more similar to e.g. , BIVA ( Maaløe et al. , 2019 ) or NVAE ( Vahdat & Kautz , 2020 ) . Contrary to BIVA , NVAE and other similar deep convolution-based VAEs , our VNCA defines a relatively simple decoder function that only consider the immediate neighborhood of a cell ( pixel ) at each step and is applied iteratively over a number of steps . The VNCA thus aims to learns a self-organising generative process . NCAs and self-organizing systems in general , represent an exciting research direction . The repeated application of a simple function that only relies on local communication lends itself well to a distributed leaderless computation paradigm , useful in , for instance , swarm robotics ( Rubenstein et al. , 2012 ) . Additionally , such self-organizing systems are often inherently robust to perturbations ( Mordvintsev et al. , 2020 ; Najarro & Risi , 2020 ; Tang & Ha , 2021 ; Sudhakaran et al. , 2021 ) . In the VNCA , we show that this robustness allows us to set a large fraction of the cells ’ states to zero and recover almost perfectly by additional iterations of growth ( Fig . 1 , right ) . By introducing an NCA that is a proper generative probabilistic model , we hope to further spur the development of methods at the intersection of artificial life and generative models . 2 VARIATIONAL NEURAL CELLULAR AUTOMATA . The VNCA defines a generative latent variable model with z ∼ p ( z ) and x ∼ pθ ( x|z ) , where p ( z ) = N ( z|µ = 0 , Σ = I ) is a Gaussian with zero mean and diagonal co-variance and pθ ( x|z ) is a learned decoder , with parameters θ . The model is trained by maximizing the evidence lower bound ( ELBO ) , log p ( x ) −DKL ( qφ ( z|x ) ‖ p ( z|x ) ) = −DKL ( qφ ( z|x ) ‖ p ( z ) ) + Ez∼qφ ( z|x ) log pθ ( x|z ) , where , qφ ( z|x ) is a learned encoder , with parameters φ , which learns to perform amortized variational inference . Since DKL ≥ 0 , the right hand side is a lower bound on log p ( x ) and increasing it either increases log p ( x ) or decreases DKL ( qφ ( z|x ) ‖ p ( z|x ) ) , which is how closely the amortized variational inference matches the true unknown posterior p ( z|x ) . By using the reparameterization trick , the sampling , z ∼ qφ ( z|x ) , is differentiable , and both φ and θ can be learned efficiently with stochastic gradient ascent ( Kingma & Welling , 2013 ) . The DKL term on the right hand side can be weighted with a parameter β to control whether the VAE should prioritize better reconstructions ( β < 1 ) , or better samples ( β > 1 ) ( Higgins et al. , 2016 ) . For β > 1 this is still a ( looser ) lower bound on log p ( x ) . The decoder of the generative process , pθ ( x|z ) , is based on a NCA ( Fig . 2 ) . The NCA defines a recurrent computation over vector-valued ” cells ” in a grid . At step t of the NCA , the cells compute an additive update to their state , based only on the state of their neighbor cells in a 3× 3 neighborhood , zi , t = zi , t−1 + uθ ( { zj , t−1 } j∈N ( i ) ) , ( 1 ) where uθ is a learned update function , index i denote a single cell and N ( i ) denotes the indexes of the 3 × 3 neighborhood of cell i , including i . All cells are updated in parallel . In practice , uθ is efficiently implemented using a Convolutional Neural Network ( CNN ) ( Gilpin , 2019 ) with a single 3 × 3 filter followed by a number of 1 × 1 filters and non-linearities . The initial grid z0 consists of a single sample from the latent space repeated in a 2× 2 grid . A traditional NCA defines whether a cell is alive or dead based on the cell state and its neighbors ’ cell states ( Mordvintsev et al. , 2020 ) . This allows the NCA to “ grow ” from a small initial seed of alive cells . Our NCA uses a different approach inspired by cell mitosis . Every M steps of regular NCA updates all the cells duplicate by creating new cells initialized to their own current state to the right and below themselves , “ pushing ” the existing cells out of the way as they do so . This is efficiently implemented using a “ nearest ” type image rescaling operation ( Fig . 2 , right ) . After K doubling and M ( K + 1 ) steps of NCA updates , the final cell states zT condition the parameters of the likelihood distribution . For RGB images , we use a discrete logistic likelihood with L mixtures ( Salimans et al. , 2017 ) , such that the 10L first channels are the parameters of the discrete logistic mixture1 and for binary images a Bernoulli likelihood with the first channel of each cell being log p. The update function is a single 3×3 convolution , followed by four residual blocks ( He et al. , 2016 ) . Each block consists of a 1 × 1 convolution , Exponential Linear Unit ( ELU ) non-linearity ( Clevert et al. , 2015 ) and another 1× 1 convolution . Finally , a single 1× 1 convolution maps to the cell state size . This last convolution layers ’ weights and biases are initialized to zero to prevent the recurrent computation from overflowing . The number of channels for all convolutional layers , the size of the latent space , and the cell state are all 256 . The total number of parameters in the NCA decoder is approximately 1.2M . Since we are primarily interested in examining the properties of the NCA decoder , the encoder qφ ( z|x ) is a fairly standard deep convolutional network . It consists of a single layer of 5 × 5 con- 1We use the implementation from https : //github.com/vlievin/biva-pytorch volution with 32 channels followed by four layers of 5× 5 convolution with stride 2 , where each of these layers has twice the number of channels as the previous layer . Finally , the down-scaled image is flattened and passed through a dense layer which maps to twice the latent space dimensionality . The first half encodes the mean and the second half the log-variance of a Gaussian . All convolutional layers are followed by ELU non-linearities . For a detailed model definition , see the appendix .
This paper proposes variational extension of Neural Cellular Automata for image generation. It performs experiments on MNIST, Noto Emoji and CelebA. The likelihood results are shown to be significantly behind SOTA on CelebA and also behind on other datasets. The paper provides qualitative analysis of the self-organized generation process and shows robustness to early-stage perturbations of latents.
SP:92b53426c0008d9890df2c2213da536c132b1046
EigenGame Unloaded: When playing games is better than optimizing
1 INTRODUCTION . Large , high-dimensional datasets containing billions of samples are commonplace . Dimensionality reduction to extract the most informative features is an important step in the data processing pipeline which enables faster learning of classifiers and regressors ( Dhillon et al. , 2013 ) , clustering ( Kannan and Vempala , 2009 ) , and interpretable visualizations . Many dimensionality reduction and clustering techniques rely on eigendecomposition at their core including principal component analysis ( Jolliffe , 2002 ) , locally linear embedding ( Roweis and Saul , 2000 ) , multidimensional scaling ( Mead , 1992 ) , Isomap ( Tenenbaum et al. , 2000 ) , and graph spectral clustering ( Von Luxburg , 2007 ) . Numerical solutions to the eigenvalue problem have been approached from a variety of angles for centuries : Jacobi ’ s method , Rayleigh quotient , power ( von Mises ) iteration ( Golub and Van der Vorst , 2000 ) . For large datasets that do not fit in memory , approaches that access only subsets—or minibatches—of the data at a time have been proposed . Recently , EigenGame ( Gemp et al. , 2021 ) was introduced with the novel perspective of viewing the set of eigenvectors as the Nash strategy of a suitably defined game . While this work demonstrated an algorithm that was empirically competitive given access to only subsets of the data , its performance degraded with smaller minibatch sizes , which are required to fit high dimensional data onto devices . One path towards circumventing EigenGame ’ s need for large minibatch sizes is parallelization . In a data parallel approach , updates are computed in parallel on partitions of the data and then combined such that the aggregate update is equivalent to a single large-batch update . The technical obstacle preventing such an approach for EigenGame lies in the bias of its updates , i.e. , the divide-and-conquer EigenGame update is not equivalent to the large-batch update . Biased updates are not just a theoretical nuisance ; they can slow and even prevent convergence to the solution ( made obvious in Figure 4 ) . In this work we introduce a formulation of EigenGame which admits unbiased updates which we term µ-EigenGame . We will refer to the original formulation of EigenGame as α-EigenGame.3 µ-EigenGame and α-EigenGame are contrasted in Figure 1 . Unbiased updates allow us to increase the effective batch size using data parallelism . Lower variance updates mean that µ-EigenGame should converge faster and to more accurate solutions than α-EigenGame regardless of batch size . In Figure 1a ( top ) , the density of the shaded region shows the distribution of steps taken by the stochastic variant of each algorithm after 100 burn-in steps . Although the expected path of α-EG is 3µ signifies unbiased or unloaded and α denotes original . 1The trajectory when updating with E [ X > t Xt ] . 2Overestimation is expected by Jensen ’ s : E [ 1 X ] ≥ 1E [ X ] . slightly more direct , its stochastic variant has much larger variance . Figure 1a ( bottom ) shows that with increasing iterations , the µ-EG trajectory approaches its expected value whereas α-EG exhibits larger bias . Figure 1b further supports µ-EigenGame ’ s reduced bias with details in Sections 3 and 4 . Our contributions : In the rest of the paper , we present our new formulation of EigenGame , analyze its bias and propose a novel unbiased parallel variant , µ-EigenGame with stochastic convergence guarantees . µ-EigenGame ’ s utilities are distinct from α-EigenGame and offer an alternative perspective . We demonstrate its performance with extensive experiments including dimensionality reduction of massive data sets and clustering a large social network graph . We conclude with discussions of the algorithm ’ s design and context within optimization , game theory , and neuroscience . 2 PRELIMINARIES AND RELATED WORK . In this work , we aim to compute the top-k right singular vectors of dataX , which is either represented as a matrix , X ∈ Rn×d , of n d-dimensional samples , or as a d-dimensional random variable . In either case , we assume we can repeatedly sample a minibatch Xt from the data of size n′ < n , Xt ∈ Rn ′×d . The top-k right singular vectors of the dataset are then given by the top-k eigenvectors of the ( sample ) covariance matrix , C = E [ 1n′X > t Xt ] = E [ Ct ] . For small datasets , SVD is appropriate . However , the time , O ( min { nd2 , n2d } ) , and space , O ( nd ) , complexity of SVD prohibit its use for larger datasets ( Shamir , 2015 ) including when X is a random variable . For larger datasets , stochastic , randomized , or sketching algorithms are better suited . Stochastic algorithms such as Oja ’ s algorithm ( Oja , 1982 ; Allen-Zhu and Li , 2017 ) perform power iteration ( Rutishauser , 1971 ) to iteratively improve an approximation , maintaining orthogonality of the eigenvectors typically through repeated QR decompositions . Alternatively , randomized algorithms ( Halko et al. , 2011 ; Sarlos , 2006 ; Cohen et al. , 2017 ) first compute a random projection of the data onto a ( k + p ) -subspace approximately containing the top-k subspace . This is done using techniques similar to Krylov subspace iteration methods ( Musco and Musco , 2015 ) . After projecting , a call to SVD is then made on this reduced-dimensionality data matrix . Sketching algorithms ( Feldman et al. , 2020 ) such as Frequent Directions ( Ghashami et al. , 2016 ) also target learning the top-k subspace by maintaining an overcomplete sketch matrix of size ( k + p ) × d and maintaining a span of the top subspace with repeated calls to SVD . In both the randomized and sketching approaches , a final SVD of the n× ( k + p ) dataset is required to recover the desired singular vectors . Although the SVD scales linearly in n , some datasets are too large to fit in memory ; in this case , an out-of-memory SVD may suffice ( Haidar et al. , 2017 ) . For this reason , the direct approach of stochastic algorithms , which avoid an SVD call altogether , is appealing when processing very large datasets . Algorithm 1 µ-EigenGameR 1 : Given : data stream Xt ∈ Rn ′×d , vectors v̂0i ∈ Sd−1 , step sequence ηt , and iterations T . 2 : v̂i ← v̂0i for all i 3 : for t = 1 : T do 4 : parfor i = 1 : k do 5 : rewards← 1n′X > t Xtv̂i 6 : penalties ← 1 n′ ∑ j < i〈Xtv̂i , Xtv̂j〉v̂j 7 : ∇̃µi ← rewards− penalties 8 : ∇̃µ , Ri ← ∇̃ µ i − 〈∇̃ µ i , v̂i〉v̂i 9 : v̂′i ← v̂i + ηt∇̃ µ , R i 10 : v̂i ← v̂ ′ i ||v̂′i|| 11 : end parfor 12 : end for 13 : return all v̂i A large literature on distributed approaches to PCA exists ( Liang et al. , 2014 ; Garber et al. , 2017 ; Fan et al. , 2019 ) . These typically follow the pattern of computing solutions locally and then aggregating them in a single round ( or minimal rounds ) of communication . The modern distributed machine learning setting which has evolved to meet the needs of deep learning is fundamentally different . Many accelerators joined with fast interconnects means the cost of communication is low compared to the cost of a single update step , however existing approaches to distributed PCA can not take full advantage of this . Notation : We follow the same notation as Gemp et al . ( 2021 ) . Variables returned by an approximation algorithm are distinguished from the true solutions with hats , e.g. , the column-wise matrix of eigenvectors V̂ approximates V . We order the columns of V such that the ith column , vi , is the eigenvector with the ith largest eigenvalue λi . The set of all eigenvectors { vj } with λj larger than λi , namely vi ’ s parents , will be denoted by vj < i . Similarly , sums over subsets of indices may be abbreviated as ∑ j < i = ∑i−1 j=1 . The set of all parents and children of vi are denoted by v−i . Let the ith eigengap gi = λi − λi+1 . We assume the standard Euclidean inner product 〈u , v〉 = u > v and denote the unit-sphere and simplex in ambient space Rd with Sd−1 and ∆d−1 respectively . α-EigenGame . We build on the algorithm introduced by Gemp et al . ( 2021 ) , which we refer to here as α-EigenGame . This algorithm is derived by formulating the eigendecomposition of a symmetric positive definite matrix as the Nash equilibrium of a game among k players , each player i owning the approximate eigenvector v̂i ∈ Sd−1 . Each player is also assigned a utility function , uαi ( v̂i|v̂j < i ) , that they must maximize : uαi ( v̂i|v̂j < i ) = Var︷ ︸︸ ︷ v̂ > i Cv̂i− ∑ j < i Align-penalty︷ ︸︸ ︷ 〈v̂i , Cv̂j〉2 〈v̂j , Cv̂j〉 . ( 1 ) These utilities balance two terms , one that rewards a v̂i that captures more variance in the data and a second term that penalizes v̂i for failing to be orthogonal to each of its parents v̂j < i ( these terms are indicated with Var and Align-penalty in equation ( 1 ) ) . In α-EigenGame , each player simultaneously updates v̂i with gradient ascent , and it is shown that this process converges to the Nash equilibrium . We are interested in extending this approach to the data parallel setting where each player i may distribute its update computation over multiple devices . 3 A SCALABLE UNBIASED ALGORITHM . We present our novel modification to α-EigenGame called µ-EigenGame along with intuition , theory , and empirical support for critical lemmas . We begin with identifying and systematically removing the bias that exists in the α-EigenGame updates . We then explain how removing bias allows us to exploit modern compute architectures culminating in the development of a highly parallelizable algorithm . 3.1 α-EIGENGAME ’ S BIASED UPDATES Consider partitioning the sample covariance matrix Ct into a sum ofmmatrices as Ct = 1n′X > t Xt = 1 m ∑ m m n′X > tmXtm = 1 m ∑ m Ctm . For sake of exposition , we drop the additional subscript t on C in what follows . We would like α-EigenGame to parallelize over these partitions . However , the gradient of uαi with respect to v̂i does not decompose cleanly over the data partitions : ∇αi ∝ Var︷︸︸︷ Cv̂i − ∑ j < i Align-penalty︷ ︸︸ ︷ v̂ > i Cv̂j v > j Cv̂j Cv̂j = 1 m ∑ m [ Cmv̂i − ∑ j < i v̂ > i Cv̂j v̂ > j Cv̂j Cmv̂j ] . ( 2 ) We include the superscript α on the EigenGame gradient to differentiate it from the µ-EigenGame direction later . The nonlinear appearance of C in the penalty terms makes obtaining an unbiased gradient difficult . The quadratic term in the numerator of equation ( 2 ) could be made unbiased by using two sample estimates ofC , one for each term . But the appearance of the term in the denominator does not have an easy solution . Cm is likely singular for small n′ ( n′ < d ) which increases the likelihood of a small denominator , i.e. , a large penalty coefficient ( boxed ) , if we were to estimate the denominator with samples . The result is an update that emphasizes penalizing orthogonality over capturing data variance . Techniques exist to reduce the bias of samples of ratios of random variables , but to our knowledge , techniques to obtain unbiased estimates are not available . This was conjectured by Gemp et al . ( 2021 ) as the reason for why α-EigenGame performed worse with small minibatches . 3.2 REMOVING α-EIGENGAME ’ S BIAS It is helpful to rearrange equation ( 2 ) to shift perspective from estimating a penalty coefficient ( in red ) to estimating a penalty direction ( in blue ) : ∇αi ∝ 1 m ∑ m [ Cmv̂i − ∑ j < i v̂ > i Cmv̂j Cv̂j v̂ > j Cv̂j ] . ( 3 ) The penalty direction in equation ( 3 ) is still difficult to estimate . However , consider the case where v̂j is any eigenvector of C with associated ( unknown ) eigenvalue λ′ . In this case , Cv̂j = λ′v̂j and the penalty direction ( in blue ) simplifies to v̂j because ||v̂j || = 1 . While this assumption is certainly not met at initialization , α-EigenGame leads each v̂j towards vj , so we can expect this assumption to be met asymptotically . This intuition motivates the following µ-EigenGame update direction for v̂i with inexact parents v̂j ( compare orange in equation ( 4 ) to blue in equation ( 3 ) ) : ∆µi = Cv̂i − ∑ j < i ( v̂ > i Cv̂j ) v̂j = 1 m ∑ m [ Cmv̂i − ∑ j < i ( v̂ > i Cmv̂j ) v̂j ] . ( 4 ) We use ∆ instead of ∇ because the direction is not a gradient ( discussed later ) . Notice how the strictly linear appearance of C in µ-EigenGame allows the update to easily decompose over the data partitions in equation ( 4 ) . The µ-EigenGame update satisfies two important properties . Lemma 1 ( Asymptotic equivalence ) . The µ-EigenGame direction , ∆µi , with exact parents ( v̂j = vj ∀ j < i ) is equivalent to α-EigenGame . Proof . We start with α-EigenGame and add a superscript e to its gradient to emphasize this is the gradient computed with exact parents ( v̂j = vj ) . Then simplifying , we find ∇α , ei ∝ Cv̂i − ∑ j < i v̂ > i Cvj v > j Cvj Cvj = Cv̂i − ∑ j < i v̂ > i Cvj v > j λjvj λjvj = Cv̂i − ∑ j < i ( v̂ > i Cvj ) vj = ∆ µ i . ( 5 ) Therefore , once the first ( i − 1 ) eigenvectors are learned , learning the ith eigenvector with µEigenGame is equivalent to learning with α-EigenGame . Lemma 2 ( Zero bias ) . Unbiased estimates of ∆µi can be obtained with samples from p ( X ) . Proof . Let X ∼ p ( X ) where X ∈ Rd and p ( X ) is the uniform distribution over the dataset . Then E [ ∆µi ] = E [ XX > ] v̂i − ∑ j < i ( v̂ > i E [ XX > ] v̂j ) v̂j = Cv̂i − ∑ j < i ( v̂ > i Cv̂j ) v̂j . ( 6 ) where all expectations are with respect to p ( X ) . These two lemmas provide the foundation for a performant algorithm . The first enables convergence to the desired solution , while the second facilitates scaling to larger datasets . Algorithm 1 presents pseudocode for µ-EigenGame where computation is parallelized over the k players . 3.3 MODEL AND DATA PARALLELISM In our setting we have a number of connected devices . Specifically we consider the parallel framework specified by TPUv3 available in Google Cloud , however our setup is applicable to any multi-host , multi-device system . The α-EigenGame formulation ( Gemp et al. , 2021 ) considers an extreme form of model parallelism ( Figure 2a ) where each device has its own unique set of eigenvectors . In this work we further consider a different form of model and data parallelism which is directly enabled by having unbiased updates ( Figure 2b ) . This enables µ-EigenGame to deal with both high-dimensional problems as well as massive sample sizes . Here each set of eigenvectors is copied on M devices . Update directions are computed on each device individually using a different data stream and then combined by summing or averaging . Updates are applied to a sin- gle copy and this is duplicated across theM−1 remaining devices . In this way , updates are computed using an M× larger effective batch size while still allowing device-wise model parallelism . This setting is particularly useful when the number of samples is very large . This form of parallelism is not possible using the original EigenGame formulation since it relies on combining unbiased updates . In this sense , the parallelism discussed in this work generalizes that introduced by Gemp et al . ( 2021 ) . Note that we also allow for within-device parallelism . That is , each vi in Figure 2 is a contiguous collection of eigenvectors which are updated independently , in parallel , on a given device ( for example using vmap in Jax ) . We provide pseudocode in Algorithm 2 in the appendix which simply augments Algorithm 1 with an additional parallelized for-loop and aggregation step over available devices . We also provide detailed Jax pseudo-code for parallel µ-EigenGame in Appendix F. We compare the empirical scaling performance of µ-EigenGame against α-EigenGame on a 14 billion sample dataset in section 5 .
The authors study the problem of finding the top $k$ right singular vectors of a data matrix $X$. They propose a modification of an established game theoretic gradient based algorithm $\alpha$-EigenGame. They observe that the gradients of $\alpha$-EigenGame are biased when implemented stochastically by subsampling the data matrix $X$. Their proposed modification guarantees unbiased updates while converging to the true singular vectors. Their modified updates in combination with their data parallel distrusted algorithm leads to significantly improved convergence rates.
SP:64afac7388471f9ecc2ea9a47befeda6e7fd0703
EigenGame Unloaded: When playing games is better than optimizing
1 INTRODUCTION . Large , high-dimensional datasets containing billions of samples are commonplace . Dimensionality reduction to extract the most informative features is an important step in the data processing pipeline which enables faster learning of classifiers and regressors ( Dhillon et al. , 2013 ) , clustering ( Kannan and Vempala , 2009 ) , and interpretable visualizations . Many dimensionality reduction and clustering techniques rely on eigendecomposition at their core including principal component analysis ( Jolliffe , 2002 ) , locally linear embedding ( Roweis and Saul , 2000 ) , multidimensional scaling ( Mead , 1992 ) , Isomap ( Tenenbaum et al. , 2000 ) , and graph spectral clustering ( Von Luxburg , 2007 ) . Numerical solutions to the eigenvalue problem have been approached from a variety of angles for centuries : Jacobi ’ s method , Rayleigh quotient , power ( von Mises ) iteration ( Golub and Van der Vorst , 2000 ) . For large datasets that do not fit in memory , approaches that access only subsets—or minibatches—of the data at a time have been proposed . Recently , EigenGame ( Gemp et al. , 2021 ) was introduced with the novel perspective of viewing the set of eigenvectors as the Nash strategy of a suitably defined game . While this work demonstrated an algorithm that was empirically competitive given access to only subsets of the data , its performance degraded with smaller minibatch sizes , which are required to fit high dimensional data onto devices . One path towards circumventing EigenGame ’ s need for large minibatch sizes is parallelization . In a data parallel approach , updates are computed in parallel on partitions of the data and then combined such that the aggregate update is equivalent to a single large-batch update . The technical obstacle preventing such an approach for EigenGame lies in the bias of its updates , i.e. , the divide-and-conquer EigenGame update is not equivalent to the large-batch update . Biased updates are not just a theoretical nuisance ; they can slow and even prevent convergence to the solution ( made obvious in Figure 4 ) . In this work we introduce a formulation of EigenGame which admits unbiased updates which we term µ-EigenGame . We will refer to the original formulation of EigenGame as α-EigenGame.3 µ-EigenGame and α-EigenGame are contrasted in Figure 1 . Unbiased updates allow us to increase the effective batch size using data parallelism . Lower variance updates mean that µ-EigenGame should converge faster and to more accurate solutions than α-EigenGame regardless of batch size . In Figure 1a ( top ) , the density of the shaded region shows the distribution of steps taken by the stochastic variant of each algorithm after 100 burn-in steps . Although the expected path of α-EG is 3µ signifies unbiased or unloaded and α denotes original . 1The trajectory when updating with E [ X > t Xt ] . 2Overestimation is expected by Jensen ’ s : E [ 1 X ] ≥ 1E [ X ] . slightly more direct , its stochastic variant has much larger variance . Figure 1a ( bottom ) shows that with increasing iterations , the µ-EG trajectory approaches its expected value whereas α-EG exhibits larger bias . Figure 1b further supports µ-EigenGame ’ s reduced bias with details in Sections 3 and 4 . Our contributions : In the rest of the paper , we present our new formulation of EigenGame , analyze its bias and propose a novel unbiased parallel variant , µ-EigenGame with stochastic convergence guarantees . µ-EigenGame ’ s utilities are distinct from α-EigenGame and offer an alternative perspective . We demonstrate its performance with extensive experiments including dimensionality reduction of massive data sets and clustering a large social network graph . We conclude with discussions of the algorithm ’ s design and context within optimization , game theory , and neuroscience . 2 PRELIMINARIES AND RELATED WORK . In this work , we aim to compute the top-k right singular vectors of dataX , which is either represented as a matrix , X ∈ Rn×d , of n d-dimensional samples , or as a d-dimensional random variable . In either case , we assume we can repeatedly sample a minibatch Xt from the data of size n′ < n , Xt ∈ Rn ′×d . The top-k right singular vectors of the dataset are then given by the top-k eigenvectors of the ( sample ) covariance matrix , C = E [ 1n′X > t Xt ] = E [ Ct ] . For small datasets , SVD is appropriate . However , the time , O ( min { nd2 , n2d } ) , and space , O ( nd ) , complexity of SVD prohibit its use for larger datasets ( Shamir , 2015 ) including when X is a random variable . For larger datasets , stochastic , randomized , or sketching algorithms are better suited . Stochastic algorithms such as Oja ’ s algorithm ( Oja , 1982 ; Allen-Zhu and Li , 2017 ) perform power iteration ( Rutishauser , 1971 ) to iteratively improve an approximation , maintaining orthogonality of the eigenvectors typically through repeated QR decompositions . Alternatively , randomized algorithms ( Halko et al. , 2011 ; Sarlos , 2006 ; Cohen et al. , 2017 ) first compute a random projection of the data onto a ( k + p ) -subspace approximately containing the top-k subspace . This is done using techniques similar to Krylov subspace iteration methods ( Musco and Musco , 2015 ) . After projecting , a call to SVD is then made on this reduced-dimensionality data matrix . Sketching algorithms ( Feldman et al. , 2020 ) such as Frequent Directions ( Ghashami et al. , 2016 ) also target learning the top-k subspace by maintaining an overcomplete sketch matrix of size ( k + p ) × d and maintaining a span of the top subspace with repeated calls to SVD . In both the randomized and sketching approaches , a final SVD of the n× ( k + p ) dataset is required to recover the desired singular vectors . Although the SVD scales linearly in n , some datasets are too large to fit in memory ; in this case , an out-of-memory SVD may suffice ( Haidar et al. , 2017 ) . For this reason , the direct approach of stochastic algorithms , which avoid an SVD call altogether , is appealing when processing very large datasets . Algorithm 1 µ-EigenGameR 1 : Given : data stream Xt ∈ Rn ′×d , vectors v̂0i ∈ Sd−1 , step sequence ηt , and iterations T . 2 : v̂i ← v̂0i for all i 3 : for t = 1 : T do 4 : parfor i = 1 : k do 5 : rewards← 1n′X > t Xtv̂i 6 : penalties ← 1 n′ ∑ j < i〈Xtv̂i , Xtv̂j〉v̂j 7 : ∇̃µi ← rewards− penalties 8 : ∇̃µ , Ri ← ∇̃ µ i − 〈∇̃ µ i , v̂i〉v̂i 9 : v̂′i ← v̂i + ηt∇̃ µ , R i 10 : v̂i ← v̂ ′ i ||v̂′i|| 11 : end parfor 12 : end for 13 : return all v̂i A large literature on distributed approaches to PCA exists ( Liang et al. , 2014 ; Garber et al. , 2017 ; Fan et al. , 2019 ) . These typically follow the pattern of computing solutions locally and then aggregating them in a single round ( or minimal rounds ) of communication . The modern distributed machine learning setting which has evolved to meet the needs of deep learning is fundamentally different . Many accelerators joined with fast interconnects means the cost of communication is low compared to the cost of a single update step , however existing approaches to distributed PCA can not take full advantage of this . Notation : We follow the same notation as Gemp et al . ( 2021 ) . Variables returned by an approximation algorithm are distinguished from the true solutions with hats , e.g. , the column-wise matrix of eigenvectors V̂ approximates V . We order the columns of V such that the ith column , vi , is the eigenvector with the ith largest eigenvalue λi . The set of all eigenvectors { vj } with λj larger than λi , namely vi ’ s parents , will be denoted by vj < i . Similarly , sums over subsets of indices may be abbreviated as ∑ j < i = ∑i−1 j=1 . The set of all parents and children of vi are denoted by v−i . Let the ith eigengap gi = λi − λi+1 . We assume the standard Euclidean inner product 〈u , v〉 = u > v and denote the unit-sphere and simplex in ambient space Rd with Sd−1 and ∆d−1 respectively . α-EigenGame . We build on the algorithm introduced by Gemp et al . ( 2021 ) , which we refer to here as α-EigenGame . This algorithm is derived by formulating the eigendecomposition of a symmetric positive definite matrix as the Nash equilibrium of a game among k players , each player i owning the approximate eigenvector v̂i ∈ Sd−1 . Each player is also assigned a utility function , uαi ( v̂i|v̂j < i ) , that they must maximize : uαi ( v̂i|v̂j < i ) = Var︷ ︸︸ ︷ v̂ > i Cv̂i− ∑ j < i Align-penalty︷ ︸︸ ︷ 〈v̂i , Cv̂j〉2 〈v̂j , Cv̂j〉 . ( 1 ) These utilities balance two terms , one that rewards a v̂i that captures more variance in the data and a second term that penalizes v̂i for failing to be orthogonal to each of its parents v̂j < i ( these terms are indicated with Var and Align-penalty in equation ( 1 ) ) . In α-EigenGame , each player simultaneously updates v̂i with gradient ascent , and it is shown that this process converges to the Nash equilibrium . We are interested in extending this approach to the data parallel setting where each player i may distribute its update computation over multiple devices . 3 A SCALABLE UNBIASED ALGORITHM . We present our novel modification to α-EigenGame called µ-EigenGame along with intuition , theory , and empirical support for critical lemmas . We begin with identifying and systematically removing the bias that exists in the α-EigenGame updates . We then explain how removing bias allows us to exploit modern compute architectures culminating in the development of a highly parallelizable algorithm . 3.1 α-EIGENGAME ’ S BIASED UPDATES Consider partitioning the sample covariance matrix Ct into a sum ofmmatrices as Ct = 1n′X > t Xt = 1 m ∑ m m n′X > tmXtm = 1 m ∑ m Ctm . For sake of exposition , we drop the additional subscript t on C in what follows . We would like α-EigenGame to parallelize over these partitions . However , the gradient of uαi with respect to v̂i does not decompose cleanly over the data partitions : ∇αi ∝ Var︷︸︸︷ Cv̂i − ∑ j < i Align-penalty︷ ︸︸ ︷ v̂ > i Cv̂j v > j Cv̂j Cv̂j = 1 m ∑ m [ Cmv̂i − ∑ j < i v̂ > i Cv̂j v̂ > j Cv̂j Cmv̂j ] . ( 2 ) We include the superscript α on the EigenGame gradient to differentiate it from the µ-EigenGame direction later . The nonlinear appearance of C in the penalty terms makes obtaining an unbiased gradient difficult . The quadratic term in the numerator of equation ( 2 ) could be made unbiased by using two sample estimates ofC , one for each term . But the appearance of the term in the denominator does not have an easy solution . Cm is likely singular for small n′ ( n′ < d ) which increases the likelihood of a small denominator , i.e. , a large penalty coefficient ( boxed ) , if we were to estimate the denominator with samples . The result is an update that emphasizes penalizing orthogonality over capturing data variance . Techniques exist to reduce the bias of samples of ratios of random variables , but to our knowledge , techniques to obtain unbiased estimates are not available . This was conjectured by Gemp et al . ( 2021 ) as the reason for why α-EigenGame performed worse with small minibatches . 3.2 REMOVING α-EIGENGAME ’ S BIAS It is helpful to rearrange equation ( 2 ) to shift perspective from estimating a penalty coefficient ( in red ) to estimating a penalty direction ( in blue ) : ∇αi ∝ 1 m ∑ m [ Cmv̂i − ∑ j < i v̂ > i Cmv̂j Cv̂j v̂ > j Cv̂j ] . ( 3 ) The penalty direction in equation ( 3 ) is still difficult to estimate . However , consider the case where v̂j is any eigenvector of C with associated ( unknown ) eigenvalue λ′ . In this case , Cv̂j = λ′v̂j and the penalty direction ( in blue ) simplifies to v̂j because ||v̂j || = 1 . While this assumption is certainly not met at initialization , α-EigenGame leads each v̂j towards vj , so we can expect this assumption to be met asymptotically . This intuition motivates the following µ-EigenGame update direction for v̂i with inexact parents v̂j ( compare orange in equation ( 4 ) to blue in equation ( 3 ) ) : ∆µi = Cv̂i − ∑ j < i ( v̂ > i Cv̂j ) v̂j = 1 m ∑ m [ Cmv̂i − ∑ j < i ( v̂ > i Cmv̂j ) v̂j ] . ( 4 ) We use ∆ instead of ∇ because the direction is not a gradient ( discussed later ) . Notice how the strictly linear appearance of C in µ-EigenGame allows the update to easily decompose over the data partitions in equation ( 4 ) . The µ-EigenGame update satisfies two important properties . Lemma 1 ( Asymptotic equivalence ) . The µ-EigenGame direction , ∆µi , with exact parents ( v̂j = vj ∀ j < i ) is equivalent to α-EigenGame . Proof . We start with α-EigenGame and add a superscript e to its gradient to emphasize this is the gradient computed with exact parents ( v̂j = vj ) . Then simplifying , we find ∇α , ei ∝ Cv̂i − ∑ j < i v̂ > i Cvj v > j Cvj Cvj = Cv̂i − ∑ j < i v̂ > i Cvj v > j λjvj λjvj = Cv̂i − ∑ j < i ( v̂ > i Cvj ) vj = ∆ µ i . ( 5 ) Therefore , once the first ( i − 1 ) eigenvectors are learned , learning the ith eigenvector with µEigenGame is equivalent to learning with α-EigenGame . Lemma 2 ( Zero bias ) . Unbiased estimates of ∆µi can be obtained with samples from p ( X ) . Proof . Let X ∼ p ( X ) where X ∈ Rd and p ( X ) is the uniform distribution over the dataset . Then E [ ∆µi ] = E [ XX > ] v̂i − ∑ j < i ( v̂ > i E [ XX > ] v̂j ) v̂j = Cv̂i − ∑ j < i ( v̂ > i Cv̂j ) v̂j . ( 6 ) where all expectations are with respect to p ( X ) . These two lemmas provide the foundation for a performant algorithm . The first enables convergence to the desired solution , while the second facilitates scaling to larger datasets . Algorithm 1 presents pseudocode for µ-EigenGame where computation is parallelized over the k players . 3.3 MODEL AND DATA PARALLELISM In our setting we have a number of connected devices . Specifically we consider the parallel framework specified by TPUv3 available in Google Cloud , however our setup is applicable to any multi-host , multi-device system . The α-EigenGame formulation ( Gemp et al. , 2021 ) considers an extreme form of model parallelism ( Figure 2a ) where each device has its own unique set of eigenvectors . In this work we further consider a different form of model and data parallelism which is directly enabled by having unbiased updates ( Figure 2b ) . This enables µ-EigenGame to deal with both high-dimensional problems as well as massive sample sizes . Here each set of eigenvectors is copied on M devices . Update directions are computed on each device individually using a different data stream and then combined by summing or averaging . Updates are applied to a sin- gle copy and this is duplicated across theM−1 remaining devices . In this way , updates are computed using an M× larger effective batch size while still allowing device-wise model parallelism . This setting is particularly useful when the number of samples is very large . This form of parallelism is not possible using the original EigenGame formulation since it relies on combining unbiased updates . In this sense , the parallelism discussed in this work generalizes that introduced by Gemp et al . ( 2021 ) . Note that we also allow for within-device parallelism . That is , each vi in Figure 2 is a contiguous collection of eigenvectors which are updated independently , in parallel , on a given device ( for example using vmap in Jax ) . We provide pseudocode in Algorithm 2 in the appendix which simply augments Algorithm 1 with an additional parallelized for-loop and aggregation step over available devices . We also provide detailed Jax pseudo-code for parallel µ-EigenGame in Appendix F. We compare the empirical scaling performance of µ-EigenGame against α-EigenGame on a 14 billion sample dataset in section 5 .
The paper considers PCA problem from a game-theoretic view and propose a novel algorithm ($\mu$-EigenGame) with stochastic convergence guarantees. The proposed method introduces an unbiased update which allows greater parallelism over data. The empirical results show that $\mu$-EigenGame outperforms its predecessor $\alpha$-EigenGame.
SP:64afac7388471f9ecc2ea9a47befeda6e7fd0703
Reversible Instance Normalization for Accurate Time-Series Forecasting against Distribution Shift
1 INTRODUCTION . Time-series forecasting plays a significant role in various daily problems such as health care , economics , and traffic engineering ( Che et al. , 2018 ; Bauer et al. , 2016 ; Zhang et al. , 2017 ) . Recently , time-series forecasting models have achieved comparative performance on these problems by overcoming several challenges , e.g. , long-term forecasting ( Zhou et al. , 2021 ) and missing value im- putation ( Tang et al. , 2020 ) . However , these time-series forecasting models often severely suffer from statistical properties that change over time , which is also widely known as a distribution shift problem ; for example , the mean and variance of the time-series data distribution vary over time . Accordingly , the input sequences to the forecasting models have different underlying distributions from each other . In the case of the train and test data , they are usually divided into data before and after a specific point in time . Thus , the distributions of the two data often hardly overlap , which is commonly known as the reason for model performance degradation . Thus , we assume that if we normalize every sequence in the data to have identical mean and variance and provide the transformed data to the model , the discrepancy in the distribution will be reduced , thereby improving the model performance . However , if the input to the model is shifted and scaled , the prediction of the model can be shifted and scaled as much as the input ; since this will differ from the groundtruth distribution , the accuracy of the model will decrease . Also , we further hypothesize that if the model output , shifted and scaled , can be returned to its original distribution explicitly , we can alleviate the discrepancy in the distribution of the data during the forward pass of the model as well as allow its prediction to obey the original distribution . Here , reconstructing the original distribution can be achieved by applying denormalization on the output of the model as a reversed function of the normalization applied on the input data . Inspired by these , we propose a simple yet effective normalization method , reversible instance normalization ( RevIN ) , which first normalizes the input sequences and then denormalizes the model output sequences to solve the time-series forecasting task against the distribution shift problem . RevIN is symmetrically structured to return the model output to the original distribution in the denormalization layer by scaling and shifting the model output as much as the input data is shifted and scaled in the normalization layer . Adding only the normalization and denormalization layers on the input and output of the model , respectively , RevIN can be applied to any model without modification to the model architecture . We empirically found that RevIN effectively alleviates the distribution discrepancy within the data , as well as significantly improves the model performance when applied to various state-of-the-art time-series forecasting methods . To verify the effectiveness of RevIN , we conduct extensive quantitative evaluations with various baselines : Informer ( Zhou et al. , 2021 ) , N-BEATS ( Oreshkin et al. , 2020 ) , and SCINet ( Liu et al. , 2021 ) . We also present an in-depth analysis of the behavior of the model , including the verification of the assumptions on reversible instance normalization ( See Section 3.2 ) . RevIN is a flexible , end-to-end trainable layer that can be applied to any arbitrarily chosen layers , effectively suppressing non-stationary information ( mean and standard deviation of the instance ) from one layer and restoring it on the other layer at a virtually symmetric position . Despite its remarkable performance , there has been no work on generalizing and expanding the instance-wise normalization-and-denormalization as a flexibly applicable , trainable layer in the time-series domain . Recently , deep learning-based time-series forecasting approaches , such as Informer ( Zhou et al. , 2021 ) and N-BEATS ( Oreshkin et al. , 2020 ) , have shown outstanding performance in timeseries forecasting . However , they overlooked the importance of normalization , merely using simple global preprocessing to the model input without further exploration and expecting their endto-end deep learning model to replace the role . Despite the simplicity of our method , there have been no cases of using such techniques in modern deep-learning-based time-series forecasting approaches ( Zhou et al. , 2021 ; Liu et al. , 2021 ; Oreshkin et al. , 2020 ) . In this sense , we enlight the importance of the appropriate normalization method in deep-learning-based time-series approaches ; we propose a carefully designed , deep-learning-friendly module , for time-series forecasting , by combining the learnable affine transformation with the method , which has been widely accepted in recent deep-learning-based normalization work ( Ulyanov et al. , 2016 ) . In summary , our contributions are as follows : • We propose a simple and effective normalization-and-denormalization method for timeseries , called RevIN , symmetrically structured to remove and restore the statistical information of a time-series instance ; it is a generally-applicable layer to arbitrary deep neural networks with negligible cost and significantly improves the performance by reducing the distribution discrepancy within the data . • By adding RevIN to the baseline , we achieve the state-of-the-art performance on four largescale real-world datasets with a significant margin . • We conduct extensive evaluations on RevIN with quantitative analysis and qualitative visualizations to verify its effectiveness , addressing the distribution shift problem . 2 RELATED WORK . Time-series forecasting . Time-series forecasting methods are mainly categorized into three distinct approaches : ( 1 ) statistical methods , ( 2 ) hybrid methods , and ( 3 ) deep learning-based methods . As an example of the statistical models , exponential smoothing forecasting ( Holt , 2004 ; Winters , 1960 ) is a well-established benchmark to predict future values . Statistical models have several advantages , e.g. , interpretability and theoretically well guaranteed . In order to boost the performance , recent work proposed a hybrid model ( Smyl , 2020 ) which incorporates a deep learning module with a statistical model . It achieved better performance over the statistical methods in the M4 timeseries forecasting competition . The deep learning-based method basically follows the sequenceto-sequence framework to model the time-series forecasting . Initially , deep learning-based models utilized variations of recurrent neural networks ( RNNs ) . However , to overcome the limitation of the limited receptive field , several studies utilize advanced techniques , such as the dilatation and attention module . For instance , SCINet ( Liu et al. , 2021 ) and Informer ( Zhou et al. , 2021 ) modified the sequence-to-sequence-based model to improve the performance for long sequences . However , most previous deep learning-based models are hard to interpret compared to statistical models . Thus , inspired by statistical models , N-BEATS ( Oreshkin et al. , 2020 ) designed an interpretable layer for time-series forecasting by encouraging the model to explicitly learn trend , seasonality , and residual components . This model shows superior performance on M4 competition datasets . Distribution shift . Although there are various models for time-series forecasting , they often suffer from non-stationary time-series , where the data distribution changes over time . Domain adaptation ( DA ) ( Tzeng et al. , 2017 ; Ganin et al. , 2016 ; Wang et al. , 2018 ) and domain generalization ( DG ) ( Wang et al. , 2021 ; Li et al. , 2018 ; Muandet et al. , 2013 ) are common solutions for alleviating the distribution shift . A domain adaptation algorithm attempts to reduce the distribution gap between source and target domains . A domain generalization algorithm only relies on the source domain and hopes to generalize on the target domain . Both DA and DG have a common objective that bridges the gap between source and target distributions . However , in non-stationary time-series , defining a domain is not as straightforward since the data distribution shifts over time . Recently , Du et al . ( Du et al. , 2021 ) proposed Adaptive RNNs ( AdaRNNs ) to handle the distribution shift problems for non-stationary time-series data . It first characterizes the distribution information by splitting the training data into periods . Then , it matches distributions of the discovered periods to generalize the model . However , unlike AdaRNNs that are costly expensive , RevIN is simple yet effective and model-agnostic since the method can be adopted easily to any deep-learning model . 3 PROPOSED METHOD . In this section , we propose reversible instance normalization ( RevIN ) for alleviating the distribution shift problem in time-series , which causes the discrepancy among the input sequences of the training data , as well as the discrepancy between train and test data distributions . Section 3.1 describes RevIN in detail and Section 3.2 discusses how RevIN alleviates the distribution discrepancy in time-series throughout qualitative visualization . 3.1 REVERSIBLE INSTANCE NORMALIZATION . We consider the multivariate time-series forecasting task in discrete time , with a sliding window size of Tx for input data . Here , N , K , Tx , and Ty indicate the number of the sequences , the number of variables , the input sequence length , and the prediction length . Let X = { x ( i ) } Ni=1 and Y = { y ( i ) } Ni=1 denote the input data and corresponding target , respectively . In RevIN , the input sequence length Tx and the prediction length Ty can be different since the observations are normalized and denormalized across the temporal dimension , as will be explained below . Given an input sequence x ( i ) ∈ RK×Tx , we aim to solve the time-series forecasting problem , which is to predict the subsequent values y ( i ) ∈ RK×Ty . Our proposed method , RevIN , symmetrically transforms the input data x ( i ) and the prediction output ỹ ( i ) of the network , as illustrated in Fig . 2 . First , we normalize the input data x ( i ) with the instance-specific mean and standard deviation , which is widely accepted as instance normalization ( Ulyanov et al. , 2016 ) . The mean and standard deviation are computed for every instance x ( i ) k· of the input data ( Fig . 2 ( a-3 ) ) as Et [ x ( i ) kt ] = 1 Tx Tx∑ j=1 x ( i ) kj and Var [ x ( i ) kt ] = 1 Tx Tx∑ j=1 ( x ( i ) kj − Et [ x ( i ) kt ] ) 2 . ( 1 ) Using these statistics , we normalize the input data x ( i ) as ( Fig . 2 ( a-1 ) ) x̂ ( i ) kt = γk ( x ( i ) kt − Et [ x ( i ) kt ] √ Var [ x ( i ) kt ] + ) + βk , ( 2 ) where γ , β ∈ RK are learnable affine parameter vectors . The normalized sequences have the same mean and variance , where the non-stationary information is reduced . As a result , the denormalization layer allows the model to accurately predict the local dynamics within the sequence while receiving inputs of consistent distributions in terms of the mean and variance . The model then receives the transformed data x̂ ( i ) as input and forecasts their future values . However , the input data have different statistics from the original distribution , and only observing the normalized input x̂ ( i ) , it is difficult to capture the original distribution of the input x ( i ) . Thus , to make this easier for the model , we explicitly restore the non-stationary properties removed from the input data to the model output by reversing the normalization step ( Fig . 2 ( a-3 ) ) . Such denormalization step can return the model output to the original time-series value as well ( Ogasawara et al. , 2010 ) . Accordingly , we denormalize the model output ỹ ( i ) by applying the reciprocal of the normalization in Eq . 2 ( Fig . 2 ( a-2 ) ) as ŷ ( i ) kt = √ Var [ x ( i ) kt ] + · ( ỹ ( i ) kt − β γ ) + Et [ x ( i ) kt ] , ( 3 ) where the same statistics used in the normalization step in Eq . ( 2 ) are used for the scaling and shifting . Now , ŷ ( i ) is the final prediction of the model instead of ỹ ( i ) . Simply added to the input and output of a network , RevIN can be easily applied to any network with negligible cost while effectively improving time-series forecasting performance . Additionally , each step of RevIN , normalization and denormalization , can be applied to any activations of the intermediate layers in the network . However , our method is most effective when applied to the layers of symmetric encoder-decoder structure . In a typical time-series forecasting model , the boundary between the encoder and the decoder is often unclear . Therefore , we apply normalization and denormalization to the input and output of a forecasting network , which can be interpreted as an encoderdecoder structure , generating subsequent values given input data . Additional analysis on selecting layers to apply RevIN is provided in Section 4.2.3 .
This work proposes to use a normalization method to address temporal distribution shift in time-series forecasting. The proposed approach, *RevIN*, consists of two steps: instance normalization on input sequences and "de-normalization" of output sequences by re-using statistics (mean and variance) computed during the normalization step. Experiments are conducted on two time-series datasets (ETT and ECL) with varying splits and prediction windows lengths. Results show that RevIN used on top of deep-learning based methods for time-series forecasting (Informer, N-BEATS and SCINet) improves prediction performances, in particular for long sequence prediction. Finally, they conduct an empirical comparison with other normalization methods, such as batch normalization and min-max normalization, to evaluate the adequateness of instance normalization and of the denormalization step.
SP:549b4b2a88e8b13656ee6bd9425fe1d2be77b334